text: /**
   * Cesium - https://github.com/AnalyticalGraphicsInc/cesium
   *
   * Copyright 2011-2014 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.
  */
  
  /**
    @license
    when.js - https://github.com/cujojs/when
  
    MIT License (c) copyright B Cavalier & J Hann
  
   * A lightweight CommonJS Promises/A and when() implementation
   * when is part of the cujo.js family of libraries (http://cujojs.com/)
   *
   * Licensed under the MIT License at:
   * http://www.opensource.org/licenses/mit-license.php
   *
   * @version 1.7.1
   */
  
  /**
  @license
  sprintf.js from the php.js project - https://github.com/kvz/phpjs
  Directly from https://github.com/kvz/phpjs/blob/master/functions/strings/sprintf.js
  
  php.js is copyright 2012 Kevin van Zonneveld.
  
  Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
  (http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
  (http://getsprink.com), Waldo Malqui Silva, Paulo Freitas, Jack, Jonas
  Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Legaev
  Andrey, Ates Goral (http://magnetiq.com), Alex, Ratheous, Martijn Wieringa,
  Rafa? Kukawski (http://blog.kukawski.pl), lmeyrick
  (https://sourceforge.net/projects/bcmath-js/), Nate, Philippe Baumann,
  Enrique Gonzalez, Webtoolkit.info (http://www.webtoolkit.info/), Carlos R.
  L. Rodrigues (http://www.jsfromhell.com), Ash Searle
  (http://hexmen.com/blog/), Jani Hartikainen, travc, Ole Vrijenhoek,
  Erkekjetter, Michael Grier, Rafa? Kukawski (http://kukawski.pl), Johnny
  Mast (http://www.phpvrouwen.nl), T.Wild, d3x,
  http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript,
  Rafa? Kukawski (http://blog.kukawski.pl/), stag019, pilus, WebDevHobo
  (http://webdevhobo.blogspot.com/), marrtins, GeekFG
  (http://geekfg.blogspot.com), Andrea Giammarchi
  (http://webreflection.blogspot.com), Arpad Ray (mailto:arpad@php.net),
  gorthaur, Paul Smith, Tim de Koning (http://www.kingsquare.nl), Joris, Oleg
  Eremeev, Steve Hilder, majak, gettimeofday, KELAN, Josh Fraser
  (http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/),
  Marc Palau, Martin
  (http://www.erlenwiese.de/), Breaking Par Consulting Inc
  (http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7),
  Chris, Mirek Slugen, saulius, Alfonso Jimenez
  (http://www.alfonsojimenez.com), Diplom@t (http://difane.com/), felix,
  Mailfaker (http://www.weedem.fr/), Tyler Akins (http://rumkin.com), Caio
  Ariede (http://caioariede.com), Robin, Kankrelune
  (http://www.webfaktory.info/), Karol Kowalski, Imgen Tata
  (http://www.myipdf.com/), mdsjack (http://www.mdsjack.bo.it), Dreamer,
  Felix Geisendoerfer (http://www.debuggable.com/felix), Lars Fischer, AJ,
  David, Aman Gupta, Michael White, Public Domain
  (http://www.json.org/json2.js), Steven Levithan
  (http://blog.stevenlevithan.com), Sakimori, Pellentesque Malesuada,
  Thunder.m, Dj (http://phpjs.org/functions/htmlentities:425#comment_134018),
  Steve Clay, David James, Francois, class_exists, nobbler, T. Wild, Itsacon
  (http://www.itsacon.net/), date, Ole Vrijenhoek (http://www.nervous.nl/),
  Fox, Raphael (Ao RUDLER), Marco, noname, Mateusz "loonquawl" Zalega, Frank
  Forte, Arno, ger, mktime, john (http://www.jd-tech.net), Nick Kolosov
  (http://sammy.ru), marc andreu, Scott Cariss, Douglas Crockford
  (http://javascript.crockford.com), madipta, Slawomir Kaniecki,
  ReverseSyntax, Nathan, Alex Wilson, kenneth, Bayron Guevara, Adam Wallner
  (http://web2.bitbaro.hu/), paulo kuong, jmweb, Lincoln Ramsay, djmix,
  Pyerre, Jon Hohle, Thiago Mata (http://thiagomata.blog.com), lmeyrick
  (https://sourceforge.net/projects/bcmath-js/this.), Linuxworld, duncan,
  Gilbert, Sanjoy Roy, Shingo, sankai, Oskar Larsson H?gfeldt
  (http://oskar-lh.name/), Denny Wardhana, 0m3r, Everlasto, Subhasis Deb,
  josh, jd, Pier Paolo Ramon (http://www.mastersoup.com/), P, merabi, Soren
  Hansen, Eugene Bulkin (http://doubleaw.com/), Der Simon
  (http://innerdom.sourceforge.net/), echo is bad, Ozh, XoraX
  (http://www.xorax.info), EdorFaus, JB, J A R, Marc Jansen, Francesco, LH,
  Stoyan Kyosev (http://www.svest.org/), nord_ua, omid
  (http://phpjs.org/functions/380:380#comment_137122), Brad Touesnard, MeEtc
  (http://yass.meetcweb.com), Peter-Paul Koch
  (http://www.quirksmode.org/js/beat.html), Olivier Louvignes
  (http://mg-crea.com/), T0bsn, Tim Wiel, Bryan Elliott, Jalal Berrami,
  Martin, JT, David Randall, Thomas Beaucourt (http://www.webapp.fr), taith,
  vlado houba, Pierre-Luc Paour, Kristof Coomans (SCK-CEN Belgian Nucleair
  Research Centre), Martin Pool, Kirk Strobeck, Rick Waldron, Brant Messenger
  (http://www.brantmessenger.com/), Devan Penner-Woelk, Saulo Vallory, Wagner
  B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong
  (http://carrot.org/), Christoph, Daniel Esteban, strftime, Mick@el, rezna,
  Simon Willison (http://simonwillison.net), Anton Ongson, Gabriel Paderni,
  Marco van Oort, penutbutterjelly, Philipp Lenssen, Bjorn Roesbeke
  (http://www.bjornroesbeke.be/), Bug?, Eric Nagel, Tomasz Wesolowski,
  Evertjan Garretsen, Bobby Drake, Blues (http://tech.bluesmoon.info/), Luke
  Godfrey, Pul, uestla, Alan C, Ulrich, Rafal Kukawski, Yves Sucaet,
  sowberry, Norman "zEh" Fuchs, hitwork, Zahlii, johnrembo, Nick Callen,
  Steven Levithan (stevenlevithan.com), ejsanders, Scott Baker, Brian Tafoya
  (http://www.premasolutions.com/), Philippe Jausions
  (http://pear.php.net/user/jausions), Aidan Lister
  (http://aidanlister.com/), Rob, e-mike, HKM, ChaosNo1, metjay, strcasecmp,
  strcmp, Taras Bogach, jpfle, Alexander Ermolaev
  (http://snippets.dzone.com/user/AlexanderErmolaev), DxGx, kilops, Orlando,
  dptr1988, Le Torbi, James (http://www.james-bell.co.uk/), Pedro Tainha
  (http://www.pedrotainha.com), James, Arnout Kazemier
  (http://www.3rd-Eden.com), Chris McMacken, gabriel paderni, Yannoo,
  FGFEmperor, baris ozdil, Tod Gentille, Greg Frazier, jakes, 3D-GRAF, Allan
  Jensen (http://www.winternet.no), Howard Yeend, Benjamin Lupton, davook,
  daniel airton wermann (http://wermann.com.br), Atli T¨®r, Maximusya, Ryan
  W Tenney (http://ryan.10e.us), Alexander M Beedie, fearphage
  (http://http/my.opera.com/fearphage/), Nathan Sepulveda, Victor, Matteo,
  Billy, stensi, Cord, Manish, T.J. Leahy, Riddler
  (http://www.frontierwebdev.com/), Rafa? Kukawski, FremyCompany, Matt
  Bradley, Tim de Koning, Luis Salazar (http://www.freaky-media.com/), Diogo
  Resende, Rival, Andrej Pavlovic, Garagoth, Le Torbi
  (http://www.letorbi.de/), Dino, Josep Sanz (http://www.ws3.es/), rem,
  Russell Walker (http://www.nbill.co.uk/), Jamie Beck
  (http://www.terabit.ca/), setcookie, Michael, YUI Library:
  http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at
  http://hacks.bluesmoon.info/strftime/strftime.js, Ben
  (http://benblume.co.uk/), DtTvB
  (http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, William,
  meo, incidence, Cagri Ekin, Amirouche, Amir Habibi
  (http://www.residence-mixte.com/), Luke Smith (http://lucassmith.name),
  Kheang Hok Chin (http://www.distantia.ca/), Jay Klehr, Lorenzo Pisani,
  Tony, Yen-Wei Liu, Greenseed, mk.keck, Leslie Hoare, dude, booeyOH, Ben
  Bryan
  
  Licensed under the MIT (MIT-LICENSE.txt) license.
  
  Permission is hereby granted, free of charge, to any person obtaining a
  copy of this software and associated documentation files (the
  "Software"), to deal in the Software without restriction, including
  without limitation the rights to use, copy, modify, merge, publish,
  distribute, sublicense, and/or sell copies of the Software, and to
  permit persons to whom the Software is furnished to do so, subject to
  the following conditions:
  
  The above copyright notice and this permission notice shall be included
  in all copies or substantial portions of the Software.
  
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES
  OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  OTHER DEALINGS IN THE SOFTWARE.
  */
  
  /**
   * @license
   *
   * Grauw URI utilities
   *
   * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js
   *
   * @author Laurens Holst (http://www.grauw.nl/)
   *
   *   Copyright 2012 Laurens Holst
   *
   *   Licensed under the Apache License, Version 2.0 (the "License");
   *   you may not use this file except in compliance with the License.
   *   You may obtain a copy of the License at
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *   limitations under the License.
   *
   */
  
  !function(){define("Core/defined",[],function(){"use strict";var e=function(e){return void 0!==e};return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";var t=function(e,t){return void 0!==e?e:t};return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";var t=function(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=2636928640&e<<7,e^=4022730752&e<<15,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:0>e?-1:0},n.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},n.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},n.lerp=function(e,t,n){return(1-n)*e+n*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=.5*3*Math.PI,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.negativePiToPi=function(e){for(var t=n.EPSILON10,r=n.PI,a=n.TWO_PI;-(r+t)>e;)e+=a;if(-r>e)return-r;for(;e>r+t;)e-=a;return e>r?r:e},n.zeroToTwoPi=function(e){var t=e%n.TWO_PI;return 0>t?(t+n.TWO_PI)%n.TWO_PI:t},n.equalsEpsilon=function(e,n,r){return r=t(r,0),Math.abs(e-n)<=r};var r=[1];n.factorial=function(e){var t=r.length;if(e>=t)for(var n=r[t-1],a=t;e>=a;a++)r.push(n*a);return r[e]},n.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,n){return t>e?t:e>n?n:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n}),define("Core/Cartesian3",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i=function(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)};i.fromSpherical=function(n,r){t(r)||(r=new i);var a=n.clock,o=n.cone,s=e(n.magnitude,1),u=s*Math.sin(o);return r.x=u*Math.cos(a),r.y=u*Math.sin(a),r.z=s*Math.cos(o),r},i.fromElements=function(e,n,r,a){return t(a)?(a.x=e,a.y=n,a.z=r,a):new i(e,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n):new i(e.x,e.y,e.z):void 0},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r++],a.z=n[r],a},i.fromArray=i.unpack,i.getMaximumComponent=function(e){return Math.max(e.x,e.y,e.z)},i.getMinimumComponent=function(e){return Math.min(e.x,e.y,e.z)},i.getMinimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},i.getMaximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,s),r=i.multiplyByScalar(e,1-n,r),i.add(s,r,r)};var u=new i,c=new i;i.angleBetween=function(e,t){i.normalize(e,u),i.normalize(t,c);var n=i.dot(u,c),r=i.magnitude(i.cross(u,c,u));return Math.atan2(r,n)};var l=new i;i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?n.x<=n.z?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Z,t):n.y<=n.z?i.clone(i.UNIT_Y,t):i.clone(i.UNIT_Z,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z},i.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r},i.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,s=t.y,u=t.z,c=a*u-i*s,l=i*o-r*u,h=r*s-a*o;return n.x=c,n.y=l,n.z=h,n},i.fromDegrees=function(e,t,n,r,o){var s=a.toRadians(e),u=a.toRadians(t);return i.fromRadians(s,u,n,r,o)};var h=new i,f=new i,d=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(n,r,a,o,s){a=e(a,0);var u=t(o)?o.radiiSquared:d,c=Math.cos(r);h.x=c*Math.cos(n),h.y=c*Math.sin(n),h.z=Math.sin(r),h=i.normalize(h,h),i.multiplyComponents(u,h,f);var l=Math.sqrt(i.dot(h,f));return f=i.divideByScalar(f,l,f),h=i.multiplyByScalar(h,a,h),t(s)||(s=new i),i.add(f,h,s)},i.fromDegreesArray=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o++)r[o]=a.toRadians(e[o]);return i.fromRadiansArray(r,t,n)},i.fromRadiansArray=function(e,n,r){var a=e.length;t(r)?r.length=a/2:r=new Array(a/2);for(var o=0;a>o;o+=2){var s=e[o],u=e[o+1];r[o/2]=i.fromRadians(s,u,0,n,r[o/2])}return r},i.fromDegreesArrayHeights=function(e,t,n){for(var r=new Array(e.length),o=0;o<e.length;o+=3)r[o]=a.toRadians(e[o]),r[o+1]=a.toRadians(e[o+1]),r[o+2]=e[o+2];return i.fromRadiansArrayHeights(r,t,n)},i.fromRadiansArrayHeights=function(e,n,r){var a=e.length;t(r)?r.length=a/3:r=new Array(a/3);for(var o=0;a>o;o+=3){var s=e[o],u=e[o+1],c=e[o+2];r[o/3]=i.fromRadians(s,u,c,n,r[o/3])}return r},i.ZERO=r(new i(0,0,0)),i.UNIT_X=r(new i(1,0,0)),i.UNIT_Y=r(new i(0,1,0)),i.UNIT_Z=r(new i(0,0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/Cartographic",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i=function(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)};return i.fromRadians=function(n,r,a,o){return a=e(a,0),t(o)?(o.longitude=n,o.latitude=r,o.height=a,o):new i(n,r,a)},i.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),i.fromRadians(e,t,n,r)},i.clone=function(e,n){return t(e)?t(n)?(n.longitude=e.longitude,n.latitude=e.latitude,n.height=e.height,n):new i(e.longitude,e.latitude,e.height):void 0},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.longitude===n.longitude&&e.latitude===n.latitude&&e.height===n.height},i.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.longitude-n.longitude)<=r&&Math.abs(e.latitude-n.latitude)<=r&&Math.abs(e.height-n.height)<=r},i.toString=function(e){return"("+e.longitude+", "+e.latitude+", "+e.height+")"},i.ZERO=r(new i(0,0,0)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return i.toString(this)},i}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,s){"use strict";var u=function(t,r,a){t=n(t,0),r=n(r,0),a=n(a,0),this._radii=new e(t,r,a),this._radiiSquared=new e(t*t,r*r,a*a),this._radiiToTheFourth=new e(t*t*t*t,r*r*r*r,a*a*a*a),this._oneOverRadii=new e(0===t?0:1/t,0===r?0:1/r,0===a?0:1/a),this._oneOverRadiiSquared=new e(0===t?0:1/(t*t),0===r?0:1/(r*r),0===a?0:1/(a*a)),this._minimumRadius=Math.min(t,r,a),this._maximumRadius=Math.max(t,r,a),this._centerToleranceSquared=s.EPSILON1};a(u.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),u.clone=function(t,n){if(!r(t))return void 0;var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new u(a.x,a.y,a.z)},u.fromCartesian3=function(e){return r(e)?new u(e.x,e.y,e.z):new u},u.WGS84=o(new u(6378137,6378137,6356752.314245179)),u.UNIT_SPHERE=o(new u(1,1,1)),u.MOON=o(new u(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.geocentricSurfaceNormal=e.normalize,u.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),s=o*Math.cos(a),u=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=s,n.y=u,n.z=c,e.normalize(n,n)},u.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var c=new e,l=new e;u.prototype.cartographicToCartesian=function(t,n){var a=c,i=l;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},u.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;n>a;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,f=new e,d=new e;u.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,f);if(!r(i))return void 0;var o=this.geodeticSurfaceNormal(i,h),u=e.subtract(n,i,d),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),m=s.sign(e.dot(u,n))*e.magnitude(u);return r(a)?(a.longitude=c,a.latitude=l,a.height=m,a):new t(c,l,m)},u.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;n>a;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t};var m=new e,p=new e;return u.prototype.scaleToGeodeticSurface=function(t,n){var a=t.x,i=t.y,o=t.z,u=this._oneOverRadii,c=u.x,l=u.y,h=u.z,f=a*a*c*c,d=i*i*l*l,y=o*o*h*h,v=f+d+y,g=Math.sqrt(1/v),w=e.multiplyByScalar(t,g,m);if(v<this._centerToleranceSquared)return isFinite(g)?e.clone(w,n):void 0;var E=this._oneOverRadiiSquared,x=E.x,S=E.y,M=E.z,_=p;_.x=2*w.x*x,_.y=2*w.y*S,_.z=2*w.z*M;var O,T,C,P,N,R,I,b,z,D,A,U=(1-g)*e.magnitude(t)/(.5*e.magnitude(_)),q=0;do{U-=q,C=1/(1+U*x),P=1/(1+U*S),N=1/(1+U*M),R=C*C,I=P*P,b=N*N,z=R*C,D=I*P,A=b*N,O=f*R+d*I+y*b-1,T=f*z*x+d*D*S+y*A*M;var L=-2*T;q=O/L}while(Math.abs(O)>s.EPSILON12);return r(n)?(n.x=a*C,n.y=i*P,n.z=o*N,n):new e(a*C,i*P,o*N)},u.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,s=this._oneOverRadiiSquared,u=1/Math.sqrt(a*a*s.x+i*i*s.y+o*o*s.z);return e.multiplyByScalar(t,u,n)},u.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},u.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},u.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},u.prototype.toString=function(){return this._radii.toString()},u}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";var s=function(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis};return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,s=t.height;return r(n)?(n.x=i,n.y=o,n.z=s,n):new e(i,o,s)},s.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,s=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=s,n):new t(i,o,s)},s}),define("Core/Intersect",[],function(){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e}),define("Core/Interval",["./defaultValue"],function(e){"use strict";var t=function(t,n){this.start=e(t,0),this.stop=e(n,0)};return t}),define("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";var a=function(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)};a.fromElements=function(e,n,r,i,o){return t(o)?(o.x=e,o.y=n,o.z=r,o.w=i,o):new a(e,n,r,i)},a.fromColor=function(e,n){return t(n)?(n.x=e.red,n.y=e.green,n.z=e.blue,n.w=e.alpha,n):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n.z=e.z,n.w=e.w,n):new a(e.x,e.y,e.z,e.w):void 0},a.packedLength=4,a.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.x=n[r++],i.y=n[r++],i.z=n[r++],i.w=n[r],i},a.fromArray=a.unpack,a.getMaximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.getMinimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.getMinimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},a.getMaximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var i=new a;a.distance=function(e,t){return a.subtract(e,t,i),a.magnitude(i)},a.normalize=function(e,t){var n=a.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},a.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},a.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},a.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},a.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var o=new a;a.lerp=function(e,t,n,r){return a.multiplyByScalar(t,n,o),r=a.multiplyByScalar(e,1-n,r),a.add(o,r,r)};var s=new a;return a.mostOrthogonalAxis=function(e,t){var n=a.normalize(e,s);return a.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):n.y<=n.z?n.y<=n.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):n.z<=n.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y&&e.z===n.z&&e.w===n.w},a.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r&&Math.abs(e.z-n.z)<=r&&Math.abs(e.w-n.w)<=r},a.ZERO=r(new a(0,0,0,0)),a.UNIT_X=r(new a(1,0,0,0)),a.UNIT_Y=r(new a(0,1,0,0)),a.UNIT_Z=r(new a(0,0,1,0)),a.UNIT_W=r(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e){for(var t=0,n=0;9>n;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function s(e){for(var t=0,n=0;3>n;++n){var r=e[c.getElementIndex(d[n],f[n])];t+=2*r*r}return Math.sqrt(t)}function u(e,t){for(var n=i.EPSILON15,r=0,a=1,o=0;3>o;++o){var s=Math.abs(e[c.getElementIndex(d[o],f[o])]);s>r&&(a=o,r=s)}var u=1,l=0,h=f[a],m=d[a];if(Math.abs(e[c.getElementIndex(m,h)])>n){var p,y=e[c.getElementIndex(m,m)],v=e[c.getElementIndex(h,h)],g=e[c.getElementIndex(m,h)],w=(y-v)/2/g;p=0>w?-1/(-w+Math.sqrt(1+w*w)):1/(w+Math.sqrt(1+w*w)),u=1/Math.sqrt(1+p*p),l=p*u}return t=c.clone(c.IDENTITY,t),t[c.getElementIndex(h,h)]=t[c.getElementIndex(m,m)]=u,t[c.getElementIndex(m,h)]=l,t[c.getElementIndex(h,m)]=-l,t}var c=function(e,n,r,a,i,o,s,u,c){this[0]=t(e,0),this[1]=t(a,0),this[2]=t(s,0),this[3]=t(n,0),this[4]=t(i,0),this[5]=t(u,0),this[6]=t(r,0),this[7]=t(o,0),this[8]=t(c,0)};c.clone=function(e,t){return n(e)?n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new c(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]):void 0},c.fromArray=function(e,r,a){return r=t(r,0),n(a)||(a=new c),a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],a[8]=e[r+8],a[9]=e[r+9],a},c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},c.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,s=e.y*e.y,u=e.y*e.z,l=e.y*e.w,h=e.z*e.z,f=e.z*e.w,d=e.w*e.w,m=r-s-h+d,p=2*(a-f),y=2*(i+l),v=2*(a+f),g=-r+s-h+d,w=2*(u-o),E=2*(i-l),x=2*(u+o),S=-r-s+h+d;return n(t)?(t[0]=m,t[1]=v,t[2]=E,t[3]=p,t[4]=g,t[5]=x,t[6]=y,t[7]=w,t[8]=S,t):new c(m,p,y,v,g,w,E,x,S)},c.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new c(e.x,0,0,0,e.y,0,0,0,e.z)},c.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new c(e,0,0,0,e,0,0,0,e)},c.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new c(1,0,0,0,r,-a,0,a,r)},c.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new c(r,0,a,0,1,0,-a,0,r)},c.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new c(r,-a,0,a,r,0,0,0,1)},c.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},c.getElementIndex=function(e,t){return 3*e+t},c.getColumn=function(t,r,a){var i=3*r,o=t[i],s=t[i+1],u=t[i+2];return n(a)?(a.x=o,a.y=s,a.z=u,a):new e(o,s,u)},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},c.getRow=function(t,r,a){var i=t[r],o=t[r+3],s=t[r+6];return n(a)?(a.x=i,a.y=o,a.z=s,a):new e(i,o,s)},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;c.getScale=function(t,r){return n(r)||(r=new e),r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),r};var h=new e;c.getMaximumScale=function(t){return c.getScale(t,h),e.getMaximumComponent(h)},c.multiply=function(e,t,r){var a=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],h=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n(r)?(r[0]=a,r[1]=i,r[2]=o,r[3]=s,r[4]=u,r[5]=l,r[6]=h,r[7]=f,r[8]=d,r):new c(a,s,h,i,u,f,o,l,d)},c.multiplyByVector=function(t,r,a){var i=r.x,o=r.y,s=r.z,u=t[0]*i+t[3]*o+t[6]*s,c=t[1]*i+t[4]*o+t[7]*s,l=t[2]*i+t[5]*o+t[8]*s;return n(a)?(a.x=u,a.y=c,a.z=l,a):new e(u,c,l)},c.multiplyByScalar=function(e,t,r){return n(r)?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r):new c(e[0]*t,e[3]*t,e[6]*t,e[1]*t,e[4]*t,e[7]*t,e[2]*t,e[5]*t,e[8]*t)},c.negate=function(e,t){return n(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t):new c(-e[0],-e[3],-e[6],-e[1],-e[4],-e[7],-e[2],-e[5],-e[8])},c.transpose=function(e,t){var r=e[0],a=e[3],i=e[6],o=e[1],s=e[4],u=e[7],l=e[2],h=e[5],f=e[8];return n(t)?(t[0]=r,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=h,t[8]=f,t):new c(r,o,l,a,s,h,i,u,f)};var f=[1,0,0],d=[2,2,1],m=new c,p=new c;return c.getEigenDecomposition=function(e,t){var r=i.EPSILON20,a=10,l=0,h=0;n(t)||(t={});for(var f=t.unitary=c.clone(c.IDENTITY,t.unitary),d=t.diagonal=c.clone(e,t.diagonal),y=r*o(d);a>h&&s(d)>y;)u(d,m),c.transpose(m,p),c.multiply(d,m,d),c.multiply(p,d,d),c.multiply(f,m,f),++l>2&&(++h,l=0);return t},c.abs=function(e,t){return n(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):new c(Math.abs(e[0]),Math.abs(e[3]),Math.abs(e[6]),Math.abs(e[1]),Math.abs(e[4]),Math.abs(e[7]),Math.abs(e[2]),Math.abs(e[5]),Math.abs(e[8]))},c.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],s=e[2],u=e[5],c=e[8];return t*(i*c-u*o)+a*(u*r-n*c)+s*(n*o-i*r)},c.inverse=function(e,t){var a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],h=e[5],f=e[6],d=e[7],m=e[8],p=c.determinant(e);if(Math.abs(p)<=i.EPSILON15)throw new r("matrix is not invertible");n(t)||(t=new c),t[0]=l*m-d*h,t[1]=d*s-o*m,t[2]=o*h-l*s,t[3]=f*h-u*m,t[4]=a*m-f*s,t[5]=u*s-a*h,t[6]=u*d-f*l,t[7]=f*o-a*d,t[8]=a*l-u*o;var y=1/p;return c.multiplyByScalar(t,y,t)},c.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]},c.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},c.IDENTITY=a(new c(1,0,0,0,1,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN1ROW0=3,c.COLUMN1ROW1=4,c.COLUMN1ROW2=5,c.COLUMN2ROW0=6,c.COLUMN2ROW1=7,c.COLUMN2ROW2=8,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n"+"("+this[1]+", "+this[4]+", "+this[7]+")\n"+"("+this[2]+", "+this[5]+", "+this[8]+")"},c}),define("Core/RuntimeError",["./defined"],function(e){"use strict";var t=function(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(n){t=n.stack}this.stack=t};return t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,s,u){"use strict";var c=function(e,t,r,a,i,o,s,u,c,l,h,f,d,m,p,y){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(m,0),this[8]=n(r,0),this[9]=n(s,0),this[10]=n(h,0),this[11]=n(p,0),this[12]=n(a,0),this[13]=n(u,0),this[14]=n(f,0),this[15]=n(y,0)};c.packedLength=16,c.pack=function(e,t,r){r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15]},c.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new c),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a[9]=e[t++],a[10]=e[t++],a[11]=e[t++],a[12]=e[t++],a[13]=e[t++],a[14]=e[t++],a[15]=e[t],a},c.clone=function(e,t){return r(e)?r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]):void 0},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(e,t,n){return r(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new c(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},new s,c.fromTranslationQuaternionRotationScale=function(e,t,n,a){r(a)||(a=new c);var i=n.x,o=n.y,s=n.z,u=t.x*t.x,l=t.x*t.y,h=t.x*t.z,f=t.x*t.w,d=t.y*t.y,m=t.y*t.z,p=t.y*t.w,y=t.z*t.z,v=t.z*t.w,g=t.w*t.w,w=u-d-y+g,E=2*(l-v),x=2*(h+p),S=2*(l+v),M=-u+d-y+g,_=2*(m-f),O=2*(h-p),T=2*(m+f),C=-u-d+y+g;return a[0]=w*i,a[1]=S*i,a[2]=O*i,a[3]=0,a[4]=E*o,a[5]=M*o,a[6]=T*o,a[7]=0,a[8]=x*s,a[9]=_*s,a[10]=C*s,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,a},c.fromTranslation=function(e,t){return c.fromRotationTranslation(s.IDENTITY,e,t)},c.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var l=new e,h=new e,f=new e;c.fromCamera=function(t,n){var a=t.eye,i=t.target,o=t.up;e.normalize(e.subtract(i,a,l),l),e.normalize(e.cross(l,o,h),h),e.normalize(e.cross(h,l,f),f);var s=h.x,u=h.y,d=h.z,m=l.x,p=l.y,y=l.z,v=f.x,g=f.y,w=f.z,E=a.x,x=a.y,S=a.z,M=s*-E+u*-x+d*-S,_=v*-E+g*-x+w*-S,O=m*E+p*x+y*S;return r(n)?(n[0]=s,n[1]=v,n[2]=-m,n[3]=0,n[4]=u,n[5]=g,n[6]=-p,n[7]=0,n[8]=d,n[9]=w,n[10]=-y,n[11]=0,n[12]=M,n[13]=_,n[14]=O,n[15]=1,n):new c(s,u,d,M,v,g,w,_,-m,-p,-y,O,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,a,i){var o=Math.tan(.5*e),s=1/o,u=s/t,l=(a+n)/(n-a),h=2*a*n/(n-a);return r(i)?(i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=-1,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i):new c(u,0,0,0,0,s,0,0,0,0,l,h,0,0,-1,0)},c.computeOrthographicOffCenter=function(e,t,n,a,i,o,s){var u=1/(t-e),l=1/(a-n),h=1/(o-i),f=-(t+e)*u,d=-(a+n)*l,m=-(o+i)*h;return u*=2,l*=2,h*=-2,r(s)?(s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=l,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=h,s[11]=0,s[12]=f,s[13]=d,s[14]=m,s[15]=1,s):new c(u,0,0,f,0,l,0,d,0,0,h,m,0,0,0,1)},c.computePerspectiveOffCenter=function(e,t,n,a,i,o,s){var u=2*i/(t-e),l=2*i/(a-n),h=(t+e)/(t-e),f=(a+n)/(a-n),d=-(o+i)/(o-i),m=-1,p=-2*o*i/(o-i);return r(s)?(s[0]=u,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=l,s[6]=0,s[7]=0,s[8]=h,s[9]=f,s[10]=d,s[11]=m,s[12]=0,s[13]=0,s[14]=p,s[15]=0,s):new c(u,0,h,0,0,l,f,0,0,0,d,p,0,0,m,0)},c.computeInfinitePerspectiveOffCenter=function(e,t,n,a,i,o){var s=2*i/(t-e),u=2*i/(a-n),l=(t+e)/(t-e),h=(a+n)/(a-n),f=-1,d=-1,m=-2*i;return r(o)?(o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=l,o[9]=h,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=m,o[15]=0,o):new c(s,0,l,0,0,u,h,0,0,0,f,m,0,0,d,0)},c.computeViewportTransformation=function(e,t,a,i){e=n(e,n.EMPTY_OBJECT);var o=n(e.x,0),s=n(e.y,0),u=n(e.width,0),l=n(e.height,0);t=n(t,0),a=n(a,1);var h=.5*u,f=.5*l,d=.5*(a-t),m=h,p=f,y=d,v=o+h,g=s+f,w=t+d,E=1;return r(i)?(i[0]=m,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]=y,i[11]=0,i[12]=v,i[13]=g,i[14]=w,i[15]=E,i):new c(m,0,0,v,0,p,0,g,0,0,y,w,0,0,0,E)},c.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,n,a){var i=4*n,o=e[i],s=e[i+1],u=e[i+2],c=e[i+3];return r(a)?(a.x=o,a.y=s,a.z=u,a.w=c,a):new t(o,s,u,c)},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},c.getRow=function(e,n,a){var i=e[n],o=e[n+4],s=e[n+8],u=e[n+12];return r(a)?(a.x=i,a.y=o,a.z=s,a.w=u,a):new t(i,o,s,u)},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var d=new e;c.getScale=function(t,n){return r(n)||(n=new e),n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),n
  };var m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.getMaximumComponent(m)},c.multiply=function(e,t,n){var a=e[0],i=e[1],o=e[2],s=e[3],u=e[4],l=e[5],h=e[6],f=e[7],d=e[8],m=e[9],p=e[10],y=e[11],v=e[12],g=e[13],w=e[14],E=e[15],x=t[0],S=t[1],M=t[2],_=t[3],O=t[4],T=t[5],C=t[6],P=t[7],N=t[8],R=t[9],I=t[10],b=t[11],z=t[12],D=t[13],A=t[14],U=t[15],q=a*x+u*S+d*M+v*_,L=i*x+l*S+m*M+g*_,W=o*x+h*S+p*M+w*_,B=s*x+f*S+y*M+E*_,F=a*O+u*T+d*C+v*P,G=i*O+l*T+m*C+g*P,Y=o*O+h*T+p*C+w*P,H=s*O+f*T+y*C+E*P,V=a*N+u*R+d*I+v*b,j=i*N+l*R+m*I+g*b,k=o*N+h*R+p*I+w*b,X=s*N+f*R+y*I+E*b,Z=a*z+u*D+d*A+v*U,J=i*z+l*D+m*A+g*U,K=o*z+h*D+p*A+w*U,$=s*z+f*D+y*A+E*U;return r(n)?(n[0]=q,n[1]=L,n[2]=W,n[3]=B,n[4]=F,n[5]=G,n[6]=Y,n[7]=H,n[8]=V,n[9]=j,n[10]=k,n[11]=X,n[12]=Z,n[13]=J,n[14]=K,n[15]=$,n):new c(q,F,V,Z,L,G,j,J,W,Y,k,K,B,H,X,$)},c.multiplyTransformation=function(e,t,n){var a=e[0],i=e[1],o=e[2],s=e[4],u=e[5],l=e[6],h=e[8],f=e[9],d=e[10],m=e[12],p=e[13],y=e[14],v=t[0],g=t[1],w=t[2],E=t[4],x=t[5],S=t[6],M=t[8],_=t[9],O=t[10],T=t[12],C=t[13],P=t[14],N=a*v+s*g+h*w,R=i*v+u*g+f*w,I=o*v+l*g+d*w,b=a*E+s*x+h*S,z=i*E+u*x+f*S,D=o*E+l*x+d*S,A=a*M+s*_+h*O,U=i*M+u*_+f*O,q=o*M+l*_+d*O,L=a*T+s*C+h*P+m,W=i*T+u*C+f*P+p,B=o*T+l*C+d*P+y;return r(n)?(n[0]=N,n[1]=R,n[2]=I,n[3]=0,n[4]=b,n[5]=z,n[6]=D,n[7]=0,n[8]=A,n[9]=U,n[10]=q,n[11]=0,n[12]=L,n[13]=W,n[14]=B,n[15]=1,n):new c(N,b,A,L,R,z,U,W,I,D,q,B,0,0,0,1)},c.multiplyByTranslation=function(e,t,n){var a=t.x,i=t.y,o=t.z,s=a*e[0]+i*e[4]+o*e[8]+e[12],u=a*e[1]+i*e[5]+o*e[9]+e[13],l=a*e[2]+i*e[6]+o*e[10]+e[14];return r(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]=s,n[13]=u,n[14]=l,n[15]=e[15],n):new c(e[0],e[4],e[8],s,e[1],e[5],e[9],u,e[2],e[6],e[10],l,e[3],e[7],e[11],e[15])};var p=new e;return c.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,c.multiplyByScale(e,p,n)},c.multiplyByScale=function(e,t,n){var a=t.x,i=t.y,o=t.z;return 1===a&&1===i&&1===o?c.clone(e,n):r(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):new c(a*e[0],i*e[4],o*e[8],e[12],a*e[1],i*e[5],o*e[9],e[13],a*e[2],i*e[6],o*e[10],e[14],0,0,0,1)},c.multiplyByVector=function(e,n,a){var i=n.x,o=n.y,s=n.z,u=n.w,c=e[0]*i+e[4]*o+e[8]*s+e[12]*u,l=e[1]*i+e[5]*o+e[9]*s+e[13]*u,h=e[2]*i+e[6]*o+e[10]*s+e[14]*u,f=e[3]*i+e[7]*o+e[11]*s+e[15]*u;return r(a)?(a.x=c,a.y=l,a.z=h,a.w=f,a):new t(c,l,h,f)},c.multiplyByPointAsVector=function(t,n,a){var i=n.x,o=n.y,s=n.z,u=t[0]*i+t[4]*o+t[8]*s,c=t[1]*i+t[5]*o+t[9]*s,l=t[2]*i+t[6]*o+t[10]*s;return r(a)?(a.x=u,a.y=c,a.z=l,a):new e(u,c,l)},c.multiplyByPoint=function(t,n,a){var i=n.x,o=n.y,s=n.z,u=t[0]*i+t[4]*o+t[8]*s+t[12],c=t[1]*i+t[5]*o+t[9]*s+t[13],l=t[2]*i+t[6]*o+t[10]*s+t[14];return r(a)?(a.x=u,a.y=c,a.z=l,a):new e(u,c,l)},c.multiplyByScalar=function(e,t,n){return r(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):new c(e[0]*t,e[4]*t,e[8]*t,e[12]*t,e[1]*t,e[5]*t,e[9]*t,e[13]*t,e[2]*t,e[6]*t,e[10]*t,e[14]*t,e[3]*t,e[7]*t,e[11]*t,e[15]*t)},c.negate=function(e,t){return r(t)?(t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t):new c(-e[0],-e[4],-e[8],-e[12],-e[1],-e[5],-e[9],-e[13],-e[2],-e[6],-e[10],-e[14],-e[3],-e[7],-e[11],-e[15])},c.transpose=function(e,t){if(!r(t))return new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]);var n=e[1],a=e[2],i=e[3],o=e[6],s=e[7],u=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]=s,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return r(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):new c(Math.abs(e[0]),Math.abs(e[4]),Math.abs(e[8]),Math.abs(e[12]),Math.abs(e[1]),Math.abs(e[5]),Math.abs(e[9]),Math.abs(e[13]),Math.abs(e[2]),Math.abs(e[6]),Math.abs(e[10]),Math.abs(e[14]),Math.abs(e[3]),Math.abs(e[7]),Math.abs(e[11]),Math.abs(e[15]))},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&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},c.getTranslation=function(t,n){return r(n)?(n.x=t[12],n.y=t[13],n.z=t[14],n):new e(t[12],t[13],t[14])},c.getRotation=function(e,t){return r(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):new s(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10])},c.inverse=function(e,t){var n=e[0],a=e[4],i=e[8],s=e[12],l=e[1],h=e[5],f=e[9],d=e[13],m=e[2],p=e[6],y=e[10],v=e[14],g=e[3],w=e[7],E=e[11],x=e[15],S=y*x,M=v*E,_=p*x,O=v*w,T=p*E,C=y*w,P=m*x,N=v*g,R=m*E,I=y*g,b=m*w,z=p*g,D=S*h+O*f+T*d-(M*h+_*f+C*d),A=M*l+P*f+I*d-(S*l+N*f+R*d),U=_*l+N*h+b*d-(O*l+P*h+z*d),q=C*l+R*h+z*f-(T*l+I*h+b*f),L=M*a+_*i+C*s-(S*a+O*i+T*s),W=S*n+N*i+R*s-(M*n+P*i+I*s),B=O*n+P*a+z*s-(_*n+N*a+b*s),F=T*n+I*a+b*i-(C*n+R*a+z*i);S=i*d,M=s*f,_=a*d,O=s*h,T=a*f,C=i*h,P=n*d,N=s*l,R=n*f,I=i*l,b=n*h,z=a*l;var G=S*w+O*E+T*x-(M*w+_*E+C*x),Y=M*g+P*E+I*x-(S*g+N*E+R*x),H=_*g+N*w+b*x-(O*g+P*w+z*x),V=C*g+R*w+z*E-(T*g+I*w+b*E),j=_*y+C*v+M*p-(T*v+S*p+O*y),k=R*v+S*m+N*y-(P*y+I*v+M*m),X=P*p+z*v+O*m-(b*v+_*m+N*p),Z=b*y+T*m+I*p-(R*p+z*y+C*m),J=n*D+a*A+i*U+s*q;if(Math.abs(J)<o.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return J=1/J,r(t)?(t[0]=D*J,t[1]=A*J,t[2]=U*J,t[3]=q*J,t[4]=L*J,t[5]=W*J,t[6]=B*J,t[7]=F*J,t[8]=G*J,t[9]=Y*J,t[10]=H*J,t[11]=V*J,t[12]=j*J,t[13]=k*J,t[14]=X*J,t[15]=Z*J,t):new c(D*J,L*J,G*J,j*J,A*J,W*J,Y*J,k*J,U*J,B*J,H*J,X*J,q*J,F*J,V*J,Z*J)},c.inverseTransformation=function(e,t){var n=e[0],a=e[1],i=e[2],o=e[4],s=e[5],u=e[6],l=e[8],h=e[9],f=e[10],d=e[12],m=e[13],p=e[14],y=-n*d-a*m-i*p,v=-o*d-s*m-u*p,g=-l*d-h*m-f*p;return r(t)?(t[0]=n,t[1]=o,t[2]=l,t[3]=0,t[4]=a,t[5]=s,t[6]=h,t[7]=0,t[8]=i,t[9]=u,t[10]=f,t[11]=0,t[12]=y,t[13]=v,t[14]=g,t[15]=1,t):new c(n,a,i,y,o,s,u,v,l,h,f,g,0,0,0,1)},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n"+"("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n"+"("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n"+"("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o){"use strict";var s=function(e,n,r,a){this.west=t(e,0),this.south=t(n,0),this.east=t(r,0),this.north=t(a,0)};s.fromDegrees=function(e,r,a,i,u){return e=o.toRadians(t(e,0)),r=o.toRadians(t(r,0)),a=o.toRadians(t(a,0)),i=o.toRadians(t(i,0)),n(u)?(u.west=e,u.south=r,u.east=a,u.north=i,u):new s(e,r,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,u=0,c=e.length;c>u;u++){var l=e[u];r=Math.min(r,l.longitude),a=Math.max(a,l.longitude),i=Math.min(i,l.latitude),o=Math.max(o,l.latitude)}return n(t)?(t.west=r,t.south=i,t.east=a,t.north=o,t):new s(r,i,a,o)},s.packedLength=4,s.pack=function(e,n,r){r=t(r,0),n[r++]=e.west,n[r++]=e.south,n[r++]=e.east,n[r]=e.north},s.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new s),a.west=e[r++],a.south=e[r++],a.east=e[r++],a.north=e[r],a},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,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(){},s.getSouthwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.getNorthwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.getNortheast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.getSoutheast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.getCenter=function(t,r){return n(r)?(r.longitude=.5*(t.west+t.east),r.latitude=.5*(t.south+t.north),r.height=0,r):new e(.5*(t.west+t.east),.5*(t.south+t.north))},s.intersectWith=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.contains=function(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north},s.isEmpty=function(e){return e.west>=e.east||e.south>=e.north};var u=new e;return s.subsample=function(e,r,i,s){r=t(r,a.WGS84),i=t(i,0),n(s)||(s=[]);var c=0,l=e.north,h=e.south,f=e.east,d=e.west,m=u;m.height=i,m.longitude=d,m.latitude=l,s[c]=r.cartographicToCartesian(m,s[c]),c++,m.longitude=f,s[c]=r.cartographicToCartesian(m,s[c]),c++,m.latitude=h,s[c]=r.cartographicToCartesian(m,s[c]),c++,m.longitude=d,s[c]=r.cartographicToCartesian(m,s[c]),c++,m.latitude=0>l?l:h>0?h:0;for(var p=1;8>p;++p){var y=-Math.PI+p*o.PI_OVER_TWO;y>d&&f>y&&(m.longitude=y,s[c]=r.cartographicToCartesian(m,s[c]),c++)}return 0===m.latitude&&(m.longitude=d,s[c]=r.cartographicToCartesian(m,s[c]),c++,m.longitude=f,s[c]=r.cartographicToCartesian(m,s[c]),c++),s.length=c,s},s.MAX_VALUE=i(new s(-Math.PI,-o.PI_OVER_TWO,Math.PI,o.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,s,u,c,l){"use strict";var h=function(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)},f=new e,d=new e,m=new e,p=new e,y=new e,v=new e,g=new e,w=new e,E=new e,x=new e,S=new e,M=new e;h.fromPoints=function(t,n){if(r(n)||(n=new h),!r(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var a=e.clone(t[0],g),i=e.clone(a,f),o=e.clone(a,d),s=e.clone(a,m),u=e.clone(a,p),c=e.clone(a,y),l=e.clone(a,v),_=t.length,O=1;_>O;O++){e.clone(t[O],a);var T=a.x,C=a.y,P=a.z;T<i.x&&e.clone(a,i),T>u.x&&e.clone(a,u),C<o.y&&e.clone(a,o),C>c.y&&e.clone(a,c),P<s.z&&e.clone(a,s),P>l.z&&e.clone(a,l)}var N=e.magnitudeSquared(e.subtract(u,i,w)),R=e.magnitudeSquared(e.subtract(c,o,w)),I=e.magnitudeSquared(e.subtract(l,s,w)),b=i,z=u,D=N;R>D&&(D=R,b=o,z=c),I>D&&(D=I,b=s,z=l);var A=E;A.x=.5*(b.x+z.x),A.y=.5*(b.y+z.y),A.z=.5*(b.z+z.z);var U=e.magnitudeSquared(e.subtract(z,A,w)),q=Math.sqrt(U),L=x;L.x=i.x,L.y=o.y,L.z=s.z;var W=S;W.x=u.x,W.y=c.y,W.z=l.z;var B=e.multiplyByScalar(e.add(L,W,w),.5,M),F=0;for(O=0;_>O;O++){e.clone(t[O],a);var G=e.magnitude(e.subtract(a,B,w));G>F&&(F=G);var Y=e.magnitudeSquared(e.subtract(a,A,w));if(Y>U){var H=Math.sqrt(Y);q=.5*(q+H),U=q*q;var V=H-q;A.x=(q*A.x+V*a.x)/H,A.y=(q*A.y+V*a.y)/H,A.z=(q*A.z+V*a.z)/H}}return F>q?(e.clone(A,n.center),n.radius=q):(e.clone(B,n.center),n.radius=F),n};var _=new o,O=new e,T=new e,C=new t,P=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,a,i,o,s){if(r(s)||(s=new h),!r(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;a=n(a,_),l.getSouthwest(t,C),C.height=i,l.getNortheast(t,P),P.height=o;var u=a.project(C,O),c=a.project(P,T),f=c.x-u.x,d=c.y-u.y,m=c.z-u.z;s.radius=.5*Math.sqrt(f*f+d*d+m*m);var p=s.center;return p.x=u.x+.5*f,p.y=u.y+.5*d,p.z=u.z+.5*m,s};var N=[];h.fromRectangle3D=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0);var s;return r(e)&&(s=l.subsample(e,t,a,N)),h.fromPoints(s,o)},h.fromVertices=function(t,a,i,o){if(r(o)||(o=new h),!r(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;a=n(a,e.ZERO),i=n(i,3);var s=g;s.x=t[0]+a.x,s.y=t[1]+a.y,s.z=t[2]+a.z;for(var u=e.clone(s,f),c=e.clone(s,d),l=e.clone(s,m),_=e.clone(s,p),O=e.clone(s,y),T=e.clone(s,v),C=t.length,P=0;C>P;P+=i){var N=t[P]+a.x,R=t[P+1]+a.y,I=t[P+2]+a.z;s.x=N,s.y=R,s.z=I,N<u.x&&e.clone(s,u),N>_.x&&e.clone(s,_),R<c.y&&e.clone(s,c),R>O.y&&e.clone(s,O),I<l.z&&e.clone(s,l),I>T.z&&e.clone(s,T)}var b=e.magnitudeSquared(e.subtract(_,u,w)),z=e.magnitudeSquared(e.subtract(O,c,w)),D=e.magnitudeSquared(e.subtract(T,l,w)),A=u,U=_,q=b;z>q&&(q=z,A=c,U=O),D>q&&(q=D,A=l,U=T);var L=E;L.x=.5*(A.x+U.x),L.y=.5*(A.y+U.y),L.z=.5*(A.z+U.z);var W=e.magnitudeSquared(e.subtract(U,L,w)),B=Math.sqrt(W),F=x;F.x=u.x,F.y=c.y,F.z=l.z;var G=S;G.x=_.x,G.y=O.y,G.z=T.z;var Y=e.multiplyByScalar(e.add(F,G,w),.5,M),H=0;for(P=0;C>P;P+=i){s.x=t[P]+a.x,s.y=t[P+1]+a.y,s.z=t[P+2]+a.z;var V=e.magnitude(e.subtract(s,Y,w));V>H&&(H=V);var j=e.magnitudeSquared(e.subtract(s,L,w));if(j>W){var k=Math.sqrt(j);B=.5*(B+k),W=B*B;var X=k-B;L.x=(B*L.x+X*s.x)/k,L.y=(B*L.y+X*s.y)/k,L.z=(B*L.z+X*s.z)/k}}return H>B?(e.clone(L,o.center),o.radius=B):(e.clone(Y,o.center),o.radius=H),o},h.fromCornerPoints=function(t,n,a){r(a)||(a=new h);var i=a.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),a.radius=e.distance(i,n),a},h.fromEllipsoid=function(t,n){return r(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n},h.clone=function(t,n){return r(t)?r(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius):void 0},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var a=e.center;t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius},h.unpack=function(e,t,a){t=n(t,0),r(a)||(a=new h);var i=a.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],a.radius=e[t],a};var R=new e,I=new e;h.union=function(t,n,a){r(a)||(a=new h);var i=t.center,o=n.center;e.add(i,o,I);var s=e.multiplyByScalar(I,.5,I),u=e.magnitude(e.subtract(i,s,R))+t.radius,c=e.magnitude(e.subtract(o,s,R))+n.radius;return a.radius=Math.max(u,c),e.clone(s,a.center),a};var b=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,b));return a>r.radius&&(r.radius=a),r},h.intersect=function(t,n){var r=t.center,a=t.radius,i=e.dot(n,r)+n.w;return-a>i?s.OUTSIDE:a>i?s.INTERSECTING:s.INSIDE},h.transform=function(e,t,n){return r(n)||(n=new h),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return r(n)||(n=new h),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var D=new e;h.getPlaneDistances=function(t,n,a,i){r(i)||(i=new u);var o=e.subtract(t.center,n,D),s=e.multiplyByScalar(a,e.dot(a,o),D),c=e.magnitude(s);return i.start=c-t.radius,i.stop=c+t.radius,i};for(var A=new e,U=new e,q=new e,L=new e,W=new e,B=new t,F=new Array(8),G=0;8>G;++G)F[G]=new e;var Y=new o;return h.projectTo2D=function(t,r,a){r=n(r,Y);var i=r.ellipsoid,o=t.center,s=t.radius,u=i.geodeticSurfaceNormal(o,A),c=e.cross(e.UNIT_Z,u,U);e.normalize(c,c);var l=e.cross(u,c,q);e.normalize(l,l),e.multiplyByScalar(u,s,u),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c);var f=e.negate(l,W),d=e.negate(c,L),m=F,p=m[0];e.add(u,l,p),e.add(p,c,p),p=m[1],e.add(u,l,p),e.add(p,d,p),p=m[2],e.add(u,f,p),e.add(p,d,p),p=m[3],e.add(u,f,p),e.add(p,c,p),e.negate(u,u),p=m[4],e.add(u,l,p),e.add(p,c,p),p=m[5],e.add(u,l,p),e.add(p,d,p),p=m[6],e.add(u,f,p),e.add(p,d,p),p=m[7],e.add(u,f,p),e.add(p,c,p);for(var y=m.length,v=0;y>v;++v){var g=m[v];e.add(o,g,g);var w=i.cartesianToCartographic(g,B);r.project(w,g)}a=h.fromPoints(m,a),o=a.center;var E=o.x,x=o.y,S=o.z;return o.x=S,o.y=E,o.z=x,a},h.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersect=function(e){return h.intersect(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={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[r.fullscreenElement]:void 0}},changeEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenchange:void 0}},errorEventName:{get:function(){return a.supportsFullscreen()?r.fullscreenerror:void 0}},enabled:{get:function(){return a.supportsFullscreen()?document[r.fullscreenEnabled]:void 0}},fullscreen:{get:function(){return a.supportsFullscreen()?null!==a.element:void 0}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,s=i.length;s>o;++o){var u=i[o];a=u+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=u+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=u+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=u+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=u+"FullscreenEnabled",e(document[a])?r.fullscreenEnabled=a:(a=u+"FullScreenEnabled",e(document[a])&&(r.fullscreenEnabled=a)),a=u+"FullscreenElement",e(document[a])?r.fullscreenElement=a:(a=u+"FullScreenElement",e(document[a])&&(r.fullscreenElement=a)),a=u+"fullscreenchange",e(document["on"+a])&&("ms"===u&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=u+"fullscreenerror",e(document["on"+a])&&("ms"===u&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e){a.supportsFullscreen()&&e[r.requestFullscreen]()},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;r>n;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(f)){var e=/ Chrome\/([\.0-9]+)/.exec(navigator.userAgent);null===e?f=!1:(f=!0,d=r(e[1]))}return f}function i(){return a()&&d}function o(){if(!t(m))if(a()||!/ Safari\/[\.0-9]+/.test(navigator.userAgent))m=!1;else{var e=/ Version\/([\.0-9]+)/.exec(navigator.userAgent);null===e?m=!1:(m=!0,p=r(e[1]))}return m}function s(){return o()&&p}function u(){if(!t(y)){var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);null===e?y=!1:(y=!0,v=r(e[1]),v.isNightly=!!e[2])}return y}function c(){return u()&&v}function l(){if(!t(g)){var e;"Microsoft Internet Explorer"===navigator.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(g=!0,w=r(e[1]))):"Netscape"===navigator.appName?(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(navigator.userAgent),null!==e&&(g=!0,w=r(e[1]))):g=!1}return g}function h(){return l()&&w}var f,d,m,p,y,v,g,w,E={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:s,isWebkit:u,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:h,hardwareConcurrency:e(navigator.hardwareConcurrency,3)};return E.supportsFullscreen=function(){return n.supportsFullscreen()},E.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},E}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection"],function(e,t,n,r){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,FLOAT:5126,DOUBLE:5130};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new n("componentDatatype is not a valid value.")}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t);default:throw new n("componentDatatype is not a valid value.")}},a.createArrayBufferView=function(t,r,i,o){switch(i=e(i,0),o=e(o,(r.byteLength-i)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(r,i,o);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,o);case a.SHORT:return new Int16Array(r,i,o);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,o);case a.FLOAT:return new Float32Array(r,i,o);case a.DOUBLE:return new Float64Array(r,i,o);default:throw new n("componentDatatype is not a valid value.")}},a}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=function(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=t.primitiveType,this.boundingSphere=t.boundingSphere};return r.computeNumberOfVertices=function(e){var r=-1;for(var a in e.attributes)if(e.attributes.hasOwnProperty(a)&&t(e.attributes[a])&&t(e.attributes[a].values)){var i=e.attributes[a],o=i.values.length/i.componentsPerAttribute;if(r!==o&&-1!==r)throw new n("All attribute lists must have the same number of attributes.");r=o}return r},r}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values};return t}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";var t=function(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color};return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./Math"],function(e,t,n){"use strict";var r={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125};return r.getSizeInBytes=function(e){switch(e){case r.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case r.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case r.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},r.validate=function(t){return e(t)&&(t===r.UNSIGNED_BYTE||t===r.UNSIGNED_SHORT||t===r.UNSIGNED_INT)},r.createTypedArray=function(e,t){return e>n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},r}),define("Core/PrimitiveType",[],function(){"use strict";var e={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,validate:function(t){return t===e.POINTS||t===e.LINES||t===e.LINE_LOOP||t===e.LINE_STRIP||t===e.TRIANGLES||t===e.TRIANGLE_STRIP||t===e.TRIANGLE_FAN}};return e}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";var i=function(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i};i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,s=t[0].z,u=t[0].x,c=t[0].y,l=t[0].z,h=t.length,f=1;h>f;f++){var d=t[f],m=d.x,p=d.y,y=d.z;a=Math.min(m,a),u=Math.max(m,u),o=Math.min(p,o),c=Math.max(p,c),s=Math.min(y,s),l=Math.max(y,l)}var v=r.minimum;v.x=a,v.y=o,v.z=s;var g=r.maximum;g.x=u,g.y=c,g.z=l;var w=e.add(v,g,r.center);return e.multiplyByScalar(w,.5,w),r},i.clone=function(t,r){return n(t)?n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum):void 0},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersect=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=r.x*Math.abs(n.x)+r.y*Math.abs(n.y)+r.z*Math.abs(n.z),s=e.dot(t.center,n)+n.w;return s-i>0?a.INSIDE:0>s+i?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersect=function(e){return i.intersect(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a){"use strict";var i=function(t,n){this.x=e(t,0),this.y=e(n,0)};i.fromElements=function(e,n,r){return t(r)?(r.x=e,r.y=n,r):new i(e,n)},i.clone=function(e,n){return t(e)?t(n)?(n.x=e.x,n.y=e.y,n):new i(e.x,e.y):void 0},i.fromCartesian3=i.clone,i.fromCartesian4=i.clone,i.packedLength=2,i.pack=function(t,n,r){r=e(r,0),n[r++]=t.x,n[r]=t.y},i.unpack=function(n,r,a){return r=e(r,0),t(a)||(a=new i),a.x=n[r++],a.y=n[r],a},i.fromArray=i.unpack,i.getMaximumComponent=function(e){return Math.max(e.x,e.y)},i.getMinimumComponent=function(e){return Math.min(e.x,e.y)},i.getMinimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},i.getMaximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},i.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},i.magnitude=function(e){return Math.sqrt(i.magnitudeSquared(e))};var o=new i;i.distance=function(e,t){return i.subtract(e,t,o),i.magnitude(o)},i.normalize=function(e,t){var n=i.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},i.dot=function(e,t){return e.x*t.x+e.y*t.y},i.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},i.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},i.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},i.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},i.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},i.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},i.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new i;i.lerp=function(e,t,n,r){return i.multiplyByScalar(t,n,s),r=i.multiplyByScalar(e,1-n,r),i.add(s,r,r)};var u=new i,c=new i;i.angleBetween=function(e,t){return i.normalize(e,u),i.normalize(t,c),a.acosClamped(i.dot(u,c))};var l=new i;return i.mostOrthogonalAxis=function(e,t){var n=i.normalize(e,l);return i.abs(n,n),t=n.x<=n.y?i.clone(i.UNIT_X,t):i.clone(i.UNIT_Y,t)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.x===n.x&&e.y===n.y},i.equalsEpsilon=function(e,n,r){return e===n||t(e)&&t(n)&&Math.abs(e.x-n.x)<=r&&Math.abs(e.y-n.y)<=r},i.ZERO=r(new i(0,0)),i.UNIT_X=r(new i(1,0)),i.UNIT_Y=r(new i(0,1)),i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.x+", "+this.y+")"},i}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.discriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.realRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),s=Math.abs(e);if(s>o&&o/s<t.EPSILON14)return[0,0];if(o>s&&s/o<t.EPSILON14)return[];if(i=-a/e,0>i)return[];var u=Math.sqrt(i);return[-u,u]}if(0===a)return i=-r/e,0>i?[i,0]:[0,i];var c=r*r,l=4*e*a,h=n(c,-l,t.EPSILON14);if(0>h)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(h),t.EPSILON14);return r>0?[f/e,a/f]:[a/f,f/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,s=t/3,u=n/3,c=r,l=o*u,h=s*c,f=s*s,d=u*u,m=o*u-f,p=o*c-s*u,y=s*c-d,v=4*m*y-p*p;if(0>v){var g,w,E;f*h>=l*d?(g=o,w=m,E=-2*s*m+o*p):(g=c,w=y,E=-c*p+2*u*y);var x=0>E?-1:1,S=-x*Math.abs(g)*Math.sqrt(-v);i=-E+S;var M=i/2,_=0>M?-Math.pow(-M,1/3):Math.pow(M,1/3),O=i===S?-_:-w/_;return a=0>=w?_+O:-E/(_*_+O*O+w),f*h>=l*d?[(a-s)/o]:[-c/(a+u)]}var T=m,C=-2*s*m+o*p,P=y,N=-c*p+2*u*y,R=Math.sqrt(v),I=Math.sqrt(3)/2,b=Math.abs(Math.atan2(o*R,-C)/3);a=2*Math.sqrt(-T);var z=Math.cos(b);i=a*z;var D=a*(-z/2-I*Math.sin(b)),A=i+D>2*s?i-s:D-s,U=o,q=A/U;b=Math.abs(Math.atan2(c*R,-N)/3),a=2*Math.sqrt(-P),z=Math.cos(b),i=a*z,D=a*(-z/2-I*Math.sin(b));var L=-c,W=2*u>i+D?i+u:D+u,B=L/W,F=U*W,G=-A*W-U*L,Y=A*L,H=(u*G-s*Y)/(-s*G+u*F);return H>=q?B>=q?B>=H?[q,H,B]:[q,B,H]:[B,q,H]:B>=q?[H,q,B]:B>=H?[H,B,q]:[B,H,q]}var r={};return r.discriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,s=r*r,u=18*e*t*n*r+i*o-27*a*s-4*(e*o*n+i*t*r);return u},r.realRoots=function(e,r,a,i){var o,s;if(0===e)return t.realRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];s=-i/e;var u=0>s?-Math.pow(-s,1/3):Math.pow(s,1/3);return[u,u,u]}return 0===i?(o=t.realRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(s=-r/e,0>s?[s,0,0]:[0,0,s]):n(e,r,0,i):0===i?(o=t.realRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var s=t*t,u=a-3*s/8,c=i-a*t/2+s*t/8,l=o-i*t/4+a*s/16-3*s*s/256,h=e.realRoots(1,2*u,u*u-4*l,-c*c);if(h.length>0){var f=-t/4,d=h[h.length-1];if(Math.abs(d)<n.EPSILON14){var m=r.realRoots(1,u,l);if(2===m.length){var p,y=m[0],v=m[1];if(y>=0&&v>=0){var g=Math.sqrt(y),w=Math.sqrt(v);return[f-w,f-g,f+g,f+w]}if(y>=0&&0>v)return p=Math.sqrt(y),[f-p,f+p];if(0>y&&v>=0)return p=Math.sqrt(v),[f-p,f+p]}return[]}if(d>0){var E=Math.sqrt(d),x=(u+d-c/E)/2,S=(u+d+c/E)/2,M=r.realRoots(1,E,x),_=r.realRoots(1,-E,S);return 0!==M.length?(M[0]+=f,M[1]+=f,0!==_.length?(_[0]+=f,_[1]+=f,M[1]<=_[0]?[M[0],M[1],_[0],_[1]]:_[1]<=M[0]?[_[0],_[1],M[0],M[1]]:M[0]>=_[0]&&M[1]<=_[1]?[_[0],M[0],M[1],_[1]]:_[0]>=M[0]&&_[1]<=M[1]?[M[0],_[0],_[1],M[1]]:M[0]>_[0]&&M[0]<_[1]?[_[0],M[0],_[1],M[1]]:[M[0],_[0],M[1],_[1]]):M):0!==_.length?(_[0]+=f,_[1]+=f,_):[]
  }}return[]}function i(t,a,i,o){var s=i*i,u=a*a,c=t*t,l=-2*a,h=i*t+u-4*o,f=c*o-i*a*t+s,d=e.realRoots(1,l,h,f);if(d.length>0){var m,p,y=d[0],v=a-y,g=v*v,w=t/2,E=v/2,x=g-4*o,S=g+4*Math.abs(o),M=c-4*y,_=c+4*Math.abs(y);if(0>y||M*S>x*_){var O=Math.sqrt(M);m=O/2,p=0===O?0:(t*E-i)/O}else{var T=Math.sqrt(x);m=0===T?0:(t*E-i)/T,p=T/2}var C,P;0===w&&0===m?(C=0,P=0):n.sign(w)===n.sign(m)?(C=w+m,P=y/C):(P=w-m,C=y/P);var N,R;0===E&&0===p?(N=0,R=0):n.sign(E)===n.sign(p)?(N=E+p,R=o/N):(R=E-p,N=o/R);var I=r.realRoots(1,C,N),b=r.realRoots(1,P,R);if(0!==I.length)return 0!==b.length?I[1]<=b[0]?[I[0],I[1],b[0],b[1]]:b[1]<=I[0]?[b[0],b[1],I[0],I[1]]:I[0]>=b[0]&&I[1]<=b[1]?[b[0],I[0],I[1],b[1]]:b[0]>=I[0]&&b[1]<=I[1]?[I[0],b[0],b[1],I[1]]:I[0]>b[0]&&I[0]<b[1]?[b[0],I[0],b[1],I[1]]:[I[0],b[0],I[1],b[1]]:I;if(0!==b.length)return b}return[]}var o={};return o.discriminant=function(e,t,n,r,a){var i=e*e,o=i*e,s=t*t,u=s*t,c=n*n,l=c*n,h=r*r,f=h*r,d=a*a,m=d*a,p=s*c*h-4*u*f-4*e*l*h+18*e*t*n*f-27*i*h*h+256*o*m+a*(18*u*n*r-4*s*l+16*e*c*c-80*e*t*c*r-6*e*s*h+144*i*n*h)+d*(144*e*s*n-27*s*s-128*i*c-192*i*t*r);return p},o.realRoots=function(t,r,o,s,u){if(Math.abs(t)<n.EPSILON15)return e.realRoots(r,o,s,u);var c=r/t,l=o/t,h=s/t,f=u/t,d=0>c?1:0;switch(d+=0>l?d+1:d,d+=0>h?d+1:d,d+=0>f?d+1:d){case 0:return a(c,l,h,f);case 1:return i(c,l,h,f);case 2:return i(c,l,h,f);case 3:return a(c,l,h,f);case 4:return a(c,l,h,f);case 5:return i(c,l,h,f);case 6:return a(c,l,h,f);case 7:return a(c,l,h,f);case 8:return i(c,l,h,f);case 9:return a(c,l,h,f);case 10:return a(c,l,h,f);case 11:return i(c,l,h,f);case 12:return a(c,l,h,f);case 13:return a(c,l,h,f);case 14:return a(c,l,h,f);case 15:return a(c,l,h,f);default:return void 0}},o}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial"],function(e,t,n,r,a,i,o,s){"use strict";function u(e,t,n){var r=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function c(t,n,r,c,l){var h,f=c*c,d=l*l,m=(t[i.COLUMN1ROW1]-t[i.COLUMN2ROW2])*d,p=l*(c*u(t[i.COLUMN1ROW0],t[i.COLUMN0ROW1],a.EPSILON15)+n.y),y=t[i.COLUMN0ROW0]*f+t[i.COLUMN2ROW2]*d+c*n.x+r,v=d*u(t[i.COLUMN2ROW1],t[i.COLUMN1ROW2],a.EPSILON15),g=l*(c*u(t[i.COLUMN2ROW0],t[i.COLUMN0ROW2])+n.z),w=[];if(0===g&&0===v){if(h=o.realRoots(m,p,y),0===h.length)return w;var E=h[0],x=Math.sqrt(Math.max(1-E*E,0));if(w.push(new e(c,l*E,l*-x)),w.push(new e(c,l*E,l*x)),2===h.length){var S=h[1],M=Math.sqrt(Math.max(1-S*S,0));w.push(new e(c,l*S,l*-M)),w.push(new e(c,l*S,l*M))}return w}var _=g*g,O=v*v,T=m*m,C=g*v,P=T+O,N=2*(p*m+C),R=2*y*m+p*p-O+_,I=2*(y*p-C),b=y*y-_;if(0===P&&0===N&&0===R&&0===I)return w;h=s.realRoots(P,N,R,I,b);var z=h.length;if(0===z)return w;for(var D=0;z>D;++D){var A,U=h[D],q=U*U,L=Math.max(1-q,0),W=Math.sqrt(L);A=a.sign(m)===a.sign(y)?u(m*q+y,p*U,a.EPSILON12):a.sign(y)===a.sign(p*U)?u(m*q,p*U+y,a.EPSILON12):u(m*q+p*U,y,a.EPSILON12);var B=u(v*U,g,a.EPSILON15),F=A*B;0>F?w.push(new e(c,l*U,l*W)):F>0?w.push(new e(c,l*U,l*-W)):0!==W?(w.push(new e(c,l*U,l*-W)),w.push(new e(c,l*U,l*W)),++D):w.push(new e(c,l*U,l*W))}return w}var l={};l.rayPlane=function(t,r,i){n(i)||(i=new e);var o=t.origin,s=t.direction,u=r.normal,c=e.dot(u,s);if(Math.abs(c)<a.EPSILON15)return void 0;var l=(-r.distance-e.dot(u,o))/c;return 0>l?void 0:(i=e.multiplyByScalar(s,l,i),e.add(o,i,i))};var h=new e,f=new e;l.rayEllipsoid=function(t,n){var r,a,i,o,s,u=n.oneOverRadii,c=e.multiplyComponents(u,t.origin,h),l=e.multiplyComponents(u,t.direction,f),d=e.magnitudeSquared(c),m=e.dot(c,l);if(d>1){if(m>=0)return void 0;var p=m*m;if(r=d-1,a=e.magnitudeSquared(l),i=a*r,i>p)return void 0;if(p>i){o=m*m-i,s=-m+Math.sqrt(o);var y=s/a,v=r/s;return v>y?{start:y,stop:v}:{start:v,stop:y}}var g=Math.sqrt(r/a);return{start:g,stop:g}}return 1>d?(r=d-1,a=e.magnitudeSquared(l),i=a*r,o=m*m-i,s=-m+Math.sqrt(o),{start:0,stop:s/a}):0>m?(a=e.magnitudeSquared(l),{start:0,stop:-m/a}):void 0};var d=new e,m=new e,p=new e,y=new e;l.grazingAltitudeLocation=function(r,o){var s=r.origin,u=r.direction,l=o.geodeticSurfaceNormal(s);if(e.dot(u,l)>=0)return s;var h,f,v=n(this.rayEllipsoid(r,o)),g=o.transformPositionToScaledSpace(u),w=e.normalize(g,d),E=e.mostOrthogonalAxis(g,y),x=e.normalize(e.cross(E,w,m),m),S=e.normalize(e.cross(w,x,p),p),M=new i(w.x,x.x,S.x,w.y,x.y,S.y,w.z,x.z,S.z),_=i.transpose(M),O=i.fromScale(o.radii),T=i.fromScale(o.oneOverRadii),C=new i(0,u.z,-u.y,-u.z,0,u.x,u.y,-u.x,0),P=i.multiply(i.multiply(_,T),C),N=i.multiply(i.multiply(P,O),M),R=i.multiplyByVector(P,s),I=c(N,e.negate(R,d),0,0,1),b=I.length;if(b>0){for(var z=e.ZERO,D=Number.NEGATIVE_INFINITY,A=0;b>A;++A){h=i.multiplyByVector(O,i.multiplyByVector(M,I[A]));var U=e.normalize(e.subtract(h,s,y),y),q=e.dot(U,u);q>D&&(D=q,z=h)}var L=o.cartesianToCartographic(z);return D=a.clamp(D,0,1),f=e.magnitude(e.subtract(z,s,y))*Math.sqrt(1-D*D),f=v?-f:f,o.cartographicToCartesian(new t(L.longitude,L.latitude,f))}return void 0};var v=new e;return l.lineSegmentPlane=function(t,r,i,o){n(o)||(o=new e);var s=e.subtract(r,t,v),u=i.normal,c=e.dot(u,s);if(Math.abs(c)<a.EPSILON6)return void 0;var l=e.dot(u,t),h=-(i.distance+l)/c;return 0>h||h>1?void 0:(e.multiplyByScalar(s,h,o),e.add(t,o,o),o)},l.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,s=e.dot(i,t)+o<0,u=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,h=0;h+=s?1:0,h+=u?1:0,h+=c?1:0;var f,d;if((1===h||2===h)&&(f=new e,d=new e),1===h){if(s)return l.lineSegmentPlane(t,n,a,f),l.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(u)return l.lineSegmentPlane(n,r,a,f),l.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return l.lineSegmentPlane(r,t,a,f),l.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===h){if(!s)return l.lineSegmentPlane(n,t,a,f),l.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!u)return l.lineSegmentPlane(r,n,a,f),l.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return l.lineSegmentPlane(t,r,a,f),l.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}return void 0},l}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError"],function(e,t){"use strict";var n=function(t,n){this.normal=e.clone(t),this.distance=n};return n.fromPointNormal=function(r,a,i){var o=-e.dot(a,r);return t(i)?(e.clone(a,i.normal),i.distance=o,i):new n(a,o)},n.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},n}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=function(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r};return r.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},r}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:s(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(r){return i(r)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(a){return i(a)}});return n}function o(){function e(e,t,n){return f(e,t,n)}function n(e){return m(e)}function a(e){return m(i(e))}function s(e){return d(e)}var u,c,l,h,f,d,m;return c=new r(e),u={then:e,resolve:n,reject:a,progress:s,promise:c,resolver:{resolve:n,reject:a,progress:s}},l=[],h=[],f=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(t){r.progress(t)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),h.push(a),r.promise},d=function(e){return p(h,e),e},m=function(e){return e=t(e),f=e.then,m=t,d=v,p(l,e),h=l=x,e},u}function s(e){return e&&"function"==typeof e.then}function u(t,n,r,a,i){return y(2,arguments),e(t,function(t){function s(e){p(e)}function u(e){m(e)}var c,l,h,f,d,m,p,y,g,w;if(g=t.length>>>0,c=Math.max(0,Math.min(n,g)),h=[],l=g-c+1,f=[],d=o(),c)for(y=d.progress,p=function(e){f.push(e),--l||(m=p=v,d.reject(f))},m=function(e){h.push(e),--c||(m=p=v,d.resolve(h))},w=0;g>w;++w)w in t&&e(t[w],u,s,y);else d.resolve(h);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return u(e,1,a,n,r)}function l(e,t,n,r){return y(1,arguments),f(e,g).then(t,n,r)}function h(){return f(arguments,g)}function f(t,n){return e(t,function(t){var r,a,i,s,u,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(s=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},u=0;a>u;u++)u in t?s(t[u],u):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=E.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},w.apply(t,r)})}function m(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function p(e,t){for(var n,r=0;n=e[r++];)n(t)}function y(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function v(){}function g(e){return e}var w,E,x;return e.defer=o,e.resolve=t,e.reject=n,e.join=h,e.all=l,e.map=f,e.reduce=d,e.any=c,e.some=u,e.chain=m,e.isPromise=s,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(x,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(x,t)})})}},E=[].slice,w=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;a>i;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(){"use strict";var e=function(e,t,n){for(var r,a,i=0,o=e.length-1;o>=i;)if(r=~~((i+o)/2),a=n(e[r],t),0>a)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)};return e}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";var e=function(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a};return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var s=r-e.length;return s>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",s,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,s,u){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),s||0,"0",!1),i(e,n,r,o,u)},s=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},u=function(e,r,u,c,l,h,f){var d,m,p,y,v;if("%%"==e)return"%";for(var g=!1,w="",E=!1,x=!1,S=" ",M=u.length,_=0;u&&M>_;_++)switch(u.charAt(_)){case" ":w=" ";break;case"+":w="+";break;case"-":g=!0;break;case"'":S=u.charAt(_+1);break;case"0":E=!0;break;case"#":x=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,0>c&&(c=-c,g=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[n++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(f)>-1?6:"d"==f?0:void 0,v=r?t[r.slice(0,-1)]:t[n++],f){case"s":return s(String(v),g,c,h,E,S);case"c":return s(String.fromCharCode(+v),g,c,h,E);case"b":return o(v,2,x,g,c,h,E);case"o":return o(v,8,x,g,c,h,E);case"x":return o(v,16,x,g,c,h,E);case"X":return o(v,16,x,g,c,h,E).toUpperCase();case"u":return o(v,10,x,g,c,h,E);case"i":case"d":return d=+v||0,d=Math.round(d-d%1),m=0>d?"-":w,v=m+a(String(Math.abs(d)),h,"0",!1),i(v,m,g,c,E);case"e":case"E":case"f":case"F":case"g":case"G":return d=+v,m=0>d?"-":w,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2],v=m+Math.abs(d)[p](h),i(v,m,g,c,E)[y]();default:return e}};return r.replace(e,u)}return e}),define("Core/GregorianDate",[],function(){"use strict";var e=function(e,t,n,r,a,i,o,s){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=s};return e}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/isLeapYear",["./DeveloperError"],function(){"use strict";function e(e){return 0===e%4&&0!==e%100||0===e%400}return e}),define("Core/LeapSecond",[],function(){"use strict";var e=function(e,t){this.julianDate=e,this.offset=t};return e}),define("Core/TimeConstants",[],function(){"use strict";var e={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e}),define("Core/TimeStandard",[],function(){"use strict";var e={UTC:0,TAI:1};return e}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./GregorianDate","./isArray","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,s,u,c,l,h){"use strict";function f(e,t){return I.compare(e.julianDate,t.julianDate)}function d(e){E.julianDate=e;var n=I.leapSeconds,r=t(n,E,f);0>r&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=I.getSecondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}I.addSeconds(e,a,e)}function m(e,n){E.julianDate=e;var r=I.leapSeconds,a=t(r,E,f);if(0>a&&(a=~a),0===a)return I.addSeconds(e,-r[0].offset,n);if(a>=r.length)return I.addSeconds(e,-r[a-1].offset,n);var i=I.getSecondsDifference(r[a].julianDate,e);return 0===i?I.addSeconds(e,-r[a].offset,n):1>=i?void 0:I.addSeconds(e,-r[--a].offset,n)}function p(e,t,n){var r=0|t/l.SECONDS_PER_DAY;return e+=r,t-=l.SECONDS_PER_DAY*r,0>t&&(e--,t+=l.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function y(e,t,n,r,a,i,o){var s=0|(t-14)/12,u=e+4800+s,c=(0|1461*u/4)+(0|367*(t-2-12*s)/12)-(0|3*((u+100)/100)/4)+n-32075;r-=12,0>r&&(r+=24);var h=i+(r*l.SECONDS_PER_HOUR+a*l.SECONDS_PER_MINUTE+o*l.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}var v=new o,g=[31,28,31,30,31,30,31,31,30,31,30,31],w=29,E=new c,x=/^(\d{4})$/,S=/^(\d{4})-(\d{2})$/,M=/^(\d{4})-?(\d{3})$/,_=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,O=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,C=/^(\d{2})(\.\d+)?/.source+T.source,P=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,N=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,R="Invalid ISO 8601 date.",I=function(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,h.UTC);var a=0|e;t+=(e-a)*l.SECONDS_PER_DAY,p(a,t,this),r===h.UTC&&d(this)};I.fromDate=function(e,t){var n=y(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(p(n[0],n[1],t),d(t),t):new I(n[0],n[1],h.UTC)},I.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,o,s=e.split("T"),c=1,l=1,f=0,m=0,v=0,E=0,T=s[0],b=s[1];if(!r(T))throw new i(R);var z;if(s=T.match(O),null!==s){if(z=T.split("-").length-1,z>0&&2!==z)throw new i(R);n=+s[1],c=+s[2],l=+s[3]}else if(s=T.match(S),null!==s)n=+s[1],c=+s[2];else if(s=T.match(x),null!==s)n=+s[1];else{var D;if(s=T.match(M),null!==s){if(n=+s[1],D=+s[2],o=u(n),1>D||o&&D>366||!o&&D>365)throw new i(R)}else{if(s=T.match(_),null===s)throw new i(R);n=+s[1];var A=+s[2],U=+s[3]||0;if(z=T.split("-").length-1,z>0&&(!r(s[3])&&1!==z||r(s[3])&&2!==z))throw new i(R);var q=new Date(Date.UTC(n,0,4));D=7*A+U-q.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(D),c=a.getUTCMonth()+1,l=a.getUTCDate()}if(o=u(n),1>c||c>12||1>l||(2!==c||!o)&&l>g[c-1]||o&&2===c&&l>w)throw new i(R);var L;if(r(b)){if(s=b.match(N),null!==s){if(z=b.split(":").length-1,z>0&&2!==z&&3!==z)throw new i(R);f=+s[1],m=+s[2],v=+s[3],E=1e3*+(s[4]||0),L=5}else if(s=b.match(P),null!==s){if(z=b.split(":").length-1,z>0&&1!==z)throw new i(R);f=+s[1],m=+s[2],v=60*+(s[3]||0),L=4}else{if(s=b.match(C),null===s)throw new i(R);f=+s[1],m=60*+(s[2]||0),L=3}if(m>=60||v>=61||f>24||24===f&&(m>0||v>0||E>0))throw new i(R);var W=s[L],B=+s[L+1],F=+(s[L+2]||0);switch(W){case"+":f-=B,m-=F;break;case"-":f+=B,m+=F;break;case"Z":break;default:m+=new Date(Date.UTC(n,c-1,l,f,m)).getTimezoneOffset()}}else m+=new Date(Date.UTC(n,c-1,l)).getTimezoneOffset();var G=60===v;for(G&&v--;m>=60;)m-=60,f++;for(;f>=24;)f-=24,l++;for(a=o&&2===c?w:g[c-1];l>a;)l-=a,c++,c>12&&(c-=12,n++),a=o&&2===c?w:g[c-1];for(;0>m;)m+=60,f--;for(;0>f;)f+=24,l--;for(;1>l;)c--,1>c&&(c+=12,n--),a=o&&2===c?w:g[c-1],l+=a;var Y=y(n,c,l,f,m,v,E);return r(t)?(p(Y[0],Y[1],t),d(t)):t=new I(Y[0],Y[1],h.UTC),G&&I.addSeconds(t,1,t),t},I.now=function(e){return I.fromDate(new Date,e)};var b=new I(0,0,h.TAI);return I.toGregorianDate=function(e,t){var n=!1,a=m(e,b);r(a)||(I.addSeconds(e,-1,b),a=m(b,b),n=!0);var i=a.dayNumber,s=a.secondsOfDay;s>=43200&&(i+=1);var u=0|i+68569,c=0|4*u/146097;u=0|u-(0|(146097*c+3)/4);var h=0|4e3*(u+1)/1461001;u=0|u-(0|1461*h/4)+31;var f=0|80*u/2447,d=0|u-(0|2447*f/80);u=0|f/11;var p=0|f+2-12*u,y=0|100*(c-49)+h+u,v=0|s/l.SECONDS_PER_HOUR,g=s-v*l.SECONDS_PER_HOUR,w=0|g/l.SECONDS_PER_MINUTE;g-=w*l.SECONDS_PER_MINUTE;var E=0|g,x=(g-E)/l.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),n&&(E+=1),r(t)?(t.year=y,t.month=p,t.day=d,t.hour=v,t.minute=w,t.second=E,t.millisecond=x,t.isLeapSecond=n,t):new o(y,p,d,v,w,E,x,n)},I.toDate=function(e){var t=I.toGregorianDate(e,v),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},I.toIso8601=function(t,n){var a,i=I.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},I.clone=function(e,t){return r(e)?r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new I(e.dayNumber,e.secondsOfDay,h.TAI):void 0},I.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},I.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},I.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(I.getSecondsDifference(e,t))<=n},I.getTotalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},I.getSecondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},I.getDaysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return n+r},I.getTaiMinusUtc=function(e){E.julianDate=e;var n=I.leapSeconds,r=t(n,E,f);return 0>r&&(r=~r,--r,0>r&&(r=0)),n[r].offset},I.addSeconds=function(e,t,n){return p(e.dayNumber,e.secondsOfDay+t,n)},I.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,r,n)},I.addHours=function(e,t,n){var r=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,r,n)},I.addDays=function(e,t,n){var r=e.dayNumber+t;return p(r,e.secondsOfDay,n)},I.lessThan=function(e,t){return I.compare(e,t)<0},I.lessThanOrEquals=function(e,t){return I.compare(e,t)<=0},I.greaterThan=function(e,t){return I.compare(e,t)>0},I.greaterThanOrEquals=function(e,t){return I.compare(e,t)>=0},I.prototype.clone=function(e){return I.clone(this,e)},I.prototype.equals=function(e){return I.equals(this,e)},I.prototype.equalsEpsilon=function(e,t){return I.equalsEpsilon(this,e,t)},I.leapSeconds=[new c(new I(2441317,43210,h.TAI),10),new c(new I(2441499,43211,h.TAI),11),new c(new I(2441683,43212,h.TAI),12),new c(new I(2442048,43213,h.TAI),13),new c(new I(2442413,43214,h.TAI),14),new c(new I(2442778,43215,h.TAI),15),new c(new I(2443144,43216,h.TAI),16),new c(new I(2443509,43217,h.TAI),17),new c(new I(2443874,43218,h.TAI),18),new c(new I(2444239,43219,h.TAI),19),new c(new I(2444786,43220,h.TAI),20),new c(new I(2445151,43221,h.TAI),21),new c(new I(2445516,43222,h.TAI),22),new c(new I(2446247,43223,h.TAI),23),new c(new I(2447161,43224,h.TAI),24),new c(new I(2447892,43225,h.TAI),25),new c(new I(2448257,43226,h.TAI),26),new c(new I(2448804,43227,h.TAI),27),new c(new I(2449169,43228,h.TAI),28),new c(new I(2449534,43229,h.TAI),29),new c(new I(2450083,43230,h.TAI),30),new c(new I(2450630,43231,h.TAI),31),new c(new I(2451179,43232,h.TAI),32),new c(new I(2453736,43233,h.TAI),33),new c(new I(2454832,43234,h.TAI),34),new c(new I(2456109,43235,h.TAI),35)],I}),define("Core/clone",["./defaultValue"],function(e){"use strict";var t=function(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a};return t}),define("Core/parseResponseHeaders",[],function(){"use strict";var e=function(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),s=a.substring(i+2);t[o]=s}}return t};return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";var n=function(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))};return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent"],function(e,t,n,r,a){"use strict";function i(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function o(e,t){for(var n=i(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),o=0;o<n.length;o++)a[o]=n.charCodeAt(o);return r}function s(e,n){n=t(n,"");var a=e[1],s=!!e[2],u=e[3];switch(n){case"":case"text":return i(s,u);case"arraybuffer":return o(s,u);case"blob":var c=o(s,u);return new Blob([c],{type:a});case"document":var l=new DOMParser;return l.parseFromString(i(s,u),a);case"json":return JSON.parse(i(s,u));default:throw new r("Unhandled responseType: "+n)}}var u=function(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})},c=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,i,o,u,l){var h=c.exec(e);if(null!==h)return u.resolve(s(h,t)),void 0;var f=new XMLHttpRequest;if(n(l)&&f.overrideMimeType(l),f.open(r,e,!0),n(o))for(var d in o)o.hasOwnProperty(d)&&f.setRequestHeader(d,o[d]);n(t)&&(f.responseType=t),f.onload=function(){200===f.status?u.resolve(f.response):u.reject(new a(f.status,f.response,f.getAllResponseHeaders()))},f.onerror=function(){u.reject(new a)},f.send(i)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";var t=function(t,n){return e({url:t,headers:n})};return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";var a={Accept:"application/json,*/*;q=0.01"},i=function(n,i){return t(i)?t(i.Accept)||(i=e(i),i.Accept=a.Accept):i=a,r(n,i).then(function(e){return JSON.parse(e)})};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,s,u,c,l,h){"use strict";function f(e,t){return o.compare(e.julianDate,t)}function d(e,n){if(!r(n.columnNames))return e._dataError="Error in loaded EOP data: The columnNames property is required.",void 0;if(!r(n.samples))return e._dataError="Error in loaded EOP data: The samples property is required.",void 0;var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),u=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("taiMinusUtcSeconds");if(0>a||0>i||0>u||0>c||0>d||0>m||0>p)return e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns",void 0;var y=e._samples=n.samples,v=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=u,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=p,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var g,w=e._addNewLeapSeconds,E=0,x=y.length;x>E;E+=e._columnCount){var S=y[E+a],M=y[E+p],_=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(_,M,h.TAI);if(v.push(O),w){if(M!==g&&r(g)){var T=o.leapSeconds,C=t(T,O,f);if(0>C){var P=new s(O,M);T.splice(~C,0,P)}}g=M}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,s){var u=e._columnCount;if(i>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,u,s),s;if(r.equals(l))return m(e,n,i,u,s),s;var h=o.getSecondsDifference(r,c)/o.getSecondsDifference(l,c),f=a*u,d=i*u,y=n[f+e._ut1MinusUtcSecondsColumn],v=n[d+e._ut1MinusUtcSecondsColumn],g=v-y;if(g>.5||-.5>g){var w=n[f+e._taiMinusUtcSecondsColumn],E=n[d+e._taiMinusUtcSecondsColumn];w!==E&&(l.equals(r)?y=v:v-=E-w)}return s.xPoleWander=p(h,n[f+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),s.yPoleWander=p(h,n[f+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),s.xPoleOffset=p(h,n[f+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=p(h,n[f+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=p(h,y,v),s}var v=function(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))d(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(u(t.url),function(e){d(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else d(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})};return v.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),v.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},v.prototype.compute=function(e,n){if(!r(this._samples)){if(r(this._dataError))throw new c(this._dataError);return void 0}if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,s=this._lastIndex,u=0,l=0;if(r(s)){var h=i[s],f=i[s+1],d=o.lessThanOrEquals(h,e),m=!r(f),p=m||o.greaterThanOrEquals(f,e);if(d&&p)return u=s,!m&&f.equals(e)&&++u,l=u+1,y(this,i,this._samples,e,u,l,n),n}var v=t(i,e,o.compare,this._dateColumn);return v>=0?(v<i.length-1&&i[v+1].equals(e)&&++v,u=v,l=v):(l=~v,u=l-1,0>u&&(u=0)),this._lastIndex=u,y(this,i,this._samples,e,u,l,n),n},v}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(n.path=t.authority&&""==t.path?"/"+this.path:t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];for(r&&t.shift(),""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);("."==e||".."==e)&&n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","require"],function(e,t,n,r){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;n>t;++t){var r=e[t].getAttribute("src"),a=h.exec(r);if(null!==a)return a[1]}return void 0}function i(){if(t(u))return u;var r;if(r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),!t(r))throw new n("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");
  return u=new e(r).resolve(new e(document.location.href))}function o(e){return r.toUrl("../"+e)}function s(t){return new e(t).resolve(i()).toString()}var u,c,l,h=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,f=function(e){t(c)||(c=t(r.toUrl)?o:s),t(l)||(l=document.createElement("a"));var n=c(e);return l.href=n,l.href=l.href,l.href};return f._cesiumScriptRegex=h,f}),define("Core/Iau2006XysSample",[],function(){"use strict";var e=function(e,t,n){this.x=e,this.y=t,this.s=n};return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,s){"use strict";function u(e,t,n){var r=h;return r.dayNumber=t,r.secondsOfDay=n,i.getDaysDifference(r,e._sampleZeroDateTT)}function c(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var s,u=n._xysFileUrlTemplate;return s=r(u)?u.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(s),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=3*a*n._samplesPerXysFile,s=0,u=r.length;u>s;++s)t[o+s]=r[s];i.resolve()}),i.promise}var l=function(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,s.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),u=0;t>=u;++u){r[u]=o,a[u]=u*this._stepSizeDays;for(var c=0;t>=c;++c)c!==u&&(r[u]*=u-c);r[u]=1/r[u]}this._work=new Array(t+1),this._coef=new Array(t+1)},h=new i(0,0,s.TAI);return l.prototype.preload=function(t,n,r,a){var i=u(this,t,n),o=u(this,r,a),s=0|i/this._stepSizeDays-this._interpolationOrder/2;0>s&&(s=0);var l=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var h=0|s/this._samplesPerXysFile,f=0|l/this._samplesPerXysFile,d=[],m=h;f>=m;++m)d.push(c(this,m));return e.all(d)},l.prototype.computeXysRadians=function(e,t,n){var i=u(this,e,t);if(0>i)return void 0;var o=0|i/this._stepSizeDays;if(o>=this._totalSamples)return void 0;var s=this._interpolationOrder,l=o-(0|s/2);0>l&&(l=0);var h=l+s;h>=this._totalSamples&&(h=this._totalSamples-1,l=h-s,0>l&&(l=0));var f=!1,d=this._samples;if(r(d[3*l])||(c(this,0|l/this._samplesPerXysFile),f=!0),r(d[3*h])||(c(this,0|h/this._samplesPerXysFile),f=!0),f)return void 0;r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var m,p,y=i-l*this._stepSizeDays,v=this._work,g=this._denominators,w=this._coef,E=this._xTable;for(m=0;s>=m;++m)v[m]=y-E[m];for(m=0;s>=m;++m){for(w[m]=1,p=0;s>=p;++p)p!==m&&(w[m]*=v[p]);w[m]*=g[m];var x=3*(l+m);n.x+=w[m]*d[x++],n.y+=w[m]*d[x++],n.s+=w[m]*d[x]}return n},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./TimeConstants"],function(e,t,n,r,a,i,o,s,u,c,l,h,f,d,m,p,y){"use strict";var v={},g=new n,w=new n,E=new n;v.eastNorthUpToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-o,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(0,-o,0,e.x,1,0,0,e.y,0,0,o,e.z,0,0,0,1)}var s=g,u=w,l=E;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,s),u.x=-e.y,u.y=e.x,u.z=0,n.normalize(u,u),n.cross(s,u,l),i(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=l.x,r[5]=l.y,r[6]=l.z,r[7]=0,r[8]=s.x,r[9]=s.y,r[10]=s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(u.x,l.x,s.x,e.x,u.y,l.y,s.y,e.y,u.z,l.z,s.z,e.z,0,0,0,1)};var x=new n,S=new n,M=new n;v.northEastDownToFixedFrame=function(e,t,r){if(d.equalsEpsilon(e.x,0,d.EPSILON14)&&d.equalsEpsilon(e.y,0,d.EPSILON14)){var o=d.sign(e.z);return i(r)?(r[0]=-o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-o,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(-o,0,0,e.x,0,1,0,e.y,0,0,-o,e.z,0,0,0,1)}var s=x,u=S,l=M;return t=a(t,c.WGS84),t.geodeticSurfaceNormal(e,s),u.x=-e.y,u.y=e.x,u.z=0,n.normalize(u,u),n.cross(s,u,l),i(r)?(r[0]=l.x,r[1]=l.y,r[2]=l.z,r[3]=0,r[4]=u.x,r[5]=u.y,r[6]=u.z,r[7]=0,r[8]=-s.x,r[9]=-s.y,r[10]=-s.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new p(l.x,u.x,-s.x,e.x,l.y,u.y,-s.y,e.y,l.z,u.z,-s.z,e.z,0,0,0,1)};var _=24110.54841,O=8640184.812866,T=.093104,C=-62e-7,P=1.1772758384668e-19,N=72921158553e-15,R=d.TWO_PI/86400,I=new f;v.computeTemeToPseudoFixedMatrix=function(e,t){I=f.addSeconds(e,-f.getTaiMinusUtc(e),I);var n,r=I.dayNumber,a=I.secondsOfDay,o=r-2451545;n=a>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var s=_+n*(O+n*(T+n*C)),u=s*R%d.TWO_PI,c=N+P*(r-2451545.5),l=(a+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,h=u+c*l,p=Math.cos(h),v=Math.sin(h);return i(t)?(t[0]=p,t[1]=-v,t[2]=0,t[3]=v,t[4]=p,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(p,v,0,-v,p,0,0,0,1)},v.iau2006XysData=new l,v.earthOrientationParameters=s.NONE;var b=32.184,z=2451545;v.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+b,a=t.stop.dayNumber,i=t.stop.secondsOfDay+b,o=v.iau2006XysData.preload(n,r,a,i),s=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,s])},v.computeIcrfToFixedMatrix=function(e,t){var n=v.computeFixedToIcrfMatrix(e,t);return i(n)?m.transpose(n,t):void 0};var D=new h(0,0,0),A=new u(0,0,0,0,0,0),U=new m,q=new m;v.computeFixedToIcrfMatrix=function(e,t){var n=v.earthOrientationParameters.compute(e,A);if(!i(n))return void 0;var r=e.dayNumber,a=e.secondsOfDay+b,o=v.iau2006XysData.computeXysRadians(r,a,D);if(!i(o))return void 0;var s=o.x+n.xPoleOffset,u=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-u*u)),l=U;l[0]=1-c*s*s,l[3]=-c*s*u,l[6]=s,l[1]=-c*s*u,l[4]=1-c*u*u,l[7]=u,l[2]=-s,l[5]=-u,l[8]=1-c*(s*s+u*u);var h=m.fromRotationZ(-o.s,q),p=m.multiply(l,h,U),g=e.dayNumber,w=e.secondsOfDay-f.getTaiMinusUtc(e)+n.ut1MinusUtc,E=g-2451545,x=w/y.SECONDS_PER_DAY,S=.779057273264+x+.00273781191135448*(E+x);S=S%1*d.TWO_PI;var M=m.fromRotationZ(S,q),_=m.multiply(p,M,U),O=Math.cos(n.xPoleWander),T=Math.cos(n.yPoleWander),C=Math.sin(n.xPoleWander),P=Math.sin(n.yPoleWander),N=r-z+a/y.SECONDS_PER_DAY;N/=36525;var R=-47e-6*N*d.RADIANS_PER_DEGREE/3600,I=Math.cos(R),L=Math.sin(R),W=q;return W[0]=O*I,W[1]=O*L,W[2]=C,W[3]=-T*L+P*C*I,W[4]=T*I+P*C*L,W[5]=-P*O,W[6]=-P*L-T*C*I,W[7]=P*I-T*C*L,W[8]=T*O,m.multiply(_,W,t)};var L=new r;return v.pointToWindowCoordinates=function(e,t,n,r){return r=v.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},v.pointToGLWindowCoordinates=function(e,n,a,o){i(o)||(o=new t);var s=L;return p.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,s),s),r.multiplyByScalar(s,1/s.w,s),p.multiplyByVector(n,s,s),t.fromCartesian4(s,o)},v}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,s,u,c,l,h,f){"use strict";var d=function(e,t){t=r(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var a=f.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(c.getColumn(a,0)),this._yAxis=n.fromCartesian4(c.getColumn(a,1));var i=n.fromCartesian4(c.getColumn(a,2));this._plane=l.fromPointNormal(e,i)};i(d.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}}});var m=new e;d.fromPoints=function(t,n){var r=e.fromPoints(t,m);return new d(r.center,n)};var p=new h,y=new n;d.prototype.projectPointOntoPlane=function(e,r){var i=p;i.origin=e,n.normalize(e,i.direction);var o=u.rayPlane(i,this._plane,y);if(a(o)||(n.negate(i.direction,i.direction),o=u.rayPlane(i,this._plane,y)),a(o)){var s=n.subtract(o,this._origin,o),c=n.dot(this._xAxis,s),l=n.dot(this._yAxis,s);return a(r)?(r.x=c,r.y=l,r):new t(c,l)}return void 0},d.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var n=0,r=e.length,i=0;r>i;i++){var o=this.projectPointOntoPlane(e[i],t[n]);a(o)&&(t[n]=o,n++)}return t.length=n,t};var v=new n;return d.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;a(t)?t.length=r:t=new Array(r);for(var i=this._ellipsoid,o=this._origin,s=this._xAxis,u=this._yAxis,c=v,l=0;r>l;++l){var h=e[l];n.multiplyByScalar(s,h.x,c),a(t[l])||(t[l]=new n);var f=n.add(o,c,t[l]);n.multiplyByScalar(u,h.y,c),n.add(f,c,f),i.scaleToGeocentricSurface(f,f)}return t},d}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";var r=new t,a=new t,i=new t,o=function(o,s,u,c,l){n(l)||(l=new t);var h,f,d,m,p,y,v,g;n(s.z)?(h=t.subtract(u,s,r),f=t.subtract(c,s,a),d=t.subtract(o,s,i),m=t.dot(h,h),p=t.dot(h,f),y=t.dot(h,d),v=t.dot(f,f),g=t.dot(f,d)):(h=e.subtract(u,s,r),f=e.subtract(c,s,a),d=e.subtract(o,s,i),m=e.dot(h,h),p=e.dot(h,f),y=e.dot(h,d),v=e.dot(f,f),g=e.dot(f,d));var w=1/(m*v-p*p);return l.y=(v*y-p*g)*w,l.z=(m*g-p*y)*w,l.x=1-l.y-l.z,l};return o}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";var n=new t,r=function(t,r,a,i){return e(t,r,a,i,n),n.x>0&&n.y>0&&n.z>0};return r}),define("Core/Queue",[],function(){"use strict";var e=function(){this._array=[],this._offset=0,this.length=0};return e.prototype.enqueue=function(e){this._array.push(e),this.length++},e.prototype.dequeue=function(){if(0===this.length)return void 0;var e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this.length--,n},e.prototype.contains=function(e){return-1!==this._array.indexOf(e)},e.prototype.clear=function(){this._array.length=this._offset=this.length=0},e.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},e}),define("Core/WindingOrder",[],function(){"use strict";var e={CLOCKWISE:2304,COUNTER_CLOCKWISE:2305,validate:function(t){return t===e.CLOCKWISE||t===e.COUNTER_CLOCKWISE}};return e}),define("Core/PolygonPipeline",["./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./Math","./pointInsideTriangle","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,s,u,c,l,h,f,d,m){"use strict";function p(t,n,r){var a=e.subtract(n,t,L),i=e.subtract(r,n,W);return a.x*i.y-a.y*i.x>=0}function y(e){for(var t=e[0].x,n=0,r=0;r<e.length;r++)e[r].x>t&&(t=e[r].x,n=r);return n}function v(e){for(var t=e[0][0].x,n=0,r=0;r<e.length;r++){var a=e[r][y(e[r])].x;a>t&&(t=a,n=r)}return n}function g(e){for(var t=[],n=0;n<e.length;n++){var r=e[(n-1+e.length)%e.length],a=e[n],i=e[(n+1)%e.length];p(r,a,i)||t.push(a)}return t}function w(t,n){for(var r=0;r<t.length;r++)if(e.equals(n,t[r]))return r;return-1}function E(n,a,i){i=r(i,[]);var o=Number.MAX_VALUE,s=y(a),u=new e(a[s].x,n.y);i.push(s),i.push((s+1)%a.length);for(var c=a[0].x,l=c,h=1;h<a.length;++h)a[h].x<c?c=a[h].x:a[h].x>l&&(l=a[h].x);l+=l-c;var f=new t(l,n.y,0);for(h=0;h<a.length;h++){var d=a[h],m=a[(h+1)%a.length];if((d.x>=n.x||m.x>=n.x)&&(d.y>=n.y&&m.y<=n.y||d.y<=n.y&&m.y>=n.y)){var p=(m.y-d.y)*(f.x-n.x)-(m.x-d.x)*(f.y-n.y);if(0!==p){p=1/p;var v=((m.x-d.x)*(n.y-d.y)-(m.y-d.y)*(n.x-d.x))*p,g=((f.x-n.x)*(n.y-d.y)-(f.y-n.y)*(n.x-d.x))*p;if(v>=0&&1>=v&&g>=0&&1>=g){var w=new e(n.x+v*(f.x-n.x),n.y+v*(f.y-n.y)),E=e.subtract(w,n,B);p=e.magnitudeSquared(E),o>p&&(u=w,o=p,i[0]=h,i[1]=(h+1)%a.length)}}}}return u}function x(t,n){var r=v(n),a=n[r],i=y(a),o=a[i],s=[],u=E(o,t,s),c=w(t,u);if(-1!==c)return c;var f=e.magnitudeSquared(e.subtract(t[s[0]],o,F)),d=e.magnitudeSquared(e.subtract(t[s[1]],o,F)),m=d>f?t[s[0]]:t[s[1]],p=g(t),x=p.indexOf(m);-1!==x&&p.splice(x,1);for(var S=[],M=0;M<p.length;M++){var _=p[M];h(_,o,u,m)&&S.push(_)}var O=Number.MAX_VALUE;if(S.length>0){var T=e.fromElements(1,0,F);for(M=0;M<S.length;M++){var C=e.subtract(S[M],o,G),P=e.magnitude(T)*e.magnitudeSquared(C);if(0!==P){var N=Math.abs(l.acosClamped(e.dot(T,C)/P));O>N&&(O=N,m=S[M])}}}return t.indexOf(m)}function S(e,n,r){for(var a=st.computeWindingOrder2D(e),i=0;i<n.length;i++){var o=n[i];t.equals(o[0],o[o.length-1])||o.push(o[0]);var u=st.computeWindingOrder2D(o);u===a&&o.reverse()}var c=s.fromPoints(e,r),l=c.projectPointsOntoPlane(e),h=[];for(i=0;i<n.length;i++)h.push(c.projectPointsOntoPlane(n[i]));var f=x(l,h),d=v(h),m=y(h[d]),p=n[d],g=[];for(i=0;i<e.length;i++)g.push(e[i]);var w,E=[];if(0!==m)for(w=0;w<=p.length;w++){var S=(w+m)%p.length;0!==S&&E.push(p[S])}else for(w=0;w<p.length;w++)E.push(p[(w+m)%p.length]);var M=g.lastIndexOf(e[f]);E.push(e[M]);var _=g.slice(0,M+1),O=g.slice(M+1);return g=_.concat(E,O),n.splice(d,1),g}function M(e){var t="0."+Math.sin(Y).toString().substr(5);Y+=.2;var n=Math.floor(t*e);return n===e&&n--,n}function _(t,n,r){return O(t,n,r)&&O(n,t,r)&&!D(r[t].position,r[n].position,r)&&!e.equals(r[t].position,r[n].position)}function O(t,n,r){P(t,r);var a=r[t],i=r[n],o=C(t,r,H),s=C(t,r,V),u=e.subtract(r[o].position,a.position,j),c=e.subtract(r[s].position,a.position,k),l=e.subtract(i.position,a.position,X);return N(u,l)?T(u,l):N(c,l)?T(c,l):R(u,c)?z(u,c,l)?!0:!1:I(u,c)?b(u,c,l)?!1:!0:void 0}function T(t,n){return e.magnitude(n)<e.magnitude(t)}function C(e,t,n){var r=e+n;return 0>r&&(r=t.length-1),r===t.length&&(r=0),P(r,t),r}function P(t,n){var r=t-1,a=t+1;0>r&&(r=n.length-1),a===n.length&&(a=0);var o=e.subtract(n[r].position,n[t].position,Z),s=e.subtract(n[a].position,n[t].position,J);if(N(o,s)){var u=new i("Superfluous vertex found.");throw u.vertexIndex=t,u}}function N(e,n){return 0===t.cross(e,n,K).z}function R(e,n){return t.cross(e,n,$).z<0}function I(e,n){return t.cross(e,n,Q).z>0}function b(e,n,r){return t.cross(e,r,et).z>0&&t.cross(r,n,et).z>0}function z(e,n,r){return t.cross(e,r,tt).z<0&&t.cross(r,n,tt).z<0}function D(t,n,r){for(var a=0;a<r.length;a++){var i,o=r[a].position;if(i=a<r.length-1?r[a+1].position:r[0].position,!(e.equals(t,o)||e.equals(n,i)||e.equals(t,i)||e.equals(n,o))){var s=(n.y-t.y)/(n.x-t.x),u=(i.y-o.y)/(i.x-o.x);if(!(s===u||isNaN(s)&&isNaN(u))){var c;c=isNaN(s)?t.x:isNaN(u)?o.x:(t.y-o.y-s*t.x+u*o.x)/(u-s);var l=s*c+t.y-s*t.x,h=e.fromElements(c,l,nt);if(!(e.equals(h,t)||e.equals(h,n)||e.equals(h,o)||e.equals(h,i))){var f=U(c,t.x,n.x)&&U(l,t.y,n.y)&&U(c,o.x,i.x)&&U(l,o.y,i.y);if(f)return!0}}}}return!1}function A(t){var n=t[0].position,r=t[1].position,a=t[2].position,i=e.subtract(r,n,rt),o=e.subtract(a,n,at);return N(i,o)}function U(e,t,n){return(e>t||e>n)&&(t>e||n>e)||t===n&&t===e}function q(e){var t=e.length;if(3===t)return A(e)?[]:[e[0].index,e[1].index,e[2].index];if(e.length<3)throw new i("Invalid polygon: must have at least three vertices.");for(var n=!1,r=0;!n;){var a=10*e.length;if(r>a)return[];r++;for(var o=M(e.length),s=o+1;Math.abs(o-s)<2||Math.abs(o-s)>e.length-2;)s=M(e.length);if(o>s){var u=o;o=s,s=u}try{if(_(o,s,e)){var c=e.splice(o,s-o+1,e[o],e[s]);return q(e).concat(q(c))}}catch(l){if(l.hasOwnProperty("vertexIndex"))return e.splice(l.vertexIndex,1),q(e);throw l}}}var L=new e,W=new e,B=new e,F=new e(1,0),G=new e,Y=0,H=-1,V=1,j=new t,k=new t,X=new t,Z=new t,J=new t,K=new t,$=new t,Q=new t,et=new t,tt=new t,nt=new e,rt=new t,at=new t,it=new t,ot=new t,st={};return st.removeDuplicates=function(e){for(var n=e.length,r=[],a=n-1,i=0;n>i;a=i++){var o=e[a],s=e[i];t.equals(o,s)||r.push(s)}return r},st.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;t>a;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},st.computeWindingOrder2D=function(e){var t=st.computeArea2D(e);return t>0?m.COUNTER_CLOCKWISE:m.CLOCKWISE},st.triangulate=function(e){for(var t=e.length,n=[],r=0;t>r;++r)n[r]={position:e[r],index:r};return q(n)},st.resetSeed=function(e){Y=r(e,0)},st.computeSubdivision=function(e,a,i){i=r(i,l.RADIANS_PER_DEGREE);for(var o=new d,s=a.length,h=0;s>h;h+=3)o.enqueue({i0:a[h],i1:a[h+1],i2:a[h+2]});for(var m,p=e.slice(0),y=[],v={};o.length>0;){var g,w,E=o.dequeue(),x=p[E.i0],S=p[E.i1],M=p[E.i2],_=t.angleBetween(x,S),O=t.angleBetween(S,M),T=t.angleBetween(M,x),C=Math.max(_,Math.max(O,T));C>i?_===C?(g=Math.min(E.i0,E.i1).toString()+" "+Math.max(E.i0,E.i1).toString(),m=v[g],m||(w=t.add(x,S,new t),t.multiplyByScalar(w,.5,w),p.push(w),m=p.length-1,v[g]=m),o.enqueue({i0:E.i0,i1:m,i2:E.i2}),o.enqueue({i0:m,i1:E.i1,i2:E.i2})):O===C?(g=Math.min(E.i1,E.i2).toString()+" "+Math.max(E.i1,E.i2).toString(),m=v[g],m||(w=t.add(S,M,new t),t.multiplyByScalar(w,.5,w),p.push(w),m=p.length-1,v[g]=m),o.enqueue({i0:E.i1,i1:m,i2:E.i0}),o.enqueue({i0:m,i1:E.i2,i2:E.i0})):T===C&&(g=Math.min(E.i2,E.i0).toString()+" "+Math.max(E.i2,E.i0).toString(),m=v[g],m||(w=t.add(M,x,new t),t.multiplyByScalar(w,.5,w),p.push(w),m=p.length-1,v[g]=m),o.enqueue({i0:E.i2,i1:m,i2:E.i1}),o.enqueue({i0:m,i1:E.i0,i2:E.i1})):(y.push(E.i0),y.push(E.i1),y.push(E.i2))}var P=p.length,N=new Array(3*P),R=0;for(m=0;P>m;m++){var I=p[m];N[R++]=I.x,N[R++]=I.y,N[R++]=I.z}return new u({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:N})},indices:y,primitiveType:f.TRIANGLES})},st.scaleToGeodeticHeight=function(e,n,i,s){i=r(i,o.WGS84);var u=it,c=ot;if(n=r(n,0),s=r(s,!0),a(e)&&a(e.attributes)&&a(e.attributes.position))for(var l=e.attributes.position.values,h=l.length,f=0;h>f;f+=3)t.fromArray(l,f,c),s&&(c=i.scaleToGeodeticSurface(c,c)),u=i.geodeticSurfaceNormal(c,u),t.multiplyByScalar(u,n,u),t.add(c,u,c),l[f]=c.x,l[f+1]=c.y,l[f+2]=c.z;return e},st.eliminateHoles=function(e,n,a){a=r(a,o.WGS84);for(var i=[],s=0;s<n.length;s++){for(var u=[],c=0;c<n[s].length;c++)u.push(t.clone(n[s][c]));i.push(u)}for(var l=e;i.length>0;)l=S(l,i,a);return l},st}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,s){"use strict";function u(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),s=(1-a)*Math.tan(e._start.latitude),u=1/Math.sqrt(1+s*s),c=u*s,l=Math.atan2(s,i),h=u*o,f=h*h,d=1-f,m=Math.sqrt(d),p=t/4,y=p*p,v=y*p,g=y*y,w=1+p-3*y/4+5*v/4-175*g/64,E=1-p+15*y/8-35*v/8,x=1-3*p+35*y/4,S=1-5*p,M=w*l-E*Math.sin(2*l)*p/2-x*Math.sin(4*l)*y/16-S*Math.sin(6*l)*v/48-5*Math.sin(8*l)*g/512,_=e._constants;_.a=n,_.b=r,_.f=a,_.cosineHeading=i,_.sineHeading=o,_.tanU=s,_.cosineU=u,_.sineU=c,_.sigma=l,_.sineAlpha=h,_.sineSquaredAlpha=f,_.cosineSquaredAlpha=d,_.cosineAlpha=m,_.u2Over4=p,_.u4Over16=y,_.u6Over64=v,_.u8Over256=g,_.a0=w,_.a1=E,_.a2=x,_.a3=S,_.distanceRatio=M}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var s=c(e,n);return(1-s)*e*t*(r+s*a*(o+s*i*(2*o*o-1)))}function h(e,t,n,r,a,i,o){var u,c,h,f,d,m=(t-n)/t,p=i-r,y=Math.atan((1-m)*Math.tan(a)),v=Math.atan((1-m)*Math.tan(o)),g=Math.cos(y),w=Math.sin(y),E=Math.cos(v),x=Math.sin(v),S=g*E,M=g*x,_=w*x,O=w*E,T=p,C=s.TWO_PI,P=Math.cos(T),N=Math.sin(T);do{P=Math.cos(T),N=Math.sin(T);var R=M-O*P;h=Math.sqrt(E*E*N*N+R*R),c=_+S*P,u=Math.atan2(h,c);var I;0===h?(I=0,f=1):(I=S*N/h,f=1-I*I),C=T,d=c-2*_/f,isNaN(d)&&(d=0),T=p+l(m,I,f,u,h,c,d)}while(Math.abs(T-C)>s.EPSILON12);var b=f*(t*t-n*n)/(n*n),z=1+b*(4096+b*(b*(320-175*b)-768))/16384,D=b*(256+b*(b*(74-47*b)-128))/1024,A=d*d,U=D*h*(d+D*(c*(2*A-1)-D*d*(4*h*h-3)*(4*A-3)/6)/4),q=n*z*(u-U),L=Math.atan2(E*N,M-O*P),W=Math.atan2(g*N,M*P-O);e._distance=q,e._startHeading=L,e._endHeading=W,e._uSquared=b}function f(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),d),e.normalize(i.cartographicToCartesian(a,m),m),h(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),r.height=0,a.height=0,n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),u(n)}var d=new e,m=new e,p=function(e,a,i){var s=n(i,o.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&f(this,e,a,s)};return a(p.prototype,{surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),p.prototype.setEndPoints=function(e,t){f(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),s=Math.cos(4*i),u=Math.cos(6*i),c=Math.sin(2*i),h=Math.sin(4*i),f=Math.sin(6*i),d=Math.sin(8*i),m=i*i,p=i*m,y=a.u8Over256,v=a.u2Over4,g=a.u6Over64,w=a.u4Over16,E=2*p*y*o/3+i*(1-v+7*w/4-15*g/4+579*y/64-(w-15*g/4+187*y/16)*o-(5*g/4-115*y/16)*s-29*y*u/16)+(v/2-w+71*g/32-85*y/16)*c+(5*w/16-5*g/4+383*y/96)*h-m*((g-11*y/2)*c+5*y*h/2)+(29*g/96-29*y/16)*f+539*y*d/1536,x=Math.asin(Math.sin(E)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(x));E-=a.sigma;var M=Math.cos(2*a.sigma+E),_=Math.sin(E),O=Math.cos(E),T=a.cosineU*O,C=a.sineU*_,P=Math.atan2(_*a.sineHeading,T-C*a.cosineHeading),N=P-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,E,_,O,M);return r(n)?(n.longitude=this._start.longitude+N,n.latitude=S,n.height=0,n):new t(this._start.longitude+N,S,0)},p}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,s,u,c,l,h){"use strict";function f(t,n,r,a){var i=a.scaleToGeodeticSurface(t,T),o=a.scaleToGeodeticSurface(n,C),s=e.angleBetween(i,o),u=Math.ceil(s/r),c=new Array(3*u),l=a.cartesianToCartographic(i,M),h=a.cartesianToCartographic(o,_);P.setEndPoints(l,h);var f=P.surfaceDistance/u,d=0;l.height=0;var m=a.cartographicToCartesian(l,O);c[d++]=m.x,c[d++]=m.y,c[d++]=m.z;for(var p=1;u>p;p++){var y=P.interpolateUsingSurfaceDistance(p*f,_);m=a.cartographicToCartesian(y,O),c[d++]=m.x,c[d++]=m.y,c[d++]=m.z}return c}function d(t,n,r){var a=N;return r.geodeticSurfaceNormal(t,a),e.multiplyByScalar(a,n,a),e.add(t,a,t),t}var m={},p=new l,y=new e,v=new e,g=new h(e.ZERO,0),w=new e,E=new h(e.ZERO,0),x=new e,S=new e,M=new t,_=new t,O=new e,T=new e,C=new e,P=new o,N=new e,R=new e;return m.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var u=l.inverseTransformation(a,p),c=l.multiplyByPoint(u,e.ZERO,y),f=l.multiplyByPointAsVector(u,e.UNIT_Y,v),d=h.fromPointNormal(c,f,g),m=l.multiplyByPointAsVector(u,e.UNIT_X,w),M=h.fromPointNormal(c,m,E),_=1;i.push(e.clone(t[0]));for(var O=i[0],T=t.length,C=1;T>C;++C){var P=t[C];if(h.getPointDistance(M,O)<0||h.getPointDistance(M,P)<0){var N=s.lineSegmentPlane(O,P,d,x);if(r(N)){var R=e.multiplyByScalar(f,5e-9,S);h.getPointDistance(d,O)<0&&e.negate(R,R),i.push(e.add(N,R,new e)),o.push(_+1),e.negate(R,R),i.push(e.add(N,R,new e)),_=1}}i.push(e.clone(t[C])),_++,O=P}o.push(_)}return{positions:i,lengths:o}},m.removeDuplicates=function(t){var n=t.length;if(2>n)return t.slice(0);var r=[];r.push(t[0]);for(var a=1;n>a;++a){var i=t[a-1],o=t[a];e.equals(i,o)||r.push(o)}return r},m.scaleToSurface=function(e,t,r){t=n(t,c.RADIANS_PER_DEGREE),r=n(r,i.WGS84);for(var a=e.length,o=[],s=0;a-1>s;s++){var u=e[s],l=e[s+1];o=o.concat(f(u,l,t,r))}var h=e[a-1],d=r.cartesianToCartographic(h,M);d.height=0;var m=r.cartographicToCartesian(d,O);return o.push(m.x,m.y,m.z),o},m.scaleToGeodeticHeight=function(t,o,s,c){s=n(s,i.WGS84);var l,h,f=t.length,m=R;if(r(c)){if(c.length!==t.length)throw new a("result.length must be equal to positions.length");h=c}else h=new Array(t.length);if(0===o){for(l=0;f>l;l+=3)m=s.scaleToGeodeticSurface(e.fromArray(t,l,m),m),h[l]=m.x,h[l+1]=m.y,h[l+2]=m.z;return h}var p;if(u(o)){if(o.length!==f/3)throw new a("height.length must be equal to positions.length");for(l=0;f>l;l+=3)p=o[l/3],m=e.fromArray(t,l,m),m=d(m,p,s),h[l]=m.x,h[l+1]=m.y,h[l+2]=m.z}else for(p=o,l=0;f>l;l+=3)m=e.fromArray(t,l,m),m=d(m,p,s),h[l]=m.x,h[l+1]=m.y,h[l+2]=m.z;return h},m}),define("Core/WallGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,a,i,o,s,u){"use strict";function c(t,n,r,a,i){var o,s=e.angleBetween(t,n),u=Math.ceil(s/i),c=new Array(u);if(r===a){for(o=0;u>o;o++)c[o]=r;return c}var l=a-r,h=l/u;for(o=1;u>o;o++){var f=r+o*h;c[o]=f}return c[0]=r,c}function l(e,t){return i.equalsEpsilon(e.latitude,t.latitude,i.EPSILON14)&&i.equalsEpsilon(e.longitude,t.longitude,i.EPSILON14)}function h(e,r,a,i){var o=n(i),s=n(a),u=[],c=[],h=o?[]:void 0,f=r.length;if(2>f)return{positions:r};var p=r[0];u.push(p);var y=e.cartesianToCartographic(p,d);s&&(y.height=a[0]),c.push(y.height),o&&h.push(i[0]);for(var v=1;f>v;++v){var g=r[v],w=e.cartesianToCartographic(g,m);s&&(w.height=a[v]),l(y,w)?y.height<w.height&&(c[c.length-1]=w.height):(u.push(g),c.push(w.height),o&&h.push(i[v])),t.clone(w,y)}return{positions:u,topHeights:c,bottomHeights:h}}var f={},d=new t,m=new t;return f.computePositions=function(e,t,r,i,l,f){var d=h(e,t,r,i);t=d.positions,r=d.topHeights,i=d.bottomHeights;var m=n(i);if(t.length>=3){var p=a.fromPoints(t,e),y=p.projectPointsOntoPlane(t);o.computeWindingOrder2D(y)===u.CLOCKWISE&&(t.reverse(),r.reverse(),m&&i.reverse())}var v,g=t.length,w=[],E=m?[]:void 0,x=[];for(v=0;g-1>v;v++){var S=t[v],M=t[v+1],_=r[v],O=r[v+1];w=w.concat(c(S,M,_,O,l)),f&&w.push(O),m&&(S=t[v],M=t[v+1],_=i[v],O=i[v+1],E=E.concat(c(S,M,_,O,l)),f&&E.push(O)),f&&(x=x.concat(s.scaleToSurface([S,M],l,e)))}f||(x=s.scaleToSurface(t,l,e),w.push(r[g-1]),m&&E.push(i[g-1]));var T=m?s.scaleToGeodeticHeight(x,E,e):x.slice(0),C=s.scaleToGeodeticHeight(x,w,e);return{newWallPositions:x,bottomPositions:T,topPositions:C}},f}),define("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,n,r,a,i,o,s,u,c,l,h,f,d){"use strict";var m=new t,p=new t,y=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.positions,n=e.maximumHeights,a=e.minimumHeights,i=r(e.granularity,h.RADIANS_PER_DEGREE),s=r(e.ellipsoid,o.WGS84);this._positions=t,this._minimumHeights=a,this._maximumHeights=n,this._granularity=i,this._ellipsoid=s,this._workerName="createWallOutlineGeometry"};return y.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,n,i=e.positions,o=e.minimumHeight,s=e.maximumHeight,u=a(o),c=a(s);if(u||c){var l=i.length;t=u?new Array(l):void 0,n=c?new Array(l):void 0;for(var h=0;l>h;++h)u&&(t[h]=o),c&&(n[h]=s)}var f={positions:i,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid};return new y(f)},y.createGeometry=function(r){var a=r._positions,i=r._minimumHeights,o=r._maximumHeights,y=r._granularity,v=r._ellipsoid,g=d.computePositions(v,a,o,i,y,!1),w=g.newWallPositions,E=g.bottomPositions,x=g.topPositions,S=w.length,M=2*S,_=new Float64Array(M),O=0;S/=3;var T;for(T=0;S>T;++T){var C=3*T,P=t.fromArray(x,C,m),N=t.fromArray(E,C,p);_[O++]=N.x,_[O++]=N.y,_[O++]=N.z,_[O++]=P.x,_[O++]=P.y,_[O++]=P.z}var R=new c({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:_})}),I=M/3;M=2*I-4+I;var b=l.createTypedArray(I,M),z=0;for(T=0;I-2>T;T+=2){var D=T,A=T+2,U=t.fromArray(_,3*D,m),q=t.fromArray(_,3*A,p);if(!t.equalsEpsilon(U,q,h.EPSILON6)){var L=T+1,W=T+3;b[z++]=L,b[z++]=D,b[z++]=L,b[z++]=W,b[z++]=D,b[z++]=A}}return b[z++]=I-2,b[z++]=I-1,new s({attributes:R,indices:b,primitiveType:f.LINES,boundingSphere:new e.fromVertices(_)})},y}),define("Workers/createWallOutlineGeometry",["../Core/Ellipsoid","../Core/WallOutlineGeometry"],function(e,t){"use strict";function n(n){return n._ellipsoid=e.clone(n._ellipsoid),t.createGeometry(n)}return n})}();