text: /**
   * Cesium - https://github.com/AnalyticalGraphicsInc/cesium
   *
   * Copyright 2011-2015 Cesium Contributors
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *
   * Columbus View (Pat. Pend.)
   *
   * Portions licensed separately.
   * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
   */
  /**
  @license
  mersenne-twister.js - https://gist.github.com/banksean/300494
  
     Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
     All rights reserved.
  
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
     are met:
  
       1. Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
  
       2. Redistributions in binary form must reproduce the above copyright
          notice, this list of conditions and the following disclaimer in the
          documentation and/or other materials provided with the distribution.
  
       3. The names of its contributors may not be used to endorse or promote
          products derived from this software without specific prior written
          permission.
  
     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
     LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
  
  !function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};r.EPSILON1=.1,r.EPSILON2=.01,r.EPSILON3=.001,r.EPSILON4=1e-4,r.EPSILON5=1e-5,r.EPSILON6=1e-6,r.EPSILON7=1e-7,r.EPSILON8=1e-8,r.EPSILON9=1e-9,r.EPSILON10=1e-10,r.EPSILON11=1e-11,r.EPSILON12=1e-12,r.EPSILON13=1e-13,r.EPSILON14=1e-14,r.EPSILON15=1e-15,r.EPSILON16=1e-16,r.EPSILON17=1e-17,r.EPSILON18=1e-18,r.EPSILON19=1e-19,r.EPSILON20=1e-20,r.GRAVITATIONALPARAMETER=3986004418e5,r.SOLAR_RADIUS=6955e5,r.LUNAR_RADIUS=1737400,r.SIXTY_FOUR_KILOBYTES=65536,r.sign=function(e){return e>0?1:0>e?-1:0},r.signNotZero=function(e){return 0>e?-1:1},r.toSNorm=function(e){return Math.round(255*(.5*r.clamp(e,-1,1)+.5))},r.fromSNorm=function(e){return 2*(r.clamp(e,0,255)/255)-1},r.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},r.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},r.lerp=function(e,t,r){return(1-r)*e+r*t},r.PI=Math.PI,r.ONE_OVER_PI=1/Math.PI,r.PI_OVER_TWO=.5*Math.PI,r.PI_OVER_THREE=Math.PI/3,r.PI_OVER_FOUR=Math.PI/4,r.PI_OVER_SIX=Math.PI/6,r.THREE_PI_OVER_TWO=.5*3*Math.PI,r.TWO_PI=2*Math.PI,r.ONE_OVER_TWO_PI=1/(2*Math.PI),r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.RADIANS_PER_ARCSECOND=r.RADIANS_PER_DEGREE/3600,r.toRadians=function(e){return e*r.RADIANS_PER_DEGREE},r.toDegrees=function(e){return e*r.DEGREES_PER_RADIAN},r.convertLongitudeRange=function(e){var t=r.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},r.negativePiToPi=function(e){return r.zeroToTwoPi(e+r.PI)-r.PI},r.zeroToTwoPi=function(e){var t=r.mod(e,r.TWO_PI);return Math.abs(t)<r.EPSILON14&&Math.abs(e)>r.EPSILON14?r.TWO_PI:t},r.mod=function(e,t){return(e%t+t)%t},r.equalsEpsilon=function(e,r,n,o){o=t(o,n);var i=Math.abs(e-r);return o>=i||i<=n*Math.max(Math.abs(e),Math.abs(r))};var n=[1];r.factorial=function(e){var t=n.length;if(e>=t)for(var r=n[t-1],o=t;e>=o;o++)n.push(r*o);return n[e]},r.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},r.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},r.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},r.clamp=function(e,t,r){return t>e?t:e>r?r:e};var o=new e;return r.setRandomNumberSeed=function(t){o=new e(t)},r.nextRandomNumber=function(){return o.random()},r.acosClamped=function(e){return Math.acos(r.clamp(e,-1,1))},r.asinClamped=function(e){return Math.asin(r.clamp(e,-1,1))},r.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},r}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var i=function(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)};i.fromSpherical=function(r,n){t(n)||(n=new i);var o=r.clock,a=r.cone,s=e(r.magnitude,1),u=s*Math.sin(a);return n.x=u*Math.cos(o),n.y=u*Math.sin(o),n.z=s*Math.cos(a),n},i.fromElements=function(e,r,n,o){return t(o)?(o.x=e,o.y=r,o.z=n,o):new i(e,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.x=r[n++],o.y=r[n++],o.z=r[n],o},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},i.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},i.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},i.distanceSquared=function(e,t){return i.subtract(e,t,a),i.magnitudeSquared(a)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},i.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},i.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},i.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,s),n=i.multiplyByScalar(e,1-r,n),i.add(s,n,n)};var u=new i,c=new i;i.angleBetween=function(e,t){i.normalize(e,u),i.normalize(t,c);var r=i.dot(u,c),n=i.magnitude(i.cross(u,c,u));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);return i.abs(r,r),t=r.x<=r.y?r.x<=r.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):r.y<=r.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,t)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&o.equalsEpsilon(e.x,r.x,n,i)&&o.equalsEpsilon(e.y,r.y,n,i)&&o.equalsEpsilon(e.z,r.z,n,i)},i.cross=function(e,t,r){var n=e.x,o=e.y,i=e.z,a=t.x,s=t.y,u=t.z,c=o*u-i*s,l=i*a-n*u,f=n*s-o*a;return r.x=c,r.y=l,r.z=f,r},i.fromDegrees=function(e,t,r,n,a){var s=o.toRadians(e),u=o.toRadians(t);return i.fromRadians(s,u,r,n,a)};var f=new i,m=new i,h=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(r,n,o,a,s){o=e(o,0);var u=t(a)?a.radiiSquared:h,c=Math.cos(n);f.x=c*Math.cos(r),f.y=c*Math.sin(r),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(u,f,m);var l=Math.sqrt(i.dot(f,m));return m=i.divideByScalar(m,l,m),f=i.multiplyByScalar(f,o,f),t(s)||(s=new i),i.add(m,f,s)},i.fromDegreesArray=function(e,t,r){for(var n=new Array(e.length),a=0;a<e.length;a++)n[a]=o.toRadians(e[a]);return i.fromRadiansArray(n,t,r)},i.fromRadiansArray=function(e,r,n){var o=e.length;t(n)?n.length=o/2:n=new Array(o/2);for(var a=0;o>a;a+=2){var s=e[a],u=e[a+1];n[a/2]=i.fromRadians(s,u,0,r,n[a/2])}return n},i.fromDegreesArrayHeights=function(e,t,r){for(var n=new Array(e.length),a=0;a<e.length;a+=3)n[a]=o.toRadians(e[a]),n[a+1]=o.toRadians(e[a+1]),n[a+2]=e[a+2];return i.fromRadiansArrayHeights(n,t,r)},i.fromRadiansArrayHeights=function(e,r,n){var o=e.length;t(n)?n.length=o/3:n=new Array(o/3);for(var a=0;o>a;a+=3){var s=e[a],u=e[a+1],c=e[a+2];n[a/3]=i.fromRadians(s,u,c,r,n[a/3])}return n},i.ZERO=n(new i(0,0,0)),i.UNIT_X=n(new i(1,0,0)),i.UNIT_Y=n(new i(0,1,0)),i.UNIT_Z=n(new i(0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var i=function(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)};return i.fromRadians=function(r,n,o,a){return o=e(o,0),t(a)?(a.longitude=r,a.latitude=n,a.height=o,a):new i(r,n,o)},i.fromDegrees=function(e,t,r,n){return e=o.toRadians(e),t=o.toRadians(t),i.fromRadians(e,t,r,n)},i.clone=function(e,r){return t(e)?t(r)?(r.longitude=e.longitude,r.latitude=e.latitude,r.height=e.height,r):new i(e.longitude,e.latitude,e.height):void 0},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.longitude===r.longitude&&e.latitude===r.latitude&&e.height===r.height},i.equalsEpsilon=function(e,r,n){return e===r||t(e)&&t(r)&&Math.abs(e.longitude-r.longitude)<=n&&Math.abs(e.latitude-r.latitude)<=n&&Math.abs(e.height-r.height)<=n},i.ZERO=n(new i(0,0,0)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},i}),define("Core/deprecationWarning",["./defined","./DeveloperError"],function(e){"use strict";var t={},r=function(r,n){e(t[r])||(t[r]=!0,console.log(n))};return r}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o,i,a,s){"use strict";function u(t,n,o,i){n=r(n,0),o=r(o,0),i=r(i,0),t._radii=new e(n,o,i),t._radiiSquared=new e(n*n,o*o,i*i),t._radiiToTheFourth=new e(n*n*n*n,o*o*o*o,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===o?0:1/o,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===o?0:1/(o*o),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,o,i),t._maximumRadius=Math.max(n,o,i),t._centerToleranceSquared=s.EPSILON1}var c=function(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,u(this,e,t,r)};o(c.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}}}),c.clone=function(t,r){if(!n(t))return void 0;var o=t._radii;return n(r)?(e.clone(o,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new c(o.x,o.y,o.z)},c.fromCartesian3=function(e,t){return n(t)||(t=new c),n(e)?(u(t,e.x,e.y,e.z),t):t},c.WGS84=a(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=a(new c(1,1,1)),c.MOON=a(new c(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,n,o){o=r(o,0),e.pack(t._radii,n,o)},c.unpack=function(t,n,o){n=r(n,0);var i=e.unpack(t,n);return c.fromCartesian3(i,o)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,r){var o=t.longitude,i=t.latitude,a=Math.cos(i),s=a*Math.cos(o),u=a*Math.sin(o),c=Math.sin(i);return n(r)||(r=new e),r.x=s,r.y=u,r.z=c,e.normalize(r,r)},c.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var l=new e,f=new e;c.prototype.cartographicToCartesian=function(t,r){var o=l,i=f;this.geodeticSurfaceNormalCartographic(t,o),e.multiplyComponents(this._radiiSquared,o,i);var a=Math.sqrt(e.dot(o,i));return e.divideByScalar(i,a,i),e.multiplyByScalar(o,t.height,o),n(r)||(r=new e),e.add(i,o,r)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var o=0;r>o;o++)t[o]=this.cartographicToCartesian(e[o],t[o]);return t};var m=new e,h=new e,d=new e;c.prototype.cartesianToCartographic=function(r,o){var i=this.scaleToGeodeticSurface(r,h);if(!n(i))return void 0;var a=this.geodeticSurfaceNormal(i,m),u=e.subtract(r,i,d),c=Math.atan2(a.y,a.x),l=Math.asin(a.z),f=s.sign(e.dot(u,r))*e.magnitude(u);return n(o)?(o.longitude=c,o.latitude=l,o.height=f,o):new t(c,l,f)},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var o=0;r>o;++o)t[o]=this.cartesianToCartographic(e[o],t[o]);return t};var E=new e,p=new e;return c.prototype.scaleToGeodeticSurface=function(t,r){var o=t.x,i=t.y,a=t.z,u=this._oneOverRadii,c=u.x,l=u.y,f=u.z,m=o*o*c*c,h=i*i*l*l,d=a*a*f*f,y=m+h+d,v=Math.sqrt(1/y),T=e.multiplyByScalar(t,v,E);if(y<this._centerToleranceSquared)return isFinite(v)?e.clone(T,r):void 0;var g=this._oneOverRadiiSquared,S=g.x,A=g.y,C=g.z,R=p;R.x=2*T.x*S,R.y=2*T.y*A,R.z=2*T.z*C;var I,N,_,O,M,w,L,b,x,P,F,D=(1-v)*e.magnitude(t)/(.5*e.magnitude(R)),U=0;do{D-=U,_=1/(1+D*S),O=1/(1+D*A),M=1/(1+D*C),w=_*_,L=O*O,b=M*M,x=w*_,P=L*O,F=b*M,I=m*w+h*L+d*b-1,N=m*x*S+h*P*A+d*F*C;var B=-2*N;U=I/B}while(Math.abs(I)>s.EPSILON12);return n(r)?(r.x=o*_,r.y=i*O,r.z=a*M,r):new e(o*_,i*O,a*M)},c.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var o=t.x,i=t.y,a=t.z,s=this._oneOverRadiiSquared,u=1/Math.sqrt(o*o*s.x+i*i*s.y+a*a*s.z);return e.multiplyByScalar(t,u,r)},c.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,o,i,a){"use strict";var s=function(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,r){var o=this._semimajorAxis,i=t.longitude*o,a=t.latitude*o,s=t.height;return n(r)?(r.x=i,r.y=a,r.z=s,r):new e(i,a,s)},s.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,i=e.x*o,a=e.y*o,s=e.z;return n(r)?(r.longitude=i,r.latitude=a,r.height=s,r):new t(i,a,s)},s}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";var t=function(t,r){this.start=e(t,0),this.stop=e(r,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var i=function(t,r,n,o){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(o,0)};i.fromElements=function(e,r,n,o,a){return t(a)?(a.x=e,a.y=r,a.z=n,a.w=o,a):new i(e,r,n,o)},i.fromColor=function(e,r){return t(r)?(r.x=e.red,r.y=e.green,r.z=e.blue,r.w=e.alpha,r):new i(e.red,e.green,e.blue,e.alpha)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r):new i(e.x,e.y,e.z,e.w):void 0},i.packedLength=4,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.x=r[n++],o.y=r[n++],o.z=r[n++],o.w=r[n],o},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},i.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},i.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},i.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},i.distanceSquared=function(e,t){return i.subtract(e,t,a),i.magnitudeSquared(a)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},i.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},i.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},i.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,s),n=i.multiplyByScalar(e,1-r,n),i.add(s,n,n)};var u=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,u);return i.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_W,t):r.z<=r.w?i.clone(i.UNIT_Z,t):i.clone(i.UNIT_W,t)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y&&e.z===r.z&&e.w===r.w},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&o.equalsEpsilon(e.x,r.x,n,i)&&o.equalsEpsilon(e.y,r.y,n,i)&&o.equalsEpsilon(e.z,r.z,n,i)&&o.equalsEpsilon(e.w,r.w,n,i)},i.ZERO=n(new i(0,0,0,0)),i.UNIT_X=n(new i(1,0,0,0)),i.UNIT_Y=n(new i(0,1,0,0)),i.UNIT_Z=n(new i(0,0,1,0)),i.UNIT_W=n(new i(0,0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o,i){"use strict";function a(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function s(e){for(var t=0,r=0;3>r;++r){var n=e[c.getElementIndex(h[r],m[r])];t+=2*n*n}return Math.sqrt(t)}function u(e,t){for(var r=i.EPSILON15,n=0,o=1,a=0;3>a;++a){var s=Math.abs(e[c.getElementIndex(h[a],m[a])]);s>n&&(o=a,n=s)}var u=1,l=0,f=m[o],d=h[o];if(Math.abs(e[c.getElementIndex(d,f)])>r){var E,p=e[c.getElementIndex(d,d)],y=e[c.getElementIndex(f,f)],v=e[c.getElementIndex(d,f)],T=(p-y)/2/v;E=0>T?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),u=1/Math.sqrt(1+E*E),l=E*u}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(f,f)]=t[c.getElementIndex(d,d)]=u,t[c.getElementIndex(d,f)]=l,t[c.getElementIndex(f,d)]=-l,t}var c=function(e,r,n,o,i,a,s,u,c){this[0]=t(e,0),this[1]=t(o,0),this[2]=t(s,0),this[3]=t(r,0),this[4]=t(i,0),this[5]=t(u,0),this[6]=t(n,0),this[7]=t(a,0),this[8]=t(c,0)};c.packedLength=9,c.pack=function(e,r,n){n=t(n,0),r[n++]=e[0],r[n++]=e[1],r[n++]=e[2],r[n++]=e[3],r[n++]=e[4],r[n++]=e[5],r[n++]=e[6],r[n++]=e[7],r[n++]=e[8]},c.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new c),o[0]=e[n++],o[1]=e[n++],o[2]=e[n++],o[3]=e[n++],o[4]=e[n++],o[5]=e[n++],o[6]=e[n++],o[7]=e[n++],o[8]=e[n++],o},c.clone=function(e,t){return r(e)?r(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 c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,n,o){return n=t(n,0),r(o)||(o=new c),o[0]=e[n],o[1]=e[n+1],o[2]=e[n+2],o[3]=e[n+3],o[4]=e[n+4],o[5]=e[n+5],o[6]=e[n+6],o[7]=e[n+7],o[8]=e[n+8],o},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(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 c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var n=e.x*e.x,o=e.x*e.y,i=e.x*e.z,a=e.x*e.w,s=e.y*e.y,u=e.y*e.z,l=e.y*e.w,f=e.z*e.z,m=e.z*e.w,h=e.w*e.w,d=n-s-f+h,E=2*(o-m),p=2*(i+l),y=2*(o+m),v=-n+s-f+h,T=2*(u-a),g=2*(i-l),S=2*(u+a),A=-n-s+f+h;return r(t)?(t[0]=d,t[1]=y,t[2]=g,t[3]=E,t[4]=v,t[5]=S,t[6]=p,t[7]=T,t[8]=A,t):new c(d,E,p,y,v,T,g,S,A)},c.fromScale=function(e,t){return r(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 c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return r(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 c(e,0,0,0,e,0,0,0,e)},c.fromCrossProduct=function(e,t){return r(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 c(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},c.fromRotationX=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=o,t[6]=0,t[7]=-o,t[8]=n,t):new c(1,0,0,0,n,-o,0,o,n)},c.fromRotationY=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-o,t[3]=0,t[4]=1,t[5]=0,t[6]=o,t[7]=0,t[8]=n,t):new c(n,0,o,0,1,0,-o,0,n)},c.fromRotationZ=function(e,t){var n=Math.cos(e),o=Math.sin(e);return r(t)?(t[0]=n,t[1]=o,t[2]=0,t[3]=-o,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new c(n,-o,0,o,n,0,0,0,1)},c.toArray=function(e,t){return r(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]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(e,t,r){var n=3*t,o=e[n],i=e[n+1],a=e[n+2];return r.x=o,r.y=i,r.z=a,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var o=3*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n},c.getRow=function(e,t,r){var n=e[t],o=e[t+3],i=e[t+6];return r.x=n,r.y=o,r.z=i,r},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var l=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=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],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],u=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],l=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]=o,r[2]=i,r[3]=a,r[4]=s,r[5]=u,r[6]=c,r[7]=l,r[8]=f,r},c.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},c.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},c.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=e[0]*n+e[3]*o+e[6]*i,s=e[1]*n+e[4]*o+e[7]*i,u=e[2]*n+e[5]*o+e[8]*i;return r.x=a,r.y=s,r.z=u,r},c.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},c.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},c.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},c.transpose=function(e,t){var r=e[0],n=e[3],o=e[6],i=e[1],a=e[4],s=e[7],u=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=o,t[3]=i,t[4]=a,t[5]=s,t[6]=u,t[7]=c,t[8]=l,t};var m=[1,0,0],h=[2,2,1],d=new c,E=new c;return c.computeEigenDecomposition=function(e,t){var n=i.EPSILON20,o=10,l=0,f=0;r(t)||(t={});for(var m=t.unitary=c.clone(c.IDENTITY,t.unitary),h=t.diagonal=c.clone(e,t.diagonal),p=n*a(h);o>f&&s(h)>p;)u(h,d),c.transpose(d,E),c.multiply(h,d,h),c.multiply(E,h,h),c.multiply(m,d,m),++l>2&&(++f,l=0);return t},c.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},c.determinant=function(e){var t=e[0],r=e[3],n=e[6],o=e[1],i=e[4],a=e[7],s=e[2],u=e[5],c=e[8];return t*(i*c-u*a)+o*(u*n-r*c)+s*(r*a-i*n)},c.inverse=function(e,t){var r=e[0],o=e[1],a=e[2],s=e[3],u=e[4],l=e[5],f=e[6],m=e[7],h=e[8],d=c.determinant(e);if(Math.abs(d)<=i.EPSILON15)throw new n("matrix is not invertible");t[0]=u*h-m*l,t[1]=m*a-o*h,t[2]=o*l-u*a,t[3]=f*l-s*h,t[4]=r*h-f*a,t[5]=s*a-r*l,t[6]=s*m-f*u,t[7]=f*o-r*m,t[8]=r*u-s*o;var E=1/d;return c.multiplyByScalar(t,E,t)},c.equals=function(e,t){return e===t||r(e)&&r(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]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},c.IDENTITY=o(new c(1,0,0,0,1,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,o,i,a,s,u){"use strict";var c=function(e,t,n,o,i,a,s,u,c,l,f,m,h,d,E,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(a,0),this[6]=r(l,0),this[7]=r(d,0),this[8]=r(n,0),this[9]=r(s,0),this[10]=r(f,0),this[11]=r(E,0),this[12]=r(o,0),this[13]=r(u,0),this[14]=r(m,0),this[15]=r(p,0)};c.packedLength=16,c.pack=function(e,t,n){n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15]},c.unpack=function(e,t,o){return t=r(t,0),n(o)||(o=new c),o[0]=e[t++],o[1]=e[t++],o[2]=e[t++],o[3]=e[t++],o[4]=e[t++],o[5]=e[t++],o[6]=e[t++],o[7]=e[t++],o[8]=e[t++],o[9]=e[t++],o[10]=e[t++],o[11]=e[t++],o[12]=e[t++],o[13]=e[t++],o[14]=e[t++],o[15]=e[t],o},c.clone=function(e,t){return n(e)?n(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 c(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]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return n(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 c(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])},c.fromRotationTranslation=function(t,o,i){return o=r(o,e.ZERO),n(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=o.x,i[13]=o.y,i[14]=o.z,i[15]=1,i):new c(t[0],t[3],t[6],o.x,t[1],t[4],t[7],o.y,t[2],t[5],t[8],o.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,r,o){n(o)||(o=new c);var i=r.x,a=r.y,s=r.z,u=t.x*t.x,l=t.x*t.y,f=t.x*t.z,m=t.x*t.w,h=t.y*t.y,d=t.y*t.z,E=t.y*t.w,p=t.z*t.z,y=t.z*t.w,v=t.w*t.w,T=u-h-p+v,g=2*(l-y),S=2*(f+E),A=2*(l+y),C=-u+h-p+v,R=2*(d-m),I=2*(f-E),N=2*(d+m),_=-u-h+p+v;return o[0]=T*i,o[1]=A*i,o[2]=I*i,o[3]=0,o[4]=g*a,o[5]=C*a,o[6]=N*a,o[7]=0,o[8]=S*s,o[9]=R*s,o[10]=_*s,o[11]=0,o[12]=e.x,o[13]=e.y,o[14]=e.z,o[15]=1,o},c.fromTranslation=function(e,t){return c.fromRotationTranslation(s.IDENTITY,e,t)},c.fromScale=function(e,t){return n(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 c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return n(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 c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,f=new e,m=new e;c.fromCamera=function(t,r){var o=t.eye,i=t.target,a=t.up;e.normalize(e.subtract(i,o,l),l),e.normalize(e.cross(l,a,f),f),e.normalize(e.cross(f,l,m),m);var s=f.x,u=f.y,h=f.z,d=l.x,E=l.y,p=l.z,y=m.x,v=m.y,T=m.z,g=o.x,S=o.y,A=o.z,C=s*-g+u*-S+h*-A,R=y*-g+v*-S+T*-A,I=d*g+E*S+p*A;return n(r)?(r[0]=s,r[1]=y,r[2]=-d,r[3]=0,r[4]=u,r[5]=v,r[6]=-E,r[7]=0,r[8]=h,r[9]=T,r[10]=-p,r[11]=0,r[12]=C,r[13]=R,r[14]=I,r[15]=1,r):new c(s,u,h,C,y,v,T,R,-d,-E,-p,I,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,r,n,o){var i=Math.tan(.5*e),a=1/i,s=a/t,u=(n+r)/(r-n),c=2*n*r/(r-n);return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=c,o[15]=0,o},c.computeOrthographicOffCenter=function(e,t,r,n,o,i,a){var s=1/(t-e),u=1/(n-r),c=1/(i-o),l=-(t+e)*s,f=-(n+r)*u,m=-(i+o)*c;return s*=2,u*=2,c*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=c,a[11]=0,a[12]=l,a[13]=f,a[14]=m,a[15]=1,a
  },c.computePerspectiveOffCenter=function(e,t,r,n,o,i,a){var s=2*o/(t-e),u=2*o/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(i+o)/(i-o),m=-1,h=-2*i*o/(i-o);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=c,a[9]=l,a[10]=f,a[11]=m,a[12]=0,a[13]=0,a[14]=h,a[15]=0,a},c.computeInfinitePerspectiveOffCenter=function(e,t,r,n,o,i){var a=2*o/(t-e),s=2*o/(n-r),u=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,m=-2*o;return i[0]=a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=u,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=m,i[15]=0,i},c.computeViewportTransformation=function(e,t,n,o){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),a=r(e.y,0),s=r(e.width,0),u=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*s,l=.5*u,f=.5*(n-t),m=c,h=l,d=f,E=i+c,p=a+l,y=t+f,v=1;return o[0]=m,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=d,o[11]=0,o[12]=E,o[13]=p,o[14]=y,o[15]=v,o},c.toArray=function(e,t){return n(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]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,r){var n=4*t,o=e[n],i=e[n+1],a=e[n+2],s=e[n+3];return r.x=o,r.y=i,r.z=a,r.w=s,r},c.setColumn=function(e,t,r,n){n=c.clone(e,n);var o=4*t;return n[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n[o+3]=r.w,n},c.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},c.getRow=function(e,t,r){var n=e[t],o=e[t+4],i=e[t+8],a=e[t+12];return r.x=n,r.y=o,r.z=i,r.w=a,r},c.setRow=function(e,t,r,n){return n=c.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var h=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],h)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],h)),r};var d=new e;c.getMaximumScale=function(t){return c.getScale(t,d),e.maximumComponent(d)},c.multiply=function(e,t,r){var n=e[0],o=e[1],i=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],f=e[8],m=e[9],h=e[10],d=e[11],E=e[12],p=e[13],y=e[14],v=e[15],T=t[0],g=t[1],S=t[2],A=t[3],C=t[4],R=t[5],I=t[6],N=t[7],_=t[8],O=t[9],M=t[10],w=t[11],L=t[12],b=t[13],x=t[14],P=t[15],F=n*T+s*g+f*S+E*A,D=o*T+u*g+m*S+p*A,U=i*T+c*g+h*S+y*A,B=a*T+l*g+d*S+v*A,z=n*C+s*R+f*I+E*N,G=o*C+u*R+m*I+p*N,V=i*C+c*R+h*I+y*N,q=a*C+l*R+d*I+v*N,H=n*_+s*O+f*M+E*w,W=o*_+u*O+m*M+p*w,k=i*_+c*O+h*M+y*w,Y=a*_+l*O+d*M+v*w,X=n*L+s*b+f*x+E*P,K=o*L+u*b+m*x+p*P,j=i*L+c*b+h*x+y*P,Z=a*L+l*b+d*x+v*P;return r[0]=F,r[1]=D,r[2]=U,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=H,r[9]=W,r[10]=k,r[11]=Y,r[12]=X,r[13]=K,r[14]=j,r[15]=Z,r},c.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},c.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},c.multiplyTransformation=function(e,t,r){var n=e[0],o=e[1],i=e[2],a=e[4],s=e[5],u=e[6],c=e[8],l=e[9],f=e[10],m=e[12],h=e[13],d=e[14],E=t[0],p=t[1],y=t[2],v=t[4],T=t[5],g=t[6],S=t[8],A=t[9],C=t[10],R=t[12],I=t[13],N=t[14],_=n*E+a*p+c*y,O=o*E+s*p+l*y,M=i*E+u*p+f*y,w=n*v+a*T+c*g,L=o*v+s*T+l*g,b=i*v+u*T+f*g,x=n*S+a*A+c*C,P=o*S+s*A+l*C,F=i*S+u*A+f*C,D=n*R+a*I+c*N+m,U=o*R+s*I+l*N+h,B=i*R+u*I+f*N+d;return r[0]=_,r[1]=O,r[2]=M,r[3]=0,r[4]=w,r[5]=L,r[6]=b,r[7]=0,r[8]=x,r[9]=P,r[10]=F,r[11]=0,r[12]=D,r[13]=U,r[14]=B,r[15]=1,r},c.multiplyByMatrix3=function(e,t,r){var n=e[0],o=e[1],i=e[2],a=e[4],s=e[5],u=e[6],c=e[8],l=e[9],f=e[10],m=t[0],h=t[1],d=t[2],E=t[3],p=t[4],y=t[5],v=t[6],T=t[7],g=t[8],S=n*m+a*h+c*d,A=o*m+s*h+l*d,C=i*m+u*h+f*d,R=n*E+a*p+c*y,I=o*E+s*p+l*y,N=i*E+u*p+f*y,_=n*v+a*T+c*g,O=o*v+s*T+l*g,M=i*v+u*T+f*g;return r[0]=S,r[1]=A,r[2]=C,r[3]=0,r[4]=R,r[5]=I,r[6]=N,r[7]=0,r[8]=_,r[9]=O,r[10]=M,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},c.multiplyByTranslation=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=n*e[0]+o*e[4]+i*e[8]+e[12],s=n*e[1]+o*e[5]+i*e[9]+e[13],u=n*e[2]+o*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]=a,r[13]=s,r[14]=u,r[15]=e[15],r};var E=new e;c.multiplyByUniformScale=function(e,t,r){return E.x=t,E.y=t,E.z=t,c.multiplyByScale(e,E,r)},c.multiplyByScale=function(e,t,r){var n=t.x,o=t.y,i=t.z;return 1===n&&1===o&&1===i?c.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=o*e[4],r[5]=o*e[5],r[6]=o*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)},c.multiplyByVector=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=t.w,s=e[0]*n+e[4]*o+e[8]*i+e[12]*a,u=e[1]*n+e[5]*o+e[9]*i+e[13]*a,c=e[2]*n+e[6]*o+e[10]*i+e[14]*a,l=e[3]*n+e[7]*o+e[11]*i+e[15]*a;return r.x=s,r.y=u,r.z=c,r.w=l,r},c.multiplyByPointAsVector=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=e[0]*n+e[4]*o+e[8]*i,s=e[1]*n+e[5]*o+e[9]*i,u=e[2]*n+e[6]*o+e[10]*i;return r.x=a,r.y=s,r.z=u,r},c.multiplyByPoint=function(e,t,r){var n=t.x,o=t.y,i=t.z,a=e[0]*n+e[4]*o+e[8]*i+e[12],s=e[1]*n+e[5]*o+e[9]*i+e[13],u=e[2]*n+e[6]*o+e[10]*i+e[14];return r.x=a,r.y=s,r.z=u,r},c.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},c.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},c.transpose=function(e,t){var r=e[1],n=e[2],o=e[3],i=e[6],a=e[7],s=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]=o,t[13]=a,t[14]=s,t[15]=e[15],t},c.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},c.equals=function(e,t){return e===t||n(e)&&n(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]},c.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(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},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.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 s,y=new s,v=new t,T=new t(0,0,0,1);return c.inverse=function(e,r){if(s.equalsEpsilon(c.getRotation(e,p),y,a.EPSILON7)&&t.equals(c.getRow(e,3,v),T))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;var n=e[0],o=e[4],i=e[8],l=e[12],f=e[1],m=e[5],h=e[9],d=e[13],E=e[2],g=e[6],S=e[10],A=e[14],C=e[3],R=e[7],I=e[11],N=e[15],_=S*N,O=A*I,M=g*N,w=A*R,L=g*I,b=S*R,x=E*N,P=A*C,F=E*I,D=S*C,U=E*R,B=g*C,z=_*m+w*h+L*d-(O*m+M*h+b*d),G=O*f+x*h+D*d-(_*f+P*h+F*d),V=M*f+P*m+U*d-(w*f+x*m+B*d),q=b*f+F*m+B*h-(L*f+D*m+U*h),H=O*o+M*i+b*l-(_*o+w*i+L*l),W=_*n+P*i+F*l-(O*n+x*i+D*l),k=w*n+x*o+B*l-(M*n+P*o+U*l),Y=L*n+D*o+U*i-(b*n+F*o+B*i);_=i*d,O=l*h,M=o*d,w=l*m,L=o*h,b=i*m,x=n*d,P=l*f,F=n*h,D=i*f,U=n*m,B=o*f;var X=_*R+w*I+L*N-(O*R+M*I+b*N),K=O*C+x*I+D*N-(_*C+P*I+F*N),j=M*C+P*R+U*N-(w*C+x*R+B*N),Z=b*C+F*R+B*I-(L*C+D*R+U*I),Q=M*S+b*A+O*g-(L*A+_*g+w*S),J=F*A+_*E+P*S-(x*S+D*A+O*E),$=x*g+B*A+w*E-(U*A+M*E+P*g),et=U*S+L*E+D*g-(F*g+B*S+b*E),tt=n*z+o*G+i*V+l*q;if(Math.abs(tt)<a.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return tt=1/tt,r[0]=z*tt,r[1]=G*tt,r[2]=V*tt,r[3]=q*tt,r[4]=H*tt,r[5]=W*tt,r[6]=k*tt,r[7]=Y*tt,r[8]=X*tt,r[9]=K*tt,r[10]=j*tt,r[11]=Z*tt,r[12]=Q*tt,r[13]=J*tt,r[14]=$*tt,r[15]=et*tt,r},c.inverseTransformation=function(e,t){var r=e[0],n=e[1],o=e[2],i=e[4],a=e[5],s=e[6],u=e[8],c=e[9],l=e[10],f=e[12],m=e[13],h=e[14],d=-r*f-n*m-o*h,E=-i*f-a*m-s*h,p=-u*f-c*m-l*h;return t[0]=r,t[1]=i,t[2]=u,t[3]=0,t[4]=n,t[5]=a,t[6]=c,t[7]=0,t[8]=o,t[9]=s,t[10]=l,t[11]=0,t[12]=d,t[13]=E,t[14]=p,t[15]=1,t},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=i(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.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]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.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]+")"},c}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";var o=function(t,r){this.normal=e.clone(t),this.distance=r};o.fromPointNormal=function(r,n,i){var a=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=a,i):new o(n,a)};var i=new e;return o.fromCartesian4=function(r,n){var a=e.fromCartesian4(r,i),s=r.w;return t(n)?(e.clone(a,n.normal),n.distance=s,n):new o(a,s)},o.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},o.ORIGIN_XY_PLANE=n(new o(e.UNIT_Z,0)),o.ORIGIN_YZ_PLANE=n(new o(e.UNIT_X,0)),o.ORIGIN_ZX_PLANE=n(new o(e.UNIT_Y,0)),o}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,o,i,a,s){"use strict";var u=function(e,r,n,o){this.west=t(e,0),this.south=t(r,0),this.east=t(n,0),this.north=t(o,0)};n(u.prototype,{width:{get:function(){return u.computeWidth(this)}},height:{get:function(){return u.computeHeight(this)}}}),u.packedLength=4,u.pack=function(e,r,n){n=t(n,0),r[n++]=e.west,r[n++]=e.south,r[n++]=e.east,r[n]=e.north},u.unpack=function(e,n,o){return n=t(n,0),r(o)||(o=new u),o.west=e[n++],o.south=e[n++],o.east=e[n++],o.north=e[n],o},u.computeWidth=function(e){var t=e.east,r=e.west;return r>t&&(t+=s.TWO_PI),t-r},u.computeHeight=function(e){return e.north-e.south},u.fromDegrees=function(e,n,o,i,a){return e=s.toRadians(t(e,0)),n=s.toRadians(t(n,0)),o=s.toRadians(t(o,0)),i=s.toRadians(t(i,0)),r(a)?(a.west=e,a.south=n,a.east=o,a.north=i,a):new u(e,n,o,i)},u.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=0,c=e.length;c>s;s++){var l=e[s];n=Math.min(n,l.longitude),o=Math.max(o,l.longitude),i=Math.min(i,l.latitude),a=Math.max(a,l.latitude)}return r(t)?(t.west=n,t.south=i,t.east=o,t.north=a,t):new u(n,i,o,a)},u.clone=function(e,t){return r(e)?r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new u(e.west,e.south,e.east,e.north):void 0},u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},u.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},u.validate=function(){},u.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},u.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},u.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},u.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},u.center=function(t,n){var o=t.east,i=t.west;i>o&&(o+=s.TWO_PI);var a=s.negativePiToPi(.5*(i+o)),u=.5*(t.south+t.north);return r(n)?(n.longitude=a,n.latitude=u,n.height=0,n):new e(a,u)},u.intersection=function(e,t,n){var o=e.east,i=e.west,a=t.east,c=t.west;i>o&&a>0?o+=s.TWO_PI:c>a&&o>0&&(a+=s.TWO_PI),i>o&&0>c?c+=s.TWO_PI:c>a&&0>i&&(i+=s.TWO_PI);var l=s.negativePiToPi(Math.max(i,c)),f=s.negativePiToPi(Math.min(o,a));if((e.west<e.east||t.west<t.east)&&l>=f)return void 0;var m=Math.max(e.south,t.south),h=Math.min(e.north,t.north);return m>=h?void 0:r(n)?(n.west=l,n.south=m,n.east=f,n.north=h,n):new u(l,m,f,h)},u.contains=function(e,t){var r=t.longitude,n=t.latitude,o=e.west,i=e.east;return o>i&&(i+=s.TWO_PI,0>r&&(r+=s.TWO_PI)),(r>o||s.equalsEpsilon(r,o,s.EPSILON14))&&(i>r||s.equalsEpsilon(r,i,s.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return u.subsample=function(e,n,o,a){n=t(n,i.WGS84),o=t(o,0),r(a)||(a=[]);var l=0,f=e.north,m=e.south,h=e.east,d=e.west,E=c;E.height=o,E.longitude=d,E.latitude=f,a[l]=n.cartographicToCartesian(E,a[l]),l++,E.longitude=h,a[l]=n.cartographicToCartesian(E,a[l]),l++,E.latitude=m,a[l]=n.cartographicToCartesian(E,a[l]),l++,E.longitude=d,a[l]=n.cartographicToCartesian(E,a[l]),l++,E.latitude=0>f?f:m>0?m:0;for(var p=1;8>p;++p)E.longitude=-Math.PI+p*s.PI_OVER_TWO,u.contains(e,E)&&(a[l]=n.cartographicToCartesian(E,a[l]),l++);return 0===E.latitude&&(E.longitude=d,a[l]=n.cartographicToCartesian(E,a[l]),l++,E.longitude=h,a[l]=n.cartographicToCartesian(E,a[l]),l++),a.length=l,a},u.MAX_VALUE=a(new u(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),u}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Plane","./Rectangle"],function(e,t,r,n,o,i,a,s,u,c,l,f,m){"use strict";var h=function(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)},d=new e,E=new e,p=new e,y=new e,v=new e,T=new e,g=new e,S=new e,A=new e,C=new e,R=new e,I=new e;h.fromPoints=function(t,r){if(n(r)||(r=new h),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var o=e.clone(t[0],g),i=e.clone(o,d),a=e.clone(o,E),s=e.clone(o,p),u=e.clone(o,y),c=e.clone(o,v),l=e.clone(o,T),f=t.length,m=1;f>m;m++){e.clone(t[m],o);var N=o.x,_=o.y,O=o.z;N<i.x&&e.clone(o,i),N>u.x&&e.clone(o,u),_<a.y&&e.clone(o,a),_>c.y&&e.clone(o,c),O<s.z&&e.clone(o,s),O>l.z&&e.clone(o,l)}var M=e.magnitudeSquared(e.subtract(u,i,S)),w=e.magnitudeSquared(e.subtract(c,a,S)),L=e.magnitudeSquared(e.subtract(l,s,S)),b=i,x=u,P=M;w>P&&(P=w,b=a,x=c),L>P&&(P=L,b=s,x=l);var F=A;F.x=.5*(b.x+x.x),F.y=.5*(b.y+x.y),F.z=.5*(b.z+x.z);var D=e.magnitudeSquared(e.subtract(x,F,S)),U=Math.sqrt(D),B=C;B.x=i.x,B.y=a.y,B.z=s.z;var z=R;z.x=u.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,S),.5,I),V=0;for(m=0;f>m;m++){e.clone(t[m],o);var q=e.magnitude(e.subtract(o,G,S));q>V&&(V=q);var H=e.magnitudeSquared(e.subtract(o,F,S));if(H>D){var W=Math.sqrt(H);U=.5*(U+W),D=U*U;var k=W-U;F.x=(U*F.x+k*o.x)/W,F.y=(U*F.y+k*o.y)/W,F.z=(U*F.z+k*o.z)/W}}return V>U?(e.clone(F,r.center),r.radius=U):(e.clone(G,r.center),r.radius=V),r};var N=new s,_=new e,O=new e,M=new t,w=new t;h.fromRectangle2D=function(e,t,r){return h.fromRectangleWithHeights2D(e,t,0,0,r)},h.fromRectangleWithHeights2D=function(t,o,i,a,s){if(n(s)||(s=new h),!n(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;o=r(o,N),m.southwest(t,M),M.height=i,m.northeast(t,w),w.height=a;var u=o.project(M,_),c=o.project(w,O),l=c.x-u.x,f=c.y-u.y,d=c.z-u.z;s.radius=.5*Math.sqrt(l*l+f*f+d*d);var E=s.center;return E.x=u.x+.5*l,E.y=u.y+.5*f,E.z=u.z+.5*d,s};var L=[];h.fromRectangle3D=function(e,t,o,i){t=r(t,a.WGS84),o=r(o,0);var s;return n(e)&&(s=m.subsample(e,t,o,L)),h.fromPoints(s,i)},h.fromVertices=function(t,o,i,a){if(n(a)||(a=new h),!n(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;o=r(o,e.ZERO),i=r(i,3);var s=g;s.x=t[0]+o.x,s.y=t[1]+o.y,s.z=t[2]+o.z;for(var u=e.clone(s,d),c=e.clone(s,E),l=e.clone(s,p),f=e.clone(s,y),m=e.clone(s,v),N=e.clone(s,T),_=t.length,O=0;_>O;O+=i){var M=t[O]+o.x,w=t[O+1]+o.y,L=t[O+2]+o.z;s.x=M,s.y=w,s.z=L,M<u.x&&e.clone(s,u),M>f.x&&e.clone(s,f),w<c.y&&e.clone(s,c),w>m.y&&e.clone(s,m),L<l.z&&e.clone(s,l),L>N.z&&e.clone(s,N)}var b=e.magnitudeSquared(e.subtract(f,u,S)),x=e.magnitudeSquared(e.subtract(m,c,S)),P=e.magnitudeSquared(e.subtract(N,l,S)),F=u,D=f,U=b;x>U&&(U=x,F=c,D=m),P>U&&(U=P,F=l,D=N);var B=A;B.x=.5*(F.x+D.x),B.y=.5*(F.y+D.y),B.z=.5*(F.z+D.z);var z=e.magnitudeSquared(e.subtract(D,B,S)),G=Math.sqrt(z),V=C;V.x=u.x,V.y=c.y,V.z=l.z;var q=R;q.x=f.x,q.y=m.y,q.z=N.z;var H=e.multiplyByScalar(e.add(V,q,S),.5,I),W=0;for(O=0;_>O;O+=i){s.x=t[O]+o.x,s.y=t[O+1]+o.y,s.z=t[O+2]+o.z;var k=e.magnitude(e.subtract(s,H,S));k>W&&(W=k);var Y=e.magnitudeSquared(e.subtract(s,B,S));if(Y>z){var X=Math.sqrt(Y);G=.5*(G+X),z=G*G;var K=X-G;B.x=(G*B.x+K*s.x)/X,B.y=(G*B.y+K*s.y)/X,B.z=(G*B.z+K*s.z)/X}}return W>G?(e.clone(B,a.center),a.radius=G):(e.clone(H,a.center),a.radius=W),a},h.fromCornerPoints=function(t,r,o){n(o)||(o=new h);var i=o.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),o.radius=e.distance(i,r),o},h.fromEllipsoid=function(t,r){return n(r)||(r=new h),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var b=new e;h.fromBoundingSpheres=function(t,r){if(n(r)||(r=new h),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var o=t.length;if(1===o)return h.clone(t[0],r);if(2===o)return h.union(t[0],t[1],r);for(var i=[],a=0;o>a;a++)i.push(t[a].center);r=h.fromPoints(i,r);var s=r.center,u=r.radius;for(a=0;o>a;a++){var c=t[a];u=Math.max(u,e.distance(s,c.center,b)+c.radius)}return r.radius=u,r},h.clone=function(t,r){return n(t)?n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new h(t.center,t.radius):void 0},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var o=e.center;t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n]=e.radius},h.unpack=function(e,t,o){t=r(t,0),n(o)||(o=new h);var i=o.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],o.radius=e[t],o};var x=new e,P=new e;h.union=function(t,r,o){n(o)||(o=new h);var i=t.center,a=t.radius,s=r.center,u=r.radius,c=e.subtract(s,i,x),l=e.magnitude(c);if(a>=l+u)return t.clone(o),o;if(u>=l+a)return r.clone(o),o;var f=.5*(a+l+u),m=e.multiplyByScalar(c,(-a+f)/l,P);return e.add(m,i,m),e.clone(m,o.center),o.radius=f,o};var F=new e;h.expand=function(t,r,n){n=h.clone(t,n);var o=e.magnitude(e.subtract(r,n.center,F));return o>n.radius&&(n.radius=o),n},h.intersectPlane=function(t,r){var n=t.center,o=t.radius,i=r.normal,a=e.dot(i,n)+r.distance;return-o>a?u.OUTSIDE:o>a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,r){return n(r)||(r=new h),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var D=new e;h.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,D);return e.magnitudeSquared(n)-t.radius*t.radius},h.transformWithoutScale=function(e,t,r){return n(r)||(r=new h),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var U=new e;h.computePlaneDistances=function(t,r,o,i){n(i)||(i=new c);var a=e.subtract(t.center,r,U),s=e.dot(o,a);return i.start=s-t.radius,i.stop=s+t.radius,i};for(var B=new e,z=new e,G=new e,V=new e,q=new e,H=new t,W=new Array(8),k=0;8>k;++k)W[k]=new e;var Y=new s;return h.projectTo2D=function(t,n,o){n=r(n,Y);var i=n.ellipsoid,a=t.center,s=t.radius,u=i.geodeticSurfaceNormal(a,B),c=e.cross(e.UNIT_Z,u,z);e.normalize(c,c);var l=e.cross(u,c,G);e.normalize(l,l),e.multiplyByScalar(u,s,u),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c);var f=e.negate(l,q),m=e.negate(c,V),d=W,E=d[0];e.add(u,l,E),e.add(E,c,E),E=d[1],e.add(u,l,E),e.add(E,m,E),E=d[2],e.add(u,f,E),e.add(E,m,E),E=d[3],e.add(u,f,E),e.add(E,c,E),e.negate(u,u),E=d[4],e.add(u,l,E),e.add(E,c,E),E=d[5],e.add(u,l,E),e.add(E,m,E),E=d[6],e.add(u,f,E),e.add(E,m,E),E=d[7],e.add(u,f,E),e.add(E,c,E);for(var p=d.length,y=0;p>y;++y){var v=d[y];e.add(a,v,v);var T=i.cartesianToCartographic(v,H);n.project(T,v)}o=h.fromPoints(d,o),a=o.center;var g=a.x,S=a.y,A=a.z;return a.x=A,a.y=g,a.z=S,o},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,r){return h.computePlaneDistances(this,e,t,r)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},o={};return t(o,{element:{get:function(){return o.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return o.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return o.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return o.supportsFullscreen()?null!==o.element:void 0}}}),o.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var o,i=["webkit","moz","o","ms","khtml"],a=0,s=i.length;s>a;++a){var u=i[a];o=u+"RequestFullscreen","function"==typeof t[o]?(n.requestFullscreen=o,r=!0):(o=u+"RequestFullScreen","function"==typeof t[o]&&(n.requestFullscreen=o,r=!0)),o=u+"ExitFullscreen","function"==typeof document[o]?n.exitFullscreen=o:(o=u+"CancelFullScreen","function"==typeof document[o]&&(n.exitFullscreen=o)),o=u+"FullscreenEnabled",e(document[o])?n.fullscreenEnabled=o:(o=u+"FullScreenEnabled",e(document[o])&&(n.fullscreenEnabled=o)),o=u+"FullscreenElement",e(document[o])?n.fullscreenElement=o:(o=u+"FullScreenElement",e(document[o])&&(n.fullscreenElement=o)),o=u+"fullscreenchange",e(document["on"+o])&&("ms"===u&&(o="MSFullscreenChange"),n.fullscreenchange=o),o=u+"fullscreenerror",e(document["on"+o])&&("ms"===u&&(o="MSFullscreenError"),n.fullscreenerror=o)}return r},o.requestFullscreen=function(e){o.supportsFullscreen()&&e[n.requestFullscreen]()},o.exitFullscreen=function(){o.supportsFullscreen()&&document[n.exitFullscreen]()},o}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;n>r;++r)t[r]=parseInt(t[r],10);return t}function o(){if(!t(p)){p=!1;var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(p=!0,y=n(e[1]))}return p}function i(){return o()&&y}function a(){if(!t(v)&&(v=!1,!o()&&/ Safari\/[\.0-9]+/.test(navigator.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(v=!0,T=n(e[1]))}return v}function s(){return a()&&T}function u(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null!==e&&(g=!0,S=n(e[1]),S.isNightly=!!e[2])}return g}function c(){return u()&&S}function l(){if(!t(A)){A=!1;var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(A=!0,C=n(e[1]))):"Netscape"===navigator.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(A=!0,C=n(e[1])))}return A}function f(){return l()&&C}function m(){if(!t(R)){R=!1;var e=/Firefox\/([\.0-9]+)/.exec(navigator.userAgent);null!==e&&(R=!0,I=n(e[1]))}return R}function h(){return t(N)||(N=/Windows/i.test(navigator.appVersion)),N}function d(){return m()&&I}function E(){return t(_)||(_=t(window.PointerEvent)&&(!t(window.navigator.pointerEnabled)||window.navigator.pointerEnabled)),_}var p,y,v,T,g,S,A,C,R,I,N,_,O={isChrome:o,chromeVersion:i,isSafari:a,safariVersion:s,isWebkit:u,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isFirefox:m,firefoxVersion:d,isWindows:h,hardwareConcurrency:e(navigator.hardwareConcurrency,3),supportsPointerEvents:E};return O.supportsFullscreen=function(){return r.supportsFullscreen()},O.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},O.supportsWebWorkers=function(){return"undefined"!=typeof Worker},O}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,r,n,o,i){"use strict";function a(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1>6*r?e+6*(t-e)*r:1>2*r?t:2>3*r?e+6*(t-e)*(2/3-r):e}var s=function(t,r,n,o){this.red=e(t,1),this.green=e(r,1),this.blue=e(n,1),this.alpha=e(o,1)};s.fromCartesian4=function(e,r){return t(r)?(r.red=e.x,r.green=e.y,r.blue=e.z,r.alpha=e.w,r):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(r,n,o,i,a){return r=s.byteToFloat(e(r,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),i=s.byteToFloat(e(i,255)),t(a)?(a.red=r,a.green=n,a.blue=o,a.alpha=i,a):new s(r,n,o,i)},s.fromAlpha=function(e,r,n){return t(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=r,n):new s(e.red,e.green,e.blue,r)};var u,c,l;n.supportsTypedArrays()&&(u=new ArrayBuffer(4),c=new Uint32Array(u),l=new Uint8Array(u)),s.fromRgba=function(e){return c[0]=e,s.fromBytes(l[0],l[1],l[2],l[3])},s.fromHsl=function(t,r,n,o){t=e(t,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var i=n,u=n,c=n;if(0!==r){var l;l=.5>n?n*(1+r):n+r-n*r;var f=2*n-l;i=a(f,l,t+1/3),u=a(f,l,t),c=a(f,l,t-1/3)}return new s(i,u,c,o)},s.fromRandom=function(r,n){r=e(r,e.EMPTY_OBJECT);var o=r.red;if(!t(o)){var a=e(r.minimumRed,0),u=e(r.maximumRed,1);o=a+i.nextRandomNumber()*(u-a)}var c=r.green;if(!t(c)){var l=e(r.minimumGreen,0),f=e(r.maximumGreen,1);c=l+i.nextRandomNumber()*(f-l)}var m=r.blue;if(!t(m)){var h=e(r.minimumBlue,0),d=e(r.maximumBlue,1);m=h+i.nextRandomNumber()*(d-h)}var E=r.alpha;if(!t(E)){var p=e(r.minimumAlpha,0),y=e(r.maximumAlpha,1);E=p+i.nextRandomNumber()*(y-p)}return t(n)?(n.red=o,n.green=c,n.blue=m,n.alpha=E,n):new s(o,c,m,E)};var f=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,m=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,h=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,d=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(r){var n=s[r.toUpperCase()];if(t(n))return s.clone(n);var o=f.exec(r);return null!==o?new s(parseInt(o[1],16)/15,parseInt(o[2],16)/15,parseInt(o[3],16)/15):(o=m.exec(r),null!==o?new s(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255):(o=h.exec(r),null!==o?new s(parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),parseFloat(e(o[4],"1.0"))):(o=d.exec(r),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0"))):void 0)))},s.packedLength=4,s.pack=function(t,r,n){n=e(n,0),r[n++]=t.red,r[n++]=t.green,r[n++]=t.blue,r[n]=t.alpha},s.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new s),o.red=r[n++],o.green=r[n++],o.blue=r[n++],o.alpha=r[n],o},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:0|256*e},s.clone=function(e,r){return t(e)?t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new s(e.red,e.green,e.blue,e.alpha):void 0},s.equals=function(e,r){return e===r||t(e)&&t(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},s.equalsArray=function(e,t,r){return e.red===t[r]&&e.green===t[r+1]&&e.blue===t[r+2]&&e.alpha===t[r+3]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,r){return this===e||t(e)&&Math.abs(this.red-e.red)<=r&&Math.abs(this.green-e.green)<=r&&Math.abs(this.blue-e.blue)<=r&&Math.abs(this.alpha-e.alpha)<=r},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},s.prototype.toBytes=function(e){var r=s.floatToByte(this.red),n=s.floatToByte(this.green),o=s.floatToByte(this.blue),i=s.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=n,e[2]=o,e[3]=i,e):[r,n,o,i]},s.prototype.toRgba=function(){return l[0]=s.floatToByte(this.red),l[1]=s.floatToByte(this.green),l[2]=s.floatToByte(this.blue),l[3]=s.floatToByte(this.alpha),c[0]},s.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},s.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.ALICEBLUE=o(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=o(s.fromCssColorString("#FAEBD7")),s.AQUA=o(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=o(s.fromCssColorString("#7FFFD4")),s.AZURE=o(s.fromCssColorString("#F0FFFF")),s.BEIGE=o(s.fromCssColorString("#F5F5DC")),s.BISQUE=o(s.fromCssColorString("#FFE4C4")),s.BLACK=o(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=o(s.fromCssColorString("#FFEBCD")),s.BLUE=o(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=o(s.fromCssColorString("#8A2BE2")),s.BROWN=o(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=o(s.fromCssColorString("#DEB887")),s.CADETBLUE=o(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=o(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=o(s.fromCssColorString("#D2691E")),s.CORAL=o(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=o(s.fromCssColorString("#6495ED")),s.CORNSILK=o(s.fromCssColorString("#FFF8DC")),s.CRIMSON=o(s.fromCssColorString("#DC143C")),s.CYAN=o(s.fromCssColorString("#00FFFF")),s.DARKBLUE=o(s.fromCssColorString("#00008B")),s.DARKCYAN=o(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=o(s.fromCssColorString("#B8860B")),s.DARKGRAY=o(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=o(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=o(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=o(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=o(s.fromCssColorString("#556B2F")),s.DARKORANGE=o(s.fromCssColorString("#FF8C00")),s.DARKORCHID=o(s.fromCssColorString("#9932CC")),s.DARKRED=o(s.fromCssColorString("#8B0000")),s.DARKSALMON=o(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=o(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=o(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=o(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=o(s.fromCssColorString("#00CED1")),s.DARKVIOLET=o(s.fromCssColorString("#9400D3")),s.DEEPPINK=o(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=o(s.fromCssColorString("#00BFFF")),s.DIMGRAY=o(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=o(s.fromCssColorString("#1E90FF")),s.FIREBRICK=o(s.fromCssColorString("#B22222")),s.FLORALWHITE=o(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=o(s.fromCssColorString("#228B22")),s.FUSCHIA=o(s.fromCssColorString("#FF00FF")),s.GAINSBORO=o(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=o(s.fromCssColorString("#F8F8FF")),s.GOLD=o(s.fromCssColorString("#FFD700")),s.GOLDENROD=o(s.fromCssColorString("#DAA520")),s.GRAY=o(s.fromCssColorString("#808080")),s.GREEN=o(s.fromCssColorString("#008000")),s.GREENYELLOW=o(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=o(s.fromCssColorString("#F0FFF0")),s.HOTPINK=o(s.fromCssColorString("#FF69B4")),s.INDIANRED=o(s.fromCssColorString("#CD5C5C")),s.INDIGO=o(s.fromCssColorString("#4B0082")),s.IVORY=o(s.fromCssColorString("#FFFFF0")),s.KHAKI=o(s.fromCssColorString("#F0E68C")),s.LAVENDER=o(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=o(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=o(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=o(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=o(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=o(s.fromCssColorString("#F08080")),s.LIGHTCYAN=o(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=o(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=o(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=o(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=o(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=o(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=o(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=o(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=o(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=o(s.fromCssColorString("#FFFFE0")),s.LIME=o(s.fromCssColorString("#00FF00")),s.LIMEGREEN=o(s.fromCssColorString("#32CD32")),s.LINEN=o(s.fromCssColorString("#FAF0E6")),s.MAGENTA=o(s.fromCssColorString("#FF00FF")),s.MAROON=o(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=o(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=o(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=o(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=o(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=o(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=o(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=o(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=o(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=o(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=o(s.fromCssColorString("#191970")),s.MINTCREAM=o(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=o(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=o(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=o(s.fromCssColorString("#FFDEAD")),s.NAVY=o(s.fromCssColorString("#000080")),s.OLDLACE=o(s.fromCssColorString("#FDF5E6")),s.OLIVE=o(s.fromCssColorString("#808000")),s.OLIVEDRAB=o(s.fromCssColorString("#6B8E23")),s.ORANGE=o(s.fromCssColorString("#FFA500")),s.ORANGERED=o(s.fromCssColorString("#FF4500")),s.ORCHID=o(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=o(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=o(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=o(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=o(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=o(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=o(s.fromCssColorString("#FFDAB9")),s.PERU=o(s.fromCssColorString("#CD853F")),s.PINK=o(s.fromCssColorString("#FFC0CB")),s.PLUM=o(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=o(s.fromCssColorString("#B0E0E6")),s.PURPLE=o(s.fromCssColorString("#800080")),s.RED=o(s.fromCssColorString("#FF0000")),s.ROSYBROWN=o(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=o(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=o(s.fromCssColorString("#8B4513")),s.SALMON=o(s.fromCssColorString("#FA8072")),s.SANDYBROWN=o(s.fromCssColorString("#F4A460")),s.SEAGREEN=o(s.fromCssColorString("#2E8B57")),s.SEASHELL=o(s.fromCssColorString("#FFF5EE")),s.SIENNA=o(s.fromCssColorString("#A0522D")),s.SILVER=o(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=o(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=o(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=o(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=o(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=o(s.fromCssColorString("#00FF7F")),s.STEELBLUE=o(s.fromCssColorString("#4682B4")),s.TAN=o(s.fromCssColorString("#D2B48C")),s.TEAL=o(s.fromCssColorString("#008080")),s.THISTLE=o(s.fromCssColorString("#D8BFD8")),s.TOMATO=o(s.fromCssColorString("#FF6347")),s.TURQUOISE=o(s.fromCssColorString("#40E0D0")),s.VIOLET=o(s.fromCssColorString("#EE82EE")),s.WHEAT=o(s.fromCssColorString("#F5DEB3")),s.WHITE=o(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=o(s.fromCssColorString("#F5F5F5")),s.YELLOW=o(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=o(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=o(new s(0,0,0,0)),s
  }),define("Renderer/WebGLConstants",["../Core/freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,UNSIGNED_INT_24_8_WEBGL:34042,DOUBLE:5130};return e(t)}),define("Core/ComponentDatatype",["../Renderer/WebGLConstants","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject"],function(e,t,r,n,o,i){"use strict";if(!o.supportsTypedArrays())return{};var a={BYTE:e.BYTE,UNSIGNED_BYTE:e.UNSIGNED_BYTE,SHORT:e.SHORT,UNSIGNED_SHORT:e.UNSIGNED_SHORT,FLOAT:e.FLOAT,DOUBLE:e.DOUBLE};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return r(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(e,r,o,i){switch(o=t(o,0),i=t(i,(r.byteLength-o)/a.getSizeInBytes(e)),e){case a.BYTE:return new Int8Array(r,o,i);case a.UNSIGNED_BYTE:return new Uint8Array(r,o,i);case a.SHORT:return new Int16Array(r,o,i);case a.UNSIGNED_SHORT:return new Uint16Array(r,o,i);case a.FLOAT:return new Float32Array(r,o,i);case a.DOUBLE:return new Float64Array(r,o,i);default:throw new n("componentDatatype is not a valid value.")}},i(a)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["../Renderer/WebGLConstants","./freezeObject"],function(e,t){"use strict";var r={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return t(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,o){"use strict";var i=function(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,o.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=void 0};return i.computeNumberOfVertices=function(e){var n=-1;for(var o in e.attributes)if(e.attributes.hasOwnProperty(o)&&t(e.attributes[o])&&t(e.attributes[o].values)){var i=e.attributes[o],a=i.values.length/i.componentsPerAttribute;if(n!==a&&-1!==n)throw new r("All attribute lists must have the same number of attributes.");n=a}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color};return t}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var i=function(t,r){this.x=e(t,0),this.y=e(r,0)};i.fromElements=function(e,r,n){return t(n)?(n.x=e,n.y=r,n):new i(e,r)},i.clone=function(e,r){return t(e)?t(r)?(r.x=e.x,r.y=e.y,r):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,r,n){n=e(n,0),r[n++]=t.x,r[n]=t.y},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.x=r[n++],o.y=r[n],o},i.fromArray=i.unpack,i.maximumComponent=function(e){return Math.max(e.x,e.y)},i.minimumComponent=function(e){return Math.min(e.x,e.y)},i.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},i.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var a=new i;i.distance=function(e,t){return i.subtract(e,t,a),i.magnitude(a)},i.distanceSquared=function(e,t){return i.subtract(e,t,a),i.magnitudeSquared(a)},i.normalize=function(e,t){var r=i.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},i.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},i.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},i.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},i.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new i;i.lerp=function(e,t,r,n){return i.multiplyByScalar(t,r,s),n=i.multiplyByScalar(e,1-r,n),i.add(s,n,n)};var u=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,u),i.normalize(t,c),o.acosClamped(i.dot(u,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var r=i.normalize(e,l);return i.abs(r,r),t=r.x<=r.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.x===r.x&&e.y===r.y},i.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},i.equalsEpsilon=function(e,r,n,i){return e===r||t(e)&&t(r)&&o.equalsEpsilon(e.x,r.x,n,i)&&o.equalsEpsilon(e.y,r.y,n,i)},i.ZERO=n(new i(0,0)),i.UNIT_X=n(new i(1,0)),i.UNIT_Y=n(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,o){"use strict";var i={};i.octEncode=function(e,t){if(t.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),t.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=t.x,n=t.y;t.x=(1-Math.abs(n))*o.signNotZero(r),t.y=(1-Math.abs(r))*o.signNotZero(n)}return t.x=o.toSNorm(t.x),t.y=o.toSNorm(t.y),t},i.octDecode=function(e,r,n){if(n.x=o.fromSNorm(e),n.y=o.fromSNorm(r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*o.signNotZero(i),n.y=(1-Math.abs(i))*o.signNotZero(n.y)}return t.normalize(n,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,a),i.octPackFloat(a)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),o=256*(r-n);return i.octDecode(n,o,t)},i.octPack=function(e,t,r,n){var o=i.octEncodeFloat(e),s=i.octEncodeFloat(t),u=i.octEncode(r,a);return n.x=65536*u.x+o,n.y=65536*u.y+s,n},i.octUnpack=function(e,t,r,n){var o=e.x/65536,a=Math.floor(o),s=65536*(o-a);o=e.y/65536;var u=Math.floor(o),c=65536*(o-u);i.octDecodeFloat(s,t),i.octDecodeFloat(c,r),i.octDecode(a,u,n)},i.compressTextureCoordinates=function(e){var t=1===e.x?4095:0|4096*e.x,r=1===e.y?4095:0|4096*e.y;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096;return t.x=Math.floor(r)/4096,t.y=r-Math.floor(r),t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=new t,o=new t,i=new t,a=function(a,s,u,c,l){r(l)||(l=new t);var f,m,h,d,E,p,y,v;r(s.z)?(f=t.subtract(u,s,n),m=t.subtract(c,s,o),h=t.subtract(a,s,i),d=t.dot(f,f),E=t.dot(f,m),p=t.dot(f,h),y=t.dot(m,m),v=t.dot(m,h)):(f=e.subtract(u,s,n),m=e.subtract(c,s,o),h=e.subtract(a,s,i),d=e.dot(f,f),E=e.dot(f,m),p=e.dot(f,h),y=e.dot(m,m),v=e.dot(m,h));var T=1/(d*y-E*E);return l.y=(y*p-E*v)*T,l.z=(d*v-E*p)*T,l.x=1-l.y-l.z,l};return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var r=function(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)};r.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var n={high:0,low:0};r.fromCartesian=function(e,o){t(o)||(o=new r);var i=o.high,a=o.low;return r.encode(e.x,n),i.x=n.high,a.x=n.low,r.encode(e.y,n),i.y=n.high,a.y=n.low,r.encode(e.z,n),i.z=n.high,a.z=n.low,o};var o=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,o);var i=o.high,a=o.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=a.x,t[n+4]=a.y,t[n+5]=a.z},r}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";var o=function(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0};return o}),define("Core/IndexDatatype",["../Renderer/WebGLConstants","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,o){"use strict";var i={UNSIGNED_BYTE:e.UNSIGNED_BYTE,UNSIGNED_SHORT:e.UNSIGNED_SHORT,UNSIGNED_INT:e.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>o.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>o.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var o=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(o/Math.max(Math.abs(e),Math.abs(r)))<n?0:o}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,o){var i;if(0===e)return 0===n?[]:[-o/n];if(0===n){if(0===o)return[0,0];var a=Math.abs(o),s=Math.abs(e);if(s>a&&a/s<t.EPSILON14)return[0,0];if(a>s&&s/a<t.EPSILON14)return[];if(i=-o/e,0>i)return[];var u=Math.sqrt(i);return[-u,u]}if(0===o)return i=-n/e,0>i?[i,0]:[0,i];var c=n*n,l=4*e*o,f=r(c,-l,t.EPSILON14);if(0>f)return[];var m=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[m/e,o/m]:[o/m,m/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var o,i,a=e,s=t/3,u=r/3,c=n,l=a*u,f=s*c,m=s*s,h=u*u,d=a*u-m,E=a*c-s*u,p=s*c-h,y=4*d*p-E*E;if(0>y){var v,T,g;m*f>=l*h?(v=a,T=d,g=-2*s*d+a*E):(v=c,T=p,g=-c*E+2*u*p);var S=0>g?-1:1,A=-S*Math.abs(v)*Math.sqrt(-y);i=-g+A;var C=i/2,R=0>C?-Math.pow(-C,1/3):Math.pow(C,1/3),I=i===A?-R:-T/R;return o=0>=T?R+I:-g/(R*R+I*I+T),m*f>=l*h?[(o-s)/a]:[-c/(o+u)]}var N=d,_=-2*s*d+a*E,O=p,M=-c*E+2*u*p,w=Math.sqrt(y),L=Math.sqrt(3)/2,b=Math.abs(Math.atan2(a*w,-_)/3);o=2*Math.sqrt(-N);var x=Math.cos(b);i=o*x;var P=o*(-x/2-L*Math.sin(b)),F=i+P>2*s?i-s:P-s,D=a,U=F/D;b=Math.abs(Math.atan2(c*w,-M)/3),o=2*Math.sqrt(-O),x=Math.cos(b),i=o*x,P=o*(-x/2-L*Math.sin(b));var B=-c,z=2*u>i+P?i+u:P+u,G=B/z,V=D*z,q=-F*z-D*B,H=F*B,W=(u*q-s*H)/(-s*q+u*V);return W>=U?G>=U?G>=W?[U,W,G]:[U,G,W]:[G,U,W]:G>=U?[W,U,G]:G>=W?[W,G,U]:[G,W,U]}var n={};return n.computeDiscriminant=function(e,t,r,n){var o=e*e,i=t*t,a=r*r,s=n*n,u=18*e*t*r*n+i*a-27*o*s-4*(e*a*r+i*t*n);return u},n.computeRealRoots=function(e,n,o,i){var a,s;if(0===e)return t.computeRealRoots(n,o,i);if(0===n){if(0===o){if(0===i)return[0,0,0];s=-i/e;var u=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[u,u,u]}return 0===i?(a=t.computeRealRoots(e,0,o),0===a.Length?[0]:[a[0],0,a[1]]):r(e,0,o,i)}return 0===o?0===i?(s=-n/e,0>s?[s,0,0]:[0,0,s]):r(e,n,0,i):0===i?(a=t.computeRealRoots(e,n,o),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):r(e,n,o,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function o(t,o,i,a){var s=t*t,u=o-3*s/8,c=i-o*t/2+s*t/8,l=a-i*t/4+o*s/16-3*s*s/256,f=e.computeRealRoots(1,2*u,u*u-4*l,-c*c);if(f.length>0){var m=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,u,l);if(2===d.length){var E,p=d[0],y=d[1];if(p>=0&&y>=0){var v=Math.sqrt(p),T=Math.sqrt(y);return[m-T,m-v,m+v,m+T]}if(p>=0&&0>y)return E=Math.sqrt(p),[m-E,m+E];if(0>p&&y>=0)return E=Math.sqrt(y),[m-E,m+E]}return[]}if(h>0){var g=Math.sqrt(h),S=(u+h-c/g)/2,A=(u+h+c/g)/2,C=n.computeRealRoots(1,g,S),R=n.computeRealRoots(1,-g,A);return 0!==C.length?(C[0]+=m,C[1]+=m,0!==R.length?(R[0]+=m,R[1]+=m,C[1]<=R[0]?[C[0],C[1],R[0],R[1]]:R[1]<=C[0]?[R[0],R[1],C[0],C[1]]:C[0]>=R[0]&&C[1]<=R[1]?[R[0],C[0],C[1],R[1]]:R[0]>=C[0]&&R[1]<=C[1]?[C[0],R[0],R[1],C[1]]:C[0]>R[0]&&C[0]<R[1]?[R[0],C[0],R[1],C[1]]:[C[0],R[0],C[1],R[1]]):C):0!==R.length?(R[0]+=m,R[1]+=m,R):[]}}return[]}function i(t,o,i,a){var s=i*i,u=o*o,c=t*t,l=-2*o,f=i*t+u-4*a,m=c*a-i*o*t+s,h=e.computeRealRoots(1,l,f,m);if(h.length>0){var d,E,p=h[0],y=o-p,v=y*y,T=t/2,g=y/2,S=v-4*a,A=v+4*Math.abs(a),C=c-4*p,R=c+4*Math.abs(p);if(0>p||C*A>S*R){var I=Math.sqrt(C);d=I/2,E=0===I?0:(t*g-i)/I}else{var N=Math.sqrt(S);d=0===N?0:(t*g-i)/N,E=N/2}var _,O;0===T&&0===d?(_=0,O=0):r.sign(T)===r.sign(d)?(_=T+d,O=p/_):(O=T-d,_=p/O);var M,w;0===g&&0===E?(M=0,w=0):r.sign(g)===r.sign(E)?(M=g+E,w=a/M):(w=g-E,M=a/w);var L=n.computeRealRoots(1,_,M),b=n.computeRealRoots(1,O,w);if(0!==L.length)return 0!==b.length?L[1]<=b[0]?[L[0],L[1],b[0],b[1]]:b[1]<=L[0]?[b[0],b[1],L[0],L[1]]:L[0]>=b[0]&&L[1]<=b[1]?[b[0],L[0],L[1],b[1]]:b[0]>=L[0]&&b[1]<=L[1]?[L[0],b[0],b[1],L[1]]:L[0]>b[0]&&L[0]<b[1]?[b[0],L[0],b[1],L[1]]:[L[0],b[0],L[1],b[1]]:L;if(0!==b.length)return b}return[]}var a={};return a.computeDiscriminant=function(e,t,r,n,o){var i=e*e,a=i*e,s=t*t,u=s*t,c=r*r,l=c*r,f=n*n,m=f*n,h=o*o,d=h*o,E=s*c*f-4*u*m-4*e*l*f+18*e*t*r*m-27*i*f*f+256*a*d+o*(18*u*r*n-4*s*l+16*e*c*c-80*e*t*c*n-6*e*s*f+144*i*r*f)+h*(144*e*s*r-27*s*s-128*i*c-192*i*t*n);return E},a.computeRealRoots=function(t,n,a,s,u){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,a,s,u);var c=n/t,l=a/t,f=s/t,m=u/t,h=0>c?1:0;switch(h+=0>l?h+1:h,h+=0>f?h+1:h,h+=0>m?h+1:h){case 0:return o(c,l,f,m);case 1:return i(c,l,f,m);case 2:return i(c,l,f,m);case 3:return o(c,l,f,m);case 4:return o(c,l,f,m);case 5:return i(c,l,f,m);case 6:return o(c,l,f,m);case 7:return o(c,l,f,m);case 8:return i(c,l,f,m);case 9:return o(c,l,f,m);case 10:return o(c,l,f,m);case 11:return i(c,l,f,m);case 12:return o(c,l,f,m);case 13:return o(c,l,f,m);case 14:return o(c,l,f,m);case 15:return o(c,l,f,m);default:return void 0}},a}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n=function(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n};return n.getPoint=function(t,n,o){return r(o)||(o=new e),o=e.multiplyByScalar(t.direction,n,o),e.add(t.origin,o,o)},n}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,o,i,a,s,u,c){"use strict";function l(t,n,o,a,s){s=r(s,!1);var u,c,l,f,m,h=t.origin,d=t.direction,E=e.subtract(o,n,p),S=e.subtract(a,n,y),A=e.cross(d,S,v),C=e.dot(E,A);if(s){if(C<i.EPSILON6)return void 0;if(u=e.subtract(h,n,T),l=e.dot(u,A),0>l||l>C)return void 0;if(c=e.cross(u,E,g),f=e.dot(d,c),0>f||l+f>C)return void 0;m=e.dot(S,c)/C}else{if(Math.abs(C)<i.EPSILON6)return void 0;var R=1/C;if(u=e.subtract(h,n,T),l=e.dot(u,A)*R,0>l||l>1)return void 0;if(c=e.cross(u,E,g),f=e.dot(d,c)*R,0>f||l+f>1)return void 0;m=e.dot(S,c)*R}return m}function f(e,t,r,n){var o=t*t-4*e*r;if(0>o)return void 0;if(o>0){var i=1/(2*e),a=Math.sqrt(o),s=(-t+a)*i,u=(-t-a)*i;return u>s?(n.root0=s,n.root1=u):(n.root0=u,n.root1=s),n}var c=-t/(2*e);return 0===c?void 0:(n.root0=n.root1=c,n)}function m(t,r,o){n(o)||(o={});var i=t.origin,a=t.direction,s=r.center,u=r.radius*r.radius,c=e.subtract(i,s,v),l=e.dot(a,a),m=2*e.dot(a,c),h=e.magnitudeSquared(c)-u,d=f(l,m,h,A);return n(d)?(o.start=d.root0,o.stop=d.root1,o):void 0}function h(e,t,r){var n=e+t;return i.sign(e)!==i.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function d(t,r,n,o,c){var l,f=o*o,m=c*c,d=(t[a.COLUMN1ROW1]-t[a.COLUMN2ROW2])*m,E=c*(o*h(t[a.COLUMN1ROW0],t[a.COLUMN0ROW1],i.EPSILON15)+r.y),p=t[a.COLUMN0ROW0]*f+t[a.COLUMN2ROW2]*m+o*r.x+n,y=m*h(t[a.COLUMN2ROW1],t[a.COLUMN1ROW2],i.EPSILON15),v=c*(o*h(t[a.COLUMN2ROW0],t[a.COLUMN0ROW2])+r.z),T=[];if(0===v&&0===y){if(l=s.computeRealRoots(d,E,p),0===l.length)return T;var g=l[0],S=Math.sqrt(Math.max(1-g*g,0));if(T.push(new e(o,c*g,c*-S)),T.push(new e(o,c*g,c*S)),2===l.length){var A=l[1],C=Math.sqrt(Math.max(1-A*A,0));T.push(new e(o,c*A,c*-C)),T.push(new e(o,c*A,c*C))}return T}var R=v*v,I=y*y,N=d*d,_=v*y,O=N+I,M=2*(E*d+_),w=2*p*d+E*E-I+R,L=2*(p*E-_),b=p*p-R;if(0===O&&0===M&&0===w&&0===L)return T;l=u.computeRealRoots(O,M,w,L,b);var x=l.length;if(0===x)return T;for(var P=0;x>P;++P){var F,D=l[P],U=D*D,B=Math.max(1-U,0),z=Math.sqrt(B);F=i.sign(d)===i.sign(p)?h(d*U+p,E*D,i.EPSILON12):i.sign(p)===i.sign(E*D)?h(d*U,E*D+p,i.EPSILON12):h(d*U+E*D,p,i.EPSILON12);var G=h(y*D,v,i.EPSILON15),V=F*G;0>V?T.push(new e(o,c*D,c*z)):V>0?T.push(new e(o,c*D,c*-z)):0!==z?(T.push(new e(o,c*D,c*-z)),T.push(new e(o,c*D,c*z)),++P):T.push(new e(o,c*D,c*z))}return T}var E={};E.rayPlane=function(t,r,o){n(o)||(o=new e);var a=t.origin,s=t.direction,u=r.normal,c=e.dot(u,s);if(Math.abs(c)<i.EPSILON15)return void 0;var l=(-r.distance-e.dot(u,a))/c;return 0>l?void 0:(o=e.multiplyByScalar(s,l,o),e.add(a,o,o))};var p=new e,y=new e,v=new e,T=new e,g=new e;E.rayTriangle=function(t,r,o,i,a,s){var u=l(t,r,o,i,a);return!n(u)||0>u?void 0:(n(s)||(s=new e),e.multiplyByScalar(t.direction,u,s),e.add(t.origin,s,s))};var S=new c;E.lineSegmentTriangle=function(t,r,o,i,a,s,u){var c=S;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var f=l(c,o,i,a,s);return!n(f)||0>f||f>e.distance(t,r)?void 0:(n(u)||(u=new e),e.multiplyByScalar(c.direction,f,u),e.add(c.origin,u,u))};var A={root0:0,root1:0};E.raySphere=function(e,t,r){return r=m(e,t,r),!n(r)||r.stop<0?void 0:(r.start=Math.max(r.start,0),r)};var C=new c;E.lineSegmentSphere=function(t,r,o,i){var a=C;e.clone(t,a.origin);var s=e.subtract(r,t,a.direction),u=e.magnitude(s);return e.normalize(s,s),i=m(a,o,i),!n(i)||i.stop<0||i.start>u?void 0:(i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,u),i)};var R=new e,I=new e;E.rayEllipsoid=function(t,r){var n,o,i,a,s,u=r.oneOverRadii,c=e.multiplyComponents(u,t.origin,R),l=e.multiplyComponents(u,t.direction,I),f=e.magnitudeSquared(c),m=e.dot(c,l);if(f>1){if(m>=0)return void 0;var h=m*m;if(n=f-1,o=e.magnitudeSquared(l),i=o*n,i>h)return void 0;if(h>i){a=m*m-i,s=-m+Math.sqrt(a);var d=s/o,E=n/s;return E>d?{start:d,stop:E}:{start:E,stop:d}}var p=Math.sqrt(n/o);return{start:p,stop:p}}return 1>f?(n=f-1,o=e.magnitudeSquared(l),i=o*n,a=m*m-i,s=-m+Math.sqrt(a),{start:0,stop:s/o}):0>m?(o=e.magnitudeSquared(l),{start:0,stop:-m/o}):void 0};var N=new e,_=new e,O=new e,M=new e,w=new e,L=new a,b=new a,x=new a,P=new a,F=new a,D=new a,U=new a,B=new e,z=new e,G=new t;E.grazingAltitudeLocation=function(t,r){var o=t.origin,s=t.direction,u=r.geodeticSurfaceNormal(o,N);if(e.dot(s,u)>=0)return o;var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(s,N),f=e.normalize(l,l),m=e.mostOrthogonalAxis(l,M),h=e.normalize(e.cross(m,f,_),_),E=e.normalize(e.cross(f,h,O),O),p=L;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=E.x,p[7]=E.y,p[8]=E.z;var y=a.transpose(p,b),v=a.fromScale(r.radii,x),T=a.fromScale(r.oneOverRadii,P),g=F;g[0]=0,g[1]=-s.z,g[2]=s.y,g[3]=s.z,g[4]=0,g[5]=-s.x,g[6]=-s.y,g[7]=s.x,g[8]=0;var S,A,C=a.multiply(a.multiply(y,T,D),g,D),R=a.multiply(a.multiply(C,v,U),p,U),I=a.multiplyByVector(C,o,w),V=d(R,e.negate(I,N),0,0,1),q=V.length;if(q>0){for(var H=e.clone(e.ZERO,z),W=Number.NEGATIVE_INFINITY,k=0;q>k;++k){S=a.multiplyByVector(v,a.multiplyByVector(p,V[k],B),B);var Y=e.normalize(e.subtract(S,o,M),M),X=e.dot(Y,s);X>W&&(W=X,H=e.clone(S,H))}var K=r.cartesianToCartographic(H,G);return W=i.clamp(W,0,1),A=e.magnitude(e.subtract(H,o,M))*Math.sqrt(1-W*W),A=c?-A:A,K.height=A,r.cartographicToCartesian(K,new e)}return void 0};var V=new e;return E.lineSegmentPlane=function(t,r,o,a){n(a)||(a=new e);var s=e.subtract(r,t,V),u=o.normal,c=e.dot(u,s);if(Math.abs(c)<i.EPSILON6)return void 0;var l=e.dot(u,t),f=-(o.distance+l)/c;return 0>f||f>1?void 0:(e.multiplyByScalar(s,f,a),e.add(t,a,a),a)},E.trianglePlaneIntersection=function(t,r,n,o){var i=o.normal,a=o.distance,s=e.dot(i,t)+a<0,u=e.dot(i,r)+a<0,c=e.dot(i,n)+a<0,l=0;l+=s?1:0,l+=u?1:0,l+=c?1:0;var f,m;if((1===l||2===l)&&(f=new e,m=new e),1===l){if(s)return E.lineSegmentPlane(t,r,o,f),E.lineSegmentPlane(t,n,o,m),{positions:[t,r,n,f,m],indices:[0,3,4,1,2,4,1,4,3]};if(u)return E.lineSegmentPlane(r,n,o,f),E.lineSegmentPlane(r,t,o,m),{positions:[t,r,n,f,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(n,t,o,f),E.lineSegmentPlane(n,r,o,m),{positions:[t,r,n,f,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!s)return E.lineSegmentPlane(r,t,o,f),E.lineSegmentPlane(n,t,o,m),{positions:[t,r,n,f,m],indices:[1,2,4,1,4,3,0,3,4]};if(!u)return E.lineSegmentPlane(n,r,o,f),E.lineSegmentPlane(t,r,o,m),{positions:[t,r,n,f,m],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,n,o,f),E.lineSegmentPlane(r,n,o,m),{positions:[t,r,n,f,m],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},E}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var r={};return r.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,o=r.maximumIndex,i=e(r.cacheSize,24),a=n.length;if(!t(o)){o=0;for(var s=0,u=n[s];a>s;)u>o&&(o=u),++s,u=n[s]}for(var c=[],l=0;o+1>l;l++)c[l]=0;for(var f=i+1,m=0;a>m;++m)f-c[n[m]]>i&&(c[n[m]]=f,++f);return(f-i+1)/(a/3)},r.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var o=t[t.length-1];if(t.splice(t.length-1,1),e[o].numLiveTriangles>0)return o}for(;n>i;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function o(e,t,r,o,i,a,s){for(var u,c=-1,l=-1,f=0;f<r.length;){var m=r[f];o[m].numLiveTriangles&&(u=0,i-o[m].timeStamp+2*o[m].numLiveTriangles<=t&&(u=i-o[m].timeStamp),(u>l||-1===l)&&(l=u,c=m)),++f}return-1===c?n(o,a,e,s):c}r=e(r,e.EMPTY_OBJECT);var i,a=r.indices,s=r.maximumIndex,u=e(r.cacheSize,24),c=a.length,l=0,f=0,m=a[f],h=c;if(t(s))l=s+1;else{for(;h>f;)m>l&&(l=m),++f,m=a[f];if(-1===l)return 0;++l}for(var d=[],E=0;l>E;E++)d[E]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;h>f;)d[a[f]].vertexTriangles.push(p),++d[a[f]].numLiveTriangles,d[a[f+1]].vertexTriangles.push(p),++d[a[f+1]].numLiveTriangles,d[a[f+2]].vertexTriangles.push(p),++d[a[f+2]].numLiveTriangles,++p,f+=3;var y=0,v=u+1;i=1;var T,g,S=[],A=[],C=0,R=[],I=c/3,N=[];for(E=0;I>E;E++)N[E]=!1;for(var _,O;-1!==y;){S=[],g=d[y],O=g.vertexTriangles.length;for(var M=0;O>M;++M)if(p=g.vertexTriangles[M],!N[p]){N[p]=!0,f=p+p+p;for(var w=0;3>w;++w)_=a[f],S.push(_),A.push(_),R[C]=_,++C,T=d[_],--T.numLiveTriangles,v-T.timeStamp>u&&(T.timeStamp=v,++v),++f}y=o(a,u,S,d,v,A,l)}return R},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,o,i,a,s,u,c,l,f,m,h,d,E,p,y,v,T,g,S,A,C,R,I){"use strict";function N(e,t,r,n,o){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=o,e[t++]=o,e[t]=r}function _(e){for(var t=e.length,r=6*(t/3),n=y.createTypedArray(t,r),o=0,i=0;t>i;i+=3,o+=6)N(n,o,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);N(n,0,e[0],e[1],e[2]);for(var o=6,i=3;t>i;++i,o+=6)N(n,o,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function M(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=y.createTypedArray(t,r),o=e[0],i=0,a=1;t>a;++a,i+=6)N(n,i,o,e[a],e[a+1]);return n}return new Uint16Array}function w(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new d({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function L(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var o=t[n],i=0;i<o.componentsPerAttribute;++i)e[n].values.push(o.values[r*o.componentsPerAttribute+i])
  }function b(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)o.unpack(r,i,it),A.multiplyByPoint(e,it,it),o.pack(it,r,i)}function x(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;n>i;i+=3)o.unpack(r,i,it),S.multiplyByVector(e,it,it),it=o.normalize(it,it),o.pack(it,r,i)}function P(e,t){var r,n=e.length,o={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var a=i[r],u=a.values.length,l=!0,f=1;n>f;++f){var m=e[f][t].attributes[r];if(!c(m)||a.componentDatatype!==m.componentDatatype||a.componentsPerAttribute!==m.componentsPerAttribute||a.normalize!==m.normalize){l=!1;break}u+=m.values.length}l&&(o[r]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,u)}))}return o}function F(e,t){var n,i,a,s,u=e.length;e[0].modelMatrix;var l,f,m,d=c(e[0][t].indices),E=e[0][t].primitiveType,p=P(e,t);for(n in p)if(p.hasOwnProperty(n))for(l=p[n].values,s=0,i=0;u>i;++i)for(f=e[i][t].attributes[n].values,m=f.length,a=0;m>a;++a)l[s++]=f[a];var v;if(d){var T=0;for(i=0;u>i;++i)T+=e[i][t].indices.length;var g=h.computeNumberOfVertices(new h({attributes:p,primitiveType:R.POINTS})),S=y.createTypedArray(g,T),A=0,C=0;for(i=0;u>i;++i){var I=e[i][t].indices,N=I.length;for(s=0;N>s;++s)S[A++]=C+I[s];C+=h.computeNumberOfVertices(e[i][t])}v=S}var _,O=new o,M=0;for(i=0;u>i;++i){if(_=e[i][t].boundingSphere,!c(_)){O=void 0;break}o.add(_.center,O,O)}if(c(O))for(o.divideByScalar(O,u,O),i=0;u>i;++i){_=e[i][t].boundingSphere;var w=o.magnitude(o.subtract(_.center,O,ut))+_.radius;w>M&&(M=w)}return new h({attributes:p,indices:v,primitiveType:E,boundingSphere:c(O)?new r(O,M):void 0})}function D(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function U(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,o=3;t>o;++o)r[n++]=o-1,r[n++]=0,r[n++]=o;return e.indices=r,e.primitiveType=R.TRIANGLES,e}function B(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,o=3;t-1>o;o+=2)r[n++]=o,r[n++]=o-1,r[n++]=o+1,t>o+2&&(r[n++]=o,r[n++]=o+1,r[n++]=o+2);return e.indices=r,e.primitiveType=R.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;t>n;++n)r[n]=n;return e.indices=r,e}function G(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return e.indices=r,e.primitiveType=R.LINES,e}function V(e){var t=h.computeNumberOfVertices(e),r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,o=2;t>o;++o)r[n++]=o-1,r[n++]=o;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=R.LINES,e}function q(e){switch(e.primitiveType){case R.TRIANGLE_FAN:return U(e);case R.TRIANGLE_STRIP:return B(e);case R.TRIANGLES:return D(e);case R.LINE_STRIP:return G(e);case R.LINE_LOOP:return V(e);case R.LINES:return z(e)}return e}function H(e,t){Math.abs(e.y)<g.EPSILON6&&(e.y=t?-g.EPSILON6:g.EPSILON6)}function W(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return H(e,e.y<0),H(t,t.y<0),H(r,r.y<0),void 0;var n,o=Math.abs(e.y),i=Math.abs(t.y),a=Math.abs(r.y);n=o>i?o>a?g.sign(e.y):g.sign(r.y):i>a?g.sign(t.y):g.sign(r.y);var s=0>n;H(e,s),H(t,s),H(r,s)}function k(e,t,r,n){o.add(e,o.multiplyByScalar(o.subtract(t,e,gt),e.y/(e.y-t.y),gt),r),o.clone(r,n),H(r,!0),H(n,!1)}function Y(e,t,r){if(e.x>=0||t.x>=0||r.x>=0)return void 0;W(e,t,r);var n=e.y<0,o=t.y<0,i=r.y<0,a=0;a+=n?1:0,a+=o?1:0,a+=i?1:0;var s=It.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,n?(k(e,t,St,Ct),k(e,r,At,Rt),s[0]=0,s[3]=1,s[4]=2,s[6]=1):o?(k(t,r,St,Ct),k(t,e,At,Rt),s[0]=1,s[3]=2,s[4]=0,s[6]=2):i&&(k(r,e,St,Ct),k(r,t,At,Rt),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,n?o?i||(k(r,e,St,Ct),k(r,t,At,Rt),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(k(t,r,St,Ct),k(t,e,At,Rt),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(k(e,t,St,Ct),k(e,r,At,Rt),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var u=It.positions;return u[0]=e,u[1]=t,u[2]=r,u.length=3,(1===a||2===a)&&(u[3]=St,u[4]=At,u[5]=Ct,u[6]=Rt,u.length=7),It}function X(e,t){var n=e.attributes;if(0===n.position.values.length)return void 0;for(var o in n)if(n.hasOwnProperty(o)&&c(n[o])&&c(n[o].values)){var i=n[o];i.values=s.createTypedArray(i.componentDatatype,i.values)}var a=h.computeNumberOfVertices(e);return e.indices=y.createTypedArray(a,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}function K(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var o=t[n];r[n]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function j(e,t,r){var n=c(e.geometry.boundingSphere);t=X(t,n),r=X(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,r,i,a,s,u,l,f,m,h,d){if(c(u)||c(l)||c(f)||c(m)){var E=o.fromArray(s,3*e,Nt),p=o.fromArray(s,3*r,_t),y=o.fromArray(s,3*i,Ot),v=t(a,E,p,y,Mt);if(c(u)){var T=o.fromArray(u,3*e,Nt),g=o.fromArray(u,3*r,_t),S=o.fromArray(u,3*i,Ot);o.multiplyByScalar(T,v.x,T),o.multiplyByScalar(g,v.y,g),o.multiplyByScalar(S,v.z,S);var A=o.add(T,g,T);o.add(A,S,A),o.normalize(A,A),o.pack(A,h.normal.values,3*d)}if(c(l)){var C=o.fromArray(l,3*e,Nt),R=o.fromArray(l,3*r,_t),I=o.fromArray(l,3*i,Ot);o.multiplyByScalar(C,v.x,C),o.multiplyByScalar(R,v.y,R),o.multiplyByScalar(I,v.z,I);var N=o.add(C,R,C);o.add(N,I,N),o.normalize(N,N),o.pack(N,h.binormal.values,3*d)}if(c(f)){var _=o.fromArray(f,3*e,Nt),O=o.fromArray(f,3*r,_t),M=o.fromArray(f,3*i,Ot);o.multiplyByScalar(_,v.x,_),o.multiplyByScalar(O,v.y,O),o.multiplyByScalar(M,v.z,M);var w=o.add(_,O,_);o.add(w,M,w),o.normalize(w,w),o.pack(w,h.tangent.values,3*d)}if(c(m)){var L=n.fromArray(m,2*e,wt),b=n.fromArray(m,2*r,Lt),x=n.fromArray(m,2*i,bt);n.multiplyByScalar(L,v.x,L),n.multiplyByScalar(b,v.y,b),n.multiplyByScalar(x,v.z,x);var P=n.add(L,b,L);n.add(P,x,P),n.pack(P,h.st.values,2*d)}}}function Q(e,t,r,n,o,i){var a=e.position.values.length/3;if(-1!==o){var s=n[o],u=r[s];return-1===u?(r[s]=a,e.position.values.push(i.x,i.y,i.z),t.push(a),a):(t.push(u),u)}return e.position.values.push(i.x,i.y,i.z),t.push(a),a}function J(e){var t,r,n,i,a,s=e.geometry,u=s.attributes,l=u.position.values,f=c(u.normal)?u.normal.values:void 0,m=c(u.binormal)?u.binormal.values:void 0,h=c(u.tangent)?u.tangent.values:void 0,d=c(u.st)?u.st.values:void 0,E=s.indices,p=K(s),y=K(s),v=[];v.length=l.length/3;var T=[];for(T.length=l.length/3,a=0;a<v.length;++a)v[a]=-1,T[a]=-1;var g=E.length;for(a=0;g>a;a+=3){var S=E[a],A=E[a+1],C=E[a+2],R=o.fromArray(l,3*S),I=o.fromArray(l,3*A),N=o.fromArray(l,3*C),_=Y(R,I,N);if(c(_)&&_.positions.length>3)for(var O=_.positions,M=_.indices,w=M.length,L=0;w>L;++L){var b=M[L],x=O[b];x.y<0?(t=y.attributes,r=y.indices,n=v):(t=p.attributes,r=p.indices,n=T),i=Q(t,r,n,E,3>b?a+b:-1,x),Z(S,A,C,x,l,f,m,h,d,t,i)}else c(_)&&(R=_.positions[0],I=_.positions[1],N=_.positions[2]),R.y<0?(t=y.attributes,r=y.indices,n=v):(t=p.attributes,r=p.indices,n=T),i=Q(t,r,n,E,a,R),Z(S,A,C,R,l,f,m,h,d,t,i),i=Q(t,r,n,E,a+1,I),Z(S,A,C,I,l,f,m,h,d,t,i),i=Q(t,r,n,E,a+2,N),Z(S,A,C,N,l,f,m,h,d,t,i)}j(e,y,p)}function $(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,a=r.indices,s=K(r),u=K(r),l=a.length,f=[];f.length=i.length/3;var m=[];for(m.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,m[t]=-1;for(t=0;l>t;t+=2){var h=a[t],d=a[t+1],E=o.fromArray(i,3*h,Nt),p=o.fromArray(i,3*d,_t);Math.abs(E.y)<g.EPSILON6&&(E.y=E.y<0?-g.EPSILON6:g.EPSILON6),Math.abs(p.y)<g.EPSILON6&&(p.y=p.y<0?-g.EPSILON6:g.EPSILON6);var y=s.attributes,v=s.indices,S=m,A=u.attributes,C=u.indices,R=f,I=T.lineSegmentPlane(E,p,xt,Ot);if(c(I)){var N=o.multiplyByScalar(o.UNIT_Y,5*g.EPSILON9,Pt);E.y<0&&(o.negate(N,N),y=u.attributes,v=u.indices,S=f,A=s.attributes,C=s.indices,R=m);var _=o.add(I,N,Ft);Q(y,v,S,a,t,E),Q(y,v,S,a,-1,_),o.negate(N,N),o.add(I,N,_),Q(A,C,R,a,-1,_),Q(A,C,R,a,t+1,p)}else{var O,M,w;E.y<0?(O=u.attributes,M=u.indices,w=f):(O=s.attributes,M=s.indices,w=m),Q(O,M,w,a,t,E),Q(O,M,w,a,t+1,p)}}j(e,u,s)}function et(e){var t=e.geometry,r=t.attributes,a=r.position.values,s=r.prevPosition.values,u=r.nextPosition.values,l=r.expandAndWidth.values;t.indices;var f,m,h,d=c(r.st)?r.st.values:void 0,E=c(r.color)?r.color.values:void 0,p=K(t),y=K(t),v=a.length/3;for(f=0;v>f;f+=4){var S=f,A=f+1,C=f+2,R=f+3,I=o.fromArray(a,3*S,Bt),N=o.fromArray(a,3*A,zt),_=o.fromArray(a,3*C,Gt),O=o.fromArray(a,3*R,Vt);Math.abs(I.y)<g.EPSILON6&&(I.y=g.EPSILON6*(_.y<0?-1:1),N.y=I.y),Math.abs(_.y)<g.EPSILON6&&(_.y=g.EPSILON6*(I.y<0?-1:1),O.y=_.y);var M=p.attributes,w=p.indices,L=y.attributes,b=y.indices,x=T.lineSegmentPlane(I,_,xt,qt);if(c(x)){var P=o.multiplyByScalar(o.UNIT_Y,5*g.EPSILON9,Ht);I.y<0&&(o.negate(P,P),M=y.attributes,w=y.indices,L=p.attributes,b=p.indices);var F=o.add(x,P,Wt);for(M.position.values.push(I.x,I.y,I.z,N.x,N.y,N.z),M.position.values.push(F.x,F.y,F.z),M.position.values.push(F.x,F.y,F.z),o.negate(P,P),o.add(x,P,F),L.position.values.push(F.x,F.y,F.z),L.position.values.push(F.x,F.y,F.z),L.position.values.push(_.x,_.y,_.z,O.x,O.y,O.z),m=3*S;3*S+6>m;++m)M.prevPosition.values.push(s[m]);for(M.prevPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),L.prevPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),m=3*C;3*C+6>m;++m)L.prevPosition.values.push(s[m]);for(m=3*S;3*S+6>m;++m)M.nextPosition.values.push(u[m]);for(M.nextPosition.values.push(_.x,_.y,_.z,_.x,_.y,_.z),L.nextPosition.values.push(_.x,_.y,_.z,_.x,_.y,_.z),m=3*C;3*C+6>m;++m)L.nextPosition.values.push(u[m]);var D=n.fromArray(l,2*S,Dt),U=Math.abs(D.y);M.expandAndWidth.values.push(-1,U,1,U),M.expandAndWidth.values.push(-1,-U,1,-U),L.expandAndWidth.values.push(-1,U,1,U),L.expandAndWidth.values.push(-1,-U,1,-U);var B=o.magnitudeSquared(o.subtract(x,I,Vt));if(B/=o.magnitudeSquared(o.subtract(_,I,Vt)),c(E)){var z=i.fromArray(E,4*S,kt),G=i.fromArray(E,4*C,kt),V=g.lerp(z.x,G.x,B),q=g.lerp(z.y,G.y,B),H=g.lerp(z.z,G.z,B),W=g.lerp(z.w,G.w,B);for(m=4*S;4*S+8>m;++m)M.color.values.push(E[m]);for(M.color.values.push(V,q,H,W),M.color.values.push(V,q,H,W),L.color.values.push(V,q,H,W),L.color.values.push(V,q,H,W),m=4*C;4*C+8>m;++m)L.color.values.push(E[m])}if(c(d)){var k=n.fromArray(d,2*S,Dt),Y=n.fromArray(d,2*(f+3),Ut),X=g.lerp(k.x,Y.x,B);for(m=2*S;2*S+4>m;++m)M.st.values.push(d[m]);for(M.st.values.push(X,k.y),M.st.values.push(X,Y.y),L.st.values.push(X,k.y),L.st.values.push(X,Y.y),m=2*C;2*C+4>m;++m)L.st.values.push(d[m])}h=M.position.values.length/3-4,w.push(h,h+2,h+1),w.push(h+1,h+2,h+3),h=L.position.values.length/3-4,b.push(h,h+2,h+1),b.push(h+1,h+2,h+3)}else{var Z,Q;for(I.y<0?(Z=y.attributes,Q=y.indices):(Z=p.attributes,Q=p.indices),Z.position.values.push(I.x,I.y,I.z),Z.position.values.push(N.x,N.y,N.z),Z.position.values.push(_.x,_.y,_.z),Z.position.values.push(O.x,O.y,O.z),m=3*f;3*f+12>m;++m)Z.prevPosition.values.push(s[m]),Z.nextPosition.values.push(u[m]);for(m=2*f;2*f+8>m;++m)Z.expandAndWidth.values.push(l[m]),c(d)&&Z.st.values.push(d[m]);if(c(E))for(m=4*f;4*f+16>m;++m)Z.color.values.push(E[m]);h=Z.position.values.length/3-4,Q.push(h,h+2,h+1),Q.push(h+1,h+2,h+3)}}j(e,y,p)}var tt={};tt.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case R.TRIANGLES:e.indices=_(t);break;case R.TRIANGLE_STRIP:e.indices=O(t);break;case R.TRIANGLE_FAN:e.indices=M(t);break;default:throw new l("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=R.LINES}return e},tt.createLineSegmentsForVectors=function(e,t,n){t=u(t,"normal"),n=u(n,1e4);for(var o=e.attributes.position.values,i=e.attributes[t].values,a=o.length,l=new Float64Array(2*a),f=0,m=0;a>m;m+=3)l[f++]=o[m],l[f++]=o[m+1],l[f++]=o[m+2],l[f++]=o[m]+i[m]*n,l[f++]=o[m+1]+i[m+1]*n,l[f++]=o[m+2]+i[m+2]*n;var E,p=e.boundingSphere;return c(p)&&(E=new r(p.center,p.radius+n)),new h({attributes:{position:new d({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:R.LINES,boundingSphere:E})},tt.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],n=e.attributes,o={},i=0,a=r.length;for(t=0;a>t;++t){var s=r[t];c(n[s])&&(o[s]=i++)}for(var u in n)n.hasOwnProperty(u)&&!c(o[u])&&(o[u]=i++);return o},tt.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),o=0;t>o;o++)n[o]=-1;for(var i,a=r,u=a.length,l=y.createTypedArray(t,u),f=0,m=0,d=0;u>f;)i=n[a[f]],-1!==i?l[m]=i:(i=a[f],n[i]=d,l[m]=d,++d),++f,++m;e.indices=l;var E=e.attributes;for(var p in E)if(E.hasOwnProperty(p)&&c(E[p])&&c(E[p].values)){for(var v=E[p],T=v.values,g=0,S=v.componentsPerAttribute,A=s.createTypedArray(v.componentDatatype,d*S);t>g;){var C=n[g];if(-1!==C)for(o=0;S>o;o++)A[S*C+o]=T[S*g+o];++g}v.values=A}}return e},tt.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===R.TRIANGLES&&c(r)){for(var n=r.length,o=0,i=0;n>i;i++)r[i]>o&&(o=r[i]);e.indices=I.tipsify({indices:r,maximumIndex:o,cacheSize:t})}return e},tt.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>g.SIXTY_FOUR_KILOBYTES){var n,o=[],i=[],a=0,s=w(e.attributes),u=e.indices,l=u.length;e.primitiveType===R.TRIANGLES?n=3:e.primitiveType===R.LINES?n=2:e.primitiveType===R.POINTS&&(n=1);for(var f=0;l>f;f+=n){for(var m=0;n>m;++m){var d=u[f+m],E=o[d];c(E)||(E=a++,o[d]=E,L(s,e.attributes,d)),i.push(E)}a+n>g.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:s,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),o=[],i=[],a=0,s=w(e.attributes))}0!==i.length&&t.push(new h({attributes:s,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var rt=new o,nt=new a;tt.projectTo2D=function(e,t,r,n,i){var a=e.attributes[t];i=c(i)?i:new m;for(var u=i.ellipsoid,f=a.values,h=new Float64Array(f.length),E=0,p=0;p<f.length;p+=3){var y=o.fromArray(f,p,rt),v=u.cartesianToCartographic(y,nt);if(!c(v))throw new l("Could not project point ("+y.x+", "+y.y+", "+y.z+") to 2D.");var T=i.project(v,rt);h[E++]=T.x,h[E++]=T.y,h[E++]=T.z}return e.attributes[r]=a,e.attributes[n]=new d({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:h}),delete e.attributes[t],e};var ot={high:0,low:0};tt.encodeAttribute=function(e,t,r,n){for(var o=e.attributes[t],i=o.values,a=i.length,u=new Float32Array(a),c=new Float32Array(a),l=0;a>l;++l)f.encode(i[l],ot),u[l]=ot.high,c[l]=ot.low;var m=o.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:s.FLOAT,componentsPerAttribute:m,values:u}),e.attributes[n]=new d({componentDatatype:s.FLOAT,componentsPerAttribute:m,values:c}),delete e.attributes[t],e};var it=new o,at=new A,st=new S;tt.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var n=e.geometry.attributes;b(t,n.position),b(t,n.prevPosition),b(t,n.nextPosition),(c(n.normal)||c(n.binormal)||c(n.tangent))&&(A.inverse(t,at),A.transpose(at,at),A.getRotation(at,st),x(st,n.normal),x(st,n.binormal),x(st,n.tangent));var o=e.geometry.boundingSphere;return c(o)&&(e.geometry.boundingSphere=r.transform(o,t,o)),e.modelMatrix=A.clone(A.IDENTITY),e};var ut=new o;tt.combineInstances=function(e){for(var t=[],r=[],n=e.length,o=0;n>o;++o){var i=e[o];c(i.geometry)?t.push(i):r.push(i)}var a=[];return t.length>0&&a.push(F(t,"geometry")),r.length>0&&(a.push(F(r,"westHemisphereGeometry")),a.push(F(r,"eastHemisphereGeometry"))),a};var ct=new o,lt=new o,ft=new o,mt=new o;tt.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,a=t.length,u=new Array(i),c=new Array(a/3),l=new Array(a),f=0;i>f;f++)u[f]={indexOffset:0,count:0,currentCount:0};var m=0;for(f=0;a>f;f+=3){var h=t[f],E=t[f+1],p=t[f+2],y=3*h,v=3*E,T=3*p;lt.x=n[y],lt.y=n[y+1],lt.z=n[y+2],ft.x=n[v],ft.y=n[v+1],ft.z=n[v+2],mt.x=n[T],mt.y=n[T+1],mt.z=n[T+2],u[h].count++,u[E].count++,u[p].count++,o.subtract(ft,lt,ft),o.subtract(mt,lt,mt),c[m]=o.cross(ft,mt,new o),m++}var g=0;for(f=0;i>f;f++)u[f].indexOffset+=g,g+=u[f].count;m=0;var S;for(f=0;a>f;f+=3){S=u[t[f]];var A=S.indexOffset+S.currentCount;l[A]=m,S.currentCount++,S=u[t[f+1]],A=S.indexOffset+S.currentCount,l[A]=m,S.currentCount++,S=u[t[f+2]],A=S.indexOffset+S.currentCount,l[A]=m,S.currentCount++,m++}var C=new Float32Array(3*i);for(f=0;i>f;f++){var R=3*f;if(S=u[f],S.count>0){for(o.clone(o.ZERO,ct),m=0;m<S.count;m++)o.add(ct,c[l[S.indexOffset+m]],ct);o.normalize(ct,ct),C[R]=ct.x,C[R+1]=ct.y,C[R+2]=ct.z}else C[R]=0,C[R+1]=0,C[R+2]=1}return e.attributes.normal=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:C}),e};var ht=new o,dt=new o,Et=new o;tt.computeBinormalAndTangent=function(e){e.attributes;for(var t=e.indices,r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,a=e.attributes.position.values.length/3,u=t.length,c=new Array(3*a),l=0;l<c.length;l++)c[l]=0;var f,m,h;for(l=0;u>l;l+=3){var E=t[l],p=t[l+1],y=t[l+2];f=3*E,m=3*p,h=3*y;var v=2*E,T=2*p,g=2*y,S=r[f],A=r[f+1],C=r[f+2],R=i[v],I=i[v+1],N=i[T+1]-I,_=i[g+1]-I,O=1/((i[T]-R)*_-(i[g]-R)*N),M=(_*(r[m]-S)-N*(r[h]-S))*O,w=(_*(r[m+1]-A)-N*(r[h+1]-A))*O,L=(_*(r[m+2]-C)-N*(r[h+2]-C))*O;c[f]+=M,c[f+1]+=w,c[f+2]+=L,c[m]+=M,c[m+1]+=w,c[m+2]+=L,c[h]+=M,c[h+1]+=w,c[h+2]+=L}var b=new Float32Array(3*a),x=new Float32Array(3*a);for(l=0;a>l;l++){f=3*l,m=f+1,h=f+2;var P=o.fromArray(n,f,ht),F=o.fromArray(c,f,Et),D=o.dot(P,F);o.multiplyByScalar(P,D,dt),o.normalize(o.subtract(F,dt,F),F),x[f]=F.x,x[m]=F.y,x[h]=F.z,o.normalize(o.cross(P,F,F),F),b[f]=F.x,b[m]=F.y,b[h]=F.z}return e.attributes.tangent=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:x}),e.attributes.binormal=new d({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:b}),e};var pt=new n,yt=new o,vt=new o,Tt=new o;tt.compressVertices=function(t){var r=t.attributes.normal,i=t.attributes.st;if(!c(r)&&!c(i))return t;var a,u,l,f,m=t.attributes.tangent,h=t.attributes.binormal;c(r)&&(a=r.values),c(i)&&(u=i.values),c(m)&&(l=m.values),h&&(f=h.values);var E=c(a)?a.length:u.length,p=c(a)?3:2,y=E/p,v=y,T=c(u)&&c(a)?2:1;T+=c(l)||c(f)?1:0,v*=T;for(var g=new Float32Array(v),S=0,A=0;y>A;++A){c(u)&&(n.fromArray(u,2*A,pt),g[S++]=e.compressTextureCoordinates(pt));var C=3*A;c(a)&&c(l)&&c(f)?(o.fromArray(a,C,yt),o.fromArray(l,C,vt),o.fromArray(f,C,Tt),e.octPack(yt,vt,Tt,pt),g[S++]=pt.x,g[S++]=pt.y):(c(a)&&(o.fromArray(a,C,yt),g[S++]=e.octEncodeFloat(yt)),c(l)&&(o.fromArray(l,C,yt),g[S++]=e.octEncodeFloat(yt)),c(f)&&(o.fromArray(f,C,yt),g[S++]=e.octEncodeFloat(yt)))}return t.attributes.compressedAttributes=new d({componentDatatype:s.FLOAT,componentsPerAttribute:T,values:g}),c(a)&&delete t.attributes.normal,c(u)&&delete t.attributes.st,c(l)&&delete t.attributes.tangent,c(f)&&delete t.attributes.binormal,t};var gt=new o,St=new o,At=new o,Ct=new o,Rt=new o,It={positions:new Array(7),indices:new Array(9)},Nt=new o,_t=new o,Ot=new o,Mt=new o,wt=new n,Lt=new n,bt=new n,xt=C.fromPointNormal(o.ZERO,o.UNIT_Y),Pt=new o,Ft=new o,Dt=new n,Ut=new n,Bt=new o,zt=new o,Gt=new o,Vt=new o,qt=new o,Ht=new o,Wt=new o,kt=new i;return new i,tt.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var o=n.center.x-n.radius;if(o>0||r.intersectPlane(n,C.ORIGIN_ZX_PLANE)!==v.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:et(e);break;case p.TRIANGLES:J(e);break;case p.LINES:$(e)}else q(t),t.primitiveType===R.TRIANGLES?J(e):t.primitiveType===R.LINES&&$(e);return e},tt}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,o,i,a,s){"use strict";var u=function(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return o(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.mercatorAngleToGeodeticLatitude=function(e){return s.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},u.geodeticLatitudeToMercatorAngle=function(e){e>u.MaximumLatitude?e=u.MaximumLatitude:e<-u.MaximumLatitude&&(e=-u.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},u.MaximumLatitude=u.mercatorAngleToGeodeticLatitude(Math.PI),u.prototype.project=function(t,r){var o=this._semimajorAxis,i=t.longitude*o,a=u.geodeticLatitudeToMercatorAngle(t.latitude)*o,s=t.height;return n(r)?(r.x=i,r.y=a,r.z=s,r):new e(i,a,s)},u.prototype.unproject=function(e,r){var o=this._oneOverSemimajorAxis,i=e.x*o,a=u.mercatorAngleToGeodeticLatitude(e.y*o),s=e.z;return n(r)?(r.longitude=i,r.latitude=a,r.height=s,r):new t(i,a,s)},u}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,o,i,a,s,u,c,l,f,m,h,d,E){"use strict";function p(e,t,r){var n,o=!r,i=e.length;if(!o&&i>1){var a=e[0].modelMatrix;for(n=1;i>n;++n)if(!d.equals(a,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;i>n;++n)m.transformToWorldCoordinates(e[n]);else d.multiplyTransformation(t,e[0].modelMatrix,t)}function y(e,n){var o=e.attributes,i=o.position,a=4*(i.values.length/i.componentsPerAttribute);o.pickColor=new l({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0,values:new Uint8Array(a)});for(var s=t.floatToByte(n.red),u=t.floatToByte(n.green),c=t.floatToByte(n.blue),f=t.floatToByte(n.alpha),m=o.pickColor.values,h=0;a>h;h+=4)m[h]=s,m[h+1]=u,m[h+2]=c,m[h+3]=f}function v(e,t){for(var r=e.length,n=0;r>n;++n){var i=e[n],a=t[n];o(i.geometry)?y(i.geometry,a):(y(i.westHemisphereGeometry,a),y(i.eastHemisphereGeometry,a))}}function T(e){var t,r=e.length,n=[],i=e[0].attributes;for(t in i)if(i.hasOwnProperty(t)){for(var a=i[t],s=!0,u=1;r>u;++u){var c=e[u].attributes[t];if(!o(c)||a.componentDatatype!==c.componentDatatype||a.componentsPerAttribute!==c.componentsPerAttribute||a.normalize!==c.normalize){s=!1;break}}s&&n.push(t)}return n}function g(e,t,n){for(var o=c.computeNumberOfVertices(t),i=n.length,a=0;i>a;++a){for(var s=n[a],u=e[s],f=u.componentDatatype,m=u.value,h=m.length,d=r.createTypedArray(f,o*h),E=0;o>E;++E)d.set(m,E*h);t.attributes[s]=new l({componentDatatype:f,componentsPerAttribute:h,normalize:u.normalize,values:d})}}function S(e,t){for(var r=e.length,n=0;r>n;++n){var i=e[n],a=i.attributes;o(i.geometry)?g(a,i.geometry,t):(g(a,i.westHemisphereGeometry,t),g(a,i.eastHemisphereGeometry,t))}}function A(t){var n,i,a=t.instances,s=t.pickIds,u=t.projection,c=t.elementIndexUintSupported,l=t.scene3DOnly,f=t.allowPicking,h=t.vertexCacheOptimize,d=t.compressVertices,E=t.modelMatrix,y=a.length;if(a[0].geometry.primitiveType,p(a,E,l),!l)for(n=0;y>n;++n)m.splitLongitude(a[n]);f&&v(a,s);var g=T(a);if(S(a,g),h)for(n=0;y>n;++n){var A=a[n];o(A.geometry)?(m.reorderForPostVertexCache(A.geometry),m.reorderForPreVertexCache(A.geometry)):(m.reorderForPostVertexCache(A.westHemisphereGeometry),m.reorderForPreVertexCache(A.westHemisphereGeometry),m.reorderForPostVertexCache(A.eastHemisphereGeometry),m.reorderForPreVertexCache(A.eastHemisphereGeometry))}var C=m.combineInstances(a);for(y=C.length,n=0;y>n;++n){i=C[n];var R,I=i.attributes;if(l)for(R in I)I.hasOwnProperty(R)&&I[R].componentDatatype===r.DOUBLE&&m.encodeAttribute(i,R,R+"3DHigh",R+"3DLow");else for(R in I)if(I.hasOwnProperty(R)&&I[R].componentDatatype===r.DOUBLE){var N=R+"3D",_=R+"2D";m.projectTo2D(i,R,N,_,u),o(i.boundingSphere)&&"position"===R&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),m.encodeAttribute(i,N,N+"High",N+"Low"),m.encodeAttribute(i,_,_+"High",_+"Low")}d&&m.compressVertices(i)}if(!c){var O=[];for(y=C.length,n=0;y>n;++n)i=C[n],O=O.concat(m.fitToUnsignedShortIndices(i));C=O}return C}function C(e,t,n){for(var o=[],i=e.attributes,a=n.length,s=0;a>s;++s){var u=n[s],c=i[u],l=c.componentDatatype;l===r.DOUBLE&&(l=r.FLOAT);var f=r.createTypedArray(l,c.values);o.push({index:t[u],componentDatatype:l,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,values:f}),delete i[u]}return o}function R(e,t,r,i,a,s,u,l,f){var m=c.computeNumberOfVertices(t);o(u[e])||(u[e]={boundingSphere:t.boundingSphere,boundingSphereCV:t.boundingSphereCV});for(var h=i.length,d=0;h>d;++d)for(var E=i[d],p=a[E],y=m;y>0;){for(var v,T=n(f[E],0),g=s[T],S=g.length,A=0;S>A&&(v=g[A],v.index!==p);++A);o(u[e][E])||(u[e][E]={dirty:!1,valid:!0,value:r[E].value,indices:[]});var C,R=v.values.length/v.componentsPerAttribute,I=n(l[E],0);R>I+y?(C=y,u[e][E].indices.push({attribute:v,offset:I,count:C}),l[E]=I+y):(C=R-I,u[e][E].indices.push({attribute:v,offset:I,count:C}),l[E]=0,f[E]=T+1),y-=C}}function I(e,t,r,n,i){var a,s,u,c=[],l=e.length,f={},m={};for(a=0;l>a;++a)s=e[a],u=s.attributes,o(s.geometry)&&R(a,s.geometry,u,i,n,r,c,f,m);for(a=0;l>a;++a)s=e[a],u=s.attributes,o(s.westHemisphereGeometry)&&R(a,s.westHemisphereGeometry,u,i,n,r,c,f,m);for(a=0;l>a;++a)s=e[a],u=s.attributes,o(s.eastHemisphereGeometry)&&R(a,s.eastHemisphereGeometry,u,i,n,r,c,f,m);for(l=t.length,a=0;l>a;++a){s=t[a],u=s.attributes;var h={};c.push(h);for(var d=i.length,E=0;d>E;++E){var p=i[E];h[p]={dirty:!1,valid:!1,value:u[p].value,indices:[]}}}return c}function N(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var i=r[n];o(i)&&o(i.values)&&t.push(i.values.buffer)}o(e.indices)&&t.push(e.indices.buffer)}function _(e,t){for(var r=e.length,n=0;r>n;++n)N(e[n],t)}function O(e,t){for(var r=e.length,n=0;r>n;++n)for(var o=e[n],i=o.length,a=0;i>a;++a)t.push(o[a].values.buffer)}function M(t){for(var r=1,n=t.length,i=0;n>i;i++){var a=t[i];if(++r,o(a)){var s=a.attributes;r+=6+2*e.packedLength+(o(a.indices)?a.indices.length:0);for(var u in s)if(s.hasOwnProperty(u)&&o(s[u])){var c=s[u];r+=5+c.values.length}}}return r}function w(e,t){for(var r=e.length,n=new Uint32Array(e.length),o=0;r>o;++o)n[o]=e[o].toRgba();return t.push(n.buffer),n}function L(e){for(var r=e.length,n=new Array(r),o=0;r>o;o++)n[o]=t.fromRgba(e[o]);return n}function b(e){for(var t=e.length,r=1+17*t,n=0;t>n;n++){var i=e[n].attributes;for(var a in i)if(i.hasOwnProperty(a)&&o(i[a])){var s=i[a];r+=5+s.value.length}}return r}function x(e,t){var r=new Float64Array(b(e)),n={},i=[],a=e.length,s=0;r[s++]=a;for(var u=0;a>u;u++){var c=e[u];d.pack(c.modelMatrix,r,s),s+=d.packedLength;var l=c.attributes,f=[];for(var m in l)l.hasOwnProperty(m)&&o(l[m])&&(f.push(m),o(n[m])||(n[m]=i.length,i.push(m)));r[s++]=f.length;for(var h=0;h<f.length;h++){var E=f[h],p=l[E];r[s++]=n[E],r[s++]=p.componentDatatype,r[s++]=p.componentsPerAttribute,r[s++]=p.normalize,r[s++]=p.value.length,r.set(p.value,s),s+=p.value.length}}return t.push(r.buffer),{stringTable:i,packedData:r}}function P(e){for(var t=e.packedData,n=e.stringTable,o=new Array(t[0]),i=0,a=1;a<t.length;){var s=d.unpack(t,a);a+=d.packedLength;for(var u={},c=t[a++],l=0;c>l;l++){for(var f=n[t[a++]],m=t[a++],h=t[a++],E=0!==t[a++],p=t[a++],y=r.createTypedArray(m,p),v=0;p>v;v++)y[v]=t[a++];u[f]={componentDatatype:m,componentsPerAttribute:h,normalize:E,value:y}}o[i++]={attributes:u,modelMatrix:s}}return o}function F(t){for(var r=t.length,n=1+r,i=0;r>i;i++){var a=t[i];n+=2,n+=o(a.boundingSphere)?e.packedLength:0,n+=o(a.boundingSphereCV)?e.packedLength:0;for(var s in a)if(a.hasOwnProperty(s)&&o(a[s])&&"boundingSphere"!==s&&"boundingSphereCV"!==s){var u=a[s];n+=4+3*u.indices.length+u.value.length}}return n}function D(t,r){var n=new Float64Array(F(t)),i=[],a=[],s={},u=t.length,c=0;n[c++]=u;for(var l=0;u>l;l++){var f=t[l],m=f.boundingSphere,h=o(m);n[c++]=h?1:0,h&&(e.pack(m,n,c),c+=e.packedLength),m=f.boundingSphereCV,h=o(m),n[c++]=h?1:0,h&&(e.pack(m,n,c),c+=e.packedLength);var d=[];for(var E in f)f.hasOwnProperty(E)&&o(f[E])&&"boundingSphere"!==E&&"boundingSphereCV"!==E&&(d.push(E),o(s[E])||(s[E]=i.length,i.push(E)));n[c++]=d.length;for(var p=0;p<d.length;p++){var y=d[p],v=f[y];n[c++]=s[y],n[c++]=v.valid?1:0;var T=v.indices,g=T.length;n[c++]=g;for(var S=0;g>S;S++){var A=T[S];n[c++]=A.count,n[c++]=A.offset;var C=a.indexOf(A.attribute);-1===C&&(C=a.length,a.push(A.attribute)),n[c++]=C}n[c++]=v.value.length,n.set(v.value,c),c+=v.value.length}}return r.push(n.buffer),{stringTable:i,packedData:n,attributeTable:a}}function U(t){for(var n=t.stringTable,o=t.attributeTable,i=t.packedData,a=new Array(i[0]),s=0,u=1,c=i.length;c>u;){var l={},f=1===i[u++];f&&(l.boundingSphere=e.unpack(i,u),u+=e.packedLength),f=1===i[u++],f&&(l.boundingSphereCV=e.unpack(i,u),u+=e.packedLength);for(var m=i[u++],h=0;m>h;h++){for(var d=n[i[u++]],E=1===i[u++],p=i[u++],y=p>0?new Array(p):void 0,v=0;p>v;v++){var T={};T.count=i[u++],T.offset=i[u++],T.attribute=o[i[u++]],y[v]=T}for(var g=i[u++],S=E?r.createTypedArray(y[0].attribute.componentDatatype,g):new Array(g),A=0;g>A;A++)S[A]=i[u++];l[d]={dirty:!1,valid:E,indices:y,value:S}}a[s++]=l}return a}if(!s.supportsTypedArrays())return{};var B={};return B.combineGeometry=function(e){var t,r,n,i,a,s=e.instances,u=e.invalidInstances;if(s.length>0){t=A(e),r=m.createAttributeLocations(t[0]),i=T(s),n=[],a=t.length;for(var c=0;a>c;++c){var l=t[c];n.push(C(l,r,i))}}i=o(i)?i:T(u);var f=I(s,u,n,r,i);return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:r,vaAttributes:n,vaAttributeLocations:f,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices}},B.packCreateGeometryResults=function(t,r){var n=new Float64Array(M(t)),i=[],a={},s=t.length,u=0;n[u++]=s;for(var c=0;s>c;c++){var l=t[c],f=o(l);if(n[u++]=f?1:0,f){n[u++]=l.primitiveType,n[u++]=l.geometryType;var m=o(l.boundingSphere)?1:0;n[u++]=m,m&&e.pack(l.boundingSphere,n,u),u+=e.packedLength;var h=o(l.boundingSphereCV)?1:0;n[u++]=h,h&&e.pack(l.boundingSphereCV,n,u),u+=e.packedLength;var d=l.attributes,E=[];for(var p in d)d.hasOwnProperty(p)&&o(d[p])&&(E.push(p),o(a[p])||(a[p]=i.length,i.push(p)));n[u++]=E.length;for(var y=0;y<E.length;y++){var v=E[y],T=d[v];n[u++]=a[v],n[u++]=T.componentDatatype,n[u++]=T.componentsPerAttribute,n[u++]=T.normalize?1:0,n[u++]=T.values.length,n.set(T.values,u),u+=T.values.length}var g=o(l.indices)?l.indices.length:0;n[u++]=g,g>0&&(n.set(l.indices,u),u+=g)}}return r.push(n.buffer),{stringTable:i,packedData:n}},B.unpackCreateGeometryResults=function(t){for(var n,o=t.stringTable,i=t.packedData,a=new Array(i[0]),s=0,u=1;u<i.length;){var m=1===i[u++];if(m){var d,E,p=i[u++],y=i[u++],v=1===i[u++];v&&(d=e.unpack(i,u)),u+=e.packedLength;var T=1===i[u++];T&&(E=e.unpack(i,u)),u+=e.packedLength;var g,S,A,C=new f,R=i[u++];for(n=0;R>n;n++){var I=o[i[u++]],N=i[u++];A=i[u++];var _=0!==i[u++];g=i[u++],S=r.createTypedArray(N,g);for(var O=0;g>O;O++)S[O]=i[u++];C[I]=new l({componentDatatype:N,componentsPerAttribute:A,normalize:_,values:S})}var M;if(g=i[u++],g>0){var w=S.length/A;for(M=h.createTypedArray(w,g),n=0;g>n;n++)M[n]=i[u++]}a[s++]=new c({primitiveType:p,geometryType:y,boundingSphere:d,indices:M,attributes:C})}else a[s++]=void 0}return a},B.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,o=0;n>o;o++)t.push(r[o].packedData.buffer);var i;return e.allowPicking&&(i=w(e.pickIds,t)),{createGeometryResults:e.createGeometryResults,packedInstances:x(e.instances,t),packedPickIds:i,ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof u,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix}
  },B.unpackCombineGeometryParameters=function(e){for(var t=P(e.packedInstances),r=e.allowPicking,n=r?L(e.packedPickIds):void 0,i=e.createGeometryResults,s=i.length,c=0,l=[],f=[],m=[],h=[],p=[],y=0;s>y;y++)for(var v=B.unpackCreateGeometryResults(i[y]),T=v.length,g=0;T>g;g++){var S=v[g],A=t[c];o(S)?(A.geometry=S,l.push(A),m.push(c),r&&p.push(n[c])):(f.push(A),h.push(c)),++c}var C=a.clone(e.ellipsoid),R=e.isGeographic?new u(C):new E(C);return{instances:l,invalidInstances:f,validInstancesIndices:m,invalidInstancesIndices:h,pickIds:p,ellipsoid:C,projection:R,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,allowPicking:e.allowPicking,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:d.clone(e.modelMatrix)}},B.packCombineGeometryResults=function(e,t){return o(e.geometries)&&(_(e.geometries,t),O(e.vaAttributes,t)),{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,packedVaAttributeLocations:D(e.vaAttributeLocations,t),modelMatrix:e.modelMatrix,validInstancesIndices:e.validInstancesIndices,invalidInstancesIndices:e.invalidInstancesIndices}},B.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,vaAttributes:e.vaAttributes,perInstanceAttributeLocations:U(e.packedVaAttributeLocations,e.vaAttributes),modelMatrix:e.modelMatrix}},B}),define("Core/formatError",["./defined"],function(e){"use strict";var t=function(t){var r,n=t.name,o=t.message;r=e(n)&&e(o)?n+": "+o:t.toString();var i=t.stack;return e(i)&&(r+="\n"+i),r};return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";var n=function(n){var o,i=[],a={id:void 0,result:void 0,error:void 0};return function(s){var u=s.data;i.length=0,a.id=u.id,a.error=void 0,a.result=void 0;try{a.result=n(u.parameters,i)}catch(c){a.error=c instanceof Error?{name:c.name,message:c.message,stack:c.stack}:c}t(o)||(o=e(self.webkitPostMessage,self.postMessage)),u.canTransferArrayBuffer||(i.length=0);try{o(a,i)}catch(c){a.result=void 0,a.error="postMessage failed with error: "+r(c)+"\n  with responseMessage: "+JSON.stringify(a),o(a)}}};return n}),define("Workers/combineGeometry",["../Scene/PrimitivePipeline","./createTaskProcessorWorker"],function(e,t){"use strict";function r(t,r){var n=e.unpackCombineGeometryParameters(t),o=e.combineGeometry(n);return e.packCombineGeometryResults(o,r)}return t(r)})}();