/** * Cesium - https://github.com/AnalyticalGraphicsInc/cesium * * Copyright 2011-2017 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";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),n>=r)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),n>r)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a.typeOf.number.equals=function(e,r,n,i){if(a.typeOf.number(e,n),a.typeOf.number(r,i),n!==i)throw new t(e+" must be equal to "+r+", the actual values are "+n+" and "+i)},a}),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";function t(e,t){return void 0!==e&&null!==e?e:t}return t.EMPTY_OBJECT=e({}),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>>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>>1^t[1&e];for(;r>>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^=e<<7&2636928640,e^=e<<15&4022730752,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,r,n){"use strict";var a={};a.Radious=6378137,a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:0>e?-1:0},a.signNotZero=function(e){return 0>e?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){if(!r(e))throw new n("degrees is required.");return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){if(!r(e))throw new n("radians is required.");return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){if(!r(e))throw new n("angle is required.");var t=a.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},a.clampToLatitudeRange=function(e){if(!r(e))throw new n("angle is required.");return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){if(!r(e))throw new n("angle is required.");return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){if(!r(e))throw new n("angle is required.");var t=a.mod(e,a.TWO_PI);return Math.abs(t)a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){if(!r(e))throw new n("m is required.");if(!r(t))throw new n("n is required.");return(e%t+t)%t},a.equalsEpsilon=function(e,a,i,o){if(!r(e))throw new n("left is required.");if(!r(a))throw new n("right is required.");if(!r(i))throw new n("relativeEpsilon is required.");o=t(o,i);var u=Math.abs(e-a);return o>=u||u<=i*Math.max(Math.abs(e),Math.abs(a))};var i=[1];a.factorial=function(e){if("number"!=typeof e||0>e)throw new n("A number greater than or equal to 0 is required.");var t=i.length;if(e>=t)for(var r=i[t-1],a=t;e>=a;a++)i.push(r*a);return i[e]},a.incrementWrap=function(e,a,i){if(i=t(i,0),!r(e))throw new n("n is required.");if(i>=a)throw new n("maximumValue must be greater than minimumValue.");return++e,e>a&&(e=i),e},a.isPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new n("A number greater than or equal to 0 is required.");return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){if("number"!=typeof e||0>e)throw new n("A number greater than or equal to 0 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,a){if(!r(e))throw new n("value is required");if(!r(t))throw new n("min is required.");if(!r(a))throw new n("max is required.");return t>e?t:e>a?a:e};var o=new e;return a.setRandomNumberSeed=function(t){if(!r(t))throw new n("seed is required.");o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.randomBetween=function(e,t){return a.nextRandomNumber()*(t-e)+e},a.acosClamped=function(e){if(!r(e))throw new n("value is required.");return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){if(!r(e))throw new n("value is required.");return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){if(!r(e))throw new n("angle is required.");if(!r(t))throw new n("radius is required.");return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){if(!r(e))throw new n("number is required.");if(!r(t))throw new n("base is required.");return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(n,a){e.typeOf.object("spherical",n),r(a)||(a=new o);var i=n.clock,u=n.cone,s=t(n.magnitude,1),c=s*Math.sin(u);return a.x=c*Math.cos(i),a.y=c*Math.sin(i),a.z=s*Math.cos(u),a},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z):void 0},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(r,n,a){return e.typeOf.object("value",r),e.defined("array",n),a=t(a,0),n[a++]=r.x,n[a++]=r.y,n[a]=r.z,n},o.unpack=function(n,a,i){return e.defined("array",n),a=t(a,0),r(i)||(i=new o),i.x=n[a++],i.y=n[a++],i.z=n[a],i},o.packArray=function(t,n){e.defined("array",t);var a=t.length;r(n)?n.length=3*a:n=new Array(3*a);for(var i=0;a>i;++i)o.pack(t[i],n,3*i);return n},o.unpackArray=function(t,a){if(e.defined("array",t),e.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!==0)throw new n("array length must be a multiple of 3.");var i=t.length;r(a)?a.length=i/3:a=new Array(i/3);for(var u=0;i>u;u+=3){var s=u/3;a[s]=o.unpack(t,u,a[s])}return a},o.fromArray=o.unpack,o.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.min(t.x,r.x),n.y=Math.min(t.y,r.y),n.z=Math.min(t.z,r.z),n},o.maximumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.max(t.x,r.x),n.y=Math.max(t.y,r.y),n.z=Math.max(t.z,r.z),n},o.magnitudeSquared=function(t){return e.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.subtract(t,r,u),o.magnitude(u)},o.distanceSquared=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.subtract(t,r,u),o.magnitudeSquared(u)},o.normalize=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var a=o.magnitude(t);if(r.x=t.x/a,r.y=t.y/a,r.z=t.z/a,isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new n("normalized result is not a number");return r},o.dot=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),t.x*r.x+t.y*r.y+t.z*r.z},o.multiplyComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x*r.x,n.y=t.y*r.y,n.z=t.z*r.z,n},o.divideComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x/r.x,n.y=t.y/r.y,n.z=t.z/r.z,n},o.add=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x+r.x,n.y=t.y+r.y,n.z=t.z+r.z,n},o.subtract=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x-r.x,n.y=t.y-r.y,n.z=t.z-r.z,n},o.multiplyByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x*r,n.y=t.y*r,n.z=t.z*r,n},o.divideByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x/r,n.y=t.y/r,n.z=t.z/r,n},o.negate=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=-t.x,r.y=-t.y,r.z=-t.z,r},o.abs=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=Math.abs(t.x),r.y=Math.abs(t.y),r.z=Math.abs(t.z),r};var s=new o;o.lerp=function(t,r,n,a){return e.typeOf.object("start",t),e.typeOf.object("end",r),e.typeOf.number("t",n),e.typeOf.object("result",a),o.multiplyByScalar(r,n,s),a=o.multiplyByScalar(t,1-n,a),o.add(s,a,a)};var c=new o,f=new o;o.angleBetween=function(t,r){e.typeOf.object("left",t),e.typeOf.object("right",r),o.normalize(t,c),o.normalize(r,f);var n=o.dot(c,f),a=o.magnitude(o.cross(c,f,c));return Math.atan2(a,n)};var l=new o;o.mostOrthogonalAxis=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var n=o.normalize(t,l);return o.abs(n,n),r=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,r):o.clone(o.UNIT_Z,r):n.y<=n.z?o.clone(o.UNIT_Y,r):o.clone(o.UNIT_Z,r)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(t,r,n){e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n);var a=t.x,i=t.y,o=t.z,u=r.x,s=r.y,c=r.z,f=i*c-o*s,l=o*u-a*c,E=a*s-i*u;return n.x=f,n.y=l,n.z=E,n},o.fromDegrees=function(t,r,n,a,u){return e.typeOf.number("longitude",t),e.typeOf.number("latitude",r),t=i.toRadians(t),r=i.toRadians(r),o.fromRadians(t,r,n,a,u)};var E=new o,y=new o,p=new o(40680631590769,40680631590769,40408299984661.445),h=new o(40680631590769,40680631590769,40680631590769);return o.fromRadians=function(n,a,u,s,c){e.typeOf.number("longitude",n),e.typeOf.number("latitude",a),u=t(u,0);var f=r(s)?s.radiiSquared:p;i.Radious>6356753&&(f=r(s)?s.radiiSquared:h);var l=Math.cos(a);E.x=l*Math.cos(n),E.y=l*Math.sin(n),E.z=Math.sin(a),E=o.normalize(E,E),o.multiplyComponents(f,E,y);var O=Math.sqrt(o.dot(E,y));return y=o.divideByScalar(y,O,y),E=o.multiplyByScalar(E,u,E),r(c)||(c=new o),o.add(y,E,c)},o.fromDegreesArray=function(t,a,i){if(e.defined("coordinates",t),t.length<2||t.length%2!==0)throw new n("the number of coordinates must be a multiple of 2 and at least 2");var u=t.length;r(i)?i.length=u/2:i=new Array(u/2);for(var s=0;u>s;s+=2){var c=t[s],f=t[s+1],l=s/2;i[l]=o.fromDegrees(c,f,0,a,i[l])}return i},o.fromRadiansArray=function(t,a,i){if(e.defined("coordinates",t),t.length<2||t.length%2!==0)throw new n("the number of coordinates must be a multiple of 2 and at least 2");var u=t.length;r(i)?i.length=u/2:i=new Array(u/2);for(var s=0;u>s;s+=2){var c=t[s],f=t[s+1],l=s/2;i[l]=o.fromRadians(c,f,0,a,i[l])}return i},o.fromDegreesArrayHeights=function(t,a,i){if(e.defined("coordinates",t),t.length<3||t.length%3!==0)throw new n("the number of coordinates must be a multiple of 3 and at least 3");var u=t.length;r(i)?i.length=u/3:i=new Array(u/3);for(var s=0;u>s;s+=3){var c=t[s],f=t[s+1],l=t[s+2],E=s/3;i[E]=o.fromDegrees(c,f,l,a,i[E])}return i},o.fromRadiansArrayHeights=function(t,a,i){if(e.defined("coordinates",t),t.length<3||t.length%3!==0)throw new n("the number of coordinates must be a multiple of 3 and at least 3");var u=t.length;r(i)?i.length=u/3:i=new Array(u/3);for(var s=0;u>s;s+=3){var c=t[s],f=t[s+1],l=t[s+2],E=s/3;i[E]=o.fromRadians(c,f,l,a,i[E])}return i},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(a,u,s,c,f){if(!t(a))throw new r("cartesian is required.");if(!t(u))throw new r("oneOverRadii is required.");if(!t(s))throw new r("oneOverRadiiSquared is required.");if(!t(c))throw new r("centerToleranceSquared is required.");var l=a.x,E=a.y,y=a.z,p=u.x,h=u.y,O=u.z,_=l*l*p*p,d=E*E*h*h,T=y*y*O*O,R=_+d+T,m=Math.sqrt(1/R),A=e.multiplyByScalar(a,m,i);if(c>R)return isFinite(m)?e.clone(A,f):void 0;var N=s.x,S=s.y,b=s.z,I=o;I.x=A.x*N*2,I.y=A.y*S*2,I.z=A.z*b*2;var M,x,g,w,v,C,U,L,P,F,D,B=(1-m)*e.magnitude(a)/(.5*e.magnitude(I)),j=0;do{B-=j,g=1/(1+B*N),w=1/(1+B*S),v=1/(1+B*b),C=g*g,U=w*w,L=v*v,P=C*g,F=U*w,D=L*v,M=_*C+d*U+T*L-1,x=_*P*N+d*F*S+T*D*b;var z=-2*x;j=M/z}while(Math.abs(M)>n.EPSILON12);return t(f)?(f.x=l*g,f.y=E*w,f.z=y*v,f):new e(l*g,E*w,y*v)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,t,n){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(n,0)}u.fromRadians=function(e,a,i,o){return t.typeOf.number("longitude",e),t.typeOf.number("latitude",a),i=r(i,0),n(o)?(o.longitude=e,o.latitude=a,o.height=i,o):new u(e,a,i)},u.fromDegrees=function(e,r,n,a){return t.typeOf.number("longitude",e),t.typeOf.number("latitude",r),e=i.toRadians(e),r=i.toRadians(r),u.fromRadians(e,r,n,a)};var s=new e,c=new e,f=new e,l=new e(1/6378137,1/6378137,1/6356752.314245179),E=new e(1/6378137,1/6378137,1/6378137),y=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=new e(1/40680631590769,1/40680631590769,1/40680631590769),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var O=n(r)?r.oneOverRadii:l,_=n(r)?r.oneOverRadiiSquared:y,d=n(r)?r._centerToleranceSquared:h;i.Radious>6356753&&(O=n(r)?r.oneOverRadii:E,_=n(r)?r.oneOverRadiiSquared:p);var T=o(t,O,_,d,c);if(n(T)){var R=e.multiplyComponents(T,_,s);R=e.normalize(R,R);var m=e.subtract(t,T,f),A=Math.atan2(R.y,R.x),N=Math.asin(R.z),S=i.sign(e.dot(m,t))*e.magnitude(m);return n(a)?(a.longitude=A,a.latitude=N,a.height=S,a):new u(A,N,S)}},u.clone=function(e,t){return n(e)?n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height):void 0},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,r,a){return t.typeOf.number("epsilon",a),e===r||n(e)&&n(r)&&Math.abs(e.longitude-r.longitude)<=a&&Math.abs(e.latitude-r.latitude)<=a&&Math.abs(e.height-r.height)<=a},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u.sphericalDistance=function(e,t,r,a){if(!n(e)||!n(r))throw new DeveloperError("longitude is required.");if(!n(t)||!n(a))throw new DeveloperError("latitude is required.");if(e===r&&t===a)return 0;var o=i.toRadians(t),u=i.toRadians(a),s=i.toRadians(e),c=i.toRadians(r),f=s*s+o*o,l=c*c+u*u,E=(s-c)*(s-c)+(o-u)*(o-u),y=(f+l-E)/(2*Math.sqrt(f)*Math.sqrt(l));return y=i.clamp(y,-1,1),Math.acos(y)*i.Radious},u}),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","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function f(t,a,i,o){a=n(a,0),i=n(i,0),o=n(o,0),s.equalsEpsilon(o,6378137,s.EPSILON10)&&(s.Radious=o),r.typeOf.number.greaterThanOrEquals("x",a,0),r.typeOf.number.greaterThanOrEquals("y",i,0),r.typeOf.number.greaterThanOrEquals("z",o,0),t._radii=new e(a,i,o),t._radiiSquared=new e(a*a,i*i,o*o),t._radiiToTheFourth=new e(a*a*a*a,i*i*i*i,o*o*o*o),t._oneOverRadii=new e(0===a?0:1/a,0===i?0:1/i,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===a?0:1/(a*a),0===i?0:1/(i*i),0===o?0:1/(o*o)),t._minimumRadius=Math.min(a,i,o),t._maximumRadius=Math.max(a,i,o),t._centerToleranceSquared=s.EPSILON1,0!==t._radiiSquared.z&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,f(this,e,t,r)}i(l.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}}}),l.clone=function(t,r){if(a(t)){var n=t._radii;return a(r)?(e.clone(n,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 l(n.x,n.y,n.z)}},l.fromCartesian3=function(e,t){return a(t)||(t=new l),a(e)?(f(t,e.x,e.y,e.z),t):t},l.WGS84=u(new l(6378137,6378137,s.Radious)),l.UNIT_SPHERE=u(new l(1,1,1)),l.MOON=u(new l(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,a,i){return r.typeOf.object("value",t),r.defined("array",a),i=n(i,0),e.pack(t._radii,a,i),a},l.unpack=function(t,a,i){r.defined("array",t),a=n(a,0);var o=e.unpack(t,a);return l.fromCartesian3(o,i)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){r.typeOf.object("cartographic",t);var i=t.longitude,o=t.latitude,u=Math.cos(o),s=u*Math.cos(i),c=u*Math.sin(i),f=Math.sin(o);return a(n)||(n=new e),n.x=s,n.y=c,n.z=f,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,r){return a(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,y=new e;l.prototype.cartographicToCartesian=function(t,r){var n=E,i=y;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,i);var o=Math.sqrt(e.dot(n,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(n,t.height,n),a(r)||(r=new e),e.add(i,n,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){r.defined("cartographics",e);var n=e.length;a(t)?t.length=n:t=new Array(n);for(var i=0;n>i;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var p=new e,h=new e,O=new e;return l.prototype.cartesianToCartographic=function(r,n){var i=this.scaleToGeodeticSurface(r,h);if(a(i)){var o=this.geodeticSurfaceNormal(i,p),u=e.subtract(r,i,O),c=Math.atan2(o.y,o.x),f=Math.asin(o.z),l=s.sign(e.dot(u,r))*e.magnitude(u);return a(n)?(n.longitude=c,n.latitude=f,n.height=l,n):new t(c,f,l)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){r.defined("cartesians",e);var n=e.length;a(t)?t.length=n:t=new Array(n);for(var i=0;n>i;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return c(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r.typeOf.object("cartesian",t),a(n)||(n=new e);var i=t.x,o=t.y,u=t.z,s=this._oneOverRadiiSquared,c=1/Math.sqrt(i*i*s.x+o*o*s.y+u*u*s.z);return e.multiplyByScalar(t,c,n)},l.prototype.transformPositionToScaledSpace=function(t,r){return a(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return a(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||a(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,u){if(r.typeOf.object("position",t),!s.equalsEpsilon(this._radii.x,this._radii.y,s.EPSILON15))throw new o("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");r.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),i=n(i,0);var c=this._squaredXOverSquaredZ;return a(u)||(u=new e),u.x=0,u.y=0,u.z=t.z*(1-c),Math.abs(u.z)>=this._radii.z-i?void 0:u},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,n,a){return t.typeOf.object("value",e),t.defined("array",n),a=r(a,0),n[a++]=e.west,n[a++]=e.south,n[a++]=e.east,n[a]=e.north,n},s.unpack=function(e,a,i){return t.defined("array",e),a=r(a,0),n(i)||(i=new s),i.west=e[a++],i.south=e[a++],i.east=e[a++],i.north=e[a],i},s.computeWidth=function(e){t.typeOf.object("rectangle",e);var r=e.east,n=e.west;return n>r&&(r+=u.TWO_PI),r-n},s.computeHeight=function(e){return t.typeOf.object("rectangle",e),e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),a=u.toRadians(r(a,0)),i=u.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,r){t.defined("cartographics",e);for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,y=e.length;y>E;E++){var p=e[E];a=Math.min(a,p.longitude),i=Math.max(i,p.longitude),f=Math.min(f,p.latitude),l=Math.max(l,p.latitude);var h=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;o=Math.min(o,h),c=Math.max(c,h)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=f,r.east=i,r.north=l,r):new s(a,f,i,l)},s.fromCartesianArray=function(e,a,o){t.defined("cartesians",e),a=r(a,i.WGS84);for(var c=Number.MAX_VALUE,f=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,y=Number.MAX_VALUE,p=-Number.MAX_VALUE,h=0,O=e.length;O>h;h++){var _=a.cartesianToCartographic(e[h]);c=Math.min(c,_.longitude),f=Math.max(f,_.longitude),y=Math.min(y,_.latitude),p=Math.max(p,_.latitude);var d=_.longitude>=0?_.longitude:_.longitude+u.TWO_PI;l=Math.min(l,d),E=Math.max(E,d)}return f-c>E-l&&(c=l,f=E,f>u.PI&&(f-=u.TWO_PI),c>u.PI&&(c-=u.TWO_PI)),n(o)?(o.west=c,o.south=y,o.east=f,o.north=p,o):new s(c,y,f,p)},s.clone=function(e,t){return n(e)?n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north):void 0},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,r){return t.typeOf.number("epsilon",r),n(e)&&Math.abs(this.west-e.west)<=r&&Math.abs(this.south-e.south)<=r&&Math.abs(this.east-e.east)<=r&&Math.abs(this.north-e.north)<=r},s.validate=function(e){t.typeOf.object("rectangle",e);var r=e.north;t.typeOf.number.greaterThanOrEquals("north",r,-u.PI_OVER_TWO),t.typeOf.number.lessThanOrEquals("north",r,u.PI_OVER_TWO);var n=e.south;t.typeOf.number.greaterThanOrEquals("south",n,-u.PI_OVER_TWO),t.typeOf.number.lessThanOrEquals("south",n,u.PI_OVER_TWO);var a=e.west;t.typeOf.number.greaterThanOrEquals("west",a,-Math.PI),t.typeOf.number.lessThanOrEquals("west",a,Math.PI);var i=e.east;t.typeOf.number.greaterThanOrEquals("east",i,-Math.PI),t.typeOf.number.lessThanOrEquals("east",i,Math.PI)},s.southwest=function(r,a){return t.typeOf.object("rectangle",r),n(a)?(a.longitude=r.west,a.latitude=r.south,a.height=0,a):new e(r.west,r.south)},s.northwest=function(r,a){return t.typeOf.object("rectangle",r),n(a)?(a.longitude=r.west,a.latitude=r.north,a.height=0,a):new e(r.west,r.north)},s.northeast=function(r,a){return t.typeOf.object("rectangle",r),n(a)?(a.longitude=r.east,a.latitude=r.north,a.height=0,a):new e(r.east,r.north)},s.southeast=function(r,a){return t.typeOf.object("rectangle",r),n(a)?(a.longitude=r.east,a.latitude=r.south,a.height=0,a):new e(r.east,r.south)},s.center=function(r,a){t.typeOf.object("rectangle",r);var i=r.east,o=r.west;o>i&&(i+=u.TWO_PI);var s=u.negativePiToPi(.5*(o+i)),c=.5*(r.south+r.north);return n(a)?(a.longitude=s,a.latitude=c,a.height=0,a):new e(s,c)},s.intersection=function(e,r,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var i=e.east,o=e.west,c=r.east,f=r.west;o>i&&c>0?i+=u.TWO_PI:f>c&&i>0&&(c+=u.TWO_PI),o>i&&0>f?f+=u.TWO_PI:f>c&&0>o&&(o+=u.TWO_PI);var l=u.negativePiToPi(Math.max(o,f)),E=u.negativePiToPi(Math.min(i,c));if(!((e.west=E)){var y=Math.max(e.south,r.south),p=Math.min(e.north,r.north);if(!(y>=p))return n(a)?(a.west=l,a.south=y,a.east=E,a.north=p,a):new s(l,y,E,p)}},s.simpleIntersection=function(e,r,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r);var i=Math.max(e.west,r.west),o=Math.max(e.south,r.south),u=Math.min(e.east,r.east),c=Math.min(e.north,r.north);return o>=c||i>=u?void 0:n(a)?(a.west=i,a.south=o,a.east=u,a.north=c,a):new s(i,o,u,c)},s.union=function(e,r,a){t.typeOf.object("rectangle",e),t.typeOf.object("otherRectangle",r),n(a)||(a=new s);var i=e.east,o=e.west,c=r.east,f=r.west;o>i&&c>0?i+=u.TWO_PI:f>c&&i>0&&(c+=u.TWO_PI),o>i&&0>f?f+=u.TWO_PI:f>c&&0>o&&(o+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(o,f)),E=u.convertLongitudeRange(Math.max(i,c));return a.west=l,a.south=Math.min(e.south,r.south),a.east=E,a.north=Math.max(e.north,r.north),a},s.expand=function(e,r,a){return t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",r),n(a)||(a=new s),a.west=Math.min(e.west,r.longitude),a.south=Math.min(e.south,r.latitude),a.east=Math.max(e.east,r.longitude),a.north=Math.max(e.north,r.latitude),a},s.contains=function(e,r){t.typeOf.object("rectangle",e),t.typeOf.object("cartographic",r);var n=r.longitude,a=r.latitude,i=e.west,o=e.east;return i>o&&(o+=u.TWO_PI,0>n&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(o>n||u.equalsEpsilon(n,o,u.EPSILON14))&&a>=e.south&&a<=e.north};var c=new e;return s.subsample=function(e,a,o,f){t.typeOf.object("rectangle",e),a=r(a,i.WGS84),o=r(o,0),n(f)||(f=[]);var l=0,E=e.north,y=e.south,p=e.east,h=e.west,O=c;O.height=o,O.longitude=h,O.latitude=E,f[l]=a.cartographicToCartesian(O,f[l]),l++,O.longitude=p,f[l]=a.cartographicToCartesian(O,f[l]),l++,O.latitude=y,f[l]=a.cartographicToCartesian(O,f[l]),l++,O.longitude=h,f[l]=a.cartographicToCartesian(O,f[l]),l++,0>E?O.latitude=E:y>0?O.latitude=y:O.latitude=0;for(var _=1;8>_;++_)O.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,O)&&(f[l]=a.cartographicToCartesian(O,f[l]),l++);return 0===O.latitude&&(O.longitude=h,f[l]=a.cartographicToCartesian(O,f[l]),l++,O.longitude=p,f[l]=a.cartographicToCartesian(O,f[l]),l++),f.length=l,f},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){if(!n(e))throw new i("cartesian is required");var a=this._oneOverSemimajorAxis,o=e.x*a,u=e.y*a,s=e.z;return n(r)?(r.longitude=o,r.latitude=u,r.height=s,r):new t(o,u,s)},u}),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";function t(t,r){this.start=e(t,0),this.stop=e(r,0); }return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;9>r;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function f(e){for(var t=0,r=0;3>r;++r){var n=e[s.getElementIndex(h[r],p[r])];t+=2*n*n}return Math.sqrt(t)}function l(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;3>i;++i){var o=Math.abs(e[s.getElementIndex(h[i],p[i])]);o>n&&(a=i,n=o)}var c=1,f=0,l=p[a],E=h[a];if(Math.abs(e[s.getElementIndex(E,l)])>r){var y,O=e[s.getElementIndex(E,E)],_=e[s.getElementIndex(l,l)],d=e[s.getElementIndex(E,l)],T=(O-_)/2/d;y=0>T?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+y*y),f=y*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(l,l)]=t[s.getElementIndex(E,E)]=c,t[s.getElementIndex(E,l)]=f,t[s.getElementIndex(l,E)]=-f,t}s.packedLength=9,s.pack=function(e,n,a){return t.typeOf.object("value",e),t.defined("array",n),a=r(a,0),n[a++]=e[0],n[a++]=e[1],n[a++]=e[2],n[a++]=e[3],n[a++]=e[4],n[a++]=e[5],n[a++]=e[6],n[a++]=e[7],n[a++]=e[8],n},s.unpack=function(e,a,i){return t.defined("array",e),a=r(a,0),n(i)||(i=new s),i[0]=e[a++],i[1]=e[a++],i[2]=e[a++],i[3]=e[a++],i[4]=e[a++],i[5]=e[a++],i[6]=e[a++],i[7]=e[a++],i[8]=e[a++],i},s.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):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},s.fromArray=function(e,a,i){return t.defined("array",e),a=r(a,0),n(i)||(i=new s),i[0]=e[a],i[1]=e[a+1],i[2]=e[a+2],i[3]=e[a+3],i[4]=e[a+4],i[5]=e[a+5],i[6]=e[a+6],i[7]=e[a+7],i[8]=e[a+8],i},s.fromColumnMajorArray=function(e,r){return t.defined("values",e),s.clone(e,r)},s.fromRowMajorArray=function(e,r){return t.defined("values",e),n(r)?(r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8],r):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,r){t.typeOf.object("quaternion",e);var a=e.x*e.x,i=e.x*e.y,o=e.x*e.z,u=e.x*e.w,c=e.y*e.y,f=e.y*e.z,l=e.y*e.w,E=e.z*e.z,y=e.z*e.w,p=e.w*e.w,h=a-c-E+p,O=2*(i-y),_=2*(o+l),d=2*(i+y),T=-a+c-E+p,R=2*(f-u),m=2*(o-l),A=2*(f+u),N=-a-c+E+p;return n(r)?(r[0]=h,r[1]=d,r[2]=m,r[3]=O,r[4]=T,r[5]=A,r[6]=_,r[7]=R,r[8]=N,r):new s(h,O,_,d,T,R,m,A,N)},s.fromHeadingPitchRoll=function(e,r){t.typeOf.object("headingPitchRoll",e);var a=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),u=Math.sin(-e.pitch),c=Math.sin(-e.heading),f=Math.sin(e.roll),l=a*i,E=-o*c+f*u*i,y=f*c+o*u*i,p=a*c,h=o*i+f*u*c,O=-f*i+o*u*c,_=-u,d=f*a,T=o*a;return n(r)?(r[0]=l,r[1]=p,r[2]=_,r[3]=E,r[4]=h,r[5]=d,r[6]=y,r[7]=O,r[8]=T,r):new s(l,E,y,p,h,O,_,d,T)},s.fromScale=function(e,r){return t.typeOf.object("scale",e),n(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=0,r[4]=e.y,r[5]=0,r[6]=0,r[7]=0,r[8]=e.z,r):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,r){return t.typeOf.number("scale",e),n(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=0,r[4]=e,r[5]=0,r[6]=0,r[7]=0,r[8]=e,r):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,r){return t.typeOf.object("vector",e),n(r)?(r[0]=0,r[1]=e.z,r[2]=-e.y,r[3]=-e.z,r[4]=0,r[5]=e.x,r[6]=e.y,r[7]=-e.x,r[8]=0,r):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,r){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return n(r)?(r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=a,r[5]=i,r[6]=0,r[7]=-i,r[8]=a,r):new s(1,0,0,0,a,-i,0,i,a)},s.fromRotationY=function(e,r){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return n(r)?(r[0]=a,r[1]=0,r[2]=-i,r[3]=0,r[4]=1,r[5]=0,r[6]=i,r[7]=0,r[8]=a,r):new s(a,0,i,0,1,0,-i,0,a)},s.fromRotationZ=function(e,r){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return n(r)?(r[0]=a,r[1]=i,r[2]=0,r[3]=-i,r[4]=a,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new s(a,-i,0,i,a,0,0,0,1)},s.toArray=function(e,r){return t.typeOf.object("matrix",e),n(r)?(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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,r){return t.typeOf.number.greaterThanOrEquals("row",r,0),t.typeOf.number.lessThanOrEquals("row",r,2),t.typeOf.number.greaterThanOrEquals("column",e,0),t.typeOf.number.lessThanOrEquals("column",e,2),3*e+r},s.getColumn=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,2),t.typeOf.object("result",n);var a=3*r,i=e[a],o=e[a+1],u=e[a+2];return n.x=i,n.y=o,n.z=u,n},s.setColumn=function(e,r,n,a){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,2),t.typeOf.object("cartesian",n),t.typeOf.object("result",a),a=s.clone(e,a);var i=3*r;return a[i]=n.x,a[i+1]=n.y,a[i+2]=n.z,a},s.getRow=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,2),t.typeOf.object("result",n);var a=e[r],i=e[r+3],o=e[r+6];return n.x=a,n.y=i,n.z=o,n},s.setRow=function(e,r,n,a){return t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,2),t.typeOf.object("cartesian",n),t.typeOf.object("result",a),a=s.clone(e,a),a[r]=n.x,a[r+3]=n.y,a[r+6]=n.z,a};var E=new e;s.getScale=function(r,n){return t.typeOf.object("matrix",r),t.typeOf.object("result",n),n.x=e.magnitude(e.fromElements(r[0],r[1],r[2],E)),n.y=e.magnitude(e.fromElements(r[3],r[4],r[5],E)),n.z=e.magnitude(e.fromElements(r[6],r[7],r[8],E)),n};var y=new e;s.getMaximumScale=function(t){return s.getScale(t,y),e.maximumComponent(y)},s.multiply=function(e,r,n){t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n);var a=e[0]*r[0]+e[3]*r[1]+e[6]*r[2],i=e[1]*r[0]+e[4]*r[1]+e[7]*r[2],o=e[2]*r[0]+e[5]*r[1]+e[8]*r[2],u=e[0]*r[3]+e[3]*r[4]+e[6]*r[5],s=e[1]*r[3]+e[4]*r[4]+e[7]*r[5],c=e[2]*r[3]+e[5]*r[4]+e[8]*r[5],f=e[0]*r[6]+e[3]*r[7]+e[6]*r[8],l=e[1]*r[6]+e[4]*r[7]+e[7]*r[8],E=e[2]*r[6]+e[5]*r[7]+e[8]*r[8];return n[0]=a,n[1]=i,n[2]=o,n[3]=u,n[4]=s,n[5]=c,n[6]=f,n[7]=l,n[8]=E,n},s.add=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n[0]=e[0]+r[0],n[1]=e[1]+r[1],n[2]=e[2]+r[2],n[3]=e[3]+r[3],n[4]=e[4]+r[4],n[5]=e[5]+r[5],n[6]=e[6]+r[6],n[7]=e[7]+r[7],n[8]=e[8]+r[8],n},s.subtract=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],n[3]=e[3]-r[3],n[4]=e[4]-r[4],n[5]=e[5]-r[5],n[6]=e[6]-r[6],n[7]=e[7]-r[7],n[8]=e[8]-r[8],n},s.multiplyByVector=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.object("cartesian",r),t.typeOf.object("result",n);var a=r.x,i=r.y,o=r.z,u=e[0]*a+e[3]*i+e[6]*o,s=e[1]*a+e[4]*i+e[7]*o,c=e[2]*a+e[5]*i+e[8]*o;return n.x=u,n.y=s,n.z=c,n},s.multiplyByScalar=function(e,r,n){return t.typeOf.object("matrix",e),t.typeOf.number("scalar",r),t.typeOf.object("result",n),n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7]*r,n[8]=e[8]*r,n},s.multiplyByScale=function(e,r,n){return t.typeOf.object("matrix",e),t.typeOf.object("scale",r),t.typeOf.object("result",n),n[0]=e[0]*r.x,n[1]=e[1]*r.x,n[2]=e[2]*r.x,n[3]=e[3]*r.y,n[4]=e[4]*r.y,n[5]=e[5]*r.y,n[6]=e[6]*r.z,n[7]=e[7]*r.z,n[8]=e[8]*r.z,n},s.negate=function(e,r){return t.typeOf.object("matrix",e),t.typeOf.object("result",r),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},s.transpose=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],a=e[3],i=e[6],o=e[1],u=e[4],s=e[7],c=e[2],f=e[5],l=e[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=f,r[8]=l,r};var p=[1,0,0],h=[2,2,1],O=new s,_=new s;return s.computeEigenDecomposition=function(e,r){t.typeOf.object("matrix",e);var a=u.EPSILON20,i=10,o=0,E=0;n(r)||(r={});for(var y=r.unitary=s.clone(s.IDENTITY,r.unitary),p=r.diagonal=s.clone(e,r.diagonal),h=a*c(p);i>E&&f(p)>h;)l(p,O),s.transpose(O,_),s.multiply(p,O,p),s.multiply(_,p,p),s.multiply(y,O,y),++o>2&&(++E,o=0);return r},s.abs=function(e,r){return t.typeOf.object("matrix",e),t.typeOf.object("result",r),r[0]=Math.abs(e[0]),r[1]=Math.abs(e[1]),r[2]=Math.abs(e[2]),r[3]=Math.abs(e[3]),r[4]=Math.abs(e[4]),r[5]=Math.abs(e[5]),r[6]=Math.abs(e[6]),r[7]=Math.abs(e[7]),r[8]=Math.abs(e[8]),r},s.determinant=function(e){t.typeOf.object("matrix",e);var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],f=e[8];return r*(o*f-c*u)+i*(c*a-n*f)+s*(n*u-o*a)},s.inverse=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],a=e[1],o=e[2],c=e[3],f=e[4],l=e[5],E=e[6],y=e[7],p=e[8],h=s.determinant(e);if(Math.abs(h)<=u.EPSILON15)throw new i("matrix is not invertible");r[0]=f*p-y*l,r[1]=y*o-a*p,r[2]=a*l-f*o,r[3]=E*l-c*p,r[4]=n*p-E*o,r[5]=c*o-n*l,r[6]=c*y-E*f,r[7]=E*a-n*y,r[8]=n*f-c*a;var O=1/h;return s.multiplyByScalar(r,O,r)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,r,a){return t.typeOf.number("epsilon",a),e===r||n(e)&&n(r)&&Math.abs(e[0]-r[0])<=a&&Math.abs(e[1]-r[1])<=a&&Math.abs(e[2]-r[2])<=a&&Math.abs(e[3]-r[3])<=a&&Math.abs(e[4]-r[4])<=a&&Math.abs(e[5]-r[5])<=a&&Math.abs(e[6]-r[6])<=a&&Math.abs(e[7]-r[7])<=a&&Math.abs(e[8]-r[8])<=a},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.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]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(t,n){return e.typeOf.object("color",t),r(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w):void 0},o.packedLength=4,o.pack=function(r,n,a){return e.typeOf.object("value",r),e.defined("array",n),a=t(a,0),n[a++]=r.x,n[a++]=r.y,n[a++]=r.z,n[a]=r.w,n},o.unpack=function(n,a,i){return e.defined("array",n),a=t(a,0),r(i)||(i=new o),i.x=n[a++],i.y=n[a++],i.z=n[a++],i.w=n[a],i},o.packArray=function(t,n){e.defined("array",t);var a=t.length;r(n)?n.length=4*a:n=new Array(4*a);for(var i=0;a>i;++i)o.pack(t[i],n,4*i);return n},o.unpackArray=function(t,n){e.defined("array",t);var a=t.length;r(n)?n.length=a/4:n=new Array(a/4);for(var i=0;a>i;i+=4){var u=i/4;n[u]=o.unpack(t,i,n[u])}return n},o.fromArray=o.unpack,o.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.min(t.x,r.x),n.y=Math.min(t.y,r.y),n.z=Math.min(t.z,r.z),n.w=Math.min(t.w,r.w),n},o.maximumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.max(t.x,r.x),n.y=Math.max(t.y,r.y),n.z=Math.max(t.z,r.z),n.w=Math.max(t.w,r.w),n},o.magnitudeSquared=function(t){return e.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.subtract(t,r,u),o.magnitude(u)},o.distanceSquared=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.subtract(t,r,u),o.magnitudeSquared(u)},o.normalize=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var a=o.magnitude(t);if(r.x=t.x/a,r.y=t.y/a,r.z=t.z/a,r.w=t.w/a,isNaN(r.x)||isNaN(r.y)||isNaN(r.z)||isNaN(r.w))throw new n("normalized result is not a number");return r},o.dot=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),t.x*r.x+t.y*r.y+t.z*r.z+t.w*r.w},o.multiplyComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x*r.x,n.y=t.y*r.y,n.z=t.z*r.z,n.w=t.w*r.w,n},o.divideComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x/r.x,n.y=t.y/r.y,n.z=t.z/r.z,n.w=t.w/r.w,n},o.add=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x+r.x,n.y=t.y+r.y,n.z=t.z+r.z,n.w=t.w+r.w,n},o.subtract=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x-r.x,n.y=t.y-r.y,n.z=t.z-r.z,n.w=t.w-r.w,n},o.multiplyByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x*r,n.y=t.y*r,n.z=t.z*r,n.w=t.w*r,n},o.divideByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x/r,n.y=t.y/r,n.z=t.z/r,n.w=t.w/r,n},o.negate=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=-t.x,r.y=-t.y,r.z=-t.z,r.w=-t.w,r},o.abs=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=Math.abs(t.x),r.y=Math.abs(t.y),r.z=Math.abs(t.z),r.w=Math.abs(t.w),r};var s=new o;o.lerp=function(t,r,n,a){return e.typeOf.object("start",t),e.typeOf.object("end",r),e.typeOf.number("t",n),e.typeOf.object("result",a),o.multiplyByScalar(r,n,s),a=o.multiplyByScalar(t,1-n,a),o.add(s,a,a)};var c=new o;return o.mostOrthogonalAxis=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var n=o.normalize(t,c);return o.abs(n,n),r=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,r):o.clone(o.UNIT_W,r):n.z<=n.w?o.clone(o.UNIT_Z,r):o.clone(o.UNIT_W,r):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,r):o.clone(o.UNIT_W,r):n.z<=n.w?o.clone(o.UNIT_Z,r):o.clone(o.UNIT_W,r)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.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]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(r){t=r.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),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","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function f(e,t,r,a,i,o,u,s,c,f,l,E,y,p,h,O){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(y,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(f,0),this[7]=n(p,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(l,0),this[11]=n(h,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(E,0),this[15]=n(O,0)}f.packedLength=16,f.pack=function(e,t,a){return r.typeOf.object("value",e),r.defined("array",t),a=n(a,0),t[a++]=e[0],t[a++]=e[1],t[a++]=e[2],t[a++]=e[3],t[a++]=e[4],t[a++]=e[5],t[a++]=e[6],t[a++]=e[7],t[a++]=e[8],t[a++]=e[9],t[a++]=e[10],t[a++]=e[11],t[a++]=e[12],t[a++]=e[13],t[a++]=e[14],t[a]=e[15],t},f.unpack=function(e,t,i){return r.defined("array",e),t=n(t,0),a(i)||(i=new f),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i[9]=e[t++],i[10]=e[t++],i[11]=e[t++],i[12]=e[t++],i[13]=e[t++],i[14]=e[t++],i[15]=e[t],i},f.clone=function(e,t){return a(e)?a(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 f(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},f.fromArray=f.unpack,f.fromColumnMajorArray=function(e,t){return r.defined("values",e),f.clone(e,t)},f.fromRowMajorArray=function(e,t){return r.defined("values",e),a(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 f(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])},f.fromRotationTranslation=function(t,i,o){return r.typeOf.object("rotation",t),i=n(i,e.ZERO),a(o)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=0,o[4]=t[3],o[5]=t[4],o[6]=t[5],o[7]=0,o[8]=t[6],o[9]=t[7],o[10]=t[8],o[11]=0,o[12]=i.x,o[13]=i.y,o[14]=i.z,o[15]=1,o):new f(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},f.fromTranslationQuaternionRotationScale=function(e,t,n,i){r.typeOf.object("translation",e),r.typeOf.object("rotation",t),r.typeOf.object("scale",n),a(i)||(i=new f);var o=n.x,u=n.y,s=n.z,c=t.x*t.x,l=t.x*t.y,E=t.x*t.z,y=t.x*t.w,p=t.y*t.y,h=t.y*t.z,O=t.y*t.w,_=t.z*t.z,d=t.z*t.w,T=t.w*t.w,R=c-p-_+T,m=2*(l-d),A=2*(E+O),N=2*(l+d),S=-c+p-_+T,b=2*(h-y),I=2*(E-O),M=2*(h+y),x=-c-p+_+T;return i[0]=R*o,i[1]=N*o,i[2]=I*o,i[3]=0,i[4]=m*u,i[5]=S*u,i[6]=M*u,i[7]=0,i[8]=A*s,i[9]=b*s,i[10]=x*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},f.fromTranslationRotationScale=function(e,t){return r.typeOf.object("translationRotationScale",e),f.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},f.fromTranslation=function(e,t){return r.typeOf.object("translation",e),f.fromRotationTranslation(s.IDENTITY,e,t)},f.fromScale=function(e,t){return r.typeOf.object("scale",e),a(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 f(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},f.fromUniformScale=function(e,t){return r.typeOf.number("scale",e),a(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 f(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,E=new e,y=new e;f.fromCamera=function(t,n){r.typeOf.object("camera",t);var i=t.position,o=t.direction,u=t.up;r.typeOf.object("camera.position",i),r.typeOf.object("camera.direction",o),r.typeOf.object("camera.up",u),e.normalize(o,l),e.normalize(e.cross(l,u,E),E),e.normalize(e.cross(E,l,y),y);var s=E.x,c=E.y,p=E.z,h=l.x,O=l.y,_=l.z,d=y.x,T=y.y,R=y.z,m=i.x,A=i.y,N=i.z,S=s*-m+c*-A+p*-N,b=d*-m+T*-A+R*-N,I=h*m+O*A+_*N;return a(n)?(n[0]=s,n[1]=d,n[2]=-h,n[3]=0,n[4]=c,n[5]=T,n[6]=-O,n[7]=0,n[8]=p,n[9]=R,n[10]=-_,n[11]=0,n[12]=S,n[13]=b,n[14]=I,n[15]=1,n):new f(s,c,p,S,d,T,R,b,-h,-O,-_,I,0,0,0,1)},f.computePerspectiveFieldOfView=function(e,t,n,a,i){r.typeOf.number.greaterThan("fovY",e,0),r.typeOf.number.lessThan("fovY",e,Math.PI),r.typeOf.number.greaterThan("near",n,0),r.typeOf.number.greaterThan("far",a,0),r.typeOf.object("result",i);var o=Math.tan(.5*e),u=1/o,s=u/t,c=(a+n)/(n-a),f=2*a*n/(n-a);return i[0]=s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=c,i[11]=-1,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},f.computeOrthographicOffCenter=function(e,t,n,a,i,o,u){r.typeOf.number("left",e),r.typeOf.number("right",t),r.typeOf.number("bottom",n),r.typeOf.number("top",a),r.typeOf.number("near",i),r.typeOf.number("far",o),r.typeOf.object("result",u);var s=1/(t-e),c=1/(a-n),f=1/(o-i),l=-(t+e)*s,E=-(a+n)*c,y=-(o+i)*f;return s*=2,c*=2,f*=-2,u[0]=s,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=c,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=f,u[11]=0,u[12]=l,u[13]=E,u[14]=y,u[15]=1,u},f.computePerspectiveOffCenter=function(e,t,n,a,i,o,u){r.typeOf.number("left",e),r.typeOf.number("right",t),r.typeOf.number("bottom",n),r.typeOf.number("top",a),r.typeOf.number("near",i),r.typeOf.number("far",o),r.typeOf.object("result",u);var s=2*i/(t-e),c=2*i/(a-n),f=(t+e)/(t-e),l=(a+n)/(a-n),E=-(o+i)/(o-i),y=-1,p=-2*o*i/(o-i);return u[0]=s,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=c,u[6]=0,u[7]=0,u[8]=f,u[9]=l,u[10]=E,u[11]=y,u[12]=0,u[13]=0,u[14]=p,u[15]=0,u},f.computeInfinitePerspectiveOffCenter=function(e,t,n,a,i,o){r.typeOf.number("left",e),r.typeOf.number("right",t),r.typeOf.number("bottom",n),r.typeOf.number("top",a),r.typeOf.number("near",i),r.typeOf.object("result",o);var u=2*i/(t-e),s=2*i/(a-n),c=(t+e)/(t-e),f=(a+n)/(a-n),l=-1,E=-1,y=-2*i;return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=f,o[10]=l,o[11]=E,o[12]=0,o[13]=0,o[14]=y,o[15]=0,o},f.computeViewportTransformation=function(e,t,a,i){r.typeOf.object("result",i),e=n(e,n.EMPTY_OBJECT);var o=n(e.x,0),u=n(e.y,0),s=n(e.width,0),c=n(e.height,0);t=n(t,0),a=n(a,1);var f=.5*s,l=.5*c,E=.5*(a-t),y=f,p=l,h=E,O=o+f,_=u+l,d=t+E,T=1;return i[0]=y,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=h,i[11]=0,i[12]=O,i[13]=_,i[14]=d,i[15]=T,i},f.computeView=function(t,n,a,i,o){return r.typeOf.object("position",t),r.typeOf.object("direction",n),r.typeOf.object("up",a),r.typeOf.object("right",i),r.typeOf.object("result",o),o[0]=i.x,o[1]=a.x,o[2]=-n.x,o[3]=0,o[4]=i.y,o[5]=a.y,o[6]=-n.y,o[7]=0,o[8]=i.z,o[9]=a.z,o[10]=-n.z,o[11]=0,o[12]=-e.dot(i,t),o[13]=-e.dot(a,t),o[14]=e.dot(n,t),o[15]=1,o},f.toArray=function(e,t){return r.typeOf.object("matrix",e),a(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]]},f.getElementIndex=function(e,t){return r.typeOf.number.greaterThanOrEquals("row",t,0),r.typeOf.number.lessThanOrEquals("row",t,3),r.typeOf.number.greaterThanOrEquals("column",e,0),r.typeOf.number.lessThanOrEquals("column",e,3),4*e+t},f.getColumn=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.number.greaterThanOrEquals("index",t,0),r.typeOf.number.lessThanOrEquals("index",t,3),r.typeOf.object("result",n);var a=4*t,i=e[a],o=e[a+1],u=e[a+2],s=e[a+3];return n.x=i,n.y=o,n.z=u,n.w=s,n},f.setColumn=function(e,t,n,a){r.typeOf.object("matrix",e),r.typeOf.number.greaterThanOrEquals("index",t,0),r.typeOf.number.lessThanOrEquals("index",t,3),r.typeOf.object("cartesian",n),r.typeOf.object("result",a),a=f.clone(e,a);var i=4*t;return a[i]=n.x,a[i+1]=n.y,a[i+2]=n.z,a[i+3]=n.w,a},f.setTranslation=function(e,t,n){return r.typeOf.object("matrix",e),r.typeOf.object("translation",t),r.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},f.getRow=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.number.greaterThanOrEquals("index",t,0),r.typeOf.number.lessThanOrEquals("index",t,3),r.typeOf.object("result",n);var a=e[t],i=e[t+4],o=e[t+8],u=e[t+12];return n.x=a,n.y=i,n.z=o,n.w=u,n},f.setRow=function(e,t,n,a){return r.typeOf.object("matrix",e),r.typeOf.number.greaterThanOrEquals("index",t,0),r.typeOf.number.lessThanOrEquals("index",t,3),r.typeOf.object("cartesian",n),r.typeOf.object("result",a),a=f.clone(e,a),a[t]=n.x,a[t+4]=n.y,a[t+8]=n.z,a[t+12]=n.w,a};var p=new e;f.getScale=function(t,n){return r.typeOf.object("matrix",t),r.typeOf.object("result",n),n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),n};var h=new e;f.getMaximumScale=function(t){return f.getScale(t,h),e.maximumComponent(h)},f.multiply=function(e,t,n){r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n);var a=e[0],i=e[1],o=e[2],u=e[3],s=e[4],c=e[5],f=e[6],l=e[7],E=e[8],y=e[9],p=e[10],h=e[11],O=e[12],_=e[13],d=e[14],T=e[15],R=t[0],m=t[1],A=t[2],N=t[3],S=t[4],b=t[5],I=t[6],M=t[7],x=t[8],g=t[9],w=t[10],v=t[11],C=t[12],U=t[13],L=t[14],P=t[15],F=a*R+s*m+E*A+O*N,D=i*R+c*m+y*A+_*N,B=o*R+f*m+p*A+d*N,j=u*R+l*m+h*A+T*N,z=a*S+s*b+E*I+O*M,G=i*S+c*b+y*I+_*M,q=o*S+f*b+p*I+d*M,X=u*S+l*b+h*I+T*M,V=a*x+s*g+E*w+O*v,W=i*x+c*g+y*w+_*v,H=o*x+f*g+p*w+d*v,Y=u*x+l*g+h*w+T*v,k=a*C+s*U+E*L+O*P,Z=i*C+c*U+y*L+_*P,K=o*C+f*U+p*L+d*P,Q=u*C+l*U+h*L+T*P;return n[0]=F,n[1]=D,n[2]=B,n[3]=j,n[4]=z,n[5]=G,n[6]=q,n[7]=X,n[8]=V,n[9]=W,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=K,n[15]=Q,n},f.add=function(e,t,n){return r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},f.subtract=function(e,t,n){return r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},f.multiplyTransformation=function(e,t,n){r.typeOf.object("left",e),r.typeOf.object("right",t),r.typeOf.object("result",n);var a=e[0],i=e[1],o=e[2],u=e[4],s=e[5],c=e[6],f=e[8],l=e[9],E=e[10],y=e[12],p=e[13],h=e[14],O=t[0],_=t[1],d=t[2],T=t[4],R=t[5],m=t[6],A=t[8],N=t[9],S=t[10],b=t[12],I=t[13],M=t[14],x=a*O+u*_+f*d,g=i*O+s*_+l*d,w=o*O+c*_+E*d,v=a*T+u*R+f*m,C=i*T+s*R+l*m,U=o*T+c*R+E*m,L=a*A+u*N+f*S,P=i*A+s*N+l*S,F=o*A+c*N+E*S,D=a*b+u*I+f*M+y,B=i*b+s*I+l*M+p,j=o*b+c*I+E*M+h;return n[0]=x,n[1]=g,n[2]=w,n[3]=0,n[4]=v,n[5]=C,n[6]=U,n[7]=0,n[8]=L,n[9]=P,n[10]=F,n[11]=0,n[12]=D,n[13]=B,n[14]=j,n[15]=1,n},f.multiplyByMatrix3=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("rotation",t),r.typeOf.object("result",n);var a=e[0],i=e[1],o=e[2],u=e[4],s=e[5],c=e[6],f=e[8],l=e[9],E=e[10],y=t[0],p=t[1],h=t[2],O=t[3],_=t[4],d=t[5],T=t[6],R=t[7],m=t[8],A=a*y+u*p+f*h,N=i*y+s*p+l*h,S=o*y+c*p+E*h,b=a*O+u*_+f*d,I=i*O+s*_+l*d,M=o*O+c*_+E*d,x=a*T+u*R+f*m,g=i*T+s*R+l*m,w=o*T+c*R+E*m;return n[0]=A,n[1]=N,n[2]=S,n[3]=0,n[4]=b,n[5]=I,n[6]=M,n[7]=0,n[8]=x,n[9]=g,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},f.multiplyByTranslation=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("translation",t),r.typeOf.object("result",n);var a=t.x,i=t.y,o=t.z,u=a*e[0]+i*e[4]+o*e[8]+e[12],s=a*e[1]+i*e[5]+o*e[9]+e[13],c=a*e[2]+i*e[6]+o*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=u,n[13]=s,n[14]=c,n[15]=e[15],n};var O=new e;f.multiplyByUniformScale=function(e,t,n){return r.typeOf.object("matrix",e),r.typeOf.number("scale",t),r.typeOf.object("result",n),O.x=t,O.y=t,O.z=t,f.multiplyByScale(e,O,n)},f.multiplyByScale=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("scale",t),r.typeOf.object("result",n);var a=t.x,i=t.y,o=t.z;return 1===a&&1===i&&1===o?f.clone(e,n):(n[0]=a*e[0],n[1]=a*e[1],n[2]=a*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=o*e[8],n[9]=o*e[9],n[10]=o*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},f.multiplyByVector=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("cartesian",t),r.typeOf.object("result",n);var a=t.x,i=t.y,o=t.z,u=t.w,s=e[0]*a+e[4]*i+e[8]*o+e[12]*u,c=e[1]*a+e[5]*i+e[9]*o+e[13]*u,f=e[2]*a+e[6]*i+e[10]*o+e[14]*u,l=e[3]*a+e[7]*i+e[11]*o+e[15]*u;return n.x=s,n.y=c,n.z=f,n.w=l,n},f.multiplyByPointAsVector=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("cartesian",t),r.typeOf.object("result",n);var a=t.x,i=t.y,o=t.z,u=e[0]*a+e[4]*i+e[8]*o,s=e[1]*a+e[5]*i+e[9]*o,c=e[2]*a+e[6]*i+e[10]*o;return n.x=u,n.y=s,n.z=c,n},f.multiplyByPoint=function(e,t,n){r.typeOf.object("matrix",e),r.typeOf.object("cartesian",t),r.typeOf.object("result",n);var a=t.x,i=t.y,o=t.z,u=e[0]*a+e[4]*i+e[8]*o+e[12],s=e[1]*a+e[5]*i+e[9]*o+e[13],c=e[2]*a+e[6]*i+e[10]*o+e[14];return n.x=u,n.y=s,n.z=c,n},f.multiplyByScalar=function(e,t,n){return r.typeOf.object("matrix",e),r.typeOf.number("scalar",t),r.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},f.negate=function(e,t){return r.typeOf.object("matrix",e),r.typeOf.object("result",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},f.transpose=function(e,t){r.typeOf.object("matrix",e),r.typeOf.object("result",t);var n=e[1],a=e[2],i=e[3],o=e[6],u=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=a,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=u,t[14]=s,t[15]=e[15],t},f.abs=function(e,t){return r.typeOf.object("matrix",e),r.typeOf.object("result",t),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},f.equals=function(e,t){return e===t||a(e)&&a(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]},f.equalsEpsilon=function(e,t,n){return r.typeOf.number("epsilon",n),e===t||a(e)&&a(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&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},f.getTranslation=function(e,t){return r.typeOf.object("matrix",e),r.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t},f.getRotation=function(e,t){return r.typeOf.object("matrix",e),r.typeOf.object("result",t),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 _=new s,d=new s,T=new t,R=new t(0,0,0,1);return f.inverse=function(e,n){if(r.typeOf.object("matrix",e),r.typeOf.object("result",n),s.equalsEpsilon(f.getRotation(e,_),d,u.EPSILON7)&&t.equals(f.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0, n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var a=e[0],i=e[4],o=e[8],l=e[12],E=e[1],y=e[5],p=e[9],h=e[13],O=e[2],m=e[6],A=e[10],N=e[14],S=e[3],b=e[7],I=e[11],M=e[15],x=A*M,g=N*I,w=m*M,v=N*b,C=m*I,U=A*b,L=O*M,P=N*S,F=O*I,D=A*S,B=O*b,j=m*S,z=x*y+v*p+C*h-(g*y+w*p+U*h),G=g*E+L*p+D*h-(x*E+P*p+F*h),q=w*E+P*y+B*h-(v*E+L*y+j*h),X=U*E+F*y+j*p-(C*E+D*y+B*p),V=g*i+w*o+U*l-(x*i+v*o+C*l),W=x*a+P*o+F*l-(g*a+L*o+D*l),H=v*a+L*i+j*l-(w*a+P*i+B*l),Y=C*a+D*i+B*o-(U*a+F*i+j*o);x=o*h,g=l*p,w=i*h,v=l*y,C=i*p,U=o*y,L=a*h,P=l*E,F=a*p,D=o*E,B=a*y,j=i*E;var k=x*b+v*I+C*M-(g*b+w*I+U*M),Z=g*S+L*I+D*M-(x*S+P*I+F*M),K=w*S+P*b+B*M-(v*S+L*b+j*M),Q=U*S+F*b+j*I-(C*S+D*b+B*I),J=w*A+U*N+g*m-(C*N+x*m+v*A),$=F*N+x*O+P*A-(L*A+D*N+g*O),ee=L*m+j*N+v*O-(B*N+w*O+P*m),te=B*A+C*O+D*m-(F*m+j*A+U*O),re=a*z+i*G+o*q+l*X;if(Math.abs(re)n;n++){e.clone(t[n],i);var I=i.x,M=i.y,x=i.z;Ic.x&&e.clone(i,c),Mf.y&&e.clone(i,f),xl.z&&e.clone(i,l)}var g=e.magnitudeSquared(e.subtract(c,o,R)),w=e.magnitudeSquared(e.subtract(f,u,R)),v=e.magnitudeSquared(e.subtract(l,s,R)),C=o,U=c,L=g;w>L&&(L=w,C=u,U=f),v>L&&(L=v,C=s,U=l);var P=m;P.x=.5*(C.x+U.x),P.y=.5*(C.y+U.y),P.z=.5*(C.z+U.z);var F=e.magnitudeSquared(e.subtract(U,P,R)),D=Math.sqrt(F),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var j=N;j.x=c.x,j.y=f.y,j.z=l.z;var z=e.multiplyByScalar(e.add(B,j,R),.5,S),G=0;for(n=0;b>n;n++){e.clone(t[n],i);var q=e.magnitude(e.subtract(i,z,R));q>G&&(G=q);var X=e.magnitudeSquared(e.subtract(i,P,R));if(X>F){var V=Math.sqrt(X);D=.5*(D+V),F=D*D;var W=V-D;P.x=(D*P.x+W*i.x)/V,P.y=(D*P.y+W*i.y)/V,P.z=(D*P.z+W*i.z)/V}}return G>D?(e.clone(P,r.center),r.radius=D):(e.clone(z,r.center),r.radius=G),r};var b=new o,I=new e,M=new e,x=new t,g=new t;E.fromRectangle2D=function(e,t,r){return E.fromRectangleWithHeights2D(e,t,0,0,r)},E.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new E),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,b),l.southwest(t,x),x.height=i,l.northeast(t,g),g.height=o;var s=r.project(x,I),c=r.project(g,M),f=c.x-s.x,y=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(f*f+y*y+p*p);var h=u.center;return h.x=s.x+.5*f,h.y=s.y+.5*y,h.z=s.z+.5*p,u};var w=[];E.fromRectangle3D=function(t,r,o,u){if(r=n(r,i.WGS84),o=n(o,0),a(u)||(u=new E),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;var s=l.subsample(t,r,o,w);return E.fromPoints(s,u)},E.fromVertices=function(t,i,o,u){if(a(u)||(u=new E),!a(t)||0===t.length)return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;i=n(i,e.ZERO),o=n(o,3),r.typeOf.number.greaterThanOrEquals("stride",o,3);var s=T;s.x=t[0]+i.x,s.y=t[1]+i.y,s.z=t[2]+i.z;var c,f=e.clone(s,y),l=e.clone(s,p),b=e.clone(s,h),I=e.clone(s,O),M=e.clone(s,_),x=e.clone(s,d),g=t.length;for(c=0;g>c;c+=o){var w=t[c]+i.x,v=t[c+1]+i.y,C=t[c+2]+i.z;s.x=w,s.y=v,s.z=C,wI.x&&e.clone(s,I),vM.y&&e.clone(s,M),Cx.z&&e.clone(s,x)}var U=e.magnitudeSquared(e.subtract(I,f,R)),L=e.magnitudeSquared(e.subtract(M,l,R)),P=e.magnitudeSquared(e.subtract(x,b,R)),F=f,D=I,B=U;L>B&&(B=L,F=l,D=M),P>B&&(B=P,F=b,D=x);var j=m;j.x=.5*(F.x+D.x),j.y=.5*(F.y+D.y),j.z=.5*(F.z+D.z);var z=e.magnitudeSquared(e.subtract(D,j,R)),G=Math.sqrt(z),q=A;q.x=f.x,q.y=l.y,q.z=b.z;var X=N;X.x=I.x,X.y=M.y,X.z=x.z;var V=e.multiplyByScalar(e.add(q,X,R),.5,S),W=0;for(c=0;g>c;c+=o){s.x=t[c]+i.x,s.y=t[c+1]+i.y,s.z=t[c+2]+i.z;var H=e.magnitude(e.subtract(s,V,R));H>W&&(W=H);var Y=e.magnitudeSquared(e.subtract(s,j,R));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;j.x=(G*j.x+Z*s.x)/k,j.y=(G*j.y+Z*s.y)/k,j.z=(G*j.z+Z*s.z)/k}}return W>G?(e.clone(j,u.center),u.radius=G):(e.clone(V,u.center),u.radius=W),u},E.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new E),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=T;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];var o,u=e.clone(i,y),s=e.clone(i,p),c=e.clone(i,h),f=e.clone(i,O),l=e.clone(i,_),b=e.clone(i,d),I=t.length;for(o=0;I>o;o+=3){var M=t[o]+r[o],x=t[o+1]+r[o+1],g=t[o+2]+r[o+2];i.x=M,i.y=x,i.z=g,Mf.x&&e.clone(i,f),xl.y&&e.clone(i,l),gb.z&&e.clone(i,b)}var w=e.magnitudeSquared(e.subtract(f,u,R)),v=e.magnitudeSquared(e.subtract(l,s,R)),C=e.magnitudeSquared(e.subtract(b,c,R)),U=u,L=f,P=w;v>P&&(P=v,U=s,L=l),C>P&&(P=C,U=c,L=b);var F=m;F.x=.5*(U.x+L.x),F.y=.5*(U.y+L.y),F.z=.5*(U.z+L.z);var D=e.magnitudeSquared(e.subtract(L,F,R)),B=Math.sqrt(D),j=A;j.x=u.x,j.y=s.y,j.z=c.z;var z=N;z.x=f.x,z.y=l.y,z.z=b.z;var G=e.multiplyByScalar(e.add(j,z,R),.5,S),q=0;for(o=0;I>o;o+=3){i.x=t[o]+r[o],i.y=t[o+1]+r[o+1],i.z=t[o+2]+r[o+2];var X=e.magnitude(e.subtract(i,G,R));X>q&&(q=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>D){var W=Math.sqrt(V);B=.5*(B+W),D=B*B;var H=W-B;F.x=(B*F.x+H*i.x)/W,F.y=(B*F.y+H*i.y)/W,F.z=(B*F.z+H*i.z)/W}}return q>B?(e.clone(F,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n},E.fromCornerPoints=function(t,n,i){r.typeOf.object("corner",t),r.typeOf.object("oppositeCorner",n),a(i)||(i=new E);var o=i.center;return e.add(t,n,o),e.multiplyByScalar(o,.5,o),i.radius=e.distance(o,n),i},E.fromEllipsoid=function(t,n){return r.typeOf.object("ellipsoid",t),a(n)||(n=new E),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var v=new e;E.fromBoundingSpheres=function(t,r){if(a(r)||(r=new E),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return E.clone(t[0],r);if(2===n)return E.union(t[0],t[1],r);var i,o=[];for(i=0;n>i;i++)o.push(t[i].center);r=E.fromPoints(o,r);var u=r.center,s=r.radius;for(i=0;n>i;i++){var c=t[i];s=Math.max(s,e.distance(u,c.center,v)+c.radius)}return r.radius=s,r};var C=new e,U=new e,L=new e;E.fromOrientedBoundingBox=function(t,n){r.defined("orientedBoundingBox",t),a(n)||(n=new E);var i=t.halfAxes,o=c.getColumn(i,0,C),u=c.getColumn(i,1,U),s=c.getColumn(i,2,L);return e.add(o,u,o),e.add(o,s,o),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(o),n},E.clone=function(t,r){return a(t)?a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new E(t.center,t.radius):void 0},E.packedLength=4,E.pack=function(e,t,a){r.typeOf.object("value",e),r.defined("array",t),a=n(a,0);var i=e.center;return t[a++]=i.x,t[a++]=i.y,t[a++]=i.z,t[a]=e.radius,t},E.unpack=function(e,t,i){r.defined("array",e),t=n(t,0),a(i)||(i=new E);var o=i.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],i.radius=e[t],i};var P=new e,F=new e;E.union=function(t,n,i){r.typeOf.object("left",t),r.typeOf.object("right",n),a(i)||(i=new E);var o=t.center,u=t.radius,s=n.center,c=n.radius,f=e.subtract(s,o,P),l=e.magnitude(f);if(u>=l+c)return t.clone(i),i;if(c>=l+u)return n.clone(i),i;var y=.5*(u+l+c),p=e.multiplyByScalar(f,(-u+y)/l,F);return e.add(p,o,p),e.clone(p,i.center),i.radius=y,i};var D=new e;E.expand=function(t,n,a){r.typeOf.object("sphere",t),r.typeOf.object("point",n),a=E.clone(t,a);var i=e.magnitude(e.subtract(n,a.center,D));return i>a.radius&&(a.radius=i),a},E.intersectPlane=function(t,n){r.typeOf.object("sphere",t),r.typeOf.object("plane",n);var a=t.center,i=t.radius,o=n.normal,s=e.dot(o,a)+n.distance;return-i>s?u.OUTSIDE:i>s?u.INTERSECTING:u.INSIDE},E.transform=function(e,t,n){return r.typeOf.object("sphere",e),r.typeOf.object("transform",t),a(n)||(n=new E),n.center=f.multiplyByPoint(t,e.center,n.center),n.radius=f.getMaximumScale(t)*e.radius,n};var B=new e;E.distanceSquaredTo=function(t,n){r.typeOf.object("sphere",t),r.typeOf.object("cartesian",n);var a=e.subtract(t.center,n,B);return e.magnitudeSquared(a)-t.radius*t.radius},E.transformWithoutScale=function(e,t,n){return r.typeOf.object("sphere",e),r.typeOf.object("transform",t),a(n)||(n=new E),n.center=f.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var j=new e;E.computePlaneDistances=function(t,n,i,o){r.typeOf.object("sphere",t),r.typeOf.object("position",n),r.typeOf.object("direction",i),a(o)||(o=new s);var u=e.subtract(t.center,n,j),c=e.dot(i,u);return o.start=c-t.radius,o.stop=c+t.radius,o};for(var z=new e,G=new e,q=new e,X=new e,V=new e,W=new t,H=new Array(8),Y=0;8>Y;++Y)H[Y]=new e;var k=new o;return E.projectTo2D=function(t,a,i){r.typeOf.object("sphere",t),a=n(a,k);var o=a.ellipsoid,u=t.center,s=t.radius,c=o.geodeticSurfaceNormal(u,z),f=e.cross(e.UNIT_Z,c,G);e.normalize(f,f);var l=e.cross(c,f,q);e.normalize(l,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(f,s,f);var y=e.negate(l,V),p=e.negate(f,X),h=H,O=h[0];e.add(c,l,O),e.add(O,f,O),O=h[1],e.add(c,l,O),e.add(O,p,O),O=h[2],e.add(c,y,O),e.add(O,p,O),O=h[3],e.add(c,y,O),e.add(O,f,O),e.negate(c,c),O=h[4],e.add(c,l,O),e.add(O,f,O),O=h[5],e.add(c,l,O),e.add(O,p,O),O=h[6],e.add(c,y,O),e.add(O,p,O),O=h[7],e.add(c,y,O),e.add(O,f,O);for(var _=h.length,d=0;_>d;++d){var T=h[d];e.add(u,T,T);var R=o.cartesianToCartographic(T,W);a.project(R,T)}i=E.fromPoints(h,i),u=i.center;var m=u.x,A=u.y,N=u.z;return u.x=N,u.y=m,u.z=A,i},E.isOccluded=function(e,t){return r.typeOf.object("sphere",e),r.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)},E.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},E.prototype.intersectPlane=function(e){return E.intersectPlane(this,e)},E.prototype.distanceSquaredTo=function(e){return E.distanceSquaredTo(this,e)},E.prototype.computePlaneDistances=function(e,t,r){return E.computePlaneDistances(this,e,t,r)},E.prototype.isOccluded=function(e){return E.isOccluded(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.clone=function(e){return E.clone(this,e)},E}),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},a={};return t(a,{element:{get:function(){return a.supportsFullscreen()?document[n.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?n.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[n.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),a.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 a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;u>o;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),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 a(){if(!t(A)&&(A=!1,!E())){var e=/ Chrome\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(A=!0,N=n(e[1]))}return A}function i(){return a()&&N}function o(){if(!t(S)&&(S=!1,!a()&&!E()&&/ Safari\/[\.0-9]+/.test(m.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(S=!0,b=n(e[1]))}return S}function u(){return o()&&b}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(m.userAgent);null!==e&&(I=!0,M=n(e[1]),M.isNightly=!!e[2])}return I}function c(){return s()&&M}function f(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===m.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==e&&(x=!0,g=n(e[1]))):"Netscape"===m.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==e&&(x=!0,g=n(e[1])))}return x}function l(){return f()&&g}function E(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(w=!0,v=n(e[1]))}return w}function y(){return E()&&v}function p(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(m.userAgent);null!==e&&(C=!0,U=n(e[1]))}return C}function h(){return t(L)||(L=/Windows/i.test(m.appVersion)),L}function O(){return p()&&U}function _(){return t(P)||(P="undefined"!=typeof PointerEvent&&(!t(m.pointerEnabled)||m.pointerEnabled)),P}function d(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;D=t(r)&&""!==r,D&&(F=r)}return D}function T(){return d()?F:void 0}function R(){var e=window.navigator.userAgent.toLowerCase(),t="ipad"==e.match(/ipad/i),r="iphone os"==e.match(/iphone os/i),n="midp"==e.match(/midp/i),a="rv:1.2.3.4"==e.match(/rv:1.2.3.4/i),i="ucweb"==e.match(/ucweb/i),o="android"==e.match(/android/i),u="windows ce"==e.match(/windows ce/i),s="windows mobile"==e.match(/windows mobile/i);return t||r||n||a||i||o||u||s?!1:!0}var m;m="undefined"!=typeof navigator?navigator:{};var A,N,S,b,I,M,x,g,w,v,C,U,L,P,F,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:f,internetExplorerVersion:l,isEdge:E,edgeVersion:y,isFirefox:p,firefoxVersion:O,isWindows:h,hardwareConcurrency:e(m.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:d,imageRenderingValue:T,isPCBroswer:R};return B.supportsFullscreen=function(){return r.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./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,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){if(!t(e))throw new r("value is required.");switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new r("componentDatatype is not a valid value.")}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,n){if(!t(e))throw new r("componentDatatype is required.");if(!t(n))throw new r("valuesOrLength is required.");switch(e){case o.BYTE:return new Int8Array(n);case o.UNSIGNED_BYTE:return new Uint8Array(n);case o.SHORT:return new Int16Array(n);case o.UNSIGNED_SHORT:return new Uint16Array(n); case o.INT:return new Int32Array(n);case o.UNSIGNED_INT:return new Uint32Array(n);case o.FLOAT:return new Float32Array(n);case o.DOUBLE:return new Float64Array(n);default:throw new r("componentDatatype is not a valid value.")}},o.createArrayBufferView=function(n,a,i,u){if(!t(n))throw new r("componentDatatype is required.");if(!t(a))throw new r("buffer is required.");switch(i=e(i,0),u=e(u,(a.byteLength-i)/o.getSizeInBytes(n)),n){case o.BYTE:return new Int8Array(a,i,u);case o.UNSIGNED_BYTE:return new Uint8Array(a,i,u);case o.SHORT:return new Int16Array(a,i,u);case o.UNSIGNED_SHORT:return new Uint16Array(a,i,u);case o.INT:return new Int32Array(a,i,u);case o.UNSIGNED_INT:return new Uint32Array(a,i,u);case o.FLOAT:return new Float32Array(a,i,u);case o.DOUBLE:return new Float64Array(a,i,u);default:throw new r("componentDatatype is not a valid value.")}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE;default:throw new r("name is not a valid value.")}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.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 e(r)}),define("Core/Geometry",["./Check","./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a,i){"use strict";function o(r){r=t(r,t.EMPTY_OBJECT),e.typeOf.object("options.attributes",r.attributes),this.attributes=r.attributes,this.indices=r.indices,this.primitiveType=t(r.primitiveType,i.TRIANGLES),this.boundingSphere=r.boundingSphere,this.geometryType=t(r.geometryType,a.NONE),this.boundingSphereCV=r.boundingSphereCV}return o.computeNumberOfVertices=function(t){e.typeOf.object("geometry",t);var a=-1;for(var i in t.attributes)if(t.attributes.hasOwnProperty(i)&&r(t.attributes[i])&&r(t.attributes[i].values)){var o=t.attributes[i],u=o.values.length/o.componentsPerAttribute;if(a!==u&&-1!==a)throw new n("All attribute lists must have the same number of attributes.");a=u}return a},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(n){if(n=e(n,e.EMPTY_OBJECT),!t(n.componentDatatype))throw new r("options.componentDatatype is required.");if(!t(n.componentsPerAttribute))throw new r("options.componentsPerAttribute is required.");if(n.componentsPerAttribute<1||n.componentsPerAttribute>4)throw new r("options.componentsPerAttribute must be between 1 and 4.");if(!t(n.values))throw new r("options.values is required.");this.componentDatatype=n.componentDatatype,this.componentsPerAttribute=n.componentsPerAttribute,this.normalize=e(n.normalize,!1),this.values=n.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.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}throw new t("indexDatatype is required and must be a valid IndexDatatype constant.")},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(r,a){if(!e(r))throw new t("numberOfVertices is required.");return r>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(a):new Uint16Array(a)},i.createTypedArrayFromArrayBuffer=function(r,a,i,o){if(!e(r))throw new t("numberOfVertices is required.");if(!e(a))throw new t("sourceArray is required.");if(!e(i))throw new t("byteOffset is required.");return r>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(a,i,o):new Uint16Array(a,i,o)},r(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,r,a){a=a||2;var i=r&&r.length,o=i?r[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var f,l,E,y,p,h,O;if(i&&(u=s(e,r,u,a)),e.length>80*a){f=E=e[0],l=y=e[1];for(var _=a;o>_;_+=a)p=e[_],h=e[_+1],f>p&&(f=p),l>h&&(l=h),p>E&&(E=p),h>y&&(y=h);O=Math.max(E-f,y-l)}return n(u,c,a,f,l,O),c}function t(e,t,r,n,a){var i,o;if(a===x(e,t,r,n)>0)for(i=t;r>i;i+=n)o=b(i,e[i],e[i+1],o);else for(i=r-n;i>=t;i-=n)o=b(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function r(e,t){if(!e)return e;t||(t=e);var r,n=e;do if(r=!1,n.steiner||!T(n,n.next)&&0!==d(n.prev,n,n.next))n=n.next;else{if(I(n),n=t=n.prev,n===n.next)return null;r=!0}while(r||n!==t);return t}function n(e,t,s,c,f,l,y){if(e){!y&&l&&E(e,c,f,l);for(var p,h,O=e;e.prev!==e.next;)if(p=e.prev,h=e.next,l?i(e,c,f,l):a(e))t.push(p.i/s),t.push(e.i/s),t.push(h.i/s),I(e),e=h.next,O=h.next;else if(e=h,e===O){y?1===y?(e=o(e,t,s),n(e,t,s,c,f,l,2)):2===y&&u(e,t,s,c,f,l):n(r(e),t,s,c,f,l,1);break}}}function a(e){var t=e.prev,r=e,n=e.next;if(d(t,r,n)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(O(t.x,t.y,r.x,r.y,n.x,n.y,a.x,a.y)&&d(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,r,n){var a=e.prev,i=e,o=e.next;if(d(a,i,o)>=0)return!1;for(var u=a.xi.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,f=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,l=p(u,s,t,r,n),E=p(c,f,t,r,n),y=e.nextZ;y&&y.z<=E;){if(y!==e.prev&&y!==e.next&&O(a.x,a.y,i.x,i.y,o.x,o.y,y.x,y.y)&&d(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(y=e.prevZ;y&&y.z>=l;){if(y!==e.prev&&y!==e.next&&O(a.x,a.y,i.x,i.y,o.x,o.y,y.x,y.y)&&d(y.prev,y,y.next)>=0)return!1;y=y.prevZ}return!0}function o(e,t,r){var n=e;do{var a=n.prev,i=n.next.next;!T(a,i)&&R(a,n,n.next,i)&&A(a,i)&&A(i,a)&&(t.push(a.i/r),t.push(n.i/r),t.push(i.i/r),I(n),I(n.next),n=e=i),n=n.next}while(n!==e);return n}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&_(s,c)){var f=S(s,c);return s=r(s,s.next),f=r(f,f.next),n(s,t,a,i,o,u),void n(f,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,n,a,i){var o,u,s,l,E,y=[];for(o=0,u=n.length;u>o;o++)s=n[o]*i,l=u-1>o?n[o+1]*i:e.length,E=t(e,s,l,i,!1),E===E.next&&(E.steiner=!0),y.push(h(E));for(y.sort(c),o=0;o=n.next.y){var u=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a>=u&&u>o){if(o=u,u===a){if(i===n.y)return n;if(i===n.next.y)return n.next}r=n.x=n.x&&n.x>=f&&O(l>i?a:o,i,f,l,l>i?o:a,i,n.x,n.y)&&(s=Math.abs(i-n.y)/(a-n.x),(E>s||s===E&&n.x>r.x)&&A(n,e)&&(r=n,E=s)),n=n.next;return r}function E(e,t,r,n){var a=e;do null===a.z&&(a.z=p(a.x,a.y,t,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,y(a)}function y(e){var t,r,n,a,i,o,u,s,c=1;do{for(r=e,e=null,i=null,o=0;r;){for(o++,n=r,u=0,t=0;c>t&&(u++,n=n.nextZ,n);t++);for(s=c;u>0||s>0&&n;)0===u?(a=n,n=n.nextZ,s--):0!==s&&n?r.z<=n.z?(a=r,r=r.nextZ,u--):(a=n,n=n.nextZ,s--):(a=r,r=r.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;r=n}i.nextZ=null,c*=2}while(o>1);return e}function p(e,t,r,n,a){return e=32767*(e-r)/a,t=32767*(t-n)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function h(e){var t=e,r=e;do t.x=0&&(e-o)*(n-u)-(r-o)*(t-u)>=0&&(r-o)*(i-u)-(a-o)*(n-u)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!m(e,t)&&A(e,t)&&A(t,e)&&N(e,t)}function d(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,r,n){return T(e,t)&&T(r,n)||T(e,n)&&T(r,t)?!0:d(e,t,r)>0!=d(e,t,n)>0&&d(r,n,e)>0!=d(r,n,t)>0}function m(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&R(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function A(e,t){return d(e.prev,e,e.next)<0?d(e,t,e.next)>=0&&d(e,e.prev,t)>=0:d(e,t,e.prev)<0||d(e,e.next,t)<0}function N(e,t){var r=e,n=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do r.y>i!=r.next.y>i&&a<(r.next.x-r.x)*(i-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function S(e,t){var r=new M(e.i,e.x,e.y),n=new M(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,r.next=a,a.prev=r,n.next=r,r.prev=n,i.next=n,n.prev=i,n}function b(e,t,r,n){var a=new M(e,t,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function I(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function M(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function x(e,t,r,n){for(var a=0,i=t,o=r-n;r>i;i+=n)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,r,n){var a=t&&t.length,i=a?t[0]*r:e.length,o=Math.abs(x(e,0,i,r));if(a)for(var u=0,s=t.length;s>u;u++){var c=t[u]*r,f=s-1>u?t[u+1]*r:e.length;o-=Math.abs(x(e,c,f,r))}var l=0;for(u=0;uo;o++)r.vertices.push(e[a][i][o]);a>0&&(n+=e[a-1].length,r.holes.push(n))}return r},e}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){return r(e)?r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y):void 0},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(r,n,a){return e.typeOf.object("value",r),e.defined("array",n),a=t(a,0),n[a++]=r.x,n[a]=r.y,n},o.unpack=function(n,a,i){return e.defined("array",n),a=t(a,0),r(i)||(i=new o),i.x=n[a++],i.y=n[a],i},o.packArray=function(t,n){e.defined("array",t);var a=t.length;r(n)?n.length=2*a:n=new Array(2*a);for(var i=0;a>i;++i)o.pack(t[i],n,2*i);return n},o.unpackArray=function(t,n){e.defined("array",t);var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;a>i;i+=2){var u=i/2;n[u]=o.unpack(t,i,n[u])}return n},o.fromArray=o.unpack,o.maximumComponent=function(t){return e.typeOf.object("cartesian",t),Math.max(t.x,t.y)},o.minimumComponent=function(t){return e.typeOf.object("cartesian",t),Math.min(t.x,t.y)},o.minimumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.min(t.x,r.x),n.y=Math.min(t.y,r.y),n},o.maximumByComponent=function(t,r,n){return e.typeOf.object("first",t),e.typeOf.object("second",r),e.typeOf.object("result",n),n.x=Math.max(t.x,r.x),n.y=Math.max(t.y,r.y),n},o.magnitudeSquared=function(t){return e.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.subtract(t,r,u),o.magnitude(u)},o.distanceSquared=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.subtract(t,r,u),o.magnitudeSquared(u)},o.normalize=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var a=o.magnitude(t);if(r.x=t.x/a,r.y=t.y/a,isNaN(r.x)||isNaN(r.y))throw new n("normalized result is not a number");return r},o.dot=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),t.x*r.x+t.y*r.y},o.multiplyComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x*r.x,n.y=t.y*r.y,n},o.divideComponents=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x/r.x,n.y=t.y/r.y,n},o.add=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x+r.x,n.y=t.y+r.y,n},o.subtract=function(t,r,n){return e.typeOf.object("left",t),e.typeOf.object("right",r),e.typeOf.object("result",n),n.x=t.x-r.x,n.y=t.y-r.y,n},o.multiplyByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x*r,n.y=t.y*r,n},o.divideByScalar=function(t,r,n){return e.typeOf.object("cartesian",t),e.typeOf.number("scalar",r),e.typeOf.object("result",n),n.x=t.x/r,n.y=t.y/r,n},o.negate=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=-t.x,r.y=-t.y,r},o.abs=function(t,r){return e.typeOf.object("cartesian",t),e.typeOf.object("result",r),r.x=Math.abs(t.x),r.y=Math.abs(t.y),r};var s=new o;o.lerp=function(t,r,n,a){return e.typeOf.object("start",t),e.typeOf.object("end",r),e.typeOf.number("t",n),e.typeOf.object("result",a),o.multiplyByScalar(r,n,s),a=o.multiplyByScalar(t,1-n,a),o.add(s,a,a)};var c=new o,f=new o;o.angleBetween=function(t,r){return e.typeOf.object("left",t),e.typeOf.object("right",r),o.normalize(t,c),o.normalize(r,f),i.acosClamped(o.dot(c,f))};var l=new o;return o.mostOrthogonalAxis=function(t,r){e.typeOf.object("cartesian",t),e.typeOf.object("result",r);var n=o.normalize(t,l);return o.abs(n,n),r=n.x<=n.y?o.clone(o.UNIT_X,r):o.clone(o.UNIT_Y,r)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,n,a,i,o,u,s,c,f,l,E){"use strict";var y=new r,p=new r,h={};h.computeArea2D=function(e){n.defined("positions",e),n.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);for(var t=e.length,r=0,a=t-1,i=0;t>i;a=i++){var o=e[a],u=e[i];r+=o.x*u.y-u.x*o.y}return.5*r},h.computeWindingOrder2D=function(e){var t=h.computeArea2D(e);return t>0?E.COUNTER_CLOCKWISE:E.CLOCKWISE},h.triangulate=function(r,a){n.defined("positions",r);var i=t.packArray(r);return e(i,a,2)};var O=new r,_=new r,d=new r,T=new r,R=new r,m=new r,A=new r;return h.computeSubdivision=function(e,t,u,E){E=i(E,f.RADIANS_PER_DEGREE),n.typeOf.object("ellipsoid",e),n.defined("positions",t),n.defined("indices",u),n.typeOf.number.greaterThanOrEquals("indices.length",u.length,3),n.typeOf.number.equals("indices.length % 3","0",u.length%3,0),n.typeOf.number.greaterThan("granularity",E,0);var y,p=u.slice(0),h=t.length,N=new Array(3*h),S=0;for(y=0;h>y;y++){var b=t[y];N[S++]=b.x,N[S++]=b.y,N[S++]=b.z}for(var I=[],M={},x=e.maximumRadius,g=f.chordLength(E,x),w=g*g;p.length>0;){var v,C,U=p.pop(),L=p.pop(),P=p.pop(),F=r.fromArray(N,3*P,O),D=r.fromArray(N,3*L,_),B=r.fromArray(N,3*U,d),j=r.multiplyByScalar(r.normalize(F,T),x,T),z=r.multiplyByScalar(r.normalize(D,R),x,R),G=r.multiplyByScalar(r.normalize(B,m),x,m),q=r.magnitudeSquared(r.subtract(j,z,A)),X=r.magnitudeSquared(r.subtract(z,G,A)),V=r.magnitudeSquared(r.subtract(G,j,A)),W=Math.max(q,X,V);W>w?q===W?(v=Math.min(P,L)+" "+Math.max(P,L),y=M[v],o(y)||(C=r.add(F,D,A),r.multiplyByScalar(C,.5,C),N.push(C.x,C.y,C.z),y=N.length/3-1,M[v]=y),p.push(P,y,U),p.push(y,L,U)):X===W?(v=Math.min(L,U)+" "+Math.max(L,U),y=M[v],o(y)||(C=r.add(D,B,A),r.multiplyByScalar(C,.5,C),N.push(C.x,C.y,C.z),y=N.length/3-1,M[v]=y),p.push(L,y,P),p.push(y,U,P)):V===W&&(v=Math.min(U,P)+" "+Math.max(U,P),y=M[v],o(y)||(C=r.add(B,F,A),r.multiplyByScalar(C,.5,C),N.push(C.x,C.y,C.z),y=N.length/3-1,M[v]=y),p.push(U,y,L),p.push(y,P,L)):(I.push(P),I.push(L),I.push(U))}return new s({attributes:{position:new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:N})},indices:I,primitiveType:l.TRIANGLES})},h.scaleToGeodeticHeight=function(e,t,n,a){n=i(n,u.WGS84);var s=y,c=p;if(t=i(t,0),a=i(a,!0),o(e))for(var f=e.length,l=0;f>l;l+=3)r.fromArray(e,l,c),a&&(c=n.scaleToGeodeticSurface(c,c)),0!==t&&(s=n.geodeticSurfaceNormal(c,s),r.multiplyByScalar(s,t,s),r.add(c,s,c)),e[l]=c.x,e[l+1]=c.y,e[l+2]=c.z;return e},h}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,r,n,a,i){"use strict";function o(e,t,n,a){this[0]=r(e,0),this[1]=r(n,0),this[2]=r(t,0),this[3]=r(a,0)}o.packedLength=4,o.pack=function(e,n,a){return t.typeOf.object("value",e),t.defined("array",n),a=r(a,0),n[a++]=e[0],n[a++]=e[1],n[a++]=e[2],n[a++]=e[3],n},o.unpack=function(e,a,i){return t.defined("array",e),a=r(a,0),n(i)||(i=new o),i[0]=e[a++],i[1]=e[a++],i[2]=e[a++],i[3]=e[a++],i},o.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):new o(e[0],e[2],e[1],e[3]):void 0},o.fromArray=function(e,a,i){return t.defined("array",e),a=r(a,0),n(i)||(i=new o),i[0]=e[a],i[1]=e[a+1],i[2]=e[a+2],i[3]=e[a+3],i},o.fromColumnMajorArray=function(e,r){return t.defined("values",e),o.clone(e,r)},o.fromRowMajorArray=function(e,r){return t.defined("values",e),n(r)?(r[0]=e[0],r[1]=e[2],r[2]=e[1],r[3]=e[3],r):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,r){return t.typeOf.object("scale",e),n(r)?(r[0]=e.x,r[1]=0,r[2]=0,r[3]=e.y,r):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,r){return t.typeOf.number("scale",e),n(r)?(r[0]=e,r[1]=0,r[2]=0,r[3]=e,r):new o(e,0,0,e)},o.fromRotation=function(e,r){t.typeOf.number("angle",e);var a=Math.cos(e),i=Math.sin(e);return n(r)?(r[0]=a,r[1]=i,r[2]=-i,r[3]=a,r):new o(a,-i,i,a)},o.toArray=function(e,r){return t.typeOf.object("matrix",e),n(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,r){return t.typeOf.number.greaterThanOrEquals("row",r,0),t.typeOf.number.lessThanOrEquals("row",r,1),t.typeOf.number.greaterThanOrEquals("column",e,0),t.typeOf.number.lessThanOrEquals("column",e,1),2*e+r},o.getColumn=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,1),t.typeOf.object("result",n);var a=2*r,i=e[a],o=e[a+1];return n.x=i,n.y=o,n},o.setColumn=function(e,r,n,a){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,1),t.typeOf.object("cartesian",n),t.typeOf.object("result",a),a=o.clone(e,a);var i=2*r;return a[i]=n.x,a[i+1]=n.y,a},o.getRow=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,1),t.typeOf.object("result",n);var a=e[r],i=e[r+2];return n.x=a,n.y=i,n},o.setRow=function(e,r,n,a){return t.typeOf.object("matrix",e),t.typeOf.number.greaterThanOrEquals("index",r,0),t.typeOf.number.lessThanOrEquals("index",r,1),t.typeOf.object("cartesian",n),t.typeOf.object("result",a),a=o.clone(e,a),a[r]=n.x,a[r+2]=n.y,a};var u=new e;o.getScale=function(r,n){return t.typeOf.object("matrix",r),t.typeOf.object("result",n),n.x=e.magnitude(e.fromElements(r[0],r[1],u)),n.y=e.magnitude(e.fromElements(r[2],r[3],u)),n};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.maximumComponent(s)},o.multiply=function(e,r,n){t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n);var a=e[0]*r[0]+e[2]*r[1],i=e[0]*r[2]+e[2]*r[3],o=e[1]*r[0]+e[3]*r[1],u=e[1]*r[2]+e[3]*r[3];return n[0]=a,n[1]=o,n[2]=i,n[3]=u,n},o.add=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n[0]=e[0]+r[0],n[1]=e[1]+r[1],n[2]=e[2]+r[2],n[3]=e[3]+r[3],n},o.subtract=function(e,r,n){return t.typeOf.object("left",e),t.typeOf.object("right",r),t.typeOf.object("result",n),n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],n[3]=e[3]-r[3],n},o.multiplyByVector=function(e,r,n){t.typeOf.object("matrix",e),t.typeOf.object("cartesian",r),t.typeOf.object("result",n);var a=e[0]*r.x+e[2]*r.y,i=e[1]*r.x+e[3]*r.y;return n.x=a,n.y=i,n},o.multiplyByScalar=function(e,r,n){return t.typeOf.object("matrix",e),t.typeOf.number("scalar",r),t.typeOf.object("result",n),n[0]=e[0]*r,n[1]=e[1]*r,n[2]=e[2]*r,n[3]=e[3]*r,n},o.multiplyByScale=function(e,r,n){return t.typeOf.object("matrix",e),t.typeOf.object("scale",r),t.typeOf.object("result",n),n[0]=e[0]*r.x,n[1]=e[1]*r.x,n[2]=e[2]*r.y,n[3]=e[3]*r.y,n},o.negate=function(e,r){return t.typeOf.object("matrix",e),t.typeOf.object("result",r),r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r},o.transpose=function(e,r){t.typeOf.object("matrix",e),t.typeOf.object("result",r);var n=e[0],a=e[2],i=e[1],o=e[3];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r},o.abs=function(e,r){return t.typeOf.object("matrix",e),t.typeOf.object("result",r),r[0]=Math.abs(e[0]),r[1]=Math.abs(e[1]),r[2]=Math.abs(e[2]),r[3]=Math.abs(e[3]),r},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.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]},o.equalsEpsilon=function(e,r,a){return t.typeOf.number("epsilon",a),e===r||n(e)&&n(r)&&Math.abs(e[0]-r[0])<=a&&Math.abs(e[1]-r[1])<=a&&Math.abs(e[2]-r[2])<=a&&Math.abs(e[3]-r[3])<=a},o.IDENTITY=i(new o(1,0,0,1)),o.ZERO=i(new o(0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,a(o.prototype,{length:{get:function(){return o.packedLength}}}),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},o}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,r,n,a,i,o,u){"use strict";function s(t,r,n,a,i,u,s){var c=Math.cos(r),f=a*c,l=n*c,E=Math.sin(r),h=a*E,d=n*E;p=_.project(t,p),p=e.subtract(p,O,p);var T=o.fromRotation(r,y);p=o.multiplyByVector(T,p,p),p=e.add(p,O,p),t=_.unproject(p,t),u-=1,s-=1;var R=t.latitude,m=R+u*d,A=R-f*s,N=R-f*s+u*d,S=Math.max(R,m,A,N),b=Math.min(R,m,A,N),I=t.longitude,M=I+u*l,x=I+s*h,g=I+s*h+u*l,w=Math.max(I,M,x,g),v=Math.min(I,M,x,g);return{north:S,south:b,east:w,west:v,granYCos:f,granYSin:h,granXCos:l,granXSin:d,nwCorner:t}}var c=Math.cos,f=Math.sin,l=Math.sqrt,E={};E.computePosition=function(e,t,n,a,i){var o=e.ellipsoid.radiiSquared,u=e.nwCorner,s=e.rectangle,E=u.latitude-e.granYCos*t+n*e.granXSin,y=c(E),p=f(E),h=o.z*p,O=u.longitude+t*e.granYSin+n*e.granXCos,_=y*c(O),d=y*f(O),T=o.x*_,R=o.y*d,m=l(T*_+R*d+h*p);if(a.x=T/m,a.y=R/m,a.z=h/m,r(e.vertexFormat)&&e.vertexFormat.st){var A=e.stNwCorner;r(A)?(E=A.latitude-e.stGranYCos*t+n*e.stGranXSin,O=A.longitude+t*e.stGranYSin+n*e.stGranXCos,i.x=(O-e.stWest)*e.lonScalar,i.y=(E-e.stSouth)*e.latScalar):(i.x=(O-s.west)*e.lonScalar,i.y=(E-s.south)*e.latScalar)}};var y=new o,p=new e,h=new t,O=new e,_=new a;return E.computeOptions=function(e,t,r,a){var o,c,f,l,E,y=e._granularity,p=e._ellipsoid,d=e._surfaceHeight,T=e._rotation,R=e._stRotation,m=e._extrudedHeight,A=t.east,N=t.west,S=t.north,b=t.south,I=S-b;N>A?(E=i.TWO_PI-N+A,o=Math.ceil(E/y)+1,c=Math.ceil(I/y)+1,f=E/(o-1),l=I/(c-1)):(E=A-N,o=Math.ceil(E/y)+1,c=Math.ceil(I/y)+1,f=E/(o-1),l=I/(c-1)),r=u.northwest(t,r);var M=u.center(t,h);(0!==T||0!==R)&&(M.longitudei.PI_OVER_TWO||b<-i.PI_OVER_TWO||b>i.PI_OVER_TWO)throw new n("Rotated rectangle is invalid. It crosses over either the north or south pole.");C.granYCos=U.granYCos,C.granYSin=U.granYSin,C.granXCos=U.granXCos,C.granXSin=U.granXSin,t.north=S,t.south=b,t.east=A,t.west=N}if(0!==R){T-=R,a=u.northwest(t,a);var L=s(a,T,f,l,M,o,c);C.stGranYCos=L.granYCos,C.stGranXCos=L.granXCos,C.stGranYSin=L.granYSin,C.stGranXSin=L.granXSin,C.stNwCorner=a,C.stWest=L.west,C.stSouth=L.south}return C},E}),define("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,r,n,a,i,o,u,s,c,f,l,E,y,p,h,O){"use strict";function _(e){var t,r=e.size,a=e.height,i=e.width,o=new Float64Array(3*r),u=0,E=0,y=A;for(t=0;i>t;t++)O.computePosition(e,E,t,y),o[u++]=y.x,o[u++]=y.y,o[u++]=y.z;for(t=i-1,E=1;a>E;E++)O.computePosition(e,E,t,y),o[u++]=y.x,o[u++]=y.y,o[u++]=y.z;for(E=a-1,t=i-2;t>=0;t--)O.computePosition(e,E,t,y),o[u++]=y.x,o[u++]=y.y,o[u++]=y.z;for(t=0,E=a-2;E>0;E--)O.computePosition(e,E,t,y),o[u++]=y.x,o[u++]=y.y,o[u++]=y.z;for(var h=o.length/3*2,_=l.createTypedArray(o.length/3,h),d=0,T=0;TR;R++)d[T++]=R,d[T++]=R+1,d[T++]=R+f,d[T++]=R+f+1;return d[T++]=f-1,d[T++]=0,d[T++]=f+f-1,d[T++]=f,d[T++]=0,d[T++]=f,d[T++]=s-1,d[T++]=f+s-1,d[T++]=s+u-2,d[T++]=s+u-2+f,d[T++]=2*s+u-3,d[T++]=2*s+u-3+f,o.indices=d,o}function T(e){e=a(e,a.EMPTY_OBJECT);var t=e.rectangle,r=a(e.granularity,E.RADIANS_PER_DEGREE),n=a(e.ellipsoid,u.WGS84),s=a(e.height,0),c=a(e.rotation,0),f=e.extrudedHeight;if(!i(t))throw new o("rectangle is required.");if(h.validate(t),t.north