/**
 * Cesium - https://github.com/AnalyticalGraphicsInc/cesium
 *
 * Copyright 2011-2016 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 almond 0.3.3 Copyright jQuery Foundation and other contributors.
 * Released under MIT license, http://github.com/requirejs/almond/LICENSE
 */

/**
  @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
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
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.
 *
 */

// Copyright 2012 Google Inc., Apache 2.0 license.

/**
@license
tween.js - https://github.com/sole/tween.js

Copyright (c) 2010-2012 Tween.js authors.

Easing equations Copyright (c) 2001 Robert Penner http://robertpenner.com/easing/

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 THE
AUTHORS OR COPYRIGHT HOLDERS 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
  fontmetrics.js - https://github.com/Pomax/fontmetrics.js

  Copyright (C) 2011 by Mike "Pomax" Kamermans

  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 THE
  AUTHORS OR COPYRIGHT HOLDERS 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
topojson - https://github.com/mbostock/topojson

Copyright (c) 2012, Michael Bostock
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* 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.

* The name Michael Bostock 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 MICHAEL BOSTOCK 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.
*/

/*!
 * Autolinker.js
 * 0.17.1
 *
 * Copyright(c) 2015 Gregory Jacobs <greg@greg-jacobs.com>
 * MIT Licensed. http://www.opensource.org/licenses/mit-license.php
 *
 * https://github.com/gregjacobs/Autolinker.js
 */

/**
@license
 Copyright (c) 2013 Gildas Lormeau. 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 the authors may not be used to endorse or promote products
 derived from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 JCRAFT,
 INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE 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
 * Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
 *
 * TO  THE MAXIMUM  EXTENT PERMITTED  BY APPLICABLE  LAW, THIS SOFTWARE  IS PROVIDED
 * *AS IS*  AND NVIDIA AND  ITS SUPPLIERS DISCLAIM  ALL WARRANTIES,  EITHER  EXPRESS
 * OR IMPLIED, INCLUDING, BUT NOT LIMITED  TO, NONINFRINGEMENT,IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL  NVIDIA 
 * OR ITS SUPPLIERS BE  LIABLE  FOR  ANY  DIRECT, SPECIAL,  INCIDENTAL,  INDIRECT,  OR  
 * CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,  DAMAGES FOR LOSS 
 * OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY 
 * OTHER PECUNIARY LOSS) ARISING OUT OF THE  USE OF OR INABILITY  TO USE THIS SOFTWARE, 
 * EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 */

/**
 * @license
 * Copyright (c) 2000-2005, Sean O'Neil (s_p_oneil@hotmail.com)
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 
 * * Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 * * 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.
 * * Neither the name of the project nor the names of its contributors may 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.
 *
 * Modifications made by Analytical Graphics, Inc.
 */

/*!
 * Knockout JavaScript library v3.4.0
 * (c) Steven Sanderson - http://knockoutjs.com/
 * License: MIT (http://www.opensource.org/licenses/mit-license.php)
 */

/**
 * @license
 * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
 * Copyright (c) Steve Sanderson
 * MIT license
 */

/**
 * @license
 * NoSleep.js v0.5.0 - git.io/vfn01
 * Rich Tibbett
 * MIT license
 **/

!function(){var e,t,i;!function(r){function n(e,t){return w.call(e,t)}function o(e,t){var i,r,n,o,a,s,l,u,c,h,d,p,m=t&&t.split("/"),f=y.map,_=f&&f["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,y.nodeIdCompat&&E.test(e[a])&&(e[a]=e[a].replace(E,"")),"."===e[0].charAt(0)&&m&&(p=m.slice(0,m.length-1),e=p.concat(e)),c=0;c<e.length;c++)if(d=e[c],"."===d)e.splice(c,1),c-=1;else if(".."===d){if(0===c||1===c&&".."===e[2]||".."===e[c-1])continue;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((m||_)&&f){for(i=e.split("/"),c=i.length;c>0;c-=1){if(r=i.slice(0,c).join("/"),m)for(h=m.length;h>0;h-=1)if(n=f[m.slice(0,h).join("/")],n&&(n=n[r])){o=n,s=c;break}if(o)break;!l&&_&&_[r]&&(l=_[r],u=c)}!o&&l&&(o=l,s=u),o&&(i.splice(0,s,o),e=i.join("/"))}return e}function a(e,t){return function(){var i=S.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),m.apply(r,i.concat([e,t]))}}function s(e){return function(t){return o(t,e)}}function l(e){return function(t){g[e]=t}}function u(e){if(n(v,e)){var t=v[e];delete v[e],C[e]=!0,p.apply(r,t)}if(!n(g,e)&&!n(C,e))throw new Error("No "+e);return g[e]}function c(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function h(e){return e?c(e):[]}function d(e){return function(){return y&&y.config&&y.config[e]||{}}}var p,m,f,_,g={},v={},y={},C={},w=Object.prototype.hasOwnProperty,S=[].slice,E=/\.js$/;f=function(e,t){var i,r=c(e),n=r[0],a=t[1];return e=r[1],n&&(n=o(n,a),i=u(n)),n?e=i&&i.normalize?i.normalize(e,s(a)):o(e,a):(e=o(e,a),r=c(e),n=r[0],e=r[1],n&&(i=u(n))),{f:n?n+"!"+e:e,n:e,pr:n,p:i}},_={require:function(e){return a(e)},exports:function(e){var t=g[e];return"undefined"!=typeof t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:d(e)}}},p=function(e,t,i,o){var s,c,d,p,m,y,w,S=[],E=typeof i;if(o=o||e,y=h(o),"undefined"===E||"function"===E){for(t=!t.length&&i.length?["require","exports","module"]:t,m=0;m<t.length;m+=1)if(p=f(t[m],y),c=p.f,"require"===c)S[m]=_.require(e);else if("exports"===c)S[m]=_.exports(e),w=!0;else if("module"===c)s=S[m]=_.module(e);else if(n(g,c)||n(v,c)||n(C,c))S[m]=u(c);else{if(!p.p)throw new Error(e+" missing "+c);p.p.load(p.n,a(o,!0),l(c),{}),S[m]=g[c]}d=i?i.apply(g[e],S):void 0,e&&(s&&s.exports!==r&&s.exports!==g[e]?g[e]=s.exports:d===r&&w||(g[e]=d))}else e&&(g[e]=i)},e=t=m=function(e,t,i,n,o){if("string"==typeof e)return _[e]?_[e](t):u(f(e,h(t)).f);if(!e.splice){if(y=e,y.deps&&m(y.deps,y.callback),!t)return;t.splice?(e=t,t=i,i=null):e=r}return t=t||function(){},"function"==typeof i&&(i=n,n=o),n?p(r,e,t,i):setTimeout(function(){p(r,e,t,i)},4),m},m.config=function(e){return m(e)},e._defined=g,i=function(e,t,i){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(i=t,t=[]),n(g,e)||n(v,e)||(v[e]=[e,t,i])},i.amd={jQuery:!0}}(),i("Core/appendForwardSlash",[],function(){"use strict";function e(e){return 0!==e.length&&"/"===e[e.length-1]||(e+="/"),e}return e}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,i,r,n){return t(e).then(i,r,n)}function t(e){var t,i;return e instanceof r?t=e:s(e)?(i=a(),e.then(function(e){i.resolve(e)},function(e){i.reject(e)},function(e){i.progress(e)}),t=i.promise):t=n(e),t}function i(t){return e(t,o)}function r(e){this.then=e}function n(e){var i=new r(function(i){try{return t(i?i(e):e)}catch(e){return o(e)}});return i}function o(e){var i=new r(function(i,r){try{return r?t(r(e)):o(e)}catch(e){return o(e)}});return i}function a(){function e(e,t,i){return d(e,t,i)}function i(e){return m(e)}function n(e){return m(o(e))}function s(e){return p(e)}var l,u,c,h,d,p,m;return u=new r(e),l={then:e,resolve:i,reject:n,progress:s,promise:u,resolver:{resolve:i,reject:n,progress:s}},c=[],h=[],d=function(e,t,i){var r,n;return r=a(),n="function"==typeof i?function(e){try{r.progress(i(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},c.push(function(i){i.then(e,t).then(r.resolve,r.reject,n)}),h.push(n),r.promise},p=function(e){return f(h,e),e},m=function(e){return e=t(e),d=e.then,m=t,p=g,f(c,e),h=c=w,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,i,r,n,o){return _(2,arguments),e(t,function(t){function s(e){f(e)}function l(e){m(e)}var u,c,h,d,p,m,f,_,v,y;if(v=t.length>>>0,u=Math.max(0,Math.min(i,v)),h=[],c=v-u+1,d=[],p=a(),u)for(_=p.progress,f=function(e){d.push(e),--c||(m=f=g,p.reject(d))},m=function(e){h.push(e),--u||(m=f=g,p.resolve(h))},y=0;y<v;++y)y in t&&e(t[y],l,s,_);else p.resolve(h);return p.then(r,n,o)})}function u(e,t,i,r){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,i,r)}function c(e,t,i,r){return _(1,arguments),d(e,v).then(t,i,r)}function h(){return d(arguments,v)}function d(t,i){return e(t,function(t){var r,n,o,s,l,u;if(o=n=t.length>>>0,r=[],u=a(),o)for(s=function(t,n){e(t,i).then(function(e){r[n]=e,--o||u.resolve(r)},u.reject)},l=0;l<n;l++)l in t?s(t[l],l):--o;else u.resolve(r);return u.promise})}function p(t,i){var r=C.call(arguments,1);return e(t,function(t){var n;return n=t.length,r[0]=function(t,r,o){return e(t,function(t){return e(r,function(e){return i(t,e,o,n)})})},y.apply(t,r)})}function m(t,i,r){var n=arguments.length>2;return e(t,function(e){return e=n?r:e,i.resolve(e),e},function(e){return i.reject(e),o(e)},i.progress)}function f(e,t){for(var i,r=0;i=e[r++];)i(t)}function _(e,t){for(var i,r=t.length;r>e;)if(i=t[--r],null!=i&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function g(){}function v(e){return e}var y,C,w;return e.defer=a,e.resolve=t,e.reject=i,e.join=h,e.all=c,e.map=d,e.reduce=p,e.any=u,e.some=l,e.chain=m,e.isPromise=s,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(w,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(w,t)})})}},C=[].slice,y=[].reduce||function(e){var t,i,r,n,o;if(o=0,t=Object(this),n=t.length>>>0,i=arguments,i.length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=n)throw new TypeError}else r=i[1];for(;o<n;++o)o in t&&(r=e(r,t[o],o,t));return r},e})}("function"==typeof i&&i.amd?i:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),i("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),i("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),i=Object.defineProperties;return t&&e(i)||(i=function(e){return e}),i}),i("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),i("Core/Credit",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){var a=e(r),s=e(i),l=e(t);l||s||(t=r),this._text=t,this._imageUrl=i,this._link=r,this._hasLink=a,this._hasImage=s;var u,c=JSON.stringify([t,i,r]);e(o[c])?u=o[c]:(u=n++,o[c]=u),this._id=u}var n=0,o={};return t(r.prototype,{text:{get:function(){return this._text}},imageUrl:{get:function(){return this._imageUrl}},link:{get:function(){return this._link}},id:{get:function(){return this._id}}}),r.prototype.hasImage=function(){return this._hasImage},r.prototype.hasLink=function(){return this._hasLink},r.equals=function(t,i){return t===i||e(t)&&e(i)&&t._id===i._id},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),i("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),i("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}),i("Core/Check",["./defaultValue","./defined","./DeveloperError","./isArray"],function(e,t,i,r){"use strict";function n(e){return e+" was required but undefined."}function o(e,t,i){return"Expected "+i+" to be typeof "+t+", got "+e}var a={};return a.typeOf={},a.numeric={},a.defined=function(e,r){if(!t(e))throw new i(n(r))},a.numeric.maximum=function(e,t){if(a.typeOf.number(e),a.typeOf.number(t),e>t)throw new i("Expected "+e+" to be at most "+t)},a.numeric.minimum=function(e,t){if(a.typeOf.number(e),a.typeOf.number(t),e<t)throw new i("Expected "+e+" to be at least "+t)},a.typeOf.function=function(e,t){if("function"!=typeof e)throw new i(o(typeof e,"function",t))},a.typeOf.string=function(e,t){if("string"!=typeof e)throw new i(o(typeof e,"string",t))},a.typeOf.number=function(e,t){if("number"!=typeof e)throw new i(o(typeof e,"number",t))},a.typeOf.object=function(e,t){if("object"!=typeof e)throw new i(o(typeof e,"object",t))},a.typeOf.boolean=function(e,t){if("boolean"!=typeof e)throw new i(o(typeof e,"boolean",t))},a}),i("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 i;for(this.mti==this.N+1&&this.init_genrand(5489),i=0;i<this.N-this.M;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+this.M]^e>>>1^t[1&e];for(;i<this.N-1;i++)e=this.mt[i]&this.UPPER_MASK|this.mt[i+1]&this.LOWER_MASK,this.mt[i]=this.mt[i+(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^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),i("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"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:e<0?-1:0},n.signNotZero=function(e){return e<0?-1:1},n.toSNorm=function(e,i){return i=t(i,255),Math.round((.5*n.clamp(e,-1,1)+.5)*i)},n.fromSNorm=function(e,i){return i=t(i,255),n.clamp(e,0,i)/i*2-1},n.sinh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t-i)},n.cosh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t+i)},n.lerp=function(e,t,i){return(1-i)*e+i*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=3*Math.PI*.5,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,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},n.clampToLatitudeRange=function(e){return n.clamp(e,-1*n.PI_OVER_TWO,n.PI_OVER_TWO)},n.negativePiToPi=function(e){return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){var t=n.mod(e,n.TWO_PI);return Math.abs(t)<n.EPSILON14&&Math.abs(e)>n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,i,r,n){n=t(n,r);var o=Math.abs(e-i);return o<=n||o<=r*Math.max(Math.abs(e),Math.abs(i))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var i=o[t-1],r=t;r<=e;r++)o.push(i*r);return o[e]},n.incrementWrap=function(e,i,r){return r=t(r,0),++e,e>i&&(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,i){return e<t?t:e>i?i: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.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},n.logBase=function(e,t){return Math.log(e)/Math.log(t)},n.fog=function(e,t){var i=e*t;return 1-Math.exp(-(i*i))},n}),i("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0)}a.fromSpherical=function(e,r){i(r)||(r=new a);var n=e.clock,o=e.cone,s=t(e.magnitude,1),l=s*Math.sin(o);return r.x=l*Math.cos(n),r.y=l*Math.sin(n),r.z=s*Math.cos(o),r},a.fromElements=function(e,t,r,n){return i(n)?(n.x=e,n.y=t,n.z=r,n):new a(e,t,r)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r]=e.z,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r++],n.z=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=3*r:t=new Array(3*r);for(var n=0;n<r;++n)a.pack(e[n],t,3*n);return t},a.unpackArray=function(e,t){var r=e.length;i(t)?t.length=r/3:t=new Array(r/3);for(var n=0;n<r;n+=3){var o=n/3;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i},a.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var i=a.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i},a.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i},a.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i},a.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i},a.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i},a.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,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};var l=new a;a.lerp=function(e,t,i,r){return a.multiplyByScalar(t,i,l),r=a.multiplyByScalar(e,1-i,r),a.add(l,r,r)};var u=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,u),a.normalize(t,c);var i=a.dot(u,c),r=a.magnitude(a.cross(u,c,u));return Math.atan2(r,i)};var h=new a;a.mostOrthogonalAxis=function(e,t){var i=a.normalize(e,h);return a.abs(i,i),t=i.x<=i.y?i.x<=i.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):i.y<=i.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},a.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]},a.equalsEpsilon=function(e,t,r,n){return e===t||i(e)&&i(t)&&o.equalsEpsilon(e.x,t.x,r,n)&&o.equalsEpsilon(e.y,t.y,r,n)&&o.equalsEpsilon(e.z,t.z,r,n)},a.cross=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=t.x,s=t.y,l=t.z,u=n*l-o*s,c=o*a-r*l,h=r*s-n*a;return i.x=u,i.y=c,i.z=h,i},a.fromDegrees=function(e,t,i,r,n){return e=o.toRadians(e),t=o.toRadians(t),a.fromRadians(e,t,i,r,n)};var d=new a,p=new a,m=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(e,r,n,o,s){n=t(n,0);var l=i(o)?o.radiiSquared:m,u=Math.cos(r);d.x=u*Math.cos(e),d.y=u*Math.sin(e),d.z=Math.sin(r),d=a.normalize(d,d),a.multiplyComponents(l,d,p);var c=Math.sqrt(a.dot(d,p));return p=a.divideByScalar(p,c,p),d=a.multiplyByScalar(d,n,d),i(s)||(s=new a),a.add(p,d,s)},a.fromDegreesArray=function(e,t,r){var n=e.length;i(r)?r.length=n/2:r=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;r[u]=a.fromDegrees(s,l,0,t,r[u])}return r},a.fromRadiansArray=function(e,t,r){var n=e.length;i(r)?r.length=n/2:r=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;r[u]=a.fromRadians(s,l,0,t,r[u])}return r},a.fromDegreesArrayHeights=function(e,t,r){var n=e.length;i(r)?r.length=n/3:r=new Array(n/3);for(var o=0;o<n;o+=3){var s=e[o],l=e[o+1],u=e[o+2],c=o/3;r[c]=a.fromDegrees(s,l,u,t,r[c])}return r},a.fromRadiansArrayHeights=function(e,t,r){var n=e.length;i(r)?r.length=n/3:r=new Array(n/3);for(var o=0;o<n;o+=3){var s=e[o],l=e[o+1],u=e[o+2],c=o/3;r[c]=a.fromRadians(s,l,u,t,r[c])}return r},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(new a(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,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),i("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(i,n,s,l,u){var c=i.x,h=i.y,d=i.z,p=n.x,m=n.y,f=n.z,_=c*c*p*p,g=h*h*m*m,v=d*d*f*f,y=_+g+v,C=Math.sqrt(1/y),w=e.multiplyByScalar(i,C,o);if(y<l)return isFinite(C)?e.clone(w,u):void 0;var S=s.x,E=s.y,b=s.z,T=a;T.x=w.x*S*2,T.y=w.y*E*2,T.z=w.z*b*2;var x,A,P,D,M,I,R,O,N,L,B,F=(1-C)*e.magnitude(i)/(.5*e.magnitude(T)),V=0;do{F-=V,P=1/(1+F*S),D=1/(1+F*E),M=1/(1+F*b),I=P*P,R=D*D,O=M*M,N=I*P,L=R*D,B=O*M,x=_*I+g*R+v*O-1,A=_*N*S+g*L*E+v*B*b;var k=-2*A;V=x/k}while(Math.abs(x)>r.EPSILON12);return t(u)?(u.x=c*P,u.y=h*D,u.z=d*M,u):new e(c*P,h*D,d*M)}var o=new e,a=new e;return n}),i("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r){this.longitude=t(e,0),this.latitude=t(i,0),this.height=t(r,0)}s.fromRadians=function(e,r,n,o){return n=t(n,0),i(o)?(o.longitude=e,o.latitude=r,o.height=n,o):new s(e,r,n)},s.fromDegrees=function(e,t,i,r){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,i,r)};var l=new e,u=new e,c=new e,h=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var m=i(r)?r.oneOverRadii:h,f=i(r)?r.oneOverRadiiSquared:d,_=i(r)?r._centerToleranceSquared:p,g=a(t,m,f,_,u);if(i(g)){var v=e.multiplyComponents(g,f,l);v=e.normalize(v,v);var y=e.subtract(t,g,c),C=Math.atan2(v.y,v.x),w=Math.asin(v.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=C,n.latitude=w,n.height=S,n):new s(C,w,S)}},s.clone=function(e,t){if(i(e))return i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),i("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,r,n,o){r=i(r,0),n=i(n,0),o=i(o,0),t._radii=new e(r,n,o),t._radiiSquared=new e(r*r,n*n,o*o),t._radiiToTheFourth=new e(r*r*r*r,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===r?0:1/r,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(r,n,o),t._maximumRadius=Math.max(r,n,o),t._centerToleranceSquared=s.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,u(this,e,t,i)}n(c.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),c.clone=function(t,i){if(r(t)){var n=t._radii;return r(i)?(e.clone(n,i._radii),e.clone(t._radiiSquared,i._radiiSquared),e.clone(t._radiiToTheFourth,i._radiiToTheFourth),e.clone(t._oneOverRadii,i._oneOverRadii),e.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new c(n.x,n.y,n.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(u(t,e.x,e.y,e.z),t):t},c.WGS84=a(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=a(new c(1,1,1)),c.MOON=a(new c(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,n){return n=i(n,0),e.pack(t._radii,r,n),r},c.unpack=function(t,r,n){r=i(r,0);var o=e.unpack(t,r);return c.fromCartesian3(o,n)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,i){var n=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(n),l=a*Math.sin(n),u=Math.sin(o);return r(i)||(i=new e),i.x=s,i.y=l,i.z=u,e.normalize(i,i)},c.prototype.geodeticSurfaceNormal=function(t,i){return r(i)||(i=new e),i=e.multiplyComponents(t,this._oneOverRadiiSquared,i),e.normalize(i,i)};var h=new e,d=new e;c.prototype.cartographicToCartesian=function(t,i){var n=h,o=d;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,t.height,n),r(i)||(i=new e),e.add(o,n,i)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;n<i;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var p=new e,m=new e,f=new e;return c.prototype.cartesianToCartographic=function(i,n){var o=this.scaleToGeodeticSurface(i,m);if(r(o)){var a=this.geodeticSurfaceNormal(o,p),l=e.subtract(i,o,f),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),h=s.sign(e.dot(l,i))*e.magnitude(l);return r(n)?(n.longitude=u,n.latitude=c,n.height=h,n):new t(u,c,h)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;n<i;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return l(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,i){r(i)||(i=new e);var n=t.x,o=t.y,a=t.z,s=this._oneOverRadiiSquared,l=1/Math.sqrt(n*n*s.x+o*o*s.y+a*a*s.z);return e.multiplyByScalar(t,l,i)},c.prototype.transformPositionToScaledSpace=function(t,i){return r(i)||(i=new e),e.multiplyComponents(t,this._oneOverRadii,i)},c.prototype.transformPositionFromScaledSpace=function(t,i){return r(i)||(i=new e),e.multiplyComponents(t,this._radii,i)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,n,o){n=i(n,0);var a=this._sqauredXOverSquaredZ;if(r(o)||(o=new e),o.x=0,o.y=0,o.z=t.z*(1-a),!(Math.abs(o.z)>=this._radii.z-n))return o},c}),i("Core/Event",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}return t(r.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),r.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},r.prototype.removeEventListener=function(e,t){for(var i=this._listeners,r=this._scopes,n=-1,o=0;o<i.length;o++)if(i[o]===e&&r[o]===t){n=o;break}return n!==-1&&(this._insideRaiseEvent?(this._toRemove.push(n),i[n]=void 0,r[n]=void 0):(i.splice(n,1),r.splice(n,1)),!0)},r.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;var t,i=this._listeners,r=this._scopes,n=i.length;for(t=0;t<n;t++){var o=i[t];e(o)&&i[t].apply(r[t],arguments)}var a=this._toRemove;for(n=a.length,t=0;t<n;t++){var s=a[t];i.splice(s,1),r.splice(s,1)}a.length=0,this._insideRaiseEvent=!1},r}),i("Core/Cartesian2",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i){this.x=e(t,0),this.y=e(i,0)}o.fromElements=function(e,i,r){return t(r)?(r.x=e,r.y=i,r):new o(e,i)},o.clone=function(e,i){if(t(e))return t(i)?(i.x=e.x,i.y=e.y,i):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,i,r){return r=e(r,0),i[r++]=t.x,i[r]=t.y,i},o.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new o),n.x=i[r++],n.y=i[r],n},o.packArray=function(e,i){var r=e.length;t(i)?i.length=2*r:i=new Array(2*r);for(var n=0;n<r;++n)o.pack(e[n],i,2*n);return i},o.unpackArray=function(e,i){var r=e.length;t(i)?i.length=r/2:i=new Array(r/2);for(var n=0;n<r;n+=2){var a=n/2;i[a]=o.unpack(e,n,i[a])}return i},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i},o.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i},o.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i},o.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i},o.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i},o.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i},o.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o,u=new o;o.angleBetween=function(e,t){return o.normalize(e,l),o.normalize(t,u),n.acosClamped(o.dot(l,u))};var c=new o;return o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,c);return o.abs(i,i),t=i.x<=i.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y},o.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)},o.ZERO=r(new o(0,0)),o.UNIT_X=r(new o(1,0)),o.UNIT_Y=r(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),i("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._ellipsoid=i(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},s.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=e.y*n,s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},s}),i("Core/Rectangle",["./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./freezeObject","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i,r,n){this.west=t(e,0),this.south=t(i,0),this.east=t(r,0),this.north=t(n,0)}r(l.prototype,{width:{get:function(){return l.computeWidth(this)}},height:{get:function(){return l.computeHeight(this)}}}),l.packedLength=4,l.pack=function(e,i,r){return r=t(r,0),i[r++]=e.west,i[r++]=e.south,i[r++]=e.east,i[r]=e.north,i},l.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new l),n.west=e[r++],n.south=e[r++],n.east=e[r++],n.north=e[r],n},l.computeWidth=function(e){var t=e.east,i=e.west;return t<i&&(t+=s.TWO_PI),t-i},l.computeHeight=function(e){return e.north-e.south},l.fromDegrees=function(e,r,n,o,a){return e=s.toRadians(t(e,0)),r=s.toRadians(t(r,0)),n=s.toRadians(t(n,0)),o=s.toRadians(t(o,0)),i(a)?(a.west=e,a.south=r,a.east=n,a.north=o,a):new l(e,r,n,o)},l.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=e[h];r=Math.min(r,p.longitude),n=Math.max(n,p.longitude),u=Math.min(u,p.latitude),c=Math.max(c,p.latitude);var m=p.longitude>=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,m),a=Math.max(a,m)}return n-r>a-o&&(r=o,n=a,n>s.PI&&(n-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),i(t)?(t.west=r,t.south=u,t.east=n,t.north=c,t):new l(r,u,n,c)},l.fromCartesianArray=function(e,t,r){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,h=-Number.MAX_VALUE,d=0,p=e.length;d<p;d++){var m=t.cartesianToCartographic(e[d]);n=Math.min(n,m.longitude),o=Math.max(o,m.longitude),c=Math.min(c,m.latitude),h=Math.max(h,m.latitude);var f=m.longitude>=0?m.longitude:m.longitude+s.TWO_PI;a=Math.min(a,f),u=Math.max(u,f)}return o-n>u-a&&(n=a,o=u,o>s.PI&&(o-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),i(r)?(r.west=n,r.south=c,r.east=o,r.north=h,r):new l(n,c,o,h)},l.clone=function(e,t){if(i(e))return i(t)?(t.west=e.west,
t.south=e.south,t.east=e.east,t.north=e.north,t):new l(e.west,e.south,e.east,e.north)},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},l.prototype.equalsEpsilon=function(e,t){return i(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},l.validate=function(e){},l.southwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},l.northwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},l.northeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},l.southeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},l.center=function(t,r){var n=t.east,o=t.west;n<o&&(n+=s.TWO_PI);var a=s.negativePiToPi(.5*(o+n)),l=.5*(t.south+t.north);return i(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new e(a,l)},l.intersection=function(e,t,r){var n=e.east,o=e.west,a=t.east,u=t.west;n<o&&a>0?n+=s.TWO_PI:a<u&&n>0&&(a+=s.TWO_PI),n<o&&u<0?u+=s.TWO_PI:a<u&&o<0&&(o+=s.TWO_PI);var c=s.negativePiToPi(Math.max(o,u)),h=s.negativePiToPi(Math.min(n,a));if(!((e.west<e.east||t.west<t.east)&&h<=c)){var d=Math.max(e.south,t.south),p=Math.min(e.north,t.north);if(!(d>=p))return i(r)?(r.west=c,r.south=d,r.east=h,r.north=p,r):new l(c,d,h,p)}},l.simpleIntersection=function(e,t,r){var n=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||n>=a))return i(r)?(r.west=n,r.south=o,r.east=a,r.north=s,r):new l(n,o,a,s)},l.union=function(e,t,r){i(r)||(r=new l);var n=e.east,o=e.west,a=t.east,u=t.west;n<o&&a>0?n+=s.TWO_PI:a<u&&n>0&&(a+=s.TWO_PI),n<o&&u<0?u+=s.TWO_PI:a<u&&o<0&&(o+=s.TWO_PI);var c=s.convertLongitudeRange(Math.min(o,u)),h=s.convertLongitudeRange(Math.max(n,a));return r.west=c,r.south=Math.min(e.south,t.south),r.east=h,r.north=Math.max(e.north,t.north),r},l.expand=function(e,t,r){return i(r)||(r=new l),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},l.contains=function(e,t){var i=t.longitude,r=t.latitude,n=e.west,o=e.east;return o<n&&(o+=s.TWO_PI,i<0&&(i+=s.TWO_PI)),(i>n||s.equalsEpsilon(i,n,s.EPSILON14))&&(i<o||s.equalsEpsilon(i,o,s.EPSILON14))&&r>=e.south&&r<=e.north};var u=new e;return l.subsample=function(e,r,n,a){r=t(r,o.WGS84),n=t(n,0),i(a)||(a=[]);var c=0,h=e.north,d=e.south,p=e.east,m=e.west,f=u;f.height=n,f.longitude=m,f.latitude=h,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.latitude=d,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=m,a[c]=r.cartographicToCartesian(f,a[c]),c++,h<0?f.latitude=h:d>0?f.latitude=d:f.latitude=0;for(var _=1;_<8;++_)f.longitude=-Math.PI+_*s.PI_OVER_TWO,l.contains(e,f)&&(a[c]=r.cartographicToCartesian(f,a[c]),c++);return 0===f.latitude&&(f.longitude=m,a[c]=r.cartographicToCartesian(f,a[c]),c++,f.longitude=p,a[c]=r.cartographicToCartesian(f,a[c]),c++),a.length=c,a},l.MAX_VALUE=a(new l(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),l}),i("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=t(e,{}),this._ellipsoid=t(e.ellipsoid,o.WGS84),this._rectangle=t(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=t(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=t(e.numberOfLevelZeroTilesY,1)}return r(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},u.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},u.prototype.rectangleToNativeRectangle=function(e,t){var r=s.toDegrees(e.west),n=s.toDegrees(e.south),o=s.toDegrees(e.east),a=s.toDegrees(e.north);return i(t)?(t.west=r,t.south=n,t.east=o,t.north=a,t):new l(r,n,o,a)},u.prototype.tileXYToNativeRectangle=function(e,t,i,r){var n=this.tileXYToRectangle(e,t,i,r);return n.west=s.toDegrees(n.west),n.south=s.toDegrees(n.south),n.east=s.toDegrees(n.east),n.north=s.toDegrees(n.north),n},u.prototype.tileXYToRectangle=function(e,t,r,n){var o=this._rectangle,a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),u=o.width/a,c=e*u+o.west,h=(e+1)*u+o.west,d=o.height/s,p=o.north-t*d,m=o.north-(t+1)*d;return i(n)||(n=new l(c,m,h,p)),n.west=c,n.south=m,n.east=h,n.north=p,n},u.prototype.positionToTileXY=function(t,r,n){var o=this._rectangle;if(l.contains(o,t)){var a=this.getNumberOfXTilesAtLevel(r),u=this.getNumberOfYTilesAtLevel(r),c=o.width/a,h=o.height/u,d=t.longitude;o.east<o.west&&(d+=s.TWO_PI);var p=(d-o.west)/c|0;p>=a&&(p=a-1);var m=(o.north-t.latitude)/h|0;return m>=u&&(m=u-1),i(n)?(n.x=p,n.y=m,n):new e(p,m)}},u}),i("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,r,n){e(r)||(r=t.width),e(n)||(n=t.height);var o=i[r];e(o)||(o={},i[r]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=r,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,r,n),a.getImageData(0,0,r,n).data}var i={};return t}),i("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),i("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,i,r,n){"use strict";function o(r,n,o){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(n,e.ZERO)),i(o)?o=e.clone(o):(o=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(o,.5,o)),this.center=o}o.fromPoints=function(t,r){if(i(r)||(r=new o),!i(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 n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,h=t.length,d=1;d<h;d++){var p=t[d],m=p.x,f=p.y,_=p.z;n=Math.min(m,n),l=Math.max(m,l),a=Math.min(f,a),u=Math.max(f,u),s=Math.min(_,s),c=Math.max(_,c)}var g=r.minimum;g.x=n,g.y=a,g.z=s;var v=r.maximum;v.x=l,v.y=u,v.z=c;var y=e.add(g,v,r.center);return e.multiplyByScalar(y,.5,y),r},o.clone=function(t,r){if(i(t))return i(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 o(t.minimum,t.maximum)},o.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var a=new e;return o.intersectPlane=function(t,i){a=e.subtract(t.maximum,t.minimum,a);var r=e.multiplyByScalar(a,.5,a),o=i.normal,s=r.x*Math.abs(o.x)+r.y*Math.abs(o.y)+r.z*Math.abs(o.z),l=e.dot(t.center,o)+i.distance;return l-s>0?n.INSIDE:l+s<0?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),i("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,i){this.start=e(t,0),this.stop=e(i,0)}return t}),i("Core/Matrix3",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r,n,o,a,s,l,u){this[0]=t(e,0),this[1]=t(n,0),this[2]=t(s,0),this[3]=t(i,0),this[4]=t(o,0),this[5]=t(l,0),this[6]=t(r,0),this[7]=t(a,0),this[8]=t(u,0)}function l(e){for(var t=0,i=0;i<9;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}function u(e){for(var t=0,i=0;i<3;++i){var r=e[s.getElementIndex(m[i],p[i])];t+=2*r*r}return Math.sqrt(t)}function c(e,t){for(var i=a.EPSILON15,r=0,n=1,o=0;o<3;++o){var l=Math.abs(e[s.getElementIndex(m[o],p[o])]);l>r&&(n=o,r=l)}var u=1,c=0,h=p[n],d=m[n];if(Math.abs(e[s.getElementIndex(d,h)])>i){var f,_=e[s.getElementIndex(d,d)],g=e[s.getElementIndex(h,h)],v=e[s.getElementIndex(d,h)],y=(_-g)/2/v;f=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+f*f),c=f*u}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(h,h)]=t[s.getElementIndex(d,d)]=u,t[s.getElementIndex(d,h)]=c,t[s.getElementIndex(h,d)]=-c,t}s.packedLength=9,s.pack=function(e,i,r){return r=t(r,0),i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3],i[r++]=e[4],i[r++]=e[5],i[r++]=e[6],i[r++]=e[7],i[r++]=e[8],i},s.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new s),n[0]=e[r++],n[1]=e[r++],n[2]=e[r++],n[3]=e[r++],n[4]=e[r++],n[5]=e[r++],n[6]=e[r++],n[7]=e[r++],n[8]=e[r++],n},s.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,r,n){return r=t(r,0),i(n)||(n=new s),n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n[4]=e[r+4],n[5]=e[r+5],n[6]=e[r+6],n[7]=e[r+7],n[8]=e[r+8],n},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return i(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 s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,l=e.y*e.y,u=e.y*e.z,c=e.y*e.w,h=e.z*e.z,d=e.z*e.w,p=e.w*e.w,m=r-l-h+p,f=2*(n-d),_=2*(o+c),g=2*(n+d),v=-r+l-h+p,y=2*(u-a),C=2*(o-c),w=2*(u+a),S=-r-l+h+p;return i(t)?(t[0]=m,t[1]=g,t[2]=C,t[3]=f,t[4]=v,t[5]=w,t[6]=_,t[7]=y,t[8]=S,t):new s(m,f,_,g,v,y,C,w,S)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),n=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),l=Math.sin(-e.heading),u=Math.sin(e.roll),c=r*n,h=-o*l+u*a*n,d=u*l+o*a*n,p=r*l,m=o*n+u*a*l,f=-a*o+o*a*l,_=-a,g=u*r,v=o*r;return i(t)?(t[0]=c,t[1]=p,t[2]=_,t[3]=h,t[4]=m,t[5]=g,t[6]=d,t[7]=f,t[8]=v,t):new s(c,h,d,p,m,f,_,g,v)},s.fromScale=function(e,t){return i(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 s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return i(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 s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return i(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=n,t[6]=0,t[7]=-n,t[8]=r,t):new s(1,0,0,0,r,-n,0,n,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=r,t):new s(r,0,n,0,1,0,-n,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-n,0,n,r,0,0,0,1)},s.toArray=function(e,t){return i(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]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,i){var r=3*t,n=e[r],o=e[r+1],a=e[r+2];return i.x=n,i.y=o,i.z=a,i},s.setColumn=function(e,t,i,r){r=s.clone(e,r);var n=3*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r},s.getRow=function(e,t,i){var r=e[t],n=e[t+3],o=e[t+6];return i.x=r,i.y=n,i.z=o,i},s.setRow=function(e,t,i,r){return r=s.clone(e,r),r[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var h=new e;s.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),i.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),i.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),i};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,i){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=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],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=r,i[1]=n,i[2]=o,i[3]=a,i[4]=s,i[5]=l,i[6]=u,i[7]=c,i[8]=h,i},s.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},s.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},s.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[3]*n+e[6]*o,s=e[1]*r+e[4]*n+e[7]*o,l=e[2]*r+e[5]*n+e[8]*o;return i.x=a,i.y=s,i.z=l,i},s.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},s.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var i=e[0],r=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var p=[1,0,0],m=[2,2,1],f=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var r=a.EPSILON20,n=10,o=0,h=0;i(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),p=t.diagonal=s.clone(e,t.diagonal),m=r*l(p);h<n&&u(p)>m;)c(p,f),s.transpose(f,_),s.multiply(p,f,p),s.multiply(_,p,p),s.multiply(d,f,d),++o>2&&(++h,o=0);return t},s.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},s.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*r-i*u)+s*(i*a-o*r)},s.inverse=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=s.determinant(e);t[0]=a*h-c*l,t[1]=c*n-r*h,t[2]=r*l-a*n,t[3]=u*l-o*h,t[4]=i*h-u*n,t[5]=o*n-i*l,t[6]=o*c-u*a,t[7]=u*r-i*c,t[8]=i*a-o*r;var p=1/d;return s.multiplyByScalar(t,p,t)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(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},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,r(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),i("Core/Cartesian4",["./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n){"use strict";function o(t,i,r,n){this.x=e(t,0),this.y=e(i,0),this.z=e(r,0),this.w=e(n,0)}o.fromElements=function(e,i,r,n,a){return t(a)?(a.x=e,a.y=i,a.z=r,a.w=n,a):new o(e,i,r,n)},o.fromColor=function(e,i){return t(i)?(i.x=e.red,i.y=e.green,i.z=e.blue,i.w=e.alpha,i):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,i){if(t(e))return t(i)?(i.x=e.x,i.y=e.y,i.z=e.z,i.w=e.w,i):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(t,i,r){return r=e(r,0),i[r++]=t.x,i[r++]=t.y,i[r++]=t.z,i[r]=t.w,i},o.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new o),n.x=i[r++],n.y=i[r++],n.z=i[r++],n.w=i[r],n},o.packArray=function(e,i){var r=e.length;t(i)?i.length=4*r:i=new Array(4*r);for(var n=0;n<r;++n)o.pack(e[n],i,4*n);return i},o.unpackArray=function(e,i){var r=e.length;t(i)?i.length=r/4:i=new Array(r/4);for(var n=0;n<r;n+=4){var a=n/4;i[a]=o.unpack(e,n,i[a])}return i},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,i){return i.x=Math.min(e.x,t.x),i.y=Math.min(e.y,t.y),i.z=Math.min(e.z,t.z),i.w=Math.min(e.w,t.w),i},o.maximumByComponent=function(e,t,i){return i.x=Math.max(e.x,t.x),i.y=Math.max(e.y,t.y),i.z=Math.max(e.z,t.z),i.w=Math.max(e.w,t.w),i},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var a=new o;o.distance=function(e,t){return o.subtract(e,t,a),o.magnitude(a)},o.distanceSquared=function(e,t){return o.subtract(e,t,a),o.magnitudeSquared(a)},o.normalize=function(e,t){var i=o.magnitude(e);return t.x=e.x/i,t.y=e.y/i,t.z=e.z/i,t.w=e.w/i,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,i){return i.x=e.x*t.x,i.y=e.y*t.y,i.z=e.z*t.z,i.w=e.w*t.w,i},o.divideComponents=function(e,t,i){return i.x=e.x/t.x,i.y=e.y/t.y,i.z=e.z/t.z,i.w=e.w/t.w,i},o.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},o.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},o.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},o.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,i,r){return o.multiplyByScalar(t,i,s),r=o.multiplyByScalar(e,1-i,r),o.add(s,r,r)};var l=new o;return o.mostOrthogonalAxis=function(e,t){var i=o.normalize(e,l);return o.abs(i,i),t=i.x<=i.y?i.x<=i.z?i.x<=i.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):i.z<=i.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):i.y<=i.z?i.y<=i.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):i.z<=i.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,i){return e===i||t(e)&&t(i)&&e.x===i.x&&e.y===i.y&&e.z===i.z&&e.w===i.w},o.equalsArray=function(e,t,i){return e.x===t[i]&&e.y===t[i+1]&&e.z===t[i+2]&&e.w===t[i+3]},o.equalsEpsilon=function(e,i,r,o){return e===i||t(e)&&t(i)&&n.equalsEpsilon(e.x,i.x,r,o)&&n.equalsEpsilon(e.y,i.y,r,o)&&n.equalsEpsilon(e.z,i.z,r,o)&&n.equalsEpsilon(e.w,i.w,r,o)},o.ZERO=r(new o(0,0,0,0)),o.UNIT_X=r(new o(1,0,0,0)),o.UNIT_Y=r(new o(0,1,0,0)),o.UNIT_Z=r(new o(0,0,1,0)),o.UNIT_W=r(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,i){return o.equalsEpsilon(this,e,t,i)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),i("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),i("Core/Matrix4",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,r,n,o,a,s,l,u,c,h,d,p,m,f,_){this[0]=i(e,0),this[1]=i(o,0),this[2]=i(u,0),this[3]=i(p,0),this[4]=i(t,0),this[5]=i(a,0),this[6]=i(c,0),this[7]=i(m,0),this[8]=i(r,0),this[9]=i(s,0),this[10]=i(h,0),this[11]=i(f,0),this[12]=i(n,0),this[13]=i(l,0),this[14]=i(d,0),this[15]=i(_,0)}c.packedLength=16,c.pack=function(e,t,r){return r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},c.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(r(e))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.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(t,n,o){return n=i(n,e.ZERO),r(o)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=0,o[4]=t[3],o[5]=t[4],o[6]=t[5],o[7]=0,o[8]=t[6],o[9]=t[7],o[10]=t[8],o[11]=0,o[12]=n.x,o[13]=n.y,o[14]=n.z,o[15]=1,o):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,i,n){r(n)||(n=new c);var o=i.x,a=i.y,s=i.z,l=t.x*t.x,u=t.x*t.y,h=t.x*t.z,d=t.x*t.w,p=t.y*t.y,m=t.y*t.z,f=t.y*t.w,_=t.z*t.z,g=t.z*t.w,v=t.w*t.w,y=l-p-_+v,C=2*(u-g),w=2*(h+f),S=2*(u+g),E=-l+p-_+v,b=2*(m-d),T=2*(h-f),x=2*(m+d),A=-l-p+_+v;return n[0]=y*o,n[1]=S*o,n[2]=T*o,n[3]=0,n[4]=C*a,n[5]=E*a,n[6]=x*a,n[7]=0,n[8]=w*s,n[9]=b*s,n[10]=A*s,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(l.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 h=new e,d=new e,p=new e;c.fromCamera=function(t,i){var n=t.position,o=t.direction,a=t.up;e.normalize(o,h),e.normalize(e.cross(h,a,d),d),e.normalize(e.cross(d,h,p),p);var s=d.x,l=d.y,u=d.z,m=h.x,f=h.y,_=h.z,g=p.x,v=p.y,y=p.z,C=n.x,w=n.y,S=n.z,E=s*-C+l*-w+u*-S,b=g*-C+v*-w+y*-S,T=m*C+f*w+_*S;return r(i)?(i[0]=s,i[1]=g,i[2]=-m,i[3]=0,i[4]=l,i[5]=v,i[6]=-f,i[7]=0,i[8]=u,i[9]=y,i[10]=-_,i[11]=0,i[12]=E,i[13]=b,i[14]=T,i[15]=1,i):new c(s,l,u,E,g,v,y,b,-m,-f,-_,T,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,i,r,n){var o=Math.tan(.5*e),a=1/o,s=a/t,l=(r+i)/(i-r),u=2*r*i/(i-r);return n[0]=s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=l,n[11]=-1,n[12]=0,n[13]=0,n[14]=u,n[15]=0,n},c.computeOrthographicOffCenter=function(e,t,i,r,n,o,a){var s=1/(t-e),l=1/(r-i),u=1/(o-n),c=-(t+e)*s,h=-(r+i)*l,d=-(o+n)*u;return s*=2,l*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=c,a[13]=h,a[14]=d,a[15]=1,a},c.computePerspectiveOffCenter=function(e,t,i,r,n,o,a){var s=2*n/(t-e),l=2*n/(r-i),u=(t+e)/(t-e),c=(r+i)/(r-i),h=-(o+n)/(o-n),d=-1,p=-2*o*n/(o-n);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=u,a[9]=c,a[10]=h,a[11]=d,a[12]=0,a[13]=0,a[14]=p,a[15]=0,a},c.computeInfinitePerspectiveOffCenter=function(e,t,i,r,n,o){var a=2*n/(t-e),s=2*n/(r-i),l=(t+e)/(t-e),u=(r+i)/(r-i),c=-1,h=-1,d=-2*n;return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=l,o[9]=u,o[10]=c,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},c.computeViewportTransformation=function(e,t,r,n){e=i(e,i.EMPTY_OBJECT);var o=i(e.x,0),a=i(e.y,0),s=i(e.width,0),l=i(e.height,0);t=i(t,0),r=i(r,1);var u=.5*s,c=.5*l,h=.5*(r-t),d=u,p=c,m=h,f=o+u,_=a+c,g=t+h,v=1;return n[0]=d,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=p,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=m,n[11]=0,n[12]=f,n[13]=_,n[14]=g,n[15]=v,n},c.computeView=function(t,i,r,n,o){return o[0]=n.x,o[1]=r.x,o[2]=-i.x,o[3]=0,o[4]=n.y,o[5]=r.y,o[6]=-i.y,o[7]=0,o[8]=n.z,o[9]=r.z,o[10]=-i.z,o[11]=0,o[12]=-e.dot(n,t),o[13]=-e.dot(r,t),o[14]=e.dot(i,t),o[15]=1,o},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,t,i){var r=4*t,n=e[r],o=e[r+1],a=e[r+2],s=e[r+3];return i.x=n,i.y=o,i.z=a,i.w=s,i},c.setColumn=function(e,t,i,r){r=c.clone(e,r);var n=4*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r[n+3]=i.w,r},c.setTranslation=function(e,t,i){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=e[15],i},c.getRow=function(e,t,i){var r=e[t],n=e[t+4],o=e[t+8],a=e[t+12];return i.x=r,i.y=n,i.z=o,i.w=a,i},c.setRow=function(e,t,i,r){return r=c.clone(e,r),r[t]=i.x,r[t+4]=i.y,r[t+8]=i.z,r[t+12]=i.w,r};var m=new e;c.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],m)),i.y=e.magnitude(e.fromElements(t[4],t[5],t[6],m)),i.z=e.magnitude(e.fromElements(t[8],t[9],t[10],m)),i};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],p=e[10],m=e[11],f=e[12],_=e[13],g=e[14],v=e[15],y=t[0],C=t[1],w=t[2],S=t[3],E=t[4],b=t[5],T=t[6],x=t[7],A=t[8],P=t[9],D=t[10],M=t[11],I=t[12],R=t[13],O=t[14],N=t[15],L=r*y+s*C+h*w+f*S,B=n*y+l*C+d*w+_*S,F=o*y+u*C+p*w+g*S,V=a*y+c*C+m*w+v*S,k=r*E+s*b+h*T+f*x,z=n*E+l*b+d*T+_*x,U=o*E+u*b+p*T+g*x,G=a*E+c*b+m*T+v*x,W=r*A+s*P+h*D+f*M,H=n*A+l*P+d*D+_*M,q=o*A+u*P+p*D+g*M,j=a*A+c*P+m*D+v*M,Y=r*I+s*R+h*O+f*N,X=n*I+l*R+d*O+_*N,Z=o*I+u*R+p*O+g*N,K=a*I+c*R+m*O+v*N;return i[0]=L,i[1]=B,i[2]=F,i[3]=V,i[4]=k,i[5]=z,i[6]=U,i[7]=G,i[8]=W,i[9]=H,i[10]=q,i[11]=j,i[12]=Y,i[13]=X,i[14]=Z,i[15]=K,i},c.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i[9]=e[9]+t[9],i[10]=e[10]+t[10],i[11]=e[11]+t[11],i[12]=e[12]+t[12],i[13]=e[13]+t[13],i[14]=e[14]+t[14],i[15]=e[15]+t[15],i},c.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i[9]=e[9]-t[9],i[10]=e[10]-t[10],i[11]=e[11]-t[11],i[12]=e[12]-t[12],i[13]=e[13]-t[13],i[14]=e[14]-t[14],i[15]=e[15]-t[15],i},c.multiplyTransformation=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=e[12],p=e[13],m=e[14],f=t[0],_=t[1],g=t[2],v=t[4],y=t[5],C=t[6],w=t[8],S=t[9],E=t[10],b=t[12],T=t[13],x=t[14],A=r*f+a*_+u*g,P=n*f+s*_+c*g,D=o*f+l*_+h*g,M=r*v+a*y+u*C,I=n*v+s*y+c*C,R=o*v+l*y+h*C,O=r*w+a*S+u*E,N=n*w+s*S+c*E,L=o*w+l*S+h*E,B=r*b+a*T+u*x+d,F=n*b+s*T+c*x+p,V=o*b+l*T+h*x+m;return i[0]=A,i[1]=P,i[2]=D,i[3]=0,i[4]=M,i[5]=I,i[6]=R,i[7]=0,i[8]=O,i[9]=N,i[10]=L,i[11]=0,i[12]=B,i[13]=F,i[14]=V,i[15]=1,i},c.multiplyByMatrix3=function(e,t,i){var r=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=t[0],p=t[1],m=t[2],f=t[3],_=t[4],g=t[5],v=t[6],y=t[7],C=t[8],w=r*d+a*p+u*m,S=n*d+s*p+c*m,E=o*d+l*p+h*m,b=r*f+a*_+u*g,T=n*f+s*_+c*g,x=o*f+l*_+h*g,A=r*v+a*y+u*C,P=n*v+s*y+c*C,D=o*v+l*y+h*C;return i[0]=w,i[1]=S,i[2]=E,i[3]=0,i[4]=b,i[5]=T,i[6]=x,i[7]=0,i[8]=A,i[9]=P,i[10]=D,i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.multiplyByTranslation=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=r*e[0]+n*e[4]+o*e[8]+e[12],s=r*e[1]+n*e[5]+o*e[9]+e[13],l=r*e[2]+n*e[6]+o*e[10]+e[14];return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=a,i[13]=s,i[14]=l,i[15]=e[15],i};var _=new e;c.multiplyByUniformScale=function(e,t,i){return _.x=t,_.y=t,_.z=t,c.multiplyByScale(e,_,i)},c.multiplyByScale=function(e,t,i){var r=t.x,n=t.y,o=t.z;return 1===r&&1===n&&1===o?c.clone(e,i):(i[0]=r*e[0],i[1]=r*e[1],i[2]=r*e[2],i[3]=0,i[4]=n*e[4],i[5]=n*e[5],i[6]=n*e[6],i[7]=0,i[8]=o*e[8],i[9]=o*e[9],i[10]=o*e[10],i[11]=0,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=1,i)},c.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=t.w,s=e[0]*r+e[4]*n+e[8]*o+e[12]*a,l=e[1]*r+e[5]*n+e[9]*o+e[13]*a,u=e[2]*r+e[6]*n+e[10]*o+e[14]*a,c=e[3]*r+e[7]*n+e[11]*o+e[15]*a;return i.x=s,i.y=l,i.z=u,i.w=c,i},c.multiplyByPointAsVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o,s=e[1]*r+e[5]*n+e[9]*o,l=e[2]*r+e[6]*n+e[10]*o;return i.x=a,i.y=s,i.z=l,i},c.multiplyByPoint=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[4]*n+e[8]*o+e[12],s=e[1]*r+e[5]*n+e[9]*o+e[13],l=e[2]*r+e[6]*n+e[10]*o+e[14];return i.x=a,i.y=s,i.z=l,i},c.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i[9]=e[9]*t,i[10]=e[10]*t,i[11]=e[11]*t,i[12]=e[12]*t,i[13]=e[13]*t,i[14]=e[14]*t,i[15]=e[15]*t,i},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var i=e[1],r=e[2],n=e[3],o=e[6],a=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=n,t[13]=a,t[14]=s,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i&&Math.abs(e[9]-t[9])<=i&&Math.abs(e[10]-t[10])<=i&&Math.abs(e[11]-t[11])<=i&&Math.abs(e[12]-t[12])<=i&&Math.abs(e[13]-t[13])<=i&&Math.abs(e[14]-t[14])<=i&&Math.abs(e[15]-t[15])<=i},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var g=new l,v=new l,y=new t,C=new t(0,0,0,1);return c.inverse=function(e,i){if(l.equalsEpsilon(c.getRotation(e,g),v,s.EPSILON7)&&t.equals(c.getRow(e,3,y),C))return i[0]=0,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=0,
i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=0,i[11]=0,i[12]=-e[12],i[13]=-e[13],i[14]=-e[14],i[15]=1,i;var r=e[0],n=e[4],o=e[8],a=e[12],h=e[1],d=e[5],p=e[9],m=e[13],f=e[2],_=e[6],w=e[10],S=e[14],E=e[3],b=e[7],T=e[11],x=e[15],A=w*x,P=S*T,D=_*x,M=S*b,I=_*T,R=w*b,O=f*x,N=S*E,L=f*T,B=w*E,F=f*b,V=_*E,k=A*d+M*p+I*m-(P*d+D*p+R*m),z=P*h+O*p+B*m-(A*h+N*p+L*m),U=D*h+N*d+F*m-(M*h+O*d+V*m),G=R*h+L*d+V*p-(I*h+B*d+F*p),W=P*n+D*o+R*a-(A*n+M*o+I*a),H=A*r+N*o+L*a-(P*r+O*o+B*a),q=M*r+O*n+V*a-(D*r+N*n+F*a),j=I*r+B*n+F*o-(R*r+L*n+V*o);A=o*m,P=a*p,D=n*m,M=a*d,I=n*p,R=o*d,O=r*m,N=a*h,L=r*p,B=o*h,F=r*d,V=n*h;var Y=A*b+M*T+I*x-(P*b+D*T+R*x),X=P*E+O*T+B*x-(A*E+N*T+L*x),Z=D*E+N*b+F*x-(M*E+O*b+V*x),K=R*E+L*b+V*T-(I*E+B*b+F*T),Q=D*w+R*S+P*_-(I*S+A*_+M*w),J=L*S+A*f+N*w-(O*w+B*S+P*f),$=O*_+V*S+M*f-(F*S+D*f+N*_),ee=F*w+I*f+B*_-(L*_+V*w+R*f),te=r*k+n*z+o*U+a*G;if(Math.abs(te)<s.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return te=1/te,i[0]=k*te,i[1]=z*te,i[2]=U*te,i[3]=G*te,i[4]=W*te,i[5]=H*te,i[6]=q*te,i[7]=j*te,i[8]=Y*te,i[9]=X*te,i[10]=Z*te,i[11]=K*te,i[12]=Q*te,i[13]=J*te,i[14]=$*te,i[15]=ee*te,i},c.inverseTransformation=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[4],a=e[5],s=e[6],l=e[8],u=e[9],c=e[10],h=e[12],d=e[13],p=e[14],m=-i*h-r*d-n*p,f=-o*h-a*d-s*p,_=-l*h-u*d-c*p;return t[0]=i,t[1]=o,t[2]=l,t[3]=0,t[4]=r,t[5]=a,t[6]=u,t[7]=0,t[8]=n,t[9]=s,t[10]=c,t[11]=0,t[12]=m,t[13]=f,t[14]=_,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=a(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,n(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]&&e[9]===t[i+9]&&e[10]===t[i+10]&&e[11]===t[i+11]&&e[12]===t[i+12]&&e[13]===t[i+13]&&e[14]===t[i+14]&&e[15]===t[i+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),i("Core/BoundingSphere",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t,r){this.center=e.clone(i(t,e.ZERO)),this.radius=i(r,0)}var p=new e,m=new e,f=new e,_=new e,g=new e,v=new e,y=new e,C=new e,w=new e,S=new e,E=new e,b=new e;d.fromPoints=function(t,i){if(r(i)||(i=new d),!r(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;for(var n=e.clone(t[0],y),o=e.clone(n,p),a=e.clone(n,m),s=e.clone(n,f),l=e.clone(n,_),u=e.clone(n,g),c=e.clone(n,v),h=t.length,T=1;T<h;T++){e.clone(t[T],n);var x=n.x,A=n.y,P=n.z;x<o.x&&e.clone(n,o),x>l.x&&e.clone(n,l),A<a.y&&e.clone(n,a),A>u.y&&e.clone(n,u),P<s.z&&e.clone(n,s),P>c.z&&e.clone(n,c)}var D=e.magnitudeSquared(e.subtract(l,o,C)),M=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=o,O=l,N=D;M>N&&(N=M,R=a,O=u),I>N&&(N=I,R=s,O=c);var L=w;L.x=.5*(R.x+O.x),L.y=.5*(R.y+O.y),L.z=.5*(R.z+O.z);var B=e.magnitudeSquared(e.subtract(O,L,C)),F=Math.sqrt(B),V=S;V.x=o.x,V.y=a.y,V.z=s.z;var k=E;k.x=l.x,k.y=u.y,k.z=c.z;var z=e.multiplyByScalar(e.add(V,k,C),.5,b),U=0;for(T=0;T<h;T++){e.clone(t[T],n);var G=e.magnitude(e.subtract(n,z,C));G>U&&(U=G);var W=e.magnitudeSquared(e.subtract(n,L,C));if(W>B){var H=Math.sqrt(W);F=.5*(F+H),B=F*F;var q=H-F;L.x=(F*L.x+q*n.x)/H,L.y=(F*L.y+q*n.y)/H,L.z=(F*L.z+q*n.z)/H}}return F<U?(e.clone(L,i.center),i.radius=F):(e.clone(z,i.center),i.radius=U),i};var T=new a,x=new e,A=new e,P=new t,D=new t;d.fromRectangle2D=function(e,t,i){return d.fromRectangleWithHeights2D(e,t,0,0,i)},d.fromRectangleWithHeights2D=function(t,n,o,a,s){if(r(s)||(s=new d),!r(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;n=i(n,T),h.southwest(t,P),P.height=o,h.northeast(t,D),D.height=a;var l=n.project(P,x),u=n.project(D,A),c=u.x-l.x,p=u.y-l.y,m=u.z-l.z;s.radius=.5*Math.sqrt(c*c+p*p+m*m);var f=s.center;return f.x=l.x+.5*c,f.y=l.y+.5*p,f.z=l.z+.5*m,s};var M=[];d.fromRectangle3D=function(e,t,n,a){t=i(t,o.WGS84),n=i(n,0);var s;return r(e)&&(s=h.subsample(e,t,n,M)),d.fromPoints(s,a)},d.fromVertices=function(t,n,o,a){if(r(a)||(a=new d),!r(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;n=i(n,e.ZERO),o=i(o,3);var s=y;s.x=t[0]+n.x,s.y=t[1]+n.y,s.z=t[2]+n.z;for(var l=e.clone(s,p),u=e.clone(s,m),c=e.clone(s,f),h=e.clone(s,_),T=e.clone(s,g),x=e.clone(s,v),A=t.length,P=0;P<A;P+=o){var D=t[P]+n.x,M=t[P+1]+n.y,I=t[P+2]+n.z;s.x=D,s.y=M,s.z=I,D<l.x&&e.clone(s,l),D>h.x&&e.clone(s,h),M<u.y&&e.clone(s,u),M>T.y&&e.clone(s,T),I<c.z&&e.clone(s,c),I>x.z&&e.clone(s,x)}var R=e.magnitudeSquared(e.subtract(h,l,C)),O=e.magnitudeSquared(e.subtract(T,u,C)),N=e.magnitudeSquared(e.subtract(x,c,C)),L=l,B=h,F=R;O>F&&(F=O,L=u,B=T),N>F&&(F=N,L=c,B=x);var V=w;V.x=.5*(L.x+B.x),V.y=.5*(L.y+B.y),V.z=.5*(L.z+B.z);var k=e.magnitudeSquared(e.subtract(B,V,C)),z=Math.sqrt(k),U=S;U.x=l.x,U.y=u.y,U.z=c.z;var G=E;G.x=h.x,G.y=T.y,G.z=x.z;var W=e.multiplyByScalar(e.add(U,G,C),.5,b),H=0;for(P=0;P<A;P+=o){s.x=t[P]+n.x,s.y=t[P+1]+n.y,s.z=t[P+2]+n.z;var q=e.magnitude(e.subtract(s,W,C));q>H&&(H=q);var j=e.magnitudeSquared(e.subtract(s,V,C));if(j>k){var Y=Math.sqrt(j);z=.5*(z+Y),k=z*z;var X=Y-z;V.x=(z*V.x+X*s.x)/Y,V.y=(z*V.y+X*s.y)/Y,V.z=(z*V.z+X*s.z)/Y}}return z<H?(e.clone(V,a.center),a.radius=z):(e.clone(W,a.center),a.radius=H),a},d.fromEncodedCartesianVertices=function(t,i,n){if(r(n)||(n=new d),!r(t)||!r(i)||t.length!==i.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var o=y;o.x=t[0]+i[0],o.y=t[1]+i[1],o.z=t[2]+i[2];for(var a=e.clone(o,p),s=e.clone(o,m),l=e.clone(o,f),u=e.clone(o,_),c=e.clone(o,g),h=e.clone(o,v),T=t.length,x=0;x<T;x+=3){var A=t[x]+i[x],P=t[x+1]+i[x+1],D=t[x+2]+i[x+2];o.x=A,o.y=P,o.z=D,A<a.x&&e.clone(o,a),A>u.x&&e.clone(o,u),P<s.y&&e.clone(o,s),P>c.y&&e.clone(o,c),D<l.z&&e.clone(o,l),D>h.z&&e.clone(o,h)}var M=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=e.magnitudeSquared(e.subtract(h,l,C)),O=a,N=u,L=M;I>L&&(L=I,O=s,N=c),R>L&&(L=R,O=l,N=h);var B=w;B.x=.5*(O.x+N.x),B.y=.5*(O.y+N.y),B.z=.5*(O.z+N.z);var F=e.magnitudeSquared(e.subtract(N,B,C)),V=Math.sqrt(F),k=S;k.x=a.x,k.y=s.y,k.z=l.z;var z=E;z.x=u.x,z.y=c.y,z.z=h.z;var U=e.multiplyByScalar(e.add(k,z,C),.5,b),G=0;for(x=0;x<T;x+=3){o.x=t[x]+i[x],o.y=t[x+1]+i[x+1],o.z=t[x+2]+i[x+2];var W=e.magnitude(e.subtract(o,U,C));W>G&&(G=W);var H=e.magnitudeSquared(e.subtract(o,B,C));if(H>F){var q=Math.sqrt(H);V=.5*(V+q),F=V*V;var j=q-V;B.x=(V*B.x+j*o.x)/q,B.y=(V*B.y+j*o.y)/q,B.z=(V*B.z+j*o.z)/q}}return V<G?(e.clone(B,n.center),n.radius=V):(e.clone(U,n.center),n.radius=G),n},d.fromCornerPoints=function(t,i,n){r(n)||(n=new d);var o=n.center;return e.add(t,i,o),e.multiplyByScalar(o,.5,o),n.radius=e.distance(o,i),n},d.fromEllipsoid=function(t,i){return r(i)||(i=new d),e.clone(e.ZERO,i.center),i.radius=t.maximumRadius,i};var I=new e;d.fromBoundingSpheres=function(t,i){if(r(i)||(i=new d),!r(t)||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var n=t.length;if(1===n)return d.clone(t[0],i);if(2===n)return d.union(t[0],t[1],i);for(var o=[],a=0;a<n;a++)o.push(t[a].center);i=d.fromPoints(o,i);var s=i.center,l=i.radius;for(a=0;a<n;a++){var u=t[a];l=Math.max(l,e.distance(s,u.center,I)+u.radius)}return i.radius=l,i};var R=new e,O=new e,N=new e;d.fromOrientedBoundingBox=function(t,i){r(i)||(i=new d);var n=t.halfAxes,o=u.getColumn(n,0,R),a=u.getColumn(n,1,O),s=u.getColumn(n,2,N),l=e.magnitude(o),c=e.magnitude(a),h=e.magnitude(s);return i.center=e.clone(t.center,i.center),i.radius=Math.max(l,c,h),i},d.clone=function(t,i){if(r(t))return r(i)?(i.center=e.clone(t.center,i.center),i.radius=t.radius,i):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,r){r=i(r,0);var n=e.center;return t[r++]=n.x,t[r++]=n.y,t[r++]=n.z,t[r]=e.radius,t},d.unpack=function(e,t,n){t=i(t,0),r(n)||(n=new d);var o=n.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],n.radius=e[t],n};var L=new e,B=new e;d.union=function(t,i,n){r(n)||(n=new d);var o=t.center,a=t.radius,s=i.center,l=i.radius,u=e.subtract(s,o,L),c=e.magnitude(u);if(a>=c+l)return t.clone(n),n;if(l>=c+a)return i.clone(n),n;var h=.5*(a+c+l),p=e.multiplyByScalar(u,(-a+h)/c,B);return e.add(p,o,p),e.clone(p,n.center),n.radius=h,n};var F=new e;d.expand=function(t,i,r){r=d.clone(t,r);var n=e.magnitude(e.subtract(i,r.center,F));return n>r.radius&&(r.radius=n),r},d.intersectPlane=function(t,i){var r=t.center,n=t.radius,o=i.normal,a=e.dot(o,r)+i.distance;return a<-n?s.OUTSIDE:a<n?s.INTERSECTING:s.INSIDE},d.transform=function(e,t,i){return r(i)||(i=new d),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=c.getMaximumScale(t)*e.radius,i};var V=new e;d.distanceSquaredTo=function(t,i){var r=e.subtract(t.center,i,V);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,i){return r(i)||(i=new d),i.center=c.multiplyByPoint(t,e.center,i.center),i.radius=e.radius,i};var k=new e;d.computePlaneDistances=function(t,i,n,o){r(o)||(o=new l);var a=e.subtract(t.center,i,k),s=e.dot(n,a);return o.start=s-t.radius,o.stop=s+t.radius,o};for(var z=new e,U=new e,G=new e,W=new e,H=new e,q=new t,j=new Array(8),Y=0;Y<8;++Y)j[Y]=new e;var X=new a;return d.projectTo2D=function(t,r,n){r=i(r,X);var o=r.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,z),u=e.cross(e.UNIT_Z,l,U);e.normalize(u,u);var c=e.cross(l,u,G);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var h=e.negate(c,H),p=e.negate(u,W),m=j,f=m[0];e.add(l,c,f),e.add(f,u,f),f=m[1],e.add(l,c,f),e.add(f,p,f),f=m[2],e.add(l,h,f),e.add(f,p,f),f=m[3],e.add(l,h,f),e.add(f,u,f),e.negate(l,l),f=m[4],e.add(l,c,f),e.add(f,u,f),f=m[5],e.add(l,c,f),e.add(f,p,f),f=m[6],e.add(l,h,f),e.add(f,p,f),f=m[7],e.add(l,h,f),e.add(f,u,f);for(var _=m.length,g=0;g<_;++g){var v=m[g];e.add(a,v,v);var y=o.cartesianToCartographic(v,q);r.project(y,v)}n=d.fromPoints(m,n),a=n.center;var C=a.x,w=a.y,S=a.z;return a.x=S,a.y=C,a.z=w,n},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,i){return t===i||r(t)&&r(i)&&e.equals(t.center,i.center)&&t.radius===i.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,i){return d.computePlaneDistances(this,e,t,i)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),i("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,i,r,n,o,a){"use strict";function s(e,i){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(i)&&(this.cameraPosition=i)}function l(e,i,r){var n=e.transformPositionToScaledSpace(i,m),o=t.magnitudeSquared(n),a=Math.sqrt(o),s=t.divideByScalar(n,a,f);o=Math.max(1,o),a=Math.max(1,a);var l=t.dot(s,r),u=t.magnitude(t.cross(s,r,s)),c=1/a,h=Math.sqrt(o-1)*c;return 1/(l*c-u*h)}function u(e,i,r){if(!(i<=0||i===1/0||i!==i))return t.multiplyByScalar(e,i,r)}function c(e,i){return t.equals(i,t.ZERO)?i:(e.transformPositionToScaledSpace(i,_),t.normalize(_,_))}n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var i=this._ellipsoid,r=i.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=n}}});var h=new t;s.prototype.isPointVisible=function(e){var t=this._ellipsoid,i=t.transformPositionToScaledSpace(e,h);return this.isScaledSpacePointVisible(i)},s.prototype.isScaledSpacePointVisible=function(e){var i=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,n=t.subtract(e,i,h),o=-t.dot(n,i),a=r<0?o>0:o>r&&o*o/t.magnitudeSquared(n)>r;return!a},s.prototype.computeHorizonCullingPoint=function(e,i,n){r(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,h=0,d=i.length;h<d;++h){var p=i[h],m=l(o,p,a);s=Math.max(s,m)}return u(a,s,n)};var d=new t;s.prototype.computeHorizonCullingPointFromVertices=function(e,n,o,a,s){r(s)||(s=new t),a=i(a,t.ZERO);for(var h=this._ellipsoid,p=c(h,e),m=0,f=0,_=n.length;f<_;f+=o){d.x=n[f]+a.x,d.y=n[f+1]+a.y,d.z=n[f+2]+a.z;var g=l(h,d,p);m=Math.max(m,g)}return u(p,m,s)};var p=[];s.prototype.computeHorizonCullingPointFromRectangle=function(i,r,n){var o=a.subsample(i,r,0,p),s=e.fromPoints(o);if(!(t.magnitude(s.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(s.center,o,n)};var m=new t,f=new t,_=new t;return s}),i("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function i(e,i,r){var n=e+i;return t.sign(e)!==t.sign(i)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(i)))<r?0:n}var r={};return r.computeDiscriminant=function(e,t,i){var r=t*t-4*e*i;return r},r.computeRealRoots=function(e,r,n){var o;if(0===e)return 0===r?[]:[-n/r];if(0===r){if(0===n)return[0,0];var a=Math.abs(n),s=Math.abs(e);if(a<s&&a/s<t.EPSILON14)return[0,0];if(a>s&&s/a<t.EPSILON14)return[];if(o=-n/e,o<0)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-r/e,o<0?[o,0]:[0,o];var u=r*r,c=4*e*n,h=i(u,-c,t.EPSILON14);if(h<0)return[];var d=-.5*i(r,t.sign(r)*Math.sqrt(h),t.EPSILON14);return r>0?[d/e,n/d]:[n/d,d/e]},r}),i("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function i(e,t,i,r){var n,o,a=e,s=t/3,l=i/3,u=r,c=a*l,h=s*u,d=s*s,p=l*l,m=a*l-d,f=a*u-s*l,_=s*u-p,g=4*m*_-f*f;if(g<0){var v,y,C;d*h>=c*p?(v=a,y=m,C=-2*s*m+a*f):(v=u,y=_,C=-u*f+2*l*_);var w=C<0?-1:1,S=-w*Math.abs(v)*Math.sqrt(-g);o=-C+S;var E=o/2,b=E<0?-Math.pow(-E,1/3):Math.pow(E,1/3),T=o===S?-b:-y/b;return n=y<=0?b+T:-C/(b*b+T*T+y),d*h>=c*p?[(n-s)/a]:[-u/(n+l)]}var x=m,A=-2*s*m+a*f,P=_,D=-u*f+2*l*_,M=Math.sqrt(g),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(a*M,-A)/3);n=2*Math.sqrt(-x);var O=Math.cos(R);o=n*O;var N=n*(-O/2-I*Math.sin(R)),L=o+N>2*s?o-s:N-s,B=a,F=L/B;R=Math.abs(Math.atan2(u*M,-D)/3),n=2*Math.sqrt(-P),O=Math.cos(R),o=n*O,N=n*(-O/2-I*Math.sin(R));var V=-u,k=o+N<2*l?o+l:N+l,z=V/k,U=B*k,G=-L*k-B*V,W=L*V,H=(l*G-s*W)/(-s*G+l*U);return F<=H?F<=z?H<=z?[F,H,z]:[F,z,H]:[z,F,H]:F<=z?[H,F,z]:H<=z?[H,z,F]:[z,H,F]}var r={};return r.computeDiscriminant=function(e,t,i,r){var n=e*e,o=t*t,a=i*i,s=r*r,l=18*e*t*i*r+o*a-27*n*s-4*(e*a*i+o*t*r);return l},r.computeRealRoots=function(e,r,n,o){var a,s;if(0===e)return t.computeRealRoots(r,n,o);if(0===r){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.computeRealRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):i(e,0,n,o)}return 0===n?0===o?(s=-r/e,s<0?[s,0,0]:[0,0,s]):i(e,r,0,o):0===o?(a=t.computeRealRoots(e,r,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):i(e,r,n,o)},r}),i("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,i,r){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,h=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(h.length>0){var d=-t/4,p=h[h.length-1];if(Math.abs(p)<i.EPSILON14){var m=r.computeRealRoots(1,l,c);if(2===m.length){var f,_=m[0],g=m[1];if(_>=0&&g>=0){var v=Math.sqrt(_),y=Math.sqrt(g);return[d-y,d-v,d+v,d+y]}if(_>=0&&g<0)return f=Math.sqrt(_),[d-f,d+f];if(_<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}return[]}if(p>0){var C=Math.sqrt(p),w=(l+p-u/C)/2,S=(l+p+u/C)/2,E=r.computeRealRoots(1,C,w),b=r.computeRealRoots(1,-C,S);return 0!==E.length?(E[0]+=d,E[1]+=d,0!==b.length?(b[0]+=d,b[1]+=d,E[1]<=b[0]?[E[0],E[1],b[0],b[1]]:b[1]<=E[0]?[b[0],b[1],E[0],E[1]]:E[0]>=b[0]&&E[1]<=b[1]?[b[0],E[0],E[1],b[1]]:b[0]>=E[0]&&b[1]<=E[1]?[E[0],b[0],b[1],E[1]]:E[0]>b[0]&&E[0]<b[1]?[b[0],E[0],b[1],E[1]]:[E[0],b[0],E[1],b[1]]):E):0!==b.length?(b[0]+=d,b[1]+=d,b):[]}}return[]}function o(t,n,o,a){var s=o*o,l=n*n,u=t*t,c=-2*n,h=o*t+l-4*a,d=u*a-o*n*t+s,p=e.computeRealRoots(1,c,h,d);if(p.length>0){var m,f,_=p[0],g=n-_,v=g*g,y=t/2,C=g/2,w=v-4*a,S=v+4*Math.abs(a),E=u-4*_,b=u+4*Math.abs(_);if(_<0||w*b<E*S){var T=Math.sqrt(E);m=T/2,f=0===T?0:(t*C-o)/T}else{var x=Math.sqrt(w);m=0===x?0:(t*C-o)/x,f=x/2}var A,P;0===y&&0===m?(A=0,P=0):i.sign(y)===i.sign(m)?(A=y+m,P=_/A):(P=y-m,A=_/P);var D,M;0===C&&0===f?(D=0,M=0):i.sign(C)===i.sign(f)?(D=C+f,M=a/D):(M=C-f,D=a/M);var I=r.computeRealRoots(1,A,D),R=r.computeRealRoots(1,P,M);if(0!==I.length)return 0!==R.length?I[1]<=R[0]?[I[0],I[1],R[0],R[1]]:R[1]<=I[0]?[R[0],R[1],I[0],I[1]]:I[0]>=R[0]&&I[1]<=R[1]?[R[0],I[0],I[1],R[1]]:R[0]>=I[0]&&R[1]<=I[1]?[I[0],R[0],R[1],I[1]]:I[0]>R[0]&&I[0]<R[1]?[R[0],I[0],R[1],I[1]]:[I[0],R[0],I[1],R[1]]:I;if(0!==R.length)return R}return[]}var a={};return a.computeDiscriminant=function(e,t,i,r,n){var o=e*e,a=o*e,s=t*t,l=s*t,u=i*i,c=u*i,h=r*r,d=h*r,p=n*n,m=p*n,f=s*u*h-4*l*d-4*e*c*h+18*e*t*i*d-27*o*h*h+256*a*m+n*(18*l*i*r-4*s*c+16*e*u*u-80*e*t*u*r-6*e*s*h+144*o*i*h)+p*(144*e*s*i-27*s*s-128*o*u-192*o*t*r);return f},a.computeRealRoots=function(t,r,a,s,l){if(Math.abs(t)<i.EPSILON15)return e.computeRealRoots(r,a,s,l);var u=r/t,c=a/t,h=s/t,d=l/t,p=u<0?1:0;switch(p+=c<0?p+1:p,p+=h<0?p+1:p,p+=d<0?p+1:p){case 0:return n(u,c,h,d);case 1:return o(u,c,h,d);case 2:return o(u,c,h,d);case 3:return n(u,c,h,d);case 4:return n(u,c,h,d);case 5:return o(u,c,h,d);case 6:return n(u,c,h,d);case 7:return n(u,c,h,d);case 8:return o(u,c,h,d);case 9:return n(u,c,h,d);case 10:return n(u,c,h,d);case 11:return o(u,c,h,d);case 12:return n(u,c,h,d);case 13:return n(u,c,h,d);case 14:return n(u,c,h,d);case 15:return n(u,c,h,d);default:return}},a}),i("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(i,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(i,e.ZERO)),this.direction=r}return n.getPoint=function(t,r,n){return i(n)||(n=new e),n=e.multiplyByScalar(t.direction,r,n),e.add(t.origin,n,n)},n}),i("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i,r){var n=t*t-4*e*i;if(!(n<0)){if(n>0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s<l?(r.root0=s,r.root1=l):(r.root0=l,r.root1=s),r}var u=-t/(2*e);if(0!==u)return r.root0=r.root1=u,r}}function h(t,i,n){r(n)||(n={});var o=t.origin,a=t.direction,s=i.center,l=i.radius*i.radius,u=e.subtract(o,s,g),h=e.dot(a,a),d=2*e.dot(a,u),p=e.magnitudeSquared(u)-l,m=c(h,d,p,w);if(r(m))return n.start=m.root0,n.stop=m.root1,n}function d(e,t,i){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<i?0:r}function p(t,i,r,n,u){var c,h=n*n,p=u*u,m=(t[a.COLUMN1ROW1]-t[a.COLUMN2ROW2])*p,f=u*(n*d(t[a.COLUMN1ROW0],t[a.COLUMN0ROW1],o.EPSILON15)+i.y),_=t[a.COLUMN0ROW0]*h+t[a.COLUMN2ROW2]*p+n*i.x+r,g=p*d(t[a.COLUMN2ROW1],t[a.COLUMN1ROW2],o.EPSILON15),v=u*(n*d(t[a.COLUMN2ROW0],t[a.COLUMN0ROW2])+i.z),y=[];if(0===v&&0===g){if(c=s.computeRealRoots(m,f,_),0===c.length)return y;var C=c[0],w=Math.sqrt(Math.max(1-C*C,0));if(y.push(new e(n,u*C,u*-w)),y.push(new e(n,u*C,u*w)),2===c.length){var S=c[1],E=Math.sqrt(Math.max(1-S*S,0));y.push(new e(n,u*S,u*-E)),y.push(new e(n,u*S,u*E))}return y}var b=v*v,T=g*g,x=m*m,A=v*g,P=x+T,D=2*(f*m+A),M=2*_*m+f*f-T+b,I=2*(_*f-A),R=_*_-b;if(0===P&&0===D&&0===M&&0===I)return y;c=l.computeRealRoots(P,D,M,I,R);var O=c.length;if(0===O)return y;for(var N=0;N<O;++N){var L,B=c[N],F=B*B,V=Math.max(1-F,0),k=Math.sqrt(V);L=o.sign(m)===o.sign(_)?d(m*F+_,f*B,o.EPSILON12):o.sign(_)===o.sign(f*B)?d(m*F,f*B+_,o.EPSILON12):d(m*F+f*B,_,o.EPSILON12);var z=d(g*B,v,o.EPSILON15),U=L*z;U<0?y.push(new e(n,u*B,u*k)):U>0?y.push(new e(n,u*B,u*-k)):0!==k?(y.push(new e(n,u*B,u*-k)),y.push(new e(n,u*B,u*k)),++N):y.push(new e(n,u*B,u*k))}return y}var m={};m.rayPlane=function(t,i,n){r(n)||(n=new e);var a=t.origin,s=t.direction,l=i.normal,u=e.dot(l,s);if(!(Math.abs(u)<o.EPSILON15)){var c=(-i.distance-e.dot(l,a))/u;if(!(c<0))return n=e.multiplyByScalar(s,c,n),e.add(a,n,n)}};var f=new e,_=new e,g=new e,v=new e,y=new e;m.rayTriangleParametric=function(t,r,n,a,s){s=i(s,!1);var l,u,c,h,d,p=t.origin,m=t.direction,C=e.subtract(n,r,f),w=e.subtract(a,r,_),S=e.cross(m,w,g),E=e.dot(C,S);if(s){if(E<o.EPSILON6)return;if(l=e.subtract(p,r,v),c=e.dot(l,S),c<0||c>E)return;if(u=e.cross(l,C,y),h=e.dot(m,u),h<0||c+h>E)return;d=e.dot(w,u)/E}else{if(Math.abs(E)<o.EPSILON6)return;var b=1/E;if(l=e.subtract(p,r,v),c=e.dot(l,S)*b,c<0||c>1)return;if(u=e.cross(l,C,y),h=e.dot(m,u)*b,h<0||c+h>1)return;d=e.dot(w,u)*b}return d},m.rayTriangle=function(t,i,n,o,a,s){var l=m.rayTriangleParametric(t,i,n,o,a);if(r(l)&&!(l<0))return r(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var C=new u;m.lineSegmentTriangle=function(t,i,n,o,a,s,l){var u=C;e.clone(t,u.origin),e.subtract(i,t,u.direction),e.normalize(u.direction,u.direction);var c=m.rayTriangleParametric(u,n,o,a,s);if(!(!r(c)||c<0||c>e.distance(t,i)))return r(l)||(l=new e),e.multiplyByScalar(u.direction,c,l),e.add(u.origin,l,l)};var w={root0:0,root1:0};m.raySphere=function(e,t,i){if(i=h(e,t,i),r(i)&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var S=new u;m.lineSegmentSphere=function(t,i,n,o){var a=S;e.clone(t,a.origin);var s=e.subtract(i,t,a.direction),l=e.magnitude(s);if(e.normalize(s,s),o=h(a,n,o),!(!r(o)||o.stop<0||o.start>l))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o};var E=new e,b=new e;m.rayEllipsoid=function(t,i){var r,n,o,a,s,l=i.oneOverRadii,u=e.multiplyComponents(l,t.origin,E),c=e.multiplyComponents(l,t.direction,b),h=e.magnitudeSquared(u),d=e.dot(u,c);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,n=e.magnitudeSquared(c),o=n*r,p<o)return;if(p>o){a=d*d-o,s=-d+Math.sqrt(a);var m=s/n,f=r/s;return m<f?{start:m,stop:f}:{start:f,stop:m}}var _=Math.sqrt(r/n);return{start:_,stop:_}}return h<1?(r=h-1,n=e.magnitudeSquared(c),o=n*r,a=d*d-o,s=-d+Math.sqrt(a),{start:0,stop:s/n}):d<0?(n=e.magnitudeSquared(c),{start:0,stop:-d/n}):void 0};var T=new e,x=new e,A=new e,P=new e,D=new e,M=new a,I=new a,R=new a,O=new a,N=new a,L=new a,B=new a,F=new e,V=new e,k=new t;m.grazingAltitudeLocation=function(t,i){var n=t.origin,s=t.direction;if(!e.equals(n,e.ZERO)){var l=i.geodeticSurfaceNormal(n,T);if(e.dot(s,l)>=0)return n}var u=r(this.rayEllipsoid(t,i)),c=i.transformPositionToScaledSpace(s,T),h=e.normalize(c,c),d=e.mostOrthogonalAxis(c,P),m=e.normalize(e.cross(d,h,x),x),f=e.normalize(e.cross(h,m,A),A),_=M;_[0]=h.x,_[1]=h.y,_[2]=h.z,_[3]=m.x,_[4]=m.y,_[5]=m.z,_[6]=f.x,_[7]=f.y,_[8]=f.z;var g=a.transpose(_,I),v=a.fromScale(i.radii,R),y=a.fromScale(i.oneOverRadii,O),C=N;C[0]=0,C[1]=-s.z,C[2]=s.y,C[3]=s.z,C[4]=0,C[5]=-s.x,C[6]=-s.y,C[7]=s.x,C[8]=0;var w,S,E=a.multiply(a.multiply(g,y,L),C,L),b=a.multiply(a.multiply(E,v,B),_,B),z=a.multiplyByVector(E,n,D),U=p(b,e.negate(z,T),0,0,1),G=U.length;if(G>0){for(var W=e.clone(e.ZERO,V),H=Number.NEGATIVE_INFINITY,q=0;q<G;++q){w=a.multiplyByVector(v,a.multiplyByVector(_,U[q],F),F);var j=e.normalize(e.subtract(w,n,P),P),Y=e.dot(j,s);Y>H&&(H=Y,W=e.clone(w,W))}var X=i.cartesianToCartographic(W,k);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(W,n,P))*Math.sqrt(1-H*H),S=u?-S:S,X.height=S,i.cartographicToCartesian(X,new e)}};var z=new e;return m.lineSegmentPlane=function(t,i,n,a){r(a)||(a=new e);var s=e.subtract(i,t,z),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)<o.EPSILON6)){var c=e.dot(l,t),h=-(n.distance+c)/u;if(!(h<0||h>1))return e.multiplyByScalar(s,h,a),e.add(t,a,a),a}},m.trianglePlaneIntersection=function(t,i,r,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,i)+a<0,u=e.dot(o,r)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var h,d;if(1!==c&&2!==c||(h=new e,d=new e),1===c){if(s)return m.lineSegmentPlane(t,i,n,h),m.lineSegmentPlane(t,r,n,d),{positions:[t,i,r,h,d],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(i,r,n,h),m.lineSegmentPlane(i,t,n,d),{positions:[t,i,r,h,d],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(r,t,n,h),m.lineSegmentPlane(r,i,n,d),{positions:[t,i,r,h,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return m.lineSegmentPlane(i,t,n,h),m.lineSegmentPlane(r,t,n,d),{positions:[t,i,r,h,d],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(r,i,n,h),m.lineSegmentPlane(t,i,n,d),{positions:[t,i,r,h,d],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,r,n,h),m.lineSegmentPlane(i,r,n,d),{positions:[t,i,r,h,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),i("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t,i){this.normal=e.clone(t),this.distance=i}n.fromPointNormal=function(i,r,o){var a=-e.dot(r,i);return t(o)?(e.clone(r,o.normal),o.distance=a,o):new n(r,a)};var o=new e;return n.fromCartesian4=function(i,r){var a=e.fromCartesian4(i,o),s=i.w;return t(r)?(e.clone(a,r.normal),r.distance=s,r):new n(a,s)},n.getPointDistance=function(t,i){return e.dot(t.normal,i)+t.distance},n.ORIGIN_XY_PLANE=r(new n(e.UNIT_Z,0)),n.ORIGIN_YZ_PLANE=r(new n(e.UNIT_X,0)),n.ORIGIN_ZX_PLANE=r(new n(e.UNIT_Y,0)),n}),i("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){t(n[i])||(n[i]=!0,console.log(e(r,i)))}var n={};return r.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",r}),i("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,i){"use strict";function r(e,t){i(e,t)}return r}),i("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i){for(var r,n,o=0,a=e.length-1;o<=a;)if(r=~~((o+a)/2),n=i(e[r],t),n<0)o=r+1;else{if(!(n>0))return r;a=r-1}return~(a+1)}return i}),i("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,i,r,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=r,this.ut1MinusUtc=n}return e}),i("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,i=0,r=t[i++],n=function(e,t,i,r){i||(i=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(i);return r?e+n:n+e},o=function(e,t,i,r,o,a){var s=r-e.length;return s>0&&(e=i||!o?n(e,r,a,i):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,i,r,a,s,l){var u=e>>>0;return i=i&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=i+n(u.toString(t),s||0,"0",!1),o(e,i,r,a,l)},s=function(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),o(e,"",t,i,n,a)},l=function(e,r,l,u,c,h,d){var p,m,f,_,g;if("%%"==e)return"%";for(var v=!1,y="",C=!1,w=!1,S=" ",E=l.length,b=0;l&&b<E;b++)switch(l.charAt(b)){case" ":y=" ";break;case"+":y="+";break;case"-":v=!0;break;case"'":S=l.charAt(b+1);break;case"0":C=!0;break;case"#":w=!0}if(u=u?"*"==u?+t[i++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,u<0&&(u=-u,v=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[i++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,g=r?t[r.slice(0,-1)]:t[i++],d){case"s":return s(String(g),v,u,h,C,S);case"c":return s(String.fromCharCode(+g),v,u,h,C);case"b":return a(g,2,w,v,u,h,C);case"o":return a(g,8,w,v,u,h,C);case"x":return a(g,16,w,v,u,h,C);case"X":return a(g,16,w,v,u,h,C).toUpperCase();case"u":return a(g,10,w,v,u,h,C);case"i":case"d":return p=+g||0,p=Math.round(p-p%1),m=p<0?"-":y,g=m+n(String(Math.abs(p)),h,"0",!1),o(g,m,v,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return p=+g,m=p<0?"-":y,f=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],g=m+Math.abs(p)[f](h),o(g,m,v,u,C)[_]();default:return e}};return r.replace(e,l)}return e}),i("Core/GregorianDate",[],function(){"use strict";function e(e,t,i,r,n,o,a,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),i("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),i("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),i("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={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(t)}),i("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),i("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t){return f.compare(e.julianDate,t.julianDate)}function h(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);r<0&&(r=~r),r>=i.length&&(r=i.length-1);var n=i[r].offset;if(r>0){var o=f.secondsDifference(i[r].julianDate,e);o>n&&(r--,n=i[r].offset)}f.addSeconds(e,n,e)}function d(e,i){y.julianDate=e;var r=f.leapSeconds,n=t(r,y,c);if(n<0&&(n=~n),0===n)return f.addSeconds(e,-r[0].offset,i);if(n>=r.length)return f.addSeconds(e,-r[n-1].offset,i);var o=f.secondsDifference(r[n].julianDate,e);return 0===o?f.addSeconds(e,-r[n].offset,i):o<=1?void 0:f.addSeconds(e,-r[--n].offset,i)}function p(e,t,i){var r=t/l.SECONDS_PER_DAY|0;return e+=r,t-=l.SECONDS_PER_DAY*r,t<0&&(e--,t+=l.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function m(e,t,i,r,n,o,a){var s=(t-14)/12|0,u=e+4800+s,c=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+i-32075;r-=12,r<0&&(r+=24);var h=o+(r*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return h>=43200&&(c-=1),[c,h]}function f(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=i(e,0),t=i(t,0),r=i(r,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,p(n,t,this),r===u.UTC&&h(this)}var _=new o,g=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,y=new s,C=/^(\d{4})$/,w=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,E=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,b=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+T.source,A=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source;f.fromDate=function(e,t){var i=m(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(p(i[0],i[1],t),h(t),t):new f(i[0],i[1],u.UTC)},f.fromIso8601=function(e,t){e=e.replace(",",".");var i,n,o,s=e.split("T"),l=1,c=1,d=0,_=0,y=0,T=0,D=s[0],M=s[1];if(s=D.match(b),null!==s)i=+s[1],l=+s[2],c=+s[3];else if(s=D.match(w),null!==s)i=+s[1],l=+s[2];else if(s=D.match(C),null!==s)i=+s[1];else{var I;if(s=D.match(S),null!==s)i=+s[1],I=+s[2],o=a(i);else if(s=D.match(E),null!==s){i=+s[1];var R=+s[2],O=+s[3]||0,N=new Date(Date.UTC(i,0,4));
I=7*R+O-N.getUTCDay()-3}n=new Date(Date.UTC(i,0,1)),n.setUTCDate(I),l=n.getUTCMonth()+1,c=n.getUTCDate()}o=a(i);var L;if(r(M)){s=M.match(P),null!==s?(d=+s[1],_=+s[2],y=+s[3],T=1e3*+(s[4]||0),L=5):(s=M.match(A),null!==s?(d=+s[1],_=+s[2],y=60*+(s[3]||0),L=4):(s=M.match(x),null!==s&&(d=+s[1],_=60*+(s[2]||0),L=3)));var B=s[L],F=+s[L+1],V=+(s[L+2]||0);switch(B){case"+":d-=F,_-=V;break;case"-":d+=F,_+=V;break;case"Z":break;default:_+=new Date(Date.UTC(i,l-1,c,d,_)).getTimezoneOffset()}}else _+=new Date(i,l-1,c).getTimezoneOffset();var k=60===y;for(k&&y--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,c++;for(n=o&&2===l?v:g[l-1];c>n;)c-=n,l++,l>12&&(l-=12,i++),n=o&&2===l?v:g[l-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,c--;for(;c<1;)l--,l<1&&(l+=12,i--),n=o&&2===l?v:g[l-1],c+=n;var z=m(i,l,c,d,_,y,T);return r(t)?(p(z[0],z[1],t),h(t)):t=new f(z[0],z[1],u.UTC),k&&f.addSeconds(t,1,t),t},f.now=function(e){return f.fromDate(new Date,e)};var D=new f(0,0,u.TAI);return f.toGregorianDate=function(e,t){var i=!1,n=d(e,D);r(n)||(f.addSeconds(e,-1,D),n=d(D,D),i=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=a+68569|0,c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;var h=4e3*(u+1)/1461001|0;u=u-(1461*h/4|0)+31|0;var p=80*u/2447|0,m=u-(2447*p/80|0)|0;u=p/11|0;var _=p+2-12*u|0,g=100*(c-49)+h+u|0,v=s/l.SECONDS_PER_HOUR|0,y=s-v*l.SECONDS_PER_HOUR,C=y/l.SECONDS_PER_MINUTE|0;y-=C*l.SECONDS_PER_MINUTE;var w=0|y,S=(y-w)/l.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),i&&(w+=1),r(t)?(t.year=g,t.month=_,t.day=m,t.hour=v,t.minute=C,t.second=w,t.millisecond=S,t.isLeapSecond=i,t):new o(g,_,m,v,C,w,S,i)},f.toDate=function(e){var t=f.toGregorianDate(e,_),i=t.second;return t.isLeapSecond&&(i-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,i,t.millisecond))},f.toIso8601=function(t,i){var n,o=f.toGregorianDate(t,o);return r(i)||0===o.millisecond?r(i)&&0!==i?(n=(.01*o.millisecond).toFixed(i).replace(".","").slice(0,i),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(n=(.01*o.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n))},f.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new f(e.dayNumber,e.secondsOfDay,u.TAI)},f.compare=function(e,t){var i=e.dayNumber-t.dayNumber;return 0!==i?i:e.secondsOfDay-t.secondsOfDay},f.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},f.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(f.secondsDifference(e,t))<=i},f.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},f.secondsDifference=function(e,t){var i=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return i+(e.secondsOfDay-t.secondsOfDay)},f.daysDifference=function(e,t){var i=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return i+r},f.computeTaiMinusUtc=function(e){y.julianDate=e;var i=f.leapSeconds,r=t(i,y,c);return r<0&&(r=~r,--r,r<0&&(r=0)),i[r].offset},f.addSeconds=function(e,t,i){return p(e.dayNumber,e.secondsOfDay+t,i)},f.addMinutes=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,r,i)},f.addHours=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,r,i)},f.addDays=function(e,t,i){var r=e.dayNumber+t;return p(r,e.secondsOfDay,i)},f.lessThan=function(e,t){return f.compare(e,t)<0},f.lessThanOrEquals=function(e,t){return f.compare(e,t)<=0},f.greaterThan=function(e,t){return f.compare(e,t)>0},f.greaterThanOrEquals=function(e,t){return f.compare(e,t)>=0},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.equalsEpsilon=function(e,t){return f.equalsEpsilon(this,e,t)},f.prototype.toString=function(){return f.toIso8601(this)},f.leapSeconds=[new s(new f(2441317,43210,u.TAI),10),new s(new f(2441499,43211,u.TAI),11),new s(new f(2441683,43212,u.TAI),12),new s(new f(2442048,43213,u.TAI),13),new s(new f(2442413,43214,u.TAI),14),new s(new f(2442778,43215,u.TAI),15),new s(new f(2443144,43216,u.TAI),16),new s(new f(2443509,43217,u.TAI),17),new s(new f(2443874,43218,u.TAI),18),new s(new f(2444239,43219,u.TAI),19),new s(new f(2444786,43220,u.TAI),20),new s(new f(2445151,43221,u.TAI),21),new s(new f(2445516,43222,u.TAI),22),new s(new f(2446247,43223,u.TAI),23),new s(new f(2447161,43224,u.TAI),24),new s(new f(2447892,43225,u.TAI),25),new s(new f(2448257,43226,u.TAI),26),new s(new f(2448804,43227,u.TAI),27),new s(new f(2449169,43228,u.TAI),28),new s(new f(2449534,43229,u.TAI),29),new s(new f(2450083,43230,u.TAI),30),new s(new f(2450630,43231,u.TAI),31),new s(new f(2451179,43232,u.TAI),32),new s(new f(2453736,43233,u.TAI),33),new s(new f(2454832,43234,u.TAI),34),new s(new f(2456109,43235,u.TAI),35),new s(new f(2457204,43236,u.TAI),36),new s(new f(2457754,43237,u.TAI),37)],f}),i("Core/clone",["./defaultValue"],function(e){"use strict";function t(i,r){if(null===i||"object"!=typeof i)return i;r=e(r,!1);var n=new i.constructor;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];r&&(a=t(a,r)),n[o]=a}return n}return t}),i("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var i=e.split("\r\n"),r=0;r<i.length;++r){var n=i[r],o=n.indexOf(": ");if(o>0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),i("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function i(e,i,r){this.statusCode=e,this.response=i,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return i.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},i}),i("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 i=r.exec(t);this.scheme=i[1],this.authority=i[2],this.path=i[3],this.query=i[4],this.fragment=i[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function i(e,t,i,r){return(t||"")+i.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(a,i).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var i=new e;return this.scheme?(i.scheme=this.scheme,i.authority=this.authority,i.path=this.path,i.query=this.query):(i.scheme=t.scheme,this.authority?(i.authority=this.authority,i.path=this.path,i.query=this.query):(i.authority=t.authority,""==this.path?(i.path=t.path,i.query=this.query||t.query):("/"==this.path.charAt(0)?(i.path=this.path,i.removeDotSegments()):(t.authority&&""==t.path?i.path="/"+this.path:i.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,i.removeDotSegments()),i.query=this.query))),i.fragment=this.fragment,i},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),i=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?i.pop():"."!=e&&i.push(e);"."!=e&&".."!=e||i.push(""),r&&i.unshift(""),this.path=i.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}),i("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i){var r=new e(i);r.normalize();var n=r.getAuthority();if(t(n)){if(n.indexOf("@")!==-1){var o=n.split("@");n=o[1]}if(n.indexOf(":")===-1){var a=r.getScheme();if(t(a)||(a=window.location.protocol,a=a.substring(0,a.length-1)),"http"===a)n+=":80";else{if("https"!==a)return;n+=":443"}}return n}}var n={},o={};return n.add=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])||(o[r]=!0)},n.remove=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])&&delete o[r]},n.contains=function(e){var i=r(e);return!(!t(i)||!t(o[i]))},n.clear=function(){o={}},n}),i("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT);var r=i.responseType,n=t(i.method,"GET"),o=i.data,a=i.headers,l=i.overrideMimeType;return e(i.url,function(t){var i=e.defer();return s.load(t,r,n,o,a,i,l),i.promise})}function l(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function u(e,t){for(var i=l(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o<i.length;o++)n[o]=i.charCodeAt(o);return r}function c(e,i){i=t(i,"");var r=e[1],n=!!e[2],o=e[3];switch(i){case"":case"text":return l(n,o);case"arraybuffer":return u(n,o);case"blob":var a=u(n,o);return new Blob([a],{type:r});case"document":var s=new DOMParser;return s.parseFromString(l(n,o),r);case"json":return JSON.parse(l(n,o))}}var h=/^data:(.*?)(;base64)?,(.*)$/;return s.load=function(e,t,r,s,l,u,d){var p=h.exec(e);if(null!==p)return void u.resolve(c(p,t));var m=new XMLHttpRequest;if(a.contains(e)&&(m.withCredentials=!0),i(d)&&i(m.overrideMimeType)&&m.overrideMimeType(d),m.open(r,e,!0),i(l))for(var f in l)l.hasOwnProperty(f)&&m.setRequestHeader(f,l[f]);i(t)&&(m.responseType=t),m.onload=function(){if(m.status<200||m.status>=300)return void u.reject(new n(m.status,m.response,m.getAllResponseHeaders()));var e=m.response,r=m.responseType;if(!i(e)||i(t)&&r!==t)if("json"===t&&"string"==typeof e)try{u.resolve(JSON.parse(e))}catch(e){u.reject(e)}else(""===r||"document"===r)&&i(m.responseXML)&&m.responseXML.hasChildNodes()?u.resolve(m.responseXML):""!==r&&"text"!==r||!i(m.responseText)?u.reject(new o("Invalid XMLHttpRequest response type.")):u.resolve(m.responseText);else u.resolve(e)},m.onerror=function(e){u.reject(new n)},m.send(s)},s.defaultLoad=s.load,s}),i("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,headers:i})}return t}),i("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,i,r){"use strict";function n(i,n){return t(n)?t(n.Accept)||(n=e(n),n.Accept=o.Accept):n=o,r(i,n).then(function(e){return JSON.parse(e)})}var o={Accept:"application/json,*/*;q=0.01"};return n}),i("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t){if(t=i(t,i.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=i(t.addNewLeapSeconds,!0),r(t.data))m(this,t.data);else if(r(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){m(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else m(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function p(e,t){return a.compare(e.julianDate,t)}function m(e,i){if(!r(i.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(i.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),u=i.columnNames.indexOf("ut1MinusUtcSeconds"),d=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),m=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||l<0||u<0||d<0||m<0||f<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=i.samples,g=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=m,e._taiMinusUtcSecondsColumn=f,e._columnCount=i.columnNames.length,e._lastIndex=void 0;for(var v,y=e._addNewLeapSeconds,C=0,w=_.length;C<w;C+=e._columnCount){var S=_[C+n],E=_[C+f],b=S+c.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new a(b,E,h.TAI);if(g.push(T),y){if(E!==v&&r(v)){var x=a.leapSeconds,A=t(x,T,p);if(A<0){var P=new s(T,E);x.splice(~A,0,P)}}v=E}}}function f(e,t,i,r,n){var o=i*r;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function _(e,t,i){return t+e*(i-t)}function g(e,t,i,r,n,o,s){var l=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||r.equals(u))return f(e,i,n,l,s),s;if(r.equals(c))return f(e,i,o,l,s),s;var h=a.secondsDifference(r,u)/a.secondsDifference(c,u),d=n*l,p=o*l,m=i[d+e._ut1MinusUtcSecondsColumn],g=i[p+e._ut1MinusUtcSecondsColumn],v=g-m;if(v>.5||v<-.5){var y=i[d+e._taiMinusUtcSecondsColumn],C=i[p+e._taiMinusUtcSecondsColumn];y!==C&&(c.equals(r)?m=g:g-=C-y)}return s.xPoleWander=_(h,i[d+e._xPoleWanderRadiansColumn],i[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=_(h,i[d+e._yPoleWanderRadiansColumn],i[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_(h,i[d+e._xCelestialPoleOffsetRadiansColumn],i[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_(h,i[d+e._yCelestialPoleOffsetRadiansColumn],i[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_(h,m,g),s}return d.NONE=o({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 n(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,i){if(r(this._samples)){if(r(i)||(i=new n(0,0,0,0,0)),0===this._samples.length)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;var o=this._dates,s=this._lastIndex,l=0,c=0;if(r(s)){var h=o[s],d=o[s+1],p=a.lessThanOrEquals(h,e),m=!r(d),f=m||a.greaterThanOrEquals(d,e);if(p&&f)return l=s,!m&&d.equals(e)&&++l,c=l+1,g(this,o,this._samples,e,l,c,i),i}var _=t(o,e,a.compare,this._dateColumn);return _>=0?(_<o.length-1&&o[_+1].equals(e)&&++_,l=_,c=_):(c=~_,l=c-1,l<0&&(l=0)),this._lastIndex=l,g(this,o,this._samples,e,l,c,i),i}if(r(this._dataError))throw new u(this._dataError)},d}),i("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(t,i,r){this.heading=e(t,0),this.pitch=e(i,0),this.roll=e(r,0)}return n.fromQuaternion=function(e,i){t(i)||(i=new n);var r=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),a=2*(e.w*e.x+e.y*e.z),s=1-2*(e.y*e.y+e.z*e.z),l=2*(e.w*e.z+e.x*e.y);return i.heading=-Math.atan2(l,s),i.roll=Math.atan2(a,o),i.pitch=-Math.asin(r),i},n.fromDegrees=function(e,i,o,a){return t(a)||(a=new n),a.heading=e*r.RADIANS_PER_DEGREE,a.pitch=i*r.RADIANS_PER_DEGREE,a.roll=o*r.RADIANS_PER_DEGREE,a},n.clone=function(e,i){if(t(e))return t(i)?(i.heading=e.heading,i.pitch=e.pitch,i.roll=e.roll,i):new n(e.heading,e.pitch,e.roll)},n.equals=function(e,i){return e===i||t(e)&&t(i)&&e.heading===i.heading&&e.pitch===i.pitch&&e.roll===i.roll},n.equalsEpsilon=function(e,i,n,o){return e===i||t(e)&&t(i)&&r.equalsEpsilon(e.heading,i.heading,n,o)&&r.equalsEpsilon(e.pitch,i.pitch,n,o)&&r.equalsEpsilon(e.roll,i.roll,n,o)},n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t,i){return n.equalsEpsilon(this,e,t,i)},n.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},n}),i("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(i,r){r=t(r,document.location.href);var n=new e(r),o=new e(i);return o.resolve(n).toString()}return n}),i("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,o){o=t(o,!0),r instanceof e||(r=new e(r)),n instanceof e||(n=new e(n)),i(n.authority)&&!i(n.scheme)&&("undefined"!=typeof document&&i(document.location)&&i(document.location.href)?n.scheme=new e(document.location.href).scheme:n.scheme=r.scheme);var a=r;n.isAbsolute()&&(a=n);var s="";i(a.scheme)&&(s+=a.scheme+":"),i(a.authority)&&(s+="//"+a.authority,""!==a.path&&"/"!==a.path&&(s=s.replace(/\/?$/,"/"),a.path=a.path.replace(/^\/?/g,""))),s+=a===r?o?r.path.replace(/\/?$/,"/")+n.path.replace(/^\/?/g,""):r.path+n.path:n.path;var l=i(r.query),u=i(n.query);l&&u?s+="?"+r.query+"&"+n.query:l&&!u?s+="?"+r.query:!l&&u&&(s+="?"+n.query);var c=i(n.fragment);return i(r.fragment)&&!c?s+="#"+r.fragment:c&&(s+="#"+n.fragment),s}return n}),i("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,i,r,n,o){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;t<i;++t){var r=e[t].getAttribute("src"),n=m.exec(r);if(null!==n)return n[1]}}function s(){if(t(h))return h;var i;return i="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),h=new e(r(i))}function l(e){return o.toUrl("../"+e)}function u(e){return n(s(),e)}function c(e){t(d)||(d=t(o.toUrl)?l:u),t(p)||(p=document.createElement("a"));var i=d(e);return p.href=i,p.href=p.href,p.href}var h,d,p,m=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=m,c.setBaseUrl=function(t){h=new e(t).resolve(new e(document.location.href))},c}),i("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,i){this.x=e,this.y=t,this.s=i}return e}),i("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=i(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=i(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new o(this._sampleZeroJulianEphemerisDate,0,s.TAI),this._stepSizeDays=i(e.stepSizeDays,1),this._samplesPerXysFile=i(e.samplesPerXysFile,1e3),this._totalSamples=i(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),l=0;l<=t;++l){r[l]=a,n[l]=l*this._stepSizeDays;for(var u=0;u<=t;++u)u!==l&&(r[l]*=l-u);r[l]=1/r[l]}this._work=new Array(t+1),this._coef=new Array(t+1)}function u(e,t,i){var r=h;return r.dayNumber=t,r.secondsOfDay=i,o.daysDifference(r,e._sampleZeroDateTT)}function c(i,n){if(i._chunkDownloadsInProgress[n])return i._chunkDownloadsInProgress[n];var o=e.defer();i._chunkDownloadsInProgress[n]=o;var s,l=i._xysFileUrlTemplate;return s=r(l)?l.replace("{0}",n):t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json"),e(a(s),function(e){i._chunkDownloadsInProgress[n]=!1;for(var t=i._samples,r=e.samples,a=n*i._samplesPerXysFile*3,s=0,l=r.length;s<l;++s)t[a+s]=r[s];o.resolve()}),o.promise}var h=new o(0,0,s.TAI);return l.prototype.preload=function(t,i,r,n){var o=u(this,t,i),a=u(this,r,n),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);var l=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var h=s/this._samplesPerXysFile|0,d=l/this._samplesPerXysFile|0,p=[],m=h;m<=d;++m)p.push(c(this,m));return e.all(p)},l.prototype.computeXysRadians=function(e,t,i){var o=u(this,e,t);if(!(o<0)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);l<0&&(l=0);var h=l+s;h>=this._totalSamples&&(h=this._totalSamples-1,l=h-s,l<0&&(l=0));var d=!1,p=this._samples;if(r(p[3*l])||(c(this,l/this._samplesPerXysFile|0),d=!0),r(p[3*h])||(c(this,h/this._samplesPerXysFile|0),d=!0),!d){r(i)?(i.x=0,i.y=0,i.s=0):i=new n(0,0,0);var m,f,_=o-l*this._stepSizeDays,g=this._work,v=this._denominators,y=this._coef,C=this._xTable;for(m=0;m<=s;++m)g[m]=_-C[m];for(m=0;m<=s;++m){for(y[m]=1,f=0;f<=s;++f)f!==m&&(y[m]*=g[f]);y[m]*=v[m];var w=3*(l+m);i.x+=y[m]*p[w++],i.y+=y[m]*p[w++],i.s+=y[m]*p[w]}return i}}}},l}),i("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var i,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(n.supportsFullscreen())return null!==n.element}}}),n.supportsFullscreen=function(){if(e(i))return i;i=!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",i=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;a<s;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof t[n]?(r.requestFullscreen=n,i=!0):(n=l+"RequestFullScreen","function"==typeof t[n]&&(r.requestFullscreen=n,i=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?r.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(r.exitFullscreen=n)),n=l+"FullscreenEnabled",void 0!==document[n]?r.fullscreenEnabled=n:(n=l+"FullScreenEnabled",void 0!==document[n]&&(r.fullscreenEnabled=n)),n=l+"FullscreenElement",void 0!==document[n]?r.fullscreenElement=n:(n=l+"FullScreenElement",void 0!==document[n]&&(r.fullscreenElement=n)),n=l+"fullscreenchange",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenChange"),r.fullscreenchange=n),n=l+"fullscreenerror",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenError"),r.fullscreenerror=n)}return i},n.requestFullscreen=function(e,t){n.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},n.exitFullscreen=function(){n.supportsFullscreen()&&document[r.exitFullscreen]()},n}),i("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,i){"use strict";function r(e){for(var t=e.split("."),i=0,r=t.length;i<r;++i)t[i]=parseInt(t[i],10);return t}function n(){if(!t(w)&&(w=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(w=!0,S=r(e[1]))}return w}function o(){return n()&&S}function a(){if(!t(E)&&(E=!1,!n()&&!d()&&/ Safari\/[\.0-9]+/.test(C.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(E=!0,b=r(e[1]))}return E}function s(){return a()&&b}function l(){if(!t(T)){T=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(C.userAgent);null!==e&&(T=!0,x=r(e[1]),x.isNightly=!!e[2])}return T}function u(){return l()&&x}function c(){if(!t(A)){A=!1;var e;"Microsoft Internet Explorer"===C.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(C.userAgent),null!==e&&(A=!0,P=r(e[1]))):"Netscape"===C.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(C.userAgent),null!==e&&(A=!0,P=r(e[1])))}return A}function h(){return c()&&P}function d(){if(!t(D)){D=!1;var e=/ Edge\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(D=!0,M=r(e[1]))}return D}function p(){return d()&&M}function m(){if(!t(I)){I=!1;var e=/Firefox\/([\.0-9]+)/.exec(C.userAgent);null!==e&&(I=!0,R=r(e[1]))}return I}function f(){return t(O)||(O=/Windows/i.test(C.appVersion)),O}function _(){return m()&&R}function g(){return t(N)||(N="undefined"!=typeof PointerEvent&&(!t(C.pointerEnabled)||C.pointerEnabled)),N}function v(){if(!t(B)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var i=e.style.imageRendering;B=t(i)&&""!==i,B&&(L=i)}return B}function y(){return v()?L:void 0}var C;C="undefined"!=typeof navigator?navigator:{};var w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:h,isEdge:d,edgeVersion:p,isFirefox:m,firefoxVersion:_,isWindows:f,hardwareConcurrency:e(C.hardwareConcurrency,3),supportsPointerEvents:g,supportsImageRenderingPixelated:v,imageRenderingValue:y};return F.supportsFullscreen=function(){return i.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),i("Core/Quaternion",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i,r,n){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0),this.w=t(n,0)}var u=new e;l.fromAxisAngle=function(t,r,n){var o=r/2,a=Math.sin(o);u=e.normalize(t,u);var s=u.x*a,c=u.y*a,h=u.z*a,d=Math.cos(o);return i(n)?(n.x=s,n.y=c,n.z=h,n.w=d,n):new l(s,c,h,d)};var c=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var r,n,o,a,u,d=e[s.COLUMN0ROW0],p=e[s.COLUMN1ROW1],m=e[s.COLUMN2ROW2],f=d+p+m;if(f>0)r=Math.sqrt(f+1),u=.5*r,r=.5/r,n=(e[s.COLUMN1ROW2]-e[s.COLUMN2ROW1])*r,o=(e[s.COLUMN2ROW0]-e[s.COLUMN0ROW2])*r,a=(e[s.COLUMN0ROW1]-e[s.COLUMN1ROW0])*r;else{var _=c,g=0;p>d&&(g=1),m>d&&m>p&&(g=2);var v=_[g],y=_[v];r=Math.sqrt(e[s.getElementIndex(g,g)]-e[s.getElementIndex(v,v)]-e[s.getElementIndex(y,y)]+1);var C=h;C[g]=.5*r,r=.5/r,u=(e[s.getElementIndex(y,v)]-e[s.getElementIndex(v,y)])*r,C[v]=(e[s.getElementIndex(v,g)]+e[s.getElementIndex(g,v)])*r,C[y]=(e[s.getElementIndex(y,g)]+e[s.getElementIndex(g,y)])*r,n=-C[0],o=-C[1],a=-C[2]}return i(t)?(t.x=n,t.y=o,t.z=a,t.w=u,t):new l(n,o,a,u)};var d=new l;l.fromHeadingPitchRoll=function(t,i,r,n){var o=l.fromAxisAngle(e.UNIT_X,r,d),a=l.fromAxisAngle(e.UNIT_Y,-i,n);n=l.multiply(a,o,a);var s=l.fromAxisAngle(e.UNIT_Z,-t,d);return l.multiply(s,n,n)};var p=new e,m=new e,f=new l,_=new l,g=new l;l.packedLength=4,l.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r++]=e.z,i[r]=e.w,i},l.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new l),n.x=e[r],n.y=e[r+1],n.z=e[r+2],n.w=e[r+3],n},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,i,r){l.unpack(e,4*i,g),l.conjugate(g,g);for(var n=0,o=i-t+1;n<o;n++){var a=3*n;l.unpack(e,4*(t+n),f),l.multiply(f,g,f),f.w<0&&l.negate(f,f),l.computeAxis(f,p);var s=l.computeAngle(f);r[a]=p.x*s,r[a+1]=p.y*s,r[a+2]=p.z*s}},l.unpackInterpolationResult=function(t,r,n,o,a){i(a)||(a=new l),e.fromArray(t,0,m);var s=e.magnitude(m);return l.unpack(r,4*o,_),0===s?l.clone(l.IDENTITY,f):l.fromAxisAngle(m,s,f),l.multiply(f,_,a)},l.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var i=1/l.magnitude(e),r=e.x*i,n=e.y*i,o=e.z*i,a=e.w*i;return t.x=r,t.y=n,t.z=o,t.w=a,t},l.inverse=function(e,t){var i=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/i,t)},l.add=function(e,t,i){return i.x=e.x+t.x,i.y=e.y+t.y,i.z=e.z+t.z,i.w=e.w+t.w,i},l.subtract=function(e,t,i){return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,i.w=e.w-t.w,i},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,i){var r=e.x,n=e.y,o=e.z,a=e.w,s=t.x,l=t.y,u=t.z,c=t.w,h=a*s+r*c+n*u-o*l,d=a*l-r*u+n*c+o*s,p=a*u+r*l-n*s+o*c,m=a*c-r*s-n*l-o*u;return i.x=h,i.y=d,i.z=p,i.w=m,i},l.multiplyByScalar=function(e,t,i){return i.x=e.x*t,i.y=e.y*t,i.z=e.z*t,i.w=e.w*t,i},l.divideByScalar=function(e,t,i){return i.x=e.x/t,i.y=e.y/t,i.z=e.z/t,i.w=e.w/t,i},l.computeAxis=function(e,t){var i=e.w;if(Math.abs(i-1)<a.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-i*i);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<a.EPSILON6?0:2*Math.acos(e.w)};var v=new l;l.lerp=function(e,t,i,r){return v=l.multiplyByScalar(t,i,v),r=l.multiplyByScalar(e,1-i,r),l.add(v,r,r)};var y=new l,C=new l,w=new l;l.slerp=function(e,t,i,r){var n=l.dot(e,t),o=t;if(n<0&&(n=-n,o=y=l.negate(t,y)),1-n<a.EPSILON6)return l.lerp(e,o,i,r);var s=Math.acos(n);return C=l.multiplyByScalar(e,Math.sin((1-i)*s),C),w=l.multiplyByScalar(o,Math.sin(i*s),w),r=l.add(C,w,r),l.multiplyByScalar(r,1/Math.sin(s),r)},l.log=function(t,i){var r=a.acosClamped(t.w),n=0;return 0!==r&&(n=r/Math.sin(r)),e.multiplyByScalar(t,n,i)},l.exp=function(t,i){var r=e.magnitude(t),n=0;return 0!==r&&(n=Math.sin(r)/r),i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=Math.cos(r),i};var S=new e,E=new e,b=new l,T=new l;l.computeInnerQuadrangle=function(t,i,r,n){var o=l.conjugate(i,b);l.multiply(o,r,T);var a=l.log(T,S);l.multiply(o,t,T);var s=l.log(T,E);return e.add(a,s,a),e.multiplyByScalar(a,.25,a),e.negate(a,a),l.exp(a,b),l.multiply(i,b,n)},l.squad=function(e,t,i,r,n,o){var a=l.slerp(e,t,n,b),s=l.slerp(i,r,n,T);return l.slerp(a,s,2*n*(1-n),o)};for(var x=new l,A=1.9011074535173003,P=n.supportsTypedArrays()?new Float32Array(8):[],D=n.supportsTypedArrays()?new Float32Array(8):[],M=n.supportsTypedArrays()?new Float32Array(8):[],I=n.supportsTypedArrays()?new Float32Array(8):[],R=0;R<7;++R){var O=R+1,N=2*O+1;P[R]=1/(O*N),D[R]=O/N}return P[7]=A/136,D[7]=8*A/17,l.fastSlerp=function(e,t,i,r){var n,o=l.dot(e,t);o>=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-i,u=i*i,c=s*s,h=7;h>=0;--h)M[h]=(P[h]*u-D[h])*a,I[h]=(P[h]*c-D[h])*a;var d=n*i*(1+M[0]*(1+M[1]*(1+M[2]*(1+M[3]*(1+M[4]*(1+M[5]*(1+M[6]*(1+M[7])))))))),p=s*(1+I[0]*(1+I[1]*(1+I[2]*(1+I[3]*(1+I[4]*(1+I[5]*(1+I[6]*(1+I[7])))))))),m=l.multiplyByScalar(e,p,x);return l.multiplyByScalar(t,d,r),l.add(m,r,r)},l.fastSquad=function(e,t,i,r,n,o){var a=l.fastSlerp(e,t,n,b),s=l.fastSlerp(i,r,n,T);
return l.fastSlerp(a,s,2*n*(1-n),o)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),i("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./HeadingPitchRoll","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";var w={},S=new i,E=new i,b=new i;w.eastNorthUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=-n,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(0,-n,0,e.x,1,0,0,e.y,0,0,n,e.z,0,0,0,1)}var s=S,l=E,u=b;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(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 v(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 T=new i,x=new i,A=new i;w.northEastDownToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=-n,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]=-n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,1,0,e.y,0,0,-n,e.z,0,0,0,1)}var s=T,l=x,u=A;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(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 v(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)},w.northUpEastToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=-n,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=n,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,0,1,e.y,0,n,0,e.z,0,0,0,1)}var s=S,l=E,u=b;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(r)?(r[0]=u.x,r[1]=u.y,r[2]=u.z,r[3]=0,r[4]=s.x,r[5]=s.y,r[6]=s.z,r[7]=0,r[8]=l.x,r[9]=l.y,r[10]=l.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(u.x,s.x,l.x,e.x,u.y,s.y,l.y,e.y,u.z,s.z,l.z,e.z,0,0,0,1)},w.northWestUpToFixedFrame=function(e,t,r){if(_.equalsEpsilon(e.x,0,_.EPSILON14)&&_.equalsEpsilon(e.y,0,_.EPSILON14)){var n=_.sign(e.z);return a(r)?(r[0]=-n,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]=n,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r):new v(-n,0,0,e.x,0,-1,0,e.y,0,0,n,e.z,0,0,0,1)}var s=S,l=E,u=b;return t=o(t,h.WGS84),t.geodeticSurfaceNormal(e,s),l.x=-e.y,l.y=e.x,l.z=0,i.normalize(l,l),i.cross(s,l,u),a(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 v(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 P=new y,D=new i(1,1,1),M=new v;w.headingPitchRollToFixedFrame=function(e,t,r,n,o,a){var l;"object"==typeof t?(o=r,a=n,l=t.heading,r=t.pitch,n=t.roll):(s("headingPitchRollToFixedFrame","headingPitchRollToFixedFrame with separate heading, pitch, and roll arguments was deprecated in 1.27.  It will be removed in 1.30.  Use a HeadingPitchRoll object."),l=t);var u=y.fromHeadingPitchRoll(l,r,n,P),c=v.fromTranslationQuaternionRotationScale(i.ZERO,u,D,M);return a=w.eastNorthUpToFixedFrame(e,o,a),v.multiply(a,c,a)};var I=new d,R=new v,O=new g;w.headingPitchRollQuaternion=function(e,t,i,r,n,o){var a;"object"==typeof t?(a=t,n=i,o=r):(s("headingPitchRollQuaternion","headingPitchRollQuaternion with separate heading, pitch, and roll arguments was deprecated in 1.27.  It will be removed in 1.30.  Use a HeadingPitchRoll object."),I.heading=t,I.pitch=i,I.roll=r,a=I);var l=w.headingPitchRollToFixedFrame(e,a,n,R),u=v.getRotation(l,O);return y.fromRotationMatrix(u,o)};var N=24110.54841,L=8640184.812866,B=.093104,F=-62e-7,V=1.1772758384668e-19,k=72921158553e-15,z=_.TWO_PI/86400,U=new f;w.computeTemeToPseudoFixedMatrix=function(e,t){U=f.addSeconds(e,-f.computeTaiMinusUtc(e),U);var i,r=U.dayNumber,n=U.secondsOfDay,o=r-2451545;i=n>=43200?(o+.5)/C.DAYS_PER_JULIAN_CENTURY:(o-.5)/C.DAYS_PER_JULIAN_CENTURY;var s=N+i*(L+i*(B+i*F)),l=s*z%_.TWO_PI,u=k+V*(r-2451545.5),c=(n+.5*C.SECONDS_PER_DAY)%C.SECONDS_PER_DAY,h=l+u*c,d=Math.cos(h),p=Math.sin(h);return a(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new g(d,p,0,-p,d,0,0,0,1)},w.iau2006XysData=new p,w.earthOrientationParameters=u.NONE;var G=32.184,W=2451545;w.preloadIcrfFixed=function(t){var i=t.start.dayNumber,r=t.start.secondsOfDay+G,n=t.stop.dayNumber,o=t.stop.secondsOfDay+G,a=w.iau2006XysData.preload(i,r,n,o),s=w.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},w.computeIcrfToFixedMatrix=function(e,t){a(t)||(t=new g);var i=w.computeFixedToIcrfMatrix(e,t);if(a(i))return g.transpose(i,t)};var H=new m(0,0,0),q=new c(0,0,0,0,0,0),j=new g,Y=new g;w.computeFixedToIcrfMatrix=function(e,t){a(t)||(t=new g);var i=w.earthOrientationParameters.compute(e,q);if(a(i)){var r=e.dayNumber,n=e.secondsOfDay+G,o=w.iau2006XysData.computeXysRadians(r,n,H);if(a(o)){var s=o.x+i.xPoleOffset,l=o.y+i.yPoleOffset,u=1/(1+Math.sqrt(1-s*s-l*l)),c=j;c[0]=1-u*s*s,c[3]=-u*s*l,c[6]=s,c[1]=-u*s*l,c[4]=1-u*l*l,c[7]=l,c[2]=-s,c[5]=-l,c[8]=1-u*(s*s+l*l);var h=g.fromRotationZ(-o.s,Y),d=g.multiply(c,h,j),p=e.dayNumber,m=e.secondsOfDay-f.computeTaiMinusUtc(e)+i.ut1MinusUtc,v=p-2451545,y=m/C.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(v+y);S=S%1*_.TWO_PI;var E=g.fromRotationZ(S,Y),b=g.multiply(d,E,j),T=Math.cos(i.xPoleWander),x=Math.cos(i.yPoleWander),A=Math.sin(i.xPoleWander),P=Math.sin(i.yPoleWander),D=r-W+n/C.SECONDS_PER_DAY;D/=36525;var M=-47e-6*D*_.RADIANS_PER_DEGREE/3600,I=Math.cos(M),R=Math.sin(M),O=Y;return O[0]=T*I,O[1]=T*R,O[2]=A,O[3]=-x*R+P*A*I,O[4]=x*I+P*A*R,O[5]=-P*T,O[6]=-P*R-x*A*I,O[7]=P*I-x*A*R,O[8]=x*T,g.multiply(b,O,t)}}};var X=new r;w.pointToWindowCoordinates=function(e,t,i,r){return r=w.pointToGLWindowCoordinates(e,t,i,r),r.y=2*t[5]-r.y,r},w.pointToGLWindowCoordinates=function(e,i,n,o){a(o)||(o=new t);var s=X;return v.multiplyByVector(e,r.fromElements(n.x,n.y,n.z,1,s),s),r.multiplyByScalar(s,1/s.w,s),v.multiplyByVector(i,s,s),t.fromCartesian4(s,o)};var Z=new i,K=new i,Q=new i;w.rotationMatrixFromPositionVelocity=function(e,t,r,n){var s=o(r,h.WGS84).geodeticSurfaceNormal(e,Z),l=i.cross(t,s,K);i.equalsEpsilon(l,i.ZERO,_.EPSILON6)&&(l=i.clone(i.UNIT_X,l));var u=i.cross(l,t,Q);return i.cross(t,u,l),i.negate(l,l),a(n)||(n=new g),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=l.x,n[4]=l.y,n[5]=l.z,n[6]=u.x,n[7]=u.y,n[8]=u.z,n};var J=new n,$=new i,ee=new i,te=new r,ie=new r,re=new r,ne=new r,oe=new r,ae=new v,se=new v;return w.basisTo2D=function(e,t,n){var o=e.ellipsoid,a=v.getColumn(t,3,te),s=o.cartesianToCartographic(a,J),l=w.eastNorthUpToFixedFrame(a,o,ae),u=v.inverseTransformation(l,se),c=e.project(s,$),h=ie;h.x=c.z,h.y=c.x,h.z=c.y,h.w=1;var d=v.getColumn(t,0,ee),p=i.magnitude(d),m=v.multiplyByVector(u,d,re);r.fromElements(m.z,m.x,m.y,0,m);var f=v.getColumn(t,1,ee),_=i.magnitude(f),g=v.multiplyByVector(u,f,ne);r.fromElements(g.z,g.x,g.y,0,g);var y=v.getColumn(t,2,ee),C=i.magnitude(y),S=oe;return i.cross(m,g,S),i.normalize(S,S),i.cross(g,S,m),i.normalize(m,m),i.cross(S,m,g),i.normalize(g,g),i.multiplyByScalar(m,p,m),i.multiplyByScalar(g,_,g),i.multiplyByScalar(S,C,S),v.setColumn(n,0,m,n),v.setColumn(n,1,g,n),v.setColumn(n,2,S,n),v.setColumn(n,3,h,n),n},w}),i("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var r=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=i.fromCartesian4(c.getColumn(r,0,f)),this._yAxis=i.fromCartesian4(c.getColumn(r,1,f));var o=i.fromCartesian4(c.getColumn(r,2,f));this._plane=h.fromPointNormal(e,o)}var f=new r;a(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;m.fromPoints=function(t,i){var r=e.fromPoints(t,_);return new m(r.center,i)};var g=new d,v=new i;m.prototype.projectPointOntoPlane=function(e,r){var n=g;n.origin=e,i.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,v);if(o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v)),o(a)){var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return o(r)?(r.x=l,r.y=c,r):new t(l,c)}},m.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var i=0,r=e.length,n=0;n<r;n++){var a=this.projectPointOntoPlane(e[n],t[i]);o(a)&&(t[i]=a,i++)}return t.length=i,t},m.prototype.projectPointToNearestOnPlane=function(e,r){o(r)||(r=new t);var n=g;n.origin=e,i.clone(this._plane.normal,n.direction);var a=u.rayPlane(n,this._plane,v);o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v));var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return r.x=l,r.y=c,r},m.prototype.projectPointsToNearestOnPlane=function(e,t){o(t)||(t=[]);var i=e.length;t.length=i;for(var r=0;r<i;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new i;return m.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;o(t)?t.length=r:t=new Array(r);for(var n=this._ellipsoid,a=this._origin,s=this._xAxis,l=this._yAxis,u=y,c=0;c<r;++c){var h=e[c];i.multiplyByScalar(s,h.x,u),o(t[c])||(t[c]=new i);var d=i.add(a,u,t[c]);i.multiplyByScalar(l,h.y,u),i.add(d,u,d),n.scaleToGeocentricSurface(d,d)}return t},m}),i("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t){this.center=i.clone(n(e,i.ZERO)),this.halfAxes=d.clone(n(t,d.ZERO))}function _(e,t,r,n,a,s,l,u){o(u)||(u=new f);var c=u.halfAxes;d.setColumn(c,0,e.xAxis,c),d.setColumn(c,1,e.yAxis,c),d.setColumn(c,2,e.zAxis,c);var h=T;h.x=(t+r)/2,h.y=(n+a)/2,h.z=(s+l)/2;var p=x;p.x=(r-t)/2,p.y=(a-n)/2,p.z=(l-s)/2;var m=u.center;return h=d.multiplyByVector(c,h,h),i.add(e.origin,h,m),d.multiplyByScale(c,p,c),u}var g=new i,v=new i,y=new i,C=new i,w=new i,S=new i,E=new d,b={unitary:new d,diagonal:new d};f.fromPoints=function(e,t){if(o(t)||(t=new f),!o(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=i.ZERO,t;var r,n=e.length,a=i.clone(e[0],g);for(r=1;r<n;r++)i.add(a,e[r],a);var s=1/n;i.multiplyByScalar(a,s,a);var l,u=0,c=0,h=0,p=0,m=0,_=0;for(r=0;r<n;r++)l=i.subtract(e[r],a,v),u+=l.x*l.x,c+=l.x*l.y,h+=l.x*l.z,p+=l.y*l.y,m+=l.y*l.z,_+=l.z*l.z;u*=s,c*=s,h*=s,p*=s,m*=s,_*=s;var T=E;T[0]=u,T[1]=c,T[2]=h,T[3]=c,T[4]=p,T[5]=m,T[6]=h,T[7]=m,T[8]=_;var x=d.computeEigenDecomposition(T,b),A=d.clone(x.unitary,t.halfAxes),P=d.getColumn(A,0,C),D=d.getColumn(A,1,w),M=d.getColumn(A,2,S),I=-Number.MAX_VALUE,R=-Number.MAX_VALUE,O=-Number.MAX_VALUE,N=Number.MAX_VALUE,L=Number.MAX_VALUE,B=Number.MAX_VALUE;for(r=0;r<n;r++)l=e[r],I=Math.max(i.dot(P,l),I),R=Math.max(i.dot(D,l),R),O=Math.max(i.dot(M,l),O),N=Math.min(i.dot(P,l),N),L=Math.min(i.dot(D,l),L),B=Math.min(i.dot(M,l),B);P=i.multiplyByScalar(P,.5*(N+I),P),D=i.multiplyByScalar(D,.5*(L+R),D),M=i.multiplyByScalar(M,.5*(B+O),M);var F=i.add(P,D,t.center);F=i.add(F,M,F);var V=y;return V.x=I-N,V.y=R-L,V.z=O-B,i.multiplyByScalar(V,.5,V),d.multiplyByScale(t.halfAxes,V,t.halfAxes),t};var T=new i,x=new i,A=new r,P=new i,D=[new r,new r,new r,new r,new r,new r,new r,new r],M=[new i,new i,new i,new i,new i,new i,new i,new i],I=[new t,new t,new t,new t,new t,new t,new t,new t];f.fromRectangle=function(e,t,i,r,o){t=n(t,0),i=n(i,0),r=n(r,s.WGS84);var a=m.center(e,A),u=r.cartographicToCartesian(a,P),c=new l(u,r),h=c.plane,d=D[0],f=D[1],g=D[2],v=D[3],y=D[4],C=D[5],w=D[6],S=D[7],E=a.longitude,b=e.south<0&&e.north>0?0:a.latitude;w.latitude=C.latitude=y.latitude=e.south,S.latitude=v.latitude=b,d.latitude=f.latitude=g.latitude=e.north,w.longitude=S.longitude=d.longitude=e.west,C.longitude=f.longitude=E,y.longitude=v.longitude=g.longitude=e.east,g.height=f.height=d.height=S.height=w.height=C.height=y.height=v.height=i,r.cartographicArrayToCartesianArray(D,M),c.projectPointsToNearestOnPlane(M,I);var T=Math.min(I[6].x,I[7].x,I[0].x),x=Math.max(I[2].x,I[3].x,I[4].x),R=Math.min(I[4].y,I[5].y,I[6].y),O=Math.max(I[0].y,I[1].y,I[2].y);g.height=d.height=y.height=w.height=t,r.cartographicArrayToCartesianArray(D,M);var N=Math.min(p.getPointDistance(h,M[0]),p.getPointDistance(h,M[2]),p.getPointDistance(h,M[4]),p.getPointDistance(h,M[6])),L=i;return _(c,T,x,R,O,N,L,o)},f.clone=function(e,t){if(o(e))return o(t)?(i.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new f(e.center,e.halfAxes)},f.intersectPlane=function(e,t){var r=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,c=Math.abs(a*o[d.COLUMN0ROW0]+s*o[d.COLUMN0ROW1]+l*o[d.COLUMN0ROW2])+Math.abs(a*o[d.COLUMN1ROW0]+s*o[d.COLUMN1ROW1]+l*o[d.COLUMN1ROW2])+Math.abs(a*o[d.COLUMN2ROW0]+s*o[d.COLUMN2ROW1]+l*o[d.COLUMN2ROW2]),h=i.dot(n,r)+t.distance;return h<=-c?u.OUTSIDE:h>=c?u.INSIDE:u.INTERSECTING};var R=new i,O=new i,N=new i,L=new i;f.distanceSquaredTo=function(e,t){var r=i.subtract(t,e.center,T),n=e.halfAxes,o=d.getColumn(n,0,R),a=d.getColumn(n,1,O),s=d.getColumn(n,2,N),l=i.magnitude(o),u=i.magnitude(a),c=i.magnitude(s);i.normalize(o,o),i.normalize(a,a),i.normalize(s,s);var h=L;h.x=i.dot(r,o),h.y=i.dot(r,a),h.z=i.dot(r,s);var p,m=0;return h.x<-l?(p=h.x+l,m+=p*p):h.x>l&&(p=h.x-l,m+=p*p),h.y<-u?(p=h.y+u,m+=p*p):h.y>u&&(p=h.y-u,m+=p*p),h.z<-c?(p=h.z+c,m+=p*p):h.z>c&&(p=h.z-c,m+=p*p),m};var B=new i,F=new i;f.computePlaneDistances=function(e,t,r,n){o(n)||(n=new c);var a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,h=d.getColumn(u,0,R),p=d.getColumn(u,1,O),m=d.getColumn(u,2,N),f=i.add(h,p,B);i.add(f,m,f),i.add(f,l,f);var _=i.subtract(f,t,F),g=i.dot(r,_);return a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.add(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,h,f),i.subtract(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.add(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,p,f),i.add(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,h,f),i.subtract(f,p,f),i.subtract(f,m,f),i.subtract(f,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),n.start=a,n.stop=s,n};var V=new e;return f.isOccluded=function(t,i){var r=e.fromOrientedBoundingBox(t,V);return!i.isBoundingSphereVisible(r)},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,i){return f.computePlaneDistances(this,e,t,i)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.equals=function(e,t){return e===t||o(e)&&o(t)&&i.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},f.prototype.clone=function(e){return f.clone(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f}),i("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r,n){"use strict";var o={};o.octEncodeInRange=function(e,t,i){if(i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=i.x,o=i.y;i.x=(1-Math.abs(o))*n.signNotZero(r),i.y=(1-Math.abs(r))*n.signNotZero(o)}return i.x=n.toSNorm(i.x,t),i.y=n.toSNorm(i.y,t),i},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,i,r,o){if(o.x=n.fromSNorm(e,r),o.y=n.fromSNorm(i,r),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){var a=o.x;o.x=(1-Math.abs(o.y))*n.signNotZero(a),o.y=(1-Math.abs(a))*n.signNotZero(o.y)}return t.normalize(o,o)},o.octDecode=function(e,t,i){return o.octDecodeInRange(e,t,255,i)},o.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,a),o.octPackFloat(a)},o.octDecodeFloat=function(e,t){var i=e/256,r=Math.floor(i),n=256*(i-r);return o.octDecode(r,n,t)},o.octPack=function(e,t,i,r){var n=o.octEncodeFloat(e),s=o.octEncodeFloat(t),l=o.octEncode(i,a);return r.x=65536*l.x+n,r.y=65536*l.y+s,r},o.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),s=65536*(n-a);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);o.octDecodeFloat(s,t),o.octDecodeFloat(u,i),o.octDecode(a,l,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,i=4095*e.y|0;return 4096*t+i},o.decompressTextureCoordinates=function(e,t){var i=e/4096,r=Math.floor(i);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),i("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503};return e(t)}),i("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,i,r,n,o){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.INT:return Int32Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case a.FLOAT:
return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},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 Int32Array?a.INT:e instanceof Uint32Array?a.UNSIGNED_INT: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.INT||e===a.UNSIGNED_INT||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.INT:return new Int32Array(t);case a.UNSIGNED_INT:return new Uint32Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t)}},a.createArrayBufferView=function(t,i,r,n){switch(r=e(r,0),n=e(n,(i.byteLength-r)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(i,r,n);case a.UNSIGNED_BYTE:return new Uint8Array(i,r,n);case a.SHORT:return new Int16Array(i,r,n);case a.UNSIGNED_SHORT:return new Uint16Array(i,r,n);case a.INT:return new Int32Array(i,r,n);case a.UNSIGNED_INT:return new Uint32Array(i,r,n);case a.FLOAT:return new Float32Array(i,r,n);case a.DOUBLE:return new Float64Array(i,r,n)}},a.fromName=function(e){switch(e){case"BYTE":return a.BYTE;case"UNSIGNED_BYTE":return a.UNSIGNED_BYTE;case"SHORT":return a.SHORT;case"UNSIGNED_SHORT":return a.UNSIGNED_SHORT;case"INT":return a.INT;case"UNSIGNED_INT":return a.UNSIGNED_INT;case"FLOAT":return a.FLOAT;case"DOUBLE":return a.DOUBLE}},n(a)}),i("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),i("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,a,u,d){var _,g,v,y;if(o(e)&&o(t)&&o(r)&&o(a)){var C=e.minimum,w=e.maximum,S=i.subtract(w,C,h),E=r-t,b=Math.max(i.maximumComponent(S),E);_=b<f-1?l.BITS12:l.NONE,g=e.center,v=s.inverseTransformation(a,new s);var T=i.negate(C,c);s.multiply(s.fromTranslation(T,p),v,v);var x=c;x.x=1/S.x,x.y=1/S.y,x.z=1/S.z,s.multiply(s.fromScale(x,p),v,v),y=s.clone(a),s.setTranslation(y,i.ZERO,y),a=s.clone(a,new s);var A=s.fromTranslation(C,p),P=s.fromScale(S,m),D=s.multiply(A,P,p);s.multiply(a,D,a),s.multiply(y,D,y)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=g,this.toScaledENU=v,this.fromScaledENU=a,this.matrix=y,this.hasVertexNormals=u,this.hasWebMercatorT=n(d,!1)}var c=new i,h=new i,d=new t,p=new s,m=new s,f=Math.pow(2,12);u.prototype.encode=function(r,n,o,u,h,p,m){var f=u.x,_=u.y;if(this.quantization===l.BITS12){o=s.multiplyByPoint(this.toScaledENU,o,c),o.x=a.clamp(o.x,0,1),o.y=a.clamp(o.y,0,1),o.z=a.clamp(o.z,0,1);var g=this.maximumHeight-this.minimumHeight,v=a.clamp((h-this.minimumHeight)/g,0,1);t.fromElements(o.x,o.y,d);var y=e.compressTextureCoordinates(d);t.fromElements(o.z,v,d);var C=e.compressTextureCoordinates(d);t.fromElements(f,_,d);var w=e.compressTextureCoordinates(d);if(r[n++]=y,r[n++]=C,r[n++]=w,this.hasWebMercatorT){t.fromElements(m,0,d);var S=e.compressTextureCoordinates(d);r[n++]=S}}else i.subtract(o,this.center,c),r[n++]=c.x,r[n++]=c.y,r[n++]=c.z,r[n++]=h,r[n++]=f,r[n++]=_,this.hasWebMercatorT&&(r[n++]=m);return this.hasVertexNormals&&(r[n++]=e.octPackFloat(p)),n},u.prototype.decodePosition=function(t,r,n){if(o(n)||(n=new i),r*=this.getStride(),this.quantization===l.BITS12){var a=e.decompressTextureCoordinates(t[r],d);n.x=a.x,n.y=a.y;var u=e.decompressTextureCoordinates(t[r+1],d);return n.z=u.x,s.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=t[r],n.y=t[r+1],n.z=t[r+2],i.add(n,this.center,n)},u.prototype.decodeTextureCoordinates=function(i,r,n){return o(n)||(n=new t),r*=this.getStride(),this.quantization===l.BITS12?e.decompressTextureCoordinates(i[r+2],n):t.fromElements(i[r+4],i[r+5],n)},u.prototype.decodeHeight=function(t,i){if(i*=this.getStride(),this.quantization===l.BITS12){var r=e.decompressTextureCoordinates(t[i+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[i+3]},u.prototype.getOctEncodedNormal=function(e,i,r){var n=this.getStride();i=(i+1)*n-1;var o=e[i]/256,a=Math.floor(o),s=256*(o-a);return t.fromElements(a,s,r)},u.prototype.getStride=function(){var e;switch(this.quantization){case l.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},g={compressed0:0,compressed1:1};return u.prototype.getAttributes=function(e){var t,i=r.FLOAT,n=r.getSizeInBytes(i);if(this.quantization===l.NONE){var o=4,a=2;return this.hasWebMercatorT&&++a,this.hasVertexNormals&&++a,t=(o+a)*n,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:o,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:a,offsetInBytes:o*n,strideInBytes:t}]}var s=3,u=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++s,this.hasWebMercatorT&&this.hasVertexNormals?(++u,t=(s+u)*n,[{index:g.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:s,offsetInBytes:0,strideInBytes:t},{index:g.compressed1,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:u,offsetInBytes:s*n,strideInBytes:t}]):[{index:g.compressed0,vertexBuffer:e,componentDatatype:i,componentsPerAttribute:s}]},u.prototype.getAttributeLocations=function(){return this.quantization===l.NONE?_:g},u.clone=function(e,t){return o(t)||(t=new u),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=i.clone(e.center),t.toScaledENU=s.clone(e.toScaledENU),t.fromScaledENU=s.clone(e.fromScaledENU),t.matrix=s.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},u}),i("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){this._ellipsoid=i(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),l.mercatorAngleToGeodeticLatitude=function(e){return s.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},l.geodeticLatitudeToMercatorAngle=function(e){e>l.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},l.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},l}),i("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";var g={};g.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var v=new r,y=new h,C=new r,w=new r;return g.computeVertices=function(a){var u,S,E,b,T=Math.cos,x=Math.sin,A=Math.sqrt,P=Math.atan,D=Math.exp,M=c.PI_OVER_TWO,I=c.toRadians,R=a.heightmap,O=a.width,N=a.height,L=a.skirtHeight,B=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),V=1/F.maximumRadius,k=a.nativeRectangle,z=a.rectangle;o(z)?(u=z.west,S=z.south,E=z.east,b=z.north):B?(u=I(k.west),S=I(k.south),E=I(k.east),b=I(k.north)):(u=k.west*V,S=M-2*P(D(-k.south*V)),E=k.east*V,b=M-2*P(D(-k.north*V)));var U=a.relativeToCenter,G=o(U);U=G?U:r.ZERO;var W,H,q=n(a.exaggeration,1),j=n(a.includeWebMercatorT,!1),Y=n(a.structure,g.DEFAULT_STRUCTURE),X=n(Y.heightScale,g.DEFAULT_STRUCTURE.heightScale),Z=n(Y.heightOffset,g.DEFAULT_STRUCTURE.heightOffset),K=n(Y.elementsPerHeight,g.DEFAULT_STRUCTURE.elementsPerHeight),Q=n(Y.stride,g.DEFAULT_STRUCTURE.stride),J=n(Y.elementMultiplier,g.DEFAULT_STRUCTURE.elementMultiplier),$=n(Y.isBigEndian,g.DEFAULT_STRUCTURE.isBigEndian),ee=p.computeWidth(k)/(O-1),te=p.computeHeight(k)/(N-1),ie=F.radiiSquared,re=ie.x,ne=ie.y,oe=ie.z,ae=65536,se=-65536,le=f.eastNorthUpToFixedFrame(U,F),ue=h.inverseTransformation(le,y);j&&(W=_.geodeticLatitudeToMercatorAngle(S),H=1/(_.geodeticLatitudeToMercatorAngle(b)-W));var ce=C;ce.x=Number.POSITIVE_INFINITY,ce.y=Number.POSITIVE_INFINITY,ce.z=Number.POSITIVE_INFINITY;var he=w;he.x=Number.NEGATIVE_INFINITY,he.y=Number.NEGATIVE_INFINITY,he.z=Number.NEGATIVE_INFINITY;var de=Number.POSITIVE_INFINITY,pe=O+(L>0?2:0),me=N+(L>0?2:0),fe=pe*me,_e=new Array(fe),ge=new Array(fe),ve=new Array(fe),ye=j?new Array(fe):[],Ce=0,we=N,Se=0,Ee=O;L>0&&(--Ce,++we,--Se,++Ee);for(var be=0,Te=Ce;Te<we;++Te){var xe=Te;xe<0&&(xe=0),xe>=N&&(xe=N-1);var Ae=k.north-te*xe;Ae=B?I(Ae):M-2*P(D(-Ae*V));var Pe=T(Ae),De=x(Ae),Me=oe*De,Ie=(Ae-S)/(b-S);Ie=c.clamp(Ie,0,1);var Re;j&&(Re=(_.geodeticLatitudeToMercatorAngle(Ae)-W)*H);for(var Oe=Se;Oe<Ee;++Oe){var Ne=Oe;Ne<0&&(Ne=0),Ne>=O&&(Ne=O-1);var Le=k.west+ee*Ne;B?Le=I(Le):Le*=V;var Be,Fe=xe*(O*Q)+Ne*Q;if(1===K)Be=R[Fe];else{Be=0;var Ve;if($)for(Ve=0;Ve<K;++Ve)Be=Be*J+R[Fe+Ve];else for(Ve=K-1;Ve>=0;--Ve)Be=Be*J+R[Fe+Ve]}Be=(Be*X+Z)*q,se=Math.max(se,Be),ae=Math.min(ae,Be),Oe===Ne&&Te===xe||(Be-=L);var ke=Pe*T(Le),ze=Pe*x(Le),Ue=re*ke,Ge=ne*ze,We=A(Ue*ke+Ge*ze+Me*De),He=1/We,qe=Ue*He,je=Ge*He,Ye=Me*He,Xe=new r;Xe.x=qe+ke*Be,Xe.y=je+ze*Be,Xe.z=Ye+De*Be,_e[be]=Xe,ge[be]=Be;var Ze=(Le-u)/(E-u);Ze=c.clamp(Ze,0,1),ve[be]=new i(Ze,Ie),j&&(ye[be]=Re),be++,h.multiplyByPoint(ue,Xe,v),r.minimumByComponent(v,ce,ce),r.maximumByComponent(v,he,he),de=Math.min(de,Be)}}var Ke,Qe=t.fromPoints(_e);o(z)&&z.width<c.PI_OVER_TWO+c.EPSILON5&&(Ke=d.fromRectangle(z,ae,se,F));var Je;if(G){var $e=new l(F);Je=$e.computeHorizonCullingPoint(U,_e)}for(var et=new e(ce,he,U),tt=new m(et,de,se,le,!1,j),it=new Float32Array(fe*tt.getStride()),rt=0,nt=0;nt<fe;++nt)rt=tt.encode(it,rt,_e[nt],ve[nt],ge[nt],void 0,ye[nt]);return{vertices:it,maximumHeight:se,minimumHeight:ae,encoding:tt,boundingSphere3D:Qe,orientedBoundingBox:Ke,occludeePointInScaledSpace:Je}},g}),i("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function i(){return!0}function r(t,r){function n(){}r=e(r,"This object was destroyed, i.e., destroy() was called.");for(var o in t)"function"==typeof t[o]&&(t[o]=n);t.isDestroyed=i}return r}),i("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";function t(t){e(i)||(i=document.createElement("a")),i.href=window.location.href;var r=i.host,n=i.protocol;return i.href=t,i.href=i.href,n!==i.protocol||r!==i.host}var i;return t}),i("Core/TaskProcessor",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./getAbsoluteUri","./isCrossOriginUrl","./RuntimeError","require"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){if(!r(f._canTransferArrayBuffer)){var t=new Worker(d("Workers/transferTypedArrayTest.js"));t.postMessage=i(t.webkitPostMessage,t.postMessage);var n=99,o=new Int8Array([n]);try{t.postMessage({array:o},[o.buffer])}catch(e){return f._canTransferArrayBuffer=!1,f._canTransferArrayBuffer}var a=e.defer();t.onmessage=function(e){var i=e.data.array,o=r(i)&&i[0]===n;a.resolve(o),t.terminate(),f._canTransferArrayBuffer=o},f._canTransferArrayBuffer=a.promise}return f._canTransferArrayBuffer}function h(e,t){--e._activeTasks;var i=t.id;if(r(i)){var n=e._deferreds,a=n[i];if(r(t.error)){var s=t.error;"RuntimeError"===s.name?(s=new l(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new o(t.error.message),s.stack=t.error.stack),a.reject(s)}else a.resolve(t.result);delete n[i]}}function d(e){var i=t(e);if(s(i)){var r,n='importScripts("'+i+'");';try{r=new Blob([n],{type:"application/javascript"})}catch(e){var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new o;a.append(n),r=a.getBlob("application/javascript")}var l=window.URL||window.webkitURL;i=l.createObjectURL(r)}return i}function p(){return r(_)||(_=d("Workers/cesiumWorkerBootstrapper.js")),_}function m(e){var n=new Worker(p());n.postMessage=i(n.webkitPostMessage,n.postMessage);var o={loaderConfig:{},workerModule:f._workerModulePrefix+e._workerName};return r(f._loaderConfig)?o.loaderConfig=f._loaderConfig:r(u.toUrl)?o.loaderConfig.baseUrl=a("..",t("Workers/cesiumWorkerBootstrapper.js")):o.loaderConfig.paths={Workers:t("Workers")},n.postMessage(o),n.onmessage=function(t){h(e,t.data)},n}function f(e,t){this._workerName=e,this._maximumActiveTasks=i(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0}var _,g=[];return f.prototype.scheduleTask=function(t,i){if(r(this._worker)||(this._worker=m(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(c(),function(o){r(i)?o||(i.length=0):i=g;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},i),s.promise})}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return r(this._worker)&&this._worker.terminate(),n(this)},f._defaultWorkerModulePrefix="Workers/",f._workerModulePrefix=f._defaultWorkerModulePrefix,f._loaderConfig=void 0,f._canTransferArrayBuffer=void 0,f}),i("Core/TerrainMesh",["./defaultValue"],function(e){"use strict";function t(t,i,r,n,o,a,s,l,u,c,h){this.center=t,this.vertices=i,this.stride=e(l,6),this.indices=r,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c,this.exaggeration=h}return t}),i("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(){i.throwInstantiationError()}t(n.prototype,{errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},hasWaterMask:{get:i.throwInstantiationError},hasVertexNormals:{get:i.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,i){var r=o[t];e(r)||(o[t]=r=[]);var n=r[i];if(!e(n)){n=r[i]=new Uint16Array((t-1)*(i-1)*6);for(var a=0,s=0,l=0;l<i-1;++l){for(var u=0;u<t-1;++u){var c=a,h=c+t,d=h+1,p=c+1;n[s++]=c,n[s++]=h,n[s++]=p,n[s++]=p,n[s++]=h,n[s++]=d,++a}++a}}return n},n.heightmapTerrainQuality=.25,n.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,i){return 2*e.maximumRadius*Math.PI*n.heightmapTerrainQuality/(t*i)},n.prototype.requestTileGeometry=i.throwInstantiationError,n.prototype.getLevelMaximumGeometricError=i.throwInstantiationError,n.prototype.getTileDataAvailable=i.throwInstantiationError,n}),i("Core/HeightmapTerrainData",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicTilingScheme","./HeightmapTessellator","./Math","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=t(e.childTileMask,15);var r=a.DEFAULT_STRUCTURE,n=e.structure;i(n)?n!==r&&(n.heightScale=t(n.heightScale,r.heightScale),n.heightOffset=t(n.heightOffset,r.heightOffset),n.elementsPerHeight=t(n.elementsPerHeight,r.elementsPerHeight),n.stride=t(n.stride,r.stride),n.elementMultiplier=t(n.elementMultiplier,r.elementMultiplier),n.isBigEndian=t(n.isBigEndian,r.isBigEndian)):n=r,this._structure=n,this._createdByUpsampling=t(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0}function m(e,t,i,r,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south),d=0|c,p=d+1;p>=a&&(p=a-1,d=a-2);var m=0|h,f=m+1;f>=s&&(f=s-1,m=s-2);var v=c-d,y=h-m;m=s-1-m,f=s-1-f;var C=g(e,t,i,r,n,m*a+d),w=g(e,t,i,r,n,m*a+p),S=g(e,t,i,r,n,f*a+d),E=g(e,t,i,r,n,f*a+p);return _(v,y,C,w,S,E)}function f(e,t,i,r,n,o,a,s,l,u,c){var h=(l-o.west)*(a-1)/(o.east-o.west),d=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(h+=1,d+=1,a+=2,s+=2);var p=n>0?a-1:a,m=0|h,f=m+1;f>=p&&(f=a-1,m=a-2);var g=n>0?s-1:s,v=0|d,y=v+1;y>=g&&(y=s-1,v=s-2);var C=h-m,w=d-v;v=s-1-v,y=s-1-y;var S=(t.decodeHeight(e,v*a+m)/c-i)/r,E=(t.decodeHeight(e,v*a+f)/c-i)/r,b=(t.decodeHeight(e,y*a+m)/c-i)/r,T=(t.decodeHeight(e,y*a+f)/c-i)/r;return _(C,w,S,E,b,T)}function _(e,t,i,r,n,o){return t<e?i+e*(r-i)+t*(o-r):i+e*(o-n)+t*(n-i)}function g(e,t,i,r,n,o){o*=r;var a,s=0;if(n)for(a=0;a<t;++a)s=s*i+e[o+a];else for(a=t-1;a>=0;--a)s=s*i+e[o+a];return s}function v(e,t,i,r,n,o,a,s){a*=n;var l;if(o)for(l=0;l<t-1;++l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;else for(l=t-1;l>0;--l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;e[a+l]=s}r(p.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(r,n,a,s,u){var p=r.ellipsoid,m=r.tileXYToNativeRectangle(n,a,s),f=r.tileXYToRectangle(n,a,s);u=t(u,1);var _=p.cartographicToCartesian(l.center(f)),g=this._structure,v=d.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,r.getNumberOfXTilesAtLevel(0)),C=v/(1<<s);this._skirtHeight=Math.min(4*C,1e3);var w=y.scheduleTask({heightmap:this._buffer,structure:g,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:m,rectangle:f,relativeToCenter:_,ellipsoid:p,skirtHeight:this._skirtHeight,isGeographic:r instanceof o,exaggeration:u});if(i(w)){var S=this;return e(w,function(e){return S._mesh=new h(_,new Float32Array(e.vertices),d.getRegularGridIndices(e.gridWidth,e.gridHeight),e.minimumHeight,e.maximumHeight,e.boundingSphere3D,e.occludeePointInScaledSpace,e.numberOfAttributes,e.orientedBoundingBox,c.clone(e.encoding),u),S._buffer=void 0,S._mesh})}},p.prototype.interpolateHeight=function(e,t,r){var n,o=this._width,a=this._height,s=this._structure,l=s.stride,u=s.elementsPerHeight,c=s.elementMultiplier,h=s.isBigEndian,d=s.heightOffset,p=s.heightScale;if(i(this._mesh)){var _=this._mesh.vertices,g=this._mesh.encoding,v=this._skirtHeight,y=this._mesh.exaggeration;n=f(_,g,d,p,v,e,o,a,t,r,y)}else n=m(this._buffer,u,c,l,h,e,o,a,t,r),n=n*p+d;return n},p.prototype.upsample=function(e,t,r,n,o,a,l){var u=this._width,c=this._height,h=this._structure,d=this._skirtHeight,m=h.stride,_=new this._bufferType(u*c*m),g=this._mesh;if(i(g)){for(var y=g.vertices,C=g.encoding,w=e.tileXYToRectangle(t,r,n),S=e.tileXYToRectangle(o,a,l),E=h.heightOffset,b=h.heightScale,T=g.exaggeration,x=h.elementsPerHeight,A=h.elementMultiplier,P=h.isBigEndian,D=Math.pow(A,x-1),M=0;M<c;++M)for(var I=s.lerp(S.north,S.south,M/(c-1)),R=0;R<u;++R){var O=s.lerp(S.west,S.east,R/(u-1)),N=f(y,C,E,b,d,w,u,c,O,I,T);N=N<h.lowestEncodedHeight?h.lowestEncodedHeight:N,N=N>h.highestEncodedHeight?h.highestEncodedHeight:N,v(_,x,A,D,m,P,M*u+R,N)}return new p({buffer:_,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},p.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},p.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},p}),i("Core/loadImage",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./isCrossOriginUrl","./TrustedServers"],function(e,t,i,r,n,o){"use strict";function a(i,r){return r=t(r,!0),e(i,function(t){var i;i=!(s.test(t)||!r)&&n(t);var o=e.defer();return a.createImage(t,i,o),o.promise})}var s=/^data:/;return a.createImage=function(e,t,i){var r=new Image;r.onload=function(){i.resolve(r)},r.onerror=function(e){i.reject(e)},t&&(o.contains(e)?r.crossOrigin="use-credentials":r.crossOrigin=""),r.src=e},a.defaultCreateImage=a.createImage,a}),i("Core/throttleRequestByServer",["../ThirdParty/Uri","../ThirdParty/when","./defaultValue"],function(e,t,i){"use strict";function r(t){var i=new e(t).resolve(a);i.normalize();var r=i.authority;return/:/.test(r)||(r=r+":"+("https"===i.scheme?"443":"80")),r}function n(e,a){var s=r(e),l=i(o[s],0);if(!(l>=n.maximumRequestsPerServer))return o[s]=l+1,t(a(e),function(e){return o[s]--,e}).otherwise(function(e){return o[s]--,t.reject(e)})}var o={},a="undefined"!=typeof document?new e(document.location.href):new e;return n.maximumRequestsPerServer=6,n}),i("Core/ArcGisImageServerTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./Math","./TerrainProvider","./throttleRequestByServer"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(n){this._url=n.url,this._token=n.token,this._tilingScheme=n.tilingScheme,r(this._tilingScheme)||(this._tilingScheme=new l({ellipsoid:i(n.ellipsoid,a.WGS84)})),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=p.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215},this._errorEvent=new s;var o=n.credit;"string"==typeof o&&(o=new t(o)),this._credit=o,this._readyPromise=e.resolve(!0)}return n(f.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),f.prototype.requestTileGeometry=function(t,i,n){var o=this._tilingScheme.tileXYToRectangle(t,i,n),a=(o.east-o.west)/(this._heightmapWidth-1),s=(o.north-o.south)/(this._heightmapWidth-1);o.west-=.5*a,o.east+=.5*a,o.south-=.5*s,o.north+=.5*s;var l=d.toDegrees(o.west)+"%2C"+d.toDegrees(o.south)+"%2C"+d.toDegrees(o.east)+"%2C"+d.toDegrees(o.north),p=this._url+"/exportImage?interpolation=RSP_BilinearInterpolation&format=tiff&f=image&size="+this._heightmapWidth+"%2C"+this._heightmapWidth+"&bboxSR=4326&imageSR=4326&bbox="+l;this._token&&(p+="&token="+this._token);var f=this._proxy;r(f)&&(p=f.getURL(p));var _=m(p,h);if(r(_)){var g=this;return e(_,function(e){return new c({buffer:u(e),width:g._heightmapWidth,height:g._heightmapWidth,childTileMask:15,structure:g._terrainDataStructure})})}},f.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},f.prototype.getTileDataAvailable=function(e,t,i){},f}),i("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(i,r,n){if(t(i)){n=e(n,!1);var a=i.length;if(a<2)return i;var s,l,u;for(s=1;s<a&&(l=i[s-1],u=i[s],!r(l,u,o));++s);if(s===a)return n&&r(i[0],i[i.length-1],o)?i.slice(1):i;for(var c=i.slice(0,s);s<a;++s)u=i[s],r(l,u,o)||(c.push(u),l=u);return n&&c.length>1&&r(c[0],c[c.length-1],o)&&c.shift(),c}}var o=r.EPSILON10;return n}),i("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._array=[],this._hash={}}return t(r.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),r.prototype.contains=function(t){return e(this._hash[t])},r.prototype.set=function(e,t){var i=this._hash[e];t!==i&&(this.remove(e),this._hash[e]=t,this._array.push(t))},r.prototype.get=function(e){return this._hash[e]},r.prototype.remove=function(t){var i=this._hash[t],r=e(i);if(r){var n=this._array;n.splice(n.indexOf(i),1),delete this._hash[t]}return r},r.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},r}),i("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var h,d,p,m,f,_,g,v;i(n.z)?(h=t.subtract(l,n,o),d=t.subtract(u,n,a),p=t.subtract(r,n,s),m=t.dot(h,h),f=t.dot(h,d),_=t.dot(h,p),g=t.dot(d,d),v=t.dot(d,p)):(h=e.subtract(l,n,o),d=e.subtract(u,n,a),p=e.subtract(r,n,s),m=e.dot(h,h),f=e.dot(h,d),_=e.dot(h,p),g=e.dot(d,d),v=e.dot(d,p));var y=1/(m*g-f*f);return c.y=(g*_-f*v)*y,c.z=(m*v-f*_)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),i("Core/BingMapsApi",["./Credit","./defined"],function(e,t){"use strict";var i={};i.defaultKey=void 0;var r,n=!1,o="This application is using Cesium's default Bing Maps key.  Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API.";return i.getKey=function(e){return t(e)?e:t(i.defaultKey)?i.defaultKey:(n||(console.log(o),n=!0),"AhiQlDaPOwKbStA_3nJIdimUj4PRYkp0yHwcNpvxVlLNPRo5ZJWY5oX_h6B_dMbm")},i.getErrorCredit=function(n){if(!t(n)&&!t(i.defaultKey))return t(r)||(r=new e(o)),r},i}),i("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./defaultValue","./defined","./DeveloperError","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,r,n){this.x=i(e,0),this.y=i(t,0),this.width=i(r,0),this.height=i(n,0)}l.packedLength=4,l.pack=function(e,t,r){return r=i(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.width,t[r]=e.height,t},l.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},l.fromPoints=function(e,t){if(r(t)||(t=new l),!r(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var i=e.length,n=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;u<i;u++){var c=e[u],h=c.x,d=c.y;n=Math.min(h,n),a=Math.max(h,a),o=Math.min(d,o),s=Math.max(d,s)}return t.x=n,t.y=o,t.width=a-n,t.height=s-o,t};var u=new o,c=new t,h=new t;return l.fromRectangle=function(t,n,o){if(r(o)||(o=new l),!r(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;n=i(n,u);var a=n.project(s.southwest(t,c)),d=n.project(s.northeast(t,h));return e.subtract(d,a,d),o.x=a.x,o.y=a.y,o.width=d.x,o.height=d.y,o},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new l(e.x,e.y,e.width,e.height)},l.union=function(e,t,i){r(i)||(i=new l);var n=Math.min(e.x,t.x),o=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return i.x=n,i.y=o,i.width=a-n,i.height=s-o,i},l.expand=function(e,t,i){i=l.clone(e,i);var r=t.x-i.x,n=t.y-i.y;return r>i.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),n>i.height?i.height=n:n<0&&(i.height-=n,i.y=t.y),i},l.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,o=t.y;return i>n+t.width||i+e.width<n||r+e.height<o||r>o+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),i("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),i("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===i.POINTS||e===i.LINES||e===i.LINE_LOOP||e===i.LINE_STRIP||e===i.TRIANGLES||e===i.TRIANGLE_STRIP||e===i.TRIANGLE_FAN}};return e(i)}),i("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,i,r,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,n.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return o.computeNumberOfVertices=function(e){var i=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var n=e.attributes[r],o=n.values.length/n.componentsPerAttribute;i=o}return i},o}),i("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(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 r}),i("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.binormal=t.binormal,this.tangent=t.tangent,this.color=t.color}return t}),i("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.binormal=e(t.binormal,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=r(new n({position:!0})),n.POSITION_AND_NORMAL=r(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=r(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=r(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=r(new n({position:!0,color:!0})),n.ALL=r(new n({position:!0,normal:!0,st:!0,binormal:!0,tangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,i,r){return r=e(r,0),i[r++]=t.position?1:0,i[r++]=t.normal?1:0,i[r++]=t.st?1:0,i[r++]=t.binormal?1:0,i[r++]=t.tangent?1:0,i[r++]=t.color?1:0,i},n.unpack=function(i,r,o){return r=e(r,0),t(o)||(o=new n),o.position=1===i[r++],o.normal=1===i[r++],o.st=1===i[r++],o.binormal=1===i[r++],o.tangent=1===i[r++],o.color=1===i[r++],o},n.clone=function(e,i){if(t(e))return t(i)||(i=new n),i.position=e.position,i.normal=e.normal,i.st=e.st,i.binormal=e.binormal,i.tangent=e.tangent,i.color=e.color,i},n}),i("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum,o=r(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(i),this._maximum=t.clone(n),this._vertexFormat=o,this._workerName="createBoxGeometry"}var d=new t;h.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new h({minimum:t.negate(n,new t),maximum:n,vertexFormat:e.vertexFormat})},h.fromAxisAlignedBoundingBox=function(e){return new h({minimum:e.minimum,maximum:e.maximum})},h.packedLength=2*t.packedLength+c.packedLength,h.pack=function(e,i,n){return n=r(n,0),t.pack(e._minimum,i,n),t.pack(e._maximum,i,n+t.packedLength),c.pack(e._vertexFormat,i,n+2*t.packedLength),i};var p=new t,m=new t,f=new c,_={minimum:p,maximum:m,vertexFormat:f};return h.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,p),s=t.unpack(e,i+t.packedLength,m),l=c.unpack(e,i+2*t.packedLength,f);return n(o)?(o._minimum=t.clone(a,o._minimum),
o._maximum=t.clone(s,o._maximum),o._vertexFormat=c.clone(l,o._vertexFormat),o):new h(_)},h.createGeometry=function(r){var n=r._minimum,o=r._maximum,c=r._vertexFormat;if(!t.equals(n,o)){var h,p,m=new l;if(c.position&&(c.st||c.normal||c.binormal||c.tangent)){if(c.position&&(p=new Float64Array(72),p[0]=n.x,p[1]=n.y,p[2]=o.z,p[3]=o.x,p[4]=n.y,p[5]=o.z,p[6]=o.x,p[7]=o.y,p[8]=o.z,p[9]=n.x,p[10]=o.y,p[11]=o.z,p[12]=n.x,p[13]=n.y,p[14]=n.z,p[15]=o.x,p[16]=n.y,p[17]=n.z,p[18]=o.x,p[19]=o.y,p[20]=n.z,p[21]=n.x,p[22]=o.y,p[23]=n.z,p[24]=o.x,p[25]=n.y,p[26]=n.z,p[27]=o.x,p[28]=o.y,p[29]=n.z,p[30]=o.x,p[31]=o.y,p[32]=o.z,p[33]=o.x,p[34]=n.y,p[35]=o.z,p[36]=n.x,p[37]=n.y,p[38]=n.z,p[39]=n.x,p[40]=o.y,p[41]=n.z,p[42]=n.x,p[43]=o.y,p[44]=o.z,p[45]=n.x,p[46]=n.y,p[47]=o.z,p[48]=n.x,p[49]=o.y,p[50]=n.z,p[51]=o.x,p[52]=o.y,p[53]=n.z,p[54]=o.x,p[55]=o.y,p[56]=o.z,p[57]=n.x,p[58]=o.y,p[59]=o.z,p[60]=n.x,p[61]=n.y,p[62]=n.z,p[63]=o.x,p[64]=n.y,p[65]=n.z,p[66]=o.x,p[67]=n.y,p[68]=o.z,p[69]=n.x,p[70]=n.y,p[71]=o.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p})),c.normal){var f=new Float32Array(72);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=0,f[5]=1,f[6]=0,f[7]=0,f[8]=1,f[9]=0,f[10]=0,f[11]=1,f[12]=0,f[13]=0,f[14]=-1,f[15]=0,f[16]=0,f[17]=-1,f[18]=0,f[19]=0,f[20]=-1,f[21]=0,f[22]=0,f[23]=-1,f[24]=1,f[25]=0,f[26]=0,f[27]=1,f[28]=0,f[29]=0,f[30]=1,f[31]=0,f[32]=0,f[33]=1,f[34]=0,f[35]=0,f[36]=-1,f[37]=0,f[38]=0,f[39]=-1,f[40]=0,f[41]=0,f[42]=-1,f[43]=0,f[44]=0,f[45]=-1,f[46]=0,f[47]=0,f[48]=0,f[49]=1,f[50]=0,f[51]=0,f[52]=1,f[53]=0,f[54]=0,f[55]=1,f[56]=0,f[57]=0,f[58]=1,f[59]=0,f[60]=0,f[61]=-1,f[62]=0,f[63]=0,f[64]=-1,f[65]=0,f[66]=0,f[67]=-1,f[68]=0,f[69]=0,f[70]=-1,f[71]=0,m.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:f})}if(c.st){var _=new Float32Array(48);_[0]=0,_[1]=0,_[2]=1,_[3]=0,_[4]=1,_[5]=1,_[6]=0,_[7]=1,_[8]=1,_[9]=0,_[10]=0,_[11]=0,_[12]=0,_[13]=1,_[14]=1,_[15]=1,_[16]=0,_[17]=0,_[18]=1,_[19]=0,_[20]=1,_[21]=1,_[22]=0,_[23]=1,_[24]=1,_[25]=0,_[26]=0,_[27]=0,_[28]=0,_[29]=1,_[30]=1,_[31]=1,_[32]=1,_[33]=0,_[34]=0,_[35]=0,_[36]=0,_[37]=1,_[38]=1,_[39]=1,_[40]=0,_[41]=0,_[42]=1,_[43]=0,_[44]=1,_[45]=1,_[46]=0,_[47]=1,m.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:_})}if(c.tangent){var g=new Float32Array(72);g[0]=1,g[1]=0,g[2]=0,g[3]=1,g[4]=0,g[5]=0,g[6]=1,g[7]=0,g[8]=0,g[9]=1,g[10]=0,g[11]=0,g[12]=-1,g[13]=0,g[14]=0,g[15]=-1,g[16]=0,g[17]=0,g[18]=-1,g[19]=0,g[20]=0,g[21]=-1,g[22]=0,g[23]=0,g[24]=0,g[25]=1,g[26]=0,g[27]=0,g[28]=1,g[29]=0,g[30]=0,g[31]=1,g[32]=0,g[33]=0,g[34]=1,g[35]=0,g[36]=0,g[37]=-1,g[38]=0,g[39]=0,g[40]=-1,g[41]=0,g[42]=0,g[43]=-1,g[44]=0,g[45]=0,g[46]=-1,g[47]=0,g[48]=-1,g[49]=0,g[50]=0,g[51]=-1,g[52]=0,g[53]=0,g[54]=-1,g[55]=0,g[56]=0,g[57]=-1,g[58]=0,g[59]=0,g[60]=1,g[61]=0,g[62]=0,g[63]=1,g[64]=0,g[65]=0,g[66]=1,g[67]=0,g[68]=0,g[69]=1,g[70]=0,g[71]=0,m.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(c.binormal){var v=new Float32Array(72);v[0]=0,v[1]=1,v[2]=0,v[3]=0,v[4]=1,v[5]=0,v[6]=0,v[7]=1,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=0,v[13]=1,v[14]=0,v[15]=0,v[16]=1,v[17]=0,v[18]=0,v[19]=1,v[20]=0,v[21]=0,v[22]=1,v[23]=0,v[24]=0,v[25]=0,v[26]=1,v[27]=0,v[28]=0,v[29]=1,v[30]=0,v[31]=0,v[32]=1,v[33]=0,v[34]=0,v[35]=1,v[36]=0,v[37]=0,v[38]=1,v[39]=0,v[40]=0,v[41]=1,v[42]=0,v[43]=0,v[44]=1,v[45]=0,v[46]=0,v[47]=1,v[48]=0,v[49]=0,v[50]=1,v[51]=0,v[52]=0,v[53]=1,v[54]=0,v[55]=0,v[56]=1,v[57]=0,v[58]=0,v[59]=1,v[60]=0,v[61]=0,v[62]=1,v[63]=0,v[64]=0,v[65]=1,v[66]=0,v[67]=0,v[68]=1,v[69]=0,v[70]=0,v[71]=1,m.binormal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:v})}h=new Uint16Array(36),h[0]=0,h[1]=1,h[2]=2,h[3]=0,h[4]=2,h[5]=3,h[6]=6,h[7]=5,h[8]=4,h[9]=7,h[10]=6,h[11]=4,h[12]=8,h[13]=9,h[14]=10,h[15]=8,h[16]=10,h[17]=11,h[18]=14,h[19]=13,h[20]=12,h[21]=15,h[22]=14,h[23]=12,h[24]=18,h[25]=17,h[26]=16,h[27]=19,h[28]=18,h[29]=16,h[30]=20,h[31]=21,h[32]=22,h[33]=20,h[34]=22,h[35]=23}else p=new Float64Array(24),p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,m.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),h=new Uint16Array(36),h[0]=4,h[1]=5,h[2]=6,h[3]=4,h[4]=6,h[5]=7,h[6]=1,h[7]=0,h[8]=3,h[9]=1,h[10]=3,h[11]=2,h[12]=1,h[13]=6,h[14]=5,h[15]=1,h[16]=2,h[17]=6,h[18]=2,h[19]=3,h[20]=7,h[21]=2,h[22]=7,h[23]=6,h[24]=3,h[25]=0,h[26]=4,h[27]=3,h[28]=4,h[29]=7,h[30]=0,h[31]=1,h[32]=5,h[33]=0,h[34]=5,h[35]=4;var y=t.subtract(o,n,d),C=.5*t.magnitude(y);return new a({attributes:m,indices:h,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,C)})}},h}),i("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum;this._min=t.clone(i),this._max=t.clone(n),this._workerName="createBoxOutlineGeometry"}var h=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new c({minimum:t.negate(n,new t),maximum:n})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,i,n){return n=r(n,0),t.pack(e._min,i,n),t.pack(e._max,i,n+t.packedLength),i};var d=new t,p=new t,m={minimum:d,maximum:p};return c.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,d),s=t.unpack(e,i+t.packedLength,p);return n(o)?(o._min=t.clone(a,o._min),o._max=t.clone(s,o._max),o):new c(m)},c.createGeometry=function(r){var n=r._min,o=r._max;if(!t.equals(n,o)){var c=new l,d=new Uint16Array(24),p=new Float64Array(24);p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,c.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),d[0]=4,d[1]=5,d[2]=5,d[3]=6,d[4]=6,d[5]=7,d[6]=7,d[7]=4,d[8]=0,d[9]=1,d[10]=1,d[11]=2,d[12]=2,d[13]=3,d[14]=3,d[15]=0,d[16]=0,d[17]=4,d[18]=1,d[19]=5,d[20]=2,d[21]=6,d[22]=3,d[23]=7;var m=t.subtract(o,n,h),f=.5*t.magnitude(m);return new a({attributes:c,indices:d,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,f)})}},c}),i("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){i(e)}if("undefined"!=typeof window){var i=window.cancelAnimationFrame;return function(){if(!e(i))for(var t=["webkit","moz","ms","o"],r=0,n=t.length;r<n&&!e(i);)i=window[t[r]+"CancelAnimationFrame"],e(i)||(i=window[t[r]+"CancelRequestAnimationFrame"]),++r;e(i)||(i=clearTimeout)}(),t}}),i("Core/Spline",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(){this.times=void 0,this.points=void 0,i.throwInstantiationError()}return r.prototype.evaluate=i.throwInstantiationError,r.prototype.findTimeInterval=function(t,i){var r=this.times,n=r.length;if(i=e(i,0),t>=r[i]){if(i+1<n&&t<r[i+1])return i;if(i+2<n&&t<r[i+2])return i+1}else if(i-1>=0&&t>=r[i-1])return i-1;var o;if(t>r[i])for(o=i;o<n-1&&!(t>=r[o]&&t<r[o+1]);++o);else for(o=i-1;o>=0&&!(t>=r[o]&&t<r[o+1]);--o);return o===n-1&&(o=n-2),o},r}),i("Core/LinearSpline",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Spline"],function(e,t,i,r,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var i=e.points,r=e.times;this._times=r,this._points=i,this._lastTimeIndex=0}return r(a.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.evaluate=function(t,r){var n=this.points,o=this.times,a=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),s=(t-o[a])/(o[a+1]-o[a]);return i(r)||(r=new e),e.lerp(n[a],n[a+1],s,r)},a}),i("Core/TridiagonalSystemSolver",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.solve=function(t,i,r,n){var o,a=new Array(r.length),s=new Array(n.length),l=new Array(n.length);for(o=0;o<s.length;o++)s[o]=new e,l[o]=new e;a[0]=r[0]/i[0],s[0]=e.multiplyByScalar(n[0],1/i[0],s[0]);var u;for(o=1;o<a.length;++o)u=1/(i[o]-a[o-1]*t[o-1]),a[o]=r[o]*u,s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]);for(u=1/(i[o]-a[o-1]*t[o-1]),s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]),l[l.length-1]=s[s.length-1],o=l.length-2;o>=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},r}),i("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,n){var o=p,a=f,s=m,l=_;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var h=l[0];for(r(h)||(h=l[0]=new e),e.clone(i,h),c=1;c<o.length-1;++c)o[c]=a[c]=1,s[c]=4,h=l[c],r(h)||(h=l[c]=new e),e.subtract(t[c+1],t[c-1],h),e.multiplyByScalar(h,3,h);return o[c]=0,a[c]=1,s[c]=4,h=l[c],r(h)||(h=l[c]=new e),e.subtract(t[c+1],t[c-1],h),e.multiplyByScalar(h,3,h),s[c+1]=1,h=l[c+1],r(h)||(h=l[c+1]=new e),e.clone(n,h),u.solve(o,s,a,l)}function h(t){var i=p,n=f,o=m,a=_;i.length=n.length=t.length-1,o.length=a.length=t.length;var s;i[0]=n[0]=1,o[0]=2;var l=a[0];for(r(l)||(l=a[0]=new e),e.subtract(t[1],t[0],l),e.multiplyByScalar(l,3,l),s=1;s<i.length;++s)i[s]=n[s]=1,o[s]=4,l=a[s],r(l)||(l=a[s]=new e),e.subtract(t[s+1],t[s-1],l),e.multiplyByScalar(l,3,l);return o[s]=2,l=a[s],r(l)||(l=a[s]=new e),e.subtract(t[s],t[s-1],l),e.multiplyByScalar(l,3,l),u.solve(i,o,n,a)}function d(e){e=i(e,i.EMPTY_OBJECT);var t=e.points,r=e.times,n=e.inTangents,o=e.outTangents;this._times=r,this._points=t,this._inTangents=n,this._outTangents=o,this._lastTimeIndex=0}var p=[],m=[],f=[],_=[];n(d.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}}),d.createC1=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points,n=e.tangents,o=n.slice(0,n.length-1),a=n.slice(1,n.length);return new d({times:t,points:r,inTangents:a,outTangents:o})},d.createNaturalCubic=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points;if(r.length<3)return new a({points:r,times:t});var n=h(r),o=n.slice(0,n.length-1),s=n.slice(1,n.length);return new d({times:t,points:r,inTangents:s,outTangents:o})},d.createClampedCubic=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.times,r=e.points,n=e.firstTangent,o=e.lastTangent;if(r.length<3)return new a({points:r,times:t});var s=c(r,n,o),l=s.slice(0,s.length-1),u=s.slice(1,s.length);return new d({times:t,points:r,inTangents:u,outTangents:l})},d.hermiteCoefficientMatrix=new s(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),d.prototype.findTimeInterval=l.prototype.findTimeInterval;var g=new t,v=new e;return d.prototype.evaluate=function(t,i){r(i)||(i=new e);var n=this.points,o=this.times,a=this.inTangents,l=this.outTangents,u=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),c=(t-o[u])/(o[u+1]-o[u]),h=g;h.z=c,h.y=c*c,h.x=h.y*c,h.w=1;var p=s.multiplyByVector(d.hermiteCoefficientMatrix,h,h);return i=e.multiplyByScalar(n[u],p.x,i),e.multiplyByScalar(n[u+1],p.y,v),e.add(i,v,i),e.multiplyByScalar(l[u],p.z,v),e.add(i,v,i),e.multiplyByScalar(a[u],p.w,v),e.add(i,v,i)},d}),i("Core/CatmullRomSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./HermiteSpline","./Matrix4","./Spline"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){var i=t.points,n=t.times;if(i.length<3){var o=n[0],l=1/(n[1]-o),u=i[0],m=i[1];return function(t,i){r(i)||(i=new e);var n=(t-o)*l;return e.lerp(u,m,n,i)}}return function(o,l){r(l)||(l=new e);var u=t._lastTimeIndex=t.findTimeInterval(o,t._lastTimeIndex),m=(o-n[u])/(n[u+1]-n[u]),f=h;f.z=m,f.y=m*m,f.x=f.y*m,f.w=1;var _,g,v,y,C;return 0===u?(_=i[0],g=i[1],v=t.firstTangent,y=e.subtract(i[2],_,d),e.multiplyByScalar(y,.5,y),C=s.multiplyByVector(a.hermiteCoefficientMatrix,f,f)):u===i.length-2?(_=i[u],g=i[u+1],y=t.lastTangent,v=e.subtract(g,i[u-1],d),e.multiplyByScalar(v,.5,v),C=s.multiplyByVector(a.hermiteCoefficientMatrix,f,f)):(_=i[u-1],g=i[u],v=i[u+1],y=i[u+2],C=s.multiplyByVector(c.catmullRomCoefficientMatrix,f,f)),l=e.multiplyByScalar(_,C.x,l),e.multiplyByScalar(g,C.y,p),e.add(l,p,l),e.multiplyByScalar(v,C.z,p),e.add(l,p,l),e.multiplyByScalar(y,C.w,p),e.add(l,p,l)}}function c(t){t=i(t,i.EMPTY_OBJECT);var n=t.points,o=t.times,a=t.firstTangent,s=t.lastTangent;if(n.length>2&&(r(a)||(a=m,e.multiplyByScalar(n[1],2,a),e.subtract(a,n[2],a),e.subtract(a,n[0],a),e.multiplyByScalar(a,.5,a)),!r(s))){var l=n.length-1;s=f,e.multiplyByScalar(n[l-1],2,s),e.subtract(n[l],s,s),e.add(s,n[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=n,this._firstTangent=e.clone(a),this._lastTangent=e.clone(s),this._evaluateFunction=u(this),this._lastTimeIndex=0}var h=new t,d=new e,p=new e,m=new e,f=new e;return n(c.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}}),c.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c.prototype.findTimeInterval=l.prototype.findTimeInterval,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),i("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,i,r,n){"use strict";var o={UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,UNSIGNED_INT:n.UNSIGNED_INT};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(t){return e(t)&&(t===o.UNSIGNED_BYTE||t===o.UNSIGNED_SHORT||t===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,i,n){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,n):new Uint16Array(t,i,n)},i(o)}),i("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"arraybuffer",headers:i})}return t}),i("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,i,r,n,o,a){t(a)?a.length=0:a=[];var s,l,u;i?(s=r<e,l=n<e,u=o<e):(s=r>e,l=n>e,u=o>e);var c,h,d,p,m,f,_=s+l+u;return 1===_?s?(c=(e-r)/(n-r),h=(e-r)/(o-r),a.push(1),a.push(2),1!==h&&(a.push(-1),a.push(0),a.push(2),a.push(h)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(d=(e-n)/(o-n),p=(e-n)/(r-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==d&&(a.push(-1),a.push(1),a.push(2),a.push(d))):u&&(m=(e-o)/(r-o),f=(e-o)/(n-o),a.push(0),a.push(1),1!==f&&(a.push(-1),a.push(2),a.push(1),a.push(f)),1!==m&&(a.push(-1),a.push(2),a.push(0),a.push(m))):2===_?s||r===e?l||n===e?u||o===e||(h=(e-r)/(o-r),d=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(h),a.push(-1),a.push(1),a.push(2),a.push(d)):(f=(e-o)/(n-o),c=(e-r)/(n-r),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(f),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(r-n),m=(e-o)/(r-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(m)):3!==_&&(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(i,r,n,o,a,s,l,u,c){var h=n-l,d=l-a,p=s-u,m=o-u,f=1/(p*h+d*m),_=r-u,g=i-l,v=(p*g+d*_)*f,y=(-m*g+h*_)*f,C=1-v-y;return t(c)?(c.x=v,c.y=y,c.z=C,c):new e(v,y,C)},r}),i("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){function t(e,t){return a[e]-a[t]}function i(e,t){return o[e]-o[t]}this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint;var r=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,r),a=this._vValues=this._quantizedVertices.subarray(r,2*r);this._heightValues=this._quantizedVertices.subarray(2*r,3*r),this._westIndices=_(e.westIndices,t,r),this._southIndices=_(e.southIndices,i,r),this._eastIndices=_(e.eastIndices,t,r),this._northIndices=_(e.northIndices,i,r),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function _(e,t,i){y.length=e.length;for(var r=!1,n=0,o=e.length;n<o;++n)y[n]=e[n],r=r||n>0&&t(e[n-1],e[n])>0;return r?(y.sort(t),l.createTypedArray(i,y)):e}function g(e,t,i){for(var r=e._mesh,n=r.vertices,o=r.encoding,a=r.indices,s=0,l=a.length;s<l;s+=3){var c=a[s],h=a[s+1],d=a[s+2],p=o.decodeTextureCoordinates(n,c,b),m=o.decodeTextureCoordinates(n,h,T),f=o.decodeTextureCoordinates(n,d,x),_=u.computeBarycentricCoordinates(t,i,p.x,p.y,m.x,m.y,f.x,f.y,E);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){var g=o.decodeHeight(n,c),v=o.decodeHeight(n,h),y=o.decodeHeight(n,d);return _.x*g+_.y*v+_.z*y}}}function v(e,t,i){for(var r=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s<l;s+=3){var h=a[s],d=a[s+1],p=a[s+2],m=r[h],f=r[d],_=r[p],g=n[h],v=n[d],y=n[p],C=u.computeBarycentricCoordinates(t,i,m,g,f,v,_,y,E);if(C.x>=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){var w=C.x*o[h]+C.y*o[d]+C.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,w/S)}}}a(f.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=[],C=new d("createVerticesFromQuantizedTerrainMesh");f.prototype.createMesh=function(t,i,r,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(i,r,a);s=n(s,1);var h=C.scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(h)){var d=this;return e(h,function(e){var t=d._quantizedVertices.length/3;t+=d._westIndices.length+d._southIndices.length+d._eastIndices.length+d._northIndices.length;var i=l.createTypedArray(t,e.indices),r=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,u=e.maximumHeight,c=n(e.boundingSphere,d._boundingSphere),h=n(e.orientedBoundingBox,d._orientedBoundingBox),f=d._horizonOcclusionPoint,_=e.vertexStride,g=p.clone(e.encoding);return d._skirtIndex=e.skirtIndex,d._vertexCountWithoutSkirts=d._quantizedVertices.length/3,d._mesh=new m(o,r,i,a,u,c,f,_,h,g,s),d._quantizedVertices=void 0,d._encodedNormals=void 0,d._indices=void 0,d._uValues=void 0,d._vValues=void 0,d._heightValues=void 0,d._westIndices=void 0,d._southIndices=void 0,d._eastIndices=void 0,d._northIndices=void 0,d._mesh})}};var w=new d("upsampleQuantizedTerrainMesh");f.prototype.upsample=function(i,n,a,s,u,c,d){var p=this._mesh;if(o(this._mesh)){var m=2*n!==u,_=2*a===c,g=i.ellipsoid,v=i.tileXYToRectangle(u,c,d),y=w.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:m,isNorthChild:_,childRectangle:v,ellipsoid:g,exaggeration:p.exaggeration});if(o(y)){var C=Math.min(this._westSkirtHeight,this._eastSkirtHeight);C=Math.min(C,this._southSkirtHeight),C=Math.min(C,this._northSkirtHeight);var S=m?.5*C:this._westSkirtHeight,E=_?.5*C:this._southSkirtHeight,b=m?this._eastSkirtHeight:.5*C,T=_?this._northSkirtHeight:.5*C;return e(y,function(e){var i,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new f({quantizedVertices:n,indices:a,encodedNormals:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:h.clone(e.orientedBoundingBox),horizonOcclusionPoint:r.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:S,southSkirtHeight:E,eastSkirtHeight:b,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0})})}}};var S=32767,E=new r;f.prototype.interpolateHeight=function(e,t,i){var r=c.clamp((t-e.west)/e.width,0,1);r*=S;var n=c.clamp((i-e.south)/e.height,0,1);return n*=S,o(this._mesh)?void g(this,r,n):v(this,r,n)};var b=new i,T=new i,x=new i;return f.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},f.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},f}),i("Core/formatError",["./defined"],function(e){"use strict";function t(t){var i,r=t.name,n=t.message;i=e(r)&&e(n)?r+": "+n:t.toString();var o=t.stack;return e(o)&&(i+="\n"+o),i}return t}),i("Core/TileProviderError",["./defaultValue","./defined","./formatError"],function(e,t,i){"use strict";function r(t,i,r,n,o,a,s){this.provider=t,this.message=i,this.x=r,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1,this.error=s}return r.handleError=function(e,n,o,a,s,l,u,c,h){var d=e;return t(e)?(d.provider=n,d.message=a,d.x=s,d.y=l,d.level=u,d.retry=!1,d.error=h,++d.timesRetried):d=new r(n,a,s,l,u,0,h),o.numberOfListeners>0?o.raiseEvent(d):console.log('An error occurred in "'+n.constructor.name+'": '+i(a)),d.retry&&t(c)&&c(),d},r.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},r}),i("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(i){function r(t){var i;if(!t.format)return i="The tile format is not specified in the layer.json file.",void(m=w.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));if(!t.tiles||0===t.tiles.length)return i="The layer.json file does not specify any tile URL templates.",void(m=w.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));if("heightmap-1.0"===t.format)_._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},_._hasWaterMask=!0,_._requestWaterMask=!0;else if(0!==t.format.indexOf("quantized-mesh-1."))return i='The tile format "'+t.format+'" is invalid or not supported.',void(m=w.handleError(m,_,_._errorEvent,i,void 0,void 0,void 0,l));_._tileUrlTemplates=t.tiles;for(var r=0;r<_._tileUrlTemplates.length;++r){var o=new e(_._tileUrlTemplates[r]),s=new e(_._url);o.authority&&!s.authority&&(s.authority=o.authority,s.scheme=o.scheme),_._tileUrlTemplates[r]=p(s,o).toString().replace("{version}",t.version)}_._availableTiles=t.available,!a(_._credit)&&a(t.attribution)&&null!==t.attribution&&(_._credit=new n(t.attribution)),a(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?_._hasVertexNormals=!0:a(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(_._hasVertexNormals=!0,_._littleEndianExtensionSize=!1),a(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(_._hasWaterMask=!0),_._ready=!0,_._readyPromise.resolve(!0)}function s(e){if(a(e)&&404===e.statusCode)return void r({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]});var t="An error occurred while accessing "+d+".";m=w.handleError(m,_,_._errorEvent,t,void 0,void 0,void 0,l)}function l(){var e=f(d);t(e,r,s)}this._url=i.url,this._proxy=i.proxy,this._tilingScheme=new c({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:i.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=y.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=o(i.requestVertexNormals,!1),this._littleEndianExtensionSize=!0,this._requestWaterMask=o(i.requestWaterMask,!1),this._errorEvent=new u;var h=i.credit;"string"==typeof h&&(h=new n(h)),this._credit=h,this._ready=!1,this._readyPromise=t.defer();var d=p(this._url,"layer.json");a(this._proxy)&&(d=this._proxy.getURL(d));var m,_=this;l()}function E(e){if(a(e)&&0!==e.length){var t=e.join("-");return{Accept:"application/vnd.quantized-mesh;extensions="+t+",application/octet-stream;q=0.9,*/*;q=0.01"}}return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function b(e,t,i,r,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new h({buffer:a,childTileMask:new Uint8Array(t,a.byteLength,1)[0],waterMask:new Uint8Array(t,a.byteLength+1,t.byteLength-a.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure})}function T(e,t,n,o,a,s){function l(e){return e>>1^-(1&e)}var u=0,c=3,h=c+1,p=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*h,f=3,y=Uint16Array.BYTES_PER_ELEMENT*f,C=3,w=Uint16Array.BYTES_PER_ELEMENT,S=w*C,E=new DataView(t),b=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var T=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var A=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var D=new i(new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0)),E.getFloat64(u+p,!0));u+=m;var M=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var I=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var R=new Uint16Array(t,u,3*I);u+=I*y,I>65536&&(w=Uint32Array.BYTES_PER_ELEMENT,S=w*C);var O,N=R.subarray(0,I),L=R.subarray(I,2*I),B=R.subarray(2*I,3*I),F=0,V=0,k=0;for(O=0;O<I;++O)F+=l(N[O]),V+=l(L[O]),k+=l(B[O]),N[O]=F,L[O]=V,B[O]=k;u%w!==0&&(u+=w-u%w);var z=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var U=d.createTypedArrayFromArrayBuffer(I,t,u,z*C);u+=z*S;var G=0;for(O=0;O<U.length;++O){var W=U[O];U[O]=G-W,0===W&&++G}var H=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var q=d.createTypedArrayFromArrayBuffer(I,t,u,H);u+=H*w;var j=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var Y=d.createTypedArrayFromArrayBuffer(I,t,u,j);u+=j*w;var X=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var Z=d.createTypedArrayFromArrayBuffer(I,t,u,X);u+=X*w;var K=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var Q=d.createTypedArrayFromArrayBuffer(I,t,u,K);u+=K*w;for(var J,$;u<E.byteLength;){var ee=E.getUint8(u,!0);u+=Uint8Array.BYTES_PER_ELEMENT;var te=E.getUint32(u,e._littleEndianExtensionSize);u+=Uint32Array.BYTES_PER_ELEMENT,ee===P.OCT_VERTEX_NORMALS&&e._requestVertexNormals?J=new Uint8Array(t,u,2*I):ee===P.WATER_MASK&&e._requestWaterMask&&($=new Uint8Array(t,u,te)),u+=te}var ie,re=5*e.getLevelMaximumGeometricError(n),ne=e._tilingScheme.tileXYToRectangle(o,a,n);return ne.width<_.PI_OVER_TWO+_.EPSILON5&&(ie=g.fromRectangle(ne,T,A,e._tilingScheme.ellipsoid)),new v({center:b,minimumHeight:T,maximumHeight:A,boundingSphere:D,orientedBoundingBox:ie,horizonOcclusionPoint:M,quantizedVertices:R,encodedNormals:J,indices:U,westIndices:q,southIndices:Y,eastIndices:Z,northIndices:Q,westSkirtHeight:re,southSkirtHeight:re,eastSkirtHeight:re,northSkirtHeight:re,childTileMask:x(e,n,o,s),waterMask:$})}function x(e,t,i,r){var n=e._availableTiles;if(!n||0===n.length)return 15;var o=t+1;if(o>=n.length)return 0;var a=n[o],s=0;return s|=A(a,2*i,2*r)?1:0,s|=A(a,2*i+1,2*r)?2:0,s|=A(a,2*i,2*r+1)?4:0,s|=A(a,2*i+1,2*r+1)?8:0}function A(e,t,i){for(var r=0,n=e.length;r<n;++r){var o=e[r];if(t>=o.startX&&t<=o.endX&&i>=o.startY&&i<=o.endY)return!0}return!1}var P={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return S.prototype.requestTileGeometry=function(e,i,r,n){function s(e){return m(e,E(f))}var l=this._tileUrlTemplates;if(0!==l.length){var u=this._tilingScheme.getNumberOfYTilesAtLevel(r),c=u-i-1,h=l[(e+c+r)%l.length].replace("{z}",r).replace("{x}",e).replace("{y}",c),d=this._proxy;a(d)&&(h=d.getURL(h));var p,f=[];if(this._requestVertexNormals&&this._hasVertexNormals&&f.push(this._littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&this._hasWaterMask&&f.push("watermask"),n=o(n,!0)){if(p=C(h,s),!a(p))return}else p=s(h);var _=this;return t(p,function(t){return a(_._heightmapStructure)?b(_,t,r,e,i,c):T(_,t,r,e,i,c)})}},s(S.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}}}),S.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},S.prototype.getTileDataAvailable=function(e,t,i){var r=this._availableTiles;if(r&&0!==r.length){if(i>=r.length)return!1;var n=r[i],o=this._tilingScheme.getNumberOfYTilesAtLevel(i),a=o-t-1;return A(n,e,a)}},S}),i("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,i,r){"use strict";function n(t,n,o,c,h,d,p,m,f,_){var g=t+n;e.multiplyByScalar(c,Math.cos(g),a),e.multiplyByScalar(o,Math.sin(g),s),e.add(a,s,a);var v=Math.cos(t);v*=v;var y=Math.sin(t);y*=y;var C=d/Math.sqrt(p*v+h*y),w=C/m;return r.fromAxisAngle(a,w,l),i.fromQuaternion(l,u),i.multiplyByVector(u,f,_),e.normalize(_,_),e.multiplyByScalar(_,m,_),_}var o={},a=new e,s=new e,l=new r,u=new i,c=new e,h=new e,d=new e,p=new e;o.raisePositionsToHeight=function(t,i,r){for(var n=i.ellipsoid,o=i.height,a=i.extrudedHeight,s=r?t.length/3*2:t.length/3,l=new Float64Array(3*s),u=t.length,m=r?u:0,f=0;f<u;f+=3){var _=f+1,g=f+2,v=e.fromArray(t,f,c);n.scaleToGeodeticSurface(v,v);var y=e.clone(v,h),C=n.geodeticSurfaceNormal(v,p),w=e.multiplyByScalar(C,o,d);e.add(v,w,v),r&&(e.multiplyByScalar(C,a,w),e.add(y,w,y),l[f+m]=y.x,l[_+m]=y.y,l[g+m]=y.z),l[f]=v.x,l[_]=v.y,l[g]=v.z}return l};var m=new e,f=new e,_=new e;return o.computeEllipsePositions=function(i,r,o){var a=i.semiMinorAxis,s=i.semiMajorAxis,l=i.rotation,u=i.center,p=8*i.granularity,g=a*a,v=s*s,y=s*a,C=e.magnitude(u),w=e.normalize(u,m),S=e.cross(e.UNIT_Z,u,f);
S=e.normalize(S,S);var E=e.cross(w,S,_),b=1+Math.ceil(t.PI_OVER_TWO/p),T=t.PI_OVER_TWO/(b-1),x=t.PI_OVER_TWO-b*T;x<0&&(b-=Math.ceil(Math.abs(x)/T));var A,P,D,M,I,R=2*(b*(b+2)),O=r?new Array(3*R):void 0,N=0,L=c,B=h,F=4*b*3,V=F-1,k=0,z=o?new Array(F):void 0;for(x=t.PI_OVER_TWO,L=n(x,l,E,S,g,y,v,C,w,L),r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z),o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x),x=t.PI_OVER_TWO-T,A=1;A<b+1;++A){if(L=n(x,l,E,S,g,y,v,C,w,L),B=n(Math.PI-x,l,E,S,g,y,v,C,w,B),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,D=2*A+2,P=1;P<D-1;++P)M=P/(D-1),I=e.lerp(L,B,M,d),O[N++]=I.x,O[N++]=I.y,O[N++]=I.z;O[N++]=B.x,O[N++]=B.y,O[N++]=B.z}o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,z[k++]=B.x,z[k++]=B.y,z[k++]=B.z),x=t.PI_OVER_TWO-(A+1)*T}for(A=b;A>1;--A){if(x=t.PI_OVER_TWO-(A-1)*T,L=n(-x,l,E,S,g,y,v,C,w,L),B=n(x+Math.PI,l,E,S,g,y,v,C,w,B),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,D=2*(A-1)+2,P=1;P<D-1;++P)M=P/(D-1),I=e.lerp(L,B,M,d),O[N++]=I.x,O[N++]=I.y,O[N++]=I.z;O[N++]=B.x,O[N++]=B.y,O[N++]=B.z}o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,z[k++]=B.x,z[k++]=B.y,z[k++]=B.z)}x=t.PI_OVER_TWO,L=n(-x,l,E,S,g,y,v,C,w,L);var U={};return r&&(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,U.positions=O,U.numPts=b),o&&(z[V--]=L.z,z[V--]=L.y,z[V--]=L.x,U.outerPositions=z),U},o}),i("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return n}),i("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,i){t(i)||(i={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),i.high=r,i.low=e-r):(r=65536*Math.floor(-e/65536),i.high=-r,i.low=e+r),i};var n={high:0,low:0};r.fromCartesian=function(e,i){t(i)||(i=new r);var o=i.high,a=i.low;return r.encode(e.x,n),o.x=n.high,a.x=n.low,r.encode(e.y,n),o.y=n.high,a.y=n.low,r.encode(e.z,n),o.z=n.high,a.z=n.low,i};var o=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,o);var n=o.high,a=o.low;t[i]=n.x,t[i+1]=n.y,t[i+2]=n.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),i("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.calculateACMR=function(i){i=e(i,e.EMPTY_OBJECT);var r=i.indices,n=i.maximumIndex,o=e(i.cacheSize,24),a=r.length;if(!t(n)){n=0;for(var s=0,l=r[s];s<a;)l>n&&(n=l),++s,l=r[s]}for(var u=[],c=0;c<n+1;c++)u[c]=0;for(var h=o+1,d=0;d<a;++d)h-u[r[d]]>o&&(u[r[d]]=h,++h);return(h-o+1)/(a/3)},r.tipsify=function(i){function r(e,t,i,r){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;o<r;){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function n(e,t,i,n,o,a,s){for(var l,u=-1,c=-1,h=0;h<i.length;){var d=i[h];n[d].numLiveTriangles&&(l=0,o-n[d].timeStamp+2*n[d].numLiveTriangles<=t&&(l=o-n[d].timeStamp),(l>c||c===-1)&&(c=l,u=d)),++h}return u===-1?r(n,a,e,s):u}i=e(i,e.EMPTY_OBJECT);var o,a=i.indices,s=i.maximumIndex,l=e(i.cacheSize,24),u=a.length,c=0,h=0,d=a[h],p=u;if(t(s))c=s+1;else{for(;h<p;)d>c&&(c=d),++h,d=a[h];if(c===-1)return 0;++c}for(var m=[],f=0;f<c;f++)m[f]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};h=0;for(var _=0;h<p;)m[a[h]].vertexTriangles.push(_),++m[a[h]].numLiveTriangles,m[a[h+1]].vertexTriangles.push(_),++m[a[h+1]].numLiveTriangles,m[a[h+2]].vertexTriangles.push(_),++m[a[h+2]].numLiveTriangles,++_,h+=3;var g=0,v=l+1;o=1;var y,C,w=[],S=[],E=0,b=[],T=u/3,x=[];for(f=0;f<T;f++)x[f]=!1;for(var A,P;g!==-1;){w=[],C=m[g],P=C.vertexTriangles.length;for(var D=0;D<P;++D)if(_=C.vertexTriangles[D],!x[_]){x[_]=!0,h=_+_+_;for(var M=0;M<3;++M)A=a[h],w.push(A),S.push(A),b[E]=A,++E,y=m[A],--y.numLiveTriangles,v-y.timeStamp>l&&(y.timeStamp=v,++v),++h}g=n(a,l,w,m,v,S,c)}return b},r}),i("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function x(e){for(var t=e.length,i=t/3*6,r=_.createTypedArray(t,i),n=0,o=0;o<t;o+=3,n+=6)T(r,n,e[o],e[o+1],e[o+2]);return r}function A(e){var t=e.length;if(t>=3){var i=6*(t-2),r=_.createTypedArray(t,i);T(r,0,e[0],e[1],e[2]);for(var n=6,o=3;o<t;++o,n+=6)T(r,n,e[o-1],e[o],e[o-2]);return r}return new Uint16Array}function P(e){if(e.length>0){for(var t=e.length-1,i=6*(t-1),r=_.createTypedArray(t,i),n=e[0],o=0,a=1;a<t;++a,o+=6)T(r,o,n,e[a],e[a+1]);return r}return new Uint16Array}function D(e){var t={};for(var i in e)if(e.hasOwnProperty(i)&&u(e[i])&&u(e[i].values)){var r=e[i];t[i]=new m({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function M(e,t,i){for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values))for(var n=t[r],o=0;o<n.componentsPerAttribute;++o)e[r].values.push(n.values[i*n.componentsPerAttribute+o])}function I(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;o<r;o+=3)n.unpack(i,o,oe),w.multiplyByPoint(e,oe,oe),n.pack(oe,i,o)}function R(e,t){if(u(t))for(var i=t.values,r=i.length,o=0;o<r;o+=3)n.unpack(i,o,oe),C.multiplyByVector(e,oe,oe),oe=n.normalize(oe,oe),n.pack(oe,i,o)}function O(e,t){var i,r=e.length,n={},o=e[0][t].attributes;for(i in o)if(o.hasOwnProperty(i)&&u(o[i])&&u(o[i].values)){for(var a=o[i],l=a.values.length,c=!0,h=1;h<r;++h){var d=e[h][t].attributes[i];if(!u(d)||a.componentDatatype!==d.componentDatatype||a.componentsPerAttribute!==d.componentsPerAttribute||a.normalize!==d.normalize){c=!1;break}l+=d.values.length}c&&(n[i]=new m({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,l)}))}return n}function N(e,t){var r,o,a,s,l,c,h,d=e.length,m=(e[0].modelMatrix,u(e[0][t].indices)),f=e[0][t].primitiveType,g=O(e,t);for(r in g)if(g.hasOwnProperty(r))for(l=g[r].values,s=0,o=0;o<d;++o)for(c=e[o][t].attributes[r].values,h=c.length,a=0;a<h;++a)l[s++]=c[a];var v;if(m){var y=0;for(o=0;o<d;++o)y+=e[o][t].indices.length;var C=p.computeNumberOfVertices(new p({attributes:g,primitiveType:E.POINTS})),w=_.createTypedArray(C,y),S=0,b=0;for(o=0;o<d;++o){var T=e[o][t].indices,x=T.length;for(s=0;s<x;++s)w[S++]=b+T[s];b+=p.computeNumberOfVertices(e[o][t])}v=w}var A,P=new n,D=0;for(o=0;o<d;++o){if(A=e[o][t].boundingSphere,!u(A)){P=void 0;break}n.add(A.center,P,P)}if(u(P))for(n.divideByScalar(P,d,P),o=0;o<d;++o){A=e[o][t].boundingSphere;var M=n.magnitude(n.subtract(A.center,P,le))+A.radius;M>D&&(D=M)}return new p({attributes:g,indices:v,primitiveType:f,boundingSphere:u(P)?new i(P,D):void 0})}function L(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,t),r=0;r<t;++r)i[r]=r;return e.indices=i,e}function B(e){var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,3*(t-2));i[0]=1,i[1]=0,i[2]=2;for(var r=3,n=3;n<t;++n)i[r++]=n-1,i[r++]=0,i[r++]=n;return e.indices=i,e.primitiveType=E.TRIANGLES,e}function F(e){var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,3*(t-2));i[0]=0,i[1]=1,i[2]=2,t>3&&(i[3]=0,i[4]=2,i[5]=3);for(var r=6,n=3;n<t-1;n+=2)i[r++]=n,i[r++]=n-1,i[r++]=n+1,n+2<t&&(i[r++]=n,i[r++]=n+1,i[r++]=n+2);return e.indices=i,e.primitiveType=E.TRIANGLES,e}function V(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,t),r=0;r<t;++r)i[r]=r;return e.indices=i,e}function k(e){var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,2*(t-1));i[0]=0,i[1]=1;for(var r=2,n=2;n<t;++n)i[r++]=n-1,i[r++]=n;return e.indices=i,e.primitiveType=E.LINES,e}function z(e){var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,2*t);i[0]=0,i[1]=1;for(var r=2,n=2;n<t;++n)i[r++]=n-1,i[r++]=n;return i[r++]=t-1,i[r]=0,e.indices=i,e.primitiveType=E.LINES,e}function U(e){switch(e.primitiveType){case E.TRIANGLE_FAN:return B(e);case E.TRIANGLE_STRIP:return F(e);case E.TRIANGLES:return L(e);case E.LINE_STRIP:return k(e);case E.LINE_LOOP:return z(e);case E.LINES:return V(e)}return e}function G(e,t){Math.abs(e.y)<y.EPSILON6&&(t?e.y=-y.EPSILON6:e.y=y.EPSILON6)}function W(e,t,i){if(0!==e.y&&0!==t.y&&0!==i.y)return G(e,e.y<0),G(t,t.y<0),void G(i,i.y<0);var r,n=Math.abs(e.y),o=Math.abs(t.y),a=Math.abs(i.y);r=n>o?n>a?y.sign(e.y):y.sign(i.y):o>a?y.sign(t.y):y.sign(i.y);var s=r<0;G(e,s),G(t,s),G(i,s)}function H(e,t,i,r){n.add(e,n.multiplyByScalar(n.subtract(t,e,Ce),e.y/(e.y-t.y),Ce),i),n.clone(i,r),G(i,!0),G(r,!1)}function q(e,t,i){if(!(e.x>=0||t.x>=0||i.x>=0)){W(e,t,i);var r=e.y<0,n=t.y<0,o=i.y<0,a=0;a+=r?1:0,a+=n?1:0,a+=o?1:0;var s=Te.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(H(e,t,we,Ee),H(e,i,Se,be),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(H(t,i,we,Ee),H(t,e,Se,be),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(H(i,e,we,Ee),H(i,t,Se,be),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?n?o||(H(i,e,we,Ee),H(i,t,Se,be),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(H(t,i,we,Ee),H(t,e,Se,be),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(H(e,t,we,Ee),H(e,i,Se,be),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=Te.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,1!==a&&2!==a||(l[3]=we,l[4]=Se,l[5]=Ee,l[6]=be,l.length=7),Te}}function j(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var n in r)if(r.hasOwnProperty(n)&&u(r[n])&&u(r[n].values)){var o=r[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=p.computeNumberOfVertices(e);return e.indices=_.createTypedArray(a,e.indices),t&&(e.boundingSphere=i.fromVertices(r.position.values)),e}}function Y(e){var t=e.attributes,i={};for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values)){var n=t[r];i[r]=new m({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({attributes:i,indices:[],primitiveType:e.primitiveType})}function X(e,t,i){var r=u(e.geometry.boundingSphere);t=j(t,r),i=j(i,r),u(i)&&!u(t)?e.geometry=i:!u(i)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function Z(e,i,o,a,s,l,c,h,d,p,m){if(u(l)||u(c)||u(h)||u(d)){var f=n.fromArray(s,3*e,xe),_=n.fromArray(s,3*i,Ae),g=n.fromArray(s,3*o,Pe),v=t(a,f,_,g,De);if(u(l)){var y=n.fromArray(l,3*e,xe),C=n.fromArray(l,3*i,Ae),w=n.fromArray(l,3*o,Pe);n.multiplyByScalar(y,v.x,y),n.multiplyByScalar(C,v.y,C),n.multiplyByScalar(w,v.z,w);var S=n.add(y,C,y);n.add(S,w,S),n.normalize(S,S),n.pack(S,p.normal.values,3*m)}if(u(c)){var E=n.fromArray(c,3*e,xe),b=n.fromArray(c,3*i,Ae),T=n.fromArray(c,3*o,Pe);n.multiplyByScalar(E,v.x,E),n.multiplyByScalar(b,v.y,b),n.multiplyByScalar(T,v.z,T);var x=n.add(E,b,E);n.add(x,T,x),n.normalize(x,x),n.pack(x,p.binormal.values,3*m)}if(u(h)){var A=n.fromArray(h,3*e,xe),P=n.fromArray(h,3*i,Ae),D=n.fromArray(h,3*o,Pe);n.multiplyByScalar(A,v.x,A),n.multiplyByScalar(P,v.y,P),n.multiplyByScalar(D,v.z,D);var M=n.add(A,P,A);n.add(M,D,M),n.normalize(M,M),n.pack(M,p.tangent.values,3*m)}if(u(d)){var I=r.fromArray(d,2*e,Me),R=r.fromArray(d,2*i,Ie),O=r.fromArray(d,2*o,Re);r.multiplyByScalar(I,v.x,I),r.multiplyByScalar(R,v.y,R),r.multiplyByScalar(O,v.z,O);var N=r.add(I,R,I);r.add(N,O,N),r.pack(N,p.st.values,2*m)}}}function K(e,t,i,r,n,o){var a=e.position.values.length/3;if(n!==-1){var s=r[n],l=i[s];return l===-1?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function Q(e){var t,i,r,o,a,s=e.geometry,l=s.attributes,c=l.position.values,h=u(l.normal)?l.normal.values:void 0,d=u(l.binormal)?l.binormal.values:void 0,p=u(l.tangent)?l.tangent.values:void 0,m=u(l.st)?l.st.values:void 0,f=s.indices,_=Y(s),g=Y(s),v=[];v.length=c.length/3;var y=[];for(y.length=c.length/3,a=0;a<v.length;++a)v[a]=-1,y[a]=-1;var C=f.length;for(a=0;a<C;a+=3){var w=f[a],S=f[a+1],E=f[a+2],b=n.fromArray(c,3*w),T=n.fromArray(c,3*S),x=n.fromArray(c,3*E),A=q(b,T,x);if(u(A)&&A.positions.length>3)for(var P=A.positions,D=A.indices,M=D.length,I=0;I<M;++I){var R=D[I],O=P[R];O.y<0?(t=g.attributes,i=g.indices,r=v):(t=_.attributes,i=_.indices,r=y),o=K(t,i,r,f,R<3?a+R:-1,O),Z(w,S,E,O,c,h,d,p,m,t,o)}else u(A)&&(b=A.positions[0],T=A.positions[1],x=A.positions[2]),b.y<0?(t=g.attributes,i=g.indices,r=v):(t=_.attributes,i=_.indices,r=y),o=K(t,i,r,f,a,b),Z(w,S,E,b,c,h,d,p,m,t,o),o=K(t,i,r,f,a+1,T),Z(w,S,E,T,c,h,d,p,m,t,o),o=K(t,i,r,f,a+2,x),Z(w,S,E,x,c,h,d,p,m,t,o)}X(e,g,_)}function J(e){var t,i=e.geometry,r=i.attributes,o=r.position.values,a=i.indices,s=Y(i),l=Y(i),c=a.length,h=[];h.length=o.length/3;var d=[];for(d.length=o.length/3,t=0;t<h.length;++t)h[t]=-1,d[t]=-1;for(t=0;t<c;t+=2){var p=a[t],m=a[t+1],f=n.fromArray(o,3*p,xe),_=n.fromArray(o,3*m,Ae);Math.abs(f.y)<y.EPSILON6&&(f.y<0?f.y=-y.EPSILON6:f.y=y.EPSILON6),Math.abs(_.y)<y.EPSILON6&&(_.y<0?_.y=-y.EPSILON6:_.y=y.EPSILON6);var g=s.attributes,C=s.indices,w=d,S=l.attributes,E=l.indices,b=h,T=v.lineSegmentPlane(f,_,Oe,Pe);if(u(T)){var x=n.multiplyByScalar(n.UNIT_Y,5*y.EPSILON9,Ne);f.y<0&&(n.negate(x,x),g=l.attributes,C=l.indices,w=h,S=s.attributes,E=s.indices,b=d);var A=n.add(T,x,Le);K(g,C,w,a,t,f),K(g,C,w,a,-1,A),n.negate(x,x),n.add(T,x,A),K(S,E,b,a,-1,A),K(S,E,b,a,t+1,_)}else{var P,D,M;f.y<0?(P=l.attributes,D=l.indices,M=h):(P=s.attributes,D=s.indices,M=d),K(P,D,M,a,t,f),K(P,D,M,a,t+1,_)}}X(e,l,s)}function $(e){for(var t=e.attributes,i=t.position.values,r=t.prevPosition.values,o=t.nextPosition.values,a=i.length,s=0;s<a;s+=3){var l=n.unpack(i,s,Ve);if(!(l.x>0)){var u=n.unpack(r,s,ke);(l.y<0&&u.y>0||l.y>0&&u.y<0)&&(s-3>0?(r[s]=i[s-3],r[s+1]=i[s-2],r[s+2]=i[s-1]):n.pack(l,r,s));var c=n.unpack(o,s,ze);(l.y<0&&c.y>0||l.y>0&&c.y<0)&&(s+3<a?(o[s]=i[s+3],o[s+1]=i[s+4],o[s+2]=i[s+5]):n.pack(l,o,s))}}}function ee(e){var t,i,a,s=e.geometry,l=s.attributes,c=l.position.values,h=l.prevPosition.values,d=l.nextPosition.values,p=l.expandAndWidth.values,m=u(l.st)?l.st.values:void 0,f=u(l.color)?l.color.values:void 0,_=Y(s),g=Y(s),C=!1,w=c.length/3;for(t=0;t<w;t+=4){var S=t,E=t+2,b=n.fromArray(c,3*S,Ve),T=n.fromArray(c,3*E,ke);if(Math.abs(b.y)<je)for(b.y=je*(T.y<0?-1:1),c[3*t+1]=b.y,c[3*(t+1)+1]=b.y,i=3*S;i<3*S+12;i+=3)h[i]=c[3*t],h[i+1]=c[3*t+1],h[i+2]=c[3*t+2];if(Math.abs(T.y)<je)for(T.y=je*(b.y<0?-1:1),c[3*(t+2)+1]=T.y,c[3*(t+3)+1]=T.y,i=3*S;i<3*S+12;i+=3)d[i]=c[3*(t+2)],d[i+1]=c[3*(t+2)+1],d[i+2]=c[3*(t+2)+2];var x=_.attributes,A=_.indices,P=g.attributes,D=g.indices,M=v.lineSegmentPlane(b,T,Oe,Ue);if(u(M)){C=!0;var I=n.multiplyByScalar(n.UNIT_Y,qe,Ge);b.y<0&&(n.negate(I,I),x=g.attributes,A=g.indices,P=_.attributes,D=_.indices);var R=n.add(M,I,We);x.position.values.push(b.x,b.y,b.z,b.x,b.y,b.z),x.position.values.push(R.x,R.y,R.z),x.position.values.push(R.x,R.y,R.z),x.prevPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),x.prevPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]),x.prevPosition.values.push(b.x,b.y,b.z,b.x,b.y,b.z),x.nextPosition.values.push(R.x,R.y,R.z),x.nextPosition.values.push(R.x,R.y,R.z),x.nextPosition.values.push(R.x,R.y,R.z),x.nextPosition.values.push(R.x,R.y,R.z),n.negate(I,I),n.add(M,I,R),P.position.values.push(R.x,R.y,R.z),P.position.values.push(R.x,R.y,R.z),P.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),P.prevPosition.values.push(R.x,R.y,R.z),P.prevPosition.values.push(R.x,R.y,R.z),P.prevPosition.values.push(R.x,R.y,R.z),P.prevPosition.values.push(R.x,R.y,R.z),P.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),P.nextPosition.values.push(d[3*E],d[3*E+1],d[3*E+2]),P.nextPosition.values.push(d[3*E+3],d[3*E+4],d[3*E+5]);var O=r.fromArray(p,2*S,Be),N=Math.abs(O.y);x.expandAndWidth.values.push(-1,N,1,N),x.expandAndWidth.values.push(-1,-N,1,-N),P.expandAndWidth.values.push(-1,N,1,N),P.expandAndWidth.values.push(-1,-N,1,-N);var L=n.magnitudeSquared(n.subtract(M,b,ze));if(L/=n.magnitudeSquared(n.subtract(T,b,ze)),u(f)){var B=o.fromArray(f,4*S,He),F=o.fromArray(f,4*E,He),V=y.lerp(B.x,F.x,L),k=y.lerp(B.y,F.y,L),z=y.lerp(B.z,F.z,L),U=y.lerp(B.w,F.w,L);for(i=4*S;i<4*S+8;++i)x.color.values.push(f[i]);for(x.color.values.push(V,k,z,U),x.color.values.push(V,k,z,U),P.color.values.push(V,k,z,U),P.color.values.push(V,k,z,U),i=4*E;i<4*E+8;++i)P.color.values.push(f[i])}if(u(m)){var G=r.fromArray(m,2*S,Be),W=r.fromArray(m,2*(t+3),Fe),H=y.lerp(G.x,W.x,L);for(i=2*S;i<2*S+4;++i)x.st.values.push(m[i]);for(x.st.values.push(H,G.y),x.st.values.push(H,W.y),P.st.values.push(H,G.y),P.st.values.push(H,W.y),i=2*E;i<2*E+4;++i)P.st.values.push(m[i])}a=x.position.values.length/3-4,A.push(a,a+2,a+1),A.push(a+1,a+2,a+3),a=P.position.values.length/3-4,D.push(a,a+2,a+1),D.push(a+1,a+2,a+3)}else{var q,j;for(b.y<0?(q=g.attributes,j=g.indices):(q=_.attributes,j=_.indices),q.position.values.push(b.x,b.y,b.z),q.position.values.push(b.x,b.y,b.z),q.position.values.push(T.x,T.y,T.z),q.position.values.push(T.x,T.y,T.z),i=3*t;i<3*t+12;++i)q.prevPosition.values.push(h[i]),q.nextPosition.values.push(d[i]);for(i=2*t;i<2*t+8;++i)q.expandAndWidth.values.push(p[i]),u(m)&&q.st.values.push(m[i]);if(u(f))for(i=4*t;i<4*t+16;++i)q.color.values.push(f[i]);a=q.position.values.length/3-4,j.push(a,a+2,a+1),j.push(a+1,a+2,a+3)}}C&&($(g),$(_)),X(e,g,_)}var te={};te.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case E.TRIANGLES:e.indices=x(t);break;case E.TRIANGLE_STRIP:e.indices=A(t);break;case E.TRIANGLE_FAN:e.indices=P(t)}e.primitiveType=E.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=l(t,"normal"),r=l(r,1e4);for(var n=e.attributes.position.values,o=e.attributes[t].values,a=n.length,c=new Float64Array(2*a),h=0,d=0;d<a;d+=3)c[h++]=n[d],c[h++]=n[d+1],c[h++]=n[d+2],c[h++]=n[d]+o[d]*r,c[h++]=n[d+1]+o[d+1]*r,c[h++]=n[d+2]+o[d+2]*r;var f,_=e.boundingSphere;return u(_)&&(f=new i(_.center,_.radius+r)),new p({attributes:{position:new m({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:E.LINES,boundingSphere:f})},te.createAttributeLocations=function(e){var t,i=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","binormal","tangent","compressedAttributes"],r=e.attributes,n={},o=0,a=i.length;for(t=0;t<a;++t){var s=i[t];u(r[s])&&(n[s]=o++)}for(var l in r)r.hasOwnProperty(l)&&!u(n[l])&&(n[l]=o++);return n},te.reorderForPreVertexCache=function(e){var t=p.computeNumberOfVertices(e),i=e.indices;if(u(i)){for(var r=new Int32Array(t),n=0;n<t;n++)r[n]=-1;for(var o,a=i,l=a.length,c=_.createTypedArray(t,l),h=0,d=0,m=0;h<l;)o=r[a[h]],o!==-1?c[d]=o:(o=a[h],r[o]=m,c[d]=m,++m),++h,++d;e.indices=c;var f=e.attributes;for(var g in f)if(f.hasOwnProperty(g)&&u(f[g])&&u(f[g].values)){for(var v=f[g],y=v.values,C=0,w=v.componentsPerAttribute,S=s.createTypedArray(v.componentDatatype,m*w);C<t;){var E=r[C];if(E!==-1)for(n=0;n<w;n++)S[w*E+n]=y[w*C+n];++C}v.values=S}}return e},te.reorderForPostVertexCache=function(e,t){var i=e.indices;if(e.primitiveType===E.TRIANGLES&&u(i)){for(var r=i.length,n=0,o=0;o<r;o++)i[o]>n&&(n=i[o]);e.indices=b.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],i=p.computeNumberOfVertices(e);if(u(e.indices)&&i>=y.SIXTY_FOUR_KILOBYTES){var r,n=[],o=[],a=0,s=D(e.attributes),l=e.indices,c=l.length;e.primitiveType===E.TRIANGLES?r=3:e.primitiveType===E.LINES?r=2:e.primitiveType===E.POINTS&&(r=1);for(var h=0;h<c;h+=r){for(var d=0;d<r;++d){var m=l[h+d],f=n[m];u(f)||(f=a++,n[m]=f,M(s,e.attributes,m)),o.push(f)}a+r>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=D(e.attributes))}0!==o.length&&t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ie=new n,re=new a;te.projectTo2D=function(e,t,i,r,o){var a=e.attributes[t];o=u(o)?o:new d;for(var l=o.ellipsoid,c=a.values,h=new Float64Array(c.length),p=0,f=0;f<c.length;f+=3){var _=n.fromArray(c,f,ie),g=l.cartesianToCartographic(_,re),v=o.project(g,ie);h[p++]=v.x,h[p++]=v.y,h[p++]=v.z}return e.attributes[i]=a,e.attributes[r]=new m({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:h}),delete e.attributes[t],e};var ne={high:0,low:0};te.encodeAttribute=function(e,t,i,r){for(var n=e.attributes[t],o=n.values,a=o.length,l=new Float32Array(a),u=new Float32Array(a),c=0;c<a;++c)h.encode(o[c],ne),l[c]=ne.high,u[c]=ne.low;var d=n.componentsPerAttribute;return e.attributes[i]=new m({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:l}),e.attributes[r]=new m({componentDatatype:s.FLOAT,componentsPerAttribute:d,values:u}),delete e.attributes[t],e};var oe=new n,ae=new w,se=new C;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(w.equals(t,w.IDENTITY))return e;var r=e.geometry.attributes;I(t,r.position),I(t,r.prevPosition),I(t,r.nextPosition),(u(r.normal)||u(r.binormal)||u(r.tangent))&&(w.inverse(t,ae),w.transpose(ae,ae),w.getRotation(ae,se),R(se,r.normal),R(se,r.binormal),R(se,r.tangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=i.transform(n,t,n)),e.modelMatrix=w.clone(w.IDENTITY),e};var le=new n;te.combineInstances=function(e){for(var t=[],i=[],r=e.length,n=0;n<r;++n){var o=e[n];u(o.geometry)?t.push(o):u(o.westHemisphereGeometry)&&u(o.eastHemisphereGeometry)&&i.push(o)}var a=[];return t.length>0&&a.push(N(t,"geometry")),i.length>0&&(a.push(N(i,"westHemisphereGeometry")),a.push(N(i,"eastHemisphereGeometry"))),a};var ue=new n,ce=new n,he=new n,de=new n;te.computeNormal=function(e){for(var t=e.indices,i=e.attributes,r=i.position.values,o=i.position.values.length/3,a=t.length,l=new Array(o),u=new Array(a/3),c=new Array(a),h=0;h<o;h++)l[h]={indexOffset:0,count:0,currentCount:0};var d=0;for(h=0;h<a;h+=3){var p=t[h],f=t[h+1],_=t[h+2],g=3*p,v=3*f,y=3*_;ce.x=r[g],ce.y=r[g+1],ce.z=r[g+2],he.x=r[v],he.y=r[v+1],he.z=r[v+2],de.x=r[y],de.y=r[y+1],de.z=r[y+2],l[p].count++,l[f].count++,l[_].count++,n.subtract(he,ce,he),n.subtract(de,ce,de),u[d]=n.cross(he,de,new n),d++}var C=0;for(h=0;h<o;h++)l[h].indexOffset+=C,C+=l[h].count;d=0;var w;for(h=0;h<a;h+=3){w=l[t[h]];var S=w.indexOffset+w.currentCount;c[S]=d,w.currentCount++,w=l[t[h+1]],S=w.indexOffset+w.currentCount,c[S]=d,w.currentCount++,w=l[t[h+2]],S=w.indexOffset+w.currentCount,c[S]=d,w.currentCount++,d++}var E=new Float32Array(3*o);for(h=0;h<o;h++){var b=3*h;if(w=l[h],w.count>0){for(n.clone(n.ZERO,ue),d=0;d<w.count;d++)n.add(ue,u[c[w.indexOffset+d]],ue);n.normalize(ue,ue),E[b]=ue.x,E[b+1]=ue.y,E[b+2]=ue.z}else E[b]=0,E[b+1]=0,E[b+2]=1}return e.attributes.normal=new m({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:E}),e};var pe=new n,me=new n,fe=new n;te.computeBinormalAndTangent=function(e){for(var t=(e.attributes,e.indices),i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,a=e.attributes.position.values.length/3,l=t.length,u=new Array(3*a),c=0;c<u.length;c++)u[c]=0;var h,d,p;for(c=0;c<l;c+=3){var f=t[c],_=t[c+1],g=t[c+2];h=3*f,d=3*_,p=3*g;var v=2*f,y=2*_,C=2*g,w=i[h],S=i[h+1],E=i[h+2],b=o[v],T=o[v+1],x=o[y+1]-T,A=o[C+1]-T,P=1/((o[y]-b)*A-(o[C]-b)*x),D=(A*(i[d]-w)-x*(i[p]-w))*P,M=(A*(i[d+1]-S)-x*(i[p+1]-S))*P,I=(A*(i[d+2]-E)-x*(i[p+2]-E))*P;u[h]+=D,u[h+1]+=M,u[h+2]+=I,u[d]+=D,u[d+1]+=M,u[d+2]+=I,u[p]+=D,u[p+1]+=M,u[p+2]+=I}var R=new Float32Array(3*a),O=new Float32Array(3*a);for(c=0;c<a;c++){h=3*c,d=h+1,p=h+2;var N=n.fromArray(r,h,pe),L=n.fromArray(u,h,fe),B=n.dot(N,L);n.multiplyByScalar(N,B,me),n.normalize(n.subtract(L,me,L),L),O[h]=L.x,O[d]=L.y,O[p]=L.z,n.normalize(n.cross(N,L,L),L),R[h]=L.x,R[d]=L.y,R[p]=L.z}return e.attributes.tangent=new m({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:O}),e.attributes.binormal=new m({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e};var _e=new r,ge=new n,ve=new n,ye=new n;te.compressVertices=function(t){var i=t.attributes.normal,o=t.attributes.st;if(!u(i)&&!u(o))return t;var a,l,c,h,d=t.attributes.tangent,p=t.attributes.binormal;u(i)&&(a=i.values),u(o)&&(l=o.values),u(d)&&(c=d.values),p&&(h=p.values);var f=u(a)?a.length:l.length,_=u(a)?3:2,g=f/_,v=g,y=u(l)&&u(a)?2:1;y+=u(c)||u(h)?1:0,v*=y;for(var C=new Float32Array(v),w=0,S=0;S<g;++S){u(l)&&(r.fromArray(l,2*S,_e),C[w++]=e.compressTextureCoordinates(_e));var E=3*S;u(a)&&u(c)&&u(h)?(n.fromArray(a,E,ge),n.fromArray(c,E,ve),n.fromArray(h,E,ye),e.octPack(ge,ve,ye,_e),C[w++]=_e.x,C[w++]=_e.y):(u(a)&&(n.fromArray(a,E,ge),C[w++]=e.octEncodeFloat(ge)),u(c)&&(n.fromArray(c,E,ge),C[w++]=e.octEncodeFloat(ge)),u(h)&&(n.fromArray(h,E,ge),C[w++]=e.octEncodeFloat(ge)))}return t.attributes.compressedAttributes=new m({componentDatatype:s.FLOAT,componentsPerAttribute:y,values:C}),u(a)&&delete t.attributes.normal,u(l)&&delete t.attributes.st,u(c)&&delete t.attributes.tangent,u(h)&&delete t.attributes.binormal,t};var Ce=new n,we=new n,Se=new n,Ee=new n,be=new n,Te={positions:new Array(7),indices:new Array(9)},xe=new n,Ae=new n,Pe=new n,De=new n,Me=new r,Ie=new r,Re=new r,Oe=S.fromPointNormal(n.ZERO,n.UNIT_Y),Ne=new n,Le=new n,Be=new r,Fe=new r,Ve=new n,ke=new n,ze=new n,Ue=new n,Ge=new n,We=new n,He=new o,qe=5*y.EPSILON9,je=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(u(r)){var n=r.center.x-r.radius;if(n>0||i.intersectPlane(r,S.ORIGIN_ZX_PLANE)!==g.INTERSECTING)return e}if(t.geometryType!==f.NONE)switch(t.geometryType){case f.POLYLINES:ee(e);break;case f.TRIANGLES:Q(e);break;case f.LINES:J(e)}else U(t),t.primitiveType===E.TRIANGLES?Q(e):t.primitiveType===E.LINES&&J(e);return e},te}),i("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e,r,o){var a=r.vertexFormat,s=r.center,l=r.semiMajorAxis,c=r.semiMinorAxis,d=r.ellipsoid,f=r.stRotation,_=o?e.length/3*2:e.length/3,g=a.st?new Float32Array(2*_):void 0,v=a.normal?new Float32Array(3*_):void 0,C=a.tangent?new Float32Array(3*_):void 0,w=a.binormal?new Float32Array(3*_):void 0,E=0,b=U,T=G,x=W,A=new h(d),P=A.project(d.cartesianToCartographic(s,H),q),D=d.scaleToGeodeticSurface(s,N);d.geodeticSurfaceNormal(D,D);for(var M=S.fromAxisAngle(D,f,z),I=y.fromQuaternion(M,k),R=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,j),O=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),F=e.length,X=o?F:0,Z=X/3*2,K=0;K<F;K+=3){var Q=K+1,J=K+2,$=i.fromArray(e,K,N);if(a.st){var ee=y.multiplyByVector(I,$,L),te=A.project(d.cartesianToCartographic(ee,H),B);i.subtract(te,P,te),V.x=(te.x+l)/(2*l),V.y=(te.y+c)/(2*c),R.x=Math.min(V.x,R.x),R.y=Math.min(V.y,R.y),O.x=Math.max(V.x,O.x),O.y=Math.max(V.y,O.y),o&&(g[E+Z]=V.x,g[E+1+Z]=V.y),g[E++]=V.x,g[E++]=V.y}b=d.geodeticSurfaceNormal($,b),(a.normal||a.tangent||a.binormal)&&((a.tangent||a.binormal)&&(T=i.normalize(i.cross(i.UNIT_Z,b,T),T),y.multiplyByVector(I,T,T)),a.normal&&(v[K]=b.x,v[Q]=b.y,v[J]=b.z,o&&(v[K+X]=-b.x,v[Q+X]=-b.y,v[J+X]=-b.z)),a.tangent&&(C[K]=T.x,C[Q]=T.y,C[J]=T.z,o&&(C[K+X]=-T.x,C[Q+X]=-T.y,C[J+X]=-T.z)),a.binormal&&(x=i.normalize(i.cross(b,T,x),x),w[K]=x.x,w[Q]=x.y,w[J]=x.z,o&&(w[K+X]=x.x,w[Q+X]=x.y,w[J+X]=x.z)))}if(a.st){F=g.length;for(var ie=0;ie<F;ie+=2)g[ie]=(g[ie]-R.x)/(O.x-R.x),g[ie+1]=(g[ie+1]-R.y)/(O.y-R.y)}var re=new m;if(a.position){var ne=u.raisePositionsToHeight(e,r,o);re.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:ne})}return a.st&&(re.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:g})),a.normal&&(re.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:v})),a.tangent&&(re.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),a.binormal&&(re.binormal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),re}function A(e){var t,i,r,n,o,a=new Array(12*(e*(e+1))-6),s=0;for(t=0,r=1,n=0;n<3;n++)a[s++]=r++,a[s++]=t,a[s++]=r;for(n=2;n<e+1;++n){for(r=n*(n+1)-1,t=(n-1)*n-1,a[s++]=r++,a[s++]=t,a[s++]=r,i=2*n,o=0;o<i-1;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=r++,a[s++]=t,a[s++]=r}for(i=2*e,++r,++t,n=0;n<i-1;++n)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;for(a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t++,a[s++]=t,++t,n=e-1;n>1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=r,i=2*n,o=0;o<i-1;++o)a[s++]=r,a[s++]=t++,a[s++]=t,a[s++]=r++,a[s++]=t,a[s++]=r;a[s++]=t++,a[s++]=t++,a[s++]=r++}for(n=0;n<3;n++)a[s++]=t++,a[s++]=t,a[s++]=r;return a}function P(t){var r=t.center;X=i.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(r,X),t.height,X),X=i.add(r,X,X);var n=new e(X,t.semiMajorAxis),o=u.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,l=x(a,t,!1),c=A(s);return c=g.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:l,indices:c}}function D(e,r){var o=r.vertexFormat,a=r.center,s=r.semiMajorAxis,l=r.semiMinorAxis,u=r.ellipsoid,c=r.height,d=r.extrudedHeight,f=r.stRotation,_=e.length/3*2,g=new Float64Array(3*_),v=o.st?new Float32Array(2*_):void 0,C=o.normal?new Float32Array(3*_):void 0,w=o.tangent?new Float32Array(3*_):void 0,E=o.binormal?new Float32Array(3*_):void 0,b=0,T=U,x=G,A=W,P=new h(u),D=P.project(u.cartesianToCartographic(a,H),q),M=u.scaleToGeodeticSurface(a,N);u.geodeticSurfaceNormal(M,M);for(var I=S.fromAxisAngle(M,f,z),R=y.fromQuaternion(I,k),O=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,j),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),Z=e.length,K=Z/3*2,Q=0;Q<Z;Q+=3){var J,$=Q+1,ee=Q+2,te=i.fromArray(e,Q,N);if(o.st){var ie=y.multiplyByVector(R,te,L),re=P.project(u.cartesianToCartographic(ie,H),B);i.subtract(re,D,re),V.x=(re.x+s)/(2*s),V.y=(re.y+l)/(2*l),O.x=Math.min(V.x,O.x),O.y=Math.min(V.y,O.y),X.x=Math.max(V.x,X.x),X.y=Math.max(V.y,X.y),v[b+K]=V.x,v[b+1+K]=V.y,v[b++]=V.x,v[b++]=V.y}te=u.scaleToGeodeticSurface(te,te),J=i.clone(te,L),T=u.geodeticSurfaceNormal(te,T);var ne=i.multiplyByScalar(T,c,F);if(te=i.add(te,ne,te),ne=i.multiplyByScalar(T,d,ne),J=i.add(J,ne,J),o.position&&(g[Q+Z]=J.x,g[$+Z]=J.y,g[ee+Z]=J.z,g[Q]=te.x,g[$]=te.y,g[ee]=te.z),o.normal||o.tangent||o.binormal){A=i.clone(T,A);var oe=i.fromArray(e,(Q+3)%Z,F);i.subtract(oe,te,oe);var ae=i.subtract(J,te,B);T=i.normalize(i.cross(ae,oe,T),T),o.normal&&(C[Q]=T.x,C[$]=T.y,C[ee]=T.z,C[Q+Z]=T.x,C[$+Z]=T.y,C[ee+Z]=T.z),o.tangent&&(x=i.normalize(i.cross(A,T,x),x),w[Q]=x.x,w[$]=x.y,w[ee]=x.z,w[Q+Z]=x.x,w[Q+1+Z]=x.y,w[Q+2+Z]=x.z),o.binormal&&(E[Q]=A.x,E[$]=A.y,E[ee]=A.z,E[Q+Z]=A.x,E[$+Z]=A.y,E[ee+Z]=A.z)}}if(o.st){Z=v.length;for(var se=0;se<Z;se+=2)v[se]=(v[se]-O.x)/(X.x-O.x),v[se+1]=(v[se+1]-O.y)/(X.y-O.y)}var le=new m;return o.position&&(le.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:g})),o.st&&(le.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:v})),o.normal&&(le.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),o.tangent&&(le.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),o.binormal&&(le.binormal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),le}function M(e){for(var t=e.length/3,i=g.createTypedArray(t,6*t),r=0,n=0;n<t;n++){var o=n,a=n+t,s=(o+1)%t,l=s+t;
i[r++]=o,i[r++]=a,i[r++]=s,i[r++]=s,i[r++]=a,i[r++]=l}return i}function I(t){var r=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,N),t.height,N);Z.center=i.add(r,a,Z.center),Z.radius=o,a=i.multiplyByScalar(n.geodeticSurfaceNormal(r,a),t.extrudedHeight,a),K.center=i.add(r,a,K.center),K.radius=o;var s=u.computeEllipsePositions(t,!0,!0),l=s.positions,c=s.numPts,h=s.outerPositions,p=e.union(Z,K),m=x(l,t,!0),v=A(c),y=v.length;v.length=2*y;for(var C=l.length/3,S=0;S<y;S+=3)v[S+y]=v[S+2]+C,v[S+1+y]=v[S+1]+C,v[S+2+y]=v[S]+C;var E=g.createTypedArray(2*C/3,v),b=new d({attributes:m,indices:E,primitiveType:w.TRIANGLES}),T=D(h,t);v=M(h);var P=g.createTypedArray(2*h.length/3,v),I=new d({attributes:T,indices:P,primitiveType:w.TRIANGLES}),R=_.combineInstances([new f({geometry:b}),new f({geometry:I})]);return{boundingSphere:p,attributes:R[0].attributes,indices:R[0].indices}}function R(e,t,r,n,o){b.eastNorthUpToFixedFrame(e,t,Q),C.inverseTransformation(Q,J);for(var a=0;a<4;++a)i.clone(i.ZERO,ee[a]);for(ee[0].x+=r,ee[1].x-=r,ee[2].y+=n,ee[3].y-=n,y.fromRotationZ(o,$),a=0;a<4;++a)y.multiplyByVector($,ee[a],ee[a]),C.multiplyByPoint(Q,ee[a],ee[a]),t.cartesianToCartographic(ee[a],te[a]);return E.fromCartographicArray(te)}function O(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,r=o(e.ellipsoid,c.WGS84),n=e.semiMajorAxis,s=e.semiMinorAxis,l=o(e.granularity,v.RADIANS_PER_DEGREE),u=o(e.height,0),h=e.extrudedHeight,d=a(h)&&Math.abs(u-h)>1,p=o(e.vertexFormat,T.DEFAULT);this._center=i.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=c.clone(r),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=u,this._granularity=l,this._vertexFormat=T.clone(p),this._extrudedHeight=o(h,u),this._extrude=d,this._workerName="createEllipseGeometry",this._rectangle=R(this._center,this._ellipsoid,n,s,this._rotation)}var N=new i,L=new i,B=new i,F=new i,V=new t,k=new y,z=new S,U=new i,G=new i,W=new i,H=new r,q=new i,j=new t,Y=new t,X=new i,Z=new e,K=new e,Q=new C,J=new C,$=new y,ee=[new i,new i,new i,new i],te=[new r,new r,new r,new r];O.packedLength=i.packedLength+c.packedLength+T.packedLength+E.packedLength+8,O.pack=function(e,t,r){return r=o(r,0),i.pack(e._center,t,r),r+=i.packedLength,c.pack(e._ellipsoid,t,r),r+=c.packedLength,T.pack(e._vertexFormat,t,r),r+=T.packedLength,E.pack(e._rectangle,t,r),r+=E.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r]=e._extrude?1:0,t};var ie=new i,re=new c,ne=new T,oe=new E,ae={center:ie,ellipsoid:re,vertexFormat:ne,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0};return O.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,ie);t+=i.packedLength;var s=c.unpack(e,t,re);t+=c.packedLength;var l=T.unpack(e,t,ne);t+=T.packedLength;var u=E.unpack(e,t,oe);t+=E.packedLength;var h=e[t++],d=e[t++],p=e[t++],m=e[t++],f=e[t++],_=e[t++],g=e[t++],v=1===e[t];return a(r)?(r._center=i.clone(n,r._center),r._ellipsoid=c.clone(s,r._ellipsoid),r._vertexFormat=T.clone(l,r._vertexFormat),r._semiMajorAxis=h,r._semiMinorAxis=d,r._rotation=p,r._stRotation=m,r._height=f,r._granularity=_,r._extrudedHeight=g,r._extrude=v,r._rectangle=E.clone(u),r):(ae.height=f,ae.extrudedHeight=g,ae.granularity=_,ae.stRotation=m,ae.rotation=p,ae.semiMajorAxis=h,ae.semiMinorAxis=d,new O(ae))},O.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=I(i)):t=P(i),new d({attributes:t.attributes,indices:t.indices,primitiveType:w.TRIANGLES,boundingSphere:t.boundingSphere})}},O.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new O({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:T.POSITION_ONLY})},s(O.prototype,{rectangle:{get:function(){return this._rectangle}}}),O}),i("Core/CircleGeometry",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var i=e.radius,r={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation};this._ellipseGeometry=new o(r),this._workerName="createCircleGeometry"}l.packedLength=o.packedLength,l.pack=function(e,t,i){return o.pack(e._ellipseGeometry,t,i)};var u=new o({center:new e,semiMajorAxis:1,semiMinorAxis:1}),c={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new s,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return l.unpack=function(t,r,n){var h=o.unpack(t,r,u);return c.center=e.clone(h._center,c.center),c.ellipsoid=a.clone(h._ellipsoid,c.ellipsoid),c.height=h._height,c.extrudedHeight=h._extrudedHeight,c.granularity=h._granularity,c.vertexFormat=s.clone(h._vertexFormat,c.vertexFormat),c.stRotation=h._stRotation,i(n)?(c.semiMajorAxis=h._semiMajorAxis,c.semiMinorAxis=h._semiMinorAxis,n._ellipseGeometry=new o(c),n):(c.radius=h._semiMajorAxis,new l(c))},l.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},l.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(r,n),a=i(r,n);return new l({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:s.POSITION_ONLY})},r(l.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),l}),i("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(r){var n=r.center;v=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(n,v),r.height,v),v=t.add(n,v,v);for(var o=new e(v,r.semiMajorAxis),s=a.computeEllipsePositions(r,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,r,!1)})}),d=s.length/3,p=h.createTypedArray(d,2*d),m=0,f=0;f<d;++f)p[m++]=f,p[m++]=(f+1)%d;return{boundingSphere:o,attributes:l,indices:p}}function f(n){var o=n.center,s=n.ellipsoid,l=n.semiMajorAxis,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,g),n.height,g);y.center=t.add(o,p,y.center),y.radius=l,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,p),n.extrudedHeight,p),C.center=t.add(o,p,C.center),C.radius=l;var m=a.computeEllipsePositions(n,!1,!0).outerPositions,f=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(m,n,!0)})});m=f.position.values;var _=e.union(y,C),v=m.length/3,w=r(n.numberOfVerticalLines,16);w=d.clamp(w,0,v/2);var S=h.createTypedArray(v,2*v+2*w);v/=2;var E,b=0;for(E=0;E<v;++E)S[b++]=E,S[b++]=(E+1)%v,S[b++]=E+v,S[b++]=(E+1)%v+v;var T;if(w>0){var x=Math.min(w,v);T=Math.round(v/x);var A=Math.min(T*w,v);for(E=0;E<A;E+=T)S[b++]=E,S[b++]=E+v}return{boundingSphere:_,attributes:f,indices:S}}function _(e){e=r(e,r.EMPTY_OBJECT);var i=e.center,o=r(e.ellipsoid,s.WGS84),a=e.semiMajorAxis,l=e.semiMinorAxis,u=r(e.granularity,d.RADIANS_PER_DEGREE),c=r(e.height,0),h=e.extrudedHeight,p=n(h)&&Math.abs(c-h)>1;this._center=t.clone(i),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=r(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=h,this._extrude=p,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var g=new t,v=new t,y=new e,C=new e;_.packedLength=t.packedLength+s.packedLength+9,_.pack=function(e,i,o){return o=r(o,0),t.pack(e._center,i,o),o+=t.packedLength,s.pack(e._ellipsoid,i,o),o+=s.packedLength,i[o++]=e._semiMajorAxis,i[o++]=e._semiMinorAxis,i[o++]=e._rotation,i[o++]=e._height,i[o++]=e._granularity,i[o++]=n(e._extrudedHeight)?1:0,i[o++]=r(e._extrudedHeight,0),i[o++]=e._extrude?1:0,i[o]=e._numberOfVerticalLines,i};var w=new t,S=new s,E={center:w,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return _.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,w);i+=t.packedLength;var l=s.unpack(e,i,S);i+=s.packedLength;var u=e[i++],c=e[i++],h=e[i++],d=e[i++],p=e[i++],m=e[i++],f=e[i++],g=1===e[i++],v=e[i];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=h,o._height=d,o._granularity=p,o._extrudedHeight=m?f:void 0,o._extrude=g,o._numberOfVerticalLines=v,o):(E.height=d,E.extrudedHeight=m?f:void 0,E.granularity=p,E.rotation=h,E.semiMajorAxis=u,E.semiMinorAxis=c,E.numberOfVerticalLines=v,new _(E))},_.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=f(i)):t=m(i),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})}},_}),i("Core/CircleOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,i,r,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var i=e.radius,r={center:e.center,semiMajorAxis:i,semiMinorAxis:i,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(r),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){return n.pack(e._ellipseGeometry,t,i)};var s=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.center=e.clone(c._center,l.center),l.ellipsoid=o.clone(c._ellipsoid,l.ellipsoid),l.height=c._height,l.extrudedHeight=c._extrudedHeight,l.granularity=c._granularity,l.numberOfVerticalLines=c._numberOfVerticalLines,i(u)?(l.semiMajorAxis=c._semiMajorAxis,l.semiMinorAxis=c._semiMinorAxis,u._ellipseGeometry=new n(l),u):(l.radius=c._semiMajorAxis,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},a}),i("Core/ClockRange",["./freezeObject"],function(e){"use strict";var t={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e(t)}),i("Core/ClockStep",["./freezeObject"],function(e){"use strict";var t={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return e(t)}),i("Core/getTimestamp",["./defined"],function(e){"use strict";var t;return t="undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),i("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT);var o=n.currentTime,u=n.startTime,c=n.stopTime;o=r(o)?l.clone(o):r(u)?l.clone(u):r(c)?l.addDays(c,-1,new l):l.now(),u=r(u)?l.clone(u):l.clone(o),c=r(c)?l.clone(c):l.addDays(u,1,new l),this.startTime=u,this.stopTime=c,this.clockRange=i(n.clockRange,e.UNBOUNDED),this.canAnimate=i(n.canAnimate,!0),this.onTick=new a,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=s(),this.currentTime=o,this.multiplier=i(n.multiplier,1),this.clockStep=i(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.shouldAnimate=i(n.shouldAnimate,!0)}return n(u.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){l.equals(this._currentTime,e)||(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===t.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=l.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),u.prototype.tick=function(){var i=s(),r=l.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var n=this._clockStep;if(n===t.SYSTEM_CLOCK)r=l.now(r);else{var o=this._multiplier;if(n===t.TICK_DEPENDENT)r=l.addSeconds(r,o,r);else{var a=i-this._lastSystemTime;r=l.addSeconds(r,o*(a/1e3),r)}var u=this.clockRange,c=this.startTime,h=this.stopTime;if(u===e.CLAMPED)l.lessThan(r,c)?r=l.clone(c,r):l.greaterThan(r,h)&&(r=l.clone(h,r));else if(u===e.LOOP_STOP)for(l.lessThan(r,c)&&(r=l.clone(c,r));l.greaterThan(r,h);)r=l.addSeconds(c,l.secondsDifference(r,h),r)}}return this._currentTime=r,this._lastSystemTime=i,this.onTick.raiseEvent(this),r},u}),i("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function s(t,i,r,n){this.red=e(t,1),this.green=e(i,1),this.blue=e(r,1),this.alpha=e(n,1)}s.fromCartesian4=function(e,i){return t(i)?(i.red=e.x,i.green=e.y,i.blue=e.z,i.alpha=e.w,i):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(i,r,n,o,a){return i=s.byteToFloat(e(i,255)),r=s.byteToFloat(e(r,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),t(a)?(a.red=i,a.green=r,a.blue=n,a.alpha=o,a):new s(i,r,n,o)},s.fromAlpha=function(e,i,r){return t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=i,r):new s(e.red,e.green,e.blue,i)};var l,u,c;r.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e,t){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3],t)},s.fromHsl=function(i,r,n,o,l){i=e(i,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var u=n,c=n,h=n;if(0!==r){var d;d=n<.5?n*(1+r):n+r-n*r;var p=2*n-d;u=a(p,d,i+1/3),c=a(p,d,i),h=a(p,d,i-1/3)}return t(l)?(l.red=u,l.green=c,l.blue=h,l.alpha=o,l):new s(u,c,h,o)},s.fromRandom=function(i,r){i=e(i,e.EMPTY_OBJECT);var n=i.red;if(!t(n)){var a=e(i.minimumRed,0),l=e(i.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=i.green;if(!t(u)){var c=e(i.minimumGreen,0),h=e(i.maximumGreen,1);u=c+o.nextRandomNumber()*(h-c)}var d=i.blue;if(!t(d)){var p=e(i.minimumBlue,0),m=e(i.maximumBlue,1);d=p+o.nextRandomNumber()*(m-p)}var f=i.alpha;if(!t(f)){var _=e(i.minimumAlpha,0),g=e(i.maximumAlpha,1);f=_+o.nextRandomNumber()*(g-_)}return t(r)?(r.red=n,r.green=u,r.blue=d,r.alpha=f,r):new s(n,u,d,f)};var h=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,d=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,p=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,m=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(i,r){t(r)||(r=new s);var n=s[i.toUpperCase()];if(t(n))return s.clone(n,r),r;var o=h.exec(i);return null!==o?(r.red=parseInt(o[1],16)/15,r.green=parseInt(o[2],16)/15,r.blue=parseInt(o[3],16)/15,r.alpha=1,r):(o=d.exec(i),null!==o?(r.red=parseInt(o[1],16)/255,r.green=parseInt(o[2],16)/255,r.blue=parseInt(o[3],16)/255,r.alpha=1,r):(o=p.exec(i),null!==o?(r.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),r.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),r.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),r.alpha=parseFloat(e(o[4],"1.0")),r):(o=m.exec(i),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0")),r):r=void 0)))},s.packedLength=4,s.pack=function(t,i,r){return r=e(r,0),i[r++]=t.red,i[r++]=t.green,i[r++]=t.blue,i[r]=t.alpha,i},s.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new s),n.red=i[r++],n.green=i[r++],n.blue=i[r++],n.alpha=i[r],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,i){if(t(e))return t(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=e.alpha,i):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,i){return e===i||t(e)&&t(i)&&e.red===i.red&&e.green===i.green&&e.blue===i.blue&&e.alpha===i.alpha},s.equalsArray=function(e,t,i){return e.red===t[i]&&e.green===t[i+1]&&e.blue===t[i+2]&&e.alpha===t[i+3]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,i){return this===e||t(e)&&Math.abs(this.red-e.red)<=i&&Math.abs(this.green-e.green)<=i&&Math.abs(this.blue-e.blue)<=i&&Math.abs(this.alpha-e.alpha)<=i},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),i=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},s.prototype.toBytes=function(e){var i=s.floatToByte(this.red),r=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=i,e[1]=r,e[2]=n,e[3]=o,e):[i,r,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t},s.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.add=function(e,t,i){return i.red=e.red+t.red,i.green=e.green+t.green,i.blue=e.blue+t.blue,i.alpha=e.alpha+t.alpha,i},s.subtract=function(e,t,i){return i.red=e.red-t.red,i.green=e.green-t.green,i.blue=e.blue-t.blue,i.alpha=e.alpha-t.alpha,i},s.multiply=function(e,t,i){return i.red=e.red*t.red,i.green=e.green*t.green,i.blue=e.blue*t.blue,i.alpha=e.alpha*t.alpha,i},s.divide=function(e,t,i){return i.red=e.red/t.red,i.green=e.green/t.green,i.blue=e.blue/t.blue,i.alpha=e.alpha/t.alpha,i},s.mod=function(e,t,i){return i.red=e.red%t.red,i.green=e.green%t.green,i.blue=e.blue%t.blue,i.alpha=e.alpha%t.alpha,i},s.multiplyByScalar=function(e,t,i){return i.red=e.red*t,i.green=e.green*t,i.blue=e.blue*t,i.alpha=e.alpha*t,i},s.divideByScalar=function(e,t,i){return i.red=e.red/t,i.green=e.green/t,i.blue=e.blue/t,i.alpha=e.alpha/t,i},s.ALICEBLUE=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUSCHIA=n(s.fromCssColorString("#FF00FF")),s.GAINSBORO=n(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=n(s.fromCssColorString("#F8F8FF")),s.GOLD=n(s.fromCssColorString("#FFD700")),s.GOLDENROD=n(s.fromCssColorString("#DAA520")),s.GRAY=n(s.fromCssColorString("#808080")),s.GREEN=n(s.fromCssColorString("#008000")),s.GREENYELLOW=n(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=n(s.fromCssColorString("#F0FFF0")),s.HOTPINK=n(s.fromCssColorString("#FF69B4")),s.INDIANRED=n(s.fromCssColorString("#CD5C5C")),s.INDIGO=n(s.fromCssColorString("#4B0082")),s.IVORY=n(s.fromCssColorString("#FFFFF0")),s.KHAKI=n(s.fromCssColorString("#F0E68C")),s.LAVENDER=n(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=n(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=n(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=n(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=n(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=n(s.fromCssColorString("#F08080")),s.LIGHTCYAN=n(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=n(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=n(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=n(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=n(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=n(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=n(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=n(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=n(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=n(s.fromCssColorString("#FFFFE0")),s.LIME=n(s.fromCssColorString("#00FF00")),s.LIMEGREEN=n(s.fromCssColorString("#32CD32")),s.LINEN=n(s.fromCssColorString("#FAF0E6")),s.MAGENTA=n(s.fromCssColorString("#FF00FF")),s.MAROON=n(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=n(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=n(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=n(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=n(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=n(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=n(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=n(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=n(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=n(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=n(s.fromCssColorString("#191970")),s.MINTCREAM=n(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=n(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=n(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=n(s.fromCssColorString("#FFDEAD")),s.NAVY=n(s.fromCssColorString("#000080")),s.OLDLACE=n(s.fromCssColorString("#FDF5E6")),s.OLIVE=n(s.fromCssColorString("#808000")),s.OLIVEDRAB=n(s.fromCssColorString("#6B8E23")),s.ORANGE=n(s.fromCssColorString("#FFA500")),s.ORANGERED=n(s.fromCssColorString("#FF4500")),s.ORCHID=n(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=n(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=n(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=n(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=n(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=n(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=n(s.fromCssColorString("#FFDAB9")),s.PERU=n(s.fromCssColorString("#CD853F")),s.PINK=n(s.fromCssColorString("#FFC0CB")),s.PLUM=n(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=n(s.fromCssColorString("#B0E0E6")),s.PURPLE=n(s.fromCssColorString("#800080")),s.RED=n(s.fromCssColorString("#FF0000")),s.ROSYBROWN=n(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=n(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=n(s.fromCssColorString("#8B4513")),s.SALMON=n(s.fromCssColorString("#FA8072")),s.SANDYBROWN=n(s.fromCssColorString("#F4A460")),s.SEAGREEN=n(s.fromCssColorString("#2E8B57")),s.SEASHELL=n(s.fromCssColorString("#FFF5EE")),s.SIENNA=n(s.fromCssColorString("#A0522D")),s.SILVER=n(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=n(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=n(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=n(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=n(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=n(s.fromCssColorString("#00FF7F")),s.STEELBLUE=n(s.fromCssColorString("#4682B4")),s.TAN=n(s.fromCssColorString("#D2B48C")),s.TEAL=n(s.fromCssColorString("#008080")),s.THISTLE=n(s.fromCssColorString("#D8BFD8")),s.TOMATO=n(s.fromCssColorString("#FF6347")),s.TURQUOISE=n(s.fromCssColorString("#40E0D0")),s.VIOLET=n(s.fromCssColorString("#EE82EE")),s.WHEAT=n(s.fromCssColorString("#F5DEB3")),s.WHITE=n(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=n(s.fromCssColorString("#F5F5F5")),s.YELLOW=n(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=n(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=n(new s(0,0,0,0)),s}),i("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(t,r,n,o){t=i(t,1),r=i(r,1),n=i(n,1),o=i(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(r),e.floatToByte(n),e.floatToByte(o)])}return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){return r(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]},a}),i("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function i(r,n,o){o=e(o,!1);var a,s,l,u={},c=t(r),h=t(n);if(c)for(a in r)r.hasOwnProperty(a)&&(s=r[a],h&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],"object"==typeof l?u[a]=i(s,l,o):u[a]=s):u[a]=s);if(h)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return i}),i("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),i("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=e._uSquared,i=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,n=(i-r)/i,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),h=l*a,d=h*h,p=1-d,m=Math.sqrt(p),f=t/4,_=f*f,g=_*f,v=_*_,y=1+f-3*_/4+5*g/4-175*v/64,C=1-f+15*_/8-35*g/8,w=1-3*f+35*_/4,S=1-5*f,E=y*c-C*Math.sin(2*c)*f/2-w*Math.sin(4*c)*_/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*v/512,b=e._constants;b.a=i,b.b=r,b.f=n,b.cosineHeading=o,b.sineHeading=a,b.tanU=s,b.cosineU=l,b.sineU=u,b.sigma=c,b.sineAlpha=h,b.sineSquaredAlpha=d,b.cosineSquaredAlpha=p,b.cosineAlpha=m,b.u2Over4=f,b.u4Over16=_,b.u6Over64=g,b.u8Over256=v,b.a0=y,b.a1=C,b.a2=w,b.a3=S,b.distanceRatio=E}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,i,r,n,o,a){var s=u(e,i);return(1-s)*e*t*(r+s*n*(a+s*o*(2*a*a-1)))}function h(e,t,i,r,n,o,a){var l,u,h,d,p,m=(t-i)/t,f=o-r,_=Math.atan((1-m)*Math.tan(n)),g=Math.atan((1-m)*Math.tan(a)),v=Math.cos(_),y=Math.sin(_),C=Math.cos(g),w=Math.sin(g),S=v*C,E=v*w,b=y*w,T=y*C,x=f,A=s.TWO_PI,P=Math.cos(x),D=Math.sin(x);do{P=Math.cos(x),D=Math.sin(x);var M=E-T*P;h=Math.sqrt(C*C*D*D+M*M),u=b+S*P,l=Math.atan2(h,u);var I;0===h?(I=0,d=1):(I=S*D/h,d=1-I*I),A=x,p=u-2*b/d,isNaN(p)&&(p=0),x=f+c(m,I,d,l,h,u,p)}while(Math.abs(x-A)>s.EPSILON12);var R=d*(t*t-i*i)/(i*i),O=1+R*(4096+R*(R*(320-175*R)-768))/16384,N=R*(256+R*(R*(74-47*R)-128))/1024,L=p*p,B=N*h*(p+N*(u*(2*L-1)-N*p*(4*h*h-3)*(4*L-3)/6)/4),F=i*O*(l-B),V=Math.atan2(C*D,E-T*P),k=Math.atan2(v*D,E*P-T);e._distance=F,e._startHeading=V,e._endHeading=k,e._uSquared=R}function d(i,r,n,o){e.normalize(o.cartographicToCartesian(r,f),m),e.normalize(o.cartographicToCartesian(n,f),f);h(i,o.maximumRadius,o.minimumRadius,r.longitude,r.latitude,n.longitude,n.latitude),i._start=t.clone(r,i._start),i._end=t.clone(n,i._end),i._start.height=0,i._end.height=0,l(i)}function p(e,n,o){var s=i(o,a.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(n)&&d(this,e,n,s)}var m=new e,f=new e;return n(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},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){d(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,i){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),h=Math.sin(4*o),d=Math.sin(6*o),p=Math.sin(8*o),m=o*o,f=o*m,_=n.u8Over256,g=n.u2Over4,v=n.u6Over64,y=n.u4Over16,C=2*f*_*a/3+o*(1-g+7*y/4-15*v/4+579*_/64-(y-15*v/4+187*_/16)*a-(5*v/4-115*_/16)*s-29*_*l/16)+(g/2-y+71*v/32-85*_/16)*u+(5*y/16-5*v/4+383*_/96)*h-m*((v-11*_/2)*u+5*_*h/2)+(29*v/96-29*_/16)*d+539*_*p/1536,w=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(w));C-=n.sigma;var E=Math.cos(2*n.sigma+C),b=Math.sin(C),T=Math.cos(C),x=n.cosineU*T,A=n.sineU*b,P=Math.atan2(b*n.sineHeading,x-A*n.cosineHeading),D=P-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,b,T,E);return r(i)?(i.longitude=this._start.longitude+D,i.latitude=S,i.height=0,i):new t(this._start.longitude+D,S,0)},p}),i("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,t,i){var r=b;r.length=e;var n;if(t===i){for(n=0;n<e;n++)r[n]=t;return r;
}var o=i-t,a=o/e;for(n=0;n<e;n++){var s=t+n*a;r[n]=s}return r}function p(t,i,r,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,P),c=n.scaleToGeodeticSurface(i,D),h=m.numberOfPoints(t,i,r),p=n.cartesianToCartographic(u,T),f=n.cartesianToCartographic(c,x),_=d(h,o,a);M.setEndPoints(p,f);var g=M.surfaceDistance/h,v=l;p.height=o;var y=n.cartographicToCartesian(p,A);e.pack(y,s,v),v+=3;for(var C=1;C<h;C++){var w=M.interpolateUsingSurfaceDistance(C*g,x);w.height=_[C],y=n.cartographicToCartesian(w,A),e.pack(y,s,v),v+=3}return v}var m={};m.numberOfPoints=function(t,i,r){var n=e.distance(t,i);return Math.ceil(n/r)};var f=new t;m.extractHeights=function(e,t){for(var i=e.length,r=new Array(i),n=0;n<i;n++){var o=e[n];r[n]=t.cartesianToCartographic(o,f).height}return r};var _=new c,g=new e,v=new e,y=new h(e.ZERO,0),C=new e,w=new h(e.ZERO,0),S=new e,E=new e,b=[],T=new t,x=new t,A=new e,P=new e,D=new e,M=new a;return m.wrapLongitude=function(t,n){var o=[],a=[];if(r(t)&&t.length>0){n=i(n,c.IDENTITY);var l=c.inverseTransformation(n,_),u=c.multiplyByPoint(l,e.ZERO,g),d=c.multiplyByPointAsVector(l,e.UNIT_Y,v),p=h.fromPointNormal(u,d,y),m=c.multiplyByPointAsVector(l,e.UNIT_X,C),f=h.fromPointNormal(u,m,w),b=1;o.push(e.clone(t[0]));for(var T=o[0],x=t.length,A=1;A<x;++A){var P=t[A];if(h.getPointDistance(f,T)<0||h.getPointDistance(f,P)<0){var D=s.lineSegmentPlane(T,P,p,S);if(r(D)){var M=e.multiplyByScalar(d,5e-9,E);h.getPointDistance(p,T)<0&&e.negate(M,M),o.push(e.add(D,M,new e)),a.push(b+1),e.negate(M,M),o.push(e.add(D,M,new e)),b=1}}o.push(e.clone(t[A])),b++,T=P}a.push(b)}return{positions:o,lengths:a}},m.generateArc=function(t){r(t)||(t={});var n=t.positions,a=n.length,s=i(t.ellipsoid,o.WGS84),c=i(t.height,0),h=l(c);if(a<1)return[];if(1===a){var d=s.scaleToGeodeticSurface(n[0],P);if(c=h?c[0]:c,0!==c){var f=s.geodeticSurfaceNormal(d,A);e.multiplyByScalar(f,c,f),e.add(d,f,d)}return[d.x,d.y,d.z]}var _=t.minDistance;if(!r(_)){var g=i(t.granularity,u.RADIANS_PER_DEGREE);_=u.chordLength(g,s.maximumRadius)}var v,y=0;for(v=0;v<a-1;v++)y+=m.numberOfPoints(n[v],n[v+1],_);var C=3*(y+1),w=new Array(C),S=0;for(v=0;v<a-1;v++){var E=n[v],x=n[v+1],D=h?c[v]:c,M=h?c[v+1]:c;S=p(E,x,_,s,D,M,w,S)}b.length=0;var I=n[a-1],R=s.cartesianToCartographic(I,T);R.height=h?c[a-1]:c;var O=s.cartographicToCartesian(R,A);return e.pack(O,w,C-3),w},m.generateCartesianArc=function(t){for(var i=m.generateArc(t),r=i.length/3,n=new Array(r),o=0;o<r;o++)n[o]=e.unpack(i,3*o);return n},m}),i("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++){var n=e[r];O=t.cartesianToCartographic(n,O),i[r]=O.height,e[r]=t.scaleToGeodeticSurface(n,n)}return i}function p(e,i,r,n){var o,a=e[0],s=e[1],l=t.angleBetween(a,s),u=Math.ceil(l/n),c=new Array(u);if(i===r){for(o=0;o<u;o++)c[o]=i;return c.push(r),c}var h=r-i,d=h/u;for(o=1;o<u;o++){var p=i+o*d;c[o]=p}return c[0]=i,c.push(r),c}function m(i,r,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,i,j),j),u=s.projectPointOntoPlane(t.add(n,r,Y),Y),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function f(e,i,r,n,o,a,u,c){var d=k,p=z;L=h.eastNorthUpToFixedFrame(e,o,L),d=l.multiplyByPointAsVector(L,N,d),d=t.normalize(d,d);var f=m(d,i,e,o);F=s.fromRotationZ(f,F),U.z=a,L=l.multiplyTransformation(L,l.fromRotationTranslation(F,U,B),L);var _=V;_[0]=u;for(var g=0;g<c;g++)for(var v=0;v<r.length;v+=3)p=t.fromArray(r,v,p),p=s.multiplyByVector(_,p,p),p=l.multiplyByPoint(L,p,p),n.push(p.x,p.y,p.z);return n}function _(e,i,r,n,o,a,s){for(var l=0;l<e.length;l+=3){var u=t.fromArray(e,l,G);n=f(u,i,r,n,o,a[l/3],s,1)}return n}function g(e,t){var i=e.length,r=new Array(6*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a;for(var l=1;l<i;l++){s=e[l];var u=s.x-o,c=s.y-a;r[n++]=u,r[n++]=0,r[n++]=c,r[n++]=u,r[n++]=0,r[n++]=c}return s=e[0],r[n++]=s.x-o,r[n++]=0,r[n++]=s.y-a,r}function v(e,t){for(var i=e.length,r=new Array(3*i),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;s<i;s++)r[n++]=e[s].x-o,r[n++]=0,r[n++]=e[s].y-a;return r}function y(e,i,r,o,l,u,h,d,p,m){var _,g=t.angleBetween(t.subtract(i,e,M),t.subtract(r,e,I)),v=o===n.BEVELED?0:Math.ceil(g/a.toRadians(5));_=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,M),g/(v+1),W),q):s.fromQuaternion(c.fromAxisAngle(e,g/(v+1),W),q);var y,C;if(i=t.clone(i,H),v>0)for(var w=m?2:1,S=0;S<v;S++)i=s.multiplyByVector(_,i,i),y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,I),h=f(C,y,d,h,u,p,1,w);else y=t.subtract(i,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(i,I),h=f(C,y,d,h,u,p,1,1),r=t.clone(r,H),y=t.subtract(r,e,M),y=t.normalize(y,y),l||(y=t.negate(y,y)),C=u.scaleToGeodeticSurface(r,I),h=f(C,y,d,h,u,p,1,1);return h}var C=[new t,new t],w=new t,S=new t,E=new t,b=new t,T=new t,x=new t,A=new t,P=new t,D=new t,M=new t,I=new t,R={},O=new r,N=new t(-1,0,0),L=new l,B=new l,F=new s,V=s.IDENTITY.clone(),k=new t,z=new i,U=new t,G=new t,W=new c,H=new t,q=new s;R.removeDuplicatesFromShape=function(t){for(var i=t.length,r=[],n=i-1,o=0;o<i;n=o++){var a=t[n],s=t[o];e.equals(a,s)||r.push(s)}return r};var j=new t,Y=new t;R.angleIsGreaterThanPi=function(e,i,r,n){var a=new o(r,n),s=a.projectPointOntoPlane(t.add(r,e,j),j),l=a.projectPointOntoPlane(t.add(r,i,Y),Y);return l.x*s.y-l.y*s.x>=0};var X=new t,Z=new t;return R.computePositions=function(e,i,r,o,s){var l=o._ellipsoid,c=d(e,l),h=o._granularity,m=o._cornerType,I=s?g(i,r):v(i,r),O=s?v(i,r):void 0,N=r.height/2,L=r.width/2,B=e.length,F=[],V=s?[]:void 0,k=w,z=S,U=E,G=b,W=T,H=x,q=A,j=P,Y=D,K=e[0],Q=e[1];G=l.geodeticSurfaceNormal(K,G),k=t.subtract(Q,K,k),k=t.normalize(k,k),j=t.cross(G,k,j),j=t.normalize(j,j);var J=c[0],$=c[1];s&&(V=f(K,j,O,V,l,J+N,1,1)),Y=t.clone(K,Y),K=Q,z=t.negate(k,z);for(var ee,te,ie=1;ie<B-1;ie++){var re=s?2:1;Q=e[ie+1],k=t.subtract(Q,K,k),k=t.normalize(k,k),U=t.add(k,z,U),U=t.normalize(U,U),G=l.geodeticSurfaceNormal(K,G);var ne=t.multiplyByScalar(G,t.dot(k,G),X);t.subtract(k,ne,ne),t.normalize(ne,ne);var oe=t.multiplyByScalar(G,t.dot(z,G),Z);t.subtract(z,oe,oe),t.normalize(oe,oe);var ae=!a.equalsEpsilon(Math.abs(t.dot(ne,oe)),1,a.EPSILON7);if(ae){U=t.cross(U,G,U),U=t.cross(G,U,U),U=t.normalize(U,U);var se=1/Math.max(.25,t.magnitude(t.cross(U,z,M))),le=R.angleIsGreaterThanPi(k,z,K,l);le?(W=t.add(K,t.multiplyByScalar(U,se*L,U),W),H=t.add(W,t.multiplyByScalar(j,L,H),H),C[0]=t.clone(Y,C[0]),C[1]=t.clone(H,C[1]),ee=p(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),F=_(te,j,I,F,l,ee,1),j=t.cross(G,k,j),j=t.normalize(j,j),q=t.add(W,t.multiplyByScalar(j,L,q),q),m===n.ROUNDED||m===n.BEVELED?y(W,H,q,m,le,l,F,I,$+N,s):(U=t.negate(U,U),F=f(K,U,I,F,l,$+N,se,re)),Y=t.clone(q,Y)):(W=t.add(K,t.multiplyByScalar(U,se*L,U),W),H=t.add(W,t.multiplyByScalar(j,-L,H),H),C[0]=t.clone(Y,C[0]),C[1]=t.clone(H,C[1]),ee=p(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),F=_(te,j,I,F,l,ee,1),j=t.cross(G,k,j),j=t.normalize(j,j),q=t.add(W,t.multiplyByScalar(j,-L,q),q),m===n.ROUNDED||m===n.BEVELED?y(W,H,q,m,le,l,F,I,$+N,s):F=f(K,U,I,F,l,$+N,se,re),Y=t.clone(q,Y)),z=t.negate(k,z)}else F=f(Y,j,I,F,l,J+N,1,1),Y=K;J=$,$=c[ie+1],K=Q}C[0]=t.clone(Y,C[0]),C[1]=t.clone(K,C[1]),ee=p(C,J+N,$+N,h),te=u.generateArc({positions:C,granularity:h,ellipsoid:l}),F=_(te,j,I,F,l,ee,1),s&&(V=f(K,j,O,V,l,$+N,1,1)),B=F.length;var ue=s?B+V.length:B,ce=new Float64Array(ue);return ce.set(F),s&&ce.set(V,B),ce},R}),i("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,i,r,n,o,a,s){"use strict";function l(i,o,a,l,u){var c=e.angleBetween(e.subtract(o,i,m),e.subtract(a,i,f)),h=l===t.BEVELED?1:Math.ceil(c/r.toRadians(5))+1,d=3*h,p=new Array(d);p[d-3]=a.x,p[d-2]=a.y,p[d-1]=a.z;var _;_=u?n.fromQuaternion(s.fromAxisAngle(e.negate(i,m),c/h,D),M):n.fromQuaternion(s.fromAxisAngle(i,c/h,D),M);var g=0;o=e.clone(o,m);for(var v=0;v<h;v++)o=n.multiplyByVector(_,o,o),p[g++]=o.x,p[g++]=o.y,p[g++]=o.z;return p}function u(i){var r=y,n=C,o=w,a=i[1];n=e.fromArray(i[1],a.length-3,n),o=e.fromArray(i[0],0,o),r=e.multiplyByScalar(e.add(n,o,r),.5,r);var s=l(r,n,o,t.ROUNDED,!1),u=i.length-1,c=i[u-1];a=i[u],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),r=e.multiplyByScalar(e.add(n,o,r),.5,r);var h=l(r,n,o,t.ROUNDED,!1);return[s,h]}function c(t,i,r,n){var o=m;return n?o=e.add(t,i,o):(i=e.negate(i,i),o=e.add(t,i,o)),[o.x,o.y,o.z,r.x,r.y,r.z]}function h(t,i,r,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(i,r,m),l=e.negate(s,f),u=0,c=t.length-1,h=0;h<t.length;h+=3){var d=e.fromArray(t,h,_),p=e.add(d,l,g);o[u++]=p.x,o[u++]=p.y,o[u++]=p.z;var v=e.add(d,s,g);a[c--]=v.z,a[c--]=v.y,a[c--]=v.x}return n.push(o,a),n}function d(e,t){for(var i=0;i<e.length;i++)e[i]=t.scaleToGeodeticSurface(e[i],e[i]);return e}var p={},m=new e,f=new e,_=new e,g=new e,v=[new e,new e],y=new e,C=new e,w=new e,S=new e,E=new e,b=new e,T=new e,x=new e,A=new e,P=new e,D=new s,M=new n;p.addAttribute=function(e,t,r,n){var o=t.x,a=t.y,s=t.z;i(r)&&(e[r]=o,e[r+1]=a,e[r+2]=s),i(n)&&(e[n]=s,e[n-1]=a,e[n-2]=o)};var I=new e,R=new e;return p.computePositions=function(i){var n=i.granularity,s=i.positions,p=i.ellipsoid;s=d(s,p);var f=i.width/2,_=i.cornerType,g=i.saveAttributes,D=y,M=C,O=w,N=S,L=E,B=b,F=T,V=x,k=A,z=P,U=[],G=g?[]:void 0,W=g?[]:void 0,H=s[0],q=s[1];M=e.normalize(e.subtract(q,H,M),M),D=p.geodeticSurfaceNormal(H,D),N=e.normalize(e.cross(D,M,N),N),g&&(G.push(N.x,N.y,N.z),W.push(D.x,D.y,D.z)),F=e.clone(H,F),H=q,O=e.negate(M,O);var j,Y,X=[],Z=s.length;for(Y=1;Y<Z-1;Y++){D=p.geodeticSurfaceNormal(H,D),q=s[Y+1],M=e.normalize(e.subtract(q,H,M),M),L=e.normalize(e.add(M,O,L),L);var K=e.multiplyByScalar(D,e.dot(M,D),I);e.subtract(M,K,K),e.normalize(K,K);var Q=e.multiplyByScalar(D,e.dot(O,D),R);e.subtract(O,Q,Q),e.normalize(Q,Q);var J=!r.equalsEpsilon(Math.abs(e.dot(K,Q)),1,r.EPSILON7);if(J){L=e.cross(L,D,L),L=e.cross(D,L,L),L=e.normalize(L,L);var $=f/Math.max(.25,e.magnitude(e.cross(L,O,m))),ee=a.angleIsGreaterThanPi(M,O,H,p);L=e.multiplyByScalar(L,$,L),ee?(V=e.add(H,L,V),z=e.add(V,e.multiplyByScalar(N,f,z),z),k=e.add(V,e.multiplyByScalar(N,2*f,k),k),v[0]=e.clone(F,v[0]),v[1]=e.clone(z,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:p}),U=h(j,N,f,U),g&&(G.push(N.x,N.y,N.z),W.push(D.x,D.y,D.z)),B=e.clone(k,B),N=e.normalize(e.cross(D,M,N),N),k=e.add(V,e.multiplyByScalar(N,2*f,k),k),F=e.add(V,e.multiplyByScalar(N,f,F),F),_===t.ROUNDED||_===t.BEVELED?X.push({leftPositions:l(V,B,k,_,ee)}):X.push({leftPositions:c(H,e.negate(L,L),k,ee)})):(k=e.add(H,L,k),z=e.add(k,e.negate(e.multiplyByScalar(N,f,z),z),z),V=e.add(k,e.negate(e.multiplyByScalar(N,2*f,V),V),V),v[0]=e.clone(F,v[0]),v[1]=e.clone(z,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:p}),U=h(j,N,f,U),g&&(G.push(N.x,N.y,N.z),W.push(D.x,D.y,D.z)),B=e.clone(V,B),N=e.normalize(e.cross(D,M,N),N),V=e.add(k,e.negate(e.multiplyByScalar(N,2*f,V),V),V),F=e.add(k,e.negate(e.multiplyByScalar(N,f,F),F),F),_===t.ROUNDED||_===t.BEVELED?X.push({rightPositions:l(k,B,V,_,ee)}):X.push({rightPositions:c(H,L,V,ee)})),O=e.negate(M,O)}H=q}D=p.geodeticSurfaceNormal(H,D),v[0]=e.clone(F,v[0]),v[1]=e.clone(H,v[1]),j=o.generateArc({positions:v,granularity:n,ellipsoid:p}),U=h(j,N,f,U),g&&(G.push(N.x,N.y,N.z),W.push(D.x,D.y,D.z));var te;return _===t.ROUNDED&&(te=u(U)),{positions:U,corners:X,lefts:G,normals:W,endPositions:te}},p}),i("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,i,n){n=n||2;var o=i&&i.length,a=o?i[0]*n:e.length,s=t(e,0,a,n,!0),u=[];if(!s)return u;var c,h,d,p,m,f,_;if(o&&(s=l(e,i,s,n)),e.length>80*n){c=d=e[0],h=p=e[1];for(var g=n;g<a;g+=n)m=e[g],f=e[g+1],m<c&&(c=m),f<h&&(h=f),m>d&&(d=m),f>p&&(p=f);_=Math.max(d-c,p-h)}return r(s,u,n,c,h,_),u}function t(e,t,i,r,n){var o,a;if(n===P(e,t,i,r)>0)for(o=t;o<i;o+=r)a=T(o,e[o],e[o+1],a);else for(o=i-r;o>=t;o-=r)a=T(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(x(a),a=a.next),a}function i(e,t){if(!e)return e;t||(t=e);var i,r=e;do if(i=!1,r.steiner||!y(r,r.next)&&0!==v(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;i=!0}while(i||r!==t);return t}function r(e,t,l,u,c,h,p){if(e){!p&&h&&d(e,u,c,h);for(var m,f,_=e;e.prev!==e.next;)if(m=e.prev,f=e.next,h?o(e,u,c,h):n(e))t.push(m.i/l),t.push(e.i/l),t.push(f.i/l),x(e),e=f.next,_=f.next;else if(e=f,e===_){p?1===p?(e=a(e,t,l),r(e,t,l,u,c,h,2)):2===p&&s(e,t,l,u,c,h):r(i(e),t,l,u,c,h,1);break}}}function n(e){var t=e.prev,i=e,r=e.next;if(v(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(_(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&v(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(e,t,i,r){var n=e.prev,o=e,a=e.next;if(v(n,o,a)>=0)return!1;for(var s=n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,l=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,u=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,h=m(s,l,t,i,r),d=m(u,c,t,i,r),p=e.nextZ;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function a(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!y(n,o)&&C(n,r,r.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),x(r),x(r.next),r=e=o),r=r.next}while(r!==e);return r}function s(e,t,n,o,a,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=b(l,u);return l=i(l,l.next),c=i(c,c.next),r(l,t,n,o,a,s),void r(c,t,n,o,a,s)}u=u.next}l=l.next}while(l!==e)}function l(e,r,n,o){var a,s,l,h,d,p=[];for(a=0,s=r.length;a<s;a++)l=r[a]*o,h=a<s-1?r[a+1]*o:e.length,d=t(e,l,h,o,!1),d===d.next&&(d.steiner=!0),p.push(f(d));for(p.sort(u),a=0;a<p.length;a++)c(p[a],n),n=i(n,n.next);return n}function u(e,t){return e.x-t.x}function c(e,t){if(t=h(e,t)){var r=b(t,e);i(r,r.next)}}function h(e,t){var i,r=t,n=e.x,o=e.y,a=-(1/0);do{if(o<=r.y&&o>=r.next.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!i)return null;if(n===a)return i.prev;var l,u=i,c=i.x,h=i.y,d=1/0;for(r=i.next;r!==u;)n>=r.x&&r.x>=c&&_(o<h?n:a,o,c,h,o<h?a:n,o,r.x,r.y)&&(l=Math.abs(o-r.y)/(n-r.x),(l<d||l===d&&r.x>i.x)&&S(r,e)&&(i=r,d=l)),r=r.next;return i}function d(e,t,i,r){var n=e;do null===n.z&&(n.z=m(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,p(n)}function p(e){var t,i,r,n,o,a,s,l,u=1;do{for(i=e,e=null,o=null,a=0;i;){for(a++,r=i,s=0,t=0;t<u&&(s++,r=r.nextZ,r);t++);for(l=u;s>0||l>0&&r;)0===s?(n=r,r=r.nextZ,l--):0!==l&&r?i.z<=r.z?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,l--):(n=i,i=i.nextZ,s--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(a>1);return e}function m(e,t,i,r,n){return e=32767*(e-i)/n,t=32767*(t-r)/n,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function f(e){var t=e,i=e;do t.x<i.x&&(i=t),t=t.next;while(t!==e);return i}function _(e,t,i,r,n,o,a,s){return(n-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(i-a)*(t-s)>=0&&(i-a)*(o-s)-(n-a)*(r-s)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!w(e,t)&&S(e,t)&&S(t,e)&&E(e,t)}function v(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,i,r){return!!(y(e,t)&&y(i,r)||y(e,r)&&y(i,t))||v(e,t,i)>0!=v(e,t,r)>0&&v(i,r,e)>0!=v(i,r,t)>0}function w(e,t){var i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&C(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function S(e,t){return v(e.prev,e,e.next)<0?v(e,t,e.next)>=0&&v(e,e.prev,t)>=0:v(e,t,e.prev)<0||v(e,e.next,t)<0}function E(e,t){var i=e,r=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do i.y>o!=i.next.y>o&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==e);return r}function b(e,t){var i=new A(e.i,e.x,e.y),r=new A(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function T(e,t,i,r){var n=new A(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function x(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(e,t,i,r){for(var n=0,o=t,a=i-r;o<i;o+=r)n+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return n}return e.deviation=function(e,t,i,r){var n=t&&t.length,o=n?t[0]*i:e.length,a=Math.abs(P(e,0,o,i));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*i,c=s<l-1?t[s+1]*i:e.length;a-=Math.abs(P(e,u,c,i))}var h=0;for(s=0;s<r.length;s+=3){var d=r[s]*i,p=r[s+1]*i,m=r[s+2]*i;h+=Math.abs((e[d]-e[m])*(e[p+1]-e[d+1])-(e[d]-e[p])*(e[m+1]-e[d+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},e.flatten=function(e){for(var t=e[0][0].length,i={vertices:[],holes:[],dimensions:t},r=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var a=0;a<t;a++)i.vertices.push(e[n][o][a]);n>0&&(r+=e[n-1].length,i.holes.push(r))}return i},e}),i("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===i.CLOCKWISE||e===i.COUNTER_CLOCKWISE}};return e(i)}),i("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";var p=new i,m=new i,f={};f.computeArea2D=function(e){for(var t=e.length,i=0,r=t-1,n=0;n<t;r=n++){var o=e[r],a=e[n];i+=o.x*a.y-a.x*o.y}return.5*i},f.computeWindingOrder2D=function(e){var t=f.computeArea2D(e);return t>0?d.COUNTER_CLOCKWISE:d.CLOCKWISE},f.triangulate=function(i,r){var n=t.packArray(i);return e(n,r,2)};var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i,S=new i;return f.computeSubdivision=function(e,t,a,s){s=n(s,c.RADIANS_PER_DEGREE);var d,p=a.slice(0),m=t.length,f=new Array(3*m),E=0;for(d=0;d<m;d++){var b=t[d];f[E++]=b.x,f[E++]=b.y,f[E++]=b.z}for(var T=[],x={},A=e.maximumRadius,P=c.chordLength(s,A),D=P*P;p.length>0;){var M,I,R=p.pop(),O=p.pop(),N=p.pop(),L=i.fromArray(f,3*N,_),B=i.fromArray(f,3*O,g),F=i.fromArray(f,3*R,v),V=i.multiplyByScalar(i.normalize(L,y),A,y),k=i.multiplyByScalar(i.normalize(B,C),A,C),z=i.multiplyByScalar(i.normalize(F,w),A,w),U=i.magnitudeSquared(i.subtract(V,k,S)),G=i.magnitudeSquared(i.subtract(k,z,S)),W=i.magnitudeSquared(i.subtract(z,V,S)),H=Math.max(U,G,W);H>D?U===H?(M=Math.min(N,O)+" "+Math.max(N,O),d=x[M],o(d)||(I=i.add(L,B,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(N,d,R),p.push(d,O,R)):G===H?(M=Math.min(O,R)+" "+Math.max(O,R),d=x[M],o(d)||(I=i.add(B,F,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(O,d,N),p.push(d,R,N)):W===H&&(M=Math.min(R,N)+" "+Math.max(R,N),d=x[M],o(d)||(I=i.add(F,L,S),i.multiplyByScalar(I,.5,I),f.push(I.x,I.y,I.z),d=f.length/3-1,x[M]=d),p.push(R,d,O),p.push(d,N,O)):(T.push(N),T.push(O),T.push(R))}return new l({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:f})},indices:T,primitiveType:h.TRIANGLES})},f.scaleToGeodeticHeight=function(e,t,r,a){r=n(r,s.WGS84);var l=p,u=m;if(t=n(t,0),a=n(a,!0),o(e))for(var c=e.length,h=0;h<c;h+=3)i.fromArray(e,h,u),a&&(u=r.scaleToGeodeticSurface(u,u)),0!==t&&(l=r.geodeticSurfaceNormal(u,l),i.multiplyByScalar(l,t,l),i.add(u,l,u)),e[h]=u.x,e[h+1]=u.y,e[h+2]=u.z;return e},f}),i("Core/CorridorGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";function w(e,t,r,n,o,s){var l=e.normals,u=e.tangents,c=e.binormals,h=i.normalize(i.cross(r,t,L),L);s.normal&&a.addAttribute(l,t,n,o),s.binormal&&a.addAttribute(c,r,n,o),s.tangent&&a.addAttribute(u,h,n,o)}function S(e,t,r){var o,s,u,c=e.positions,h=e.corners,d=e.endPositions,g=e.lefts,v=e.normals,y=new m,C=0,S=0,E=0;for(s=0;s<c.length;s+=2)u=c[s].length-3,C+=u,E+=2*u,S+=c[s+1].length-3;for(C+=3,S+=3,s=0;s<h.length;s++){o=h[s];var b=h[s].leftPositions;l(b)?(u=b.length,C+=u,E+=u):(u=h[s].rightPositions.length,S+=u,E+=u)}var T,x=l(d);x&&(T=d[0].length-3,C+=T,S+=T,T/=3,E+=6*T);var A,P,O,F,V,k,z=C+S,U=new Float64Array(z),G=t.normal?new Float32Array(z):void 0,W=t.tangent?new Float32Array(z):void 0,H=t.binormal?new Float32Array(z):void 0,q={normals:G,tangents:W,binormals:H},j=0,Y=z-1,X=D,Z=M,K=T/2,Q=f.createTypedArray(z/3,E),J=0;if(x){k=I,V=R;var $=d[0];for(X=i.fromArray(v,0,X),Z=i.fromArray(g,0,Z),s=0;s<K;s++)k=i.fromArray($,3*(K-1-s),k),V=i.fromArray($,3*(K+s),V),a.addAttribute(U,V,j),a.addAttribute(U,k,void 0,Y),w(q,X,Z,j,Y,t),P=j/3,F=P+1,A=(Y-2)/3,O=A-1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3}var ee=0,te=0,ie=c[ee++],re=c[ee++];U.set(ie,j),U.set(re,Y-re.length+1),Z=i.fromArray(g,te,Z);var ne,oe;for(u=re.length-3,s=0;s<u;s+=3)ne=r.geodeticSurfaceNormal(i.fromArray(ie,s,L),L),oe=r.geodeticSurfaceNormal(i.fromArray(re,u-s,B),B),X=i.normalize(i.add(ne,oe,X),X),w(q,X,Z,j,Y,t),P=j/3,F=P+1,A=(Y-2)/3,O=A-1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3;for(ne=r.geodeticSurfaceNormal(i.fromArray(ie,u,L),L),oe=r.geodeticSurfaceNormal(i.fromArray(re,u,B),B),X=i.normalize(i.add(ne,oe,X),X),te+=3,s=0;s<h.length;s++){var ae;o=h[s];var se,le,ue=o.leftPositions,ce=o.rightPositions,he=N,de=I,pe=R;if(X=i.fromArray(v,te,X),l(ue)){for(w(q,X,Z,void 0,Y,t),Y-=3,se=F,le=O,ae=0;ae<ue.length/3;ae++)he=i.fromArray(ue,3*ae,he),Q[J++]=se,Q[J++]=le-ae-1,Q[J++]=le-ae,a.addAttribute(U,he,void 0,Y),de=i.fromArray(U,3*(le-ae-1),de),pe=i.fromArray(U,3*se,pe),Z=i.normalize(i.subtract(de,pe,Z),Z),w(q,X,Z,void 0,Y,t),Y-=3;he=i.fromArray(U,3*se,he),de=i.subtract(i.fromArray(U,3*le,de),he,de),pe=i.subtract(i.fromArray(U,3*(le-ae),pe),he,pe),Z=i.normalize(i.add(de,pe,Z),Z),w(q,X,Z,j,void 0,t),j+=3}else{for(w(q,X,Z,j,void 0,t),j+=3,se=O,le=F,ae=0;ae<ce.length/3;ae++)he=i.fromArray(ce,3*ae,he),Q[J++]=se,Q[J++]=le+ae,Q[J++]=le+ae+1,a.addAttribute(U,he,j),de=i.fromArray(U,3*se,de),pe=i.fromArray(U,3*(le+ae),pe),Z=i.normalize(i.subtract(de,pe,Z),Z),w(q,X,Z,j,void 0,t),j+=3;he=i.fromArray(U,3*se,he),de=i.subtract(i.fromArray(U,3*(le+ae),de),he,de),pe=i.subtract(i.fromArray(U,3*le,pe),he,pe),Z=i.normalize(i.negate(i.add(pe,de,Z),Z),Z),w(q,X,Z,void 0,Y,t),Y-=3}for(ie=c[ee++],re=c[ee++],ie.splice(0,3),re.splice(re.length-3,3),U.set(ie,j),U.set(re,Y-re.length+1),u=re.length-3,te+=3,Z=i.fromArray(g,te,Z),ae=0;ae<re.length;ae+=3)ne=r.geodeticSurfaceNormal(i.fromArray(ie,ae,L),L),oe=r.geodeticSurfaceNormal(i.fromArray(re,u-ae,B),B),X=i.normalize(i.add(ne,oe,X),X),w(q,X,Z,j,Y,t),F=j/3,P=F-1,O=(Y-2)/3,A=O+1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3;j-=3,Y+=3}if(X=i.fromArray(v,v.length-3,X),w(q,X,Z,j,Y,t),x){j+=3,Y-=3,k=I,V=R;var me=d[1];for(s=0;s<K;s++)k=i.fromArray(me,3*(T-s-1),k),V=i.fromArray(me,3*s,V),a.addAttribute(U,k,void 0,Y),a.addAttribute(U,V,j),w(q,X,Z,j,Y,t),F=j/3,P=F-1,O=(Y-2)/3,A=O+1,Q[J++]=A,Q[J++]=P,Q[J++]=O,Q[J++]=O,Q[J++]=P,Q[J++]=F,j+=3,Y-=3}if(y.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:U}),t.st){var fe,_e,ge=new Float32Array(z/3*2),ve=0;if(x){C/=3,S/=3;var ye=Math.PI/(T+1);_e=1/(C-T+1),fe=1/(S-T+1);var Ce,we=T/2;for(s=we+1;s<T+1;s++)Ce=_.PI_OVER_TWO+ye*s,ge[ve++]=fe*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=1;s<S-T+1;s++)ge[ve++]=s*fe,ge[ve++]=0;for(s=T;s>we;s--)Ce=_.PI_OVER_TWO-s*ye,ge[ve++]=1-fe*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=we;s>0;s--)Ce=_.PI_OVER_TWO-ye*s,ge[ve++]=1-_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=C-T;s>0;s--)ge[ve++]=s*_e,ge[ve++]=1;for(s=1;s<we+1;s++)Ce=_.PI_OVER_TWO+ye*s,ge[ve++]=_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce))}else{for(C/=3,S/=3,_e=1/(C-1),fe=1/(S-1),s=0;s<S;s++)ge[ve++]=s*fe,ge[ve++]=0;for(s=C;s>0;s--)ge[ve++]=(s-1)*_e,ge[ve++]=1}y.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:ge})}return t.normal&&(y.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.normals})),t.tangent&&(y.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.tangents})),t.binormal&&(y.binormal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.binormals})),{attributes:y,indices:Q}}function E(e,t){if(!(t.normal||t.binormal||t.tangent||t.st))return e;var r,n,o=e.position.values;(t.normal||t.binormal)&&(r=e.normal.values,n=e.binormal.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,h=2*u;if(t.normal||t.binormal||t.tangent){var d=t.normal?new Float32Array(6*u):void 0,p=t.binormal?new Float32Array(6*u):void 0,m=t.tangent?new Float32Array(6*u):void 0,f=D,_=M,g=I,v=R,y=O,C=N,w=h;for(s=0;s<u;s+=3){var S=w+h;f=i.fromArray(o,s,f),_=i.fromArray(o,s+u,_),g=i.fromArray(o,(s+3)%u,g),_=i.subtract(_,f,_),g=i.subtract(g,f,g),v=i.normalize(i.cross(_,g,v),v),t.normal&&(a.addAttribute(d,v,S),a.addAttribute(d,v,S+3),a.addAttribute(d,v,w),a.addAttribute(d,v,w+3)),(t.tangent||t.binormal)&&(C=i.fromArray(r,s,C),t.binormal&&(a.addAttribute(p,C,S),a.addAttribute(p,C,S+3),a.addAttribute(p,C,w),a.addAttribute(p,C,w+3)),t.tangent&&(y=i.normalize(i.cross(C,v,y),y),a.addAttribute(m,y,S),a.addAttribute(m,y,S+3),a.addAttribute(m,y,w),a.addAttribute(m,y,w+3))),w+=6}if(t.normal){for(d.set(r),s=0;s<u;s+=3)d[s+u]=-r[s],d[s+u+1]=-r[s+1],d[s+u+2]=-r[s+2];e.normal.values=d}else e.normal=void 0;if(t.binormal?(p.set(n),p.set(n,u),e.binormal.values=p):e.binormal=void 0,t.tangent){var E=e.tangent.values;m.set(E),m.set(E,u),e.tangent.values=m}}if(t.st){var b=e.st.values,T=new Float32Array(6*c);T.set(b),T.set(b,c);for(var x=2*c,A=0;A<2;A++){for(T[x++]=b[0],T[x++]=b[1],s=2;s<c;s+=2){var P=b[s],L=b[s+1];T[x++]=P,T[x++]=L,T[x++]=P,T[x++]=L}T[x++]=b[0],T[x++]=b[1]}e.st.values=T}return e}function b(e,t,i){i[t++]=e[0],i[t++]=e[1],i[t++]=e[2];for(var r=3;r<e.length;r+=3){var n=e[r],o=e[r+1],a=e[r+2];i[t++]=n,i[t++]=o,i[t++]=a,i[t++]=n,i[t++]=o,i[t++]=a}return i[t++]=e[0],i[t++]=e[1],i[t++]=e[2],i}function T(e,t){var i=new C({position:t.positon,normal:t.normal||t.binormal,tangent:t.tangent,binormal:t.normal||t.binormal,st:t.st}),r=e.ellipsoid,n=a.computePositions(e),o=S(n,i,r),s=e.height,l=e.extrudedHeight,u=o.attributes,c=o.indices,h=u.position.values,d=h.length,p=new Float64Array(6*d),m=new Float64Array(d);m.set(h);var _=new Float64Array(4*d);h=g.scaleToGeodeticHeight(h,s,r),_=b(h,0,_),m=g.scaleToGeodeticHeight(m,l,r),_=b(m,2*d,_),p.set(h),p.set(m,d),p.set(_,2*d),u.position.values=p,d/=3;var v,y=c.length,w=d+d,T=f.createTypedArray(p.length/3,2*y+3*w);T.set(c);var x=y;for(v=0;v<y;v+=3){var A=c[v],P=c[v+1],D=c[v+2];T[x++]=D+d,T[x++]=P+d,T[x++]=A+d}u=E(u,t);var M,I,R,O;for(v=0;v<w;v+=2)M=v+w,I=M+w,R=M+1,O=I+1,T[x++]=M,T[x++]=I,T[x++]=R,T[x++]=R,T[x++]=I,T[x++]=O;return{attributes:u,indices:T}}function x(e,t,r,n,o,a){var s=i.subtract(t,e,F);i.normalize(s,s);var l=r.geodeticSurfaceNormal(e,V),u=i.cross(s,l,F);i.multiplyByScalar(u,n,u);var c=o.latitude,h=o.longitude,d=a.latitude,p=a.longitude;i.add(e,u,V),r.cartesianToCartographic(V,k);var m=k.latitude,f=k.longitude;c=Math.min(c,m),h=Math.min(h,f),d=Math.max(d,m),p=Math.max(p,f),i.subtract(e,u,V),r.cartesianToCartographic(V,k),m=k.latitude,f=k.longitude,c=Math.min(c,m),h=Math.min(h,f),d=Math.max(d,m),p=Math.max(p,f),o.latitude=c,o.longitude=h,a.latitude=d,a.longitude=p}function A(t,r,n,a){var s=e(t,i.equalsEpsilon),l=s.length;if(l<2||n<=0)return new y;var u=.5*n;G.latitude=Number.POSITIVE_INFINITY,G.longitude=Number.POSITIVE_INFINITY,W.latitude=Number.NEGATIVE_INFINITY,W.longitude=Number.NEGATIVE_INFINITY;var c,h;if(a===o.ROUNDED){var d=s[0];i.subtract(d,s[1],z),i.normalize(z,z),i.multiplyByScalar(z,u,z),i.add(d,z,U),r.cartesianToCartographic(U,k),c=k.latitude,h=k.longitude,G.latitude=Math.min(G.latitude,c),G.longitude=Math.min(G.longitude,h),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,h)}for(var p=0;p<l-1;++p)x(s[p],s[p+1],r,u,G,W);var m=s[l-1];i.subtract(m,s[l-2],z),i.normalize(z,z),i.multiplyByScalar(z,u,z),i.add(m,z,U),x(m,U,r,u,G,W),a===o.ROUNDED&&(r.cartesianToCartographic(U,k),c=k.latitude,h=k.longitude,G.latitude=Math.min(G.latitude,c),G.longitude=Math.min(G.longitude,h),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,h));var f=new y;return f.north=W.latitude,f.south=G.latitude,f.east=W.longitude,f.west=G.longitude,f}function P(e){e=s(e,s.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=h.clone(s(e.ellipsoid,h.WGS84)),this._vertexFormat=C.clone(s(e.vertexFormat,C.DEFAULT)),this._width=r,this._height=s(e.height,0),this._extrudedHeight=s(e.extrudedHeight,this._height),this._cornerType=s(e.cornerType,o.ROUNDED),this._granularity=s(e.granularity,_.RADIANS_PER_DEGREE),this._workerName="createCorridorGeometry",this._rectangle=A(t,this._ellipsoid,r,this._cornerType),this.packedLength=1+t.length*i.packedLength+h.packedLength+C.packedLength+y.packedLength+5}var D=new i,M=new i,I=new i,R=new i,O=new i,N=new i,L=new i,B=new i,F=new i,V=new i,k=new r,z=new i,U=new i,G=new r,W=new r;P.pack=function(e,t,r){r=s(r,0);var n=e._positions,o=n.length;t[r++]=o;for(var a=0;a<o;++a,r+=i.packedLength)i.pack(n[a],t,r);return h.pack(e._ellipsoid,t,r),r+=h.packedLength,C.pack(e._vertexFormat,t,r),r+=C.packedLength,y.pack(e._rectangle,t,r),r+=y.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r]=e._granularity,t};var H=h.clone(h.UNIT_SPHERE),q=new C,j=new y,Y={positions:void 0,ellipsoid:H,vertexFormat:q,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return P.unpack=function(e,t,r){t=s(t,0);for(var n=e[t++],o=new Array(n),a=0;a<n;++a,t+=i.packedLength)o[a]=i.unpack(e,t);var u=h.unpack(e,t,H);t+=h.packedLength;var c=C.unpack(e,t,q);t+=C.packedLength;var d=y.unpack(e,t,j);t+=y.packedLength;var p=e[t++],m=e[t++],f=e[t++],_=e[t++],g=e[t];return l(r)?(r._positions=o,r._ellipsoid=h.clone(u,r._ellipsoid),r._vertexFormat=C.clone(c,r._vertexFormat),r._width=p,r._height=m,r._extrudedHeight=f,r._cornerType=_,r._granularity=g,r._rectangle=y.clone(d),r):(Y.positions=o,Y.width=p,Y.height=m,Y.extrudedHeight=f,Y.cornerType=_,Y.granularity=g,new P(Y))},P.createGeometry=function(r){var n=r._positions,o=r._height,s=r._width,l=r._extrudedHeight,u=o!==l,c=e(n,i.equalsEpsilon);if(!(c.length<2||s<=0)){var h,p=r._ellipsoid,m=r._vertexFormat,f={ellipsoid:p,positions:c,width:s,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!0};if(u){var _=Math.max(o,l);l=Math.min(o,l),o=_,f.height=o,f.extrudedHeight=l,h=T(f,m)}else{var y=a.computePositions(f);h=S(y,m,p),h.attributes.position.values=g.scaleToGeodeticHeight(h.attributes.position.values,o,p)}var C=h.attributes,w=t.fromVertices(C.position.values,void 0,3);return m.position||(h.attributes.position.values=void 0),new d({attributes:C,indices:h.indices,primitiveType:v.TRIANGLES,boundingSphere:w})}},P.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new P({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:r,extrudedHeight:o,height:a,vertexFormat:C.POSITION_ONLY})},u(P.prototype,{rectangle:{
get:function(){return this._rectangle}}}),P}),i("Core/CorridorOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";function g(e,t){var a,l,u,c=[],m=e.positions,f=e.corners,_=e.endPositions,g=new d,v=0,y=0,E=0;for(l=0;l<m.length;l+=2)u=m[l].length-3,v+=u,E+=u/3*4,y+=m[l+1].length-3;for(v+=3,y+=3,l=0;l<f.length;l++){a=f[l];var b=f[l].leftPositions;s(b)?(u=b.length,v+=u,E+=u/3*2):(u=f[l].rightPositions.length,y+=u,E+=u/3*2)}var T,x=s(_);x&&(T=_[0].length-3,v+=T,y+=T,T/=3,E+=4*T);var A,P,D,M,I,R,O=v+y,N=new Float64Array(O),L=0,B=O-1,F=T/2,V=p.createTypedArray(O/3,E+4),k=0;if(V[k++]=L/3,V[k++]=(B-2)/3,x){c.push(L/3),R=C,I=w;var z=_[0];for(l=0;l<F;l++)R=i.fromArray(z,3*(F-1-l),R),I=i.fromArray(z,3*(F+l),I),o.addAttribute(N,I,L),o.addAttribute(N,R,void 0,B),P=L/3,M=P+1,A=(B-2)/3,D=A-1,V[k++]=A,V[k++]=D,V[k++]=P,V[k++]=M,L+=3,B-=3}var U=0,G=m[U++],W=m[U++];for(N.set(G,L),N.set(W,B-W.length+1),u=W.length-3,c.push(L/3,(B-2)/3),l=0;l<u;l+=3)P=L/3,M=P+1,A=(B-2)/3,D=A-1,V[k++]=A,V[k++]=D,V[k++]=P,V[k++]=M,L+=3,B-=3;for(l=0;l<f.length;l++){var H;a=f[l];var q,j=a.leftPositions,Y=a.rightPositions,X=S;if(s(j)){for(B-=3,q=D,c.push(M),H=0;H<j.length/3;H++)X=i.fromArray(j,3*H,X),V[k++]=q-H-1,V[k++]=q-H,o.addAttribute(N,X,void 0,B),B-=3;c.push(q-Math.floor(j.length/6)),t===n.BEVELED&&c.push((B-2)/3+1),L+=3}else{for(L+=3,q=M,c.push(D),H=0;H<Y.length/3;H++)X=i.fromArray(Y,3*H,X),V[k++]=q+H,V[k++]=q+H+1,o.addAttribute(N,X,L),L+=3;c.push(q+Math.floor(Y.length/6)),t===n.BEVELED&&c.push(L/3-1),B-=3}for(G=m[U++],W=m[U++],G.splice(0,3),W.splice(W.length-3,3),N.set(G,L),N.set(W,B-W.length+1),u=W.length-3,H=0;H<W.length;H+=3)M=L/3,P=M-1,D=(B-2)/3,A=D+1,V[k++]=A,V[k++]=D,V[k++]=P,V[k++]=M,L+=3,B-=3;L-=3,B+=3,c.push(L/3,(B-2)/3)}if(x){L+=3,B-=3,R=C,I=w;var Z=_[1];for(l=0;l<F;l++)R=i.fromArray(Z,3*(T-l-1),R),I=i.fromArray(Z,3*l,I),o.addAttribute(N,R,void 0,B),o.addAttribute(N,I,L),M=L/3,P=M-1,D=(B-2)/3,A=D+1,V[k++]=A,V[k++]=D,V[k++]=P,V[k++]=M,L+=3,B-=3;c.push(L/3)}else c.push(L/3,(B-2)/3);return V[k++]=L/3,V[k++]=(B-2)/3,g.position=new h({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:N}),{attributes:g,indices:V,wallIndices:c}}function v(e){var t=e.ellipsoid,i=o.computePositions(e),r=g(i,e.cornerType),n=r.wallIndices,a=e.height,s=e.extrudedHeight,l=r.attributes,u=r.indices,c=l.position.values,h=c.length,d=new Float64Array(h);d.set(c);var m=new Float64Array(2*h);c=f.scaleToGeodeticHeight(c,a,t),d=f.scaleToGeodeticHeight(d,s,t),m.set(c),m.set(d,h),l.position.values=m,h/=3;var _,v=u.length,y=p.createTypedArray(m.length/3,2*(v+n.length));y.set(u);var C=v;for(_=0;_<v;_+=2){var w=u[_],S=u[_+1];y[C++]=w+h,y[C++]=S+h}var E,b;for(_=0;_<n.length;_++)E=n[_],b=E+h,y[C++]=E,y[C++]=b;return{attributes:l,indices:y}}function y(e){e=a(e,a.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=u.clone(a(e.ellipsoid,u.WGS84)),this._width=r,this._height=a(e.height,0),this._extrudedHeight=a(e.extrudedHeight,this._height),this._cornerType=a(e.cornerType,n.ROUNDED),this._granularity=a(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*i.packedLength+u.packedLength+5}var C=new i,w=new i,S=new i;y.pack=function(e,t,r){r=a(r,0);var n=e._positions,o=n.length;t[r++]=o;for(var s=0;s<o;++s,r+=i.packedLength)i.pack(n[s],t,r);return u.pack(e._ellipsoid,t,r),r+=u.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r]=e._granularity,t};var E=u.clone(u.UNIT_SPHERE),b={positions:void 0,ellipsoid:E,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return y.unpack=function(e,t,r){t=a(t,0);for(var n=e[t++],o=new Array(n),l=0;l<n;++l,t+=i.packedLength)o[l]=i.unpack(e,t);var c=u.unpack(e,t,E);t+=u.packedLength;var h=e[t++],d=e[t++],p=e[t++],m=e[t++],f=e[t];return s(r)?(r._positions=o,r._ellipsoid=u.clone(c,r._ellipsoid),r._width=h,r._height=d,r._extrudedHeight=p,r._cornerType=m,r._granularity=f,r):(b.positions=o,b.width=h,b.height=d,b.extrudedHeight=p,b.cornerType=m,b.granularity=f,new y(b))},y.createGeometry=function(r){var n=r._positions,a=r._height,s=r._width,l=r._extrudedHeight,u=a!==l,h=e(n,i.equalsEpsilon);if(!(h.length<2||s<=0)){var d,p=r._ellipsoid,m={ellipsoid:p,positions:h,width:s,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!1};if(u){var y=Math.max(a,l);l=Math.min(a,l),a=y,m.height=a,m.extrudedHeight=l,d=v(m)}else{var C=o.computePositions(m);d=g(C,m.cornerType),d.attributes.position.values=f.scaleToGeodeticHeight(d.attributes.position.values,a,p)}var w=d.attributes,S=t.fromVertices(w.position.values,void 0,3);return new c({attributes:w,indices:d.indices,primitiveType:_.LINES,boundingSphere:S})}},y}),i("Core/createGuid",[],function(){"use strict";function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,i="x"===e?t:3&t|8;return i.toString(16)})}return e}),i("Core/CylinderGeometryLibrary",["./Math"],function(e){"use strict";var t={};return t.computePositions=function(t,i,r,n,o){var a,s=.5*t,l=-s,u=n+n,c=o?2*u:u,h=new Float64Array(3*c),d=0,p=0,m=o?3*u:0,f=o?3*(u+n):3*n;for(a=0;a<n;a++){var _=a/n*e.TWO_PI,g=Math.cos(_),v=Math.sin(_),y=g*r,C=v*r,w=g*i,S=v*i;h[p+m]=y,h[p+m+1]=C,h[p+m+2]=l,h[p+f]=w,h[p+f+1]=S,h[p+f+2]=s,p+=3,o&&(h[d++]=y,h[d++]=C,h[d++]=l,h[d++]=w,h[d++]=S,h[d++]=s)}return h},t}),i("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=o(e.vertexFormat,m.DEFAULT),a=o(e.slices,128);this._length=t,this._topRadius=i,this._bottomRadius=r,this._vertexFormat=m.clone(n),this._slices=a,this._workerName="createCylinderGeometry"}var _=new t,g=new i,v=new i,y=new i,C=new i;f.packedLength=m.packedLength+4,f.pack=function(e,t,i){return i=o(i,0),m.pack(e._vertexFormat,t,i),i+=m.packedLength,t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i]=e._slices,t};var w=new m,S={vertexFormat:w,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return f.unpack=function(e,t,i){t=o(t,0);var r=m.unpack(e,t,w);t+=m.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(i)?(i._vertexFormat=m.clone(r,i._vertexFormat),i._length=n,i._topRadius=s,i._bottomRadius=l,i._slices=u,i):(S.length=n,S.topRadius=s,S.bottomRadius=l,S.slices=u,new f(S))},f.createGeometry=function(o){var a=o._length,s=o._topRadius,m=o._bottomRadius,f=o._vertexFormat,w=o._slices;if(!(a<=0||s<0||m<0||0===s&&0===m)){var S,E=w+w,b=w+E,T=E+E,x=n.computePositions(a,s,m,w,!0),A=f.st?new Float32Array(2*T):void 0,P=f.normal?new Float32Array(3*T):void 0,D=f.tangent?new Float32Array(3*T):void 0,M=f.binormal?new Float32Array(3*T):void 0,I=f.normal||f.tangent||f.binormal;if(I){var R=f.tangent||f.binormal,O=0,N=0,L=0,B=g;B.z=0;var F=y,V=v;for(S=0;S<w;S++){var k=S/w*d.TWO_PI,z=Math.cos(k),U=Math.sin(k);I&&(B.x=z,B.y=U,R&&(F=i.normalize(i.cross(i.UNIT_Z,B,F),F)),f.normal&&(P[O++]=z,P[O++]=U,P[O++]=0,P[O++]=z,P[O++]=U,P[O++]=0),f.tangent&&(D[N++]=F.x,D[N++]=F.y,D[N++]=F.z,D[N++]=F.x,D[N++]=F.y,D[N++]=F.z),f.binormal&&(V=i.normalize(i.cross(B,F,V),V),M[L++]=V.x,M[L++]=V.y,M[L++]=V.z,M[L++]=V.x,M[L++]=V.y,M[L++]=V.z))}for(S=0;S<w;S++)f.normal&&(P[O++]=0,P[O++]=0,P[O++]=-1),f.tangent&&(D[N++]=1,D[N++]=0,D[N++]=0),f.binormal&&(M[L++]=0,M[L++]=-1,M[L++]=0);for(S=0;S<w;S++)f.normal&&(P[O++]=0,P[O++]=0,P[O++]=1),f.tangent&&(D[N++]=1,D[N++]=0,D[N++]=0),f.binormal&&(M[L++]=0,M[L++]=1,M[L++]=0)}var G=12*w-12,W=h.createTypedArray(T,G),H=0,q=0;for(S=0;S<w-1;S++)W[H++]=q,W[H++]=q+2,W[H++]=q+3,W[H++]=q,W[H++]=q+3,W[H++]=q+1,q+=2;for(W[H++]=E-2,W[H++]=0,W[H++]=1,W[H++]=E-2,W[H++]=1,W[H++]=E-1,S=1;S<w-1;S++)W[H++]=E+S+1,W[H++]=E+S,W[H++]=E;for(S=1;S<w-1;S++)W[H++]=b,W[H++]=b+S,W[H++]=b+S+1;var j=0;if(f.st){var Y=Math.max(s,m);for(S=0;S<T;S++){var X=i.fromArray(x,3*S,C);A[j++]=(X.x+Y)/(2*Y),A[j++]=(X.y+Y)/(2*Y)}}var Z=new c;f.position&&(Z.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:x})),f.normal&&(Z.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),f.tangent&&(Z.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:D})),f.binormal&&(Z.binormal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),f.st&&(Z.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:A})),_.x=.5*a,_.y=Math.max(m,s);var K=new e(i.ZERO,t.magnitude(_));return new l({attributes:Z,indices:W,primitiveType:p.TRIANGLES,boundingSphere:K})}},f}),i("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,i=e.topRadius,r=e.bottomRadius,n=o(e.slices,128),a=Math.max(o(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=i,this._bottomRadius=r,this._slices=n,this._numberOfVerticalLines=a,this._workerName="createCylinderOutlineGeometry"}var m=new t;p.packedLength=5,p.pack=function(e,t,i){return i=o(i,0),t[i++]=e._length,t[i++]=e._topRadius,t[i++]=e._bottomRadius,t[i++]=e._slices,t[i]=e._numberOfVerticalLines,t};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return p.unpack=function(e,t,i){t=o(t,0);var r=e[t++],n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(i)?(i._length=r,i._topRadius=n,i._bottomRadius=s,i._slices=l,i._numberOfVerticalLines=u,i):(f.length=r,f.topRadius=n,f.bottomRadius=s,f.slices=l,f.numberOfVerticalLines=u,new p(f))},p.createGeometry=function(o){var a=o._length,s=o._topRadius,p=o._bottomRadius,f=o._slices,_=o._numberOfVerticalLines;if(!(a<=0||s<0||p<0||0===s&&0===p)){var g,v=2*f,y=n.computePositions(a,s,p,f,!1),C=2*f;if(_>0){var w=Math.min(_,f);g=Math.round(f/w),C+=w}for(var S=h.createTypedArray(v,2*C),E=0,b=0;b<f-1;b++)S[E++]=b,S[E++]=b+1,S[E++]=b+f,S[E++]=b+1+f;if(S[E++]=f-1,S[E++]=0,S[E++]=f+f-1,S[E++]=f,_>0)for(b=0;b<f;b+=g)S[E++]=b,S[E++]=b+f;var T=new c;T.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:y}),m.x=.5*a,m.y=Math.max(p,s);var x=new e(i.ZERO,t.magnitude(m));return new l({attributes:T,indices:S,primitiveType:d.LINES,boundingSphere:x})}},p}),i("Core/DefaultProxy",[],function(){"use strict";function e(e){this.proxy=e}return e.prototype.getURL=function(e){var t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)},e}),i("Core/DistanceDisplayCondition",["./defaultValue","./defined","./defineProperties"],function(e,t,i){"use strict";function r(t,i){t=e(t,0),this._near=t,i=e(i,Number.MAX_VALUE),this._far=i}return i(r.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}}),r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.far===i.far},r.clone=function(e,i){if(t(e))return t(i)||(i=new r),i.near=e.near,i.far=e.far,i},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/DistanceDisplayConditionGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,i){e=t(e,0),i=t(i,Number.MAX_VALUE),this.value=new Float32Array([e,i])}return r(o.prototype,{componentDatatype:{get:function(){return e.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}}),o.fromDistanceDisplayCondition=function(e){return new o(e.near,e.far)},o.toValue=function(e,t){return i(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])},o}),i("ThirdParty/Tween",[],function(){void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var e=e||function(){var e=[];return{REVISION:"13",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);i!==-1&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();i<e.length;)e[i].update(t)?i++:e.splice(i,1);return!0}}}();return e.Tween=function(t){var i=t,r={},n={},o={},a=1e3,s=0,l=!1,u=!1,c=!1,h=0,d=null,p=e.Easing.Linear.None,m=e.Interpolation.Linear,f=[],_=null,g=!1,v=null,y=null,C=null;for(var w in t)r[w]=parseFloat(t[w],10);this.to=function(e,t){return void 0!==t&&(a=t),n=e,this},this.start=function(t){e.add(this),u=!0,g=!1,d=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),d+=h;for(var a in n){if(n[a]instanceof Array){if(0===n[a].length)continue;n[a]=[i[a]].concat(n[a])}r[a]=i[a],r[a]instanceof Array==!1&&(r[a]*=1),o[a]=r[a]||0}return this},this.stop=function(){return u?(e.remove(this),u=!1,null!==C&&C.call(i),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=f.length;e<t;e++)f[e].stop()},this.delay=function(e){return h=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return l=e,this},this.easing=function(e){return p=e,this},this.interpolation=function(e){return m=e,this},this.chain=function(){return f=arguments,this},this.onStart=function(e){return _=e,this},this.onUpdate=function(e){return v=e,this},this.onComplete=function(e){return y=e,this},this.onStop=function(e){return C=e,this},this.update=function(e){var t;if(e<d)return!0;g===!1&&(null!==_&&_.call(i),g=!0);var u=(e-d)/a;u=u>1?1:u;var C=p(u);for(t in n){var w=r[t]||0,S=n[t];S instanceof Array?i[t]=m(S,C):("string"==typeof S&&(S=w+parseFloat(S,10)),"number"==typeof S&&(i[t]=w+(S-w)*C))}if(null!==v&&v.call(i,C),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var E=o[t];o[t]=n[t],n[t]=E}r[t]=o[t]}return l&&(c=!c),d=e+h,!0}null!==y&&y.call(i);for(var b=0,T=f.length;b<T;b++)f[b].start(e);return!1}return!0}},e.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)))},Out:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},InOut:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?-.5*(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)):i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(t){return t<.5?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return i<0?a(t[0],t[1],n):i>1?a(t[r],t[r-1],r-n):a(t[o],t[o+1>r?r:o+1],n-o)},Bezier:function(t,i){var r,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(r=0;r<=o;r++)n+=a(1-i,o-r)*a(i,r)*t[r]*s(o,r);return n},CatmullRom:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[r]?(i<0&&(o=Math.floor(n=r*(1+i))),a(t[(o-1+r)%r],t[o],t[(o+1)%r],t[(o+2)%r],n-o)):i<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):i>1?t[r]-(a(t[r],t[r],t[r-1],t[r-1],n-r)-t[r]):a(t[o?o-1:0],t[o],t[r<o+1?r:o+1],t[r<o+2?r:o+2],n-o)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(t,i){var r=e.Interpolation.Utils.Factorial;return r(t)/r(i)/r(t-i)},Factorial:function(){var e=[1];return function(t){var i,r=1;if(e[t])return e[t];for(i=t;i>1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,l=n*s;return(2*t-2*i+o+a)*l+(-3*t+3*i-2*o-a)*s+o*n+t}}},e}),i("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";var i={LINEAR_NONE:e.Easing.Linear.None,QUADRACTIC_IN:e.Easing.Quadratic.In,QUADRACTIC_OUT:e.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:e.Easing.Quadratic.InOut,CUBIC_IN:e.Easing.Cubic.In,CUBIC_OUT:e.Easing.Cubic.Out,CUBIC_IN_OUT:e.Easing.Cubic.InOut,QUARTIC_IN:e.Easing.Quartic.In,QUARTIC_OUT:e.Easing.Quartic.Out,QUARTIC_IN_OUT:e.Easing.Quartic.InOut,QUINTIC_IN:e.Easing.Quintic.In,QUINTIC_OUT:e.Easing.Quintic.Out,QUINTIC_IN_OUT:e.Easing.Quintic.InOut,SINUSOIDAL_IN:e.Easing.Sinusoidal.In,SINUSOIDAL_OUT:e.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:e.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:e.Easing.Exponential.In,EXPONENTIAL_OUT:e.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:e.Easing.Exponential.InOut,CIRCULAR_IN:e.Easing.Circular.In,CIRCULAR_OUT:e.Easing.Circular.Out,CIRCULAR_IN_OUT:e.Easing.Circular.InOut,ELASTIC_IN:e.Easing.Elastic.In,ELASTIC_OUT:e.Easing.Elastic.Out,ELASTIC_IN_OUT:e.Easing.Elastic.InOut,BACK_IN:e.Easing.Back.In,BACK_OUT:e.Easing.Back.Out,BACK_IN_OUT:e.Easing.Back.InOut,BOUNCE_IN:e.Easing.Bounce.In,BOUNCE_OUT:e.Easing.Bounce.Out,BOUNCE_IN_OUT:e.Easing.Bounce.InOut};return t(i)}),i("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,w),r=n(e.stackPartitions,64),o=n(e.slicePartitions,64),a=n(e.vertexFormat,m.DEFAULT);this._radii=i.clone(t),this._stackPartitions=r,this._slicePartitions=o,this._vertexFormat=m.clone(a),this._workerName="createEllipsoidGeometry"}var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i(1,1,1),S=Math.cos,E=Math.sin;f.packedLength=i.packedLength+m.packedLength+2,f.pack=function(e,t,r){return r=n(r,0),i.pack(e._radii,t,r),r+=i.packedLength,m.pack(e._vertexFormat,t,r),r+=m.packedLength,t[r++]=e._stackPartitions,t[r]=e._slicePartitions,t};var b=new i,T=new m,x={radii:b,vertexFormat:T,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,b);t+=i.packedLength;var s=m.unpack(e,t,T);t+=m.packedLength;var l=e[t++],u=e[t];return o(r)?(r._radii=i.clone(a,r._radii),r._vertexFormat=m.clone(s,r._vertexFormat),r._stackPartitions=l,r._slicePartitions=u,r):(x.stackPartitions=l,x.slicePartitions=u,new f(x))},f.createGeometry=function(n){var o=n._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a,m,f=s.fromCartesian3(o),w=n._vertexFormat,b=n._slicePartitions+1,T=n._stackPartitions+1,x=T*b,A=new Float64Array(3*x),P=6*(b-1)*(T-2),D=h.createTypedArray(x,P),M=w.normal?new Float32Array(3*x):void 0,I=w.tangent?new Float32Array(3*x):void 0,R=w.binormal?new Float32Array(3*x):void 0,O=w.st?new Float32Array(2*x):void 0,N=new Array(b),L=new Array(b),B=0;for(a=0;a<b;a++){var F=d.TWO_PI*a/(b-1);N[a]=S(F),L[a]=E(F),A[B++]=0,A[B++]=0,A[B++]=o.z}for(a=1;a<T-1;a++){var V=Math.PI*a/(T-1),k=E(V),z=o.x*k,U=o.y*k,G=o.z*S(V);for(m=0;m<b;m++)A[B++]=N[m]*z,A[B++]=L[m]*U,A[B++]=G}for(a=0;a<b;a++)A[B++]=0,A[B++]=0,A[B++]=-o.z;var W=new c;w.position&&(W.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:A}));var H=0,q=0,j=0,Y=0;if(w.st||w.normal||w.tangent||w.binormal){for(a=0;a<x;a++){var X=i.fromArray(A,3*a,_),Z=f.geodeticSurfaceNormal(X,g);if(w.st){var K=t.negate(Z,C);t.magnitude(K)<d.EPSILON6&&(B=3*(a+b*Math.floor(.5*T)),B>A.length&&(B=3*(a-b*Math.floor(.5*T))),i.fromArray(A,B,K),f.geodeticSurfaceNormal(K,K),t.negate(K,K)),O[H++]=Math.atan2(K.y,K.x)/d.TWO_PI+.5,O[H++]=Math.asin(Z.z)/Math.PI+.5}if(w.normal&&(M[q++]=Z.x,M[q++]=Z.y,M[q++]=Z.z),w.tangent||w.binormal){var Q=v;if(a<b||a>x-b-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),w.tangent&&(I[j++]=Q.x,I[j++]=Q.y,I[j++]=Q.z),w.binormal){var J=i.cross(Z,Q,y);i.normalize(J,J),R[Y++]=J.x,R[Y++]=J.y,R[Y++]=J.z}}}w.st&&(W.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:O})),w.normal&&(W.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:M})),w.tangent&&(W.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),w.binormal&&(W.binormal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R}))}for(B=0,m=0;m<b-1;m++)D[B++]=b+m,D[B++]=b+m+1,D[B++]=m+1;var $,ee;for(a=1;a<T-2;a++)for($=a*b,ee=(a+1)*b,m=0;m<b-1;m++)D[B++]=ee+m,D[B++]=ee+m+1,D[B++]=$+m+1,D[B++]=ee+m,D[B++]=$+m+1,D[B++]=$+m;for(a=T-2,$=a*b,ee=(a+1)*b,m=0;m<b-1;m++)D[B++]=ee+m,D[B++]=$+m+1,D[B++]=$+m;return new l({attributes:W,indices:D,primitiveType:p.TRIANGLES,boundingSphere:e.fromEllipsoid(f)})}},f}),i("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){e=r(e,r.EMPTY_OBJECT);var i=r(e.radii,m),n=r(e.stackPartitions,10),o=r(e.slicePartitions,8),a=r(e.subdivisions,128);this._radii=t.clone(i),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"}var m=new t(1,1,1),f=Math.cos,_=Math.sin;p.packedLength=t.packedLength+3,p.pack=function(e,i,n){return n=r(n,0),t.pack(e._radii,i,n),n+=t.packedLength,i[n++]=e._stackPartitions,i[n++]=e._slicePartitions,i[n]=e._subdivisions,i};var g=new t,v={radii:g,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,g);i+=t.packedLength;var s=e[i++],l=e[i++],u=e[i++];return n(o)?(o._radii=t.clone(a,o._radii),o._stackPartitions=s,o._slicePartitions=l,o._subdivisions=u,o):(v.stackPartitions=s,v.slicePartitions=l,v.subdivisions=u,new p(v))},p.createGeometry=function(t){var r=t._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var n,o,p,m,g,v,y=a.fromCartesian3(r),C=t._stackPartitions,w=t._slicePartitions,S=t._subdivisions,E=S*(C+w-1),b=E-w+2,T=new Float64Array(3*b),x=c.createTypedArray(b,2*E),A=0,P=new Array(S),D=new Array(S);for(n=0;n<S;n++)p=h.TWO_PI*n/S,P[n]=f(p),D[n]=_(p);for(n=1;n<C;n++)for(m=Math.PI*n/C,g=f(m),v=_(m),o=0;o<S;o++)T[A++]=r.x*P[o]*v,T[A++]=r.y*D[o]*v,T[A++]=r.z*g;for(P.length=w,D.length=w,n=0;n<w;n++)p=h.TWO_PI*n/w,P[n]=f(p),D[n]=_(p);for(T[A++]=0,T[A++]=0,T[A++]=r.z,n=1;n<S;n++)for(m=Math.PI*n/S,g=f(m),v=_(m),o=0;o<w;o++)T[A++]=r.x*P[o]*v,T[A++]=r.y*D[o]*v,T[A++]=r.z*g;for(T[A++]=0,T[A++]=0,T[A++]=-r.z,A=0,n=0;n<C-1;++n){var M=n*S;for(o=0;o<S-1;++o)x[A++]=M+o,x[A++]=M+o+1;x[A++]=M+S-1,x[A++]=M}var I=S*(C-1);for(o=1;o<w+1;++o)x[A++]=I,x[A++]=I+o;for(n=0;n<S-2;++n){var R=n*w+1+I,O=(n+1)*w+1+I;for(o=0;o<w-1;++o)x[A++]=O+o,x[A++]=R+o;x[A++]=O+w-1,x[A++]=R+w-1}var N=T.length/3-1;for(o=N-1;o>N-w-1;--o)x[A++]=N,x[A++]=o;var L=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:T})});return new s({attributes:L,indices:x,primitiveType:d.LINES,boundingSphere:e.fromEllipsoid(y)})}},p}),i("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,{}),this._tilingScheme=r.tilingScheme,i(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(r.ellipsoid,n.WGS84)})),this._levelZeroMaximumGeometricError=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o,this._readyPromise=e.resolve(!0)}return r(u.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),u.prototype.requestTileGeometry=function(e,t,i,r){var n=16,o=16;return new s({buffer:new Uint8Array(n*o),width:n,height:o})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},u.prototype.getTileDataAvailable=function(e,t,i){},u}),i("Core/EventHelper",["./defined","./DeveloperError"],function(e,t){"use strict";function i(){this._removalFunctions=[]}return i.prototype.add=function(e,t,i){var r=e.addEventListener(t,i);this._removalFunctions.push(r);var n=this;return function(){r();var e=n._removalFunctions;e.splice(e.indexOf(r),1)}},i.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,i=e.length;t<i;++t)e[t]();e.length=0},i}),i("Core/ExtrapolationType",["./freezeObject"],function(e){"use strict";var t={NONE:0,HOLD:1,EXTRAPOLATE:2};return e(t)}),i("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.value=t.value}return r}),i("Core/getBaseUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i,r){var n="",o=i.lastIndexOf("/");return o!==-1&&(n=i.substring(0,o+1)),r?(i=new e(i),t(i.query)&&(n+="?"+i.query),t(i.fragment)&&(n+="#"+i.fragment),n):n}return r}),i("Core/getExtensionFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){var i=new e(t);i.normalize();var r=i.path,n=r.lastIndexOf("/");return n!==-1&&(r=r.substr(n+1)),n=r.lastIndexOf("."),r=n===-1?"":r.substr(n+1)}return r}),i("Core/getFilenameFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){var i=new e(t);i.normalize();var r=i.path,n=r.lastIndexOf("/");return n!==-1&&(r=r.substr(n+1)),r}return r}),i("Core/getStringFromTypedArray",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,n){return i=e(i,0),n=e(n,t.byteLength-i),t=t.subarray(i,i+n),r.decode(t)}return r.decodeWithTextDecoder=function(e){var t=new TextDecoder("utf-8");return t.decode(e)},r.decodeWithFromCharCode=function(e){for(var t="",i=e.length,r=0;r<i;++r)t+=String.fromCharCode(e[r]);return t},"undefined"!=typeof TextDecoder?r.decode=r.decodeWithTextDecoder:r.decode=r.decodeWithFromCharCode,r}),i("Core/getMagic",["./defaultValue","./getStringFromTypedArray"],function(e,t){"use strict";function i(i,r){return r=e(r,0),t(i,r,Math.min(4,i.length))}return i}),i("Core/HeadingPitchRange",["./defaultValue","./defined"],function(e,t){"use strict";function i(t,i,r){this.heading=e(t,0),this.pitch=e(i,0),this.range=e(r,0)}return i.clone=function(e,r){if(t(e))return t(r)||(r=new i),r.heading=e.heading,r.pitch=e.pitch,r.range=e.range,r},i}),i("Core/HermitePolynomialApproximation",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(e,t,i,r,o,a){var s,l,u,c=0;if(r>0){for(l=0;l<o;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(a.push(l),c+=n(e,t,i,r-1,o,a),a.splice(a.length-1,1))}return c}for(c=1,l=0;l<o;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(c*=e-i[t[l]])}return c}function o(e,t,i,n,o,a){for(var s,l,u=-1,c=t.length,h=c*(c+1)/2,d=0;d<o;d++){var p=Math.floor(d*h);for(s=0;s<c;s++)l=t[s]*o*(a+1)+d,e[p+s]=n[l];for(var m=1;m<c;m++){var f=0,_=Math.floor(m*(1-m)/2)+c*m,g=!1;for(s=0;s<c-m;s++){var v,y,C=i[t[s]],w=i[t[s+m]];if(w-C<=0)l=t[s]*o*(a+1)+o*m+d,v=n[l],y=v/r.factorial(m),e[p+_+f]=y,f++;else{var S=Math.floor((m-1)*(2-m)/2)+c*(m-1);v=e[p+S+s+1]-e[p+S+s],y=v/(w-C),e[p+_+f]=y,f++}g=g||0!==v}g&&(u=Math.max(u,m))}}return u}var a=r.factorial,s={type:"Hermite"};s.getRequiredDataPoints=function(t,i){return i=e(i,0),Math.max(Math.floor((t+1)/(i+1)),2)},s.interpolateOrderZero=function(e,i,r,o,s){t(s)||(s=new Array(o));var l,u,c,h,d,p,m=i.length,f=new Array(o);for(l=0;l<o;l++){s[l]=0;var _=new Array(m);for(f[l]=_,u=0;u<m;u++)_[u]=[]}var g=m,v=new Array(g);for(l=0;l<g;l++)v[l]=l;var y=m-1;for(h=0;h<o;h++){for(u=0;u<g;u++)p=v[u]*o+h,f[h][0].push(r[p]);for(l=1;l<g;l++){var C=!1;for(u=0;u<g-l;u++){var w,S=i[v[u]],E=i[v[u+l]];E-S<=0?(p=v[u]*o+o*l+h,w=r[p],f[h][l].push(w/a(l))):(w=f[h][l-1][u+1]-f[h][l-1][u],f[h][l].push(w/(E-S))),C=C||0!==w}C||(y=l-1)}}for(c=0,d=0;c<=d;c++)for(l=c;l<=y;l++){var b=n(e,v,i,c,l,[]);for(h=0;h<o;h++){var T=f[h][l][0];s[h+c*o]+=T*b}}return s};var l=[];return s.interpolate=function(e,i,r,a,s,u,c){var h=a*(u+1);t(c)||(c=new Array(h));for(var d=0;d<h;d++)c[d]=0;for(var p=i.length,m=new Array(p*(s+1)),f=0;f<p;f++)for(var _=0;_<s+1;_++)m[f*(s+1)+_]=f;for(var g=m.length,v=l,y=o(v,m,i,r,a,s),C=[],w=g*(g+1)/2,S=Math.min(y,u),E=0;E<=S;E++)for(f=E;f<=y;f++){C.length=0;for(var b=n(e,m,i,E,f,C),T=Math.floor(f*(1-f)/2)+g*f,x=0;x<a;x++){var A=Math.floor(x*w),P=v[A+T];c[x+E*a]+=P*b}}return c},s}),i("Core/IauOrientationParameters",[],function(){"use strict";function e(e,t,i,r){this.rightAscension=e,this.declination=t,this.rotation=i,this.rotationRate=r}return e}),i("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,i,r,n){"use strict";var o={},a=32.184,s=2451545,l=-.0529921,u=-.1059842,c=13.0120009,h=13.3407154,d=.9856003,p=26.4057084,m=13.064993,f=.3287146,_=1.7484877,g=-.1589763,v=.0036096,y=.1643573,C=12.9590088,w=new i;return o.ComputeMoon=function(o,S){e(o)||(o=i.now()),w=i.addSeconds(o,a,w);var E=i.totalDays(w)-s,b=E/n.DAYS_PER_JULIAN_CENTURY,T=(125.045+l*E)*r.RADIANS_PER_DEGREE,x=(250.089+u*E)*r.RADIANS_PER_DEGREE,A=(260.008+c*E)*r.RADIANS_PER_DEGREE,P=(176.625+h*E)*r.RADIANS_PER_DEGREE,D=(357.529+d*E)*r.RADIANS_PER_DEGREE,M=(311.589+p*E)*r.RADIANS_PER_DEGREE,I=(134.963+m*E)*r.RADIANS_PER_DEGREE,R=(276.617+f*E)*r.RADIANS_PER_DEGREE,O=(34.226+_*E)*r.RADIANS_PER_DEGREE,N=(15.134+g*E)*r.RADIANS_PER_DEGREE,L=(119.743+v*E)*r.RADIANS_PER_DEGREE,B=(239.961+y*E)*r.RADIANS_PER_DEGREE,F=(25.053+C*E)*r.RADIANS_PER_DEGREE,V=Math.sin(T),k=Math.sin(x),z=Math.sin(A),U=Math.sin(P),G=Math.sin(D),W=Math.sin(M),H=Math.sin(I),q=Math.sin(R),j=Math.sin(O),Y=Math.sin(N),X=Math.sin(L),Z=Math.sin(B),K=Math.sin(F),Q=Math.cos(T),J=Math.cos(x),$=Math.cos(A),ee=Math.cos(P),te=Math.cos(D),ie=Math.cos(M),re=Math.cos(I),ne=Math.cos(R),oe=Math.cos(O),ae=Math.cos(N),se=Math.cos(L),le=Math.cos(B),ue=Math.cos(F),ce=(269.9949+.0031*b-3.8787*V-.1204*k+.07*z-.0172*U+.0072*W-.0052*Y+.0043*K)*r.RADIANS_PER_DEGREE,he=(66.5392+.013*b+1.5419*Q+.0239*J-.0278*$+.0068*ee-.0029*ie+9e-4*re+8e-4*ae-9e-4*ue)*r.RADIANS_PER_DEGREE,de=(38.3213+13.17635815*E-1.4e-12*E*E+3.561*V+.1208*k-.0642*z+.0158*U+.0252*G-.0066*W-.0047*H-.0046*q+.0028*j+.0052*Y+.004*X+.0019*Z-.0044*K)*r.RADIANS_PER_DEGREE,pe=(13.17635815-1.4e-12*(2*E)+3.561*Q*l+.1208*J*u-.0642*$*c+.0158*ee*h+.0252*te*d-.0066*ie*p-.0047*re*m-.0046*ne*f+.0028*oe*_+.0052*ae*g+.004*se*v+.0019*le*y-.0044*ue*C)/86400*r.RADIANS_PER_DEGREE;
return e(S)||(S=new t),S.rightAscension=ce,S.declination=he,S.rotation=de,S.rotationRate=pe,S},o}),i("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,i,r,n,o,a){"use strict";function s(e){t(e)&&"function"==typeof e||(e=i.ComputeMoon),this._computeFunction=e}function l(i,r,a){var s=u;s.x=Math.cos(i+n.PI_OVER_TWO),s.y=Math.sin(i+n.PI_OVER_TWO),s.z=0;var l=Math.cos(r),d=h;d.x=l*Math.cos(i),d.y=l*Math.sin(i),d.z=Math.sin(r);var p=e.cross(d,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=p.x,a[2]=d.x,a[3]=s.y,a[4]=p.y,a[5]=d.y,a[6]=s.z,a[7]=p.z,a[8]=d.z,a}var u=new e,c=new e,h=new e,d=new o,p=new a;return s.prototype.evaluate=function(i,s){t(i)||(i=r.now());var u=this._computeFunction(i),c=l(u.rightAscension,u.declination,s),h=n.zeroToTwoPi(u.rotation),m=a.fromAxisAngle(e.UNIT_Z,h,p),f=o.fromQuaternion(a.conjugate(m,m),d),_=o.multiply(f,c,c);return _},s}),i("Core/InterpolationAlgorithm",["./DeveloperError"],function(e){"use strict";var t={};return t.type=void 0,t.getRequiredDataPoints=e.throwInstantiationError,t.interpolateOrderZero=e.throwInstantiationError,t.interpolate=e.throwInstantiationError,t}),i("Core/TimeInterval",["./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./JulianDate"],function(e,t,i,r,n,o){"use strict";function a(i){i=e(i,e.EMPTY_OBJECT),this.start=t(i.start)?o.clone(i.start):new o,this.stop=t(i.stop)?o.clone(i.stop):new o,this.data=i.data,this.isStartIncluded=e(i.isStartIncluded,!0),this.isStopIncluded=e(i.isStopIncluded,!0)}i(a.prototype,{isEmpty:{get:function(){var e=o.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var s={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};return a.fromIso8601=function(i,r){var n=i.iso8601.split("/"),l=o.fromIso8601(n[0]),u=o.fromIso8601(n[1]),c=e(i.isStartIncluded,!0),h=e(i.isStopIncluded,!0),d=i.data;return t(r)?(r.start=l,r.stop=u,r.isStartIncluded=c,r.isStopIncluded=h,r.data=d,r):(s.start=l,s.stop=u,s.isStartIncluded=c,s.isStopIncluded=h,s.data=d,new a(s))},a.toIso8601=function(e,t){return o.toIso8601(e.start,t)+"/"+o.toIso8601(e.stop,t)},a.clone=function(e,i){if(t(e))return t(i)?(i.start=e.start,i.stop=e.stop,i.isStartIncluded=e.isStartIncluded,i.isStopIncluded=e.isStopIncluded,i.data=e.data,i):new a(e)},a.equals=function(e,i,r){return e===i||t(e)&&t(i)&&(e.isEmpty&&i.isEmpty||e.isStartIncluded===i.isStartIncluded&&e.isStopIncluded===i.isStopIncluded&&o.equals(e.start,i.start)&&o.equals(e.stop,i.stop)&&(e.data===i.data||t(r)&&r(e.data,i.data)))},a.equalsEpsilon=function(e,i,r,n){return e===i||t(e)&&t(i)&&(e.isEmpty&&i.isEmpty||e.isStartIncluded===i.isStartIncluded&&e.isStopIncluded===i.isStopIncluded&&o.equalsEpsilon(e.start,i.start,r)&&o.equalsEpsilon(e.stop,i.stop,r)&&(e.data===i.data||t(n)&&n(e.data,i.data)))},a.intersect=function(e,i,r,n){if(!t(i))return a.clone(a.EMPTY,r);var s=e.start,l=e.stop,u=i.start,c=i.stop,h=o.greaterThanOrEquals(u,s)&&o.greaterThanOrEquals(l,u),d=!h&&o.lessThanOrEquals(u,s)&&o.lessThanOrEquals(s,c);if(!h&&!d)return a.clone(a.EMPTY,r);var p=e.isStartIncluded,m=e.isStopIncluded,f=i.isStartIncluded,_=i.isStopIncluded,g=o.lessThan(l,c);return r.start=h?u:s,r.isStartIncluded=p&&f||!o.equals(u,s)&&(h&&f||d&&p),r.stop=g?l:c,r.isStopIncluded=g?m:m&&_||!o.equals(c,l)&&_,r.data=t(n)?n(e.data,i.data):e.data,r},a.contains=function(e,t){if(e.isEmpty)return!1;var i=o.compare(e.start,t);if(0===i)return e.isStartIncluded;var r=o.compare(t,e.stop);return 0===r?e.isStopIncluded:i<0&&r<0},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e,t){return a.equals(this,e,t)},a.prototype.equalsEpsilon=function(e,t,i){return a.equalsEpsilon(this,e,t,i)},a.prototype.toString=function(){return a.toIso8601(this)},a.EMPTY=n(new a({start:new o,stop:new o,isStartIncluded:!1,isStopIncluded:!1})),a}),i("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,i){"use strict";var r=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z")),o=e(new i({start:r,stop:n})),a={MINIMUM_VALUE:r,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:o};return a}),i("Core/KeyboardEventModifier",["./freezeObject"],function(e){"use strict";var t={SHIFT:0,CTRL:1,ALT:2};return e(t)}),i("Core/LagrangePolynomialApproximation",["./defined"],function(e){"use strict";var t={type:"Lagrange"};return t.getRequiredDataPoints=function(e){return Math.max(e+1,2)},t.interpolateOrderZero=function(t,i,r,n,o){e(o)||(o=new Array(n));var a,s,l=i.length;for(a=0;a<n;a++)o[a]=0;for(a=0;a<l;a++){var u=1;for(s=0;s<l;s++)if(s!==a){var c=i[a]-i[s];u*=(t-i[s])/c}for(s=0;s<n;s++)o[s]+=u*r[a*n+s]}return o},t}),i("Core/LinearApproximation",["./defined","./DeveloperError"],function(e,t){"use strict";var i={type:"Linear"};return i.getRequiredDataPoints=function(e){return 2},i.interpolateOrderZero=function(t,i,r,n,o){e(o)||(o=new Array(n));var a,s,l,u=i[0],c=i[1];for(a=0;a<n;a++)s=r[a],l=r[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},i}),i("Core/loadBlob",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"blob",headers:i})}return t}),i("Core/loadImageFromTypedArray",["../ThirdParty/when","./defined","./DeveloperError","./loadImage"],function(e,t,i,r){"use strict";function n(t,i){var n=new Blob([t],{type:i}),o=window.URL.createObjectURL(n);return r(o,!1).then(function(e){return window.URL.revokeObjectURL(o),e},function(t){return window.URL.revokeObjectURL(o),e.reject(t)})}return n}),i("Core/loadImageViaBlob",["../ThirdParty/when","./loadBlob","./loadImage"],function(e,t,i){"use strict";function r(r){return n.test(r)?i(r):t(r).then(function(t){var r=window.URL.createObjectURL(t);return i(r,!1).then(function(e){return e.blob=t,window.URL.revokeObjectURL(r),e},function(t){return window.URL.revokeObjectURL(r),e.reject(t)})})}var n=/^data:/,o=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();return o?r:i}),i("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(e){var t="";for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=encodeURIComponent(r)+"=";if(i(n))for(var a=0,s=n.length;a<s;++a)t+=o+encodeURIComponent(n[a])+"&";else t+=o+encodeURIComponent(n)+"&"}return t=t.slice(0,-1)}return r}),i("Core/queryToObject",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(t){var r={};if(""===t)return r;for(var n=t.replace(/\+/g,"%20").split("&"),o=0,a=n.length;o<a;++o){var s=n[o].split("="),l=decodeURIComponent(s[0]),u=s[1];u=e(u)?decodeURIComponent(u):"";var c=r[l];"string"==typeof c?r[l]=[c,u]:i(c)?c.push(u):r[l]=u}return r}return r}),i("Core/loadJsonp",["../ThirdParty/Uri","../ThirdParty/when","./combine","./defaultValue","./defined","./DeveloperError","./objectToQuery","./queryToObject"],function(e,t,i,r,n,o,a,s){"use strict";function l(o,u){u=r(u,r.EMPTY_OBJECT);var c;do c="loadJsonp"+Math.random().toString().substring(2,8);while(n(window[c]));var h=t.defer();window[c]=function(e){h.resolve(e);try{delete window[c]}catch(e){window[c]=void 0}};var d=new e(o),p=s(r(d.query,""));n(u.parameters)&&(p=i(u.parameters,p));var m=r(u.callbackParameterName,"callback");p[m]=c,d.query=a(p),o=d.toString();var f=u.proxy;return n(f)&&(o=f.getURL(o)),l.loadAndExecuteScript(o,c,h),h.promise}return l.loadAndExecuteScript=function(e,t,i){var r=document.createElement("script");r.async=!0,r.src=e;var n=document.getElementsByTagName("head")[0];r.onload=function(){r.onload=void 0,n.removeChild(r)},r.onerror=function(e){i.reject(e)},n.appendChild(r)},l.defaultLoadAndExecuteScript=l.loadAndExecuteScript,l}),i("Core/loadXML",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"document",headers:i,overrideMimeType:"text/xml"})}return t}),i("Core/MapboxApi",["./defined","./Credit"],function(e,t){"use strict";var i={};i.defaultAccessToken=void 0;var r,n=!1,o="This application is using Cesium's default Mapbox access token.  Please create a new access token for the application as soon as possible and prior to deployment by visiting https://www.mapbox.com/account/apps/, and provide your token to Cesium by setting the Cesium.MapboxApi.defaultAccessToken property before constructing the CesiumWidget or any other object that uses the Mapbox API.";return i.getAccessToken=function(t){return e(t)?t:e(i.defaultAccessToken)?i.defaultAccessToken:(n||(console.log(o),n=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6ImNpd204Zm4wejAwNzYyeW5uNjYyZmFwdWEifQ.7i-VIZZWX8pd1bTfxIVj9g")},i.getErrorCredit=function(n){if(!e(n)&&!e(i.defaultAccessToken))return e(r)||(r=new t(o)),r},i}),i("Core/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError}}),i.prototype.project=t.throwInstantiationError,i.prototype.unproject=t.throwInstantiationError,i}),i("Core/Matrix2",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject"],function(e,t,i,r,n,o){"use strict";function a(e,i,r,n){this[0]=t(e,0),this[1]=t(r,0),this[2]=t(i,0),this[3]=t(n,0)}a.packedLength=4,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e[0],i[r++]=e[1],i[r++]=e[2],i[r++]=e[3],i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n[0]=e[r++],n[1]=e[r++],n[2]=e[r++],n[3]=e[r++],n},a.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new a(e[0],e[2],e[1],e[3])},a.fromArray=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n[0]=e[r],n[1]=e[r+1],n[2]=e[r+2],n[3]=e[r+3],n},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new a(e[0],e[1],e[2],e[3])},a.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new a(e.x,0,0,e.y)},a.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new a(e,0,0,e)},a.fromRotation=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t):new a(r,-n,n,r)},a.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},a.getElementIndex=function(e,t){return 2*e+t},a.getColumn=function(e,t,i){var r=2*t,n=e[r],o=e[r+1];return i.x=n,i.y=o,i},a.setColumn=function(e,t,i,r){r=a.clone(e,r);var n=2*t;return r[n]=i.x,r[n+1]=i.y,r},a.getRow=function(e,t,i){var r=e[t],n=e[t+2];return i.x=r,i.y=n,i},a.setRow=function(e,t,i,r){return r=a.clone(e,r),r[t]=i.x,r[t+2]=i.y,r};var s=new e;a.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],s)),i.y=e.magnitude(e.fromElements(t[2],t[3],s)),i};var l=new e;return a.getMaximumScale=function(t){return a.getScale(t,l),e.maximumComponent(l)},a.multiply=function(e,t,i){var r=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return i[0]=r,i[1]=o,i[2]=n,i[3]=a,i},a.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},a.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},a.multiplyByVector=function(e,t,i){var r=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return i.x=r,i.y=n,i},a.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},a.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.y,i[3]=e[3]*t.y,i},a.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},a.transpose=function(e,t){var i=e[0],r=e[2],n=e[1],o=e[3];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t},a.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},a.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]},a.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(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},a.IDENTITY=o(new a(1,0,0,1)),a.ZERO=o(new a(0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN1ROW0=2,a.COLUMN1ROW1=3,r(a.prototype,{length:{get:function(){return a.packedLength}}}),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[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},a}),i("Core/mergeSort",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i,r,n,s){var l,u,c=n-r+1,h=s-n,d=o,p=a;for(l=0;l<c;++l)d[l]=e[r+l];for(u=0;u<h;++u)p[u]=e[n+u+1];l=0,u=0;for(var m=r;m<=s;++m){var f=d[l],_=p[u];l<c&&(u>=h||t(f,_,i)<=0)?(e[m]=f,++l):u<h&&(e[m]=_,++u)}}function r(e,t,n,o,a){if(!(o>=a)){var s=Math.floor(.5*(o+a));r(e,t,n,o,s),r(e,t,n,s+1,a),i(e,t,n,o,s,a)}}function n(e,t,i){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,r(e,t,i,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),i("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r,n){this.near=e(t,0),this.nearValue=e(i,0),this.far=e(r,1),this.farValue=e(n,0)}return r.clone=function(e,i){if(t(e))return t(i)?(i.near=e.near,i.nearValue=e.nearValue,i.far=e.far,i.farValue=e.farValue,i):new r(e.near,e.nearValue,e.far,e.farValue)},r.packedLength=4,r.pack=function(t,i,r){return r=e(r,0),i[r++]=t.near,i[r++]=t.nearValue,i[r++]=t.far,i[r]=t.farValue,i},r.unpack=function(i,n,o){return n=e(n,0),t(o)||(o=new r),o.near=i[n++],o.nearValue=i[n++],o.far=i[n++],o.farValue=i[n],o},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.nearValue===i.nearValue&&e.far===i.far&&e.farValue===i.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),i("Core/Visibility",["./freezeObject"],function(e){"use strict";var t={NONE:-1,PARTIAL:0,FULL:1};return e(t)}),i("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=i}var h=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=t.clone(e,this._cameraPosition);var i,r,n,o=t.subtract(this._occluderPosition,e,h),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){i=Math.sqrt(a-s),a=1/Math.sqrt(a),r=t.multiplyByScalar(o,a,h);var l=i*i*a;n=t.add(e,t.multiplyByScalar(r,l,h),h)}else i=Number.MAX_VALUE;this._horizonDistance=i,this._horizonPlaneNormal=r,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,i,n){return r(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=i,n):new c(e,i)};var d=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var i=t.subtract(e,this._occluderPosition,d),r=this._occluderRadius;if(r=t.magnitudeSquared(i)-r*r,r>0)return r=Math.sqrt(r)+this._horizonDistance,i=t.subtract(e,this._cameraPosition,i),r*r>t.magnitudeSquared(i)}return!1};var p=new t;c.prototype.isBoundingSphereVisible=function(e){var i=t.clone(e.center,p),r=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,d),o=this._occluderRadius-r;if(o=t.magnitudeSquared(n)-o*o,r<this._occluderRadius)return o>0&&(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n),o*o+r*r>t.magnitudeSquared(n));if(o>0){n=t.subtract(i,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=r*r;return(this._horizonDistance*this._horizonDistance+s)*l>a*s||(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var m=new t;c.prototype.computeVisibility=function(e){var i=t.clone(e.center),r=e.radius;if(r>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,m),o=this._occluderRadius-r,a=t.magnitudeSquared(n);if(o=a-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n);var s=t.magnitudeSquared(n);return o*o+r*r<s?u.NONE:(o=this._occluderRadius+r,o=a-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+r*r?u.FULL:u.PARTIAL):(n=t.subtract(i,this._horizonPlanePosition,n),t.dot(n,this._horizonPlaneNormal)>-r?u.PARTIAL:u.FULL))}}return u.NONE};var f=new t;c.computeOccludeePoint=function(e,i,r){var n=t.clone(i),o=t.clone(e.center),a=e.radius,s=r.length,l=t.normalize(t.subtract(n,o,f),f),u=-t.dot(l,o),h=c._anyRotationVector(o,l,u),d=c._horizonToPlaneNormalDotProduct(e,l,u,h,r[0]);if(d){for(var p,m=1;m<s;++m){if(p=c._horizonToPlaneNormalDotProduct(e,l,u,h,r[m]),!p)return;p<d&&(d=p)}if(!(d<.0017453283658983088)){var _=a/d;return t.add(o,t.multiplyByScalar(l,_,f),f)}}};var _=[];c.computeOccludeePointFromRectangle=function(r,n){n=i(n,a.WGS84);var o=l.subsample(r,n,0,_),s=e.fromPoints(o),u=t.ZERO;if(!t.equals(u,s.center))return c.computeOccludeePoint(new e(u,n.minimumRadius),s.center,o)};var g=new t;c._anyRotationVector=function(e,i,r){var n=t.abs(i,g),o=n.x>n.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(i,n)+r)/-t.dot(i,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var v=new t;c._rotationVector=function(e,i,r,n,o){var a=t.subtract(n,e,v);if(a=t.normalize(a,a),t.dot(i,a)<.9999999847691291){var l=t.cross(i,a,a),u=t.magnitude(l);if(u>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,C=new t,w=new t,S=new t;return c._horizonToPlaneNormalDotProduct=function(e,i,r,n,o){var a=t.clone(o,y),s=t.clone(e.center,C),l=e.radius,u=t.subtract(s,a,w),c=t.magnitudeSquared(u),h=l*l;if(c<h)return!1;var d=c-h,p=Math.sqrt(d),m=Math.sqrt(c),f=1/m,_=p*f,g=_*p;u=t.normalize(u,u);var v=t.add(a,t.multiplyByScalar(u,g,S),S),E=Math.sqrt(d-g*g),b=this._rotationVector(s,i,r,a,n),T=t.fromElements(b.x*b.x*u.x+(b.x*b.y-b.z)*u.y+(b.x*b.z+b.y)*u.z,(b.x*b.y+b.z)*u.x+b.y*b.y*u.y+(b.y*b.z-b.x)*u.z,(b.x*b.z-b.y)*u.x+(b.y*b.z+b.x)*u.y+b.z*b.z*u.z,y);T=t.normalize(T,T);var x=t.multiplyByScalar(T,E,y);b=t.normalize(t.subtract(t.add(v,x,w),s,w),w);var A=t.dot(i,b);b=t.normalize(t.subtract(t.subtract(v,x,b),s,b),b);var P=t.dot(i,b);return A<P?A:P},c}),i("Core/Packable",["./DeveloperError"],function(e){"use strict";var t={packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError};return t}),i("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";var t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError};return t}),i("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},t=function(t,i,r,n){var o=t.measureText(i),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=e(t.canvas,"font-style"),u=e(t.canvas,"font-weight"),c=!/\S/.test(i);o.fontsize=s;var h=document.createElement("div");h.style.position="absolute",h.style.opacity=0,h.style.font=l+" "+u+" "+s+"px "+a,h.innerHTML=i+"<br/>"+i,document.body.appendChild(h),o.leading=1.2*s;var d=e(h,"height");if(d=d.replace("px",""),d>=2*s&&(o.leading=d/2|0),document.body.removeChild(h),c)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var p=document.createElement("canvas"),m=100;p.width=o.width+m,p.height=3*s,p.style.opacity=1,p.style.fontFamily=a,p.style.fontSize=s,p.style.fontStyle=l,p.style.fontWeight=u;var f=p.getContext("2d");f.font=l+" "+u+" "+s+"px "+a;var _=p.width,g=p.height,v=g/2;f.fillStyle="white",f.fillRect(-1,-1,_+2,g+2),r&&(f.strokeStyle="black",f.lineWidth=t.lineWidth,f.strokeText(i,m/2,v)),n&&(f.fillStyle="black",f.fillText(i,m/2,v));for(var y=f.getImageData(0,0,_,g).data,C=0,w=4*_,S=y.length;++C<S&&255===y[C];);var E=C/w|0;for(C=S-1;--C>0&&255===y[C];);var b=C/w|0;for(C=0;C<S&&255===y[C];)C+=w,C>=S&&(C=C-S+4);var T=C%w/4|0,x=1;for(C=S-3;C>=0&&255===y[C];)C-=w,C<0&&(C=S-3-4*x++);var A=C%w/4+1|0;o.ascent=v-E,o.descent=b-v,o.bounds={minx:T-m/2,maxx:A-m/2,miny:0,maxy:b-E},o.height=1+(b-E)}return o};return t}),i("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o){if(""!==n){o=i(o,i.EMPTY_OBJECT);var s=i(o.font,"10px sans-serif"),l=i(o.stroke,!1),u=i(o.fill,!0),c=i(o.strokeWidth,1),h=i(o.backgroundColor,t.TRANSPARENT),d=i(o.padding,0),p=2*d,m=document.createElement("canvas");m.width=1,m.height=1,m.style.font=s;var f=m.getContext("2d");r(a)||(r(f.imageSmoothingEnabled)?a="imageSmoothingEnabled":r(f.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":r(f.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":r(f.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),f.font=s,f.lineJoin="round",f.lineWidth=c,f[a]=!1,f.textBaseline=i(o.textBaseline,"bottom"),m.style.visibility="hidden",document.body.appendChild(m);var _=e(f,n,l,u);m.dimensions=_,document.body.removeChild(m),m.style.visibility="";var g=-_.bounds.minx,v=Math.ceil(_.width)+g+p,y=_.height+p,C=y-_.ascent+p,w=y-C+p;if(m.width=v,m.height=y,f.font=s,f.lineJoin="round",f.lineWidth=c,f[a]=!1,h!==t.TRANSPARENT&&(f.fillStyle=h.toCssColorString(),f.fillRect(0,0,m.width,m.height)),l){var S=i(o.strokeColor,t.BLACK);f.strokeStyle=S.toCssColorString(),f.strokeText(n,g+d,w)}if(u){var E=i(o.fillColor,t.WHITE);f.fillStyle=E.toCssColorString(),f.fillText(n,g+d,w)}return m}}var a;return o}),i("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,i,r,n,o){"use strict";function a(){this._cache={}}function s(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,c).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function l(e,i,r){var n=r/2.5,o=n,a=n;i.width>i.height?a=n*(i.height/i.width):i.width<i.height&&(o=n*(i.width/i.height));var s=(r-o)/2,l=7/24*r-a/2;e.globalCompositeOperation="destination-out",e.drawImage(i,s-1,l,o,a),e.drawImage(i,s,l-1,o,a),e.drawImage(i,s+1,l,o,a),e.drawImage(i,s,l+1,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.BLACK.toCssColorString(),e.fillRect(s-1,l-1,o+1,a+1),e.globalCompositeOperation="destination-out",e.drawImage(i,s,l,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.WHITE.toCssColorString(),e.fillRect(s,l,o,a)}function u(e,t,r,a,u){h[0]=e,h[1]=t,h[2]=r,h[3]=a;var c=JSON.stringify(h),d=u[c];if(i(d))return d;var p=document.createElement("canvas");p.width=a,p.height=a;var m=p.getContext("2d");if(s(m,r,a),i(e)){var f=n(e).then(function(e){return l(m,e,a),u[c]=p,p});return u[c]=f,f}if(i(t)){var _=o(t,{font:"bold "+a+"px sans-serif"});l(m,_,a)}return u[c]=p,p}a.prototype.fromColor=function(e,t){return u(void 0,void 0,e,t,this._cache)},a.prototype.fromUrl=function(e,t,i){return u(e,void 0,t,i,this._cache)},a.prototype.fromMakiIconId=function(t,i,r){return u(e("Assets/Textures/maki/"+encodeURIComponent(t)+".png"),void 0,i,r,this._cache)},a.prototype.fromText=function(e,t,i){return u(void 0,e,t,i,this._cache)};var c=new t,h=new Array(4);return a}),i("Core/PixelFormat",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={DEPTH_COMPONENT:t.DEPTH_COMPONENT,DEPTH_STENCIL:t.DEPTH_STENCIL,ALPHA:t.ALPHA,RGB:t.RGB,RGBA:t.RGBA,LUMINANCE:t.LUMINANCE,LUMINANCE_ALPHA:t.LUMINANCE_ALPHA,validate:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL||e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA},isColorFormat:function(e){return e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL}};return e(i)}),i("Core/PointGeometry",["./BoundingSphere","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){t=i(t,i.EMPTY_OBJECT),this._positionsTypedArray=t.positionsTypedArray,this._colorsTypedArray=t.colorsTypedArray,this._boundingSphere=e.clone(t.boundingSphere),this._workerName="createPointGeometry"}return u.createGeometry=function(i){var n=i._positionsTypedArray,u=n.byteLength/n.length,c=4===u?t.FLOAT:t.DOUBLE,h=new s;h.position=new a({componentDatatype:c,componentsPerAttribute:3,values:n}),h.color=new a({componentDatatype:t.UNSIGNED_BYTE,componentsPerAttribute:3,values:i._colorsTypedArray,normalize:!0});var d=i._boundingSphere;return r(d)||(d=e.fromVertices(n)),new o({attributes:h,primitiveType:l.POINTS,boundingSphere:d})},u}),i("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function i(t,i,n,o){return e(t,i,n,o,r),r.x>0&&r.y>0&&r.z>0}var r=new t;return i}),i("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=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--,i}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),i("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e,i,r,n){return t.subtract(i,e,v),t.multiplyByScalar(v,r/n,v),t.add(e,v,v),[v.x,v.y,v.z]}var g={};g.computeHierarchyPackedLength=function(e){for(var i=0,r=[e];r.length>0;){var o=r.pop();if(n(o)){i+=2;var a=o.positions,s=o.holes;if(n(a)&&(i+=a.length*t.packedLength),n(s))for(var l=s.length,u=0;u<l;++u)r.push(s[u])}}return i},g.packPolygonHierarchy=function(e,i,r){for(var o=[e];o.length>0;){var a=o.pop();if(n(a)){var s=a.positions,l=a.holes;if(i[r++]=n(s)?s.length:0,i[r++]=n(l)?l.length:0,n(s))for(var u=s.length,c=0;c<u;++c,r+=3)t.pack(s[c],i,r);if(n(l))for(var h=l.length,d=0;d<h;++d)o.push(l[d])}}return r},g.unpackPolygonHierarchy=function(e,i){for(var r=e[i++],n=e[i++],o=new Array(r),a=n>0?new Array(n):void 0,s=0;s<r;++s,i+=t.packedLength)o[s]=t.unpack(e,i);for(var l=0;l<n;++l)a[l]=g.unpackPolygonHierarchy(e,i),i=a[l].startingIndex,delete a[l].startingIndex;return{positions:o,holes:a,startingIndex:i}};var v=new t;g.subdivideLineCount=function(e,i,r){var n=t.distance(e,i),o=n/r,a=Math.max(0,Math.ceil(Math.log(o)/Math.log(2)));return Math.pow(2,a)},g.subdivideLine=function(e,i,r,o){var a=g.subdivideLineCount(e,i,r),s=t.distance(e,i),l=s/a;n(o)||(o=[]);var u=o;u.length=3*a;for(var c=0,h=0;h<a;h++){var d=_(e,i,h*l,s);u[c++]=d[0],u[c++]=d[1],u[c++]=d[2]}return u};var y=new t,C=new t,w=new t,S=new t;g.scaleToGeodeticHeightExtruded=function(e,i,a,s,l){s=r(s,o.WGS84);var u=y,c=C,h=w,d=S;if(n(e)&&n(e.attributes)&&n(e.attributes.position))for(var p=e.attributes.position.values,m=p.length/2,f=0;f<m;f+=3)t.fromArray(p,f,h),s.geodeticSurfaceNormal(h,u),d=s.scaleToGeodeticSurface(h,d),c=t.multiplyByScalar(u,a,c),c=t.add(d,c,c),p[f+m]=c.x,p[f+1+m]=c.y,p[f+2+m]=c.z,l&&(d=t.clone(h,d)),c=t.multiplyByScalar(u,i,c),c=t.add(d,c,c),p[f]=c.x,p[f+1]=c.y,p[f+2]=c.z;return e},g.polygonsFromHierarchy=function(i,r,o,a){var s=[],l=[],u=new m;for(u.enqueue(i);0!==u.length;){var c=u.dequeue(),h=c.positions,p=c.holes;if(h=e(h,t.equalsEpsilon,!0),!(h.length<3)){var _=o.projectPointsOntoPlane(h),g=[],v=d.computeWindingOrder2D(_);v===f.CLOCKWISE&&(_.reverse(),h=h.slice().reverse());var y,C,w=h.slice(),S=n(p)?p.length:0,E=[];for(y=0;y<S;y++){var b=p[y],T=e(b.positions,t.equalsEpsilon,!0);if(!(T.length<3)){var x=o.projectPointsOntoPlane(T);v=d.computeWindingOrder2D(x),v===f.CLOCKWISE&&(x.reverse(),T=T.slice().reverse()),E.push(T),g.push(w.length),w=w.concat(T),_=_.concat(x);var A=0;for(n(b.holes)&&(A=b.holes.length),C=0;C<A;C++)u.enqueue(b.holes[C])}}if(!r){for(y=0;y<h.length;y++)a.scaleToGeodeticSurface(h[y],h[y]);for(y=0;y<E.length;y++){var P=E[y];for(C=0;C<P.length;++C)a.scaleToGeodeticSurface(P[C],P[C])}}s.push({outerRing:h,holes:E}),l.push({positions:w,positions2D:_,holes:g})}}return{hierarchy:s,polygons:l}},g.createGeometryFromPositions=function(e,t,r,n,o){var l=d.triangulate(t.positions2D,t.holes);l.length<3&&(l=[0,1,2]);var c=t.positions;if(n){for(var h=c.length,m=new Array(3*h),f=0,_=0;_<h;_++){var g=c[_];m[f++]=g.x,m[f++]=g.y,m[f++]=g.z}var v=new a({attributes:{position:new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:m})},indices:l,primitiveType:p.TRIANGLES});return o.normal?u.computeNormal(v):v}return d.computeSubdivision(e,c,l,r)};var E=[],b=new t,T=new t;return g.computeWallGeometry=function(e,r,n,o){var u,d,m,f,_,v=e.length,y=0;if(o)for(d=3*v*2,u=new Array(2*d),m=0;m<v;m++)f=e[m],_=e[(m+1)%v],u[y]=u[y+d]=f.x,++y,u[y]=u[y+d]=f.y,++y,u[y]=u[y+d]=f.z,++y,u[y]=u[y+d]=_.x,++y,u[y]=u[y+d]=_.y,++y,u[y]=u[y+d]=_.z,++y;else{var C=h.chordLength(n,r.maximumRadius),w=0;for(m=0;m<v;m++)w+=g.subdivideLineCount(e[m],e[(m+1)%v],C);for(d=3*(w+v),u=new Array(2*d),m=0;m<v;m++){f=e[m],_=e[(m+1)%v];for(var S=g.subdivideLine(f,_,C,E),x=S.length,A=0;A<x;++A,++y)u[y]=S[A],u[y+d]=S[A];u[y]=_.x,u[y+d]=_.x,++y,u[y]=_.y,u[y+d]=_.y,++y,u[y]=_.z,u[y+d]=_.z,++y}}v=u.length;var P=c.createTypedArray(v/3,v-6*e.length),D=0;for(v/=6,m=0;m<v;m++){var M=m,I=M+1,R=M+v,O=R+1;f=t.fromArray(u,3*M,b),_=t.fromArray(u,3*I,T),t.equalsEpsilon(f,_,h.EPSILON14)||(P[D++]=M,P[D++]=R,P[D++]=I,P[D++]=I,P[D++]=R,P[D++]=O)}return new a({attributes:new l({position:new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:u})}),indices:P,primitiveType:p.TRIANGLES})},g}),i("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./Rectangle","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(e,t,i,n){for(var o=w.fromAxisAngle(e._plane.normal,i,R),a=v.fromQuaternion(o,O),l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=t.length,p=0;p<d;++p){
var m=r.clone(t[p],I);v.multiplyByVector(a,m,m);var f=e.projectPointOntoPlane(m,M);s(f)&&(l=Math.min(l,f.x),u=Math.max(u,f.x),c=Math.min(c,f.y),h=Math.max(h,f.y))}return n.x=l,n.y=c,n.width=u-l,n.height=h-c,n}function x(e,t,i,r){var n=r.cartesianToCartographic(e,N),o=n.height,a=r.cartesianToCartographic(t,L);a.height=o,r.cartographicToCartesian(a,t);var s=r.cartesianToCartographic(i,L);s.height=o-100,r.cartographicToCartesian(s,i)}function A(e){var t=e.vertexFormat,n=e.geometry;if(t.st||t.normal||t.tangent||t.binormal){var a=e.boundingRectangle,s=e.tangentPlane,l=e.ellipsoid,u=e.stRotation,c=e.wall,h=e.top||c,d=e.bottom||c,m=e.perPositionHeight,f=j;f.x=a.x,f.y=a.y;var _,y=n.attributes.position.values,C=y.length,S=t.st?new Float32Array(2*(C/3)):void 0;t.normal&&(_=m&&h&&!c?n.attributes.normal.values:new Float32Array(C));var E=t.tangent?new Float32Array(C):void 0,b=t.binormal?new Float32Array(C):void 0,T=0,A=0,P=V,D=k,M=z,I=!0,R=w.fromAxisAngle(s._plane.normal,u,Z),O=v.fromQuaternion(R,K),N=0,L=0;h&&d&&(N=C/2,L=C/3,C/=2);for(var B=0;B<C;B+=3){var Q=r.fromArray(y,B,X);if(t.st){var J=v.multiplyByVector(O,Q,F);J=l.scaleToGeodeticSurface(J,J);var $=s.projectPointOntoPlane(J,Y);i.subtract($,f,$);var ee=g.clamp($.x/a.width,0,1),te=g.clamp($.y/a.height,0,1);d&&(S[T+L]=ee,S[T+1+L]=te),h&&(S[T]=ee,S[T+1]=te),T+=2}if(t.normal||t.tangent||t.binormal){var ie=A+1,re=A+2;if(c){if(B+3<C){var ne=r.fromArray(y,B+3,U);if(I){var oe=r.fromArray(y,B+C,G);m&&x(Q,ne,oe,l),r.subtract(ne,Q,ne),r.subtract(oe,Q,oe),P=r.normalize(r.cross(oe,ne,P),P),I=!1}r.equalsEpsilon(ne,Q,g.EPSILON10)&&(I=!0)}(t.tangent||t.binormal)&&(M=l.geodeticSurfaceNormal(Q,M),t.tangent&&(D=r.normalize(r.cross(M,P,D),D)))}else P=l.geodeticSurfaceNormal(Q,P),(t.tangent||t.binormal)&&(m&&(W=r.fromArray(_,A,W),H=r.cross(r.UNIT_Z,W,H),H=r.normalize(v.multiplyByVector(O,H,H),H),t.binormal&&(q=r.normalize(r.cross(W,H,q),q))),D=r.cross(r.UNIT_Z,P,D),D=r.normalize(v.multiplyByVector(O,D,D),D),t.binormal&&(M=r.normalize(r.cross(P,D,M),M)));t.normal&&(e.wall?(_[A+N]=P.x,_[ie+N]=P.y,_[re+N]=P.z):d&&(_[A+N]=-P.x,_[ie+N]=-P.y,_[re+N]=-P.z),(h&&!m||c)&&(_[A]=P.x,_[ie]=P.y,_[re]=P.z)),t.tangent&&(e.wall?(E[A+N]=D.x,E[ie+N]=D.y,E[re+N]=D.z):d&&(E[A+N]=-D.x,E[ie+N]=-D.y,E[re+N]=-D.z),h&&(m?(E[A]=H.x,E[ie]=H.y,E[re]=H.z):(E[A]=D.x,E[ie]=D.y,E[re]=D.z))),t.binormal&&(d&&(b[A+N]=M.x,b[ie+N]=M.y,b[re+N]=M.z),h&&(m?(b[A]=q.x,b[ie]=q.y,b[re]=q.z):(b[A]=M.x,b[ie]=M.y,b[re]=M.z))),A+=3}}t.st&&(n.attributes.st=new p({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:S})),t.normal&&(n.attributes.normal=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:_})),t.tangent&&(n.attributes.tangent=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:E})),t.binormal&&(n.attributes.binormal=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:b}))}return n}function P(e,t,i,r,n,o,a,s){var l,u={walls:[]};if(o||a){var c,d,p=y.createGeometryFromPositions(e,t,i,n,s),f=p.attributes.position.values,g=p.indices;if(o&&a){var v=f.concat(f);c=v.length/3,d=_.createTypedArray(c,2*g.length),d.set(g);var w=g.length,S=c/2;for(l=0;l<w;l+=3){var E=d[l]+S,T=d[l+1]+S,x=d[l+2]+S;d[l+w]=x,d[l+1+w]=T,d[l+2+w]=E}if(p.attributes.position.values=v,n){var A=p.attributes.normal.values;p.attributes.normal.values=new Float32Array(v.length),p.attributes.normal.values.set(A)}p.indices=d}else if(a){for(c=f.length/3,d=_.createTypedArray(c,g.length),l=0;l<g.length;l+=3)d[l]=g[l+2],d[l+1]=g[l+1],d[l+2]=g[l];p.indices=d}u.topAndBottom=new m({geometry:p})}var P=r.outerRing,D=h.fromPoints(P,e),M=D.projectPointsOntoPlane(P,Q),I=C.computeWindingOrder2D(M);I===b.CLOCKWISE&&(P=P.slice().reverse());var R=y.computeWallGeometry(P,e,i,n);u.walls.push(new m({geometry:R}));var O=r.holes;for(l=0;l<O.length;l++){var N=O[l];D=h.fromPoints(N,e),M=D.projectPointsOntoPlane(N,Q),I=C.computeWindingOrder2D(M),I===b.COUNTER_CLOCKWISE&&(N=N.slice().reverse()),R=y.computeWallGeometry(N,e,i),u.walls.push(new m({geometry:R}))}return u}function D(e){var t=e.polygonHierarchy,i=a(e.vertexFormat,E.DEFAULT),r=a(e.ellipsoid,c.WGS84),n=a(e.granularity,g.RADIANS_PER_DEGREE),o=a(e.stRotation,0),l=a(e.height,0),u=a(e.perPositionHeight,!1),h=e.extrudedHeight,d=s(h);if(!u&&d)if(g.equalsEpsilon(l,h,g.EPSILON10))h=void 0,d=!1;else{var p=h;h=Math.min(p,l),l=Math.max(p,l)}this._vertexFormat=E.clone(i),this._ellipsoid=c.clone(r),this._granularity=n,this._stRotation=o,this._height=l,this._extrudedHeight=a(h,0),this._extrude=d,this._closeTop=a(e.closeTop,!0),this._closeBottom=a(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=u,this._workerName="createPolygonGeometry";var m=t.positions;!s(m)||m.length<3?this._rectangle=new S:this._rectangle=S.fromCartesianArray(m,r),this.packedLength=y.computeHierarchyPackedLength(t)+c.packedLength+E.packedLength+S.packedLength+9}var M=new i,I=new r,R=new w,O=new v,N=new n,L=new n,B=new e,F=new r,V=new r,k=new r,z=new r,U=new r,G=new r,W=new r,H=new r,q=new r,j=new i,Y=new i,X=new r,Z=new w,K=new v,Q=[];D.fromPositions=function(e){e=a(e,a.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom};return new D(t)},D.pack=function(e,t,i){return i=a(i,0),i=y.packPolygonHierarchy(e._polygonHierarchy,t,i),c.pack(e._ellipsoid,t,i),i+=c.packedLength,E.pack(e._vertexFormat,t,i),i+=E.packedLength,S.pack(e._rectangle,t,i),i+=S.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._stRotation,t[i++]=e._extrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e._closeTop?1:0,t[i++]=e._closeBottom?1:0,t[i]=e.packedLength,t};var J=c.clone(c.UNIT_SPHERE),$=new E,ee=new S,te={polygonHierarchy:{}};return D.unpack=function(e,t,i){t=a(t,0);var r=y.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var n=c.unpack(e,t,J);t+=c.packedLength;var o=E.unpack(e,t,$);t+=E.packedLength;var l=S.unpack(e,t,ee);t+=S.packedLength;var u=e[t++],h=e[t++],d=e[t++],p=e[t++],m=1===e[t++],f=1===e[t++],_=1===e[t++],g=1===e[t++],v=e[t];return s(i)||(i=new D(te)),i._polygonHierarchy=r,i._ellipsoid=c.clone(n,i._ellipsoid),i._vertexFormat=E.clone(o,i._vertexFormat),i._height=u,i._extrudedHeight=h,i._granularity=d,i._stRotation=p,i._extrude=m,i._perPositionHeight=f,i._closeTop=_,i._closeBottom=g,i._rectangle=S.clone(l),i.packedLength=v,i},D.createGeometry=function(e){var i=e._vertexFormat,r=e._ellipsoid,n=e._granularity,o=e._stRotation,a=e._height,s=e._extrudedHeight,l=e._extrude,u=e._polygonHierarchy,c=e._perPositionHeight,p=e._closeTop,g=e._closeBottom,v=u.positions;if(!(v.length<3)){var w=h.fromPoints(v,r),S=y.polygonsFromHierarchy(u,c,w,r),E=S.hierarchy,b=S.polygons;if(0!==E.length){v=E[0].outerRing;var x,D,M=T(w,v,o,B),I=[],R={perPositionHeight:c,vertexFormat:i,geometry:void 0,tangentPlane:w,boundingRectangle:M,ellipsoid:r,stRotation:o,bottom:!1,top:!0,wall:!1};if(l)for(R.top=p,R.bottom=g,D=0;D<b.length;D++){x=P(r,b[D],n,E[D],c,p,g,i);var O;p&&g?(O=x.topAndBottom,R.geometry=y.scaleToGeodeticHeightExtruded(O.geometry,a,s,r,c)):p?(O=x.topAndBottom,O.geometry.attributes.position.values=C.scaleToGeodeticHeight(O.geometry.attributes.position.values,a,r,!c),R.geometry=O.geometry):g&&(O=x.topAndBottom,O.geometry.attributes.position.values=C.scaleToGeodeticHeight(O.geometry.attributes.position.values,s,r,!0),R.geometry=O.geometry),(p||g)&&(R.wall=!1,O.geometry=A(R),I.push(O));var N=x.walls;R.wall=!0;for(var L=0;L<N.length;L++){var F=N[L];R.geometry=y.scaleToGeodeticHeightExtruded(F.geometry,a,s,r,c),F.geometry=A(R),I.push(F)}}else for(D=0;D<b.length;D++)x=new m({geometry:y.createGeometryFromPositions(r,b[D],n,c,i)}),x.geometry.attributes.position.values=C.scaleToGeodeticHeight(x.geometry.attributes.position.values,a,r,!c),R.geometry=x.geometry,x.geometry=A(R),I.push(x);x=f.combineInstances(I)[0],x.attributes.position.values=new Float64Array(x.attributes.position.values),x.indices=_.createTypedArray(x.attributes.position.values.length/3,x.indices);var V=x.attributes,k=t.fromVertices(V.position.values);return i.position||delete V.position,new d({attributes:V,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:k})}}},D.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new D({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:E.POSITION_ONLY})},l(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),i("Core/PolygonHierarchy",["./defined"],function(e){"use strict";function t(t,i){this.positions=e(t)?t:[],this.holes=e(i)?i:[]}return t}),i("Core/PolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";function w(e,t,i,n){var o=l.fromPoints(t,e),a=o.projectPointsOntoPlane(t,b),s=g.computeWindingOrder2D(a);s===C.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var p,f,y=t.length,w=0;if(n)for(p=new Float64Array(2*y*3),f=0;f<y;f++){var S=t[f],E=t[(f+1)%y];p[w++]=S.x,p[w++]=S.y,p[w++]=S.z,p[w++]=E.x,p[w++]=E.y,p[w++]=E.z}else{var x=0;for(f=0;f<y;f++)x+=_.subdivideLineCount(t[f],t[(f+1)%y],i);for(p=new Float64Array(3*x),f=0;f<y;f++)for(var A=_.subdivideLine(t[f],t[(f+1)%y],i,T),P=A.length,D=0;D<P;++D)p[w++]=A[D]}y=p.length/3;var M=2*y,I=m.createTypedArray(y,M);for(w=0,f=0;f<y-1;f++)I[w++]=f,I[w++]=f+1;return I[w++]=y-1,I[w++]=0,new d({geometry:new u({attributes:new h({position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})}),indices:I,primitiveType:v.LINES})})}function S(e,t,i,n){var o=l.fromPoints(t,e),a=o.projectPointsOntoPlane(t,b),s=g.computeWindingOrder2D(a);s===C.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var p,f,y=t.length,w=new Array(y),S=0;if(n)for(p=new Float64Array(2*y*3*2),f=0;f<y;++f){w[f]=S/3;var E=t[f],x=t[(f+1)%y];p[S++]=E.x,p[S++]=E.y,p[S++]=E.z,p[S++]=x.x,p[S++]=x.y,p[S++]=x.z}else{var A=0;for(f=0;f<y;f++)A+=_.subdivideLineCount(t[f],t[(f+1)%y],i);for(p=new Float64Array(3*A*2),f=0;f<y;++f){w[f]=S/3;for(var P=_.subdivideLine(t[f],t[(f+1)%y],i,T),D=P.length,M=0;M<D;++M)p[S++]=P[M]}}y=p.length/6;var I=w.length,R=2*(2*y+I),O=m.createTypedArray(y,R);for(S=0,f=0;f<y;++f)O[S++]=f,O[S++]=(f+1)%y,O[S++]=f+y,O[S++]=(f+1)%y+y;for(f=0;f<I;f++){var N=w[f];O[S++]=N,O[S++]=N+y}return new d({geometry:new u({attributes:new h({position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})}),indices:O,primitiveType:v.LINES})})}function E(e){var t=e.polygonHierarchy,i=n(e.ellipsoid,s.WGS84),r=n(e.granularity,f.RADIANS_PER_DEGREE),a=n(e.height,0),l=n(e.perPositionHeight,!1),u=e.extrudedHeight,c=o(u);if(c&&!l){var h=u;u=Math.min(h,a),a=Math.max(h,a)}this._ellipsoid=s.clone(i),this._granularity=r,this._height=a,this._extrudedHeight=n(u,0),this._extrude=c,this._polygonHierarchy=t,this._perPositionHeight=l,this._workerName="createPolygonOutlineGeometry",this.packedLength=_.computeHierarchyPackedLength(t)+s.packedLength+6}var b=[],T=[];E.pack=function(e,t,i){return i=n(i,0),i=_.packPolygonHierarchy(e._polygonHierarchy,t,i),s.pack(e._ellipsoid,t,i),i+=s.packedLength,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._granularity,t[i++]=e._extrude?1:0,t[i++]=e._perPositionHeight?1:0,t[i++]=e.packedLength,t};var x=s.clone(s.UNIT_SPHERE),A={polygonHierarchy:{}};return E.unpack=function(e,t,i){t=n(t,0);var r=_.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var a=s.unpack(e,t,x);t+=s.packedLength;var l=e[t++],u=e[t++],c=e[t++],h=1===e[t++],d=1===e[t++],p=e[t++];return o(i)||(i=new E(A)),i._polygonHierarchy=r,i._ellipsoid=s.clone(a,i._ellipsoid),i._height=l,i._extrudedHeight=u,i._granularity=c,i._extrude=h,i._perPositionHeight=d,i.packedLength=p,i},E.fromPositions=function(e){e=n(e,n.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new E(t)},E.createGeometry=function(r){var n=r._ellipsoid,a=r._granularity,s=r._height,l=r._extrudedHeight,c=r._extrude,h=r._polygonHierarchy,d=r._perPositionHeight,m=[],v=new y;v.enqueue(h);for(var C;0!==v.length;){var E=v.dequeue(),b=E.positions;if(b=e(b,i.equalsEpsilon,!0),!(b.length<3)){var T=E.holes?E.holes.length:0;for(C=0;C<T;C++){var x=E.holes[C];if(x.positions=e(x.positions,i.equalsEpsilon,!0),!(x.positions.length<3)){m.push(x.positions);var A=0;o(x.holes)&&(A=x.holes.length);for(var P=0;P<A;P++)v.enqueue(x.holes[P])}}m.push(b)}}if(0!==m.length){var D,M=[],I=f.chordLength(a,n.maximumRadius);if(c)for(C=0;C<m.length;C++)D=S(n,m[C],I,d),D.geometry=_.scaleToGeodeticHeightExtruded(D.geometry,s,l,n,d),M.push(D);else for(C=0;C<m.length;C++)D=w(n,m[C],I,d),D.geometry.attributes.position.values=g.scaleToGeodeticHeight(D.geometry.attributes.position.values,s,n,!d),M.push(D);D=p.combineInstances(M)[0];var R=t.fromVertices(D.attributes.position.values);return new u({attributes:D.attributes,indices:D.indices,primitiveType:D.primitiveType,boundingSphere:R})}},E}),i("Core/PolylineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(e,t,i,n,o){var a=C;a.length=o;var s,l=i.red,u=i.green,c=i.blue,h=i.alpha,d=n.red,p=n.green,m=n.blue,f=n.alpha;if(r.equals(i,n)){for(s=0;s<o;s++)a[s]=r.clone(i);return a}var _=(d-l)/o,g=(p-u)/o,v=(m-c)/o,y=(f-h)/o;for(s=0;s<o;s++)a[s]=new r(l+s*_,u+s*g,c+s*v,h+s*y);return a}function y(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,n=e.colors,s=o(e.width,1),u=o(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=s,this._colorsPerVertex=u,this._vertexFormat=g.clone(o(e.vertexFormat,g.DEFAULT)),this._followSurface=o(e.followSurface,!0),this._granularity=o(e.granularity,m.RADIANS_PER_DEGREE),this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._workerName="createPolylineGeometry";var c=1+t.length*i.packedLength;c+=a(n)?1+n.length*r.packedLength:1,this.packedLength=c+l.packedLength+g.packedLength+4}var C=[];y.pack=function(e,t,n){n=o(n,0);var s,u=e._positions,c=u.length;for(t[n++]=c,s=0;s<c;++s,n+=i.packedLength)i.pack(u[s],t,n);var h=e._colors;for(c=a(h)?h.length:0,t[n++]=c,s=0;s<c;++s,n+=r.packedLength)r.pack(h[s],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,g.pack(e._vertexFormat,t,n),n+=g.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._followSurface?1:0,t[n]=e._granularity,t};var w=l.clone(l.UNIT_SPHERE),S=new g,E={positions:void 0,colors:void 0,ellipsoid:w,vertexFormat:S,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};y.unpack=function(e,t,n){t=o(t,0);var s,u=e[t++],c=new Array(u);for(s=0;s<u;++s,t+=i.packedLength)c[s]=i.unpack(e,t);u=e[t++];var h=u>0?new Array(u):void 0;for(s=0;s<u;++s,t+=r.packedLength)h[s]=r.unpack(e,t);var d=l.unpack(e,t,w);t+=l.packedLength;var p=g.unpack(e,t,S);t+=g.packedLength;var m=e[t++],f=1===e[t++],_=1===e[t++],v=e[t];return a(n)?(n._positions=c,n._colors=h,n._ellipsoid=l.clone(d,n._ellipsoid),n._vertexFormat=g.clone(p,n._vertexFormat),n._width=m,n._colorsPerVertex=f,n._followSurface=_,n._granularity=v,n):(E.positions=c,E.colors=h,E.width=m,E.colorsPerVertex=f,E.followSurface=_,E.granularity=v,new y(E))};var b=new i,T=new i,x=new i,A=new i;return y.createGeometry=function(o){var s,l,g,y=o._width,w=o._vertexFormat,S=o._colors,E=o._colorsPerVertex,P=o._followSurface,D=o._granularity,M=o._ellipsoid,I=e(o._positions,i.equalsEpsilon),R=I.length;if(!(R<2||y<=0)){if(P){var O=f.extractHeights(I,M),N=m.chordLength(D,M.maximumRadius);if(a(S)){var L=1;for(s=0;s<R-1;++s)L+=f.numberOfPoints(I[s],I[s+1],N);var B=new Array(L),F=0;for(s=0;s<R-1;++s){var V=I[s],k=I[s+1],z=S[s],U=f.numberOfPoints(V,k,N);if(E&&s<L){var G=S[s+1],W=v(V,k,z,G,U),H=W.length;for(l=0;l<H;++l)B[F++]=W[l]}else for(l=0;l<U;++l)B[F++]=r.clone(z)}B[F]=r.clone(S[S.length-1]),S=B,C.length=0}I=f.generateCartesianArc({positions:I,minDistance:N,ellipsoid:M,height:O})}R=I.length;var q,j=4*R-4,Y=new Float64Array(3*j),X=new Float64Array(3*j),Z=new Float64Array(3*j),K=new Float32Array(2*j),Q=w.st?new Float32Array(2*j):void 0,J=a(S)?new Uint8Array(4*j):void 0,$=0,ee=0,te=0,ie=0;for(l=0;l<R;++l){0===l?(q=b,i.subtract(I[0],I[1],q),i.add(I[0],q,q)):q=I[l-1],i.clone(q,x),i.clone(I[l],T),l===R-1?(q=b,i.subtract(I[R-1],I[R-2],q),i.add(I[R-1],q,q)):q=I[l+1],i.clone(q,A);var re,ne;a(J)&&(re=0===l||E?S[l]:S[l-1],l!==R-1&&(ne=S[l]));var oe=0===l?2:0,ae=l===R-1?2:4;for(g=oe;g<ae;++g){i.pack(T,Y,$),i.pack(x,X,$),i.pack(A,Z,$),$+=3;var se=g-2<0?-1:1;if(K[ee++]=2*(g%2)-1,K[ee++]=se*y,w.st&&(Q[te++]=l/(R-1),Q[te++]=Math.max(K[ee-2],0)),a(J)){var le=g<2?re:ne;J[ie++]=r.floatToByte(le.red),J[ie++]=r.floatToByte(le.green),J[ie++]=r.floatToByte(le.blue),J[ie++]=r.floatToByte(le.alpha)}}}var ue=new h;ue.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Y}),ue.prevPosition=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:X}),ue.nextPosition=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Z}),ue.expandAndWidth=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:K}),w.st&&(ue.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:Q})),a(J)&&(ue.color=new c({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:J,normalize:!0}));var ce=p.createTypedArray(j,6*R-6),he=0,de=0,pe=R-1;for(l=0;l<pe;++l)ce[de++]=he,ce[de++]=he+2,ce[de++]=he+1,ce[de++]=he+1,ce[de++]=he+2,ce[de++]=he+3,he+=4;return new u({attributes:ue,indices:ce,primitiveType:_.TRIANGLES,boundingSphere:t.fromPoints(I),geometryType:d.POLYLINES})}},y}),i("Core/PolylineVolumeGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./oneTimeWarning","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S){"use strict";function E(e,t,r,n){var a=new p;n.position&&(a.position=new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e}));var s,l,u,c,_,y,w=t.length,S=e.length/3,E=(S-2*w)/(2*w),b=v.triangulate(t),T=(E-1)*w*6+2*b.length,x=f.createTypedArray(S,T),A=2*w,P=0;for(s=0;s<E-1;s++){for(l=0;l<w-1;l++)u=2*l+s*w*2,y=u+A,c=u+1,_=c+A,x[P++]=c,x[P++]=u,x[P++]=_,x[P++]=_,x[P++]=u,x[P++]=y;u=2*w-2+s*w*2,c=u+1,_=c+A,y=u+A,x[P++]=c,x[P++]=u,x[P++]=_,x[P++]=_,x[P++]=u,x[P++]=y}if(n.st||n.tangent||n.binormal){var D,M,I=new Float32Array(2*S),R=1/(E-1),O=1/r.height,N=r.height/2,L=0;for(s=0;s<E;s++){for(D=s*R,M=O*(t[0].y+N),I[L++]=D,I[L++]=M,l=1;l<w;l++)M=O*(t[l].y+N),I[L++]=D,I[L++]=M,I[L++]=D,I[L++]=M;M=O*(t[0].y+N),I[L++]=D,I[L++]=M}for(l=0;l<w;l++)D=0,M=O*(t[l].y+N),I[L++]=D,I[L++]=M;for(l=0;l<w;l++)D=(E-1)*R,M=O*(t[l].y+N),I[L++]=D,I[L++]=M;a.st=new d({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:new Float32Array(I)})}var B=S-2*w;for(s=0;s<b.length;s+=3){var F=b[s]+B,V=b[s+1]+B,k=b[s+2]+B;x[P++]=F,x[P++]=V,x[P++]=k,x[P++]=k+w,x[P++]=V+w,x[P++]=F+w}var z=new h({attributes:a,indices:x,boundingSphere:i.fromVertices(e),primitiveType:C.TRIANGLES});if(n.normal&&(z=m.computeNormal(z)),n.tangent||n.binormal){try{z=m.computeBinormalAndTangent(z)}catch(e){g("polyline-volume-tangent-binormal","Unable to compute tangents and binormals for polyline volume geometry")}n.tangent||(z.attributes.tangent=void 0),n.binormal||(z.attributes.binormal=void 0),n.st||(z.attributes.st=void 0)}return z}function b(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,i=e.shapePositions;this._positions=t,this._shape=i,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._vertexFormat=w.clone(s(e.vertexFormat,w.DEFAULT)),this._granularity=s(e.granularity,_.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var o=1+t.length*n.packedLength;o+=1+i.length*r.packedLength,this.packedLength=o+c.packedLength+w.packedLength+2}b.pack=function(e,t,i){i=s(i,0);var o,a=e._positions,l=a.length;for(t[i++]=l,o=0;o<l;++o,i+=n.packedLength)n.pack(a[o],t,i);var u=e._shape;for(l=u.length,t[i++]=l,o=0;o<l;++o,i+=r.packedLength)r.pack(u[o],t,i);return c.pack(e._ellipsoid,t,i),i+=c.packedLength,w.pack(e._vertexFormat,t,i),i+=w.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var T=c.clone(c.UNIT_SPHERE),x=new w,A={polylinePositions:void 0,shapePositions:void 0,ellipsoid:T,vertexFormat:x,cornerType:void 0,granularity:void 0};b.unpack=function(e,t,i){t=s(t,0);var o,a=e[t++],u=new Array(a);for(o=0;o<a;++o,t+=n.packedLength)u[o]=n.unpack(e,t);a=e[t++];var h=new Array(a);for(o=0;o<a;++o,t+=r.packedLength)h[o]=r.unpack(e,t);var d=c.unpack(e,t,T);t+=c.packedLength;var p=w.unpack(e,t,x);t+=w.packedLength;var m=e[t++],f=e[t];return l(i)?(i._positions=u,i._shape=h,i._ellipsoid=c.clone(d,i._ellipsoid),i._vertexFormat=w.clone(p,i._vertexFormat),i._cornerType=m,i._granularity=f,i):(A.polylinePositions=u,A.shapePositions=h,A.cornerType=m,A.granularity=f,new b(A))};var P=new t;return b.createGeometry=function(i){var r=i._positions,o=e(r,n.equalsEpsilon),a=i._shape;if(a=y.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){v.computeWindingOrder2D(a)===S.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,P),l=y.computePositions(o,a,s,i,!0);return E(l,a,s,i._vertexFormat)}},b}),i("Core/PolylineVolumeOutlineGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y){"use strict";function C(e,t){var r=new p;r.position=new d({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e});var n,a,s=t.length,l=r.position.values.length/3,u=e.length/3,c=u/s,f=m.createTypedArray(l,2*s*(c+1)),_=0;n=0;var g=n*s;for(a=0;a<s-1;a++)f[_++]=a+g,f[_++]=a+g+1;for(f[_++]=s-1+g,f[_++]=g,n=c-1,g=n*s,a=0;a<s-1;a++)f[_++]=a+g,f[_++]=a+g+1;for(f[_++]=s-1+g,f[_++]=g,n=0;n<c-1;n++){var y=s*n,C=y+s;for(a=0;a<s;a++)f[_++]=a+y,f[_++]=a+C}var w=new h({attributes:r,indices:m.createTypedArray(l,f),boundingSphere:i.fromVertices(e),primitiveType:v.LINES});return w}function w(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,i=e.shapePositions;this._positions=t,this._shape=i,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._granularity=s(e.granularity,f.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var o=1+t.length*n.packedLength;o+=1+i.length*r.packedLength,this.packedLength=o+c.packedLength+2}w.pack=function(e,t,i){i=s(i,0);var o,a=e._positions,l=a.length;for(t[i++]=l,o=0;o<l;++o,i+=n.packedLength)n.pack(a[o],t,i);var u=e._shape;for(l=u.length,t[i++]=l,o=0;o<l;++o,i+=r.packedLength)r.pack(u[o],t,i);return c.pack(e._ellipsoid,t,i),i+=c.packedLength,t[i++]=e._cornerType,t[i]=e._granularity,t};var S=c.clone(c.UNIT_SPHERE),E={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};w.unpack=function(e,t,i){t=s(t,0);var o,a=e[t++],u=new Array(a);for(o=0;o<a;++o,t+=n.packedLength)u[o]=n.unpack(e,t);a=e[t++];var h=new Array(a);for(o=0;o<a;++o,t+=r.packedLength)h[o]=r.unpack(e,t);var d=c.unpack(e,t,S);t+=c.packedLength;var p=e[t++],m=e[t];return l(i)?(i._positions=u,i._shape=h,i._ellipsoid=c.clone(d,i._ellipsoid),i._cornerType=p,i._granularity=m,i):(E.polylinePositions=u,E.shapePositions=h,E.cornerType=p,E.granularity=m,new w(E))};var b=new t;return w.createGeometry=function(i){var r=i._positions,o=e(r,n.equalsEpsilon),a=i._shape;if(a=g.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){_.computeWindingOrder2D(a)===y.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,b),l=g.computePositions(o,a,s,i,!1);return C(l,a)}},w}),i("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){var o=e.length,a=new Array(o);a[0]=t(i)?i:e[0],a[o-1]=t(r)?r:e[o-1];for(var s=1;s<o-1;++s)a[s]=n.computeInnerQuadrangle(e[s-1],e[s],e[s+1],new n);return a}function s(e){var i=e.points,r=e.innerQuadrangles,o=e.times;if(i.length<3){var a=o[0],s=1/(o[1]-a),l=i[0],u=i[1];return function(e,i){t(i)||(i=new n);var r=(e-a)*s;return n.fastSlerp(l,u,r,i)}}return function(a,s){t(s)||(s=new n);var l=e._lastTimeIndex=e.findTimeInterval(a,e._lastTimeIndex),u=(a-o[l])/(o[l+1]-o[l]),c=i[l],h=i[l+1],d=r[l],p=r[l+1];return n.fastSquad(c,h,d,p,u,s)}}function l(t){t=e(t,e.EMPTY_OBJECT);var i=t.points,r=t.times,n=t.firstInnerQuadrangle,o=t.lastInnerQuadrangle,l=a(i,n,o);this._times=r,this._points=i,this._innerQuadrangles=l,this._evaluateFunction=s(this),this._lastTimeIndex=0}return i(l.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},innerQuadrangles:{get:function(){return this._innerQuadrangles}}}),l.prototype.findTimeInterval=o.prototype.findTimeInterval,l.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},l});i("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r,n,o,s,l){var u=Math.cos(i),c=n*u,h=r*u,d=Math.sin(i),f=n*d,v=r*d;m=g.project(t,m),m=e.subtract(m,_,m);var y=a.fromRotation(i,p);m=a.multiplyByVector(y,m,m),m=e.add(m,_,m),t=g.unproject(m,t),s-=1,l-=1;var C=t.latitude,w=C+s*v,S=C-c*l,E=C-c*l+s*v,b=Math.max(C,w,S,E),T=Math.min(C,w,S,E),x=t.longitude,A=x+s*h,P=x+l*f,D=x+l*f+s*h,M=Math.max(x,A,P,D),I=Math.min(x,A,P,D);return{north:b,south:T,east:M,west:I,granYCos:c,granYSin:f,granXCos:h,granXSin:v,nwCorner:t}}var u=Math.cos,c=Math.sin,h=Math.sqrt,d={};d.computePosition=function(e,t,r,n,o){var a=e.ellipsoid.radiiSquared,s=e.nwCorner,l=e.rectangle,d=s.latitude-e.granYCos*t+r*e.granXSin,p=u(d),m=c(d),f=a.z*m,_=s.longitude+t*e.granYSin+r*e.granXCos,g=p*u(_),v=p*c(_),y=a.x*g,C=a.y*v,w=h(y*g+C*v+f*m);if(n.x=y/w,n.y=C/w,n.z=f/w,i(e.vertexFormat)&&e.vertexFormat.st){var S=e.stNwCorner;i(S)?(d=S.latitude-e.stGranYCos*t+r*e.stGranXSin,_=S.longitude+t*e.stGranYSin+r*e.stGranXCos,o.x=(_-e.stWest)*e.lonScalar,o.y=(d-e.stSouth)*e.latScalar):(o.x=(_-l.west)*e.lonScalar,o.y=(d-l.south)*e.latScalar)}};var p=new a,m=new e,f=new t,_=new e,g=new n;return d.computeOptions=function(e,t,i,r){var n,a,u,c,h,d=e._granularity,p=e._ellipsoid,m=e._surfaceHeight,v=e._rotation,y=e._stRotation,C=e._extrudedHeight,w=t.east,S=t.west,E=t.north,b=t.south,T=E-b;S>w?(h=o.TWO_PI-S+w,n=Math.ceil(h/d)+1,a=Math.ceil(T/d)+1,u=h/(n-1),c=T/(a-1)):(h=w-S,n=Math.ceil(h/d)+1,a=Math.ceil(T/d)+1,u=h/(n-1),c=T/(a-1)),i=s.northwest(t,i);var x=s.center(t,f);0===v&&0===y||(x.longitude<i.longitude&&(x.longitude+=o.TWO_PI),_=g.project(x,_));var A=c,P=u,D=0,M=0,I={granYCos:A,granYSin:D,granXCos:P,granXSin:M,ellipsoid:p,surfaceHeight:m,extrudedHeight:C,nwCorner:i,rectangle:t,width:n,height:a};if(0!==v){var R=l(i,v,u,c,x,n,a);E=R.north,b=R.south,w=R.east,S=R.west,I.granYCos=R.granYCos,I.granYSin=R.granYSin,I.granXCos=R.granXCos,I.granXSin=R.granXSin,t.north=E,t.south=b,t.east=w,t.west=S}if(0!==y){v-=y,r=s.northwest(t,r);var O=l(r,v,u,c,x,n,a);I.stGranYCos=O.granYCos,I.stGranXCos=O.granXCos,I.stGranYSin=O.granYSin,I.stGranXSin=O.granXSin,I.stNwCorner=r,I.stWest=O.west,I.stSouth=O.south}return I},d});i("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix2","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(e,t){var i=new c({attributes:new d,primitiveType:C.TRIANGLES});return i.attributes.position=new h({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(i.attributes.normal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(i.attributes.tangent=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.binormal&&(i.attributes.binormal=new h({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.binormals})),i}function x(e,t,r,n){for(var o=e.length,a=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,l=t.binormal?new Float32Array(o):void 0,u=0,c=F,h=B,d=L,p=0;p<o;p+=3){var m=i.fromArray(e,p,N),f=u+1,_=u+2;(t.normal||t.tangent||t.binormal)&&(d=r.geodeticSurfaceNormal(m,d),(t.tangent||t.binormal)&&(i.cross(i.UNIT_Z,d,h),v.multiplyByVector(n,h,h),i.normalize(h,h),t.binormal&&i.normalize(i.cross(d,h,c),c)),t.normal&&(a[u]=d.x,a[f]=d.y,a[_]=d.z),t.tangent&&(s[u]=h.x,s[f]=h.y,s[_]=h.z),t.binormal&&(l[u]=c.x,l[f]=c.y,l[_]=c.z)),u+=3}return T(t,{positions:e,normals:a,tangents:s,binormals:l})}function A(e,t,r){for(var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.binormal?new Float32Array(n):void 0,l=0,u=0,c=0,h=!0,d=F,p=B,m=L,f=0;f<n;f+=6){var g=i.fromArray(e,f,N);if(t.normal||t.tangent||t.binormal){var v=i.fromArray(e,(f+6)%n,G);if(h){var y=i.fromArray(e,(f+3)%n,W);i.subtract(v,g,v),i.subtract(y,g,y),m=i.normalize(i.cross(y,v,m),m),h=!1}i.equalsEpsilon(v,g,_.EPSILON10)&&(h=!0),(t.tangent||t.binormal)&&(d=r.geodeticSurfaceNormal(g,d),t.tangent&&(p=i.normalize(i.cross(d,m,p),p))),t.normal&&(o[l++]=m.x,o[l++]=m.y,o[l++]=m.z,o[l++]=m.x,o[l++]=m.y,o[l++]=m.z),t.tangent&&(a[u++]=p.x,a[u++]=p.y,a[u++]=p.z,a[u++]=p.x,a[u++]=p.y,a[u++]=p.z),t.binormal&&(s[c++]=d.x,s[c++]=d.y,s[c++]=d.z,s[c++]=d.x,s[c++]=d.y,s[c++]=d.z)}}return T(t,{positions:e,normals:o,tangents:a,binormals:s})}function P(e){for(var t=e.vertexFormat,i=e.ellipsoid,r=e.size,o=e.height,a=e.width,s=t.position?new Float64Array(3*r):void 0,l=t.st?new Float32Array(2*r):void 0,u=0,c=0,d=N,p=k,m=Number.MAX_VALUE,_=Number.MAX_VALUE,g=-Number.MAX_VALUE,v=-Number.MAX_VALUE,y=0;y<o;++y)for(var C=0;C<a;++C)E.computePosition(e,y,C,d,p),s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,t.st&&(l[c++]=p.x,l[c++]=p.y,m=Math.min(m,p.x),_=Math.min(_,p.y),g=Math.max(g,p.x),v=Math.max(v,p.y));if(t.st&&(m<0||_<0||g>1||v>1))for(var w=0;w<l.length;w+=2)l[w]=(l[w]-m)/(g-m),l[w+1]=(l[w+1]-_)/(v-_);for(var S=x(s,t,i,e.tangentRotationMatrix),b=6*(a-1)*(o-1),T=f.createTypedArray(r,b),A=0,P=0,D=0;D<o-1;++D){for(var M=0;M<a-1;++M){var I=A,R=I+a,O=R+1,L=I+1;T[P++]=I,T[P++]=R,T[P++]=L,T[P++]=L,T[P++]=R,T[P++]=O,++A}++A}return S.indices=T,t.st&&(S.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:l})),S}function D(e,t,i,r,n){return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i+2],e[t++]=n[i],e[t++]=n[i+1],e[t++]=n[i+2],e}function M(e,t,i,r){
return e[t++]=r[i],e[t++]=r[i+1],e[t++]=r[i],e[t++]=r[i+1],e}function I(e){var t,r=e.vertexFormat,o=e.surfaceHeight,a=e.extrudedHeight,s=Math.min(a,o),l=Math.max(a,o),u=e.height,c=e.width,d=e.ellipsoid,g=P(e);if(_.equalsEpsilon(s,l,_.EPSILON10))return g;var v=y.scaleToGeodeticHeight(g.attributes.position.values,l,d,!1);v=new Float64Array(v);var C=v.length,w=2*C,S=new Float64Array(w);S.set(v);var E=y.scaleToGeodeticHeight(g.attributes.position.values,s,d);S.set(E,C),g.attributes.position.values=S;var b,T=r.normal?new Float32Array(w):void 0,x=r.tangent?new Float32Array(w):void 0,I=r.binormal?new Float32Array(w):void 0,R=r.st?new Float32Array(w/3*2):void 0;if(r.normal){var O=g.attributes.normal.values;for(T.set(O),t=0;t<C;t++)O[t]=-O[t];T.set(O,C),g.attributes.normal.values=T}if(r.tangent){var N=g.attributes.tangent.values;for(x.set(N),t=0;t<C;t++)N[t]=-N[t];x.set(N,C),g.attributes.tangent.values=x}if(r.binormal){var L=g.attributes.binormal.values;I.set(L),I.set(L,C),g.attributes.binormal.values=I}r.st&&(b=g.attributes.st.values,R.set(b),R.set(b,C/3*2),g.attributes.st.values=R);var B=g.indices,F=B.length,V=C/3,k=f.createTypedArray(w/3,2*F);for(k.set(B),t=0;t<F;t+=3)k[t+F]=B[t+2]+V,k[t+1+F]=B[t+1]+V,k[t+2+F]=B[t]+V;g.indices=k;var z=2*c+2*u-4,U=2*(z+4),H=new Float64Array(3*U),q=r.st?new Float32Array(2*U):void 0,j=0,Y=0,X=c*u;for(t=0;t<X;t+=c)H=D(H,j,3*t,v,E),j+=6,r.st&&(q=M(q,Y,2*t,b),Y+=4);for(t=X-c;t<X;t++)H=D(H,j,3*t,v,E),j+=6,r.st&&(q=M(q,Y,2*t,b),Y+=4);for(t=X-1;t>0;t-=c)H=D(H,j,3*t,v,E),j+=6,r.st&&(q=M(q,Y,2*t,b),Y+=4);for(t=c-1;t>=0;t--)H=D(H,j,3*t,v,E),j+=6,r.st&&(q=M(q,Y,2*t,b),Y+=4);var Z=A(H,r,d);r.st&&(Z.attributes.st=new h({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:q}));var K,Q,J,$,ee=f.createTypedArray(U,6*z);C=H.length/3;var te=0;for(t=0;t<C-1;t+=2){K=t,$=(K+2)%C;var ie=i.fromArray(H,3*K,G),re=i.fromArray(H,3*$,W);i.equalsEpsilon(ie,re,_.EPSILON10)||(Q=(K+1)%C,J=(Q+2)%C,ee[te++]=K,ee[te++]=Q,ee[te++]=$,ee[te++]=$,ee[te++]=Q,ee[te++]=J)}return Z.indices=ee,Z=m.combineInstances([new p({geometry:g}),new p({geometry:Z})]),Z[0]}function R(e,t,i){if(0===i)return S.clone(e);S.northeast(e,X[0]),S.northwest(e,X[1]),S.southeast(e,X[2]),S.southwest(e,X[3]),t.cartographicArrayToCartesianArray(X,Y);var r=t.geodeticSurfaceNormalCartographic(S.center(e,q));w.fromAxisAngle(r,i,j),v.fromQuaternion(j,H);for(var n=0;n<4;++n)v.multiplyByVector(H,Y[n],Y[n]);return t.cartesianArrayToCartographicArray(Y,X),S.fromCartographicArray(X)}function O(e){e=o(e,o.EMPTY_OBJECT);var t=e.rectangle,i=o(e.granularity,_.RADIANS_PER_DEGREE),r=o(e.ellipsoid,u.WGS84),n=o(e.height,0),s=o(e.rotation,0),l=o(e.stRotation,0),c=o(e.vertexFormat,b.DEFAULT),h=e.extrudedHeight,d=a(h),p=o(e.closeTop,!0),m=o(e.closeBottom,!0);this._rectangle=t,this._granularity=i,this._ellipsoid=u.clone(r),this._surfaceHeight=n,this._rotation=s,this._stRotation=l,this._vertexFormat=b.clone(c),this._extrudedHeight=o(h,0),this._extrude=d,this._closeTop=p,this._closeBottom=m,this._workerName="createRectangleGeometry",this._rotatedRectangle=R(this._rectangle,this._ellipsoid,s)}var N=new i,L=new i,B=new i,F=new i,V=new S,k=new t,z=new e,U=new e,G=new i,W=new i,H=new v,q=new i,j=new w,Y=[new i,new i,new i,new i],X=[new r,new r,new r,new r];O.packedLength=S.packedLength+u.packedLength+b.packedLength+S.packedLength+8,O.pack=function(e,t,i){return i=o(i,0),S.pack(e._rectangle,t,i),i+=S.packedLength,u.pack(e._ellipsoid,t,i),i+=u.packedLength,b.pack(e._vertexFormat,t,i),i+=b.packedLength,S.pack(e._rotatedRectangle,t,i),i+=S.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._extrudedHeight,t[i++]=e._extrude?1:0,t[i++]=e._closeTop?1:0,t[i]=e._closeBottom?1:0,t};var Z=new S,K=new S,Q=u.clone(u.UNIT_SPHERE),J=new b,$={rectangle:Z,ellipsoid:Q,vertexFormat:J,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0};O.unpack=function(e,t,i){t=o(t,0);var r=S.unpack(e,t,Z);t+=S.packedLength;var n=u.unpack(e,t,Q);t+=u.packedLength;var s=b.unpack(e,t,J);t+=b.packedLength;var l=S.unpack(e,t,K);t+=S.packedLength;var c=e[t++],h=e[t++],d=e[t++],p=e[t++],m=e[t++],f=1===e[t++],_=1===e[t++],g=1===e[t];return a(i)?(i._rectangle=S.clone(r,i._rectangle),i._ellipsoid=u.clone(n,i._ellipsoid),i._vertexFormat=b.clone(s,i._vertexFormat),i._granularity=c,i._surfaceHeight=h,i._rotation=d,i._stRotation=p,i._extrudedHeight=f?m:void 0,i._extrude=f,i._closeTop=_,i._closeBottom=g,i._rotatedRectangle=l,i):($.granularity=c,$.height=h,$.rotation=d,$.stRotation=p,$.extrudedHeight=f?m:void 0,$.closeTop=_,$.closeBottom=g,new O($))};var ee=new v,te=new r,ie=new r,re=new w,ne=new r;return O.createGeometry=function(t){if(!_.equalsEpsilon(t._rectangle.north,t._rectangle.south,_.EPSILON10)&&!_.equalsEpsilon(t._rectangle.east,t._rectangle.west,_.EPSILON10)){var i=S.clone(t._rectangle,V),r=t._ellipsoid,n=t._surfaceHeight,o=t._extrude,a=t._extrudedHeight,s=t._rotation,l=t._stRotation,u=t._vertexFormat,h=E.computeOptions(t,i,te,ie),p=ee;if(0!==l||0!==s){var m=S.center(i,ne),f=r.geodeticSurfaceNormalCartographic(m,G);w.fromAxisAngle(f,-l,re),v.fromQuaternion(re,p)}else v.clone(v.IDENTITY,p);h.lonScalar=1/t._rectangle.width,h.latScalar=1/t._rectangle.height,h.vertexFormat=u,h.rotation=s,h.stRotation=l,h.tangentRotationMatrix=p,h.size=h.width*h.height;var g,C;if(i=t._rectangle,o){g=I(h);var b=e.fromRectangle3D(i,r,n,U),T=e.fromRectangle3D(i,r,a,z);C=e.union(b,T)}else g=P(h),g.attributes.position.values=y.scaleToGeodeticHeight(g.attributes.position.values,n,r,!1),C=e.fromRectangle3D(i,r,n);return u.position||delete g.attributes.position,new c({attributes:new d(g.attributes),indices:g.indices,primitiveType:g.primitiveType,boundingSphere:C})}},O.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new O({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:r,extrudedHeight:a,height:o,closeTop:!0,closeBottom:!0,vertexFormat:b.POSITION_ONLY})},s(O.prototype,{rectangle:{get:function(){return this._rotatedRectangle}}}),O}),i("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";function g(e){var t,i=e.size,n=e.height,o=e.width,a=new Float64Array(3*i),s=0,d=0,p=S;for(t=0;t<o;t++)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=o-1,d=1;d<n;d++)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(d=n-1,t=o-2;t>=0;t--)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,d=n-2;d>0;d--)_.computePosition(e,d,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var f=a.length/3*2,g=h.createTypedArray(a.length/3,f),v=0,y=0;y<a.length/3-1;y++)g[v++]=y,g[v++]=y+1;g[v++]=a.length/3-1,g[v++]=0;var C=new l({attributes:new c,primitiveType:m.LINES});return C.attributes.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a}),C.indices=g,C}function v(e){var t=e.surfaceHeight,i=e.extrudedHeight,r=e.ellipsoid,n=Math.min(i,t),o=Math.max(i,t),a=g(e);if(d.equalsEpsilon(n,o,d.EPSILON10))return a;var s=e.height,l=e.width,u=p.scaleToGeodeticHeight(a.attributes.position.values,o,r,!1),c=u.length,m=new Float64Array(2*c);m.set(u);var f=p.scaleToGeodeticHeight(a.attributes.position.values,n,r);m.set(f,c),a.attributes.position.values=m;var _=m.length/3*2+8,v=h.createTypedArray(m.length/3,_);c=m.length/6;for(var y=0,C=0;C<c-1;C++)v[y++]=C,v[y++]=C+1,v[y++]=C+c,v[y++]=C+c+1;return v[y++]=c-1,v[y++]=0,v[y++]=c+c-1,v[y++]=c,v[y++]=0,v[y++]=c,v[y++]=l-1,v[y++]=c+l-1,v[y++]=l+s-2,v[y++]=l+s-2+c,v[y++]=2*l+s-3,v[y++]=2*l+s-3+c,a.indices=v,a}function y(e){e=n(e,n.EMPTY_OBJECT);var t=e.rectangle,i=n(e.granularity,d.RADIANS_PER_DEGREE),r=n(e.ellipsoid,s.WGS84),o=n(e.height,0),a=n(e.rotation,0),l=e.extrudedHeight;this._rectangle=t,this._granularity=i,this._ellipsoid=r,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=l,this._workerName="createRectangleOutlineGeometry"}var C=new e,w=new e,S=new t,E=new f;y.packedLength=f.packedLength+s.packedLength+5,y.pack=function(e,t,i){return i=n(i,0),f.pack(e._rectangle,t,i),i+=f.packedLength,s.pack(e._ellipsoid,t,i),i+=s.packedLength,t[i++]=e._granularity,t[i++]=e._surfaceHeight,t[i++]=e._rotation,t[i++]=o(e._extrudedHeight)?1:0,t[i]=n(e._extrudedHeight,0),t};var b=new f,T=s.clone(s.UNIT_SPHERE),x={rectangle:b,ellipsoid:T,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};y.unpack=function(e,t,i){t=n(t,0);var r=f.unpack(e,t,b);t+=f.packedLength;var a=s.unpack(e,t,T);t+=s.packedLength;var l=e[t++],u=e[t++],c=e[t++],h=e[t++],d=e[t];return o(i)?(i._rectangle=f.clone(r,i._rectangle),i._ellipsoid=s.clone(a,i._ellipsoid),i._surfaceHeight=u,i._rotation=c,i._extrudedHeight=h?d:void 0,i):(x.granularity=l,x.height=u,x.rotation=c,x.extrudedHeight=h?d:void 0,new y(x))};var A=new i;return y.createGeometry=function(t){var i=f.clone(t._rectangle,E),r=t._ellipsoid,n=t._surfaceHeight,a=t._extrudedHeight,s=_.computeOptions(t,i,A);s.size=2*s.width+2*s.height-4;var u,c;if(i=t._rectangle,!d.equalsEpsilon(i.north,i.south,d.EPSILON10)&&!d.equalsEpsilon(i.east,i.west,d.EPSILON10)){if(o(a)){u=v(s);var h=e.fromRectangle3D(i,r,n,w),y=e.fromRectangle3D(i,r,a,C);c=e.union(h,y)}else u=g(s),u.attributes.position.values=p.scaleToGeodeticHeight(u.attributes.position.values,n,r,!1),c=e.fromRectangle3D(i,r,n);return new l({attributes:u.attributes,indices:u.indices,primitiveType:m.LINES,boundingSphere:c})}},y}),i("Core/ReferenceFrame",["./freezeObject"],function(e){"use strict";var t={FIXED:0,INERTIAL:1};return e(t)}),i("Core/requestAnimationFrame",["./defined","./getTimestamp"],function(e,t){"use strict";function i(e){return r(e)}if("undefined"!=typeof window){var r=window.requestAnimationFrame;return function(){if(!e(r))for(var i=["webkit","moz","ms","o"],n=0,o=i.length;n<o&&!e(r);)r=window[i[n]+"RequestAnimationFrame"],++n;if(!e(r)){var a=1e3/60,s=0;r=function(e){var i=t(),r=Math.max(a-(i-s),0);return s=i+r,setTimeout(function(){e(s)},r)}}}(),i}}),i("Core/sampleTerrain",["../ThirdParty/when","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){function o(){t.ready?e(n(t,i,r),function(e){a.resolve(e)}):setTimeout(o,10)}var a=e.defer();return o(),a.promise}function n(t,i,r){var n,s=t.tilingScheme,l=[],u={};for(n=0;n<r.length;++n){var c=s.positionToTileXY(r[n],i),h=c.toString();if(!u.hasOwnProperty(h)){var d={x:c.x,y:c.y,level:i,tilingScheme:s,terrainProvider:t,positions:[]};u[h]=d,l.push(d)}u[h].positions.push(r[n])}var p=[];for(n=0;n<l.length;++n){var m=l[n],f=m.terrainProvider.requestTileGeometry(m.x,m.y,m.level,!1),_=e(f,o(m),a(m));p.push(_)}return e.all(p,function(){return r})}function o(e){var t=e.positions,i=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(e){for(var r=0;r<t.length;++r){var n=t[r];n.height=e.interpolateHeight(i,n.longitude,n.latitude)}}}function a(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){var i=t[e];i.height=void 0}}}return r}),i("Core/ScreenSpaceEventType",["./freezeObject"],function(e){"use strict";var t={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,RIGHT_DOUBLE_CLICK:8,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MIDDLE_DOUBLE_CLICK:13,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19};return e(t)}),i("Core/ScreenSpaceEventHandler",["./AssociativeArray","./Cartesian2","./defaultValue","./defined","./destroyObject","./DeveloperError","./FeatureDetection","./getTimestamp","./KeyboardEventModifier","./ScreenSpaceEventType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i){var r=e._element;if(r===document)return i.x=t.clientX,i.y=t.clientY,i;var n=r.getBoundingClientRect();return i.x=t.clientX-n.left,i.y=t.clientY-n.top,i}function h(e,t){var i=e;return r(t)&&(i+="+"+t),i}function d(e){return e.shiftKey?l.SHIFT:e.ctrlKey?l.CTRL:e.altKey?l.ALT:void 0}function p(e,t,i,r){function n(t){r(e,t)}i.addEventListener(t,n,!1),e._removalFunctions.push(function(){i.removeEventListener(t,n,!1)})}function m(e){var t=e._element,i=r(t.disableRootEvents)?t:document;a.supportsPointerEvents()?(p(e,"pointerdown",t,P),p(e,"pointerup",t,D),p(e,"pointermove",t,M),p(e,"pointercancel",t,D)):(p(e,"mousedown",t,v),p(e,"mouseup",i,y),p(e,"mousemove",i,C),p(e,"touchstart",t,E),p(e,"touchend",i,b),p(e,"touchmove",i,x),p(e,"touchcancel",i,b)),p(e,"dblclick",t,w);var n;n="onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",p(e,n,t,S)}function f(e){for(var t=e._removalFunctions,i=0;i<t.length;++i)t[i]()}function _(e){e._lastSeenTouchEvent=s()}function g(e){return s()-e._lastSeenTouchEvent>I.mouseEmulationIgnoreMilliseconds}function v(e,i){if(g(e)){var n=i.button;e._buttonDown=n;var o;if(n===R.LEFT)o=u.LEFT_DOWN;else if(n===R.MIDDLE)o=u.MIDDLE_DOWN;else{if(n!==R.RIGHT)return;o=u.RIGHT_DOWN}var a=c(e,i,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=d(i),l=e.getInputAction(o,s);r(l)&&(t.clone(a,O.position),l(O),i.preventDefault())}}function y(e,i){if(g(e)){var n=i.button;e._buttonDown=void 0;var o,a;if(n===R.LEFT)o=u.LEFT_UP,a=u.LEFT_CLICK;else if(n===R.MIDDLE)o=u.MIDDLE_UP,a=u.MIDDLE_CLICK;else{if(n!==R.RIGHT)return;o=u.RIGHT_UP,a=u.RIGHT_CLICK}var s=d(i),l=e.getInputAction(o,s),h=e.getInputAction(a,s);if(r(l)||r(h)){var p=c(e,i,e._primaryPosition);if(r(l)&&(t.clone(p,N.position),l(N)),r(h)){var m=e._primaryStartPosition,f=m.x-p.x,_=m.y-p.y,v=Math.sqrt(f*f+_*_);v<e._clickPixelTolerance&&(t.clone(p,L.position),h(L))}}}}function C(e,i){if(g(e)){var n=d(i),o=c(e,i,e._primaryPosition),a=e._primaryPreviousPosition,s=e.getInputAction(u.MOUSE_MOVE,n);r(s)&&(t.clone(a,B.startPosition),t.clone(o,B.endPosition),s(B)),t.clone(o,a),r(e._buttonDown)&&i.preventDefault()}}function w(e,t){var i,n=t.button;if(n===R.LEFT)i=u.LEFT_DOUBLE_CLICK;else if(n===R.MIDDLE)i=u.MIDDLE_DOUBLE_CLICK;else{if(n!==R.RIGHT)return;i=u.RIGHT_DOUBLE_CLICK}var o=d(t),a=e.getInputAction(i,o);r(a)&&(c(e,t,F.position),a(F))}function S(e,t){var i;if(r(t.deltaY)){var n=t.deltaMode;i=n===t.DOM_DELTA_PIXEL?-t.deltaY:n===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else i=t.detail>0?t.detail*-120:t.wheelDelta;if(r(i)){var o=d(t),a=e.getInputAction(u.WHEEL,o);r(a)&&(a(i),t.preventDefault())}}function E(e,i){_(e);var r,n,o,a=i.changedTouches,s=a.length,l=e._positions;for(r=0;r<s;++r)n=a[r],o=n.identifier,l.set(o,c(e,n,new t));T(e,i);var u=e._previousPositions;for(r=0;r<s;++r)n=a[r],o=n.identifier,u.set(o,t.clone(l.get(o)))}function b(e,t){_(e);var i,r,n,o=t.changedTouches,a=o.length,s=e._positions;for(i=0;i<a;++i)r=o[i],n=r.identifier,s.remove(n);T(e,t);var l=e._previousPositions;for(i=0;i<a;++i)r=o[i],n=r.identifier,l.remove(n)}function T(e,i){var n,o,a=d(i),s=e._positions,l=e._previousPositions,c=s.length;if(1!==c&&e._buttonDown===R.LEFT&&(e._buttonDown=void 0,n=e.getInputAction(u.LEFT_UP,a),r(n)&&(t.clone(e._primaryPosition,z.position),n(z)),0===c&&(o=e.getInputAction(u.LEFT_CLICK,a),r(o)))){var h=e._primaryStartPosition,p=l.values[0],m=h.x-p.x,f=h.y-p.y,_=Math.sqrt(m*m+f*f);_<e._clickPixelTolerance&&(t.clone(e._primaryPosition,U.position),o(U))}if(2!==c&&e._isPinching&&(e._isPinching=!1,n=e.getInputAction(u.PINCH_END,a),r(n)&&n()),1===c){var g=s.values[0];t.clone(g,e._primaryPosition),t.clone(g,e._primaryStartPosition),t.clone(g,e._primaryPreviousPosition),e._buttonDown=R.LEFT,n=e.getInputAction(u.LEFT_DOWN,a),r(n)&&(t.clone(g,V.position),n(V)),i.preventDefault()}2===c&&(e._isPinching=!0,n=e.getInputAction(u.PINCH_START,a),r(n)&&(t.clone(s.values[0],k.position1),t.clone(s.values[1],k.position2),n(k),i.preventDefault()))}function x(e,i){_(e);var n,o,a,s=i.changedTouches,l=s.length,u=e._positions;for(n=0;n<l;++n){o=s[n],a=o.identifier;var h=u.get(a);r(h)&&c(e,o,h)}A(e,i);var d=e._previousPositions;for(n=0;n<l;++n)o=s[n],a=o.identifier,t.clone(u.get(a),d.get(a))}function A(e,i){var n,o=d(i),a=e._positions,s=e._previousPositions,l=a.length;if(1===l&&e._buttonDown===R.LEFT){var c=a.values[0];t.clone(c,e._primaryPosition);var h=e._primaryPreviousPosition;n=e.getInputAction(u.MOUSE_MOVE,o),r(n)&&(t.clone(h,G.startPosition),t.clone(c,G.endPosition),n(G)),t.clone(c,h),i.preventDefault()}else if(2===l&&e._isPinching&&(n=e.getInputAction(u.PINCH_MOVE,o),r(n))){var p=a.values[0],m=a.values[1],f=s.values[0],_=s.values[1],g=m.x-p.x,v=m.y-p.y,y=.25*Math.sqrt(g*g+v*v),C=_.x-f.x,w=_.y-f.y,S=.25*Math.sqrt(C*C+w*w),E=.125*(m.y+p.y),b=.125*(_.y+f.y),T=Math.atan2(v,g),x=Math.atan2(w,C);t.fromElements(0,S,W.distance.startPosition),t.fromElements(0,y,W.distance.endPosition),t.fromElements(x,b,W.angleAndHeight.startPosition),t.fromElements(T,E,W.angleAndHeight.endPosition),n(W)}}function P(e,i){if(i.target.setPointerCapture(i.pointerId),"touch"===i.pointerType){var r=e._positions,n=i.pointerId;r.set(n,c(e,i,new t)),T(e,i);var o=e._previousPositions;o.set(n,t.clone(r.get(n)))}else v(e,i)}function D(e,t){if("touch"===t.pointerType){var i=e._positions,r=t.pointerId;i.remove(r),T(e,t);var n=e._previousPositions;n.remove(r)}else y(e,t)}function M(e,i){if("touch"===i.pointerType){var n=e._positions,o=i.pointerId,a=n.get(o);if(!r(a))return;c(e,i,a),A(e,i);var s=e._previousPositions;t.clone(n.get(o),s.get(o))}else C(e,i)}function I(r){this._inputEvents={},this._buttonDown=void 0,this._isPinching=!1,this._lastSeenTouchEvent=-I.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new t,this._primaryPosition=new t,this._primaryPreviousPosition=new t,this._positions=new e,this._previousPositions=new e,this._removalFunctions=[],this._clickPixelTolerance=5,this._element=i(r,document),m(this)}var R={LEFT:0,MIDDLE:1,RIGHT:2},O={position:new t},N={position:new t},L={position:new t},B={startPosition:new t,endPosition:new t},F={position:new t},V={position:new t},k={position1:new t,position2:new t},z={position:new t},U={position:new t},G={startPosition:new t,endPosition:new t},W={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}};return I.prototype.setInputAction=function(e,t,i){var r=h(t,i);this._inputEvents[r]=e},I.prototype.getInputAction=function(e,t){var i=h(e,t);return this._inputEvents[i]},I.prototype.removeInputAction=function(e,t){var i=h(e,t);delete this._inputEvents[i]},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){return f(this),n(this)},I.mouseEmulationIgnoreMilliseconds=800,I}),i("Core/ShowGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(e){e=t(e,!0),this.value=o.toValue(e)}return r(o.prototype,{componentDatatype:{get:function(){return e.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),o.toValue=function(e,t){return i(t)?(t[0]=e,t):new Uint8Array([e])},o}),i("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}function u(e,t){t=r.addSeconds(e,C,t);var i=r.totalDays(t)-w;return t=r.addSeconds(t,l(i),t)}function c(i,r,a,s,l,u,c){a<0&&(a=-a,l+=n.PI);var p=i*(1-r),m=s-l,_=l,g=d(u-s,r);h(r,0);f(m,a,_,A);var v=p*(1+r),y=Math.cos(g),C=Math.sin(g),w=1+r*y,S=v/w;return t(c)?(c.x=S*y,c.y=S*C,c.z=0):c=new e(S*y,S*C,0),o.multiplyByVector(A,c,c)}function h(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function d(e,t){var i=p(e,t);return m(i,t)}function p(e,t){var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var r,o=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),a=Number.MAX_VALUE;for(r=0;r<P&&Math.abs(a-o)>D;++r){a=o;var s=a-t*Math.sin(a)-e,l=1-t*Math.cos(a);o=a-s/l}return a=o+i*n.TWO_PI}function m(e,t){var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var r=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),a=Math.atan2(o,r);return a=n.zeroToTwoPi(a),e<0&&(a-=n.TWO_PI),a+=i*n.TWO_PI}function f(e,i,r,n){var a=Math.cos(e),s=Math.sin(e),l=Math.cos(i),u=Math.sin(i),c=Math.cos(r),h=Math.sin(r);return t(n)?(n[0]=c*a-h*s*l,n[1]=h*a+c*s*l,n[2]=s*u,n[3]=-c*s-h*a*l,n[4]=-h*s+c*a*l,n[5]=a*u,n[6]=h*u,n[7]=-c*u,n[8]=l):n=new o(c*a-h*s*l,-c*s-h*a*l,h*u,h*a+c*s*l,-h*s+c*a*l,-c*u,s*u,a*u,l),n}function _(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*r,o=M+U*Math.cos(O*n)+Z*Math.sin(O*n)+G*Math.cos(N*n)+K*Math.sin(N*n)+W*Math.cos(L*n)+Q*Math.sin(L*n)+H*Math.cos(B*n)+J*Math.sin(B*n)+q*Math.cos(F*n)+$*Math.sin(F*n)+j*Math.cos(V*n)+ee*Math.sin(V*n)+Y*Math.cos(k*n)+te*Math.sin(k*n)+X*Math.cos(z*n)+ie*Math.sin(z*n),s=I+R*r+he*Math.cos(re*n)+ye*Math.sin(re*n)+de*Math.cos(ne*n)+Ce*Math.sin(ne*n)+pe*Math.cos(oe*n)+we*Math.sin(oe*n)+me*Math.cos(ae*n)+Se*Math.sin(ae*n)+fe*Math.cos(se*n)+Ee*Math.sin(se*n)+_e*Math.cos(le*n)+be*Math.sin(le*n)+ge*Math.cos(ue*n)+Te*Math.sin(ue*n)+ve*Math.cos(ce*n)+xe*Math.sin(ce*n),l=.0167086342-.0004203654*r,h=102.93734808*b+11612.3529*T*r,d=469.97289*T*r,p=174.87317577*b-8679.27034*T*r;return c(o,l,d,h,p,s,t)}function g(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/a.DAYS_PER_JULIAN_CENTURY,n=r*r,o=n*r,s=o*r,l=383397.7725+.004*r,h=.055545526-1.6e-8*r,d=5.15668983*b,p=-8e-5*r+.02966*n-42e-6*o-1.3e-7*s,m=83.35324312*b,f=14643420.2669*r-38.2702*n-.045047*o+21301e-8*s,_=125.04455501*b,g=-6967919.3631*r+6.3602*n+.007625*o-3586e-8*s,v=218.31664563*b,y=1732559343.4847*r-6.391*n+.006588*o-3169e-8*s,C=297.85019547*b+T*(1602961601.209*r-6.3706*n+.006593*o-3169e-8*s),w=93.27209062*b+T*(1739527262.8478*r-12.7512*n-.001037*o+417e-8*s),x=134.96340251*b+T*(1717915923.2178*r+31.8792*n+.051635*o-2447e-7*s),A=357.52910918*b+T*(129596581.0481*r-.5532*n+136e-6*o-1149e-8*s),P=310.17137918*b-T*(6967051.436*r+6.2068*n+.007618*o-3219e-8*s),D=2*C,M=4*C,I=6*C,R=2*x,O=3*x,N=4*x,L=2*w;l+=3400.4*Math.cos(D)-635.6*Math.cos(D-x)-235.6*Math.cos(x)+218.1*Math.cos(D-A)+181*Math.cos(D+x),h+=.014216*Math.cos(D-x)+.008551*Math.cos(D-R)-.001383*Math.cos(x)+.001356*Math.cos(D+x)-.001147*Math.cos(M-O)-914e-6*Math.cos(M-R)+869e-6*Math.cos(D-A-x)-627e-6*Math.cos(D)-394e-6*Math.cos(M-N)+282e-6*Math.cos(D-A-R)-279e-6*Math.cos(C-x)-236e-6*Math.cos(R)+231e-6*Math.cos(M)+229e-6*Math.cos(I-N)-201e-6*Math.cos(R-L),p+=486.26*Math.cos(D-L)-40.13*Math.cos(D)+37.51*Math.cos(L)+25.73*Math.cos(R-L)+19.97*Math.cos(D-A-L),f+=-55609*Math.sin(D-x)-34711*Math.sin(D-R)-9792*Math.sin(x)+9385*Math.sin(M-O)+7505*Math.sin(M-R)+5318*Math.sin(D+x)+3484*Math.sin(M-N)-3417*Math.sin(D-A-x)-2530*Math.sin(I-N)-2376*Math.sin(D)-2075*Math.sin(D-O)-1883*Math.sin(R)-1736*Math.sin(I-5*x)+1626*Math.sin(A)-1370*Math.sin(I-O),g+=-5392*Math.sin(D-L)-540*Math.sin(A)-441*Math.sin(D)+423*Math.sin(L)-288*Math.sin(R-L),y+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-x)-662.5*Math.sin(A)+396.3*Math.sin(x)-218*Math.sin(D-A);var B=2*P,F=3*P;p+=46.997*Math.cos(P)*r-.614*Math.cos(D-L+P)*r+.614*Math.cos(D-L-P)*r-.0297*Math.cos(B)*n-.0335*Math.cos(P)*n+.0012*Math.cos(D-L+B)*n-16e-5*Math.cos(P)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(B)*o;var V=2.116*Math.sin(P)*r-.111*Math.sin(D-L-P)*r-.0015*Math.sin(P)*n;f+=V,y+=V,g+=-520.77*Math.sin(P)*r+13.66*Math.sin(D-L+P)*r+1.12*Math.sin(D-P)*r-1.06*Math.sin(L-P)*r+.66*Math.sin(B)*n+.371*Math.sin(P)*n-.035*Math.sin(D-L+B)*n-.015*Math.sin(D-L+P)*n+.0014*Math.sin(P)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(B)*o,l*=E;var k=d+p*T,z=m+f*T,U=v+y*T,G=_+g*T;return c(l,h,k,z,G,U,t)}function v(t,i){return i=g(t,i),e.multiplyByScalar(i,De,i)}var y={},C=32.184,w=2451545,S=new r(2451545,0,s.TAI),E=1e3,b=n.RADIANS_PER_DEGREE,T=n.RADIANS_PER_ARCSECOND,x=14959787e4,A=new o,P=50,D=n.EPSILON8,M=1.0000010178*x,I=100.46645683*b,R=1295977422.83429*T,O=16002,N=21863,L=32004,B=10931,F=14529,V=16368,k=15318,z=32794,U=64e-7*x,G=-152e-7*x,W=62e-7*x,H=-8e-7*x,q=32e-7*x,j=-41e-7*x,Y=19e-7*x,X=-11e-7*x,Z=1e-7*-150*x,K=-46e-7*x,Q=68*1e-7*x,J=54e-7*x,$=14e-7*x,ee=24e-7*x,te=-28e-7*x,ie=22e-7*x,re=10,ne=16002,oe=21863,ae=10931,se=1473,le=32004,ue=4387,ce=73,he=-325e-7,de=-322e-7,pe=1e-7*-79,me=232*1e-7,fe=1e-7*-52,_e=97e-7,ge=55e-7,ve=-41e-7,ye=-105e-7,Ce=-137e-7,we=258e-7,Se=35e-7,Ee=1e-7*-116,be=-88e-7,Te=-112e-7,xe=-8e-6,Ae=new r(0,0,s.TAI),Pe=.012300034,De=Pe/(Pe+1)*-1,Me=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Ie=new e;return y.computeSunPositionInEarthInertialFrame=function(i,n){return t(i)||(i=r.now()),t(n)||(n=new e),Ie=_(i,Ie),n=e.negate(Ie,n),v(i,Ie),e.subtract(n,Ie,n),o.multiplyByVector(Me,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,i){return t(e)||(e=r.now()),i=g(e,i),o.multiplyByVector(Me,i,i),i},y}),i("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e,t,r,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=r.red,h=r.green,d=r.blue,m=r.alpha,f=n.red,_=n.green,g=n.blue,v=n.alpha;if(i.equals(r,n)){for(l=0;l<u;l++)a[s++]=i.floatToByte(c),a[s++]=i.floatToByte(h),a[s++]=i.floatToByte(d),a[s++]=i.floatToByte(m);return s}var y=(f-c)/u,C=(_-h)/u,w=(g-d)/u,S=(v-m)/u,E=s;for(l=0;l<u;l++)a[E++]=i.floatToByte(c+l*y),a[E++]=i.floatToByte(h+l*C),a[E++]=i.floatToByte(d+l*w),a[E++]=i.floatToByte(m+l*S);return E}function _(e){e=n(e,n.EMPTY_OBJECT);var r=e.positions,a=e.colors,l=n(e.colorsPerVertex,!1);this._positions=r,this._colors=a,this._colorsPerVertex=l,this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,d.RADIANS_PER_DEGREE),this._ellipsoid=n(e.ellipsoid,s.WGS84),this._workerName="createSimplePolylineGeometry";var u=1+r.length*t.packedLength;u+=o(a)?1+a.length*i.packedLength:1,this.packedLength=u+s.packedLength+3}_.pack=function(e,r,a){a=n(a,0);var l,u=e._positions,c=u.length;for(r[a++]=c,l=0;l<c;++l,a+=t.packedLength)t.pack(u[l],r,a);var h=e._colors;for(c=o(h)?h.length:0,r[a++]=c,l=0;l<c;++l,a+=i.packedLength)i.pack(h[l],r,a);return s.pack(e._ellipsoid,r,a),a+=s.packedLength,r[a++]=e._colorsPerVertex?1:0,r[a++]=e._followSurface?1:0,r[a]=e._granularity,r},_.unpack=function(e,r,a){r=n(r,0);var l,u=e[r++],c=new Array(u);for(l=0;l<u;++l,r+=t.packedLength)c[l]=t.unpack(e,r);u=e[r++];var h=u>0?new Array(u):void 0;for(l=0;l<u;++l,r+=i.packedLength)h[l]=i.unpack(e,r);var d=s.unpack(e,r);r+=s.packedLength;var p=1===e[r++],m=1===e[r++],f=e[r];return o(a)?(a._positions=c,a._colors=h,a._ellipsoid=d,a._colorsPerVertex=p,a._followSurface=m,a._granularity=f,a):new _({positions:c,colors:h,ellipsoid:d,colorsPerVertex:p,followSurface:m,granularity:f})};var g=new Array(2),v=new Array(2),y={positions:g,height:v,ellipsoid:void 0,minDistance:void 0};return _.createGeometry=function(n){var a,s,_,C,w,S=n._positions,E=n._colors,b=n._colorsPerVertex,T=n._followSurface,x=n._granularity,A=n._ellipsoid,P=d.chordLength(x,A.maximumRadius),D=o(E)&&!b,M=S.length,I=0;if(T){var R=p.extractHeights(S,A),O=y;if(O.minDistance=P,O.ellipsoid=A,D){var N=0;for(a=0;a<M-1;a++)N+=p.numberOfPoints(S[a],S[a+1],P)+1;s=new Float64Array(3*N),C=new Uint8Array(4*N),O.positions=g,O.height=v;var L=0;for(a=0;a<M-1;++a){g[0]=S[a],g[1]=S[a+1],v[0]=R[a],v[1]=R[a+1];var B=p.generateArc(O);if(o(E)){var F=B.length/3;w=E[a];for(var V=0;V<F;++V)C[L++]=i.floatToByte(w.red),C[L++]=i.floatToByte(w.green),C[L++]=i.floatToByte(w.blue),C[L++]=i.floatToByte(w.alpha)}s.set(B,I),I+=B.length}}else if(O.positions=S,O.height=R,s=new Float64Array(p.generateArc(O)),o(E)){for(C=new Uint8Array(s.length/3*4),a=0;a<M-1;++a){var k=S[a],z=S[a+1],U=E[a],G=E[a+1];I=f(k,z,U,G,P,C,I)}var W=E[M-1];C[I++]=i.floatToByte(W.red),C[I++]=i.floatToByte(W.green),C[I++]=i.floatToByte(W.blue),C[I++]=i.floatToByte(W.alpha)}}else{_=D?2*M-2:M,s=new Float64Array(3*_),C=o(E)?new Uint8Array(4*_):void 0;var H=0,q=0;for(a=0;a<M;++a){var j=S[a];if(D&&a>0&&(t.pack(j,s,H),H+=3,w=E[a-1],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha)),D&&a===M-1)break;t.pack(j,s,H),H+=3,o(E)&&(w=E[a],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha))}}var Y=new c;Y.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s}),o(E)&&(Y.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0})),_=s.length/3;var X=2*(_-1),Z=h.createTypedArray(_,X),K=0;for(a=0;a<_-1;++a)Z[K++]=a,Z[K++]=a+1;return new l({attributes:Y,indices:Z,primitiveType:m.LINES,boundingSphere:e.fromPoints(S)})},_}),i("Core/SphereGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidGeometry","./VertexFormat"],function(e,t,i,r,n,o){"use strict";function a(i){var r=t(i.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,vertexFormat:i.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){return n.pack(e._ellipsoidGeometry,t,i)};var s=new n,l={radius:void 0,radii:new e,vertexFormat:new o,stackPartitions:void 0,slicePartitions:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.vertexFormat=o.clone(c._vertexFormat,l.vertexFormat),l.stackPartitions=c._stackPartitions,l.slicePartitions=c._slicePartitions,i(u)?(e.clone(c._radii,l.radii),u._ellipsoidGeometry=new n(l),u):(l.radius=c._radii.x,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},a}),i("Core/SphereOutlineGeometry",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./EllipsoidOutlineGeometry"],function(e,t,i,r,n){"use strict";function o(i){var r=t(i.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:i.stackPartitions,slicePartitions:i.slicePartitions,subdivisions:i.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"}o.packedLength=n.packedLength,o.pack=function(e,t,i){return n.pack(e._ellipsoidGeometry,t,i)};var a=new n,s={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(t,r,l){var u=n.unpack(t,r,a);return s.stackPartitions=u._stackPartitions,s.slicePartitions=u._slicePartitions,s.subdivisions=u._subdivisions,i(l)?(e.clone(u._radii,s.radii),l._ellipsoidGeometry=new n(s),l):(s.radius=u._radii.x,new o(s))},o.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},o}),i("Core/Spherical",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r){this.clock=e(t,0),this.cone=e(i,0),this.magnitude=e(r,1)}return r.fromCartesian3=function(e,i){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return t(i)||(i=new r),i.clock=Math.atan2(o,n),i.cone=Math.atan2(Math.sqrt(s),a),i.magnitude=Math.sqrt(s+a*a),i},r.clone=function(e,i){if(t(e))return t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=e.magnitude,i):new r(e.clock,e.cone,e.magnitude)},r.normalize=function(e,i){return t(i)?(i.clock=e.clock,i.cone=e.cone,i.magnitude=1,i):new r(e.clock,e.cone,1)},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.clock===i.clock&&e.cone===i.cone&&e.magnitude===i.magnitude},r.equalsEpsilon=function(i,r,n){return n=e(n,0),i===r||t(i)&&t(r)&&Math.abs(i.clock-r.clock)<=n&&Math.abs(i.cone-r.cone)<=n&&Math.abs(i.magnitude-r.magnitude)<=n},r.prototype.equals=function(e){
return r.equals(this,e)},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equalsEpsilon=function(e,t){return r.equalsEpsilon(this,e,t)},r.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},r}),i("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t){for(var i=[],r=e.length,n=0;n<r;){var o=Math.ceil((r-n)/t--);i.push(e.slice(n,n+o)),n+=o}return i}return i}),i("Core/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{waterMask:{get:t.throwInstantiationError}}),i.prototype.interpolateHeight=t.throwInstantiationError,i.prototype.isChildAvailable=t.throwInstantiationError,i.prototype.createMesh=t.throwInstantiationError,i.prototype.upsample=t.throwInstantiationError,i.prototype.wasCreatedByUpsampling=t.throwInstantiationError,i}),i("Core/TilingScheme",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(e){}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError},rectangle:{get:t.throwInstantiationError},projection:{get:t.throwInstantiationError}}),i.prototype.getNumberOfXTilesAtLevel=t.throwInstantiationError,i.prototype.getNumberOfYTilesAtLevel=t.throwInstantiationError,i.prototype.rectangleToNativeRectangle=t.throwInstantiationError,i.prototype.tileXYToNativeRectangle=t.throwInstantiationError,i.prototype.tileXYToRectangle=t.throwInstantiationError,i.prototype.positionToTileXY=t.throwInstantiationError,i}),i("Core/TimeIntervalCollection",["./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./JulianDate","./TimeInterval"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){return a.compare(e.start,t.start)}function u(e){if(this._intervals=[],this._changedEvent=new o,i(e))for(var t=e.length,r=0;r<t;r++)this.addInterval(e[r])}r(u.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){var e=this._intervals;return 0===e.length?void 0:e[0].start}},isStartIncluded:{get:function(){var e=this._intervals;return 0!==e.length&&e[0].isStartIncluded}},stop:{get:function(){var e=this._intervals,t=e.length;return 0===t?void 0:e[t-1].stop}},isStopIncluded:{get:function(){var e=this._intervals,t=e.length;return 0!==t&&e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return 0===this._intervals.length}}}),u.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof u))return!1;var i=this._intervals,r=e._intervals,n=i.length;if(n!==r.length)return!1;for(var o=0;o<n;o++)if(!s.equals(i[o],r[o],t))return!1;return!0},u.prototype.get=function(e){return this._intervals[e]},u.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0};var c=new s;return u.prototype.indexOf=function(t){var i=this._intervals;c.start=t,c.stop=t;var r=e(i,c,l);return r>=0?i[r].isStartIncluded?r:r>0&&i[r-1].stop.equals(t)&&i[r-1].isStopIncluded?r-1:~r:(r=~r,r>0&&r-1<i.length&&s.contains(i[r-1],t)?r-1:~r)},u.prototype.findInterval=function(e){e=t(e,t.EMPTY_OBJECT);for(var r=e.start,n=e.stop,o=e.isStartIncluded,a=e.isStopIncluded,s=this._intervals,l=0,u=s.length;l<u;l++){var c=s[l];if((!i(r)||c.start.equals(r))&&(!i(n)||c.stop.equals(n))&&(!i(o)||c.isStartIncluded===o)&&(!i(a)||c.isStopIncluded===a))return s[l]}},u.prototype.addInterval=function(t,r){if(!t.isEmpty){var n,o,u=this._intervals;if(0===u.length||a.greaterThan(t.start,u[u.length-1].stop))return u.push(t),void this._changedEvent.raiseEvent(this);for(o=e(u,t,l),o<0?o=~o:o>0&&t.isStartIncluded&&u[o-1].isStartIncluded&&u[o-1].start.equals(t.start)?--o:o<u.length&&!t.isStartIncluded&&u[o].isStartIncluded&&u[o].start.equals(t.start)&&++o,o>0&&(n=a.compare(u[o-1].stop,t.start),(n>0||0===n&&(u[o-1].isStopIncluded||t.isStartIncluded))&&((i(r)?r(u[o-1].data,t.data):u[o-1].data===t.data)?(t=new s(a.greaterThan(t.stop,u[o-1].stop)?{start:u[o-1].start,stop:t.stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:u[o-1].start,stop:u[o-1].stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:u[o-1].isStopIncluded||t.stop.equals(u[o-1].stop)&&t.isStopIncluded,data:t.data}),u.splice(o-1,1),--o):(n=a.compare(u[o-1].stop,t.stop),n>0||0===n&&u[o-1].isStopIncluded&&!t.isStopIncluded?u.splice(o-1,1,new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}),new s({start:t.stop,stop:u[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o-1].isStopIncluded,data:u[o-1].data})):u[o-1]=new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}))));o<u.length&&(n=a.compare(t.stop,u[o].start),n>0||0===n&&(t.isStopIncluded||u[o].isStartIncluded));)if(i(r)?r(u[o].data,t.data):u[o].data===t.data)t=new s({start:t.start,stop:a.greaterThan(u[o].stop,t.stop)?u[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:a.greaterThan(u[o].stop,t.stop)?u[o].isStopIncluded:t.isStopIncluded,data:t.data}),u.splice(o,1);else{if(u[o]=new s({start:t.stop,stop:u[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o].isStopIncluded,data:u[o].data}),!u[o].isEmpty)break;u.splice(o,1)}u.splice(o,0,t),this._changedEvent.raiseEvent(this)}},u.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var i=!1,r=this._intervals,n=e(r,t,l);n<0&&(n=~n);var o=t.start,u=t.stop,c=t.isStartIncluded,h=t.isStopIncluded;if(n>0){var d=r[n-1],p=d.stop;(a.greaterThan(p,o)||s.equals(p,o)&&d.isStopIncluded&&c)&&(i=!0,(a.greaterThan(p,u)||d.isStopIncluded&&!h&&s.equals(p,u))&&r.splice(n,0,new s({start:u,stop:p,isStartIncluded:!h,isStopIncluded:d.isStopIncluded,data:d.data})),r[n-1]=new s({start:d.start,stop:o,isStartIncluded:d.isStartIncluded,isStopIncluded:!c,data:d.data}))}var m=r[n];for(n<r.length&&!c&&m.isStartIncluded&&o.equals(m.start)&&(i=!0,r.splice(n,0,new s({start:m.start,stop:m.start,isStartIncluded:!0,isStopIncluded:!0,data:m.data})),++n,m=r[n]);n<r.length&&a.greaterThan(u,m.stop);)i=!0,r.splice(n,1),m=r[n];return n<r.length&&u.equals(m.stop)&&(i=!0,!h&&m.isStopIncluded?(n+1<r.length&&r[n+1].start.equals(u)&&m.data===r[n+1].data?(r.splice(n,1),m=new s({start:m.start,stop:m.stop,isStartIncluded:!0,isStopIncluded:m.isStopIncluded,data:m.data})):m=new s({start:u,stop:u,isStartIncluded:!0,isStopIncluded:!0,data:m.data}),r[n]=m):r.splice(n,1)),n<r.length&&(a.greaterThan(u,m.start)||u.equals(m.start)&&h&&m.isStartIncluded)&&(i=!0,r[n]=new s({start:u,stop:m.stop,isStartIncluded:!h,isStopIncluded:m.isStopIncluded,data:m.data})),i&&this._changedEvent.raiseEvent(this),i},u.prototype.intersect=function(e,t,r){for(var n=0,o=0,l=new u,c=this._intervals,h=e._intervals;n<c.length&&o<h.length;){var d=c[n],p=h[o];if(a.lessThan(d.stop,p.start))++n;else if(a.lessThan(p.stop,d.start))++o;else{if(i(r)||i(t)&&t(d.data,p.data)||!i(t)&&p.data===d.data){var m=s.intersect(d,p,new s,r);m.isEmpty||l.addInterval(m,t)}a.lessThan(d.stop,p.stop)||d.stop.equals(p.stop)&&!d.isStopIncluded&&p.isStopIncluded?++n:++o}}return l},u}),i("Core/TranslationRotationScale",["./Cartesian3","./defaultValue","./defined","./Quaternion"],function(e,t,i,r){"use strict";var n=new e(1,1,1),o=e.ZERO,a=r.IDENTITY,s=function(i,s,l){this.translation=e.clone(t(i,o)),this.rotation=r.clone(t(s,a)),this.scale=e.clone(t(l,n))};return s.prototype.equals=function(t){return this===t||i(t)&&e.equals(this.translation,t.translation)&&r.equals(this.rotation,t.rotation)&&e.equals(this.scale,t.scale)},s}),i("Core/VideoSynchronizer",["./defaultValue","./defined","./defineProperties","./destroyObject","./Iso8601","./JulianDate"],function(e,t,i,r,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this.clock=t.clock,this.element=t.element,this.epoch=e(t.epoch,n.MINIMUM_VALUE),this.tolerance=e(t.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}function s(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}return i(a.prototype,{clock:{get:function(){return this._clock},set:function(e){var i=this._clock;i!==e&&(t(i)&&(this._clockSubscription(),this._clockSubscription=void 0),t(e)&&(this._clockSubscription=e.onTick.addEventListener(a.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){var i=this._element;i!==e&&(t(i)&&i.removeEventListener("seeked",this._seekFunction,!1),t(e)&&(this._seeking=!1,this._seekFunction=s(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}}),a.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,r(this)},a.prototype.isDestroyed=function(){return!1},a.prototype._onTick=function(i){var r=this._element;if(t(r)&&!(r.readyState<2)){var a=r.paused,s=i.shouldAnimate;if(s===a&&(s?r.play():r.pause()),this._seeking||this._firstTickAfterSeek)return void(this._firstTickAfterSeek=!1);r.playbackRate=i.multiplier;var l,u=i.currentTime,c=e(this.epoch,n.MINIMUM_VALUE),h=o.secondsDifference(u,c),d=r.duration,p=r.currentTime;r.loop?(h%=d,h<0&&(h=d-h),l=h):l=h>d?d:h<0?0:h;var m=s?e(this.tolerance,1):.001;Math.abs(l-p)>m&&(this._seeking=!0,r.currentTime=l)}},a}),i("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(e,t){this.rectangle=e,this.maxLevel=t}function y(r){function n(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void o("SRS "+t+" is not supported.");_._tilingScheme=new l({ellipsoid:y});var i=e.getElementsByTagName("TileFormat")[0];_._heightmapWidth=parseInt(i.getAttribute("width"),10),_._heightmapHeight=parseInt(i.getAttribute("height"),10),_._levelZeroMaximumGeometricError=f.getEstimatedLevelZeroGeometricErrorForAHeightmap(y,Math.min(_._heightmapWidth,_._heightmapHeight),_._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n<r.length;++n){var a=r[n],s=p.toRadians(parseFloat(a.getAttribute("minx"))),u=p.toRadians(parseFloat(a.getAttribute("miny"))),c=p.toRadians(parseFloat(a.getAttribute("maxx"))),h=p.toRadians(parseFloat(a.getAttribute("maxy"))),d=parseInt(a.getAttribute("maxlevel"),10);_._rectangles.push(new v(new m(s,u,c,h),d))}_._ready=!0,_._readyPromise.resolve(!0)}function o(e){var t=i(e,"An error occurred while accessing "+_._url+".");h=g.handleError(h,_,_._errorEvent,t,void 0,void 0,void 0,u)}function u(){e(d(_._url),n,o)}r=i(r,i.EMPTY_OBJECT),this._url=r.url,this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._proxy=r.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var c=r.credit;"string"==typeof c&&(c=new t(c)),this._credit=c,this._tilingScheme=void 0,this._rectangles=[];var h,_=this,y=i(r.ellipsoid,a.WGS84);u()}function C(e,t,i,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,i,n),l=0,u=0;u<a.length&&15!==l;++u){var c=a[u];if(!(c.maxLevel<=n)){var h=c.rectangle,d=m.intersection(h,s,S);r(d)&&(w(o,h,2*t,2*i,n+1)&&(l|=4),w(o,h,2*t+1,2*i,n+1)&&(l|=8),w(o,h,2*t,2*i+1,n+1)&&(l|=1),w(o,h,2*t+1,2*i+1,n+1)&&(l|=2))}}return l}function w(e,t,i,n,o){var a=e.tileXYToRectangle(i,n,o);return r(m.intersection(a,t,S))}n(y.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}}}),y.prototype.requestTileGeometry=function(t,n,o,a){var s=this._tilingScheme.getNumberOfYTilesAtLevel(o),l=this._url+o+"/"+t+"/"+(s-n-1)+".tif?cesium=true",d=this._proxy;r(d)&&(l=d.getURL(l));var p;if(a=i(a,!0)){if(p=_(l,h),!r(p))return}else p=h(l);var m=this;return e(p,function(e){return new c({buffer:u(e),width:m._heightmapWidth,height:m._heightmapHeight,childTileMask:C(m,t,n,o),structure:m._terrainDataStructure})})},y.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var S=new m;return y.prototype.getTileDataAvailable=function(e,t,i){},y}),i("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function l(i,r,n,o){var a=r.length;if(!(a<2)){var l=t(o),u=t(n),d=!0,p=new Array(a),m=new Array(a),f=new Array(a),_=r[0];p[0]=_;var g=i.cartesianToCartographic(_,c);u&&(g.height=n[0]),d=d&&g.height<=0,m[0]=g.height,l?f[0]=o[0]:f[0]=0;for(var v=1,y=1;y<a;++y){var C=r[y],w=i.cartesianToCartographic(C,h);u&&(w.height=n[y]),d=d&&w.height<=0,s(g,w)?g.height<w.height&&(m[v-1]=w.height):(p[v]=C,m[v]=w.height,l?f[v]=o[y]:f[v]=0,e.clone(w,g),++v)}if(!(d||v<2))return p.length=v,m.length=v,f.length=v,{positions:p,topHeights:m,bottomHeights:f}}}var u={},c=new e,h=new e,d=new Array(2),p=new Array(2),m={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return u.computePositions=function(e,s,u,c,h,f){var _=l(e,s,u,c);if(t(_)){if(s=_.positions,u=_.topHeights,c=_.bottomHeights,s.length>=3){var g=i.fromPoints(s,e),v=g.projectPointsOntoPlane(s);n.computeWindingOrder2D(v)===a.CLOCKWISE&&(s.reverse(),u.reverse(),c.reverse())}var y,C,w=s.length,S=w-2,E=r.chordLength(h,e.maximumRadius),b=m;if(b.minDistance=E,b.ellipsoid=e,f){var T,x=0;for(T=0;T<w-1;T++)x+=o.numberOfPoints(s[T],s[T+1],E)+1;y=new Float64Array(3*x),C=new Float64Array(3*x);var A=d,P=p;b.positions=A,b.height=P;var D=0;for(T=0;T<w-1;T++){A[0]=s[T],A[1]=s[T+1],P[0]=u[T],P[1]=u[T+1];var M=o.generateArc(b);y.set(M,D),P[0]=c[T],P[1]=c[T+1],C.set(o.generateArc(b),D),D+=M.length}}else b.positions=s,b.height=u,y=new Float64Array(o.generateArc(b)),b.height=c,C=new Float64Array(o.generateArc(b));return{bottomPositions:C,topPositions:y,numCorners:S}}},u}),i("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e=r(e,r.EMPTY_OBJECT);var i=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=r(e.vertexFormat,p.DEFAULT),u=r(e.granularity,h.RADIANS_PER_DEGREE),c=r(e.ellipsoid,a.WGS84);this._positions=i,this._minimumHeights=s,this._maximumHeights=o,this._vertexFormat=p.clone(l),this._granularity=u,this._ellipsoid=a.clone(c),this._workerName="createWallGeometry";var d=1+i.length*t.packedLength+2;n(s)&&(d+=s.length),n(o)&&(d+=o.length),this.packedLength=d+a.packedLength+p.packedLength+1}var _=new t,g=new t,v=new t,y=new t,C=new t,w=new t,S=new t,E=new t;f.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;s<u;++s)i[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,i[o++]=u,n(h))for(s=0;s<u;++s)i[o++]=h[s];return a.pack(e._ellipsoid,i,o),o+=a.packedLength,p.pack(e._vertexFormat,i,o),o+=p.packedLength,i[o]=e._granularity,i};var b=a.clone(a.UNIT_SPHERE),T=new p,x={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:b,vertexFormat:T,granularity:void 0};return f.unpack=function(e,i,o){i=r(i,0);var s,l=e[i++],u=new Array(l);for(s=0;s<l;++s,i+=t.packedLength)u[s]=t.unpack(e,i);l=e[i++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[i++];l=e[i++];var h;if(l>0)for(h=new Array(l),s=0;s<l;++s)h[s]=e[i++];var d=a.unpack(e,i,b);i+=a.packedLength;var m=p.unpack(e,i,T);i+=p.packedLength;var _=e[i];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=h,o._ellipsoid=a.clone(d,o._ellipsoid),o._vertexFormat=p.clone(m,o._vertexFormat),o._granularity=_,o):(x.positions=u,x.minimumHeights=c,x.maximumHeights=h,x.granularity=_,new f(x))},f.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,i,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,i=u?new Array(c):void 0;for(var h=0;h<c;++h)l&&(t[h]=a),u&&(i[h]=s)}var d={positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new f(d)},f.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,p=r._maximumHeights,f=r._vertexFormat,b=r._granularity,T=r._ellipsoid,x=m.computePositions(T,o,p,a,b,!0);if(n(x)){var A=x.bottomPositions,P=x.topPositions,D=x.numCorners,M=P.length,I=2*M,R=f.position?new Float64Array(I):void 0,O=f.normal?new Float32Array(I):void 0,N=f.tangent?new Float32Array(I):void 0,L=f.binormal?new Float32Array(I):void 0,B=f.st?new Float32Array(I/3*2):void 0,F=0,V=0,k=0,z=0,U=0,G=E,W=S,H=w,q=!0;M/=3;var j,Y=0,X=1/(M-o.length+1);for(j=0;j<M;++j){var Z=3*j,K=t.fromArray(P,Z,_),Q=t.fromArray(A,Z,g);if(f.position&&(R[F++]=Q.x,R[F++]=Q.y,R[F++]=Q.z,R[F++]=K.x,R[F++]=K.y,R[F++]=K.z),f.st&&(B[U++]=Y,B[U++]=0,B[U++]=Y,B[U++]=1),f.normal||f.tangent||f.binormal){var J,$=t.clone(t.ZERO,C),ee=T.scaleToGeodeticSurface(t.fromArray(P,Z,g),g);if(j+1<M&&(J=T.scaleToGeodeticSurface(t.fromArray(P,Z+3,v),v),$=t.fromArray(P,Z+3,C)),q){var te=t.subtract($,K,y),ie=t.subtract(ee,K,_);G=t.normalize(t.cross(ie,te,G),G),q=!1}t.equalsEpsilon(J,ee,h.EPSILON10)?q=!0:(Y+=X,f.tangent&&(W=t.normalize(t.subtract(J,ee,W),W)),f.binormal&&(H=t.normalize(t.cross(G,W,H),H))),f.normal&&(O[V++]=G.x,O[V++]=G.y,O[V++]=G.z,O[V++]=G.x,O[V++]=G.y,O[V++]=G.z),f.tangent&&(N[z++]=W.x,N[z++]=W.y,N[z++]=W.z,N[z++]=W.x,N[z++]=W.y,N[z++]=W.z),f.binormal&&(L[k++]=H.x,L[k++]=H.y,L[k++]=H.z,L[k++]=H.x,L[k++]=H.y,L[k++]=H.z)}}var re=new u;f.position&&(re.position=new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:R})),f.normal&&(re.normal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O})),f.tangent&&(re.tangent=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:N})),f.binormal&&(re.binormal=new l({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:L})),f.st&&(re.st=new l({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:B}));var ne=I/3;I-=6*(D+1);var oe=c.createTypedArray(ne,I),ae=0;for(j=0;j<ne-2;j+=2){var se=j,le=j+2,ue=t.fromArray(R,3*se,_),ce=t.fromArray(R,3*le,g);if(!t.equalsEpsilon(ue,ce,h.EPSILON10)){var he=j+1,de=j+3;oe[ae++]=he,oe[ae++]=se,oe[ae++]=de,oe[ae++]=de,oe[ae++]=se,oe[ae++]=le}}return new s({attributes:re,indices:oe,primitiveType:d.TRIANGLES,boundingSphere:new e.fromVertices(R)})}},f}),i("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e){e=r(e,r.EMPTY_OBJECT);var i=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=r(e.granularity,h.RADIANS_PER_DEGREE),u=r(e.ellipsoid,a.WGS84);this._positions=i,this._minimumHeights=s,this._maximumHeights=o,this._granularity=l,this._ellipsoid=a.clone(u),this._workerName="createWallOutlineGeometry";var c=1+i.length*t.packedLength+2;n(s)&&(c+=s.length),n(o)&&(c+=o.length),this.packedLength=c+a.packedLength+1}var f=new t,_=new t;m.pack=function(e,i,o){o=r(o,0);var s,l=e._positions,u=l.length;for(i[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],i,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,i[o++]=u,n(c))for(s=0;s<u;++s)i[o++]=c[s];var h=e._maximumHeights;if(u=n(h)?h.length:0,i[o++]=u,n(h))for(s=0;s<u;++s)i[o++]=h[s];return a.pack(e._ellipsoid,i,o),o+=a.packedLength,i[o]=e._granularity,i};var g=a.clone(a.UNIT_SPHERE),v={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:g,granularity:void 0};return m.unpack=function(e,i,o){i=r(i,0);var s,l=e[i++],u=new Array(l);for(s=0;s<l;++s,i+=t.packedLength)u[s]=t.unpack(e,i);l=e[i++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[i++];l=e[i++];var h;if(l>0)for(h=new Array(l),s=0;s<l;++s)h[s]=e[i++];var d=a.unpack(e,i,g);i+=a.packedLength;var p=e[i];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=h,o._ellipsoid=a.clone(d,o._ellipsoid),o._granularity=p,o):(v.positions=u,v.minimumHeights=c,v.maximumHeights=h,v.granularity=p,new m(v))},m.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,i,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,i=u?new Array(c):void 0;for(var h=0;h<c;++h)l&&(t[h]=a),u&&(i[h]=s)}var d={positions:o,maximumHeights:i,minimumHeights:t,ellipsoid:e.ellipsoid};return new m(d)},m.createGeometry=function(r){var o=r._positions,a=r._minimumHeights,m=r._maximumHeights,g=r._granularity,v=r._ellipsoid,y=p.computePositions(v,o,m,a,g,!1);if(n(y)){var C=y.bottomPositions,w=y.topPositions,S=w.length,E=2*S,b=new Float64Array(E),T=0;S/=3;var x;for(x=0;x<S;++x){var A=3*x,P=t.fromArray(w,A,f),D=t.fromArray(C,A,_);b[T++]=D.x,b[T++]=D.y,b[T++]=D.z,b[T++]=P.x,b[T++]=P.y,b[T++]=P.z}var M=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:b})}),I=E/3;E=2*I-4+I;var R=c.createTypedArray(I,E),O=0;for(x=0;x<I-2;x+=2){var N=x,L=x+2,B=t.fromArray(b,3*N,f),F=t.fromArray(b,3*L,_);if(!t.equalsEpsilon(B,F,h.EPSILON10)){var V=x+1,k=x+3;R[O++]=V,R[O++]=N,R[O++]=V,R[O++]=k,R[O++]=N,R[O++]=L}}return R[O++]=I-2,R[O++]=I-1,new s({attributes:M,indices:R,primitiveType:d.LINES,boundingSphere:new e.fromVertices(b)})}},m}),i("Core/WebMercatorTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Rectangle","./WebMercatorProjection"],function(e,t,i,r,n,o,a){"use strict";function s(r){if(r=t(r,{}),this._ellipsoid=t(r.ellipsoid,n.WGS84),this._numberOfLevelZeroTilesX=t(r.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=t(r.numberOfLevelZeroTilesY,1),this._projection=new a(this._ellipsoid),i(r.rectangleSouthwestInMeters)&&i(r.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=r.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=r.rectangleNortheastInMeters;else{var s=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new e(-s,-s),this._rectangleNortheastInMeters=new e(s,s)}var l=this._projection.unproject(this._rectangleSouthwestInMeters),u=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new o(l.longitude,l.latitude,u.longitude,u.latitude)}return r(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),s.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},s.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},s.prototype.rectangleToNativeRectangle=function(e,t){var r=this._projection,n=r.project(o.southwest(e)),a=r.project(o.northeast(e));return i(t)?(t.west=n.x,t.south=n.y,t.east=a.x,t.north=a.y,t):new o(n.x,n.y,a.x,a.y)},s.prototype.tileXYToNativeRectangle=function(e,t,r,n){var a=this.getNumberOfXTilesAtLevel(r),s=this.getNumberOfYTilesAtLevel(r),l=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/a,u=this._rectangleSouthwestInMeters.x+e*l,c=this._rectangleSouthwestInMeters.x+(e+1)*l,h=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,d=this._rectangleNortheastInMeters.y-t*h,p=this._rectangleNortheastInMeters.y-(t+1)*h;return i(n)?(n.west=u,n.south=p,n.east=c,n.north=d,n):new o(u,p,c,d)},s.prototype.tileXYToRectangle=function(t,i,r,n){var o=this.tileXYToNativeRectangle(t,i,r,n),a=this._projection,s=a.unproject(new e(o.west,o.south)),l=a.unproject(new e(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=l.longitude,o.north=l.latitude,o},s.prototype.positionToTileXY=function(t,r,n){var a=this._rectangle;if(o.contains(a,t)){var s=this.getNumberOfXTilesAtLevel(r),l=this.getNumberOfYTilesAtLevel(r),u=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,c=u/s,h=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,d=h/l,p=this._projection,m=p.project(t),f=m.x-this._rectangleSouthwestInMeters.x,_=this._rectangleNortheastInMeters.y-m.y,g=f/c|0;g>=s&&(g=s-1);var v=_/d|0;return v>=l&&(v=l-1),i(n)?(n.x=g,n.y=v,n):new e(g,v)}},s}),i("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,i){return function(){i.apply(e,arguments),t.apply(e,arguments)}}return t}),i("DataSources/ConstantProperty",["../Core/defined","../Core/defineProperties","../Core/Event"],function(e,t,i){"use strict";function r(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new i,this.setValue(e)}return t(r.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),r.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},r.prototype.setValue=function(t){var i=this._value;if(i!==t){var r=e(t),n=r&&"function"==typeof t.clone,o=r&&"function"==typeof t.equals;this._hasClone=n,this._hasEquals=o;var a=!o||!t.equals(i);a&&(this._value=n?t.clone():t,this._definitionChanged.raiseEvent(this))}},r.prototype.equals=function(e){return this===e||e instanceof r&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},r}),i("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,i){"use strict";function r(e,i,r,n,o){return{configurable:n,get:function(){return this[i]},set:function(n){var a=this[i],s=this[r];t(s)&&(s(),this[r]=void 0);var l=t(n);l&&!t(n.getValue)&&t(o)&&(n=o(n)),a!==n&&(this[i]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[r]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new i(e)}function o(t,i,o){return r(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(i,!1),e(o,n))}return o}),i("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._image=void 0,this._imageSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),imageSubRegion:o("imageSubRegion"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,e.heightReference=this._heightReference,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.imageSubRegion=this._imageSubRegion,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.sizeInMeters=this._sizeInMeters,e.distanceDisplayCondition=this._distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.heightReference=e(this._heightReference,t.heightReference),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.image=e(this._image,t.image),this.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.scale=e(this._scale,t.scale),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.show=e(this._show,t.show),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.width=e(this._width,t.width),this.height=e(this._height,t.height),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters),this.distanceDisplayCondition=e(this._distanceDisplayCondition,t.distanceDisplayCondition)},a}),i("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2};return e(t)}),i("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,LEFT:1,RIGHT:-1};return e(t)}),i("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};return e(t)}),i("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";var t={DONE:0,PENDING:1,FAILED:2};return e(t)}),i("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i,r){"use strict";function n(){r.throwInstantiationError()}return i(n.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError
}}),n.prototype.getValue=r.throwInstantiationError,n.prototype.equals=r.throwInstantiationError,n.equals=function(e,i){return e===i||t(e)&&e.equals(i)},n.arrayEquals=function(e,i){if(e===i)return!0;if(!t(e)||!t(i)||e.length!==i.length)return!1;for(var r=e.length,o=0;o<r;o++)if(!n.equals(e[o],i[o]))return!1;return!0},n.isConstant=function(e){return!t(e)||e.isConstant},n.getValueOrUndefined=function(e,i,r){return t(e)?e.getValue(i,r):void 0},n.getValueOrDefault=function(i,r,n,o){return t(i)?e(i.getValue(r,o),n):n},n.getValueOrClonedDefault=function(e,i,r,n){var o;return t(e)&&(o=e.getValue(i,n)),t(o)||(o=r.clone(o)),o},n}),i("DataSources/BillboardVisualizer",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function _(t,i){i.collectionChanged.addEventListener(_.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function g(e,t,i){o(e)&&(e.billboard=void 0,i.removeBillboard(t))}var v=n.WHITE,y=r.ZERO,C=c.NONE,w=i.ZERO,S=1,E=0,b=r.ZERO,T=h.CENTER,x=d.CENTER,A=!1,P=new r,D=new n,M=new r,I=new i,R=new u,O=new u,N=new u,L=new t,B=new l;return _.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,s=t[r],l=s.entity,u=l._billboard,c=s.billboard,h=l.isShowing&&l.isAvailable(e)&&m.getValueOrDefault(u._show,e,!0);if(h&&(P=m.getValueOrUndefined(l._position,e,P),a=m.getValueOrUndefined(u._image,e),h=o(P)&&o(a)),h){m.isConstant(l._position)||(i._clusterDirty=!0),o(c)||(c=i.getBillboard(l),c.id=l,c.image=void 0,s.billboard=c),c.show=h,o(c.image)&&s.textureValue===a||(c.image=a,s.textureValue=a),c.position=P,c.color=m.getValueOrDefault(u._color,e,v,D),c.eyeOffset=m.getValueOrDefault(u._eyeOffset,e,y,M),c.heightReference=m.getValueOrDefault(u._heightReference,e,C),c.pixelOffset=m.getValueOrDefault(u._pixelOffset,e,w,I),c.scale=m.getValueOrDefault(u._scale,e,S),c.rotation=m.getValueOrDefault(u._rotation,e,E),c.alignedAxis=m.getValueOrDefault(u._alignedAxis,e,b),c.horizontalOrigin=m.getValueOrDefault(u._horizontalOrigin,e,T),c.verticalOrigin=m.getValueOrDefault(u._verticalOrigin,e,x),c.width=m.getValueOrUndefined(u._width,e),c.height=m.getValueOrUndefined(u._height,e),c.scaleByDistance=m.getValueOrUndefined(u._scaleByDistance,e,R),c.translucencyByDistance=m.getValueOrUndefined(u._translucencyByDistance,e,O),c.pixelOffsetScaleByDistance=m.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,N),c.sizeInMeters=m.getValueOrDefault(u._sizeInMeters,A),c.distanceDisplayCondition=m.getValueOrUndefined(u._distanceDisplayCondition,e,B);var d=m.getValueOrUndefined(u._imageSubRegion,e,L);o(d)&&c.setImageSubRegion(c._imageId,d)}else g(s,l,i)}return!0},_.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);if(!o(i)||!o(i.billboard))return p.FAILED;var n=i.billboard;if(n.heightReference===c.NONE)t.center=r.clone(n.position,t.center);else{if(!o(n._clampedPosition))return p.PENDING;t.center=r.clone(n._clampedPosition,t.center)}return t.radius=0,p.DONE},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return a(this)},_.prototype._onCollectionChanged=function(e,t,i,r){var n,a,s=this._items,l=this._cluster;for(n=t.length-1;n>-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&s.set(a.id,new f(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._billboard)&&o(a._position)?s.contains(a.id)||s.set(a.id,new f(a)):(g(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],g(s.get(a.id),a,l),s.remove(a.id)},_}),i("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_binormalEC);\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 binormal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_binormalEC = czm_normal * binormal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);;\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/BlendEquation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT};return e(i)}),i("Scene/BlendFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,ONE:t.ONE,SOURCE_COLOR:t.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:t.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:t.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:t.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:t.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:t.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:t.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:t.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:t.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:t.ONE_MINUS_CONSTANT_ALPHA,CONSTANT_ALPHA:t.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:t.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:t.SRC_ALPHA_SATURATE};return e(i)}),i("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,i){"use strict";var r={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.ONE,functionSourceAlpha:i.ONE,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE,functionDestinationAlpha:i.ONE})};return e(r)}),i("Scene/CullFace",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK};return e(i)}),i("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=i(e,i.EMPTY_OBJECT),this.material=e.material,this.translucent=i(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=i(e.closed,!1)}return n(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}}),s.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),r(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),i=e(this.renderState,!1);return t?(i.depthMask=!1,i.blending=o.ALPHA_BLEND):i.depthMask=!0,i},s.getDefaultRenderState=function(e,i,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),i&&(s.cull={enabled:!0,face:a.BACK}),r(n)&&(s=t(n,s,!0)),s},s}),i("Renderer/ContextLimits",["../Core/defineProperties"],function(e){"use strict";var t={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};return e(t,{maximumCombinedTextureImageUnits:{get:function(){return t._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return t._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return t._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return t._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return t._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return t._maximumTextureSize}},maximumVaryingVectors:{get:function(){return t._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return t._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return t._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return t._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return t._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return t._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return t._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return t._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return t._maximumViewportWidth}},maximumViewportHeight:{get:function(){return t._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return t._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return t._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return t._maximumColorAttachments}},highpFloatSupported:{get:function(){return t._highpFloatSupported}},highpIntSupported:{get:function(){return t._highpIntSupported}}}),t}),i("Renderer/PixelDatatype",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.UNSIGNED_INT,FLOAT:t.FLOAT,UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:t.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:t.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:t.UNSIGNED_SHORT_5_6_5,validate:function(e){return e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.UNSIGNED_INT_24_8||e===i.UNSIGNED_SHORT_4_4_4_4||e===i.UNSIGNED_SHORT_5_5_5_1||e===i.UNSIGNED_SHORT_5_6_5}};return e(i)}),i("Renderer/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,i,r){"use strict";function n(e,t,i,r,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=i,this._targetFace=r,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return t(n.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),n.prototype.copyFrom=function(t,i,r){i=e(i,0),r=e(r,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,i,r,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,i,r,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},n.prototype.copyFromFramebuffer=function(t,i,r,n,o,a){t=e(t,0),i=e(i,0),r=e(r,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,i,r,n,o,a),s.bindTexture(l,null)},n}),i("Renderer/MipmapHint",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===i.DONT_CARE||e===i.FASTEST||e===i.NICEST}};return e(i)}),i("Renderer/TextureMagnificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR}};return e(i)}),i("Renderer/TextureMinificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,NEAREST_MIPMAP_NEAREST:t.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:t.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:t.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:t.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR||e===i.NEAREST_MIPMAP_NEAREST||e===i.LINEAR_MIPMAP_NEAREST||e===i.NEAREST_MIPMAP_LINEAR||e===i.LINEAR_MIPMAP_LINEAR}};return e(i)}),i("Renderer/TextureWrap",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===i.CLAMP_TO_EDGE||e===i.REPEAT||e===i.MIRRORED_REPEAT}};return e(i)}),i("Renderer/Sampler",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.wrapS,a.CLAMP_TO_EDGE),s=e(i.wrapT,a.CLAMP_TO_EDGE),l=e(i.minificationFilter,o.LINEAR),u=e(i.magnificationFilter,n.LINEAR),c=t(i.maximumAnisotropy)?i.maximumAnisotropy:1;this._wrapS=r,this._wrapT=s,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return i(s.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),s}),i("Renderer/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(i){function r(e,t){t.arrayBufferView?v.texImage2D(e,0,m,p,p,0,m,f,t.arrayBufferView):v.texImage2D(e,0,m,m,f,t)}i=e(i,e.EMPTY_OBJECT);var n,o,s=i.context,u=i.source;if(t(u)){var d=[u.positiveX,u.negativeX,u.positiveY,u.negativeY,u.positiveZ,u.negativeZ];n=d[0].width,o=d[0].height}else n=i.width,o=i.height;var p=n,m=e(i.pixelFormat,a.RGBA),f=e(i.pixelDatatype,c.UNSIGNED_BYTE),_=i.preMultiplyAlpha||m===a.RGB||m===a.LUMINANCE,g=e(i.flipY,!0),v=s._gl,y=v.TEXTURE_CUBE_MAP,C=v.createTexture();v.activeTexture(v.TEXTURE0),v.bindTexture(y,C),t(u)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,g),r(v.TEXTURE_CUBE_MAP_POSITIVE_X,u.positiveX),r(v.TEXTURE_CUBE_MAP_NEGATIVE_X,u.negativeX),r(v.TEXTURE_CUBE_MAP_POSITIVE_Y,u.positiveY),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,u.negativeY),r(v.TEXTURE_CUBE_MAP_POSITIVE_Z,u.positiveZ),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,u.negativeZ)):(v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_X,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_X,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Y,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Z,0,m,p,p,0,m,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,m,p,p,0,m,f,null)),v.bindTexture(y,null),this._gl=v,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=m,this._pixelDatatype=f,this._size=p,this._preMultiplyAlpha=_,this._flipY=g,this._sampler=void 0,this._positiveX=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_X,m,f,p,_,g),this._negativeX=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_X,m,f,p,_,g),this._positiveY=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Y,m,f,p,_,g),this._negativeY=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Y,m,f,p,_,g),this._positiveZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Z,m,f,p,_,g),this._negativeZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Z,m,f,p,_,g),this.sampler=t(i.sampler)?i.sampler:new h}return i(m.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var i=e.minificationFilter,r=e.magnificationFilter,n=i===p.NEAREST_MIPMAP_NEAREST||i===p.NEAREST_MIPMAP_LINEAR||i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(i=n?p.NEAREST_MIPMAP_NEAREST:p.NEAREST,r=d.NEAREST);var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,i),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),m.prototype.generateMipmap=function(t){t=e(t,u.DONT_CARE);var i=this._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,t),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},m}),i("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/WebGLConstants","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(r){r=t(r,t.EMPTY_OBJECT);var n=r.context,o=r.width,a=r.height,u=r.source;i(u)&&(i(o)||(o=t(u.videoWidth,u.width)),i(a)||(a=t(u.videoHeight,u.height)));var c=t(r.pixelFormat,s.RGBA),p=t(r.pixelDatatype,h.UNSIGNED_BYTE),m=c;n.webgl2&&(c===s.DEPTH_STENCIL?m=l.DEPTH24_STENCIL8:c===s.DEPTH_COMPONENT&&(p===h.UNSIGNED_SHORT?m=l.DEPTH_COMPONENT16:p===h.UNSIGNED_INT&&(m=l.DEPTH_COMPONENT24)));var f=r.preMultiplyAlpha||c===s.RGB||c===s.LUMINANCE,_=t(r.flipY,!0),g=n._gl,v=g.TEXTURE_2D,y=g.createTexture();g.activeTexture(g.TEXTURE0),g.bindTexture(v,y),i(u)?(g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,f),g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,_),i(u.arrayBufferView)?g.texImage2D(v,0,m,o,a,0,c,p,u.arrayBufferView):i(u.framebuffer)?(u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._bind(),g.copyTexImage2D(v,0,m,u.xOffset,u.yOffset,o,a,0),u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._unBind()):g.texImage2D(v,0,m,c,p,u)):g.texImage2D(v,0,m,o,a,0,c,p,null),g.bindTexture(v,null),this._context=n,this._textureFilterAnisotropic=n._textureFilterAnisotropic,this._textureTarget=v,this._texture=y,this._pixelFormat=c,this._pixelDatatype=p,this._width=o,this._height=a,this._dimensions=new e(o,a),this._preMultiplyAlpha=f,this._flipY=_,this._sampler=void 0,this.sampler=i(r.sampler)?r.sampler:new d}return f.fromFramebuffer=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.context,n=r._gl,o=t(e.pixelFormat,s.RGB),a=t(e.framebufferXOffset,0),l=t(e.framebufferYOffset,0),u=t(e.width,n.drawingBufferWidth),c=t(e.height,n.drawingBufferHeight),h=e.framebuffer,d=new f({context:r,width:u,height:c,pixelFormat:o,source:{framebuffer:i(h)?h:r.defaultFramebuffer,xOffset:a,yOffset:l,width:u,height:c}});return d},r(f.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,n=t===m.NEAREST_MIPMAP_NEAREST||t===m.NEAREST_MIPMAP_LINEAR||t===m.LINEAR_MIPMAP_NEAREST||t===m.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===h.FLOAT&&(t=n?m.NEAREST_MIPMAP_NEAREST:m.NEAREST,r=p.NEAREST);var o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,t),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),i(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},_target:{get:function(){return this._textureTarget}}}),f.prototype.copyFrom=function(e,i,r){i=t(i,0),r=t(r,0);var n=this._context._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,i,r,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,i,r,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},f.prototype.copyFromFramebuffer=function(e,i,r,n,o,a){e=t(e,0),i=t(i,0),r=t(r,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._context._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,i,r,n,o,a),s.bindTexture(l,null)},f.prototype.generateMipmap=function(e){e=t(e,c.DONT_CARE);var i=this._context._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,e),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},f}),i("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),i("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q  = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_resolutionScale) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),i("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n";
}),i("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#extension GL_OES_standard_derivatives : enable\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth =  0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),i("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),i("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),i("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),i("Scene/Material",["../Core/Cartesian2","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/loadImage","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D){"use strict";function M(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,I(e,this),s(this,{type:{value:this.type,writable:!1}}),a(M._uniformList[this.type])||(M._uniformList[this.type]=Object.keys(this._uniforms))}function I(e,i){e=o(e,o.EMPTY_OBJECT),i._strict=o(e.strict,!1),i._count=o(e.count,0),i._template=t(o(e.fabric,o.EMPTY_OBJECT)),i._template.uniforms=t(o(i._template.uniforms,o.EMPTY_OBJECT)),i._template.materials=t(o(i._template.materials,o.EMPTY_OBJECT)),i.type=a(i._template.type)?i._template.type:n(),i.shaderSource="",i.materials={},i.uniforms={},i._uniforms={},i._translucentFunctions=[];var s,l=M._materialCache.getMaterial(i.type);if(a(l)){var u=t(l.fabric,!0);i._template=r(i._template,u,!0),s=l.translucent}L(i),a(l)||M._materialCache.addMaterial(i.type,i),B(i),k(i),G(i);var c=0===i._translucentFunctions.length||void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var h=function(){return s(i)};i._translucentFunctions.push(h)}else i._translucentFunctions.push(s)}function R(e,t,i,r){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=t.indexOf(n)!==-1;(r&&!o||!r&&o)&&i(n,t)}}function O(e,t){}function N(e,t){}function L(e){var t=e._template,i=t.uniforms,r=t.materials,n=t.components;R(t,q,O,!0),R(n,j,O,!0);var o=[];for(var a in r)r.hasOwnProperty(a)&&o.push(a);R(i,o,N,!1)}function B(e){var t=e._template.components,i=e._template.source;if(a(i))e.shaderSource+=i+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",a(t))for(var r in t)t.hasOwnProperty(r)&&(e.shaderSource+="material."+r+" = "+t[r]+";\n");e.shaderSource+="return material;\n}\n"}}function F(e){var t;return function(i,r){var n=i.uniforms,o=n[e],s=t!==o;t=o;var l,u,c=i._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(s&&a(c)&&(c!==r.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===r.defaultTexture)return c=new _({context:r,source:o}),void(i._textures[e]=c);c.copyFrom(o)}else a(c)||(i._textures[e]=r.defaultTexture);else{if(o instanceof _&&o!==c){i._texturePaths[e]=void 0;var d=i._textures[e];return d!==i._defaultTexture&&d.destroy(),i._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}a(c)||(i._texturePaths[e]=void 0,a(i._defaultTexture)||(i._defaultTexture=r.defaultTexture),c=i._textures[e]=i._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==M.DefaultImageId&&o!==i._texturePaths[e]&&("string"==typeof o?D(h(o),function(t){i._loadedImages.push({id:e,image:t})}):o instanceof HTMLCanvasElement&&i._loadedImages.push({id:e,image:o}),i._texturePaths[e]=o)}}}function V(e){return function(t,i){var r=t.uniforms[e];if(r instanceof f){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=r)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=i.defaultCubeMap),r!==M.DefaultCubeMapId){var o=r.positiveX+r.negativeX+r.positiveY+r.negativeY+r.positiveZ+r.negativeZ;if(o!==t._texturePaths[e]){var s=[h(r.positiveX),h(r.negativeX),h(r.positiveY),h(r.negativeY),h(r.positiveZ),h(r.negativeZ)];D.all(s).then(function(i){t._loadedCubeMaps.push({id:e,images:i})}),t._texturePaths[e]=o}}}}function k(e){var t=e._template.uniforms;for(var i in t)t.hasOwnProperty(i)&&z(e,i)}function z(e,t){var i,r=(e._strict,e._template.uniforms),n=r[t],o=U(n);if("channels"===o)i=W(e,t,n,!1);else{if("sampler2D"===o){var a=t+"Dimensions";H(e,a)>0&&(r[a]={type:"ivec3",x:1,y:1},z(e,a))}var s=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!s.test(e.shaderSource)){var l="uniform "+o+" "+t+";";e.shaderSource=l+e.shaderSource}var u=t+"_"+e._count++;if(i=W(e,t,u),e.uniforms[t]=n,"sampler2D"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(F(t));else if("samplerCube"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if(o.indexOf("mat")!==-1){var c=new Y[o];e._uniforms[u]=function(){return Y[o].fromColumnMajorArray(e.uniforms[t],c)}}else e._uniforms[u]=function(){return e.uniforms[t]}}}function U(e){var t=e.type;if(!a(t)){var i=typeof e;if("number"===i)t="float";else if("boolean"===i)t="bool";else if("string"===i||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===M.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===i)if(c(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{var r=0;for(var n in e)e.hasOwnProperty(n)&&(r+=1);r>=2&&r<=4?t="vec"+r:6===r&&(t="samplerCube")}}return t}function G(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new M({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=r(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial",s=a+"_"+e._count++;W(o,a,s),e.shaderSource=o.shaderSource+e.shaderSource;var l=s+"(materialInput)";W(e,n,l)}}function W(e,t,i,r){r=o(r,!0);var n=0,a="([\\w])?",s="([\\w"+(r?".":"")+"])?",l=new RegExp(s+t+a,"g");return e.shaderSource=e.shaderSource.replace(l,function(e,t,r){return t||r?e:(n+=1,i)}),n}function H(e,t,i){return W(e,t,t,i)}M._uniformList={},M.fromType=function(e,t){var i=new M({fabric:{type:e}});if(a(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},M.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,i=t.length,r=0;r<i;++r){var n=t[r];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},M.prototype.update=function(e){var t,i,r=this._loadedImages,n=r.length;for(t=0;t<n;++t){var o=r[t];i=o.id;var a=o.image,s=new _({context:e,source:a});this._textures[i]=s;var l=i+"Dimensions";if(this.uniforms.hasOwnProperty(l)){var u=this.uniforms[l];u.x=s._width,u.y=s._height}}r.length=0;var c=this._loadedCubeMaps;for(n=c.length,t=0;t<n;++t){var h=c[t];i=h.id;var d=h.images,p=new f({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]}});this._textures[i]=p}c.length=0;var m=this._updateFunctions;for(n=m.length,t=0;t<n;++t)m[t](this,e);var g=this.materials;for(var v in g)g.hasOwnProperty(v)&&g[v].update(e)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._textures;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];i!==this._defaultTexture&&i.destroy()}var r=this.materials;for(var n in r)r.hasOwnProperty(n)&&r[n].destroy();return l(this)};var q=["type","materials","uniforms","components","source"],j=["diffuse","specular","shininess","normal","emission","alpha"],Y={mat2:d,mat3:p,mat4:m};return M._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},M.DefaultImageId="czm_defaultImage",M.DefaultCubeMapId="czm_defaultCubeMap",M.ColorType="Color",M._materialCache.addMaterial(M.ColorType,{fabric:{type:M.ColorType,uniforms:{color:new i(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),M.ImageType="Image",M._materialCache.addMaterial(M.ImageType,{fabric:{type:M.ImageType,uniforms:{image:M.DefaultImageId,repeat:new e(1,1),color:new i(1,1,1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),M.DiffuseMapType="DiffuseMap",M._materialCache.addMaterial(M.DiffuseMapType,{fabric:{type:M.DiffuseMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),M.AlphaMapType="AlphaMap",M._materialCache.addMaterial(M.AlphaMapType,{fabric:{type:M.AlphaMapType,uniforms:{image:M.DefaultImageId,channel:"a",repeat:new e(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),M.SpecularMapType="SpecularMap",M._materialCache.addMaterial(M.SpecularMapType,{fabric:{type:M.SpecularMapType,uniforms:{image:M.DefaultImageId,channel:"r",repeat:new e(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),M.EmissionMapType="EmissionMap",M._materialCache.addMaterial(M.EmissionMapType,{fabric:{type:M.EmissionMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),M.BumpMapType="BumpMap",M._materialCache.addMaterial(M.BumpMapType,{fabric:{type:M.BumpMapType,uniforms:{image:M.DefaultImageId,channel:"r",strength:.8,repeat:new e(1,1)},source:g},translucent:!1}),M.NormalMapType="NormalMap",M._materialCache.addMaterial(M.NormalMapType,{fabric:{type:M.NormalMapType,uniforms:{image:M.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:S},translucent:!1}),M.GridType="Grid",M._materialCache.addMaterial(M.GridType,{fabric:{type:M.GridType,uniforms:{color:new i(0,1,0,1),cellAlpha:.1,lineCount:new e(8,8),lineThickness:new e(1,1),lineOffset:new e(0,0)},source:w},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),M.StripeType="Stripe",M._materialCache.addMaterial(M.StripeType,{fabric:{type:M.StripeType,uniforms:{horizontal:!0,evenColor:new i(1,1,1,.5),oddColor:new i(0,0,1,.5),offset:0,repeat:5},source:A},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<0}}),M.CheckerboardType="Checkerboard",M._materialCache.addMaterial(M.CheckerboardType,{fabric:{type:M.CheckerboardType,uniforms:{lightColor:new i(1,1,1,.5),darkColor:new i(0,0,0,.5),repeat:new e(5,5)},source:v},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),M.DotType="Dot",M._materialCache.addMaterial(M.DotType,{fabric:{type:M.DotType,uniforms:{lightColor:new i(1,1,0,.75),darkColor:new i(0,1,1,.75),repeat:new e(5,5)},source:y},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<0}}),M.WaterType="Water",M._materialCache.addMaterial(M.WaterType,{fabric:{type:M.WaterType,uniforms:{baseWaterColor:new i(.2,.3,.6,1),blendColor:new i(0,1,.699,1),specularMap:M.DefaultImageId,normalMap:M.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:P},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<0}}),M.RimLightingType="RimLighting",M._materialCache.addMaterial(M.RimLightingType,{fabric:{type:M.RimLightingType,uniforms:{color:new i(1,0,0,.7),rimColor:new i(1,1,1,.4),width:.3},source:x},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<0}}),M.FadeType="Fade",M._materialCache.addMaterial(M.FadeType,{fabric:{type:M.FadeType,uniforms:{fadeInColor:new i(1,0,0,1),fadeOutColor:new i(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new e(.5,.5)},source:C},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<0}}),M.PolylineArrowType="PolylineArrow",M._materialCache.addMaterial(M.PolylineArrowType,{fabric:{type:M.PolylineArrowType,uniforms:{color:new i(1,1,1,1)},source:E},translucent:!0}),M.PolylineGlowType="PolylineGlow",M._materialCache.addMaterial(M.PolylineGlowType,{fabric:{type:M.PolylineGlowType,uniforms:{color:new i(0,.5,1,1),glowPower:.25},source:b},translucent:!0}),M.PolylineOutlineType="PolylineOutline",M._materialCache.addMaterial(M.PolylineOutlineType,{fabric:{type:M.PolylineOutlineType,uniforms:{color:new i(1,1,1,1),outlineColor:new i(1,0,0,1),outlineWidth:1},source:T},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),M}),i("Scene/MaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/freezeObject","../Core/VertexFormat","../Shaders/Appearances/AllMaterialAppearanceFS","../Shaders/Appearances/AllMaterialAppearanceVS","../Shaders/Appearances/BasicMaterialAppearanceFS","../Shaders/Appearances/BasicMaterialAppearanceVS","../Shaders/Appearances/TexturedMaterialAppearanceFS","../Shaders/Appearances/TexturedMaterialAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=e(i.closed,!1),o=e(i.materialSupport,p.MaterialSupport.TEXTURED);this.material=t(i.material)?i.material:d.fromType(d.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,o.vertexShaderSource),this._fragmentShaderSource=e(i.fragmentShaderSource,o.fragmentShaderSource),this._renderState=h.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,!n)}return i(p.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),p.prototype.getFragmentShaderSource=h.prototype.getFragmentShaderSource,p.prototype.isTranslucent=h.prototype.isTranslucent,p.prototype.getRenderState=h.prototype.getRenderState,p.MaterialSupport={BASIC:r({vertexFormat:n.POSITION_AND_NORMAL,vertexShaderSource:l,fragmentShaderSource:s}),TEXTURED:r({vertexFormat:n.POSITION_NORMAL_AND_ST,vertexShaderSource:c,fragmentShaderSource:u}),ALL:r({vertexFormat:n.ALL,vertexShaderSource:a,fragmentShaderSource:o})},p}),i("Shaders/Appearances/PerInstanceColorAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = v_color.rgb;\nmaterial.alpha = v_color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n}\n"}),i("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),i("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),h=c?a:n,d=c?o:r,p=c?l.FLAT_VERTEX_FORMAT:l.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,h),this._fragmentShaderSource=e(t.fragmentShaderSource,d),this._renderState=s.getDefaultRenderState(i,u,t.renderState),this._closed=u,this._vertexFormat=p,this._flat=c,this._faceForward=e(t.faceForward,!u)}return t(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}}),l.VERTEX_FORMAT=i.POSITION_AND_NORMAL,l.FLAT_VERTEX_FORMAT=i.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),i("Renderer/BufferUsage",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={STREAM_DRAW:t.STREAM_DRAW,STATIC_DRAW:t.STATIC_DRAW,DYNAMIC_DRAW:t.DYNAMIC_DRAW,validate:function(e){return e===i.STREAM_DRAW||e===i.STATIC_DRAW||e===i.DYNAMIC_DRAW}};return e(i)}),i("Renderer/DrawCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/PrimitiveType"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._cull=e(t.cull,!0),this._modelMatrix=t.modelMatrix,this._primitiveType=e(t.primitiveType,r.TRIANGLES),this._vertexArray=t.vertexArray,this._count=t.count,this._offset=e(t.offset,0),this._instanceCount=e(t.instanceCount,0),this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._executeInClosestFrustum=e(t.executeInClosestFrustum,!1),this._owner=t.owner,this._debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this._debugOverlappingFrustums=0,this._castShadows=e(t.castShadows,!1),this._receiveShadows=e(t.receiveShadows,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}return i(n.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return this._cull},set:function(e){this._cull!==e&&(this._cull=e,this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return this._castShadows},set:function(e){this._castShadows!==e&&(this._castShadows=e,this.dirty=!0)}},receiveShadows:{get:function(){return this._receiveShadows},set:function(e){this._receiveShadows!==e&&(this._receiveShadows=e,this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return this._executeInClosestFrustum},set:function(e){this._executeInClosestFrustum!==e&&(this._executeInClosestFrustum=e,this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}}}),n.shallowClone=function(e,i){if(t(e))return t(i)||(i=new n),i._boundingVolume=e._boundingVolume,i._orientedBoundingBox=e._orientedBoundingBox,i._cull=e._cull,i._modelMatrix=e._modelMatrix,i._primitiveType=e._primitiveType,i._vertexArray=e._vertexArray,i._count=e._count,i._offset=e._offset,i._instanceCount=e._instanceCount,i._shaderProgram=e._shaderProgram,i._uniformMap=e._uniformMap,i._renderState=e._renderState,i._framebuffer=e._framebuffer,i._pass=e._pass,i._executeInClosestFrustum=e._executeInClosestFrustum,i._owner=e._owner,i._debugShowBoundingVolume=e._debugShowBoundingVolume,i._debugOverlappingFrustums=e._debugOverlappingFrustums,i._castShadows=e._castShadows,i._receiveShadows=e._receiveShadows,i.dirty=!0,i.lastDirtyTime=0,i},n.prototype.execute=function(e,t){e.draw(this,t)},n}),i("Renderer/Pass",["../Core/freezeObject"],function(e){"use strict";var t={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,GROUND:3,OPAQUE:4,TRANSLUCENT:5,OVERLAY:6,NUMBER_OF_PASSES:7};return e(t)}),i("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/WebGLConstants","../Core/WindingOrder","./ContextLimits"],function(e,t,i,r,n,o,a,s){"use strict";function l(n){var s=i(n,{}),l=i(s.cull,{}),u=i(s.polygonOffset,{}),c=i(s.scissorTest,{}),h=i(c.rectangle,{}),d=i(s.depthRange,{}),p=i(s.depthTest,{}),m=i(s.colorMask,{}),f=i(s.blending,{}),_=i(f.color,{}),g=i(s.stencilTest,{}),v=i(g.frontOperation,{}),y=i(g.backOperation,{}),C=i(s.sampleCoverage,{}),w=s.viewport;this.frontFace=i(s.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:i(l.enabled,!1),face:i(l.face,o.BACK)},this.lineWidth=i(s.lineWidth,1),this.polygonOffset={enabled:i(u.enabled,!1),factor:i(u.factor,0),units:i(u.units,0)},this.scissorTest={enabled:i(c.enabled,!1),rectangle:e.clone(h)},this.depthRange={near:i(d.near,0),far:i(d.far,1)},this.depthTest={enabled:i(p.enabled,!1),func:i(p.func,o.LESS)},this.colorMask={red:i(m.red,!0),green:i(m.green,!0),blue:i(m.blue,!0),alpha:i(m.alpha,!0)},this.depthMask=i(s.depthMask,!0),this.stencilMask=i(s.stencilMask,-1),this.blending={enabled:i(f.enabled,!1),color:new t(i(_.red,0),i(_.green,0),i(_.blue,0),i(_.alpha,0)),equationRgb:i(f.equationRgb,o.FUNC_ADD),equationAlpha:i(f.equationAlpha,o.FUNC_ADD),functionSourceRgb:i(f.functionSourceRgb,o.ONE),functionSourceAlpha:i(f.functionSourceAlpha,o.ONE),functionDestinationRgb:i(f.functionDestinationRgb,o.ZERO),functionDestinationAlpha:i(f.functionDestinationAlpha,o.ZERO)},this.stencilTest={enabled:i(g.enabled,!1),frontFunction:i(g.frontFunction,o.ALWAYS),backFunction:i(g.backFunction,o.ALWAYS),reference:i(g.reference,0),mask:i(g.mask,-1),frontOperation:{fail:i(v.fail,o.KEEP),zFail:i(v.zFail,o.KEEP),zPass:i(v.zPass,o.KEEP)},backOperation:{fail:i(y.fail,o.KEEP),zFail:i(y.zFail,o.KEEP),zPass:i(y.zPass,o.KEEP)}},this.sampleCoverage={enabled:i(C.enabled,!1),value:i(C.value,1),invert:i(C.invert,!1)},this.viewport=r(w)?new e(w.x,w.y,w.width,w.height):void 0,this.id=0,this._applyFunctions=[]}function u(e,t,i){i?e.enable(t):e.disable(t)}function c(e,t){e.frontFace(t.frontFace)}function h(e,t){var i=t.cull,r=i.enabled;u(e,e.CULL_FACE,r),r&&e.cullFace(i.face)}function d(e,t){e.lineWidth(t.lineWidth)}function p(e,t){var i=t.polygonOffset,r=i.enabled;u(e,e.POLYGON_OFFSET_FILL,r),r&&e.polygonOffset(i.factor,i.units)}function m(e,t,i){var n=t.scissorTest,o=r(i.scissorTest)?i.scissorTest.enabled:n.enabled;if(u(e,e.SCISSOR_TEST,o),o){var a=r(i.scissorTest)?i.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function f(e,t){var i=t.depthRange;e.depthRange(i.near,i.far)}function _(e,t){var i=t.depthTest,r=i.enabled;u(e,e.DEPTH_TEST,r),r&&e.depthFunc(i.func)}function g(e,t){var i=t.colorMask;e.colorMask(i.red,i.green,i.blue,i.alpha)}function v(e,t){e.depthMask(t.depthMask)}function y(e,t){e.stencilMask(t.stencilMask)}function C(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha);
}function w(e,t,i){var n=t.blending,o=r(i.blendingEnabled)?i.blendingEnabled:n.enabled;u(e,e.BLEND,o),o&&(C(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function S(e,t){var i=t.stencilTest,r=i.enabled;if(u(e,e.STENCIL_TEST,r),r){var n=i.frontFunction,o=i.backFunction,a=i.reference,s=i.mask;e.stencilFunc(n,a,s),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=i.frontOperation,c=l.fail,h=l.zFail,d=l.zPass;e.stencilOpSeparate(e.FRONT,c,h,d);var p=i.backOperation,m=p.fail,f=p.zFail,_=p.zPass;e.stencilOpSeparate(e.BACK,m,f,_)}}function E(e,t){var i=t.sampleCoverage,r=i.enabled;u(e,e.SAMPLE_COVERAGE,r),r&&e.sampleCoverage(i.value,i.invert)}function b(e,t,n){var o=i(t.viewport,n.viewport);r(o)||(o=P,o.width=n.context.drawingBufferWidth,o.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=o,e.viewport(o.x,o.y,o.width,o.height)}function T(e,t){var i=[];return e.frontFace!==t.frontFace&&i.push(c),e.cull.enabled===t.cull.enabled&&e.cull.face===t.cull.face||i.push(h),e.lineWidth!==t.lineWidth&&i.push(d),e.polygonOffset.enabled===t.polygonOffset.enabled&&e.polygonOffset.factor===t.polygonOffset.factor&&e.polygonOffset.units===t.polygonOffset.units||i.push(p),e.depthRange.near===t.depthRange.near&&e.depthRange.far===t.depthRange.far||i.push(f),e.depthTest.enabled===t.depthTest.enabled&&e.depthTest.func===t.depthTest.func||i.push(_),e.colorMask.red===t.colorMask.red&&e.colorMask.green===t.colorMask.green&&e.colorMask.blue===t.colorMask.blue&&e.colorMask.alpha===t.colorMask.alpha||i.push(g),e.depthMask!==t.depthMask&&i.push(v),e.stencilMask!==t.stencilMask&&i.push(y),e.stencilTest.enabled===t.stencilTest.enabled&&e.stencilTest.frontFunction===t.stencilTest.frontFunction&&e.stencilTest.backFunction===t.stencilTest.backFunction&&e.stencilTest.reference===t.stencilTest.reference&&e.stencilTest.mask===t.stencilTest.mask&&e.stencilTest.frontOperation.fail===t.stencilTest.frontOperation.fail&&e.stencilTest.frontOperation.zFail===t.stencilTest.frontOperation.zFail&&e.stencilTest.backOperation.fail===t.stencilTest.backOperation.fail&&e.stencilTest.backOperation.zFail===t.stencilTest.backOperation.zFail&&e.stencilTest.backOperation.zPass===t.stencilTest.backOperation.zPass||i.push(S),e.sampleCoverage.enabled===t.sampleCoverage.enabled&&e.sampleCoverage.value===t.sampleCoverage.value&&e.sampleCoverage.invert===t.sampleCoverage.invert||i.push(E),i}var x=0,A={};l.fromCache=function(e){var t=JSON.stringify(e),i=A[t];if(r(i))return++i.referenceCount,i.state;var n=new l(e),o=JSON.stringify(n);return i=A[o],r(i)||(n.id=x++,i={referenceCount:0,state:n},A[o]=i),++i.referenceCount,A[t]={referenceCount:1,state:i.state},i.state},l.removeFromCache=function(e){var t=new l(e),i=JSON.stringify(t),n=A[i],o=JSON.stringify(e),a=A[o];r(a)&&(--a.referenceCount,0===a.referenceCount&&(delete A[o],r(n)&&--n.referenceCount)),r(n)&&0===n.referenceCount&&delete A[i]},l.getCache=function(){return A},l.clearCache=function(){A={}};var P=new e;return l.apply=function(e,t,i){c(e,t),h(e,t),d(e,t),p(e,t),f(e,t),_(e,t),g(e,t),v(e,t),y(e,t),S(e,t),E(e,t),m(e,t,i),w(e,t,i),b(e,t,i)},l.partialApply=function(e,t,i,n,o,a){if(t!==i){var s=i._applyFunctions[t.id];r(s)||(s=T(t,i),i._applyFunctions[t.id]=s);for(var l=s.length,u=0;u<l;++u)s[u](e,i)}var c=r(n.scissorTest)?n.scissorTest:t.scissorTest,h=r(o.scissorTest)?o.scissorTest:i.scissorTest;(c!==h||a)&&m(e,i,o);var d=r(n.blendingEnabled)?n.blendingEnabled:t.blending.enabled,p=r(o.blendingEnabled)?o.blendingEnabled:i.blending.enabled;(d!==p||p&&t.blending!==i.blending)&&w(e,i,o),t===i&&n===o&&n.context===o.context||b(e,i,o)},l.getState=function(i){return{frontFace:i.frontFace,cull:{enabled:i.cull.enabled,face:i.cull.face},lineWidth:i.lineWidth,polygonOffset:{enabled:i.polygonOffset.enabled,factor:i.polygonOffset.factor,units:i.polygonOffset.units},scissorTest:{enabled:i.scissorTest.enabled,rectangle:e.clone(i.scissorTest.rectangle)},depthRange:{near:i.depthRange.near,far:i.depthRange.far},depthTest:{enabled:i.depthTest.enabled,func:i.depthTest.func},colorMask:{red:i.colorMask.red,green:i.colorMask.green,blue:i.colorMask.blue,alpha:i.colorMask.alpha},depthMask:i.depthMask,stencilMask:i.stencilMask,blending:{enabled:i.blending.enabled,color:t.clone(i.blending.color),equationRgb:i.blending.equationRgb,equationAlpha:i.blending.equationAlpha,functionSourceRgb:i.blending.functionSourceRgb,functionSourceAlpha:i.blending.functionSourceAlpha,functionDestinationRgb:i.blending.functionDestinationRgb,functionDestinationAlpha:i.blending.functionDestinationAlpha},stencilTest:{enabled:i.stencilTest.enabled,frontFunction:i.stencilTest.frontFunction,backFunction:i.stencilTest.backFunction,reference:i.stencilTest.reference,mask:i.stencilTest.mask,frontOperation:{fail:i.stencilTest.frontOperation.fail,zFail:i.stencilTest.frontOperation.zFail,zPass:i.stencilTest.frontOperation.zPass},backOperation:{fail:i.stencilTest.backOperation.fail,zFail:i.stencilTest.backOperation.zFail,zPass:i.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:i.sampleCoverage.enabled,value:i.sampleCoverage.value,invert:i.sampleCoverage.invert},viewport:r(i.viewport)?e.clone(i.viewport):void 0}},l}),i("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4","../Core/WebGLConstants"],function(e,t,i){"use strict";function r(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var n=new e;if("undefined"==typeof WebGLRenderingContext)return{};var o={};o[i.FLOAT]="float",o[i.FLOAT_VEC2]="vec2",o[i.FLOAT_VEC3]="vec3",o[i.FLOAT_VEC4]="vec4",o[i.INT]="int",o[i.INT_VEC2]="ivec2",o[i.INT_VEC3]="ivec3",o[i.INT_VEC4]="ivec4",o[i.BOOL]="bool",o[i.BOOL_VEC2]="bvec2",o[i.BOOL_VEC3]="bvec3",o[i.BOOL_VEC4]="bvec4",o[i.FLOAT_MAT2]="mat2",o[i.FLOAT_MAT3]="mat3",o[i.FLOAT_MAT4]="mat4",o[i.SAMPLER_2D]="sampler2D",o[i.SAMPLER_CUBE]="samplerCube",r.prototype.getDeclaration=function(e){var t="uniform "+o[this._datatype]+" "+e,i=this._size;return t+=1===i?";":"["+i.toString()+"];"};var a={czm_viewport:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new r({size:1,datatype:i.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_inverseProjectionOIT:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseProjectionOIT}}),czm_infiniteProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new r({size:1,datatype:i.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new r({size:1,datatype:i.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new r({size:1,datatype:i.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_sunPositionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new r({size:1,datatype:i.FLOAT_VEC3,getValue:function(e){return t.getTranslation(e.inverseView,n)}}),czm_frameNumber:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.pass}}),czm_temeToPseudoFixed:new r({size:1,datatype:i.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.resolutionScale}}),czm_fogDensity:new r({size:1,datatype:i.FLOAT,getValue:function(e){return e.fogDensity}})};return a}),i("Renderer/createUniform",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i,r){switch(t.type){case e.FLOAT:return new h(e,t,i,r);case e.FLOAT_VEC2:return new d(e,t,i,r);case e.FLOAT_VEC3:return new p(e,t,i,r);case e.FLOAT_VEC4:return new m(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new f(e,t,i,r);case e.INT:case e.BOOL:return new _(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new g(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new v(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,i,r);case e.FLOAT_MAT2:return new C(e,t,i,r);case e.FLOAT_MAT3:return new w(e,t,i,r);case e.FLOAT_MAT4:return new S(e,t,i,r);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function h(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function d(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function p(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function m(e,t,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=e,this._location=r}function f(e,t,i,r){this.name=i,this.value=void 0,this._gl=e,this._location=r,this.textureUnitIndex=void 0}function _(e,t,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=e,this._location=r}function g(t,i,r,n){this.name=r,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function v(e,i,r,n){this.name=r,this.value=void 0,this._value=new t,this._gl=e,this._location=n}function y(e,t,r,n){this.name=r,this.value=void 0,this._value=new i,this._gl=e,this._location=n}function C(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(4),this._gl=e,this._location=r}function w(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(9),this._gl=e,this._location=r}function S(e,t,i,r){this.name=i,this.value=void 0,this._value=new Float32Array(16),this._gl=e,this._location=r}return h.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},d.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))},p.prototype.set=function(){var e=this.value;n(e.red)?r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):n(e.x)&&(t.equals(e,this._value)||(this._value=t.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))},m.prototype.set=function(){var e=this.value;n(e.red)?r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):n(e.x)&&(i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))},f.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},f.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},_.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},g.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))},v.prototype.set=function(){var e=this.value;t.equals(e,this._value)||(t.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},y.prototype.set=function(){var e=this.value;i.equals(e,this._value)||(i.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))},C.prototype.set=function(){a.equalsArray(this.value,this._value,0)||(a.toArray(this.value,this._value),this._gl.uniformMatrix2fv(this._location,!1,this._value))},w.prototype.set=function(){s.equalsArray(this.value,this._value,0)||(s.toArray(this.value,this._value),this._gl.uniformMatrix3fv(this._location,!1,this._value))},S.prototype.set=function(){l.equalsArray(this.value,this._value,0)||(l.toArray(this.value,this._value),this._gl.uniformMatrix4fv(this._location,!1,this._value))},c}),i("Renderer/createUniformArray",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t,i,r){switch(t.type){case e.FLOAT:return new h(e,t,i,r);case e.FLOAT_VEC2:return new d(e,t,i,r);case e.FLOAT_VEC3:return new p(e,t,i,r);case e.FLOAT_VEC4:return new m(e,t,i,r);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new f(e,t,i,r);case e.INT:case e.BOOL:return new _(e,t,i,r);case e.INT_VEC2:case e.BOOL_VEC2:return new g(e,t,i,r);case e.INT_VEC3:case e.BOOL_VEC3:return new v(e,t,i,r);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,i,r);case e.FLOAT_MAT2:return new C(e,t,i,r);case e.FLOAT_MAT3:return new w(e,t,i,r);case e.FLOAT_MAT4:return new S(e,t,i,r);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+i+'".')}}function h(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=r[0]}function d(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=r[0]}function p(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=r[0]}function m(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function f(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=r,this.textureUnitIndex=void 0}function _(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=r[0]}function g(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=r[0]}function v(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=r[0]}function y(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=r[0]}function C(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=r[0]}function w(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=r[0]}function S(e,t,i,r){var n=r.length;this.name=i,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=r[0]}return h.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;n<t;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1fv(this._location,i)},d.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;a<i;++a){var s=t[a];e.equalsArray(s,r,o)||(e.pack(s,r,o),n=!0),o+=2}n&&this._gl.uniform2fv(this._location,r)},p.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,o=!1,a=0,s=0;s<i;++s){var l=e[s];n(l.red)?l.red===r[a]&&l.green===r[a+1]&&l.blue===r[a+2]||(r[a]=l.red,r[a+1]=l.green,r[a+2]=l.blue,o=!0):n(l.x)&&(t.equalsArray(l,r,a)||(t.pack(l,r,a),o=!0)),a+=3}o&&this._gl.uniform3fv(this._location,r)},m.prototype.set=function(){for(var e=this.value,t=e.length,o=this._value,a=!1,s=0,l=0;l<t;++l){var u=e[l];n(u.red)?r.equalsArray(u,o,s)||(r.pack(u,o,s),a=!0):n(u.x)&&(i.equalsArray(u,o,s)||(i.pack(u,o,s),a=!0)),s+=4}a&&this._gl.uniform4fv(this._location,o)},f.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length,n=0;n<r;++n){var o=i[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture)}},f.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,i=t.length,r=0;r<i;++r){var n=e+r;this._gl.uniform1i(t[r],n)}return e+i},_.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0;n<t;++n){var o=e[n];o!==i[n]&&(i[n]=o,r=!0)}r&&this._gl.uniform1iv(this._location,i)},g.prototype.set=function(){for(var t=this.value,i=t.length,r=this._value,n=!1,o=0,a=0;a<i;++a){var s=t[a];e.equalsArray(s,r,o)||(e.pack(s,r,o),n=!0),o+=2}n&&this._gl.uniform2iv(this._location,r)},v.prototype.set=function(){for(var e=this.value,i=e.length,r=this._value,n=!1,o=0,a=0;a<i;++a){var s=e[a];t.equalsArray(s,r,o)||(t.pack(s,r,o),n=!0),o+=3}n&&this._gl.uniform3iv(this._location,r)},y.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,n=!1,o=0,a=0;a<t;++a){var s=e[a];i.equalsArray(s,r,o)||(i.pack(s,r,o),n=!0),o+=4}n&&this._gl.uniform4iv(this._location,r)},C.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var s=e[o];a.equalsArray(s,i,n)||(a.pack(s,i,n),r=!0),n+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)},w.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];s.equalsArray(a,i,n)||(s.pack(a,i,n),r=!0),n+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)},S.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,r=!1,n=0,o=0;o<t;++o){var a=e[o];l.equalsArray(a,i,n)||(l.pack(a,i,n),r=!0),n+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)},c}),i("Renderer/ShaderProgram",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/RuntimeError","./AutomaticUniforms","./ContextLimits","./createUniform","./createUniformArray"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){var t=d(e.vertexShaderText,e.fragmentShaderText);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=t.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=t.fragmentShaderText,this.id=y++}function h(e){var i=[],r=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(t(r))for(var n=r.length,o=0;o<n;o++){var a=r[o].trim(),s=a.slice(a.lastIndexOf(" ")+1);i.push(s)}return i}function d(e,t){var i={};if(!s.highpFloatSupported||!s.highpIntSupported){var r,n,o,a,l=h(e),u=h(t),c=l.length,d=u.length;for(r=0;r<c;r++)for(n=0;n<d;n++)if(l[r]===u[n]){o=l[r],a="czm_mediump_"+o;var p=new RegExp(o+"\\b","g");t=t.replace(p,a),i[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:i}}function p(e,i){var r=i._vertexShaderText,n=i._fragmentShaderText,a=e.createShader(e.VERTEX_SHADER);e.shaderSource(a,r),e.compileShader(a);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,n),e.compileShader(s);var l=e.createProgram();e.attachShader(l,a),e.attachShader(l,s),e.deleteShader(a),e.deleteShader(s);var u=i._attributeLocations;if(t(u))for(var c in u)u.hasOwnProperty(c)&&e.bindAttribLocation(l,u[c],c);e.linkProgram(l);var h;if(!e.getProgramParameter(l,e.LINK_STATUS)){var d=i._debugShaders;if(!e.getShaderParameter(s,e.COMPILE_STATUS)){if(h=e.getShaderInfoLog(s),console.error(C+"Fragment shader compile log: "+h),t(d)){var p=d.getTranslatedShaderSource(s);""!==p?console.error(C+"Translated fragment shader source:\n"+p):console.error(C+"Fragment shader translation failed.")}throw e.deleteProgram(l),new o("Fragment shader failed to compile.  Compile log: "+h)}if(!e.getShaderParameter(a,e.COMPILE_STATUS)){if(h=e.getShaderInfoLog(a),console.error(C+"Vertex shader compile log: "+h),t(d)){var m=d.getTranslatedShaderSource(a);""!==m?console.error(C+"Translated vertex shader source:\n"+m):console.error(C+"Vertex shader translation failed.")}throw e.deleteProgram(l),new o("Vertex shader failed to compile.  Compile log: "+h)}throw h=e.getProgramInfoLog(l),console.error(C+"Shader program link log: "+h),t(d)&&(console.error(C+"Translated vertex shader source:\n"+d.getTranslatedShaderSource(a)),console.error(C+"Translated fragment shader source:\n"+d.getTranslatedShaderSource(s))),e.deleteProgram(l),new o("Program failed to link.  Link log: "+h)}var f=i._logShaderCompilation;return f&&(h=e.getShaderInfoLog(a),t(h)&&h.length>0&&console.log(C+"Vertex shader compile log: "+h)),f&&(h=e.getShaderInfoLog(s),t(h)&&h.length>0&&console.log(C+"Fragment shader compile log: "+h)),f&&(h=e.getProgramInfoLog(l),t(h)&&h.length>0&&console.log(C+"Shader program link log: "+h)),l}function m(e,t,i){for(var r={},n=0;n<i;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);r[o.name]={name:o.name,type:o.type,index:a}}return r}function f(e,i){for(var r={},n=[],o=[],a=e.getProgramParameter(i,e.ACTIVE_UNIFORMS),s=0;s<a;++s){var c=e.getActiveUniform(i,s),h="[0]",d=c.name.indexOf(h,c.name.length-h.length)!==-1?c.name.slice(0,c.name.length-3):c.name;if(0!==d.indexOf("gl_"))if(c.name.indexOf("[")<0){var p=e.getUniformLocation(i,d);if(null!==p){var m=l(e,c,d,p);r[d]=m,n.push(m),m._setSampler&&o.push(m)}}else{var f,_,g,v,y=d.indexOf("[");if(y>=0){if(f=r[d.slice(0,y)],!t(f))continue;_=f._locations,_.length<=1&&(g=f.value,v=e.getUniformLocation(i,d),null!==v&&(_.push(v),g.push(e.getUniform(i,v))))}else{_=[];for(var C=0;C<c.size;++C)v=e.getUniformLocation(i,d+"["+C+"]"),null!==v&&_.push(v);f=u(e,c,d,_),r[d]=f,n.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:r,uniforms:n,samplerUniforms:o}}function _(e,i){var r=[],n=[];for(var o in i)if(i.hasOwnProperty(o)){var s=i[o],l=o,u=e._duplicateUniformNames[l];t(u)&&(s.name=u,l=u);var c=a[l];t(c)?r.push({uniform:s,automaticUniform:c}):n.push(s)}return{automaticUniforms:r,manualUniforms:n}}function g(e,t,i){e.useProgram(t);for(var r=0,n=i.length,o=0;o<n;++o)r=i[o]._setSampler(r);return e.useProgram(null),r}function v(e){if(!t(e._program)){var i=e._gl,r=p(i,e,e._debugShaders),n=i.getProgramParameter(r,i.ACTIVE_ATTRIBUTES),o=f(i,r),a=_(e,o.uniformsByName);e._program=r,e._numberOfVertexAttributes=n,e._vertexAttributes=m(i,r,n),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=g(i,r,o.samplerUniforms)}}var y=0;c.fromCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.getShaderProgram(t)},c.replaceCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.replaceShaderProgram(t)},i(c.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return v(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return v(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return v(this),this._uniformsByName}}});var C="[Cesium WebGL] ";return c.prototype._bind=function(){v(this),this._gl.useProgram(this._program)},c.prototype._setUniforms=function(e,i,r){var n,o;if(t(e)){var a=this._manualUniforms;for(n=a.length,o=0;o<n;++o){var s=a[o];s.value=e[s.name]()}}var l=this._automaticUniforms;for(n=l.length,o=0;o<n;++o){var u=l[o];u.uniform.value=u.automaticUniform.getValue(i)}var c=this._uniforms;for(n=c.length,o=0;o<n;++o)c[o].set();if(r){var h=this._gl,d=this._program;h.validateProgram(d)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},c.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),r(this)},c}),i("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),i("Shaders/Builtin/Constants/depthRange",[],function(){"use strict";return"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n"}),i("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),i("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),i("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),i("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),i("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),i("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),i("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),i("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),i("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),i("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),i("Shaders/Builtin/Constants/passCompute",[],function(){"use strict";return"const float czm_passCompute = 1.0;\n"}),i("Shaders/Builtin/Constants/passEnvironment",[],function(){"use strict";return"const float czm_passEnvironment = 0.0;\n"}),i("Shaders/Builtin/Constants/passGlobe",[],function(){"use strict";return"const float czm_passGlobe = 2.0;\n"}),i("Shaders/Builtin/Constants/passGround",[],function(){"use strict";return"const float czm_passGround = 3.0;\n"}),i("Shaders/Builtin/Constants/passOpaque",[],function(){"use strict";return"const float czm_passOpaque = 4.0;\n"}),i("Shaders/Builtin/Constants/passOverlay",[],function(){"use strict";return"const float czm_passOverlay = 6.0;\n"}),i("Shaders/Builtin/Constants/passTranslucent",[],function(){"use strict";return"const float czm_passTranslucent = 5.0;\n"}),i("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),i("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict";return"const float czm_piOverFour = 0.7853981633974483;\n"}),i("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),i("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),i("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),i("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n"}),i("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 2.0;\n"}),i("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 3.0;\n"}),i("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),i("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 0.0;\n"}),i("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),i("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),i("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),i("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),i("Shaders/Builtin/Structs/depthRangeStruct",[],function(){"use strict";return"struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n"}),i("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),i("Shaders/Builtin/Structs/material",[],function(){
"use strict";return"struct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\n"}),i("Shaders/Builtin/Structs/materialInput",[],function(){"use strict";return"struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\n};\n"}),i("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),i("Shaders/Builtin/Structs/raySegment",[],function(){"use strict";return"struct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n"}),i("Shaders/Builtin/Structs/shadowParameters",[],function(){"use strict";return"struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\nvec3 texCoords;\n#else\nvec2 texCoords;\n#endif\nfloat depthBias;\nfloat depth;\nfloat nDotL;\nvec2 texelStepSize;\nfloat normalShadingSmooth;\nfloat darkness;\n};\n"}),i("Shaders/Builtin/Functions/alphaWeight",[],function(){"use strict";return"float czm_alphaWeight(float a)\n{\nfloat z;\nif (czm_sceneMode != czm_sceneMode2D)\n{\nfloat x = 2.0 * (gl_FragCoord.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (gl_FragCoord.y - czm_viewport.y) / czm_viewport.w - 1.0;\nz = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 0.0);\nq /= gl_FragCoord.w;\nz = (czm_inverseProjectionOIT * q).z;\n}\nelse\n{\nz = gl_FragCoord.z * (czm_currentFrustum.y - czm_currentFrustum.x) + czm_currentFrustum.x;\n}\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 100.0 / (1e-5 + pow(abs(z) / 10.0, 3.0) + pow(abs(z) / 200.0, 6.0))));\n}\n"}),i("Shaders/Builtin/Functions/antialias",[],function(){"use strict";return"vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n"}),i("Shaders/Builtin/Functions/cascadeColor",[],function(){"use strict";return"vec4 czm_cascadeColor(vec4 weights)\n{\nreturn vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\nvec4(0.0, 1.0, 0.0, 1.0) * weights.y +\nvec4(0.0, 0.0, 1.0, 1.0) * weights.z +\nvec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n"}),i("Shaders/Builtin/Functions/cascadeDistance",[],function(){"use strict";return"uniform vec4 shadowMap_cascadeDistances;\nfloat czm_cascadeDistance(vec4 weights)\n{\nreturn dot(shadowMap_cascadeDistances, weights);\n}\n"}),i("Shaders/Builtin/Functions/cascadeMatrix",[],function(){"use strict";return"uniform mat4 shadowMap_cascadeMatrices[4];\nmat4 czm_cascadeMatrix(vec4 weights)\n{\nreturn shadowMap_cascadeMatrices[0] * weights.x +\nshadowMap_cascadeMatrices[1] * weights.y +\nshadowMap_cascadeMatrices[2] * weights.z +\nshadowMap_cascadeMatrices[3] * weights.w;\n}\n"}),i("Shaders/Builtin/Functions/cascadeWeights",[],function(){"use strict";return"uniform vec4 shadowMap_cascadeSplits[2];\nvec4 czm_cascadeWeights(float depthEye)\n{\nvec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\nvec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\nreturn near * far;\n}\n"}),i("Shaders/Builtin/Functions/columbusViewMorph",[],function(){"use strict";return"vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n"}),i("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),i("Shaders/Builtin/Functions/cosineAndSine",[],function(){"use strict";return"vec2 cordic(float angle)\n{\nvec2 vector = vec2(6.0725293500888267e-1, 0.0);\nfloat sense = (angle < 0.0) ? -1.0 : 1.0;\nmat2 rotation = mat2(1.0, sense, -sense, 1.0);\nvector = rotation * vector;\nangle -= sense * 7.8539816339744828e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfloat factor = sense * 5.0e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.6364760900080609e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.5e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4497866312686414e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.25e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2435499454676144e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.25e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.2418809995957350e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.125e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.1239833430268277e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.5625e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5623728620476831e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.8125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.8123410601011111e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.90625e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.9062301319669718e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.953125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9531225164788188e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.765625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.7656218955931946e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.8828125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.8828121119489829e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.44140625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4414062014936177e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.220703125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2207031189367021e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.103515625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.1035156174208773e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.0517578125e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.0517578115526096e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.52587890625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5258789061315762e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.62939453125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.6293945311019700e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.814697265625e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.8146972656064961e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.9073486328125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9073486328101870e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.5367431640625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.5367431640596084e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.76837158203125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.7683715820308884e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.384185791015625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.3841857910155797e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.1920928955078125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nreturn vector;\n}\nvec2 czm_cosineAndSine(float angle)\n{\nif (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n"}),i("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat xZeroTo4095 = floor(temp);\nfloat stx = xZeroTo4095 / 4095.0;\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\nreturn vec2(stx, sty);\n}\n"}),i("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x,   tangentEC.y,   tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x,    normalEC.y,    normalEC.z);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),i("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),i("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),i("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/fog",[],function(){"use strict";return"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\n"}),i("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),i("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),i("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"}),i("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, max(shininess, czm_epsilon2));\n}\n"}),i("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),i("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),i("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299,     0.587,     0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591,  0.311135);\nconst mat3 toRGB = mat3(1.0,  0.9563,  0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107,   1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),i("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),i("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),i("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n"}),i("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),i("Shaders/Builtin/Functions/metersPerPixel",[],function(){"use strict";return"float czm_metersPerPixel(vec4 positionEC)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight);\n}\n"}),i("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),i("Shaders/Builtin/Functions/nearFarScalar",[],function(){"use strict";return"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n"}),i("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded)\n{\nencoded = encoded / 255.0 * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n"}),i("Shaders/Builtin/Functions/packDepth",[],function(){"use strict";return"vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n"}),i("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),i("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"}),i("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),i("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),i("Shaders/Builtin/Functions/shadowDepthCompare",[],function(){"use strict";return"float czm_sampleShadowMap(samplerCube shadowMap, vec3 d)\n{\nreturn czm_unpackDepth(textureCube(shadowMap, d));\n}\nfloat czm_sampleShadowMap(sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\nreturn texture2D(shadowMap, uv).r;\n#else\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n"}),i("Shaders/Builtin/Functions/shadowVisibility",[],function(){"use strict";return"float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\nfloat strength = step(0.0, nDotL);\n#endif\nvisibility *= strength;\n#endif\nvisibility = max(visibility, darkness);\nreturn visibility;\n}\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec3 uvw = shadowParameters.texCoords;\ndepth -= depthBias;\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec2 uv = shadowParameters.texCoords;\ndepth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\nvec2 texelStepSize = shadowParameters.texelStepSize;\nfloat radius = 1.0;\nfloat dx0 = -texelStepSize.x * radius;\nfloat dy0 = -texelStepSize.y * radius;\nfloat dx1 = texelStepSize.x * radius;\nfloat dy1 = texelStepSize.y * radius;\nfloat visibility = (\nczm_shadowDepthCompare(shadowMap, uv, depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n) * (1.0 / 9.0);\n#else\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n"}),i("Shaders/Builtin/Functions/signNotZero",[],function(){"use strict";return"float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n"}),i("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 binormalEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 binormal = normalize(binormalEC);\nreturn mat3(tangent.x,  tangent.y,  tangent.z,\nbinormal.x, binormal.y, binormal.z,\nnormal.x,   normal.y,   normal.z);\n}\n"}),i("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),i("Shaders/Builtin/Functions/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),i("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),i("Shaders/Builtin/Functions/unpackDepth",[],function(){"use strict";return"float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n"}),i("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nq = czm_inverseProjection * q;\nreturn q;\n}\n"}),i("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693,  0.0556,\n-1.5371,  1.8760, -0.2040,\n-0.4985,  0.0416,  1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),i("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/passCompute","./Constants/passEnvironment","./Constants/passGlobe","./Constants/passGround","./Constants/passOpaque","./Constants/passOverlay","./Constants/passTranslucent","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Structs/shadowParameters","./Functions/alphaWeight","./Functions/antialias","./Functions/cascadeColor","./Functions/cascadeDistance","./Functions/cascadeMatrix","./Functions/cascadeWeights","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fog","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/RGBToXYZ","./Functions/saturation","./Functions/shadowDepthCompare","./Functions/shadowVisibility","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/XYZToRGB"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De,Me,Ie,Re,Oe,Ne,Le){
"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:i,czm_epsilon2:r,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:h,czm_passCompute:d,czm_passEnvironment:p,czm_passGlobe:m,czm_passGround:f,czm_passOpaque:_,czm_passOverlay:g,czm_passTranslucent:v,czm_pi:y,czm_piOverFour:C,czm_piOverSix:w,czm_piOverThree:S,czm_piOverTwo:E,czm_radiansPerDegree:b,czm_sceneMode2D:T,czm_sceneMode3D:x,czm_sceneModeColumbusView:A,czm_sceneModeMorphing:P,czm_solarRadius:D,czm_threePiOver2:M,czm_twoPi:I,czm_webMercatorMaxLatitude:R,czm_depthRangeStruct:O,czm_ellipsoid:N,czm_material:L,czm_materialInput:B,czm_ray:F,czm_raySegment:V,czm_shadowParameters:k,czm_alphaWeight:z,czm_antialias:U,czm_cascadeColor:G,czm_cascadeDistance:W,czm_cascadeMatrix:H,czm_cascadeWeights:q,czm_columbusViewMorph:j,czm_computePosition:Y,czm_cosineAndSine:X,czm_decompressTextureCoordinates:Z,czm_eastNorthUpToEyeCoordinates:K,czm_ellipsoidContainsPoint:Q,czm_ellipsoidNew:J,czm_ellipsoidWgs84TextureCoordinates:$,czm_equalsEpsilon:ee,czm_eyeOffset:te,czm_eyeToWindowCoordinates:ie,czm_fog:re,czm_geodeticSurfaceNormal:ne,czm_getDefaultMaterial:oe,czm_getLambertDiffuse:ae,czm_getSpecular:se,czm_getWaterNoise:le,czm_getWgs84EllipsoidEC:ue,czm_hue:ce,czm_isEmpty:he,czm_isFull:de,czm_latitudeToWebMercatorFraction:pe,czm_luminance:me,czm_metersPerPixel:fe,czm_modelToWindowCoordinates:_e,czm_multiplyWithColorBalance:ge,czm_nearFarScalar:ve,czm_octDecode:ye,czm_packDepth:Ce,czm_phong:we,czm_pointAlongRay:Se,czm_rayEllipsoidIntersectionInterval:Ee,czm_RGBToXYZ:be,czm_saturation:Te,czm_shadowDepthCompare:xe,czm_shadowVisibility:Ae,czm_signNotZero:Pe,czm_tangentToEyeSpaceMatrix:De,czm_translateRelativeToEye:Me,czm_translucentPhong:Ie,czm_transpose:Re,czm_unpackDepth:Oe,czm_windowToEyeCoordinates:Ne,czm_XYZToRGB:Le}}),i("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,i,r,n){"use strict";function o(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,i="",r=0;r<t;++r)i+="\n";return i})}function a(e,i,r){for(var n,a=0;a<r.length;++a)r[a].name===e&&(n=r[a]);return t(n)||(i=o(i),n={name:e,glslSource:i,dependsOn:[],requiredBy:[],evaluated:!1},r.push(n)),n}function s(e,i){if(!e.evaluated){e.evaluated=!0;var r=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);t(r)&&null!==r&&(r=r.filter(function(e,t){return r.indexOf(e)===t}),r.forEach(function(t){if(t!==e.name&&h._czmBuiltinsAndUniforms.hasOwnProperty(t)){var r=a(t,h._czmBuiltinsAndUniforms[t],i);e.dependsOn.push(r),r.requiredBy.push(e),s(r,i)}}))}}function l(e){for(var t=[],i=[];e.length>0;){var r=e.pop();i.push(r),0===r.requiredBy.length&&t.push(r)}for(;t.length>0;){var n=t.shift();e.push(n);for(var o=0;o<n.dependsOn.length;++o){var a=n.dependsOn[o],s=a.requiredBy.indexOf(n);a.requiredBy.splice(s,1),0===a.requiredBy.length&&t.push(a)}}for(var l=[],u=0;u<i.length;++u)0!==i[u].requiredBy.length&&l.push(i[u])}function u(e){var t=[],i=a("main",e,t);s(i,t),l(t);for(var r="",n=t.length-1;n>=0;--n)r=r+t[n].glslSource+"\n";return r.replace(i.glslSource,"")}function c(e,i){var r,n,a="",s=e.sources;if(t(s))for(r=0,n=s.length;r<n;++r)a+="\n#line 0\n"+s[r];a=o(a);var l;a=a.replace(/#version\s+(.*?)\n/gm,function(e,t){return l=t,"\n"}),a=a.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var c=e.pickColorQualifier;t(c)&&(a=h.createPickFragmentShaderSource(a,c));var d="";t(l)&&(d="#version "+l),i&&(d+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n    precision highp float;\n#else\n    precision mediump float;\n#endif\n\n");var p=e.defines;if(t(p))for(r=0,n=p.length;r<n;++r){var m=p[r];0!==m.length&&(d+="#define "+m+"\n")}return e.includeBuiltIns&&(d+=u(a)),d+="\n#line 0\n",d+=a}function h(i){i=e(i,e.EMPTY_OBJECT);var r=i.pickColorQualifier;this.defines=t(i.defines)?i.defines.slice(0):[],this.sources=t(i.sources)?i.sources.slice(0):[],this.pickColorQualifier=r,this.includeBuiltIns=e(i.includeBuiltIns,!0)}h.prototype.clone=function(){return new h({sources:this.sources,defines:this.defines,pickColorQuantifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},h.replaceMain=function(e,t){return t="void "+t+"()",e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},h.prototype.createCombinedVertexShader=function(){return c(this,!1)},h.prototype.createCombinedFragmentShader=function(){return c(this,!0)},h._czmBuiltinsAndUniforms={};for(var d in r)r.hasOwnProperty(d)&&(h._czmBuiltinsAndUniforms[d]=r[d]);for(var p in n)if(n.hasOwnProperty(p)){var m=n[p];"function"==typeof m.getDeclaration&&(h._czmBuiltinsAndUniforms[p]=m.getDeclaration(p))}h.createPickVertexShaderSource=function(e){var t=h.replaceMain(e,"czm_old_main"),i="attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n    czm_old_main(); \n    czm_pickColor = pickColor; \n}";return t+"\n"+i},h.createPickFragmentShaderSource=function(e,t){var i=h.replaceMain(e,"czm_old_main"),r=t+" vec4 czm_pickColor; \nvoid main() \n{ \n    czm_old_main(); \n    if (gl_FragColor.a == 0.0) { \n       discard; \n    } \n    gl_FragColor = czm_pickColor; \n}";return i+"\n"+r},h.findVarying=function(e,t){for(var i=e.sources,r=t.length,n=0;n<r;++n)for(var o=t[n],a=i.length,s=0;s<a;++s)if(i[s].indexOf(o)!==-1)return o};var f=["v_normalEC","v_normal"];h.findNormalVarying=function(e){return h.findVarying(e,f)};var _=["v_positionEC"];return h.findPositionVarying=function(e){return h.findVarying(e,_)},h}),i("Renderer/Buffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/IndexDatatype","../Core/WebGLConstants","./BufferUsage"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl,n=i.bufferTarget,o=i.typedArray,a=i.sizeInBytes,s=i.usage,l=t(o);l&&(a=o.byteLength);var u=r.createBuffer();r.bindBuffer(n,u),r.bufferData(n,l?o:a,s),r.bindBuffer(n,null),this._gl=r,this._bufferTarget=n,this._sizeInBytes=a,this._usage=s,this._buffer=u,this.vertexArrayDestroyable=!0}return l.createVertexBuffer=function(e){return new l({context:e.context,bufferTarget:a.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},l.createIndexBuffer=function(e){var t=e.context,r=e.indexDatatype,n=o.getSizeInBytes(r),s=new l({context:t,bufferTarget:a.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),u=s.sizeInBytes/n;return i(s,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return u}}}),s},i(l.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),l.prototype._getBuffer=function(){return this._buffer},l.prototype.copyFromArrayView=function(t,i){i=e(i,0);var r=this._gl,n=this._bufferTarget;r.bindBuffer(n,this._buffer),r.bufferSubData(n,i,t),r.bindBuffer(n,null)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),r(this)},l}),i("Renderer/VertexArray",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/IndexDatatype","../Core/Math","../Core/RuntimeError","./Buffer","./BufferUsage","./ContextLimits"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(r,n,o,a){var s=i(n.vertexBuffer),l=i(n.value),u=n.value?n.value.length:n.componentsPerAttribute,c={index:t(n.index,o),enabled:t(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:l?n.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:t(n.componentDatatype,e.FLOAT),normalize:t(n.normalize,!1),offsetInBytes:t(n.offsetInBytes,0),strideInBytes:t(n.strideInBytes,0),instanceDivisor:t(n.instanceDivisor,0)};if(s)c.vertexAttrib=function(e){var t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),this.instanceDivisor>0&&(a.glVertexAttribDivisor(t,this.instanceDivisor),a._vertexAttribDivisors[t]=this.instanceDivisor,a._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&a.glVertexAttribDivisor(o,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(e){}}r.push(c)}function m(e,t,r){for(var n=0;n<t.length;++n){var o=t[n];o.enabled&&o.vertexAttrib(e)}i(r)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r._getBuffer())}function f(r){r=t(r,t.EMPTY_OBJECT);var n,o=r.context,a=o._gl,s=r.attributes,l=r.indexBuffer,u=[],c=1,h=!1,d=s.length;for(n=0;n<d;++n)p(u,s[n],n,o);for(d=u.length,n=0;n<d;++n){var f=u[n];if(i(f.vertexBuffer)&&0===f.instanceDivisor){var _=f.strideInBytes||f.componentsPerAttribute*e.getSizeInBytes(f.componentDatatype);c=f.vertexBuffer.sizeInBytes/_;break}}for(n=0;n<d;++n)if(u[n].instanceDivisor>0){h=!0;break}var g;o.vertexArrayObject&&(g=o.glCreateVertexArray(),o.glBindVertexArray(g),m(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=h,this._context=o,this._gl=a,this._vao=g,this._attributes=u,this._indexBuffer=l}function _(e){return e.values.length/e.componentsPerAttribute}function g(t){return e.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function v(t){var r,n,o,a=[];for(n in t)t.hasOwnProperty(n)&&i(t[n])&&i(t[n].values)&&(a.push(n),t[n].componentDatatype===e.DOUBLE&&(t[n].componentDatatype=e.FLOAT,t[n].values=e.createTypedArray(e.FLOAT,t[n].values)));var s,l=a.length;if(l>0)for(s=_(t[a[0]]),r=1;r<l;++r){var c=_(t[a[r]]);if(c!==s)throw new u("Each attribute list must have the same number of vertices.  Attribute "+a[r]+" has a different number of vertices ("+c.toString()+") than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(i,r){return e.getSizeInBytes(t[r].componentDatatype)-e.getSizeInBytes(t[i].componentDatatype)});var h=0,d={};for(r=0;r<l;++r)n=a[r],o=t[n],d[n]=h,h+=g(o);if(h>0){var p=e.getSizeInBytes(t[a[0]].componentDatatype),m=h%p;0!==m&&(h+=p-m);var f=s*h,v=new ArrayBuffer(f),y={};for(r=0;r<l;++r){n=a[r];var C=e.getSizeInBytes(t[n].componentDatatype);y[n]={pointer:e.createTypedArray(t[n].componentDatatype,v),index:d[n]/C,strideInComponentType:h/C}}for(r=0;r<s;++r)for(var w=0;w<l;++w){n=a[w],o=t[n];for(var S=o.values,E=y[n],b=E.pointer,T=o.componentsPerAttribute,x=0;x<T;++x)b[E.index+x]=S[r*T+x];E.index+=E.strideInComponentType}return{buffer:v,offsetsInBytes:d,vertexSizeInBytes:h}}}function y(e){var t=e._context,i=e._hasInstancedAttributes;if(i||t._previousDrawInstanced){t._previousDrawInstanced=i;var r,n=t._vertexAttribDivisors,o=e._attributes,a=d.maximumVertexAttributes;if(i){var s=o.length;for(r=0;r<s;++r){var l=o[r];if(l.enabled){var u=l.instanceDivisor,c=l.index;u!==n[c]&&(t.glVertexAttribDivisor(c,u),n[c]=u)}}}else for(r=0;r<a;++r)n[r]>0&&(t.glVertexAttribDivisor(r,0),n[r]=0)}}return f.fromGeometry=function(r){r=t(r,t.EMPTY_OBJECT);var n,o,u,d=r.context,p=t(r.geometry,t.EMPTY_OBJECT),m=t(r.bufferUsage,h.DYNAMIC_DRAW),_=t(r.attributeLocations,t.EMPTY_OBJECT),g=t(r.interleave,!1),y=r.vertexArrayAttributes,C=i(y)?y:[],w=p.attributes;if(g){var S=v(w);if(i(S)){u=c.createVertexBuffer({context:d,typedArray:S.buffer,usage:m});var E=S.offsetsInBytes,b=S.vertexSizeInBytes;for(n in w)w.hasOwnProperty(n)&&i(w[n])&&(o=w[n],i(o.values)?C.push({index:_[n],vertexBuffer:u,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:E[n],strideInBytes:b}):C.push({index:_[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in w)if(w.hasOwnProperty(n)&&i(w[n])){o=w[n];var T=o.componentDatatype;T===e.DOUBLE&&(T=e.FLOAT),u=void 0,i(o.values)&&(u=c.createVertexBuffer({context:d,typedArray:e.createTypedArray(T,o.values),usage:m})),C.push({index:_[n],vertexBuffer:u,value:o.value,componentDatatype:T,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var x,A=p.indices;return i(A)&&(x=a.computeNumberOfVertices(p)>=l.SIXTY_FOUR_KILOBYTES&&d.elementIndexUint?c.createIndexBuffer({context:d,typedArray:new Uint32Array(A),usage:m,indexDatatype:s.UNSIGNED_INT}):c.createIndexBuffer({context:d,typedArray:new Uint16Array(A),usage:m,indexDatatype:s.UNSIGNED_SHORT})),new f({context:d,attributes:C,indexBuffer:x})},r(f.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),f.prototype.getAttribute=function(e){return this._attributes[e]},f.prototype._bind=function(){i(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&y(this)):m(this._gl,this._attributes,this._indexBuffer)},f.prototype._unBind=function(){if(i(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,r=0;r<e.length;++r){var n=e[r];n.enabled&&n.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){for(var e=this._attributes,t=0;t<e.length;++t){var r=e[t].vertexBuffer;i(r)&&!r.isDestroyed()&&r.vertexArrayDestroyable&&r.destroy()}var o=this._indexBuffer;return i(o)&&!o.isDestroyed()&&o.vertexArrayDestroyable&&o.destroy(),i(this._vao)&&this._context.glDeleteVertexArray(this._vao),n(this)},f}),i("Scene/BatchTable",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/combine","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/RuntimeError","../Renderer/ContextLimits","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(t,r,n){if(this._attributes=r,this._numberOfInstances=n,0!==r.length){var o=y(r),a=t.floatingPointTexture,s=o===p.FLOAT&&!a,l=w(r,s),u=S(l,r,s),c=Math.floor(d.maximumTextureSize/u),h=Math.min(n,c),m=u*h,f=Math.ceil(n/h),_=1/m,g=.5*_,v=1/f,C=.5*v;this._textureDimensions=new e(m,f),this._textureStep=new i(_,g,v,C),this._pixelDatatype=s?p.UNSIGNED_BYTE:o,this._packFloats=s,this._offsets=l,this._stride=u,this._texture=void 0;var E=4*m*f;this._batchValues=o!==p.FLOAT||s?new Uint8Array(E):new Float32Array(E),this._batchValuesDirty=!1}}function y(e){for(var t=!1,i=e.length,r=0;r<i;++r)if(e[r].componentDatatype!==n.UNSIGNED_BYTE){t=!0;break}return t?p.FLOAT:p.UNSIGNED_BYTE}function C(r,n){var o=r[n].componentsPerAttribute;return 2===o?e:3===o?t:4===o?i:Number}function w(e,t){for(var i=new Array(e.length),r=0,o=e.length,a=0;a<o;++a){var s=e[a],l=s.componentDatatype;i[a]=r,l!==n.UNSIGNED_BYTE&&t?r+=4:++r}return i}function S(e,t,i){var r=e.length,o=e[r-1],a=t[r-1],s=a.componentDatatype;return s!==n.UNSIGNED_BYTE&&i?o+4:o+1}function E(e){var t=e.w/2,i=Math.floor(t),r=2*(t-i);if(i-=U,r=2*r-1,r=-r,i>=U)return r<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=r*e.x*V;return n+=r*e.y*k,n+=r*e.z*z,n*Math.pow(10,i)}function b(e,t,r){var n=i.unpack(e,t,N),o=E(n);n=i.unpack(e,t+4,N);var a=E(n);n=i.unpack(e,t+8,N);var s=E(n);n=i.unpack(e,t+12,N);var l=E(n);return i.fromElements(o,a,s,l,r)}function T(e,t){if(G[0]=e,e=G[0],0===e)return i.clone(i.ZERO,t);var r,n=e<0?1:0;isFinite(e)?(e=Math.abs(e),r=Math.floor(u.logBase(e,10))+1,e/=Math.pow(10,r)):(e=.1,r=U);var o=e*L;return t.x=Math.floor(o),o=(o-t.x)*L,t.y=Math.floor(o),o=(o-t.y)*L,t.z=Math.floor(o),t.w=2*(r+U)+n,t}function x(e,t,r){var n=T(e.x,N);i.pack(n,t,r),n=T(e.y,n),i.pack(n,t,r+4),n=T(e.z,n),i.pack(n,t,r+8),n=T(e.w,n),i.pack(n,t,r+12)}function A(e,t){var i=e._textureDimensions;e._texture=new f({context:t,pixelFormat:c.RGBA,pixelDatatype:e._pixelDatatype,width:i.x,height:i.y,sampler:new m({minificationFilter:g.NEAREST,magnificationFilter:_.NEAREST})})}function P(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function D(e){var t=e._stride;return 1===e._textureDimensions.y?"uniform vec4 batchTextureStep; \nvec2 computeSt(float batchId) \n{ \n    float stepX = batchTextureStep.x; \n    float centerX = batchTextureStep.y; \n    float numberOfAttributes = float("+t+"); \n    return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5); \n} \n":"uniform vec4 batchTextureStep; \nuniform vec2 batchTextureDimensions; \nvec2 computeSt(float batchId) \n{ \n    float stepX = batchTextureStep.x; \n    float centerX = batchTextureStep.y; \n    float stepY = batchTextureStep.z; \n    float centerY = batchTextureStep.w; \n    float numberOfAttributes = float("+t+"); \n    float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x); \n    float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); \n    return vec2(centerX + (xId * stepX), 1.0 - (centerY + (yId * stepY))); \n} \n"}function M(e){return e._packFloats?"float unpackFloat(vec4 value) \n{ \n    value *= 255.0; \n    float temp = value.w / 2.0; \n    float exponent = floor(temp); \n    float sign = (temp - exponent) * 2.0; \n    exponent = exponent - float("+U+"); \n    sign = sign * 2.0 - 1.0; \n    sign = -sign; \n    float unpacked = sign * value.x * float("+V+"); \n    unpacked += sign * value.y * float("+k+"); \n    unpacked += sign * value.z * float("+z+"); \n    return unpacked * pow(10.0, exponent); \n} \n":""}function I(e){return 1===e?"float":"vec"+e}function R(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function O(e,t){var i=e._attributes,r=i[t],o=r.componentsPerAttribute,a=r.functionName,s=I(o),l=R(o),u=e._offsets[t],c=s+" "+a+"(float batchId) \n{ \n    vec2 st = computeSt(batchId); \n    st.x += batchTextureStep.x * float("+u+"); \n";return c+=e._packFloats&&r.componentDatatype!==p.UNSIGNED_BYTE?"vec4 textureValue; \ntextureValue.x = unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":"    vec4 textureValue = texture2D(batchTexture, st); \n",c+="    "+s+" value = textureValue"+l+"; \n",e._pixelDatatype!==p.UNSIGNED_BYTE||r.componentDatatype!==n.UNSIGNED_BYTE||r.normalize?e._pixelDatatype===p.FLOAT&&r.componentDatatype===n.UNSIGNED_BYTE&&r.normalize&&(c+="value /= 255.0; \n"):c+="value *= 255.0; \n",c+="    return value; \n} \n"}a(v.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});var N=new i,L=256,B=65536,F=16777216,V=1/L,k=1/B,z=1/F,U=38,G=new Float32Array(1),W=new i;v.prototype.getBatchedAttribute=function(e,t,r){var n,a=this._attributes,s=this._offsets[t],l=this._stride,u=4*l*e+4*s;n=this._packFloats&&a[t].componentDatatype!==p.UNSIGNED_BYTE?b(this._batchValues,u,W):i.unpack(this._batchValues,u,W);var c=C(a,t);return o(c.fromCartesian4)?c.fromCartesian4(n,r):o(c.clone)?c.clone(n,r):n.x};var H=[void 0,void 0,new e,new t,new i],q=new i;return v.prototype.setBatchedAttribute=function(e,t,r){var n=this._attributes,a=H[n[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,a),l=C(this._attributes,t),u=o(l.equals)?l.equals(s,r):s===r;if(!u){var c=q;c.x=o(r.x)?r.x:r,c.y=o(r.y)?r.y:0,c.z=o(r.z)?r.z:0,c.w=o(r.w)?r.w:0;var h=this._offsets[t],d=this._stride,m=4*d*e+4*h;this._packFloats&&n[t].componentDatatype!==p.UNSIGNED_BYTE?x(c,this._batchValues,m):i.pack(c,this._batchValues,m),this._batchValuesDirty=!0}},v.prototype.update=function(e){o(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,o(this._texture)||A(this,e.context),P(this))},v.prototype.getUniformMapCallback=function(){var e=this;return function(t){if(0===e._attributes.length)return t;var i={batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}};return r(t,i)}},v.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform sampler2D batchTexture; \n";t+=D(this)+"\n",t+=M(this)+"\n";for(var i=e.length,r=0;r<i;++r)t+=O(this,r);return function(e){var i=e.indexOf("void main"),r=e.substring(0,i),n=e.substring(i);return r+"\n"+t+"\n"+n}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),s(this)},v}),i("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,t,r){var n,o=!r,a=e.length;if(!o&&a>1){var s=e[0].modelMatrix;for(n=1;n<a;++n)if(!d.equals(s,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;n<a;++n)i(e[n].geometry)&&c.transformToWorldCoordinates(e[n]);else d.multiplyTransformation(t,e[0].modelMatrix,t)}function f(e,i){var r=e.attributes,n=r.position,o=n.values.length/n.componentsPerAttribute;r.batchId=new l({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});for(var a=r.batchId.values,s=0;s<o;++s)a[s]=i}function _(e){for(var t=e.length,r=0;r<t;++r){var n=e[r];i(n.geometry)?f(n.geometry,r):i(n.westHemisphereGeometry)&&i(n.eastHemisphereGeometry)&&(f(n.westHemisphereGeometry,r),f(n.eastHemisphereGeometry,r))}}function g(r){var n,o,a,s=r.instances,l=r.projection,u=r.elementIndexUintSupported,h=r.scene3DOnly,d=r.vertexCacheOptimize,p=r.compressVertices,f=r.modelMatrix,g=s.length;for(n=0;n<g;++n)if(i(s[n].geometry)){a=s[n].geometry.primitiveType;break}if(m(s,f,h),!h)for(n=0;n<g;++n)i(s[n].geometry)&&c.splitLongitude(s[n]);if(_(s),d)for(n=0;n<g;++n){var v=s[n];i(v.geometry)?(c.reorderForPostVertexCache(v.geometry),c.reorderForPreVertexCache(v.geometry)):i(v.westHemisphereGeometry)&&i(v.eastHemisphereGeometry)&&(c.reorderForPostVertexCache(v.westHemisphereGeometry),c.reorderForPreVertexCache(v.westHemisphereGeometry),c.reorderForPostVertexCache(v.eastHemisphereGeometry),c.reorderForPreVertexCache(v.eastHemisphereGeometry))}var y=c.combineInstances(s);for(g=y.length,n=0;n<g;++n){o=y[n];var C,w=o.attributes;if(h)for(C in w)w.hasOwnProperty(C)&&w[C].componentDatatype===t.DOUBLE&&c.encodeAttribute(o,C,C+"3DHigh",C+"3DLow");else for(C in w)if(w.hasOwnProperty(C)&&w[C].componentDatatype===t.DOUBLE){var S=C+"3D",E=C+"2D";c.projectTo2D(o,C,S,E,l),i(o.boundingSphere)&&"position"===C&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),c.encodeAttribute(o,S,S+"High",S+"Low"),c.encodeAttribute(o,E,E+"High",E+"Low")}p&&c.compressVertices(o)}if(!u){var b=[];for(g=y.length,n=0;n<g;++n)o=y[n],b=b.concat(c.fitToUnsignedShortIndices(o));y=b}return y}function v(e,t,r,n){var o,a,s,l=n.length-1;if(l>=0){var u=n[l];o=u.offset+u.count,s=u.index,a=r[s].indices.length}else o=0,s=0,a=r[s].indices.length;for(var c=e.length,h=0;h<c;++h){var d=e[h],p=d[t];if(i(p)){var m=p.indices.length;o+m>a&&(o=0,a=r[++s].indices.length),n.push({index:s,offset:o,count:m}),o+=m}}}function y(e,t){var i=[];return v(e,"geometry",t,i),v(e,"westHemisphereGeometry",t,i),v(e,"eastHemisphereGeometry",t,i),i}function C(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o)&&i(o.values)&&t.push(o.values.buffer)}i(e.indices)&&t.push(e.indices.buffer)}function w(e,t){for(var i=e.length,r=0;r<i;++r)C(e[r],t)}function S(t){for(var r=1,n=t.length,o=0;o<n;o++){var a=t[o];if(++r,i(a)){var s=a.attributes;r+=6+2*e.packedLength+(i(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&i(s[l])){var u=s[l];r+=5+u.values.length}}}return r}function E(e,t){var i=e.length,r=new Float64Array(1+16*i),n=0;r[n++]=i;for(var o=0;o<i;o++){var a=e[o];d.pack(a.modelMatrix,r,n),n+=d.packedLength}return t.push(r.buffer),r}function b(e){for(var t=e,i=new Array(t[0]),r=0,n=1;n<t.length;){var o=d.unpack(t,n);n+=d.packedLength,i[r++]={modelMatrix:o}}return i}function T(t){var r=t.length,n=1+(e.packedLength+1)*r,o=new Float32Array(n),a=0;o[a++]=r;for(var s=0;s<r;++s){var l=t[s];i(l)?(o[a++]=1,e.pack(t[s],o,a)):o[a++]=0,a+=e.packedLength}return o}function x(t){for(var i=new Array(t[0]),r=0,n=1;n<t.length;)1===t[n++]&&(i[r]=e.unpack(t,n)),++r,n+=e.packedLength;return i}if(!o.supportsTypedArrays())return{};var A={};return A.combineGeometry=function(t){var r,n,o=t.instances,a=o.length;a>0&&(r=g(t),r.length>0&&(n=c.createAttributeLocations(r[0])));var s;t.createPickOffsets&&r.length>0&&(s=y(o,r));for(var l=new Array(a),u=new Array(a),h=0;h<a;++h){var d=o[h],p=d.geometry;i(p)&&(l[h]=p.boundingSphere,u[h]=p.boundingSphereCV);var m=d.eastHemisphereGeometry,f=d.westHemisphereGeometry;i(m)&&i(f)&&(i(m.boundingSphere)&&i(f.boundingSphere)&&(l[h]=e.union(m.boundingSphere,f.boundingSphere)),i(m.boundingSphereCV)&&i(f.boundingSphereCV)&&(u[h]=e.union(m.boundingSphereCV,f.boundingSphereCV)))}return{geometries:r,modelMatrix:t.modelMatrix,attributeLocations:n,pickOffsets:s,boundingSpheres:l,boundingSpheresCV:u}},A.packCreateGeometryResults=function(t,r){var n=new Float64Array(S(t)),o=[],a={},s=t.length,l=0;n[l++]=s;for(var u=0;u<s;u++){var c=t[u],h=i(c);if(n[l++]=h?1:0,h){n[l++]=c.primitiveType,n[l++]=c.geometryType;var d=i(c.boundingSphere)?1:0;n[l++]=d,d&&e.pack(c.boundingSphere,n,l),l+=e.packedLength;var p=i(c.boundingSphereCV)?1:0;n[l++]=p,p&&e.pack(c.boundingSphereCV,n,l),l+=e.packedLength;var m=c.attributes,f=[];for(var _ in m)m.hasOwnProperty(_)&&i(m[_])&&(f.push(_),i(a[_])||(a[_]=o.length,o.push(_)));n[l++]=f.length;for(var g=0;g<f.length;g++){var v=f[g],y=m[v];n[l++]=a[v],n[l++]=y.componentDatatype,n[l++]=y.componentsPerAttribute,n[l++]=y.normalize?1:0,n[l++]=y.values.length,n.set(y.values,l),l+=y.values.length}var C=i(c.indices)?c.indices.length:0;n[l++]=C,C>0&&(n.set(c.indices,l),l+=C)}}return r.push(n.buffer),{stringTable:o,packedData:n}},A.unpackCreateGeometryResults=function(i){for(var r,n=i.stringTable,o=i.packedData,a=new Array(o[0]),c=0,d=1;d<o.length;){var p=1===o[d++];if(p){var m,f,_=o[d++],g=o[d++],v=1===o[d++];v&&(m=e.unpack(o,d)),d+=e.packedLength;var y=1===o[d++];y&&(f=e.unpack(o,d)),d+=e.packedLength;var C,w,S,E=new u,b=o[d++];for(r=0;r<b;r++){var T=n[o[d++]],x=o[d++];S=o[d++];var A=0!==o[d++];C=o[d++],w=t.createTypedArray(x,C);for(var P=0;P<C;P++)w[P]=o[d++];E[T]=new l({componentDatatype:x,componentsPerAttribute:S,normalize:A,values:w})}var D;if(C=o[d++],C>0){var M=w.length/S;for(D=h.createTypedArray(M,C),r=0;r<C;r++)D[r]=o[d++]}a[c++]=new s({primitiveType:_,geometryType:g,boundingSphere:m,boundingSphereCV:f,indices:D,attributes:E})}else a[c++]=void 0}return a},A.packCombineGeometryParameters=function(e,t){for(var i=e.createGeometryResults,r=i.length,n=0;n<r;n++)t.push(i[n].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:E(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},A.unpackCombineGeometryParameters=function(e){for(var t=b(e.packedInstances),i=e.createGeometryResults,r=i.length,o=0,s=0;s<r;s++)for(var l=A.unpackCreateGeometryResults(i[s]),u=l.length,c=0;c<u;c++){var h=l[c],m=t[o];m.geometry=h,++o}var f=n.clone(e.ellipsoid),_=e.isGeographic?new a(f):new p(f);return{instances:t,ellipsoid:f,projection:_,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:d.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},A.packCombineGeometryResults=function(e,t){i(e.geometries)&&w(e.geometries,t);var r=T(e.boundingSpheres),n=T(e.boundingSpheresCV);return t.push(r.buffer,n.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:r,boundingSpheresCV:n}},A.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:x(e.boundingSpheres),boundingSpheresCV:x(e.boundingSpheresCV)}},A}),i("Scene/PrimitiveState",["../Core/freezeObject"],function(e){"use strict";var t={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};return e(t)}),i("Scene/SceneMode",["../Core/freezeObject"],function(e){"use strict";var t={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};return t.getMorphTime=function(e){if(e===t.SCENE3D)return 1;if(e!==t.MORPHING)return 0},e(t)}),i("Scene/ShadowMode",["../Core/freezeObject"],function(e){"use strict";var t={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3,NUMBER_OF_SHADOW_MODES:4};return t.castShadows=function(e){return e===t.ENABLED||e===t.CAST_ONLY},t.receiveShadows=function(e){return e===t.ENABLED||e===t.RECEIVE_ONLY},t.fromCastReceive=function(e,i){return e&&i?t.ENABLED:e?t.CAST_ONLY:i?t.RECEIVE_ONLY:t.DISABLED},e(t)}),i("Scene/Primitive",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/isArray","../Core/Matrix4","../Core/RuntimeError","../Core/subdivideArray","../Core/TaskProcessor","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./BatchTable","./CullFace","./PrimitivePipeline","./PrimitiveState","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V){"use strict";function k(e){e=u(e,u.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.modelMatrix=C.clone(u(e.modelMatrix,C.IDENTITY)),this._modelMatrix=new C,this.show=u(e.show,!0),this._vertexCacheOptimize=u(e.vertexCacheOptimize,!1),this._interleave=u(e.interleave,!1),this._releaseGeometryInstances=u(e.releaseGeometryInstances,!0),this._allowPicking=u(e.allowPicking,!0),this._asynchronous=u(e.asynchronous,!0),this._compressVertices=u(e.compressVertices,!0),this.cull=u(e.cull,!0),this.debugShowBoundingVolume=u(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=u(e.shadows,V.DISABLED),this._translucent=void 0,this._state=B.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=[],this._instanceIds=[],
this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._pickRS=void 0,this._pickSP=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._readOnlyInstanceAttributes=e._readOnlyInstanceAttributes,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._readyPromise=R.defer(),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}function z(e){var t,i=e.length,r=[],n=e[0].attributes;for(t in n)if(n.hasOwnProperty(t)){for(var o=n[t],a=!0,s=1;s<i;++s){var l=e[s].attributes[t];if(!c(l)||o.componentDatatype!==l.componentDatatype||o.componentsPerAttribute!==l.componentsPerAttribute||o.normalize!==l.normalize){a=!1;break}}a&&r.push(t)}return r}function U(e){var n=e.length;return 1===n?e[0]:2===n?t.unpack(e,0,le):3===n?i.unpack(e,0,ue):4===n?r.unpack(e,0,ce):void 0}function G(e,t){var i=e.geometryInstances,r=y(i)?i:[i],n=r.length;if(0!==n){var o,s,h,d=z(r),p=d.length,m=e.allowPicking,f=[],_={},g={},v=r[0],C=v.attributes;for(o=0;o<p;++o)s=d[o],h=C[s],_[s]=o,f.push({functionName:"czm_batchTable_"+s,componentDatatype:h.componentDatatype,componentsPerAttribute:h.componentsPerAttribute,normalize:h.normalize});d.indexOf("distanceDisplayCondition")!==-1&&(f.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:l.FLOAT,componentsPerAttribute:1}),g.center3DHigh=f.length-5,g.center3DLow=f.length-4,g.center2DHigh=f.length-3,g.center2DLow=f.length-2,g.radius=f.length-1),m&&f.push({functionName:"czm_batchTable_pickColor",componentDatatype:l.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var w=f.length,S=new O(t,f,n);for(o=0;o<n;++o){var E=r[o];C=E.attributes;for(var b=0;b<p;++b){s=d[b],h=C[s];var T=U(h.value),x=_[s];S.setBatchedAttribute(o,x,T)}if(m){var A={primitive:u(E.pickPrimitive,e)};c(E.id)&&(A.id=E.id);var P=t.createPickId(A);e._pickIds.push(P);var D=P.color,M=ce;M.x=a.floatToByte(D.red),M.y=a.floatToByte(D.green),M.z=a.floatToByte(D.blue),M.w=a.floatToByte(D.alpha),S.setBatchedAttribute(o,w-1,M)}}e._batchTable=S,e._batchTableAttributeIndices=_,e._batchTableBoundingSphereAttributeIndices=g}}function W(e){var t;return t=y(e.values)?e.values.slice(0):new e.values.constructor(e.values),new g({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function H(t){var i=t.attributes,r=new v;for(var n in i)i.hasOwnProperty(n)&&c(i[n])&&(r[n]=W(i[n]));var o;if(c(t.indices)){var a=t.indices;o=y(a)?a.slice(0):new a.constructor(a)}return new _({attributes:r,indices:o,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function q(e,t){return{geometry:t,modelMatrix:C.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}function j(e,t){if(!e.compressVertices)return t;var i=t.search(/attribute\s+vec3\s+normal;/g)!==-1,r=t.search(/attribute\s+vec2\s+st;/g)!==-1;if(!i&&!r)return t;var n=t.search(/attribute\s+vec3\s+tangent;/g)!==-1,o=t.search(/attribute\s+vec3\s+binormal;/g)!==-1,a=r&&i?2:1;a+=n||o?1:0;var s=a>1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",h="";if(r){c+="vec2 st;\n";var d=a>1?l+".x":l;h+="    st = czm_decompressTextureCoordinates("+d+");\n"}i&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 binormal;\n",h+="    czm_octDecode("+l+"."+(r?"yz":"xy")+", normal, tangent, binormal);\n"):(i&&(c+="vec3 normal;\n",h+="    normal = czm_octDecode("+l+(a>1?"."+(r?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",h+="    tangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"),o&&(c+="vec3 binormal;\n",h+="    binormal = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"));var p=t;p=p.replace(/attribute\s+vec3\s+normal;/g,""),p=p.replace(/attribute\s+vec2\s+st;/g,""),p=p.replace(/attribute\s+vec3\s+tangent;/g,""),p=p.replace(/attribute\s+vec3\s+binormal;/g,""),p=M.replaceMain(p,"czm_non_compressed_main");var m="void main() \n{ \n"+h+"    czm_non_compressed_main(); \n}";return[u,c,p,m].join("\n")}function Y(e,t){e.vertexAttributes}function X(e,t){return function(){return e[t]}}function Z(e,t){var i,r,n,o,a=e._instanceIds;if(e._state===B.READY){i=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var s=e._numberOfInstances=i.length,l=[],h=[];for(n=0;n<s;++n)r=i[n].geometry,a.push(i[n].id),h.push({moduleName:r._workerName,geometry:r});if(!c(de))for(de=new Array(pe),n=0;n<pe;n++)de[n]=new E("createGeometry",Number.POSITIVE_INFINITY);var d;for(h=S(h,pe),n=0;n<h.length;n++){var p=0,m=h[n],f=m.length;for(o=0;o<f;++o)d=m[o],r=d.geometry,c(r.constructor.pack)&&(d.offset=p,p+=u(r.constructor.packedLength,r.packedLength));var _;if(p>0){var g=new Float64Array(p);for(_=[g.buffer],o=0;o<f;++o)d=m[o],r=d.geometry,c(r.constructor.pack)&&(r.constructor.pack(r,g,d.offset),d.geometry=g)}l.push(de[n].scheduleTask({subTasks:h[n]},_))}e._state=B.CREATING,R.all(l,function(t){e._createGeometryResults=t,e._state=B.CREATED}).otherwise(function(i){se(e,t,B.FAILED,i)})}else if(e._state===B.CREATED){var v=[];i=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var w=t.scene3DOnly,b=t.mapProjection,T=me.scheduleTask(L.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:i,ellipsoid:b.ellipsoid,projection:b,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:w,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},v),v);e._createGeometryResults=void 0,e._state=B.COMBINING,R(T,function(i){var r=L.unpackCombineGeometryResults(i);e._geometries=r.geometries,e._attributeLocations=r.attributeLocations,e.modelMatrix=C.clone(r.modelMatrix,e.modelMatrix),e._pickOffsets=r.pickOffsets,e._instanceBoundingSpheres=r.boundingSpheres,e._instanceBoundingSpheresCV=r.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}).otherwise(function(i){se(e,t,B.FAILED,i)})}}function K(e,t){var i,r,n=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),s=e._instanceIds,l=0;for(r=0;r<o;r++){i=n[r];var u,h=i.geometry;u=c(h.attributes)&&c(h.primitiveType)?H(h):h.constructor.createGeometry(h),a[l++]=q(i,u),s.push(i.id)}a.length=l;var d=t.scene3DOnly,p=t.mapProjection,m=L.combineGeometry({instances:a,ellipsoid:p.ellipsoid,projection:p,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:d,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=m.geometries,e._attributeLocations=m.attributeLocations,e.modelMatrix=C.clone(m.modelMatrix,e.modelMatrix),e._pickOffsets=m.pickOffsets,e._instanceBoundingSpheres=m.boundingSpheres,e._instanceBoundingSpheresCV=m.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}function Q(t,i){var r=c(t._batchTableAttributeIndices.distanceDisplayCondition);if(r||!t._batchTableBoundingSpheresUpdated){for(var n=t._batchTableBoundingSphereAttributeIndices,o=n.center3DHigh,a=n.center3DLow,s=n.center2DHigh,l=n.center2DLow,u=n.radius,h=i.mapProjection,d=h.ellipsoid,p=t._batchTable,f=t._instanceBoundingSpheres,_=f.length,g=0;g<_;++g){var v=f[g];if(c(v)){var y=t.modelMatrix;if(c(y)&&(v=e.transform(v,y,v)),r){var C=v.center,w=v.radius,S=m.fromCartesian(C,fe);p.setBatchedAttribute(g,o,S.high),p.setBatchedAttribute(g,a,S.low);var E=d.cartesianToCartographic(C,_e),b=h.project(E,ge);S=m.fromCartesian(b,fe),p.setBatchedAttribute(g,s,S.high),p.setBatchedAttribute(g,l,S.low),p.setBatchedAttribute(g,u,w)}}}t._batchTableBoundingSpheresUpdated=!0}}function J(t,i){for(var r=t._attributeLocations,n=t._geometries,o=i.scene3DOnly,a=i.context,s=[],l=n.length,u=0;u<l;++u){var h=n[u];if(s.push(I.fromGeometry({context:a,geometry:h,attributeLocations:r,bufferUsage:b.STATIC_DRAW,interleave:t._interleave})),c(t._createBoundingVolumeFunction))t._createBoundingVolumeFunction(i,h);else if(t._boundingSpheres.push(e.clone(h.boundingSphere)),t._boundingSphereWC.push(new e),!o){var d=h.boundingSphereCV.center,p=d.x,m=d.y,f=d.z;d.x=f,d.y=p,d.z=m,t._boundingSphereCV.push(e.clone(h.boundingSphereCV)),t._boundingSphere2D.push(new e),t._boundingSphereMorph.push(new e)}}t._va=s,t._primitiveType=n[0].primitiveType,t.releaseGeometryInstances&&(t.geometryInstances=void 0),t._geometries=void 0,se(t,i,B.COMPLETE,void 0)}function $(e,t,i,r){var n,a=i.getRenderState();r?(n=o(a,!1),n.cull={enabled:!0,face:N.BACK},e._frontFaceRS=P.fromCache(n),n.cull.face=N.FRONT,e._backFaceRS=P.fromCache(n)):(e._frontFaceRS=P.fromCache(a),e._backFaceRS=e._frontFaceRS),e.allowPicking?r?(n=o(a,!1),n.cull={enabled:!1},e._pickRS=P.fromCache(n)):e._pickRS=e._frontFaceRS:(n=o(a,!1),n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r?(n.cull={enabled:!1},e._pickRS=P.fromCache(n)):e._pickRS=P.fromCache(n))}function ee(e,t,i){var r=t.context,n=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(i.vertexShaderSource);o=k._appendShowToShader(e,o),o=k._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=k._updateColorAttribute(e,o),o=j(e,o),o=k._modifyShaderPosition(e,o,t.scene3DOnly);var a=i.getFragmentShaderSource();if(e.allowPicking){var s=M.createPickVertexShaderSource(o);s=k._updatePickColorAttribute(s),e._pickSP=D.replaceCache({context:r,shaderProgram:e._pickSP,vertexShaderSource:s,fragmentShaderSource:M.createPickFragmentShaderSource(a,"varying"),attributeLocations:n})}else e._pickSP=D.fromCache({context:r,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n});Y(e._pickSP,n),e._sp=D.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),Y(e._sp,n)}function te(e,t,i,r,n,o,a,l){var u=c(i)?i._uniforms:void 0,h={},d=t.uniforms;if(c(d))for(var p in d)d.hasOwnProperty(p)&&(h[p]=X(d,p));var m=s(h,u);m=e._batchTable.getUniformMapCallback()(m),c(e.rtcCenter)&&(m.u_modifiedModelView=function(){var t=l.context.uniformState.view;return C.multiply(t,e._modelMatrix,ve),C.multiplyByPoint(ve,e.rtcCenter,ye),C.setTranslation(ve,ye,ve),ve});var f=r?A.TRANSLUCENT:A.OPAQUE;o.length=e._va.length*(n?2:1),a.length=e._va.length;for(var _=o.length,g=0,v=0,y=0;y<_;++y){var w;n&&(w=o[y],c(w)||(w=o[y]=new x({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[v],w.renderState=e._backFaceRS,w.shaderProgram=e._sp,w.uniformMap=m,w.pass=f,++y),w=o[y],c(w)||(w=o[y]=new x({owner:e,primitiveType:e._primitiveType})),w.vertexArray=e._va[v],w.renderState=e._frontFaceRS,w.shaderProgram=e._sp,w.uniformMap=m,w.pass=f;var S=a[g];c(S)||(S=a[g]=new x({owner:e,primitiveType:e._primitiveType})),S.vertexArray=e._va[v],S.renderState=e._pickRS,S.shaderProgram=e._pickSP,S.uniformMap=m,S.pass=f,++g,++v}}function ie(e,t){var i=e.appearance.pixelSize;if(c(i))for(var r=e._boundingSpheres.length,n=0;n<r;++n){var o=e._boundingSpheres[n],a=e._boundingSphereWC[n],s=t.camera.getPixelSize(o,t.context.drawingBufferWidth,t.context.drawingBufferHeight),l=s*i;a.radius=o.radius+l}}function re(t,i,r,n,o,a,s,l){if(ie(t,i),!C.equals(o,t._modelMatrix)){C.clone(o,t._modelMatrix);for(var u=t._boundingSpheres.length,h=0;h<u;++h){var d=t._boundingSpheres[h];c(d)&&(t._boundingSphereWC[h]=e.transform(d,o,t._boundingSphereWC[h]),i.scene3DOnly||(t._boundingSphere2D[h]=e.clone(t._boundingSphereCV[h],t._boundingSphere2D[h]),t._boundingSphere2D[h].center.x=0,t._boundingSphereMorph[h]=e.union(t._boundingSphereWC[h],t._boundingSphereCV[h])))}}var p;i.mode===F.SCENE3D?p=t._boundingSphereWC:i.mode===F.COLUMBUS_VIEW?p=t._boundingSphereCV:i.mode===F.SCENE2D&&c(t._boundingSphere2D)?p=t._boundingSphere2D:c(t._boundingSphereMorph)&&(p=t._boundingSphereMorph);var m=i.commandList,f=i.passes;if(f.render)for(var _=V.castShadows(t.shadows),g=V.receiveShadows(t.shadows),v=r.length,y=0;y<v;++y){var w=l?Math.floor(y/2):y,S=r[y];S.modelMatrix=o,S.boundingVolume=p[w],S.cull=a,S.debugShowBoundingVolume=s,S.castShadows=_,S.receiveShadows=g,m.push(S)}if(f.pick)for(var E=n.length,b=0;b<E;++b){var T=n[b];T.modelMatrix=o,T.boundingVolume=p[b],T.cull=a,m.push(T)}}function ne(e,t,i){return function(){var r=e.getBatchedAttribute(t,i),n=e.attributes[i],o=n.componentsPerAttribute,a=l.createTypedArray(n.componentDatatype,o);return c(r.constructor.pack)?r.constructor.pack(r,a,0):a[0]=r,a}}function oe(e,t,i){return function(r){var n=U(r);e.setBatchedAttribute(t,i,n)}}function ae(e,t,i){t.boundingSphere={get:function(){return e._instanceBoundingSpheres[i]}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[i]}}}function se(e,t,i,r){e._error=r,e._state=i,t.afterRender.push(function(){e._ready=e._state===B.COMPLETE||e._state===B.FAILED,c(r)?e._readyPromise.reject(r):e._readyPromise.resolve(e)})}h(k.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}});var le=new t,ue=new i,ce=new r,he=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;k._modifyShaderPosition=function(e,t,i){for(var r,n="",o="",a="";null!==(r=he.exec(t));){var s=r[1],l="vec4 czm_compute"+s[0].toUpperCase()+s.substr(1)+"()";"vec4 czm_computePosition()"!==l&&(n+=l+";\n"),c(e.rtcCenter)?(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,""),n+="uniform mat4 u_modifiedModelView;\n",o+="attribute vec4 position;\n",a+=l+"\n{\n    return u_modifiedModelView * position;\n}\n\n",t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):i?a+=l+"\n{\n    return czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n}\n\n":(o+="attribute vec3 "+s+"2DHigh;\nattribute vec3 "+s+"2DLow;\n",a+=l+"\n{\n    vec4 p;\n    if (czm_morphTime == 1.0)\n    {\n        p = czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n    }\n    else if (czm_morphTime == 0.0)\n    {\n        p = czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy);\n    }\n    else\n    {\n        p = czm_columbusViewMorph(\n                czm_translateRelativeToEye("+s+"2DHigh.zxy, "+s+"2DLow.zxy),\n                czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow),\n                czm_morphTime);\n    }\n    return p;\n}\n\n")}return[n,o,t,a].join("\n")},k._appendShowToShader=function(e,t){if(!c(e._batchTableAttributeIndices.show))return t;var i=M.replaceMain(t,"czm_non_show_main"),r="void main() \n{ \n    czm_non_show_main(); \n    gl_Position *= czm_batchTable_show(batchId); \n}";return i+"\n"+r},k._updateColorAttribute=function(e,t){if(!c(e._batchTableAttributeIndices.color))return t;if(t.search(/attribute\s+vec4\s+color;/g)===-1)return t;var i=t;return i=i.replace(/attribute\s+vec4\s+color;/g,""),i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},k._updatePickColorAttribute=function(e){var t=e.replace(/attribute\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2")},k._appendDistanceDisplayConditionToShader=function(e,t,i){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;var r=M.replaceMain(t,"czm_non_distanceDisplayCondition_main"),n="void main() \n{ \n    czm_non_distanceDisplayCondition_main(); \n    vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\n    vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\n    vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\n    vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n    vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n    float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return n+=i?"    vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n":"    vec4 centerRTE;\n    if (czm_morphTime == 1.0)\n    {\n        centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n    }\n    else if (czm_morphTime == 0.0)\n    {\n        centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\n    }\n    else\n    {\n        centerRTE = czm_columbusViewMorph(\n                czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\n                czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\n                czm_morphTime);\n    }\n",n+="    float radiusSq = boundingSphereRadius * boundingSphereRadius; \n    float distanceSq; \n    if (czm_sceneMode == czm_sceneMode2D) \n    { \n        distanceSq = czm_eyeHeight2D.y - radiusSq; \n    } \n    else \n    { \n        distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \n    } \n    distanceSq = max(distanceSq, 0.0); \n    float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \n    float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \n    float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \n    gl_Position *= show; \n}",r+"\n"+n};var de,pe=Math.max(f.hardwareConcurrency-1,1),me=new E("combineGeometry",Number.POSITIVE_INFINITY),fe=new m,_e=new n,ge=new i,ve=new C,ye=new i;return k.prototype.update=function(e){if(!(!c(this.geometryInstances)&&0===this._va.length||c(this.geometryInstances)&&y(this.geometryInstances)&&0===this.geometryInstances.length||!c(this.appearance)||e.mode!==F.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(c(this._error))throw this._error;if(this._state!==B.FAILED){var t=e.context;if(c(this._batchTable)||G(this,t),this._batchTable.attributes.length>0){if(0===T.maximumVertexTextureImageUnits)throw new w("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==B.COMPLETE&&this._state!==B.COMBINED&&(this.asynchronous?Z(this,e):K(this,e)),this._state===B.COMBINED&&(Q(this,e),J(this,e)),this.show&&this._state===B.COMPLETE){var i=this.appearance,r=i.material,n=!1,o=!1;this._appearance!==i?(this._appearance=i,this._material=r,n=!0,o=!0):this._material!==r&&(this._material=r,o=!0);var a=this._appearance.isTranslucent();this._translucent!==a&&(this._translucent=a,n=!0),c(this._material)&&this._material.update(t);var s=i.closed&&a;if(n){var l=u(this._createRenderStatesFunction,$);l(this,t,i,s)}if(o){var h=u(this._createShaderProgramFunction,ee);h(this,e,i)}if(n||o){var d=u(this._createCommandsFunction,te);d(this,i,r,a,s,this._colorCommands,this._pickCommands,e)}var p=u(this._updateAndQueueCommandsFunction,re);p(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,s)}}}},k.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,o=0;o<n;++o){var a=(i+o)%n;if(e===r[a]){t=a;break}}if(t!==-1){var s=this._perInstanceAttributeCache[t];if(c(s))return s;var l=this._batchTable,u=this._batchTableAttributeIndices;s={};var d={};for(var p in u)if(u.hasOwnProperty(p)){var m=u[p];d[p]={get:ne(l,t,m)};var f=!0,_=this._readOnlyInstanceAttributes;if(f&&c(_)){n=_.length;for(var g=0;g<n;++g)if(p===_[g]){f=!1;break}}f&&(d[p].set=oe(l,t,m))}return ae(this,d,t),h(s,d),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=s,s}},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();var i=this._va;for(e=i.length,t=0;t<e;++t)i[t].destroy();this._va=void 0;var r=this._pickIds;for(e=r.length,t=0;t<e;++t)r[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,d(this)},k}),i("DataSources/ColorMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"Color"},a.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),i("DataSources/dynamicGeometryGetBoundingSphere",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Matrix4","./BoundingSphereState"],function(e,t,i,r,n,o){"use strict";function a(r,a,s,l){var u,c;return i(a)&&a.show&&a.ready&&(u=a.getGeometryInstanceAttributes(r),i(u)&&i(u.boundingSphere))?(c=t(a.modelMatrix,n.IDENTITY),e.transform(u.boundingSphere,c,l),o.DONE):i(s)&&s.show&&s.ready&&(u=s.getGeometryInstanceAttributes(r),i(u)&&i(u.boundingSphere))?(c=t(s.modelMatrix,n.IDENTITY),e.transform(u.boundingSphere,c,l),o.DONE):i(a)&&!a.ready||i(s)&&!s.ready?o.PENDING:o.FAILED}return a}),i("DataSources/MaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,i,r,n){"use strict";function o(){r.throwInstantiationError()}return i(o.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),o.prototype.getType=r.throwInstantiationError,o.prototype.getValue=r.throwInstantiationError,o.prototype.equals=r.throwInstantiationError,o.getValue=function(i,r,o){var a;return t(r)&&(a=r.getType(i),t(a))?(t(o)&&o.type===a||(o=n.fromType(a)),r.getValue(i,o.uniforms),o):(t(o)&&o.type===n.ColorType||(o=n.fromType(n.ColorType)),e.clone(e.WHITE,o.uniforms.color),o)},o}),i("DataSources/BoxGeometryUpdater",["../Core/BoxGeometry","../Core/BoxOutlineGeometry","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(i.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(i.BLACK),R=new C(v.DISABLED),O=new C(new u),N=new i;return a(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(t){var n,a,s=this._entity,l=s.isAvailable(t),u=new m(l&&s.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t)),h=this._distanceDisplayConditionProperty.getValue(t),f=c.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var _=i.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(_=this._materialProperty.color.getValue(t)),a=r.fromColor(_),n={show:u,distanceDisplayCondition:f,color:a}}else n={show:u,distanceDisplayCondition:f};return new d({id:s,geometry:e.fromDimensions(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(e){var n=this._entity,o=n.isAvailable(e),a=E.getValueOrDefault(this._outlineColorProperty,e,i.BLACK),s=this._distanceDisplayConditionProperty.getValue(e);return new d({id:n,geometry:t.fromDimensions(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new m(o&&n.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"box"===t){var a=this._entity.box;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.dimensions,d=e.position,m=a.show;if(!o(h)||!o(d)||o(m)&&m.isConstant&&!m.getValue(p.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=n(a.material,A),v=g instanceof y;this._materialProperty=g,this._fillProperty=n(s,D),this._showProperty=n(m,P),this._showOutlineProperty=n(a.outline,M),this._outlineColorProperty=c?n(a.outlineColor,I):void 0,this._shadowsProperty=n(a.shadows,R),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,O);var C=a.outlineWidth;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&E.isConstant(e.orientation)&&h.isConstant&&E.isConstant(C)){var w=this._options;w.vertexFormat=v?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,w.dimensions=h.getValue(p.MINIMUM_VALUE,w.dimensions),this._outlineWidth=o(C)?C.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.box;if(l.isShowing&&l.isAvailable(n)&&E.getValueOrDefault(u.show,n,!0)){var h=this._options,p=l._getModelMatrix(n),m=E.getValueOrUndefined(u.dimensions,n,h.dimensions);if(o(p)&&o(m)){h.dimensions=m;var v=this._geometryUpdater.shadowsProperty.getValue(n),y=this._geometryUpdater.distanceDisplayConditionProperty,C=y.getValue(n),w=c.fromDistanceDisplayCondition(C);if(E.getValueOrDefault(u.fill,n,!0)){var b=S.getValue(n,s.fillMaterialProperty,this._material);this._material=b;var T=new f({material:b,translucent:b.isTranslucent(),closed:!0});h.vertexFormat=T.vertexFormat,this._primitive=a.add(new g({geometryInstances:new d({id:l,geometry:e.fromDimensions(h),modelMatrix:p,attributes:{distanceDisplayCondition:w}}),appearance:T,asynchronous:!1,shadows:v}))}if(E.getValueOrDefault(u.outline,n,!1)){h.vertexFormat=_.VERTEX_FORMAT;var x=E.getValueOrClonedDefault(u.outlineColor,n,i.BLACK,N),A=E.getValueOrDefault(u.outlineWidth,n,1),P=1!==x.alpha;this._outlinePrimitive=a.add(new g({geometryInstances:new d({id:l,geometry:t.fromDimensions(h),modelMatrix:p,attributes:{color:r.fromColor(x),distanceDisplayCondition:w}}),appearance:new _({flat:!0,translucent:P,renderState:{lineWidth:s._scene.clampLineWidth(A)}}),asynchronous:!1,shadows:v}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),i("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}var u=new e(1,1),c=!1,h=t.WHITE;return n(l.prototype,{isConstant:{get:function(){
return s.isConstant(this._image)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:a("image"),repeat:a("repeat"),color:a("color"),transparent:a("transparent")}),l.prototype.getType=function(e){return"Image"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.image=s.getValueOrUndefined(this._image,e),t.repeat=s.getValueOrClonedDefault(this._repeat,e,u,t.repeat),t.color=s.getValueOrClonedDefault(this._color,e,h,t.color),s.getValueOrDefault(this._transparent,e,c)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._image,e._image)&&s.equals(this._color,e._color)&&s.equals(this._transparent,e._transparent)&&s.equals(this._repeat,e._repeat)},l}),i("DataSources/createMaterialPropertyDescriptor",["../Core/Color","../Core/DeveloperError","./ColorMaterialProperty","./createPropertyDescriptor","./ImageMaterialProperty"],function(e,t,i,r,n){"use strict";function o(t){if(t instanceof e)return new i(t);if("string"==typeof t||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){var r=new n;return r.image=t,r}}function a(e,t){return r(e,t,o)}return a}),i("DataSources/BoxGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._dimensions=void 0,this._dimensionsSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),dimensions:a("dimensions"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.dimensions=this.dimensions,e.show=this.show,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.dimensions=e(this.dimensions,t.dimensions),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/CallbackProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,i,r){"use strict";function n(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new r,this.setCallback(e,t)}return t(n.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),n.prototype.getValue=function(e,t){return this._callback(e,t)},n.prototype.setCallback=function(e,t){var i=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,i&&this._definitionChanged.raiseEvent(this)},n.prototype.equals=function(e){return this===e||e instanceof n&&this._callback===e._callback&&this._isConstant===e._isConstant},n}),i("DataSources/CheckerboardMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}var u=t.WHITE,c=t.BLACK,h=new e(2,2);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._evenColor)&&s.isConstant(this._oddColor)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:a("evenColor"),oddColor:a("oddColor"),repeat:a("repeat")}),l.prototype.getType=function(e){return"Checkerboard"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.lightColor=s.getValueOrClonedDefault(this._evenColor,e,u,t.lightColor),t.darkColor=s.getValueOrClonedDefault(this._oddColor,e,c,t.darkColor),t.repeat=s.getValueOrDefault(this._repeat,e,h),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._evenColor,e._evenColor)&&s.equals(this._oddColor,e._oddColor)&&s.equals(this._repeat,e._repeat)},l}),i("DataSources/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,i,r,n,o,a){"use strict";function s(){r.throwInstantiationError()}i(s.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError},referenceFrame:{get:r.throwInstantiationError}}),s.prototype.getValue=r.throwInstantiationError,s.prototype.getValueInReferenceFrame=r.throwInstantiationError,s.prototype.equals=r.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(i,r,s,u,c){if(!t(r))return r;if(t(c)||(c=new e),s===u)return e.clone(r,c);var h=a.computeIcrfToFixedMatrix(i,l);return t(h)||(h=a.computeTemeToPseudoFixedMatrix(i,l)),s===o.INERTIAL?n.multiplyByVector(h,r,c):s===o.FIXED?n.multiplyByVector(n.transpose(h,l),r,c):void 0},s}),i("DataSources/ConstantPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty"],function(e,t,i,r,n,o,a,s){"use strict";function l(i,r){this._definitionChanged=new o,this._value=e.clone(i),this._referenceFrame=t(r,a.FIXED)}return r(l.prototype,{isConstant:{get:function(){return!i(this._value)||this._referenceFrame===a.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.setValue=function(t,r){var n=!1;e.equals(this._value,t)||(n=!0,this._value=e.clone(t)),i(r)&&this._referenceFrame!==r&&(n=!0,this._referenceFrame=r),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(e,t,i){return s.convertToReferenceFrame(e,this._value,this._referenceFrame,t,i)},l.prototype.equals=function(t){return this===t||t instanceof l&&e.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame},l}),i("DataSources/CorridorGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),width:a("width"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.width=this.width,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.width=e(this.width,t.width),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/createRawPropertyDescriptor",["./createPropertyDescriptor"],function(e){"use strict";function t(e){return e}function i(i,r){return e(i,r,t)}return i}),i("DataSources/CylinderGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},length:a("length"),topRadius:a("topRadius"),bottomRadius:a("bottomRadius"),numberOfVerticalLines:a("numberOfVerticalLines"),slices:a("slices"),show:a("show"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.bottomRadius=this.bottomRadius,e.length=this.length,e.topRadius=this.topRadius,e.show=this.show,e.material=this.material,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.bottomRadius=e(this.bottomRadius,t.bottomRadius),this.length=e(this.length,t.length),this.topRadius=e(this.topRadius,t.topRadius),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.slices=e(this.slices,t.slices),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/EllipseGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},semiMajorAxis:a("semiMajorAxis"),semiMinorAxis:a("semiMinorAxis"),rotation:a("rotation"),show:a("show"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),numberOfVerticalLines:a("numberOfVerticalLines"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.rotation=this.rotation,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.rotation=e(this.rotation,t.rotation),this.semiMajorAxis=e(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,t.semiMinorAxis),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/EllipsoidGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radii:a("radii"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),stackPartitions:a("stackPartitions"),slicePartitions:a("slicePartitions"),subdivisions:a("subdivisions"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.radii=this.radii,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.radii=e(this.radii,t.radii),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.stackPartitions=e(this.stackPartitions,t.stackPartitions),this.slicePartitions=e(this.slicePartitions,t.slicePartitions),this.subdivisions=e(this.subdivisions,t.subdivisions),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/LabelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},text:o("text"),font:o("font"),style:o("style"),fillColor:o("fillColor"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),scale:o("scale"),show:o("show"),showBackground:o("showBackground"),backgroundColor:o("backgroundColor"),backgroundPadding:o("backgroundPadding"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.text=this.text,e.font=this.font,e.show=this.show,e.style=this.style,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.heightReference=this.heightReference,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.text=e(this.text,t.text),this.font=e(this.font,t.font),this.show=e(this.show,t.show),this.style=e(this.style,t.style),this.fillColor=e(this.fillColor,t.fillColor),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.showBackground=e(this.showBackground,t.showBackground),this.backgroundColor=e(this.backgroundColor,t.backgroundColor),this.backgroundPadding=e(this.backgroundPadding,t.backgroundPadding),this.scale=e(this.scale,t.scale),this.horizontalOrigin=e(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.eyeOffset=e(this.eyeOffset,t.eyeOffset),this.heightReference=e(this.heightReference,t.heightReference),this.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},a}),i("DataSources/NodeTransformationProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TranslationRotationScale","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";var s=new n,l=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale};return i(l.prototype,{isConstant:{get:function(){return a.isConstant(this._translation)&&a.isConstant(this._rotation)&&a.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:o("translation"),rotation:o("rotation"),scale:o("scale")}),l.prototype.getValue=function(e,i){return t(i)||(i=new n),i.translation=a.getValueOrClonedDefault(this._translation,e,s.translation,i.translation),i.rotation=a.getValueOrClonedDefault(this._rotation,e,s.rotation,i.rotation),i.scale=a.getValueOrClonedDefault(this._scale,e,s.scale,i.scale),i},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._translation,e._translation)&&a.equals(this._rotation,e._rotation)&&a.equals(this._scale,e._scale)},l});i("DataSources/PropertyBag",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){return new o(e)}function u(e,t){var i=e._propertyNames,r=t._propertyNames,n=i.length;if(n!==r.length)return!1;for(var o=0;o<n;++o){var a=i[o],l=r.indexOf(a);if(l===-1)return!1;if(!s.equals(e[a],t[a]))return!1}return!0}var c=function(e,i){this._propertyNames=[],this._definitionChanged=new n,t(e)&&this.merge(e,i)};return i(c.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){for(var e=this._propertyNames,t=0,i=e.length;t<i;t++)if(!s.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1},c.prototype.addProperty=function(i,r,n){var o=this._propertyNames;o.push(i),Object.defineProperty(this,i,a(i,!0,e(n,l))),t(r)&&(this[i]=r),this._definitionChanged.raiseEvent(this)},c.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e);this._propertyNames.splice(i,1),delete this[e],this._definitionChanged.raiseEvent(this)},c.prototype.getValue=function(e,i){t(i)||(i={});for(var r=this._propertyNames,n=0,o=r.length;n<o;n++){var a=r[n];i[a]=s.getValueOrUndefined(this[a],e,i[a])}return i},c.prototype.merge=function(e,i){for(var r=this._propertyNames,n=t(e._propertyNames)?e._propertyNames:Object.keys(e),o=0,a=n.length;o<a;o++){var s=n[o],l=this[s],u=e[s];t(l)||r.indexOf(s)!==-1||this.addProperty(s,void 0,i),t(u)&&(t(l)?t(l.merge)&&l.merge(u):t(u.merge)&&t(u.clone)?this[s]=u.clone():this[s]=u)}},c.prototype.equals=function(e){return this===e||e instanceof c&&u(this,e)},c});i("DataSources/ModelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor","./NodeTransformationProperty","./PropertyBag"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){return new a(e)}function u(e){return new s(e,l)}function c(t){this._show=void 0,this._showSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(c.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),scale:o("scale"),minimumPixelSize:o("minimumPixelSize"),maximumScale:o("maximumScale"),incrementallyLoadTextures:o("incrementallyLoadTextures"),shadows:o("shadows"),uri:o("uri"),runAnimations:o("runAnimations"),nodeTransformations:o("nodeTransformations",void 0,u),heightReference:o("heightReference"),distanceDisplayCondition:o("distanceDisplayCondition"),silhouetteColor:o("silhouetteColor"),silhouetteSize:o("silhouetteSize"),color:o("color"),colorBlendMode:o("colorBlendMode"),colorBlendAmount:o("colorBlendAmount")}),c.prototype.clone=function(e){return t(e)?(e.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.shadows=this.shadows,e.uri=this.uri,e.runAnimations=this.runAnimations,e.nodeTransformations=this.nodeTransformations,e.heightReference=this._heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e):new c(this)},c.prototype.merge=function(i){this.show=e(this.show,i.show),this.scale=e(this.scale,i.scale),this.minimumPixelSize=e(this.minimumPixelSize,i.minimumPixelSize),this.maximumScale=e(this.maximumScale,i.maximumScale),this.incrementallyLoadTextures=e(this.incrementallyLoadTextures,i.incrementallyLoadTextures),this.shadows=e(this.shadows,i.shadows),this.uri=e(this.uri,i.uri),this.runAnimations=e(this.runAnimations,i.runAnimations),this.heightReference=e(this.heightReference,i.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,i.distanceDisplayCondition),this.silhouetteColor=e(this.silhouetteColor,i.silhouetteColor),this.silhouetteSize=e(this.silhouetteSize,i.silhouetteSize),this.color=e(this.color,i.color),this.colorBlendMode=e(this.colorBlendMode,i.colorBlendMode),this.colorBlendAmount=e(this.colorBlendAmount,i.colorBlendAmount);var r=i.nodeTransformations;if(t(r)){var n=this.nodeTransformations;t(n)?n.merge(r):this.nodeTransformations=new s(r,l)}},c}),i("DataSources/PathGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._material=void 0,this._materialSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),width:a("width"),resolution:a("resolution"),leadTime:a("leadTime"),trailTime:a("trailTime"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.material=this.material,e.width=this.width,e.resolution=this.resolution,e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.material=e(this.material,t.material),this.width=e(this.width,t.width),this.resolution=e(this.resolution,t.resolution),this.show=e(this.show,t.show),this.leadTime=e(this.leadTime,t.leadTime),this.trailTime=e(this.trailTime,t.trailTime),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/PointGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._color=void 0,this._colorSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,
this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),pixelSize:o("pixelSize"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),heightReference:o("heightReference"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.heightReference=this.heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.pixelSize=e(this.pixelSize,t.pixelSize),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.heightReference=e(this.heightReference,t.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},a}),i("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._definitionChanged=new n,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),hierarchy:a("hierarchy"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),perPositionHeight:a("perPositionHeight"),closeTop:a("closeTop"),closeBottom:a("closeBottom"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.hierarchy=this.hierarchy,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.hierarchy=e(this.hierarchy,t.hierarchy),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.perPositionHeight=e(this.perPositionHeight,t.perPositionHeight),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/PolylineGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._followSurface=void 0,this._followSurfaceSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._widthSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),width:a("width"),followSurface:a("followSurface"),granularity:a("granularity"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.width=this.width,e.followSurface=this.followSurface,e.granularity=this.granularity,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.width=e(this.width,t.width),this.followSurface=e(this.followSurface,t.followSurface),this.granularity=e(this.granularity,t.granularity),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/PolylineVolumeGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),shape:a("shape"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.shape=this.shape,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.shape=e(this.shape,t.shape),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/RectangleGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),coordinates:a("coordinates"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),rotation:a("rotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),closeTop:a("closeTop"),closeBottom:a("closeBottom"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.coordinates=this.coordinates,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.rotation=this.rotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.coordinates=e(this.coordinates,t.coordinates),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.rotation=e(this.rotation,t.rotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/WallGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,i,r,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),minimumHeights:a("minimumHeights"),maximumHeights:a("maximumHeights"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.minimumHeights=e(this.minimumHeights,t.minimumHeights),this.maximumHeights=e(this.maximumHeights,t.maximumHeights),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),i("DataSources/Entity",["../Core/Cartesian3","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Transforms","./BillboardGraphics","./BoxGraphics","./ConstantPositionProperty","./CorridorGraphics","./createPropertyDescriptor","./createRawPropertyDescriptor","./CylinderGraphics","./EllipseGraphics","./EllipsoidGraphics","./LabelGraphics","./ModelGraphics","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGraphics","./PolylineVolumeGraphics","./Property","./RectangleGraphics","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D){"use strict";function M(e){return new p(e)}function I(e){return f(e,void 0,M)}function R(e,t){return f(e,void 0,function(e){return e instanceof t?e:new t(e)})}function O(e){e=i(e,i.EMPTY_OBJECT);var n=e.id;r(n)||(n=t()),this._availability=void 0,this._id=n,this._definitionChanged=new a,this._name=e.name,this._show=i(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","orientation","path","point","polygon","polyline","polylineVolume","position","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function N(e,t,i){for(var r=t.length,n=0;n<r;n++){var o=t[n],a=o._show,s=!i&&a,l=i&&a;s!==l&&N(o,o._children,i)}e._definitionChanged.raiseEvent(e,"isShowing",i,!i)}n(O.prototype,{availability:_("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:_("name"),show:{get:function(){return this._show},set:function(e){if(e!==this._show){var t=this.isShowing;this._show=e;var i=this.isShowing;t!==i&&N(this,this._children,i),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!r(this.entityCollection)||this.entityCollection.show)&&(!r(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){var t=this._parent;if(t!==e){var i=this.isShowing;if(r(t)){var n=t._children.indexOf(this);t._children.splice(n,1)}this._parent=e,r(e)&&e._children.push(this);var o=this.isShowing;i!==o&&N(this,this._children,o),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},propertyNames:{get:function(){return this._propertyNames}},billboard:R("billboard",h),box:R("box",d),corridor:R("corridor",m),cylinder:R("cylinder",g),description:f("description"),ellipse:R("ellipse",v),ellipsoid:R("ellipsoid",y),label:R("label",C),model:R("model",w),orientation:f("orientation"),path:R("path",S),point:R("point",E),polygon:R("polygon",b),polyline:R("polyline",T),polylineVolume:R("polylineVolume",x),position:I("position"),rectangle:R("rectangle",P),viewFrom:f("viewFrom"),wall:R("wall",D)}),O.prototype.isAvailable=function(e){var t=this._availability;return!r(t)||t.contains(e)},O.prototype.addProperty=function(e){var t=this._propertyNames;t.push(e),Object.defineProperty(this,e,_(e,!0))},O.prototype.removeProperty=function(e){var t=this._propertyNames,i=t.indexOf(e);this._propertyNames.splice(i,1),delete this[e]},O.prototype.merge=function(e){this.name=i(this.name,e.name),this.availability=i(e.availability,this.availability);for(var t=this._propertyNames,n=r(e._propertyNames)?e._propertyNames:Object.keys(e),o=n.length,a=0;a<o;a++){var s=n[a];if("parent"!==s){var l=this[s],u=e[s];r(l)||t.indexOf(s)!==-1||this.addProperty(s),r(u)&&(r(l)?r(l.merge)&&l.merge(u):r(u.merge)&&r(u.clone)?this[s]=u.clone():this[s]=u)}}};var L=new s,B=new e,F=new u;return O.prototype._getModelMatrix=function(e,t){var i=A.getValueOrUndefined(this._position,e,B);if(r(i)){var n=A.getValueOrUndefined(this._orientation,e,F);return t=r(n)?l.fromRotationTranslation(s.fromQuaternion(n,L),i,t):c.eastNorthUpToFixedFrame(i,void 0,t)}},O}),i("DataSources/EntityCollection",["../Core/AssociativeArray","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Iso8601","../Core/JulianDate","../Core/RuntimeError","../Core/TimeInterval","./Entity"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){if(e._firing)return void(e._refire=!0);if(0===e._suspendCount){var t=e._addedEntities,i=e._removedEntities,r=e._changedEntities;if(0!==r.length||0!==t.length||0!==i.length){e._firing=!0;do{e._refire=!1;var n=t.values.slice(0),o=i.values.slice(0),a=r.values.slice(0);t.removeAll(),i.removeAll(),r.removeAll(),e._collectionChanged.raiseEvent(e,n,o,a)}while(e._refire);e._firing=!1}}}function d(i){this._owner=i,this._entities=new e,this._addedEntities=new e,this._removedEntities=new e,this._changedEntities=new e,this._suspendCount=0,this._collectionChanged=new o,this._id=t(),this._show=!0,this._firing=!1,this._refire=!1}var p={id:void 0};return d.prototype.suspendEvents=function(){this._suspendCount++},d.prototype.resumeEvents=function(){this._suspendCount--,h(this)},d.collectionChangedEventCallback=void 0,r(d.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e!==this._show){this.suspendEvents();var t,i=[],r=this._entities.values,n=r.length;for(t=0;t<n;t++)i.push(r[t].isShowing);for(this._show=e,t=0;t<n;t++){var o=i[t],a=r[t];o!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,o)}this.resumeEvents()}}},owner:{get:function(){return this._owner}}}),d.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,r=this._entities.values,n=0,o=r.length;n<o;n++){var l=r[n],c=l.availability;if(i(c)){var h=c.start,d=c.stop;s.lessThan(h,e)&&!h.equals(a.MINIMUM_VALUE)&&(e=h),s.greaterThan(d,t)&&!d.equals(a.MAXIMUM_VALUE)&&(t=d)}}return a.MAXIMUM_VALUE.equals(e)&&(e=a.MINIMUM_VALUE),a.MINIMUM_VALUE.equals(t)&&(t=a.MAXIMUM_VALUE),new u({start:e,stop:t})},d.prototype.add=function(e){e instanceof c||(e=new c(e));var t=e.id,i=this._entities;if(i.contains(t))throw new l("An entity with id "+t+" already exists in this collection.");return e.entityCollection=this,i.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(d.prototype._onEntityDefinitionChanged,this),h(this),e},d.prototype.remove=function(e){return!!i(e)&&this.removeById(e.id)},d.prototype.contains=function(e){return this._entities.get(e.id)===e},d.prototype.removeById=function(e){if(!i(e))return!1;var t=this._entities,r=t.get(e);return!!this._entities.remove(e)&&(this._addedEntities.remove(e)||(this._removedEntities.set(e,r),this._changedEntities.remove(e)),this._entities.remove(e),r.definitionChanged.removeEventListener(d.prototype._onEntityDefinitionChanged,this),h(this),!0)},d.prototype.removeAll=function(){for(var e=this._entities,t=e.length,r=e.values,n=this._addedEntities,o=this._removedEntities,a=0;a<t;a++){var s=r[a],l=s.id,u=n.get(l);i(u)||(s.definitionChanged.removeEventListener(d.prototype._onEntityDefinitionChanged,this),o.set(l,s))}e.removeAll(),n.removeAll(),this._changedEntities.removeAll(),h(this)},d.prototype.getById=function(e){return this._entities.get(e)},d.prototype.getOrCreateEntity=function(e){var t=this._entities.get(e);return i(t)||(p.id=e,t=new c(p),this.add(t)),t},d.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),h(this)},d}),i("DataSources/CompositeEntityCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./Entity","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,i=t.length,r=0;r<i;r++)e[t[r]]=void 0}function l(e,t,i,r){f[0]=i,f[1]=r.id,t[JSON.stringify(f)]=r.definitionChanged.addEventListener(h.prototype._onDefinitionChanged,e)}function u(e,t,i,r){f[0]=i,f[1]=r.id;var n=JSON.stringify(f);t[n](),t[n]=void 0}function c(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var i,r,n,c,d,p,f=e._collections,_=f.length,g=e._collectionsCopy,v=g.length,y=e._composite,C=new a(e),w=e._eventHash;for(i=0;i<v;i++)for(d=g[i],d.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,e),n=d.values,p=d.id,c=n.length-1;c>-1;c--)r=n[c],u(e,w,p,r);for(i=_-1;i>=0;i--)for(d=f[i],d.collectionChanged.addEventListener(h.prototype._onCollectionChanged,e),n=d.values,p=d.id,c=n.length-1;c>-1;c--){r=n[c],l(e,w,p,r);var S=C.getById(r.id);t(S)||(S=y.getById(r.id),t(S)?s(S):(m.id=r.id,S=new o(m)),C.add(S)),S.merge(r)}e._collectionsCopy=f.slice(0),y.suspendEvents(),y.removeAll();var E=C.values;for(i=0;i<E.length;i++)y.add(E[i]);y.resumeEvents()}}function h(i,r){this._owner=r,this._composite=new a(this),this._suspendCount=0,this._collections=t(i)?i.slice():[],this._collectionsCopy=[],this._id=e(),this._eventHash={},c(this),this._shouldRecomposite=!1}function d(e,t){var i=e.indexOf(t);return i}function p(e,t,i){var r=e._collections;if(t=n.clamp(t,0,r.length-1),i=n.clamp(i,0,r.length-1),t!==i){var o=r[t];r[t]=r[i],r[i]=o,c(e)}}var m={id:void 0},f=new Array(2);return i(h.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}}),h.prototype.addCollection=function(e,i){var r=t(i);r?this._collections.splice(i,0,e):(i=this._collections.length,this._collections.push(e)),c(this)},h.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return t!==-1&&(this._collections.splice(t,1),c(this),!0)},h.prototype.removeAllCollections=function(){this._collections.length=0,c(this)},h.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1},h.prototype.contains=function(e){return this._composite.contains(e)},h.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},h.prototype.getCollection=function(e){return this._collections[e]},h.prototype.getCollectionsLength=function(){return this._collections.length},h.prototype.raiseCollection=function(e){var t=d(this._collections,e);p(this,t,t+1)},h.prototype.lowerCollection=function(e){var t=d(this._collections,e);p(this,t,t-1)},h.prototype.raiseCollectionToTop=function(e){var t=d(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),c(this))},h.prototype.lowerCollectionToBottom=function(e){var t=d(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),c(this))},h.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},h.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(c(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},h.prototype.computeAvailability=function(){return this._composite.computeAvailability()},h.prototype.getById=function(e){return this._composite.getById(e)},h.prototype._onCollectionChanged=function(e,i,r){var n=this._collectionsCopy,a=n.length,c=this._composite;c.suspendEvents();var h,d,p,f,_=r.length,g=this._eventHash,v=e.id;for(h=0;h<_;h++){var y=r[h];u(this,g,v,y);var C=y.id;for(d=a-1;d>=0;d--)p=n[d].getById(C),t(p)&&(t(f)||(f=c.getById(C),s(f)),f.merge(p));t(f)||c.removeById(C),f=void 0}var w=i.length;for(h=0;h<w;h++){var S=i[h];l(this,g,v,S);var E=S.id;for(d=a-1;d>=0;d--)p=n[d].getById(E),t(p)&&(t(f)||(f=c.getById(E),t(f)?s(f):(m.id=E,f=new o(m),c.add(f))),f.merge(p));f=void 0}c.resumeEvents()},h.prototype._onDefinitionChanged=function(e,i,r,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[i],h=!t(c),d=!0,p=s-1;p>=0;p--){var m=o[p].getById(e.id);if(t(m)){var f=m[i];if(t(f)){if(d){if(d=!1,!t(f.merge)||!t(f.clone)){c=f;break}c=f.clone(c)}c.merge(f)}}}h&&u.propertyNames.indexOf(i)===-1&&u.addProperty(i),u[i]=c},h}),i("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){function o(){r.raiseEvent(t)}var a=[];i.removeAll();for(var s=n.length,l=0;l<s;l++){var u=n.get(l);e(u.data)&&a.indexOf(u.data)===-1&&i.add(u.data.definitionChanged,o)}}function l(){this._eventHelper=new n,this._definitionChanged=new r,this._intervals=new o,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)}return t(l.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);if(e(r))return r.getValue(t,i)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._intervals.equals(e._intervals,a.equals)},l.prototype._intervalsChanged=function(){s(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},l}),i("DataSources/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,i,r,n,o){"use strict";function a(){this._definitionChanged=new r,this._composite=new n,this._composite.definitionChanged.addEventListener(a.prototype._raiseDefinitionChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),a.prototype.getType=function(t){var i=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(i))return i.getType(t)},a.prototype.getValue=function(t,i){var r=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(r))return r.getValue(t,i)},a.prototype.equals=function(e){return this===e||e instanceof a&&this._composite.equals(e._composite,o.equals)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._referenceFrame=e(t,o.FIXED),this._definitionChanged=new n,this._composite=new a,this._composite.definitionChanged.addEventListener(l.prototype._raiseDefinitionChanged,this)}return i(l.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._composite._intervals.findDataForIntervalContainingDate(e);if(t(n))return n.getValueInReferenceFrame(e,i,r)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,s.equals)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),i("Shaders/ShadowVolumeFS",[],function(){"use strict";return"#extension GL_EXT_frag_depth : enable\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvoid writeDepthClampedToFarPlane()\n{\ngl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n}\nvoid main(void)\n{\ngl_FragColor = v_color;\nwriteDepthClampedToFarPlane();\n}\n"}),i("Shaders/ShadowVolumeVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvec4 depthClampFarPlane(vec4 vertexInClipCoordinates)\n{\nv_WindowZ = (0.5 * (vertexInClipCoordinates.z / vertexInClipCoordinates.w) + 0.5) * vertexInClipCoordinates.w;\nvertexInClipCoordinates.z = min(vertexInClipCoordinates.z, vertexInClipCoordinates.w);\nreturn vertexInClipCoordinates;\n}\nvoid main()\n{\nv_color = color;\nvec4 position = czm_computePosition();\ngl_Position = depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n";
}),i("Scene/DepthFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(i)}),i("Scene/StencilFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(i)}),i("Scene/StencilOperation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,KEEP:t.KEEP,REPLACE:t.REPLACE,INCREMENT:t.INCR,DECREMENT:t.DECR,INVERT:t.INVERT,INCREMENT_WRAP:t.INCR_WRAP,DECREMENT_WRAP:t.DECR_WRAP};return e(i)}),i("Scene/GroundPrimitive",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/GeometryInstance","../Core/isArray","../Core/loadJson","../Core/Math","../Core/OrientedBoundingBox","../Core/Rectangle","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeVS","../ThirdParty/when","./BlendingState","./DepthFunction","./PerInstanceColorAppearance","./Primitive","./SceneMode","./StencilFunction","./StencilOperation"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O){"use strict";function N(e){e=s(e,s.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.show=s(e.show,!0),this.debugShowBoundingVolume=s(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=s(e.debugShowShadowVolume,!1),this._sp=void 0,this._spPick=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilDepthPass=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._uniformMap={},this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=x.defer(),this._primitive=void 0,this._debugPrimitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=N._defaultMaxTerrainHeight,this._minTerrainHeight=N._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[];var t,i=new D({flat:!0});l(this.geometryInstances)&&m(this.geometryInstances)&&this.geometryInstances.length>1&&(t=X),this._primitiveOptions={geometryInstances:void 0,appearance:i,vertexCacheOptimize:s(e.vertexCacheOptimize,!1),interleave:s(e.interleave,!1),releaseGeometryInstances:s(e.releaseGeometryInstances,!0),allowPicking:s(e.allowPicking,!0),asynchronous:s(e.asynchronous,!0),compressVertices:s(e.compressVertices,!0),_readOnlyInstanceAttributes:t,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_createPickOffsets:!0}}function L(e){return function(t,i){var r=i.maximumRadius,n=r/Math.cos(.5*t)-r;return e._maxHeight+n}}function B(e){return function(t,i){return e._minHeight}}function F(e,t){var i=e.mapProjection.ellipsoid;{if(l(t.attributes)&&l(t.attributes.position3DHigh)){for(var n=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,a=n.length,s=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,d=0;d<a;d+=3){var p=r.unpack(n,d,$),m=r.unpack(o,d,ee),f=r.add(p,m,te),_=i.cartesianToCartographic(f,ie),g=_.latitude,v=_.longitude;s=Math.min(s,g),u=Math.min(u,v),c=Math.max(c,g),h=Math.max(h,v)}var y=re;return y.north=c,y.south=s,y.east=h,y.west=u,y}if(l(t.rectangle))return t.rectangle}}function V(e){n.fromRadians(e.east,e.north,0,oe[0]),n.fromRadians(e.west,e.north,0,oe[1]),n.fromRadians(e.east,e.south,0,oe[2]),n.fromRadians(e.west,e.south,0,oe[3]);for(var t=0,i=0,r=0,o=0,a=N._terrainHeightsMaxLevel,s=0;s<=a;++s){for(var l=!1,u=0;u<4;++u){var c=oe[u];if(ne.positionToTileXY(c,s,ae),0===u)r=ae.x,o=ae.y;else if(r!==ae.x||o!==ae.y){l=!0;break}}if(l)break;t=r,i=o}if(0!==s)return{x:t,y:i,level:s>a?a:s-1}}function k(e,t,i){var n=V(t),o=N._defaultMinTerrainHeight,a=N._defaultMaxTerrainHeight;if(l(n)){var s=n.level+"-"+n.x+"-"+n.y,u=N._terrainHeights[s];l(u)&&(o=u[0],a=u[1]),i.cartographicToCartesian(v.northeast(t,ue),se),i.cartographicToCartesian(v.southwest(t,ue),le),r.subtract(le,se,ce),r.add(se,r.multiplyByScalar(ce,.5,ce),ce);var c=i.scaleToGeodeticSurface(ce,he);if(l(c)){var h=r.distance(ce,c);o=Math.min(o,-h)}else o=N._defaultMinTerrainHeight}e._minTerrainHeight=Math.max(N._defaultMinTerrainHeight,o),e._maxTerrainHeight=a}function z(t,i){var r=V(t),n=N._defaultMaxTerrainHeight;if(l(r)){var o=r.level+"-"+r.x+"-"+r.y,a=N._terrainHeights[o];l(a)&&(n=a[1])}var s=e.fromRectangle3D(t,i,0);return e.fromRectangle3D(t,i,n,de),e.union(s,de,s)}function U(t,i,n){var o=i.mapProjection.ellipsoid,a=F(i,n);if(a.width<_.PI){var s=g.fromRectangle(a,t._maxHeight,t._minHeight,o);t._boundingVolumes.push(s)}else{var l=n.attributes.position3DHigh.values,u=n.attributes.position3DLow.values;t._boundingVolumes.push(e.fromEncodedCartesianVertices(l,u))}if(!i.scene3DOnly){var c=i.mapProjection,h=e.fromRectangleWithHeights2D(a,c,t._maxHeight,t._minHeight);r.fromElements(h.center.z,h.center.x,h.center.y,h.center),t._boundingVolumes2D.push(h)}}function G(e,t,i,r){l(e._rsStencilPreloadPass)||(e._rsStencilPreloadPass=w.fromCache(Z),e._rsStencilDepthPass=w.fromCache(K),e._rsColorPass=w.fromCache(Q),e._rsPickPass=w.fromCache(J))}function W(e,t,i){if(!l(e._sp)){var r=t.context,n=T;n=e._primitive._batchTable.getVertexShaderCallback()(n),n=M._appendShowToShader(e._primitive,n),n=M._appendDistanceDisplayConditionToShader(e._primitive,n),n=M._modifyShaderPosition(e,n,t.scene3DOnly),n=M._updateColorAttribute(e._primitive,n);var o=b,a=e._primitive._attributeLocations;if(e._sp=S.replaceCache({context:r,shaderProgram:e._sp,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a}),e._primitive.allowPicking){var s=E.createPickVertexShaderSource(n);s=M._updatePickColorAttribute(s);var u=new E({sources:[o],pickColorQualifier:"varying"});e._spPick=S.replaceCache({context:r,shaderProgram:e._spPick,vertexShaderSource:s,fragmentShaderSource:u,attributeLocations:a})}else e._spPick=S.fromCache({context:r,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:a})}}function H(e,t){var i=e._primitive,r=3*i._va.length;t.length=r;for(var n=0,o=i._batchTable.getUniformMapCallback()(e._uniformMap),a=0;a<r;a+=3){var s=i._va[n++],u=t[a];l(u)||(u=t[a]=new y({owner:e,primitiveType:i._primitiveType})),u.vertexArray=s,u.renderState=e._rsStencilPreloadPass,u.shaderProgram=e._sp,u.uniformMap=o,u.pass=C.GROUND,u=t[a+1],l(u)||(u=t[a+1]=new y({owner:e,primitiveType:i._primitiveType})),u.vertexArray=s,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=o,u.pass=C.GROUND,u=t[a+2],l(u)||(u=t[a+2]=new y({owner:e,primitiveType:i._primitiveType})),u.vertexArray=s,u.renderState=e._rsColorPass,u.shaderProgram=e._sp,u.uniformMap=o,u.pass=C.GROUND}}function q(e,t){var i=e._primitive,r=i._pickOffsets,n=3*r.length;t.length=n;for(var o=0,a=i._batchTable.getUniformMapCallback()(e._uniformMap),s=0;s<n;s+=3){var u=r[o++],c=u.offset,h=u.count,d=i._va[u.index],p=t[s];l(p)||(p=t[s]=new y({owner:e,primitiveType:i._primitiveType})),p.vertexArray=d,p.offset=c,p.count=h,p.renderState=e._rsStencilPreloadPass,p.shaderProgram=e._sp,p.uniformMap=a,p.pass=C.GROUND,p=t[s+1],l(p)||(p=t[s+1]=new y({owner:e,primitiveType:i._primitiveType})),p.vertexArray=d,p.offset=c,p.count=h,p.renderState=e._rsStencilDepthPass,p.shaderProgram=e._sp,p.uniformMap=a,p.pass=C.GROUND,p=t[s+2],l(p)||(p=t[s+2]=new y({owner:e,primitiveType:i._primitiveType})),p.vertexArray=d,p.offset=c,p.count=h,p.renderState=e._rsPickPass,p.shaderProgram=e._spPick,p.uniformMap=a,p.pass=C.GROUND}}function j(e,t,i,r,n,o,a){H(e,o),q(e,a)}function Y(e,t,i,r,n,o,a,s){var u;t.mode===I.SCENE3D?u=e._boundingVolumes:t.mode!==I.SCENE3D&&l(e._boundingVolumes2D)&&(u=e._boundingVolumes2D);var c=t.commandList,h=t.passes;if(h.render)for(var d=i.length,p=0;p<d;++p)i[p].modelMatrix=n,i[p].boundingVolume=u[Math.floor(p/3)],i[p].cull=o,i[p].debugShowBoundingVolume=a,c.push(i[p]);if(h.pick){var m=e._primitive,f=m._pickOffsets,_=3*f.length;r.length=_;for(var g=0,v=0;v<_;v+=3){var y=f[g++],C=u[y.index];r[v].modelMatrix=n,r[v].boundingVolume=C,r[v].cull=o,r[v+1].modelMatrix=n,r[v+1].boundingVolume=C,r[v+1].cull=o,r[v+2].modelMatrix=n,r[v+2].boundingVolume=C,r[v+2].cull=o,c.push(r[v],r[v+1],r[v+2])}}}var X=["color"];u(N.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),N.isSupported=function(e){return e.context.fragmentDepth&&e.context.stencilBuffer},N._defaultMaxTerrainHeight=9e3,N._defaultMinTerrainHeight=-1e5,N._terrainHeights=void 0,N._terrainHeightsMaxLevel=6;var Z={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:R.ALWAYS,frontOperation:{fail:O.KEEP,zFail:O.DECREMENT_WRAP,zPass:O.DECREMENT_WRAP},backFunction:R.ALWAYS,backOperation:{fail:O.KEEP,zFail:O.INCREMENT_WRAP,zPass:O.INCREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},K={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:R.ALWAYS,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.INCREMENT_WRAP},backFunction:R.ALWAYS,backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!0,func:P.LESS_OR_EQUAL},depthMask:!1},Q={stencilTest:{enabled:!0,frontFunction:R.NOT_EQUAL,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.DECREMENT_WRAP},backFunction:R.NOT_EQUAL,backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1,blending:A.ALPHA_BLEND},J={stencilTest:{enabled:!0,frontFunction:R.NOT_EQUAL,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.DECREMENT_WRAP},backFunction:R.NOT_EQUAL,backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},$=new r,ee=new r,te=new r,ie=new n,re=new v,ne=new d,oe=[new n,new n,new n,new n],ae=new i,se=new r,le=new r,ue=new n,ce=new r,he=new r,de=new e;return N._initialized=!1,N._initPromise=void 0,N.initializeTerrainHeights=function(){var e=N._initPromise;return l(e)?e:(N._initPromise=f(t("Assets/approximateTerrainHeights.json")).then(function(e){N._initialized=!0,N._terrainHeights=e}),N._initPromise)},N.prototype.update=function(e){var t=e.context;if(t.fragmentDepth&&this.show&&(l(this._primitive)||l(this.geometryInstances))){if(!N._initialized)return void N.initializeTerrainHeights();if(!l(this._primitive)){var i,r,n,s,u,c=this._primitiveOptions,h=e.mapProjection.ellipsoid,d=m(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],f=d.length,_=new Array(f);for(s=0;s<f;++s){i=d[s],r=i.geometry;var g=F(e,r);l(u)?l(g)&&v.union(u,g,u):u=g;var y=i.id;if(l(y)&&l(g)){var C=z(g,h);this._boundingSpheresKeys.push(y),this._boundingSpheres.push(C)}if(n=r.constructor,l(n)&&l(n.createShadowVolume)){i.attributes}}k(this,u,e.mapProjection.ellipsoid);var w=e.terrainExaggeration;for(this._minHeight=this._minTerrainHeight*w,this._maxHeight=this._maxTerrainHeight*w,s=0;s<f;++s)i=d[s],r=i.geometry,n=r.constructor,_[s]=new p({geometry:n.createShadowVolume(r,B(this),L(this)),attributes:i.attributes,id:i.id,pickPrimitive:this});c.geometryInstances=_;var S=this;c._createBoundingVolumeFunction=function(e,t){U(S,e,t)},c._createRenderStatesFunction=function(e,t,i,r){G(S,t)},c._createShaderProgramFunction=function(e,t,i){W(S,t)},c._createCommandsFunction=function(e,t,i,r,n,o,a){j(S,void 0,void 0,!0,!1,o,a)},c._updateAndQueueCommandsFunction=function(e,t,i,r,n,o,a,s){Y(S,t,i,r,n,o,a,s)},this._primitive=new M(c),this._primitive.readyPromise.then(function(e){S._ready=!0,S.releaseGeometryInstances&&(S.geometryInstances=void 0);var t=e._error;l(t)?S._readyPromise.reject(t):S._readyPromise.resolve(S)})}if(this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),this.debugShowShadowVolume&&!l(this._debugPrimitive)&&l(this.geometryInstances)){for(var E=m(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],b=E.length,T=new Array(b),x=0;x<b;++x){var A=E[x],P=A.geometry,I=P.constructor;if(l(I)&&l(I.createShadowVolume)){var R=A.attributes.color.value,O=o.fromBytes(R[0],R[1],R[2],R[3]);o.subtract(new o(1,1,1,0),O,O),T[x]=new p({geometry:I.createShadowVolume(P,B(this),L(this)),attributes:{color:a.fromColor(O)},id:A.id,pickPrimitive:this})}}this._debugPrimitive=new M({geometryInstances:T,releaseGeometryInstances:!0,allowPicking:!1,asynchronous:!1,appearance:new D({flat:!0})})}l(this._debugPrimitive)&&(this.debugShowShadowVolume?this._debugPrimitive.update(e):(this._debugPrimitive.destroy(),this._debugPrimitive=void 0))}},N.prototype.getBoundingSphere=function(e){var t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]},N.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._debugPrimitive=this._debugPrimitive&&this._debugPrimitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),c(this)},N}),i("DataSources/CorridorGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CorridorGeometry","../Core/CorridorOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new u),B=new e;return a(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),a(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayCondition}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new f(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),h=c.fromDistanceDisplayCondition(this._distanceDisplayCondition.getValue(r));if(this._materialProperty instanceof w){var p=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(p=this._materialProperty.color.getValue(r)),a=t.fromColor(p),n={show:u,distanceDisplayCondition:h,color:a}}else n={show:u,distanceDisplayCondition:h};return new d({id:s,geometry:new i(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK);return new d({id:n,geometry:new r(this._options),attributes:{show:new f(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(this._distanceDisplayCondition.getValue(i))}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),s(this)},A.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"corridor"===t){var a=this._entity.corridor;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.positions,d=a.show;if(o(d)&&d.isConstant&&!d.getValue(p.MINIMUM_VALUE)||!o(h))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=n(a.material,D),y=f instanceof w;this._materialProperty=f,this._fillProperty=n(s,I),this._showProperty=n(d,M),this._showOutlineProperty=n(a.outline,R),this._outlineColorProperty=c?n(a.outlineColor,O):void 0,this._shadowsProperty=n(a.shadows,N),this._distanceDisplayCondition=n(a.distanceDisplayCondition,L);var C=a.height,S=a.extrudedHeight,E=a.granularity,b=a.width,x=a.outlineWidth,A=a.cornerType,P=l&&!o(C)&&!o(S)&&y&&_.isSupported(this._scene);if(c&&P&&(m(m.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=P,this._isClosed=o(S)||P,this._outlineEnabled=c,h.isConstant&&T.isConstant(C)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&(!P||T.isConstant(f))){var B=this._options;B.vertexFormat=y?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,B.positions=h.getValue(p.MINIMUM_VALUE,B.positions),B.height=o(C)?C.getValue(p.MINIMUM_VALUE):void 0,B.extrudedHeight=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,B.granularity=o(E)?E.getValue(p.MINIMUM_VALUE):void 0,B.width=o(b)?b.getValue(p.MINIMUM_VALUE):void 0,B.cornerType=o(A)?A.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(x)?x.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(n){var a=this._geometryUpdater,s=a._onTerrain,l=this._primitives,u=this._groundPrimitives;s?u.removeAndDestroy(this._primitive):(l.removeAndDestroy(this._primitive),l.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var h=a._entity,p=h.corridor;if(h.isShowing&&h.isAvailable(n)&&T.getValueOrDefault(p.show,n,!0)){var m=this._options,f=T.getValueOrUndefined(p.positions,n,m.positions),C=T.getValueOrUndefined(p.width,n);if(o(f)&&o(C)){m.positions=f,m.width=C,m.height=T.getValueOrUndefined(p.height,n),m.extrudedHeight=T.getValueOrUndefined(p.extrudedHeight,n),m.granularity=T.getValueOrUndefined(p.granularity,n),m.cornerType=T.getValueOrUndefined(p.cornerType,n);var w=this._geometryUpdater.shadowsProperty.getValue(n),S=this._geometryUpdater.distanceDisplayConditionProperty.getValue(n),E=c.fromDistanceDisplayCondition(S);if(!o(p.fill)||p.fill.getValue(n)){var x=a.fillMaterialProperty,A=b.getValue(n,x,this._material);if(this._material=A,s){var P=e.WHITE;o(x.color)&&(P=x.color.getValue(n)),this._primitive=u.add(new _({geometryInstances:new d({id:h,geometry:new i(m),attributes:{color:t.fromColor(P),distanceDisplayCondition:E}}),asynchronous:!1,shadows:w}))}else{var D=new g({material:A,translucent:A.isTranslucent(),closed:o(m.extrudedHeight)});m.vertexFormat=D.vertexFormat,this._primitive=l.add(new y({geometryInstances:new d({id:h,geometry:new i(m),attributes:{distanceDisplayCondition:E}}),appearance:D,asynchronous:!1,shadows:w}))}}if(!s&&o(p.outline)&&p.outline.getValue(n)){m.vertexFormat=v.VERTEX_FORMAT;var M=T.getValueOrClonedDefault(p.outlineColor,n,e.BLACK,B),I=T.getValueOrDefault(p.outlineWidth,n,1),R=1!==M.alpha;this._outlinePrimitive=l.add(new y({geometryInstances:new d({id:h,geometry:new r(m),attributes:{color:t.fromColor(M),distanceDisplayCondition:E}}),appearance:new v({flat:!0,translucent:R,renderState:{lineWidth:a._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:w}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},A}),i("DataSources/DataSource",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{name:{get:t.throwInstantiationError},clock:{get:t.throwInstantiationError},entities:{get:t.throwInstantiationError},isLoading:{get:t.throwInstantiationError},changedEvent:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError},loadingEvent:{get:t.throwInstantiationError},show:{get:t.throwInstantiationError},clustering:{get:t.throwInstantiationError}}),i.prototype.update=t.throwInstantiationError,i.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))},i}),i("Scene/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","../Core/Transforms","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,n,o){var a=n.viewMatrix,s=l.multiplyByVector(a,r.fromElements(e.x,e.y,e.z,1,v),v),u=i.multiplyComponents(t,i.normalize(s,y),y);return s.x+=t.x+u.x,s.y+=t.y+u.y,s.z+=u.z,l.multiplyByVector(n.frustum.projectionMatrix,s,o)}var d={},p=new r(0,0,0,1),m=new r,f=new e,_=new t,g=new t;d.wgs84ToWindowCoordinates=function(e,t,r){return d.wgs84WithEyeOffsetToWindowCoordinates(e,t,i.ZERO,r)};var v=new r,y=new i,C=new n(Math.PI,s.PI_OVER_TWO),w=new i,S=new i;d.wgs84WithEyeOffsetToWindowCoordinates=function(e,r,n,a){var v=e.frameState,y=d.computeActualWgs84Position(v,r,p);if(o(y)){var E=e.canvas,b=f;b.x=0,b.y=0,b.width=E.clientWidth,b.height=E.clientHeight;var T=e.camera,x=!1;if(v.mode===c.SCENE2D){var A=e.mapProjection,P=C,D=A.project(P,w),M=i.clone(T.position,S),I=T.frustum.clone(),R=l.computeViewportTransformation(b,0,1,new l),O=T.frustum.projectionMatrix,N=T.positionWC.y,L=i.fromElements(s.sign(N)*D.x-N,0,-T.positionWC.x),B=u.pointToGLWindowCoordinates(O,R,L);if(0===N||B.x<=0||B.x>=E.clientWidth)x=!0;else{if(B.x>.5*E.clientWidth){b.width=B.x,T.frustum.right=D.x-N,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,_),b.x+=B.x,T.position.x=-T.position.x;var F=T.frustum.right;T.frustum.right=-T.frustum.left,T.frustum.left=-F,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,g)}else{b.x+=B.x,b.width-=B.x,T.frustum.left=-D.x-N,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,_),b.x=b.x-b.width,T.position.x=-T.position.x;var V=T.frustum.left;T.frustum.left=-T.frustum.right,T.frustum.right=-V,m=h(y,n,T,m),d.clipToGLWindowCoordinates(b,m,g)}i.clone(M,T.position),T.frustum=I.clone(),a=t.clone(_,a),(a.x<0||a.x>E.clientWidth)&&(a.x=g.x)}}if(v.mode!==c.SCENE2D||x){if(m=h(y,n,T,m),m.z<0&&v.mode!==c.SCENE2D)return;a=d.clipToGLWindowCoordinates(b,m,a)}return a.y=E.clientHeight-a.y,a}},d.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(i=d.wgs84ToWindowCoordinates(e,t,i),o(i))return d.transformWindowToDrawingBuffer(e,i,i)};var E=new i,b=new n;d.computeActualWgs84Position=function(e,t,r){var n=e.mode;if(n===c.SCENE3D)return i.clone(t,r);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,b);if(o(l)){if(a.project(l,E),n===c.COLUMBUS_VIEW)return i.fromElements(E.z,E.x,E.y,r);if(n===c.SCENE2D)return i.fromElements(0,E.x,E.y,r);var u=e.morphTime;return i.fromElements(s.lerp(E.z,t.x,u),s.lerp(E.x,t.y,u),s.lerp(E.y,t.z,u),r)}};var T=new i,x=new i,A=new l;d.clipToGLWindowCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,T),l.computeViewportTransformation(e,0,1,A),l.multiplyByPoint(A,T,x),t.fromCartesian3(x,n)},d.clipToDrawingBufferCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,T),l.computeViewportTransformation(e,0,1,A),l.multiplyByPoint(A,T,x),t.fromCartesian3(x,n)},d.transformWindowToDrawingBuffer=function(e,i,r){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(i.x*o,i.y*a,r)};var P=new r,D=new r;return d.drawingBufferToWgs84Coordinates=function(e,t,n,o){var a=e.context,s=a.uniformState,u=e._passState.viewport,c=r.clone(r.UNIT_W,P);c.x=(t.x-u.x)/u.width*2-1,c.y=(t.y-u.y)/u.height*2-1,c.z=2*n-1,c.w=1;var h=l.multiplyByVector(s.inverseViewProjection,c,D),d=1/h.w;return i.multiplyByScalar(h,d,h),i.fromCartesian4(h,o)},d}),i("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v){"use strict";function y(e,r){e=s(e,s.EMPTY_OBJECT),this._show=s(e.show,!0),this._position=i.clone(s(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=i.clone(s(e.eyeOffset,i.ZERO)),this._heightReference=s(e.heightReference,m.NONE),this._verticalOrigin=s(e.verticalOrigin,v.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,f.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=i.clone(s(e.alignedAxis,i.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._sizeInMeters=s(e.sizeInMeters,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._id=e.id,this._collection=s(e.collection,r),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=r,this._dirty=!1,this._index=-1,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0;var n=e.image,u=e.imageId;l(n)&&(l(u)||(u="string"==typeof n?n:l(n.src)?n.src:a()),this._imageId=u,this._image=n),l(e.imageSubRegion)&&(this._imageId=u,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=_.SCENE3D,this._clusterShow=!0,this._updateClamping()}function C(e,t){var i=e._billboardCollection;l(i)&&(i._updateBillboard(e,t),e._dirty=!0)}var w=y.SHOW_INDEX=0,S=y.POSITION_INDEX=1,E=y.PIXEL_OFFSET_INDEX=2,b=y.EYE_OFFSET_INDEX=3,T=y.HORIZONTAL_ORIGIN_INDEX=4,x=y.VERTICAL_ORIGIN_INDEX=5,A=y.SCALE_INDEX=6,P=y.IMAGE_INDEX_INDEX=7,D=y.COLOR_INDEX=8,M=y.ROTATION_INDEX=9,I=y.ALIGNED_AXIS_INDEX=10,R=y.SCALE_BY_DISTANCE_INDEX=11,O=y.TRANSLUCENCY_BY_DISTANCE_INDEX=12,N=y.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,L=y.DISTANCE_DISPLAY_CONDITION=14;y.NUMBER_OF_PROPERTIES=15,u(y.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,C(this,w))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),this._updateClamping(),C(this,S))}},heightReference:{get:function(){return this._heightReference},set:function(e){var t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),C(this,S))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;t.equals(i,e)||(t.clone(e,i),C(this,E))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;p.equals(t,e)||(this._scaleByDistance=p.clone(e,t),C(this,R))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;p.equals(t,e)||(this._translucencyByDistance=p.clone(e,t),C(this,O))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;p.equals(t,e)||(this._pixelOffsetScaleByDistance=p.clone(e,t),C(this,N))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;i.equals(t,e)||(i.clone(e,t),C(this,b))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,C(this,T))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,C(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,C(this,A))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),C(this,D))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,C(this,M))}},alignedAxis:{
get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;i.equals(t,e)||(i.clone(e,t),C(this,I))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,C(this,P))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,C(this,P))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,C(this,D))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){h.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=h.clone(e,this._distanceDisplayCondition),C(this,L))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):l(e.src)?this.setImage(e.src,e):this.setImage(a(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,C(this,P))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition),C(this,S)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,C(this,w))}}}),y.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},y.prototype._updateClamping=function(){y._updateClamping(this._billboardCollection,this)};var B=new n,F=new i;y._updateClamping=function(e,t){function r(e){if(t._heightReference===m.RELATIVE_TO_GROUND)if(t._mode===_.SCENE3D){var r=s.cartesianToCartographic(e,B);r.height+=d.height,s.cartographicToCartesian(r,e)}else e.x+=d.height;t._clampedPosition=i.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)){var a=o.globe,s=a.ellipsoid,u=a._surface,c=o.frameState.mode,h=c!==t._mode;if(t._mode=c,(t._heightReference===m.NONE||h)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==m.NONE&&l(t._position)){var d=s.cartesianToCartographic(t._position);if(l(d)){l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(d,r),n.clone(d,B);var p=a.getHeight(d);l(p)&&(B.height=p),s.cartographicToCartesian(B,F),r(F)}}}},y.prototype._loadImage=function(){var t,i=this._billboardCollection._textureAtlas,r=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=i.addImage(r,n)),l(o)&&(t=i.addSubRegion(r,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===r&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=i.textureCoordinates[t];a._imageWidth=i.texture.width*s.width,a._imageHeight=i.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,C(a,P)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},y.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype.setImageSubRegion=function(t,i){this._imageId===t&&e.equals(this._imageSubRegion,i)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(i),l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype._setTranslate=function(e){var i=this._translate;t.equals(i,e)||(t.clone(e,i),C(this,E))},y.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},y.prototype._setActualPosition=function(e){l(this._clampedPosition)||i.clone(e,this._actualPosition),C(this,S)};var V=new r;y._computeActualPosition=function(e,t,i,r){return l(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===_.SCENE3D?t:(d.multiplyByPoint(r,t,V),g.computeActualWgs84Position(i,V))};var k=new i;y._computeScreenSpacePosition=function(e,i,r,n,o,a){var s=d.multiplyByPoint(e,i,k),u=g.wgs84WithEyeOffsetToWindowCoordinates(o,s,r,a);if(l(u))return t.add(u,n,u),u};var z=new t(0,0);return y.prototype.computeScreenSpacePosition=function(e,i){var r=this._billboardCollection;l(i)||(i=new t),t.clone(this._pixelOffset,z),t.add(z,this._translate,z);var n=r.modelMatrix,o=this._getActualPosition(),a=y._computeScreenSpacePosition(n,o,this._eyeOffset,z,e,i);return a},y.getScreenSpaceBoundingBox=function(t,i,r){var n=t.width,o=t.height,a=t.scale;n*=a,o*=a;var s=i.x;t.horizontalOrigin===f.RIGHT?s-=n:t.horizontalOrigin===f.CENTER&&(s-=.5*n);var u=i.y;return t.verticalOrigin===v.BOTTOM||t.verticalOrigin===v.BASELINE?u-=o:t.verticalOrigin===v.CENTER&&(u-=.5*o),l(r)||(r=new e),r.x=s,r.y=u,r.width=n,r.height=o,r},y.prototype.equals=function(r){return this===r||l(r)&&this._id===r._id&&i.equals(this._position,r._position)&&this._imageId===r._imageId&&this._show===r._show&&this._scale===r._scale&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&this._heightReference===r._heightReference&&e.equals(this._imageSubRegion,r._imageSubRegion)&&o.equals(this._color,r._color)&&t.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._translate,r._translate)&&i.equals(this._eyeOffset,r._eyeOffset)&&p.equals(this._scaleByDistance,r._scaleByDistance)&&p.equals(this._translucencyByDistance,r._translucencyByDistance)&&p.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)&&h.equals(this._distanceDisplayCondition,r._distanceDisplayCondition)},y.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},y}),i("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./Buffer","./BufferUsage","./VertexArray"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r,n,o,a){function s(t,i){return e.getSizeInBytes(i.componentDatatype)-e.getSizeInBytes(t.componentDatatype)}var l=u._verifyAttributes(n);o=t(o,0);for(var c,h,d=[],p={},m=l.length,f=0;f<m;++f){var _=l[f];_.vertexBuffer?d.push(_):(h=_.usage,c=p[h],i(c)||(c=p[h]=[]),c.push(_))}this._allBuffers=[];for(h in p)if(p.hasOwnProperty(h)){c=p[h],c.sort(s);var g=u._vertexSizeInBytes(c),v=c[0].usage,y={vertexSizeInBytes:g,vertexBuffer:void 0,usage:v,needsCommit:!1,arrayBuffer:void 0,arrayViews:u._createArrayViews(c,g)};this._allBuffers.push(y)}this._size=0,this._instanced=t(a,!1),this._precreated=d,this._context=r,this.writers=void 0,this.va=void 0,this.resize(o)}function c(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes<n)return o&&r.destroy(),t.vertexBuffer=a.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function h(e,t,i){if(e.needsCommit&&e.vertexSizeInBytes>0){var r=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,r,n),r)}}function d(e){var t=e.va;if(i(t)){for(var r=t.length,n=0;n<r;++n)t[n].va.destroy();e.va=void 0}}u._verifyAttributes=function(i){for(var r=[],n=0;n<i.length;++n){var o=i[n],a={index:t(o.index,n),enabled:t(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:t(o.componentDatatype,e.FLOAT),normalize:t(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:t(o.usage,s.STATIC_DRAW)};r.push(a)}for(var l=new Array(r.length),u=0;u<r.length;++u){var c=r[u],h=c.index;l[h]=!0}return r},u._vertexSizeInBytes=function(t){for(var i=0,r=t.length,n=0;n<r;++n){var o=t[n];i+=o.componentsPerAttribute*e.getSizeInBytes(o.componentDatatype)}var a=r>0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?i%a:0,l=0===s?0:a-s;return i+=l},u._createArrayViews=function(t,i){for(var r=[],n=0,o=t.length,a=0;a<o;++a){var s=t[a],l=s.componentDatatype;r.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:i/e.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*e.getSizeInBytes(l)}return r},u.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var i=0,r=t.length;i<r;++i){var n=t[i];u._resize(n,this._size),u._appendWriters(this.writers,n)}d(this)},u._resize=function(t,r){if(t.vertexSizeInBytes>0){var n=new ArrayBuffer(r*t.vertexSizeInBytes);if(i(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;l<s;++l)o[l]=a[l];for(var u=t.arrayViews,c=u.length,h=0;h<c;++h){var d=u[h];d.view=e.createArrayBufferView(d.componentDatatype,n,d.offsetInBytes)}t.arrayBuffer=n}};var p=[function(e,t,i){return function(r,n){t[r*i]=n,e.needsCommit=!0}},function(e,t,i){return function(r,n,o){var a=r*i;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a){var s=r*i;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,i){return function(r,n,o,a,s){var l=r*i;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return u._appendWriters=function(e,t){for(var i=t.arrayViews,r=i.length,n=0;n<r;++n){var o=i[n];e[o.index]=p[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},u.prototype.commit=function(e){var t,r,n,a=!1,s=this._allBuffers;for(r=0,n=s.length;r<n;++r)t=s[r],a=c(this,t)||a;if(a||!i(this.va)){d(this);for(var h=this.va=[],p=i(e)?Math.ceil(this._size/(o.SIXTY_FOUR_KILOBYTES-1)):1,m=0;m<p;++m){var f=[];for(r=0,n=s.length;r<n;++r){t=s[r];var _=m*(t.vertexSizeInBytes*(o.SIXTY_FOUR_KILOBYTES-1));u._appendAttributes(f,t,_,this._instanced)}f=f.concat(this._precreated),h.push({va:new l({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(m!==p-1?o.SIXTY_FOUR_KILOBYTES-1:this._size%(o.SIXTY_FOUR_KILOBYTES-1))})}}},u._appendAttributes=function(e,t,i,r){for(var n=t.arrayViews,o=n.length,a=0;a<o;++a){var s=n[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:i+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:r?1:0})}},u.prototype.subCommit=function(e,t){for(var i=this._allBuffers,r=0,n=i.length;r<n;++r)h(i[r],e,t)},u.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t)e[t].needsCommit=!1},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){for(var e=this._allBuffers,t=0,i=e.length;t<i;++t){var n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return d(this),r(this)},u}),i("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\nif (color.a == 0.0)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),i("Shaders/BillboardCollectionVS",[],function(){"use strict";return"#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nattribute vec2 distanceDisplayCondition;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale * 0.5;\nhalfSize *= ((direction * 2.0) - 1.0);\nvec2 originTranslate = origin * abs(halfSize);\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (validAlignedAxis || rotation != 0.0)\n{\nfloat angle = rotation;\nif (validAlignedAxis)\n{\nvec3 pos = positionEC.xyz + czm_encodedCameraPositionMCHigh + czm_encodedCameraPositionMCLow;\nvec3 normal = normalize(cross(alignedAxis, pos));\nvec4 tangent = vec4(normalize(cross(pos, normal)), 0.0);\ntangent = czm_modelViewProjection * tangent;\nangle += sign(-tangent.x) * acos(tangent.y / length(tangent.xy));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nif (sizeInMeters)\n{\noriginTranslate += originTranslate / czm_metersPerPixel(positionEC);\n}\npositionWC.xy += originTranslate;\nif (!sizeInMeters)\n{\npositionWC.xy += halfSize;\n}\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_resolutionScale);\nreturn positionWC;\n}\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y  * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nvec2 imageSize = vec2(floor(temp), compressedAttribute2.w);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\ntemp = compressedAttribute2.z * SHIFT_RIGHT5;\nbool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nscale *= czm_nearFarScalar(scaleByDistance, lengthSq);\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),i("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){var r=e._gl;r.framebufferTexture2D(r.FRAMEBUFFER,t,i._target,i._texture,0)}function l(e,t,i){var r=e._gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,i._getRenderbuffer())}function u(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl;a.maximumColorAttachments;this._gl=r,this._framebuffer=r.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e(i.destroyAttachments,!0);t(i.depthTexture)||t(i.depthRenderbuffer),t(i.depthStencilTexture)||t(i.depthStencilRenderbuffer);this._bind();var n,o,u,c,h;if(t(i.colorTextures)){var d=i.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=d.length,u=0;u<c;++u)n=d[u],h=this._gl.COLOR_ATTACHMENT0+u,s(this,h,n),this._activeColorAttachments[u]=h,this._colorTextures[u]=n}if(t(i.colorRenderbuffers)){var p=i.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=p.length,u=0;u<c;++u)o=p[u],h=this._gl.COLOR_ATTACHMENT0+u,l(this,h,o),this._activeColorAttachments[u]=h,this._colorRenderbuffers[u]=o}t(i.depthTexture)&&(n=i.depthTexture,s(this,this._gl.DEPTH_ATTACHMENT,n),this._depthTexture=n),t(i.depthRenderbuffer)&&(o=i.depthRenderbuffer,l(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o),t(i.stencilRenderbuffer)&&(o=i.stencilRenderbuffer,l(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o),t(i.depthStencilTexture)&&(n=i.depthStencilTexture,s(this,this._gl.DEPTH_STENCIL_ATTACHMENT,n),this._depthStencilTexture=n),t(i.depthStencilRenderbuffer)&&(o=i.depthStencilRenderbuffer,l(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o),this._unBind()}return i(u.prototype,{status:{get:function(){this._bind();var e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),u.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},u.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},u.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},u.prototype.getColorTexture=function(e){return this._colorTextures[e]},u.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,i=this._colorTextures,n=i.length;e<n;++e){var o=i[e];t(o)&&o.destroy()}var a=this._colorRenderbuffers;for(n=a.length,e=0;e<n;++e){var s=a[e];t(s)&&s.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),r(this)},u}),i("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/loadImage","../Core/PixelFormat","../Core/RuntimeError","../Renderer/Framebuffer","../Renderer/Texture","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(e,i,n,o,a){this.bottomLeft=r(e,t.ZERO),this.topRight=r(i,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function f(e){e=r(e,r.EMPTY_OBJECT);var t=r(e.borderWidthInPixels,1),n=r(e.initialSize,y);this._context=e.context,this._pixelFormat=r(e.pixelFormat,u.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=i(),this._idHash={},this._initialSize=n,this._root=void 0}function _(e,i){var r=e._context,o=e.numberOfImages,a=2,s=e._borderWidthInPixels;if(o>0){for(var l=e._texture.width,u=e._texture.height,c=a*(l+i.width+s),p=a*(u+i.height+s),f=l/c,_=u/p,g=new m(new t(l+s,s),new t(c,u)),v=new m(new t,new t(c,u),e._root,g),y=new m(new t(s,u+s),new t(c,p)),C=new m(new t,new t(c,p),v,y),w=0;w<e._textureCoordinates.length;w++){var S=e._textureCoordinates[w];n(S)&&(S.x*=f,S.y*=_,S.width*=f,S.height*=_)}var E=new d({context:e._context,width:c,height:p,pixelFormat:e._pixelFormat}),b=new h({context:r,colorTextures:[e._texture],destroyAttachments:!1});b._bind(),E.copyFromFramebuffer(0,0,0,0,c,p),b._unBind(),b.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=E,e._root=C}else{var T=a*(i.width+2*s),x=a*(i.height+2*s);T<e._initialSize.x&&(T=e._initialSize.x),x<e._initialSize.y&&(x=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new d({context:e._context,width:T,height:x,pixelFormat:e._pixelFormat}),e._root=new m(new t(s,s),new t(T,x))}}function g(e,i,r){if(n(i)){if(!n(i.childNode1)&&!n(i.childNode2)){if(n(i.imageIndex))return;var o=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,s=o-r.width,l=a-r.height;if(s<0||l<0)return;if(0===s&&0===l)return i;if(s>l){i.childNode1=new m(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.bottomLeft.x+r.width,i.topRight.y));var u=i.bottomLeft.x+r.width+e._borderWidthInPixels;u<i.topRight.x&&(i.childNode2=new m(new t(u,i.bottomLeft.y),new t(i.topRight.x,i.topRight.y)))}else{i.childNode1=new m(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.topRight.x,i.bottomLeft.y+r.height));var c=i.bottomLeft.y+r.height+e._borderWidthInPixels;c<i.topRight.y&&(i.childNode2=new m(new t(i.bottomLeft.x,c),new t(i.topRight.x,i.topRight.y)))}return g(e,i.childNode1,r)}return g(e,i.childNode1,r)||g(e,i.childNode2,r)}}function v(t,r,o){var a=g(t,t._root,r);if(n(a)){a.imageIndex=o;var s=t._texture.width,l=t._texture.height,u=a.topRight.x-a.bottomLeft.x,c=a.topRight.y-a.bottomLeft.y,h=a.bottomLeft.x/s,d=a.bottomLeft.y/l,p=u/s,m=c/l;t._textureCoordinates[o]=new e(h,d,p,m),t._texture.copyFrom(r,a.bottomLeft.x,a.bottomLeft.y)}else _(t,r),v(t,r,o);t._guid=i()}var y=new t(16,16);return o(f.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return n(this._texture)||(this._texture=new d({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),f.prototype.addImage=function(e,t){var i=this._idHash[e];if(n(i))return i;"function"==typeof t?t=t(e):"string"==typeof t&&(t=l(t));var r=this;return i=p(t,function(e){if(r.isDestroyed())return-1;var t=r.numberOfImages;return v(r,e,t),t}),this._idHash[e]=i,i},f.prototype.addSubRegion=function(t,r){var o=this._idHash[t];if(!n(o))throw new c('image with id "'+t+'" not found in the atlas.');var a=this;return p(o,function(t){if(t===-1)return-1;var n=a._texture.width,o=a._texture.height,s=a.numberOfImages,l=a._textureCoordinates[t],u=l.x+r.x/n,c=l.y+r.y/o,h=r.width/n,d=r.height/o;return a._textureCoordinates.push(new e(u,c,h,d)),a._guid=i(),s})},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),a(this)},f}),i("Scene/BillboardCollection",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/WebGLConstants","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/BillboardCollectionFS","../Shaders/BillboardCollectionVS","./Billboard","./BlendingState","./HeightReference","./HorizontalOrigin","./SceneMode","./TextureAtlas","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R){"use strict";function O(e){e=a(e,a.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._compiledShaderRotationPick=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._compiledShaderAlignedAxisPick=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._propertiesChanged=new Uint32Array(me),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new t,this._baseVolumeWC=new t,this._baseVolume2D=new t,this._boundingVolume=new t,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=m.clone(a(e.modelMatrix,m.IDENTITY)),this._modelMatrix=m.clone(m.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this._mode=M.SCENE3D,this._buffersUsage=[g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW,g.STATIC_DRAW];var i=this;this._uniforms={u_atlas:function(){return i._textureAtlas.texture}};var r=this._scene;s(r)&&(this._removeCallbackFunc=r.terrainProviderChanged.addEventListener(function(){for(var e=this._billboards,t=e.length,i=0;i<t;++i)e[i]._updateClamping()},this))}function N(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function L(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],i=e._billboards,r=i.length,n=0,o=0;n<r;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function B(e){var t=16384,i=e.cache.billboardCollection_indexBufferBatched;if(s(i))return i;for(var r=6*t-6,n=new Uint16Array(r),o=0,a=0;o<r;o+=6,a+=4)n[o]=a,n[o+1]=a+1,n[o+2]=a+2,n[o+3]=a+0,n[o+4]=a+2,n[o+5]=a+3;return i=_.createIndexBuffer({context:e,typedArray:n,usage:g.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT}),i.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=i,i}function F(e){var t=e.cache.billboardCollection_indexBufferInstanced;return s(t)?t:(t=_.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:g.STATIC_DRAW,indexDatatype:d.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t,t)}function V(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return s(t)?t:(t=_.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:g.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t,t)}function k(e,t,i,r){var n=[{index:J.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ee]},{index:J.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ee]},{index:J.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[te]},{index:J.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[he]},{index:J.compressedAttribute2,
componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[se]},{index:J.eyeOffset,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ie]},{index:J.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[ce]},{index:J.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:i[de]},{index:J.distanceDisplayCondition,componentsPerAttribute:2,componentDatatype:o.FLOAT,usage:i[pe]}];r&&n.push({index:J.direction,componentsPerAttribute:2,componentDatatype:o.FLOAT,vertexBuffer:V(e)});var a=r?t:4*t;return new E(e,n,a,r)}function z(e,i,r,n,o){var a,s=n[J.positionHighAndScale],l=n[J.positionLowAndRotation],u=o._getActualPosition();e._mode===M.SCENE3D&&(t.expand(e._baseVolume,u,e._baseVolume),e._boundingVolumeDirty=!0),h.fromCartesian(u,ve);var c=o.scale,d=o.rotation;0!==d&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);var p=ve.high,m=ve.low;e._instanced?(a=o._index,s(a,p.x,p.y,p.z,c),l(a,m.x,m.y,m.z,d)):(a=4*o._index,s(a+0,p.x,p.y,p.z,c),s(a+1,p.x,p.y,p.z,c),s(a+2,p.x,p.y,p.z,c),s(a+3,p.x,p.y,p.z,c),l(a+0,m.x,m.y,m.z,d),l(a+1,m.x,m.y,m.z,d),l(a+2,m.x,m.y,m.z,d),l(a+3,m.x,m.y,m.z,d))}function U(t,i,r,n,o){var a,s=n[J.compressedAttribute0],l=o.pixelOffset,u=l.x,c=l.y,h=o._translate,d=h.x,m=h.y;t._maxPixelOffset=Math.max(t._maxPixelOffset,Math.abs(u+d),Math.abs(-c+m));var f=o.horizontalOrigin,_=o._verticalOrigin,g=o.show&&o.clusterShow;0===o.color.alpha&&(g=!1),_===R.BASELINE&&(_=R.BOTTOM),t._allHorizontalCenter=t._allHorizontalCenter&&f===D.CENTER,t._allVerticalCenter=t._allVerticalCenter&&_===R.CENTER;var v=0,y=0,C=0,w=0,S=o._imageIndex;if(S!==-1){var E=r[S];v=E.x,y=E.y,C=E.width,w=E.height}var b=v+C,T=y+w,x=Math.floor(p.clamp(u,-Ce,Ce)+Ce)*Ee;x+=(f+1)*be,x+=(_+1)*Te,x+=(g?1:0)*xe;var A=Math.floor(p.clamp(c,-Ce,Ce)+Ce)*Se,P=Math.floor(p.clamp(d,-Ce,Ce)+Ce)*Se,M=(p.clamp(m,-Ce,Ce)+Ce)*Ae,I=Math.floor(M),O=Math.floor((M-I)*Se);A+=I,P+=O,ye.x=v,ye.y=y;var N=e.compressTextureCoordinates(ye);ye.x=b;var L=e.compressTextureCoordinates(ye);ye.y=T;var B=e.compressTextureCoordinates(ye);ye.x=v;var F=e.compressTextureCoordinates(ye);t._instanced?(a=o._index,s(a,x,A,P,N)):(a=4*o._index,s(a+0,x+Pe,A,P,N),s(a+1,x+De,A,P,L),s(a+2,x+Me,A,P,B),s(a+3,x+Ie,A,P,F))}function G(t,i,n,o,l){var u,c=o[J.compressedAttribute1],h=l.alignedAxis;r.equals(h,r.ZERO)||(t._shaderAlignedAxis=!0);var d=0,m=1,f=1,_=1,g=l.translucencyByDistance;s(g)&&(d=g.near,m=g.nearValue,f=g.far,_=g.farValue,1===m&&1===_||(t._shaderTranslucencyByDistance=!0));var v=0,y=l._imageIndex;if(y!==-1){var C=n[y];v=C.width}var w=t._textureAtlas.texture.width,S=Math.round(a(l.width,w*v));t._maxSize=Math.max(t._maxSize,S);var E=p.clamp(S,0,we),b=0;Math.abs(r.magnitudeSquared(h)-1)<p.EPSILON6&&(b=e.octEncodeFloat(h)),m=p.clamp(m,0,1),m=1===m?255:255*m|0,E=E*Se+m,_=p.clamp(_,0,1),_=1===_?255:255*_|0,b=b*Se+_,t._instanced?(u=l._index,c(u,E,b,d,f)):(u=4*l._index,c(u+0,E,b,d,f),c(u+1,E,b,d,f),c(u+2,E,b,d,f),c(u+3,E,b,d,f))}function W(e,t,i,o,s){var l,u=o[J.compressedAttribute2],c=s.color,h=s.getPickId(t).color,d=s.sizeInMeters?1:0,m=Math.abs(r.magnitudeSquared(s.alignedAxis)-1)<p.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===d;var f=0,_=s._imageIndex;if(_!==-1){var g=i[_];f=g.height}var v=e._textureAtlas.texture.dimensions,y=Math.round(a(s.height,v.y*f));e._maxSize=Math.max(e._maxSize,y);var C=n.floatToByte(c.red),w=n.floatToByte(c.green),S=n.floatToByte(c.blue),E=C*we+w*Se+S;C=n.floatToByte(h.red),w=n.floatToByte(h.green),S=n.floatToByte(h.blue);var b=C*we+w*Se+S,T=n.floatToByte(c.alpha)*we+n.floatToByte(h.alpha)*Se;T+=2*d+m,e._instanced?(l=s._index,u(l,E,b,T,y)):(l=4*s._index,u(l+0,E,b,T,y),u(l+1,E,b,T,y),u(l+2,E,b,T,y),u(l+3,E,b,T,y))}function H(t,i,r,n,o){var a,s=n[J.eyeOffset],l=o.eyeOffset,u=l.z;if(o._heightReference!==P.NONE&&(u*=1.005),t._maxEyeOffset=Math.max(t._maxEyeOffset,Math.abs(l.x),Math.abs(l.y),Math.abs(u)),t._instanced){var c=0,h=0,d=o._imageIndex;if(d!==-1){var p=r[d];c=p.width,h=p.height}ye.x=c,ye.y=h;var m=e.compressTextureCoordinates(ye);a=o._index,s(a,l.x,l.y,u,m)}else a=4*o._index,s(a+0,l.x,l.y,u,0),s(a+1,l.x,l.y,u,0),s(a+2,l.x,l.y,u,0),s(a+3,l.x,l.y,u,0)}function q(e,t,i,r,n){var o,a=r[J.scaleByDistance],l=0,u=1,c=1,h=1,d=n.scaleByDistance;s(d)&&(l=d.near,u=d.nearValue,c=d.far,h=d.farValue,1===u&&1===h||(e._shaderScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,h)):(o=4*n._index,a(o+0,l,u,c,h),a(o+1,l,u,c,h),a(o+2,l,u,c,h),a(o+3,l,u,c,h))}function j(e,t,i,r,n){var o,a=r[J.pixelOffsetScaleByDistance],l=0,u=1,c=1,h=1,d=n.pixelOffsetScaleByDistance;s(d)&&(l=d.near,u=d.nearValue,c=d.far,h=d.farValue,1===u&&1===h||(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,h)):(o=4*n._index,a(o+0,l,u,c,h),a(o+1,l,u,c,h),a(o+2,l,u,c,h),a(o+3,l,u,c,h))}function Y(e,t,i,r,n){var o,a=r[J.distanceDisplayCondition],l=0,u=Number.MAX_VALUE,c=n.distanceDisplayCondition;s(c)&&(l=c.near,u=c.far,e._shaderDistanceDisplayCondition=!0),e._instanced?(o=n._index,a(o,l,u)):(o=4*n._index,a(o+0,l,u),a(o+1,l,u),a(o+2,l,u),a(o+3,l,u))}function X(e,t,i,r,n){z(e,t,i,r,n),U(e,t,i,r,n),G(e,t,i,r,n),W(e,t,i,r,n),H(e,t,i,r,n),q(e,t,i,r,n),j(e,t,i,r,n),Y(e,t,i,r,n)}function Z(e,i,r,n,o,a){var l;n.mode===M.SCENE3D?(l=e._baseVolume,e._boundingVolumeDirty=!0):l=e._baseVolume2D;for(var u=[],c=0;c<r;++c){var h=i[c],d=h.position,p=x._computeActualPosition(h,d,n,o);s(p)&&(h._setActualPosition(p),a?u.push(p):t.expand(l,p,l))}a&&t.fromPoints(u,l)}function K(e,t){var i=t.mode,r=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==M.SCENE3D&&!m.equals(o,e.modelMatrix)?(e._mode=i,m.clone(e.modelMatrix,o),e._createVertexArray=!0,i!==M.SCENE3D&&i!==M.SCENE2D&&i!==M.COLUMBUS_VIEW||Z(e,r,r.length,t,o,!0)):i===M.MORPHING?Z(e,r,r.length,t,o,!0):i!==M.SCENE2D&&i!==M.COLUMBUS_VIEW||Z(e,n,e._billboardsToUpdateIndex,t,o,!1)}function Q(e,t,i){var r=1;e._allSizedInMeters&&0===e._maxPixelOffset||(r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight));var n=r*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(n*=.5);var o=r*e._maxPixelOffset+e._maxEyeOffset;i.radius+=n+o}var J,$=x.SHOW_INDEX,ee=x.POSITION_INDEX,te=x.PIXEL_OFFSET_INDEX,ie=x.EYE_OFFSET_INDEX,re=x.HORIZONTAL_ORIGIN_INDEX,ne=x.VERTICAL_ORIGIN_INDEX,oe=x.SCALE_INDEX,ae=x.IMAGE_INDEX_INDEX,se=x.COLOR_INDEX,le=x.ROTATION_INDEX,ue=x.ALIGNED_AXIS_INDEX,ce=x.SCALE_BY_DISTANCE_INDEX,he=x.TRANSLUCENCY_BY_DISTANCE_INDEX,de=x.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,pe=x.DISTANCE_DISPLAY_CONDITION_INDEX,me=x.NUMBER_OF_PROPERTIES,fe={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,distanceDisplayCondition:8},_e={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,distanceDisplayCondition:9};l(O.prototype,{length:{get:function(){return L(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),O.prototype.add=function(e){var t=new x(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},O.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},O.prototype.removeAll=function(){N(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},O.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},O.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},O.prototype.get=function(e){return L(this),this._billboards[e]};var ge;O.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<me;++r){var n=0===i[r]?g.STATIC_DRAW:g.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var ve=new h,ye=new i,Ce=32768,we=65536,Se=256,Ee=128,be=32,Te=8,xe=4,Ae=1/256,Pe=0,De=2,Me=3,Ie=1,Re=[];return O.prototype.update=function(e){L(this);var i=this._billboards,r=i.length,n=e.context;this._instanced=n.instancedArrays,J=this._instanced?_e:fe,ge=this._instanced?F:B;var o=this._textureAtlas;if(!s(o)){o=this._textureAtlas=new I({context:n});for(var a=0;a<r;++a)i[a]._loadImage()}var l=o.textureCoordinates;if(0!==l.length){K(this,e),i=this._billboards,r=i.length;var u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,h=this._propertiesChanged,d=o.guid,p=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;var _,g=e.passes,E=g.pick;if(p||!E&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var x=0;x<me;++x)h[x]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),r>0){this._vaf=k(n,r,this._buffersUsage,this._instanced),_=this._vaf.writers;for(var P=0;P<r;++P){var D=this._billboards[P];D._dirty=!1,X(this,n,l,_,D)}this._vaf.commit(ge(n))}this._billboardsToUpdateIndex=0}else if(c>0){var R=Re;R.length=0,(h[ee]||h[le]||h[oe])&&R.push(z),(h[ae]||h[te]||h[re]||h[ne]||h[$])&&(R.push(U),this._instanced&&R.push(H)),(h[ae]||h[ue]||h[he])&&(R.push(G),R.push(W)),(h[ae]||h[se])&&R.push(W),h[ie]&&R.push(H),h[ce]&&R.push(q),h[de]&&R.push(j),h[pe]&&R.push(Y);var O=R.length;if(_=this._vaf.writers,c/r>.1){for(var N=0;N<c;++N){var V=u[N];V._dirty=!1;for(var Z=0;Z<O;++Z)R[Z](this,n,l,_,V)}this._vaf.commit(ge(n))}else{for(var ve=0;ve<c;++ve){var ye=u[ve];ye._dirty=!1;for(var Ce=0;Ce<O;++Ce)R[Ce](this,n,l,_,ye);this._instanced?this._vaf.subCommit(ye._index,1):this._vaf.subCommit(4*ye._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>1.5*r&&(u.length=r),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var we,Se=m.IDENTITY;e.mode===M.SCENE3D?(Se=this.modelMatrix,we=t.clone(this._baseVolumeWC,this._boundingVolume)):we=t.clone(this._baseVolume2D,this._boundingVolume),Q(this,e,we);var Ee,be,Te,xe,Ae,Pe,De=e.commandList;if(g.render){var Me=this._colorCommands;for(s(this._rs)||(this._rs=C.fromCache({depthTest:{enabled:!0,func:f.LEQUAL},blending:A.ALPHA_BLEND})),s(this._sp)&&this._shaderRotation===this._compiledShaderRotation&&this._shaderAlignedAxis===this._compiledShaderAlignedAxis&&this._shaderScaleByDistance===this._compiledShaderScaleByDistance&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistance&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistance&&this._shaderDistanceDisplayCondition===this._compiledShaderDistanceDisplayCondition||(xe=new S({sources:[T]}),this._instanced&&xe.defines.push("INSTANCED"),this._shaderRotation&&xe.defines.push("ROTATION"),this._shaderAlignedAxis&&xe.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&xe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&xe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&xe.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&xe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._sp=w.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:xe,fragmentShaderSource:b,attributeLocations:J}),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),Ee=this._vaf.va,be=Ee.length,Me.length=be,Pe=0;Pe<be;++Pe)Te=Me[Pe],s(Te)||(Te=Me[Pe]=new v({pass:y.OPAQUE,owner:this})),Te.boundingVolume=we,Te.modelMatrix=Se,Te.count=Ee[Pe].indicesCount,Te.shaderProgram=this._sp,Te.uniformMap=this._uniforms,Te.vertexArray=Ee[Pe].va,Te.renderState=this._rs,Te.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(Te.count=6,Te.instanceCount=r),De.push(Te)}if(E){var Ie=this._pickCommands;for(s(this._spPick)&&this._shaderRotation===this._compiledShaderRotationPick&&this._shaderAlignedAxis===this._compiledShaderAlignedAxisPick&&this._shaderScaleByDistance===this._compiledShaderScaleByDistancePick&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistancePick&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistancePick&&this._shaderDistanceDisplayCondition===this._compiledShaderDistanceDisplayConditionPick||(xe=new S({defines:["RENDER_FOR_PICK"],sources:[T]}),this._instanced&&xe.defines.push("INSTANCED"),this._shaderRotation&&xe.defines.push("ROTATION"),this._shaderAlignedAxis&&xe.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&xe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&xe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&xe.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&xe.defines.push("DISTANCE_DISPLAY_CONDITION"),Ae=new S({defines:["RENDER_FOR_PICK"],sources:[b]}),this._spPick=w.replaceCache({context:n,shaderProgram:this._spPick,vertexShaderSource:xe,fragmentShaderSource:Ae,attributeLocations:J}),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition),Ee=this._vaf.va,be=Ee.length,Ie.length=be,Pe=0;Pe<be;++Pe)Te=Ie[Pe],s(Te)||(Te=Ie[Pe]=new v({pass:y.OPAQUE,owner:this})),Te.boundingVolume=we,Te.modelMatrix=Se,Te.count=Ee[Pe].indicesCount,Te.shaderProgram=this._spPick,Te.uniformMap=this._uniforms,Te.vertexArray=Ee[Pe].va,Te.renderState=this._rs,this._instanced&&(Te.count=6,Te.instanceCount=r),De.push(Te)}}}},O.prototype.isDestroyed=function(){return!1},O.prototype.destroy=function(){return s(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),N(this._billboards),u(this)},O}),i("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";var t={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};return e(t)}),i("Scene/Label",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","./Billboard","./HeightReference","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m){"use strict";function f(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function _(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function g(e,o){e=n(e,n.EMPTY_OBJECT),this._text=n(e.text,""),this._show=n(e.show,!0),this._font=n(e.font,"30px sans-serif"),this._fillColor=r.clone(n(e.fillColor,r.WHITE)),this._outlineColor=r.clone(n(e.outlineColor,r.BLACK)),this._outlineWidth=n(e.outlineWidth,1),this._showBackground=n(e.showBackground,!1),this._backgroundColor=n(e.backgroundColor,new r(.165,.165,.165,.8)),this._backgroundPadding=n(e.backgroundPadding,new t(7,5)),this._style=n(e.style,p.FILL),this._verticalOrigin=n(e.verticalOrigin,m.BASELINE),this._horizontalOrigin=n(e.horizontalOrigin,d.LEFT),this._pixelOffset=t.clone(n(e.pixelOffset,t.ZERO)),this._eyeOffset=i.clone(n(e.eyeOffset,i.ZERO)),this._position=i.clone(n(e.position,i.ZERO)),this._scale=n(e.scale,1),this._id=e.id,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._heightReference=n(e.heightReference,h.NONE),this._distanceDisplayCondition=e.distanceDisplayCondition,this._labelCollection=o,this._glyphs=[],this._backgroundBillboard=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this._updateClamping()}return a(g.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i].billboard;o(n)&&(n.show=e)}var a=this._backgroundBillboard;o(a)&&(a.show=e)}}},position:{get:function(){return this._position},set:function(e){var t=this._position;if(!i.equals(t,e)){i.clone(e,t);for(var r=this._glyphs,n=0,a=r.length;n<a;n++){var s=r[n].billboard;o(s)&&(s.position=e)}var l=this._backgroundBillboard;o(l)&&(l.position=e),this._heightReference!==h.NONE&&this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i].billboard;o(n)&&(n.heightReference=e)}var a=this._backgroundBillboard;o(a)&&(a.heightReference=e),_(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,f(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,f(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;r.equals(t,e)||(r.clone(e,t),f(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;r.equals(t,e)||(r.clone(e,t),f(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,f(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,f(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){var t=this._backgroundColor;if(!r.equals(t,e)){r.clone(e,t);var i=this._backgroundBillboard;o(i)&&(i.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){var i=this._backgroundPadding;t.equals(i,e)||(t.clone(e,i),_(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,f(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;if(!t.equals(i,e)){t.clone(e,i);for(var r=this._glyphs,n=0,a=r.length;n<a;n++){var s=r[n];o(s.billboard)&&(s.billboard.pixelOffset=e)}var l=this._backgroundBillboard;o(l)&&(l.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;if(!u.equals(t,e)){this._translucencyByDistance=u.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];o(a.billboard)&&(a.billboard.translucencyByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;if(!u.equals(t,e)){this._pixelOffsetScaleByDistance=u.clone(e,t);for(var i=this._glyphs,r=0,n=i.length;r<n;r++){var a=i[r];o(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.pixelOffsetScaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;if(!i.equals(t,e)){i.clone(e,t);for(var r=this._glyphs,n=0,a=r.length;n<a;n++){var s=r[n];o(s.billboard)&&(s.billboard.eyeOffset=e)}var l=this._backgroundBillboard;o(l)&&(l.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,_(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.verticalOrigin=e)}var a=this._backgroundBillboard;o(a)&&(a.verticalOrigin=e),_(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.scale=e)}var a=this._backgroundBillboard;o(a)&&(a.scale=e),_(this)}}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!l.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition);for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.distanceDisplayCondition=e)}var a=this._backgroundBillboard;o(a)&&(a.distanceDisplayCondition=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.id=e)}var a=this._backgroundBillboard;o(a)&&(a.id=e)}}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition);var t=this._glyphs;e=n(e,this._position);for(var r=0,a=t.length;r<a;r++){var s=t[r];o(s.billboard)&&(s.billboard._clampedPosition=e,i.clone(e,s.billboard._position),i.clone(e,s.billboard._actualPosition))}var l=this._backgroundBillboard;o(l)&&(l._clampedPosition=e,i.clone(e,l._position),i.clone(e,l._actualPosition))}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;for(var t=this._glyphs,i=0,r=t.length;i<r;i++){var n=t[i];o(n.billboard)&&(n.billboard.clusterShow=e)}var a=this._backgroundBillboard;o(a)&&(a.clusterShow=e)}}}}),g.prototype._updateClamping=function(){c._updateClamping(this._labelCollection,this)},g.prototype.computeScreenSpacePosition=function(e,i){o(i)||(i=new t);var r=this._labelCollection,n=r.modelMatrix,a=o(this._actualClampedPosition)?this._actualClampedPosition:this._position,s=c._computeScreenSpacePosition(n,a,this._eyeOffset,this._pixelOffset,e,i);return s},g.getScreenSpaceBoundingBox=function(t,i,r){var n=0,a=0,s=0,l=0,u=t.scale,c=t._labelCollection._resolutionScale,h=t._backgroundBillboard;if(o(h))n=i.x+h._translate.x/c,a=i.y-h._translate.y/c,s=h.width*u,l=h.height*u,t.verticalOrigin===m.BOTTOM||t.verticalOrigin===m.BASELINE?a-=l:t.verticalOrigin===m.CENTER&&(a-=.5*l);else{n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(var d=0,p=0,f=t._glyphs,_=f.length,g=0;g<_;++g){var v=f[g],y=v.billboard;if(o(y)){var C=i.x+y._translate.x/c,w=i.y-y._translate.y/c,S=y.width*u,E=y.height*u;t.verticalOrigin===m.BOTTOM||t.verticalOrigin===m.BASELINE?w-=E:t.verticalOrigin===m.CENTER&&(w-=.5*E),n=Math.min(n,C),a=Math.min(a,w),d=Math.max(d,C+S),p=Math.max(p,w+E)}}s=d-n,l=p-a}return o(r)||(r=new e),r.x=n,r.y=a,r.width=s,r.height=l,r},g.prototype.equals=function(e){return this===e||o(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._text===e._text&&this._font===e._font&&i.equals(this._position,e._position)&&r.equals(this._fillColor,e._fillColor)&&r.equals(this._outlineColor,e._outlineColor)&&r.equals(this._backgroundColor,e._backgroundColor)&&t.equals(this._backgroundPadding,e._backgroundPadding)&&t.equals(this._pixelOffset,e._pixelOffset)&&i.equals(this._eyeOffset,e._eyeOffset)&&u.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&l.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._id===e._id},g.prototype.isDestroyed=function(){return!1},g}),i("Scene/LabelCollection",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function g(e,t,i){this.labelCollection=e,this.index=t,this.dimensions=i}function v(e,t){var i=document.createElement("canvas");i.width=D.x,i.height=D.y;var r=i.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,i.width,i.height),e.addImage(P,i).then(function(e){t._whitePixelIndex=e})}function y(e,t,i,r,n,o,a){return I.font=t,I.fillColor=i,I.strokeColor=r,I.strokeWidth=n,a===f.CENTER?I.textBaseline="middle":a===f.TOP?I.textBaseline="top":I.textBaseline="bottom",I.fill=o===p.FILL||o===p.FILL_AND_OUTLINE,I.stroke=o===p.OUTLINE||o===p.FILL_AND_OUTLINE,u(e,I)}function C(e,t){t.textureInfo=void 0,t.dimensions=void 0;var i=t.billboard;n(i)&&(i.show=!1,i.image=void 0,e._spareBillboards.push(i),t.billboard=void 0)}function w(e,t,i,r){e.addImage(t,i).then(function(e,t){r.index=e})}function S(e,t){var i,r,o,a=t._text,s=a.length,l=t._glyphs,u=l.length;if(s<u)for(r=s;r<u;++r)C(e,l[r]);l.length=s;var c=t._showBackground&&a.split("\n").join("").length>0,d=t._backgroundBillboard,p=e._backgroundBillboardCollection;c?(n(d)||(d=p.add({collection:e,image:P,imageSubRegion:M}),t._backgroundBillboard=d),d.color=t._backgroundColor,d.show=t._show,d.position=t._position,d.eyeOffset=t._eyeOffset,d.pixelOffset=t._pixelOffset,d.horizontalOrigin=h.LEFT,d.verticalOrigin=t._verticalOrigin,d.heightReference=t._heightReference,d.scale=t._scale,d.pickPrimitive=t,d.id=t._id,d.translucencyByDistance=t._translucencyByDistance,d.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition):n(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);var m=e._glyphTextureCache;for(o=0;o<s;++o){var f=a.charAt(o),v=t._font,S=t._fillColor,E=t._outlineColor,b=t._outlineWidth,T=t._style,x=t._verticalOrigin,A=JSON.stringify([f,v,S.toRgba(),E.toRgba(),b,+T,+x]),D=m[A];if(!n(D)){var I=y(f,v,S,E,b,T,x);D=new g(e,-1,I.dimensions),m[A]=D,I.width>0&&I.height>0&&w(e._textureAtlas,A,I,D)}if(i=l[o],n(i)?D.index===-1?C(e,i):n(i.textureInfo)&&(i.textureInfo=void 0):(i=new _,l[o]=i),i.textureInfo=D,i.dimensions=D.dimensions,D.index!==-1){var R=i.billboard,O=e._spareBillboards;n(R)||(R=O.length>0?O.pop():e._billboardCollection.add({collection:e}),i.billboard=R),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=h.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,R.scale=t._scale,R.pickPrimitive=t,R.id=t._id,R.image=A,R.translucencyByDistance=t._translucencyByDistance,R.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,R.distanceDisplayCondition=t._distanceDisplayCondition}}t._repositionAllGlyphs=!0}function E(e,t,i){return t===h.CENTER?-e/2:t===h.RIGHT?-(e+i.x):i.x}function b(e,i){var r,o,a=e._glyphs,s=e._text,l=0,u=0,c=[],d=Number.NEGATIVE_INFINITY,p=0,m=1,_=0,g=a.length,v=e._backgroundBillboard,y=O;for(t.clone(n(v)?e._backgroundPadding:t.ZERO,y),_=0;_<g;++_)"\n"===s.charAt(_)?(c.push(l),++m,l=0):(r=a[_],o=r.dimensions,p=Math.max(p,o.height-o.descent),d=Math.max(d,o.descent),l+=o.width-o.bounds.minx,_<g-1&&(l+=a[_+1].dimensions.bounds.minx),u=Math.max(u,l));c.push(l);var C=p+d,w=e._scale,S=e._horizontalOrigin,b=e._verticalOrigin,T=0,x=c[T],P=E(x,S,y),D=A*C,M=D*(m-1);R.x=P*w*i,R.y=0;var I=0;for(_=0;_<g;++_)if("\n"===s.charAt(_))++T,I+=D,x=c[T],P=E(x,S,y),R.x=P*w*i;else if(r=a[_],o=r.dimensions,b===f.TOP?R.y=o.height-p-y.y:b===f.CENTER?R.y=(M+o.height-p)/2:b===f.BASELINE?R.y=M:R.y=M+d+y.y,R.y=(R.y-o.descent-I)*w*i,n(r.billboard)&&r.billboard._setTranslate(R),_<g-1){var N=a[_+1];R.x+=(o.width-o.bounds.minx+N.dimensions.bounds.minx)*w*i}n(v)&&s.split("\n").join("").length>0&&(P=S===h.CENTER?-u/2-y.x:S===h.RIGHT?-(u+2*y.x):0,R.x=P*w*i,b===f.TOP?R.y=C-p-d:b===f.CENTER?R.y=(C-p)/2-d:b===f.BASELINE?R.y=-y.y-d:R.y=0,R.y=R.y*w*i,v.width=u+2*y.x,v.height=C+M+2*y.y,v._setTranslate(R))}function T(e,t){for(var i=t._glyphs,r=0,o=i.length;r<o;++r)C(e,i[r]);n(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,n(t._removeCallbackFunc)&&t._removeCallbackFunc(),a(t)}function x(e){e=r(e,r.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._whitePixelIndex=void 0,this._backgroundBillboardCollection=new c({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new c({scene:this._scene}),this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this.modelMatrix=l.clone(r(e.modelMatrix,l.IDENTITY)),this.debugShowBoundingVolume=r(e.debugShowBoundingVolume,!1)}var A=1.2,P="ID_WHITE_PIXEL",D=new t(4,4),M=new e(1,1,1,1),I={},R=new t,O=new t;return o(x.prototype,{length:{get:function(){return this._labels.length}}}),x.prototype.add=function(e){var t=new d(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},x.prototype.remove=function(e){if(n(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),T(this,e),!0}return!1},x.prototype.removeAll=function(){for(var e=this._labels,t=0,i=e.length;t<i;++t)T(this,e[t]);e.length=0},x.prototype.contains=function(e){return n(e)&&e._labelCollection===this},x.prototype.get=function(e){return this._labels[e]},x.prototype.update=function(e){var t=this._billboardCollection,i=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,i.modelMatrix=this.modelMatrix,i.debugShowBoundingVolume=this.debugShowBoundingVolume;var r=e.context;n(this._textureAtlas)||(this._textureAtlas=new m({context:r}),t.textureAtlas=this._textureAtlas),n(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new m({context:r,initialSize:D}),i.textureAtlas=this._backgroundTextureAtlas,v(this._backgroundTextureAtlas,this));var o=r.uniformState,a=o.resolutionScale,s=this._resolutionScale!==a;this._resolutionScale=a;var l;l=s?this._labels:this._labelsToUpdate;for(var u=l.length,c=0;c<u;++c){var h=l[c];if(!h.isDestroyed()){var d=h._glyphs.length;h._rebindAllGlyphs&&(S(this,h),h._rebindAllGlyphs=!1),(s||h._repositionAllGlyphs)&&(b(h,a),h._repositionAllGlyphs=!1);var p=h._glyphs.length-d;this._totalGlyphCount+=p}}this._labelsToUpdate.length=0,i.update(e),t.update(e)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),a(this)},x}),i("Scene/PointPrimitive",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){
"use strict";function m(e,t){e=o(e,o.EMPTY_OBJECT),this._show=o(e.show,!0),this._position=i.clone(o(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._color=n.clone(o(e.color,n.WHITE)),this._outlineColor=n.clone(o(e.outlineColor,n.TRANSPARENT)),this._outlineWidth=o(e.outlineWidth,0),this._pixelSize=o(e.pixelSize,10),this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._distanceDisplayCondition=e.distanceDisplayCondition,this._id=e.id,this._collection=o(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}function f(e,t){var i=e._pointPrimitiveCollection;a(i)&&(i._updatePointPrimitive(e,t),e._dirty=!0)}var _=m.SHOW_INDEX=0,g=m.POSITION_INDEX=1,v=m.COLOR_INDEX=2,y=m.OUTLINE_COLOR_INDEX=3,C=m.OUTLINE_WIDTH_INDEX=4,w=m.PIXEL_SIZE_INDEX=5,S=m.SCALE_BY_DISTANCE_INDEX=6,E=m.TRANSLUCENCY_BY_DISTANCE_INDEX=7,b=m.DISTANCE_DISPLAY_CONDITION=8;m.NUMBER_OF_PROPERTIES=9,s(m.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,f(this,_))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),f(this,g))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;h.equals(t,e)||(this._scaleByDistance=h.clone(e,t),f(this,S))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;h.equals(t,e)||(this._translucencyByDistance=h.clone(e,t),f(this,E))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,f(this,w))}},color:{get:function(){return this._color},set:function(e){var t=this._color;n.equals(t,e)||(n.clone(e,t),f(this,v))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;n.equals(t,e)||(n.clone(e,t),f(this,y))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,f(this,C))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){u.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=u.clone(e,this._distanceDisplayCondition),f(this,b))}},id:{get:function(){return this._id},set:function(e){this._id=e,a(this._pickId)&&(this._pickId.object.id=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,f(this,_))}}}),m.prototype.getPickId=function(e){return a(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},m.prototype._getActualPosition=function(){return this._actualPosition},m.prototype._setActualPosition=function(e){i.clone(e,this._actualPosition),f(this,g)};var T=new r;m._computeActualPosition=function(e,t,i){return t.mode===d.SCENE3D?e:(c.multiplyByPoint(i,e,T),p.computeActualWgs84Position(t,T))};var x=new r;return m._computeScreenSpacePosition=function(e,t,i,n){var o=c.multiplyByVector(e,r.fromElements(t.x,t.y,t.z,1,x),x),a=p.wgs84ToWindowCoordinates(i,o,n);return a},m.prototype.computeScreenSpacePosition=function(e,i){var r=this._pointPrimitiveCollection;a(i)||(i=new t);var n=r.modelMatrix,o=m._computeScreenSpacePosition(n,this._actualPosition,e,i);if(a(o))return o.y=e.canvas.clientHeight-o.y,o},m.getScreenSpaceBoundingBox=function(t,i,r){var n=t.pixelSize,o=.5*n,s=i.x-o,l=i.y-o,u=n,c=n;return a(r)||(r=new e),r.x=s,r.y=l,r.width=u,r.height=c,r},m.prototype.equals=function(e){return this===e||a(e)&&this._id===e._id&&i.equals(this._position,e._position)&&n.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&n.equals(this._outlineColor,e._outlineColor)&&h.equals(this._scaleByDistance,e._scaleByDistance)&&h.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)},m.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0},m}),i("Shaders/PointPrimitiveCollectionFS",[],function(){"use strict";return"varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nvoid main()\n{\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\ncolor.a *= wholeAlpha;\nif (color.a < 0.005)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),i("Shaders/PointPrimitiveCollectionVS",[],function(){"use strict";return"uniform float u_maxTotalPointSize;\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 scaleByDistance;\nattribute vec2 distanceDisplayCondition;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nvoid main()\n{\nvec3 positionHigh = positionHighAndSize.xyz;\nvec3 positionLow = positionLowAndOutline.xyz;\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\nfloat outlinePercent = outlineWidthBothSides / totalSize;\ntotalSize *= czm_resolutionScale;\ntotalSize += 3.0;\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat show = floor(temp);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\nvec4 color;\nvec4 outlineColor;\n#ifdef RENDER_FOR_PICK\ncolor = vec4(0.0);\noutlineColor = vec4(0.0);\nvec4 pickColor;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\n#else\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\n#endif\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\n#endif\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\ntotalSize = min(totalSize, u_maxTotalPointSize);\nif (totalSize < 1.0)\n{\npositionEC.xyz = vec3(0.0);\ntotalSize = 1.0;\n}\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency < 0.004)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq) {\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_color = color;\nv_color.a *= translucency;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#endif\n}\n"}),i("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/WebGLConstants","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./PointPrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(t){t=r(t,r.EMPTY_OBJECT),this._sp=void 0,this._rs=void 0,this._vaf=void 0,this._spPick=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._propertiesChanged=new Uint32Array(X),this._maxPixelSize=1,this._baseVolume=new e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=c.clone(r(t.modelMatrix,c.IDENTITY)),this._modelMatrix=c.clone(c.IDENTITY),this.debugShowBoundingVolume=r(t.debugShowBoundingVolume,!1),this._mode=T.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW];var i=this;this._uniforms={u_maxTotalPointSize:function(){return i._maxTotalPointSize}}}function A(e){for(var t=e.length,i=0;i<t;++i)e[i]&&e[i]._destroy()}function P(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],i=e._pointPrimitives,r=i.length,n=0,o=0;n<r;++n){var a=i[n];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}function D(e,t,r){return new C(e,[{index:Z.positionHighAndSize,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[z]},{index:Z.positionLowAndShow,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[z]},{index:Z.compressedAttribute0,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[U]},{index:Z.compressedAttribute1,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[j]},{index:Z.scaleByDistance,componentsPerAttribute:4,componentDatatype:i.FLOAT,usage:r[q]},{index:Z.distanceDisplayCondition,componentsPerAttribute:2,componentDatatype:i.FLOAT,usage:r[Y]}],t)}function M(t,i,r,n){var o=n._index,a=n._getActualPosition();t._mode===T.SCENE3D&&(e.expand(t._baseVolume,a,t._baseVolume),t._boundingVolumeDirty=!0),l.fromCartesian(a,K);var s=n.pixelSize,u=n.outlineWidth;t._maxPixelSize=Math.max(t._maxPixelSize,s+u);var c=r[Z.positionHighAndSize],h=K.high;c(o,h.x,h.y,h.z,s);var d=r[Z.positionLowAndOutline],p=K.low;d(o,p.x,p.y,p.z,u)}function I(e,i,r,n){var o=n._index,a=n.color,s=n.getPickId(i).color,l=n.outlineColor,u=t.floatToByte(a.red),c=t.floatToByte(a.green),h=t.floatToByte(a.blue),d=u*Q+c*J+h;u=t.floatToByte(l.red),c=t.floatToByte(l.green),h=t.floatToByte(l.blue);var p=u*Q+c*J+h;u=t.floatToByte(s.red),c=t.floatToByte(s.green),h=t.floatToByte(s.blue);var m=u*Q+c*J+h,f=t.floatToByte(a.alpha)*Q+t.floatToByte(l.alpha)*J+t.floatToByte(s.alpha),_=r[Z.compressedAttribute0];_(o,d,p,m,f)}function R(e,t,i,r){var o=r._index,a=0,s=1,l=1,c=1,h=r.translucencyByDistance;n(h)&&(a=h.near,s=h.nearValue,l=h.far,c=h.farValue,1===s&&1===c||(e._shaderTranslucencyByDistance=!0));var d=r.show&&r.clusterShow;0===r.color.alpha&&0===r.outlineColor.alpha&&(d=!1),s=u.clamp(s,0,1),s=1===s?255:255*s|0;var p=(d?1:0)*J+s;c=u.clamp(c,0,1),c=1===c?255:255*c|0;var m=c,f=i[Z.compressedAttribute1];f(o,p,m,a,l)}function O(e,t,i,r){var o=r._index,a=i[Z.scaleByDistance],s=0,l=1,u=1,c=1,h=r.scaleByDistance;n(h)&&(s=h.near,l=h.nearValue,u=h.far,c=h.farValue,1===l&&1===c||(e._shaderScaleByDistance=!0)),a(o,s,l,u,c)}function N(e,t,i,r){var o=r._index,a=i[Z.distanceDisplayCondition],s=0,l=Number.MAX_VALUE,u=r.distanceDisplayCondition;n(u)&&(s=u.near,l=u.far,e._shaderDistanceDisplayCondition=!0),a(o,s,l)}function L(e,t,i,r){M(e,t,i,r),I(e,t,i,r),R(e,t,i,r),O(e,t,i,r),N(e,t,i,r)}function B(t,i,r,o,a,s){var l;o.mode===T.SCENE3D?(l=t._baseVolume,t._boundingVolumeDirty=!0):l=t._baseVolume2D;for(var u=[],c=0;c<r;++c){var h=i[c],d=h.position,p=b._computeActualPosition(d,o,a);n(p)&&(h._setActualPosition(p),s?u.push(p):e.expand(l,p,l))}s&&e.fromPoints(u,l)}function F(e,t){var i=t.mode,r=e._pointPrimitives,n=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==i||i!==T.SCENE3D&&!c.equals(o,e.modelMatrix)?(e._mode=i,c.clone(e.modelMatrix,o),e._createVertexArray=!0,i!==T.SCENE3D&&i!==T.SCENE2D&&i!==T.COLUMBUS_VIEW||B(e,r,r.length,t,o,!0)):i===T.MORPHING?B(e,r,r.length,t,o,!0):i!==T.SCENE2D&&i!==T.COLUMBUS_VIEW||B(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1)}function V(e,t,i){var r=t.camera.getPixelSize(i,t.context.drawingBufferWidth,t.context.drawingBufferHeight),n=r*e._maxPixelSize;i.radius+=n}var k=b.SHOW_INDEX,z=b.POSITION_INDEX,U=b.COLOR_INDEX,G=b.OUTLINE_COLOR_INDEX,W=b.OUTLINE_WIDTH_INDEX,H=b.PIXEL_SIZE_INDEX,q=b.SCALE_BY_DISTANCE_INDEX,j=b.TRANSLUCENCY_BY_DISTANCE_INDEX,Y=b.DISTANCE_DISPLAY_CONDITION_INDEX,X=b.NUMBER_OF_PROPERTIES,Z={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayCondition:5};o(x.prototype,{length:{get:function(){return P(this),this._pointPrimitives.length}}}),x.prototype.add=function(e){var t=new b(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},x.prototype.remove=function(e){return!!this.contains(e)&&(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},x.prototype.removeAll=function(){A(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},x.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},x.prototype.contains=function(e){return n(e)&&e._pointPrimitiveCollection===this},x.prototype.get=function(e){return P(this),this._pointPrimitives[e]},x.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,i=this._propertiesChanged,r=0;r<X;++r){var n=0===i[r]?p.STATIC_DRAW:p.STREAM_DRAW;t=t||e[r]!==n,e[r]=n}return t};var K=new l,Q=65536,J=256,$=[];return x.prototype.update=function(t){P(this),this._maxTotalPointSize=m.maximumAliasedPointSize,F(this,t);var i,r=this._pointPrimitives,o=r.length,a=this._pointPrimitivesToUpdate,s=this._pointPrimitivesToUpdateIndex,l=this._propertiesChanged,u=this._createVertexArray,p=t.context,C=t.passes,b=C.pick;if(u||!b&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var x=0;x<X;++x)l[x]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),o>0){this._vaf=D(p,o,this._buffersUsage),i=this._vaf.writers;for(var A=0;A<o;++A){var B=this._pointPrimitives[A];B._dirty=!1,L(this,p,i,B)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(s>0){var K=$;K.length=0,(l[z]||l[W]||l[H])&&K.push(M),(l[U]||l[G])&&K.push(I),(l[k]||l[j])&&K.push(R),l[q]&&K.push(O),l[Y]&&K.push(N);var Q=K.length;if(i=this._vaf.writers,s/o>.1){for(var J=0;J<s;++J){var ee=a[J];ee._dirty=!1;for(var te=0;te<Q;++te)K[te](this,p,i,ee)}this._vaf.commit()}else{for(var ie=0;ie<s;++ie){var re=a[ie];re._dirty=!1;for(var ne=0;ne<Q;++ne)K[ne](this,p,i,re);this._vaf.subCommit(re._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(s>1.5*o&&(a.length=o),n(this._vaf)&&n(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var oe,ae=c.IDENTITY;t.mode===T.SCENE3D?(ae=this.modelMatrix,oe=e.clone(this._baseVolumeWC,this._boundingVolume)):oe=e.clone(this._baseVolume2D,this._boundingVolume),V(this,t,oe);var se,le,ue,ce,he,de,pe=t.commandList;if(C.render){var me=this._colorCommands;for(n(this._rs)||(this._rs=g.fromCache({depthTest:{enabled:!0,func:d.LEQUAL},blending:E.ALPHA_BLEND})),(!n(this._sp)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition)&&(he=new y({sources:[S]}),this._shaderScaleByDistance&&he.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&he.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&he.defines.push("DISTANCE_DISPLAY_CONDITION"),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:he,fragmentShaderSource:w,attributeLocations:Z}),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),se=this._vaf.va,le=se.length,me.length=le,ce=0;ce<le;++ce)ue=me[ce],n(ue)||(ue=me[ce]=new f({primitiveType:h.POINTS,pass:_.OPAQUE,owner:this})),ue.boundingVolume=oe,ue.modelMatrix=ae,ue.shaderProgram=this._sp,ue.uniformMap=this._uniforms,ue.vertexArray=se[ce].va,ue.renderState=this._rs,ue.debugShowBoundingVolume=this.debugShowBoundingVolume,pe.push(ue)}if(b){var fe=this._pickCommands;for((!n(this._spPick)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayConditionPick)&&(he=new y({defines:["RENDER_FOR_PICK"],sources:[S]}),this._shaderScaleByDistance&&he.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&he.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&he.defines.push("DISTANCE_DISPLAY_CONDITION"),de=new y({defines:["RENDER_FOR_PICK"],sources:[w]}),this._spPick=v.replaceCache({context:p,shaderProgram:this._spPick,vertexShaderSource:he,fragmentShaderSource:de,attributeLocations:Z}),this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition),se=this._vaf.va,le=se.length,fe.length=le,ce=0;ce<le;++ce)ue=fe[ce],n(ue)||(ue=fe[ce]=new f({primitiveType:h.POINTS,pass:_.OPAQUE,owner:this})),ue.boundingVolume=oe,ue.modelMatrix=ae,ue.shaderProgram=this._spPick,ue.uniformMap=this._uniforms,ue.vertexArray=se[ce].va,ue.renderState=this._rs,pe.push(ue)}}},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),A(this._pointPrimitives),a(this)},x}),i("ThirdParty/kdbush",[],function(){"use strict";function e(e,i,r,n,o){return new t(e,i,r,n,o)}function t(e,t,n,a,s){t=t||i,n=n||r,s=s||Array,this.nodeSize=a||64,this.points=e,this.ids=new s(e.length),this.coords=new s(2*e.length);for(var l=0;l<e.length;l++)this.ids[l]=l,this.coords[2*l]=t(e[l]),this.coords[2*l+1]=n(e[l]);o(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function i(e){return e[0]}function r(e){return e[1]}function n(e,t,i,r,n,o,a){for(var s,l,u=[0,e.length-1,0],c=[];u.length;){var h=u.pop(),d=u.pop(),p=u.pop();if(d-p<=a)for(var m=p;m<=d;m++)s=t[2*m],l=t[2*m+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[m]);else{var f=Math.floor((p+d)/2);s=t[2*f],l=t[2*f+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[f]);var _=(h+1)%2;(0===h?i<=s:r<=l)&&(u.push(p),u.push(f-1),u.push(_)),(0===h?n>=s:o>=l)&&(u.push(f+1),u.push(d),u.push(_))}}return c}function o(e,t,i,r,n,s){if(!(n-r<=i)){var l=Math.floor((r+n)/2);a(e,t,l,r,n,s%2),o(e,t,i,r,l-1,s+1),o(e,t,i,l+1,n,s+1)}}function a(e,t,i,r,n,o){for(;n>r;){if(n-r>600){var l=n-r+1,u=i-r+1,c=Math.log(l),h=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*h*(l-h)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(i-u*h/l+d)),m=Math.min(n,Math.floor(i+(l-u)*h/l+d));a(e,t,i,p,m,o)}var f=t[2*i+o],_=r,g=n;for(s(e,t,r,i),t[2*n+o]>f&&s(e,t,r,n);_<g;){for(s(e,t,_,g),_++,g--;t[2*_+o]<f;)_++;for(;t[2*g+o]>f;)g--}t[2*r+o]===f?s(e,t,r,g):(g++,s(e,t,g,n)),g<=i&&(r=g+1),i<=g&&(n=g-1)}}function s(e,t,i,r){l(e,i,r),l(t,2*i,2*r),l(t,2*i+1,2*r+1)}function l(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function u(e,t,i,r,n,o){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),h=a.pop(),d=a.pop();if(h-d<=o)for(var p=d;p<=h;p++)c(t[2*p],t[2*p+1],i,r)<=l&&s.push(e[p]);else{var m=Math.floor((d+h)/2),f=t[2*m],_=t[2*m+1];c(f,_,i,r)<=l&&s.push(e[m]);var g=(u+1)%2;(0===u?i-n<=f:r-n<=_)&&(a.push(d),a.push(m-1),a.push(g)),(0===u?i+n>=f:r+n>=_)&&(a.push(m+1),a.push(h),a.push(g))}}return s}function c(e,t,i,r){var n=e-i,o=t-r;return n*n+o*o}return t.prototype={range:function(e,t,i,r){return n(this.ids,this.coords,e,t,i,r,this.nodeSize)},within:function(e,t,i){return u(this.ids,this.coords,e,t,i,this.nodeSize)}},e}),i("DataSources/EntityCluster",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EllipsoidalOccluder","../Core/Event","../Core/Matrix4","../Scene/Billboard","../Scene/BillboardCollection","../Scene/Label","../Scene/LabelCollection","../Scene/PointPrimitive","../Scene/PointPrimitiveCollection","../ThirdParty/kdbush"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){e=r(e,r.EMPTY_OBJECT),this._enabled=r(e.enabled,!1),this._pixelRange=r(e.pixelRange,80),this._minimumClusterSize=r(e.minimumClusterSize,2),this._clusterBillboards=r(e.clusterBillboards,!0),this._clusterLabels=r(e.clusterLabels,!0),this._clusterPoints=r(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new s}function g(e){return e.coord.x}function v(e){return e.coord.y}function y(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}function C(t,i,r,o,a){if(n(t._labelCollection)&&o._clusterLabels?a=h.getScreenSpaceBoundingBox(t,i,a):n(t._billboardCollection)&&o._clusterBillboards?a=u.getScreenSpaceBoundingBox(t,i,a):n(t._pointPrimitiveCollection)&&o._clusterPoints&&(a=p.getScreenSpaceBoundingBox(t,i,a)),y(a,r),o._clusterLabels&&!n(t._labelCollection)&&n(t.id)&&E(o,t.id)&&n(t.id._label)){var s=o._collectionIndicesByEntity[t.id],l=o._labelCollection.get(s),c=h.getScreenSpaceBoundingBox(l,i,M);y(c,r),a=e.union(a,c,a)}return a}function w(e,t){if(e.clusterShow=!0,!n(e._labelCollection)&&n(e.id)&&E(t,e.id)&&n(e.id._label)){var i=t._collectionIndicesByEntity[e.id],r=t._labelCollection.get(i);r.clusterShow=!0}}function S(e,t,i,r){var n={billboard:r._clusterBillboardCollection.add(),label:r._clusterLabelCollection.add(),point:r._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.billboard.position=n.label.position=n.point.position=e,r._clusterEvent.raiseEvent(i,n)}function E(e,t){return n(e)&&n(e._collectionIndicesByEntity[t])&&n(e._collectionIndicesByEntity[t].labelIndex)}function b(e,t,i,r,o){if(n(e))for(var a=e.length,s=0;s<a;++s){var l=e.get(s);if(l.clusterShow=!1,l.show&&r.isPointVisible(l.position)){var u=o._clusterLabels&&n(l._labelCollection),c=o._clusterBillboards&&n(l.id._billboard),h=o._clusterPoints&&n(l.id._point);if(!u||!h&&!c){var d=l.computeScreenSpacePosition(i);n(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}}}function T(r){return function(o){if(!(n(o)&&o<.05)&&r.enabled){var s=r._scene,h=r._labelCollection,p=r._billboardCollection,_=r._pointCollection;if((n(h)||n(p)||n(_))&&(r._clusterBillboards||r._clusterLabels||r._clusterPoints)){var y=r._clusterLabelCollection,E=r._clusterBillboardCollection,T=r._clusterPointCollection;n(y)?y.removeAll():y=r._clusterLabelCollection=new d({scene:s}),n(E)?E.removeAll():E=r._clusterBillboardCollection=new c({scene:s}),n(T)?T.removeAll():T=r._clusterPointCollection=new m;var x=r._pixelRange,A=r._minimumClusterSize,P=r._previousClusters,D=[],M=r._previousHeight,N=s.camera.positionCartographic.height,L=s.mapProjection.ellipsoid,B=s.camera.positionWC,F=new a(L,B),V=[];r._clusterLabels&&b(h,V,s,F,r),r._clusterBillboards&&b(p,V,s,F,r),r._clusterPoints&&b(_,V,s,F,r);var k,z,U,G,W,H,q,j,Y,X,Z,K,Q=f(V,g,v,64,Int32Array);if(N<M)for(U=P.length,k=0;k<U;++k){var J=P[k];if(F.isPointVisible(J.position)){var $=u._computeScreenSpacePosition(l.IDENTITY,J.position,i.ZERO,t.ZERO,s);if(n($)){var ee=1-N/M,te=J.width=J.width*ee,ie=J.height=J.height*ee;te=Math.max(te,J.minimumWidth),ie=Math.max(ie,J.minimumHeight);var re=$.x-.5*te,ne=$.y-.5*ie,oe=$.x+te,ae=$.y+ie;for(W=Q.range(re,ne,oe,ae),H=W.length,X=0,Y=[],z=0;z<H;++z)q=W[z],j=V[q],j.clustered||(++X,Z=j.collection,K=j.index,Y.push(Z.get(K).id));if(X>=A)for(S(J.position,X,Y,r),D.push(J),z=0;z<H;++z)V[W[z]].clustered=!0}}}for(U=V.length,k=0;k<U;++k){var se=V[k];if(!se.clustered){se.clustered=!0,Z=se.collection,K=se.index;var le=Z.get(K);G=C(le,se.coord,x,r,I);var ue=e.clone(G,R);W=Q.range(G.x,G.y,G.x+G.width,G.y+G.height),H=W.length;var ce=i.clone(le.position);for(X=1,Y=[le.id],z=0;z<H;++z)if(q=W[z],j=V[q],!j.clustered){var he=j.collection.get(j.index),de=C(he,j.coord,x,r,O);i.add(he.position,ce,ce),e.union(ue,de,ue),++X,Y.push(he.id)}if(X>=A){var pe=i.multiplyByScalar(ce,1/X,ce);for(S(pe,X,Y,r),D.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),z=0;z<H;++z)V[W[z]].clustered=!0}else w(le,r)}}0===y.length&&(y.destroy(),r._clusterLabelCollection=void 0),0===E.length&&(E.destroy(),r._clusterBillboardCollection=void 0),0===T.length&&(T.destroy(),r._clusterPointCollection=void 0),r._previousClusters=D,r._previousHeight=N}}}}function x(e,t,i,r){return function(o){var a=this[e];n(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});var s=this._collectionIndicesByEntity[o.id];if(n(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),n(a)&&n(s[r]))return a.get(s[r]);n(a)||(a=this[e]=new t({scene:this._scene}));var l,u,c=this[i];return c.length>0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[r]=l,this._clusterDirty=!0,u}}function A(e,t){var i=e._collectionIndicesByEntity[t];n(i.billboardIndex)||n(i.labelIndex)||n(i.pointIndex)||delete e._collectionIndicesByEntity[t]}function P(e){if(n(e))for(var t=e.length,i=0;i<t;++i)e.get(i).clusterShow=!0}function D(e){e.enabled||(n(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),n(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),n(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,P(e._labelCollection),P(e._billboardCollection),P(e._pointCollection))}var M=new e,I=new e,R=new e,O=new e;return _.prototype._initialize=function(e){this._scene=e;var t=T(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},o(_.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}}),_.prototype.getLabel=x("_labelCollection",d,"_unusedLabelIndices","labelIndex"),_.prototype.removeLabel=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._labelCollection)&&n(t)&&n(t.labelIndex)){var i=t.labelIndex;t.labelIndex=void 0,A(this,e.id);var r=this._labelCollection.get(i);r.show=!1,r.text="",r.id=void 0,this._unusedLabelIndices.push(i),this._clusterDirty=!0}},_.prototype.getBillboard=x("_billboardCollection",c,"_unusedBillboardIndices","billboardIndex"),_.prototype.removeBillboard=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._billboardCollection)&&n(t)&&n(t.billboardIndex)){var i=t.billboardIndex;t.billboardIndex=void 0,A(this,e.id);var r=this._billboardCollection.get(i);r.id=void 0,r.show=!1,r.image=void 0,this._unusedBillboardIndices.push(i),this._clusterDirty=!0}},_.prototype.getPoint=x("_pointCollection",m,"_unusedPointIndices","pointIndex"),_.prototype.removePoint=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._pointCollection)&&n(t)&&n(t.pointIndex)){var i=t.pointIndex;t.pointIndex=void 0,A(this,e.id);var r=this._pointCollection.get(i);r.show=!1,r.id=void 0,this._unusedPointIndices.push(i),this._clusterDirty=!0}},_.prototype.update=function(e){if(n(this._labelCollection)&&this._labelCollection.length>0&&0===this._labelCollection.get(0)._glyphs.length){var t=e.commandList;e.commandList=[],this._labelCollection.update(e),e.commandList=t}this._enabledDirty&&(this._enabledDirty=!1,D(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),n(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),n(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),n(this._clusterPointCollection)&&this._clusterPointCollection.update(e),n(this._labelCollection)&&this._labelCollection.update(e),n(this._billboardCollection)&&this._billboardCollection.update(e),
n(this._pointCollection)&&this._pointCollection.update(e)},_.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),n(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1},_}),i("DataSources/CustomDataSource",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./DataSource","./EntityCluster","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._name=e,this._clock=void 0,this._changed=new r,this._error=new r,this._isLoading=!1,this._loading=new r,this._entityCollection=new a(this),this._entityCluster=new o}return t(s.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){n.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),s}),i("DataSources/CylinderGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new u),N=new e;return a(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new m(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),h=this._distanceDisplayConditionProperty.getValue(r),f=c.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var _=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(_=this._materialProperty.color.getValue(r)),a=t.fromColor(_),n={show:u,distanceDisplayCondition:f,color:a}}else n={show:u,distanceDisplayCondition:f};return new d({id:s,geometry:new i(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),s=this._distanceDisplayConditionProperty.getValue(i);return new d({id:n,geometry:new r(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new m(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var a=e.cylinder;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,d=a.length,m=a.topRadius,g=a.bottomRadius,v=a.show;if(o(v)&&v.isConstant&&!v.getValue(p.MINIMUM_VALUE)||!o(h)||!o(d)||!o(m)||!o(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=n(a.material,A),w=C instanceof y;this._materialProperty=C,this._fillProperty=n(s,D),this._showProperty=n(v,P),this._showOutlineProperty=n(a.outline,M),this._outlineColorProperty=c?n(a.outlineColor,I):void 0,this._shadowsProperty=n(a.shadows,R),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,O);var S=a.slices,b=a.outlineWidth,T=a.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&E.isConstant(e.orientation)&&d.isConstant&&m.isConstant&&g.isConstant&&E.isConstant(S)&&E.isConstant(b)&&E.isConstant(T)){var x=this._options;x.vertexFormat=w?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,x.length=d.getValue(p.MINIMUM_VALUE),x.topRadius=m.getValue(p.MINIMUM_VALUE),x.bottomRadius=g.getValue(p.MINIMUM_VALUE),x.slices=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,x.numberOfVerticalLines=o(T)?T.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(b)?b.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.cylinder;if(l.isShowing&&l.isAvailable(n)&&E.getValueOrDefault(u.show,n,!0)){var h=this._options,p=l._getModelMatrix(n),m=E.getValueOrUndefined(u.length,n),v=E.getValueOrUndefined(u.topRadius,n),y=E.getValueOrUndefined(u.bottomRadius,n);if(o(p)&&o(m)&&o(v)&&o(y)){h.length=m,h.topRadius=v,h.bottomRadius=y,h.slices=E.getValueOrUndefined(u.slices,n),h.numberOfVerticalLines=E.getValueOrUndefined(u.numberOfVerticalLines,n);var C=this._geometryUpdater.shadowsProperty.getValue(n),w=this._geometryUpdater.distanceDisplayConditionProperty,b=w.getValue(n),T=c.fromDistanceDisplayCondition(b);if(E.getValueOrDefault(u.fill,n,!0)){var x=S.getValue(n,s.fillMaterialProperty,this._material);this._material=x;var A=new f({material:x,translucent:x.isTranslucent(),closed:!0});h.vertexFormat=A.vertexFormat,this._primitive=a.add(new g({geometryInstances:new d({id:l,geometry:new i(h),modelMatrix:p,attributes:{distanceDisplayCondition:T}}),appearance:A,asynchronous:!1,shadows:C}))}if(E.getValueOrDefault(u.outline,n,!1)){h.vertexFormat=_.VERTEX_FORMAT;var P=E.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,N),D=E.getValueOrDefault(u.outlineWidth,n,1),M=1!==P.alpha;this._outlinePrimitive=a.add(new g({geometryInstances:new d({id:l,geometry:new r(h),modelMatrix:p,attributes:{color:t.fromColor(P),distanceDisplayCondition:T}}),appearance:new _({flat:!0,translucent:M,renderState:{lineWidth:s._scene.clampLineWidth(D)}}),asynchronous:!1,shadows:C}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),i("Scene/ColorBlendMode",["../Core/freezeObject","../Core/Math"],function(e,t){"use strict";var i={HIGHLIGHT:0,REPLACE:1,MIX:2};return i.getColorBlend=function(e,r){return e===i.HIGHLIGHT?0:e===i.REPLACE?1:e===i.MIX?t.clamp(r,t.EPSILON4,1):void 0},e(i)}),i("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o}return r(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return i(e)||(e=new l),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e},l.prototype.equals=function(e){return this===e||i(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(r){return i(r)||(r=new e),r.startTime=t(this.startTime,r.startTime),r.stopTime=t(this.stopTime,r.stopTime),r.currentTime=t(this.currentTime,r.currentTime),r.clockRange=t(this.clockRange,r.clockRange),r.multiplier=t(this.multiplier,r.multiplier),r.clockStep=t(this.clockStep,r.clockStep),r},l}),i("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}var u=t.WHITE,c=.1,h=new e(8,8),d=new e(0,0),p=new e(1,1);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),l.prototype.getType=function(e){return"Grid"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,c),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,h,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,p,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,d,t.lineOffset),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)&&s.equals(this._lineOffset,e._lineOffset)},l}),i("DataSources/PolylineArrowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"PolylineArrow"},a.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),i("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower}var l=e.WHITE,u=.25;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),glowPower:o("glowPower")}),s.prototype.getType=function(e){return"PolylineGlow"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,u,t.glowPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},s}),i("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}var l=e.WHITE,u=e.BLACK,c=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),s.prototype.getType=function(e){return"PolylineOutline"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,u,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,c),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s}),i("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(i,a.FIXED),this.setValue(t)}return i(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var i=e.length,r=0;r<i;r++)if(!s.isConstant(e[r]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._value;if(t(n)){var o=n.length;t(r)||(r=new Array(o));for(var a=0,s=0;a<o;){var l=n[a],u=l.getValueInReferenceFrame(e,i,r[a]);t(u)&&(r[s]=u,s++),a++}return r.length=s,r}},l.prototype.setValue=function(e){var i=this._eventHelper;if(i.removeAll(),t(e)){this._value=e.slice();for(var r=e.length,n=0;n<r;n++){var o=e[n];t(o)&&i.add(o.definitionChanged,l.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&s.arrayEquals(this._value,e._value)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),i("DataSources/PropertyArray",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._value=void 0,this._definitionChanged=new r,this._eventHelper=new n,this.setValue(e)}return t(a.prototype,{isConstant:{get:function(){var t=this._value;if(!e(t))return!0;for(var i=t.length,r=0;r<i;r++)if(!o.isConstant(t[r]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getValue=function(t,i){var r=this._value;if(e(r)){var n=r.length;e(i)||(i=new Array(n));for(var o=0,a=0;o<n;){var s=this._value[o],l=s.getValue(t,i[o]);e(l)&&(i[a]=l,a++),o++}return i.length=a,i}},a.prototype.setValue=function(t){var i=this._eventHelper;if(i.removeAll(),e(t)){this._value=t.slice();for(var r=t.length,n=0;n<r;n++){var o=t[n];e(o)&&i.add(o.definitionChanged,a.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},a.prototype.equals=function(e){return this===e||e instanceof a&&o.arrayEquals(this._value,e._value)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/RuntimeError","./Property"],function(e,t,i,r,n,o){"use strict";function a(t){var i=!0;if(t._resolveEntity){var r=t._targetCollection.getById(t._targetId);if(e(r)?(r.definitionChanged.addEventListener(l.prototype._onTargetEntityDefinitionChanged,t),t._targetEntity=r,t._resolveEntity=!1):(r=t._targetEntity,i=!1),!e(r))throw new n('target entity "'+t._targetId+'" could not be resolved.')}return i}function s(t){var i=t._targetProperty;if(t._resolveProperty){var r=a(t),o=t._targetPropertyNames;i=t._targetEntity;for(var s=o.length,l=0;l<s&&e(i);l++)i=i[o[l]];if(e(i))t._targetProperty=i,t._resolveProperty=!r;else if(!e(t._targetProperty))throw new n('targetProperty "'+t._targetId+"."+o.join(".")+'" could not be resolved.')}return i}function l(e,t,i){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=i,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new r,this._resolveEntity=!0,this._resolveProperty=!0,e.collectionChanged.addEventListener(l.prototype._onCollectionChanged,this)}return t(l.prototype,{isConstant:{get:function(){return o.isConstant(s(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return s(this).referenceFrame}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return s(this)}}}),l.fromString=function(e,t){for(var i,r=[],n=!0,o=!1,a="",s=0;s<t.length;++s){var u=t.charAt(s);o?(a+=u,o=!1):"\\"===u?o=!0:n&&"#"===u?(i=a,n=!1,a=""):n||"."!==u?a+=u:(r.push(a),a="")}return r.push(a),new l(e,i,r)},l.prototype.getValue=function(e,t){return s(this).getValue(e,t)},l.prototype.getValueInReferenceFrame=function(e,t,i){return s(this).getValueInReferenceFrame(e,t,i)},l.prototype.getType=function(e){return s(this).getType(e)},l.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,i=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==i.length)return!1;for(var r=this._targetPropertyNames.length,n=0;n<r;n++)if(t[n]!==i[n])return!1;return!0},l.prototype._onTargetEntityDefinitionChanged=function(e,t,i,r){this._targetPropertyNames[0]===t&&(this._resolveProperty=!0,this._definitionChanged.raiseEvent(this))},l.prototype._onCollectionChanged=function(t,i,r){var n=this._targetEntity;e(n)&&(r.indexOf(n)!==-1?(n.definitionChanged.removeEventListener(l.prototype._onTargetEntityDefinitionChanged,this),this._resolveEntity=!0,this._resolveProperty=!0):this._resolveEntity&&(s(this),this._resolveEntity||this._definitionChanged.raiseEvent(this)))},l}),i("DataSources/Rotation",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math"],function(e,t,i,r){"use strict";var n={packedLength:1,pack:function(t,i,r){return r=e(r,0),i[r]=t,i},unpack:function(t,i,r){return i=e(i,0),t[i]},convertPackedArrayForInterpolation:function(t,i,n,o){i=e(i,0),n=e(n,t.length);for(var a,s=0,l=n-i+1;s<l;s++){var u=t[i+s];0===s||Math.abs(a-u)<Math.PI?o[s]=u:o[s]=u-r.TWO_PI,a=u}},unpackInterpolationResult:function(e,t,i,n,o){return o=e[0],o<0?o+r.TWO_PI:o}};return n}),i("DataSources/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ExtrapolationType","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,i){var r,n=e.length,o=i.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(r=a-1;r>=t;r--)e[r]=e[s--]}for(r=0;r<o;r++)e[t++]=i[r]}function c(e,t){return e instanceof s?e:"string"==typeof e?s.fromIso8601(e):s.addSeconds(t,e,new s)}function h(t,r,n,o,a){for(var l,h,d,p,_,g,v=0;v<o.length;){_=c(o[v],t),d=e(r,_,s.compare);var y=0,C=0;if(d<0){for(d=~d,p=d*a,h=void 0,g=r[d];v<o.length&&(_=c(o[v],t),!(i(h)&&s.compare(h,_)>=0||i(g)&&s.compare(_,g)>=0));){for(m[y++]=_,v+=1,l=0;l<a;l++)f[C++]=o[v],v+=1;h=_}y>0&&(f.length=C,u(n,p,f),m.length=y,u(r,d,m))}else{for(l=0;l<a;l++)v++,n[d*a+l]=o[v];v++}}}function d(e,r){var n=e;n===Number&&(n=p);var s,u=n.packedLength,c=t(n.packedInterpolationLength,u),h=0;if(i(r)){var d=r.length;s=new Array(d);for(var m=0;m<d;m++){var f=r[m];f===Number&&(f=p);var _=f.packedLength;u+=_,c+=t(f.packedInterpolationLength,_),s[m]=f}h=d}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=l,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=u,this._packedInterpolationLength=c,this._updateTableLength=!0,this._interpolationResult=new Array(c),this._definitionChanged=new o,this._derivativeTypes=r,this._innerDerivativeTypes=s,this._inputOrder=h,this._forwardExtrapolationType=a.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=a.NONE,this._backwardExtrapolationDuration=0}var p={packedLength:1,pack:function(e,i,r){r=t(r,0),i[r]=e},unpack:function(e,i,r){return i=t(i,0),e[i]}},m=[],f=[];return r(d.prototype,{isConstant:{get:function(){return 0===this._values.length}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}}),d.prototype.getValue=function(t,r){var n=this._times,o=n.length;if(0!==o){var l,u=this._innerType,c=this._values,h=e(n,t,s.compare);if(h<0){if(h=~h,0===h){var d=n[h];if(l=this._backwardExtrapolationDuration,this._backwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(d,t)>l)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,r)}if(h>=o){h=o-1;var p=n[h];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return h=o-1,u.unpack(c,h*u.packedLength,r)}var m=this._xTable,f=this._yTable,_=this._interpolationAlgorithm,g=this._packedInterpolationLength,v=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(_.getRequiredDataPoints(this._interpolationDegree,v),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,m.length=y,f.length=y*g)}var C=this._numberOfPoints-1;if(C<1)return;var w=0,S=o-1,E=S-w+1;if(E>=C+1){var b=h-(C/2|0)-1;b<w&&(b=w);var T=b+C;T>S&&(T=S,b=T-C,b<w&&(b=w)),w=b,S=T}for(var x=S-w+1,A=0;A<x;++A)m[A]=s.secondsDifference(n[w+A],n[S]);if(i(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,w,S,f);else for(var P=0,D=this._packedLength,M=w*D,I=(S+1)*D;M<I;)f[P]=c[M],M++,P++;var R,O=s.secondsDifference(t,n[S]);if(0!==v&&i(_.interpolate)){var N=Math.floor(g/(v+1));R=_.interpolate(O,m,f,N,v,v,this._interpolationResult)}else R=_.interpolateOrderZero(O,m,f,g,this._interpolationResult);return i(u.unpackInterpolationResult)?u.unpackInterpolationResult(R,c,w,S,r):u.unpack(R,0,r)}return u.unpack(c,h*this._packedLength,r)}},d.prototype.setInterpolationOptions=function(e){var t=!1,i=e.interpolationAlgorithm,r=e.interpolationDegree;this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),this._interpolationDegree!==r&&(this._interpolationDegree=r,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))},d.prototype.addSample=function(e,t,r){var n=this._innerDerivativeTypes,o=i(n),a=this._innerType,s=[];if(s.push(e),a.pack(t,s,s.length),o)for(var l=n.length,u=0;u<l;u++)n[u].pack(r[u],s,s.length);h(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.addSamples=function(e,t,r){for(var n=this._innerDerivativeTypes,o=i(n),a=this._innerType,s=e.length,l=[],u=0;u<s;u++)if(l.push(e[u]),a.pack(t[u],l,l.length),o)for(var c=r[u],d=n.length,p=0;p<d;p++)n[p].pack(c[p],l,l.length);h(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.addSamplesPackedArray=function(e,t){h(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},d.prototype.equals=function(e){if(this===e)return!0;if(!i(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,r=i(t),n=e._derivativeTypes,o=i(n);if(r!==o)return!1;var a,l;if(r){if(l=t.length,l!==n.length)return!1;for(a=0;a<l;a++)if(t[a]!==n[a])return!1}var u=this._times,c=e._times;if(l=u.length,l!==c.length)return!1;for(a=0;a<l;a++)if(!s.equals(u[a],c[a]))return!1;var h=this._values,d=e._values;for(a=0;a<l;a++)if(h[a]!==d[a])return!1;return!0},d._mergeNewSamples=h,d}),i("DataSources/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i,r){r=t(r,0);var n;if(r>0){n=new Array(r);for(var s=0;s<r;s++)n[s]=e}this._numberOfDerivatives=r,this._property=new u(e,n),this._definitionChanged=new o,this._referenceFrame=t(i,a.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}return r(c.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{
get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}}),c.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},c.prototype.getValueInReferenceFrame=function(e,t,r){if(r=this._property.getValue(e,r),i(r))return s.convertToReferenceFrame(e,r,this._referenceFrame,t,r)},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t,i){this._numberOfDerivatives;this._property.addSample(e,t,i)},c.prototype.addSamples=function(e,t,i){this._property.addSamples(e,t,i)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||e instanceof c&&l.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),i("DataSources/StripeOrientation",["../Core/freezeObject"],function(e){"use strict";var t={HORIZONTAL:0,VERTICAL:1};return e(t)}),i("DataSources/StripeMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}var u=s.HORIZONTAL,c=e.WHITE,h=e.BLACK,d=0,p=1;return r(l.prototype,{isConstant:{get:function(){return a.isConstant(this._orientation)&&a.isConstant(this._evenColor)&&a.isConstant(this._oddColor)&&a.isConstant(this._offset)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:o("orientation"),evenColor:o("evenColor"),oddColor:o("oddColor"),offset:o("offset"),repeat:o("repeat")}),l.prototype.getType=function(e){return"Stripe"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.horizontal=a.getValueOrDefault(this._orientation,e,u)===s.HORIZONTAL,t.evenColor=a.getValueOrClonedDefault(this._evenColor,e,c,t.evenColor),t.oddColor=a.getValueOrClonedDefault(this._oddColor,e,h,t.oddColor),t.offset=a.getValueOrDefault(this._offset,e,d),t.repeat=a.getValueOrDefault(this._repeat,e,p),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._orientation,e._orientation)&&a.equals(this._evenColor,e._evenColor)&&a.equals(this._oddColor,e._oddColor)&&a.equals(this._offset,e._offset)&&a.equals(this._repeat,e._repeat)},l}),i("DataSources/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t){this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=e(t,o.FIXED)}return i(u.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},u.prototype.getValueInReferenceFrame=function(e,i,r){var n=this._intervals.findDataForIntervalContainingDate(e);if(t(n))return s.convertToReferenceFrame(e,n,this._referenceFrame,i,r)},u.prototype.equals=function(e){return this===e||e instanceof u&&this._intervals.equals(e._intervals,l.equals)&&this._referenceFrame===e._referenceFrame},u.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},u}),i("DataSources/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o){"use strict";function a(){this._definitionChanged=new r,this._intervals=new n,this._intervals.changedEvent.addEventListener(a.prototype._intervalsChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),a.prototype.getValue=function(t,i){var r=this._intervals.findDataForIntervalContainingDate(t);return e(r)&&"function"==typeof r.clone?r.clone(i):r},a.prototype.equals=function(e){return this===e||e instanceof a&&this._intervals.equals(e._intervals,o.equals)},a.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},a}),i("DataSources/VelocityVectorProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,i){this._position=void 0,this._subscription=void 0,this._definitionChanged=new o,this._normalize=t(i,!0),this.position=e}r(l.prototype,{isConstant:{get:function(){return s.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){var t=this._position;t!==e&&(i(t)&&this._subscription(),this._position=e,i(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var u=new e,c=new e,h=new a,d=1/60;return l.prototype.getValue=function(e,t){return this._getValue(e,t)},l.prototype._getValue=function(t,r,n){i(r)||(r=new e);var o=this._position;if(s.isConstant(o))return this._normalize?void 0:e.clone(e.ZERO,r);var l=o.getValue(t,u),p=o.getValue(a.addSeconds(t,d,h),c);if(i(l)&&(i(p)||(p=l,l=o.getValue(a.addSeconds(t,-d,h),c),i(l)))){if(e.equals(l,p))return this._normalize?void 0:e.clone(e.ZERO,r);i(n)&&l.clone(n);var m=e.subtract(p,l,r);return this._normalize?e.normalize(m,r):e.divideByScalar(m,d,r)}},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._position,e._position)},l}),i("DataSources/CzmlDataSource",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/CornerType","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ExtrapolationType","../Core/getAbsoluteUri","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/NearFarScalar","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/ShadowMode","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./BillboardGraphics","./BoxGraphics","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./CylinderGraphics","./DataSource","./DataSourceClock","./EllipseGraphics","./EllipsoidGraphics","./EntityCluster","./EntityCollection","./GridMaterialProperty","./ImageMaterialProperty","./LabelGraphics","./ModelGraphics","./NodeTransformationProperty","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineArrowMaterialProperty","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./PropertyArray","./PropertyBag","./RectangleGraphics","./ReferenceProperty","./Rotation","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./VelocityVectorProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De){"use strict";function Me(e,t){return"#"===t[0]&&(t=Pt+t),Ce.fromString(e,t)}function Ie(e){var t=e.rgbaf;if(c(t))return t;var i=e.rgba;if(c(i)){var r=i.length;if(r===a.packedLength)return[a.byteToFloat(i[0]),a.byteToFloat(i[1]),a.byteToFloat(i[2]),a.byteToFloat(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=a.byteToFloat(i[n+1]),t[n+2]=a.byteToFloat(i[n+2]),t[n+3]=a.byteToFloat(i[n+3]),t[n+4]=a.byteToFloat(i[n+4]);return t}}function Re(e,t){var i=u(e.uri,e);return c(t)&&(i=_(i,_(t))),i}function Oe(e){var t=e.wsen;if(c(t))return t;var i=e.wsenDegrees;if(c(i)){var r=i.length;if(r===P.packedLength)return[T.toRadians(i[0]),T.toRadians(i[1]),T.toRadians(i[2]),T.toRadians(i[3])];t=new Array(r);for(var n=0;n<r;n+=5)t[n]=i[n],t[n+1]=T.toRadians(i[n+1]),t[n+2]=T.toRadians(i[n+2]),t[n+3]=T.toRadians(i[n+3]),t[n+4]=T.toRadians(i[n+4]);return t}}function Ne(e){var t=e.length;if(Mt.magnitude=1,2===t)return Mt.clock=e[0],Mt.cone=e[1],i.fromSpherical(Mt,Dt),[Dt.x,Dt.y,Dt.z];for(var r=new Array(t/3*4),n=0,o=0;n<t;n+=3,o+=4)r[o]=e[n],Mt.clock=e[n+1],Mt.cone=e[n+2],i.fromSpherical(Mt,Dt),r[o+1]=Dt.x,r[o+2]=Dt.y,r[o+3]=Dt.z;return r}function Le(e){var t=e.length;if(3===t)return Mt.clock=e[0],Mt.cone=e[1],Mt.magnitude=e[2],i.fromSpherical(Mt,Dt),[Dt.x,Dt.y,Dt.z];for(var r=new Array(t),n=0;n<t;n+=4)r[n]=e[n],Mt.clock=e[n+1],Mt.cone=e[n+2],Mt.magnitude=e[n+3],i.fromSpherical(Mt,Dt),r[n+1]=Dt.x,r[n+2]=Dt.y,r[n+3]=Dt.z;return r}function Be(e){var t=e.length;if(3===t)return It.longitude=e[0],It.latitude=e[1],It.height=e[2],p.WGS84.cartographicToCartesian(It,Dt),[Dt.x,Dt.y,Dt.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],It.longitude=e[r+1],It.latitude=e[r+2],It.height=e[r+3],p.WGS84.cartographicToCartesian(It,Dt),i[r+1]=Dt.x,i[r+2]=Dt.y,i[r+3]=Dt.z;return i}function Fe(e){var t=e.length;if(3===t)return It.longitude=T.toRadians(e[0]),It.latitude=T.toRadians(e[1]),It.height=e[2],p.WGS84.cartographicToCartesian(It,Dt),[Dt.x,Dt.y,Dt.z];for(var i=new Array(t),r=0;r<t;r+=4)i[r]=e[r],It.longitude=T.toRadians(e[r+1]),It.latitude=T.toRadians(e[r+2]),It.height=e[r+3],p.WGS84.cartographicToCartesian(It,Dt),i[r+1]=Dt.x,i[r+2]=Dt.y,i[r+3]=Dt.z;return i}function Ve(e){var t=e.cartesian;if(c(t))return t;var i=e.cartesianVelocity;if(c(i))return i;var r=e.unitCartesian;if(c(r))return r;var n=e.unitSpherical;if(c(n))return Ne(n);var o=e.spherical;if(c(o))return Le(o);var a=e.cartographicRadians;if(c(a))return Be(a);var s=e.cartographicDegrees;if(c(s))return Fe(s);throw new M(JSON.stringify(e)+" is not a valid CZML interval.")}function ke(e,t){var i=e[t],r=e[t+1],n=e[t+2],o=e[t+3],a=1/Math.sqrt(i*i+r*r+n*n+o*o);e[t]=i*a,e[t+1]=r*a,e[t+2]=n*a,e[t+3]=o*a}function ze(e){var t=e.unitQuaternion;if(c(t)){if(4===t.length)return ke(t,0),t;for(var i=1;i<t.length;i+=5)ke(t,i)}return t}function Ue(r,n,o){switch(r){case Array:return n.array;case Boolean:return u(n.boolean,n);case e:return n.boundingRectangle;case t:return n.cartesian2;case i:return Ve(n);case a:return Ie(n);case N:return N[u(n.colorBlendMode,n)];case s:return s[u(n.cornerType,n)];case L:return L[u(n.heightReference,n)];case B:return B[u(n.horizontalOrigin,n)];case Image:return Re(n,o);case w:return w.fromIso8601(u(n.date,n));case F:return F[u(n.labelStyle,n)];case Number:return u(n.number,n);case x:return n.nearFarScalar;case A:return ze(n);case we:return u(n.number,n);case V:return V[u(n.shadows,n)];case String:return u(n.string,n);case Te:return Te[u(n.stripeOrientation,n)];case P:return Oe(n);case z:return Re(n,o);case k:return k[u(n.verticalOrigin,n)];default:throw new M(r)}}function Ge(e,t){var i=e.interpolationAlgorithm;(c(i)||c(e.interpolationDegree))&&t.setInterpolationOptions({interpolationAlgorithm:Ot[i],interpolationDegree:e.interpolationDegree});var r=e.forwardExtrapolationType;c(r)&&(t.forwardExtrapolationType=f[r]);var n=e.forwardExtrapolationDuration;c(n)&&(t.forwardExtrapolationDuration=n);var o=e.backwardExtrapolationType;c(o)&&(t.backwardExtrapolationType=f[o]);var a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}function We(e,t,i,r,n,o,a){var s,l=r.interval;c(l)?(Nt.iso8601=l,s=R.fromIso8601(Nt),c(n)&&(s=R.intersect(s,n,Rt))):c(n)&&(s=n);var h,d,p,m,f=c(r.reference),_=c(s)&&!s.equals(C.MAXIMUM_INTERVAL);f||(p=Ue(e,r,o),h=u(e.packedLength,1),m=u(p.length,1),d=!c(r.array)&&"string"!=typeof p&&m>h);var g="function"==typeof e.unpack&&e!==we;if(!d&&!_)return void(f?t[i]=Me(a,r.reference):g?t[i]=new Z(e.unpack(p,0)):t[i]=new Z(p));var v,y=t[i],S=r.epoch;if(c(S)&&(v=w.fromIso8601(S)),d&&!_)return y instanceof Ee||(y=new Ee(e),t[i]=y),y.addSamplesPackedArray(p,v),void Ge(r,y);var E;if(!d&&_)return s=s.clone(),f?s.data=Me(a,r.reference):g?s.data=e.unpack(p,0):s.data=p,c(y)||(y=f?new Y:new Ae,t[i]=y),void(!f&&y instanceof Ae?y.intervals.addInterval(s):y instanceof Y?(s.data=f?s.data:new Z(s.data),y.intervals.addInterval(s)):(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E),s.data=f?s.data:new Z(s.data),y.intervals.addInterval(s)));c(y)||(y=new Y,t[i]=y),y instanceof Y||(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E));var b=y.intervals;E=b.findInterval(s),c(E)&&E.data instanceof Ee||(E=s.clone(),E.data=new Ee(e),b.addInterval(E)),E.data.addSamplesPackedArray(p,v),Ge(r,E.data)}function He(e,t,i,r,n,o,a){if(c(r))if(y(r))for(var s=0,l=r.length;s<l;s++)We(e,t,i,r[s],n,o,a);else We(e,t,i,r,n,o,a)}function qe(e,t,r,n,o,a){var s,l=r.interval;c(l)?(Nt.iso8601=l,s=R.fromIso8601(Nt),c(n)&&(s=R.intersect(s,n,Rt))):c(n)&&(s=n);var h,d,p,m=!1,f=c(r.cartesianVelocity)?1:0,_=i.packedLength*(f+1),g=c(r.reference),v=c(s)&&!s.equals(C.MAXIMUM_INTERVAL);if(g||(c(r.referenceFrame)&&(h=D[r.referenceFrame]),h=u(h,D.FIXED),d=Ve(r),p=u(d.length,1),m=p>_),!m&&!v)return void(g?e[t]=Me(a,r.reference):e[t]=new X(i.unpack(d),h));var y,S=e[t],E=r.epoch;if(c(E)&&(y=w.fromIso8601(E)),m&&!v)return S instanceof Se&&(!c(h)||S.referenceFrame===h)||(S=new Se(h,f),e[t]=S),S.addSamplesPackedArray(d,y),void Ge(r,S);var b;if(!m&&v)return s=s.clone(),g?s.data=Me(a,r.reference):s.data=i.unpack(d),c(S)||(S=g?new j(h):new xe(h),e[t]=S),void(!g&&S instanceof xe&&c(h)&&S.referenceFrame===h?S.intervals.addInterval(s):S instanceof j?(s.data=g?s.data:new X(s.data,h),S.intervals.addInterval(s)):(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b),s.data=g?s.data:new X(s.data,h),S.intervals.addInterval(s)));c(S)?S instanceof j||(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b)):(S=new j(h),e[t]=S);var T=S.intervals;b=T.findInterval(s),c(b)&&b.data instanceof Se&&(!c(h)||b.data.referenceFrame===h)||(b=s.clone(),b.data=new Se(h,f),T.addInterval(b)),b.data.addSamplesPackedArray(d,y),Ge(r,b.data)}function je(e,t,i,r,n,o){if(c(i))if(y(i))for(var a=0,s=i.length;a<s;a++)qe(e,t,i[a],r,n,o);else qe(e,t,i,r,n,o)}function Ye(e,i,r,n,o,s){var l,u=r.interval;c(u)?(Nt.iso8601=u,l=R.fromIso8601(Nt),c(n)&&(l=R.intersect(l,n,Rt))):c(n)&&(l=n);var h,d,p=e[i];if(c(l)){p instanceof q||(p=new q,e[i]=p);var m=p.intervals;d=m.findInterval({start:l.start,stop:l.stop}),c(d)?h=d.data:(d=l.clone(),m.addInterval(d))}else h=p;var f;c(r.solidColor)?(h instanceof H||(h=new H),f=r.solidColor,He(a,h,"color",f.color,void 0,void 0,s)):c(r.grid)?(h instanceof ne||(h=new ne),f=r.grid,He(a,h,"color",f.color,void 0,o,s),He(Number,h,"cellAlpha",f.cellAlpha,void 0,o,s),He(t,h,"lineCount",f.lineCount,void 0,o,s),He(t,h,"lineThickness",f.lineThickness,void 0,o,s),He(t,h,"lineOffset",f.lineOffset,void 0,o,s)):c(r.image)?(h instanceof oe||(h=new oe),f=r.image,He(Image,h,"image",f.image,void 0,o,s),He(t,h,"repeat",f.repeat,void 0,o,s),He(a,h,"color",f.color,void 0,o,s),He(Boolean,h,"transparent",f.transparent,void 0,o,s)):c(r.stripe)?(h instanceof be||(h=new be),f=r.stripe,He(Te,h,"orientation",f.orientation,void 0,o,s),He(a,h,"evenColor",f.evenColor,void 0,o,s),He(a,h,"oddColor",f.oddColor,void 0,o,s),He(Number,h,"offset",f.offset,void 0,o,s),He(Number,h,"repeat",f.repeat,void 0,o,s)):c(r.polylineOutline)?(h instanceof fe||(h=new fe),f=r.polylineOutline,He(a,h,"color",f.color,void 0,o,s),He(a,h,"outlineColor",f.outlineColor,void 0,o,s),He(Number,h,"outlineWidth",f.outlineWidth,void 0,o,s)):c(r.polylineGlow)?(h instanceof pe||(h=new pe),f=r.polylineGlow,He(a,h,"color",f.color,void 0,o,s),He(Number,h,"glowPower",f.glowPower,void 0,o,s)):c(r.polylineArrow)&&(h instanceof de||(h=new de),f=r.polylineArrow,He(a,h,"color",f.color,void 0,void 0,s)),c(d)?d.data=h:e[i]=h}function Xe(e,t,i,r,n,o){if(c(i))if(y(i))for(var a=0,s=i.length;a<s;a++)Ye(e,t,i[a],r,n,o);else Ye(e,t,i,r,n,o)}function Ze(e,t,i,r){e.name=u(t.name,e.name)}function Ke(e,t,i,r){var n=t.description;c(n)&&He(String,e,"description",n,void 0,r,i)}function Qe(e,t,i,r){var n=t.position;c(n)&&je(e,"position",n,void 0,r,i)}function Je(e,t,r,n){var o=t.viewFrom;c(o)&&He(i,e,"viewFrom",o,void 0,n,r)}function $e(e,t,i,r){var n=t.orientation;c(n)&&He(A,e,"orientation",n,void 0,r,i)}function et(e,t,i,r){var n=i.references;if(c(n)){var o=n.map(function(e){return Me(r,e)}),a=i.interval;if(c(a)){if(a=R.fromIso8601(a),!(e[t]instanceof j)){a.data=new ge(o);var s=new Y;s.intervals.addInterval(a),e[t]=s}}else e[t]=new ge(o)}else He(Array,e,t,i,void 0,void 0,r)}function tt(e,t,i,r){if(c(i))if(y(i))for(var n=0,o=i.length;n<o;++n)et(e,t,i[n],r);else et(e,t,i,r)}function it(e,t,r,n){if(c(r.references)){var o=r.references.map(function(e){return Me(n,e)}),a=r.interval;if(c(a)){if(a=R.fromIso8601(a),!(e[t]instanceof j)){a.data=new _e(o);var s=new j;s.intervals.addInterval(a),e[t]=s}}else e[t]=new _e(o)}else c(r.cartesian)?r.array=i.unpackArray(r.cartesian):c(r.cartographicRadians)?r.array=i.fromRadiansArrayHeights(r.cartographicRadians):c(r.cartographicDegrees)&&(r.array=i.fromDegreesArrayHeights(r.cartographicDegrees)),c(r.array)&&He(Array,e,t,r,void 0,void 0,n)}function rt(e,t,i,r){if(c(i))if(y(i))for(var n=0,o=i.length;n<o;n++)it(e,t,i[n],r);else it(e,t,i,r)}function nt(e,t,i,r){var n,o=t.availability;if(c(o)){var a;if(y(o))for(var s=o.length,l=0;l<s;l++)c(a)||(a=new O),Nt.iso8601=o[l],n=R.fromIso8601(Nt),a.addInterval(n);else Nt.iso8601=o,n=R.fromIso8601(Nt),a=new O,a.addInterval(n);e.availability=a}}function ot(e,t,r,n,o){c(t)&&(c(t.velocityReference)?e.alignedAxis=new Pe(Me(o,t.velocityReference),!0):He(i,e,"alignedAxis",t,r,n,o))}function at(r,n,o,s){var l=n.billboard;if(c(l)){var u,h=l.interval;c(h)&&(Nt.iso8601=h,u=R.fromIso8601(Nt));var d=r.billboard;c(d)||(r.billboard=d=new G),He(Boolean,d,"show",l.show,u,s,o),He(Image,d,"image",l.image,u,s,o),He(Number,d,"scale",l.scale,u,s,o),He(t,d,"pixelOffset",l.pixelOffset,u,s,o),He(i,d,"eyeOffset",l.eyeOffset,u,s,o),He(B,d,"horizontalOrigin",l.horizontalOrigin,u,s,o),He(k,d,"verticalOrigin",l.verticalOrigin,u,s,o),He(L,d,"heightReference",l.heightReference,u,s,o),He(a,d,"color",l.color,u,s,o),He(we,d,"rotation",l.rotation,u,s,o),ot(d,l.alignedAxis,u,s,o),He(Boolean,d,"sizeInMeters",l.sizeInMeters,u,s,o),He(Number,d,"width",l.width,u,s,o),He(Number,d,"height",l.height,u,s,o),He(x,d,"scaleByDistance",l.scaleByDistance,u,s,o),He(x,d,"translucencyByDistance",l.translucencyByDistance,u,s,o),He(x,d,"pixelOffsetScaleByDistance",l.pixelOffsetScaleByDistance,u,s,o),He(e,d,"imageSubRegion",l.imageSubRegion,u,s,o)}}function st(e,t,r,n){var o=t.box;if(c(o)){var s,l=o.interval;c(l)&&(Nt.iso8601=l,s=R.fromIso8601(Nt));var u=e.box;c(u)||(e.box=u=new W),He(Boolean,u,"show",o.show,s,n,r),He(i,u,"dimensions",o.dimensions,s,n,r),He(Boolean,u,"fill",o.fill,s,n,r),Xe(u,"material",o.material,s,n,r),He(Boolean,u,"outline",o.outline,s,n,r),He(a,u,"outlineColor",o.outlineColor,s,n,r),He(Number,u,"outlineWidth",o.outlineWidth,s,n,r),He(V,u,"shadows",o.shadows,s,n,r)}}function lt(e,t,i,r){var n=t.corridor;if(c(n)){var o,l=n.interval;c(l)&&(Nt.iso8601=l,o=R.fromIso8601(Nt));var u=e.corridor;c(u)||(e.corridor=u=new K),He(Boolean,u,"show",n.show,o,r,i),rt(u,"positions",n.positions,i),He(Number,u,"width",n.width,o,r,i),He(Number,u,"height",n.height,o,r,i),He(Number,u,"extrudedHeight",n.extrudedHeight,o,r,i),He(s,u,"cornerType",n.cornerType,o,r,i),He(Number,u,"granularity",n.granularity,o,r,i),He(Boolean,u,"fill",n.fill,o,r,i),Xe(u,"material",n.material,o,r,i),He(Boolean,u,"outline",n.outline,o,r,i),He(a,u,"outlineColor",n.outlineColor,o,r,i),He(Number,u,"outlineWidth",n.outlineWidth,o,r,i),He(V,u,"shadows",n.shadows,o,r,i)}}function ut(e,t,i,r){var n=t.cylinder;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.cylinder;c(l)||(e.cylinder=l=new Q),He(Boolean,l,"show",n.show,o,r,i),He(Number,l,"length",n.length,o,r,i),He(Number,l,"topRadius",n.topRadius,o,r,i),He(Number,l,"bottomRadius",n.bottomRadius,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),He(Number,l,"slices",n.slices,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function ct(e,t){var i=e.version;if(c(i)&&"string"==typeof i){var r=i.split(".");if(2===r.length){if("1"!==r[0])throw new M("Cesium only supports CZML version 1.");t._version=i}}if(!c(t._version))throw new M("CZML version information invalid.  It is expected to be a property on the document object in the <Major>.<Minor> version format.");var n=t._documentPacket;c(e.name)&&(n.name=e.name);var o=e.clock;if(c(o)){var a=n.clock;c(a)?(a.interval=u(o.interval,a.interval),a.currentTime=u(o.currentTime,a.currentTime),a.range=u(o.range,a.range),a.step=u(o.step,a.step),a.multiplier=u(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function ht(e,t,i,r){var n=t.ellipse;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.ellipse;c(l)||(e.ellipse=l=new ee),He(Boolean,l,"show",n.show,o,r,i),He(Number,l,"semiMajorAxis",n.semiMajorAxis,o,r,i),He(Number,l,"semiMinorAxis",n.semiMinorAxis,o,r,i),He(Number,l,"height",n.height,o,r,i),He(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),He(we,l,"rotation",n.rotation,o,r,i),He(we,l,"stRotation",n.stRotation,o,r,i),He(Number,l,"granularity",n.granularity,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function dt(e,t,r,n){var o=t.ellipsoid;if(c(o)){var s,l=o.interval;c(l)&&(Nt.iso8601=l,s=R.fromIso8601(Nt));var u=e.ellipsoid;c(u)||(e.ellipsoid=u=new te),He(Boolean,u,"show",o.show,s,n,r),He(i,u,"radii",o.radii,s,n,r),He(Boolean,u,"fill",o.fill,s,n,r),Xe(u,"material",o.material,s,n,r),He(Boolean,u,"outline",o.outline,s,n,r),He(a,u,"outlineColor",o.outlineColor,s,n,r),He(Number,u,"outlineWidth",o.outlineWidth,s,n,r),He(Number,u,"stackPartitions",o.stackPartitions,s,n,r),He(Number,u,"slicePartitions",o.slicePartitions,s,n,r),He(Number,u,"subdivisions",o.subdivisions,s,n,r),He(V,u,"shadows",o.shadows,s,n,r)}}function pt(e,r,n,o){var s=r.label;if(c(s)){var l,u=s.interval;c(u)&&(Nt.iso8601=u,l=R.fromIso8601(Nt));var h=e.label;c(h)||(e.label=h=new ae),He(Boolean,h,"show",s.show,l,o,n),He(String,h,"text",s.text,l,o,n),He(String,h,"font",s.font,l,o,n),He(F,h,"style",s.style,l,o,n),He(Number,h,"scale",s.scale,l,o,n),He(Boolean,h,"showBackground",s.showBackground,l,o,n),He(a,h,"backgroundColor",s.backgroundColor,l,o,n),He(t,h,"backgroundPadding",s.backgroundPadding,l,o,n),He(t,h,"pixelOffset",s.pixelOffset,l,o,n),He(i,h,"eyeOffset",s.eyeOffset,l,o,n),He(B,h,"horizontalOrigin",s.horizontalOrigin,l,o,n),He(k,h,"verticalOrigin",s.verticalOrigin,l,o,n),He(L,h,"heightReference",s.heightReference,l,o,n),He(a,h,"fillColor",s.fillColor,l,o,n),He(a,h,"outlineColor",s.outlineColor,l,o,n),He(Number,h,"outlineWidth",s.outlineWidth,l,o,n),He(x,h,"translucencyByDistance",s.translucencyByDistance,l,o,n),He(x,h,"pixelOffsetScaleByDistance",s.pixelOffsetScaleByDistance,l,o,n)}}function mt(e,t,i,r){var n=t.model;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.model;c(l)||(e.model=l=new se),He(Boolean,l,"show",n.show,o,r,i),He(z,l,"uri",n.gltf,o,r,i),He(Number,l,"scale",n.scale,o,r,i),He(Number,l,"minimumPixelSize",n.minimumPixelSize,o,r,i),He(Number,l,"maximumScale",n.maximumScale,o,r,i),He(Boolean,l,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),He(Boolean,l,"runAnimations",n.runAnimations,o,r,i),He(V,l,"shadows",n.shadows,o,r,i),He(L,l,"heightReference",n.heightReference,o,r,i),He(a,l,"silhouetteColor",n.silhouetteColor,o,r,i),He(Number,l,"silhouetteSize",n.silhouetteSize,o,r,i),He(a,l,"color",n.color,o,r,i),He(N,l,"colorBlendMode",n.colorBlendMode,o,r,i),He(Number,l,"colorBlendAmount",n.colorBlendAmount,o,r,i);var u=n.nodeTransformations;if(c(u))if(y(u))for(var h=0,d=u.length;h<d;h++)ft(l,u[h],o,r,i);else ft(l,u,o,r,i)}}function ft(e,t,r,n,o){var a,s=t.interval;c(s)?(Nt.iso8601=s,a=R.fromIso8601(Nt),c(r)&&(a=R.intersect(a,r,Rt))):c(r)&&(a=r);for(var l=e.nodeTransformations,u=Object.keys(t),h=0,d=u.length;h<d;++h){var p=u[h];if("interval"!==p){var m=t[p];if(c(m)){c(l)||(e.nodeTransformations=l=new ve),l.hasProperty(p)||l.addProperty(p);var f=l[p];c(f)||(l[p]=f=new le),He(i,f,"translation",m.translation,a,n,o),He(A,f,"rotation",m.rotation,a,n,o),He(i,f,"scale",m.scale,a,n,o)}}}}function _t(e,t,i,r){var n=t.path;if(c(n)){var o,a=n.interval;c(a)&&(Nt.iso8601=a,o=R.fromIso8601(Nt));var s=e.path;c(s)||(e.path=s=new ue),He(Boolean,s,"show",n.show,o,r,i),He(Number,s,"width",n.width,o,r,i),He(Number,s,"resolution",n.resolution,o,r,i),He(Number,s,"leadTime",n.leadTime,o,r,i),He(Number,s,"trailTime",n.trailTime,o,r,i),Xe(s,"material",n.material,o,r,i)}}function gt(e,t,i,r){var n=t.point;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.point;c(l)||(e.point=l=new ce),He(Boolean,l,"show",n.show,o,r,i),He(Number,l,"pixelSize",n.pixelSize,o,r,i),He(L,l,"heightReference",n.heightReference,o,r,i),He(a,l,"color",n.color,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(x,l,"scaleByDistance",n.scaleByDistance,o,r,i),He(x,l,"translucencyByDistance",n.translucencyByDistance,o,r,i)}}function vt(e,t,i,r){var n=t.polygon;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.polygon;c(l)||(e.polygon=l=new he),He(Boolean,l,"show",n.show,o,r,i),rt(l,"hierarchy",n.positions,i),He(Number,l,"height",n.height,o,r,i),He(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),He(we,l,"stRotation",n.stRotation,o,r,i),He(Number,l,"granularity",n.granularity,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(Boolean,l,"perPositionHeight",n.perPositionHeight,o,r,i),He(Boolean,l,"closeTop",n.closeTop,o,r,i),He(Boolean,l,"closeBottom",n.closeBottom,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function yt(e,t,i,r){var n=t.polyline;if(c(n)){var o,a=n.interval;c(a)&&(Nt.iso8601=a,o=R.fromIso8601(Nt));var s=e.polyline;c(s)||(e.polyline=s=new me),He(Boolean,s,"show",n.show,o,r,i),rt(s,"positions",n.positions,i),He(Number,s,"width",n.width,o,r,i),He(Number,s,"granularity",n.granularity,o,r,i),Xe(s,"material",n.material,o,r,i),He(Boolean,s,"followSurface",n.followSurface,o,r,i),He(V,s,"shadows",n.shadows,o,r,i)}}function Ct(e,t,i,r){var n=t.rectangle;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.rectangle;c(l)||(e.rectangle=l=new ye),He(Boolean,l,"show",n.show,o,r,i),He(P,l,"coordinates",n.coordinates,o,r,i),He(Number,l,"height",n.height,o,r,i),He(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),He(we,l,"rotation",n.rotation,o,r,i),He(we,l,"stRotation",n.stRotation,o,r,i),He(Number,l,"granularity",n.granularity,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(Boolean,l,"closeTop",n.closeTop,o,r,i),He(Boolean,l,"closeBottom",n.closeBottom,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function wt(e,t,i,r){var n=t.wall;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.wall;c(l)||(e.wall=l=new De),He(Boolean,l,"show",n.show,o,r,i),rt(l,"positions",n.positions,i),tt(l,"minimumHeights",n.minimumHeights,i),tt(l,"maximumHeights",n.maximumHeights,i),He(Number,l,"granularity",n.granularity,o,r,i),He(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),He(Boolean,l,"outline",n.outline,o,r,i),He(a,l,"outlineColor",n.outlineColor,o,r,i),He(Number,l,"outlineWidth",n.outlineWidth,o,r,i),He(V,l,"shadows",n.shadows,o,r,i)}}function St(e,t,i,r,n){var o=e.id;if(c(o)||(o=l()),Pt=o,!c(n._version)&&"document"!==o)throw new M("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if("document"===o)ct(e,n);else{var a=t.getOrCreateEntity(o),s=e.parent;c(s)&&(a.parent=t.getOrCreateEntity(s));for(var u=i.length-1;u>-1;u--)i[u](a,e,t,r)}Pt=void 0}function Et(e){var t,i=e._documentPacket.clock;if(!c(i)){if(!c(e._clock)){var r=e._entityCollection.computeAvailability();if(!r.start.equals(C.MINIMUM_VALUE)){var a=r.start,s=r.stop,l=w.secondsDifference(s,a),h=Math.round(l/120);return t=new $,t.startTime=w.clone(a),t.stopTime=w.clone(s),t.clockRange=n.LOOP_STOP,t.multiplier=h,t.currentTime=w.clone(a),t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(c(e._clock)?t=e._clock.clone():(t=new $,t.startTime=C.MINIMUM_VALUE.clone(),t.stopTime=C.MAXIMUM_VALUE.clone(),t.currentTime=C.MINIMUM_VALUE.clone(),t.clockRange=n.LOOP_STOP,t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),c(i.interval)){Nt.iso8601=i.interval;var d=R.fromIso8601(Nt);t.startTime=d.start,t.stopTime=d.stop}return c(i.currentTime)&&(t.currentTime=w.fromIso8601(i.currentTime)),c(i.range)&&(t.clockRange=u(n[i.range],n.LOOP_STOP)),c(i.step)&&(t.clockStep=u(o[i.step],o.SYSTEM_CLOCK_MULTIPLIER)),c(i.multiplier)&&(t.multiplier=i.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function bt(e,t,i,r){i=u(i,u.EMPTY_OBJECT);var n=t,o=i.sourceUri;return"string"==typeof t&&(n=b(t),o=u(o,t)),J.setLoading(e,!0),U(n,function(t){return Tt(e,t,o,r)}).otherwise(function(t){return J.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),U.reject(t)})}function Tt(e,t,i,r){J.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new xt,n.removeAll()),At._processCzml(t,n,i,void 0,e);var o=Et(e),a=e._documentPacket;return c(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!c(e._name)&&c(i)&&(e._name=g(i),o=!0),J.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function xt(){this.name=void 0,
this.clock=void 0}function At(e){this._name=e,this._changed=new m,this._error=new m,this._isLoading=!1,this._loading=new m,this._clock=void 0,this._documentPacket=new xt,this._version=void 0,this._entityCollection=new re(this),this._entityCluster=new ie}var Pt,Dt=new i,Mt=new I,It=new r,Rt=new R,Ot={HERMITE:v,LAGRANGE:S,LINEAR:E},Nt={iso8601:void 0};return At.load=function(e,t){return(new At).load(e,t)},h(At.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),At.updaters=[at,st,lt,ut,ht,dt,pt,mt,Ze,Ke,_t,gt,vt,yt,Ct,Qe,Je,wt,$e,nt],At.prototype.process=function(e,t){return bt(this,e,t,!1)},At.prototype.load=function(e,t){return bt(this,e,t,!0)},At.processPacketData=He,At.processPositionPacketData=je,At.processMaterialPacketData=Xe,At._processCzml=function(e,t,i,r,n){if(r=c(r)?r:At.updaters,y(e))for(var o=0,a=e.length;o<a;o++)St(e[o],t,r,i,n);else St(e,t,r,i,n)},At}),i("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o}return i(s.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}}}),s.prototype.add=function(e){var t=this,i=this._dataSources;return a(e,function(e){return i===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},s.prototype.remove=function(t,i){i=e(i,!1);var r=this._dataSources.indexOf(t);return r!==-1&&(this._dataSources.splice(r,1),this._dataSourceRemoved.raiseEvent(this,t),i&&"function"==typeof t.destroy&&t.destroy(),!0)},s.prototype.removeAll=function(t){t=e(t,!1);for(var i=this._dataSources,r=0,n=i.length;r<n;++r){var o=i[r];this._dataSourceRemoved.raiseEvent(this,o),t&&"function"==typeof o.destroy&&o.destroy()}this._dataSources=[]},s.prototype.contains=function(e){return this.indexOf(e)!==-1},s.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},s.prototype.get=function(e){return this._dataSources[e]},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this.removeAll(!0),r(this)},s}),i("DataSources/EllipseGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new s),B=new e;return n(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),n(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),c=new f(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),p=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof w){var m=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(i)),o=t.fromColor(m),n={show:c,distanceDisplayCondition:p,color:o}}else n={show:c,distanceDisplayCondition:p};return new d({id:a,geometry:new u(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new d({id:r,geometry:new c(this._options),attributes:{show:new f(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"position"===t||"ellipse"===t){var a=this._entity.ellipse;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=this._entity.position,d=a.semiMajorAxis,f=a.semiMinorAxis,y=a.show;if(r(y)&&y.isConstant&&!y.getValue(p.MINIMUM_VALUE)||!r(h)||!r(d)||!r(f))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=i(a.material,D),S=C instanceof w;this._materialProperty=C,this._fillProperty=i(s,I),this._showProperty=i(y,M),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,O):void 0,this._shadowsProperty=i(a.shadows,N),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,L);var E=a.rotation,b=a.height,x=a.extrudedHeight,A=a.granularity,P=a.stRotation,B=a.outlineWidth,F=a.numberOfVerticalLines,V=l&&!r(b)&&!r(x)&&S&&_.isSupported(this._scene);if(c&&V&&(m(m.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=V,this._isClosed=r(x)||V,this._outlineEnabled=c,h.isConstant&&d.isConstant&&f.isConstant&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&T.isConstant(P)&&T.isConstant(B)&&T.isConstant(F)&&(!V||T.isConstant(C))){var k=this._options;k.vertexFormat=S?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,k.center=h.getValue(p.MINIMUM_VALUE,k.center),k.semiMajorAxis=d.getValue(p.MINIMUM_VALUE,k.semiMajorAxis),k.semiMinorAxis=f.getValue(p.MINIMUM_VALUE,k.semiMinorAxis),k.rotation=r(E)?E.getValue(p.MINIMUM_VALUE):void 0,k.height=r(b)?b.getValue(p.MINIMUM_VALUE):void 0,k.extrudedHeight=r(x)?x.getValue(p.MINIMUM_VALUE):void 0,k.granularity=r(A)?A.getValue(p.MINIMUM_VALUE):void 0,k.stRotation=r(P)?P.getValue(p.MINIMUM_VALUE):void 0,k.numberOfVerticalLines=r(F)?F.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=r(B)?B.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var h=n._entity,p=h.ellipse;if(h.isShowing&&h.isAvailable(i)&&T.getValueOrDefault(p.show,i,!0)){var m=this._options,f=T.getValueOrUndefined(h.position,i,m.center),C=T.getValueOrUndefined(p.semiMajorAxis,i),w=T.getValueOrUndefined(p.semiMinorAxis,i);if(r(f)&&r(C)&&r(w)){m.center=f,m.semiMajorAxis=C,m.semiMinorAxis=w,m.rotation=T.getValueOrUndefined(p.rotation,i),m.height=T.getValueOrUndefined(p.height,i),m.extrudedHeight=T.getValueOrUndefined(p.extrudedHeight,i),m.granularity=T.getValueOrUndefined(p.granularity,i),m.stRotation=T.getValueOrUndefined(p.stRotation,i),m.numberOfVerticalLines=T.getValueOrUndefined(p.numberOfVerticalLines,i);var S=this._geometryUpdater.shadowsProperty.getValue(i),E=this._geometryUpdater.distanceDisplayConditionProperty,x=E.getValue(i),A=l.fromDistanceDisplayCondition(x);if(T.getValueOrDefault(p.fill,i,!0)){var P=n.fillMaterialProperty,D=b.getValue(i,P,this._material);if(this._material=D,o){var M=e.WHITE;r(P.color)&&(M=P.color.getValue(i)),this._primitive=s.add(new _({geometryInstances:new d({id:h,geometry:new u(m),attributes:{color:t.fromColor(M),distanceDisplayCondition:A}}),asynchronous:!1,shadows:S}))}else{var I=new g({material:D,translucent:D.isTranslucent(),closed:r(m.extrudedHeight)});m.vertexFormat=I.vertexFormat,this._primitive=a.add(new y({geometryInstances:new d({id:h,geometry:new u(m)}),attributes:{distanceDisplayCondition:A},appearance:I,asynchronous:!1,shadows:S}))}}if(!o&&T.getValueOrDefault(p.outline,i,!1)){m.vertexFormat=v.VERTEX_FORMAT;var R=T.getValueOrClonedDefault(p.outlineColor,i,e.BLACK,B),O=T.getValueOrDefault(p.outlineWidth,i,1),N=1!==R.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new d({id:h,geometry:new c(m),attributes:{color:t.fromColor(R),distanceDisplayCondition:A}}),appearance:new v({flat:!0,translucent:N,renderState:{lineWidth:n._scene.clampLineWidth(O)}}),asynchronous:!1,shadows:S}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),i("DataSources/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0}function P(e,t){this._scene=t,this._entity=e,this._entitySubscription=e.definitionChanged.addEventListener(P.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new A(e),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function D(e,t){this._entity=t._entity,this._scene=t._scene,this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new A(t._entity),this._modelMatrix=new f,this._material=void 0,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0}var M=new S(t.WHITE),I=new E(!0),R=new E(!0),O=new E(!1),N=new E(t.BLACK),L=new E(w.DISABLED),B=new E(new l),F=new e,V=new t,k=new e(1,1,1);return o(P,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),o(P.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&x.isConstant(this._showProperty)&&x.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!n(this._entity.availability)&&x.isConstant(this._showProperty)&&x.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),P.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},P.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},P.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new _(s&&a.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),h=this._distanceDisplayConditionProperty.getValue(e),d=u.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof S){var f=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(e)),o=i.fromColor(f),r={show:l,distanceDisplayCondition:d,color:o}}else r={show:l,distanceDisplayCondition:d};return new p({id:a,geometry:new c(this._options),modelMatrix:a._getModelMatrix(m.MINIMUM_VALUE),attributes:r})},P.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,n=r.isAvailable(e),o=x.getValueOrDefault(this._outlineColorProperty,e,t.BLACK),a=this._distanceDisplayConditionProperty.getValue(e);return new p({id:r,geometry:new h(this._options),modelMatrix:r._getModelMatrix(m.MINIMUM_VALUE),attributes:{show:new _(n&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(o),distanceDisplayCondition:u.fromDistanceDisplayCondition(a)}})},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._entitySubscription(),a(this)},P.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"position"===t||"orientation"===t||"ellipsoid"===t){var a=e.ellipsoid;if(!n(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!n(s)||!s.isConstant||s.getValue(m.MINIMUM_VALUE),u=a.outline,c=n(u);if(c&&u.isConstant&&(c=u.getValue(m.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=e.position,d=a.radii,p=a.show;if(n(p)&&p.isConstant&&!p.getValue(m.MINIMUM_VALUE)||!n(h)||!n(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=r(a.material,M),_=f instanceof S;this._materialProperty=f,this._fillProperty=r(s,R),this._showProperty=r(p,I),this._showOutlineProperty=r(a.outline,O),this._outlineColorProperty=c?r(a.outlineColor,N):void 0,this._shadowsProperty=r(a.shadows,L),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,B),this._fillEnabled=l,this._outlineEnabled=c;var y=a.stackPartitions,C=a.slicePartitions,w=a.outlineWidth,E=a.subdivisions;if(h.isConstant&&x.isConstant(e.orientation)&&d.isConstant&&x.isConstant(y)&&x.isConstant(C)&&x.isConstant(w)&&x.isConstant(E)){var b=this._options;b.vertexFormat=_?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,b.radii=d.getValue(m.MINIMUM_VALUE,b.radii),b.stackPartitions=n(y)?y.getValue(m.MINIMUM_VALUE):void 0,b.slicePartitions=n(C)?C.getValue(m.MINIMUM_VALUE):void 0,b.subdivisions=n(E)?E.getValue(m.MINIMUM_VALUE):void 0,this._outlineWidth=n(w)?w.getValue(m.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},P.prototype.createDynamicUpdater=function(e){return new D(e,this)},D.prototype.update=function(e){var o=this._entity,a=o.ellipsoid;if(!o.isShowing||!o.isAvailable(e)||!x.getValueOrDefault(a.show,e,!0))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var s=x.getValueOrUndefined(a.radii,e,F),d=o._getModelMatrix(e,this._modelMatrix);if(!n(d)||!n(s))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var m,w=x.getValueOrDefault(a.fill,e,!0),S=x.getValueOrDefault(a.outline,e,!1),E=x.getValueOrClonedDefault(a.outlineColor,e,t.BLACK,V),b=T.getValue(e,r(a.material,M),this._material);this._material=b;var A=x.getValueOrUndefined(a.stackPartitions,e),P=x.getValueOrUndefined(a.slicePartitions,e),D=x.getValueOrUndefined(a.subdivisions,e),I=x.getValueOrDefault(a.outlineWidth,e,1),R=this._scene.mode,O=R===C.SCENE3D,N=this._options,L=this._geometryUpdater.shadowsProperty.getValue(e),B=this._geometryUpdater.distanceDisplayConditionProperty,z=B.getValue(e),U=u.fromDistanceDisplayCondition(z),G=!O||this._lastSceneMode!==R||!n(this._primitive)||N.stackPartitions!==A||N.slicePartitions!==P||N.subdivisions!==D||this._lastOutlineWidth!==I;if(G){var W=this._primitives;W.removeAndDestroy(this._primitive),W.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=R,this._lastOutlineWidth=I,N.stackPartitions=A,N.slicePartitions=P,N.subdivisions=D,N.radii=O?k:s,m=new g({material:b,translucent:b.isTranslucent(),closed:!0}),N.vertexFormat=m.vertexFormat,this._primitive=W.add(new y({geometryInstances:new p({id:o,geometry:new c(N),modelMatrix:O?void 0:d,attributes:{show:new _(w),distanceDisplayCondition:U}}),appearance:m,asynchronous:!1,shadows:L})),N.vertexFormat=v.VERTEX_FORMAT,this._outlinePrimitive=W.add(new y({geometryInstances:new p({id:o,geometry:new h(N),modelMatrix:O?void 0:d,attributes:{show:new _(S),color:i.fromColor(E),distanceDisplayCondition:U}}),appearance:new v({flat:!0,translucent:1!==E.alpha,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:L})),this._lastShow=w,this._lastOutlineShow=S,this._lastOutlineColor=t.clone(E,this._lastOutlineColor),this._lastDistanceDisplayCondition=z}else if(this._primitive.ready){var H=this._primitive,q=this._outlinePrimitive;H.show=!0,q.show=!0,m=H.appearance,m.material=b;var j=this._attributes;n(j)||(j=H.getGeometryInstanceAttributes(o),this._attributes=j),w!==this._lastShow&&(j.show=_.toValue(w,j.show),this._lastShow=w);var Y=this._outlineAttributes;n(Y)||(Y=q.getGeometryInstanceAttributes(o),this._outlineAttributes=Y),S!==this._lastOutlineShow&&(Y.show=_.toValue(S,Y.show),this._lastOutlineShow=S),t.equals(E,this._lastOutlineColor)||(Y.color=i.toValue(E,Y.color),t.clone(E,this._lastOutlineColor)),l.equals(z,this._lastDistanceDisplayCondition)||(j.distanceDisplayCondition=u.toValue(z,j.distanceDisplayCondition),Y.distanceDisplayCondition=u.toValue(z,Y.distanceDisplayCondition),l.clone(z,this._lastDistanceDisplayCondition))}O&&(s.x=Math.max(s.x,.001),s.y=Math.max(s.y,.001),s.z=Math.max(s.z,.001),d=f.multiplyByScale(d,s,d),this._primitive.modelMatrix=d,this._outlinePrimitive.modelMatrix=d)},D.prototype.getBoundingSphere=function(e,t){return b(e,this._primitive,this._outlinePrimitive,t)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),a(this)},P}),i("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,r,n,o){this.translucent=i,this.appearanceType=r,this.closed=n,this.shadows=o,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[]}function h(e,t,i,r){this._solidBatch=new c(e,!1,t,i,r),this._translucentBatch=new c(e,!0,t,i,r)}var d=new t,p=new n;return c.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&u.isConstant(e.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},c.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}},c.prototype.update=function(e){var l,c,h=!0,m=0,f=this.primitive,_=this.primitives;if(this.createPrimitive){var g=this.geometry.values,v=g.length;if(v>0){for(r(f)&&(r(this.oldPrimitive)?_.remove(f):this.oldPrimitive=f),c=0;c<v;c++){var y=g[c],C=y.attributes;l=this.attributes.get(y.id.id),r(l)&&(r(C.show)&&(C.show.value=l.show),r(C.color)&&(C.color.value=l.color))}f=new s({asynchronous:!0,geometryInstances:g,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),shadows:this.shadows}),_.add(f),h=!1}else{r(f)&&(_.remove(f),f=void 0);var w=this.oldPrimitive;r(w)&&(_.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=f,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(f)&&f.ready){r(this.oldPrimitive)&&(_.remove(this.oldPrimitive),this.oldPrimitive=void 0);var S=this.updatersWithAttributes.values,E=S.length,b=this.waitingOnCreate;for(c=0;c<E;c++){var T=S[c],x=this.geometry.get(T.entity.id);if(l=this.attributes.get(x.id.id),r(l)||(l=f.getGeometryInstanceAttributes(x.id),this.attributes.set(x.id.id,l)),!T.fillMaterialProperty.isConstant||b){var A=T.fillMaterialProperty.color;A.getValue(e,d),t.equals(l._lastColor,d)||(l._lastColor=t.clone(d,l._lastColor),l.color=i.toValue(d,l.color),(this.translucent&&255===l.color[3]||!this.translucent&&255!==l.color[3])&&(this.itemsToRemove[m++]=T))}var P=T.entity.isShowing&&(T.hasConstantFill||T.isFilled(e)),D=1===l.show[0];P!==D&&(l.show=a.toValue(P,l.show));var M=T.distanceDisplayConditionProperty;if(!u.isConstant(M)){var I=M.getValue(e,p);n.equals(I,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=n.clone(I,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=o.toValue(I,l.distanceDisplayCondition))}}this.updateShows(f),this.waitingOnCreate=!1}else r(f)&&!f.ready&&(h=!1);return this.itemsToRemove.length=m,h},c.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,n=0;n<i;n++){var o=t[n],s=this.geometry.get(o.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},c.prototype.contains=function(e){return this.updaters.contains(e.id)},c.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return l.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?l.FAILED:(n.boundingSphere.clone(t),l.DONE)},c.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},h.prototype.add=function(e,t){var i=t.createFillGeometryInstance(e);255===i.attributes.color.value[3]?this._solidBatch.add(t,i):this._translucentBatch.add(t,i)},h.prototype.remove=function(e){this._solidBatch.remove(e)||this._translucentBatch.remove(e)},h.prototype.update=function(e){var t,i,r=this._solidBatch.update(e);r=this._translucentBatch.update(e)&&r;var n=this._solidBatch.itemsToRemove,o=n.length;if(o>0)for(t=0;t<o;t++)i=n[t],this._solidBatch.remove(i),this._translucentBatch.add(i,i.createFillGeometryInstance(e));n=this._translucentBatch.itemsToRemove;var a=n.length;if(a>0)for(t=0;t<a;t++)i=n[t],this._translucentBatch.remove(i),this._solidBatch.add(i,i.createFillGeometryInstance(e));return(o>0||a>0)&&(r=this._solidBatch.update(e)&&r,r=this._translucentBatch.update(e)&&r),r},h.prototype.getBoundingSphere=function(e,t){return this._solidBatch.contains(e)?this._solidBatch.getBoundingSphere(e,t):this._translucentBatch.contains(e)?this._translucentBatch.getBoundingSphere(e,t):l.FAILED},h.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},h}),i("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o){this.primitives=t,this.appearanceType=i,this.materialProperty=r,this.closed=n,this.shadows=o,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(u.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function c(e,t,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=i,this._shadows=r}var h=new i;return u.prototype.onMaterialChanged=function(){this.invalidated=!0},u.prototype.isMaterial=function(e){var i=this.materialProperty,r=e.fillMaterialProperty;return r===i||!!t(i)&&i.equals(r)},u.prototype.add=function(e,t){var i=t.entity.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&l.isConstant(t.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(e,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},u.prototype.remove=function(e){var i=e.entity.id;if(this.createPrimitive=this.geometry.remove(i)||this.createPrimitive,this.updaters.remove(i)){this.updatersWithAttributes.remove(i);var r=this.subscriptions.get(i);t(r)&&(r(),this.subscriptions.remove(i))}return this.createPrimitive},u.prototype.update=function(e){var a,u,c=!0,d=this.primitive,p=this.primitives,m=this.geometry.values;if(this.createPrimitive){var f=m.length;if(f>0){for(t(d)&&(t(this.oldPrimitive)?p.remove(d):this.oldPrimitive=d),u=0;u<f;u++){var _=m[u],g=_.attributes;a=this.attributes.get(_.id.id),t(a)&&(t(g.show)&&(g.show.value=a.show),t(g.color)&&(g.color.value=a.color))}this.material=s.getValue(e,this.materialProperty,this.material),d=new o({asynchronous:!0,geometryInstances:m,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),shadows:this.shadows}),p.add(d),c=!1}else{t(d)&&(p.remove(d),d=void 0);var v=this.oldPrimitive;t(v)&&(p.remove(v),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=d,this.createPrimitive=!1}else if(t(d)&&d.ready){t(this.oldPrimitive)&&(p.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=s.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;var y=this.updatersWithAttributes.values,C=y.length;for(u=0;u<C;u++){var w=y[u],S=w.entity,E=this.geometry.get(S.id);a=this.attributes.get(E.id.id),t(a)||(a=d.getGeometryInstanceAttributes(E.id),this.attributes.set(E.id.id,a));var b=S.isShowing&&(w.hasConstantFill||w.isFilled(e)),T=1===a.show[0];b!==T&&(a.show=n.toValue(b,a.show));var x=w.distanceDisplayConditionProperty;if(!l.isConstant(x)){var A=x.getValue(e,h);i.equals(A,a._lastDistanceDisplayCondition)||(a._lastDistanceDisplayCondition=i.clone(A,a._lastDistanceDisplayCondition),a.distanceDisplayCondition=r.toValue(A,a.distanceDisplayCondition))}}this.updateShows(d)}else t(d)&&!d.ready&&(c=!1);return c},u.prototype.updateShows=function(e){for(var i=this.showsUpdated.values,r=i.length,o=0;o<r;o++){var a=i[o],s=a.entity,l=this.geometry.get(s.id),u=this.attributes.get(l.id.id);
t(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=s.isShowing,h=1===u.show[0];c!==h&&(u.show=n.toValue(c,u.show))}this.showsUpdated.removeAll()},u.prototype.contains=function(e){return this.updaters.contains(e.id)},u.prototype.getBoundingSphere=function(e,i){var r=this.primitive;if(!r.ready)return a.PENDING;var n=r.getGeometryInstanceAttributes(e);return!t(n)||!t(n.boundingSphere)||t(n.show)&&0===n.show[0]?a.FAILED:(n.boundingSphere.clone(i),a.DONE)},u.prototype.destroy=function(e){var i=this.primitive,r=this.primitives;t(i)&&r.remove(i);var n=this.oldPrimitive;t(n)&&r.remove(n),this.removeMaterialSubscription()},c.prototype.add=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var o=i[n];if(o.isMaterial(t))return void o.add(e,t)}var a=new u(this._primitives,this._appearanceType,t.fillMaterialProperty,this._closed,this._shadows);a.add(e,t),i.push(a)},c.prototype.remove=function(e){for(var t=this._items,i=t.length,r=i-1;r>=0;r--){var n=t[r];if(n.remove(e)){0===n.updaters.length&&(t.splice(r,1),n.destroy());break}}},c.prototype.update=function(e){var t,i=this._items,r=i.length;for(t=r-1;t>=0;t--){var n=i[t];if(n.invalidated){i.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;s<a;s++)this.add(e,o[s]);n.destroy()}}var l=!0;for(t=0;t<r;t++)l=i[t].update(e)&&l;return l},c.prototype.getBoundingSphere=function(e,t){for(var i=this._items,r=i.length,n=0;n<r;n++){var o=i[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return a.FAILED},c.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,i=0;i<t;i++)e[i].destroy();this._items.length=0},c}),i("DataSources/StaticGroundGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r){this.primitives=t,this.color=i,this.key=r,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[],this.isDirty=!1}function c(t){this._batches=new e,this._primitives=t}var h=new t,d=new r;u.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&l.isConstant(e.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},u.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}};var p=new Array(4);return u.prototype.update=function(e){var s,u,c=!0,m=0,f=this.primitive,_=this.primitives;if(this.createPrimitive){var g=this.geometry.values,v=g.length;if(v>0){for(i(f)&&(i(this.oldPrimitive)?_.remove(f):this.oldPrimitive=f),u=0;u<v;u++){var y=g[u],C=y.attributes;s=this.attributes.get(y.id.id),i(s)&&(i(C.show)&&(C.show.value=s.show),i(C.color)&&(C.color.value=s.color))}f=new a({asynchronous:!0,geometryInstances:g}),_.add(f),c=!1}else{i(f)&&(_.remove(f),f=void 0);var w=this.oldPrimitive;i(w)&&(_.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=f,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(i(f)&&f.ready){i(this.oldPrimitive)&&(_.remove(this.oldPrimitive),this.oldPrimitive=void 0);var S=this.updatersWithAttributes.values,E=S.length,b=this.waitingOnCreate;for(u=0;u<E;u++){var T=S[u],x=this.geometry.get(T.entity.id);if(s=this.attributes.get(x.id.id),i(s)||(s=f.getGeometryInstanceAttributes(x.id),this.attributes.set(x.id.id,s)),!T.fillMaterialProperty.isConstant||b){var A=T.fillMaterialProperty.color;if(A.getValue(e,h),!t.equals(s._lastColor,h)){s._lastColor=t.clone(h,s._lastColor);var P=this.color,D=h.toBytes(p);P[0]===D[0]&&P[1]===D[1]&&P[2]===D[2]&&P[3]===D[3]||(this.itemsToRemove[m++]=T)}}var M=T.entity.isShowing&&(T.hasConstantFill||T.isFilled(e)),I=1===s.show[0];M!==I&&(s.show=o.toValue(M,s.show));var R=T.distanceDisplayConditionProperty;if(!l.isConstant(R)){var O=R.getValue(e,d);r.equals(O,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=r.clone(O,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=n.toValue(O,s.distanceDisplayCondition))}}this.updateShows(f),this.waitingOnCreate=!1}else i(f)&&!f.ready&&(c=!1);return this.itemsToRemove.length=m,c},u.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var a=t[n],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=o.toValue(u,l.show))}this.showsUpdated.removeAll()},u.prototype.contains=function(e){return this.updaters.contains(e.id)},u.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return s.PENDING;var n=r.getBoundingSphere(e);return i(n)?(n.clone(t),s.DONE):s.FAILED},u.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;i(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var r=this.oldPrimitive;i(r)&&(e.remove(r),this.oldPrimitive=void 0)},c.prototype.add=function(e,t){var i,r=t.createFillGeometryInstance(e),n=this._batches,o=new Uint32Array(r.attributes.color.value.buffer)[0];return n.contains(o)?i=n.get(o):(i=new u(this._primitives,r.attributes.color.value,o),n.set(o,i)),i.add(t,r),i},c.prototype.remove=function(e){for(var t=this._batches.values,i=t.length,r=0;r<i;++r)if(t[r].remove(e))return},c.prototype.update=function(e){var t,i,r=!0,n=this._batches,o=n.values,a=o.length;for(t=0;t<a;++t)r=o[t].update(e)&&r;for(t=0;t<a;++t)for(var s=o[t],l=s.itemsToRemove,u=l.length,c=0;c<u;c++){i=l[c],s.remove(i);var h=this.add(e,i);s.isDirty=!0,h.isDirty=!0}var d=o.slice(),p=d.length;for(t=0;t<p;++t){var m=d[t];m.isDirty&&(r=d[t].update(e)&&r,m.isDirty=!1),0===m.geometry.length&&n.remove(m.key)}return r},c.prototype.getBoundingSphere=function(e,t){for(var i=this._batches.values,r=i.length,n=0;n<r;++n){var o=i[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return s.FAILED},c.prototype.removeAllPrimitives=function(){for(var e=this._batches.values,t=e.length,i=0;i<t;++i)e[i].removeAllPrimitives()},c}),i("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(t,i,r,n){this.translucent=i,this.width=r,this.shadows=n,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.itemsToRemove=[],this.subscriptions=new e,this.showsUpdated=new e}function d(t,i,r){this._primitives=t,this._scene=i,this._shadows=r,this._solidBatches=new e,this._translucentBatches=new e}h.prototype.add=function(e,t){var i=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(i,t),this.updaters.set(i,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant&&c.isConstant(e.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,e.entity.definitionChanged.addEventListener(function(t,i,n,o){"isShowing"===i&&r.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(i,e)},h.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}};var p=new t,m=new n;return h.prototype.update=function(e){var u,h,d=!0,f=0,_=this.primitive,g=this.primitives;if(this.createPrimitive){var v=this.geometry.values,y=v.length;if(y>0){for(r(_)&&(r(this.oldPrimitive)?g.remove(_):this.oldPrimitive=_),h=0;h<y;h++){var C=v[h],w=C.attributes;u=this.attributes.get(C.id.id),r(u)&&(r(w.show)&&(w.show.value=u.show),r(w.color)&&(w.color.value=u.color))}_=new l({asynchronous:!0,geometryInstances:v,appearance:new s({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),g.add(_),d=!1}else{r(_)&&(g.remove(_),_=void 0);var S=this.oldPrimitive;r(S)&&(g.remove(S),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=_,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(_)&&_.ready){r(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0);var E=this.updatersWithAttributes.values,b=E.length,T=this.waitingOnCreate;for(h=0;h<b;h++){var x=E[h],A=this.geometry.get(x.entity.id);if(u=this.attributes.get(A.id.id),r(u)||(u=_.getGeometryInstanceAttributes(A.id),this.attributes.set(A.id.id,u)),!x.outlineColorProperty.isConstant||T){var P=x.outlineColorProperty;P.getValue(e,p),t.equals(u._lastColor,p)||(u._lastColor=t.clone(p,u._lastColor),u.color=i.toValue(p,u.color),(this.translucent&&255===u.color[3]||!this.translucent&&255!==u.color[3])&&(this.itemsToRemove[f++]=x))}var D=x.entity.isShowing&&(x.hasConstantOutline||x.isOutlineVisible(e)),M=1===u.show[0];D!==M&&(u.show=a.toValue(D,u.show));var I=x.distanceDisplayConditionProperty;if(!c.isConstant(I)){var R=I.getValue(e,m);n.equals(R,u._lastDistanceDisplayCondition)||(u._lastDistanceDisplayCondition=n.clone(R,u._lastDistanceDisplayCondition),u.distanceDisplayCondition=o.toValue(R,u.distanceDisplayCondition))}}this.updateShows(_),this.waitingOnCreate=!1}else r(_)&&!_.ready&&(d=!1);return this.itemsToRemove.length=f,d},h.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,n=0;n<i;n++){var o=t[n],s=this.geometry.get(o.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},h.prototype.contains=function(e){return this.updaters.contains(e.id)},h.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return u.PENDING;var n=i.getGeometryInstanceAttributes(e);return!r(n)||!r(n.boundingSphere)||r(n.show)&&0===n.show[0]?u.FAILED:(n.boundingSphere.clone(t),u.DONE)},h.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},d.prototype.add=function(e,t){var i,n,o=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===o.attributes.color.value[3]?(i=this._solidBatches,n=i.get(a),r(n)||(n=new h(this._primitives,!1,a,this._shadows),i.set(a,n)),n.add(t,o)):(i=this._translucentBatches,n=i.get(a),r(n)||(n=new h(this._primitives,!0,a,this._shadows),i.set(a,n)),n.add(t,o))},d.prototype.remove=function(e){var t,i=this._solidBatches.values,r=i.length;for(t=0;t<r;t++)if(i[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;t<o;t++)if(n[t].remove(e))return},d.prototype.update=function(e){var t,i,r,n,o,a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,u=l.length,c=!0,h=!1;do{for(h=!1,i=0;i<s;i++){n=a[i],c=n.update(e),o=n.itemsToRemove;var d=o.length;if(d>0)for(h=!0,t=0;t<d;t++)r=o[t],n.remove(r),this.add(e,r)}for(i=0;i<u;i++){n=l[i],c=n.update(e),o=n.itemsToRemove;var p=o.length;if(p>0)for(h=!0,t=0;t<p;t++)r=o[t],n.remove(r),this.add(e,r)}}while(h);return c},d.prototype.getBoundingSphere=function(e,t){var i,r=this._solidBatches.values,n=r.length;for(i=0;i<n;i++){var o=r[i];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,s=a.length;for(i=0;i<s;i++){var l=a[i];if(l.contains(e))return l.getBoundingSphere(e,t)}return u.FAILED},d.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var r=this._translucentBatches.values,n=r.length;for(e=0;e<n;e++)r[e].removeAllPrimitives()},d}),i("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticGroundGeometryColorBatch","./StaticOutlineGeometryBatch"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t,i){this._primitives=t,this._groundPrimitives=i,this._dynamicUpdaters=new e}function p(e,t){for(var i=e._batches,r=i.length,n=0;n<r;n++)i[n].remove(t)}function m(e,t,i){if(i.isDynamic)return void e._dynamicBatch.add(t,i);var r;(i.outlineEnabled||i.fillEnabled)&&(r=i.shadowsProperty.getValue(t)),i.outlineEnabled&&e._outlineBatches[r].add(t,i),i.fillEnabled&&(i.onTerrain?e._groundColorBatch.add(t,i):i.isClosed?i.fillMaterialProperty instanceof s?e._closedColorBatches[r].add(t,i):e._closedMaterialBatches[r].add(t,i):i.fillMaterialProperty instanceof s?e._openColorBatches[r].add(t,i):e._openMaterialBatches[r].add(t,i))}function f(t,i,r){this._type=t;var n=i.primitives,a=i.groundPrimitives;this._scene=i,this._primitives=n,this._groundPrimitives=a,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e;var s=o.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(s),this._closedColorBatches=new Array(s),this._closedMaterialBatches=new Array(s),this._openColorBatches=new Array(s),this._openMaterialBatches=new Array(s);for(var p=0;p<s;++p)this._outlineBatches[p]=new h(n,i,p),this._closedColorBatches[p]=new l(n,t.perInstanceColorAppearanceType,!0,p),this._closedMaterialBatches[p]=new u(n,t.materialAppearanceType,!0,p),this._openColorBatches[p]=new l(n,t.perInstanceColorAppearanceType,!1,p),this._openMaterialBatches[p]=new u(n,t.materialAppearanceType,!1,p);this._groundColorBatch=new c(a),this._dynamicBatch=new d(n,a),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatch,this._dynamicBatch),this._subscriptions=new e,this._updaters=new e,this._entityCollection=r,r.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._onCollectionChanged(r,r.values,_)}var _=[];d.prototype.add=function(e,t){this._dynamicUpdaters.set(t.entity.id,t.createDynamicUpdater(this._primitives,this._groundPrimitives))},d.prototype.remove=function(e){var t=e.entity.id,r=this._dynamicUpdaters.get(t);i(r)&&(this._dynamicUpdaters.remove(t),r.destroy())},d.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,i=0,r=t.length;i<r;i++)t[i].update(e);return!0},d.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,i=e.length;t<i;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},d.prototype.getBoundingSphere=function(e,t){var r=this._dynamicUpdaters.get(e.id);return i(r)&&i(r.getBoundingSphere)?r.getBoundingSphere(e,t):a.FAILED},f.prototype.update=function(e){var t,i,r,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values;for(t=c.length-1;t>-1;t--)i=c[t],r=i.id,n=this._updaters.get(r),n.entity===i?(p(this,n),m(this,e,n)):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)i=l[t],r=i.id,n=this._updaters.get(r),p(this,n),n.destroy(),this._updaters.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(t=a.length-1;t>-1;t--)i=a[t],r=i.id,n=new this._type(i,this._scene),this._updaters.set(r,n),m(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(f._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var h=!0,d=this._batches,_=d.length;for(t=0;t<_;t++)h=d[t].update(e)&&h;return h};var g=[],v=new t;return f.prototype.getBoundingSphere=function(e,i){for(var r=g,n=v,o=0,s=a.DONE,l=this._batches,u=l.length,c=0;c<u;c++){if(s=l[c].getBoundingSphere(e,n),s===a.PENDING)return a.PENDING;s===a.DONE&&(r[o]=t.clone(n,r[o]),o++)}return 0===o?a.FAILED:(r.length=o,t.fromBoundingSpheres(r,i),a.DONE)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,i=t.length;for(e=0;e<i;e++)t[e].removeAllPrimitives();var n=this._subscriptions.values;for(i=n.length,e=0;e<i;e++)n[e]();return this._subscriptions.removeAll(),r(this)},f._onGeometryChanged=function(e){var t=this._removedObjects,r=this._changedObjects,n=e.entity,o=n.id;i(t.get(o))||i(r.get(o))||r.set(o,n)},f.prototype._onCollectionChanged=function(e,t,i){var r,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(r=i.length-1;r>-1;r--)o=i[r],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(r=t.length-1;r>-1;r--)o=t[r],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},f}),i("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){this.entity=e,this.label=void 0,this.index=void 0}function g(t,i){i.collectionChanged.addEventListener(g.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t,i){o(e)&&(e.label=void 0,i.removeLabel(t))}var y=1,C="30px sans-serif",w=d.FILL,S=r.WHITE,E=r.BLACK,b=1,T=!1,x=new r(.165,.165,.165,.8),A=new t(7,5),P=t.ZERO,D=i.ZERO,M=c.NONE,I=h.CENTER,R=p.CENTER,O=new i,N=new r,L=new r,B=new r,F=new t,V=new i,k=new t,z=new u,U=new u,G=new l;return g.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r<n;r++){var a,s=t[r],l=s.entity,u=l._label,c=s.label,h=l.isShowing&&l.isAvailable(e)&&f.getValueOrDefault(u._show,e,!0);h&&(O=f.getValueOrUndefined(l._position,e,O),a=f.getValueOrUndefined(u._text,e),h=o(O)&&o(a)),h?(f.isConstant(l._position)||(i._clusterDirty=!0),o(c)||(c=i.getLabel(l),c.id=l,s.label=c),c.show=!0,c.position=O,c.text=a,c.scale=f.getValueOrDefault(u._scale,e,y),c.font=f.getValueOrDefault(u._font,e,C),c.style=f.getValueOrDefault(u._style,e,w),c.fillColor=f.getValueOrDefault(u._fillColor,e,S,N),c.outlineColor=f.getValueOrDefault(u._outlineColor,e,E,L),c.outlineWidth=f.getValueOrDefault(u._outlineWidth,e,b),c.showBackground=f.getValueOrDefault(u._showBackground,e,T),c.backgroundColor=f.getValueOrDefault(u._backgroundColor,e,x,B),c.backgroundPadding=f.getValueOrDefault(u._backgroundPadding,e,A,F),c.pixelOffset=f.getValueOrDefault(u._pixelOffset,e,P,k),c.eyeOffset=f.getValueOrDefault(u._eyeOffset,e,D,V),c.heightReference=f.getValueOrDefault(u._heightReference,e,M),c.horizontalOrigin=f.getValueOrDefault(u._horizontalOrigin,e,I),c.verticalOrigin=f.getValueOrDefault(u._verticalOrigin,e,R),c.translucencyByDistance=f.getValueOrUndefined(u._translucencyByDistance,e,z),c.pixelOffsetScaleByDistance=f.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,U),c.distanceDisplayCondition=f.getValueOrUndefined(u._distanceDisplayCondition,e,G)):v(s,l,i)}return!0},g.prototype.getBoundingSphere=function(e,t){var r=this._items.get(e.id);if(!o(r)||!o(r.label))return m.FAILED;var a=r.label;return t.center=i.clone(n(a._clampedPosition,a.position),t.center),t.radius=0,m.DONE},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(g.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return a(this)},g.prototype._onCollectionChanged=function(e,t,i,r){var n,a,s=this._items,l=this._cluster;for(n=t.length-1;n>-1;n--)a=t[n],o(a._label)&&o(a._position)&&s.set(a.id,new _(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._label)&&o(a._position)?s.contains(a.id)||s.set(a.id,new _(a)):(v(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],v(s.get(a.id),a,l),s.remove(a.id)},g}),i("ThirdParty/gltfDefaults",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/Quaternion","../Core/WebGLConstants"],function(e,t,i,r,n){"use strict";function o(e){i(e.accessors)||(e.accessors={});var r=e.accessors;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.byteStride=t(o.byteStride,0)}}function a(e){i(e.animations)||(e.animations={});var r=e.animations;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.channels)||(o.channels=[]),i(o.parameters)||(o.parameters={}),i(o.samplers)||(o.samplers={});var a=r.samplers;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];l.interpolation=t(l.interpolation,"LINEAR")}}}function s(e){i(e.asset)||(e.asset={});var r=e.asset;i(r.profile)&&"string"!=typeof r.profile||(r.profile={});var n=r.profile;r.premultipliedAlpha=t(r.premultipliedAlpha,!1),n.api=t(n.api,"WebGL"),n.version=t(n.version,"1.0.2"),i(e.version)&&(r.version=t(r.version,e.version),delete e.version),"number"==typeof r.version&&(r.version=r.version.toFixed(1).toString())}function l(e){i(e.buffers)||(e.buffers={});var r=e.buffers;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.type=t(o.type,"arraybuffer")}}function u(e){i(e.bufferViews)||(e.bufferViews={})}function c(e){i(e.cameras)||(e.cameras={})}function h(e){i(e.images)||(e.images={})}function d(e){i(e.extensions)||(e.extensions={});var r=e.extensions;i(r.KHR_materials_common)||(r.KHR_materials_common={});var n=r.KHR_materials_common;i(e.lights)?(n.lights=e.lights,delete e.lights):i(n.lights)||(n.lights={});var o=n.lights;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if("ambient"===s.type){i(s.ambient)||(s.ambient={});var l=s.ambient;i(l.color)||(l.color=[1,1,1])}else if("directional"===s.type){i(s.directional)||(s.directional={});var u=s.directional;i(u.color)||(u.color=[1,1,1])}else if("point"===s.type){i(s.point)||(s.point={});var c=s.point;i(c.color)||(c.color=[1,1,1]),c.constantAttenuation=t(c.constantAttenuation,1),c.linearAttenuation=t(c.linearAttenuation,0),c.quadraticAttenuation=t(c.quadraticAttenuation,0)}else if("spot"===s.type){i(s.spot)||(s.spot={});var h=s.spot;i(h.color)||(h.color=[1,1,1]),h.constantAttenuation=t(h.constantAttenuation,1),h.fallOffAngle=t(h.fallOffAngle,3.14159265),h.fallOffExponent=t(h.fallOffExponent,0),h.linearAttenuation=t(h.linearAttenuation,0),h.quadraticAttenuation=t(h.quadraticAttenuation,0)}}}function p(e){i(e.materials)||(e.materials={});var t=e.materials;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r],a=o.instanceTechnique;if(i(a)&&(o.technique=a.technique,o.values=a.values,delete o.instanceTechnique),!i(o.extensions))if(i(o.technique))i(o.values)||(o.values={});else{delete o.values,o.extensions={KHR_materials_common:{technique:"CONSTANT",transparent:!1,values:{emission:{type:n.FLOAT_VEC4,value:[.5,.5,.5,1]}}}},i(e.extensionsUsed)||(e.extensionsUsed=[]);var s=e.extensionsUsed;s.indexOf("KHR_materials_common")===-1&&s.push("KHR_materials_common")}}}function m(e){i(e.meshes)||(e.meshes={});var r=e.meshes;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i(a.primitives)||(a.primitives=[]);for(var s=a.primitives.length,l=s.length,u=0;u<l;++u){var c=s[u];i(c.attributes)||(c.attributes={});var h=t(c.primitive,n.TRIANGLES);c.mode=t(c.mode,h)}}}function f(t){i(t.nodes)||(t.nodes={});var n=t.nodes,o=parseFloat(t.asset.version)<1,a=new e,s=new r;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l];if(i(u.children)||(u.children=[]),o&&i(u.rotation)){var c=u.rotation;e.fromArray(c,0,a),r.fromAxisAngle(a,c[3],s),u.rotation=[s.x,s.y,s.z,s.w]}i(u.matrix)||(i(u.translation)||i(u.rotation)||i(u.scale)?(i(u.translation)||(u.translation=[0,0,0]),i(u.rotation)||(u.rotation=[0,0,0,1]),i(u.scale)||(u.scale=[1,1,1])):u.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);var h=u.instanceSkin;i(h)&&(u.skeletons=h.skeletons,u.skin=h.skin,u.meshes=h.meshes,delete u.instanceSkin)}}function _(e){i(e.programs)||(e.programs={});var t=e.programs;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.attributes)||(n.attributes=[])}}function g(e){i(e.samplers)||(e.samplers={});var r=e.samplers;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];a.magFilter=t(a.magFilter,n.LINEAR),a.minFilter=t(a.minFilter,n.NEAREST_MIPMAP_LINEAR),a.wrapS=t(a.wrapS,n.REPEAT),a.wrapT=t(a.wrapT,n.REPEAT)}}function v(e){i(e.scenes)||(e.scenes={});var t=e.scenes;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.node)||(n.node=[])}}function y(e){i(e.shaders)||(e.shaders={})}function C(e){i(e.skins)||(e.skins={});var t=e.skins;for(var r in t)if(t.hasOwnProperty(r)){var n=t[r];i(n.bindShapeMatrix)||(n.bindShapeMatrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}function w(e){i(e.enable)||(e.enable=[]),i(e.disable)||(e.disable=[])}function S(e){i(e.techniques)||(e.techniques={});var r=e.techniques;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.parameters)||(o.parameters={});var a=o.parameters;for(var s in a){var l=a[s];l.node=t(l.node,l.source),l.source=void 0}var u=o.passes;if(i(u)){var c=t(o.pass,"defaultPass");if(u.hasOwnProperty(c)){var h=u[c],d=h.instanceProgram;o.attributes=t(o.attributes,d.attributes),o.program=t(o.program,d.program),o.uniforms=t(o.uniforms,d.uniforms),o.states=t(o.states,h.states)}o.passes=void 0,o.pass=void 0}i(o.attributes)||(o.attributes={}),i(o.uniforms)||(o.uniforms={}),i(o.states)||(o.states={}),w(o.states)}}function E(e){i(e.textures)||(e.textures={});var r=e.textures;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];a.format=t(a.format,n.RGBA),a.internalFormat=t(a.internalFormat,a.format),a.target=t(a.target,n.TEXTURE_2D),a.type=t(a.type,n.UNSIGNED_BYTE)}}var b=function(e){if(i(e))return i(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,e.allExtensions=void 0),e.extensionsUsed=t(e.extensionsUsed,[]),o(e),a(e),s(e),l(e),u(e),c(e),h(e),d(e),p(e),m(e),f(e),_(e),g(e),v(e),y(e),C(e),S(e),E(e),e};return b}),i("Scene/getAttributeOrUniformBySemantic",[],function(){"use strict";function e(e,t){var i=e.techniques;for(var r in i)if(i.hasOwnProperty(r)){var n=i[r],o=n.parameters,a=n.attributes,s=n.uniforms;for(var l in a)if(a.hasOwnProperty(l)&&o[a[l]].semantic===t)return l;for(var u in s)if(s.hasOwnProperty(u)&&o[s[u]].semantic===t)return u}}return e}),i("Scene/getBinaryAccessor",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t,i=e.componentType;t="string"==typeof i?r.fromName(i):i;var n=l[e.type],o=u[e.type];return{componentsPerAttribute:n,classType:o,createArrayBufferView:function(e,i,o){return r.createArrayBufferView(t,e,i,n*o)}}}var l={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},u={SCALAR:void 0,VEC2:e,VEC3:t,VEC4:i,MAT2:n,MAT3:o,MAT4:a};return s}),i("Scene/ModelAnimationCache",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Core/WebGLConstants","./getBinaryAccessor"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(){}function c(e,i){var r=e.gltf,n=r.buffers,o=r.bufferViews,a=o[i.bufferView],s=n[a.buffer],u=a.byteOffset+i.byteOffset,c=i.count*l(i).componentsPerAttribute;return e.cacheKey+"//"+t(s.path,"")+"/"+u+"/"+c}function h(e,t,i){return e.cacheKey+"//"+t+"/"+i}function d(e){this._value=e}var p={},m=new e;u.getAnimationParameterValues=function(t,r){var n=c(t,r),a=p[n];if(!i(a)){var u,h=t._loadResources,d=t.gltf,f=parseFloat(d.asset.version)<1,_=d.bufferViews,g=_[r.bufferView],v=r.componentType,y=r.type,C=r.count,w=h.getBuffer(g),S=l(r).createArrayBufferView(w.buffer,w.byteOffset+r.byteOffset,C);if(v===s.FLOAT&&"SCALAR"===y)a=S;else if(v===s.FLOAT&&"VEC3"===y)for(a=new Array(C),u=0;u<C;++u)a[u]=e.fromArray(S,3*u);else if(v===s.FLOAT&&"VEC4"===y)for(a=new Array(C),u=0;u<C;++u){var E=4*u;f?a[u]=o.fromAxisAngle(e.fromArray(S,E,m),S[E+3]):a[u]=o.unpack(S,E)}i(t.cacheKey)&&(p[n]=a)}return a};var f={};d.prototype.evaluate=function(e,t){return this._value},u.getAnimationSpline=function(e,t,n,o,l,u){var c=h(e,t,o),p=f[c];if(!i(p)){var m=u[l.input],_=e.gltf.accessors[n.parameters[l.output]],g=u[l.output];if(1===m.length&&1===g.length)p=new d(g[0]);else{var v=_.componentType,y=_.type;"LINEAR"===l.interpolation&&(v===s.FLOAT&&"VEC3"===y?p=new r({times:m,points:g}):v===s.FLOAT&&"VEC4"===y&&(p=new a({times:m,points:g})))}i(e.cacheKey)&&(f[c]=p)}return p};var _={};return u.getSkinInverseBindMatrices=function(e,t){var r=c(e,t),o=_[r];if(!i(o)){var a=e._loadResources,u=e.gltf,h=u.bufferViews,d=h[t.bufferView],p=t.componentType,m=t.type,f=t.count,g=a.getBuffer(d),v=l(t).createArrayBufferView(g.buffer,g.byteOffset+t.byteOffset,f);if(o=new Array(f),p===s.FLOAT&&"MAT4"===m)for(var y=0;y<f;++y)o[y]=n.fromArray(v,16*y);_[r]=o}return o},u}),i("Scene/ModelAnimationLoop",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};return e(t)}),i("Scene/ModelAnimationState",["../Core/freezeObject"],function(e){"use strict";return e({STOPPED:0,ANIMATING:1})}),i("Scene/ModelAnimation",["../Core/defaultValue","../Core/defineProperties","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o){"use strict";function a(t,a,s){this._name=t.name,this._startTime=r.clone(t.startTime),this._delay=e(t.delay,0),this._stopTime=t.stopTime,this.removeOnStop=e(t.removeOnStop,!1),this._speedup=e(t.speedup,1),this._reverse=e(t.reverse,!1),this._loop=e(t.loop,n.NONE),this.start=new i,this.update=new i,this.stop=new i,this._state=o.STOPPED,this._runtimeAnimation=s,this._computedStartTime=void 0,this._duration=void 0;var l=this;this._raiseStartEvent=function(){l.start.raiseEvent(a,l)},this._updateEventTime=0,this._raiseUpdateEvent=function(){l.update.raiseEvent(a,l,l._updateEventTime)},this._raiseStopEvent=function(){l.stop.raiseEvent(a,l)}}return t(a.prototype,{name:{get:function(){return this._name}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},speedup:{get:function(){return this._speedup}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),a}),i("Scene/ModelAnimationCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/Math","./ModelAnimation","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){this.animationAdded=new o,this.animationRemoved=new o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function d(e,t){for(var i=e.channelEvaluators,r=i.length,n=0;n<r;++n)i[n](t)}function p(e,t,i){return function(){e.animationRemoved.raiseEvent(t,i)}}r(h.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),h.prototype.add=function(e){e=t(e,t.EMPTY_OBJECT);var i=this._model,r=i._runtime.animations,n=r[e.name],o=new l(e,i,n);return this._scheduledAnimations.push(o),this.animationAdded.raiseEvent(i,o),o},h.prototype.addAll=function(i){
i=t(i,t.EMPTY_OBJECT),i=e(i);for(var r=[],n=this._model._animationIds,o=n.length,a=0;a<o;++a)i.name=n[a],r.push(this.add(i));return r},h.prototype.remove=function(e){if(i(e)){var t=this._scheduledAnimations,r=t.indexOf(e);if(r!==-1)return t.splice(r,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},h.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,i=t.length;this._scheduledAnimations=[];for(var r=0;r<i;++r)this.animationRemoved.raiseEvent(e,t[r])},h.prototype.contains=function(e){return!!i(e)&&this._scheduledAnimations.indexOf(e)!==-1},h.prototype.get=function(e){return this._scheduledAnimations[e]};var m=[];return h.prototype.update=function(e){var r=this._scheduledAnimations,n=r.length;if(0===n)return this._previousTime=void 0,!1;if(a.equals(e.time,this._previousTime))return!1;this._previousTime=a.clone(e.time,this._previousTime);for(var o=!1,l=e.time,h=this._model,f=0;f<n;++f){var _=r[f],g=_._runtimeAnimation;i(_._computedStartTime)||(_._computedStartTime=a.addSeconds(t(_.startTime,l),_.delay,new a)),i(_._duration)||(_._duration=g.stopTime*(1/_.speedup));var v=_._computedStartTime,y=_._duration,C=_.stopTime,w=0!==y?a.secondsDifference(l,v)/y:0,S=w>=0,E=_.loop===u.REPEAT||_.loop===u.MIRRORED_REPEAT,b=(S||E&&!i(_.startTime))&&(w<=1||E)&&(!i(C)||a.lessThanOrEquals(l,C));if(b){if(_._state===c.STOPPED&&(_._state=c.ANIMATING,_.start.numberOfListeners>0&&e.afterRender.push(_._raiseStartEvent)),_.loop===u.REPEAT)w-=Math.floor(w);else if(_.loop===u.MIRRORED_REPEAT){var T=Math.floor(w),x=w-T;w=T%2===1?1-x:x}_.reverse&&(w=1-w);var A=w*y*_.speedup;A=s.clamp(A,g.startTime,g.stopTime),d(g,A),_.update.numberOfListeners>0&&(_._updateEventTime=A,e.afterRender.push(_._raiseUpdateEvent)),o=!0}else S&&_._state===c.ANIMATING&&(_._state=c.STOPPED,_.stop.numberOfListeners>0&&e.afterRender.push(_._raiseStopEvent),_.removeOnStop&&m.push(_))}n=m.length;for(var P=0;P<n;++P){var D=m[P];r.splice(r.indexOf(D),1),e.afterRender.push(p(this,h,D))}return m.length=0,o},h}),i("Scene/ModelMaterial",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i){"use strict";function r(e,t,i){this._name=t.name,this._id=i,this._uniformMap=e._uniformMaps[i]}return t(r.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),r.prototype.setValue=function(e,t){var i=this._uniformMap.values[e];i.value=i.clone(t,i.value)},r.prototype.getValue=function(t){var i=this._uniformMap.values[t];if(e(i))return i.value},r}),i("Scene/modelMaterialsCommon",["../Core/defaultValue","../Core/defined","../Core/WebGLConstants"],function(e,t,i){"use strict";function r(e){switch(e){case i.FLOAT:return"float";case i.FLOAT_VEC2:return"vec2";case i.FLOAT_VEC3:return"vec3";case i.FLOAT_VEC4:return"vec4";case i.FLOAT_MAT2:return"mat2";case i.FLOAT_MAT3:return"mat3";case i.FLOAT_MAT4:return"mat4";case i.SAMPLER_2D:return"sampler2D"}}function n(e){var r,n={};if(t(e.extensions)&&t(e.extensions.KHR_materials_common)&&(r=e.extensions.KHR_materials_common.lights),t(r)){var o=e.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if(t(s.extensions)&&t(s.extensions.KHR_materials_common)){var l=s.extensions.KHR_materials_common.light;t(l)&&t(r[l])&&(r[l].node=a),delete s.extensions.KHR_materials_common}}var u=0;for(var c in r)if(r.hasOwnProperty(c)){var h=r[c],d=h.type;if("ambient"!==d&&!t(h.node)){delete r[c];continue}var p="light"+u.toString();switch(h.baseName=p,d){case"ambient":var m=h.ambient;n[p+"Color"]={type:i.FLOAT_VEC3,value:m.color};break;case"directional":var f=h.directional;n[p+"Color"]={type:i.FLOAT_VEC3,value:f.color},t(h.node)&&(n[p+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4});break;case"point":var _=h.point;n[p+"Color"]={type:i.FLOAT_VEC3,value:_.color},t(h.node)&&(n[p+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4}),n[p+"Attenuation"]={type:i.FLOAT_VEC3,value:[_.constantAttenuation,_.linearAttenuation,_.quadraticAttenuation]};break;case"spot":var g=h.spot;n[p+"Color"]={type:i.FLOAT_VEC3,value:g.color},t(h.node)&&(n[p+"Transform"]={node:h.node,semantic:"MODELVIEW",type:i.FLOAT_MAT4},n[p+"InverseTransform"]={node:h.node,semantic:"MODELVIEWINVERSE",type:i.FLOAT_MAT4,useInFragment:!0}),n[p+"Attenuation"]={type:i.FLOAT_VEC3,value:[g.constantAttenuation,g.linearAttenuation,g.quadraticAttenuation]},n[p+"FallOff"]={type:i.FLOAT_VEC2,value:[g.fallOffAngle,g.fallOffExponent]}}++u}}return n}function o(i,r,n){var o,a=e(n,0);do o=r+(a++).toString();while(t(i[o]));return o}function a(n,a,l){var u,m=n.techniques,f=n.shaders,_=n.programs,g=a.technique.toUpperCase();t(n.extensions)&&t(n.extensions.KHR_materials_common)&&(u=n.extensions.KHR_materials_common.lights);var v=e(a.jointCount,0),y=v>0,C=a.values,w="precision highp float;\n",S="precision highp float;\n",E=o(m,"technique",c),b=o(f,"vertexShader",h),T=o(f,"fragmentShader",d),x=o(_,"program",p),A="CONSTANT"!==g,P={modelViewMatrix:{semantic:"MODELVIEW",type:i.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:i.FLOAT_MAT4}};A&&(P.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:i.FLOAT_MAT3}),y&&(P.jointMatrix={count:v,semantic:"JOINTMATRIX",type:i.FLOAT_MAT4});var D,M=!1;for(var I in C)if(C.hasOwnProperty(I)&&"transparent"!==I&&"doubleSided"!==I){var R=s(I,C[I]);D=I.toLowerCase(),M||R!==i.SAMPLER_2D||(M=!0),P[D]={type:R}}if(t(l))for(var O in l)l.hasOwnProperty(O)&&(P[O]=l[O]);var N={};for(var L in P)if(P.hasOwnProperty(L)){var B=P[L];N["u_"+L]=L;var F=t(B.count)?"["+B.count+"]":"";B.type!==i.FLOAT_MAT3&&B.type!==i.FLOAT_MAT4||B.useInFragment?(S+="uniform "+r(B.type)+" u_"+L+F+";\n",delete B.useInFragment):w+="uniform "+r(B.type)+" u_"+L+F+";\n"}var V="";y&&(V+="  mat4 skinMat = a_weight.x * u_jointMatrix[int(a_joint.x)];\n",V+="  skinMat += a_weight.y * u_jointMatrix[int(a_joint.y)];\n",V+="  skinMat += a_weight.z * u_jointMatrix[int(a_joint.z)];\n",V+="  skinMat += a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var k={a_position:"position"};P.position={semantic:"POSITION",type:i.FLOAT_VEC3},w+="attribute vec3 a_position;\n",w+="varying vec3 v_positionEC;\n",V+=y?"  vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":"  vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",V+="  v_positionEC = pos.xyz;\n",V+="  gl_Position = u_projectionMatrix * pos;\n",S+="varying vec3 v_positionEC;\n",A&&(k.a_normal="normal",P.normal={semantic:"NORMAL",type:i.FLOAT_VEC3},w+="attribute vec3 a_normal;\n",w+="varying vec3 v_normal;\n",V+=y?"  v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":"  v_normal = u_normalMatrix * a_normal;\n",S+="varying vec3 v_normal;\n");var z;M&&(k.a_texcoord_0="texcoord_0",P.texcoord_0={semantic:"TEXCOORD_0",type:i.FLOAT_VEC2},z="v_texcoord_0",w+="attribute vec2 a_texcoord_0;\n",w+="varying vec2 "+z+";\n",V+="  "+z+" = a_texcoord_0;\n",S+="varying vec2 "+z+";\n"),y&&(k.a_joint="joint",P.joint={semantic:"JOINT",type:i.FLOAT_VEC4},k.a_weight="weight",P.weight={semantic:"WEIGHT",type:i.FLOAT_VEC4},w+="attribute vec4 a_joint;\n",w+="attribute vec4 a_weight;\n");var U=A&&("BLINN"===g||"PHONG"===g)&&t(P.specular)&&t(P.shininess),G=!1,W=!1,H="";for(var q in u)if(u.hasOwnProperty(q)){var j=u[q],Y=j.type.toLowerCase(),X=j.baseName;H+="  {\n";var Z,K,Q="u_"+X+"Color";"ambient"===Y?(W=!0,H+="    ambientLight += "+Q+";\n"):A&&(G=!0,Z="v_"+X+"Direction",K="v_"+X+"Position","point"!==Y&&(w+="varying vec3 "+Z+";\n",S+="varying vec3 "+Z+";\n",V+="  "+Z+" = mat3(u_"+X+"Transform) * vec3(0.,0.,1.);\n","directional"===Y&&(H+="    vec3 l = normalize("+Z+");\n")),"directional"!==Y?(w+="varying vec3 "+K+";\n",S+="varying vec3 "+K+";\n",V+="  "+K+" = u_"+X+"Transform[3].xyz;\n",H+="    vec3 VP = "+K+" - v_positionEC;\n",H+="    vec3 l = normalize(VP);\n",H+="    float range = length(VP);\n",H+="    float attenuation = 1.0 / (u_"+X+"Attenuation.x + ",H+="(u_"+X+"Attenuation.y * range) + ",H+="(u_"+X+"Attenuation.z * range * range));\n"):H+="    float attenuation = 1.0;\n","spot"===Y&&(H+="    float spotDot = dot(l, normalize("+Z+"));\n",H+="    if (spotDot < cos(u_"+X+"FallOff.x * 0.5))\n",H+="    {\n",H+="      attenuation = 0.0;\n",H+="    }\n",H+="    else\n",H+="    {\n",H+="        attenuation *= max(0.0, pow(spotDot, u_"+X+"FallOff.y));\n",H+="    }\n"),H+="    diffuseLight += "+Q+"* max(dot(normal,l), 0.) * attenuation;\n",U&&("BLINN"===g?(H+="    vec3 h = normalize(l + viewDir);\n",H+="    float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(H+="    vec3 reflectDir = reflect(-l, normal);\n",H+="    float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),H+="    specularLight += "+Q+" * specularIntensity;\n")),H+="  }\n"}W||(H+="  ambientLight += vec3(0.2, 0.2, 0.2);\n"),G||"CONSTANT"===g||(H+="  vec3 l = normalize(czm_sunDirectionEC);\n",H+="  diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.);\n",U&&("BLINN"===g?(H+="  vec3 h = normalize(l + viewDir);\n",H+="  float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(H+="  vec3 reflectDir = reflect(-l, normal);\n",H+="  float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),H+="  specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")),w+="void main(void) {\n",w+=V,w+="}\n",S+="void main(void) {\n";var J="  vec3 color = vec3(0.0, 0.0, 0.0);\n";A&&(S+="  vec3 normal = normalize(v_normal);\n",a.doubleSided&&(S+="  if (gl_FrontFacing == false)\n",S+="  {\n",S+="    normal = -normal;\n",S+="  }\n"));var $;"CONSTANT"!==g?(t(P.diffuse)&&(S+=P.diffuse.type===i.SAMPLER_2D?"  vec4 diffuse = texture2D(u_diffuse, "+z+");\n":"  vec4 diffuse = u_diffuse;\n",S+="  vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",J+="  color += diffuse.rgb * diffuseLight;\n"),U&&(S+=P.specular.type===i.SAMPLER_2D?"  vec3 specular = texture2D(u_specular, "+z+").rgb;\n":"  vec3 specular = u_specular.rgb;\n",S+="  vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",J+="  color += specular * specularLight;\n"),$=t(P.transparency)?"  gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);\n":"  gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):$=t(P.transparency)?"  gl_FragColor = vec4(color, u_transparency);\n":"  gl_FragColor = vec4(color, 1.0);\n",t(P.emission)&&(S+=P.emission.type===i.SAMPLER_2D?"  vec3 emission = texture2D(u_emission, "+z+").rgb;\n":"  vec3 emission = u_emission.rgb;\n",J+="  color += emission;\n"),(t(P.ambient)||"CONSTANT"!==g)&&(S+=t(P.ambient)?P.ambient.type===i.SAMPLER_2D?"  vec3 ambient = texture2D(u_ambient, "+z+").rgb;\n":"  vec3 ambient = u_ambient.rgb;\n":"  vec3 ambient = diffuse.rgb;\n",J+="  color += ambient * ambientLight;\n"),S+="  vec3 viewDir = -normalize(v_positionEC);\n",S+="  vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",S+=H,S+=J,S+=$,S+="}\n";var ee;ee=a.transparent?{enable:[i.DEPTH_TEST,i.BLEND],depthMask:!1,functions:{blendEquationSeparate:[i.FUNC_ADD,i.FUNC_ADD],blendFuncSeparate:[i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA]}}:a.doubleSided?{enable:[i.DEPTH_TEST]}:{enable:[i.CULL_FACE,i.DEPTH_TEST]},m[E]={attributes:k,parameters:P,program:x,states:ee,uniforms:N},f[b]={type:i.VERTEX_SHADER,uri:"",extras:{source:w}},f[T]={type:i.FRAGMENT_SHADER,uri:"",extras:{source:S}};var te=Object.keys(k);return _[x]={attributes:te,fragmentShader:T,vertexShader:b},E}function s(e,r){var n;switch(n=t(r.value)?r.value:r,e){case"ambient":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"diffuse":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"emission":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"specular":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"shininess":return i.FLOAT;case"transparency":return i.FLOAT;case"transparent":return i.BOOL;case"doubleSided":return i.BOOL}}function l(t){var i="";i+="technique:"+t.technique+";";for(var r=t.values,n=Object.keys(r).sort(),o=n.length,a=0;a<o;++a){var l=n[a];r.hasOwnProperty(l)&&"transparent"!==l&&"doubleSided"!==l&&(i+=l+":"+s(l,r[l]),i+=";")}var u=e(t.doubleSided,!1);i+=u.toString()+";";var c=e(t.transparent,!1);i+=c.toString()+";";var h=e(t.jointCount,0);return i+=h.toString()+";"}function u(e){if(t(e)){var i=!1,r=e.extensionsUsed;if(t(r))for(var o=r.length,s=0;s<o;++s)if("KHR_materials_common"===r[s]){i=!0,r.splice(s,1);break}if(i){t(e.programs)||(e.programs={}),t(e.shaders)||(e.shaders={}),t(e.techniques)||(e.techniques={});var u=n(e),c={},h=e.materials;for(var d in h)if(h.hasOwnProperty(d)){var p=h[d];if(t(p.extensions)&&t(p.extensions.KHR_materials_common)){var m=p.extensions.KHR_materials_common,f=l(m),_=c[f];t(_)||(_=a(e,m,u),c[f]=_),p.values={};var g=m.values;for(var v in g)if(g.hasOwnProperty(v)){var y=g[v];t(y.value)?p.values[v]=y.value:p.values[v]=y}p.technique=_,delete p.extensions.KHR_materials_common}}t(e.extensions)&&delete e.extensions.KHR_materials_common}return e}}var c=0,h=0,d=0,p=0;return u}),i("Scene/ModelMesh",["../Core/defineProperties"],function(e){"use strict";function t(e,t,i){for(var r=[],n=e.primitives,o=n.length,a=0;a<o;++a){var s=n[a];r[a]=t[s.material]}this._name=e.name,this._materials=r,this._id=i}return e(t.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),t}),i("Scene/ModelNode",["../Core/defineProperties","../Core/Matrix4"],function(e,t){"use strict";function i(e,i,r,n,o){this._model=e,this._runtimeNode=r,this._name=i.name,this._id=n,this.useMatrix=!1,this._show=!0,this._matrix=t.clone(o)}return e(i.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,this._model._perNodeShowDirty=!0)}},matrix:{get:function(){return this._matrix},set:function(e){this._matrix=t.clone(e,this._matrix),this.useMatrix=!0;var i=this._model;i._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=i._maxDirtyNumber}}}),i.prototype.setMatrix=function(e){t.clone(e,this._matrix)},i}),i("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getBaseUri","../Core/getMagic","../Core/getStringFromTypedArray","../Core/IndexDatatype","../Core/loadArrayBuffer","../Core/loadImage","../Core/loadImageFromTypedArray","../Core/loadText","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PrimitiveType","../Core/Quaternion","../Core/Queue","../Core/RuntimeError","../Core/Transforms","../Core/WebGLConstants","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../ThirdParty/gltfDefaults","../ThirdParty/Uri","../ThirdParty/when","./BlendingState","./ColorBlendMode","./getAttributeOrUniformBySemantic","./getBinaryAccessor","./HeightReference","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./modelMaterialsCommon","./ModelMesh","./ModelNode","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se){"use strict";function le(){this.buffersToCreate=new M,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new M,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new M,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new M,this.pendingBufferViewToImage=0,this.createSamplers=!0,this.createSkins=!0,this.createRuntimeAnimations=!0,this.createVertexArrays=!0,this.createRenderStates=!0,this.createUniformMaps=!0,this.createRuntimeNodes=!0,this.skinnedNodesIds=[]}function ue(e,t){e._cachedGltf=t,e._animationIds=he(t)}function ce(e){this._gltf=re(j(e.gltf)),this._bgltf=e.bgltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}function he(e){var t=[];if(u(e)&&u(e.gltf)){var i=e.gltf.animations;for(var r in i)i.hasOwnProperty(r)&&t.push(r)}return t}function de(t){t=l(t,l.EMPTY_OBJECT);var i=t.cacheKey;this._cacheKey=i,this._cachedGltf=void 0,this._releaseGltfJson=l(t.releaseGltfJson,!1),this._animationIds=void 0;var r;if(u(i)&&u(di[i])&&di[i].ready)r=di[i],++r.count;else{var n=t.gltf;if(u(n)){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array){var o=_e(n);0!==o.binaryOffset&&(n=n.subarray(o.binaryOffset)),r=new ce({gltf:o.glTF,bgltf:n,ready:!0})}else r=new ce({gltf:t.gltf,ready:!0});r.count=1,u(i)&&(di[i]=r)}}ue(this,r),this._basePath=l(t.basePath,"");var s=new Y(document.location.href),c=new Y(this._basePath);this._baseUri=c.resolve(s),this.show=l(t.show,!0),this.silhouetteColor=l(t.silhouetteColor,a.RED),this._silhouetteColor=new a,this._normalAttributeName=void 0,this.silhouetteSize=l(t.silhouetteSize,0),this.modelMatrix=A.clone(l(t.modelMatrix,A.IDENTITY)),this._modelMatrix=A.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=l(t.scale,1),this._scale=this.scale,this.minimumPixelSize=l(t.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=t.maximumScale,this._maximumScale=this.maximumScale,this.id=t.id,this._id=t.id,this.heightReference=l(t.heightReference,$.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;var h=t.scene;this._scene=h,u(h)&&h.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this),this.pickPrimitive=t.pickPrimitive,this._allowPicking=l(t.allowPicking,!0),this._ready=!1,this._readyPromise=X.defer(),this.activeAnimations=new te(this),this._defaultTexture=void 0,this._incrementallyLoadTextures=l(t.incrementallyLoadTextures,!0),this._asynchronous=l(t.asynchronous,!0),this.shadows=l(t.shadows,se.ENABLED),this._shadows=this.shadows,this.color=l(t.color,a.WHITE),this._color=new a,this.colorBlendMode=l(t.colorBlendMode,K.HIGHLIGHT),this.colorBlendAmount=l(t.colorBlendAmount,.5),this.debugShowBoundingVolume=l(t.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=l(t.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=t.distanceDisplayCondition,this._precreatedAttributes=t.precreatedAttributes,this._vertexShaderLoaded=t.vertexShaderLoaded,this._fragmentShaderLoaded=t.fragmentShaderLoaded,this._uniformMapLoaded=t.uniformMapLoaded,this._pickVertexShaderLoaded=t.pickVertexShaderLoaded,this._pickFragmentShaderLoaded=t.pickFragmentShaderLoaded,this._pickUniformMapLoaded=t.pickUniformMapLoaded,this._ignoreCommands=l(t.ignoreCommands,!1),this.cull=l(t.cull,!0),this._computedModelMatrix=new A,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=ci.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._perNodeShowDirty=!1,this._cesiumAnimationsDirty=!1,this._dirty=!1,this._maxDirtyNumber=0,this._runtime={animations:void 0,rootNodes:void 0,nodes:void 0,nodesByName:void 0,skinnedNodes:void 0,meshesByName:void 0,materialsByName:void 0,materialsById:void 0},this._uniformMaps={},this._extensionsUsed=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0}function pe(e){return e.stencilBuffer}function me(e,t,i){return e.subarray(t,t+i)}function fe(e){var t=g(e);return"glTF"===t}function _e(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=0;i+=pi,i+=pi,i+=pi;var r=t.getUint32(i,!0);i+=pi+pi;var n=i,o=n+r,a=v(e,n,r);return{glTF:JSON.parse(a),binaryOffset:o}}function ge(e,t,i){return e._runtime[t][i]}function ve(e,t){var i=e.accessors[t],r=i.extensions,n=i.min,o=i.max;if(u(r)){var a=r.WEB3D_quantized_attributes;u(a)&&(n=a.decodedMin,o=a.decodedMax)}return{min:n,max:o}}function ye(t){for(var r=t.nodes,n=t.meshes,o=t.scenes[t.scene].nodes,a=o.length,s=[],l=new i(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),c=new i(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),h=0;h<a;++h){var d=r[o[h]];for(d._transformToRoot=De(d),s.push(d);s.length>0;){d=s.pop();var p=d._transformToRoot,m=d.meshes;if(u(m))for(var f=m.length,_=0;_<f;++_)for(var g=n[m[_]].primitives,v=g.length,y=0;y<v;++y){var C=g[y].attributes.POSITION;if(u(C)){var w=ve(t,C),S=i.fromArray(w.min,0,mi),E=i.fromArray(w.max,0,fi);u(l)&&u(c)&&(A.multiplyByPoint(p,S,S),A.multiplyByPoint(p,E,E),i.minimumByComponent(l,S,l),i.maximumByComponent(c,E,c))}}for(var b=d.children,T=b.length,x=0;x<T;++x){var P=r[b[x]];P._transformToRoot=De(P),A.multiplyTransformation(p,P._transformToRoot,P._transformToRoot),s.push(P)}delete d._transformToRoot}}var D=e.fromCornerPoints(l,c);return e.transformWithoutScale(D,li,D)}function Ce(e,t,i){return function(){e._state=ci.FAILED,e._readyPromise.reject(new I("Failed to load "+t+": "+i))}}function we(e,t){return function(i){var r=e._loadResources;r.buffers[t]=new Uint8Array(i),--r.pendingBufferLoads}}function Se(e){var t=e.gltf.buffers;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if("binary_glTF"===i||"KHR_binary_glTF"===i){var n=e._loadResources;n.buffers[i]=e._cachedGltf.bgltf}else if("arraybuffer"===r.type){++e._loadResources.pendingBufferLoads;var o=new Y(r.uri),a=o.resolve(e._baseUri).toString();C(a).then(we(e,i)).otherwise(Ce(e,"buffer",a))}}}function Ee(e){var t=e.gltf.bufferViews;for(var i in t)t.hasOwnProperty(i)&&t[i].target===O.ARRAY_BUFFER&&e._loadResources.buffersToCreate.enqueue(i)}function be(e,t){return function(i){var r=e._loadResources;r.shaders[t]={source:i,bufferView:void 0},--r.pendingShaderLoads}}function Te(e){var t=e.gltf.shaders;for(var i in t)if(t.hasOwnProperty(i)){var r=t[i];if(u(r.extras)&&u(r.extras.source))e._loadResources.shaders[i]={source:r.extras.source,bufferView:void 0};else if(u(r.extensions)&&u(r.extensions.KHR_binary_glTF)){var n=r.extensions.KHR_binary_glTF;e._loadResources.shaders[i]={source:void 0,bufferView:n.bufferView}}else{++e._loadResources.pendingShaderLoads;var o=new Y(r.uri),a=o.resolve(e._baseUri).toString();E(a).then(be(e,i)).otherwise(Ce(e,"shader",a))}}}function xe(e){var t=e.gltf.programs;for(var i in t)t.hasOwnProperty(i)&&e._loadResources.programsToCreate.enqueue(i)}function Ae(e,t){return function(i){var r=e._loadResources;--r.pendingTextureLoads,r.texturesToCreate.enqueue({id:t,image:i,bufferView:void 0})}}function Pe(e){var t=e.gltf.images,i=e.gltf.textures;for(var r in i)if(i.hasOwnProperty(r)){var n=t[i[r].source];if(u(n.extensions)&&u(n.extensions.KHR_binary_glTF)){var o=n.extensions.KHR_binary_glTF;e._loadResources.texturesToCreateFromBufferView.enqueue({id:r,image:void 0,bufferView:o.bufferView,mimeType:o.mimeType})}else{++e._loadResources.pendingTextureLoads;var a=new Y(n.uri),s=a.resolve(e._baseUri).toString();w(s).then(Ae(e,r)).otherwise(Ce(e,"image",s))}}}function De(e){return u(e.matrix)?A.fromArray(e.matrix):A.fromTranslationQuaternionRotationScale(i.fromArray(e.translation,0,_i),D.unpack(e.rotation,0,gi),i.fromArray(e.scale,0,vi))}function Me(e){var t={},i={},r=[],n=e._loadResources.skinnedNodesIds,o=e.gltf.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a],l={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new A,computedMatrix:new A,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,children:[],parents:[],publicNode:void 0};l.publicNode=new oe(e,s,l,a,De(s)),t[a]=l,i[s.name]=l,u(s.skin)&&(n.push(a),r.push(l))}e._runtime.nodes=t,e._runtime.nodesByName=i,e._runtime.skinnedNodes=r}function Ie(e){var t={},i={},r=e.gltf.materials,n=e._uniformMaps;for(var o in r)if(r.hasOwnProperty(o)){n[o]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0};var a=r[o],s=new ie(e,a,o);t[a.name]=s,i[o]=s}e._runtime.materialsByName=t,e._runtime.materialsById=i}function Re(e){var t={},i=e._runtime.materialsById,r=e.gltf.meshes,n=Ne(e,"WEB3D_quantized_attributes");for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];if(t[a.name]=new ne(a,i,o),n)for(var s=a.primitives,l=s.length,c=0;c<l;c++){var h=s[c],d=ke(e,h),p=e._programPrimitives[d];u(p)||(p=[],e._programPrimitives[d]=p),p.push(h)}}e._runtime.meshesByName=t}function Oe(e){e._loadRendererResourcesFromCache||(Se(e),Ee(e),Te(e),xe(e),Pe(e)),Ie(e),Re(e),Me(e)}function Ne(e,t){var i=e._extensionsUsed;if(!u(i)){var r=e.gltf.extensionsUsed;i={};for(var n=r.length,o=0;o<n;o++)i[r[o]]=!0}return u(i[t])}function Le(e,t){var i=e._loadResources;if(0===i.pendingBufferLoads){for(var r,n=e.gltf.bufferViews,o=e._rendererResources.buffers;i.buffersToCreate.length>0;){var a=i.buffersToCreate.dequeue();r=n[a];var s=N.createVertexBuffer({context:t,typedArray:i.getBuffer(r),usage:L.STATIC_DRAW});s.vertexArrayDestroyable=!1,o[a]=s}var l=e.gltf.accessors;for(var c in l)if(l.hasOwnProperty(c)){var h=l[c];if(r=n[h.bufferView],r.target===O.ELEMENT_ARRAY_BUFFER&&!u(o[h.bufferView])){var d=N.createIndexBuffer({context:t,typedArray:i.getBuffer(r),usage:L.STATIC_DRAW,indexDatatype:h.componentType});d.vertexArrayDestroyable=!1,o[h.bufferView]=d}}}}function Be(e,t){var i,r={},n=t.length;for(i=1;i<n;++i){var o=t[i];if(/position/i.test(o)){t[i]=t[0],t[0]=o;break}}for(i=0;i<n;++i)r[t[i]]=i;return r}function Fe(e,t){if(u(t.source))return t.source;var i=e._loadResources,r=e.gltf,n=r.bufferViews[t.bufferView];return v(i.getBuffer(n))}function Ve(e,t,i){var r=e.indexOf(t);return e.replace(new RegExp(t,"g"),function(e,t,n){return r===t?e:i})}function ke(e,t){var i=e.gltf,r=t.material,n=i.materials[r],o=n.technique,a=i.techniques[o];return a.program}function ze(e,t){var i=e.gltf,r=i.accessors[t],n=r.extensions;if(u(n))return n.WEB3D_quantized_attributes}function Ue(e,t,i){var r=e.gltf,n=t.material,o=r.materials[n],a=o.technique,s=r.techniques[a];for(var l in s.parameters)if(s.parameters.hasOwnProperty(l)){var u=s.parameters[l].semantic;if(u===i){var c=s.attributes;for(var h in c)if(c.hasOwnProperty(h)){var d=c[h];if(d===l)return h}}}}function Ge(e,t,i,r){var n={};i._quantizedUniforms[t]=n;for(var o=i._programPrimitives[t],a=0;a<o.length;a++){var s=o[a];if(ke(i,s)===t)for(var l in s.attributes)if(s.attributes.hasOwnProperty(l)){var c="gltf_u_dec_"+l.toLowerCase(),h=c+"_scale",d=c+"_translate";if(!u(n[c])&&!u(n[h])){var p=s.attributes[l],m=ze(i,p);if(u(m)){var f=Ue(i,s,l),_=m.decodeMatrix,g="gltf_decoded_"+l,v=f.replace("a_","gltf_a_dec_"),y=Math.floor(Math.sqrt(_.length));e=Ve(e,f,v);var C;C=y>2?"vec"+(y-1):"float",e=C+" "+v+";\n"+e;var w="";5===y?(e="uniform mat4 "+h+";\n"+e,e="uniform vec4 "+d+";\n"+e,w="\nvoid main() {\n    "+v+" = "+h+" * "+f+" + "+d+";\n    "+g+"();\n}\n",n[h]={mat:4},n[d]={vec:4}):(e="uniform mat"+y+" "+c+";\n"+e,w="\nvoid main() {\n    "+v+" = "+C+"("+c+" * vec"+y+"("+f+",1.0));\n    "+g+"();\n}\n",n[c]={mat:y}),e=U.replaceMain(e,g),e+=w}}}}return i._programPrimitives[t]=void 0,e}function We(e){var t=e.gltf;return!!u(t.asset)&&l(t.asset.premultipliedAlpha,!1)}function He(e,t){return e=U.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n    gltf_blend_main(); \n",t&&(e+="    float alpha = 1.0 - ceil(gl_FragColor.a) + gl_FragColor.a; \n    gl_FragColor.rgb /= alpha; \n"),e+="    gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n    float highlight = ceil(gltf_colorBlend); \n    gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n    gl_FragColor.a *= gltf_color.a; \n} \n"}function qe(e,t,i){return u(i)&&(e=i(e,t)),e}function je(e,t,i){var r=t.gltf.programs,n=t._loadResources.shaders,o=r[e],a=Be(t,o.attributes),s=Fe(t,n[o.vertexShader]),l=Fe(t,n[o.fragmentShader]),c=o.attributes.length,h=t._precreatedAttributes;if(u(h))for(var d in h)h.hasOwnProperty(d)&&(a[d]=c++);Ne(t,"WEB3D_quantized_attributes")&&(s=Ge(s,e,t,i));var p=We(t),m=He(l,p),f=qe(s,e,t._vertexShaderLoaded),_=qe(m,e,t._fragmentShaderLoaded);if(t._rendererResources.programs[e]=z.fromCache({context:i,vertexShaderSource:f,fragmentShaderSource:_,attributeLocations:a}),t.allowPicking){var g=qe(s,e,t._pickVertexShaderLoaded),v=qe(l,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(v=U.createPickFragmentShaderSource(l,"uniform")),t._rendererResources.pickPrograms[e]=z.fromCache({context:i,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:a})}}function Ye(e,t){var i,r=e._loadResources;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads)if(e.asynchronous)r.programsToCreate.length>0&&(i=r.programsToCreate.dequeue(),je(i,e,t));else for(;r.programsToCreate.length>0;)i=r.programsToCreate.dequeue(),je(i,e,t)}function Xe(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function Ze(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView],o=Xe(t,i),a=Ce(e,"image","id: "+i.id+", bufferView: "+i.bufferView);S(t.getBuffer(n),i.mimeType).then(o).otherwise(a),++t.pendingBufferViewToImage}}function Ke(e,t){var i=e._loadResources;if(i.createSamplers){i.createSamplers=!1;var r=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];r[o]=new k({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function Qe(e,t,i){var r=t.gltf.textures,n=r[e.id],o=t._rendererResources.samplers,a=o[n.sampler],s=a.minificationFilter===W.NEAREST_MIPMAP_NEAREST||a.minificationFilter===W.NEAREST_MIPMAP_LINEAR||a.minificationFilter===W.LINEAR_MIPMAP_NEAREST||a.minificationFilter===W.LINEAR_MIPMAP_LINEAR,l=s||a.wrapS===H.REPEAT||a.wrapS===H.MIRRORED_REPEAT||a.wrapT===H.REPEAT||a.wrapT===H.MIRRORED_REPEAT,u=e.image,c=!b.isPowerOfTwo(u.width)||!b.isPowerOfTwo(u.height);if(l&&c){var h=document.createElement("canvas");h.width=b.nextPowerOfTwo(u.width),h.height=b.nextPowerOfTwo(u.height);var d=h.getContext("2d");d.drawImage(u,0,0,u.width,u.height,0,0,h.width,h.height),u=h}var p;n.target===O.TEXTURE_2D&&(p=new G({context:i,source:u,pixelFormat:n.internalFormat,pixelDatatype:n.type,sampler:a,flipY:!1})),s&&p.generateMipmap(),t._rendererResources.textures[e.id]=p}function Je(e,t){var i,r=e._loadResources;if(e.asynchronous)r.texturesToCreate.length>0&&(i=r.texturesToCreate.dequeue(),Qe(i,e,t));else for(;r.texturesToCreate.length>0;)i=r.texturesToCreate.dequeue(),Qe(i,e,t)}function $e(e,t){var i=e.gltf,r=i.techniques,n=i.materials,o={},a=r[n[t.material].technique],s=a.parameters,l=a.attributes,c=e._rendererResources.programs[a.program].vertexAttributes;for(var h in c)if(c.hasOwnProperty(h)){var d=l[h],p=c[h].index;if(u(d)){var m=s[d];o[m.semantic]=p}else o[h]=p}return o}function et(e,t,i){for(var r=e.length,n=0;n<r;++n)for(var o=[e[n]];o.length>0;){var a=o.pop(),s=i[a];if(s.jointName===t)return a;for(var l=s.children,u=l.length,c=0;c<u;++c)o.push(l[c])}}function tt(e,t){for(var i=e.gltf,r=i.skins,n=i.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length,l=0;l<s;++l){var u=a[l],c=o[u],h=n[u],d=t[h.skin];c.inverseBindMatrices=d.inverseBindMatrices,c.bindShapeMatrix=d.bindShapeMatrix;for(var p=[],m=h.skeletons,f=m.length,_=0;_<f;++_)p.push(m[_]);for(var g=r[h.skin].jointNames,v=g.length,y=0;y<v;++y){var C=g[y],w=o[et(p,C,n)];c.joints.push(w)}}}function it(e){var t=e._loadResources;
if(0===t.pendingBufferLoads&&t.createSkins){t.createSkins=!1;var i=e.gltf,r=i.accessors,n=i.skins,o={};for(var a in n)if(n.hasOwnProperty(a)){var s,l=n[a],u=r[l.inverseBindMatrices];A.equals(l.bindShapeMatrix,A.IDENTITY)||(s=A.clone(l.bindShapeMatrix)),o[a]={inverseBindMatrices:ee.getSkinInverseBindMatrices(e,u),bindShapeMatrix:s}}tt(e,o)}}function rt(e,t,i,r){return function(n){t[i]=r.evaluate(n,t[i]),t.dirtyNumber=e._maxDirtyNumber}}function nt(e){var t=e._loadResources;if(t.finishedPendingBufferLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations={};var i=e._runtime.nodes,r=e.gltf.animations,n=e.gltf.accessors;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o],s=a.channels,l=a.parameters,u=a.samplers,c={};for(var h in l)l.hasOwnProperty(h)&&(c[h]=ee.getAnimationParameterValues(e,n[l[h]]));for(var d=Number.MAX_VALUE,p=-Number.MAX_VALUE,m=s.length,f=new Array(m),_=0;_<m;++_){var g=s[_],v=g.target,y=u[g.sampler],C=c[y.input];d=Math.min(d,C[0]),p=Math.max(p,C[C.length-1]);var w=ee.getAnimationSpline(e,o,a,g.sampler,y,c);f[_]=rt(e,i[v.id],v.path,w)}e._runtime.animations[o]={startTime:d,stopTime:p,channelEvaluators:f}}}}function ot(e,t){var i=e._loadResources;if(i.finishedBuffersCreation()&&i.finishedProgramCreation()&&i.createVertexArrays){i.createVertexArrays=!1;var r=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,o=e.gltf,a=o.accessors,s=o.meshes;for(var l in s)if(s.hasOwnProperty(l))for(var c=s[l].primitives,h=c.length,d=0;d<h;++d){var p,m,f,_=c[d],g=$e(e,_),v=[],y=_.attributes;for(p in y)if(y.hasOwnProperty(p)&&(m=g[p],u(m))){var C=a[y[p]];v.push({index:m,vertexBuffer:r[C.bufferView],componentsPerAttribute:J(C).componentsPerAttribute,componentDatatype:C.componentType,normalize:!1,offsetInBytes:C.byteOffset,strideInBytes:C.byteStride})}var w=e._precreatedAttributes;if(u(w))for(p in w)w.hasOwnProperty(p)&&(m=g[p],u(m)&&(f=w[p],f.index=m,v.push(f)));var S;if(u(_.indices)){var E=a[_.indices];S=r[E.bufferView]}n[l+".primitive."+d]=new q({context:t,attributes:v,indexBuffer:S})}}}function at(e){var t={};t[O.BLEND]=!1,t[O.CULL_FACE]=!1,t[O.DEPTH_TEST]=!1,t[O.POLYGON_OFFSET_FILL]=!1,t[O.SCISSOR_TEST]=!1;var i,r=e.enable,n=r.length;for(i=0;i<n;++i)t[r[i]]=!0;return t}function st(e,t){var i=e._loadResources,r=e.gltf.techniques;if(i.createRenderStates){i.createRenderStates=!1;for(var n in r)r.hasOwnProperty(n)&&lt(e,n,t)}}function lt(e,t,i){var r=e._rendererResources.renderStates,n=e.gltf.techniques,o=n[t],a=o.states,s=at(a),c=l(a.functions,l.EMPTY_OBJECT),h=l(c.blendColor,[0,0,0,0]),d=l(c.blendEquationSeparate,[O.FUNC_ADD,O.FUNC_ADD]),p=l(c.blendFuncSeparate,[O.ONE,O.ZERO,O.ONE,O.ZERO]),m=l(c.colorMask,[!0,!0,!0,!0]),f=l(c.depthRange,[0,1]),_=l(c.polygonOffset,[0,0]),g=l(c.scissor,[0,0,0,0]);s[O.BLEND]&&We(e)&&p[0]===O.ONE&&p[1]===O.ONE_MINUS_SRC_ALPHA&&(p[0]=O.SRC_ALPHA,p[1]=O.ONE_MINUS_SRC_ALPHA,p[2]=O.SRC_ALPHA,p[3]=O.ONE_MINUS_SRC_ALPHA),r[t]=V.fromCache({frontFace:u(c.frontFace)?c.frontFace[0]:O.CCW,cull:{enabled:s[O.CULL_FACE],face:u(c.cullFace)?c.cullFace[0]:O.BACK},lineWidth:u(c.lineWidth)?c.lineWidth[0]:1,polygonOffset:{enabled:s[O.POLYGON_OFFSET_FILL],factor:_[0],units:_[1]},scissorTest:{enabled:s[O.SCISSOR_TEST],rectangle:{x:g[0],y:g[1],width:g[2],height:g[3]}},depthRange:{near:f[0],far:f[1]},depthTest:{enabled:s[O.DEPTH_TEST],func:u(c.depthFunc)?c.depthFunc[0]:O.LESS},colorMask:{red:m[0],green:m[1],blue:m[2],alpha:m[3]},depthMask:!u(c.depthMask)||c.depthMask[0],blending:{enabled:s[O.BLEND],color:{red:h[0],green:h[1],blue:h[2],alpha:h[3]},equationRgb:d[0],equationAlpha:d[1],functionSourceRgb:p[0],functionDestinationRgb:p[1],functionSourceAlpha:p[2],functionDestinationAlpha:p[3]}})}function ut(e,t){var i={value:e,clone:function(e,t){return e},func:function(){return i.value}};return i}function ct(e,i){var r={value:t.fromArray(e),clone:t.clone,func:function(){return r.value}};return r}function ht(e,t){var r={value:i.fromArray(e),clone:i.clone,func:function(){return r.value}};return r}function dt(e,t){var i={value:r.fromArray(e),clone:r.clone,func:function(){return i.value}};return i}function pt(e,t){var i={value:T.fromColumnMajorArray(e),clone:T.clone,func:function(){return i.value}};return i}function mt(e,t){var i={value:x.fromColumnMajorArray(e),clone:x.clone,func:function(){return i.value}};return i}function ft(e,t){var i={value:A.fromColumnMajorArray(e),clone:A.clone,func:function(){return i.value}};return i}function _t(e,t){this._value=void 0,this._textureId=e,this._model=t}function gt(e,t){var i=new _t(e,t);return i.func=function(){return i.value},i}function vt(e,t,i,r){var n=t._runtime.nodes[e];return Si[i](r,t,n)}function yt(e,t){var i=e._loadResources;if(i.finishedProgramCreation()&&i.createUniformMaps){i.createUniformMaps=!1;var r=e.gltf,n=r.materials,o=r.techniques,a=e._uniformMaps;for(var s in n)if(n.hasOwnProperty(s)){var l,c=n[s],h=c.values,d=o[c.technique],p=d.parameters,m=d.uniforms,f={},_={};for(var g in m)if(m.hasOwnProperty(g)){var v=m[g],y=p[v];if(u(h[v])){var C=wi[y.type](h[v],e);f[g]=C.func,_[v]=C}else if(u(y.node))f[g]=vt(y.node,e,y.semantic,t.uniformState);else if(u(y.semantic))"JOINTMATRIX"!==y.semantic?f[g]=Ci[y.semantic](t.uniformState,e):l=g;else if(u(y.value)){var w=wi[y.type](y.value,e);f[g]=w.func,_[v]=w}}var S=a[s];S.uniformMap=f,S.values=_,S.jointMatrixUniformName=l}}}function Ct(e){return[e[0],e[1],e[2],e[3],e[5],e[6],e[7],e[8],e[10],e[11],e[12],e[13],e[15],e[16],e[17],e[18]]}function wt(e){return[e[20],e[21],e[22],e[23]]}function St(e,t,i){var r=e.gltf,n=r.accessors,o=ke(e,t),a=e._quantizedUniforms[o],s={},l={};for(var c in t.attributes)if(t.attributes.hasOwnProperty(c)){var h=t.attributes[c],d=n[h],p=d.extensions;if(u(p)){var m=p.WEB3D_quantized_attributes;if(u(m)){var f=m.decodeMatrix,_="gltf_u_dec_"+c.toLowerCase();switch(d.type){case"SCALAR":l[_]=pt(f,e).func,s[_]=!0;break;case"VEC2":l[_]=mt(f,e).func,s[_]=!0;break;case"VEC3":l[_]=ft(f,e).func,s[_]=!0;break;case"VEC4":var g=_+"_scale",v=_+"_translate";l[g]=ft(Ct(f),e).func,l[v]=dt(wt(f),e).func,s[g]=!0,s[v]=!0}}}}for(var y in a)if(a.hasOwnProperty(y)&&!s[y]){var C=a[y];u(C.mat)&&(2===C.mat?l[y]=pt(T.IDENTITY,e).func:3===C.mat?l[y]=mt(x.IDENTITY,e).func:4===C.mat&&(l[y]=ft(A.IDENTITY,e).func)),u(C.vec)&&4===C.vec&&(l[y]=dt([0,0,0,0],e).func)}return l}function Et(e){return function(){return e}}function bt(e){return function(){return e.computedJointMatrices}}function Tt(e){return function(){return e.silhouetteColor}}function xt(e){return function(){return e.silhouetteSize}}function At(e){return function(){return e.color}}function Pt(e){return function(){return K.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function Dt(t,r,n,o,a){for(var c=t._nodeCommands,h=t._pickIds,d=t.allowPicking,p=t._runtime.meshesByName,m=t._rendererResources,f=m.vertexArrays,_=m.programs,g=m.pickPrograms,v=m.renderStates,C=t._uniformMaps,w=t.gltf,S=w.accessors,E=w.meshes,b=w.techniques,T=w.materials,x=r.meshes,P=x.length,D=0;D<P;++D)for(var M=x[D],I=E[M],R=I.primitives,O=R.length,N=0;N<O;++N){var L,V=R[N],k=S[V.indices],z=T[V.material],U=b[z.technique],G=U.program,W=V.attributes.POSITION;if(u(W)){var H=ve(w,W);L=e.fromCornerPoints(i.fromArray(H.min),i.fromArray(H.max))}var q,j,Y=f[M+".primitive."+N];if(u(k))j=k.count,q=k.byteOffset/y.getSizeInBytes(k.componentType);else{var X=S[V.attributes.POSITION];j=X.count,q=0}var Z=C[V.material],K=Z.uniformMap;if(u(Z.jointMatrixUniformName)){var Q={};Q[Z.jointMatrixUniformName]=bt(n),K=s(K,Q)}if(K=s(K,{gltf_color:At(t),gltf_colorBlend:Pt(t)}),u(t._uniformMapLoaded)&&(K=t._uniformMapLoaded(K,G,n)),Ne(t,"WEB3D_quantized_attributes")){var J=St(t,V,o);K=s(K,J)}var $,ee=v[z.technique],te=ee.blending.enabled,ie={primitive:l(t.pickPrimitive,t),id:t.id,node:n.publicNode,mesh:p[I.name]},re=se.castShadows(t._shadows),ne=se.receiveShadows(t._shadows),oe=new B({boundingVolume:new e,cull:t.cull,modelMatrix:new A,primitiveType:V.mode,vertexArray:Y,count:j,offset:q,shaderProgram:_[U.program],castShadows:re,receiveShadows:ne,uniformMap:K,renderState:ee,owner:ie,pass:te?F.TRANSLUCENT:F.OPAQUE});if(d){var ae;if(u(t._pickFragmentShaderLoaded))ae=u(t._pickUniformMapLoaded)?t._pickUniformMapLoaded(K):s(K);else{var le=o.createPickId(ie);h.push(le);var ue={czm_pickColor:Et(le.color)};ae=s(K,ue)}$=new B({boundingVolume:new e,cull:t.cull,modelMatrix:new A,primitiveType:V.mode,vertexArray:Y,count:j,offset:q,shaderProgram:g[U.program],uniformMap:ae,renderState:ee,owner:ie,pass:te?F.TRANSLUCENT:F.OPAQUE})}var ce,he;a||(ce=B.shallowClone(oe),ce.boundingVolume=new e,ce.modelMatrix=new A,d&&(he=B.shallowClone($),he.boundingVolume=new e,he.modelMatrix=new A));var de={show:!0,boundingSphere:L,command:oe,pickCommand:$,command2D:ce,pickCommand2D:he,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0};n.commands.push(de),c.push(de)}}function Mt(e,t,r){var n=e._loadResources;if(n.finishedEverythingButTextureCreation()&&n.createRuntimeNodes){n.createRuntimeNodes=!1;for(var o=[],a=e._runtime.nodes,s=e.gltf,l=s.nodes,c=s.scenes[s.scene],h=c.nodes,d=h.length,p=[],m=0;m<d;++m)for(p.push({parentRuntimeNode:void 0,gltfNode:l[h[m]],id:h[m]});p.length>0;){var f=p.pop(),_=f.parentRuntimeNode,g=f.gltfNode,v=a[f.id];if(0===v.parents.length)if(u(g.matrix))v.matrix=A.fromColumnMajorArray(g.matrix);else{var y=g.rotation;v.translation=i.fromArray(g.translation),v.rotation=D.unpack(y),v.scale=i.fromArray(g.scale)}u(_)?(_.children.push(v),v.parents.push(_)):o.push(v),u(g.meshes)&&Dt(e,g,v,t,r);for(var C=g.children,w=C.length,S=0;S<w;++S)p.push({parentRuntimeNode:v,gltfNode:l[C[S]],id:C[S]})}e._runtime.rootNodes=o,e._runtime.nodes=a}}function It(e,t){var i=t.context,r=t.scene3DOnly;if(e._loadRendererResourcesFromCache){var n=e._rendererResources,o=e._cachedRendererResources;n.buffers=o.buffers,n.vertexArrays=o.vertexArrays,n.programs=o.programs,n.pickPrograms=o.pickPrograms,n.silhouettePrograms=o.silhouettePrograms,n.textures=o.textures,n.samplers=o.samplers,n.renderStates=o.renderStates,u(e._precreatedAttributes)&&ot(e,i)}else Le(e,i),Ye(e,i),Ke(e,i),Ze(e),Je(e,i);it(e),nt(e),e._loadRendererResourcesFromCache||(ot(e,i),st(e,i)),yt(e,i),Mt(e,i,r)}function Rt(e,t){var i=e.publicNode,r=i.matrix;i.useMatrix&&u(r)?A.clone(r,t):u(e.matrix)?A.clone(e.matrix,t):(A.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),i.setMatrix(t))}function Ot(t,r,n,o){var a=t._maxDirtyNumber,s=t.allowPicking,l=t._runtime.rootNodes,c=l.length,h=Ei,d=t._computedModelMatrix;t._mode!==ae.SCENE3D&&(d=R.basisTo2D(o,d,bi));for(var p=0;p<c;++p){var m=l[p];for(Rt(m,m.transformToRoot),h.push(m);h.length>0;){m=h.pop();var f=m.transformToRoot,_=m.commands;if(m.dirtyNumber===a||r||n){var g=A.multiplyTransformation(d,f,m.computedMatrix),v=_.length;if(v>0)for(var y=0;y<v;++y){var C=_[y],w=C.command;if(A.clone(g,w.modelMatrix),e.transform(C.boundingSphere,w.modelMatrix,w.boundingVolume),u(t._rtcCenter)&&i.add(t._rtcCenter,w.boundingVolume.center,w.boundingVolume.center),s){var S=C.pickCommand;A.clone(w.modelMatrix,S.modelMatrix),e.clone(w.boundingVolume,S.boundingVolume)}if(w=C.command2D,u(w)&&t._mode===ae.SCENE2D&&(A.clone(g,w.modelMatrix),w.modelMatrix[13]-=2*b.sign(w.modelMatrix[13])*b.PI*o.ellipsoid.maximumRadius,e.transform(C.boundingSphere,w.modelMatrix,w.boundingVolume),s)){var E=C.pickCommand2D;A.clone(w.modelMatrix,E.modelMatrix),e.clone(w.boundingVolume,E.boundingVolume)}}}for(var T=m.children,x=T.length,P=0;P<x;++P){var D=T[P];D.dirtyNumber=Math.max(D.dirtyNumber,m.dirtyNumber),(D.dirtyNumber===a||n)&&(Rt(D,D.transformToRoot),A.multiplyTransformation(f,D.transformToRoot,D.transformToRoot)),h.push(D)}}}++t._maxDirtyNumber}function Nt(e){for(var t=e._runtime.skinnedNodes,i=t.length,r=0;r<i;++r){var n=t[r];Ti=A.inverseTransformation(n.transformToRoot,Ti);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,l=n.inverseBindMatrices,c=l.length,h=0;h<c;++h)u(o[h])||(o[h]=new A),o[h]=A.multiplyTransformation(Ti,a[h].transformToRoot,o[h]),o[h]=A.multiplyTransformation(o[h],l[h],o[h]),u(s)&&(o[h]=A.multiplyTransformation(o[h],s,o[h]))}}function Lt(e){for(var t=e._runtime.rootNodes,i=t.length,r=Ei,n=0;n<i;++n){var o=t[n];for(o.computedShow=o.publicNode.show,r.push(o);r.length>0;){o=r.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;u<l;++u)s[u].show=a;for(var c=o.children,h=c.length,d=0;d<h;++d){var p=c[d];p.computedShow=a&&p.publicNode.show,r.push(p)}}}}function Bt(e,t){var i=e.id;if(e._id!==i){e._id=i;for(var r=e._pickIds,n=r.length,o=0;o<n;++o)r[o].object.id=i}}function Ft(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?P.LINES:P.TRIANGLES,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.primitiveType=t}}function Vt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,i=e._nodeCommands,r=i.length,n=0;n<r;++n)i[n].command.debugShowBoundingVolume=t}}function kt(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=se.castShadows(e.shadows),i=se.receiveShadows(e.shadows),r=e._nodeCommands,n=r.length,o=0;o<n;o++){var a=r[o];a.command.castShadows=t,a.command.receiveShadows=i}}}function zt(e){var t=o(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=Z.ALPHA_BLEND,V.fromCache(t)}function Ut(e){var t=B.shallowClone(e);return t.pass=F.TRANSLUCENT,t.renderState=zt(e.renderState),t}function Gt(e,t){var i=t.scene3DOnly,r=e.color.alpha;if(r>0&&r<1){var n=e._nodeCommands,o=n.length;if(!u(n[0].translucentCommand))for(var a=0;a<o;++a){var s=n[a],l=s.command;if(s.translucentCommand=Ut(l),!i){var c=s.command2D;s.translucentCommand2D=Ut(c)}}}}function Wt(e,t){var i=e._rendererResources.programs;for(var r in i)if(i.hasOwnProperty(r)&&i[r]===t)return r}function Ht(e,t,i){var r=t.vertexShaderSource.sources[0],n=t._attributeLocations,o=e._normalAttributeName;r=U.replaceMain(r,"gltf_silhouette_main"),r+="uniform float gltf_silhouetteSize; \nvoid main() \n{ \n    gltf_silhouette_main(); \n    vec3 n = normalize(czm_normal3D * "+o+"); \n    n.x *= czm_projection[0][0]; \n    n.y *= czm_projection[1][1]; \n    vec4 clip = gl_Position; \n    clip.xy += n.xy * clip.w * gltf_silhouetteSize / czm_viewport.z; \n    gl_Position = clip; \n}";var a="uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n    gl_FragColor = gltf_silhouetteColor; \n}";return z.fromCache({context:i.context,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:n})}function qt(e,t){return pe(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&u(e._normalAttributeName)}function jt(e){for(var t=e._nodeCommands,i=t.length,r=0;r<i;++r){var n=t[r],o=n.command;if(o.pass===F.TRANSLUCENT)return!0}return!1}function Yt(e){return e.color.alpha>0&&e.color.alpha<1}function Xt(e){return 0===e.color.alpha}function Zt(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}function Kt(e,t){for(var i=++xi%255,r=jt(e)||Yt(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,a=t.scene3DOnly,l=e._nodeCommands,c=l.length,h=0;h<c;++h){var d=l[h],p=d.command,m=Yt(e)?d.translucentCommand:p,f=B.shallowClone(m),_=o(m.renderState);_.stencilTest={enabled:!0,frontFunction:O.ALWAYS,backFunction:O.ALWAYS,reference:i,mask:-1,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.REPLACE},backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.REPLACE}},Xt(e)&&(_.colorMask={red:!1,green:!1,blue:!1,alpha:!1},_.depthMask=!1),_=V.fromCache(_),f.renderState=_,d.silhouetteModelCommand=f;var g=B.shallowClone(p);_=o(p.renderState,!0),_.depthTest.enabled=!0,_.cull.enabled=!1,r&&(g.pass=F.TRANSLUCENT,_.depthMask=!1,_.blending=Z.ALPHA_BLEND),_.stencilTest={enabled:!0,frontFunction:O.NOTEQUAL,backFunction:O.NOTEQUAL,reference:i,mask:-1,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.KEEP},backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.KEEP}},_=V.fromCache(_);var v=p.shaderProgram,y=Wt(e,v),C=n[y];u(C)||(C=Ht(e,v,t),n[y]=C);var w=s(p.uniformMap,{gltf_silhouetteColor:Tt(e),gltf_silhouetteSize:xt(e)});if(g.renderState=_,g.shaderProgram=C,g.uniformMap=w,g.castShadows=!1,g.receiveShadows=!1,d.silhouetteColorCommand=g,!a){var S=d.command2D,E=B.shallowClone(f);E.boundingVolume=S.boundingVolume,E.modelMatrix=S.modelMatrix,d.silhouetteModelCommand2D=E;var b=B.shallowClone(g);E.boundingVolume=S.boundingVolume,E.modelMatrix=S.modelMatrix,d.silhouetteColorCommand2D=b}}}function Qt(e,t){if(qt(e,t)){var i=e._nodeCommands,r=Zt(e.color.alpha,e._color.alpha)||Zt(e.silhouetteColor.alpha,e._silhouetteColor.alpha)||!u(i[0].silhouetteModelCommand);a.clone(e.color,e._color),a.clone(e.silhouetteColor,e._silhouetteColor),r&&Kt(e,t)}}function Jt(e,t,i){return Ai.center=e,Ai.radius=t,i.camera.getPixelSize(Ai,i.context.drawingBufferWidth,i.context.drawingBufferHeight)}function $t(e,t){var r=e.scale;if(0!==e.minimumPixelSize){var n=t.context,o=Math.max(n.drawingBufferWidth,n.drawingBufferHeight),a=u(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(Pi.x=a[12],Pi.y=a[13],Pi.z=a[14],u(e._rtcCenter)&&i.add(e._rtcCenter,Pi,Pi),e._mode!==ae.SCENE3D){var s=t.mapProjection,l=s.ellipsoid.cartesianToCartographic(Pi,Di);s.project(l,Pi),i.fromElements(Pi.z,Pi.x,Pi.y,Pi)}var c=e.boundingSphere.radius,h=Jt(Pi,c,t),d=1/h,p=Math.min(d*(2*c),o);p<e.minimumPixelSize&&(r=e.minimumPixelSize*h/(2*e._initialRadius))}return u(e.maximumScale)?Math.min(e.maximumScale,r):r}function ei(e){u(e._cacheKey)&&u(e._cachedGltf)&&0===--e._cachedGltf.count&&delete di[e._cacheKey],e._cachedGltf=void 0}function ti(e){var t=e.gltf.extensionsUsed;if(u(t))for(var i=t.length,r=0;r<i;++r){var n=t[r];if("CESIUM_RTC"!==n&&"KHR_binary_glTF"!==n&&"KHR_materials_common"!==n&&"WEB3D_quantized_attributes"!==n)throw new I("Unsupported glTF Extension: "+n)}}function ii(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.pickPrograms=void 0,this.silhouettePrograms=void 0,this.textures=void 0,this.samplers=void 0,this.renderStates=void 0,this.ready=!1,this.context=e,this.cacheKey=t,this.count=0}function ri(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function ni(e){ri(e.buffers),ri(e.vertexArrays),ri(e.programs),ri(e.pickPrograms),ri(e.silhouettePrograms),ri(e.textures)}function oi(e,t,i){return function(r){if(e.heightReference===$.RELATIVE_TO_GROUND){var n=t.cartesianToCartographic(r,Di);n.height+=i.height,t.cartographicToCartesian(n,r)}var o=e._clampedModelMatrix;A.clone(e.modelMatrix,o),o[12]=r.x,o[13]=r.y,o[14]=r.z,e._heightChanged=!0}}function ai(e){u(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);var t=e._scene;if(!u(t)||e.heightReference===$.NONE)return void(e._clampedModelMatrix=void 0);var i=t.globe,r=i.ellipsoid,o=e.modelMatrix;Pi.x=o[12],Pi.y=o[13],Pi.z=o[14];var a=r.cartesianToCartographic(Pi);u(e._clampedModelMatrix)||(e._clampedModelMatrix=A.clone(o,new A));var s=i._surface;e._removeUpdateHeightCallback=s.updateHeight(a,oi(e,r,a));var l=i.getHeight(a);if(u(l)){var c=oi(e,r,a);n.clone(a,Di),Di.height=l,r.cartographicToCartesian(Di,Pi),c(Pi)}}function si(e,t){var r,n=e.distanceDisplayCondition,o=n.near*n.near,a=n.far*n.far;if(t.mode===ae.SCENE2D){var s=t.camera.frustum.right-t.camera.frustum.left;r=.5*s,r*=r}else{var l=A.getTranslation(e.modelMatrix,Mi);if(t.mode===ae.COLUMBUS_VIEW){var u=t.mapProjection,c=u.ellipsoid,h=c.cartesianToCartographic(l,Ii);l=u.project(h,l),i.fromElements(l.z,l.x,l.y,l)}r=i.distanceSquared(l,t.camera.positionWC)}return r>=o&&r<=a}if(!m.supportsTypedArrays())return{};var li=A.fromRotationTranslation(x.fromRotationX(b.PI_OVER_TWO)),ui=new i,ci={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},hi="model/vnd.gltf.binary,model/vnd.gltf+json,model/gltf.binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01";le.prototype.getBuffer=function(e){return me(this.buffers[e.buffer],e.byteOffset,e.byteLength)},le.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},le.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},le.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},le.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},le.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return e&&t},le.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},c(ce.prototype,{gltf:{set:function(e){this._gltf=re(j(e))},get:function(){return this._gltf}},bgltf:{get:function(){return this._bgltf}}}),ce.prototype.makeReady=function(e,t){this.gltf=e,this._bgltf=t;for(var i=this.modelsToLoad,r=i.length,n=0;n<r;++n){var o=i[n];o.isDestroyed()||ue(o,this)}this.modelsToLoad=void 0,this.ready=!0};var di={};c(de.prototype,{gltf:{get:function(){return u(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._basePath}},boundingSphere:{get:function(){var e=this.modelMatrix;this.heightReference!==$.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);var t=A.getScale(e,ui),r=u(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;i.multiplyByScalar(t,r,t);var n=this._scaledBoundingSphere;return n.center=i.multiplyComponents(this._boundingSphere.center,t,n.center),n.radius=i.maximumComponent(t)*this._initialRadius,u(this._rtcCenter)&&i.add(this._rtcCenter,n.center,n.center),n}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},asynchronous:{get:function(){return this._asynchronous}},allowPicking:{get:function(){return this._allowPicking}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},pendingTextureLoads:{get:function(){return u(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=p.clone(e,this._distanceDisplayCondition)}}});var pi=Uint32Array.BYTES_PER_ELEMENT;de.silhouetteSupported=function(e){return pe(e.context)},de.fromGltf=function(e){var t=e.url,i=l(e.cacheKey,f(t));e=o(e),e.basePath=_(t),e.cacheKey=i;var r=new de(e);e.headers=u(e.headers)?o(e.headers):{},u(e.headers.Accept)||(e.headers.Accept=hi);var n=di[i];return u(n)?n.ready||(++n.count,n.modelsToLoad.push(r)):(n=new ce({ready:!1}),n.count=1,n.modelsToLoad.push(r),ue(r,n),di[i]=n,C(t,e.headers).then(function(e){var t=new Uint8Array(e);if(fe(t)){var i=_e(t);0!==i.binaryOffset&&(t=t.subarray(i.binaryOffset)),n.makeReady(i.glTF,t)}else{var r=v(t);n.makeReady(JSON.parse(r))}}).otherwise(Ce(r,"model",t))),r},de._gltfCache=di,de.prototype.getNode=function(e){var t=ge(this,"nodesByName",e);return u(t)?t.publicNode:void 0},de.prototype.getMesh=function(e){return ge(this,"meshesByName",e)},de.prototype.getMaterial=function(e){return ge(this,"materialsByName",e)};var mi=new i,fi=new i,_i=new i,gi=new D,vi=new i,yi=new i,Ci={MODEL:function(e,t){return function(){return e.model}},VIEW:function(e,t){return function(){return e.view}},PROJECTION:function(e,t){return function(){return e.projection}},MODELVIEW:function(e,t){return function(){return e.modelView}},CESIUM_RTC_MODELVIEW:function(e,t){var r=new A;return function(){return A.getTranslation(e.model,yi),i.add(yi,t._rtcCenter,yi),A.multiplyByPoint(e.view,yi,yi),A.setTranslation(e.modelView,yi,r)}},MODELVIEWPROJECTION:function(e,t){return function(){return e.modelViewProjection}},MODELINVERSE:function(e,t){return function(){return e.inverseModel}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t){return function(){return e.inverseModelView}},MODELVIEWPROJECTIONINVERSE:function(e,t){return function(){return e.inverseModelViewProjection}},MODELINVERSETRANSPOSE:function(e,t){return function(){return e.inverseTransposeModel}},MODELVIEWINVERSETRANSPOSE:function(e,t){return function(){return e.normal}},VIEWPORT:function(e,t){return function(){return e.viewportCartesian4}}};c(_t.prototype,{value:{get:function(){if(!u(this._value)){var e=this._model._rendererResources.textures[this._textureId];if(!u(e))return this._model._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),_t.prototype.clone=function(e,t){return e},_t.prototype.func=void 0;var wi={};wi[O.FLOAT]=ut,wi[O.FLOAT_VEC2]=ct,wi[O.FLOAT_VEC3]=ht,wi[O.FLOAT_VEC4]=dt,wi[O.INT]=ut,wi[O.INT_VEC2]=ct,wi[O.INT_VEC3]=ht,wi[O.INT_VEC4]=dt,wi[O.BOOL]=ut,wi[O.BOOL_VEC2]=ct,wi[O.BOOL_VEC3]=ht,wi[O.BOOL_VEC4]=dt,wi[O.FLOAT_MAT2]=pt,wi[O.FLOAT_MAT3]=mt,wi[O.FLOAT_MAT4]=ft,wi[O.SAMPLER_2D]=gt;var Si={MODEL:function(e,t,i){return function(){return i.computedMatrix}},VIEW:function(e,t,i){return function(){return e.view}},PROJECTION:function(e,t,i){return function(){return e.projection}},MODELVIEW:function(e,t,i){var r=new A;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r)}},CESIUM_RTC_MODELVIEW:function(e,t,i){var r=new A;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r),A.setTranslation(r,t._rtcCenterEye,r)}},MODELVIEWPROJECTION:function(e,t,i){var r=new A;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r),A.multiply(e._projection,r,r)}},MODELINVERSE:function(e,t,i){var r=new A;return function(){return A.inverse(i.computedMatrix,r)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,i){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,i){var r=new A,n=new A;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r),A.inverse(r,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,i){var r=new A,n=new A;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r),A.multiply(e._projection,r,r),A.inverse(r,n)}},MODELINVERSETRANSPOSE:function(e,t,i){var r=new A,n=new x;return function(){return A.inverse(i.computedMatrix,r),A.getRotation(r,n),x.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,i){var r=new A,n=new A,o=new x;return function(){return A.multiplyTransformation(e.view,i.computedMatrix,r),A.inverse(r,n),A.getRotation(n,o),x.transpose(o,o)}},VIEWPORT:function(e,t,i){return function(){return e.viewportCartesian4}}},Ei=[],bi=new A,Ti=new A,xi=0,Ai=new e,Pi=new i,Di=new n;ii.prototype.release=function(){if(0===--this.count)return u(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],ni(this),h(this)};var Mi=new i,Ii=new n;return de.prototype.update=function(e){if(e.mode!==ae.MORPHING){var t=e.context;if(this._defaultTexture=t.defaultTexture,this._state===ci.NEEDS_LOAD&&u(this.gltf)){var r,n=this.cacheKey;if(u(n)){t.cache.modelRendererResourceCache=l(t.cache.modelRendererResourceCache,{});var o=t.cache.modelRendererResourceCache;if(r=o[this.cacheKey],u(r)){if(!r.ready)return;++r.count,this._loadRendererResourcesFromCache=!0}else r=new ii(t,n),r.count=1,o[this.cacheKey]=r;this._cachedRendererResources=r}else r=new ii(t),r.count=1,this._cachedRendererResources=r;if(this._state=ci.LOADING,this._boundingSphere=ye(this.gltf),this._initialRadius=this._boundingSphere.radius,ti(this),this._state!==ci.FAILED){var a=this.gltf.extensions;u(a)&&u(a.CESIUM_RTC)&&(this._rtcCenter=i.fromArray(a.CESIUM_RTC.center),this._rtcCenterEye=new i),this._loadResources=new le,Oe(this)}}var s=this._loadResources,c=this._incrementallyLoadTextures,h=!1;if(this._state===ci.LOADING&&(It(this,e),(s.finished()||c&&s.finishedEverythingButTextureCreation())&&(this._state=ci.LOADED,h=!0)),u(s)&&this._state===ci.LOADED&&(c&&!h&&It(this,e),s.finished())){this._loadResources=void 0;var d=this._rendererResources,p=this._cachedRendererResources;p.buffers=d.buffers,p.vertexArrays=d.vertexArrays,p.programs=d.programs,p.pickPrograms=d.pickPrograms,p.silhouettePrograms=d.silhouettePrograms,p.textures=d.textures,p.samplers=d.samplers,p.renderStates=d.renderStates,p.ready=!0,this._normalAttributeName=Q(this.gltf,"NORMAL"),u(this._precreatedAttributes)&&(p.vertexArrays={}),this.releaseGltfJson&&ei(this)}var m=qt(this,e),f=Yt(this),_=Xt(this),g=!u(this.distanceDisplayCondition)||si(this,e),v=this.show&&g&&0!==this.scale&&(!_||m);if(v&&this._state===ci.LOADED||h){var y=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var C=this.modelMatrix,w=e.mode!==this._mode;this._mode=e.mode;var S=!A.equals(this._modelMatrix,C)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||w;if(S||h){A.clone(C,this._modelMatrix),ai(this),u(this._clampedModelMatrix)&&(C=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;var E=$t(this,e),T=this._computedModelMatrix;A.multiplyByUniformScale(C,E,T),A.multiplyTransformation(T,li,T)}(y||S||h)&&(Ot(this,S,h,e.mapProjection),this._dirty=!0,(y||h)&&Nt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,Lt(this)),Bt(this,t),Ft(this),Vt(this),kt(this),Gt(this,e),Qt(this,e)}if(h){var x=this;return void e.afterRender.push(function(){x._ready=!0,x._readyPromise.resolve(x)})}if(v&&!this._ignoreCommands){var P,D,M,I=e.commandList,R=e.passes,O=this._nodeCommands,N=O.length,L=e.mapProjection.ellipsoid.maximumRadius*b.PI;if(R.render){for(P=0;P<N;++P)if(D=O[P],D.show){var B=f?D.translucentCommand:D.command;if(B=m?D.silhouetteModelCommand:B,I.push(B),M=D.command.boundingVolume,e.mode===ae.SCENE2D&&(M.center.y+M.radius>L||M.center.y-M.radius<L)){var F=f?D.translucentCommand2D:D.command2D;F=m?D.silhouetteModelCommand2D:F,I.push(F)}}if(m)for(P=0;P<N;++P)D=O[P],D.show&&(I.push(D.silhouetteColorCommand),M=D.command.boundingVolume,e.mode===ae.SCENE2D&&(M.center.y+M.radius>L||M.center.y-M.radius<L)&&I.push(D.silhouetteColorCommand2D))}if(R.pick&&this.allowPicking)for(P=0;P<N;++P)if(D=O[P],D.show){var V=D.pickCommand;I.push(V),M=V.boundingVolume,e.mode===ae.SCENE2D&&(M.center.y+M.radius>L||M.center.y-M.radius<L)&&I.push(D.pickCommand2D)}}}},de.prototype.isDestroyed=function(){return!1},de.prototype.destroy=function(){u(this._precreatedAttributes)&&ri(this._rendererResources.vertexArrays),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release();for(var e=this._pickIds,t=e.length,i=0;i<t;++i)e[i].destroy();return ei(this),h(this)},de}),i("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/Model","../Scene/ModelAnimationLoop","../Scene/ShadowMode","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t,i){i.collectionChanged.addEventListener(m.prototype._onCollectionChanged,this),this._scene=t,this._primitives=t.primitives,this._entityCollection=i,this._modelHash={},this._entitiesToVisualize=new e,this._onCollectionChanged(i,i.values,[],[])}function f(e,t,i,n){var o=i[t.id];r(o)&&(n.removeAndDestroy(o.modelPrimitive),delete i[t.id])}function _(e,t){
var i=t[e.id];r(i)&&(i.nodeTransformationsScratch={})}function g(e){console.error(e)}var v=1,y=0,C=!0,w=h.ENABLED,S=l.NONE,E=i.RED,b=0,T=i.WHITE,x=s.HIGHLIGHT,A=.5,P=new i,D=new a,M=new a;return m.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,i=this._modelHash,n=this._primitives,o=0,s=t.length;o<s;o++){var l,h,d=t[o],m=d._model,f=i[d.id],_=d.isShowing&&d.isAvailable(e)&&p.getValueOrDefault(m._show,e,!0);if(_&&(h=d._getModelMatrix(e,D),l=p.getValueOrUndefined(m._uri,e),_=r(h)&&r(l)),_){var I=r(f)?f.modelPrimitive:void 0;if(r(I)&&l===f.uri||(r(I)&&(n.removeAndDestroy(I),delete i[d.id]),I=u.fromGltf({url:l,incrementallyLoadTextures:p.getValueOrDefault(m._incrementallyLoadTextures,e,C),scene:this._scene}),I.readyPromise.otherwise(g),I.id=d,n.add(I),f={modelPrimitive:I,uri:l,animationsRunning:!1,nodeTransformationsScratch:{},originalNodeMatrixHash:{}},i[d.id]=f),I.show=!0,I.scale=p.getValueOrDefault(m._scale,e,v),I.minimumPixelSize=p.getValueOrDefault(m._minimumPixelSize,e,y),I.maximumScale=p.getValueOrUndefined(m._maximumScale,e),I.modelMatrix=a.clone(h,I.modelMatrix),I.shadows=p.getValueOrDefault(m._shadows,e,w),I.heightReference=p.getValueOrDefault(m._heightReference,e,S),I.distanceDisplayCondition=p.getValueOrUndefined(m._distanceDisplayCondition,e),I.silhouetteColor=p.getValueOrDefault(m.silhouetteColor,e,E),I.silhouetteSize=p.getValueOrDefault(m.silhouetteSize,e,b),I.color=p.getValueOrDefault(m._color,e,T,P),I.colorBlendMode=p.getValueOrDefault(m._colorBlendMode,e,x),I.colorBlendAmount=p.getValueOrDefault(m._colorBlendAmount,e,A),I.ready){var R=p.getValueOrDefault(m._runAnimations,e,!0);f.animationsRunning!==R&&(R?I.activeAnimations.addAll({loop:c.REPEAT}):I.activeAnimations.removeAll(),f.animationsRunning=R);var O=p.getValueOrUndefined(m._nodeTransformations,e,f.nodeTransformationsScratch);if(r(O))for(var N=f.originalNodeMatrixHash,L=Object.keys(O),B=0,F=L.length;B<F;++B){var V=L[B],k=O[V];if(r(k)){var z=I.getNode(V);if(r(z)){var U=N[V];r(U)||(U=z.matrix.clone(),N[V]=U);var G=a.fromTranslationRotationScale(k,M);z.matrix=a.multiply(U,G,G)}}}}}else r(f)&&(f.modelPrimitive.show=!1)}return!0},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(m.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,i=this._primitives,r=e.length-1;r>-1;r--)f(this,e[r],t,i);return n(this)},m.prototype.getBoundingSphere=function(e,i){var n=this._modelHash[e.id];if(!r(n))return d.FAILED;var o=n.modelPrimitive;if(!r(o)||!o.show)return d.FAILED;if(!o.ready)return d.PENDING;if(o.heightReference===l.NONE)t.transform(o.boundingSphere,o.modelMatrix,i);else{if(!r(o._clampedModelMatrix))return d.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,i)}return d.DONE},m.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],r(a._model)&&r(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],r(a._model)&&r(a._position)?(_(a,l),s.set(a.id,a)):(f(this,a,l,u),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],f(this,a,l,u),s.remove(a.id)},m}),i("Shaders/PolylineCommon",[],function(){"use strict";return"void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance =  -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(previous.xyz - position.xyz, vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(next.xyz - position.xyz, vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),i("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Shaders/PolylineVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\nvarying vec2  v_st;\nvarying float v_width;\nvarying vec4  czm_pickColor;\nvoid main()\n{\nfloat texCoord = texCoordExpandAndBatchIndex.x;\nfloat expandDir = texCoordExpandAndBatchIndex.y;\nbool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\nfloat batchTableIndex = texCoordExpandAndBatchIndex.w;\nvec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\nfloat width = widthAndShow.x + 0.5;\nfloat show = widthAndShow.y;\nif (width < 1.0)\n{\nshow = 0.0;\n}\nvec4 pickColor = batchTable_getPickColor(batchTableIndex);\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\n#ifdef DISTANCE_DISPLAY_CONDITION\nvec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\nvec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\nvec3 centerLow = centerLowAndRadius.xyz;\nfloat radius = centerLowAndRadius.w;\nvec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nvec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\nlengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n}\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\nshow = 0.0;\n}\n#endif\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),i("Scene/Polyline",["../Core/arrayRemoveDuplicates","../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(a,s){a=n(a,n.EMPTY_OBJECT),this._show=n(a.show,!0),this._width=n(a.width,1),this._loop=n(a.loop,!1),this._distanceDisplayCondition=a.distanceDisplayCondition,this._material=a.material,o(this._material)||(this._material=h.fromType(h.ColorType,{color:new r(1,1,1,1)}));var l=a.positions;o(l)||(l=[]),this._positions=l,this._actualPositions=e(l,i.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=l.slice()),this._actualPositions.push(i.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=a.id;var d;o(s)&&(d=u.clone(s.modelMatrix)),this._modelMatrix=d,this._segments=c.wrapLongitude(this._actualPositions,d),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(C),this._polylineCollection=s,this._dirty=!1,this._pickId=void 0,this._boundingVolume=t.fromPoints(this._actualPositions),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new t}function p(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;o(i)&&(i._updatePolyline(e,t),e._dirty=!0)}var m=d.POSITION_INDEX=0,f=d.SHOW_INDEX=1,_=d.WIDTH_INDEX=2,g=d.MATERIAL_INDEX=3,v=d.POSITION_SIZE_INDEX=4,y=d.DISTANCE_DISPLAY_CONDITION=5,C=d.NUMBER_OF_PROPERTIES=6;return a(d.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,p(this,f))}},positions:{get:function(){return this._positions},set:function(r){var n=e(r,i.equalsEpsilon);this._loop&&n.length>2&&(n===r&&(n=r.slice()),n.push(i.clone(n[0]))),this._actualPositions.length===n.length&&this._actualPositions.length===this._length||p(this,v),this._positions=r,this._actualPositions=n,this._length=n.length,this._boundingVolume=t.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),p(this,m),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,p(this,g))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,p(this,_))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var t=this._actualPositions;e?t.length>2&&!i.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(i.clone(t[0]))):t.length>2&&i.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,p(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){l.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition),p(this,y))}}}),d.prototype.update=function(){var e=u.IDENTITY;o(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var i=this._segments.positions.length,r=this._segments.lengths,n=this._propertiesChanged[m]>0||this._propertiesChanged[v]>0;if(u.equals(e,this._modelMatrix)&&!n||(this._segments=c.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=t.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=e,this._segments.positions.length!==i)p(this,v);else for(var a=r.length,s=0;s<a;++s)if(r[s]!==this._segments.lengths[s]){p(this,v);break}},d.prototype.getPickId=function(e){return o(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},d.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;t<C-1;++t)e[t]=0},d.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},d}),i("Scene/PolylineCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/Plane","../Core/RuntimeError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BatchTable","./BlendingState","./Material","./Polyline","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L){"use strict";function B(e){e=s(e,s.EMPTY_OBJECT),this.modelMatrix=_.clone(s(e.modelMatrix,_.IDENTITY)),this._modelMatrix=_.clone(_.IDENTITY),this.debugShowBoundingVolume=s(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._pickCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(re),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:C.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1}function F(e,t){l(e._batchTable)&&e._batchTable.destroy();var i=[{functionName:"batchTable_getWidthAndShow",componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:a.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:a.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:a.FLOAT,componentsPerAttribute:2}];e._batchTable=new I(t,i,e._polylines.length)}function V(t,i,r,n,o){for(var a=i.context,s=i.commandList,u=r.length,c=0,h=!0,d=t._vertexArrays,p=t.debugShowBoundingVolume,m=t._batchTable,f=m.getUniformMapCallback(),_=d.length,g=0;g<_;++g)for(var v=d[g],y=v.buckets,C=y.length,w=0;w<C;++w){for(var b,T,x,A=y[w],P=A.offset,D=o?A.bucket.shaderProgram:A.bucket.pickShaderProgram,M=A.bucket.polylines,I=M.length,R=0,O=0;O<I;++O){var N=M[O],B=U(N._material);if(B!==b){if(l(b)&&R>0){var F=T.isTranslucent();c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=v.va,x.renderState=F?t._translucentRS:t._opaqueRS,x.pass=F?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=f(T._uniforms),x.count=R,x.offset=P,P+=R,R=0,h=!0,s.push(x)}T=N._material,T.update(a),b=B}for(var V=N._locatorBuckets,k=V.length,z=0;z<k;++z){var G=V[z];G.locator===A&&(R+=G.count)}var W;i.mode===L.SCENE3D?W=N._boundingVolumeWC:i.mode===L.COLUMBUS_VIEW?W=N._boundingVolume2D:i.mode===L.SCENE2D?l(N._boundingVolume2D)&&(W=e.clone(N._boundingVolume2D,ue),W.center.x=0):l(N._boundingVolumeWC)&&l(N._boundingVolume2D)&&(W=e.union(N._boundingVolumeWC,N._boundingVolume2D,ue)),h?(h=!1,e.clone(W,le)):e.union(W,le,le)}l(b)&&R>0&&(c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=v.va,x.renderState=T.isTranslucent()?t._translucentRS:t._opaqueRS,x.pass=T.isTranslucent()?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=f(T._uniforms),x.count=R,x.offset=P,h=!0,s.push(x)),b=void 0}r.length=c}function k(e){var t=!1,i=e._propertiesChanged,r=e._positionBufferUsage;return i[$]?r.bufferUsage!==C.STREAM_DRAW?(t=!0,r.bufferUsage=C.STREAM_DRAW,r.frameCount=100):r.frameCount=100:r.bufferUsage!==C.STATIC_DRAW&&(0===r.frameCount?(t=!0,r.bufferUsage=C.STATIC_DRAW):r.frameCount--),t}function z(e,t,i){e._createVertexArray=!1,q(e),j(e),G(e);var r,n,o=[[]],s=o[0],u=e._batchTable,c=[0],h=0,d=[[]],m=0,_=e._polylineBuckets;for(r in _)_.hasOwnProperty(r)&&(n=_[r],n.updateShader(t,u),m+=n.lengthOfPositions);if(m>0){var g,v=e._mode,w=new Float32Array(6*m*3),S=new Float32Array(4*m),E=0,b=0,T=0;for(r in _)if(_.hasOwnProperty(r)){n=_[r],n.write(w,S,E,b,T,u,t,i),v===L.MORPHING&&(l(g)||(g=new Float32Array(6*m*3)),n.writeForMorph(g,E));var x=n.lengthOfPositions;E+=6*x*3,b+=4*x,T+=4*x,h=n.updateIndices(o,c,d,h)}var P=e._positionBufferUsage.bufferUsage,D=C.STATIC_DRAW;e._positionBuffer=y.createVertexBuffer({context:t,typedArray:w,usage:P});var M;l(g)&&(M=y.createVertexBuffer({context:t,typedArray:g,usage:P})),e._texCoordExpandAndBatchIndexBuffer=y.createVertexBuffer({context:t,typedArray:S,usage:D});for(var I=3*Float32Array.BYTES_PER_ELEMENT,R=4*Float32Array.BYTES_PER_ELEMENT,O=0,N=o.length,B=0;B<N;++B)if(s=o[B],s.length>0){var F=new Uint16Array(s),V=y.createIndexBuffer({context:t,typedArray:F,usage:C.STATIC_DRAW,indexDatatype:p.UNSIGNED_SHORT});O+=c[B];var k,z,U,W,H=6*(B*(I*f.SIXTY_FOUR_KILOBYTES)-O*I),Y=I+H,X=I+Y,Z=I+X,K=I+Z,Q=I+K,J=B*(R*f.SIXTY_FOUR_KILOBYTES)-O*R,$=[{index:ne.position3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:H,strideInBytes:6*I},{index:ne.position3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.position2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:H,strideInBytes:6*I},{index:ne.position2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:a.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}];v===L.SCENE3D?(k=e._positionBuffer,z="vertexBuffer",U=ce,W="value"):v===L.SCENE2D||v===L.COLUMBUS_VIEW?(k=ce,z="value",U=e._positionBuffer,W="vertexBuffer"):(k=M,z="vertexBuffer",U=e._positionBuffer,W="vertexBuffer"),$[0][z]=k,$[1][z]=k,$[2][W]=U,$[3][W]=U,$[4][z]=k,$[5][z]=k,$[6][W]=U,$[7][W]=U,$[8][z]=k,$[9][z]=k,$[10][W]=U,$[11][W]=U;var ee=new A({context:t,attributes:$,indexBuffer:V});e._vertexArrays.push({va:ee,buckets:d[B]})}}}function U(e){var t=O._uniformList[e.type],i=t.length;he.length=2*i;for(var r=0,n=0;n<i;++n){var o=t[n];he[r]=o,he[r+1]=e._uniforms[o](),r+=2}return e.type+":"+JSON.stringify(he)}function G(e){for(var t=e._mode,i=e._modelMatrix,r=e._polylineBuckets={},n=e._polylines,o=n.length,a=0;a<o;++a){var s=n[a];if(s._actualPositions.length>1){s.update();var u=s.material,c=r[u.type];l(c)||(c=r[u.type]=new Z(u,t,i)),c.addPolyline(s)}}}function W(e,t){var i=t.mode;e._mode===i&&_.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=_.clone(e.modelMatrix),e._createVertexArray=!0)}function H(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],i=e._polylines.length,r=0,n=0;r<i;++r){var o=e._polylines[r];l(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function q(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)if(l(t[r])){var n=t[r]._bucket;l(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function j(e){for(var t=e._vertexArrays.length,i=0;i<t;++i)e._vertexArrays[i].va.destroy();e._vertexArrays.length=0}function Y(e){for(var t=e._polylines,i=t.length,r=0;r<i;++r)l(t[r])&&t[r]._destroy()}function X(e,t,i){this.count=e,this.offset=t,this.bucket=i}function Z(e,t,i){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.modelMatrix=i}function K(e){return i.dot(i.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(g.ORIGIN_ZX_PLANE)===m.INTERSECTING}var Q=N.SHOW_INDEX,J=N.WIDTH_INDEX,$=N.POSITION_INDEX,ee=N.MATERIAL_INDEX,te=N.POSITION_SIZE_INDEX,ie=N.DISTANCE_DISPLAY_CONDITION,re=N.NUMBER_OF_PROPERTIES,ne={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};u(B.prototype,{length:{get:function(){return H(this),this._polylines.length}}}),B.prototype.add=function(e){var t=new N(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t},B.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){var t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),t.pickShaderProgram=t.pickShaderProgram&&t.pickShaderProgram.destroy()}return e._destroy(),!0}return!1},B.prototype.removeAll=function(){q(this),Y(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},B.prototype.contains=function(e){return l(e)&&e._polylineCollection===this},B.prototype.get=function(e){return H(this),this._polylines[e]};var oe=new d,ae=new r,se=new t;B.prototype.update=function(e){if(H(this),0!==this._polylines.length){W(this,e);var i,n=e.context,o=e.mapProjection,a=this._propertiesChanged;if(this._createBatchTable){if(0===w.maximumVertexTextureImageUnits)throw new v("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");F(this,n),this._createBatchTable=!1}if(this._createVertexArray||k(this))z(this,n,o);else if(this._polylinesUpdated){var s=this._polylinesToUpdate;if(this._mode!==L.SCENE3D)for(var u=s.length,c=0;c<u;++c)i=s[c],i.update();if(a[te]||a[ee])z(this,n,o);else for(var h=s.length,p=this._polylineBuckets,m=0;m<h;++m){i=s[m],a=i._propertiesChanged;var f=i._bucket,g=0;for(var y in p)if(p.hasOwnProperty(y)){if(p[y]===f){a[$]&&f.writeUpdate(g,i,this._positionBuffer,o);break}g+=p[y].lengthOfPositions}if((a[Q]||a[J])&&this._batchTable.setBatchedAttribute(i._index,0,new t(i._width,i._show)),this._batchTable.attributes.length>2){if(a[$]||a[te]){var C=e.mode===L.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,S=d.fromCartesian(C.center,oe),E=r.fromElements(S.low.x,S.low.y,S.low.z,C.radius,ae);this._batchTable.setBatchedAttribute(i._index,2,S.high),this._batchTable.setBatchedAttribute(i._index,3,E)}if(a[ie]){var T=se;T.x=0,T.y=Number.MAX_VALUE;var x=i.distanceDisplayCondition;l(x)&&(T.x=x.near,T.x=x.far),this._batchTable.setBatchedAttribute(i._index,4,T)}}i._clean()}s.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(var A=0;A<re;++A)a[A]=0;var P=_.IDENTITY;e.mode===L.SCENE3D&&(P=this.modelMatrix);var D=e.passes,M=0!==e.morphTime;if(l(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===M||(this._opaqueRS=b.fromCache({depthMask:M,depthTest:{enabled:M}})),l(this._translucentRS)&&this._translucentRS.depthTest.enabled===M||(this._translucentRS=b.fromCache({blending:R.ALPHA_BLEND,depthMask:!M,depthTest:{enabled:M}})),this._batchTable.update(e),D.render){var I=this._colorCommands;V(this,e,I,P,!0)}if(D.pick){var O=this._pickCommands;V(this,e,O,P,!1)}}};var le=new e,ue=new e;B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){return j(this),q(this),Y(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),c(this)};var ce=[0,0,0],he=[];B.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},Z.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},Z.prototype.updateShader=function(e,t){if(!l(this.shaderProgram)){var i=["DISTANCE_DISPLAY_CONDITION"],r=t.getVertexShaderCallback()(M),n=new x({defines:i,sources:[P,r]}),o=new x({sources:[this.material.shaderSource,D]}),a=new x({sources:o.sources,pickColorQualifier:"varying"});this.shaderProgram=T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:ne}),this.pickShaderProgram=T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:ne})}},Z.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===L.SCENE3D||!K(e))return t=e._actualPositions.length,4*t-4;var i=0,r=e._segments.lengths;t=r.length;for(var n=0;n<t;++n)i+=4*r[n]-4;return i};var de=new i,pe=new i,me=new i,fe=new i,_e=new r,ge=new t;Z.prototype.write=function(e,t,n,a,s,u,c,h){for(var p=this.mode,m=h.ellipsoid.maximumRadius*f.PI,_=this.polylines,g=_.length,v=0;v<g;++v){for(var y,C=_[v],w=C.width,S=C.show&&w>0,E=C._index,b=this.getSegments(C,h),T=b.positions,x=b.lengths,A=T.length,P=C.getPickId(c).color,D=0,M=0,I=0;I<A;++I){0===I?C._loop?y=T[A-2]:(y=fe,i.subtract(T[0],T[1],y),i.add(T[0],y,y)):y=T[I-1],i.clone(y,pe),i.clone(T[I],de),I===A-1?C._loop?y=T[1]:(y=fe,i.subtract(T[A-1],T[A-2],y),i.add(T[A-1],y,y)):y=T[I+1],i.clone(y,me);var R=x[D];I===M+R&&(M+=R,++D);var O=I-M===0,N=I===M+x[D]-1;p===L.SCENE2D&&(pe.z=0,de.z=0,me.z=0),p!==L.SCENE2D&&p!==L.MORPHING||(O||N)&&m-Math.abs(de.x)<1&&((de.x<0&&pe.x>0||de.x>0&&pe.x<0)&&i.clone(de,pe),(de.x<0&&me.x>0||de.x>0&&me.x<0)&&i.clone(de,me));for(var B=O?2:0,F=N?2:4,V=B;V<F;++V){d.writeElements(de,e,n),d.writeElements(pe,e,n+6),d.writeElements(me,e,n+12);var k=V-2<0?-1:1;t[s]=I/(A-1),t[s+1]=2*(V%2)-1,t[s+2]=k,t[s+3]=E,n+=18,s+=4}}var z=_e;z.x=o.floatToByte(P.red),z.y=o.floatToByte(P.green),z.z=o.floatToByte(P.blue),z.w=o.floatToByte(P.alpha);var U=ge;U.x=w,U.y=S?1:0;var G=p===L.SCENE2D?C._boundingVolume2D:C._boundingVolumeWC,W=d.fromCartesian(G.center,oe),H=W.high,q=r.fromElements(W.low.x,W.low.y,W.low.z,G.radius,ae),j=se;j.x=0,j.y=Number.MAX_VALUE;var Y=C.distanceDisplayCondition;l(Y)&&(j.x=Y.near,j.y=Y.far),u.setBatchedAttribute(E,0,U),u.setBatchedAttribute(E,1,z),u.attributes.length>2&&(u.setBatchedAttribute(E,2,H),u.setBatchedAttribute(E,3,q),u.setBatchedAttribute(E,4,j))}};var ve=new i,ye=new i,Ce=new i,we=new i;Z.prototype.writeForMorph=function(e,t){for(var r=this.modelMatrix,n=this.polylines,o=n.length,a=0;a<o;++a)for(var s=n[a],l=s._segments.positions,u=s._segments.lengths,c=l.length,h=0,p=0,m=0;m<c;++m){var f;0===m?s._loop?f=l[c-2]:(f=we,i.subtract(l[0],l[1],f),i.add(l[0],f,f)):f=l[m-1],f=_.multiplyByPoint(r,f,ye);var g,v=_.multiplyByPoint(r,l[m],ve);m===c-1?s._loop?g=l[1]:(g=we,i.subtract(l[c-1],l[c-2],g),i.add(l[c-1],g,g)):g=l[m+1],g=_.multiplyByPoint(r,g,Ce);var y=u[h];m===p+y&&(p+=y,++h);for(var C=m-p===0,w=m===p+u[h]-1,S=C?2:0,E=w?2:4,b=S;b<E;++b)d.writeElements(v,e,t),d.writeElements(f,e,t+6),d.writeElements(g,e,t+12),t+=18}};var Se=new Array(1);Z.prototype.updateIndices=function(e,t,i,r){var n=i.length-1,o=new X(0,r,this);i[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,h=0;h<c;++h){var d=u[h];d._locatorBuckets=[];var p;if(this.mode===L.SCENE3D){p=Se;var m=d._actualPositions.length;if(!(m>0))continue;p[0]=m}else p=d._segments.lengths;var _=p.length;if(_>0){for(var g=0,v=0;v<_;++v)for(var y=p[v]-1,C=0;C<y;++C)l+4>=f.SIXTY_FOUR_KILOBYTES-2&&(d._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,r=0,o=new X(0,0,this),i[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,r+=6,l+=4;d._locatorBuckets.push({locator:o,count:g}),l+4>=f.SIXTY_FOUR_KILOBYTES-2&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new X(0,0,this),i[++n]=[o])}d._clean()}return o.count=a,r},Z.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;n<r;++n){var o=t[n];if(o===e)break;i+=o._actualLength}return i};var Ee={positions:void 0,lengths:void 0},be=new Array(1),Te=new i,xe=new n;Z.prototype.getSegments=function(t,r){var n=t._actualPositions;if(this.mode===L.SCENE3D)return be[0]=n.length,Ee.positions=n,Ee.lengths=be,Ee;K(t)&&(n=t._segments.positions);for(var o,a=r.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=Te,h=0;h<u;++h)o=n[h],c=_.multiplyByPoint(l,o,c),s.push(r.project(a.cartesianToCartographic(c,xe)));if(s.length>0){t._boundingVolume2D=e.fromPoints(s,t._boundingVolume2D);var d=t._boundingVolume2D.center;t._boundingVolume2D.center=new i(d.z,d.x,d.y)}return Ee.positions=s,Ee.lengths=t._segments.lengths,Ee};var Ae;return Z.prototype.writeUpdate=function(e,t,r,n){var o=this.mode,a=n.ellipsoid.maximumRadius*f.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);var u=Ae,c=6*s*3;!l(u)||u.length<c?u=Ae=new Float32Array(c):u.length>c&&(u=new Float32Array(u.buffer,0,c));var h,p=this.getSegments(t,n),m=p.positions,_=p.lengths,g=0,v=0,y=0;s=m.length;for(var C=0;C<s;++C){0===C?t._loop?h=m[s-2]:(h=fe,i.subtract(m[0],m[1],h),i.add(m[0],h,h)):h=m[C-1],i.clone(h,pe),i.clone(m[C],de),C===s-1?t._loop?h=m[1]:(h=fe,i.subtract(m[s-1],m[s-2],h),i.add(m[s-1],h,h)):h=m[C+1],i.clone(h,me);var w=_[v];C===y+w&&(y+=w,++v);var S=C-y===0,E=C===y+_[v]-1;o===L.SCENE2D&&(pe.z=0,de.z=0,me.z=0),o!==L.SCENE2D&&o!==L.MORPHING||(S||E)&&a-Math.abs(de.x)<1&&((de.x<0&&pe.x>0||de.x>0&&pe.x<0)&&i.clone(de,pe),(de.x<0&&me.x>0||de.x>0&&me.x<0)&&i.clone(de,me));for(var b=S?2:0,T=E?2:4,x=b;x<T;++x)d.writeElements(de,u,g),d.writeElements(pe,u,g+6),d.writeElements(me,u,g+12),g+=18}r.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e)}},B}),i("DataSources/ScaledPositionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a){
"use strict";function s(e){this._definitionChanged=new n,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}return t(s.prototype,{isConstant:{get:function(){return a.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return e(this._value)?this._value.referenceFrame:o.FIXED}}}),s.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},s.prototype.setValue=function(t){this._value!==t&&(this._value=t,e(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),e(t)&&(this._removeSubscription=t.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},s.prototype.getValueInReferenceFrame=function(t,i,n){if(e(this._value))return n=this._value.getValueInReferenceFrame(t,i,n),e(n)?r.WGS84.scaleToGeodeticSurface(n,n):void 0},s.prototype.equals=function(e){return this===e||e instanceof s&&this._value===e._value},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),i("DataSources/PathVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/JulianDate","../Core/Matrix3","../Core/Matrix4","../Core/ReferenceFrame","../Core/TimeInterval","../Core/Transforms","../Scene/PolylineCollection","../Scene/SceneMode","./CompositePositionProperty","./ConstantPositionProperty","./MaterialProperty","./Property","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionPositionProperty"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";function w(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function S(e,t,r,n,a,s,l,u,c){var h,d=u;h=e.getValueInReferenceFrame(t,s,c[d]),i(h)&&(c[d++]=h);for(var p,m,f,_=!i(a)||o.lessThanOrEquals(a,t)||o.greaterThanOrEquals(a,r),g=0,v=n.length,y=n[g],C=r,w=!1;g<v;){if(!_&&o.greaterThanOrEquals(y,a)&&(h=e.getValueInReferenceFrame(a,s,c[d]),i(h)&&(c[d++]=h),_=!0),o.greaterThan(y,t)&&o.lessThan(y,C)&&!y.equals(a)&&(h=e.getValueInReferenceFrame(y,s,c[d]),i(h)&&(c[d++]=h)),g<v-1){if(l>0&&!w){var S=n[g+1],E=o.secondsDifference(S,y);w=E>l,w&&(p=Math.ceil(E/l),m=0,f=E/Math.max(p,2),p=Math.max(p-1,1))}if(w&&m<p){y=o.addSeconds(y,f,new o),m++;continue}}w=!1,g++,y=n[g]}return h=e.getValueInReferenceFrame(r,s,c[d]),i(h)&&(c[d++]=h),d}function E(e,t,r,n,a,s,l,u){for(var c,h=0,d=l,p=t,m=Math.max(s,60),f=!i(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,r);o.lessThan(p,r);)!f&&o.greaterThanOrEquals(p,n)&&(f=!0,c=e.getValueInReferenceFrame(n,a,u[d]),i(c)&&(u[d]=c,d++)),c=e.getValueInReferenceFrame(p,a,u[d]),i(c)&&(u[d]=c,d++),h++,p=o.addSeconds(t,m*h,new o);return c=e.getValueInReferenceFrame(r,a,u[d]),i(c)&&(u[d]=c,d++),d}function b(e,t,r,n,a,s,l,c){L.start=t,L.stop=r;for(var h=l,d=e.intervals,p=0;p<d.length;p++){var m=d.get(p);if(!u.intersect(m,L,O).isEmpty){var f=m.start;m.isStartIncluded||(f=m.isStopIncluded?m.stop:o.addSeconds(m.start,o.secondsDifference(m.stop,m.start)/2,new o));var _=e.getValueInReferenceFrame(f,a,c[h]);i(_)&&(c[h]=_,h++)}}return h}function T(e,t,r,n,o,a,s,l){var u=e.getValueInReferenceFrame(t,o,l[s]);return i(u)&&(l[s++]=u),s}function x(e,t,i,r,n,a,s,l){N.start=t,N.stop=i;for(var c=s,h=e.intervals,d=0;d<h.length;d++){var p=h.get(d);if(!u.intersect(p,N,O).isEmpty){var m=p.start,f=p.stop,_=t;o.greaterThan(m,_)&&(_=m);var g=i;o.lessThan(f,g)&&(g=f),c=A(p.data,_,g,r,n,a,c,l)}}return c}function A(e,t,i,r,n,o,a,s){for(var l=e;l instanceof g||l instanceof y;)l instanceof g&&(l=l.resolvedProperty),l instanceof y&&(l=l._value);if(l instanceof v){var u=l._property._times;a=S(e,t,i,u,r,n,o,a,s)}else a=l instanceof p?x(e,t,i,r,n,o,a,s):l instanceof C?b(e,t,i,r,n,o,a,s):l instanceof m?T(e,t,i,r,n,o,a,s):E(e,t,i,r,n,o,a,s);return a}function P(e,t,r,n,o,a,s){i(s)||(s=[]);var l=A(e,t,r,n,o,a,0,s);return s.length=l,s}function D(e,t){this._unusedIndexes=[],this._polylineCollection=new h,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function M(t,i){i.collectionChanged.addEventListener(M.prototype._onCollectionChanged,this),this._scene=t,this._updaters={},this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}var I=60,R=1,O=new u,N=new u,L=new u,B=new a;return D.prototype.update=function(e){if(this._referenceFrame===l.INERTIAL){var r=c.computeIcrfToFixedMatrix(e,B);i(r)||(r=c.computeTemeToPseudoFixedMatrix(e,B)),s.fromRotationTranslation(r,t.ZERO,this._polylineCollection.modelMatrix)}},D.prototype.updateObject=function(e,t){var r,n,a=t.entity,s=a._path,l=a._position,u=s._show,c=t.polyline,h=a.isShowing&&(!i(u)||u.getValue(e));if(h){var d=_.getValueOrUndefined(s._leadTime,e),p=_.getValueOrUndefined(s._trailTime,e),m=a._availability,g=i(m),v=i(d),y=i(p);if(h=g||v&&y){if(y&&(r=o.addSeconds(e,-p,new o)),v&&(n=o.addSeconds(e,d,new o)),g){var C=m.start,w=m.stop;y&&!o.greaterThan(C,r)||(r=C),v&&!o.lessThan(w,n)||(n=w)}h=o.lessThan(r,n)}}if(!h)return void(i(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0));if(!i(c)){var S=this._unusedIndexes,E=S.length;if(E>0){var b=S.pop();c=this._polylineCollection.get(b),t.index=b}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var T=_.getValueOrDefault(s._resolution,e,I);c.show=!0,c.positions=P(l,r,n,e,this._referenceFrame,T,c.positions.slice()),c.material=f.getValue(e,s._material,c.material),c.width=_.getValueOrDefault(s._width,e,R),c.distanceDisplayCondition=_.getValueOrUndefined(s._distanceDisplayCondition,e,c.distanceDisplayCondition)},D.prototype.removeObject=function(e){var t=e.polyline;i(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},D.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),r(this)},M.prototype.update=function(e){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].update(e);for(var n=this._items.values,o=0,a=n.length;o<a;o++){var s=n[o],u=s.entity,c=u._position,h=s.updater,p=l.FIXED;this._scene.mode===d.SCENE3D&&(p=c.referenceFrame);var m=this._updaters[p];h===m&&i(m)?m.updateObject(e,s):(i(h)&&h.removeObject(s),i(m)||(m=new D(this._scene,p),m.update(e),this._updaters[p]=m),s.updater=m,i(m)&&m.updateObject(e,s))}return!0},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(M.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return r(this)},M.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],i(a._path)&&i(a._position)&&l.set(a.id,new w(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._path)&&i(a._position)?l.contains(a.id)||l.set(a.id,new w(a)):(s=l.get(a.id),i(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=r.length-1;o>-1;o--)a=r[o],s=l.get(a.id),i(s)&&(i(s.updater)&&s.updater.removeObject(s),l.remove(a.id))},M._subSample=P,M}),i("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function d(t,i){i.collectionChanged.addEventListener(d.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function p(e,t,i){if(r(e)){var n=e.pointPrimitive;if(r(n))return e.pointPrimitive=void 0,void i.removePoint(t);var o=e.billboard;r(o)&&(e.billboard=void 0,i.removeBillboard(t))}}function m(e,t,i,r,n){return function(o){var a=document.createElement("canvas"),s=n+2*r;a.height=a.width=s;var l=a.getContext("2d");return l.clearRect(0,0,s,s),0!==r&&(l.beginPath(),l.arc(s/2,s/2,s/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=i,l.fill(),e<1&&(l.save(),l.globalCompositeOperation="destination-out",l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle="black",l.fill(),l.restore())),l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=t,l.fill(),a}}var f=i.WHITE,_=i.BLACK,g=0,v=1,y=new i,C=new t,w=new i,S=new s,E=new s,b=new a;return d.prototype.update=function(e){for(var t=this._items.values,n=this._cluster,o=0,a=t.length;o<a;o++){var s=t[o],u=s.entity,h=u._point,d=s.pointPrimitive,T=s.billboard,x=c.getValueOrDefault(h._heightReference,e,l.NONE),A=u.isShowing&&u.isAvailable(e)&&c.getValueOrDefault(h._show,e,!0);if(A&&(C=c.getValueOrUndefined(u._position,e,C),A=r(C)),A){c.isConstant(u._position)||(n._clusterDirty=!0);var P=!1;if(x===l.NONE||r(T)?x!==l.NONE||r(d)||(r(T)&&(p(s,u,n),T=void 0),d=n.getPoint(u),d.id=u,s.pointPrimitive=d):(r(d)&&(p(s,u,n),d=void 0),T=n.getBillboard(u),T.id=u,T.image=void 0,s.billboard=T,P=!0),r(d))d.show=!0,d.position=C,d.scaleByDistance=c.getValueOrUndefined(h._scaleByDistance,e,S),d.translucencyByDistance=c.getValueOrUndefined(h._translucencyByDistance,e,E),d.color=c.getValueOrDefault(h._color,e,f,y),d.outlineColor=c.getValueOrDefault(h._outlineColor,e,_,w),d.outlineWidth=c.getValueOrDefault(h._outlineWidth,e,g),d.pixelSize=c.getValueOrDefault(h._pixelSize,e,v),d.distanceDisplayCondition=c.getValueOrUndefined(h._distanceDisplayCondition,e,b);else{T.show=!0,T.position=C,T.scaleByDistance=c.getValueOrUndefined(h._scaleByDistance,e,S),T.translucencyByDistance=c.getValueOrUndefined(h._translucencyByDistance,e,E),T.distanceDisplayCondition=c.getValueOrUndefined(h._distanceDisplayCondition,e,b),T.heightReference=x;var D=c.getValueOrDefault(h._color,e,f,y),M=c.getValueOrDefault(h._outlineColor,e,_,w),I=Math.round(c.getValueOrDefault(h._outlineWidth,e,g)),R=Math.max(1,Math.round(c.getValueOrDefault(h._pixelSize,e,v)));if(I>0?(T.scale=1,P=P||I!==s.outlineWidth||R!==s.pixelSize||!i.equals(D,s.color)||!i.equals(M,s.outlineColor)):(T.scale=R/50,R=50,P=P||I!==s.outlineWidth||!i.equals(D,s.color)||!i.equals(M,s.outlineColor)),P){s.color=i.clone(D,s.color),s.outlineColor=i.clone(M,s.outlineColor),s.pixelSize=R,s.outlineWidth=I;var O=D.alpha,N=D.toCssColorString(),L=M.toCssColorString(),B=JSON.stringify([N,R,L,I]);T.setImage(B,m(O,N,L,I,R))}}}else p(s,u,n)}return!0},d.prototype.getBoundingSphere=function(e,i){var n=this._items.get(e.id);if(!r(n)||!r(n.pointPrimitive)&&!r(n.billboard))return u.FAILED;if(r(n.pointPrimitive))i.center=t.clone(n.pointPrimitive.position,i.center);else{var o=n.billboard;if(!r(o._clampedPosition))return u.PENDING;i.center=t.clone(o._clampedPosition,i.center)}return i.radius=0,u.DONE},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return n(this)},d.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._items,l=this._cluster;for(o=t.length-1;o>-1;o--)a=t[o],r(a._point)&&r(a._position)&&s.set(a.id,new h(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._point)&&r(a._position)?s.contains(a.id)||s.set(a.id,new h(a)):(p(s.get(a.id),a,l),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],p(s.get(a.id),a,l),s.remove(a.id)},d}),i("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/oneTimeWarning","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0}function D(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(D.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new P(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function M(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new P(i._entity)}var I=new E(e.WHITE),R=new b(!0),O=new b(!0),N=new b(!1),L=new b(e.BLACK),B=new b(S.DISABLED),F=new b(new s),V=new e;return n(D,{perInstanceColorAppearanceType:{value:C},materialAppearanceType:{value:y}}),n(D.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),D.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},D.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},D.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new g(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),d=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof E){var p=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(p=this._materialProperty.color.getValue(i)),o=t.fromColor(p),n={show:u,distanceDisplayCondition:d,color:o}}else n={show:u,distanceDisplayCondition:d};return new c({id:a,geometry:new m(this._options),attributes:n})},D.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=A.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new _(this._options),attributes:{show:new g(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._entitySubscription(),o(this)},D.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polygon"===t){var a=this._entity.polygon;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.perPositionHeight,c=r(u)&&(!u.isConstant||u.getValue(d.MINIMUM_VALUE)),m=a.outline,_=r(m);if(_&&m.isConstant&&(_=m.getValue(d.MINIMUM_VALUE)),!l&&!_)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=a.hierarchy,w=a.show;if(r(w)&&w.isConstant&&!w.getValue(d.MINIMUM_VALUE)||!r(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var S=i(a.material,I),b=S instanceof E;this._materialProperty=S,this._fillProperty=i(s,O),this._showProperty=i(w,R),this._showOutlineProperty=i(a.outline,N),this._outlineColorProperty=_?i(a.outlineColor,L):void 0,this._shadowsProperty=i(a.shadows,B),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,F);var T=a.height,x=a.extrudedHeight,P=a.granularity,D=a.stRotation,M=a.outlineWidth,V=l&&!r(T)&&!r(x)&&b&&!c&&v.isSupported(this._scene);_&&V&&(p(p.geometryOutlines),_=!1);var k=a.perPositionHeight,z=a.closeTop,U=a.closeBottom;if(this._fillEnabled=l,this._onTerrain=V,this._outlineEnabled=_,g.isConstant&&A.isConstant(T)&&A.isConstant(x)&&A.isConstant(P)&&A.isConstant(D)&&A.isConstant(M)&&A.isConstant(u)&&A.isConstant(k)&&A.isConstant(z)&&A.isConstant(U)&&(!V||A.isConstant(S))){var G=this._options;G.vertexFormat=b?C.VERTEX_FORMAT:y.MaterialSupport.TEXTURED.vertexFormat;var W=g.getValue(d.MINIMUM_VALUE);h(W)&&(W=new f(W));var H=A.getValueOrUndefined(T,d.MINIMUM_VALUE),q=A.getValueOrDefault(z,d.MINIMUM_VALUE,!0),j=A.getValueOrDefault(U,d.MINIMUM_VALUE,!0),Y=A.getValueOrUndefined(x,d.MINIMUM_VALUE);G.polygonHierarchy=W,G.height=H,G.extrudedHeight=Y,G.granularity=A.getValueOrUndefined(P,d.MINIMUM_VALUE),G.stRotation=A.getValueOrUndefined(D,d.MINIMUM_VALUE),G.perPositionHeight=A.getValueOrUndefined(k,d.MINIMUM_VALUE),G.closeTop=q,G.closeBottom=j,this._outlineWidth=A.getValueOrDefault(M,d.MINIMUM_VALUE,1),this._isClosed=r(Y)&&Y!==H&&q&&j,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},D.prototype.createDynamicUpdater=function(e,t){return new M(e,t,this)},M.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.polygon;if(l.isShowing&&l.isAvailable(i)&&A.getValueOrDefault(u.show,i,!0)){var d=this._options,p=A.getValueOrUndefined(u.hierarchy,i);if(r(p)){h(p)?d.polygonHierarchy=new f(p):d.polygonHierarchy=p;var g=A.getValueOrDefault(u.closeTop,i,!0),S=A.getValueOrDefault(u.closeBottom,i,!0);d.height=A.getValueOrUndefined(u.height,i),d.extrudedHeight=A.getValueOrUndefined(u.extrudedHeight,i),d.granularity=A.getValueOrUndefined(u.granularity,i),d.stRotation=A.getValueOrUndefined(u.stRotation,i),d.perPositionHeight=A.getValueOrUndefined(u.perPositionHeight,i),d.closeTop=g,d.closeBottom=S;var E=this._geometryUpdater.shadowsProperty.getValue(i);if(A.getValueOrDefault(u.fill,i,!0)){var b=n.fillMaterialProperty,T=x.getValue(i,b,this._material);if(this._material=T,o){var P=e.WHITE;r(b.color)&&(P=b.color.getValue(i)),this._primitive=s.add(new v({geometryInstances:new c({id:l,geometry:new m(d),attributes:{color:t.fromColor(P)}}),asynchronous:!1,shadows:E}))}else{var D=new y({material:T,translucent:T.isTranslucent(),closed:r(d.extrudedHeight)&&d.extrudedHeight!==d.height&&g&&S});d.vertexFormat=D.vertexFormat,this._primitive=a.add(new w({geometryInstances:new c({id:l,geometry:new m(d)}),appearance:D,asynchronous:!1,shadows:E}))}}if(!o&&A.getValueOrDefault(u.outline,i,!1)){d.vertexFormat=C.VERTEX_FORMAT;var M=A.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,V),I=A.getValueOrDefault(u.outlineWidth,i,1),R=1!==M.alpha;this._outlinePrimitive=a.add(new w({geometryInstances:new c({id:l,geometry:new _(d),attributes:{color:t.fromColor(M)}}),appearance:new C({flat:!0,translucent:R,renderState:{lineWidth:n._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:E}))}}}},M.prototype.getBoundingSphere=function(e,t){return T(e,this._primitive,this._outlinePrimitive,t)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},D}),i("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,i,r,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),r=!1,n=s.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(i,r,t.renderState),this._closed=r,this._vertexFormat=n}var l=o+"\n"+n,u=r;return t(s.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),s.VERTEX_FORMAT=i.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),i("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),i("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=!1,o=u.VERTEX_FORMAT;this.material=t(i.material)?i.material:l.fromType(l.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,c),this._fragmentShaderSource=e(i.fragmentShaderSource,h),this._renderState=s.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._vertexFormat=o}var c=o+"\n"+n,h=a;return i(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),i("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0}function x(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new T(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function A(e,t){var i=t._scene.id,r=P[i];!n(r)||r.isDestroyed()?(r=new _,P[i]=r,e.add(r)):e.contains(r)||e.add(r);var o=r.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[],O.ellipsoid=t._scene.globe.ellipsoid}var P={},D=new w(t.WHITE),M=new S(!0),I=new S(y.DISABLED),R=new S(new l);o(x,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:v}}),o(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&b.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){return!1},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new f(s&&a.isShowing&&this._showProperty.getValue(e)),c=this._distanceDisplayConditionProperty.getValue(e),d=u.fromDistanceDisplayCondition(c);if(this._materialProperty instanceof w){var m=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(e)),r=i.fromColor(m),o={show:l,distanceDisplayCondition:d,color:r}}else o={show:l,distanceDisplayCondition:d};return new h({id:a,geometry:new p(this._options),attributes:o})},x.prototype.createOutlineGeometryInstance=function(e){},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),a(this)},x.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!n(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(n(l)&&l.isConstant&&!l.getValue(d.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=r(a.material,D),c=u instanceof w;this._materialProperty=u,this._showProperty=r(l,M),this._shadowsProperty=r(a.shadows,I),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,R),this._fillEnabled=!0;var h=a.width,p=a.followSurface,m=a.granularity;if(s.isConstant&&b.isConstant(h)&&b.isConstant(p)&&b.isConstant(m)){var f=this._options,_=s.getValue(d.MINIMUM_VALUE,f.positions);if(!n(_)||_.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));f.vertexFormat=c?g.VERTEX_FORMAT:v.VERTEX_FORMAT,f.positions=_,f.width=n(h)?h.getValue(d.MINIMUM_VALUE):void 0,f.followSurface=n(p)?p.getValue(d.MINIMUM_VALUE):void 0,f.granularity=n(m)?m.getValue(d.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new A(e,this)};var O={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return A.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,o=this._line;if(!i.isShowing||!i.isAvailable(e)||!b.getValueOrDefault(r._show,e,!0))return void(o.show=!1);var a=r.positions,s=b.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=b.getValueOrDefault(r._followSurface,e,!0);l&&(O.positions=s,O.granularity=b.getValueOrUndefined(r._granularity,e),O.height=m.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=m.generateCartesianArc(O)),o.show=!0,o.positions=s.slice(),o.material=E.getValue(e,t.fillMaterialProperty,o.material),o.width=b.getValueOrDefault(r._width,e,1),o.distanceDisplayCondition=b.getValueOrUndefined(r._distanceDisplayCondition,e,o.distanceDisplayCondition)},A.prototype.getBoundingSphere=function(t,i){var r=this._line;return r.show&&r.positions.length>0?(e.fromPoints(r.positions,i),C.DONE):C.FAILED},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,i=P[t];i.remove(this._line),0===i.length&&(this._primitives.removeAndDestroy(i),delete P[t]),a(this)},x}),i("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){
"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new m(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),p=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:p,color:o}}else n={show:u,distanceDisplayCondition:p};return new c({id:a,geometry:new d(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new p(this._options),attributes:{show:new m(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polylineVolume"===t){var a=this._entity.polylineVolume;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,p=a.shape,m=a.show;if(!r(d)||!r(p)||r(m)&&m.isConstant&&!m.getValue(h.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,A),v=g instanceof y;this._materialProperty=g,this._fillProperty=i(s,D),this._showProperty=i(m,P),this._showOutlineProperty=i(a.outline,M),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var C=a.granularity,w=a.outlineWidth,S=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&p.isConstant&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=v?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,b.polylinePositions=d.getValue(h.MINIMUM_VALUE,b.polylinePositions),b.shapePositions=p.getValue(h.MINIMUM_VALUE,b.shape),b.granularity=r(C)?C.getValue(h.MINIMUM_VALUE):void 0,b.cornerType=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polylineVolume;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.polylinePositions),h=E.getValueOrUndefined(s.shape,i);if(r(u)&&r(h)){l.polylinePositions=u,l.shapePositions=h,l.granularity=E.getValueOrUndefined(s.granularity,i),l.cornerType=E.getValueOrUndefined(s.cornerType,i);var m=this._geometryUpdater.shadowsProperty.getValue(i);if(!r(s.fill)||s.fill.getValue(i)){var v=S.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var y=new f({material:v,translucent:v.isTranslucent(),closed:!0});l.vertexFormat=y.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new d(l)}),appearance:y,asynchronous:!1,shadows:m}))}if(r(s.outline)&&s.outline.getValue(i)){l.vertexFormat=_.VERTEX_FORMAT;var C=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),w=E.getValueOrDefault(s.outlineWidth,i,1),b=1!==C.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l),attributes:{color:t.fromColor(C)}}),appearance:new _({flat:!0,translucent:b,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1,shadows:m}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),i("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var D=new w(e.WHITE),M=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new s),B=new e;return n(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),n(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new f(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),d=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof w){var m=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(i)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:d,color:o}}else n={show:u,distanceDisplayCondition:d};return new c({id:a,geometry:new p(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new m(this._options),attributes:{show:new f(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"rectangle"===t){var a=this._entity.rectangle;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var p=a.coordinates,m=a.show;if(r(m)&&m.isConstant&&!m.getValue(h.MINIMUM_VALUE)||!r(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=i(a.material,D),y=f instanceof w;this._materialProperty=f,this._fillProperty=i(s,I),this._showProperty=i(m,M),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,O):void 0,this._shadowsProperty=i(a.shadows,N),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,L);var C=a.height,S=a.extrudedHeight,E=a.granularity,b=a.stRotation,x=a.rotation,A=a.outlineWidth,P=a.closeBottom,B=a.closeTop,F=l&&!r(C)&&!r(S)&&y&&_.isSupported(this._scene);if(c&&F&&(d(d.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=F,this._outlineEnabled=c,p.isConstant&&T.isConstant(C)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&T.isConstant(P)&&T.isConstant(B)&&(!F||T.isConstant(f))){var V=this._options;V.vertexFormat=y?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,V.rectangle=p.getValue(h.MINIMUM_VALUE,V.rectangle),V.height=r(C)?C.getValue(h.MINIMUM_VALUE):void 0,V.extrudedHeight=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,V.granularity=r(E)?E.getValue(h.MINIMUM_VALUE):void 0,V.stRotation=r(b)?b.getValue(h.MINIMUM_VALUE):void 0,V.rotation=r(x)?x.getValue(h.MINIMUM_VALUE):void 0,V.closeBottom=r(P)?P.getValue(h.MINIMUM_VALUE):void 0,V.closeTop=r(B)?B.getValue(h.MINIMUM_VALUE):void 0,this._isClosed=r(S)&&r(V.closeTop)&&r(V.closeBottom)&&V.closeTop&&V.closeBottom,this._outlineWidth=r(A)?A.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.rectangle;if(l.isShowing&&l.isAvailable(i)&&T.getValueOrDefault(u.show,i,!0)){var h=this._options,d=T.getValueOrUndefined(u.coordinates,i,h.rectangle);if(r(d)){h.rectangle=d,h.height=T.getValueOrUndefined(u.height,i),h.extrudedHeight=T.getValueOrUndefined(u.extrudedHeight,i),h.granularity=T.getValueOrUndefined(u.granularity,i),h.stRotation=T.getValueOrUndefined(u.stRotation,i),h.rotation=T.getValueOrUndefined(u.rotation,i),h.closeBottom=T.getValueOrUndefined(u.closeBottom,i),h.closeTop=T.getValueOrUndefined(u.closeTop,i);var f=this._geometryUpdater.shadowsProperty.getValue(i);if(T.getValueOrDefault(u.fill,i,!0)){var C=n.fillMaterialProperty,w=b.getValue(i,C,this._material);if(this._material=w,o){var S=e.WHITE;r(C.color)&&(S=C.color.getValue(i)),this._primitive=s.add(new _({geometryInstances:new c({id:l,geometry:new p(h),attributes:{color:t.fromColor(S)}}),asynchronous:!1,shadows:f}))}else{var E=new g({material:w,translucent:w.isTranslucent(),closed:r(h.extrudedHeight)});h.vertexFormat=E.vertexFormat,this._primitive=a.add(new y({geometryInstances:new c({id:l,geometry:new p(h)}),appearance:E,asynchronous:!1,shadows:f}))}}if(!o&&T.getValueOrDefault(u.outline,i,!1)){h.vertexFormat=v.VERTEX_FORMAT;var x=T.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,B),A=T.getValueOrDefault(u.outlineWidth,i,1),P=1!==x.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new c({id:l,geometry:new m(h),attributes:{color:t.fromColor(x)}}),appearance:new v({flat:!0,translucent:P,renderState:{lineWidth:n._scene.clampLineWidth(A)}}),asynchronous:!1,shadows:f}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),i("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),D=new C(!0),M=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:f}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new d(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),h=this._distanceDisplayConditionProperty.getValue(i),m=l.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof y){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:m,color:o}}else n={show:u,distanceDisplayCondition:m};return new c({id:a,geometry:new p(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new m(this._options),attributes:{show:new d(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"wall"===t){var a=this._entity.wall;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(h.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,p=a.show;if(r(p)&&p.isConstant&&!p.getValue(h.MINIMUM_VALUE)||!r(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=i(a.material,A),g=m instanceof y;this._materialProperty=m,this._fillProperty=i(s,D),this._showProperty=i(p,P),this._showOutlineProperty=i(a.outline,M),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var v=a.minimumHeights,C=a.maximumHeights,w=a.outlineWidth,S=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&E.isConstant(v)&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=g?_.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,b.positions=d.getValue(h.MINIMUM_VALUE,b.positions),b.minimumHeights=r(v)?v.getValue(h.MINIMUM_VALUE,b.minimumHeights):void 0,b.maximumHeights=r(C)?C.getValue(h.MINIMUM_VALUE,b.maximumHeights):void 0,b.granularity=r(S)?S.getValue(h.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(h.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.wall;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.positions);if(r(u)){l.positions=u,l.minimumHeights=E.getValueOrUndefined(s.minimumHeights,i,l.minimumHeights),l.maximumHeights=E.getValueOrUndefined(s.maximumHeights,i,l.maximumHeights),l.granularity=E.getValueOrUndefined(s.granularity,i);var h=this._geometryUpdater.shadowsProperty.getValue(i);if(E.getValueOrDefault(s.fill,i,!0)){var d=S.getValue(i,o.fillMaterialProperty,this._material);this._material=d;var v=new f({material:d,translucent:d.isTranslucent(),closed:r(l.extrudedHeight)});l.vertexFormat=v.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l)}),appearance:v,asynchronous:!1,shadows:h}))}if(E.getValueOrDefault(s.outline,i,!1)){l.vertexFormat=_.VERTEX_FORMAT;var y=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),C=E.getValueOrDefault(s.outlineWidth,i,1),w=1!==y.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new m(l),attributes:{color:t.fromColor(y)}}),appearance:new _({flat:!0,translucent:w,renderState:{lineWidth:o._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:h}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),i("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","../Scene/GroundPrimitive","./BillboardVisualizer","./BoundingSphereState","./BoxGeometryUpdater","./CorridorGeometryUpdater","./CustomDataSource","./CylinderGeometryUpdater","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){s.initializeTerrainHeights();var i=e.scene,r=e.dataSourceCollection;this._eventHelper=new a,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=r,this._scene=i,this._visualizersCallback=t(e.visualizersCallback,x.defaultVisualizersCallback);for(var n=0,o=r.length;n<o;n++)this._onDataSourceAdded(r,r.get(n));var l=new d;this._onDataSourceAdded(void 0,l),this._defaultDataSource=l,this._ready=!1}x.defaultVisualizersCallback=function(e,t,i){var r=i.entities;return[new l(t,r),new _(c,e,r),new _(p,e,r),new _(h,e,r),new _(m,e,r),new _(f,e,r),new _(w,e,r),new _(S,e,r),new _(E,e,r),new _(b,e,r),new _(T,e,r),new g(t,r),new v(e,r),new C(t,r),new y(e,r)]},r(x.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}}),x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,i=e.length;t<i;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),n(this)},x.prototype.update=function(e){if(!s._initialized)return this._ready=!1,!1;var t,r,n,o,a=!0,l=this._dataSourceCollection,u=l.length;for(t=0;t<u;t++){var c=l.get(t);for(i(c.update)&&(a=c.update(e)&&a),n=c._visualizers,o=n.length,r=0;r<o;r++)a=n[r].update(e)&&a}for(n=this._defaultDataSource._visualizers,o=n.length,r=0;r<o;r++)a=n[r].update(e)&&a;return this._ready=a,a};var A=[],P=new e;return x.prototype.getBoundingSphere=function(t,r,n){if(!this._ready)return u.PENDING;var o,a,s=this._defaultDataSource;if(!s.entities.contains(t)){s=void 0;var l=this._dataSourceCollection;for(a=l.length,o=0;o<a;o++){var c=l.get(o);if(c.entities.contains(t)){s=c;break}}}if(!i(s))return u.FAILED;var h=A,d=P,p=0,m=u.DONE,f=s._visualizers,_=f.length;for(o=0;o<_;o++){var g=f[o];if(i(g.getBoundingSphere)){if(m=f[o].getBoundingSphere(t,d),!r&&m===u.PENDING)return u.PENDING;m===u.DONE&&(h[p]=e.clone(d,h[p]),p++)}}return 0===p?u.FAILED:(h.length=p,e.fromBoundingSpheres(h,n),u.DONE)},x.prototype._onDataSourceAdded=function(e,t){var i=this._scene,r=t.clustering;r._initialize(i),i.primitives.add(r),t._visualizers=this._visualizersCallback(i,r,t)},x.prototype._onDataSourceRemoved=function(e,t){var i=this._scene,r=t.clustering;i.primitives.remove(r);for(var n=t._visualizers,o=n.length,a=0;a<o;a++)n[a].destroy();t._visualizers=void 0},x}),i("DataSources/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),i("DataSources/EntityView",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/HeadingPitchRange","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(t,r,n,o,a,c,p){var m=t.scene.mode,A=a.getValue(c,t._lastCartesian);if(i(A)){var P,D,M,I=!1;if(m===d.SCENE3D){T=s.addSeconds(c,.001,T);var R=a.getValue(T,y);if(i(R)){var O,N=h.computeFixedToIcrfMatrix(c,f),L=h.computeFixedToIcrfMatrix(T,_);i(N)&&i(L)?O=u.transpose(N,g):(O=h.computeTemeToPseudoFixedMatrix(c,g),N=u.transpose(O,f),L=h.computeTemeToPseudoFixedMatrix(T,_),u.transpose(L,L));var B=u.multiplyByVector(N,A,E),F=u.multiplyByVector(L,R,b);e.subtract(B,F,S);var V=1e3*e.magnitude(S),k=3986004418e5,z=-k/(V*V-2*k/e.magnitude(B));z<0||z>x*p.maximumRadius?(P=C,e.normalize(A,P),e.negate(P,P),M=e.clone(e.UNIT_Z,w),D=e.cross(M,P,y),e.magnitude(D)>l.EPSILON7&&(e.normalize(P,P),e.normalize(D,D),M=e.cross(P,D,w),e.normalize(M,M),I=!0)):e.equalsEpsilon(A,R,l.EPSILON7)||(M=C,e.normalize(B,M),e.normalize(F,F),D=e.cross(M,F,w),e.equalsEpsilon(D,e.ZERO,l.EPSILON7)||(P=e.cross(D,M,y),u.multiplyByVector(O,P,P),u.multiplyByVector(O,D,D),u.multiplyByVector(O,M,M),e.normalize(P,P),e.normalize(D,D),e.normalize(M,M),I=!0))}}i(t.boundingSphere)&&(A=t.boundingSphere.center);var U,G,W;o&&(U=e.clone(r.position,S),G=e.clone(r.direction,E),W=e.clone(r.up,b));var H=v;I?(H[0]=P.x,H[1]=P.y,H[2]=P.z,H[3]=0,H[4]=D.x,H[5]=D.y,H[6]=D.z,H[7]=0,H[8]=M.x,H[9]=M.y,H[10]=M.z,H[11]=0,H[12]=A.x,H[13]=A.y,H[14]=A.z,H[15]=0):h.eastNorthUpToFixedFrame(A,p,H),r._setTransform(H),o&&(e.clone(U,r.position),e.clone(G,r.direction),e.clone(W,r.up),e.cross(G,W,r.right))}if(n){var q=m===d.SCENE2D||e.equals(t._offset3D,e.ZERO)?void 0:t._offset3D;r.lookAtTransform(r.transform,q)}}function m(i,r,n){this.entity=i,this.scene=r,this.ellipsoid=t(n,o.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new e,this._defaultOffset3D=void 0,this._offset3D=new e}var f=new u,_=new u,g=new u,v=new c,y=new e,C=new e,w=new e,S=new e,E=new e,b=new e,T=new s,x=1.25;r(m,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(t){this._defaultOffset3D=e.clone(t,new e)}}}),m.defaultOffset3D=new e(-14e3,3500,3500);var A=new a,P=new e;return m.prototype.update=function(t,r){var n=this.scene,o=this.entity,a=this.ellipsoid,s=n.mode;if(s!==d.MORPHING){var u=o.position,c=o!==this._lastEntity,h=s!==this._mode,f=this._offset3D,_=n.camera,g=c||h,v=!0;if(c){var y=o.viewFrom,C=i(y);if(!C&&i(r)){var w=n.screenSpaceCameraController;w.minimumZoomDistance=Math.min(w.minimumZoomDistance,.5*r.radius),A.pitch=-l.PI_OVER_FOUR,A.range=0;var S=u.getValue(t,P);if(i(S)){var E=2-1/Math.max(1,e.magnitude(S)/a.maximumRadius);A.pitch*=E}_.viewBoundingSphere(r,A),this.boundingSphere=r,g=!1,v=!1}else C&&i(y.getValue(t,f))||e.clone(m._defaultOffset3D,f)}else h||n.mode===d.MORPHING||this._mode===d.SCENE2D||e.clone(_.position,f);this._lastEntity=o,this._mode=n.mode!==d.MORPHING?n.mode:this._mode,n.mode!==d.MORPHING&&p(this,_,g,v,u,t,a)}},m}),!function(){function e(e,t){function i(t){var i,r=e.arcs[t<0?~t:t],n=r[0];return e.transform?(i=[0,0],r.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=r[r.length-1],t<0?[i,n]:[n,i]}function r(e,t){for(var i in e){var r=e[i];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){n[e<0?~e:e]=1}),s.push(r)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(i,r){var n,o=e.arcs[i<0?~i:i];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=i,t[r]=n)}),t.forEach(function(e){var t,r,n=i(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),
t.end=l,r=o[l]){delete o[r.start];var u=r===t?t:t.concat(r);o[u.start=t.start]=a[u.end=r.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,r=a[s]){delete a[r.end];var c=r===t?t:r.concat(t);o[c.start=r.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),r(a,o),r(o,a),t.forEach(function(e){n[e<0?~e:e]||s.push([e])}),s}function t(t,i,r){function n(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in h&&(u=e,h[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],h={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(i),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var d=0,p=t.arcs.length;d<p;++d)l.push(d);return{type:"MultiLineString",arcs:e(t,l)}}function r(t,i){function r(e){e.forEach(function(t){t.forEach(function(t){(a[t=t<0?~t:t]||(a[t]=[])).push(e)})}),l.push(e)}function o(e){return d(s(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var a={},l=[],u=[];return i.forEach(function(e){"Polygon"===e.type?r(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(r)}),l.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,u.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){a[e<0?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(i){var r=[];if(i.forEach(function(e){e.forEach(function(e){e.forEach(function(e){a[e<0?~e:e].length<2&&r.push(e)})})}),r=e(t,r),(n=r.length)>1)for(var s,l=o(i[0][0]),u=0;u<n;++u)if(l===o(r[u])){s=r[0],r[0]=r[u],r[u]=s;break}return r})}}function o(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return a(e,t)})}:a(e,t)}function a(e,t){var i={type:"Feature",id:t.id,properties:t.properties||{},geometry:s(e,t)};return null==t.id&&delete i.id,i}function s(e,t){function i(e,t){t.length&&t.pop();for(var i,r=c[e<0?~e:e],n=0,o=r.length;n<o;++n)t.push(i=r[n].slice()),u(i,n);e<0&&l(t,o)}function r(e){return e=e.slice(),u(e,0),e}function n(e){for(var t=[],r=0,n=e.length;r<n;++r)i(e[r],t);return t.length<2&&t.push(t[0].slice()),t}function o(e){for(var t=n(e);t.length<4;)t.push(t[0].slice());return t}function a(e){return e.map(o)}function s(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(s)}:t in h?{type:t,coordinates:h[t](e)}:null}var u=_(e.transform),c=e.arcs,h={Point:function(e){return r(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(r)},LineString:function(e){return n(e.arcs)},MultiLineString:function(e){return e.arcs.map(n)},Polygon:function(e){return a(e.arcs)},MultiPolygon:function(e){return e.arcs.map(a)}};return s(t)}function l(e,t){for(var i,r=e.length,n=r-t;n<--r;)i=e[n],e[n++]=e[r],e[r]=i}function u(e,t){for(var i=0,r=e.length;i<r;){var n=i+r>>>1;e[n]<t?i=n+1:r=n}return i}function c(e){function t(e,t){e.forEach(function(e){e<0&&(e=~e);var i=n[e];i?i.push(t):n[e]=[t]})}function i(e,i){e.forEach(function(e){t(e,i)})}function r(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){r(e,t)}):e.type in a&&a[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),a={LineString:t,MultiLineString:i,Polygon:i,MultiPolygon:function(e,t){e.forEach(function(e){i(e,t)})}};e.forEach(r);for(var s in n)for(var l=n[s],c=l.length,h=0;h<c;++h)for(var d=h+1;d<c;++d){var p,m=l[h],f=l[d];(p=o[m])[s=u(p,f)]!==f&&p.splice(s,0,f),(p=o[f])[s=u(p,m)]!==m&&p.splice(s,0,m)}return o}function h(e,t){function i(e){o.remove(e),e[1][2]=t(e),o.push(e)}var r=_(e.transform),n=g(e.transform),o=f();return t||(t=p),e.arcs.forEach(function(e){for(var a,s,l=[],u=0,c=0,h=e.length;c<h;++c)s=e[c],r(e[c]=[s[0],s[1],1/0],c);for(var c=1,h=e.length-1;c<h;++c)a=e.slice(c-1,c+2),a[1][2]=t(a),l.push(a),o.push(a);for(var c=0,h=l.length;c<h;++c)a=l[c],a.previous=l[c-1],a.next=l[c+1];for(;a=o.pop();){var d=a.previous,p=a.next;a[1][2]<u?a[1][2]=u:u=a[1][2],d&&(d.next=p,d[2]=a[2],i(d)),p&&(p.previous=d,p[0]=a[0],i(p))}e.forEach(n)}),e}function d(e){for(var t,i=-1,r=e.length,n=e[r-1],o=0;++i<r;)t=n,n=e[i],o+=t[0]*n[1]-t[1]*n[0];return.5*o}function p(e){var t=e[0],i=e[1],r=e[2];return Math.abs((t[0]-r[0])*(i[1]-t[1])-(t[0]-i[0])*(r[1]-t[1]))}function m(e,t){return e[1][2]-t[1][2]}function f(){function e(e,t){for(;t>0;){var i=(t+1>>1)-1,n=r[i];if(m(e,n)>=0)break;r[n._=t]=n,r[e._=t=i]=e}}function t(e,t){for(;;){var i=t+1<<1,o=i-1,a=t,s=r[a];if(o<n&&m(r[o],s)<0&&(s=r[a=o]),i<n&&m(r[i],s)<0&&(s=r[a=i]),a===t)break;r[s._=t]=s,r[e._=t=a]=e}}var i={},r=[],n=0;return i.push=function(t){return e(r[t._=n]=t,n++),n},i.pop=function(){if(!(n<=0)){var e,i=r[0];return--n>0&&(e=r[n],t(r[e._=0]=e,0)),i}},i.remove=function(i){var o,a=i._;if(r[a]===i)return a!==--n&&(o=r[n],(m(o,i)<0?e:t)(r[o._=a]=o,a)),a},i}function _(e){if(!e)return v;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0),e[0]=(t+=e[0])*r+o,e[1]=(i+=e[1])*n+a}}function g(e){if(!e)return v;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0);var l=(e[0]-o)/r|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-i,t=l,i=u}}function v(){}var y={version:"1.6.18",mesh:function(e){return s(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return s(e,r.apply(this,arguments))},mergeArcs:r,feature:o,neighbors:c,presimplify:h};"function"==typeof i&&i.amd?i("ThirdParty/topojson",y):"object"==typeof module&&module.exports?module.exports=y:this.topojson=y}(),i("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./DataSource","./EntityCluster","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(t){return e.fromDegrees(t[0],t[1],t[2])}function D(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||ue.indexOf(r)!==-1)continue;var o=e[r];n(o)&&(i+="object"==typeof o?"<tr><th>"+r+"</th><td>"+D(o)+"</td></tr>":"<tr><th>"+r+"</th><td>"+o+"</td></tr>")}return i.length>0&&(i='<table class="cesium-infoBox-defaultTable"><tbody>'+i+"</tbody></table>"),i}function M(e,t,i){var r;return function(o,a){return n(r)||(r=e(t,i)),r}}function I(e,t){return new v(M(D,e,t),!0)}function R(e,t,r){var o=e.id;if(n(o)&&"Feature"===e.type){for(var a=2,s=o;n(t.getById(s));)s=o+"_"+a,a++;o=s}else o=i();var l=t.getOrCreateEntity(o),u=e.properties;if(n(u)){l.addProperty("properties"),l.properties=u;var c,h=u.title;if(n(h))l.name=h,c="title";else{var d=Number.MAX_VALUE;for(var p in u)if(u.hasOwnProperty(p)&&u[p]){var m=p.toLowerCase();if(d>1&&"title"===m){d=1,c=p;break}d>2&&"name"===m?(d=2,c=p):d>3&&/title/i.test(p)?(d=3,c=p):d>4&&/name/i.test(p)&&(d=4,c=p)}n(c)&&(l.name=u[c])}var f=u.description;null!==f&&(l.description=n(f)?new w(f):r(u,c))}return l}function O(e,t){for(var i=new Array(e.length),r=0;r<e.length;r++)i[r]=t(e[r]);return i}function N(e,t,i,r,o){if(null===t.geometry)return void R(t,e._entityCollection,o.describe);if(!n(t.geometry))throw new d("feature.geometry is required.");var a=t.geometry.type,s=he[a];if(!n(s))throw new d("Unknown geometry type: "+a);s(e,t,t.geometry,r,o)}function L(e,t,i,r,n){for(var o=t.features,a=0,s=o.length;a<s;a++)N(e,o[a],void 0,r,n)}function B(e,t,i,r,o){for(var a=i.geometries,s=0,l=a.length;s<l;s++){var u=a[s],c=u.type,h=he[c];if(!n(h))throw new d("Unknown geometry type: "+c);h(e,t,u,r,o)}}function F(e,i,o,a,s){var l=s.markerSymbol,u=s.markerColor,c=s.markerSize,h=i.properties;if(n(h)){var d=h["marker-color"];n(d)&&(u=t.fromCssColorString(d)),c=r(le[h["marker-size"]],c);var f=h["marker-symbol"];n(f)&&(l=f)}var v;v=n(l)?1===l.length?e._pinBuilder.fromText(l.toUpperCase(),u,c):e._pinBuilder.fromMakiIconId(l,u,c):e._pinBuilder.fromColor(u,c);var y=new g;y.verticalOrigin=new w(m.BOTTOM),2===a.length&&s.clampToGround&&(y.heightReference=p.CLAMP_TO_GROUND);var S=R(i,e._entityCollection,s.describe);S.billboard=y,S.position=new C(o(a));var E=_(v).then(function(e){y.image=new w(e)}).otherwise(function(){y.image=new w(e._pinBuilder.fromColor(u,c))});e._promises.push(E)}function V(e,t,i,r,n){F(e,t,r,i.coordinates,n)}function k(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)F(e,t,r,o[a],n)}function z(e,i,r,o,a){var s=a.strokeMaterialProperty,l=a.strokeWidthProperty,u=i.properties;if(n(u)){var c=u["stroke-width"];n(c)&&(l=new w(c));var h,d=u.stroke;n(d)&&(h=t.fromCssColorString(d));var p=u["stroke-opacity"];n(p)&&1!==p&&(n(h)||(h=s.color.clone()),h.alpha=p),n(h)&&(s=new y(h))}var m,f=R(i,e._entityCollection,a.describe);a.clampToGround?(m=new S,f.corridor=m):(m=new A,f.polyline=m),m.material=s,m.width=l,m.positions=new w(O(o,r))}function U(e,t,i,r,n){z(e,t,r,i.coordinates,n)}function G(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)z(e,t,r,o[a],n)}function W(e,i,r,o,a){if(0!==o.length&&0!==o[0].length){var s=a.strokeMaterialProperty.color,l=a.fillMaterialProperty,u=a.strokeWidthProperty,c=i.properties;if(n(c)){var d=c["stroke-width"];n(d)&&(u=new w(d));var p,m=c.stroke;n(m)&&(p=t.fromCssColorString(m));var f=c["stroke-opacity"];n(f)&&1!==f&&(n(p)||(p=a.strokeMaterialProperty.color.clone()),p.alpha=f),n(p)&&(s=new w(p));var _,g=c.fill;n(g)&&(_=t.fromCssColorString(g),_.alpha=l.color.alpha),f=c["fill-opacity"],n(f)&&f!==l.color.alpha&&(n(_)||(_=l.color.clone()),_.alpha=f),n(_)&&(l=new y(_))}var v=new x;v.outline=new w(!0),v.outlineColor=s,v.outlineWidth=u,v.material=l;for(var C=[],S=1,E=o.length;S<E;S++)C.push(new h(O(o[S],r)));var b=o[0];v.hierarchy=new w(new h(O(b,r),C)),b[0].length>2?v.perPositionHeight=new w(!0):a.clampToGround||(v.height=0);var T=R(i,e._entityCollection,a.describe);T.polygon=v}}function H(e,t,i,r,n){W(e,t,r,i.coordinates,n)}function q(e,t,i,r,n){for(var o=i.coordinates,a=0;a<o.length;a++)W(e,t,r,o[a],n)}function j(e,t,i,r,n){for(var o in i.objects)if(i.objects.hasOwnProperty(o)){var a=f.feature(i,i.objects[o]),s=ce[a.type];s(e,a,a,r,n)}}function Y(e){this._name=e,this._changed=new s,this._error=new s,this._isLoading=!1,this._loading=new s,this._entityCollection=new T(this),this._promises=[],this._pinBuilder=new c,this._entityCluster=new b}function X(e,t,i,r){var o;n(r)&&(o=l(r)),n(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));var a=ce[t.type];if(!n(a))throw new d("Unsupported GeoJSON object type: "+t.type);var s=t.crs,u=null!==s?P:null;if(n(s)){if(!n(s.properties))throw new d("crs.properties is undefined.");var c=s.properties;if("name"===s.type){if(u=K[c.name],!n(u))throw new d("Unknown crs name: "+c.name)}else if("link"===s.type){var h=Q[c.href];if(n(h)||(h=J[c.type]),!n(h))throw new d("Unable to resolve crs link: "+JSON.stringify(c));u=h(c)}else{if("EPSG"!==s.type)throw new d("Unknown crs type: "+s.type);if(u=K["EPSG:"+c.code],!n(u))throw new d("Unknown crs EPSG code: "+c.code)}}return _(u,function(r){return e._entityCollection.removeAll(),null!==r&&a(e,t,t,r,i),_.all(e._promises,function(){return e._promises.length=0,E.setLoading(e,!1),e})})}var Z,K={"urn:ogc:def:crs:OGC:1.3:CRS84":P,"EPSG:4326":P,"urn:ogc:def:crs:EPSG::4326":P},Q={},J={},$=48,ee=t.ROYALBLUE,te=t.YELLOW,ie=2,re=t.fromBytes(255,255,0,100),ne=!1,oe=new w(ie),ae=new y(te),se=new y(re),le={small:24,medium:48,large:64},ue=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"],ce={Feature:N,FeatureCollection:L,GeometryCollection:B,LineString:U,MultiLineString:G,MultiPoint:k,MultiPolygon:q,Point:V,Polygon:H,Topology:j},he={GeometryCollection:B,LineString:U,MultiLineString:G,MultiPoint:k,MultiPolygon:q,Point:V,Polygon:H,Topology:j};return Y.load=function(e,t){return(new Y).load(e,t)},o(Y,{markerSize:{get:function(){return $},set:function(e){$=e}},markerSymbol:{get:function(){return Z},set:function(e){Z=e}},markerColor:{get:function(){return ee},set:function(e){ee=e}},stroke:{get:function(){return te},set:function(e){te=e,ae.color.setValue(e)}},strokeWidth:{get:function(){return ie},set:function(e){ie=e,oe.setValue(e)}},fill:{get:function(){return re},set:function(e){re=e,se=new y(re)}},clampToGround:{get:function(){return ne},set:function(e){ne=e}},crsNames:{get:function(){return K}},crsLinkHrefs:{get:function(){return Q}},crsLinkTypes:{get:function(){return J}}}),o(Y.prototype,{name:{get:function(){return this._name}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),Y.prototype.load=function(e,t){E.setLoading(this,!0);var i=e;t=r(t,r.EMPTY_OBJECT);var o=t.sourceUri;"string"==typeof e&&(n(o)||(o=e),i=u(e)),t={describe:r(t.describe,I),markerSize:r(t.markerSize,$),markerSymbol:r(t.markerSymbol,Z),markerColor:r(t.markerColor,ee),strokeWidthProperty:new w(r(t.strokeWidth,ie)),strokeMaterialProperty:new y(r(t.stroke,te)),fillMaterialProperty:new y(r(t.fill,re)),clampToGround:r(t.clampToGround,ne)};var a=this;return _(i,function(e){return X(a,e,t,o)}).otherwise(function(e){return E.setLoading(a,!1),a._error.raiseEvent(a,e),console.log(e),_.reject(e)})},Y}),i("DataSources/GeometryUpdater",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(e,i){t.throwInstantiationError()}return e(i,{perInstanceColorAppearanceType:{get:t.throwInstantiationError},materialAppearanceType:{get:t.throwInstantiationError}}),e(i.prototype,{entity:{get:t.throwInstantiationError},fillEnabled:{get:t.throwInstantiationError},hasConstantFill:{get:t.throwInstantiationError},fillMaterialProperty:{get:t.throwInstantiationError},outlineEnabled:{get:t.throwInstantiationError},hasConstantOutline:{get:t.throwInstantiationError},outlineColorProperty:{get:t.throwInstantiationError},outlineWidth:{get:t.throwInstantiationError},isDynamic:{get:t.throwInstantiationError},isClosed:{get:t.throwInstantiationError},geometryChanged:{get:t.throwInstantiationError}}),i.prototype.isOutlineVisible=t.throwInstantiationError,i.prototype.isFilled=t.throwInstantiationError,i.prototype.createFillGeometryInstance=t.throwInstantiationError,i.prototype.createOutlineGeometryInstance=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i.prototype.createDynamicUpdater=t.throwInstantiationError,i}),function(e,t){"function"==typeof i&&i.amd?i("ThirdParty/Autolinker",[],function(){return e.Autolinker=t()}):"object"==typeof exports?module.exports=t():e.Autolinker=t()}(this,function(){var e=function(t){e.Util.assign(this,t);var i=this.hashtag;if(i!==!1&&"twitter"!==i&&"facebook"!==i)throw new Error("invalid `hashtag` cfg - see docs")};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser(),i=t.parse(e),r=0,n=[],o=0,a=i.length;o<a;o++){var s=i[o],l=s.getType(),u=s.getText();if("element"===l)"a"===s.getTagName()&&(s.isClosing()?r=Math.max(r-1,0):r++),n.push(u);else if("entity"===l||"comment"===l)n.push(u);else if(0===r){var c=this.linkifyStr(u);n.push(c)}else n.push(u)}return n.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var i;if(this.replaceFn&&(i=this.replaceFn.call(this,this,t)),"string"==typeof i)return i;if(i===!1)return t.getMatchedText();if(i instanceof e.HtmlTag)return i.toAnchorString();var r=this.getTagBuilder(),n=r.build(t);return n.toAnchorString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,phone:this.phone,hashtag:this.hashtag,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,i){var r=new e(i);return r.link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},trimRegex:/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,assign:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},extend:function(t,i){var r=t.prototype,n=function(){};n.prototype=r;var o;o=i.hasOwnProperty("constructor")?i.constructor:function(){r.constructor.apply(this,arguments)};var a=o.prototype=new n;return a.constructor=o,a.superclass=r,delete i.constructor,e.Util.assign(a,i),o},ellipsis:function(e,t,i){return e.length>t&&(i=null==i?"..":i,e=e.substring(0,t-i.length)+i),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var i,r=[],n=0;i=t.exec(e);)r.push(e.substring(n,i.index)),r.push(i[0]),n=i.index+i[0].length;return r.push(e.substring(n)),r},trim:function(e){return e.replace(this.trimRegex,"")}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){var i=this.getAttrs();return i[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var i=this.getAttrs();return e.Util.assign(i,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);i=s.shift();)o(a,i)===-1&&a.push(i);return this.getAttrs().class=a.join(" "),this},removeClass:function(t){for(var i,r=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=r?r.split(n):[],s=t.split(n);a.length&&(i=s.shift());){var l=o(a,i);l!==-1&&a.splice(l,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i+'="'+e[i]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var i=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return i},createAttrs:function(e,t){var i={href:t},r=this.createCssClass(e);return r&&(i.class=r),this.newWindow&&(i.target="_blank"),i},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,i=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=i.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,parse:function(e){for(var t,i,r=this.htmlRegex,n=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(i=this.parseTextAndEntityNodes(c),o.push.apply(o,i)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n<e.length){var h=e.substring(n);h&&(i=this.parseTextAndEntityNodes(h),o.push.apply(o,i))}return o},parseTextAndEntityNodes:function(t){for(var i=[],r=e.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),n=0,o=r.length;n<o;n+=2){var a=r[n],s=r[n+1];a&&i.push(this.createTextNode(a)),s&&i.push(this.createEntityNode(s))}return i},createCommentNode:function(t,i){return new e.htmlParser.CommentNode({text:t,comment:e.Util.trim(i)})},createElementNode:function(t,i,r){return new e.htmlParser.ElementNode({text:t,tagName:i.toLowerCase(),closing:r})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.CommentNode=e.Util.extend(e.htmlParser.HtmlNode,{comment:"",getType:function(){return"comment"},getComment:function(){return this.comment}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(^|[^\w])#(\w{1,15})/,i=/(?:[\-;:&=\+\$,\w\.]+@)/,r=/(?:\+?\d{1,3}[-\s.])?\(?\d{3}\)?[-\s.]?\d{3}[-\s.]\d{4}/,n=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,o=/(?:www\.)/,a=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,s=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)\b/,l=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",i.source,a.source,s.source,")","|","(","(?:","(",n.source,a.source,")","|","(?:","(.?//)?",o.source,a.source,")","|","(?:","(.?//)?",a.source,s.source,")",")","(?:"+l.source+")?",")","|","(",r.source,")","|","(",t.source,")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,i){var r=this;return e.replace(this.matcherRegex,function(e,n,o,a,s,l,u,c,h,d,p,m,f){var _=r.processCandidateMatch(e,n,o,a,s,l,u,c,h,d,p,m,f);if(_){var g=t.call(i,_.match);return _.prefixStr+g+_.suffixStr}return e})},processCandidateMatch:function(t,i,r,n,o,a,s,l,u,c,h,d,p){var m,f=l||u,_="",g="";if(a&&!this.urls||o&&!this.email||c&&!this.phone||i&&!this.twitter||h&&!this.hashtag||!this.matchValidator.isValidMatch(a,s,f))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),g=")"),o)m=new e.match.Email({matchedText:t,email:o});else if(i)r&&(_=r,t=t.slice(1)),m=new e.match.Twitter({matchedText:t,twitterHandle:n});else if(c){var v=t.replace(/\D/g,"");m=new e.match.Phone({matchedText:t,number:v})}else if(h)d&&(_=d,t=t.slice(1)),m=new e.match.Hashtag({matchedText:t,serviceName:this.hashtag,hashtag:p});else{if(f){var y=f.match(this.charBeforeProtocolRelMatchRegex)[1]||"";y&&(_=y,t=t.slice(1))}m=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!f,stripPrefix:this.stripPrefix})}return{prefixStr:_,suffixStr:g,match:m}},matchHasUnbalancedClosingParen:function(e){var t=e.charAt(e.length-1);if(")"===t){var i=e.match(/\(/g),r=e.match(/\)/g),n=i&&i.length||0,o=r&&r.length||0;if(n<o)return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,i){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(i))},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||e.indexOf(".")!==-1)},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Hashtag=e.Util.extend(e.match.Match,{getType:function(){return"hashtag"},getHashtag:function(){return this.hashtag},getAnchorHref:function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;default:throw new Error("Unknown service name to point hashtag to: ",e)}},getAnchorText:function(){return"#"+this.hashtag}}),e.match.Phone=e.Util.extend(e.match.Match,{getType:function(){return"phone"},getNumber:function(){return this.number},getAnchorHref:function(){return"tel:"+this.number},getAnchorText:function(){return this.matchedText}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){var e=this.getUrl();return e.replace(/&amp;/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e}),i("ThirdParty/zip",["../Core/buildModuleUrl","../Core/defineProperties"],function(e,t){var i={};return function(i){function r(){var e=-1,t=this;t.append=function(i){var r,n=t.table;for(r=0;r<i.length;r++)e=e>>>8^n[255&(e^i[r])]},t.get=function(){return~e}}function n(e,t,i){return e.slice?e.slice(t,t+i):e.webkitSlice?e.webkitSlice(t,t+i):e.mozSlice?e.mozSlice(t,t+i):e.msSlice?e.msSlice(t,t+i):void 0}function o(e,t){var i,r;return i=new ArrayBuffer(e),r=new Uint8Array(i),t&&r.set(t,0),{buffer:i,array:r,view:new DataView(i)}}function a(){}function s(e){function t(t,i){var o=new Blob([e],{type:z});r=new u(o),r.init(function(){n.size=r.size,t()},i)}function i(e,t,i,n){r.readUint8Array(e,t,i,n)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function l(e){function t(t){for(var i=e.length;"="==e.charAt(i-1);)i--;r=e.indexOf(",")+1,n.size=Math.floor(.75*(i-r)),t()}function i(t,i,n){var a,s=o(i),l=4*Math.floor(t/3),u=4*Math.ceil((t+i)/3),c=window.atob(e.substring(l+r,u+r)),h=t-3*Math.floor(l/4);for(a=h;a<h+i;a++)s.array[a-h]=c.charCodeAt(a);n(s.array)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function u(e){function t(t){this.size=e.size,t()}function i(t,i,r,o){var a=new FileReader;a.onload=function(e){r(new Uint8Array(e.target.result))},a.onerror=o,a.readAsArrayBuffer(n(e,t,i))}var r=this;r.size=0,r.init=t,r.readUint8Array=i}function c(){}function h(e){function t(e){n=new Blob([],{type:z}),e()}function i(e,t){n=new Blob([n,P?e:e.buffer],{type:z}),t()}function r(t,i){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=i,r.readAsText(n,e)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function d(e){function t(t){o+="data:"+(e||"")+";base64,",t()}function i(e,t){var i,r=a.length,n=a;for(a="",i=0;i<3*Math.floor((r+e.length)/3)-r;i++)n+=String.fromCharCode(e[i]);for(;i<e.length;i++)a+=String.fromCharCode(e[i]);n.length>2?o+=window.btoa(n):a=n,t()}function r(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=i,n.getData=r}function p(e){function t(t){n=new Blob([],{type:e}),t()}function i(t,i){n=new Blob([n,P?t:t.buffer],{type:e}),i()}function r(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function m(e,t,i,r,n,o,a,s,l,u){function c(){e.removeEventListener(U,h,!1),s(m)}function h(e){
var t=e.data,r=t.data;t.onappend&&(m+=r.length,i.writeUint8Array(r,function(){o(!1,r),d()},u)),t.onflush&&(r?(m+=r.length,i.writeUint8Array(r,function(){o(!1,r),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function d(){p=f*F,p<n?t.readUint8Array(r+p,Math.min(F,n-p),function(t){e.postMessage({append:!0,data:t}),f++,a&&a(p,n),o(!0,t)},l):e.postMessage({flush:!0})}var p,m,f=0;m=0,e.addEventListener(U,h,!1),d()}function f(e,t,i,r,n,o,a,s,l,u){function c(){var m;h=d*F,h<n?t.readUint8Array(r+h,Math.min(F,n-h),function(t){var s=e.append(t,function(){a&&a(r+h,n)});p+=s.length,o(!0,t),i.writeUint8Array(s,function(){o(!1,s),d++,setTimeout(c,1)},u),a&&a(h,n)},l):(m=e.flush(),m?(p+=m.length,i.writeUint8Array(m,function(){o(!1,m),s(p)},u)):s(p))}var h,d=0,p=0;c()}function _(e,t,n,o,a,s,l,u,c){function h(e,t){a&&!e&&_.append(t)}function d(e){s(e,_.get())}var p,_=new r;return i.zip.useWebWorkers?(p=new Worker(i.zip.workerScriptsPath+V),m(p,e,t,n,o,h,l,d,u,c)):f(new i.zip.Inflater,e,t,n,o,h,l,d,u,c),p}function g(e,t,n,o,a,s,l){function u(e,t){e&&p.append(t)}function c(e){o(e,p.get())}function h(){d.removeEventListener(U,h,!1),m(d,e,t,0,e.size,u,a,c,s,l)}var d,p=new r;return i.zip.useWebWorkers?(d=new Worker(i.zip.workerScriptsPath+k),d.addEventListener(U,h,!1),d.postMessage({init:!0,level:n})):f(new i.zip.Deflater,e,t,0,e.size,u,a,c,s,l),d}function v(e,t,i,n,o,a,s,l,u){function c(){var r=h*F;r<n?e.readUint8Array(i+r,Math.min(F,n-r),function(e){o&&d.append(e),s&&s(r,n,e),t.writeUint8Array(e,function(){h++,c()},u)},l):a(n,d.get())}var h=0,d=new r;c()}function y(e){var t,i,r="",n=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)i=255&e.charCodeAt(t),r+=i>127?n[i-128]:String.fromCharCode(i);return r}function C(e){return decodeURIComponent(escape(e))}function w(e){var t,i="";for(t=0;t<e.length;t++)i+=String.fromCharCode(e[t]);return i}function S(e){var t=(4294901760&e)>>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch(e){}}function E(e,t,i,r,n){return e.version=t.view.getUint16(i,!0),e.bitFlag=t.view.getUint16(i+2,!0),e.compressionMethod=t.view.getUint16(i+4,!0),e.lastModDateRaw=t.view.getUint32(i+6,!0),e.lastModDate=S(e.lastModDateRaw),1===(1&e.bitFlag)?void n(M):((r||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(I):(e.filenameLength=t.view.getUint16(i+22,!0),void(e.extraFieldLength=t.view.getUint16(i+24,!0))))}function b(e,t){function i(){}function r(i,n){e.readUint8Array(e.size-i,i,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?r(i+1,n):n(t)},function(){t(R)})}return i.prototype.getData=function(i,r,n,a){function s(e,t){d&&d.terminate(),d=null,e&&e(t)}function l(e){var t=o(4);return t.view.setUint32(0,e),p.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():i.getData(function(e){s(r,e)})}function c(){s(t,L)}function h(){s(t,N)}var d,p=this;e.readUint8Array(p.offset,30,function(r){var s,l=o(r.length,r);return 1347093252!=l.view.getUint32(0)?void t(D):(E(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,void i.init(function(){0===p.compressionMethod?v(e,i,s,p.compressedSize,a,u,n,c,h):d=_(e,i,s,p.compressedSize,a,u,n,c,h)},h))},c)},{getEntries:function(n){return e.size<22?void t(D):void r(22,function(r){var a,s;a=r.getUint32(16,!0),s=r.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var r,a,l,u,c=0,h=[],d=o(e.length,e);for(r=0;r<s;r++){if(a=new i,1347092738!=d.view.getUint32(c))return void t(D);E(a,d,c+6,!0,t),a.commentLength=d.view.getUint16(c+32,!0),a.directory=16==(16&d.view.getUint8(c+38)),a.offset=d.view.getUint32(c+42,!0),l=w(d.array.subarray(c+46,c+46+a.filenameLength)),a.filename=2048===(2048&a.bitFlag)?C(l):y(l),a.directory||"/"!=a.filename.charAt(a.filename.length-1)||(a.directory=!0),u=w(d.array.subarray(c+46+a.filenameLength+a.extraFieldLength,c+46+a.filenameLength+a.extraFieldLength+a.commentLength)),a.comment=2048===(2048&a.bitFlag)?C(u):y(u),h.push(a),c+=46+a.filenameLength+a.extraFieldLength+a.commentLength}n(h)},function(){t(R)})})},close:function(e){e&&e()}}}function T(e){return unescape(encodeURIComponent(e))}function x(e){var t,i=[];for(t=0;t<e.length;t++)i.push(e.charCodeAt(t));return i}function A(e,t,i){function r(e,t){s&&s.terminate(),s=null,e&&e(t)}function n(){r(t,O)}function a(){r(t,L)}var s,l={},u=[],c=0;return{add:function(h,d,p,m,f){function _(t){var r;E=f.lastModDate||new Date,w=o(26),l[h]={headerArray:w.array,directory:f.directory,filename:S,offset:c,comment:x(T(f.comment||""))},w.view.setUint32(0,335546376),f.version&&w.view.setUint8(0,f.version),i||0===f.level||f.directory||w.view.setUint16(4,2048),w.view.setUint16(6,(E.getHours()<<6|E.getMinutes())<<5|E.getSeconds()/2,!0),w.view.setUint16(8,(E.getFullYear()-1980<<4|E.getMonth()+1)<<5|E.getDate(),!0),w.view.setUint16(22,S.length,!0),r=o(30+S.length),r.view.setUint32(0,1347093252),r.array.set(w.array,4),r.array.set(S,30),c+=r.array.length,e.writeUint8Array(r.array,t,n)}function y(t,i){var a=o(16);c+=t||0,a.view.setUint32(0,1347094280),"undefined"!=typeof i&&(w.view.setUint32(10,i,!0),a.view.setUint32(4,i,!0)),d&&(a.view.setUint32(8,t,!0),w.view.setUint32(14,t,!0),a.view.setUint32(12,d.size,!0),w.view.setUint32(18,d.size,!0)),e.writeUint8Array(a.array,function(){c+=16,r(p)},n)}function C(){return f=f||{},h=h.trim(),f.directory&&"/"!=h.charAt(h.length-1)&&(h+="/"),l.hasOwnProperty(h)?void t(B):(S=x(T(h)),u.push(h),void _(function(){d?i||0===f.level?v(d,e,0,d.size,!0,y,m,a,n):s=g(d,e,f.level,y,m,a,n):y()},n))}var w,S,E;d?d.init(C,a):C()},close:function(t){var i,a,s,h=0,d=0;for(a=0;a<u.length;a++)s=l[u[a]],h+=46+s.filename.length+s.comment.length;for(i=o(h+22),a=0;a<u.length;a++)s=l[u[a]],i.view.setUint32(d,1347092738),i.view.setUint16(d+4,5120),i.array.set(s.headerArray,d+6),i.view.setUint16(d+32,s.comment.length,!0),s.directory&&i.view.setUint8(d+38,16),i.view.setUint32(d+42,s.offset,!0),i.array.set(s.filename,d+46),i.array.set(s.comment,d+46+s.filename.length),d+=46+s.filename.length+s.comment.length;i.view.setUint32(d,1347093766),i.view.setUint16(d+8,u.length,!0),i.view.setUint16(d+10,u.length,!0),i.view.setUint32(d+12,h,!0),i.view.setUint32(d+16,c,!0),e.writeUint8Array(i.array,function(){r(function(){e.getData(t)})},n)}}}var P,D="File format is not recognized.",M="File contains encrypted entry.",I="File is using Zip64 (4gb+ file size).",R="Error while reading zip file.",O="Error while writing zip file.",N="Error while writing file data.",L="Error while reading file data.",B="File already exists.",F=524288,V="inflate.js",k="deflate.js",z="text/plain",U="message";try{P=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}r.prototype.table=function(){var e,t,i,r=[];for(e=0;e<256;e++){for(i=e,t=0;t<8;t++)1&i?i=i>>>1^3988292384:i>>>=1;r[e]=i}return r}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},h.prototype=new c,h.prototype.constructor=h,d.prototype=new c,d.prototype.constructor=d,p.prototype=new c,p.prototype.constructor=p,i.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:d,TextWriter:h,createReader:function(e,t,i){e.init(function(){t(b(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(A(e,i,r))},i)},useWebWorkers:!0};var G;t(i.zip,{workerScriptsPath:{get:function(){return"undefined"==typeof G&&(G=e("ThirdParty/Workers/")),G}}})}(i),i.zip}),i("DataSources/KmlDataSource",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/joinUrls","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/SceneMode","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./CorridorGraphics","./DataSource","./DataSourceClock","./Entity","./EntityCluster","./EntityCollection","./LabelGraphics","./PathGraphics","./PolygonGraphics","./PolylineGraphics","./PositionPropertyArray","./RectangleGraphics","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re){"use strict";function ne(e){var t=e.slice(0,Math.min(4,e.size)),i=F.defer(),r=new FileReader;return r.addEventListener("load",function(){i.resolve(1347093252===new DataView(r.result).getUint32(0,!1))}),r.addEventListener("error",function(){i.reject(r.error)}),r.readAsArrayBuffer(t),i.promise}function oe(e){var t=F.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function ae(e,t,i,r){t.getData(new V.TextWriter,function(e){i.kml=gt.parseFromString(e,"application/xml"),r.resolve()})}function se(e,t,i,r){var n=u(_t.detectFromFilename(t.filename),"application/octet-stream");t.getData(new V.Data64URIWriter(n),function(e){i[t.filename]=e,r.resolve()})}function le(e,t,i,r){for(var n=r.keys,o=new B("."),a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=l.getAttribute(i),c=new B(u).resolve(o).toString(),h=n.indexOf(c);if(h!==-1){var d=n[h];l.setAttribute(i,r[d]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",d)}}}function ue(e,t){return c(t)&&new B(e).isAbsolute()&&(e=t.getURL(e)),e}function ce(e,t,i){var r=fe(e,"id");r=c(r)&&0!==r.length?r:l(),c(i)&&(r=i+r);var n=t.getById(r);return c(n)&&(r=l(),c(i)&&(r=i+r)),n=t.add(new H({id:r})),c(n.kml)||(n.addProperty("kml"),n.kml=new ft),n}function he(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function de(e){if(!c(e))return r.fromDegrees(0,0,0);var t=e.match(/[^\s,\n]+/g);if(!c(t))return r.fromDegrees(0,0,0);var i=parseFloat(t[0]),n=parseFloat(t[1]),o=parseFloat(t[2]);return i=isNaN(i)?0:i,n=isNaN(n)?0:n,o=isNaN(o)?0:o,r.fromDegrees(i,n,o)}function pe(e){if(c(e)){var t=e.textContent.match(/[^\s\n]+/g);if(c(t)){for(var i=t.length,r=new Array(i),n=0,o=0;o<i;o++)r[n++]=de(t[o]);return r}}}function me(e,t){if(c(e)){var i=e.getAttribute(t);if(null!==i){var r=parseFloat(i);return isNaN(r)?void 0:r}}}function fe(e,t){if(c(e)){var i=e.getAttribute(t);return null!==i?i:void 0}}function _e(e,t,i){if(c(e))for(var r=e.childNodes,n=r.length,o=0;o<n;o++){var a=r[o];if(a.localName===t&&i.indexOf(a.namespaceURI)!==-1)return a}}function ge(e,t,i){if(c(e)){for(var r=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&i.indexOf(s.namespaceURI)!==-1&&r.push(s)}return r}}function ve(e,t,i){if(!c(e))return[];for(var r=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&i.indexOf(s.namespaceURI)!==-1&&r.push(s)}return r}function ye(e,t,i){var r=_e(e,t,i);if(c(r)){var n=parseFloat(r.textContent);return isNaN(n)?void 0:n}}function Ce(e,t,i){var r=_e(e,t,i);if(c(r))return r.textContent.trim()}function we(e,t,i){var r=_e(e,t,i);if(c(r)){var n=r.textContent.trim();return"1"===n||/^true$/i.test(n)}}function Se(e,t,i,r){if(c(e)){var n=!1;if(c(r)){var o=r[e];if(c(o))n=!0,e=o;else{var a=f(e,i);o=r[a],c(o)&&(n=!0,e=o)}}return!n&&c(i)&&(e=f(e,f(i)),e=ue(e,t)),e}}function Ee(e,t){if(c(e)){"#"===e[0]&&(e=e.substring(1));var i=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?Pt.maximumRed=o:Pt.red=0,n>0?Pt.maximumGreen=n:Pt.green=0,r>0?Pt.maximumBlue=r:Pt.blue=0,Pt.alpha=i,s.fromRandom(Pt)):new s(o,n,r,i)}}function be(e,t,i){var r=Ce(e,t,i);if(c(r))return Ee(r,"random"===Ce(e,"colorMode",i))}function Te(e){var t=_e(e,"TimeStamp",At.kmlgx),i=Ce(t,"when",At.kmlgx);if(c(t)&&c(i)&&0!==i.length){var r=C.fromIso8601(i),n=new M;return n.addInterval(new D({start:r,stop:v.MAXIMUM_VALUE})),n}}function xe(e){var t=_e(e,"TimeSpan",At.kmlgx);if(c(t)){var i,r=_e(t,"begin",At.kmlgx),n=c(r)?C.fromIso8601(r.textContent):void 0,o=_e(t,"end",At.kmlgx),a=c(o)?C.fromIso8601(o.textContent):void 0;if(c(n)&&c(a)){if(C.lessThan(a,n)){var s=n;n=a,a=s}i=new M,i.addInterval(new D({start:n,stop:a}))}else c(n)?(i=new M,i.addInterval(new D({start:n,stop:v.MAXIMUM_VALUE}))):c(a)&&(i=new M,i.addInterval(new D({start:v.MINIMUM_VALUE,stop:a})));return i}}function Ae(){var e=new k;return e.width=yt,e.height=yt,e.scaleByDistance=new b(Ct,wt,St,Et),e.pixelOffsetScaleByDistance=new b(Ct,wt,St,Et),e}function Pe(){var e=new Z;return e.outline=!0,e.outlineColor=s.WHITE,e}function De(){var e=new Y;return e.translucencyByDistance=new b(3e6,1,5e6,0),e.pixelOffset=new i(17,0),e.horizontalOrigin=R.LEFT,e.font="16px sans-serif",e.style=O.FILL_AND_OUTLINE,e}function Me(e,t,i,r,n){var o=Ce(e,"href",At.kml);if(c(o)&&0!==o.length){if(0===o.indexOf("root://icons/palette-")){var a=o.charAt(21),s=u(ye(e,"x",At.gx),0),l=u(ye(e,"y",At.gx),0);s=Math.min(s/32,7),l=7-Math.min(l/32,7);var h=8*l+s;o="https://maps.google.com/mapfiles/kml/pal"+a+"/icon"+h+".png"}if(o=Se(o,t._proxy,i,r),n){var d=Ce(e,"refreshMode",At.kml),p=Ce(e,"viewRefreshMode",At.kml);"onInterval"===d||"onExpire"===d?console.log("KML - Unsupported Icon refreshMode: "+d):"onStop"!==p&&"onRegion"!==p||console.log("KML - Unsupported Icon viewRefreshMode: "+p);var m=u(Ce(e,"viewBoundScale",At.kml),1),f="onStop"===p?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",_=u(Ce(e,"viewFormat",At.kml),f),g=Ce(e,"httpQuery",At.kml),v=ot(_,g),C=y(o,v,!1);return at(t._camera,t._canvas,C,m,t._lastCameraView.bbox)}return o}}function Ie(e,n,o,a,s){var l=ye(n,"scale",At.kml),h=ye(n,"heading",At.kml),d=be(n,"color",At.kml),p=_e(n,"Icon",At.kml),m=Me(p,e,a,s,!1),f=ye(p,"x",At.gx),_=ye(p,"y",At.gx),g=ye(p,"w",At.gx),v=ye(p,"h",At.gx),y=_e(n,"hotSpot",At.kml),C=me(y,"x"),w=me(y,"y"),S=fe(y,"xunits"),b=fe(y,"yunits"),T=o.billboard;c(T)||(T=Ae(),o.billboard=T),T.image=m,T.scale=l,T.color=d,(c(f)||c(_)||c(g)||c(v))&&(T.imageSubRegion=new t(f,_,g,v)),c(h)&&0!==h&&(T.rotation=E.toRadians(-h),T.alignedAxis=r.UNIT_Z),l=u(l,1);var x,A;c(C)&&("pixels"===S?x=-C*l:"insetPixels"===S?x=(C-yt)*l:"fraction"===S&&(x=-C*yt*l),x+=.5*yt*l),c(w)&&("pixels"===b?A=w*l:"insetPixels"===b?A=(-w+yt)*l:"fraction"===b&&(A=w*yt*l),A-=.5*yt*l),(c(x)||c(A))&&(T.pixelOffset=new i(x,A))}function Re(e,t,i,r,n){for(var o=0,a=t.childNodes.length;o<a;o++){var l=t.childNodes.item(o);if("IconStyle"===l.localName)Ie(e,l,i,r,n);else if("LabelStyle"===l.localName){var h=i.label;c(h)||(h=De(),i.label=h),h.scale=u(ye(l,"scale",At.kml),h.scale),h.fillColor=u(be(l,"color",At.kml),h.fillColor),h.text=i.name}else if("LineStyle"===l.localName){var d=i.polyline;c(d)||(d=new K,i.polyline=d),d.width=ye(l,"width",At.kml),d.material=be(l,"color",At.kml),c(be(l,"outerColor",At.gx))&&console.log("KML - gx:outerColor is not supported in a LineStyle"),c(ye(l,"outerWidth",At.gx))&&console.log("KML - gx:outerWidth is not supported in a LineStyle"),c(ye(l,"physicalWidth",At.gx))&&console.log("KML - gx:physicalWidth is not supported in a LineStyle"),c(we(l,"labelVisibility",At.gx))&&console.log("KML - gx:labelVisibility is not supported in a LineStyle")}else if("PolyStyle"===l.localName){var p=i.polygon;c(p)||(p=Pe(),i.polygon=p),p.material=u(be(l,"color",At.kml),p.material),p.fill=u(we(l,"fill",At.kml),p.fill),p.outline=u(we(l,"outline",At.kml),p.outline)}else if("BalloonStyle"===l.localName){var m=u(Ee(Ce(l,"bgColor",At.kml)),s.WHITE),f=u(Ee(Ce(l,"textColor",At.kml)),s.BLACK),_=Ce(l,"text",At.kml);i.addProperty("balloonStyle"),i.balloonStyle={bgColor:m,textColor:f,text:_}}else if("ListStyle"===l.localName){var g=Ce(l,"listItemType",At.kml);"radioFolder"!==g&&"checkOffOnly"!==g||console.log("KML - Unsupported ListStyle with listItemType: "+g)}}}function Oe(e,t,i,r,n,o){for(var a,s=new H,l=-1,u=i.childNodes,h=u.length,d=0;d<h;d++){var p=u[d];"Style"!==p.localName&&"StyleMap"!==p.localName||(l=d)}if(l!==-1){var m=u[l];if("Style"===m.localName)Re(t,m,s,n,o);else for(var _=ve(m,"Pair",At.kml),g=0;g<_.length;g++){var v=_[g],y=Ce(v,"key",At.kml);if("normal"===y){var C=Ce(v,"styleUrl",At.kml);if(c(C))a=r.getById(C),c(a)||(a=r.getById("#"+C)),c(a)&&s.merge(a);else{var w=_e(v,"Style",At.kml);Re(t,w,s,n,o)}}else console.log("KML - Unsupported StyleMap key: "+y)}}var S=Ce(i,"styleUrl",At.kml);if(c(S)){var E=S;if("#"!==S[0]&&S.indexOf("#")!==-1){var b=S.split("#"),T=b[0];c(n)&&(T=f(T,f(n))),E=T+"#"+b[1]}a=r.getById(E),c(a)||(a=r.getById("#"+E)),c(a)&&s.merge(a)}return s}function Ne(e,t,i){return S(ue(t,e._proxy)).then(function(r){return Le(e,r,i,t,!0)})}function Le(e,t,i,r,n,o){var a,s,l,u,h=ge(t,"Style",At.kml);if(c(h)){var d=h.length;for(a=0;a<d;a++)u=h[a],s=fe(u,"id"),c(s)&&(s="#"+s,n&&c(r)&&(s=r+s),c(i.getById(s))||(l=new H({id:s}),i.add(l),Re(e,u,l,r,o)))}var p=ge(t,"StyleMap",At.kml);if(c(p)){var m=p.length;for(a=0;a<m;a++){var _=p[a];if(s=fe(_,"id"),c(s))for(var g=ve(_,"Pair",At.kml),v=0;v<g.length;v++){var y=g[v],C=Ce(y,"key",At.kml);if("normal"===C){if(s="#"+s,n&&c(r)&&(s=r+s),!c(i.getById(s))){l=i.getOrCreateEntity(s);var w=Ce(y,"styleUrl",At.kml);if(c(w)){"#"!==w[0]&&(w="#"+w),n&&c(r)&&(w=r+w);var S=i.getById(w);c(S)&&l.merge(S)}else u=_e(y,"Style",At.kml),Re(e,u,l,r,o)}}else console.log("KML - Unsupported StyleMap key: "+C)}}}var E={},b=[],T=t.getElementsByTagName("styleUrl"),x=T.length;for(a=0;a<x;a++){var A=T[a].textContent;if("#"!==A[0]){var P=A.split("#");if(2===P.length){var D=P[0];c(E[D])||(c(r)&&(D=f(D,f(r))),b.push(Ne(e,D,i,r)))}}}return b}function Be(e,t,i){var r=new $(e,t.id,["position"]),n=new te(t.position);t.polyline=c(i.polyline)?i.polyline.clone():new K,t.polyline.positions=new Q([r,n])}function Fe(e,t){return!c(e)&&!c(t)||"clampToGround"===e?I.CLAMP_TO_GROUND:"relativeToGround"===e?I.RELATIVE_TO_GROUND:"absolute"===e?I.NONE:"clampToSeaFloor"===t?(console.log("KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),I.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(console.log("KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),I.RELATIVE_TO_GROUND):(c(e)?console.log("KML - Unknown <kml:altitudeMode>:"+e+", using <kml:altitudeMode>:CLAMP_TO_GROUND."):console.log("KML - Unknown <gx:altitudeMode>:"+t+", using <kml:altitudeMode>:CLAMP_TO_GROUND."),I.CLAMP_TO_GROUND)}function Ve(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i)),new te(e))}function ke(e,t,i){if(c(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i));for(var r=e.length,n=0;n<r;n++){var o=e[n];p.WGS84.scaleToGeodeticSurface(o,o)}return e}}function ze(e,t,r,n){var o=t.label;c(o)||(o=c(r.label)?r.label.clone():De(),t.label=o),o.text=t.name;var a=t.billboard;c(a)||(a=c(r.billboard)?r.billboard.clone():Ae(),t.billboard=a),c(a.image)||(a.image=e._pinBuilder.fromColor(s.YELLOW,64));var l=1;c(a.scale)&&(l=a.scale.getValue(),0!==l?o.pixelOffset=new i(16*l+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(n)&&e._clampToGround&&(a.heightReference=n,o.heightReference=n)}function Ue(e,t,i){var r=t.path;c(r)||(r=new X,r.leadTime=0,t.path=r);var n=i.polyline;c(n)&&(r.material=n.material,r.width=n.width)}function Ge(e,t,i,r,n){var o=Ce(i,"coordinates",At.kml),a=Ce(i,"altitudeMode",At.kml),s=Ce(i,"altitudeMode",At.gx),l=we(i,"extrude",At.kml),u=de(o);return r.position=u,ze(e,r,n,Fe(a,s)),l&&he(a,s)&&Be(t,r,n),!0}function We(e,t,i,r,n){var o=_e(i,"coordinates",At.kml),a=Ce(i,"altitudeMode",At.kml),l=Ce(i,"altitudeMode",At.gx),h=we(i,"extrude",At.kml),d=we(i,"tessellate",At.kml),p=he(a,l);c(ye(i,"drawOrder",At.gx))&&console.log("KML - gx:drawOrder is not supported in LineStrings");var m=pe(o),f=n.polyline;if(p&&h){var _=new re;r.wall=_,_.positions=m;var g=n.polygon;c(g)&&(_.fill=g.fill,_.outline=g.outline,_.material=g.material),c(f)&&(_.outlineColor=c(f.material)?f.material.color:s.WHITE,_.outlineWidth=f.width)}else if(e._clampToGround&&!p&&d){var y=new U;r.corridor=y,y.positions=m,c(f)?(y.material=c(f.material)?f.material.color.getValue(v.MINIMUM_VALUE):s.WHITE,y.width=u(f.width,1)):(y.material=s.WHITE,y.width=1)}else f=c(f)?f.clone():new K,r.polyline=f,f.positions=ke(m,a,l),d&&!p||(f.followSurface=!1);return!0}function He(e,t,i,r,n){var o=_e(i,"outerBoundaryIs",At.kml),a=_e(o,"LinearRing",At.kml),l=_e(a,"coordinates",At.kml),u=pe(l),h=we(i,"extrude",At.kml),d=Ce(i,"altitudeMode",At.kml),p=Ce(i,"altitudeMode",At.gx),m=he(d,p),f=c(n.polygon)?n.polygon.clone():Pe(),_=n.polyline;if(c(_)&&(f.outlineColor=c(_.material)?_.material.color:s.WHITE,f.outlineWidth=_.width),r.polygon=f,m?(f.perPositionHeight=!0,f.extrudedHeight=h?0:void 0):e._clampToGround||(f.height=0),c(u)){for(var g=new x(u),v=ve(i,"innerBoundaryIs",At.kml),y=0;y<v.length;y++){a=ve(v[y],"LinearRing",At.kml);for(var C=0;C<a.length;C++)l=_e(a[C],"coordinates",At.kml),u=pe(l),c(u)&&g.holes.push(new x(u))}f.hierarchy=g}return!0}function qe(e,t,i,r,n){var o=Ce(i,"altitudeMode",At.kml),a=Ce(i,"altitudeMode",At.gx),s=ve(i,"coord",At.gx),l=ve(i,"angles",At.gx),u=ve(i,"when",At.kml),c=we(i,"extrude",At.kml),h=he(o,a);l.length>0&&console.log("KML - gx:angles are not supported in gx:Tracks");for(var d=Math.min(s.length,u.length),p=[],m=[],f=0;f<d;f++){var _=de(s[f].textContent);p.push(_),m.push(C.fromIso8601(u[f].textContent))}var g=new ee;return g.addSamples(m,p),r.position=g,ze(e,r,n,Fe(o,a)),Ue(e,r,n),r.availability=new M,u.length>0&&r.availability.addInterval(new D({start:m[0],stop:m[m.length-1]})),h&&c&&Be(t,r,n),!0}function je(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],h=new ee;h.addSamples(e,t),i.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:Ve(h,a,s)})),r.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function Ye(e,t,i,r,n){for(var o,a,s,l=we(i,"interpolate",At.gx),u=ve(i,"Track",At.gx),h=!1,d=new ie,p=new M,m=new z,f=0,_=u.length;f<_;f++){var g=u[f],v=ve(g,"when",At.kml),y=ve(g,"coord",At.gx),w=Ce(g,"altitudeMode",At.kml),S=Ce(g,"altitudeMode",At.gx),E=he(w,S),b=we(g,"extrude",At.kml),T=Math.min(y.length,v.length),x=[];o=[];for(var A=0;A<T;A++){var P=de(y[A].textContent);x.push(P),o.push(C.fromIso8601(v[A].textContent))}l&&(c(a)&&je([a,o[0]],[s,x[0]],m,p,d,!1,"absolute",void 0,!1),a=o[T-1],s=x[x.length-1]),je(o,x,m,p,d,E&&b,w,S,!0),h=h||E&&b}return r.availability=p,r.position=m,ze(e,r,n),Ue(e,r,n),h&&(Be(t,r,n),r.polyline.show=d),!0}function Xe(e,t,i,r,n,o){for(var a=i.childNodes,s=!1,l=0,u=a.length;l<u;l++){var h=a.item(l),d=Mt[h.localName];if(c(d)){var p=ce(h,t,o);p.parent=r,p.name=r.name,p.availability=r.availability,p.description=r.description,p.kml=r.kml,d(e,t,h,p,n)&&(s=!0)}}return s}function Ze(e,t,i,r,n){return console.log("KML - Unsupported geometry: "+i.localName),!1}function Ke(e,t){var i=_e(e,"ExtendedData",At.kml);if(c(i)){c(_e(i,"SchemaData",At.kml))&&console.log("KML - SchemaData is unsupported"),c(fe(i,"xmlns:prefix"))&&console.log("KML - ExtendedData with xmlns:prefix is unsupported");var r={},n=ve(i,"Data",At.kml);if(c(n))for(var o=n.length,a=0;a<o;a++){var s=n[a],l=fe(s,"name");c(l)&&(r[l]={displayName:Ce(s,"displayName",At.kml),value:Ce(s,"value",At.kml)})}t.kml.extendedData=r}}function Qe(e,t,i,r){var n,o,a,l=t.kml,h=l.extendedData,d=Ce(e,"description",At.kml),p=u(t.balloonStyle,i.balloonStyle),m=s.WHITE,f=s.BLACK,_=d;c(p)&&(m=u(p.bgColor,s.WHITE),f=u(p.textColor,s.BLACK),_=u(p.text,d));var g;if(c(_)){if(_=_.replace("$[name]",u(t.name,"")),_=_.replace("$[description]",u(d,"")),_=_.replace("$[address]",u(l.address,"")),_=_.replace("$[Snippet]",u(l.snippet,"")),_=_.replace("$[id]",t.id),_=_.replace("$[geDirections]",""),c(h)){var v=_.match(/\$\[.+?\]/g);if(null!==v)for(n=0;n<v.length;n++){var y=v[n],C=y.substr(2,y.length-3),w=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),g=h[C],c(g)&&(g=w?g.displayName:g.value),c(g)&&(_=_.replace(y,u(g,"")))}}}else if(c(h)&&(a=Object.keys(h),a.length>0)){for(_='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',n=0;n<a.length;n++)o=a[n],g=h[o],_+="<tr><th>"+u(g.displayName,o)+"</th><td>"+u(g.value,"")+"</td></tr>";_+="</tbody></table>"}if(c(_)){_=vt.link(_),Dt.innerHTML=_;var S=Dt.querySelectorAll("a");for(n=0;n<S.length;n++)S[n].setAttribute("target","_blank");c(r)&&r.keys.length>1&&(le(Dt,"a","href",r),le(Dt,"img","src",r));var E='<div class="cesium-infoBox-description-lighter" style="';E+="overflow:auto;",E+="word-wrap:break-word;",E+="background-color:"+m.toCssColorString()+";",E+="color:"+f.toCssColorString()+";",E+='">',E+=Dt.innerHTML+"</div>",Dt.innerHTML="",t.description=E}}function Je(e,t,i,r,n,o,a,s,l){function h(e){return!e||e.show&&h(e.parent)}var d=ce(i,r,l),p=d.kml,m=Oe(d,e,i,n,o,a),f=Ce(i,"name",At.kml);d.name=f,d.parent=t;var _=xe(i);c(_)||(_=Te(i)),d.availability=_,pt(d);var g=we(i,"visibility",At.kml);d.show=h(t)&&u(g,!0);var v=_e(i,"author",At.atom),y=p.author;y.name=Ce(v,"name",At.atom),y.uri=Ce(v,"uri",At.atom),y.email=Ce(v,"email",At.atom);var C=_e(i,"link",At.atom),w=p.link;return w.href=fe(C,"href"),w.hreflang=fe(C,"hreflang"),w.rel=fe(C,"rel"),w.type=fe(C,"type"),w.title=fe(C,"title"),w.length=fe(C,"length"),p.address=Ce(i,"address",At.kml),p.phoneNumber=Ce(i,"phoneNumber",At.kml),p.snippet=Ce(i,"Snippet",At.kml),Ke(i,d),Qe(i,d,m,a),c(_e(i,"Camera",At.kml))&&console.log("KML - Unsupported view: Camera"),c(_e(i,"LookAt",At.kml))&&console.log("KML - Unsupported view: LookAt"),c(_e(i,"Region",At.kml))&&console.log("KML - Placemark Regions are unsupported"),{entity:d,styleEntity:m}}function $e(e,t,i,r,n,o,a,s,l){for(var u=Object.keys(Bt),c=u.length,h=0;h<c;h++)for(var d=u[h],p=Bt[d],m=i.childNodes,f=m.length,_=0;_<f;_++){var g=m[_];g.localName!==d||At.kml.indexOf(g.namespaceURI)===-1&&At.gx.indexOf(g.namespaceURI)===-1||p(e,t,g,r,n,o,a,s,l)}}function et(e,t,i,r,n,o,a,s,l){var u=Je(e,t,i,r,n,o,a,s,l);$e(e,u.entity,i,r,n,o,a,s,l)}function tt(e,t,i,r,n,o,a,s,l){for(var u=Je(e,t,i,r,n,o,a,s,l),h=u.entity,d=u.styleEntity,p=!1,m=i.childNodes,f=0,_=m.length;f<_&&!p;f++){var g=m.item(f),v=Mt[g.localName];c(v)&&(v(e,r,g,h,d,h.id),p=!0)}p||(h.merge(d),ze(e,h,d))}function it(e,t,i,r,n,o,a,s,l){var u,h=Je(e,t,i,r,n,o,a,s,l),d=h.entity,p=!1,m=pe(_e(i,"LatLonQuad",At.gx));if(c(m))u=Pe(),u.hierarchy=new x(m),d.polygon=u,p=!0;else{u=new J,d.rectangle=u;var f=_e(i,"LatLonBox",At.kml);if(c(f)){var _=ye(f,"west",At.kml),g=ye(f,"south",At.kml),v=ye(f,"east",At.kml),y=ye(f,"north",At.kml);c(_)&&(_=E.negativePiToPi(E.toRadians(_))),c(g)&&(g=E.clampToLatitudeRange(E.toRadians(g))),c(v)&&(v=E.negativePiToPi(E.toRadians(v))),c(y)&&(y=E.clampToLatitudeRange(E.toRadians(y))),u.coordinates=new A(_,g,v,y);var C=ye(f,"rotation",At.kml);c(C)&&(u.rotation=E.toRadians(C))}}var w=_e(i,"Icon",At.kml),S=Me(w,e,o,a,!0);if(c(S)){p&&console.log("KML - gx:LatLonQuad Icon does not support texture projection.");var b=ye(w,"x",At.gx),T=ye(w,"y",At.gx),P=ye(w,"w",At.gx),D=ye(w,"h",At.gx);(c(b)||c(T)||c(P)||c(D))&&console.log("KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),u.material=S,u.material.color=be(i,"color",At.kml),u.material.transparent=!0}else u.material=be(i,"color",At.kml);var M=Ce(i,"altitudeMode",At.kml);c(M)?"absolute"===M?u.height=ye(i,"altitude",At.kml):"clampToGround"!==M&&console.log("KML - Unknown altitudeMode: "+M):(M=Ce(i,"altitudeMode",At.gx),"relativeToSeaFloor"===M?(console.log("KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),u.height=ye(i,"altitude",At.kml)):"clampToSeaFloor"===M?console.log("KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(M)&&console.log("KML - Unknown altitudeMode: "+M))}function rt(e,t,i,r,n,o,a,s,l){e._unsupportedNode.raiseEvent(e,t,i,r,n,o,a),console.log("KML - Unsupported feature: "+i.localName)}function nt(e){if(!c(e)||0===e.length)return"";var t=e[0];return"&"===t&&e.splice(0,1),"?"!==t&&(e="?"+e),e}function ot(e,t){var i="";return(c(e)&&e.length>0||c(t)&&t.length>0)&&(i+=y(nt(e),nt(t),!1)),i}function at(e,t,i,n,o){function a(e){return e<-E.PI_OVER_TWO?-E.PI_OVER_TWO:e>E.PI_OVER_TWO?E.PI_OVER_TWO:e}function s(e){return e>E.PI?e-E.TWO_PI:e<-E.PI?e+E.TWO_PI:e}if(c(e)&&e._mode!==N.MORPHING){var l,h,d=p.WGS84;if(o=u(o,Rt),c(t)&&(Nt.x=.5*t.clientWidth,Nt.y=.5*t.clientHeight,l=e.pickEllipsoid(Nt,d,Lt)),c(l)?h=d.cartesianToCartographic(l,Ot):(h=A.center(o,Ot),l=d.cartographicToCartesian(h)),c(n)&&!E.equalsEpsilon(n,1,E.EPSILON9)){var m=o.width*n*.5,f=o.height*n*.5;o=new A(s(h.longitude-m),a(h.latitude-f),s(h.longitude+m),a(h.latitude+f))}i=i.replace("[bboxWest]",E.toDegrees(o.west).toString()),i=i.replace("[bboxSouth]",E.toDegrees(o.south).toString()),i=i.replace("[bboxEast]",E.toDegrees(o.east).toString()),i=i.replace("[bboxNorth]",E.toDegrees(o.north).toString());var _=E.toDegrees(h.longitude).toString(),g=E.toDegrees(h.latitude).toString();i=i.replace("[lookatLon]",_),i=i.replace("[lookatLat]",g),i=i.replace("[lookatTilt]",E.toDegrees(e.pitch).toString()),i=i.replace("[lookatHeading]",E.toDegrees(e.heading).toString()),i=i.replace("[lookatRange]",r.distance(e.positionWC,l)),i=i.replace("[lookatTerrainLon]",_),i=i.replace("[lookatTerrainLat]",g),i=i.replace("[lookatTerrainAlt]",h.height.toString()),d.cartesianToCartographic(e.positionWC,Ot),i=i.replace("[cameraLon]",E.toDegrees(Ot.longitude).toString()),i=i.replace("[cameraLat]",E.toDegrees(Ot.latitude).toString()),i=i.replace("[cameraAlt]",E.toDegrees(Ot.height).toString());var v=e.frustum,y=v.aspectRatio,C="",w="";if(c(y)){var S=E.toDegrees(v.fov);y>1?(C=S,w=S/y):(w=S,C=S*y)}i=i.replace("[horizFov]",C.toString()),i=i.replace("[vertFov]",w.toString())}else i=i.replace("[bboxWest]","-180"),i=i.replace("[bboxSouth]","-90"),i=i.replace("[bboxEast]","180"),i=i.replace("[bboxNorth]","90"),i=i.replace("[lookatLon]",""),i=i.replace("[lookatLat]",""),i=i.replace("[lookatRange]",""),i=i.replace("[lookatTilt]",""),i=i.replace("[lookatHeading]",""),i=i.replace("[lookatTerrainLon]",""),i=i.replace("[lookatTerrainLat]",""),i=i.replace("[lookatTerrainAlt]",""),i=i.replace("[cameraLon]",""),i=i.replace("[cameraLat]",""),i=i.replace("[cameraAlt]",""),i=i.replace("[horizFov]",""),i=i.replace("[vertFov]","");return c(t)?(i=i.replace("[horizPixels]",t.clientWidth),i=i.replace("[vertPixels]",t.clientHeight)):(i=i.replace("[horizPixels]",""),i=i.replace("[vertPixels]","")),i=i.replace("[terrainEnabled]","1"),i=i.replace("[clientVersion]","1"),
i=i.replace("[kmlVersion]","2.2"),i=i.replace("[clientName]","Cesium"),i=i.replace("[language]","English")}function st(e,t,i,r,n,o,a,s,h){var d=Je(e,t,i,r,n,o,a,s,h),p=d.entity,m=_e(i,"Link",At.kml);if(c(m)||(m=_e(i,"Url",At.kml)),c(m)){var _=Ce(m,"href",At.kml);if(c(_)){var g=_;_=Se(_,void 0,o,a);var v;if(/^data:/.test(_))v=_,/\.kmz/i.test(o)||(g=f(g,o));else{g=_;var w=Ce(m,"viewRefreshMode",At.kml),S=u(Ce(m,"viewBoundScale",At.kml),1),E="onStop"===w?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=u(Ce(m,"viewFormat",At.kml),E),T=Ce(m,"httpQuery",At.kml),x=ot(b,T);v=at(e._camera,e._canvas,y(_,x,!1),S,e._lastCameraView.bbox)}var A={sourceUri:g,uriResolver:a,context:p.id},P=new j,D=ht(e,P,v,A).then(function(t){var i=e._entityCollection,r=P.values;i.suspendEvents();for(var n=0;n<r.length;n++){var o=r[n];c(o.parent)||(o.parent=p,pt(o)),i.add(o)}i.resumeEvents();var a=Ce(m,"refreshMode",At.kml),s=u(ye(m,"refreshInterval",At.kml),0);if("onInterval"===a&&s>0||"onExpire"===a||"onStop"===w){var h=_e(t,"NetworkLinkControl",At.kml),d=c(h),f=C.now(),g={id:l(),href:_,cookie:"",queryString:x,lastUpdated:f,updating:!1,entity:p,viewBoundScale:S,needsUpdate:!1,cameraUpdateTime:f},v=0;if(d&&(g.cookie=u(Ce(h,"cookie",At.kml),""),v=u(ye(h,"minRefreshPeriod",At.kml),0)),"onInterval"===a)d&&(s=Math.max(v,s)),g.refreshMode=It.INTERVAL,g.time=s;else if("onExpire"===a){var y;if(d&&(y=Ce(h,"expires",At.kml)),c(y))try{var E=C.fromIso8601(y),b=C.secondsDifference(E,f);b>0&&b<v&&C.addSeconds(f,v,E),g.refreshMode=It.EXPIRE,g.time=E}catch(e){console.log("KML - NetworkLinkControl expires is not a valid date")}else console.log("KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else e._camera?(g.refreshMode=It.STOP,g.time=u(ye(m,"viewRefreshTime",At.kml),0)):console.log("A NetworkLink with viewRefreshMode=onStop requires a camera be passed in when creating the KmlDataSource");c(g.refreshMode)&&e._networkLinks.set(g.id,g)}else"onRegion"===w&&console.log("KML - Unsupported viewRefreshMode: onRegion")});s.push(D)}}}function lt(e,t,i,r,n,o,a,s,l){var u=Bt[t.localName];c(u)?u(e,i,t,r,n,o,a,s,l):rt(e,i,t,r,n,o,a,s,l)}function ut(e,t,i,r,n,o){t.removeAll();var a=[],s=i.documentElement,l="Document"===s.localName?s:_e(s,"Document",At.kml),u=Ce(l,"name",At.kml);!c(u)&&c(r)&&(u=g(r)),c(e._name)||(e._name=u);var h=new j(e);return F.all(Le(e,i,h,r,!1,n,o)).then(function(){var s=i.documentElement;if("kml"===s.localName)for(var l=s.childNodes,u=0;u<l.length;u++){var d=l[u];if(c(Bt[d.localName])){s=d;break}}return t.suspendEvents(),lt(e,s,void 0,t,h,r,n,a,o),t.resumeEvents(),F.all(a).then(function(){return i.documentElement})})}function ct(e,t,i,r){var n=F.defer();return V.createReader(new V.BlobReader(i),function(i){i.getEntries(function(o){for(var a,s,l=[],u={},h=0;h<o.length;h++){var d=o[h];if(!d.directory){var p=F.defer();l.push(p.promise),/\.kml$/i.test(d.filename)?c(a)&&/\//i.test(d.filename)?se(i,d,u,p):(c(a)&&se(i,a,u,s),a=d,s=p):se(i,d,u,p)}}c(a)&&ae(i,a,u,s),F.all(l).then(function(){return i.close(),c(u.kml)?(u.keys=Object.keys(u),ut(e,t,u.kml,r,u)):void n.reject(new P("KMZ file does not contain a KML document."))}).then(n.resolve).otherwise(n.reject)})},function(e){n.reject(e)}),n.promise}function ht(e,t,i,r){r=u(r,u.EMPTY_OBJECT);var n=r.sourceUri,o=r.uriResolver,a=r.context,s=i;return"string"==typeof i&&(s=w(ue(i,e._proxy)),n=u(n,i)),F(s).then(function(i){return i instanceof Blob?ne(i).then(function(r){return r?ct(e,t,i,n):oe(i).then(function(i){var r,s;try{r=gt.parseFromString(i,"application/xml")}catch(e){s=e.toString()}if(c(s)||r.body||"parsererror"===r.documentElement.tagName){var l=c(s)?s:r.documentElement.firstChild.nodeValue;throw l||(l=r.body.innerText),new P(l)}return ut(e,t,r,n,o,a)})}):ut(e,t,i,n,o,a)}).otherwise(function(t){return e._error.raiseEvent(e,t),console.log(t),F.reject(t)})}function dt(t){t=u(t,{});var i=t.camera,n=t.canvas;this._changed=new m,this._error=new m,this._loading=new m,this._refresh=new m,this._unsupportedNode=new m,this._clock=void 0,this._entityCollection=new j(this),this._name=void 0,this._isLoading=!1,this._proxy=t.proxy,this._pinBuilder=new T,this._networkLinks=new e,this._entityCluster=new q,this._canvas=n,this._camera=i,this._lastCameraView={position:c(i)?r.clone(i.positionWC):void 0,direction:c(i)?r.clone(i.directionWC):void 0,up:c(i)?r.clone(i.upWC):void 0,bbox:c(i)?i.computeViewRectangle():A.clone(A.MAX_VALUE)}}function pt(e){var t=e.parent;if(c(t)){var i=t.availability;if(c(i)){var r=e.availability;c(r)?r.intersect(i):e.availability=i}}}function mt(e,t,i,r,n){return function(o){function a(e){w.remove(e);for(var t=e._children,i=t.length,r=0;r<i;++r)a(t[r])}if(r.contains(t.id)){var s=!1,l=_e(o,"NetworkLinkControl",At.kml),h=c(l),d=0;if(h){if(c(_e(l,"Update",At.kml)))return console.log("KML - NetworkLinkControl updates aren't supported."),t.updating=!1,void r.remove(t.id);t.cookie=u(Ce(l,"cookie",At.kml),""),d=u(ye(l,"minRefreshPeriod",At.kml),0)}var p=C.now(),m=t.refreshMode;if(m===It.INTERVAL)c(l)&&(t.time=Math.max(d,t.time));else if(m===It.EXPIRE){var f;if(c(l)&&(f=Ce(l,"expires",At.kml)),c(f))try{var _=C.fromIso8601(f),g=C.secondsDifference(_,p);g>0&&g<d&&C.addSeconds(p,d,_),t.time=_}catch(e){console.log("KML - NetworkLinkControl expires is not a valid date"),s=!0}else console.log("KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}var y=t.entity,w=e._entityCollection,S=i.values;w.suspendEvents();for(var E=w.values.slice(),b=0;b<E.length;++b){var T=E[b];T.parent===y&&(T.parent=void 0,a(T))}for(w.resumeEvents(),w.suspendEvents(),b=0;b<S.length;b++){var x=S[b];c(x.parent)||(x.parent=y,pt(x)),w.add(x)}w.resumeEvents(),s?r.remove(t.id):t.lastUpdated=p;var A=w.computeAvailability(),P=A.start,D=A.stop,M=C.equals(P,v.MINIMUM_VALUE),I=C.equals(D,v.MAXIMUM_VALUE);if(!M||!I){var R=e._clock;R.startTime===P&&R.stopTime===D||(R.startTime=P,R.stopTime=D,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,n)}}}function ft(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}if("undefined"==typeof DOMParser)return{};var _t={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){var t=e.toLowerCase();return t=_(t),_t[t]}},gt=new DOMParser,vt=new L({stripPrefix:!1,twitter:!1,email:!1,replaceFn:function(e,t){if(!t.protocolUrlMatch)return!1}}),yt=32,Ct=2414016,wt=1,St=16093e3,Et=.1,bt=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],Tt=["http://www.google.com/kml/ext/2.2"],xt=["http://www.w3.org/2005/Atom"],At={kml:bt,gx:Tt,atom:xt,kmlgx:bt.concat(Tt)},Pt={},Dt=document.createElement("div"),Mt={Point:Ge,LineString:We,LinearRing:We,Polygon:He,Track:qe,MultiTrack:Ye,MultiGeometry:Xe,Model:Ze},It={INTERVAL:0,EXPIRE:1,STOP:2},Rt=new A,Ot=new n,Nt=new i,Lt=new r,Bt={Document:$e,Folder:et,Placemark:tt,NetworkLink:st,GroundOverlay:it,PhotoOverlay:rt,ScreenOverlay:rt,Tour:rt};dt.load=function(e,t){t=u(t,u.EMPTY_OBJECT);var i=new dt(t);return i.load(e,t)},h(dt.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}}),dt.prototype.load=function(e,t){t=u(t,{}),G.setLoading(this,!0);var i=this._name;this._name=void 0,this._clampToGround=u(t.clampToGround,!1);var r=this;return ht(this,this._entityCollection,e,t).then(function(){var e,t=r._entityCollection.computeAvailability(),n=t.start,s=t.stop,l=C.equals(n,v.MINIMUM_VALUE),u=C.equals(s,v.MAXIMUM_VALUE);if(!l||!u){var c;l&&(c=new Date,c.setHours(0,0,0,0),n=C.fromDate(c)),u&&(c=new Date,c.setHours(24,0,0,0),s=C.fromDate(c)),e=new W,e.startTime=n,e.stopTime=s,e.currentTime=C.clone(n),e.clockRange=o.LOOP_STOP,e.clockStep=a.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(C.secondsDifference(s,n)/60,1),31556900))}var h=!1;return e!==r._clock&&(r._clock=e,h=!0),i!==r._name&&(h=!0),h&&r._changed.raiseEvent(r),G.setLoading(r,!1),r}).otherwise(function(e){return G.setLoading(r,!1),r._error.raiseEvent(r,e),console.log(e),F.reject(e)})};var Ft=new e;return dt.prototype.update=function(t){function i(e){for(var t=e._children,r=t.length,n=0;n<r;++n){var o=t[n];Ft.set(o.id,o),i(o)}}var n=this._networkLinks;if(0===n.length)return!0;var o=C.now(),a=this;Ft.removeAll();var s=!1,l=this._lastCameraView,u=this._camera;!c(u)||u.positionWC.equalsEpsilon(l.position,E.EPSILON7)&&u.directionWC.equalsEpsilon(l.direction,E.EPSILON7)&&u.upWC.equalsEpsilon(l.up,E.EPSILON7)||(l.position=r.clone(u.positionWC),l.direction=r.clone(u.directionWC),l.up=r.clone(u.upWC),l.bbox=u.computeViewRectangle(),s=!0);var h=new e,d=!1;return n.values.forEach(function(e){var t=e.entity;if(!Ft.contains(t.id)){if(!e.updating){var r=!1;if(e.refreshMode===It.INTERVAL?C.secondsDifference(o,e.lastUpdated)>e.time&&(r=!0):e.refreshMode===It.EXPIRE?C.greaterThan(o,e.time)&&(r=!0):e.refreshMode===It.STOP&&(s&&(e.needsUpdate=!0,e.cameraUpdateTime=o),e.needsUpdate&&C.secondsDifference(o,e.cameraUpdateTime)>=e.time&&(r=!0)),r){i(t),e.updating=!0;var n=new j,u=y(e.href,ot(e.cookie,e.queryString),!1);u=at(a._camera,a._canvas,u,e.viewBoundScale,l.bbox),ht(a,n,u,{context:t.id}).then(mt(a,e,n,h,u)).otherwise(function(t){var i="NetworkLink "+e.href+" refresh failed: "+t;console.log(i),a._error.raiseEvent(a,i)}),d=!0}}h.set(e.id,e)}}),d&&(this._networkLinks=h,this._changed.raiseEvent(this)),!0},dt}),i("DataSources/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/Event","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property","./VelocityVectorProperty"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,i){this._velocityVectorProperty=new c(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new o,this.ellipsoid=t(i,n.WGS84);var r=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){r._definitionChanged.raiseEvent(r)})}r(h.prototype,{isConstant:{get:function(){return u.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){var t=this._ellipsoid;t!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var d=new e,p=new e,m=new a;return h.prototype.getValue=function(e,t){var r=this._velocityVectorProperty._getValue(e,p,d);if(i(r))return l.rotationMatrixFromPositionVelocity(d,r,this._ellipsoid,m),s.fromRotationMatrix(m,t)},h.prototype.equals=function(e){return this===e||e instanceof h&&u.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},h}),i("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),i("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,i){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner}return r.ALL=i(new r({color:new e(0,0,0,0),depth:1,stencil:0})),r.prototype.execute=function(e,t){e.clear(this,t)},r}),i("Renderer/ComputeCommand",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT),this.vertexArray=i.vertexArray,this.fragmentShaderSource=i.fragmentShaderSource,this.shaderProgram=i.shaderProgram,this.uniformMap=i.uniformMap,this.outputTexture=i.outputTexture,this.preExecute=i.preExecute,this.postExecute=i.postExecute,this.persists=e(i.persists,!1),this.pass=t.COMPUTE,this.owner=i.owner}return i.prototype.execute=function(e){e.execute(this)},i}),i("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),i("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(e){this._context=e}function p(e,t){return new u({context:e,colorTextures:[t],destroyAttachments:!1})}function m(e,t){return h.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function f(t,r){return i(_)&&_.viewport.width===t&&_.viewport.height===r||(_=c.fromCache({viewport:new e(0,0,t,r)})),_}var _,g=new l({primitiveType:o.TRIANGLES}),v=new s({color:new t(0,0,0,0)});return d.prototype.execute=function(e){i(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,r=t.width,n=t.height,o=this._context,a=i(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=i(e.shaderProgram)?e.shaderProgram:m(o,e.fragmentShaderSource),l=p(o,t),u=f(r,n),c=e.uniformMap,h=v;h.framebuffer=l,h.renderState=u,h.execute(o);var d=g;d.vertexArray=a,d.renderState=u,d.shaderProgram=s,d.uniformMap=c,d.framebuffer=l,d.execute(o),l.destroy(),e.persists||(s.destroy(),i(e.vertexArray)&&a.destroy()),i(e.postExecute)&&e.postExecute(t)},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return r(this)},d}),i("Renderer/PassState",[],function(){"use strict";function e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return e}),i("Renderer/RenderbufferFormat",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={RGBA4:t.RGBA4,RGB5_A1:t.RGB5_A1,RGB565:t.RGB565,DEPTH_COMPONENT16:t.DEPTH_COMPONENT16,STENCIL_INDEX8:t.STENCIL_INDEX8,DEPTH_STENCIL:t.DEPTH_STENCIL,validate:function(e){return e===i.RGBA4||e===i.RGB5_A1||e===i.RGB565||e===i.DEPTH_COMPONENT16||e===i.STENCIL_INDEX8||e===i.DEPTH_STENCIL}};return e(i)}),i("Renderer/Renderbuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=i.context,n=r._gl,s=(o.maximumRenderbufferSize,e(i.format,a.RGBA4)),l=t(i.width)?i.width:n.drawingBufferWidth,u=t(i.height)?i.height:n.drawingBufferHeight;this._gl=n,this._format=s,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,s,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return i(s.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),s.prototype._getRenderbuffer=function(){return this._renderbuffer},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),r(this)},s}),i("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){var i=new a(t);i.blendingEnabled=!1,i.scissorTest={enabled:!0,rectangle:new e},i.viewport=new e,this._context=t,this._fb=void 0,this._passState=i,this._width=0,this._height=0}c.prototype.begin=function(t){var i=this._context,n=i.drawingBufferWidth,a=i.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),r(this._fb)&&this._width===n&&this._height===a||(this._width=n,this._height=a,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:i,colorTextures:[new u({context:i,width:n,height:a})],depthStencilRenderbuffer:new s({context:i,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var h=new t;return c.prototype.end=function(e){for(var n=i(e.width,1),o=i(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),l=Math.max(n,o),u=l*l,c=Math.floor(.5*n),d=Math.floor(.5*o),p=0,m=0,f=0,_=-1,g=0;g<u;++g){if(-c<=p&&p<=c&&-d<=m&&m<=d){var v=4*((d-m)*n+p+c);h.red=t.byteToFloat(s[v]),h.green=t.byteToFloat(s[v+1]),h.blue=t.byteToFloat(s[v+2]),h.alpha=t.byteToFloat(s[v+3]);var y=a.getObjectByPickColor(h);if(r(y))return y}if(p===m||p<0&&-p===m||p>0&&p===1-m){var C=f;f=-_,_=C}p+=f,m+=_}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),i("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,i,r,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}return t(o.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),o.prototype.replaceShaderProgram=function(t){return e(t.shaderProgram)&&t.shaderProgram.destroy(),this.getShaderProgram(t)},o.prototype.getShaderProgram=function(e){var t=e.vertexShaderSource,i=e.fragmentShaderSource,o=e.attributeLocations;"string"==typeof t&&(t=new n({sources:[t]})),"string"==typeof i&&(i=new n({sources:[i]}));var a,s=t.createCombinedVertexShader(),l=i.createCombinedFragmentShader(),u=s+l+JSON.stringify(o);if(this._shaders[u])a=this._shaders[u],delete this._shadersToRelease[u];else{var c=this._context,h=new r({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:t,vertexShaderText:s,fragmentShaderSource:i,fragmentShaderText:l,attributeLocations:o});a={cache:this,shaderProgram:h,keyword:u,count:0},h._cachedShader=a,this._shaders[u]=a,++this._numberOfShaders}return++a.count,a.shaderProgram},o.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];delete this._shaders[i.keyword],i.shaderProgram.finalDestroy(),--this._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(t){if(e(t)){var i=t._cachedShader;i&&0===--i.count&&(this._shadersToRelease[i.keyword]=i)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return i(this)},o}),i("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(){this.globeDepthTexture=void 0,this._viewport=new e,this._viewportCartesian4=new r,this._viewportDirty=!1,this._viewportOrthographicMatrix=c.clone(c.IDENTITY),this._viewportTransformation=c.clone(c.IDENTITY),this._model=c.clone(c.IDENTITY),this._view=c.clone(c.IDENTITY),this._inverseView=c.clone(c.IDENTITY),this._projection=c.clone(c.IDENTITY),this._infiniteProjection=c.clone(c.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._frustumPlanes=new r,this._frameState=void 0,this._temeToPseudoFixed=u.clone(c.IDENTITY),this._view3DDirty=!0,this._view3D=new c,this._inverseView3DDirty=!0,this._inverseView3D=new c,this._inverseModelDirty=!0,this._inverseModel=new c,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new u,this._viewRotation=new u,this._inverseViewRotation=new u,this._viewRotation3D=new u,this._inverseViewRotation3D=new u,this._inverseProjectionDirty=!0,this._inverseProjection=new c,this._inverseProjectionOITDirty=!0,this._inverseProjectionOIT=new c,this._modelViewDirty=!0,this._modelView=new c,this._modelView3DDirty=!0,this._modelView3D=new c,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new c,this._inverseModelViewDirty=!0,this._inverseModelView=new c,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new c,this._viewProjectionDirty=!0,this._viewProjection=new c,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new c,this._modelViewProjectionDirty=!0,this._modelViewProjection=new c,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new c,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new c,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new c,this._normalDirty=!0,this._normal=new u,this._normal3DDirty=!0,this._normal3D=new u,this._inverseNormalDirty=!0,this._inverseNormal=new u,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new u,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new s,this._cameraPosition=new i,this._sunPositionWC=new i,this._sunPositionColumbusView=new i,this._sunDirectionWC=new i,this._sunDirectionEC=new i,this._moonDirectionEC=new i,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new i,this._cameraRight=new i,this._cameraUp=new i,this._frustum2DWidth=0,this._eyeHeight2D=new t,this._resolutionScale=1,this._fogDensity=void 0}function f(e,t){c.clone(t,e._view),c.getRotation(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function _(e,t){c.clone(t,e._inverseView),c.getRotation(t,e._inverseViewRotation)}function g(e,t){c.clone(t,e._projection),e._inverseProjectionDirty=!0,e._inverseProjectionOITDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function v(e,t){c.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function y(e,t){i.clone(t.positionWC,e._cameraPosition),i.clone(t.directionWC,e._cameraDirection),i.clone(t.rightWC,e._cameraRight),i.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function C(e,t){o(d.computeIcrfToFixedMatrix(t.time,W))||(W=d.computeTemeToPseudoFixedMatrix(t.time,W));var r=h.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);u.multiplyByVector(W,r,r),i.normalize(r,e._sunDirectionWC),r=u.multiplyByVector(e.viewRotation3D,r,e._sunDirectionEC),i.normalize(r,r),r=h.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),u.multiplyByVector(W,r,r),u.multiplyByVector(e.viewRotation3D,r,r),i.normalize(r,r);var n=t.mapProjection,a=n.ellipsoid,s=a.cartesianToCartographic(e._sunPositionWC,H);n.project(s,e._sunPositionColumbusView)}function w(e){if(e._viewportDirty){var t=e._viewport;c.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),c.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function S(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,c.inverse(e._projection,e._inverseProjection))}function E(e){e._inverseProjectionOITDirty&&(e._inverseProjectionOITDirty=!1,e._mode!==p.SCENE2D&&e._mode!==p.MORPHING?c.inverse(e._projection,e._inverseProjectionOIT):c.clone(c.IDENTITY,e._inverseProjectionOIT))}function b(e){e._modelViewDirty&&(e._modelViewDirty=!1,c.multiplyTransformation(e._view,e._model,e._modelView))}function T(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,c.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function x(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,c.inverse(e.modelView,e._inverseModelView))}function A(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,c.inverse(e.modelView3D,e._inverseModelView3D))}function P(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,c.multiply(e._projection,e._view,e._viewProjection))}function D(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,c.inverse(e.viewProjection,e._inverseViewProjection))}function M(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,c.multiply(e._projection,e.modelView,e._modelViewProjection))}function I(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,i=e._modelViewRelativeToEye;i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=0,i[13]=0,i[14]=0,i[15]=t[15]}}function R(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,c.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function O(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,c.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function N(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,c.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function L(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;c.getRotation(e.inverseModelView,t),u.transpose(t,t)}}function B(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;c.getRotation(e.inverseModelView3D,t),u.transpose(t,t)}}function F(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,c.getRotation(e.inverseModelView,e._inverseNormal))}function V(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,c.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function k(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,c.multiplyByPoint(e.inverseModel,e._cameraPosition,q),s.fromCartesian(q,e._encodedCameraPositionMC))}function z(e,t,r,n,a,s,u,h){var m=j;m.x=e.y,m.y=e.z,m.z=e.x;var f=Y;f.x=r.y,f.y=r.z,f.z=r.x;var _=X;_.x=n.y,_.y=n.z,_.z=n.x;var g=Z;g.x=t.y,g.y=t.z,g.z=t.x,s===p.SCENE2D&&(m.z=.5*a);var v=u.unproject(m,K);v.longitude=l.clamp(v.longitude,-Math.PI,Math.PI),v.latitude=l.clamp(v.latitude,-l.PI_OVER_TWO,l.PI_OVER_TWO);var y=u.ellipsoid,C=y.cartographicToCartesian(v,Q),w=d.eastNorthUpToFixedFrame(C,y,J);return c.multiplyByPointAsVector(w,f,f),c.multiplyByPointAsVector(w,_,_),c.multiplyByPointAsVector(w,g,g),o(h)||(h=new c),h[0]=f.x,h[1]=_.x,h[2]=-g.x,h[3]=0,h[4]=f.y,h[5]=_.y,h[6]=-g.y,h[7]=0,h[8]=f.z,h[9]=_.z,h[10]=-g.z,h[11]=0,h[12]=-i.dot(f,C),h[13]=-i.dot(_,C),h[14]=i.dot(g,C),h[15]=1,h}function U(e){e._view3DDirty&&(e._mode===p.SCENE3D?c.clone(e._view,e._view3D):z(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),c.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function G(e){e._inverseView3DDirty&&(c.inverseTransformation(e.view3D,e._inverseView3D),c.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}a(m.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(t){if(!e.equals(t,this._viewport)){e.clone(t,this._viewport);var i=this._viewport,r=this._viewportCartesian4;r.x=i.x,r.y=i.y,r.z=i.width,r.w=i.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return w(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return w(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){c.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,c.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,c.getRotation(this.inverseModel,e),u.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return U(this),this._view3D}},viewRotation:{get:function(){return U(this),this._viewRotation}},viewRotation3D:{get:function(){return U(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return G(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return G(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return S(this),this._inverseProjection}},inverseProjectionOIT:{get:function(){return E(this),this._inverseProjectionOIT}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return b(this),this._modelView}},modelView3D:{get:function(){return T(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return I(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return x(this),this._inverseModelView;
}},inverseModelView3D:{get:function(){return A(this),this._inverseModelView3D}},viewProjection:{get:function(){return P(this),this._viewProjection}},inverseViewProjection:{get:function(){return D(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return M(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return R(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return O(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return N(this),this._modelViewInfiniteProjection}},normal:{get:function(){return L(this),this._normal}},normal3D:{get:function(){return B(this),this._normal3D}},inverseNormal:{get:function(){return F(this),this._inverseNormal}},inverseNormal3D:{get:function(){return V(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},encodedCameraPositionMCHigh:{get:function(){return k(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return k(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}},fogDensity:{get:function(){return this._fogDensity}},pass:{get:function(){return this._pass}}});var W=new u,H=new n;m.prototype.updateCamera=function(e){f(this,e.viewMatrix),_(this,e.inverseViewMatrix),y(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum)},m.prototype.updateFrustum=function(e){g(this,e.projectionMatrix),o(e.infiniteProjectionMatrix)&&v(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,o(e.top)||(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},m.prototype.updatePass=function(e){this._pass=e},m.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var t=e.context._canvas;this._resolutionScale=t.width/t.clientWidth;var i=e.camera;this.updateCamera(i),e.mode===p.SCENE2D?(this._frustum2DWidth=i.frustum.right-i.frustum.left,this._eyeHeight2D.x=.5*this._frustum2DWidth,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),C(this,e),this._fogDensity=e.fog.density,this._frameState=e,this._temeToPseudoFixed=d.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed)};var q=new i,j=new i,Y=new i,X=new i,Z=new i,K=new n,Q=new i,J=new c;return m}),i("Renderer/Context",["../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Core/WebGLConstants","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P){"use strict";function D(e,t){var i="WebGL Error:  ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function M(e,t,i,r){for(var n=D(e,r)+": "+t.name+"(",o=0;o<i.length;++o)0!==o&&(n+=", "),n+=i[o];return n+=");"}function I(e,t,i){var r=e.getError();if(r!==e.NO_ERROR)throw new p(M(e,t,i,r))}function R(e,t,i){return{get:function(){var r=e[t];return i(e,"get: "+t,r),e[t]},set:function(r){e[t]=r,i(e,"set: "+t,r)}}}function O(e,t){function i(i){return function(){var r=i.apply(e,arguments);return t(e,i,arguments),r}}if(!t)return e;var r={};for(var n in e){var o=e[n];"function"==typeof o?r[n]=i(o):Object.defineProperty(r,n,R(e,n,t))}return r}function N(e,t){for(var i=t.length,r=0;r<i;++r){var n=e.getExtension(t[r]);if(n)return n}}function L(i,a){if("undefined"==typeof WebGLRenderingContext)throw new p("The browser does not support WebGL.  Visit http://get.webgl.org.");this._canvas=i,a=e(a,!0),a=n(a,{}),a.allowTextureFilterAnisotropic=n(a.allowTextureFilterAnisotropic,!0);var s=n(a.webgl,{});s.alpha=n(s.alpha,!1),s.stencil=n(s.stencil,!0);var l,u=!1,c="undefined"!=typeof WebGL2RenderingContext,h=!1;if(u&&c&&(l=i.getContext("webgl2",s)||i.getContext("experimental-webgl2",s)||void 0,o(l)&&(h=!0)),o(l)||(l=i.getContext("webgl",s)||i.getContext("experimental-webgl",s)||void 0),!o(l))throw new p("The browser supports WebGL, but initialization failed.");this._originalGLContext=l,this._webgl2=h,this._id=r(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new b(this);var d=this._gl=this._originalGLContext;this._redBits=d.getParameter(d.RED_BITS),this._greenBits=d.getParameter(d.GREEN_BITS),this._blueBits=d.getParameter(d.BLUE_BITS),this._alphaBits=d.getParameter(d.ALPHA_BITS),this._depthBits=d.getParameter(d.DEPTH_BITS),this._stencilBits=d.getParameter(d.STENCIL_BITS),v._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),v._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),v._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),v._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),v._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),v._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),v._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),v._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),v._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),v._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS);var f=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);v._minimumAliasedLineWidth=f[0],v._maximumAliasedLineWidth=f[1];var _=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);v._minimumAliasedPointSize=_[0],v._maximumAliasedPointSize=_[1];var g=d.getParameter(d.MAX_VIEWPORT_DIMS);v._maximumViewportWidth=g[0],v._maximumViewportHeight=g[1];var y=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);v._highpFloatSupported=0!==y.precision;var C=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);v._highpIntSupported=0!==C.rangeMax,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!N(d,["OES_standard_derivatives"]),this._elementIndexUint=!!N(d,["OES_element_index_uint"]),this._depthTexture=!!N(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=!!N(d,["OES_texture_float"]),this._fragDepth=!!N(d,["EXT_frag_depth"]),this._debugShaders=N(d,["WEBGL_debug_shaders"]);var S=a.allowTextureFilterAnisotropic?N(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=S,v._maximumTextureFilterAnisotropy=o(S)?d.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;var T,x,P,D,M,I,R,O,L,B;if(h){var F=this;T=function(){return F._gl.createVertexArray()},x=function(e){F._gl.bindVertexArray(e)},P=function(e){F._gl.deleteVertexArray(e)},D=function(e,t,i,r,n){d.drawElementsInstanced(e,t,i,r,n)},M=function(e,t,i,r){d.drawArraysInstanced(e,t,i,r)},I=function(e,t){d.vertexAttribDivisor(e,t)},R=function(e){d.drawBuffers(e)}}else O=N(d,["OES_vertex_array_object"]),o(O)&&(T=function(){return O.createVertexArrayOES()},x=function(e){O.bindVertexArrayOES(e)},P=function(e){O.deleteVertexArrayOES(e)}),L=N(d,["ANGLE_instanced_arrays"]),o(L)&&(D=function(e,t,i,r,n){L.drawElementsInstancedANGLE(e,t,i,r,n)},M=function(e,t,i,r){L.drawArraysInstancedANGLE(e,t,i,r)},I=function(e,t){L.vertexAttribDivisorANGLE(e,t)}),B=N(d,["WEBGL_draw_buffers"]),o(B)&&(R=function(e){B.drawBuffersWEBGL(e)});this.glCreateVertexArray=T,this.glBindVertexArray=x,this.glDeleteVertexArray=P,this.glDrawElementsInstanced=D,this.glDrawArraysInstanced=M,this.glVertexAttribDivisor=I,this.glDrawBuffers=R,this._vertexArrayObject=!!O,this._instancedArrays=!!L,this._drawBuffers=!!B,v._maximumDrawBuffers=this.drawBuffers?d.getParameter(m.MAX_DRAW_BUFFERS):1,v._maximumColorAttachments=this.drawBuffers?d.getParameter(m.MAX_COLOR_ATTACHMENTS):1;var V=d.getParameter(d.COLOR_CLEAR_VALUE);this._clearColor=new t(V[0],V[1],V[2],V[3]),this._clearDepth=d.getParameter(d.DEPTH_CLEAR_VALUE),this._clearStencil=d.getParameter(d.STENCIL_CLEAR_VALUE);var k=new A,z=new w(this),U=E.fromCache();this._defaultPassState=z,this._defaultRenderState=U,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=k,this._currentRenderState=U,this._currentPassState=z,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var G=0;G<v._maximumVertexAttributes;G++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=a,this.cache={},E.apply(d,U,z)}function B(e){}function F(e,t,i,r){var n=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=i,E.partialApply(e._gl,n,t,o,i,r)}function V(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var i=W;if(o(t))t._bind(),B(e),i=t._getActiveColorAttachments();else{var r=e._gl;r.bindFramebuffer(r.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(i)}}function k(e,t,i,r){var o=n(i._renderState,e._defaultRenderState);V(e,t),F(e,o,r,!1);var a=i._shaderProgram;a._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,a.maximumTextureUnitIndex)}function z(e,t){var i=t._primitiveType,r=t._vertexArray,a=t._offset,s=t._count,l=t.instanceCount;e._us.model=n(t._modelMatrix,h.IDENTITY),t._shaderProgram._setUniforms(t._uniformMap,e._us,e.validateShaderProgram),r._bind();var u=r.indexBuffer;o(u)?(a*=u.bytesPerIndex,s=n(s,u.numberOfIndices),0===l?e._gl.drawElements(i,s,u.indexDatatype,a):e.glDrawElementsInstanced(i,s,u.indexDatatype,a,l)):(s=n(s,r.numberOfVertices),0===l?e._gl.drawArrays(i,a,s):e.glDrawArraysInstanced(i,a,s,l)),r._unBind()}function U(e,t,i){this._pickObjects=e,this.key=t,this.color=i}var G={};a(L.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},uniformState:{get:function(){return this._us}},redBits:{get:function(){return this._redBits}},greenBits:{get:function(){return this._greenBits}},blueBits:{get:function(){return this._blueBits}},alphaBits:{get:function(){return this._alphaBits}},depthBits:{get:function(){return this._depthBits}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture}},floatingPointTexture:{get:function(){return this._textureFloat}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=O(this._originalGLContext,e?I:null)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new x({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),this._defaultTexture}},defaultCubeMap:{get:function(){if(void 0===this._defaultCubeMap){var e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new y({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e}})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return G}}});var W;"undefined"!=typeof WebGLRenderingContext&&(W=[m.BACK]);var H=new g;L.prototype.clear=function(e,i){e=n(e,H),i=n(i,this._defaultPassState);var r=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;o(s)&&(t.equals(this._clearColor,s)||(t.clone(s,this._clearColor),r.clearColor(s.red,s.green,s.blue,s.alpha)),a|=r.COLOR_BUFFER_BIT),o(l)&&(l!==this._clearDepth&&(this._clearDepth=l,r.clearDepth(l)),a|=r.DEPTH_BUFFER_BIT),o(u)&&(u!==this._clearStencil&&(this._clearStencil=u,r.clearStencil(u)),a|=r.STENCIL_BUFFER_BIT);var c=n(e.renderState,this._defaultRenderState);F(this,c,i,!0);var h=n(e.framebuffer,i.framebuffer);V(this,h),r.clear(a)},L.prototype.draw=function(e,t){t=n(t,this._defaultPassState);var i=n(e._framebuffer,t.framebuffer);k(this,i,e,t),z(this,e)},L.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=W;this.drawBuffers&&this.glDrawBuffers(t);var i=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;r<i;++r)e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},L.prototype.readPixels=function(e){var t=this._gl;e=e||{};var i=Math.max(e.x||0,0),r=Math.max(e.y||0,0),n=e.width||t.drawingBufferWidth,o=e.height||t.drawingBufferHeight,a=e.framebuffer,s=new Uint8Array(4*n*o);return V(this,a),t.readPixels(i,r,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s};var q={position:0,textureCoordinates:1};return L.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!o(e)){var t=new u({attributes:{position:new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new c({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:d.TRIANGLES});e=P.fromGeometry({context:this,geometry:t,attributeLocations:q,bufferUsage:_.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},L.prototype.createViewportQuadCommand=function(e,t){return t=n(t,n.EMPTY_OBJECT),new C({vertexArray:this.getViewportQuadVertexArray(),primitiveType:d.TRIANGLES,renderState:t.renderState,shaderProgram:T.fromCache({context:this,vertexShaderSource:f,fragmentShaderSource:e,attributeLocations:q}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer})},L.prototype.createPickFramebuffer=function(){return new S(this)},L.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},a(U.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),U.prototype.destroy=function(){delete this._pickObjects[this.key]},L.prototype.createPickId=function(e){++this._nextPickColor[0];var i=this._nextPickColor[0];if(0===i)throw new p("Out of unique Pick IDs.");return this._pickObjects[i]=e,new U(this._pickObjects,i,t.fromRgba(i))},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];o(i.destroy)&&i.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),s(this)},L}),i("Renderer/loadCubeMap",["../Core/defined","../Core/DeveloperError","../Core/loadImage","../ThirdParty/when","./CubeMap"],function(e,t,i,r,n){"use strict";function o(e,t,o){var a=[i(t.positiveX,o),i(t.negativeX,o),i(t.positiveY,o),i(t.negativeY,o),i(t.positiveZ,o),i(t.negativeZ,o)];return r.all(a,function(t){return new n({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})}return o}),i("Scene/DiscardMissingTileImagePolicy",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/getImagePixels","../Core/loadImageViaBlob","../ThirdParty/when"],function(e,t,i,r,n,o){"use strict";function a(i){function a(e){t(e.blob)&&(l._missingImageByteLength=e.blob.size);var n=r(e);if(i.disableCheckIfAllPixelsAreTransparent){for(var o=!0,a=e.width,s=i.pixelsToCheck,u=0,c=s.length;o&&u<c;++u){var h=s[u],d=4*h.x+h.y*a,p=n[d+3];p>0&&(o=!1)}o&&(n=void 0)}l._missingImagePixels=n,l._isReady=!0}function s(){l._missingImagePixels=void 0,l._isReady=!0}i=e(i,e.EMPTY_OBJECT),this._pixelsToCheck=i.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var l=this;o(n(i.missingImageUrl),a,s)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){var i=this._pixelsToCheck,n=this._missingImagePixels;if(!t(n))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var o=r(e),a=e.width,s=0,l=i.length;s<l;++s)for(var u=i[s],c=4*u.x+u.y*a,h=0;h<4;++h){var d=c+h;if(o[d]!==n[d])return!1}return!0},a}),i("Scene/ImageryLayerFeatureInfo",["../Core/defined"],function(e){"use strict";function t(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}return t.prototype.configureNameFromProperties=function(t){var i,r=10;for(var n in t)if(t.hasOwnProperty(n)&&t[n]){var o=n.toLowerCase();r>1&&"name"===o?(r=1,i=n):r>2&&"title"===o?(r=2,i=n):r>3&&/name/i.test(n)?(r=3,i=n):r>4&&/title/i.test(n)&&(r=4,i=n)}e(i)&&(this.name=t[i])},t.prototype.configureDescriptionFromProperties=function(t){function i(t){var r='<table class="cesium-infoBox-defaultTable">';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(r+="object"==typeof o?"<tr><td>"+n+"</td><td>"+i(o)+"</td></tr>":"<tr><td>"+n+"</td><td>"+o+"</td></tr>")}return r+="</table>"}this.description=i(t)},t}),i("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadImage","../Core/loadImageViaBlob","../Core/throttleRequestByServer"],function(e,t,i,r,n,o){"use strict";function a(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,i.throwInstantiationError()}return t(a.prototype,{ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},rectangle:{get:i.throwInstantiationError},tileWidth:{get:i.throwInstantiationError},tileHeight:{get:i.throwInstantiationError},maximumLevel:{get:i.throwInstantiationError},minimumLevel:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},tileDiscardPolicy:{get:i.throwInstantiationError},errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},proxy:{get:i.throwInstantiationError},hasAlphaChannel:{get:i.throwInstantiationError}}),a.prototype.getTileCredits=i.throwInstantiationError,a.prototype.requestImage=i.throwInstantiationError,a.prototype.pickFeatures=i.throwInstantiationError,a.loadImage=function(t,i){return e(t.tileDiscardPolicy)?o(i,n):o(i,r)},a}),i("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(i){function a(n){var a=n.tileInfo;if(o(a)){if(C._tileWidth=a.rows,C._tileHeight=a.cols,102100===a.spatialReference.wkid||102113===a.spatialReference.wkid)C._tilingScheme=new g({ellipsoid:i.ellipsoid});else{if(4326!==n.tileInfo.spatialReference.wkid){var s="Tile spatial reference WKID "+n.tileInfo.spatialReference.wkid+" is not supported.";return void(d=f.handleError(d,C,C._errorEvent,s,void 0,void 0,void 0,c))}C._tilingScheme=new u({ellipsoid:i.ellipsoid})}if(C._maximumLevel=n.tileInfo.lods.length-1,o(n.fullExtent)){if(o(n.fullExtent.spatialReference)&&o(n.fullExtent.spatialReference.wkid))if(102100===n.fullExtent.spatialReference.wkid||102113===n.fullExtent.spatialReference.wkid){var l=new _,h=n.fullExtent,m=l.unproject(new t(Math.max(h.xmin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(h.ymin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),v=l.unproject(new t(Math.min(h.xmax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(h.ymax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));C._rectangle=new p(m.longitude,m.latitude,v.longitude,v.latitude)}else{if(4326!==n.fullExtent.spatialReference.wkid){var w="fullExtent.spatialReference WKID "+n.fullExtent.spatialReference.wkid+" is not supported.";return void(d=f.handleError(d,C,C._errorEvent,w,void 0,void 0,void 0,c))}C._rectangle=p.fromDegrees(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax)}}else C._rectangle=C._tilingScheme.rectangle;o(C._tileDiscardPolicy)||(C._tileDiscardPolicy=new y({missingImageUrl:E(C,0,0,C._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),C._useTiles=!0}else C._useTiles=!1;o(n.copyrightText)&&n.copyrightText.length>0&&(C._credit=new r(n.copyrightText)),C._ready=!0,C._readyPromise.resolve(!0),f.handleSuccess(d)}function s(e){var t="An error occurred while accessing "+C._url+".";d=f.handleError(d,C,C._errorEvent,t,void 0,void 0,void 0,c),C._readyPromise.reject(new m(t))}function c(){var e={f:"json"};o(C._token)&&(e.token=C._token);var t=h(C._url,{parameters:e,proxy:C._proxy});v(t,a,s)}i=n(i,{}),this._url=i.url,this._token=i.token,this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._tileWidth=n(i.tileWidth,256),this._tileHeight=n(i.tileHeight,256),this._maximumLevel=i.maximumLevel,this._tilingScheme=n(i.tilingScheme,new u({ellipsoid:i.ellipsoid})),this._credit=void 0,this._useTiles=n(i.usePreCachedTilesIfAvailable,!0),this._rectangle=n(i.rectangle,this._tilingScheme.rectangle),this._layers=i.layers,this.enablePickFeatures=n(i.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=v.defer();var d,C=this;this._useTiles?c():(this._ready=!0,this._readyPromise.resolve(!0))}function E(e,t,i,r){var n;if(e._useTiles)n=e._url+"/tile/"+r+"/"+i+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;n=e._url+"/export?",n+="bbox="+s,n+=e._tilingScheme instanceof u?"&bboxSR=4326&imageSR=4326":"&bboxSR=3857&imageSR=3857",n+="&size="+e._tileWidth+"%2C"+e._tileHeight,n+="&format=png&transparent=true&f=image",e.layers&&(n+="&layers=show:"+e.layers)}var l=e._token;o(l)&&(n.indexOf("?")===-1&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var c=e._proxy;return o(c)&&(n=c.getURL(n)),n}return a(S.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),S.prototype.getTileCredits=function(e,t,i){},S.prototype.requestImage=function(e,t,i){var r=E(this,e,t,i);return w.loadImage(this,r)},S.prototype.pickFeatures=function(e,r,n,a,s){if(this.enablePickFeatures){var l,h,p,m=this._tilingScheme.tileXYToNativeRectangle(e,r,n);if(this._tilingScheme instanceof u)l=d.toDegrees(a),h=d.toDegrees(s),p="4326";else{var f=this._tilingScheme.projection.project(new i(a,s,0));l=f.x,h=f.y,p="3857"}var g=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return g+="&geometry="+l+","+h,g+="&mapExtent="+m.west+","+m.south+","+m.east+","+m.north,g+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",g+="&sr="+p,g+="&layers=visible",o(this._layers)&&(g+=":"+this._layers),o(this._token)&&(g+="&token="+this._token),o(this._proxy)&&(g=this._proxy.getURL(g)),c(g).then(function(e){var r=[],n=e.results;if(!o(n))return r;for(var a=0;a<n.length;++a){var s=n[a],l=new C;if(l.data=s,l.name=s.value,l.properties=s.attributes,l.configureDescriptionFromProperties(s.attributes),"esriGeometryPoint"===s.geometryType&&s.geometry){var u=s.geometry.spatialReference&&s.geometry.spatialReference.wkid?s.geometry.spatialReference.wkid:4326;if(4326===u||4283===u)l.position=i.fromDegrees(s.geometry.x,s.geometry.y,s.geometry.z);else if(102100===u||900913===u||3857===u){var c=new _;l.position=c.unproject(new t(s.geometry.x,s.geometry.y,s.geometry.z))}}r.push(l)}return r})}},S}),i("Scene/BingMapsStyle",["../Core/freezeObject"],function(e){"use strict";var t={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",ROAD:"Road",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};return e(t)}),i("Scene/BingMapsImageryProvider",["../Core/BingMapsApi","../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(o){function a(e){var r=e.resourceSets[0].resources[0];E._tileWidth=r.imageWidth,E._tileHeight=r.imageHeight,E._maximumLevel=r.zoomMax-1,E._imageUrlSubdomains=r.imageUrlSubdomains,E._imageUrlTemplate=r.imageUrl.replace("{culture}",E._culture);var o=E._tileProtocol;if(!n(o)){var a=document.location.protocol;o=/^http/.test(a)?a:"http:"}E._imageUrlTemplate=E._imageUrlTemplate.replace(/^http:/,o),n(E._tileDiscardPolicy)||(E._tileDiscardPolicy=new _({missingImageUrl:y(E,0,0,E._maximumLevel),pixelsToCheck:[new t(0,0),new t(120,140),new t(130,160),new t(200,50),new t(200,200)],disableCheckIfAllPixelsAreTransparent:!0}));var s=E._attributionList=r.imageryProviders;s||(s=E._attributionList=[]);for(var l=0,h=s.length;l<h;++l){var p=s[l];p.credit=new i(p.attribution);for(var m=p.coverageAreas,f=0,g=p.coverageAreas.length;f<g;++f){var v=m[f],C=v.bbox;v.bbox=new c(u.toRadians(C[1]),u.toRadians(C[0]),u.toRadians(C[3]),u.toRadians(C[2]))}}E._ready=!0,E._readyPromise.resolve(!0),d.handleSuccess(w)}function g(e){var t="An error occurred while accessing "+S+".";w=d.handleError(w,E,E._errorEvent,t,void 0,void 0,void 0,C),E._readyPromise.reject(new h(t))}function C(){var e=l(S,{callbackParameterName:"jsonp",proxy:E._proxy});m(e,a,g)}o=r(o,{}),this._key=e.getKey(o.key),this._keyErrorCredit=e.getErrorCredit(o.key),this._url=o.url,this._tileProtocol=o.tileProtocol,this._mapStyle=r(o.mapStyle,f.AERIAL),this._culture=r(o.culture,""),this._tileDiscardPolicy=o.tileDiscardPolicy,this._proxy=o.proxy,this._credit=new i("Bing Imagery",v._logoData,"http://www.bing.com"),this.defaultGamma=1,this._tilingScheme=new p({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:o.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new s,this._ready=!1,this._readyPromise=m.defer();var w,S=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle+"?incl=ImageryProviders&key="+this._key,E=this;C()}function y(e,t,i,r){var o=e._imageUrlTemplate,a=v.tileXYToQuadKey(t,i,r);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(t+i+r)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return n(u)&&(o=u.getURL(o)),o}function C(e,t,i){++t;for(var r=[],o=0,a=e.length;o<a;++o){for(var s=e[o],l=s.coverageAreas,u=!1,h=0,d=s.coverageAreas.length;!u&&h<d;++h){var p=l[h];if(t>=p.zoomMin&&t<=p.zoomMax){var m=c.intersection(i,p.bbox,S);n(m)&&(u=!0)}}u&&r.push(s.credit)}return r}o(v.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});var w=new c;v.prototype.getTileCredits=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,w),o=C(this._attributionList,i,r);return n(this._keyErrorCredit)&&o.push(this._keyErrorCredit),o},v.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},v.prototype.pickFeatures=function(){},v._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==",
v.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<<n,a=0;0!==(e&o)&&(a|=1),0!==(t&o)&&(a|=2),r+=a}return r},v.quadKeyToTileXY=function(e){for(var t=0,i=0,r=e.length-1,n=r;n>=0;--n){var o=1<<n,a=+e[r-n];0!==(1&a)&&(t|=o),0!==(2&a)&&(i|=o)}return{x:t,y:i,level:r}};var S=new c;return v}),i("Scene/CullingVolume",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Intersect","../Core/Plane"],function(e,t,i,r,n,o,a){"use strict";function s(e){this.planes=i(e,[])}var l=[new e,new e,new e];e.clone(e.UNIT_X,l[0]),e.clone(e.UNIT_Y,l[1]),e.clone(e.UNIT_Z,l[2]);var u=new e,c=new e,h=new a(new e,0);return s.fromBoundingSphere=function(i,n){r(n)||(n=new s);var o=l.length,a=n.planes;a.length=2*o;for(var h=i.center,d=i.radius,p=0,m=0;m<o;++m){var f=l[m],_=a[p],g=a[p+1];r(_)||(_=a[p]=new t),r(g)||(g=a[p+1]=new t),e.multiplyByScalar(f,-d,u),e.add(h,u,u),_.x=f.x,_.y=f.y,_.z=f.z,_.w=-e.dot(f,u),e.multiplyByScalar(f,d,u),e.add(h,u,u),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-e.dot(e.negate(f,c),u),p+=2}return n},s.prototype.computeVisibility=function(e){for(var t=this.planes,i=!1,r=0,n=t.length;r<n;++r){var s=e.intersectPlane(a.fromCartesian4(t[r],h));if(s===o.OUTSIDE)return o.OUTSIDE;s===o.INTERSECTING&&(i=!0)}return i?o.INTERSECTING:o.INSIDE},s.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===s.MASK_OUTSIDE||t===s.MASK_INSIDE)return t;for(var i=s.MASK_INSIDE,r=this.planes,n=0,l=r.length;n<l;++n){var u=n<31?1<<n:0;if(!(n<31&&0===(t&u))){var c=e.intersectPlane(a.fromCartesian4(r[n],h));if(c===o.OUTSIDE)return s.MASK_OUTSIDE;c===o.INTERSECTING&&(i|=u)}}return i},s.MASK_OUTSIDE=4294967295,s.MASK_INSIDE=0,s.MASK_INDETERMINATE=2147483647,s}),i("Scene/PerspectiveOffCenterFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._perspectiveMatrix=new o,this._infinitePerspective=new o}function l(e){var t=e.top,i=e.bottom,r=e.right,n=e.left,a=e.near,s=e.far;t===e._top&&i===e._bottom&&n===e._left&&r===e._right&&a===e._near&&s===e._far||(e._left=n,e._right=r,e._top=t,e._bottom=i,e._near=a,e._far=s,e._perspectiveMatrix=o.computePerspectiveOffCenter(n,r,i,t,a,s,e._perspectiveMatrix),e._infinitePerspective=o.computeInfinitePerspectiveOffCenter(n,r,i,t,a,e._infinitePerspective))}r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return l(this),this._infinitePerspective}}});var u=new e,c=new e,h=new e,d=new e;return s.prototype.computeCullingVolume=function(r,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,m=this.left,f=this.near,_=this.far,g=e.cross(n,o,u),v=c;e.multiplyByScalar(n,f,v),e.add(r,v,v);var y=h;e.multiplyByScalar(n,_,y),e.add(r,y,y);var C=d;e.multiplyByScalar(g,m,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(C,o,C);var w=a[0];return i(w)||(w=a[0]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),e.multiplyByScalar(g,p,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(o,C,C),w=a[1],i(w)||(w=a[1]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),e.multiplyByScalar(o,l,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(g,C,C),w=a[2],i(w)||(w=a[2]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),e.multiplyByScalar(o,s,C),e.add(v,C,C),e.subtract(C,r,C),e.normalize(C,C),e.cross(C,g,C),w=a[3],i(w)||(w=a[3]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,r),w=a[4],i(w)||(w=a[4]=new t),w.x=n.x,w.y=n.y,w.z=n.z,w.w=-e.dot(n,v),e.negate(n,C),w=a[5],i(w)||(w=a[5]=new t),w.x=C.x,w.y=C.y,w.z=C.z,w.w=-e.dot(C,y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,i,r){l(this);var n=1/this.near,o=this.top*n,a=2*i*o/t;o=this.right*n;var s=2*i*o/e;return r.x=s,r.y=a,r},s.prototype.clone=function(e){return i(e)||(e=new s),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},s.prototype.equals=function(e){return i(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s}),i("Scene/PerspectiveFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","./PerspectiveOffCenterFrustum"],function(e,t,i,r){"use strict";function n(){this._offCenterFrustum=new r,this.fov=void 0,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this.xOffset=0,this._xOffset=this.xOffset,this.yOffset=0,this._yOffset=this.yOffset}function o(e){var t=e._offCenterFrustum;e.fov===e._fov&&e.aspectRatio===e._aspectRatio&&e.near===e._near&&e.far===e._far&&e.xOffset===e._xOffset&&e.yOffset===e._yOffset||(e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:2*Math.atan(Math.tan(.5*e.fov)/e.aspectRatio),e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset,t.top=e.near*Math.tan(.5*e._fovy),t.bottom=-t.top,t.right=e.aspectRatio*t.top,t.left=-t.right,t.near=e.near,t.far=e.far,t.right+=e.xOffset,t.left+=e.xOffset,t.top+=e.yOffset,t.bottom+=e.yOffset)}return t(n.prototype,{projectionMatrix:{get:function(){return o(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return o(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return o(this),this._fovy}},sseDenominator:{get:function(){return o(this),this._sseDenominator}}}),n.prototype.computeCullingVolume=function(e,t,i){return o(this),this._offCenterFrustum.computeCullingVolume(e,t,i)},n.prototype.getPixelDimensions=function(e,t,i,r){return o(this),this._offCenterFrustum.getPixelDimensions(e,t,i,r)},n.prototype.clone=function(t){return e(t)||(t=new n),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},n.prototype.equals=function(t){return!!e(t)&&(o(this),o(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum))},n}),i("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t,i){var r,n,o;if(e instanceof l){var a=Math.tan(.5*e.fovy);return r=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*r/o,i*r/n)}return e instanceof u?(r=e.near,n=e.top,o=e.right,Math.max(t*r/o,i*r/n)):Math.max(t,i)}function d(e,i,r,o,a){var l=a,u=Math.max(r,o);if(!n(l)){var c=e.position,d=i,p=e.up,m=e.right,f=e.frustum,_=t.subtract(c,d,C),g=t.magnitude(t.multiplyByScalar(p,t.dot(_,p),w)),v=t.magnitude(t.multiplyByScalar(m,t.dot(_,m),w));l=Math.min(.2*h(f,g,v),1e9)}if(u<l){var y=8,S=1e6,E=-Math.pow((l-r)*S,1/y),b=Math.pow((l-o)*S,1/y);return function(e){var t=e*(b-E)+E;return-Math.pow(t,y)/S+l}}return function(e){return s.lerp(r,o,e)}}function p(e,t){return s.equalsEpsilon(e,s.TWO_PI,s.EPSILON11)&&(e=0),t>e+Math.PI?e+=s.TWO_PI:t<e-Math.PI&&(e-=s.TWO_PI),e}function m(i,r,n,o,a,l,u){function c(t){var i=t.time/r;h.setView({orientation:{heading:s.lerp(_,o,i),pitch:s.lerp(f,a,i),roll:s.lerp(g,l,i)}}),e.lerp(m,n,i,h.position),h.position.z=v(i)}var h=i.camera,m=t.clone(h.position,S),f=h.pitch,_=p(h.heading,o),g=p(h.roll,l),v=d(h,n,m.z,n.z,u);return c}function f(e,r,n,o,a,l,u){function c(e){var i=e.time/r,n=t.fromRadians(s.lerp(_.longitude,C.longitude,i),s.lerp(_.latitude,C.latitude,i),S(i));h.setView({destination:n,orientation:{heading:s.lerp(v,o,i),pitch:s.lerp(g,a,i),roll:s.lerp(y,l,i)}})}var h=e.camera,m=e.mapProjection,f=m.ellipsoid,_=i.clone(h.positionCartographic,E),g=h.pitch,v=p(h.heading,o),y=p(h.roll,l),C=f.cartesianToCartographic(n,b);_.longitude=s.zeroToTwoPi(_.longitude),C.longitude=s.zeroToTwoPi(C.longitude);var w=_.longitude-C.longitude;w<-s.PI?_.longitude+=s.TWO_PI:w>s.PI&&(C.longitude+=s.TWO_PI);var S=d(h,n,_.height,C.height,u);return c}function _(i,r,n,o,a,l,u){function c(t){var i=t.time/r;h.setView({orientation:{heading:s.lerp(f,o,i)}}),e.lerp(m,n,i,h.position);var a=g(i),l=h.frustum,u=l.top/l.right,c=.5*(a-(l.right-l.left));l.right+=c,l.left-=c,l.top=u*l.right,l.bottom=-l.top}var h=i.camera,m=t.clone(h.position,S),f=p(h.heading,o),_=h.frustum.right-h.frustum.left,g=d(h,n,_,n.z,u);return c}function g(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function v(e,t){function i(){"function"==typeof t&&t(),e.enableInputs=!0}return i}var y={},C=new t,w=new t,S=new t,E=new i,b=new i,T=new i,x=new t;return y.createTween=function(i,o){o=r(o,r.EMPTY_OBJECT);var l=o.destination,u=i.mode;if(u===c.MORPHING)return g();var h=r(o.convert,!0),d=i.mapProjection,p=d.ellipsoid,y=o.maximumHeight,C=o.easingFunction;h&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,T),l=d.project(T,x));var w=i.camera,S=o.endTransform;n(S)&&w._setTransform(S);var E=o.duration;n(E)||(E=Math.ceil(t.distance(w.position,l)/1e6)+2,E=Math.min(E,3));var b=r(o.heading,0),A=r(o.pitch,-s.PI_OVER_TWO),P=r(o.roll,0),D=i.screenSpaceCameraController;D.enableInputs=!1;var M=v(D,o.complete),I=v(D,o.cancel),R=w.frustum,O=i.mode===c.SCENE2D;if(O=O&&e.equalsEpsilon(w.position,l,s.EPSILON6),O=O&&s.equalsEpsilon(Math.max(R.right-R.left,R.top-R.bottom),l.z,s.EPSILON6),O=O||i.mode!==c.SCENE2D&&t.equalsEpsilon(l,w.position,s.EPSILON10),O=O&&s.equalsEpsilon(s.negativePiToPi(b),s.negativePiToPi(w.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(A),s.negativePiToPi(w.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(P),s.negativePiToPi(w.roll),s.EPSILON10))return g(M,I);var N=new Array(4);if(N[c.SCENE2D]=_,N[c.SCENE3D]=f,N[c.COLUMBUS_VIEW]=m,E<=0){var L=function(){var e=N[u](i,1,l,b,A,P,y);e({time:1}),"function"==typeof M&&M()};return g(L,I)}var B=N[u](i,E,l,b,A,P,y);if(!n(C)){var F=w.positionCartographic.height,V=u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z;C=F>V&&F>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:E,easingFunction:C,startObject:{time:0},stopObject:{time:E},update:B,complete:M,cancel:I}},y}),i("Scene/MapMode2D",["../Core/freezeObject"],function(e){"use strict";var t={ROTATE:0,INFINITE_SCROLL:1};return e(t)}),i("Scene/Camera",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/EllipsoidGeodesic","../Core/Event","../Core/HeadingPitchRange","../Core/Intersect","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./MapMode2D","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(e){this._scene=e,this._transform=v.clone(v.IDENTITY),this._invTransform=v.clone(v.IDENTITY),this._actualTransform=v.clone(v.IDENTITY),this._actualInvTransform=v.clone(v.IDENTITY),this._transformChanged=!1,this.position=new i,this._position=new i,this._positionWC=new i,this._positionCartographic=new n,this.direction=new i,this._direction=new i,this._directionWC=new i,this.up=new i,this._up=new i,this._upWC=new i,this.right=new i,this._right=new i,this._rightWC=new i,this.frustum=new T,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=_.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new d,this._moveEnd=new d,this._changed=new d,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new v,this._invViewMatrix=new v,P(this),this._mode=x.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new n(Math.PI,_.PI_OVER_TWO)),this._max2Dfrustum=void 0,this._suspendTerrainAdjustment=!1,j(this,A.DEFAULT_VIEW_RECTANGLE,this.position,!0);var r=i.magnitude(this.position);r+=r*A.DEFAULT_VIEW_FACTOR,i.normalize(this.position,this.position),i.multiplyByScalar(this.position,r,this.position)}function P(e){v.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),v.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),v.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function D(e){S.basisTo2D(e._projection,e._transform,e._actualTransform)}function M(e){var t=e._projection,n=t.ellipsoid,o=v.getColumn(e._transform,3,de),a=n.cartesianToCartographic(o,ue),s=t.project(a,ce),l=pe;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.clone(r.UNIT_X,_e),c=r.add(v.getColumn(e._transform,0,he),o,he);n.cartesianToCartographic(c,a),t.project(a,s);var h=me;h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,i.subtract(h,l,h),h.x=0;var d=fe;if(i.magnitudeSquared(h)>_.EPSILON10)i.cross(u,h,d);else{var p=r.add(v.getColumn(e._transform,1,he),o,he);n.cartesianToCartographic(p,a),t.project(a,s),d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,i.subtract(d,l,d),d.x=0,i.magnitudeSquared(d)<_.EPSILON10&&(r.clone(r.UNIT_Y,h),r.clone(r.UNIT_Z,d))}i.cross(d,u,h),i.normalize(h,h),i.cross(u,h,d),i.normalize(d,d),v.setColumn(e._actualTransform,0,h,e._actualTransform),v.setColumn(e._actualTransform,1,d,e._actualTransform),v.setColumn(e._actualTransform,2,u,e._actualTransform),v.setColumn(e._actualTransform,3,l,e._actualTransform)}function I(e){var t=e._mode,r=!1,n=0;t===x.SCENE2D&&(n=e.frustum.right-e.frustum.left,r=n!==e._positionCartographic.height);var o=e._position,a=!i.equals(o,e.position)||r;a&&(o=i.clone(e.position,e._position));var s=e._direction,l=!i.equals(s,e.direction);l&&(i.normalize(e.direction,e.direction),s=i.clone(e.direction,e._direction));var u=e._up,c=!i.equals(u,e.up);c&&(i.normalize(e.up,e.up),u=i.clone(e.up,e._up));var h=e._right,d=!i.equals(h,e.right);d&&(i.normalize(e.right,e.right),h=i.clone(e.right,e._right));var p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(v.inverseTransformation(e._transform,e._invTransform),e._mode===x.COLUMBUS_VIEW||e._mode===x.SCENE2D?v.equals(v.IDENTITY,e._transform)?v.clone(A.TRANSFORM_2D,e._actualTransform):e._mode===x.COLUMBUS_VIEW?D(e):M(e):v.clone(e._transform,e._actualTransform),v.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var m=e._actualTransform;if(a||p)if(e._positionWC=v.multiplyByPoint(m,o,e._positionWC),t===x.SCENE3D||t===x.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var f=ge;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===x.SCENE2D&&(f.z=n),e._projection.unproject(f,e._positionCartographic)}if(l||c||d){var g=i.dot(s,i.cross(u,h,ge));if(Math.abs(1-g)>_.EPSILON2){var y=1/i.magnitudeSquared(u),C=i.dot(u,s)*y,w=i.multiplyByScalar(s,C,ge);u=i.normalize(i.subtract(u,w,e._up),e._up),i.clone(u,e.up),h=i.cross(s,u,e._right),i.clone(h,e.right)}}(l||p)&&(e._directionWC=v.multiplyByPointAsVector(m,s,e._directionWC)),(c||p)&&(e._upWC=v.multiplyByPointAsVector(m,u,e._upWC)),(d||p)&&(e._rightWC=v.multiplyByPointAsVector(m,h,e._rightWC)),(a||l||c||d||p)&&P(e)}function R(e,t){var i;return i=_.equalsEpsilon(Math.abs(e.z),1,_.EPSILON3)?Math.atan2(t.y,t.x)-_.PI_OVER_TWO:Math.atan2(e.y,e.x)-_.PI_OVER_TWO,_.TWO_PI-_.zeroToTwoPi(i)}function O(e){return _.PI_OVER_TWO-_.acosClamped(e.z)}function N(e,t,i){var r=0;return _.equalsEpsilon(Math.abs(e.z),1,_.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=_.zeroToTwoPi(r+_.TWO_PI)),r}function L(e,t,r,n,o){var a=v.clone(e.transform,be),s=S.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Te);e._setTransform(s),i.clone(i.ZERO,e.position);var l=y.fromHeadingPitchRoll(r-_.PI_OVER_TWO,n,o,xe),u=g.fromQuaternion(l,Ae);g.getColumn(u,0,e.direction),g.getColumn(u,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(a)}function B(e,t,r,n,o,a){var s=v.clone(e.transform,be);if(e._setTransform(v.IDENTITY),!i.equals(t,e.positionWC)){if(a){var l=e._projection,u=l.ellipsoid.cartesianToCartographic(t,Pe);t=l.project(u,Ee)}i.clone(t,e.position)}var c=y.fromHeadingPitchRoll(r-_.PI_OVER_TWO,n,o,xe),h=g.fromQuaternion(c,Ae);g.getColumn(h,0,e.direction),g.getColumn(h,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(s)}function F(e,r,n,o){var a=-_.PI_OVER_TWO,s=0,l=v.clone(e.transform,be);if(e._setTransform(v.IDENTITY),!i.equals(r,e.positionWC)){if(o){var u=e._projection,c=u.ellipsoid.cartesianToCartographic(r,Pe);r=u.project(c,Ee)}t.clone(r,e.position);var h=.5*-r.z,d=-h,p=e.frustum;if(d>h){var m=p.top/p.right;p.right=d,p.left=h,p.top=p.right*m,p.bottom=-p.top}}if(e._scene.mapMode2D===b.ROTATE){var f=y.fromHeadingPitchRoll(n-_.PI_OVER_TWO,a,s,xe),C=g.fromQuaternion(f,Ae);g.getColumn(C,2,e.up),i.cross(e.direction,e.up,e.right)}e._setTransform(l)}function V(e,t,r,n){var o=i.clone(r.direction,De),a=i.clone(r.up,Me);if(e._scene.mode===x.SCENE3D){var s=e._projection.ellipsoid,l=S.eastNorthUpToFixedFrame(t,s,ve),u=v.inverseTransformation(l,ye);v.multiplyByPointAsVector(u,o,o),v.multiplyByPointAsVector(u,a,a)}var c=i.cross(o,a,Ie);return n.heading=R(o,a),n.pitch=O(o),n.roll=N(o,a,c),n}function k(e,t){var i,r,n=e._scene.mapMode2D===b.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;n?(r=o,i=-r):(r=t.x-2*o,i=t.x+2*o),t.x>o&&(t.x=r),t.x<-o&&(t.x=i),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}function z(e,t){var r=e.position,n=i.normalize(r,ke);if(a(e.constrainedAxis)){var o=i.equalsEpsilon(n,e.constrainedAxis,_.EPSILON2),s=i.equalsEpsilon(n,i.negate(e.constrainedAxis,Ge),_.EPSILON2);if(o||s)(o&&t<0||s&&t>0)&&e.rotate(e.right,t);else{var l=i.normalize(e.constrainedAxis,ze),u=i.dot(n,l),c=_.acosClamped(u);t>0&&t>c&&(t=c-_.EPSILON4),u=i.dot(n,i.negate(l,Ge)),c=_.acosClamped(u),t<0&&-t>c&&(t=-c+_.EPSILON4);var h=i.cross(l,n,Ue);e.rotate(h,t)}}else e.rotate(e.right,t)}function U(e,t){a(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function G(e,t){var i=e.frustum;t=.5*t;var r=i.right-t,n=i.left+t,o=e._maxCoord.x;e._scene.mapMode2D===b.ROTATE&&(o*=e.maximumZoomFactor),r>o&&(r=o,n=-o),r<=n&&(r=1,n=-1);var a=i.top/i.right;i.right=r,i.left=n,i.top=i.right*a,i.bottom=-i.top}function W(e,t){e.move(e.direction,t)}function H(e,t,r){t=_.clamp(t,-_.PI_OVER_TWO,_.PI_OVER_TWO),e=_.zeroToTwoPi(e)-_.PI_OVER_TWO;var n=y.fromAxisAngle(i.UNIT_Y,-t,qe),o=y.fromAxisAngle(i.UNIT_Z,-e,je),a=y.multiply(o,n,o),s=g.fromQuaternion(a,Ye),l=i.clone(i.UNIT_X,He);return g.multiplyByVector(s,l,l),i.negate(l,l),i.multiplyByScalar(l,r,l),l}function q(e,t,r,n){var o=Math.abs(i.dot(t,r));return o/n-i.dot(e,r)}function j(e,t,r,n){var o=e._projection.ellipsoid,s=n?e:ot,l=t.north,u=t.south,c=t.east,d=t.west;d>c&&(c+=_.TWO_PI);var p,m=.5*(d+c);if(u<-_.PI_OVER_TWO+_.RADIANS_PER_DEGREE&&l>_.PI_OVER_TWO-_.RADIANS_PER_DEGREE)p=0;else{var f=Ze;f.longitude=m,f.latitude=l,f.height=0;var g=Ke;g.longitude=m,g.latitude=u,g.height=0;var v=Xe;a(v)&&v.ellipsoid===o||(Xe=v=new h(void 0,void 0,o)),v.setEndPoints(f,g),p=v.interpolateUsingFraction(.5,Ze).latitude}var y=Ze;y.longitude=m,y.latitude=p,y.height=0;var C=o.cartographicToCartesian(y,rt),w=Ze;w.longitude=c,w.latitude=l;var S=o.cartographicToCartesian(w,Qe);w.longitude=d;var E=o.cartographicToCartesian(w,$e);w.longitude=m;var b=o.cartographicToCartesian(w,tt);w.latitude=u;var T=o.cartographicToCartesian(w,it);w.longitude=c;var x=o.cartographicToCartesian(w,et);w.longitude=d;var A=o.cartographicToCartesian(w,Je);i.subtract(E,C,E),i.subtract(x,C,x),i.subtract(S,C,S),i.subtract(A,C,A),i.subtract(b,C,b),i.subtract(T,C,T);var P=o.geodeticSurfaceNormal(C,s.direction);i.negate(P,P);var D=i.cross(P,i.UNIT_Z,s.right);i.normalize(D,D);var M=i.cross(D,P,s.up),I=Math.tan(.5*e.frustum.fovy),R=e.frustum.aspectRatio*I,O=Math.max(q(P,M,E,I),q(P,M,x,I),q(P,M,S,I),q(P,M,A,I),q(P,M,b,I),q(P,M,T,I),q(P,D,E,R),q(P,D,x,R),q(P,D,S,R),q(P,D,A,R),q(P,D,b,R),q(P,D,T,R));if(u<0&&l>0){var N=Ze;N.longitude=d,N.latitude=0,N.height=0;var L=o.cartographicToCartesian(N,nt);i.subtract(L,C,L),O=Math.max(O,q(P,M,L,I),q(P,D,L,R)),N.longitude=c,L=o.cartographicToCartesian(N,nt),i.subtract(L,C,L),O=Math.max(O,q(P,M,L,I),q(P,D,L,R))}return i.add(C,i.multiplyByScalar(P,-O,nt),r)}function Y(e,t,i){var r=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,a=at;a.longitude=t.east,a.latitude=t.north;var s=r.project(a,st);v.multiplyByPoint(n,s,s),v.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;var l=r.project(a,lt);v.multiplyByPoint(n,l,l),v.multiplyByPoint(o,l,l);var u=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*u;return i.x=.5*(s.x-l.x)+l.x,i.y=.5*(s.y-l.y)+l.y,i.z=.5*Math.max((s.x-l.x)/c,(s.y-l.y)/u),i}function X(e,t,i){var r=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=ut;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,ct);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,ht),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),h=e.frustum.right/e.frustum.top,d=c*h;return u>d?(a=u,s=a/h):(s=c,a=d),c=Math.max(2*a,2*s),i.x=.5*(o.x-l.x)+l.x,i.y=.5*(o.y-l.y)+l.y,n=r.unproject(i,n),n.height=c,i=r.project(n,i)}function Z(e,t,i,r){i=o(i,c.WGS84);var n=e.getPickRay(t,dt),a=f.rayEllipsoid(n,i);if(a){var s=a.start>0?a.start:a.stop;return C.getPoint(n,s,r)}}function K(e,t,i,r){var n=e.getPickRay(t,pt),o=n.origin;o.z=0;var a=i.unproject(o);if(!(a.latitude<-_.PI_OVER_TWO||a.latitude>_.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(a,r)}function Q(e,t,r,n){var o=e.getPickRay(t,mt),a=-o.origin.x/o.direction.x;C.getPoint(o,a,n);var s=r.unproject(new i(n.y,n.z,0));if(!(s.latitude<-_.PI_OVER_TWO||s.latitude>_.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return r.ellipsoid.cartographicToCartesian(s,n)}function J(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*t.x-1,h=2/a*(a-t.y)-1,d=e.positionWC;i.clone(d,r.origin);var p=i.multiplyByScalar(e.directionWC,u,ft);i.add(d,p,p);var m=i.multiplyByScalar(e.rightWC,c*u*l,_t),f=i.multiplyByScalar(e.upWC,h*u*s,gt),_=i.add(p,m,r.direction);return i.add(_,f,_),i.subtract(_,d,_),i.normalize(_,_),r}function $(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=2/o*t.x-1;s*=.5*(e.frustum.right-e.frustum.left);var l=2/a*(a-t.y)-1;l*=.5*(e.frustum.top-e.frustum.bottom);var u=r.origin;return i.clone(e.position,u),i.multiplyByScalar(e.right,s,vt),i.add(vt,u,u),i.multiplyByScalar(e.up,l,vt),i.add(vt,u,u),i.clone(e.directionWC,r.direction),r}function ee(e,t,r,n,o,a){function s(r){var n=i.lerp(t,l,r.time,new i);e.worldToCameraCoordinatesPoint(n,e.position)}var l=i.clone(t);return r.y>n?l.y-=r.y-n:r.y<-n&&(l.y+=-n-r.y),r.z>o?l.z-=r.z-o:r.z<-o&&(l.z+=-o-r.z),{easingFunction:u.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function te(e,t){var r=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(i.UNIT_X,St),a=-i.dot(o,r)/i.dot(o,n),s=i.add(r,i.multiplyByScalar(n,a,Et),Et);e.cameraToWorldCoordinatesPoint(s,s),r=e.cameraToWorldCoordinatesPoint(e.position,bt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=i.magnitude(i.subtract(r,s,Tt)),h=u*c,d=l*c,p=e._maxCoord.x,m=e._maxCoord.y,f=Math.max(h-p,p),_=Math.max(d-m,m);if(r.z<-f||r.z>f||r.y<-_||r.y>_){var g=s.y<-f||s.y>f,v=s.z<-_||s.z>_;if(g||v)return ee(e,r,s,f,_,t)}}function ie(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function re(e,t){var i,r,n=e.frustum,o=n.right/n.top,a=t*o;return t>a?(i=t,r=i/o):(r=t,i=a),1.5*Math.max(i,r)}function ne(e,t,i){a(i)||(i=p.clone(Pt));var r=i.range;if(!a(r)||0===r){var n=t.radius;0===n?i.range=Dt:i.range=e._mode===x.SCENE2D?re(e,n):ie(e,n)}return i}function oe(e,t){var r,n,o=t.radii,a=e.positionWC,s=i.multiplyComponents(t.oneOverRadii,a,Vt),l=i.magnitude(s),u=i.normalize(s,kt);i.equalsEpsilon(u,i.UNIT_Z,_.EPSILON10)?(r=new i(0,1,0),n=new i(0,0,1)):(r=i.normalize(i.cross(i.UNIT_Z,u,zt),zt),n=i.normalize(i.cross(u,r,Ut),Ut));var c=Math.sqrt(i.magnitudeSquared(s)-1),h=i.multiplyByScalar(u,1/l,Vt),d=c/l,p=i.multiplyByScalar(r,d,kt),m=i.multiplyByScalar(n,d,zt),f=i.add(h,m,Gt[0]);i.subtract(f,p,f),i.multiplyComponents(o,f,f);var g=i.subtract(h,m,Gt[1]);i.subtract(g,p,g),i.multiplyComponents(o,g,g);var v=i.subtract(h,m,Gt[2]);i.add(v,p,v),i.multiplyComponents(o,v,v);var y=i.add(h,m,Gt[3]);return i.add(y,p,y),i.multiplyComponents(o,y,y),Gt}function ae(e,t,i,r,n,o){Wt.x=e,Wt.y=t;var s=r.pickEllipsoid(Wt,n,Ht);return a(s)?(qt[i]=n.cartesianToCartographic(s,qt[i]),1):(qt[i]=n.cartesianToCartographic(o[i],qt[i]),0)}A.TRANSFORM_2D=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),A.TRANSFORM_2D_INVERSE=v.inverseTransformation(A.TRANSFORM_2D,new v),A.DEFAULT_VIEW_RECTANGLE=w.fromDegrees(-95,-20,-70,90),A.DEFAULT_VIEW_FACTOR=.5,A.prototype._updateCameraChanged=function(){var e=this;if(0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode===x.SCENE2D){if(!a(e._changedFrustum))return e._changedPosition=i.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var r,n=e.position,o=e._changedPosition,s=e.frustum,l=e._changedFrustum,u=n.x+s.left,c=n.x+s.right,h=o.x+l.left,d=o.x+l.right,p=n.y+s.bottom,m=n.y+s.top,f=o.y+l.bottom,g=o.y+l.top,v=Math.max(u,h),y=Math.min(c,d),C=Math.max(p,f),w=Math.min(m,g);if(v>=y||C>=m)r=1;else{var S=l;u<h&&c>d&&p<f&&m>g&&(S=s),r=1-(y-v)*(w-C)/((S.right-S.left)*(S.top-S.bottom))}return void(r>t&&(e._changed.raiseEvent(r),e._changedPosition=i.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!a(e._changedDirection))return e._changedPosition=i.clone(e.positionWC,e._changedPosition),void(e._changedDirection=i.clone(e.directionWC,e._changedDirection));var E=_.acosClamped(i.dot(e.directionWC,e._changedDirection)),b=E/(.5*e.frustum.fovy),T=i.distance(e.positionWC,e._changedPosition),A=T/e.positionCartographic.height;(b>t||A>t)&&(e._changed.raiseEvent(Math.max(b,A)),e._changedPosition=i.clone(e.positionWC,e._changedPosition),e._changedDirection=i.clone(e.directionWC,e._changedDirection))}};var se=new v,le=new n;A.prototype._adjustHeightForTerrain=function(){var e=this._scene,t=e.screenSpaceCameraController,r=t.enableCollisionDetection,n=t.minimumCollisionTerrainHeight,o=t.minimumZoomDistance;if(!this._suspendTerrainAdjustment&&r){var s=this._mode,l=e.globe;if(a(l)&&s!==x.SCENE2D&&s!==x.MORPHING){var u,c,h=l.ellipsoid,d=e.mapProjection;v.equals(this.transform,v.IDENTITY)||(u=v.clone(this.transform,se),c=i.magnitude(this.position),this._setTransform(v.IDENTITY));var p=le;s===x.SCENE3D?h.cartesianToCartographic(this.position,p):d.unproject(this.position,p);var m=!1;if(p.height<n){var f=l.getHeight(p);a(f)&&(f+=o,p.height<f&&(p.height=f,s===x.SCENE3D?h.cartographicToCartesian(p,this.position):d.project(p,this.position),m=!0))}a(u)&&(this._setTransform(u),m&&(i.normalize(this.position,this.position),i.negate(this.position,this.direction),i.multiplyByScalar(this.position,Math.max(c,o),this.position),i.normalize(this.direction,this.direction),i.cross(this.direction,this.up,this.right),i.cross(this.right,this.direction,this.up)))}}};var ue=new n,ce=new i,he=new i,de=new r,pe=new r,me=new r,fe=new r,_e=new r,ge=new i,ve=new v,ye=new v;s(A.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return I(this),this._invTransform}},viewMatrix:{get:function(){return I(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return I(this),this._invViewMatrix}},positionCartographic:{get:function(){return I(this),this._positionCartographic}},positionWC:{get:function(){return I(this),this._positionWC}},directionWC:{get:function(){return I(this),this._directionWC}},upWC:{get:function(){return I(this),this._upWC}},rightWC:{get:function(){return I(this),this._rightWC}},heading:{get:function(){if(this._mode!==x.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,ve),i=S.eastNorthUpToFixedFrame(this.positionWC,e,ye);this._setTransform(i);var r=R(this.direction,this.up);return this._setTransform(t),r}}},pitch:{get:function(){if(this._mode!==x.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,ve),i=S.eastNorthUpToFixedFrame(this.positionWC,e,ye);this._setTransform(i);var r=O(this.direction);return this._setTransform(t),r}}},roll:{get:function(){if(this._mode!==x.MORPHING){var e=this._projection.ellipsoid,t=v.clone(this._transform,ve),i=S.eastNorthUpToFixedFrame(this.positionWC,e,ye);this._setTransform(i);var r=N(this.direction,this.up,this.right);return this._setTransform(t),r}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),A.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==x.MORPHING,t=this._mode===x.SCENE2D),t){var i=this._max2Dfrustum=this.frustum.clone(),r=2,n=i.top/i.right;i.right=this._maxCoord.x*r,i.left=-i.right,i.top=n*i.right,i.bottom=-i.top}this._mode===x.SCENE2D&&k(this,this.position);var o=this._scene.globe,s=!a(o)||o._surface.tileProvider.ready&&0===o._surface._tileLoadQueueHigh.length&&0===o._surface._tileLoadQueueMedium.length&&0===o._surface._tileLoadQueueLow.length&&0===o._surface._debug.tilesWaitingForChildren;this._suspendTerrainAdjustment&&(this._suspendTerrainAdjustment=!s),this._adjustHeightForTerrain()};var Ce=new i,we=new i,Se=new i;A.prototype._setTransform=function(e){var t=i.clone(this.positionWC,Ce),r=i.clone(this.upWC,we),n=i.clone(this.directionWC,Se);v.clone(e,this._transform),this._transformChanged=!0,I(this);var o=this._actualInvTransform;v.multiplyByPoint(o,t,this.position),v.multiplyByPointAsVector(o,n,this.direction),v.multiplyByPointAsVector(o,r,this.up),i.cross(this.direction,this.up,this.right),I(this)};var Ee=new i,be=new v,Te=new v,xe=new y,Ae=new g,Pe=new n,De=new i,Me=new i,Ie=new i,Re={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0};A.prototype.setView=function(e){e=o(e,o.EMPTY_OBJECT);var t=o(e.orientation,o.EMPTY_OBJECT),r=this._mode;if(r!==x.MORPHING){a(e.endTransform)&&this._setTransform(e.endTransform);var n=o(e.convert,!0),s=o(e.destination,i.clone(this.positionWC,Ee));a(s)&&a(s.west)&&(s=this.getRectangleCameraCoordinates(s,Ee),n=!1),a(t.direction)&&(t=V(this,s,t,Re.orientation));var l=o(t.heading,0),u=o(t.pitch,-_.PI_OVER_TWO),c=o(t.roll,0);this._suspendTerrainAdjustment=!0,r===x.SCENE3D?L(this,s,l,u,c):r===x.SCENE2D?F(this,s,l,n):B(this,s,l,u,c,n)}};var Oe=new i;A.prototype.flyHome=function(e){var t=this._mode;if(t===x.MORPHING&&this._scene.completeMorph(),t===x.SCENE2D)this.flyTo({destination:w.MAX_VALUE,duration:e,endTransform:v.IDENTITY});else if(t===x.SCENE3D){var r=this.getRectangleCameraCoordinates(A.DEFAULT_VIEW_RECTANGLE),n=i.magnitude(r);n+=n*A.DEFAULT_VIEW_FACTOR,i.normalize(r,r),i.multiplyByScalar(r,n,r),this.flyTo({destination:r,duration:e,endTransform:v.IDENTITY})}else if(t===x.COLUMBUS_VIEW){var o=this._projection.ellipsoid.maximumRadius,a=new i(0,-1,1);a=i.multiplyByScalar(i.normalize(a,a),5*o,a),this.flyTo({destination:a,duration:e,orientation:{heading:0,pitch:-Math.acos(i.normalize(a,Oe).z),roll:0},endTransform:v.IDENTITY,convert:!1})}},A.prototype.worldToCameraCoordinates=function(e,t){
return a(t)||(t=new r),I(this),v.multiplyByVector(this._actualInvTransform,e,t)},A.prototype.worldToCameraCoordinatesPoint=function(e,t){return a(t)||(t=new i),I(this),v.multiplyByPoint(this._actualInvTransform,e,t)},A.prototype.worldToCameraCoordinatesVector=function(e,t){return a(t)||(t=new i),I(this),v.multiplyByPointAsVector(this._actualInvTransform,e,t)},A.prototype.cameraToWorldCoordinates=function(e,t){return a(t)||(t=new r),I(this),v.multiplyByVector(this._actualTransform,e,t)},A.prototype.cameraToWorldCoordinatesPoint=function(e,t){return a(t)||(t=new i),I(this),v.multiplyByPoint(this._actualTransform,e,t)},A.prototype.cameraToWorldCoordinatesVector=function(e,t){return a(t)||(t=new i),I(this),v.multiplyByPointAsVector(this._actualTransform,e,t)};var Ne=new i;A.prototype.move=function(e,t){var r=this.position;i.multiplyByScalar(e,t,Ne),i.add(r,Ne,r),this._mode===x.SCENE2D&&k(this,r)},A.prototype.moveForward=function(e){e=o(e,this.defaultMoveAmount),this.move(this.direction,e)},A.prototype.moveBackward=function(e){e=o(e,this.defaultMoveAmount),this.move(this.direction,-e)},A.prototype.moveUp=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,e)},A.prototype.moveDown=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,-e)},A.prototype.moveRight=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,e)},A.prototype.moveLeft=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,-e)},A.prototype.lookLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.up,-e)},A.prototype.lookRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.up,e)},A.prototype.lookUp=function(e){e=o(e,this.defaultLookAmount),this.look(this.right,-e)},A.prototype.lookDown=function(e){e=o(e,this.defaultLookAmount),this.look(this.right,e)};var Le=new y,Be=new g;A.prototype.look=function(e,t){var i=o(t,this.defaultLookAmount),r=y.fromAxisAngle(e,-i,Le),n=g.fromQuaternion(r,Be),a=this.direction,s=this.up,l=this.right;g.multiplyByVector(n,a,a),g.multiplyByVector(n,s,s),g.multiplyByVector(n,l,l)},A.prototype.twistLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,e)},A.prototype.twistRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,-e)};var Fe=new y,Ve=new g;A.prototype.rotate=function(e,t){var r=o(t,this.defaultRotateAmount),n=y.fromAxisAngle(e,-r,Fe),a=g.fromQuaternion(n,Ve);g.multiplyByVector(a,this.position,this.position),g.multiplyByVector(a,this.direction,this.direction),g.multiplyByVector(a,this.up,this.up),i.cross(this.direction,this.up,this.right),i.cross(this.right,this.direction,this.up)},A.prototype.rotateDown=function(e){e=o(e,this.defaultRotateAmount),z(this,e)},A.prototype.rotateUp=function(e){e=o(e,this.defaultRotateAmount),z(this,-e)};var ke=new i,ze=new i,Ue=new i,Ge=new i;A.prototype.rotateRight=function(e){e=o(e,this.defaultRotateAmount),U(this,-e)},A.prototype.rotateLeft=function(e){e=o(e,this.defaultRotateAmount),U(this,e)},A.prototype.zoomIn=function(e){e=o(e,this.defaultZoomAmount),this._mode===x.SCENE2D?G(this,e):W(this,e)},A.prototype.zoomOut=function(e){e=o(e,this.defaultZoomAmount),this._mode===x.SCENE2D?G(this,-e):W(this,-e)},A.prototype.getMagnitude=function(){return this._mode===x.SCENE3D?i.magnitude(this.position):this._mode===x.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===x.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var We=new v;A.prototype.lookAt=function(e,t){var i=S.eastNorthUpToFixedFrame(e,c.WGS84,We);this.lookAtTransform(i,t)};var He=new i,qe=new y,je=new y,Ye=new g;A.prototype.lookAtTransform=function(e,r){if(this._setTransform(e),a(r)){var n;if(n=a(r.heading)?H(r.heading,r.pitch,r.range):r,this._mode===x.SCENE2D){t.clone(t.ZERO,this.position),i.negate(n,this.up),this.up.z=0,i.magnitudeSquared(this.up)<_.EPSILON10&&i.clone(i.UNIT_Y,this.up),i.normalize(this.up,this.up),this._setTransform(v.IDENTITY),i.negate(i.UNIT_Z,this.direction),i.cross(this.direction,this.up,this.right),i.normalize(this.right,this.right);var o=this.frustum,s=o.top/o.right;return o.right=.5*i.magnitude(n),o.left=-o.right,o.top=s*o.right,o.bottom=-o.top,void this._setTransform(e)}i.clone(n,this.position),i.negate(this.position,this.direction),i.normalize(this.direction,this.direction),i.cross(this.direction,i.UNIT_Z,this.right),i.magnitudeSquared(this.right)<_.EPSILON10&&i.clone(i.UNIT_X,this.right),i.normalize(this.right,this.right),i.cross(this.right,this.direction,this.up),i.normalize(this.up,this.up)}};var Xe,Ze=new n,Ke=new n,Qe=new i,Je=new i,$e=new i,et=new i,tt=new i,it=new i,rt=new i,nt=new i,ot={direction:new i,right:new i,up:new i},at=new n,st=new i,lt=new i,ut=new n,ct=new i,ht=new i;A.prototype.getRectangleCameraCoordinates=function(e,t){var r=this._mode;return a(t)||(t=new i),r===x.SCENE3D?j(this,e,t):r===x.COLUMBUS_VIEW?Y(this,e,t):r===x.SCENE2D?X(this,e,t):void 0};var dt=new C,pt=new C,mt=new C;A.prototype.pickEllipsoid=function(e,t,r){if(a(r)||(r=new i),t=o(t,c.WGS84),this._mode===x.SCENE3D)r=Z(this,e,t,r);else if(this._mode===x.SCENE2D)r=K(this,e,this._projection,r);else{if(this._mode!==x.COLUMBUS_VIEW)return;r=Q(this,e,this._projection,r)}return r};var ft=new i,_t=new i,gt=new i,vt=new i;A.prototype.getPickRay=function(e,t){a(t)||(t=new C);var i=this.frustum;return a(i.aspectRatio)&&a(i.fov)&&a(i.near)?J(this,e,t):$(this,e,t)};var yt=new i,Ct=new i;A.prototype.distanceToBoundingSphere=function(e){var t=i.subtract(this.positionWC,e.center,yt),r=i.multiplyByScalar(this.directionWC,i.dot(t,this.directionWC),Ct);return Math.max(0,i.magnitude(r)-e.radius)};var wt=new t;A.prototype.getPixelSize=function(e,t,i){var r=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,i,r,wt);return Math.max(n.x,n.y)};var St=new i,Et=new i,bt=new i,Tt=new i;A.prototype.createCorrectPositionTween=function(e){if(this._mode===x.COLUMBUS_VIEW)return te(this,e)};var xt=new i,At={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};A.prototype.cancelFlight=function(){a(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},A.prototype.flyTo=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.destination,i=this._mode;if(i!==x.MORPHING){this.cancelFlight();var r=o(e.orientation,o.EMPTY_OBJECT);if(a(r.direction)&&(r=V(this,t,r,Re.orientation)),a(e.duration)&&e.duration<=0){var n=Re;return n.destination=e.destination,n.orientation.heading=r.heading,n.orientation.pitch=r.pitch,n.orientation.roll=r.roll,n.convert=e.convert,n.endTransform=e.endTransform,this.setView(n),void("function"==typeof e.complete&&e.complete())}var s=a(t.west);s&&(t=this.getRectangleCameraCoordinates(t,xt));var l,u=this;At.destination=t,At.heading=r.heading,At.pitch=r.pitch,At.roll=r.roll,At.duration=e.duration,At.complete=function(){l===u._currentFlight&&(u._currentFlight=void 0),a(e.complete)&&e.complete()},At.cancel=e.cancel,At.endTransform=e.endTransform,At.convert=!s&&e.convert,At.maximumHeight=e.maximumHeight,At.easingFunction=e.easingFunction;var c=this._scene;l=c.tweens.add(E.createTween(c,At)),this._currentFlight=l}};var Pt=new p(0,-_.PI_OVER_FOUR,0),Dt=100;A.prototype.viewBoundingSphere=function(e,t){t=ne(this,e,t),this.lookAt(e.center,t)};var Mt=new v,It=new i,Rt=new i,Ot=new i,Nt=new i,Lt=new r,Bt=new y,Ft=new g;A.prototype.flyToBoundingSphere=function(e,t){t=o(t,o.EMPTY_OBJECT);var r=this._mode===x.SCENE2D||this._mode===x.COLUMBUS_VIEW;this._setTransform(v.IDENTITY);var n,a=ne(this,e,t.offset);n=r?i.multiplyByScalar(i.UNIT_Z,a.range,It):H(a.heading,a.pitch,a.range);var s=S.eastNorthUpToFixedFrame(e.center,c.WGS84,Mt);v.multiplyByPoint(s,n,n);var l,u;if(!r){if(l=i.subtract(e.center,n,Rt),i.normalize(l,l),u=v.multiplyByPointAsVector(s,i.UNIT_Z,Ot),1-Math.abs(i.dot(l,u))<_.EPSILON6){var h=y.fromAxisAngle(l,a.heading,Bt),d=g.fromQuaternion(h,Ft);i.fromCartesian4(v.getColumn(s,1,Lt),u),g.multiplyByVector(d,u,u)}var p=i.cross(l,u,Nt);i.cross(p,l,u),i.normalize(u,u)}this.flyTo({destination:n,orientation:{direction:l,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction})};var Vt=new i,kt=new i,zt=new i,Ut=new i,Gt=[new i,new i,new i,new i],Wt=new t,Ht=new i,qt=[new n,new n,new n,new n];return A.prototype.computeViewRectangle=function(t,r){t=o(t,c.WGS84);var n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),a=new e(i.ZERO,t.maximumRadius),s=n.computeVisibility(a);if(s!==m.OUTSIDE){var l=this._scene.canvas,u=l.clientWidth,h=l.clientHeight,d=0,p=oe(this,t);if(d+=ae(0,0,0,this,t,p),d+=ae(0,h,1,this,t,p),d+=ae(u,h,2,this,t,p),d+=ae(u,0,3,this,t,p),d<2)return w.MAX_VALUE;r=w.fromCartographicArray(qt,r);for(var f=0,g=qt[3].longitude,v=0;v<4;++v){var y=qt[v].longitude,C=Math.abs(y-g);f+=C>_.PI?_.TWO_PI-C:C,g=y}return _.equalsEpsilon(Math.abs(f),_.TWO_PI,_.EPSILON9)&&(r.west=-_.PI,r.east=_.PI,qt[0].latitude>=0?r.north=_.PI_OVER_TWO:r.south=-_.PI_OVER_TWO),r}},A.clone=function(e,t){return a(t)||(t=new A(e._scene)),i.clone(e.position,t.position),i.clone(e.direction,t.direction),i.clone(e.up,t.up),i.clone(e.right,t.right),v.clone(e._transform,t.transform),t._transformChanged=!0,t},A}),i("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";var t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};return e(t)}),i("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){var r=e;return t(i)&&(r+="+"+i),r}function h(t,i){e.clone(t.distance.startPosition,i.distance.startPosition),e.clone(t.distance.endPosition,i.distance.endPosition),e.clone(t.angleAndHeight.startPosition,i.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,i.angleAndHeight.endPosition)}function d(i,r,n){var o=c(u.PINCH,r),a=i._update,s=i._isDown,d=i._eventStartPosition,p=i._pressTime,m=i._releaseTime;a[o]=!0,s[o]=!1,d[o]=new e;var f=i._movement[o];t(f)||(f=i._movement[o]={}),f.distance={startPosition:new e,endPosition:new e},f.angleAndHeight={startPosition:new e,endPosition:new e},f.prevAngle=0,i._eventHandler.setInputAction(function(t){i._buttonsDown++,s[o]=!0,p[o]=new Date,e.lerp(t.position1,t.position2,.5,d[o])},l.PINCH_START,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),s[o]=!1,m[o]=new Date},l.PINCH_END,r),i._eventHandler.setInputAction(function(t){if(s[o]){a[o]?(h(t,f),a[o]=!1,f.prevAngle=f.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,f.distance.endPosition),e.clone(t.angleAndHeight.endPosition,f.angleAndHeight.endPosition));for(var i=f.angleAndHeight.endPosition.x,r=f.prevAngle,l=2*Math.PI;i>=r+Math.PI;)i-=l;for(;i<r-Math.PI;)i+=l;f.angleAndHeight.endPosition.x=-i*n.clientWidth/12,f.angleAndHeight.startPosition.x=-r*n.clientWidth/12}},l.PINCH_MOVE,r)}function p(i,r){var n=c(u.WHEEL,r),o=i._update;o[n]=!0;var s=i._movement[n];t(s)||(s=i._movement[n]={}),s.startPosition=new e,s.endPosition=new e,i._eventHandler.setInputAction(function(t){var i=15*a.toRadians(t);o[n]?(e.clone(e.ZERO,s.startPosition),s.endPosition.x=0,s.endPosition.y=i,o[n]=!1):s.endPosition.y=s.endPosition.y+i},l.WHEEL,r)}function m(i,r,n){var o=c(n,r),a=i._isDown,s=i._eventStartPosition,h=i._pressTime,d=i._releaseTime;a[o]=!1,s[o]=new e;var p=i._lastMovement[o];t(p)||(p=i._lastMovement[o]={startPosition:new e,endPosition:new e,valid:!1});var m,f;n===u.LEFT_DRAG?(m=l.LEFT_DOWN,f=l.LEFT_UP):n===u.RIGHT_DRAG?(m=l.RIGHT_DOWN,f=l.RIGHT_UP):n===u.MIDDLE_DRAG&&(m=l.MIDDLE_DOWN,f=l.MIDDLE_UP),i._eventHandler.setInputAction(function(t){i._buttonsDown++,p.valid=!1,a[o]=!0,h[o]=new Date,e.clone(t.position,s[o])},m,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),a[o]=!1,d[o]=new Date},f,r)}function f(t,i){e.clone(t.startPosition,i.startPosition),e.clone(t.endPosition,i.endPosition)}function _(i,r){var n=i._update,o=i._movement,a=i._lastMovement,s=i._isDown;for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];if(t(d)){var p=c(d,r);n[p]=!0,t(i._lastMovement[p])||(i._lastMovement[p]={startPosition:new e,endPosition:new e,valid:!1}),t(i._movement[p])||(i._movement[p]={startPosition:new e,endPosition:new e})}}i._eventHandler.setInputAction(function(l){for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];if(t(d)){var p=c(d,r);s[p]&&(n[p]?(f(o[p],a[p]),a[p].valid=!0,f(l,o[p]),n[p]=!1):e.clone(l.endPosition,o[p].endPosition))}}e.clone(l.endPosition,i._currentMousePosition)},l.MOUSE_MOVE,r)}function g(i){this._eventHandler=new s(i,!0),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new e,p(this,void 0),d(this,void 0,i),m(this,void 0,u.LEFT_DRAG),m(this,void 0,u.RIGHT_DRAG),m(this,void 0,u.MIDDLE_DRAG),_(this,void 0);for(var r in o)if(o.hasOwnProperty(r)){var n=o[r];t(n)&&(p(this,n),d(this,n,i),m(this,n,u.LEFT_DRAG),m(this,n,u.RIGHT_DRAG),m(this,n,u.MIDDLE_DRAG),_(this,n))}}return i(g.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){var e=!(this._update[c(u.WHEEL)]&&this._update[c(u.WHEEL,o.SHIFT)]&&this._update[c(u.WHEEL,o.CTRL)]&&this._update[c(u.WHEEL,o.ALT)]);return this._buttonsDown>0||e}}}),g.prototype.isMoving=function(e,t){var i=c(e,t);return!this._update[i]},g.prototype.getMovement=function(e,t){var i=c(e,t),r=this._movement[i];return r},g.prototype.getLastMovement=function(e,t){var i=c(e,t),r=this._lastMovement[i];if(r.valid)return r},g.prototype.isButtonDown=function(e,t){var i=c(e,t);return this._isDown[i]},g.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL)return this._currentMousePosition;var i=c(e,t);return this._eventStartPosition[i]},g.prototype.getButtonPressTime=function(e,t){var i=c(e,t);return this._pressTime[i]},g.prototype.getButtonReleaseTime=function(e,t){var i=c(e,t);return this._releaseTime[i]},g.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),r(this)},g}),i("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/isArray","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C){"use strict";function w(e){this._errorEvent=new u,this._url=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesUrl=void 0,this._proxy=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}function S(e,t,i,r){return re=!1,oe=!1,b(e,e._urlParts,function(n){return n(e,t,i,r)})}function E(e,t,i,r,n,o,a){return re=!1,oe=!1,se=!1,ce=!1,b(e,e._pickFeaturesUrlParts,function(s){return s(e,t,i,r,n,o,a)})}function b(e,t,i){for(var r="",n=0;n<t.length;++n){var o=t[n];r+="string"==typeof o?o:encodeURIComponent(i(o))}var s=e._proxy;return a(s)&&(r=s.getURL(r)),r}function T(e,t){if(a(e)){for(var i,r,n=[],o=0,s=Object.keys(t);o<e.length;){i=Number.MAX_VALUE,r=void 0;for(var l=0;l<s.length;++l){var u=e.indexOf(s[l],o);u>=0&&u<i&&(i=u,r=s[l])}a(r)?(o<i&&n.push(e.substring(o,i)),n.push(t[r]),o=i+r.length):(n.push(e.substring(o)),o=e.length)}return n}}function x(e,t,i){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){var r=e.urlSchemeZeroPadding[t];if("string"==typeof r){var n=r.length;n>1&&(i=i.length>=n?i:new Array(n-i.toString().length+1).join("0")+i)}}return i}function A(e,t,i,r){return x(e,"{x}",t)}function P(e,t,i,r){var n=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return x(e,"{reverseX}",n)}function D(e,t,i,r){return x(e,"{y}",i)}function M(e,t,i,r){var n=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return x(e,"{reverseY}",n)}function I(e,t,i,r){var n=e.maximumLevel,o=a(n)&&r<n?n-r-1:r;return x(e,"{reverseZ}",o)}function R(e,t,i,r){return x(e,"{z}",r)}function O(e,t,i,r){var n=(t+i+r)%e._subdomains.length;return e._subdomains[n]}function N(e,t,i,r){re||(e.tilingScheme.tileXYToRectangle(t,i,r,ne),ne.west=_.toDegrees(ne.west),ne.south=_.toDegrees(ne.south),ne.east=_.toDegrees(ne.east),ne.north=_.toDegrees(ne.north),re=!0)}function L(e,t,i,r){return N(e,t,i,r),ne.west}function B(e,t,i,r){return N(e,t,i,r),ne.south}function F(e,t,i,r){return N(e,t,i,r),ne.east}function V(e,t,i,r){return N(e,t,i,r),ne.north}function k(e,t,i,r){oe||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,ae),oe=!0)}function z(e,t,i,r){return k(e,t,i,r),ae.west}function U(e,t,i,r){return k(e,t,i,r),ae.south}function G(e,t,i,r){return k(e,t,i,r),ae.east}function W(e,t,i,r){return k(e,t,i,r),ae.north}function H(e,t,i,r){return e.tileWidth}function q(e,t,i,r){return e.tileHeight}function j(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),le.x}function Y(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),le.y}function X(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),e.tileWidth-le.x-1}function Z(e,t,i,r,n,o,a){return K(e,t,i,r,n,o),e.tileHeight-le.y-1}function K(e,t,i,r,n,o,a){if(!se){te(e,t,i,r,n,o);var s=he,l=e.tilingScheme.tileXYToNativeRectangle(t,i,r,ue);le.x=e.tileWidth*(s.x-l.west)/l.width|0,le.y=e.tileHeight*(l.north-s.y)/l.height|0,se=!0}}function Q(e,t,i,r,n,o,a){return _.toDegrees(n)}function J(e,t,i,r,n,o,a){return _.toDegrees(o)}function $(e,t,i,r,n,o,a){return te(e,t,i,r,n,o),he.x}function ee(e,t,i,r,n,o,a){return te(e,t,i,r,n,o),he.y}function te(e,t,i,r,n,o,a){if(!ce){var s;if(e.tilingScheme instanceof c)he.x=_.toDegrees(n),he.y=_.toDegrees(o);else{var l=de;l.longitude=n,l.latitude=o,s=e.tilingScheme.projection.project(l,he)}ce=!0}}function ie(e,t,i,r,n,o,a){return a}s(w.prototype,{url:{get:function(){return this._url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesUrl}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return a(this._urlParts)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),w.prototype.reinitialize=function(e){var t=this;t._readyPromise=y(e).then(function(e){t.enablePickFeatures=o(e.enablePickFeatures,t.enablePickFeatures),t._url=e.url,t._urlSchemeZeroPadding=o(e.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._pickFeaturesUrl=e.pickFeaturesUrl,t._proxy=e.proxy,t._tileDiscardPolicy=e.tileDiscardPolicy,t._getFeatureInfoFormats=e.getFeatureInfoFormats,t._subdomains=e.subdomains,h(t._subdomains)?t._subdomains=t._subdomains.slice():a(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new v({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=g.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0);var i=e.credit;return"string"==typeof i&&(i=new n(i)),t._credit=i,t._urlParts=T(t._url,pe),t._pickFeaturesUrlParts=T(t._pickFeaturesUrl,me),!0})},w.prototype.getTileCredits=function(e,t,i){},w.prototype.requestImage=function(e,t,i){var r=S(this,e,t,i);return C.loadImage(this,r)},w.prototype.pickFeatures=function(e,t,i,r,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return y([]);var a=u._getFeatureInfoFormats[l],c=E(u,e,t,i,r,n,a.format);return++l,"json"===a.type?d(c).then(a.callback).otherwise(s):"xml"===a.type?f(c).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?p(c).then(a.callback).otherwise(s):m({url:c,responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesUrl)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var re=!1,ne=new g,oe=!1,ae=new g,se=!1,le=new e,ue=new g,ce=!1,he=new t,de=new i,pe={"{x}":A,"{y}":D,"{z}":R,"{s}":O,"{reverseX}":P,"{reverseY}":M,"{reverseZ}":I,"{westDegrees}":L,"{southDegrees}":B,"{eastDegrees}":F,"{northDegrees}":V,"{westProjected}":z,"{southProjected}":U,"{eastProjected}":G,"{northProjected}":W,"{width}":H,"{height}":q},me=r(pe,{"{i}":j,"{j}":Y,"{reverseI}":X,"{reverseJ}":Z,"{longitudeDegrees}":Q,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":ie});return w}),i("Scene/createOpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,{});var a=t(i.url,"https://a.tile.openstreetmap.org/");s.test(a)||(a+="/");var u=t(i.fileExtension,"png"),c=new n({ellipsoid:i.ellipsoid}),h=256,d=256,p=t(i.minimumLevel,0),m=i.maximumLevel,f=t(i.rectangle,c.rectangle),_=c.positionToTileXY(r.southwest(f),p),g=c.positionToTileXY(r.northeast(f),p),v=((Math.abs(g.x-_.x)+1)*(Math.abs(g.y-_.y)+1),t(i.credit,l));"string"==typeof v&&(v=new e(v));var y=a+"{z}/{x}/{y}."+u;return new o({url:y,proxy:i.proxy,credit:v,tilingScheme:c,tileWidth:h,tileHeight:d,minimumLevel:p,maximumLevel:m,rectangle:f})}var s=/\/$/,l=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return a}),i("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var u=[],c=r.geometry;i(c.attributes)&&i(c.primitiveType)||(c=c.constructor.createGeometry(c));var h=c.attributes,d=a.clone(t(r.modelMatrix,a.IDENTITY)),p=t(r.length,1e4);if(i(h.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:d})),i(h.binormal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"binormal",p),attributes:{color:new e(0,1,0,1)},modelMatrix:d})),i(h.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",p),attributes:{color:new e(0,0,1,1)},modelMatrix:d})),u.length>0)return new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})})}return u}),i("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(n){function m(s){for(var d,p,m,f,w=/tileformat/i,S=/tileset/i,E=/tilesets/i,b=/boundingbox/i,T=/srs/i,x=[],A=s.childNodes[0].childNodes,P=0;P<A.length;P++)if(w.test(A.item(P).nodeName))d=A.item(P);else if(E.test(A.item(P).nodeName)){m=A.item(P);for(var D=A.item(P).childNodes,M=0;M<D.length;M++)S.test(D.item(M).nodeName)&&x.push(D.item(M))}else b.test(A.item(P).nodeName)?p=A.item(P):T.test(A.item(P).nodeName)&&(f=A.item(P).textContent);var I=i(n.fileExtension,d.getAttribute("extension")),R=i(n.tileWidth,parseInt(d.getAttribute("width"),10)),O=i(n.tileHeight,parseInt(d.getAttribute("height"),10)),N=i(n.minimumLevel,parseInt(x[0].getAttribute("order"),10)),L=i(n.maximumLevel,parseInt(x[x.length-1].getAttribute("order"),10)),B=m.getAttribute("profile"),F=n.tilingScheme;if(!r(F))if("geodetic"===B||"global-geodetic"===B)F=new o({ellipsoid:n.ellipsoid});else{if("mercator"!==B&&"global-mercator"!==B){var V=a(v,"tilemapresource.xml")+"specifies an unsupported profile attribute, "+B+".";return g=c.handleError(g,C,C.errorEvent,V,void 0,void 0,void 0,_),void(g.retry||y.reject(new u(V)))}F=new h({ellipsoid:n.ellipsoid})}var k=l.clone(n.rectangle);if(!r(k)){var z,U,G,W,H=i(n.flipXY,!1);H?(G=new e(parseFloat(p.getAttribute("miny")),parseFloat(p.getAttribute("minx"))),W=new e(parseFloat(p.getAttribute("maxy")),parseFloat(p.getAttribute("maxx")))):(G=new e(parseFloat(p.getAttribute("minx")),parseFloat(p.getAttribute("miny"))),W=new e(parseFloat(p.getAttribute("maxx")),parseFloat(p.getAttribute("maxy"))));var q="geodetic"===B||"mercator"===B;if(F instanceof o||q)z=t.fromDegrees(G.x,G.y),U=t.fromDegrees(W.x,W.y);else{var j=F.projection;z=j.unproject(G),U=j.unproject(W)}k=new l(z.longitude,z.latitude,U.longitude,U.latitude)}k.west<F.rectangle.west&&(k.west=F.rectangle.west),k.east>F.rectangle.east&&(k.east=F.rectangle.east),k.south<F.rectangle.south&&(k.south=F.rectangle.south),k.north>F.rectangle.north&&(k.north=F.rectangle.north);var Y=F.positionToTileXY(l.southwest(k),N),X=F.positionToTileXY(l.northeast(k),N),Z=(Math.abs(X.x-Y.x)+1)*(Math.abs(X.y-Y.y)+1);Z>4&&(N=0);var K=a(v,"{z}/{x}/{reverseY}."+I);y.resolve({url:K,tilingScheme:F,rectangle:k,tileWidth:R,tileHeight:O,minimumLevel:N,maximumLevel:L,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function f(e){var t=i(n.fileExtension,"png"),o=i(n.tileWidth,256),s=i(n.tileHeight,256),l=i(n.minimumLevel,0),u=n.maximumLevel,c=r(n.tilingScheme)?n.tilingScheme:new h({ellipsoid:n.ellipsoid}),d=i(n.rectangle,c.rectangle),p=a(v,"{z}/{x}/{reverseY}."+t);y.resolve({url:p,tilingScheme:c,rectangle:d,tileWidth:o,tileHeight:s,minimumLevel:l,maximumLevel:u,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function _(){var e=a(v,"tilemapresource.xml"),t=n.proxy;r(t)&&(e=t.getURL(e)),s(e).then(m).otherwise(f)}n=i(n,{});var g,v=n.url,y=d.defer(),C=new p(y.promise);return _(),C}return m}),i("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,t,r){if(!i(e.element)){var n=e.text,o=e.link,a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(t.hasChildNodes()){var l=document.createElement("span");l.textContent=r,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!i(e.element)){var r=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",i(r)&&(a.alt=r,a.title=r),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}t.appendChild(e.element)}function s(t,i){for(var r=t.length,n=0;n<r;n++){var o=t[n];if(e.equals(o,i))return!0}return!1}function l(e){var t=e.element;if(i(t)){var r=t.parentNode;if(!e.hasImage()){var n=t.previousSibling;null===n&&(n=t.nextSibling),null!==n&&r.removeChild(n)}r.removeChild(t)}}function u(e,t){var r,n,a,s=e._displayedCredits.textCredits;for(r=0;r<t.length;r++)a=t[r],i(a)&&(n=s.indexOf(a),n===-1?o(a,e._textContainer,e._delimiter):s.splice(n,1));for(r=0;r<s.length;r++)a=s[r],i(a)&&l(a)}function c(e,t){var r,n,o,s=e._displayedCredits.imageCredits;for(r=0;r<t.length;r++)o=t[r],i(o)&&(n=s.indexOf(o),n===-1?a(o,e._imageContainer):s.splice(n,1));for(r=0;r<s.length;r++)o=s[r],i(o)&&l(o)}function h(e,i){var r=document.createElement("span");r.className="cesium-credit-imageContainer";var n=document.createElement("span");n.className="cesium-credit-textContainer",e.appendChild(r),e.appendChild(n),this._delimiter=t(i," • "),this._textContainer=n,this._imageContainer=r,this._defaultImageCredits=[],this._defaultTextCredits=[],this._displayedCredits={imageCredits:[],textCredits:[]},this._currentFrameCredits={imageCredits:[],textCredits:[]},this.container=e}return h.prototype.addCredit=function(e){if(e.hasImage()){var t=this._currentFrameCredits.imageCredits;s(this._defaultImageCredits,e)||(t[e.id]=e)}else{var i=this._currentFrameCredits.textCredits;s(this._defaultTextCredits,e)||(i[e.id]=e)}},h.prototype.addDefaultCredit=function(e){if(e.hasImage()){var t=this._defaultImageCredits;s(t,e)||t.push(e)}else{var i=this._defaultTextCredits;s(i,e)||i.push(e)}},h.prototype.removeDefaultCredit=function(e){var t;e.hasImage()?(t=this._defaultImageCredits.indexOf(e),t!==-1&&this._defaultImageCredits.splice(t,1)):(t=this._defaultTextCredits.indexOf(e),t!==-1&&this._defaultTextCredits.splice(t,1))},h.prototype.beginFrame=function(){this._currentFrameCredits.imageCredits.length=0,this._currentFrameCredits.textCredits.length=0},h.prototype.endFrame=function(){var e=this._defaultTextCredits.concat(this._currentFrameCredits.textCredits),t=this._defaultImageCredits.concat(this._currentFrameCredits.imageCredits);u(this,e),c(this,t),this._displayedCredits.textCredits=e,this._displayedCredits.imageCredits=t},h.prototype.destroy=function(){return this.container.removeChild(this._textContainer),this.container.removeChild(this._imageContainer),r(this)},h.prototype.isDestroyed=function(){return!1},h}),i("Scene/DebugAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./Appearance"],function(e,t,i,r,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT);var i,r=t.attributeName,o=t.perInstanceAttribute,a=e(t.glslDatatype,"vec3"),s="v_"+r;if("normal"===r||"binormal"===r||"tangent"===r)i="vec4 getColor() { return vec4(("+s+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===r&&(a="vec2"),a){case"float":i="vec4 getColor() { return vec4(vec3("+s+"), 1.0); }\n";break;case"vec2":i="vec4 getColor() { return vec4("+s+", 0.0, 1.0); }\n";break;case"vec3":i="vec4 getColor() { return vec4("+s+", 1.0); }\n";break;case"vec4":i="vec4 getColor() { return "+s+"; }\n"}var l="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(o?"":"attribute "+a+" "+r+";\n")+"varying "+a+" "+s+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(o?s+" = czm_batchTable_"+r+"(batchId);\n":s+" = "+r+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",u="varying "+a+" "+s+";\n"+i+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=e(t.translucent,!1),this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=n.getDefaultRenderState(!1,!1,t.renderState),this._closed=e(t.closed,!1),this._attributeName=r,this._glslDatatype=a}return i(o.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource;
}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}}),o.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,o.prototype.isTranslucent=n.prototype.isTranslucent,o.prototype.getRenderState=n.prototype.getRenderState,o}),i("Scene/DebugCameraPrimitive",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/Matrix4","../Core/PrimitiveType","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_){"use strict";function g(e){e=a(e,a.EMPTY_OBJECT),this._camera=e.camera,this._color=a(e.color,r.CYAN),this._updateOnChange=a(e.updateOnChange,!0),this.show=a(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitive=void 0,this._planesPrimitive=void 0}var v=new Array(8);v[0]=new i(-1,-1,-1,1),v[1]=new i(1,-1,-1,1),v[2]=new i(1,1,-1,1),v[3]=new i(-1,1,-1,1),v[4]=new i(-1,-1,1,1),v[5]=new i(1,-1,1,1),v[6]=new i(1,1,1,1),v[7]=new i(-1,1,1,1);for(var y=new p,C=new Array(8),w=0;w<8;++w)C[w]=new i;var S=new r;return g.prototype.update=function(a){if(this.show){if(this._updateOnChange&&(this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive=this._planesPrimitive&&this._planesPrimitive.destroy()),!s(this._outlinePrimitive)){for(var l=this._camera.viewMatrix,u=this._camera.frustum.projectionMatrix,g=p.multiply(u,l,y),w=p.inverse(g,y),E=new Float64Array(24),b=0;b<8;++b){var T=i.clone(v[b],C[b]);p.multiplyByVector(w,T,T),t.divideByScalar(T,T.w,T),E[3*b]=T.x,E[3*b+1]=T.y,E[3*b+2]=T.z}var x=new e.fromVertices(E),A=new h;A.position=new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:E});var P=new Uint16Array([0,1,1,2,2,3,3,0,0,4,4,7,7,3,7,6,6,2,2,1,1,5,5,4,5,6]);this._outlinePrimitive=new _({geometryInstances:new d({geometry:{attributes:A,indices:P,primitiveType:m.LINES,boundingSphere:x},attributes:{color:n.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new f({translucent:!1,flat:!0}),asynchronous:!1});var D=new Uint16Array([4,5,6,4,6,7,5,1,2,5,2,6,7,6,2,7,2,3,0,1,5,0,5,4,0,4,7,0,7,3,1,0,3,1,3,2]);this._planesPrimitive=new _({geometryInstances:new d({geometry:{attributes:A,indices:D,primitiveType:m.TRIANGLES,boundingSphere:x},attributes:{color:n.fromColor(r.fromAlpha(this._color,.1,S))},id:this.id,pickPrimitive:this}),appearance:new f({translucent:!0,flat:!0}),asynchronous:!1})}this._outlinePrimitive.update(a),this._planesPrimitive.update(a)}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive=this._planesPrimitive&&this._planesPrimitive.destroy(),l(this)},g}),i("Scene/DebugModelMatrixPrimitive",["../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/GeometryInstance","../Core/Matrix4","../Core/PolylineGeometry","./PolylineColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=i(e,i.EMPTY_OBJECT),this.length=i(e.length,1e7),this._length=void 0,this.width=i(e.width,2),this._width=void 0,this.show=i(e.show,!0),this.modelMatrix=a.clone(i(e.modelMatrix,a.IDENTITY)),this._modelMatrix=new a,this.id=e.id,this._id=void 0,this._primitive=void 0}return c.prototype.update=function(i){if(this.show){if(!r(this._primitive)||!a.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=a.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,r(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);var n=new o({geometry:new s({positions:[e.ZERO,e.UNIT_X],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.RED,t.RED],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),c=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Y],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.GREEN,t.GREEN],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),h=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Z],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.BLUE,t.BLUE],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this});this._primitive=new u({geometryInstances:[n,c,h],appearance:new l,asynchronous:!1})}this._primitive.update(i)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},c}),i("Shaders/DepthPlaneFS",[],function(){"use strict";return"varying vec4 positionEC;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),i("Shaders/DepthPlaneVS",[],function(){"use strict";return"attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\n}\n"}),i("Scene/DepthPlane",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/DepthPlaneFS","../Shaders/DepthPlaneVS","./DepthFunction","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0}function y(e,i){var r=e.radii,n=i.camera.positionWC,o=t.multiplyComponents(e.oneOverRadii,n,w),a=t.magnitude(o),s=t.normalize(o,S),l=t.normalize(t.cross(t.UNIT_Z,o,E),E),u=t.normalize(t.cross(s,l,b),b),c=Math.sqrt(t.magnitudeSquared(o)-1),h=t.multiplyByScalar(s,1/a,w),d=c/a,p=t.multiplyByScalar(l,d,S),m=t.multiplyByScalar(u,d,E),f=t.add(h,m,b);t.subtract(f,p,f),t.multiplyComponents(r,f,f),t.pack(f,C,0);var _=t.subtract(h,m,b);t.subtract(_,p,_),t.multiplyComponents(r,_,_),t.pack(_,C,3);var g=t.add(h,m,b);t.add(g,p,g),t.multiplyComponents(r,g,g),t.pack(g,C,6);var v=t.subtract(h,m,b);return t.add(v,p,v),t.multiplyComponents(r,v,v),t.pack(v,C,9),C}var C=n.supportsTypedArrays()?new Float32Array(12):[],w=new t,S=new t,E=new t,b=new t;return v.prototype.update=function(n){if(this._mode=n.mode,n.mode===g.SCENE3D){var v=n.context,C=n.mapProjection.ellipsoid;r(this._command)||(this._rs=h.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:_.ALWAYS},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._sp=d.fromCache({context:v,vertexShaderSource:f,fragmentShaderSource:m,attributeLocations:{position:0}}),this._command=new u({renderState:this._rs,shaderProgram:this._sp,boundingVolume:new e(t.ZERO,C.maximumRadius),pass:c.OPAQUE,owner:this}));var w=y(C,n);if(r(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(w);else{var S=new o({attributes:{position:new a({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:w})},indices:[0,1,2,2,1,3],primitiveType:s.TRIANGLES});this._va=p.fromGeometry({context:v,geometry:S,attributeLocations:{position:0},bufferUsage:l.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}},v.prototype.execute=function(e,t){this._mode===g.SCENE3D&&this._command.execute(e,t)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()},v}),i("Scene/DeviceOrientationCameraController",["../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/Matrix3","../Core/Quaternion"],function(e,t,i,r,n,o){"use strict";function a(t){function i(t){var i=t.alpha;return e(i)?(n._alpha=r.toRadians(i),n._beta=r.toRadians(t.beta),void(n._gamma=r.toRadians(t.gamma))):(n._alpha=void 0,n._beta=void 0,void(n._gamma=void 0))}this._scene=t,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;var n=this;window.addEventListener("deviceorientation",i,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",i,!1)}}function s(e,t,i,r){var a=e.direction,s=e.right,h=e.up,d=o.fromAxisAngle(a,i,u),p=o.fromAxisAngle(s,r,l),m=o.multiply(p,d,p),f=o.fromAxisAngle(h,t,u);o.multiply(f,m,m);var _=n.fromQuaternion(m,c);n.multiplyByVector(_,s,s),n.multiplyByVector(_,h,h),n.multiplyByVector(_,a,a)}var l=new o,u=new o,c=new n;return a.prototype.update=function(){if(e(this._alpha)){e(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);var t=this._lastAlpha-this._alpha,i=this._lastBeta-this._beta,r=this._lastGamma-this._gamma;s(this._scene.camera,-t,i,r),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._removeListener(),t(this)},a}),i("Shaders/EllipsoidFS",[],function(){"use strict";return"#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#endif\nuniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\nvarying vec3 v_positionEC;\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\nvec3 sphericalNormal = normalize(positionMC / u_radii);\nvec3 normalMC = geodeticNormal * side;\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\nvec3 positionToEyeEC = -positionEC;\nczm_materialInput materialInput;\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = (positionMC + u_radii) / u_radii;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef ONLY_SUN_LIGHTING\nreturn czm_private_phong(normalize(positionToEyeEC), material);\n#else\nreturn czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\nvoid main()\n{\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\nvec3 direction = normalize(v_positionEC);\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\nfloat t1 = -1.0;\nfloat t2 = -1.0;\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\nfloat discriminant = b * b - 4.0 * c;\nif (discriminant >= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n#ifdef WRITE_DEPTH\n#ifdef GL_EXT_frag_depth\nt = (intersection.start != 0.0) ? intersection.start : intersection.stop;\nvec3 positionEC = czm_pointAlongRay(ray, t);\nvec4 positionCC = czm_projection * vec4(positionEC, 1.0);\nfloat z = positionCC.z / positionCC.w;\nfloat n = czm_depthRange.near;\nfloat f = czm_depthRange.far;\ngl_FragDepthEXT = (z * (f - n) + f + n) * 0.5;\n#endif\n#endif\n}\n"}),i("Shaders/EllipsoidVS",[],function(){"use strict";return"attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);\n}\n"}),i("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S){"use strict";function E(t){t=n(t,n.EMPTY_OBJECT),this.center=i.clone(n(t.center,i.ZERO)),this._center=new i,this.radii=i.clone(t.radii),this._radii=new i,this._oneOverEllipsoidRadiiSquared=new i,this._boundingSphere=new e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,w.fromType(w.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=n(t.depthTestEnabled,!0),this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new h({owner:n(t._owner,this)}),this._pickCommand=new h({owner:n(t._owner,this)});var r=this;this._uniforms={u_radii:function(){return r.radii},u_oneOverEllipsoidRadiiSquared:function(){return r._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return r._pickId.color}}}function b(e){var r=e.cache.ellipsoidPrimitive_vertexArray;if(o(r))return r;var n=t.createGeometry(t.fromDimensions({dimensions:new i(2,2,2),vertexFormat:u.POSITION_ONLY}));return r=_.fromGeometry({context:e,geometry:n,attributeLocations:T,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=r,r}var T={position:0};return E.prototype.update=function(t){if(this.show&&t.mode===S.SCENE3D&&o(this.center)&&o(this.radii)){var n=t.context,a=this.material.isTranslucent(),s=this._translucent!==a;o(this._rs)&&!s||(this._translucent=a,this._rs=p.fromCache({cull:{enabled:!0,face:C.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?y.ALPHA_BLEND:void 0})),o(this._va)||(this._va=b(n));var u=!1,c=this.radii;if(!i.equals(this._radii,c)){i.clone(c,this._radii);var h=this._oneOverEllipsoidRadiiSquared;h.x=1/(c.x*c.x),h.y=1/(c.y*c.y),h.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&i.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),i.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(i.clone(i.ZERO,this._boundingSphere.center),this._boundingSphere.radius=i.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var _=this._material!==this.material;this._material=this.material,this._material.update(n);var w=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var E,x=this._colorCommand;(_||w||s)&&(E=new f({sources:[this.material.shaderSource,g]}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._sp=m.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._sp,x.uniformMap=r(this._uniforms,this.material._uniforms),x.executeInClosestFrustum=a);var A=t.commandList,P=t.passes;if(P.render&&(x.boundingVolume=this._boundingSphere,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.modelMatrix=this._computedModelMatrix,x.pass=a?d.TRANSLUCENT:d.OPAQUE,A.push(x)),P.pick){var D=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(_||w||!o(this._pickSP))&&(E=new f({sources:[this.material.shaderSource,g],pickColorQualifier:"uniform"}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._pickSP=m.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),D.vertexArray=this._va,D.renderState=this._rs,D.shaderProgram=this._pickSP,D.uniformMap=r(r(this._uniforms,this._pickUniforms),this.material._uniforms),D.executeInClosestFrustum=a),D.boundingVolume=this._boundingSphere,D.modelMatrix=this._computedModelMatrix,D.pass=a?d.TRANSLUCENT:d.OPAQUE,A.push(D)}}},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),a(this)},E}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n#ifdef FACE_FORWARD\nnormalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n"}),i("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),i("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),l=e(i.aboveGround,!1);this.material=t(i.material)?i.material:s.fromType(s.ColorType),this.translucent=e(i.translucent,!0),this._vertexShaderSource=e(i.vertexShaderSource,o),this._fragmentShaderSource=e(i.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(r,!l,i.renderState),this._closed=!1,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,l),this._aboveGround=l}return i(l.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=r.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),i("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,i,r){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2}function o(e){var t=a,i=t.length;if(e<t[0])return d=0;if(e>t[i-1])return d=i-2;if(e>=t[d]){if(d+1<i&&e<t[d+1])return d;if(d+2<i&&e<t[d+2])return++d,d}else if(d-1>=0&&e>=t[d-1])return--d,d;var r;for(r=0;r<i-2&&!(e>=t[r]&&e<t[r+1]);++r);return d=r}for(var a=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],s=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7],l=0;l<s.length;++l)s[l]*=1e6;for(var u=s[1],c=s[s.length-1],h=0;h<s.length;++h)s[h]=(s[h]-c)/(u-c);var d=0,p=new e;return n.prototype.update=function(n){var l=n.fog.enabled=this.enabled;if(l){var h=n.camera,d=h.positionCartographic;if(!t(d)||d.height>8e5||n.mode!==r.SCENE3D)return void(n.fog.enabled=!1);var m=d.height,f=o(m),_=i.clamp((m-a[f])/(a[f+1]-a[f]),0,1),g=i.lerp(s[f],s[f+1],_),v=1e6*this.density,y=v/u*c;g=g*(v-y)*1e-6;var C=e.normalize(h.positionWC,p),w=i.clamp(e.dot(h.directionWC,C),0,1);g*=1-w,n.fog.density=g,n.fog.sse=this.screenSpaceErrorFactor}},n}),i("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){function r(){c(n)}this._scene=i.scene,this.samplingWindow=e(i.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(i.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(i.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(i.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(i.minimumFrameRateAfterWarmup,l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var n=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){u(n,t)}),this._hiddenPropertyName=void 0!==document.hidden?"hidden":void 0!==document.mozHidden?"mozHidden":void 0!==document.msHidden?"msHidden":void 0!==document.webkitHidden?"webkitHidden":void 0;var a=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,r,!1)})}function u(e,t){if(!(e._pauseCount>0)){var i=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=r){for(;e._frameTimes.length>=2&&e._frameTimes[1]<r;)e._frameTimes.shift();var n=(i-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/n;var o=1e3/(i>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}}function c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return t(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},i(l.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}}),l.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),r(this)},l}),i("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,i){this.context=t,this.commandList=[],this.shadowMaps=[],this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.passes={render:!1,pick:!1},this.creditDisplay=i,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0},this.terrainExaggeration=1,this.shadowHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0}}return t}),i("Scene/FrustumCommands",["../Core/defaultValue","../Renderer/Pass"],function(e,t){"use strict";function i(i,r){this.near=e(i,0),this.far=e(r,0);for(var n=t.NUMBER_OF_PASSES,o=new Array(n),a=new Array(n),s=0;s<n;++s)o[s]=[],a[s]=0;this.commands=o,this.indices=a}return i}),i("Shaders/PostProcessFilters/FXAA",[],function(){"use strict";return"#ifndef FXAA_PRESET\n#define FXAA_PRESET 3\n#endif\n#if (FXAA_PRESET == 3)\n#define FXAA_EDGE_THRESHOLD      (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN  (1.0/24.0)\n#define FXAA_SEARCH_STEPS        16\n#define FXAA_SEARCH_THRESHOLD    (1.0/4.0)\n#define FXAA_SUBPIX_CAP          (3.0/4.0)\n#define FXAA_SUBPIX_TRIM         (1.0/4.0)\n#endif\n#if (FXAA_PRESET == 4)\n#define FXAA_EDGE_THRESHOLD      (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN  (1.0/24.0)\n#define FXAA_SEARCH_STEPS        24\n#define FXAA_SEARCH_THRESHOLD    (1.0/4.0)\n#define FXAA_SUBPIX_CAP          (3.0/4.0)\n#define FXAA_SUBPIX_TRIM         (1.0/4.0)\n#endif\n#if (FXAA_PRESET == 5)\n#define FXAA_EDGE_THRESHOLD      (1.0/8.0)\n#define FXAA_EDGE_THRESHOLD_MIN  (1.0/24.0)\n#define FXAA_SEARCH_STEPS        32\n#define FXAA_SEARCH_THRESHOLD    (1.0/4.0)\n#define FXAA_SUBPIX_CAP          (3.0/4.0)\n#define FXAA_SUBPIX_TRIM         (1.0/4.0)\n#endif\n#define FXAA_SUBPIX_TRIM_SCALE (1.0/(1.0 - FXAA_SUBPIX_TRIM))\nfloat FxaaLuma(vec3 rgb) {\nreturn rgb.y * (0.587/0.299) + rgb.x;\n}\nvec3 FxaaLerp3(vec3 a, vec3 b, float amountOfA) {\nreturn (vec3(-amountOfA) * b) + ((a * vec3(amountOfA)) + b);\n}\nvec4 FxaaTexOff(sampler2D tex, vec2 pos, ivec2 off, vec2 rcpFrame) {\nfloat x = pos.x + float(off.x) * rcpFrame.x;\nfloat y = pos.y + float(off.y) * rcpFrame.y;\nreturn texture2D(tex, vec2(x, y));\n}\nvec3 FxaaPixelShader(vec2 pos, sampler2D tex, vec2 rcpFrame)\n{\nvec3 rgbN = FxaaTexOff(tex, pos.xy, ivec2( 0,-1), rcpFrame).xyz;\nvec3 rgbW = FxaaTexOff(tex, pos.xy, ivec2(-1, 0), rcpFrame).xyz;\nvec3 rgbM = FxaaTexOff(tex, pos.xy, ivec2( 0, 0), rcpFrame).xyz;\nvec3 rgbE = FxaaTexOff(tex, pos.xy, ivec2( 1, 0), rcpFrame).xyz;\nvec3 rgbS = FxaaTexOff(tex, pos.xy, ivec2( 0, 1), rcpFrame).xyz;\nfloat lumaN = FxaaLuma(rgbN);\nfloat lumaW = FxaaLuma(rgbW);\nfloat lumaM = FxaaLuma(rgbM);\nfloat lumaE = FxaaLuma(rgbE);\nfloat lumaS = FxaaLuma(rgbS);\nfloat rangeMin = min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE)));\nfloat rangeMax = max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE)));\nfloat range = rangeMax - rangeMin;\nif(range < max(FXAA_EDGE_THRESHOLD_MIN, rangeMax * FXAA_EDGE_THRESHOLD))\n{\nreturn rgbM;\n}\nvec3 rgbL = rgbN + rgbW + rgbM + rgbE + rgbS;\nfloat lumaL = (lumaN + lumaW + lumaE + lumaS) * 0.25;\nfloat rangeL = abs(lumaL - lumaM);\nfloat blendL = max(0.0, (rangeL / range) - FXAA_SUBPIX_TRIM) * FXAA_SUBPIX_TRIM_SCALE;\nblendL = min(FXAA_SUBPIX_CAP, blendL);\nvec3 rgbNW = FxaaTexOff(tex, pos.xy, ivec2(-1,-1), rcpFrame).xyz;\nvec3 rgbNE = FxaaTexOff(tex, pos.xy, ivec2( 1,-1), rcpFrame).xyz;\nvec3 rgbSW = FxaaTexOff(tex, pos.xy, ivec2(-1, 1), rcpFrame).xyz;\nvec3 rgbSE = FxaaTexOff(tex, pos.xy, ivec2( 1, 1), rcpFrame).xyz;\nrgbL += (rgbNW + rgbNE + rgbSW + rgbSE);\nrgbL *= vec3(1.0/9.0);\nfloat lumaNW = FxaaLuma(rgbNW);\nfloat lumaNE = FxaaLuma(rgbNE);\nfloat lumaSW = FxaaLuma(rgbSW);\nfloat lumaSE = FxaaLuma(rgbSE);\nfloat edgeVert =\nabs((0.25 * lumaNW) + (-0.5 * lumaN) + (0.25 * lumaNE)) +\nabs((0.50 * lumaW ) + (-1.0 * lumaM) + (0.50 * lumaE )) +\nabs((0.25 * lumaSW) + (-0.5 * lumaS) + (0.25 * lumaSE));\nfloat edgeHorz =\nabs((0.25 * lumaNW) + (-0.5 * lumaW) + (0.25 * lumaSW)) +\nabs((0.50 * lumaN ) + (-1.0 * lumaM) + (0.50 * lumaS )) +\nabs((0.25 * lumaNE) + (-0.5 * lumaE) + (0.25 * lumaSE));\nbool horzSpan = edgeHorz >= edgeVert;\nfloat lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;\nif(!horzSpan)\n{\nlumaN = lumaW;\nlumaS = lumaE;\n}\nfloat gradientN = abs(lumaN - lumaM);\nfloat gradientS = abs(lumaS - lumaM);\nlumaN = (lumaN + lumaM) * 0.5;\nlumaS = (lumaS + lumaM) * 0.5;\nif (gradientN < gradientS)\n{\nlumaN = lumaS;\nlumaN = lumaS;\ngradientN = gradientS;\nlengthSign *= -1.0;\n}\nvec2 posN;\nposN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);\nposN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);\ngradientN *= FXAA_SEARCH_THRESHOLD;\nvec2 posP = posN;\nvec2 offNP = horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);\nfloat lumaEndN = lumaN;\nfloat lumaEndP = lumaN;\nbool doneN = false;\nbool doneP = false;\nposN += offNP * vec2(-1.0, -1.0);\nposP += offNP * vec2( 1.0,  1.0);\nfor(int i = 0; i < FXAA_SEARCH_STEPS; i++) {\nif(!doneN)\n{\nlumaEndN = FxaaLuma(texture2D(tex, posN.xy).xyz);\n}\nif(!doneP)\n{\nlumaEndP = FxaaLuma(texture2D(tex, posP.xy).xyz);\n}\ndoneN = doneN || (abs(lumaEndN - lumaN) >= gradientN);\ndoneP = doneP || (abs(lumaEndP - lumaN) >= gradientN);\nif(doneN && doneP)\n{\nbreak;\n}\nif(!doneN)\n{\nposN -= offNP;\n}\nif(!doneP)\n{\nposP += offNP;\n}\n}\nfloat dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;\nfloat dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;\nbool directionN = dstN < dstP;\nlumaEndN = directionN ? lumaEndN : lumaEndP;\nif(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))\n{\nlengthSign = 0.0;\n}\nfloat spanLength = (dstP + dstN);\ndstN = directionN ? dstN : dstP;\nfloat subPixelOffset = (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;\nvec3 rgbF = texture2D(tex, vec2(\npos.x + (horzSpan ? 0.0 : subPixelOffset),\npos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;\nreturn FxaaLerp3(rgbL, rgbF, blendL);\n}\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = vec4(FxaaPixelShader(v_textureCoordinates, u_texture, u_step), 1.0);\n}\n";
}),i("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/FXAA"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){this._texture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0;var r=new a({color:new i(0,0,0,0),depth:1,owner:this});this._clearCommand=r}function f(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,r(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return m.prototype.update=function(i){var n=i.drawingBufferWidth,a=i.drawingBufferHeight,m=this._texture,f=!r(m)||m.width!==n||m.height!==a;if(f&&(this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),this._texture=new d({context:i,width:n,height:a,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),i.depthTexture?this._depthStencilTexture=new d({context:i,width:n,height:a,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}):this._depthStencilRenderbuffer=new u({context:i,width:n,height:a,format:c.DEPTH_STENCIL})),r(this._fbo)&&!f||(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:i,colorTextures:[this._texture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})),r(this._command)||(this._command=i.createViewportQuadCommand(p,{owner:this})),this._viewport.width=n,this._viewport.height=a,r(this._rs)&&e.equals(this._rs.viewport,this._viewport)||(this._rs=h.fromCache({viewport:this._viewport})),this._command.renderState=this._rs,f){var _=this,g=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return _._texture},u_step:function(){return g}}}},m.prototype.execute=function(e,t){this._command.execute(e,t)},m.prototype.clear=function(e,t,r){var n=t.framebuffer;t.framebuffer=this._fbo,i.clone(r,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},m.prototype.getColorFramebuffer=function(){return this._fbo},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return f(this),n(this)},m}),i("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,i,r,n){"use strict";function o(e,i,r){this.type=e,t(i)||("json"===e?i="application/json":"xml"===e?i="text/xml":"html"===e?i="text/html":"text"===e&&(i="text/plain")),this.format=i,t(r)||("json"===e?r=a:"xml"===e?r=s:"html"===e?r=f:"text"===e&&(r=f)),this.callback=r}function a(i){for(var r=[],o=i.features,a=0;a<o.length;++a){var s=o[a],l=new n;if(l.data=s,l.properties=s.properties,l.configureNameFromProperties(s.properties),l.configureDescriptionFromProperties(s.properties),t(s.geometry)&&"Point"===s.geometry.type){var u=s.geometry.coordinates[0],c=s.geometry.coordinates[1];l.position=e.fromDegrees(u,c)}r.push(l)}return r}function s(e){var t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===_)return l(e);if("FeatureInfoResponse"===t.localName&&t.namespaceURI===g)return u(e);if("FeatureCollection"===t.localName&&t.namespaceURI===v)return c(e);if("ServiceExceptionReport"===t.localName)throw new r((new XMLSerializer).serializeToString(t));return"msGMLOutput"===t.localName?h(e):m(e)}function l(e){for(var t=[],i=e.documentElement,r=i.getElementsByTagNameNS(_,"Feature"),o=0;o<r.length;++o){for(var a=r[o],s={},l=a.getElementsByTagNameNS(_,"Val"),u=0;u<l.length;++u){var c=l[u];if(c.hasAttribute("ref")){var h=c.getAttribute("ref"),d=c.textContent.trim();s[h]=d}}var p=new n;p.data=a,p.properties=s,p.configureNameFromProperties(s),p.configureDescriptionFromProperties(s),t.push(p)}return t}function u(e){var t,i=e.documentElement,r=[],n=i.getElementsByTagNameNS("*","FIELDS");if(n.length>0)for(var o=0;o<n.length;++o){var a=n[o];t={};for(var s=a.attributes,l=0;l<s.length;++l){var u=s[l];t[u.name]=u.value}r.push(p(a,t))}else for(var c=i.getElementsByTagNameNS("*","FeatureInfo"),h=0;h<c.length;++h){var d=c[h];t={};for(var m=d.childNodes,f=0;f<m.length;++f){var _=m[f];_.nodeType===Node.ELEMENT_NODE&&(t[_.localName]=_.textContent)}r.push(p(d,t))}return r}function c(e){for(var t=[],i=e.documentElement,r=i.getElementsByTagNameNS(y,"featureMember"),n=0;n<r.length;++n){var o=r[n],a={};d(o,a),t.push(p(o,a))}return t}function h(e){for(var t,i=[],r=e.documentElement.childNodes,n=0;n<r.length;n++)if(r[n].nodeType===Node.ELEMENT_NODE){t=r[n];break}for(var o=t.childNodes,a=0;a<o.length;++a){var s=o[a];if(s.nodeType===Node.ELEMENT_NODE){var l={};d(s,l),i.push(p(s,l))}}return i}function d(e,t){for(var i=!0,r=0;r<e.childNodes.length;++r){var n=e.childNodes[r];n.nodeType===Node.ELEMENT_NODE&&(i=!1),"Point"!==n.localName&&"LineString"!==n.localName&&"Polygon"!==n.localName&&"boundedBy"!==n.localName&&n.hasChildNodes()&&d(n,t)&&(t[n.localName]=n.textContent)}return i}function p(e,t){var i=new n;return i.data=e,i.properties=t,i.configureNameFromProperties(t),i.configureDescriptionFromProperties(t),i}function m(e){var t=(new XMLSerializer).serializeToString(e),i=document.createElement("div"),r=document.createElement("pre");r.textContent=t,i.appendChild(r);var o=new n;return o.data=e,o.description=i.innerHTML,[o]}function f(e){if(!C.test(e)&&!w.test(e)){var t,i=S.exec(e);i&&i.length>1&&(t=i[1]);var r=new n;return r.name=t,r.description=e,r.data=e,[r]}}var _="http://www.mapinfo.com/mxp",g="http://www.esri.com/wms",v="http://www.opengis.net/wfs",y="http://www.opengis.net/gml",C=/<body>\s*<\/body>/im,w=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,S=/<title>([\s\S]*)<\/title>/im;return o}),i("Shaders/GlobeFS",[],function(){"use strict";return"uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#ifdef ENABLE_DAYNIGHT_SHADING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(texture, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue);\nvoid main()\n{\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask);\n}\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef FOG\nconst float fExposure = 2.0;\nvec3 fogColor = v_mieColor + finalColor.rgb * v_rayleighColor;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\ngl_FragColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#else\ngl_FragColor = finalColor;\n#endif\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n"}),i("Shaders/GlobeVS",[],function(){"use strict";return"#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn u_modifiedModelViewProjection * rtcPosition2D;\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = compressed0.w;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = 0.0;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#ifdef FOG\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(position3DWC);\nv_mieColor = atmosColor.mie;\nv_rayleighColor = atmosColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n}\n"}),i("Shaders/GroundAtmosphere",[],function(){"use strict";return"const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = 1.0;\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n"}),i("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,i,r,n){"use strict";function o(e,t,i){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=i}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[]}function s(e){var t,i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",r="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",o="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }";switch(e){case n.SCENE3D:t=i;break;case n.SCENE2D:case n.COLUMBUS_VIEW:t=r;break;case n.MORPHING:t=o}return t}function l(e){var t="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }",i="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }";return e?i:t}return a.prototype.getShaderProgram=function(t,n,a,u,c,h,d,p,m,f,_,g,v,y,C){var w=0,S="",E=n.pickTerrain.mesh.encoding,b=E.quantization;b===i.BITS12&&(w=1,S="QUANTIZATION_BITS12");var T=t.mode,x=T|u<<2|c<<3|h<<4|d<<5|p<<6|m<<7|f<<8|_<<9|g<<10|v<<11|y<<12|C<<13|w<<14,A=n.surfaceShader;if(e(A)&&A.numberOfDayTextures===a&&A.flags===x)return A.shaderProgram;var P=this._shadersByTexturesFlags[a];if(e(P)||(P=this._shadersByTexturesFlags[a]=[]),A=P[x],!e(A)){var D=this.baseVertexShaderSource.clone(),M=this.baseFragmentShaderSource.clone();D.defines.push(S),M.defines.push("TEXTURE_UNITS "+a),u&&M.defines.push("APPLY_BRIGHTNESS"),c&&M.defines.push("APPLY_CONTRAST"),h&&M.defines.push("APPLY_HUE"),d&&M.defines.push("APPLY_SATURATION"),p&&M.defines.push("APPLY_GAMMA"),m&&M.defines.push("APPLY_ALPHA"),f&&(M.defines.push("SHOW_REFLECTIVE_OCEAN"),D.defines.push("SHOW_REFLECTIVE_OCEAN")),_&&M.defines.push("SHOW_OCEAN_WAVES"),g&&(v?(D.defines.push("ENABLE_VERTEX_LIGHTING"),M.defines.push("ENABLE_VERTEX_LIGHTING")):(D.defines.push("ENABLE_DAYNIGHT_SHADING"),M.defines.push("ENABLE_DAYNIGHT_SHADING"))),D.defines.push("INCLUDE_WEB_MERCATOR_Y"),M.defines.push("INCLUDE_WEB_MERCATOR_Y"),C&&(D.defines.push("FOG"),M.defines.push("FOG"));for(var I="    vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n    {\n        vec4 color = initialColor;\n",R=0;R<a;++R)I+="    color = sampleAndBlend(\n        color,\n        u_dayTextures["+R+"],\n        u_dayTextureUseWebMercatorT["+R+"] ? textureCoordinates.xz : textureCoordinates.xy,\n        u_dayTextureTexCoordsRectangle["+R+"],\n        u_dayTextureTranslationAndScale["+R+"],\n        "+(m?"u_dayTextureAlpha["+R+"]":"1.0")+",\n        "+(u?"u_dayTextureBrightness["+R+"]":"0.0")+",\n        "+(c?"u_dayTextureContrast["+R+"]":"0.0")+",\n        "+(h?"u_dayTextureHue["+R+"]":"0.0")+",\n        "+(d?"u_dayTextureSaturation["+R+"]":"0.0")+",\n        "+(p?"u_dayTextureOneOverGamma["+R+"]":"0.0")+"\n    );\n";I+="        return color;\n    }",M.sources.push(I),D.sources.push(s(T)),D.sources.push(l(y));var O=r.fromCache({context:t.context,vertexShaderSource:D,fragmentShaderSource:M,attributeLocations:E.getAttributeLocations()});A=P[x]=new o(a,x,O)}return n.surfaceShader=A,A.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding,h=c.quantization;h===i.BITS12&&(a=1,u="QUANTIZATION_BITS12");var d=t.mode,p=d|o<<2|a<<3,m=this._pickShaderPrograms[p];if(!e(m)){var f=this.baseVertexShaderSource.clone();f.defines.push(u),f.sources.push(s(d)),f.sources.push(l(o));var _="void main()\n{\n    gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";m=this._pickShaderPrograms[p]=r.fromCache({context:t.context,vertexShaderSource:f,fragmentShaderSource:_,attributeLocations:c.getAttributeLocations()})}return m},a.prototype.destroy=function(){var i,r,n=this._shadersByTexturesFlags;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];if(!e(a))continue;for(i in a)a.hasOwnProperty(i)&&(r=a[i],e(r)&&r.shaderProgram.destroy())}var s=this._pickShaderPrograms;for(i in s)s.hasOwnProperty(i)&&(r=s[i],r.destroy());return t(this)},a}),i("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";var t={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};return e(t)}),i("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,DONE:2,FAILED:3};return e(t)}),i("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";var t={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};return e(t)}),i("Scene/TileBoundingBox",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/Rectangle","./SceneMode"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){r.cartographicToCartesian(a.southwest(i),t.southwestCornerCartesian),r.cartographicToCartesian(a.northeast(i),t.northeastCornerCartesian),m.longitude=i.west,m.latitude=.5*(i.south+i.north),m.height=0;var n=r.cartographicToCartesian(m,d),o=e.cross(n,e.UNIT_Z,c);e.normalize(o,t.westNormal),m.longitude=i.east;var s=r.cartographicToCartesian(m,p),l=e.cross(e.UNIT_Z,s,c);e.normalize(l,t.eastNormal);var u=r.geodeticSurfaceNormalCartographic(a.southeast(i),h),f=e.subtract(n,s,c),_=e.cross(u,f,h);e.normalize(_,t.southNormal);var g=r.geodeticSurfaceNormalCartographic(a.northwest(i),h),v=e.cross(f,g,h);e.normalize(v,t.northNormal)}var u=function(t){t=i(t,i.EMPTY_OBJECT),this.rectangle=a.clone(t.rectangle),this.minimumHeight=i(t.minimumHeight,0),this.maximumHeight=i(t.maximumHeight,0),this.southwestCornerCartesian=new e,this.northeastCornerCartesian=new e,this.westNormal=new e,this.southNormal=new e,this.eastNormal=new e,this.northNormal=new e;var r=i(t.ellipsoid,o.WGS84);l(this,t.rectangle,r)},c=new e,h=new e,d=new e,p=new e,m=new t,f=new e,_=new e,g=new e(0,-1,0),v=new e(0,0,-1),y=new e;return u.prototype.distanceToCamera=function(t){var i=t.camera,r=i.positionWC,n=i.positionCartographic,o=0;if(!a.contains(this.rectangle,n)){var l=this.southwestCornerCartesian,u=this.northeastCornerCartesian,c=this.westNormal,h=this.southNormal,d=this.eastNormal,p=this.northNormal;t.mode!==s.SCENE3D&&(l=t.mapProjection.project(a.southwest(this.rectangle),f),l.z=l.y,l.y=l.x,l.x=0,u=t.mapProjection.project(a.northeast(this.rectangle),_),u.z=u.y,u.y=u.x,u.x=0,c=g,d=e.UNIT_Y,h=v,p=e.UNIT_Z);var m=e.subtract(r,l,y),C=e.dot(m,c),w=e.dot(m,h),S=e.subtract(r,u,y),E=e.dot(S,d),b=e.dot(S,p);C>0?o+=C*C:E>0&&(o+=E*E),w>0?o+=w*w:b>0&&(o+=b*b)}var T;T=t.mode===s.SCENE3D?n.height:r.x;var x=t.mode===s.SCENE3D?this.maximumHeight:0,A=T-x;return A>0&&(o+=A*A),Math.sqrt(o)},u}),i("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState","./TileBoundingBox"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(e){this.state=h.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e}function m(e,t,r,n,o){function s(t){e.data=t,e.state=h.RECEIVED}function l(){e.state=h.FAILED;var i="Failed to obtain terrain tile X: "+r+" Y: "+n+" Level: "+o+".";t._requestError=a.handleError(t._requestError,t,t.errorEvent,i,r,n,o,u)}function u(){e.data=t.requestTileGeometry(r,n,o),i(e.data)?(e.state=h.RECEIVING,c(e.data,s,l)):e.state=h.UNLOADED}u()}function f(e,t,r,n,o,a){var s=r.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);i(u)&&(e.state=h.TRANSFORMING,c(u,function(t){e.mesh=t,e.state=h.TRANSFORMED},function(){e.state=h.FAILED}))}function _(e,t,r,o,a,c){var d=e.mesh.vertices,p=s.createVertexBuffer({context:t,typedArray:d,usage:l.STATIC_DRAW}),m=e.mesh.encoding.getAttributes(p),f=e.mesh.indices.indexBuffers||{},_=f[t.id];if(!i(_)||_.isDestroyed()){var g=e.mesh.indices,v=2===g.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;_=s.createIndexBuffer({context:t,typedArray:g,usage:l.STATIC_DRAW,indexDatatype:v}),_.vertexArrayDestroyable=!1,_.referenceCount=1,f[t.id]=_,
e.mesh.indices.indexBuffers=f}else++_.referenceCount;e.vertexArray=new u({context:t,attributes:m,indexBuffer:_}),e.state=h.READY}return p.prototype.freeResources=function(){if(this.state=h.UNLOADED,this.data=void 0,this.mesh=void 0,i(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&i(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},p.prototype.publishToTile=function(i){var r=i.data,n=this.mesh;t.clone(n.center,r.center),r.minimumHeight=n.minimumHeight,r.maximumHeight=n.maximumHeight,r.boundingSphere3D=e.clone(n.boundingSphere3D,r.boundingSphere3D),r.orientedBoundingBox=o.clone(n.orientedBoundingBox,r.orientedBoundingBox),r.tileBoundingBox=new d({rectangle:i.rectangle,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,ellipsoid:i.tilingScheme.ellipsoid}),i.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,r.occludeePointInScaledSpace)},p.prototype.processLoadStateMachine=function(e,t,i,r,n){this.state===h.UNLOADED&&m(this,t,i,r,n),this.state===h.RECEIVED&&f(this,e,t,i,r,n),this.state===h.TRANSFORMED&&_(this,e.context,t,i,r,n)},p.prototype.processUpsampleStateMachine=function(e,t,r,n,o){if(this.state===h.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,d=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,d,r,n,o),!i(this.data))return;this.state=h.RECEIVING;var p=this;c(this.data,function(e){p.data=e,p.state=h.RECEIVED},function(){p.state=h.FAILED})}this.state===h.RECEIVED&&f(this,e,t,r,n,o),this.state===h.TRANSFORMED&&_(this,e.context,t,r,n,o)},p}),i("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileTerrain"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v){"use strict";function y(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new i(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.orientedBoundingBox=void 0,this.tileBoundingBox=void 0,this.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0,this.surfaceShader=void 0}function C(e,i,r,o,a,s){if(e.decodePosition(o,a,s),n(i)&&i!==_.SCENE3D){var l=r.ellipsoid,u=l.cartesianToCartographic(s);r.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function w(e,t,i){var r=e.data,o=E(e);n(o)&&(r.upsampledTerrain=new v(o)),P(e,t)&&(r.loadedTerrain=new v);for(var a=0,s=i.length;a<s;++a){var l=i.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function S(e,t,i,o){var a=e.data,s=a.loadedTerrain,l=a.upsampledTerrain,u=!1;n(s)&&(s.processLoadStateMachine(t,i,e.x,e.y,e.level),s.state>=g.RECEIVED&&(a.terrainData!==s.data&&(a.terrainData=s.data,M(t.context,a),x(e)),u=!0),s.state===g.READY?(s.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=s.vertexArray,s.vertexArray=void 0,a.pickTerrain=r(a.loadedTerrain,a.upsampledTerrain),a.loadedTerrain=void 0,a.upsampledTerrain=void 0):s.state===g.FAILED&&(a.loadedTerrain=void 0)),!u&&n(l)&&(l.processUpsampleStateMachine(t,i,e.x,e.y,e.level),l.state>=g.RECEIVED&&a.terrainData!==l.data&&(a.terrainData=l.data,i.hasWaterMask&&I(e),b(e)),l.state===g.READY?(l.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=l.vertexArray,l.vertexArray=void 0,a.pickTerrain=a.upsampledTerrain,a.upsampledTerrain=void 0):l.state===g.FAILED&&(a.upsampledTerrain=void 0))}function E(e){for(var t=e.parent;n(t)&&n(t.data)&&!n(t.data.terrainData);)t=t.parent;if(n(t)&&n(t.data))return{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}}function b(e){T(e,e._southwestChild),T(e,e._southeastChild),T(e,e._northwestChild),T(e,e._northeastChild)}function T(e,t){if(n(t)&&t.state!==f.START){var i=t.data;if(n(i.terrainData)&&!i.terrainData.wasCreatedByUpsampling())return;n(i.upsampledTerrain)&&i.upsampledTerrain.freeResources(),i.upsampledTerrain=new v({data:e.data.terrainData,x:e.x,y:e.y,level:e.level}),t.state=f.LOADING}}function x(e){var t=e.data;A(e,t,e.southwestChild),A(e,t,e.southeastChild),A(e,t,e.northwestChild),A(e,t,e.northeastChild)}function A(e,t,i){if(i.state!==f.START){var r=i.data;if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())return;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new v({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,i.x,i.y)&&(n(r.loadedTerrain)||(r.loadedTerrain=new v)),i.state=f.LOADING}}function P(e,t){var i=t.getTileDataAvailable(e.x,e.y,e.level);if(n(i))return i;var r=e.parent;return!n(r)||!(!n(r.data)||!n(r.data.terrainData))&&r.data.terrainData.isChildAvailable(r.x,r.y,e.x,e.y)}function D(e){var t=e.cache.tile_waterMaskData;if(!n(t)){var i=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1;var r=new u({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,minificationFilter:d.LINEAR,magnificationFilter:h.LINEAR});t={allWaterTexture:i,sampler:r,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function M(e,t){var r=t.waterMaskTexture;n(r)&&(--r.referenceCount,0===r.referenceCount&&r.destroy(),t.waterMaskTexture=void 0);var o=t.terrainData.waterMask;if(n(o)){var a,u=D(e),h=o.length;if(1===h){if(0===o[0])return;a=u.allWaterTexture}else{var d=Math.sqrt(h);a=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{width:d,height:d,arrayBufferView:o},sampler:u.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,i.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function I(e){for(var t=e.data,i=e.parent;n(i)&&!n(i.data.terrainData)||i.data.terrainData.wasCreatedByUpsampling();)i=i.parent;if(n(i)&&n(i.data.waterMaskTexture)){t.waterMaskTexture=i.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var r=i.rectangle,o=e.rectangle,a=o.width,s=o.height,l=a/r.width,u=s/r.height;t.waterMaskTranslationAndScale.x=l*(o.west-r.west)/a,t.waterMaskTranslationAndScale.y=u*(o.south-r.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}o(y.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=n(e)&&(e.state===g.RECEIVING||e.state===g.TRANSFORMING),i=this.upsampledTerrain,r=n(i)&&(i.state===g.RECEIVING||i.state===g.TRANSFORMING),o=!t&&!r,a=this.imagery,s=0,l=a.length;o&&s<l;++s){var u=a[s];o=!n(u.loadingImagery)||u.loadingImagery.state!==m.TRANSITIONING}return o}}});var R=new t,O=new t,N=new t,L=new t;return y.prototype.pick=function(e,i,r,o,s){var l=this.pickTerrain;if(n(l)){var u=l.mesh;if(n(u))for(var c=u.vertices,h=u.indices,d=u.encoding,p=h.length,m=0;m<p;m+=3){var f=h[m],_=h[m+1],g=h[m+2],v=C(d,i,r,c,f,R),y=C(d,i,r,c,_,O),w=C(d,i,r,c,g,N),S=a.rayTriangle(e,v,y,w,o,L);if(n(S))return t.clone(S,s)}}},y.prototype.freeResources=function(){n(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,n(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),n(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),n(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,i=this.imagery;for(e=0,t=i.length;e<t;++e)i[e].freeResources();this.imagery.length=0,this.freeVertexArray()},y.prototype.freeVertexArray=function(){var e;n(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),n(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},y.processStateMachine=function(e,t,i,r,o){var a=e.data;n(a)||(a=e.data=new y),e.state===f.START&&(w(e,i,r),e.state=f.LOADING),e.state===f.LOADING&&S(e,t,i,o);for(var s=n(a.vertexArray),l=!n(a.loadedTerrain)&&!n(a.upsampledTerrain),u=n(a.terrainData)&&a.terrainData.wasCreatedByUpsampling(),c=a.imagery,h=0,d=c.length;h<d;++h){var p=c[h];if(n(p.loadingImagery)){if(p.loadingImagery.state===m.PLACEHOLDER){var _=p.loadingImagery.imageryLayer;if(_.imageryProvider.ready){p.freeResources(),c.splice(h,1),_._createTileImagerySkeletons(e,i,h),--h,d=c.length;continue}u=!1}var g=p.processStateMachine(e,t);l=l&&g,s=s&&(g||n(p.readyImagery)),u=u&&n(p.loadingImagery)&&(p.loadingImagery.state===m.FAILED||p.loadingImagery.state===m.INVALID)}else u=!1}e.upsampledFromParent=u,h===d&&(s&&(e.renderable=!0),l&&(e.state=f.DONE))},y}),i("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n"}),i("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,i){"use strict";function r(t,r,n,o,a){if(this.imageryLayer=t,this.x=r,this.y=n,this.level=o,0!==o){var s=r/2|0,l=n/2|0,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=i.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(r,n,o)}this.rectangle=a}return r.createPlaceholder=function(e){var t=new r(e,0,0,0);return t.addReference(),t.state=i.PLACEHOLDER,t},r.prototype.addReference=function(){++this.referenceCount},r.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&this.texture.destroy(),e(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),t(this),0):this.referenceCount},r.prototype.processStateMachine=function(e,t){this.state===i.UNLOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===i.RECEIVED&&(this.state=i.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var r=this.state===i.READY&&t&&!this.texture;(this.state===i.TEXTURE_LOADED||r)&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},r}),i("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function i(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}return i.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},i.prototype.processStateMachine=function(i,r){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(r,!this.useWebMercatorT),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this),!0;for(var a,s=n.parent;e(s)&&s.state!==t.READY;)s.state!==t.FAILED&&s.state!==t.INVALID&&(a=a||s),s=s.parent;return this.readyImagery!==s&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=s,e(s)&&(s.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this))),(n.state===t.FAILED||n.state===t.INVALID)&&(!e(a)||(a.processStateMachine(r,!this.useWebMercatorT),!1))},i}),i("Scene/ImageryLayer",["../Core/Cartesian2","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/MipmapHint","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImageryState","./TileImagery"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N){"use strict";function L(e,t){this._imageryProvider=e,t=i(t,{}),this.alpha=i(t.alpha,i(e.defaultAlpha,1)),this.brightness=i(t.brightness,i(e.defaultBrightness,L.DEFAULT_BRIGHTNESS)),this.contrast=i(t.contrast,i(e.defaultContrast,L.DEFAULT_CONTRAST)),this.hue=i(t.hue,i(e.defaultHue,L.DEFAULT_HUE)),this.saturation=i(t.saturation,i(e.defaultSaturation,L.DEFAULT_SATURATION)),this.gamma=i(t.gamma,i(e.defaultGamma,L.DEFAULT_GAMMA)),this.show=i(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=i(t.rectangle,h.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new N(R.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[]}function B(e,t,n,o){if(u.isPowerOfTwo(o.width)&&u.isPowerOfTwo(o.height)){var a=t.cache.imageryLayer_mipmapSampler;if(!r(a)){var s=y.maximumTextureFilterAnisotropy;a=t.cache.imageryLayer_mipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR_MIPMAP_LINEAR,magnificationFilter:T.LINEAR,maximumAnisotropy:Math.min(s,i(e._maximumAnisotropy,s))})}o.generateMipmap(C.NICEST),o.sampler=a}else{var l=t.cache.imageryLayer_nonMipmapSampler;r(l)||(l=t.cache.imageryLayer_nonMipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})),o.sampler=l}n.state=O.READY}function F(e,t,i){return JSON.stringify([e,t,i])}function V(e,t,i,n){var o=t.cache.imageryLayer_reproject;if(!r(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){r(this.framebuffer)&&this.framebuffer.destroy(),r(this.vertexArray)&&this.vertexArray.destroy(),r(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),s=0,c=0;c<64;++c){var h=c/63;a[s++]=0,a[s++]=h,a[s++]=1,a[s++]=h}var p={position:0,webMercatorT:1},m=d.getRegularGridIndices(2,64),f=_.createIndexBuffer({context:t,typedArray:m,usage:g.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});o.vertexArray=new P({context:t,attributes:[{index:p.position,vertexBuffer:_.createVertexBuffer({context:t,typedArray:a,usage:g.STATIC_DRAW}),componentsPerAttribute:2},{index:p.webMercatorT,vertexBuffer:_.createVertexBuffer({context:t,sizeInBytes:512,usage:g.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:f});var v=new E({sources:[M]});o.shaderProgram=S.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:D,attributeLocations:p}),o.sampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})}i.sampler=o.sampler;var y=i.width,I=i.height;H.textureDimensions.x=y,H.textureDimensions.y=I,H.texture=i;var R=Math.sin(n.south),O=.5*Math.log((1+R)/(1-R));R=Math.sin(n.north);var N=.5*Math.log((1+R)/(1-R)),L=1/(N-O),B=new b({context:t,width:y,height:I,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});u.isPowerOfTwo(y)&&u.isPowerOfTwo(I)&&B.generateMipmap(C.NICEST);for(var F=n.south,V=n.north,k=q,z=0,U=0;U<64;++U){var G=U/63,W=u.lerp(F,V,G);R=Math.sin(W);var j=.5*Math.log((1+R)/(1-R)),Y=(j-O)*L;k[z++]=Y,k[z++]=Y}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(k),e.shaderProgram=o.shaderProgram,e.outputTexture=B,e.uniformMap=H,e.vertexArray=o.vertexArray}function k(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof s?1:Math.cos(i),l=n.rectangle,u=o.maximumRadius*l.width*a/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),c=u/t,h=Math.log(c)/Math.log(2),d=Math.round(h);return 0|d}n(L.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),L.DEFAULT_BRIGHTNESS=1,L.DEFAULT_CONTRAST=1,L.DEFAULT_HUE=0,L.DEFAULT_SATURATION=1,L.DEFAULT_GAMMA=1,L.prototype.isBaseLayer=function(){return this._isBaseLayer},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){return o(this)};var z=new h,U=new h,G=new h,W=new h;L.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return h.intersection(e.rectangle,t)})},L.prototype._createTileImagerySkeletons=function(e,i,n){var o=e.data;if(r(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(r(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var a=this._imageryProvider;if(r(n)||(n=o.imagery.length),!a.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),o.imagery.splice(n,0,this._skeletonPlaceholder),!0;var s=a.tilingScheme instanceof f&&e.rectangle.north<m.MaximumLatitude&&e.rectangle.south>-m.MaximumLatitude,l=h.intersection(a.rectangle,this._rectangle,z),u=h.intersection(e.rectangle,l,U);if(!r(u)){if(!this.isBaseLayer())return!1;var c=l,d=e.rectangle;u=U,d.south>=c.north?u.north=u.south=c.north:d.north<=c.south?u.north=u.south=c.south:(u.south=Math.max(d.south,c.south),u.north=Math.min(d.north,c.north)),d.west>=c.east?u.west=u.east=c.east:d.east<=c.west?u.west=u.east=c.west:(u.west=Math.max(d.west,c.west),u.east=Math.min(d.east,c.east))}var p=0;u.south>0?p=u.south:u.north<0&&(p=u.north);var _=1,g=_*i.getLevelMaximumGeometricError(e.level),v=k(this,g,p);v=Math.max(0,v);var y=a.maximumLevel;if(v>y&&(v=y),r(a.minimumLevel)){var C=a.minimumLevel;v<C&&(v=C)}var w=a.tilingScheme,S=w.positionToTileXY(h.northwest(u),v),E=w.positionToTileXY(h.southeast(u),v),b=e.rectangle.width/512,T=e.rectangle.height/512,x=w.tileXYToRectangle(S.x,S.y,v);Math.abs(x.south-e.rectangle.north)<T&&S.y<E.y&&++S.y,Math.abs(x.east-e.rectangle.west)<b&&S.x<E.x&&++S.x;var A=w.tileXYToRectangle(E.x,E.y,v);Math.abs(A.north-e.rectangle.south)<T&&E.y>S.y&&--E.y,Math.abs(A.west-e.rectangle.east)<b&&E.x>S.x&&--E.x;var P,D=h.clone(e.rectangle,W),M=w.tileXYToRectangle(S.x,S.y,v),I=h.intersection(M,l,G);s?(w.rectangleToNativeRectangle(D,D),w.rectangleToNativeRectangle(M,M),w.rectangleToNativeRectangle(I,I),w.rectangleToNativeRectangle(l,l),P=w.tileXYToNativeRectangle.bind(w),b=D.width/512,T=D.height/512):P=w.tileXYToRectangle.bind(w);var R,O,L=0,B=1;!this.isBaseLayer()&&Math.abs(I.west-D.west)>=b&&(L=Math.min(1,(I.west-D.west)/D.width)),!this.isBaseLayer()&&Math.abs(I.north-D.north)>=T&&(B=Math.max(0,(I.north-D.south)/D.height));for(var F=B,V=S.x;V<=E.x;V++)if(R=L,M=P(V,S.y,v),I=h.simpleIntersection(M,l,G),r(I)){L=Math.min(1,(I.east-D.west)/D.width),V===E.x&&(this.isBaseLayer()||Math.abs(I.east-D.east)<b)&&(L=1),B=F;for(var H=S.y;H<=E.y;H++)if(O=B,M=P(V,H,v),I=h.simpleIntersection(M,l,G),r(I)){B=Math.max(0,(I.south-D.south)/D.height),H===E.y&&(this.isBaseLayer()||Math.abs(I.south-D.south)<T)&&(B=0);var q=new t(R,B,L,O),j=this.getImageryFromCache(V,H,v);o.imagery.splice(n,0,new N(j,q,s)),++n}}return!0},L.prototype._calculateTextureTranslationAndScale=function(e,i){var r=i.readyImagery.rectangle,n=e.rectangle;if(i.useWebMercatorT){var o=i.readyImagery.imageryLayer.imageryProvider.tilingScheme;r=o.rectangleToNativeRectangle(r,z),n=o.rectangleToNativeRectangle(n,W)}var a=n.width,s=n.height,l=a/r.width,u=s/r.height;return new t(l*(n.west-r.west)/a,u*(n.south-r.south)/s,l,u)},L.prototype._requestImagery=function(e){function t(t){return r(t)?(e.image=t,e.state=O.RECEIVED,void p.handleSuccess(a._requestImageError)):i()}function i(t){e.state=O.FAILED;var i="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";a._requestImageError=p.handleError(a._requestImageError,o,o.errorEvent,i,e.x,e.y,e.level,n,t)}function n(){e.state=O.TRANSITIONING;var n=o.requestImage(e.x,e.y,e.level);return r(n)?(r(o.getTileCredits)&&(e.credits=o.getTileCredits(e.x,e.y,e.level)),void I(n,t,i)):void(e.state=O.UNLOADED)}var o=this._imageryProvider,a=this;n()},L.prototype._createTexture=function(e,t){var i=this._imageryProvider;if(r(i.tileDiscardPolicy)){var n=i.tileDiscardPolicy;if(r(n)){if(!n.isReady())return void(t.state=O.RECEIVED);if(n.shouldDiscardImage(t.image))return void(t.state=O.INVALID)}}var o=new b({context:e,source:t.image,pixelFormat:i.hasAlphaChannel?c.RGBA:c.RGB});i.tilingScheme instanceof f?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=O.TEXTURE_LOADED},L.prototype._reprojectTexture=function(e,t,r){var n=t.textureWebMercator||t.texture,o=t.rectangle,a=e.context;if(r=i(r,!0),r&&!(this._imageryProvider.tilingScheme instanceof s)&&o.width/n.width>1e-5){var l=this;t.addReference();var u=new v({persists:!0,owner:this,preExecute:function(e){V(e,a,n,t.rectangle)},postExecute:function(e){t.texture=e,B(l,a,t,e),t.releaseReference()}});this._reprojectComputeCommands.push(u)}else r&&(t.texture=n),B(this,a,t,n)},L.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,i=t.length,r=0;r<i;++r)e.commandList.push(t[r]);t.length=0},L.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},L.prototype.getImageryFromCache=function(e,t,i,n){var o=F(e,t,i),a=this._imageryCache[o];return r(a)||(a=new R(this,e,t,i,n),this._imageryCache[o]=a),a.addReference(),a},L.prototype.removeImageryFromCache=function(e){var t=F(e.x,e.y,e.level);delete this._imageryCache[t]};var H={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new e,texture:void 0},q=a.supportsTypedArrays()?new Float32Array(128):void 0;return L}),i("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/PrimitiveType","../Core/Rectangle","../Core/SphereOutlineGeometry","../Core/TerrainQuantization","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/VertexArray","../Scene/BlendingState","../Scene/DepthFunction","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./GlobeSurfaceTile","./ImageryLayer","./QuadtreeTileLoadState","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U){"use strict";function G(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.shadows=U.RECEIVE_ONLY,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._pickRenderState=void 0,this._errorEvent=new d,this._imageryLayers.layerAdded.addEventListener(G.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(G.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(G.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(G.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function W(e,t){var i=e.loadingImagery;l(i)||(i=e.readyImagery);var r=t.loadingImagery;return l(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function H(e){var t=e.indexBuffer;e.destroy(),!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function q(e){var t={u_initialColor:function(){return this.properties.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var t=e.context.uniformState.view,i=v.multiplyByPoint(t,this.properties.rtc,te);return v.setTranslation(t,i,Q),Q},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,i=e.context.uniformState.projection,r=v.multiplyByPoint(t,this.properties.rtc,te);return v.setTranslation(t,r,J),v.multiply(i,J,J),J},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},properties:{initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new i(65e5,9e6),center3D:void 0,rtc:new r,modifiedModelView:new v,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayIntensity:0,southAndNorthLatitude:new i,southMercatorYAndOneOverHeight:new i,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new i,scaleAndBias:new v}};return t}function j(e,t,i){var r=i.data;l(r.wireframeVertexArray)||l(r.terrainData)&&l(r.terrainData._mesh)&&(r.wireframeVertexArray=Y(e,r.vertexArray,r.terrainData._mesh))}function Y(e,t,i){var r={indices:i.indices,primitiveType:C.TRIANGLES};m.toWireframe(r);var n=r.indices,o=x.createIndexBuffer({context:e,typedArray:n,usage:A.STATIC_DRAW,indexDatatype:f.UNSIGNED_SHORT});return new R({context:e,attributes:t._attributes,indexBuffer:o})}function X(t,i,a){var s=i.data,u=P.maximumTextureImageUnits,c=s.waterMaskTexture,h=t.hasWaterMask&&l(c),d=t.oceanNormalMap,p=h&&l(d),m=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,f=a.fog.enabled,_=U.castShadows(t.shadows),S=U.receiveShadows(t.shadows);h&&--u,p&&--u;var b=s.center,x=s.pickTerrain.mesh.encoding,A=$,I=0,R=0,O=0,N=0,L=!1;if(a.mode!==z.SCENE3D){var B=a.mapProjection,F=B.project(w.southwest(i.rectangle),ie),k=B.project(w.northeast(i.rectangle),re);if(A.x=F.x,A.y=F.y,A.z=k.x,A.w=k.y,a.mode!==z.MORPHING&&(b=ee,b.x=0,b.y=.5*(A.z+A.x),b.z=.5*(A.w+A.y),A.x-=b.y,A.y-=b.z,A.z-=b.y,A.w-=b.z),a.mode===z.SCENE2D&&x.quantization===E.BITS12){var G=1/(Math.pow(2,12)-1)*.5,W=(A.z-A.x)*G,H=(A.w-A.y)*G;A.x-=W,A.y-=H,A.z+=W,A.w+=H}B instanceof T&&(I=i.rectangle.south,R=i.rectangle.north,O=T.geodeticLatitudeToMercatorAngle(I),N=1/(T.geodeticLatitudeToMercatorAngle(R)-O),L=!0)}var Y=s.imagery,X=0,Z=Y.length,K=t._renderState,Q=t._blendRenderState,J=K,te=t._firstPassInitialColor,le=a.context;l(t._debug.boundingSphereTile)||ae();do{var ue,ce,he=0;t._drawCommands.length<=t._usedDrawCommands?(ue=new D,ue.owner=i,ue.cull=!1,ue.boundingVolume=new e,ue.orientedBoundingBox=void 0,ce=q(a),t._drawCommands.push(ue),t._uniformMaps.push(ce)):(ue=t._drawCommands[t._usedDrawCommands],ce=t._uniformMaps[t._usedDrawCommands]),ue.owner=i,++t._usedDrawCommands,i===t._debug.boundingSphereTile&&(l(s.orientedBoundingBox)?ne(s.orientedBoundingBox,o.RED).update(a):l(s.boundingSphere3D)&&oe(s.boundingSphere3D,o.RED).update(a));var de=ce.properties;n.clone(te,de.initialColor),de.oceanNormalMap=d,de.lightingFadeDistance.x=t.lightingFadeOutDistance,de.lightingFadeDistance.y=t.lightingFadeInDistance,de.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,de.center3D=s.center,r.clone(b,de.rtc),n.clone(A,de.tileRectangle),de.southAndNorthLatitude.x=I,de.southAndNorthLatitude.y=R,de.southMercatorYAndOneOverHeight.x=O,de.southMercatorYAndOneOverHeight.y=N;for(var pe=f&&g.fog(i._distance,a.fog.density)>g.EPSILON3,me=!1,fe=!1,_e=!1,ge=!1,ve=!1,ye=!1;he<u&&X<Z;){var Ce=Y[X],we=Ce.readyImagery;if(++X,l(we)&&0!==we.imageryLayer.alpha){var Se=Ce.useWebMercatorT?we.textureWebMercator:we.texture,Ee=we.imageryLayer;if(l(Ce.textureTranslationAndScale)||(Ce.textureTranslationAndScale=Ee._calculateTextureTranslationAndScale(i,Ce)),de.dayTextures[he]=Se,de.dayTextureTranslationAndScale[he]=Ce.textureTranslationAndScale,de.dayTextureTexCoordsRectangle[he]=Ce.textureCoordinateRectangle,de.dayTextureUseWebMercatorT[he]=Ce.useWebMercatorT,de.dayTextureAlpha[he]=Ee.alpha,ye=ye||1!==de.dayTextureAlpha[he],de.dayTextureBrightness[he]=Ee.brightness,me=me||de.dayTextureBrightness[he]!==V.DEFAULT_BRIGHTNESS,de.dayTextureContrast[he]=Ee.contrast,fe=fe||de.dayTextureContrast[he]!==V.DEFAULT_CONTRAST,de.dayTextureHue[he]=Ee.hue,_e=_e||de.dayTextureHue[he]!==V.DEFAULT_HUE,de.dayTextureSaturation[he]=Ee.saturation,ge=ge||de.dayTextureSaturation[he]!==V.DEFAULT_SATURATION,de.dayTextureOneOverGamma[he]=1/Ee.gamma,ve=ve||de.dayTextureOneOverGamma[he]!==1/V.DEFAULT_GAMMA,l(we.credits))for(var be=a.creditDisplay,Te=we.credits,xe=0,Ae=Te.length;xe<Ae;++xe)be.addCredit(Te[xe]);
++he}}de.dayTextures.length=he,de.waterMask=c,n.clone(s.waterMaskTranslationAndScale,de.waterMaskTranslationAndScale),de.minMaxHeight.x=x.minimumHeight,de.minMaxHeight.y=x.maximumHeight,v.clone(x.matrix,de.scaleAndBias),ue.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,he,me,fe,_e,ge,ve,ye,h,p,t.enableLighting,m,L,pe),ue.castShadows=_,ue.receiveShadows=S,ue.renderState=J,ue.primitiveType=C.TRIANGLES,ue.vertexArray=s.vertexArray,ue.uniformMap=ce,ue.pass=M.GLOBE,t._debug.wireframe&&(j(le,t,i),l(s.wireframeVertexArray)&&(ue.vertexArray=s.wireframeVertexArray,ue.primitiveType=C.LINES));var Pe=ue.boundingVolume,De=ue.orientedBoundingBox;a.mode!==z.SCENE3D?(e.fromRectangleWithHeights2D(i.rectangle,a.mapProjection,s.minimumHeight,s.maximumHeight,Pe),r.fromElements(Pe.center.z,Pe.center.x,Pe.center.y,Pe.center),a.mode===z.MORPHING&&(Pe=e.union(s.boundingSphere3D,Pe,Pe))):(ue.boundingVolume=e.clone(s.boundingSphere3D,Pe),ue.orientedBoundingBox=y.clone(s.orientedBoundingBox,De)),a.commandList.push(ue),J=Q,te=se}while(X<Z)}function Z(e,t,i){var r;e._pickCommands.length<=e._usedPickCommands?(r=new D,r.cull=!1,e._pickCommands.push(r)):r=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=i.projection instanceof T;r.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(i,n,o),r.renderState=e._pickRenderState,r.owner=t.owner,r.primitiveType=t.primitiveType,r.vertexArray=t.vertexArray,r.uniformMap=t.uniformMap,r.boundingVolume=t.boundingVolume,r.orientedBoundingBox=t.orientedBoundingBox,r.pass=t.pass,i.commandList.push(r)}u(G.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=n.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),G.prototype.initialize=function(e){var t=this._imageryLayers;t._update(),t.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(W)}));var i=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&i.addCredit(this._terrainProvider.credit);for(var r=0,n=t.length;r<n;++r){var o=t.get(r).imageryProvider;o.ready&&l(o.credit)&&i.addCredit(o.credit)}for(var a=this._vertexArraysToDestroy,s=a.length,u=0;u<s;++u)H(a[u]);a.length=0},G.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];l(n)&&(n.length=0)}this._usedDrawCommands=0},G.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS_OR_EQUAL},blending:O.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];if(l(n))for(var o=0,a=n.length;o<a;++o)X(this,n[o],e)}},G.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=I.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)Z(this,t[i],e)},G.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},G.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},G.prototype.loadTile=function(e,t){F.processStateMachine(t,e,this._terrainProvider,this._imageryLayers,this._vertexArraysToDestroy)};var K=new e;G.prototype.computeTileVisibility=function(t,i,n){var o=this.computeDistanceToTile(t,i);if(t._distance=o,i.fog.enabled&&g.fog(o,i.fog.density)>=1)return b.NONE;var a=t.data,u=i.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);i.mode!==z.SCENE3D&&(c=K,e.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,a.minimumHeight,a.maximumHeight,c),r.fromElements(c.center.z,c.center.x,c.center.y,c.center),i.mode===z.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var h=u.computeVisibility(c);if(h===_.OUTSIDE)return b.NONE;if(i.mode===z.SCENE3D){var d=a.occludeePointInScaledSpace;return l(d)?n.ellipsoid.isScaledSpacePointVisible(d)?h:b.NONE:h}return h};var Q=new v,J=new v,$=new n,ee=new r,te=new r,ie=new r,re=new r;G.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,o=r.length;n<o;++n){var a=r[n];l(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e);var u=this._debug;++u.tilesRendered,u.texturesRendered+=i},G.prototype.computeDistanceToTile=function(e,t){var i=e.data,r=i.tileBoundingBox;return r.distanceToCamera(t)},G.prototype.isDestroyed=function(){return!1},G.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},G.prototype._onLayerAdded=function(e,t){if(e.show){var i=this._terrainProvider;this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,i)&&(t.state=k.LOADING)}),this._layerOrderChanged=!0}},G.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var i=t.data.imagery,r=-1,n=0,o=0,a=i.length;o<a;++o){var s=i[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)r===-1&&(r=o),s.freeResources(),++n;else if(r!==-1)break}r!==-1&&i.splice(r,n)})},G.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0},G.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var ne,oe,ae;!function(){function e(e){return new B({geometryInstances:e,appearance:new L({translucent:!1,flat:!0}),asynchronous:!1})}var i,n,o=new p({geometry:t.fromDimensions({dimensions:new r(2,2,2)})}),s=new p({geometry:new S({radius:1})}),u=new v;ne=function(t,r){return t===i?n:(ae(),i=t,u=v.fromRotationTranslation(t.halfAxes,t.center,u),o.modelMatrix=u,o.attributes.color=a.fromColor(r),n=e(o))},oe=function(t,r){return t===i?n:(ae(),i=t,u=v.fromTranslation(t.center,u),u=v.multiplyByUniformScale(u,t.radius,u),s.modelMatrix=u,s.attributes.color=a.fromColor(r),n=e(s))},ae=function(){l(n)&&(n.destroy(),n=void 0,i=void 0)}}();var se=new n(0,0,0,0);return G}),i("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o}function h(e,t){var i=e.indexOf(t);return i}function d(e,t,i){var r=e._layers;if(t=a.clamp(t,0,r.length-1),i=a.clamp(i,0,r.length-1),t!==i){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}i(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,i){var r=t(i);r?this._layers.splice(i,0,e):(i=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,i)},c.prototype.addImageryProvider=function(e,t){var i=new u(e);return this.add(i,t),i},c.prototype.remove=function(t,i){i=e(i,!0);var r=this._layers.indexOf(t);return r!==-1&&(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(t,r),i&&t.destroy(),!0)},c.prototype.removeAll=function(t){t=e(t,!0);for(var i=this._layers,r=0,n=i.length;r<n;r++){var o=i[r];this.layerRemoved.raiseEvent(o,r),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return this.indexOf(e)!==-1},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=h(this._layers,e);d(this,t,t+1)},c.prototype.lower=function(e){var t=h(this._layers,e);d(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=h(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},c.prototype.lowerToBottom=function(e){var t=h(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var p=new s;return c.prototype.pickImageryLayerFeatures=function(e,i){var r=i.globe.pick(e,i);if(t(r)){for(var n,o=i.globe.ellipsoid.cartesianToCartographic(r),u=i.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var h=u[c];s.contains(h.rectangle,o)&&(n=h)}if(t(n)){for(var d=n.data.imagery,m=[],f=[],_=d.length-1;_>=0;--_){var g=d[_],v=g.readyImagery;if(t(v)){var y=v.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(v.rectangle,o)){var C=p,w=1/1024;if(C.west=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.x-w),C.east=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.z+w),C.south=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.y-w),C.north=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.w+w),s.contains(C,o)){var S=y.pickFeatures(v.x,v.y,v.level,o.longitude,o.latitude);t(S)&&(m.push(S),f.push(v.imageryLayer))}}}}if(0!==m.length)return l.all(m,function(e){for(var i=[],r=0;r<e.length;++r){var n=e[r],a=f[r];if(t(n)&&n.length>0)for(var s=0;s<n.length;++s){var l=n[s];l.imageryLayer=a,t(l.position)||(l.position=o),i.push(l)}}return i})}}},c.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},c.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),r(this)},c.prototype._update=function(){for(var e,i,r=!0,n=this._layers,o=0,a=n.length;o<a;++o)i=n[o],i._layerIndex=o,i.show?(i._isBaseLayer=r,r=!1):i._isBaseLayer=!1,i.show!==i._show&&(t(i._show)&&(t(e)||(e=[]),e.push(i)),i._show=i.show);if(t(e))for(o=0,a=e.length;o<a;++o)i=e[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)},c}),i("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,i){"use strict";function r(t){this._ellipsoid=new i(t.ellipsoid,e.ZERO)}return t(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),r}),i("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,i,r,n){"use strict";function o(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this._replacementPrevious=void 0,this._replacementNext=void 0,this._distance=0,this._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function a(t){e(t)&&t.freeResources()}return o.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,a=0;a<i;++a)for(var s=0;s<t;++s)r[n++]=new o({tilingScheme:e,x:s,y:a,level:0});return r},o.prototype._updateCustomData=function(t,i,n){var o,a,s,l=this.customData;if(e(i)&&e(n)){for(l=l.filter(function(e){return n.indexOf(e)===-1}),this._customData=l,s=this._rectangle,o=0;o<i.length;++o)a=i[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=t}else{var u=this._parent;if(e(u)&&this._frameUpdated!==u._frameUpdated){l.length=0,s=this._rectangle;var c=u.customData;for(o=0;o<c.length;++o)a=c[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=u._frameUpdated}}},t(o.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return e(this._southwestChild)||(this._southwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return e(this._southeastChild)||(this._southeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return e(this._northwestChild)||(this._northwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return e(this._northeastChild)||(this._northeastChild=new o({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<n.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),o.prototype.freeResources=function(){this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&this.data.freeResources(),a(this._southwestChild),this._southwestChild=void 0,a(this._southeastChild),this._southeastChild=void 0,a(this._northwestChild),this._northwestChild=void 0,a(this._northeastChild),this._northeastChild=void 0},o}),i("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function i(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}return t.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},t.prototype.trimTiles=function(t){for(var r=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(r);){n=r!==this._lastBeforeStartOfFrame;var o=r.replacementPrevious;r.eligibleForUnloading&&(r.freeResources(),i(this,r)),r=o}},t.prototype.markTileRendered=function(t){var r=this.head;return r===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(r)?((e(t.replacementPrevious)||e(t.replacementNext))&&i(this,t),t.replacementPrevious=void 0,t.replacementNext=r,r.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),i("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/Queue","../Core/Ray","../Core/Rectangle","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme,r=t.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new g,this._levelZeroTiles=void 0,this._levelZeroTilesReady=!1,this._loadQueueTimeSlice=5,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=i(e.maximumScreenSpaceError,2),this.tileCacheSize=i(e.tileCacheSize,100),this._occluders=new p({ellipsoid:r}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function y(e,t){var i=h.center(e.rectangle,L),r=i.longitude-N.longitude,n=i.latitude-N.latitude;i=h.center(t.rectangle,L);var o=i.longitude-N.longitude,a=i.latitude-N.latitude;return r*r+n*n-(o*o+a*a)}function C(e,t){var i=e._debug;if(!i.suspendLodUpdate){var n,o,a=e._tilesToRender;if(a.length=0,!r(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var s=e._tileProvider.tilingScheme;e._levelZeroTiles=m.createLevelZeroTiles(s)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l,u=e._tileProvider,c=e._occluders,h=e._levelZeroTiles;N=t.camera.positionCartographic,h.sort(y);var p=e._addHeightCallbacks,f=e._removeHeightCallbacks,_=t.frameNumber;if(p.length>0||f.length>0){for(n=0,o=h.length;n<o;++n)l=h[n],l._updateCustomData(_,p,f);p.length=0,f.length=0}for(n=0,o=h.length;n<o;++n)l=h[n],e._tileReplacementQueue.markTileRendered(l),l.renderable?u.computeTileVisibility(l,t,c)!==d.NONE?w(e,t,l):(l.needsLoading&&e._tileLoadQueueLow.push(l),++i.tilesCulled):(l.needsLoading&&e._tileLoadQueueHigh.push(l),++i.tilesWaitingForChildren);x(e)}}function w(e,t,i){var r=e._debug;if(++r.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>r.maxDepth&&(r.maxDepth=i.level),A(e,t,i)<e.maximumScreenSpaceError)return i.needsLoading&&e._tileLoadQueueMedium.push(i),void D(e,i);var n=i.southwestChild,o=i.southeastChild,a=i.northwestChild,s=i.northeastChild,l=n.renderable&&o.renderable&&a.renderable&&s.renderable,u=n.upsampledFromParent&&o.upsampledFromParent&&a.upsampledFromParent&&s.upsampledFromParent;l?u?(D(e,i),S(e,t.camera.positionCartographic,n,o,a,s),i.needsLoading&&e._tileLoadQueueMedium.push(i)):(b(e,n,o,a,s,t),i.needsLoading&&e._tileLoadQueueLow.push(i)):(S(e,t.camera.positionCartographic,n,o,a,s),D(e,i),i.needsLoading&&e._tileLoadQueueLow.push(i))}function S(e,t,i,r,n,o){t.longitude<i.east?t.latitude<i.north?(E(e,i),E(e,r),E(e,n),E(e,o)):(E(e,n),E(e,i),E(e,o),E(e,r)):t.latitude<i.north?(E(e,r),E(e,i),E(e,o),E(e,n)):(E(e,o),E(e,n),E(e,r),E(e,i))}function E(e,t){e._tileReplacementQueue.markTileRendered(t),t.needsLoading&&(t.renderable?e._tileLoadQueueLow.push(t):e._tileLoadQueueHigh.push(t))}function b(e,t,i,r,n,o){var a=o.camera.positionCartographic,s=e._tileProvider,l=e._occluders;a.longitude<t.rectangle.east?a.latitude<t.rectangle.north?(T(e,t,s,o,l),T(e,i,s,o,l),T(e,r,s,o,l),T(e,n,s,o,l)):(T(e,r,s,o,l),T(e,t,s,o,l),T(e,n,s,o,l),T(e,i,s,o,l)):a.latitude<t.rectangle.north?(T(e,i,s,o,l),T(e,t,s,o,l),T(e,n,s,o,l),T(e,r,s,o,l)):(T(e,n,s,o,l),T(e,r,s,o,l),T(e,i,s,o,l),T(e,t,s,o,l))}function T(e,t,i,r,n){i.computeTileVisibility(t,r,n)!==d.NONE?w(e,r,t):(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t))}function x(e){var t=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function A(e,t,i){if(t.mode===_.SCENE2D)return P(e,t,i);var r=e._tileProvider.getLevelMaximumGeometricError(i.level),n=i._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=r*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function P(e,t,i){var r=t.camera,n=r.frustum,o=t.context,a=o.drawingBufferWidth,s=o.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(i.level),u=Math.max(n.top-n.bottom,n.right-n.left)/Math.max(a,s);return l/u}function D(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function M(e,t){var i=e._tileLoadQueueHigh,r=e._tileLoadQueueMedium,n=e._tileLoadQueueLow,o=e._tileProvider;if(0!==i.length||0!==r.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var a=s()+e._loadQueueTimeSlice;I(e,t,o,a,i),I(e,t,o,a,r),I(e,t,o,a,n)}}function I(e,t,i,r,n){for(var o=0,a=n.length;o<a&&s()<r;++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l)}}function R(n,o){for(var a=n._tileToUpdateHeights,l=n._tileProvider.terrainProvider,u=s(),c=n._updateHeightsTimeSlice,d=u+c,p=o.mode,m=o.mapProjection,f=m.ellipsoid;a.length>0;){for(var g=a[0],v=g.customData,y=v.length,C=!1,w=n._lastTileIndex;w<y;++w){var S=v[w];if(g.level>S.level){if(r(S.positionOnEllipsoidSurface)||(S.positionOnEllipsoidSurface=e.fromRadians(S.positionCartographic.longitude,S.positionCartographic.latitude,0,f)),p===_.SCENE3D){var E=f.geodeticSurfaceNormal(S.positionOnEllipsoidSurface,B.direction),b=f.getSurfaceNormalIntersectionWithZAxis(S.positionOnEllipsoidSurface,11500,B.origin);if(!r(b)){var T=Math.min(i(g.data.minimumHeight,0),-11500),x=e.multiplyByScalar(E,Math.abs(T)+1,V);e.subtract(S.positionOnEllipsoidSurface,x,B.origin)}}else t.clone(S.positionCartographic,F),F.height=-11500,m.project(F,V),e.fromElements(V.z,V.x,V.y,V),e.clone(V,B.origin),e.clone(e.UNIT_X,B.direction);var A=g.data.pick(B,p,m,!1,V);r(A)&&S.callback(A),S.level=g.level}else if(g.level===S.level){for(var P,D=g.children,M=D.length,I=0;I<M&&(P=D[I],!h.contains(P.rectangle,S.positionCartographic));++I);var R=l.getTileDataAvailable(P.x,P.y,P.level),O=g.parent;(r(R)&&!R||r(O)&&r(O.data)&&r(O.data.terrainData)&&!O.data.terrainData.isChildAvailable(O.x,O.y,P.x,P.y))&&S.removeFunc()}if(s()>=d){C=!0;break}}if(C){n._lastTileIndex=w;break}n._lastTileIndex=0,a.shift()}}function O(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=e._tileToUpdateHeights,o=0,a=r.length;o<a;++o){var s=r[o];i.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}}n(v.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),v.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var t=this._levelZeroTiles;if(r(t))for(var i=0;i<t.length;++i){for(var n=t[i],o=n.customData,a=o.length,s=0;s<a;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[i].freeResources()}this._levelZeroTiles=void 0,this._tileProvider.cancelReprojections()},v.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;r(t);)t.state!==f.START&&e(t),t=t.replacementNext},v.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},v.prototype.updateHeight=function(e,t){var i=this,r={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return r.removeFunc=function(){for(var e=i._addHeightCallbacks,t=e.length,n=0;n<t;++n)if(e[n]===r){e.splice(n,1);break}i._removeHeightCallbacks.push(r)},i._addHeightCallbacks.push(r),r.removeFunc},v.prototype.beginFrame=function(e){var t=e.passes;if(t.render){this._tileProvider.initialize(e);var i=this._debug;i.suspendLodUpdate||(i.maxDepth=0,i.tilesVisited=0,i.tilesCulled=0,i.tilesRendered=0,i.tilesWaitingForChildren=0,this._tileLoadQueueHigh.length=0,this._tileLoadQueueMedium.length=0,this._tileLoadQueueLow.length=0,this._tileReplacementQueue.markStartOfRenderFrame())}},v.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),C(this,e),O(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},v.prototype.endFrame=function(e){var t=e.passes;if(t.render&&e.mode!==_.MORPHING){M(this,e),R(this,e);var i=this._debug;i.suspendLodUpdate||i.enableDebugOutput&&(i.tilesVisited===i.lastTilesVisited&&i.tilesRendered===i.lastTilesRendered&&i.tilesCulled===i.lastTilesCulled&&i.maxDepth===i.lastMaxDepth&&i.tilesWaitingForChildren===i.lastTilesWaitingForChildren||(console.log("Visited "+i.tilesVisited+", Rendered: "+i.tilesRendered+", Culled: "+i.tilesCulled+", Max Depth: "+i.maxDepth+", Waiting for children: "+i.tilesWaitingForChildren),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren))}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var N,L=new t,B=new c,F=new t,V=new e;return v}),i("Scene/Globe",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/Event","../Core/IntersectionTests","../Core/loadImage","../Core/Math","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P){"use strict";function D(e){e=n(e,u.WGS84);var i=new c({ellipsoid:e}),r=new T;this._ellipsoid=e,this._imageryLayerCollection=r,this._surfaceShaderSet=new E,this._surfaceShaderSet.baseVertexShaderSource=new g({sources:[w,C]}),this._surfaceShaderSet.baseFragmentShaderSource=new g({sources:[y]}),this._surface=new x({tileProvider:new b({terrainProvider:i,imageryLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=i,this._terrainProviderChanged=new h,this.show=!0,this.oceanNormalMapUrl=t("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=P.RECEIVE_ONLY,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function M(t){return function(i,r){var n=e.distanceSquaredTo(i.pickBoundingSphere,t),o=e.distanceSquaredTo(r.pickBoundingSphere,t);return n-o}}function I(e,t){return _.contains(e.rectangle,t)?e:void 0}a(D.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var R=[],O={start:0,stop:0};D.prototype.pick=function(t,r,n){var a=r.mode,s=r.mapProjection,l=R;l.length=0;var u,c,h=this._surface._tilesToRender,p=h.length;for(c=0;c<p;++c){u=h[c];var m=u.data;if(o(m)){var f=m.pickBoundingSphere;a!==A.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,m.minimumHeight,m.maximumHeight,f),i.fromElements(f.center.z,f.center.x,f.center.y,f.center)):e.clone(m.boundingSphere3D,f);var _=d.raySphere(t,f,O);o(_)&&l.push(m)}}l.sort(M(t.origin));var g;for(p=l.length,c=0;c<p&&(g=l[c].pick(t,r.mode,r.mapProjection,!0,n),!o(g));++c);return g};var N=new i,L=new i,B=new r,F=new f;return D.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var r,a,s=t.length;for(a=0;a<s&&(r=t[a],!_.contains(r.rectangle,e));++a);if(o(r)&&_.contains(r.rectangle,e)){for(;r.renderable;)r=I(r.southwestChild,e)||I(r.southeastChild,e)||I(r.northwestChild,e)||r.northeastChild;for(;o(r)&&(!o(r.data)||!o(r.data.pickTerrain));)r=r.parent;if(o(r)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=i.fromRadians(e.longitude,e.latitude,0,l,N),c=F,h=l.geodeticSurfaceNormal(u,c.direction),d=l.getSurfaceNormalIntersectionWithZAxis(u,11500,c.origin);if(!o(d)){var p=Math.min(n(r.data.minimumHeight,0),-11500),m=i.multiplyByScalar(h,Math.abs(p)+1,L);i.subtract(u,m,c.origin)}var f=r.data.pick(c,void 0,void 0,!1,L);if(o(f))return l.cartesianToCartographic(f,B).height}}}},D.prototype.beginFrame=function(e){if(this.show){var t=this._surface,i=t.tileProvider,r=this.terrainProvider,n=this.showWaterEffect&&r.ready&&r.hasWaterMask;if(n&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var a=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=a,o(a)){var s=this;S(p(a),function(t){a===s.oceanNormalMapUrl&&(s._oceanNormalMap=s._oceanNormalMap&&s._oceanNormalMap.destroy(),s._oceanNormalMap=new v({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var l=e.mode,u=e.passes;u.render&&(l===A.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,i.terrainProvider=this.terrainProvider,i.lightingFadeOutDistance=this.lightingFadeOutDistance,i.lightingFadeInDistance=this.lightingFadeInDistance,i.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,i.hasWaterMask=n,i.oceanNormalMap=this._oceanNormalMap,i.enableLighting=this.enableLighting,i.shadows=this.shadows,t.beginFrame(e))}},D.prototype.update=function(e){if(this.show){var t=this._surface,i=e.passes;i.render&&t.update(e),i.pick&&t.update(e)}},D.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),s(this)},D}),i("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._debugGlobeDepthViewportCommand=void 0}function d(e,t,r){if(!i(e._debugGlobeDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n    float n_range = czm_depthRange.near;\n    float f_range = czm_depthRange.far;\n    float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n    float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n    gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,r)}function p(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),
e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function m(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function f(e,t,i,r){e._colorTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE}),e._depthStencilTexture=new u({context:t,width:i,height:r,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}),e._globeDepthTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE})}function _(e,t,i,r){e.framebuffer=new a({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new a({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function g(e,t,r,n){var o=e._colorTexture,a=!i(o)||o.width!==r||o.height!==n;i(e.framebuffer)&&!a||(p(e),m(e),f(e,t,r,n),_(e,t,r,n))}function v(r,n,a,s){if(r._viewport.width=a,r._viewport.height=s,i(r._rs)&&e.equals(r._viewport,r._rs.viewport)||(r._rs=l.fromCache({viewport:r._viewport})),!i(r._copyDepthCommand)){var u="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";r._copyDepthCommand=n.createViewportQuadCommand(u,{uniformMap:{u_texture:function(){return r._depthStencilTexture}},owner:r})}r._copyDepthCommand.framebuffer=r._copyDepthFramebuffer,i(r._copyColorCommand)||(r._copyColorCommand=n.createViewportQuadCommand(c,{uniformMap:{u_texture:function(){return r._colorTexture}},owner:r})),r._copyDepthCommand.renderState=r._rs,r._copyColorCommand.renderState=r._rs,i(r._clearColorCommand)||(r._clearColorCommand=new o({color:new t(0,0,0,0),stencil:0,owner:r})),r._clearColorCommand.framebuffer=r.framebuffer}return h.prototype.executeDebugGlobeDepth=function(e,t){d(this,e,t)},h.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;g(this,e,t,i),v(this,e,t,i),e.uniformState.globeDepthTexture=void 0},h.prototype.executeCopyDepth=function(e,t){i(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},h.prototype.executeCopyColor=function(e,t){i(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},h.prototype.clear=function(e,r,n){var o=this._clearColorCommand;i(o)&&(t.clone(n,o.color),o.execute(e,r))},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){p(this),m(this),i(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),i(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return i(e)&&(e.shaderProgram=e.shaderProgram.destroy()),r(this)},h}),i("Scene/GoogleEarthImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(r){function n(e){var t;try{t=JSON.parse(e)}catch(i){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n,o=0;o<t.layers.length;o++)if(t.layers[o].id===v._channel){n=t.layers[o];break}var s;if(!i(n))throw s="Could not find layer with channel (id) of "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);if(!i(n.version))throw s="Could not find a version in channel (id) "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);if(v._version=n.version,i(t.projection)&&"flat"===t.projection)v._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:r.ellipsoid});else{if(i(t.projection)&&"mercator"!==t.projection)throw s="Unsupported projection "+t.projection+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,f),new u(s);v._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:r.ellipsoid})}v._imageUrlTemplate=v._imageUrlTemplate.replace("{request}",v._requestType).replace("{channel}",v._channel).replace("{version}",v._version),v._ready=!0,v._readyPromise.resolve(!0),c.handleSuccess(_)}function p(e){var t="An error occurred while accessing "+g+".";_=c.handleError(_,v,v._errorEvent,t,void 0,void 0,void 0,f),v._readyPromise.reject(new u(t))}function f(){var e=i(v._proxy)?v._proxy.getURL(g):g,t=s(e);d(t,n,p)}r=t(r,{}),this._url=r.url,this._path=t(r.path,"/default_map"),this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._channel=r.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",m._logoData,"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=r.maximumLevel,this._imageUrlTemplate=this._url+this._path+"/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}",this._errorEvent=new o,this._ready=!1,this._readyPromise=d.defer();var _,g=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",v=this;f()}function f(e,t,r,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",r),o=o.replace("{zoom}",n+1);var a=e._proxy;return i(a)&&(o=a.getURL(o)),o}return r(m.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),m.prototype.getTileCredits=function(e,t,i){},m.prototype.requestImage=function(e,t,i){var r=f(this,e,t,i);return p.loadImage(this,r)},m.prototype.pickFeatures=function(){},m._logoData="data:image/png;base64, ",m}),i("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new o({ellipsoid:e.ellipsoid}),this._cells=t(e.cells,8),this._color=t(e.color,l),this._glowColor=t(e.glowColor,u),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,c),this._errorEvent=new n,this._tileWidth=t(e.tileWidth,256),this._tileHeight=t(e.tileHeight,256),this._canvasSize=t(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=a.resolve(!0)}var l=new e(1,1,1,.4),u=new e(0,1,0,.05),c=new e(0,.5,0,.2);return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype._drawGrid=function(e){for(var t=0,i=this._canvasSize,r=0;r<=this._cells;++r){var n=r/this._cells,o=1+n*(i-1);e.moveTo(o,t),e.lineTo(o,i),e.moveTo(t,o),e.lineTo(i,o)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=0,i=this._canvasSize,r=e.getContext("2d"),n=this._backgroundColor.toCssColorString();r.fillStyle=n,r.fillRect(t,t,i,i);var o=this._glowColor.toCssColorString();r.strokeStyle=o,r.lineWidth=this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r),r.lineWidth=.5*this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r);var a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(t,t,i,i),r.lineWidth=1,this._drawGrid(r),e},s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){return this._canvas},s.prototype.pickFeatures=function(){},s}),i("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT);var n=r.mapId,s=t(r.url,"https://api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(r.accessToken),this._accessTokenErrorCredit=o.getErrorCredit(r.key);var h=t(r.format,"png");/\./.test(h)||(h="."+h),this._format=h;var d=s;if(l.test(s)||(d+="/"),d+=n+"/{z}/{x}/{y}"+this._format,i(this._accessToken)&&(d+="?access_token="+this._accessToken),i(r.credit)){var p=r.credit;"string"==typeof p&&(p=new e(p)),u=p,c.length=0}this._imageryProvider=new a({url:d,proxy:r.proxy,credit:u,ellipsoid:r.ellipsoid,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,rectangle:r.rectangle})}var l=/\/$/,u=new e("© Mapbox © OpenStreetMap",void 0,"https://www.mapbox.com/about/maps/"),c=[new e("Improve this map",void 0,"https://www.mapbox.com/map-feedback/")];return r(s.prototype,{url:{get:function(){return this._url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),s.prototype.getTileCredits=function(e,t,r){var n=c.slice();return i(this._accessTokenErrorCredit)&&n.push(this._accessTokenErrorCredit),n},s.prototype.requestImage=function(e,t,i){return this._imageryProvider.requestImage(e,t,i)},s.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},s}),i("Scene/Moon",["../Core/buildModuleUrl","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IauOrientationAxes","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","./EllipsoidPrimitive","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p){"use strict";function m(t){t=i(t,i.EMPTY_OBJECT);var n=t.textureUrl;r(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=i(t.show,!0),this.textureUrl=n,this._ellipsoid=i(t.ellipsoid,a.MOON),this.onlySunLighting=i(t.onlySunLighting,!0),this._ellipsoidPrimitive=new d({radii:this.ellipsoid.radii,material:p.fromType(p.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var f=new l,_=new l,g=new t,v=[];return m.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;r(h.computeIcrfToFixedMatrix(i,f))||h.computeTemeToPseudoFixedMatrix(i,f);var n=this._axes.evaluate(i,_);l.transpose(n,n),l.multiply(f,n,n);var o=c.computeMoonPositionInEarthInertialFrame(i,g);l.multiplyByVector(f,o,o),u.fromRotationTranslation(n,o,t.modelMatrix);var a=e.commandList;return e.commandList=v,v.length=0,t.update(e),e.commandList=a,1===v.length?v[0]:void 0}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},m}),i("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e}),i("Shaders/AdjustTranslucentFS",[],function(){"use strict";return"#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n"}),i("Shaders/CompositeOITFS",[],function(){"use strict";return"uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\n}\n"}),i("Scene/OIT",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g){"use strict";function v(i){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var r=i.floatingPointTexture&&i.depthTexture;this._translucentMRTSupport=i.drawBuffers&&r,this._translucentMultipassSupport=!this._translucentMRTSupport&&r,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new a({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new a({color:new t(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._translucentShaderCache={},this._alphaShaderCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new e,this._rs=void 0}function y(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function C(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function w(e){y(e),C(e)}function S(e,t,i,r){y(e);var o=new Float32Array(i*r*4);e._accumulationTexture=new p({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}}),e._revealageTexture=new p({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}})}function E(e,t){C(e);var i=o.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===i&&e._adjustTranslucentFBO.status===i||(C(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new l({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new l({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,a=e._alphaFBO.status===i,s=e._adjustTranslucentFBO.status===i,u=e._adjustAlphaFBO.status===i;n&&a&&s&&u||(w(e),e._translucentMultipassSupport=!1,r=!1)}return r}function b(e,t,r,n){var o=r[n.id];if(!i(o)){var a=c.getState(n);a.depthMask=!1,a.blending=t,o=c.fromCache(a),r[n.id]=o}return o}function T(e,t,i){return b(t,N,e._translucentRenderStateCache,i)}function x(e,t,i){return b(t,L,e._translucentRenderStateCache,i)}function A(e,t,i){return b(t,B,e._alphaRenderStateCache,i)}function P(e,t,r,n){var o=t.id,a=r[o];if(!i(a)){var s=t._attributeLocations,l=t.fragmentShaderSource.clone();l.sources=l.sources.map(function(e){return e=d.replaceMain(e,"czm_translucent_main"),e=e.replace(/gl_FragColor/g,"czm_gl_FragColor"),e=e.replace(/\bdiscard\b/g,"czm_discard = true"),e=e.replace(/czm_phong/g,"czm_translucentPhong")}),l.sources.splice(0,0,(n.indexOf("gl_FragData")!==-1?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),l.sources.push("void main()\n{\n    czm_translucent_main();\n    if (czm_discard)\n    {\n        discard;\n    }\n"+n+"}\n"),a=h.fromCache({context:e,vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:l,attributeLocations:s}),r[o]=a}return a}function D(e,t,i){return P(t,i,e._translucentShaderCache,F)}function M(e,t,i){return P(t,i,e._translucentShaderCache,V)}function I(e,t,i){return P(t,i,e._alphaShaderCache,k)}function R(e,t,i,r,n){var o,a,s,l=t.context,u=r.framebuffer,c=n.length,h=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var d=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<c;++s)o=n[s],a=h&&o.receiveShadows?o.derivedCommands.oit.shadows.translucentCommand:o.derivedCommands.oit.translucentCommand,i(a,t,l,r,d);for(r.framebuffer=e._alphaFBO,s=0;s<c;++s)o=n[s],a=h&&o.receiveShadows?o.derivedCommands.oit.shadows.alphaCommand:o.derivedCommands.oit.alphaCommand,i(a,t,l,r,d);r.framebuffer=u}function O(e,t,i,r,n){var o=t.context,a=r.framebuffer,s=n.length,l=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,r);var u=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var c=0;c<s;++c){var h=n[c],d=l&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand;i(d,t,o,r,u)}r.framebuffer=a}v.prototype.update=function(t,r){if(this.isSupported()){this._opaqueFBO=r,this._opaqueTexture=r.getColorTexture(0),this._depthStencilTexture=r.depthStencilTexture;var n=this._opaqueTexture.width,o=this._opaqueTexture.height,a=this._accumulationTexture,s=!i(a)||a.width!==n||a.height!==o;if(s&&S(this,t,n,o),i(this._translucentFBO)&&!s||E(this,t)){var l,u,h=this;i(this._compositeCommand)||(l=new d({sources:[f]}),this._translucentMRTSupport&&l.defines.push("MRT"),u={u_opaque:function(){return h._opaqueTexture},u_accumulation:function(){return h._accumulationTexture},u_revealage:function(){return h._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})),i(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(l=new d({defines:["MRT"],sources:[m]}),u={u_bgColor:function(){return h._translucentMRTClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})):this._translucentMultipassSupport&&(l=new d({sources:[m]}),u={u_bgColor:function(){return h._translucentMultipassClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}),u={u_bgColor:function(){return h._alphaClearCommand.color;
},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}))),this._viewport.width=n,this._viewport.height=o,i(this._rs)&&e.equals(this._viewport,this._rs.viewport)||(this._rs=c.fromCache({viewport:this._viewport})),i(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var N={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},L={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ONE,functionDestinationAlpha:g.ONE},B={enabled:!0,color:new t(0,0,0,0),equationRgb:_.ADD,equationAlpha:_.ADD,functionSourceRgb:g.ZERO,functionDestinationRgb:g.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},F="    vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n    float ai = czm_gl_FragColor.a;\n    float wzi = czm_alphaWeight(ai);\n    gl_FragData[0] = vec4(Ci * wzi, ai);\n    gl_FragData[1] = vec4(ai * wzi);\n",V="    vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n    float ai = czm_gl_FragColor.a;\n    float wzi = czm_alphaWeight(ai);\n    gl_FragColor = vec4(Ci, ai) * wzi;\n",k="    float ai = czm_gl_FragColor.a;\n    gl_FragColor = vec4(ai);\n";return v.prototype.createDerivedCommands=function(e,t,r){if(i(r)||(r={}),this._translucentMRTSupport){var n,o;i(r.translucentCommand)&&(n=r.translucentCommand.shaderProgram,o=r.translucentCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),i(n)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=n,r.translucentCommand.renderState=o):(r.translucentCommand.shaderProgram=D(this,t,e.shaderProgram),r.translucentCommand.renderState=T(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}else{var a,l,u,c;i(r.translucentCommand)&&(a=r.translucentCommand.shaderProgram,l=r.translucentCommand.renderState,u=r.alphaCommand.shaderProgram,c=r.alphaCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),r.alphaCommand=s.shallowClone(e,r.alphaCommand),i(a)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=a,r.translucentCommand.renderState=l,r.alphaCommand.shaderProgram=u,r.alphaCommand.renderState=c):(r.translucentCommand.shaderProgram=M(this,t,e.shaderProgram),r.translucentCommand.renderState=x(this,t,e.renderState),r.alphaCommand.shaderProgram=I(this,t,e.shaderProgram),r.alphaCommand.renderState=A(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}return r},v.prototype.executeCommands=function(e,t,i,r){return this._translucentMRTSupport?void O(this,e,t,i,r):void R(this,e,t,i,r)},v.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},v.prototype.clear=function(e,i,r){var n=i.framebuffer;i.framebuffer=this._opaqueFBO,t.clone(r,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,i),i.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(e,i),this._translucentMultipassSupport&&(i.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,i)),i.framebuffer=n},v.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){w(this),i(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),i(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy());var e,t=this._translucentShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();this._translucentShaderCache={},t=this._alphaShaderCache;for(e in t)t.hasOwnProperty(e)&&i(t[e])&&t[e].destroy();return this._alphaShaderCache={},r(this)},v}),i("Scene/OrthographicFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._orthographicMatrix=new o}function l(e){e.top===e._top&&e.bottom===e._bottom&&e.left===e._left&&e.right===e._right&&e.near===e._near&&e.far===e._far||(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=o.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var u=new e,c=new e,h=new e,d=new e;return s.prototype.computeCullingVolume=function(r,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,m=this.left,f=this.near,_=this.far,g=e.cross(n,o,u),v=c;e.multiplyByScalar(n,f,v),e.add(r,v,v);var y=h;e.multiplyByScalar(g,m,y),e.add(v,y,y);var C=a[0];return i(C)||(C=a[0]=new t),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-e.dot(g,y),e.multiplyByScalar(g,p,y),e.add(v,y,y),C=a[1],i(C)||(C=a[1]=new t),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-e.dot(e.negate(g,d),y),e.multiplyByScalar(o,l,y),e.add(v,y,y),C=a[2],i(C)||(C=a[2]=new t),C.x=o.x,C.y=o.y,C.z=o.z,C.w=-e.dot(o,y),e.multiplyByScalar(o,s,y),e.add(v,y,y),C=a[3],i(C)||(C=a[3]=new t),C.x=-o.x,C.y=-o.y,C.z=-o.z,C.w=-e.dot(e.negate(o,d),y),C=a[4],i(C)||(C=a[4]=new t),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-e.dot(n,v),e.multiplyByScalar(n,_,y),e.add(r,y,y),C=a[5],i(C)||(C=a[5]=new t),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-e.dot(e.negate(n,d),y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,i,r){l(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return r.x=a,r.y=s,r},s.prototype.clone=function(e){return i(e)||(e=new s),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e},s.prototype.equals=function(e){return i(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s}),i("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e}return t}),i("Scene/PerformanceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,i,r,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT);var i=o(t.container);this._container=i;var r=document.createElement("div");r.className="cesium-performanceDisplay";var n=document.createElement("div");n.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),n.appendChild(this._fpsText);var a=document.createElement("div");a.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),a.appendChild(this._msText),r.appendChild(a),r.appendChild(n),this._container.appendChild(r),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0}return a.prototype.update=function(){if(!t(this._time))return this._lastFpsSampleTime=n(),void(this._time=n());var e=this._time,i=n();this._time=i;var r=i-e;this._frameCount++;var o=this._fps,a=i-this._lastFpsSampleTime;a>1e3&&(o=1e3*this._frameCount/a|0,this._lastFpsSampleTime=i,this._frameCount=0),o!==this._fps&&(this._fpsText.nodeValue=o+" FPS",this._fps=o),r!==this._frameTime&&(this._msText.nodeValue=r.toFixed(2)+" MS",this._frameTime=r)},a.prototype.destroy=function(){return i(this)},a}),i("Scene/PickDepth",["../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture"],function(e,t,i,r,n,o,a){"use strict";function s(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function l(t,i,r){if(!e(t._debugPickDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n    float n_range = czm_depthRange.near;\n    float f_range = czm_depthRange.far;\n    float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n    float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n    gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";t._debugPickDepthViewportCommand=i.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(i,r)}function u(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function c(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function h(e,t,r,o){e._depthTexture=new a({context:t,width:r,height:o,pixelFormat:i.RGBA,pixelDatatype:n.UNSIGNED_BYTE})}function d(e,t,i,n){u(e),c(e),h(e,t,i,n),e.framebuffer=new r({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function p(t,i,r){var n=r.width,o=r.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;e(t.framebuffer)&&!s||d(t,i,n,o)}function m(t,i,r){if(!e(t._copyDepthCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";t._copyDepthCommand=i.createViewportQuadCommand(n,{renderState:o.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=r,t._copyDepthCommand.framebuffer=t.framebuffer}return s.prototype.executeDebugPickDepth=function(e,t){l(this,e,t)},s.prototype.update=function(e,t){p(this,e,t),m(this,e,t)},s.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return u(this),c(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),t(this)},s}),i("Shaders/Appearances/PointAppearanceFS",[],function(){"use strict";return"uniform vec4 highlightColor;\nvarying vec3 v_color;\nvoid main()\n{\ngl_FragColor = vec4(v_color * highlightColor.rgb, highlightColor.a);\n}\n"}),i("Shaders/Appearances/PointAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 color;\nattribute float batchId;\nuniform float pointSize;\nvarying vec3 v_positionEC;\nvarying vec3 v_color;\nvoid main()\n{\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * czm_computePosition();\ngl_PointSize = pointSize;\n}\n"}),i("Scene/PointAppearance",["../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PointAppearanceFS","../Shaders/Appearances/PointAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT),this._vertexShaderSource=i(n.vertexShaderSource,s),this._fragmentShaderSource=i(n.fragmentShaderSource,a),this._renderState=l.getDefaultRenderState(!1,!1,n.renderState),this._pointSize=i(n.pointSize,2),this._highlightColor=r(n.highlightColor)?n.highlightColor:new e,this.material=void 0,this.translucent=i(n.translucent,!1),this.uniforms={highlightColor:this._highlightColor,pointSize:this._pointSize};var o=n.uniforms;this.uniforms=t(this.uniforms,o,!0)}return n(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return!1}},vertexFormat:{get:function(){return u.VERTEX_FORMAT}},pixelSize:{get:function(){return this._pointSize}}}),u.VERTEX_FORMAT=o.POSITION_AND_COLOR,u.prototype.getFragmentShaderSource=l.prototype.getFragmentShaderSource,u.prototype.isTranslucent=l.prototype.isTranslucent,u.prototype.getRenderState=l.prototype.getRenderState,u});i("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(i.show,!0),this.destroyPrimitives=t(i.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return r(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{},i=t._composites=t._composites||{};return i[this._guid]={collection:this},this._primitives.push(e),e},a.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,i=0;i<t;++i)e[i].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(i(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(t!==r.length-1){var n=r[t];r[t]=r[t+1],r[t+1]=n}}},a.prototype.raiseToTop=function(e){if(i(e)){var t=s(this,e),r=this._primitives;t!==r.length-1&&(r.splice(t,1),r.push(e))}},a.prototype.lower=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(0!==t){var n=r[t];r[t]=r[t-1],r[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(i(e)){var t=s(this,e),r=this._primitives;0!==t&&(r.splice(t,1),r.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,i=0;i<t.length;++i)t[i].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a});i("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return i.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(i.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),i.prototype.beginUpdate=t.throwInstantiationError,i.prototype.endUpdate=t.throwInstantiationError,i.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,i.prototype.loadTile=t.throwInstantiationError,i.prototype.computeTileVisibility=t.throwInstantiationError,i.prototype.showTileThisFrame=t.throwInstantiationError,i.prototype.computeDistanceToTile=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i}),i("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/Matrix4","../Core/Ray","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Transforms","./Camera","./OrthographicFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0}function g(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas,!1);var i=function(){e._morphCancelled=!0,t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,c.LEFT_DOWN),e._morphHandler.setInputAction(i,c.MIDDLE_DOWN),e._morphHandler.setInputAction(i,c.RIGHT_DOWN),e._morphHandler.setInputAction(i,c.WHEEL)}}function v(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function y(e,t){var i=e._scene,r=i.camera,n=Y,o=n.position,a=n.direction,l=n.up,u=i.mapProjection.unproject(r.position,H);t.cartographicToCartesian(u,o);var c=t.scaleToGeodeticSurface(o,q),d=h.eastNorthUpToFixedFrame(c,t,j);return s.multiplyByPointAsVector(d,r.direction,a),s.multiplyByPointAsVector(d,r.up,l),n}function C(t,i,r,n){function a(t){S(c,m,t.time,u.position),S(h,f,t.time,u.direction),S(p,_,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,X),h=e.clone(u.direction,Z),p=e.clone(u.up,K),m=s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,r.position,Q),f=s.multiplyByPointAsVector(d.TRANSFORM_2D_INVERSE,r.direction,J),_=s.multiplyByPointAsVector(d.TRANSFORM_2D_INVERSE,r.up,$),g=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){D(t,l,0,1,i,n)}});t._currentTweens.push(g)}function w(t,i,r){function n(t){S(d,_,t.time,l.position),S(p,v,t.time,l.direction),S(m,w,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right);var i=l.frustum;i.right=a.lerp(E,b,t.time),i.left=-i.right,i.top=i.right*(s.drawingBufferHeight/s.drawingBufferWidth),i.bottom=-i.top,l.position.z=2*s.mapProjection.ellipsoid.maximumRadius}i/=3;var s=t._scene,l=s.camera,u=ee;u.aspectRatio=s.drawingBufferWidth/s.drawingBufferHeight,u.fov=a.toRadians(60);var c;i>0?(c=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,c.position),e.negate(c.position,c.direction),e.normalize(c.direction,c.direction),e.clone(e.UNIT_Z,c.up)):(l.position.z=l.frustum.right-l.frustum.left,c=y(t,r)),c.frustum=u;var h=M(c);g(t,h);var d=e.clone(l.position,ve),p=e.clone(l.direction,ye),m=e.clone(l.up,Ce),_=e.fromElements(0,0,5*r.maximumRadius,we),v=e.negate(e.UNIT_Z,Se),w=e.clone(e.UNIT_Y,Ee),E=l.frustum.right,b=.5*_.z;if(i>0){var T=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){s._mode=f.MORPHING,x(t,i,c,function(){C(t,i,c,h)})}});t._currentTweens.push(T)}else x(t,i,c,function(){C(t,i,c,h)})}function S(t,i,r,n){return e.lerp(t,i,r,n)}function E(e,t,i,r,n){function s(e){u.frustum.fov=a.lerp(c,h,e.time);var t=d/Math.tan(.5*u.frustum.fov);r(u,t)}var l=e._scene,u=l.camera,c=u.frustum.fov,h=.5*a.RADIANS_PER_DEGREE,d=i.position.z*Math.tan(.5*c);u.frustum.far=d/Math.tan(.5*h)+1e7;var p=l.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){u.frustum=i.frustum.clone(),n(e)}});e._currentTweens.push(p)}function b(t,r){function n(t){S(c,_,t.time,u.position),S(h,m,t.time,u.direction),S(p,f,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}function a(e,t){e.position.z=t}r*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,te),h=e.clone(u.direction,ie),p=e.clone(u.up,re),m=e.negate(e.UNIT_Z,oe),f=e.clone(e.UNIT_Y,ae),_=ne;if(r>0)e.clone(e.ZERO,ne),_.z=5*l.mapProjection.ellipsoid.maximumRadius;else{e.clone(c,ne);var v=le;s.multiplyByPoint(d.TRANSFORM_2D,c,v.origin),s.multiplyByPointAsVector(d.TRANSFORM_2D,h,v.direction);var y=l.globe;if(i(y)){var C=y.pick(v,l,ue);i(C)&&(s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,C,_),_.z+=e.distance(c,_))}}var w=se;w.right=.5*_.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var b=ce;b.position=_,b.direction=m,b.up=f,b.frustum=w;var T=I(b);g(t,T);var x=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){E(t,r,b,a,T)}});t._currentTweens.push(x)}function T(t,r,n){function o(e,t){e.position.x=t}function a(){E(t,r,c,o,b)}r*=.5;var l=t._scene,u=l.camera,c=de;if(r>0)e.clone(e.ZERO,c.position),c.position.z=5*n.maximumRadius,e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);else{n.cartesianToCartographic(u.positionWC,he),l.mapProjection.project(he,c.position),e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);var p=fe;e.clone(c.position2D,p.origin);var m=e.clone(u.directionWC,p.direction),f=n.scaleToGeodeticSurface(u.positionWC,ge),_=h.eastNorthUpToFixedFrame(f,n,_e);s.inverseTransformation(_,_),s.multiplyByPointAsVector(_,m,m),s.multiplyByPointAsVector(d.TRANSFORM_2D,m,m);var v=l.globe;if(i(v)){var y=v.pick(p,l,me);if(i(y)){var C=e.distance(c.position2D,y);y.x+=C,e.clone(y,c.position2D)}}}s.multiplyByPoint(d.TRANSFORM_2D,c.position,c.position2D),s.multiplyByPointAsVector(d.TRANSFORM_2D,c.direction,c.direction2D),s.multiplyByPointAsVector(d.TRANSFORM_2D,c.up,c.up2D);var w=c.frustum;w.right=.5*c.position.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var S=pe;s.multiplyByPoint(d.TRANSFORM_2D_INVERSE,c.position2D,S.position),e.clone(c.direction,S.direction),e.clone(c.up,S.up),S.frustum=w;var b=I(S);g(t,b),P(t,r,c,a)}function x(e,t,i,r){function n(e){l.frustum.fov=a.lerp(h,c,e.time),l.position.z=d/Math.tan(.5*l.frustum.fov)}var s=e._scene,l=s.camera,u=l.frustum.right-l.frustum.left;l.frustum=i.frustum.clone();var c=l.frustum.fov,h=.5*a.RADIANS_PER_DEGREE,d=u*Math.tan(.5*c);l.frustum.far=d/Math.tan(.5*h)+1e7,l.frustum.fov=h;var p=s.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){r(e)}});e._currentTweens.push(p)}function A(t,i,r,n){function s(t){S(c,p,t.time,u.position),S(h,m,t.time,u.direction),S(d,_,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right);var i=u.frustum;i.right=a.lerp(g,v,t.time),i.left=-i.right,i.top=i.right*(l.drawingBufferHeight/l.drawingBufferWidth),i.bottom=-i.top,u.position.z=2*l.mapProjection.ellipsoid.maximumRadius}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,ve),h=e.clone(u.direction,ye),d=e.clone(u.up,Ce),p=e.clone(r.position,we),m=e.clone(r.direction,Se),_=e.clone(r.up,Ee),g=u.frustum.right,v=.5*p.z,y=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){l._mode=f.MORPHING,x(t,i,r,n)}});t._currentTweens.push(y)}function P(t,i,r,n){function a(t){S(u,d,t.time,l.position),S(c,p,t.time,l.direction),S(h,m,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right)}var s=t._scene,l=s.camera,u=e.clone(l.position,ve),c=e.clone(l.direction,ye),h=e.clone(l.up,Ce),d=e.clone(r.position2D,we),p=e.clone(r.direction2D,Se),m=e.clone(r.up2D,Ee),f=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){D(t,s,1,0,i,n)}});t._currentTweens.push(f)}function D(e,t,r,n,a,s){var l={object:t,property:"morphTime",startValue:r,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};i(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function M(t){return function(r){var n=r._scene;if(n._mode=f.SCENE3D,n.morphTime=f.getMorphTime(f.SCENE3D),v(r),r._previousMode!==f.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),i(t.frustum)&&(o.frustum=t.frustum.clone())}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.SCENE3D,a)}}function I(t){return function(r){var n=r._scene;n._mode=f.SCENE2D,n.morphTime=f.getMorphTime(f.SCENE2D),v(r);var o=n.camera;e.clone(t.position,o.position),o.position.z=2*n.mapProjection.ellipsoid.maximumRadius,e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),o.frustum=t.frustum.clone();var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.SCENE2D,a)}}function R(t){return function(r){var n=r._scene;if(n._mode=f.COLUMBUS_VIEW,n.morphTime=f.getMorphTime(f.COLUMBUS_VIEW),v(r),n.camera.frustum=t.frustum.clone(),r._previousModeMode!==f.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right)}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,f.COLUMBUS_VIEW,a)}}_.prototype.completeMorph=function(){i(this._completeMorph)&&this._completeMorph()},_.prototype.morphTo2D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==f.SCENE2D&&this._previousMode!==f.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,f.SCENE2D,!0),r._mode=f.MORPHING,r.camera._setTransform(s.IDENTITY),this._previousMode===f.COLUMBUS_VIEW?b(this,e):T(this,e,t),0===e&&i(this._completeMorph)&&this._completeMorph())};var O=new e,N=new e,L=new e,B=new e,F=new e,V=new e,k=new e,z=new t,U=new s,G=new m,W={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};_.prototype.morphToColumbusView=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==f.COLUMBUS_VIEW&&this._previousMode!==f.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,f.COLUMBUS_VIEW,!0),n.camera._setTransform(s.IDENTITY);var o=O,l=N,u=L;if(t>0)o.x=0,o.y=0,o.z=5*r.maximumRadius,e.negate(e.UNIT_Z,l),e.clone(e.UNIT_Y,u);else{var c=n.camera;if(this._previousMode===f.SCENE2D)e.clone(c.position,o),o.z=c.frustum.right-c.frustum.left,e.negate(e.UNIT_Z,l),e.clone(e.UNIT_Y,u);else{e.clone(c.positionWC,o),e.clone(c.directionWC,l),e.clone(c.upWC,u);var p=r.scaleToGeodeticSurface(o,k),m=h.eastNorthUpToFixedFrame(p,r,U);s.inverseTransformation(m,m),n.mapProjection.project(r.cartesianToCartographic(o,z),o),s.multiplyByPointAsVector(m,l,l),s.multiplyByPointAsVector(m,u,u)}}var _=G;_.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,_.fov=a.toRadians(60);var v=W;v.position=o,v.direction=l,v.up=u,v.frustum=_;var y=R(v);g(this,y),this._previousMode===f.SCENE2D?A(this,t,v,y):(v.position2D=s.multiplyByPoint(d.TRANSFORM_2D,o,B),v.direction2D=s.multiplyByPointAsVector(d.TRANSFORM_2D,l,F),v.up2D=s.multiplyByPointAsVector(d.TRANSFORM_2D,u,V),n._mode=f.MORPHING,P(this,t,v,y)),0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.morphTo3D=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==f.SCENE3D&&this._previousMode!==f.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,f.SCENE3D,!0),n._mode=f.MORPHING,n.camera._setTransform(s.IDENTITY),this._previousMode===f.SCENE2D)w(this,t,r);else{var o;t>0?(o=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,o.position),e.negate(o.position,o.direction),e.normalize(o.direction,o.direction),e.clone(e.UNIT_Z,o.up)):o=y(this,r);var a=M(o);g(this,a),C(this,t,o,a)}0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return v(this),r(this)};var H=new t,q=new e,j=new s,Y={position:new e,direction:new e,up:new e,frustum:void 0},X=new e,Z=new e,K=new e,Q=new e,J=new e,$=new e,ee=new m,te=new e,ie=new e,re=new e,ne=new e,oe=new e,ae=new e,se=new p,le=new l,ue=new e,ce={position:void 0,direction:void 0,up:void 0,frustum:void 0},he=new t,de={position:new e,direction:new e,up:new e,position2D:new e,direction2D:new e,up2D:new e,frustum:new p},pe={position:new e,direction:new e,up:new e,frustum:void 0},me=new e,fe=new l,_e=new s,ge=new e,ve=new e,ye=new e,Ce=new e,we=new e,Se=new e,Ee=new e;return _}),i("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=i,this._startObject=e(r),this._stopObject=e(n),this._duration=o,this._delay=a,this._easingFunction=s,this._update=l,this._complete=u,this.cancel=c,this.needsStart=!0}function c(){this._tweens=[]}return r(u.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),u.prototype.cancelTween=function(){this._tweens.remove(this)},r(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(r){if(r=t(r,t.EMPTY_OBJECT),0===r.duration)return i(r.complete)&&r.complete(),new u(this);var n=r.duration/s.SECONDS_PER_MILLISECOND,a=t(r.delay,0),c=a/s.SECONDS_PER_MILLISECOND,h=t(r.easingFunction,o.LINEAR_NONE),d=r.startObject,p=new l.Tween(d);p.to(e(r.stopObject),n),p.delay(c),p.easing(h),i(r.update)&&p.onUpdate(function(){r.update(d)}),p.onComplete(t(r.complete,null)),p.repeat(t(r._repeat,0));var m=new u(this,p,r.startObject,r.stopObject,r.duration,a,h,r.update,r.complete,r.cancel);return this._tweens.push(m),m},c.prototype.addProperty=function(e){function i(e){r[n]=e.value}e=t(e,t.EMPTY_OBJECT);var r=e.object,n=e.property,o=e.startValue,a=e.stopValue;return this.add({startObject:{value:o},stopObject:{value:a},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function r(e){for(var t=o.length,i=0;i<t;++i)n.uniforms[o[i]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&i(n.uniforms[a])&&i(n.uniforms[a].alpha)&&o.push(a);return this.add({startObject:{alpha:t(e.startValue,0)},stopObject:{alpha:t(e.stopValue,1)},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.material,r=i.uniforms;return this.addProperty({object:r,property:"offset",startValue:r.offset,stopValue:r.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},c.prototype.remove=function(e){if(!i(e))return!1;var t=this._tweens.indexOf(e);return t!==-1&&(e.tweenjs.stop(),i(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var r=e[t];r.tweenjs.stop(),i(r.cancel)&&r.cancel()}e.length=0},c.prototype.contains=function(e){return i(e)&&this._tweens.indexOf(e)!==-1},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,r=0;for(e=i(e)?e/s.SECONDS_PER_MILLISECOND:a();r<t.length;){var n=t[r],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?r++:(o.stop(),
t.splice(r,1))}},c}),i("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./MapMode2D","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b){"use strict";function T(i){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=C.LEFT_DRAG,this.zoomEventTypes=[C.RIGHT_DRAG,C.WHEEL,C.PINCH],this.rotateEventTypes=C.LEFT_DRAG,this.tiltEventTypes=[C.MIDDLE_DRAG,C.PINCH,{eventType:C.LEFT_DRAG,modifier:h.CTRL},{eventType:C.RIGHT_DRAG,modifier:h.CTRL}],this.lookEventTypes={eventType:C.LEFT_DRAG,modifier:h.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=i,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new y(i.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new b,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e(-1,-1),this._zoomWorldPosition=new t,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var n=i.mapProjection;this._maxCoord=n.project(new r(Math.PI,d.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3}function x(e,t){if(e<0)return 0;var i=25*(1-t);return Math.exp(-i*e)}function A(t){return e.equalsEpsilon(t.startPosition,t.endPosition,d.EPSILON14)}function P(t,i,r,n,a,s,l){var u=s[l];o(u)||(u=s[l]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var c=t.getButtonPressTime(i,r),h=t.getButtonReleaseTime(i,r),d=c&&h&&(h.getTime()-c.getTime())/1e3,p=new Date,m=h&&(p.getTime()-h.getTime())/1e3;if(c&&h&&d<$){var f=x(m,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var _=t.getLastMovement(i,r);if(!o(_)||A(_))return;u.motion.x=.5*(_.endPosition.x-_.startPosition.x),u.motion.y=.5*(_.endPosition.y-_.startPosition.y),u.startPosition=e.clone(_.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,f,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.active=!0}if(isNaN(u.endPosition.x)||isNaN(u.endPosition.y)||e.distance(u.startPosition,u.endPosition)<.5)return void(u.active=!1);if(!t.isButtonDown(i,r)){var g=t.getStartMousePosition(i,r);a(s,g,u)}}else u.active=!1}function D(e,t,i,r,n,a){if(o(i)){var s=e._aggregator;c(i)||(ee[0]=i,i=ee);for(var l=i.length,u=0;u<l;++u){var h=i[u],d=o(h.eventType)?h.eventType:h,p=h.modifier,m=s.isMoving(d,p)&&s.getMovement(d,p),f=s.getStartMousePosition(d,p);e.enableInputs&&t&&(m?r(e,f,m):n<1&&P(s,d,p,n,r,e,a))}}}function M(i,r,n,a,s,l){var u=1;o(l)&&(u=d.clamp(Math.abs(l),.25,1));var c=i.minimumZoomDistance*u,h=i.maximumZoomDistance,p=s-c,m=a*p;m=d.clamp(m,i._minimumZoomRate,i._maximumZoomRate);var f=n.endPosition.y-n.startPosition.y,_=f/i._scene.canvas.clientHeight;_=Math.min(_,i.maximumMovementRatio);var g=m*_;if(!(g>0&&Math.abs(s-c)<1||g<0&&Math.abs(s-h)<1)){s-g<c?g=s-c-1:s-g>h&&(g=s-h);var v,y=i._scene,C=y.camera,w=y.mode,b=e.equals(r,i._zoomMouseStart),T=i._zoomingOnVector,x=i._rotatingZoom;if(b||(i._zoomMouseStart=e.clone(r,i._zoomMouseStart),o(i._globe)&&(v=w!==S.SCENE2D?B(i,r,ie):C.getPickRay(r,te).origin),o(v)?(i._useZoomWorldPosition=!0,i._zoomWorldPosition=t.clone(v,i._zoomWorldPosition)):i._useZoomWorldPosition=!1,T=i._zoomingOnVector=!1,x=i._rotatingZoom=!1),!i._useZoomWorldPosition)return void C.zoomIn(g);var A=w===S.COLUMBUS_VIEW;if(C.positionCartographic.height<2e6&&(x=!0),!b||x){if(w===S.SCENE2D){var P=i._zoomWorldPosition,D=C.position;if(!t.equals(P,D)&&C.positionCartographic.height<2*i._maxCoord.x){var M=C.position.x,I=t.subtract(P,D,ne);t.normalize(I,I);var R=t.distance(P,D)*g/(.5*C.getMagnitude());C.move(I,.5*R),(C.position.x<0&&M>0||C.position.x>0&&M<0)&&(v=C.getPickRay(r,te).origin,i._zoomWorldPosition=t.clone(v,i._zoomWorldPosition))}}else if(w===S.SCENE3D){var O=t.normalize(C.position,ce);if(C.positionCartographic.height<3e3&&Math.abs(t.dot(C.direction,O))<.6)A=!0;else{var N=y.canvas,L=oe;L.x=N.clientWidth/2,L.y=N.clientHeight/2;var F=B(i,L,ae);if(o(F)&&C.positionCartographic.height<1e6){var V=de;t.clone(C.position,V);var k=i._zoomWorldPosition,z=he;if(z=t.normalize(k,z),t.dot(z,O)<0)return;var U=Ce,G=fe;t.clone(C.direction,G),t.add(V,t.multiplyByScalar(G,1e3,we),U);var W=_e,H=ge;t.subtract(k,V,W),t.normalize(W,H);var q=Math.acos(-t.dot(O,H)),j=t.magnitude(V),Y=t.magnitude(k),X=j-g,Z=t.magnitude(W),K=Math.asin(d.clamp(Z/Y*Math.sin(q),-1,1)),Q=Math.asin(d.clamp(X/Y*Math.sin(q),-1,1)),J=K-Q+q,$=pe;t.normalize(V,$);var ee=me;ee=t.cross(H,$,ee),ee=t.normalize(ee,ee),t.normalize(t.cross($,ee,we),G),t.multiplyByScalar(t.normalize(U,we),t.magnitude(U)-g,U),t.normalize(V,V),t.multiplyByScalar(V,X,V);var be=ve;t.multiplyByScalar(t.add(t.multiplyByScalar($,Math.cos(J)-1,Se),t.multiplyByScalar(G,Math.sin(J),Ee),we),X,be),t.add(V,be,V),t.normalize(U,$),t.normalize(t.cross($,ee,we),G);var Te=ye;return t.multiplyByScalar(t.add(t.multiplyByScalar($,Math.cos(J)-1,Se),t.multiplyByScalar(G,Math.sin(J),Ee),we),t.magnitude(U),Te),t.add(U,Te,U),t.clone(V,C.position),t.normalize(t.subtract(U,V,we),C.direction),t.clone(C.direction,C.direction),t.cross(C.direction,C.up,C.right),void t.cross(C.right,C.direction,C.up)}if(o(F)){var xe=t.normalize(F,se),Ae=t.normalize(i._zoomWorldPosition,le),Pe=t.dot(Ae,xe);if(Pe>0&&Pe<1){var De=d.acosClamped(Pe),Me=t.cross(Ae,xe,ue),Ie=Math.abs(De)>d.toRadians(20)?.75*C.positionCartographic.height:C.positionCartographic.height-g,Re=g/Ie;C.rotate(Me,De*Re)}}else A=!0}}i._rotatingZoom=!A}if(!b&&A||T){var Oe,Ne=E.wgs84ToWindowCoordinates(y,i._zoomWorldPosition,re);Oe=w!==S.COLUMBUS_VIEW&&e.equals(r,i._zoomMouseStart)&&o(Ne)?C.getPickRay(Ne,te):C.getPickRay(r,te);var Le=Oe.direction;w===S.COLUMBUS_VIEW&&t.fromElements(Le.y,Le.z,Le.x,Le),C.move(Le,g),i._zoomingOnVector=!0}else C.zoomIn(g)}}function I(e,i,r){var n=e._scene,o=n.camera,a=o.getPickRay(r.startPosition,be).origin,s=o.getPickRay(r.endPosition,Te).origin,l=t.subtract(a,s,xe),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function R(e,t,i){o(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera;M(e,t,i,e._zoomFactor,n.getMagnitude())}function O(t,i,r){if(o(r.angleAndHeight))return void N(t,i,r.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=Ae;c.x=2/l*r.startPosition.x-1,c.y=2/u*(u-r.startPosition.y)-1,c=e.normalize(c,c);var h=Pe;h.x=2/l*r.endPosition.x-1,h.y=2/u*(u-r.endPosition.y)-1,h=e.normalize(h,h);var p=d.acosClamped(c.x);c.y<0&&(p=d.TWO_PI-p);var m=d.acosClamped(h.x);h.y<0&&(m=d.TWO_PI-m);var f=m-p;a.twistRight(f)}function N(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(i.endPosition.x-i.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=r*s*Math.PI*4;o.twistRight(l)}function L(e){var t=e._scene.mapMode2D===w.ROTATE;m.equals(m.IDENTITY,e._scene.camera.transform)?(D(e,e.enableTranslate,e.translateEventTypes,I,e.inertiaTranslate,"_lastInertiaTranslateMovement"),D(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&D(e,e.enableRotate,e.tiltEventTypes,O,e.inertiaSpin,"_lastInertiaTiltMovement")):(D(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&D(e,e.enableRotate,e.translateEventTypes,O,e.inertiaSpin,"_lastInertiaSpinMovement"))}function B(e,i,r){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPosition(i,Me));var u=s.getPickRay(i,De),c=a.pick(u,n,Ie),h=o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY,d=o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY;return h<d?t.clone(l,r):t.clone(c,r)}}function F(i,r,n){if(t.equals(r,i._translateMousePosition)||(i._looking=!1),t.equals(r,i._strafeMousePosition)||(i._strafing=!1),i._looking)return void Q(i,r,n);if(i._strafing)return void W(i,r,n);var a,s=i._scene,l=s.camera,c=e.clone(n.startPosition,ke),h=e.clone(n.endPosition,ze),p=l.getPickRay(c,Re),m=t.clone(t.ZERO,Fe),_=t.UNIT_X;if(l.position.z<i._minimumPickingTerrainHeight&&(a=B(i,c,Ne),o(a)&&(m.x=a.x)),m.x>l.position.z&&o(a))return t.clone(a,i._strafeStartPosition),i._strafing=!0,W(i,r,n),void(i._strafeMousePosition=e.clone(r,i._strafeMousePosition));var g=f.fromPointNormal(m,_,Ve);p=l.getPickRay(c,Re);var v=u.rayPlane(p,g,Ne),y=l.getPickRay(h,Oe),C=u.rayPlane(y,g,Le);if(!o(v)||!o(C))return i._looking=!0,Q(i,r,n),void e.clone(r,i._translateMousePosition);var w=t.subtract(v,C,Be),S=w.x;w.x=w.y,w.y=w.z,w.z=S;var E=t.magnitude(w);E>d.EPSILON6&&(t.normalize(w,w),l.move(w,E))}function V(t,i,r){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void Q(t,i,r);var n=t._scene,a=n.camera,s=t._maxCoord,l=Math.abs(a.position.x)-s.x<0&&Math.abs(a.position.y)-s.y<0;t._tiltCVOffMap||!l||a.position.z>t._minimumPickingTerrainHeight?(t._tiltCVOffMap=!0,k(t,i,r)):z(t,i,r)}function k(i,r,n){var a=i._scene,s=a.camera,u=a.canvas,c=Ue;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var h,p=s.getPickRay(c,Ge),f=t.UNIT_X,_=p.origin,g=p.direction,y=t.dot(f,g);if(Math.abs(y)>d.EPSILON6&&(h=-t.dot(f,_)/y),!o(h)||h<=0)return i._looking=!0,Q(i,r,n),void e.clone(r,i._tiltCenterMousePosition);var C=t.multiplyByScalar(g,h,We);t.add(_,C,C);var w=a.mapProjection,S=w.ellipsoid;t.fromElements(C.y,C.z,C.x,C);var E=w.unproject(C,Ke);S.cartographicToCartesian(E,C);var b=v.eastNorthUpToFixedFrame(C,S,qe),T=i._globe,x=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var A=m.clone(s.transform,Qe);s._setTransform(b),q(i,r,n,t.UNIT_Z),s._setTransform(A),i._globe=T,i._ellipsoid=x;var P=x.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}function z(i,r,n){var a,s,c=i._scene,h=c.camera,g=t.UNIT_X;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,We);else{if(h.position.z<i._minimumPickingTerrainHeight&&(a=B(i,r,We)),!o(a)){s=h.getPickRay(r,Ge);var y,C=s.origin,w=s.direction,S=t.dot(g,w);if(Math.abs(S)>d.EPSILON6&&(y=-t.dot(g,C)/S),!o(y)||y<=0)return i._looking=!0,Q(i,r,n),void e.clone(r,i._tiltCenterMousePosition);a=t.multiplyByScalar(w,y,We),t.add(C,a,a)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var E=c.canvas,b=Ue;b.x=E.clientWidth/2,b.y=i._tiltCenterMousePosition.y,s=h.getPickRay(b,Ge);var T=t.clone(t.ZERO,Ye);T.x=a.x;var x=f.fromPointNormal(T,g,Xe),A=u.rayPlane(s,x,He),P=h._projection,D=P.ellipsoid;t.fromElements(a.y,a.z,a.x,a);var M=P.unproject(a,Ke);D.cartographicToCartesian(M,a);var I,R=v.eastNorthUpToFixedFrame(a,D,qe);o(A)?(t.fromElements(A.y,A.z,A.x,A),M=P.unproject(A,Ke),D.cartographicToCartesian(M,A),I=v.eastNorthUpToFixedFrame(A,D,je)):I=R;var O=i._globe,N=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var L=t.UNIT_Z,F=m.clone(h.transform,Qe);h._setTransform(R);var V=t.cross(t.UNIT_Z,t.normalize(h.position,Ze),Ze),k=t.dot(h.right,V);if(q(i,r,n,L,!1,!0),h._setTransform(I),k<0){n.startPosition.y>n.endPosition.y&&(L=void 0);var z=h.constrainedAxis;h.constrainedAxis=void 0,q(i,r,n,L,!0,!1),h.constrainedAxis=z}else q(i,r,n,L,!0,!1);if(o(h.constrainedAxis)){var U=t.cross(h.direction,h.constrainedAxis,Dt);t.equalsEpsilon(U,t.ZERO,d.EPSILON6)||(t.dot(U,h.right)<0&&t.negate(U,U),t.cross(U,h.direction,h.up),t.cross(h.direction,h.up,h.right),t.normalize(h.up,h.up),t.normalize(h.right,h.right))}h._setTransform(F),i._globe=O,i._ellipsoid=N;var G=N.maximumRadius;i._rotateFactor=1/G,i._rotateRateRangeAdjustment=G;var W=t.clone(h.positionWC,Ze);if(h._adjustHeightForTerrain(),!t.equals(h.positionWC,W)){h._setTransform(I),h.worldToCameraCoordinatesPoint(W,W);var H=t.magnitudeSquared(W);t.magnitudeSquared(h.position)>H&&(t.normalize(h.position,h.position),t.multiplyByScalar(h.position,Math.sqrt(H),h.position));var j=t.angleBetween(W,h.position),Y=t.cross(W,h.position,W);t.normalize(Y,Y);var X=_.fromAxisAngle(Y,j,Je),Z=p.fromQuaternion(X,$e);p.multiplyByVector(Z,h.direction,h.direction),p.multiplyByVector(Z,h.up,h.up),t.cross(h.direction,h.up,h.right),t.cross(h.right,h.direction,h.up),h._setTransform(F)}}function U(e,i,r){o(r.distance)&&(r=r.distance);var n=e._scene,a=n.camera,s=n.canvas,l=et;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,tt);a.position.z<e._minimumPickingTerrainHeight&&(u=B(e,l,it));var h;if(o(u))h=t.distance(c.origin,u);else{var d=t.UNIT_X,p=c.origin,m=c.direction;h=-t.dot(d,p)/t.dot(d,m)}M(e,i,r,e._zoomFactor,h)}function G(e){var t=e._scene,i=t.camera;if(m.equals(m.IDENTITY,i.transform)){var r=e._tweens;if(e._aggregator.anyButtonDown&&r.removeAll(),D(e,e.enableTilt,e.tiltEventTypes,V,e.inertiaSpin,"_lastInertiaTiltMovement"),D(e,e.enableTranslate,e.translateEventTypes,F,e.inertiaTranslate,"_lastInertiaTranslateMovement"),D(e,e.enableZoom,e.zoomEventTypes,U,e.inertiaZoom,"_lastInertiaZoomMovement"),D(e,e.enableLook,e.lookEventTypes,Q),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||r.contains(e._tween))){var n=i.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=r.add(n))}r.update()}else D(e,e.enableRotate,e.rotateEventTypes,q,e.inertiaSpin,"_lastInertiaSpinMovement"),D(e,e.enableZoom,e.zoomEventTypes,Y,e.inertiaZoom,"_lastInertiaZoomMovement")}function W(e,i,r){var n=e._scene,a=n.camera,s=B(e,r.startPosition,ut);if(o(s)){var l=r.endPosition,c=a.getPickRay(l,rt),h=t.clone(a.direction,at);n.mode===S.COLUMBUS_VIEW&&t.fromElements(h.z,h.x,h.y,h);var d=f.fromPointNormal(s,h,nt),p=u.rayPlane(c,d,ot);o(p)&&(h=t.subtract(s,p,h),n.mode===S.COLUMBUS_VIEW&&t.fromElements(h.y,h.z,h.x,h),t.add(a.position,h,a.position))}}function H(i,r,n){var a=i._scene,s=a.camera;if(!m.equals(s.transform,m.IDENTITY))return void q(i,r,n);var u,c,h,d,p=i._ellipsoid.geodeticSurfaceNormal(s.position,dt),f=i._ellipsoid.cartesianToCartographic(s.positionWC,lt).height,_=i._globe,g=!1;if(o(_)&&f<i._minimumPickingTerrainHeight&&(d=B(i,n.startPosition,ut),o(d))){var v=s.getPickRay(n.startPosition,De),y=i._ellipsoid.geodeticSurfaceNormal(d);g=Math.abs(t.dot(v.direction,y))<.05,g&&!i._looking&&(i._rotating=!1,i._strafing=!0)}return e.equals(r,i._rotateMousePosition)?void(i._looking?Q(i,r,n,p):i._rotating?q(i,r,n):i._strafing?(t.clone(d,i._strafeStartPosition),W(i,r,n)):(u=t.magnitude(i._rotateStartPosition),c=ct,c.x=c.y=c.z=u,h=l.fromCartesian3(c,ht),j(i,r,n,h))):(i._looking=!1,i._rotating=!1,i._strafing=!1,o(_)&&f<i._minimumPickingTerrainHeight?o(d)?t.magnitude(s.position)<t.magnitude(d)?(t.clone(d,i._strafeStartPosition),i._strafing=!0,W(i,r,n)):(u=t.magnitude(d),c=ct,c.x=c.y=c.z=u,h=l.fromCartesian3(c,ht),j(i,r,n,h),t.clone(d,i._rotateStartPosition)):(i._looking=!0,Q(i,r,n,p)):o(s.pickEllipsoid(n.startPosition,i._ellipsoid,st))?(j(i,r,n,i._ellipsoid),t.clone(st,i._rotateStartPosition)):f>i._minimumTrackBallHeight?(i._rotating=!0,q(i,r,n)):(i._looking=!0,Q(i,r,n,p)),void e.clone(r,i._rotateMousePosition))}function q(e,i,r,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,h=u.canvas,d=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var p=t.magnitude(c.position),m=e._rotateFactor*(p-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);var f=(r.startPosition.x-r.endPosition.x)/h.clientWidth,_=(r.startPosition.y-r.endPosition.y)/h.clientHeight;f=Math.min(f,e.maximumMovementRatio),_=Math.min(_,e.maximumMovementRatio);var g=m*f*Math.PI*2,v=m*_*Math.PI;s||c.rotateRight(g),l||c.rotateUp(v),c.constrainedAxis=d}function j(i,r,n,a){var s=i._scene,l=s.camera,u=e.clone(n.startPosition,yt),c=e.clone(n.endPosition,Ct),h=l.pickEllipsoid(u,a,pt),p=l.pickEllipsoid(c,a,mt);if(!o(h)||!o(p))return i._rotating=!0,void q(i,r,n);if(h=l.worldToCameraCoordinates(h,h),p=l.worldToCameraCoordinates(p,p),o(l.constrainedAxis)){var m=l.constrainedAxis,f=t.mostOrthogonalAxis(m,ft);t.cross(f,m,f),t.normalize(f,f);var _=t.cross(m,f,_t),g=t.magnitude(h),v=t.dot(m,h),y=Math.acos(v/g),C=t.multiplyByScalar(m,v,gt);t.subtract(h,C,C),t.normalize(C,C);var w=t.magnitude(p),S=t.dot(m,p),E=Math.acos(S/w),b=t.multiplyByScalar(m,S,vt);t.subtract(p,b,b),t.normalize(b,b);var T=Math.acos(t.dot(C,f));t.dot(C,_)<0&&(T=d.TWO_PI-T);var x=Math.acos(t.dot(b,f));t.dot(b,_)<0&&(x=d.TWO_PI-x);var A,P=T-x;A=t.equalsEpsilon(m,l.position,d.EPSILON2)?l.right:t.cross(m,l.position,ft);var D,M=t.cross(m,A,ft),I=t.dot(M,t.subtract(h,m,_t)),R=t.dot(M,t.subtract(p,m,_t));D=I>0&&R>0?E-y:I>0&&R<=0?t.dot(l.position,m)>0?-y-E:y+E:y-E,l.rotateRight(P),l.rotateUp(D)}else{t.normalize(h,h),t.normalize(p,p);var O=t.dot(h,p),N=t.cross(h,p,ft);if(O<1&&!t.equalsEpsilon(N,t.ZERO,d.EPSILON14)){var L=Math.acos(O);l.rotate(N,L)}}}function Y(e,i,r){o(r.distance)&&(r=r.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=et;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,h=s.getPickRay(u,tt),d=n.cartesianToCartographic(s.position,St).height;d<e._minimumPickingTerrainHeight&&(c=B(e,u,it));var p;p=o(c)?t.distance(h.origin,c):d;var m=t.normalize(s.position,wt);M(e,i,r,e._zoomFactor,p,t.dot(m,s.direction))}function X(t,i,r){var n=t._scene,a=n.camera;if(m.equals(a.transform,m.IDENTITY)){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){var s=t._ellipsoid.geodeticSurfaceNormal(a.position,Nt);return void Q(t,i,r,s)}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,Ot);t._tiltOnEllipsoid||u.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,Z(t,i,r)):K(t,i,r)}}function Z(i,r,n){var a=i._ellipsoid,s=i._scene,c=s.camera,h=.25*i.minimumZoomDistance,p=a.cartesianToCartographic(c.positionWC,Lt).height;if(!(p-h-1<d.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,_=Et;_.x=f.clientWidth/2,_.y=f.clientHeight/2;var y,C=c.getPickRay(_,bt),w=u.rayEllipsoid(C,a);if(o(w))y=g.getPoint(C,w.start,Tt);else{if(!(p>i._minimumTrackBallHeight)){i._looking=!0;var S=i._ellipsoid.geodeticSurfaceNormal(c.position,Nt);return Q(i,r,n,S),void e.clone(r,i._tiltCenterMousePosition)}var E=u.grazingAltitudeLocation(C,a);if(!o(E))return;var b=a.cartesianToCartographic(E,Ot);b.height=0,y=a.cartographicToCartesian(b,Tt)}var T=v.eastNorthUpToFixedFrame(y,a,At),x=i._globe,A=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var P=m.clone(c.transform,Mt);c._setTransform(T),q(i,r,n,t.UNIT_Z),c._setTransform(P),i._globe=x,i._ellipsoid=A;var D=A.maximumRadius;i._rotateFactor=1/D,i._rotateRateRangeAdjustment=D}}function K(i,r,n){var a,s,c,h=i._ellipsoid,f=i._scene,y=f.camera;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,Tt);else{if(a=B(i,r,Tt),!o(a)){if(s=y.getPickRay(r,bt),c=u.rayEllipsoid(s,h),!o(c)){var C=h.cartesianToCartographic(y.position,Ot);if(C.height<=i._minimumTrackBallHeight){i._looking=!0;var w=i._ellipsoid.geodeticSurfaceNormal(y.position,Nt);Q(i,r,n,w),e.clone(r,i._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,Tt)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var S=f.canvas,E=Et;E.x=S.clientWidth/2,E.y=i._tiltCenterMousePosition.y,s=y.getPickRay(E,bt);var b=t.magnitude(a),T=t.fromElements(b,b,b,ct),x=l.fromCartesian3(T,ht);if(c=u.rayEllipsoid(s,x),o(c)){var A=t.magnitude(s.origin)>b?c.start:c.stop,P=g.getPoint(s,A,xt),D=v.eastNorthUpToFixedFrame(a,h,At),M=v.eastNorthUpToFixedFrame(P,x,Pt),I=i._globe,R=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var O=t.UNIT_Z,N=m.clone(y.transform,Mt);y._setTransform(D);var L=t.cross(P,y.positionWC,Dt),F=t.dot(y.rightWC,L);if(q(i,r,n,O,!1,!0),y._setTransform(M),F<0){n.startPosition.y>n.endPosition.y&&(O=void 0);var V=y.constrainedAxis;y.constrainedAxis=void 0,q(i,r,n,O,!0,!1),y.constrainedAxis=V}else q(i,r,n,O,!0,!1);if(o(y.constrainedAxis)){var k=t.cross(y.direction,y.constrainedAxis,Dt);t.equalsEpsilon(k,t.ZERO,d.EPSILON6)||(t.dot(k,y.right)<0&&t.negate(k,k),t.cross(k,y.direction,y.up),t.cross(y.direction,y.up,y.right),t.normalize(y.up,y.up),t.normalize(y.right,y.right))}y._setTransform(N),i._globe=I,i._ellipsoid=R;var z=R.maximumRadius;i._rotateFactor=1/z,i._rotateRateRangeAdjustment=z;var U=t.clone(y.positionWC,Dt);if(y._adjustHeightForTerrain(),!t.equals(y.positionWC,U)){y._setTransform(M),y.worldToCameraCoordinatesPoint(U,U);var G=t.magnitudeSquared(U);t.magnitudeSquared(y.position)>G&&(t.normalize(y.position,y.position),t.multiplyByScalar(y.position,Math.sqrt(G),y.position));var W=t.angleBetween(U,y.position),H=t.cross(U,y.position,U);t.normalize(H,H);var j=_.fromAxisAngle(H,W,It),Y=p.fromQuaternion(j,Rt);p.multiplyByVector(Y,y.direction,y.direction),p.multiplyByVector(Y,y.up,y.up),t.cross(y.direction,y.up,y.right),t.cross(y.right,y.direction,y.up),y._setTransform(N)}}}function Q(e,i,r,a){var s=e._scene,l=s.camera,u=Bt;u.x=r.startPosition.x,u.y=0;var c=Ft;c.x=r.endPosition.x,c.y=0;var h=l.getPickRay(u,Vt).direction,p=l.getPickRay(c,kt).direction,m=0,f=t.dot(h,p);f<1&&(m=Math.acos(f)),m=r.startPosition.x>r.endPosition.x?-m:m;var _=e._horizontalRotationAxis;if(o(a)?l.look(a,-m):o(_)?l.look(_,-m):l.lookLeft(m),u.x=0,u.y=r.startPosition.y,c.x=0,c.y=r.endPosition.y,h=l.getPickRay(u,Vt).direction,p=l.getPickRay(c,kt).direction,m=0,f=t.dot(h,p),f<1&&(m=Math.acos(f)),m=r.startPosition.y>r.endPosition.y?-m:m,a=n(a,_),o(a)){var g=l.direction,v=t.negate(a,zt),y=t.equalsEpsilon(g,a,d.EPSILON2),C=t.equalsEpsilon(g,v,d.EPSILON2);if(y||C)(y&&m<0||C&&m>0)&&l.look(l.right,-m);else{f=t.dot(g,a);var w=d.acosClamped(f);m>0&&m>w&&(m=w-d.EPSILON4),f=t.dot(g,v),w=d.acosClamped(f),m<0&&-m>w&&(m=-w+d.EPSILON4);var S=t.cross(a,g,Ut);l.look(S,m)}}else l.lookUp(m)}function J(e){D(e,e.enableRotate,e.rotateEventTypes,H,e.inertiaSpin,"_lastInertiaSpinMovement"),D(e,e.enableZoom,e.zoomEventTypes,Y,e.inertiaZoom,"_lastInertiaZoomMovement"),D(e,e.enableTilt,e.tiltEventTypes,X,e.inertiaSpin,"_lastInertiaTiltMovement"),D(e,e.enableLook,e.lookEventTypes,Q)}var $=.4,ee=[],te=new g,ie=new t,re=new e,ne=new t,oe=new e,ae=new t,se=new t,le=new t,ue=new t,ce=new t,he=new t,de=new t,pe=new t,me=new t,fe=new t,_e=new t,ge=new t,ve=new t,ye=new t,Ce=new t,we=new t,Se=new t,Ee=new t,be=new g,Te=new g,xe=new t,Ae=new e,Pe=new e,De=new g,Me=new t,Ie=new t,Re=new g,Oe=new g,Ne=new t,Le=new t,Be=new t,Fe=new t,Ve=new f(t.ZERO,0),ke=new e,ze=new e,Ue=new e,Ge=new g,We=new t,He=new t,qe=new m,je=new m,Ye=new t,Xe=new f(t.ZERO,0),Ze=new t,Ke=new r,Qe=new m,Je=new _,$e=new p,et=new e,tt=new g,it=new t,rt=new g,nt=new f(t.ZERO,0),ot=new t,at=new t,st=new t,lt=new r,ut=new t,ct=new t,ht=new l,dt=new t,pt=i.clone(i.UNIT_W),mt=i.clone(i.UNIT_W),ft=new t,_t=new t,gt=new t,vt=new t,yt=new e,Ct=new e,wt=new t,St=new r,Et=new e,bt=new g,Tt=new t,xt=new t,At=new m,Pt=new m,Dt=new t,Mt=new m,It=new _,Rt=new p,Ot=new r,Nt=new t,Lt=new r,Bt=new e,Ft=new e,Vt=new g,kt=new g,zt=new t,Ut=new t;return T.prototype.update=function(){m.equals(this._scene.camera.transform,m.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=o(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=l.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var i=this._scene,r=i.mode;r===S.SCENE2D?L(this):r===S.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,G(this)):r===S.SCENE3D&&(this._horizontalRotationAxis=void 0,J(this)),this._aggregator.reset()},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},T}),i("Scene/ShadowMapShader",["../Core/defined","../Renderer/ShaderSource"],function(e,t){"use strict";function i(){}return i.createShadowCastVertexShader=function(i,r,n){var o=i.defines.slice(0),a=i.sources.slice(0);n&&o.push("GENERATE_POSITION");var s=t.findPositionVarying(i),l=e(s);if(r&&!l){for(var u=a.length,c=0;c<u;++c)a[c]=t.replaceMain(a[c],"czm_shadow_cast_main");var h="varying vec3 v_positionEC; \nvoid main() \n{ \n    czm_shadow_cast_main(); \n    v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}";a.push(h)}return new t({defines:o,sources:a})},i.createShadowCastFragmentShader=function(i,r,n,o){var a=i.defines.slice(0),s=i.sources.slice(0),l=t.findPositionVarying(i),u=e(l);u||(l="v_positionEC");for(var c=s.length,h=0;h<c;++h)s[h]=t.replaceMain(s[h],"czm_shadow_cast_main");var d="";return r&&(u||(d+="varying vec3 v_positionEC; \n"),d+="uniform vec4 shadowMap_lightPositionEC; \n"),d+=o?"void main() \n{ \n":"void main() \n{ \n    czm_shadow_cast_main(); \n    if (gl_FragColor.a == 0.0) \n    { \n       discard; \n    } \n",d+=r?"float distance = length("+l+"); \ndistance /= shadowMap_lightPositionEC.w; // radius \ngl_FragColor = czm_packDepth(distance); \n":n?"gl_FragColor = vec4(1.0); \n":"gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",d+="} \n",s.push(d),new t({defines:a,sources:s})},i.createShadowReceiveVertexShader=function(e,i,r){var n=e.defines.slice(0),o=e.sources.slice(0);return i&&(r?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new t({defines:n,sources:o})},i.createShadowReceiveFragmentShader=function(i,r,n,o,a){for(var s=t.findNormalVarying(i),l=!o&&e(s)||o&&a,u=t.findPositionVarying(i),c=e(u),h=r._usesDepthTexture,d=r._polygonOffsetSupported,p=r._isPointLight,m=r._isSpotLight,f=r._numberOfCascades>1,_=r.debugCascadeColors,g=r.softShadows,v=p?r._pointBias:o?r._terrainBias:r._primitiveBias,y=i.defines.slice(0),C=i.sources.slice(0),w=C.length,S=0;S<w;++S)C[S]=t.replaceMain(C[S],"czm_shadow_receive_main");p?y.push("USE_CUBE_MAP_SHADOW"):h&&y.push("USE_SHADOW_DEPTH_TEXTURE"),g&&!p&&y.push("USE_SOFT_SHADOWS"),f&&n&&o&&(l?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),n&&v.normalShading&&l&&(y.push("USE_NORMAL_SHADING"),v.normalShadingSmooth>0&&y.push("USE_NORMAL_SHADING_SMOOTH"));var E="";return E+=p?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",E+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nvec4 getPositionEC() \n{ \n"+(c?"    return vec4("+u+", 1.0); \n":"    return czm_windowToEyeCoordinates(gl_FragCoord); \n")+"} \nvec3 getNormalEC() \n{ \n"+(l?"    return normalize("+s+"); \n":"    return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(v.normalOffset&&l?"    float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n    float normalOffsetScale = 1.0 - nDotL; \n    vec3 offset = normalOffset * normalOffsetScale * normalEC; \n    positionEC.xyz += offset; \n":"")+"} \n",E+="void main() \n{ \n    czm_shadow_receive_main(); \n    vec4 positionEC = getPositionEC(); \n    vec3 normalEC = getNormalEC(); \n    float depth = -positionEC.z; \n",E+="    czm_shadowParameters shadowParameters; \n    shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n    shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n    shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n    shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",o?E+="    shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":d||(E+="    shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),E+=p?"    vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n    float distance = length(directionEC); \n    directionEC = normalize(directionEC); \n    float radius = shadowMap_lightPositionEC.w; \n    // Stop early if the fragment is beyond the point light radius \n    if (distance > radius) \n    { \n        return; \n    } \n    vec3 directionWC  = czm_inverseViewRotation * directionEC; \n    shadowParameters.depth = distance / radius; \n    shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n    shadowParameters.texCoords = directionWC; \n    float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":m?"    vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n    float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n    applyNormalOffset(positionEC, normalEC, nDotL); \n    vec4 shadowPosition = shadowMap_matrix * positionEC; \n    // Spot light uses a perspective projection, so perform the perspective divide \n    shadowPosition /= shadowPosition.w; \n    // Stop early if the fragment is not in the shadow bounds \n    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n    { \n        return; \n    } \n    shadowParameters.texCoords = shadowPosition.xy; \n    shadowParameters.depth = shadowPosition.z; \n    shadowParameters.nDotL = nDotL; \n    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":f?"    float maxDepth = shadowMap_cascadeSplits[1].w; \n    // Stop early if the eye depth exceeds the last cascade \n    if (depth > maxDepth) \n    { \n        return; \n    } \n    // Get the cascade based on the eye-space depth \n    vec4 weights = czm_cascadeWeights(depth); \n    // Apply normal offset \n    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n    applyNormalOffset(positionEC, normalEC, nDotL); \n    // Transform position into the cascade \n    vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n    // Get visibility \n    shadowParameters.texCoords = shadowPosition.xy; \n    shadowParameters.depth = shadowPosition.z; \n    shadowParameters.nDotL = nDotL; \n    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n    // Fade out shadows that are far away \n    float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n    float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n    visibility = mix(visibility, 1.0, fade); \n"+(_?"    // Draw cascade colors for debugging \n    gl_FragColor *= czm_cascadeColor(weights); \n":""):"    float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n    applyNormalOffset(positionEC, normalEC, nDotL); \n    vec4 shadowPosition = shadowMap_matrix * positionEC; \n    // Stop early if the fragment is not in the shadow bounds \n    if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n    { \n        return; \n    } \n    shadowParameters.texCoords = shadowPosition.xy; \n    shadowParameters.depth = shadowPosition.z; \n    shadowParameters.nDotL = nDotL; \n    float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",
E+="    gl_FragColor.rgb *= visibility; \n} \n",C.push(E),new t({defines:y,sources:C})},i}),i("Scene/ShadowMap",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeometryInstance","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Quaternion","../Core/SphereOutlineGeometry","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/ContextLimits","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./Camera","./CullFace","./CullingVolume","./DebugCameraPrimitive","./OrthographicFrustum","./PerInstanceColorAppearance","./PerspectiveFrustum","./Primitive","./ShadowMapShader"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K){"use strict";function Q(e){e=h(e,h.EMPTY_OBJECT);var i=e.context;this._enabled=h(e.enabled,!0),this._softShadows=h(e.softShadows,!1),this.dirty=!0,this.fromLightSource=h(e.fromLightSource,!0),this.darkness=h(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=h(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;var a=!0;(_.isInternetExplorer()||_.isEdge()||(_.isChrome()||_.isFirefox())&&_.isWindows()&&!i.depthTexture)&&(a=!1),this._polygonOffsetSupported=a,this._terrainBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:!0,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:!0,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:!1,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new C,this._shadowMapTexture=void 0,this._lightDirectionEC=new n,this._lightPositionEC=new o,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new fe,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new t,this._isPointLight=h(e.isPointLight,!1),this._pointLightRadius=h(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&h(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?h(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new r,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new j:d(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new o,new o],this._cascadeMatrices=[new C,new C,new C,new C],this._cascadeDistances=new o;var s;s=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(s);for(var u=0;u<s;++u)this._passes[u]=new J(i);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=i.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,ee(this),this._clearCommand=new T({depth:1,color:new l}),this._clearPassState=new I(i),this._size=h(e.size,2048),this.size=this._size}function J(e){this.camera=new fe,this.passState=new I(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function $(e,t){return L.fromCache({cull:{enabled:!0,face:W.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function ee(e){var t=!e._usesDepthTexture;e._primitiveRenderState=$(t,e._primitiveBias),e._terrainRenderState=$(t,e._terrainBias),e._pointRenderState=$(t,e._pointBias)}function te(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;d(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function ie(){return new B({wrapS:U.CLAMP_TO_EDGE,wrapT:U.CLAMP_TO_EDGE,minificationFilter:z.NEAREST,magnificationFilter:k.NEAREST})}function re(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:ie()}),n=new D({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),o=e._passes.length,a=0;a<o;++a){var s=e._passes[a];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function ne(e,t){for(var i=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.DEPTH_STENCIL,pixelDatatype:R.UNSIGNED_INT_24_8,sampler:ie()}),r=new D({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,o=0;o<n;++o){var a=e._passes[o];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function oe(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new A({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:ie()}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],o=0;o<6;++o){var a=new D({context:t,depthRenderbuffer:i,colorTextures:[n[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function ae(e,t){e._isPointLight?oe(e,t):e._usesDepthTexture?ne(e,t):re(e,t)}function se(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==b.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,ee(e),te(e),ae(e,t))}function le(e,t){d(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(te(e),ae(e,t),se(e,t),ue(e,t))}function ue(e,t,i){i=h(i,0),(e._isPointLight||0===i)&&(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ce(t,i){t._size=i;var r=t._passes,n=r.length,o=t._textureSize;if(t._isPointLight){i=x.maximumCubeMapSize>=i?i:x.maximumCubeMapSize,o.x=i,o.y=i;var a=new e(0,0,i,i);r[0].passState.viewport=a,r[1].passState.viewport=a,r[2].passState.viewport=a,r[3].passState.viewport=a,r[4].passState.viewport=a,r[5].passState.viewport=a}else 1===n?(i=x.maximumTextureSize>=i?i:x.maximumTextureSize,o.x=i,o.y=i,r[0].passState.viewport=new e(0,0,i,i)):4===n&&(i=x.maximumTextureSize>=2*i?i:x.maximumTextureSize/2,o.x=2*i,o.y=2*i,r[0].passState.viewport=new e(0,0,i,i),r[1].passState.viewport=new e(i,0,i,i),r[2].passState.viewport=new e(0,i,i,i),r[3].passState.viewport=new e(i,i,i,i));t._clearPassState.viewport=new e(0,0,o.x,o.y);for(var s=0;s<n;++s){var l=r[s],u=l.passState.viewport,c=u.x/o.x,h=u.y/o.y,d=u.width/o.x,p=u.height/o.y;l.textureOffsets=new C(d,0,0,c,0,p,0,h,0,0,1,0,0,0,0,1)}}function he(e,t){var i;i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n    vec2 uv = v_textureCoordinates; \n    vec3 dir; \n \n    if (uv.y < 0.5) \n    { \n        if (uv.x < 0.333) \n        { \n            dir.x = -1.0; \n            dir.y = uv.x * 6.0 - 1.0; \n            dir.z = uv.y * 4.0 - 1.0; \n        } \n        else if (uv.x < 0.666) \n        { \n            dir.y = -1.0; \n            dir.x = uv.x * 6.0 - 3.0; \n            dir.z = uv.y * 4.0 - 1.0; \n        } \n        else \n        { \n            dir.z = -1.0; \n            dir.x = uv.x * 6.0 - 5.0; \n            dir.y = uv.y * 4.0 - 1.0; \n        } \n    } \n    else \n    { \n        if (uv.x < 0.333) \n        { \n            dir.x = 1.0; \n            dir.y = uv.x * 6.0 - 1.0; \n            dir.z = uv.y * 4.0 - 3.0; \n        } \n        else if (uv.x < 0.666) \n        { \n            dir.y = 1.0; \n            dir.x = uv.x * 6.0 - 3.0; \n            dir.z = uv.y * 4.0 - 3.0; \n        } \n        else \n        { \n            dir.z = 1.0; \n            dir.x = uv.x * 6.0 - 5.0; \n            dir.y = uv.y * 4.0 - 3.0; \n        } \n    } \n \n    float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n    gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?"    float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":"    float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+"    gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n";var r=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return r.pass=M.OVERLAY,r}function de(t,i){var r=i.context,n=i.context.drawingBufferWidth,o=i.context.drawingBufferHeight,a=.3*Math.min(n,o),s=Ee;s.x=n-a,s.y=0,s.width=a,s.height=a;var l=t._debugShadowViewCommand;d(l)||(l=he(t,r),t._debugShadowViewCommand=l),d(l.renderState)&&e.equals(l.renderState.viewport,s)||(l.renderState=L.fromCache({viewport:e.clone(s)})),i.commandList.push(t._debugShadowViewCommand)}function pe(e,t){var r=new g({geometry:new i({minimum:new n(-.5,-.5,-.5),maximum:new n(.5,.5,.5)}),attributes:{color:u.fromColor(t)}}),o=new g({geometry:new E({radius:.5}),attributes:{color:u.fromColor(t)}});return new Z({geometryInstances:[r,o],appearance:new Y({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}function me(e,t){de(e,t);var i=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(i&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new q({camera:e._sceneCamera,color:l.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new q({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var r=0;r<e._numberOfCascades;++r)i&&(e._debugCascadeFrustums[r]=e._debugCascadeFrustums[r]&&e._debugCascadeFrustums[r].destroy(),e._debugCascadeFrustums[r]=new q({camera:e._passes[r].camera,color:Pe[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!d(e._debugLightFrustum)||e._needsUpdate){var o=e._shadowMapCamera.positionWC,a=S.IDENTITY,s=2*e._pointLightRadius,u=n.fromElements(s,s,s,De),c=C.fromTranslationQuaternionRotationScale(o,a,u,Te);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=pe(c,l.YELLOW)}e._debugLightFrustum.update(t)}else d(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new q({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function fe(){this.viewMatrix=new C,this.inverseViewMatrix=new C,this.frustum=void 0,this.positionCartographic=new a,this.positionWC=new n,this.directionWC=n.clone(n.UNIT_Z),this.upWC=n.clone(n.UNIT_Y),this.rightWC=n.clone(n.UNIT_X),this.viewProjectionMatrix=new C}function _e(e,t){var i,r=e._shadowMapCamera,a=e._sceneCamera,s=a.frustum.near,l=a.frustum.far,u=e._numberOfCascades,c=l-s,h=l/s,d=.9,p=!1;t.shadowHints.closestObjectSize<200&&(p=!0,d=.9);var m=Oe,f=Ie;for(f[0]=s,f[u]=l,i=0;i<u;++i){var _=(i+1)/u,g=s*Math.pow(h,_),v=s+c*_,w=y.lerp(v,g,d);f[i+1]=w,m[i]=w-f[i]}if(p){for(i=0;i<u;++i)m[i]=Math.min(m[i],e._maximumCascadeDistances[i]);var S=f[0];for(i=0;i<u-1;++i)S+=m[i],f[i+1]=S}o.unpack(f,0,e._cascadeSplits[0]),o.unpack(f,1,e._cascadeSplits[1]),o.unpack(m,0,e._cascadeDistances);var E=r.frustum,b=E.left,T=E.right,x=E.bottom,A=E.top,P=E.near,D=E.far,M=r.positionWC,I=r.directionWC,R=r.upWC,O=a.frustum.clone(Re),N=r.getViewProjection();for(i=0;i<u;++i){O.near=f[i],O.far=f[i+1];for(var L=C.multiply(O.projectionMatrix,a.viewMatrix,Te),B=C.inverse(L,Te),F=C.multiply(N,B,Te),V=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Fe),k=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ve),z=0;z<8;++z){var U=o.clone(be[z],xe[z]);C.multiplyByVector(F,U,U),n.divideByScalar(U,U.w,U),n.minimumByComponent(U,V,V),n.maximumByComponent(U,k,k)}V.x=Math.max(V.x,0),V.y=Math.max(V.y,0),V.z=0,k.x=Math.min(k.x,1),k.y=Math.min(k.y,1),k.z=Math.min(k.z,1);var G=e._passes[i],W=G.camera;W.clone(r);var H=W.frustum;H.left=b+V.x*(T-b),H.right=b+k.x*(T-b),H.bottom=x+V.y*(A-x),H.top=x+k.y*(A-x),H.near=P+V.z*(D-P),H.far=P+k.z*(D-P),G.cullingVolume=W.frustum.computeCullingVolume(M,I,R);var q=e._cascadeMatrices[i];C.multiply(W.getViewProjection(),a.inverseViewMatrix,q),C.multiply(G.textureOffsets,q,q)}}function ge(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,a=C.multiply(r.frustum.projectionMatrix,r.viewMatrix,Te),s=C.inverse(a,Te),l=i.directionWC,u=r.directionWC,c=n.cross(l,u,Le);u=n.cross(c,l,Be),n.normalize(u,u),n.normalize(c,c);for(var h=n.fromElements(0,0,0,ke),d=C.computeView(h,l,u,c,Ne),p=C.multiply(d,s,Te),m=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Fe),f=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ve),_=0;_<8;++_){var g=o.clone(be[_],xe[_]);C.multiplyByVector(p,g,g),n.divideByScalar(g,g.w,g),n.minimumByComponent(g,m,m),n.maximumByComponent(g,f,f)}f.z+=1e3,m.z-=10;var v=ke;v.x=-(.5*(m.x+f.x)),v.y=-(.5*(m.y+f.y)),v.z=-f.z;var y=C.fromTranslation(v,Te);d=C.multiply(y,d,d);var w=.5*(f.x-m.x),S=.5*(f.y-m.y),E=f.z-m.z,b=i.frustum;b.left=-w,b.right=w,b.bottom=-S,b.top=S,b.near=.01,b.far=E,C.clone(d,i.viewMatrix),C.inverse(d,i.inverseViewMatrix),C.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),n.clone(l,i.directionWC),n.clone(u,i.upWC),n.clone(c,i.rightWC)}function ve(e,t){var i=new X;i.fov=y.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=ze[r],n.upWC=Ue[r],n.rightWC=Ge[r],C.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),C.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}function ye(e,i){var r=e._sceneCamera,o=e._shadowMapCamera,a=qe;if(e._cascadesEnabled){if(r.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var s=i.mapProjection.ellipsoid.geodeticSurfaceNormal(r.positionWC,We),l=n.negate(o.directionWC,He),u=n.dot(s,l),c=y.clamp(u/.1,0,1);if(e._darkness=y.lerp(1,e.darkness,c),u<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)a.center=o.positionWC,a.radius=e._pointLightRadius,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere);else{var h=o.frustum.far/2,d=n.add(o.positionWC,n.multiplyByScalar(o.directionWC,h,je),je);a.center=d,a.radius=h,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere)}}function Ce(e,t){var i=t.camera,r=e._lightCamera,o=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?n.clone(r.directionWC,a.directionWC):e._isPointLight?n.clone(r.positionWC,a.positionWC):a.clone(r);var s=e._lightDirectionEC;C.multiplyByPointAsVector(i.viewMatrix,a.directionWC,s),n.normalize(s,s),n.negate(s,s),C.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;var l,u;e._fitNearFar?(l=Math.min(t.shadowHints.nearPlane,e.maximumDistance),u=Math.min(t.shadowHints.farPlane,e.maximumDistance+1)):(l=i.frustum.near,u=e.maximumDistance),e._sceneCamera=G.clone(i,o),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=l,e._sceneCamera.frustum.far=u,e._distance=u-l,ye(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}function we(e,t,i){var r=e._isPointLight?e._pointBias:i?e._terrainBias:e._primitiveBias,n={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var t=Ye;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,o.fromElements(t.x,t.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return o.fromElements(r.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new o,combinedUniforms2:new o};return c(t,n,!1)}function Se(e,t,i,r,n,o){var a,l,u;if(d(o)&&(a=o.shaderProgram,l=o.renderState,u=o.uniformMap),o=P.shallowClone(i,o),o.castShadows=!0,o.receiveShadows=!1,!d(a)||n!==i.shaderProgram.id||t){d(a)&&a.destroy();var c=i.shaderProgram,h=c.vertexShaderSource,p=c.fragmentShaderSource,m=i.pass===M.GLOBE,f=i.pass!==M.TRANSLUCENT,_=e._isPointLight,g=e._usesDepthTexture,v=K.createShadowCastVertexShader(h,_,m),y=K.createShadowCastFragmentShader(p,_,g,f);a=F.fromCache({context:r,vertexShaderSource:v,fragmentShaderSource:y,attributeLocations:c._attributeLocations}),l=e._primitiveRenderState,_?l=e._pointRenderState:m&&(l=e._terrainRenderState);var C=i.renderState.cull.enabled;C||(l=s(l,!1),l.cull.enabled=!1,l=L.fromCache(l)),u=we(e,i.uniformMap,m)}return o.shaderProgram=a,o.renderState=l,o.uniformMap=u,o}Q.MAXIMUM_DISTANCE=2e4,Q.prototype.debugCreateRenderStates=function(){ee(this)},p(Q.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){ce(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var Ee=new e,be=new Array(8);be[0]=new o(-1,-1,-1,1),be[1]=new o(1,-1,-1,1),be[2]=new o(1,1,-1,1),be[3]=new o(-1,1,-1,1),be[4]=new o(-1,-1,1,1),be[5]=new o(1,-1,1,1),be[6]=new o(1,1,1,1),be[7]=new o(-1,1,1,1);for(var Te=new C,xe=new Array(8),Ae=0;Ae<8;++Ae)xe[Ae]=new o;var Pe=[l.RED,l.GREEN,l.BLUE,l.MAGENTA],De=new n;fe.prototype.clone=function(e){C.clone(e.viewMatrix,this.viewMatrix),C.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),a.clone(e.positionCartographic,this.positionCartographic),n.clone(e.positionWC,this.positionWC),n.clone(e.directionWC,this.directionWC),n.clone(e.upWC,this.upWC),n.clone(e.rightWC,this.rightWC)};var Me=new C(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);fe.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return C.multiply(t,e,this.viewProjectionMatrix),C.multiply(Me,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Ie=new Array(5),Re=new X,Oe=new Array(4),Ne=new C,Le=new n,Be=new n,Fe=new n,Ve=new n,ke=new n,ze=[new n(-1,0,0),new n(0,-1,0),new n(0,0,-1),new n(1,0,0),new n(0,1,0),new n(0,0,1)],Ue=[new n(0,-1,0),new n(0,0,-1),new n(0,-1,0),new n(0,-1,0),new n(0,0,1),new n(0,-1,0)],Ge=[new n(0,0,1),new n(1,0,0),new n(-1,0,0),new n(0,0,-1),new n(1,0,0),new n(1,0,0)],We=new n,He=new n,qe=new t,je=qe.center;Q.prototype.update=function(e){if(Ce(this,e),this._needsUpdate)if(le(this,e.context),this._isPointLight&&ve(this,e),this._cascadesEnabled&&(ge(this,e),this._numberOfCascades>1&&_e(this,e)),this._isPointLight)this._shadowMapCullingVolume=H.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,i=t.positionWC,r=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(i,r,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var o=this._sceneCamera.inverseViewMatrix;C.multiply(this._shadowMapCamera.getViewProjection(),o,this._shadowMapMatrix)}this.debugShow&&me(this,e)},Q.prototype.updatePass=function(e,t){ue(this,e,t)};var Ye=new r;return Q.createDerivedCommands=function(e,t,i,r,n,o){d(o)||(o={});var a=t.length>0,s=i.shaderProgram,l=s.vertexShaderSource,u=s.fragmentShaderSource,c=i.pass===M.GLOBE,h=!1;if(c&&(h=i.owner.data.pickTerrain.mesh.encoding.hasVertexNormals),i.castShadows){var p=o.castCommands;d(p)||(p=o.castCommands=[]);var m=o.castShaderProgramId,f=e.length;p.length=f;for(var _=0;_<f;++_)p[_]=Se(e[_],r,i,n,m,p[_]);o.castShaderProgramId=i.shaderProgram.id}if(i.receiveShadows&&a){var g,v;d(o.receiveCommand)&&(g=o.receiveCommand.shaderProgram,v=o.receiveCommand.uniformMap),o.receiveCommand=P.shallowClone(i,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;var y=o.receiveShaderCastShadows!==i.castShadows,C=o.receiveShaderProgramId!==i.shaderProgram.id;if(!d(g)||C||r||y){d(g)&&g.destroy();var w=K.createShadowReceiveVertexShader(l,c,h),S=K.createShadowReceiveFragmentShader(u,t[0],i.castShadows,c,h);g=F.fromCache({context:n,vertexShaderSource:w,fragmentShaderSource:S,attributeLocations:s._attributeLocations}),v=we(t[0],i.uniformMap,c)}o.receiveCommand.shaderProgram=g,o.receiveCommand.uniformMap=v,o.receiveShaderProgramId=i.shaderProgram.id,o.receiveShaderCastShadows=i.castShadows}return o},Q.prototype.isDestroyed=function(){return!1},Q.prototype.destroy=function(){te(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return m(this)},Q}),i("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),i("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),i("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),i("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S){"use strict";function E(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new p,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new p,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t}E.prototype.clear=function(e,t){var i=this._clearFBO1Command;r.clone(n(t,r.BLACK),i.color),i.execute(e),i=this._clearFBO2Command,r.clone(n(t,r.BLACK),i.color),i.execute(e)},E.prototype.execute=function(e,t){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var b=new e,T=new e,x=new i,A=new t,P=new t,D=new l;return E.prototype.update=function(e){var i=e.context,n=e.viewport,a=i.drawingBufferWidth,p=i.drawingBufferHeight,E=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new h({color:new r}),this._clearFBO2Command=new h({color:new r});var M={};this._downSampleCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this}),M={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=i.createViewportQuadCommand(C,{uniformMap:M,owner:this});var I=1,R=2;M={delta:function(){return I},sigma:function(){return R},direction:function(){return 0}},this._blurXCommand=i.createViewportQuadCommand(w,{uniformMap:M,owner:this}),M={delta:function(){return I},sigma:function(){return R},direction:function(){return 1}},this._blurYCommand=i.createViewportQuadCommand(w,{uniformMap:M,owner:this}),M={u_center:function(){return E._uCenter},u_radius:function(){return E._uRadius}},this._blendCommand=i.createViewportQuadCommand(y,{uniformMap:M,owner:this}),M={},this._fullScreenCommand=i.createViewportQuadCommand(S,{uniformMap:M,owner:this})}var O=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),N=Math.pow(2,Math.ceil(Math.log(p)/Math.log(2))-2),L=Math.max(1,O,N),B=T;B.width=L,B.height=L;var F=this._fbo,V=o(F)&&F.getColorTexture(0)||void 0;if(!o(V)||V.width!==a||V.height!==p){F=F&&F.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/L;var k=[new v({context:i,width:a,height:p})];F=i.depthTexture?this._fbo=new d({context:i,colorTextures:k,depthTexture:new v({context:i,width:a,height:p,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:m.UNSIGNED_SHORT})}):this._fbo=new d({context:i,colorTextures:k,depthRenderbuffer:new f({context:i,format:_.DEPTH_COMPONENT16})}),this._downSampleFBO1=new d({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._downSampleFBO2=new d({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._downSampleCommand.framebuffer=this._downSampleFBO1,this._brightPassCommand.framebuffer=this._downSampleFBO2,this._blurXCommand.framebuffer=this._downSampleFBO1,this._blurYCommand.framebuffer=this._downSampleFBO2;var z=g.fromCache({viewport:B});this._downSampleCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._downSampleCommand.renderState=z,this._brightPassCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=z,this._blurXCommand.uniformMap.u_texture=function(){return E._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return E._blurStep},this._blurXCommand.renderState=z,this._blurYCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return E._blurStep},this._blurYCommand.renderState=z;var U=b;U.width=a,U.height=p;var G=g.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return F.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return E._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=G,this._fullScreenCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._fullScreenCommand.renderState=G}var W=i.uniformState,H=W.sunPositionWC,q=W.view,j=W.viewProjection,Y=W.projection,X=l.computeViewportTransformation(n,0,1,D),Z=l.multiplyByPoint(q,H,x),K=c.pointToGLWindowCoordinates(j,X,H,A);Z.x+=s.SOLAR_RADIUS;var Q=c.pointToGLWindowCoordinates(Y,X,Z,Z),J=30*t.magnitude(t.subtract(Q,K,Q))*2,$=P;$.x=J,$.y=J;var ee=this._upSamplePassState.scissorTest.rectangle;return ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._uCenter=t.clone(K,this._uCenter),this._uRadius=.5*Math.max($.x,$.y),X=l.computeViewportTransformation(B,0,1,D),K=c.pointToGLWindowCoordinates(j,X,H,A),$.x*=O/a,$.y*=N/p,ee=this._downSamplePassState.scissorTest.rectangle,ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._downSamplePassState.context=i,this._upSamplePassState.context=i,this._fbo},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),
this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},E}),i("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/getTimestamp","../Core/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/ShowGeometryInstanceAttribute","../Core/Transforms","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/PassState","../Renderer/ShaderProgram","../Renderer/ShaderSource","./Camera","./CreditDisplay","./CullingVolume","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./MapMode2D","./OIT","./OrthographicFrustum","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./ShadowMap","./SunPostProcess","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he){"use strict";function de(t){t=c(t,c.EMPTY_OBJECT);var i=t.canvas,r=t.contextOptions,n=t.creditContainer,o=new R(i,r);h(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",i.parentNode.appendChild(n)),this._id=u(),this._frameState=new q(o,new z(n)),this._frameState.scene3DOnly=c(t.scene3DOnly,!1);var a=new B(o);a.viewport=new e,a.viewport.x=0,a.viewport.y=0,a.viewport.width=o.drawingBufferWidth,a.viewport.height=o.drawingBufferHeight,this._passState=a,this._canvas=i,this._context=o,this._computeEngine=new I(o),this._globe=void 0,this._primitives=new ne,this._groundPrimitives=new ne,this._tweens=new he,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=c(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var l;o.depthTexture&&(l=new X);var d;this._useOIT&&h(l)&&(d=new K(o)),this._globeDepth=l,this._depthPlane=new G,this._oit=d,this._fxaa=new Y,this._clearColorCommand=new M({color:new s,stencil:0,owner:this}),this._depthClearCommand=new M({depth:1,owner:this}),this._stencilClearCommand=new M({stencil:0}),this._pickDepths=[],this._debugGlobeDepths=[],this._transitioner=new se(this),this._renderError=new _,this._preRender=new _,this._postRender=new _,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _,this.morphComplete=new _,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=s.clone(s.BLACK),this._mode=oe.SCENE3D,this._mapProjection=h(t.mapProjection)?t.mapProjection:new g,this.morphTime=1,this.farToNearRatio=1e3,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.fxaa=!0,this.useDepthPicking=!0,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new H,this._sunCamera=new k(this),this.shadowMap=new ue({context:o,lightCamera:this._sunCamera,enabled:c(t.shadows,!1)}),this._terrainExaggeration=c(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var p=new k(this);this._camera=p,this._cameraClone=k.clone(p),this._screenSpaceCameraController=new le(this),this._mapMode2D=c(t.mapMode2D,Z.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useFXAA:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0;var m=p.frustum.near,f=p.frustum.far,v=Math.ceil(Math.log(f/m)/Math.log(this.farToNearRatio));ye(m,f,this.farToNearRatio,v,this._frustumCommandsList,!1,void 0),ve(this,0,E.now()),this.initializeFrame()}function pe(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),n=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),n)}function me(e,t,i){var r=1/Math.max(1,pe(e.position,t.position));return n.multiplyByScalar(e.position,r,Qe),n.multiplyByScalar(t.position,r,Je),n.equalsEpsilon(Qe,Je,i)&&n.equalsEpsilon(e.direction,t.direction,i)&&n.equalsEpsilon(e.up,t.up,i)&&n.equalsEpsilon(e.right,t.right,i)&&T.equalsEpsilon(e.transform,t.transform,i)}function fe(e,t){var i=e.frameState,r=e._context,n=i.shadowHints.shadowsEnabled,o=i.shadowHints.shadowMaps,a=i.shadowHints.lightShadowMaps,s=n&&a.length>0,l=!1,u=i.shadowHints.lastDirtyTime;if(t.lastDirtyTime!==u&&(t.lastDirtyTime=u,t.dirty=!0,l=!0),t.dirty){t.dirty=!1;var c=t.derivedCommands;n&&(t.receiveShadows||t.castShadows)&&(c.shadows=ue.createDerivedCommands(o,a,t,l,r,c.shadows));var d=e._oit;t.pass===L.TRANSLUCENT&&h(d)&&d.isSupported()&&(s&&t.receiveShadows?(c.oit=h(c.oit)?c.oit:{},c.oit.shadows=d.createDerivedCommands(t.derivedCommands.shadows.receiveCommand,r,c.oit.shadows)):c.oit=d.createDerivedCommands(t,r,c.oit))}}function _e(e){var t=e.globe;if(e._mode===oe.SCENE3D&&h(t)){var i=t.ellipsoid;return $e.radius=i.minimumRadius,Ke=A.fromBoundingSphere($e,e._camera.positionWC,Ke)}}function ge(e){e.render=!1,e.pick=!1}function ve(e,t,i){var r=e._camera,n=e._frameState;n.commandList.length=0,n.shadowMaps.length=0,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=E.clone(i,n.time),n.camera=r,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.occluder=_e(e),n.terrainExaggeration=e._terrainExaggeration,ge(n.passes)}function ye(e,t,i,r,n,o,a){n.length=r;for(var s=0;s<r;++s){var l,u;o?(l=Math.min(t-a,e+s*a),u=Math.min(t,l+a)):(l=Math.max(e,Math.pow(i,s)*e),u=Math.min(t,i*l));var c=n[s];h(c)?(c.near=l,c.far=u):c=n[s]=new j(l,u)}}function Ce(e,t,i){e.debugShowFrustums&&(t.debugOverlappingFrustums=0),e.frameState.passes.pick||fe(e,t);for(var r=e._frustumCommandsList,n=r.length,o=0;o<n;++o){var a=r[o],s=a.near,l=a.far;if(!(i.start>l)){if(i.stop<s)break;var u=t instanceof M?L.OPAQUE:t.pass,c=a.indices[u]++;if(a.commands[u][c]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var d=e._debugFrustumStatistics.commandsInFrustums;d[t.debugOverlappingFrustums]=h(d[t.debugOverlappingFrustums])?d[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function we(e,t,i){return h(e)&&(!h(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==w.OUTSIDE&&(!h(i)||!e.boundingVolume.isOccluded(i)))}function Se(e){var t=e._frameState,i=t.camera,r=i.directionWC,n=i.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=e._frustumCommandsList,u=l.length,c=L.NUMBER_OF_PASSES,d=0;d<u;++d)for(var p=0;p<c;++p)l[d].indices[p]=0;o.length=0,a.length=0;for(var m=Number.MAX_VALUE,f=-Number.MAX_VALUE,_=!1,g=t.shadowHints.shadowsEnabled,v=Number.MAX_VALUE,y=-Number.MAX_VALUE,C=Number.MAX_VALUE,w=t.mode===oe.SCENE3D?t.occluder:void 0,S=t.cullingVolume,E=et.planes,b=0;b<5;++b)E[b]=S.planes[b];S=et;var T=e._environmentState;T.isSkyAtmosphereVisible=h(T.skyAtmosphereCommand)&&T.isReadyForAtmosphere,T.isSunVisible=we(T.sunDrawCommand,S,w),T.isMoonVisible=we(T.moonCommand,S,w);for(var x=s.length,A=0;A<x;++A){var P=s[A],D=P.pass;if(D===L.COMPUTE)o.push(P);else if(D===L.OVERLAY)a.push(P);else{var I=P.boundingVolume;if(h(I)){if(!we(P,S,w))continue;if(tt=I.computePlaneDistances(n,r,tt),m=Math.min(m,tt.start),f=Math.max(f,tt.stop),g&&P.receiveShadows&&tt.start<ue.MAXIMUM_DISTANCE&&!(D===L.GLOBE&&tt.start<-100&&tt.stop>100)){var R=tt.stop-tt.start;D!==L.GLOBE&&tt.start<100&&(C=Math.min(C,R)),v=Math.min(v,tt.start),y=Math.max(y,tt.stop)}}else tt.start=i.frustum.near,tt.stop=i.frustum.far,_=!(P instanceof M);Ce(e,P,tt)}}_?(m=i.frustum.near,f=i.frustum.far):(m=Math.min(Math.max(m,i.frustum.near),i.frustum.far),f=Math.max(Math.min(f,i.frustum.far),m),g&&(v=Math.min(Math.max(v,i.frustum.near),i.frustum.far),y=Math.max(Math.min(y,i.frustum.far),v))),g&&(t.shadowHints.nearPlane=v,t.shadowHints.farPlane=y,t.shadowHints.closestObjectSize=C);var O,N=e.mode===oe.SCENE2D,B=e.farToNearRatio;N?(f=Math.min(f,i.position.z+e.nearToFarDistance2D),m=Math.min(m,f),O=Math.ceil(Math.max(1,f-m)/e.nearToFarDistance2D)):O=Math.ceil(Math.log(f/m)/Math.log(B)),m!==Number.MAX_VALUE&&(O!==u||0!==l.length&&(m<l[0].near||f>l[u-1].far))&&(ye(m,f,B,O,l,N,e.nearToFarDistance2D),Se(e))}function Ee(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function be(e,t,i){var r=t.context,n=c(i,e.shaderProgram),o=n.fragmentShaderSource.clone();o.sources=o.sources.map(function(e){return e=V.replaceMain(e,"czm_Debug_main")});var a="void main() \n{ \n    czm_Debug_main(); \n";if(t.debugShowCommands){h(e._debugColor)||(e._debugColor=s.fromRandom());var l=e._debugColor;a+="    gl_FragColor.rgb *= vec3("+l.red+", "+l.green+", "+l.blue+"); \n"}if(t.debugShowFrustums){var u=1&e.debugOverlappingFrustums?"1.0":"0.0",d=2&e.debugOverlappingFrustums?"1.0":"0.0",p=4&e.debugOverlappingFrustums?"1.0":"0.0";a+="    gl_FragColor.rgb *= vec3("+u+", "+d+", "+p+"); \n"}a+="}",o.sources.push(a);var m=Ee(n);return F.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:m})}function Te(e,t,i){var r=N.shallowClone(e);r.shaderProgram=be(e,t),r.execute(t.context,i),r.shaderProgram.destroy()}function xe(e,t,r,o,a){if(!h(t.debugCommandFilter)||t.debugCommandFilter(e)){var s=t.frameState.shadowHints.shadowsEnabled,u=s&&t.frameState.shadowHints.lightShadowMaps.length>0;if(t.debugShowCommands||t.debugShowFrustums?Te(e,t,o):u&&e.receiveShadows&&h(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,o):e.execute(r,o),e.debugShowBoundingVolume&&h(e.boundingVolume)){var c=t._frameState,d=e.boundingVolume;h(t._debugVolume)&&t._debugVolume.destroy();var p,m=n.clone(d.center);if(c.mode!==oe.SCENE3D){m=T.multiplyByPoint(it,m,m);var _=c.mapProjection,g=_.unproject(m);m=_.ellipsoid.cartographicToCartesian(g)}if(h(d.radius)){var C=d.radius;p=y.toWireframe(f.createGeometry(new f({radii:new n(C,C,C),vertexFormat:$.FLAT_VERTEX_FORMAT}))),t._debugVolume=new re({geometryInstances:new v({geometry:p,modelMatrix:T.multiplyByTranslation(T.IDENTITY,m,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new $({flat:!0,translucent:!1}),asynchronous:!1})}else{var w=d.halfAxes;p=y.toWireframe(i.createGeometry(i.fromDimensions({dimensions:new n(2,2,2),vertexFormat:$.FLAT_VERTEX_FORMAT}))),t._debugVolume=new re({geometryInstances:new v({geometry:p,modelMatrix:T.fromRotationTranslation(w,m,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new $({flat:!0,translucent:!1}),asynchronous:!1})}var S=c.commandList,E=c.commandList=[];t._debugVolume.update(c);var b;h(a)&&(b=o.framebuffer,o.framebuffer=a),E[0].execute(r,o),h(b)&&(o.framebuffer=b),c.commandList=S}}}function Ae(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function Pe(e,t,i,r){var n=e.context;x(r,Ae,e._camera.positionWC);for(var o=r.length,a=0;a<o;++a)t(r[a],e,n,i)}function De(e,t){var i=e._debugGlobeDepths[t];return!h(i)&&e.context.depthTexture&&(i=new X,e._debugGlobeDepths[t]=i),i}function Me(e,t){var i=e._pickDepths[t];return h(i)||(i=new ie,e._pickDepths[t]=i),i}function Ie(e,t){var i=e._camera,r=e.context,n=r.uniformState;n.updateCamera(i);var o;o=h(i.frustum.fov)?i.frustum.clone(rt):h(i.frustum.infiniteProjectionMatrix)?i.frustum.clone(nt):i.frustum.clone(ot),o.near=i.frustum.near,o.far=i.frustum.far,n.updateFrustum(o),n.updatePass(L.ENVIRONMENT);var a=e._environmentState,s=a.skyBoxCommand;h(s)&&xe(s,e,r,t),a.isSkyAtmosphereVisible&&xe(a.skyAtmosphereCommand,e,r,t);var l=e._useWebVR&&e.mode!==oe.SCENE2D;if(a.isSunVisible&&(a.sunDrawCommand.execute(r,t),e.sunBloom&&!l)){var u;u=a.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:a.useFXAA?e._fxaa.getColorFramebuffer():a.originalFramebuffer,e._sunPostProcess.execute(r,u),t.framebuffer=u}a.isMoonVisible&&a.moonCommand.execute(r,t);var c;a.useOIT?(h(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r){e._oit.executeCommands(e,t,i,r)}),c=e._executeOITFunction):c=Pe;for(var d,p=a.clearGlobeDepth,m=a.useDepthPlane,f=e._depthClearCommand,_=e._depthPlane,g=i.position.z,v=e._frustumCommandsList,y=v.length,C=0;C<y;++C){var w=y-C-1,S=v[w];e.mode===oe.SCENE2D?(i.position.z=g-S.near+1,o.far=Math.max(1,S.far-S.near),o.near=1,n.update(e.frameState),n.updateFrustum(o)):(o.near=0!==w?S.near*Ze:S.near,o.far=S.far,n.updateFrustum(o));var E,b=e.debugShowGlobeDepth?De(e,w):e._globeDepth;e.debugShowGlobeDepth&&h(b)&&a.useGlobeDepthFramebuffer&&(E=t.framebuffer,t.framebuffer=b.framebuffer),f.execute(r,t),n.updatePass(L.GLOBE);var T=S.commands[L.GLOBE],x=S.indices[L.GLOBE];for(d=0;d<x;++d)xe(T[d],e,r,t);for(h(b)&&a.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(b.update(r),b.executeCopyDepth(r,t)),e.debugShowGlobeDepth&&h(b)&&a.useGlobeDepthFramebuffer&&(t.framebuffer=E),n.updatePass(L.GROUND),T=S.commands[L.GROUND],x=S.indices[L.GROUND],d=0;d<x;++d)xe(T[d],e,r,t);x>0&&r.stencilBuffer&&e._stencilClearCommand.execute(r,t),p&&(f.execute(r,t),m&&_.execute(r,t));for(var A=L.GROUND+1,P=L.TRANSLUCENT,D=A;D<P;++D)for(n.updatePass(D),T=S.commands[D],x=S.indices[D],d=0;d<x;++d)xe(T[d],e,r,t);if(0!==w&&e.mode!==oe.SCENE2D&&(o.near=S.near,n.updateFrustum(o)),n.updatePass(L.TRANSLUCENT),T=S.commands[L.TRANSLUCENT],T.length=S.indices[L.TRANSLUCENT],c(e,xe,t,T),h(b)&&a.useGlobeDepthFramebuffer&&e.useDepthPicking){var M=Me(e,w);M.update(r,b.framebuffer.depthStencilTexture),M.executeCopyDepth(r,t)}}}function Re(e){var t=e.context.uniformState;t.updatePass(L.COMPUTE);var i=e._environmentState.sunComputeCommand;h(i)&&i.execute(e._computeEngine);for(var r=e._computeCommandList,n=r.length,o=0;o<n;++o)r[o].execute(e._computeEngine)}function Oe(e,t){var i=e.context.uniformState;i.updatePass(L.OVERLAY);for(var r=e.context,n=e._overlayCommandList,o=n.length,a=0;a<o;++a)n[a].execute(r,t)}function Ne(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,o=i.passes,a=o.length,s=t.length,l=0;l<s;++l){var u=t[l];if(fe(e,u),u.castShadows&&(u.pass===L.GLOBE||u.pass===L.OPAQUE||u.pass===L.TRANSLUCENT)&&we(u,r))if(n)for(var c=0;c<a;++c)o[c].commandList.push(u);else if(1===a)o[0].commandList.push(u);else for(var h=!1,d=a-1;d>=0;--d){var p=o[d].cullingVolume;if(we(u,p))o[d].commandList.push(u),h=!0;else if(h)break}}}function Le(e){var t=e.frameState,i=t.shadowHints.shadowMaps,r=i.length;if(t.shadowHints.shadowsEnabled)for(var n=e.context,o=n.uniformState,a=0;a<r;++a){var s=i[a];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;var h=e.frameState.commandList;for(Ne(e,h,s),l=0;l<c;++l){var d=s.passes[l];o.updateCamera(d.camera),s.updatePass(n,l);for(var p=d.commandList.length,m=0;m<p;++m){var f=d.commandList[m];o.updatePass(f.pass),xe(f.derivedCommands.shadows.castCommands[a],e,n,d.passState)}}}}}function Be(e,t,i,r){var o=e._context,a=t.viewport,s=e._frameState,l=s.camera,u=s.mode;if(e._useWebVR&&u!==oe.SCENE2D){Ue(e),Se(e),Ge(e,t,i,r),Re(e),Le(e),a.x=0,a.y=0,a.width=.5*o.drawingBufferWidth,a.height=o.drawingBufferHeight;var c=k.clone(l,e._cameraVR),h=l.frustum.near,d=5*h,p=d/30,m=n.multiplyByScalar(c.right,.5*p,pt);l.frustum.aspectRatio=a.width/a.height;var f=.5*p*h/d;n.add(c.position,m,l.position),l.frustum.xOffset=f,Ie(e,t),a.x=t.viewport.width,n.subtract(c.position,m,l.position),l.frustum.xOffset=-f,Ie(e,t),k.clone(c,l)}else a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight,u!==oe.SCENE2D||e._mapMode2D===Z.ROTATE?Ve(!0,e,t,i,r):Fe(e,t,i,r)}function Fe(e,t,i,r){var o=e.context,a=e.frameState,s=e.camera,l=t.viewport,u=at,c=st,h=e.mapProjection;h.project(u,c);var d=n.clone(s.position,lt),p=T.clone(s.transform,ct),m=s.frustum.clone();s._setTransform(T.IDENTITY);var f=T.computeViewportTransformation(l,0,1,ut),_=s.frustum.projectionMatrix,g=s.positionWC.y,v=n.fromElements(b.sign(g)*c.x-g,0,-s.positionWC.x,ht),y=D.pointToGLWindowCoordinates(_,f,v,dt);y.x=Math.floor(y.x);var C=l.x,w=l.width;if(0===g||y.x<=0||y.x>=o.drawingBufferWidth)Ve(!0,e,t,i,r);else if(Math.abs(.5*o.drawingBufferWidth-y.x)<1)l.width=y.x,s.position.x*=b.sign(s.position.x),s.frustum.right=0,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x=l.width,s.position.x=-s.position.x,s.frustum.right=-s.frustum.left,s.frustum.left=0,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r);else if(y.x>.5*o.drawingBufferWidth){l.width=y.x;var S=s.frustum.right;s.frustum.right=c.x-g,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x+=y.x,l.width=o.drawingBufferWidth-y.x,s.position.x=-s.position.x,s.frustum.left=-s.frustum.right,s.frustum.right=S-2*s.frustum.right,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r)}else{l.x=y.x,l.width=o.drawingBufferWidth-y.x;var E=s.frustum.left;s.frustum.left=-c.x-g,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!0,e,t,i,r),l.x=0,l.width=y.x,s.position.x=-s.position.x,s.frustum.right=-s.frustum.left,s.frustum.left=E-2*s.frustum.left,a.cullingVolume=s.frustum.computeCullingVolume(s.positionWC,s.directionWC,s.upWC),o.uniformState.update(a),Ve(!1,e,t,i,r)}s._setTransform(p),n.clone(d,s.position),s.frustum=m.clone(),l.x=C,l.width=w}function Ve(e,t,i,r,n){e||(t.frameState.commandList.length=0),Ue(t),Se(t),e&&(Ge(t,i,r,n),Re(t),Le(t)),Ie(t,i)}function ke(e){var t=e._frameState,i=e._environmentState,r=t.passes.render;i.skyBoxCommand=r&&h(e.skyBox)?e.skyBox.update(t):void 0;var n=e.skyAtmosphere,o=e.globe;h(n)&&h(o)&&(n.setDynamicAtmosphereColor(o.enableLighting),i.isReadyForAtmosphere=i.isReadyForAtmosphere||o._surface._tilesToRender.length>0),i.skyAtmosphereCommand=r&&h(n)?n.update(t):void 0;var a=r&&h(e.sun)?e.sun.update(e):void 0;i.sunDrawCommand=h(a)?a.drawCommand:void 0,i.sunComputeCommand=h(a)?a.computeCommand:void 0,i.moonCommand=r&&h(e.moon)?e.moon.update(t):void 0;var s=i.clearGlobeDepth=h(o)&&(!o.depthTestAgainstTerrain||e.mode===oe.SCENE2D),l=i.useDepthPlane=s&&e.mode===oe.SCENE3D;l&&e._depthPlane.update(t)}function ze(e){var t=e._frameState,i=t.shadowMaps,r=i.length,n=r>0&&!t.passes.pick&&e.mode===oe.SCENE3D;if(n!==t.shadowHints.shadowsEnabled&&(++t.shadowHints.lastDirtyTime,t.shadowHints.shadowsEnabled=n),n){for(var o=0;o<r;++o)if(i[o]!==t.shadowHints.shadowMaps[o]){++t.shadowHints.lastDirtyTime;break}t.shadowHints.shadowMaps.length=0,t.shadowHints.lightShadowMaps.length=0;for(var a=0;a<r;++a){var s=i[a];s.update(t),t.shadowHints.shadowMaps.push(s),s.fromLightSource&&t.shadowHints.lightShadowMaps.push(s),s.dirty&&(++t.shadowHints.lastDirtyTime,s.dirty=!1)}}}function Ue(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),ze(e),e._globe&&e._globe.update(t)}function Ge(e,t,i,r){var n=e._context,o=e._environmentState,a=e._useWebVR&&e.mode!==oe.SCENE2D;o.originalFramebuffer=t.framebuffer,h(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!a?e._sunPostProcess=new ce:h(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!h(e.sun)&&h(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var l=e._clearColorCommand;s.clone(i,l.color),l.execute(n,t);var u=o.useGlobeDepthFramebuffer=!r&&h(e._globeDepth);u&&(e._globeDepth.update(n),e._globeDepth.clear(n,t,i));for(var c=!1,d=e._frustumCommandsList,p=d.length,m=0;m<p;++m)if(d[m].indices[L.TRANSLUCENT]>0){c=!0;break}var f=o.useOIT=!r&&c&&h(e._oit)&&e._oit.isSupported();f&&(e._oit.update(n,e._globeDepth.framebuffer),e._oit.clear(n,t,i),o.useOIT=e._oit.isSupported());var _=o.useFXAA=!r&&e.fxaa;_&&(e._fxaa.update(n),e._fxaa.clear(n,t,i)),o.isSunVisible&&e.sunBloom&&!a?t.framebuffer=e._sunPostProcess.update(t):u?t.framebuffer=e._globeDepth.framebuffer:_&&(t.framebuffer=e._fxaa.getColorFramebuffer()),h(t.framebuffer)&&l.execute(n,t)}function We(e,t){var i=e._context,r=e._environmentState,n=r.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){var o=De(e,e.debugShowDepthFrustum-1);o.executeDebugGlobeDepth(i,t)}if(e.debugShowPickDepth&&n){var a=Me(e,e.debugShowDepthFrustum-1);a.executeDebugPickDepth(i,t)}var s=r.useOIT,l=r.useFXAA;s&&(t.framebuffer=l?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(i,t)),l&&(!s&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(i,t)),t.framebuffer=r.originalFramebuffer,e._fxaa.execute(i,t)),s||l||!n||(t.framebuffer=r.originalFramebuffer,e._globeDepth.executeCopyColor(i,t))}function He(e){for(var t=e.afterRender,i=0,r=t.length;i<r;++i)t[i]();t.length=0}function qe(e,t){h(t)||(t=E.now());var i=e._camera;me(i,e._cameraClone,b.EPSILON6)?e._cameraStartFired&&C()-e._cameraMovedTime>e.cameraEventWaitTime&&(i.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(i.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=C(),k.clone(i,e._cameraClone)),e._preRender.raiseEvent(e,t);var r=e.context,o=r.uniformState,a=e._frameState,l=b.incrementWrap(a.frameNumber,15e6,1);ve(e,l,t),a.passes.render=!0,a.creditDisplay.beginFrame(),e.fog.update(a),o.update(a);var u=e.shadowMap;h(u)&&u.enabled&&(n.negate(o.sunDirectionWC,e._sunCamera.direction),a.shadowMaps.push(u)),e._computeCommandList.length=0,e._overlayCommandList.length=0;var d=e._passState;if(d.framebuffer=void 0,d.blendingEnabled=void 0,d.scissorTest=void 0,h(e.globe)&&e.globe.beginFrame(a),ke(e),Be(e,d,c(e.backgroundColor,s.BLACK)),We(e,d),Oe(e,d),h(e.globe)&&e.globe.endFrame(a),a.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!h(e._performanceDisplay)){var p=document.createElement("div");p.className="cesium-performanceDisplay-defaultContainer";var m=e._canvas.parentNode;m.appendChild(p);var f=new J({container:p});e._performanceDisplay=f,e._performanceContainer=p}e._performanceDisplay.update()}else h(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));r.endFrame(),He(a),e._postRender.raiseEvent(e,t)}function je(e,t,i,r){var o=e._camera,a=o.frustum,s=e._passState.viewport,l=2*(t.x-s.x)/s.width-1;l*=.5*(a.right-a.left);var u=2*(s.height-t.y-s.y)/s.height-1;u*=.5*(a.top-a.bottom);var c=T.clone(o.transform,vt);o._setTransform(T.IDENTITY);var h=n.clone(o.position,ft);n.multiplyByScalar(o.right,l,_t),n.add(_t,h,h),n.multiplyByScalar(o.up,u,_t),n.add(_t,h,h),o._setTransform(c),n.fromElements(h.z,h.x,h.y,h);var d=a.getPixelDimensions(s.width,s.height,1,gt),p=mt;return p.right=.5*d.x,p.left=-p.right,p.top=.5*d.y,p.bottom=-p.top,p.near=a.near,p.far=a.far,p.computeCullingVolume(h,o.directionWC,o.upWC)}function Ye(e,t,i,r){var n=e._camera,o=n.frustum,a=o.near,s=Math.tan(.5*o.fovy),l=o.aspectRatio*s,u=e._passState.viewport,c=2*(t.x-u.x)/u.width-1,h=2*(u.height-t.y-u.y)/u.height-1,d=c*a*l,p=h*a*s,m=o.getPixelDimensions(u.width,u.height,1,gt),f=m.x*i*.5,_=m.y*r*.5,g=yt;return g.top=p+_,g.bottom=p-_,g.right=d+f,g.left=d-f,g.near=a,g.far=o.far,g.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function Xe(e,t,i,r){return e._mode===oe.SCENE2D?je(e,t,i,r):Ye(e,t,i,r)}var Ze=.99;d(de.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return O.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return O.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},frameState:{get:function(){return this._frameState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){return this.globe.imageryLayers}},terrainProvider:{get:function(){return this.globe.terrainProvider},set:function(e){this.globe.terrainProvider=e}},terrainProviderChanged:{get:function(){return this.globe.terrainProviderChanged}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return h(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},numberOfFrustums:{get:function(){return this._frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new k(this),h(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new W(this)),this._aspectRatioVR=this._camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._camera.frustum.aspectRatio=this._aspectRatioVR,this._camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}}});var Ke,Qe=new n,Je=new n,$e=new t,et=new U,tt=new S,it=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);it=T.inverseTransformation(it,it);var rt=new ee,nt=new te,ot=new Q,at=new a(Math.PI,b.PI_OVER_TWO),st=new n,lt=new n,ut=new T,ct=new T,ht=new n,dt=new n;de.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._screenSpaceCameraController.update(),h(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this._camera.update(this._mode),this._camera._updateCameraChanged()};var pt=new n;de.prototype.render=function(e){try{qe(this,e)}catch(e){if(this._renderError.raiseEvent(this,e),this.rethrowRenderErrors)throw e}},de.prototype.clampLineWidth=function(e){return Math.max(O.minimumAliasedLineWidth,Math.min(e,O.maximumAliasedLineWidth))};var mt=new Q,ft=new n,_t=new n,gt=new r,vt=new T,yt=new te,Ct=3,wt=3,St=new e(0,0,Ct,wt),Et=new s(0,0,0,0),bt=new r;de.prototype.pick=function(e){var t=this._context,i=t.uniformState,r=this._frameState,n=ae.transformWindowToDrawingBuffer(this,e,bt);h(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),ve(this,r.frameNumber,r.time),r.cullingVolume=Xe(this,n,Ct,wt),r.passes.pick=!0,i.update(r),St.x=n.x-.5*(Ct-1),St.y=this.drawingBufferHeight-n.y-.5*(wt-1);var o=this._pickFramebuffer.begin(St);Be(this,o,Et,!0),We(this,o);var a=this._pickFramebuffer.end(St);return t.endFrame(),He(r),a};var Tt=new o,xt=new o(1,1/255,1/65025,1/16581375);return de.prototype.pickPosition=function(e,t){if(this.useDepthPicking){var i=this._context,r=i.uniformState,n=ae.transformWindowToDrawingBuffer(this,e,bt);n.y=this.drawingBufferHeight-n.y;var a,s=this._camera;h(s.frustum.fov)?a=s.frustum.clone(rt):h(s.frustum.infiniteProjectionMatrix)&&(a=s.frustum.clone(nt));for(var l=this.numberOfFrustums,u=0;u<l;++u){var c=Me(this,u),d=i.readPixels({x:n.x,y:n.y,width:1,height:1,framebuffer:c.framebuffer}),p=o.unpack(d,0,Tt);o.divideByScalar(p,255,p);var m=o.dot(p,xt);if(m>0&&m<1){var f=this._frustumCommandsList[u];return a.near=f.near*(0!==u?Ze:1),a.far=f.far,r.updateFrustum(a),ae.drawingBufferToWgs84Coordinates(this,n,m,t)}}}},de.prototype.drillPick=function(e,t){var i,r,n=[],o=[],a=[];h(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);h(s)&&h(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&h(s.id)&&(r=l.getGeometryInstanceAttributes(s.id),h(r)&&h(r.show)&&(u=!0,r.show=P.toValue(!1,r.show),a.push(r))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)r=a[i],r.show=P.toValue(!0,r.show);return n},de.prototype.completeMorph=function(){this._transitioner.completeMorph()},de.prototype.morphTo2D=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo2D(e,t)},de.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphToColumbusView(e,t)},de.prototype.morphTo3D=function(e){var t,i=this.globe;t=h(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo3D(e,t)},de.prototype.isDestroyed=function(){return!1},de.prototype.destroy=function(){return this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),
this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner.destroy(),h(this._globeDepth)&&this._globeDepth.destroy(),h(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),h(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),p(this)},de}),i("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(r){function n(e){w._image=e,w._tileWidth=e.width,w._tileHeight=e.height,w._ready=!0,w._readyPromise.resolve(!0),c.handleSuccess(w._errorEvent)}function d(e){var t="Failed to load image "+v+".";C=c.handleError(C,w,w._errorEvent,t,0,0,0,p,e),w._readyPromise.reject(new u(t))}function p(){h(s(v),n,d)}r=t(r,{});var m=r.url;this._url=m;var f=r.proxy;this._proxy=f;var _=t(r.rectangle,l.MAX_VALUE),g=new a({rectangle:_,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid});this._tilingScheme=g,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1,this._readyPromise=h.defer();var v=m;i(f)&&(v=f.getURL(v));var y=r.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var C,w=this;p()}return r(d.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),d.prototype.getTileCredits=function(e,t,i){},d.prototype.requestImage=function(e,t,i){return this._image},d.prototype.pickFeatures=function(){},d}),i("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nconst float g = -0.95;\nconst float g2 = g * g;\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\n#ifdef COLOR_CORRECT\nvec3 rgb2hsb(vec3 rgbColor)\n{\nvec4 p = mix(vec4(rgbColor.bg, K_RGB2HSB.wz), vec4(rgbColor.gb, K_RGB2HSB.xy), step(rgbColor.b, rgbColor.g));\nvec4 q = mix(vec4(p.xyw, rgbColor.r), vec4(rgbColor.r, p.yzx), step(p.x, rgbColor.r));\nfloat d = q.x - min(q.w, q.y);\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\nvec3 hsb2rgb(vec3 hsbColor)\n{\nvec3 p = abs(fract(hsbColor.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsbColor.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsbColor.y);\n}\n#endif\nvoid main (void)\n{\nfloat cosAngle = dot(czm_sunDirectionWC, normalize(v_toCamera)) / length(v_toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nconst float exposure = 2.0;\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-exposure * rgb);\nfloat l = czm_luminance(rgb);\n#ifdef COLOR_CORRECT\nvec3 hsb = rgb2hsb(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = hsb2rgb(hsb);\nl = min(l, czm_luminance(rgb));\n#endif\ngl_FragColor = vec4(rgb, min(smoothstep(0.0, 0.1, l), 1.0) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),i("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"attribute vec4 position;\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth  * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nfloat cameraHeight = u_cameraAndRadiiAndDynamicAtmosphereColor.x;\nfloat outerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.y;\nfloat innerRadius = u_cameraAndRadiiAndDynamicAtmosphereColor.z;\nvec3 positionV3 = position.xyz;\nvec3 ray = positionV3 - czm_viewerPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B*B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nvec3 start = czm_viewerPositionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth );\nfloat startOffset = startDepth*scale(startAngle);\n#else // SKY_FROM_ATMOSPHERE\nvec3 start = czm_viewerPositionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nfloat startOffset = depth*scale(startAngle);\n#endif\nfloat sampleLength = far / fSamples;\nfloat scaledLength = sampleLength * atmosphereScale;\nvec3 sampleRay = ray * sampleLength;\nvec3 samplePoint = start + sampleRay * 0.5;\nvec3 frontColor = vec3(0.0, 0.0, 0.0);\nvec3 lightDir = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? czm_sunPositionWC - czm_viewerPositionWC : czm_viewerPositionWC;\nlightDir = normalize(lightDir);\nfor(int i=0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDir, samplePoint) / height;\nfloat fCameraAngle = dot(ray, samplePoint) / height;\nfloat fScatter = (startOffset + depth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\nfrontColor += attenuate * (depth * scaledLength);\nsamplePoint += sampleRay;\n}\nv_mieColor = frontColor * KmESun;\nv_rayleighColor = frontColor * (InvWavelength * KrESun);\nv_toCamera = czm_viewerPositionWC - positionV3;\ngl_Position = czm_modelViewProjection * position;\n}\n"}),i("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../Core/Math","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w){"use strict";function S(r){r=i(r,a.WGS84),this.show=!0,this._ellipsoid=r,this._command=new d({owner:this}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._spSkyFromSpaceColorCorrect=void 0,this._spSkyFromAtmosphereColorCorrect=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new e;var n=new t;n.w=0,n.y=e.maximumComponent(e.multiplyByScalar(r.radii,1.025,new e)),n.z=r.maximumRadius,this._cameraAndRadiiAndDynamicAtmosphereColor=n;var o=this;this._command.uniformMap={u_cameraAndRadiiAndDynamicAtmosphereColor:function(){return o._cameraAndRadiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness}}}function E(e){return!(u.equalsEpsilon(e.hueShift,0,u.EPSILON7)&&u.equalsEpsilon(e.saturationShift,0,u.EPSILON7)&&u.equalsEpsilon(e.brightnessShift,0,u.EPSILON7))}return n(S.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),S.prototype.setDynamicAtmosphereColor=function(e){this._cameraAndRadiiAndDynamicAtmosphereColor.w=e?1:0},S.prototype.update=function(t){if(this.show&&(t.mode===w.SCENE3D||t.mode===w.MORPHING)&&t.passes.render){var i=this._command;if(!r(i.vertexArray)){var n=t.context,o=s.createGeometry(new s({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:c.POSITION_ONLY}));i.vertexArray=_.fromGeometry({context:n,geometry:o,attributeLocations:l.createAttributeLocations(o),bufferUsage:h.STATIC_DRAW}),i.renderState=p.fromCache({cull:{enabled:!0,face:C.FRONT},blending:y.ALPHA_BLEND});var a=new f({defines:["SKY_FROM_SPACE"],sources:[v]});this._spSkyFromSpace=m.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:g}),a=new f({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphere=m.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:g})}var u=E(this);if(u&&(!r(this._spSkyFromSpaceColorCorrect)||!r(this._spSkyFromAtmosphereColorCorrect))){var d=t.context,S=new f({defines:["SKY_FROM_SPACE"],sources:[v]}),b=new f({defines:["COLOR_CORRECT"],sources:[g]});this._spSkyFromSpaceColorCorrect=m.fromCache({context:d,vertexShaderSource:S,fragmentShaderSource:b}),S=new f({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphereColorCorrect=m.fromCache({context:d,vertexShaderSource:S,fragmentShaderSource:b})}var T=t.camera.positionWC,x=e.magnitude(T);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=x,x>this._cameraAndRadiiAndDynamicAtmosphereColor.y?i.shaderProgram=u?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:i.shaderProgram=u?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,i}},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),this._spSkyFromSpaceColorCorrect=this._spSkyFromSpaceColorCorrect&&this._spSkyFromSpaceColorCorrect.destroy(),this._spSkyFromAtmosphereColorCorrect=this._spSkyFromAtmosphereColorCorrect&&this._spSkyFromAtmosphereColorCorrect.destroy(),o(this)},S}),i("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),i("Shaders/SkyBoxVS",[],function(){"use strict";return"attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n"}),i("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y){"use strict";function C(e){this.sources=e.sources,this._sources=void 0,this.show=i(e.show,!0),this._command=new h({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return C.prototype.update=function(i){if(this.show&&(i.mode===y.SCENE3D||i.mode===y.MORPHING)&&i.passes.render){var n=i.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?d(n,this._sources).then(function(e){h._cubeMap=h._cubeMap&&h._cubeMap.destroy(),h._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:n,source:o}))}var s=this._command;if(!r(s.vertexArray)){var h=this;s.uniformMap={u_cubeMap:function(){return h._cubeMap}};var C=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),w=a.createAttributeLocations(C);s.vertexArray=f.fromGeometry({context:n,geometry:C,attributeLocations:w,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=m.fromCache({context:n,vertexShaderSource:g,fragmentShaderSource:_,attributeLocations:w}),s.renderState=p.fromCache({blending:v.ALPHA_BLEND})}if(r(this._cubeMap))return s}},C.prototype.isDestroyed=function(){return!1},C.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),n(this)},C}),i("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),i("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 1.0, surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942,  0.92106));\nburst += 0.4 * addBurst(position, vec2(0.99235,  0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457,  0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931,  0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"}),i("Shaders/SunVS",[],function(){"use strict";return"attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n"}),i("Scene/Sun",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(){this.show=!0,this._drawCommand=new _({primitiveType:d.TRIANGLES,boundingVolume:new e,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new e,this._boundingVolume2D=new e,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}}a(A.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var P=new t,D=new t,M=new r,I=new r;return A.prototype.update=function(r){var a=r._passState,s=r.frameState,d=r.context;if(this.show){var _=s.mode;if(_!==T.SCENE2D&&_!==T.MORPHING&&s.passes.render){var A=a.viewport.width,R=a.viewport.height;if(!o(this._texture)||A!==this._drawingBufferWidth||R!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=A,this._drawingBufferHeight=R,this._glowFactorDirty=!1;var O=Math.max(A,R);O=Math.pow(2,Math.ceil(Math.log(O)/Math.log(2))-2),O=Math.max(1,O),this._texture=new y({context:d,width:O,height:O,pixelFormat:h.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var N=this,L={u_glowLengthTS:function(){return N._glowLengthTS},u_radiusTS:function(){return N._radiusTS}};this._commands.computeCommand=new f({fragmentShaderSource:S,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){N._commands.computeCommand=void 0}})}var B=this._drawCommand;if(!o(B.vertexArray)){var F={direction:0},V=new Uint8Array(8);V[0]=0,V[1]=0,V[2]=255,V[3]=0,V[4]=255,V[5]=255,V[6]=0,V[7]=255;var k=p.createVertexBuffer({context:d,typedArray:V,usage:m.STATIC_DRAW}),z=[{index:F.direction,vertexBuffer:k,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}],U=p.createIndexBuffer({context:d,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:m.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});B.vertexArray=new C({context:d,attributes:z,indexBuffer:U}),B.shaderProgram=v.fromCache({context:d,vertexShaderSource:E,fragmentShaderSource:w,attributeLocations:F}),B.renderState=g.fromCache({blending:b.ALPHA_BLEND}),B.uniformMap=this._uniformMap}var G=d.uniformState.sunPositionWC,W=d.uniformState.sunPositionColumbusView,H=this._boundingVolume,q=this._boundingVolume2D;i.clone(G,H.center),q.center.x=W.z,q.center.y=W.x,q.center.z=W.y,H.radius=u.SOLAR_RADIUS+u.SOLAR_RADIUS*this._glowLengthTS,q.radius=H.radius,_===T.SCENE3D?e.clone(H,B.boundingVolume):_===T.COLUMBUS_VIEW&&e.clone(q,B.boundingVolume);var j=x.computeActualWgs84Position(s,G,I),Y=i.magnitude(i.subtract(j,r.camera.position,I)),X=d.uniformState.projection,Z=M;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var K=c.multiplyByVector(X,Z,I),Q=x.clipToDrawingBufferCoordinates(a.viewport,K,P);Z.x=u.SOLAR_RADIUS;var J=c.multiplyByVector(X,Z,I),$=x.clipToDrawingBufferCoordinates(a.viewport,J,D);return this._size=Math.ceil(t.magnitude(t.subtract($,Q,I))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),s(this)},A}),i("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT),this._tilingScheme=i(r.tilingScheme)?r.tilingScheme:new o({ellipsoid:r.ellipsoid}),this._color=t(r.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(r.tileWidth,256),this._tileHeight=t(r.tileHeight,256),this._readyPromise=a.resolve(!0)}return r(s.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){var r=document.createElement("canvas");r.width=256,r.height=256;var n=r.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+i+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),r},s.prototype.pickFeatures=function(){},s}),i("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";function t(t){e.throwInstantiationError()}return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),i("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e(t)}),i("Shaders/ViewportQuadFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),i("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(r,n){this.show=!0,i(r)||(r=new e),this.rectangle=e.clone(r),i(n)||(n=c.fromType(c.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}return h.prototype.update=function(t){if(this.show){var r=this._rs;i(r)&&e.equals(r.viewport,this.rectangle)||(this._rs=a.fromCache({blending:u.ALPHA_BLEND,viewport:this.rectangle}));var n=t.passes;if(n.render){var c=t.context;if(this._material!==this.material||!i(this._overlayCommand)){this._material=this.material,i(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var h=new s({sources:[this._material.shaderSource,l]});this._overlayCommand=c.createViewportQuadCommand(h,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=o.OVERLAY}this._material.update(c),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return i(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),r(this)},h}),i("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(r){function n(e,t){i(f[e])||(f[e]=t),i(v)&&!i(v[e])&&(v[e]=t)}r=t(r,t.EMPTY_OBJECT),this._url=r.url,this._layers=r.layers;var o=t(r.getFeatureInfoFormats,p.DefaultGetFeatureInfoFormats),h=new c(r.url),f=l(t(h.query,"")),_=e(m(t(r.parameters,t.EMPTY_OBJECT)),p.DefaultParameters);f=e(_,f);var g,v;g=new c(r.url),v=l(t(g.query,""));var y=e(m(t(r.getFeatureInfoParameters,t.EMPTY_OBJECT)),p.GetFeatureInfoDefaultParameters);v=e(y,v),n("layers",r.layers),n("srs",r.tilingScheme instanceof u?"EPSG:3857":"EPSG:4326"),n("bbox","{westProjected},{southProjected},{eastProjected},{northProjected}"),n("width","{width}"),n("height","{height}"),h.query=s(f);var C,w=h.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");i(v)&&(i(v.query_layers)||(v.query_layers=r.layers),i(v.x)||(v.x="{i}"),i(v.y)||(v.y="{j}"),i(v.info_format)||(v.info_format="{format}"),g.query=s(v),C=g.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new d({url:w,pickFeaturesUrl:C,tilingScheme:t(r.tilingScheme,new a({ellipsoid:r.ellipsoid})),rectangle:r.rectangle,tileWidth:r.tileWidth,tileHeight:r.tileHeight,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,proxy:r.proxy,subdomains:r.subdomains,tileDiscardPolicy:r.tileDiscardPolicy,credit:r.credit,getFeatureInfoFormats:o,enablePickFeatures:r.enablePickFeatures})}function m(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}return r(p.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._tileProvider.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}}}),p.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},p.prototype.requestImage=function(e,t,i){return this._tileProvider.requestImage(e,t,i)},p.prototype.pickFeatures=function(e,t,i,r,n){return this._tileProvider.pickFeatures(e,t,i,r,n)},p.DefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),p.GetFeatureInfoDefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),p.DefaultGetFeatureInfoFormats=o([o(new h("json","application/json")),o(new h("xml","text/xml")),o(new h("text","text/html"))]),p}),i("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/isArray","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f){"use strict";function _(e){e=i(e,i.EMPTY_OBJECT),this._url=e.url,this._layer=e.layer,this._style=e.style,this._tileMatrixSetID=e.tileMatrixSetID,this._tileMatrixLabels=e.tileMatrixLabels,this._format=i(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new d({ellipsoid:e.ellipsoid}),this._tileWidth=i(e.tileWidth,256),this._tileHeight=i(e.tileHeight,256),this._minimumLevel=i(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=i(e.rectangle,this._tilingScheme.rectangle),this._readyPromise=m.resolve(!0);var n=this._tilingScheme.positionToTileXY(h.southwest(this._rectangle),this._minimumLevel),o=this._tilingScheme.positionToTileXY(h.northeast(this._rectangle),this._minimumLevel);(Math.abs(o.x-n.x)+1)*(Math.abs(o.y-n.y)+1);this._errorEvent=new a;var s=e.credit;this._credit="string"==typeof s?new t(s):s,this._subdomains=e.subdomains,l(this._subdomains)?this._subdomains=this._subdomains.slice():r(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function g(t,n,o,a){var s,l=t._tileMatrixLabels,h=r(l)?l[a]:a.toString(),d=t._subdomains;if(t._url.indexOf("{")>=0)s=t._url.replace("{style}",t._style).replace("{Style}",t._style).replace("{TileMatrixSet}",t._tileMatrixSetID).replace("{TileMatrix}",h).replace("{TileRow}",o.toString()).replace("{TileCol}",n.toString()).replace("{s}",d[(n+o+a)%d.length]);else{var m=new p(t._url),f=c(i(m.query,""));f=e(v,f),f.tilematrix=h,f.layer=t._layer,f.style=t._style,f.tilerow=o,f.tilecol=n,f.tilematrixset=t._tileMatrixSetID,f.format=t._format,m.query=u(f),s=m.toString()}var _=t._proxy;return r(_)&&(s=_.getURL(s)),s}var v=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),_.prototype.getTileCredits=function(e,t,i){},_.prototype.requestImage=function(e,t,i){var r=g(this,e,t,i);return f.loadImage(this,r)},_.prototype.pickFeatures=function(){},_}),function(){!function(e){var t=this||(0,eval)("this"),r=t.document,n=t.navigator,o=t.jQuery,a=t.JSON;!function(e){"function"==typeof i&&i.amd?i("ThirdParty/knockout-3.4.0",["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:t.ko={})}(function(i,s){function l(e,t){return(null===e||typeof e in _)&&e===t}function u(t,i){var r;return function(){r||(r=f.a.setTimeout(function(){r=e,t()},i))}}function c(e,t){var i;return function(){clearTimeout(i),i=f.a.setTimeout(e,t)}}function h(e,t){t&&t!==g?"beforeChange"===t?this.Kb(e):this.Ha(e,t):this.Lb(e)}function d(e,t){null!==t&&t.k&&t.k()}function p(e,t){var i=this.Hc,r=i[S];r.R||(this.lb&&this.Ma[t]?(i.Pb(t,e,this.Ma[t]),this.Ma[t]=null,--this.lb):r.r[t]||i.Pb(t,e,r.s?{ia:e}:i.uc(e)))}function m(e,t,i,r){f.d[e]={init:function(e,n,o,a,s){var l,u;return f.m(function(){var o=f.a.c(n()),a=!i!=!o,c=!u;(c||t||a!==l)&&(c&&f.va.Aa()&&(u=f.a.ua(f.f.childNodes(e),!0)),a?(c||f.f.da(e,f.a.ua(u)),f.eb(r?r(s,o):s,e)):f.f.xa(e),l=a)},null,{
i:e}),{controlsDescendantBindings:!0}}},f.h.ta[e]=!1,f.f.Z[e]=!0}var f="undefined"!=typeof i?i:{};f.b=function(e,t){for(var i=e.split("."),r=f,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},f.G=function(e,t,i){e[t]=i},f.version="3.4.0",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1},f.a=function(){function i(e,t){for(var i in e)e.hasOwnProperty(i)&&t(i,e[i])}function s(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function l(e,t){return e.__proto__=t,e}function u(e,t,i,r){var n=e[t].match(g)||[];f.a.q(i.match(g),function(e){f.a.pa(n,e,r)}),e[t]=n.join(" ")}var c={__proto__:[]}instanceof Array,h="function"==typeof Symbol,d={},p={};d[n&&/Firefox\/2/i.test(n.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],d.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),i(d,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)p[t[i]]=e});var m={propertychange:!0},_=r&&function(){for(var t=3,i=r.createElement("div"),n=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",n[0];);return 4<t?t:e}(),g=/\S+/g;return{cc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],q:function(e,t){for(var i=0,r=e.length;i<r;i++)t(e[i],i)},o:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Sb:function(e,t,i){for(var r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r))return e[r];return null},La:function(e,t){var i=f.a.o(e,t);0<i?e.splice(i,1):0===i&&e.shift()},Tb:function(e){e=e||[];for(var t=[],i=0,r=e.length;i<r;i++)0>f.a.o(t,e[i])&&t.push(e[i]);return t},fb:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)i.push(t(e[r],r));return i},Ka:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)t(e[r],r)&&i.push(e[r]);return i},ra:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},pa:function(e,t,i){var r=f.a.o(f.a.zb(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},ka:c,extend:s,Xa:l,Ya:c?l:s,D:i,Ca:function(e,t){if(!e)return e;var i,r={};for(i in e)e.hasOwnProperty(i)&&(r[i]=t(e[i],i,e));return r},ob:function(e){for(;e.firstChild;)f.removeNode(e.firstChild)},jc:function(e){e=f.a.V(e);for(var t=(e[0]&&e[0].ownerDocument||r).createElement("div"),i=0,n=e.length;i<n;i++)t.appendChild(f.$(e[i]));return t},ua:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var o=e[i].cloneNode(!0);n.push(t?f.$(o):o)}return n},da:function(e,t){if(f.a.ob(e),t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},qc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;o<a;o++)f.removeNode(i[o])}},za:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)e.push(i),i=i.nextSibling;e.push(r)}}return e},sc:function(e,t){7>_?e.setAttribute("selected",t):e.selected=t},$a:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},nd:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},Mc:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},nb:function(e){return f.a.Mc(e,e.ownerDocument.documentElement)},Qb:function(e){return!!f.a.Sb(e,f.a.nb)},A:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Wb:function(e){return f.onError?function(){try{return e.apply(this,arguments)}catch(e){throw f.onError&&f.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(f.a.Wb(e),t)},$b:function(e){setTimeout(function(){throw f.onError&&f.onError(e),e},0)},p:function(e,t,i){var r=f.a.Wb(i);if(i=_&&m[t],f.options.useOnlyNativeEvents||i||!o)if(i||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var n=function(t){r.call(e,t)},a="on"+t;e.attachEvent(a,n),f.a.F.oa(e,function(){e.detachEvent(a,n)})}else e.addEventListener(t,r,!1);else o(e).bind(t,r)},Da:function(e,i){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var n;if("input"===f.a.A(e)&&e.type&&"click"==i.toLowerCase()?(n=e.type,n="checkbox"==n||"radio"==n):n=!1,f.options.useOnlyNativeEvents||!o||n)if("function"==typeof r.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");n=r.createEvent(p[i]||"HTMLEvents"),n.initEvent(i,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(n)}else if(n&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+i)}else o(e).trigger(i)},c:function(e){return f.H(e)?e():e},zb:function(e){return f.H(e)?e.t():e},bb:function(e,t,i){var r;t&&("object"==typeof e.classList?(r=e.classList[i?"add":"remove"],f.a.q(t.match(g),function(t){r.call(e.classList,t)})):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,i):u(e,"className",t,i))},Za:function(t,i){var r=f.a.c(i);null!==r&&r!==e||(r="");var n=f.f.firstChild(t);!n||3!=n.nodeType||f.f.nextSibling(n)?f.f.da(t,[t.ownerDocument.createTextNode(r)]):n.data=r,f.a.Rc(t)},rc:function(e,t){if(e.name=t,7>=_)try{e.mergeAttributes(r.createElement("<input name='"+e.name+"'/>"),!1)}catch(e){}},Rc:function(e){9<=_&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Nc:function(e){if(_){var t=e.style.width;e.style.width=0,e.style.width=t}},hd:function(e,t){e=f.a.c(e),t=f.a.c(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},V:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Yb:function(e){return h?Symbol(e):e},rd:6===_,sd:7===_,C:_,ec:function(e,t){for(var i=f.a.V(e.getElementsByTagName("input")).concat(f.a.V(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=i.length-1;0<=o;o--)r(i[o])&&n.push(i[o]);return n},ed:function(e){return"string"==typeof e&&(e=f.a.$a(e))?a&&a.parse?a.parse(e):new Function("return "+e)():null},Eb:function(e,t,i){if(!a||!a.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return a.stringify(f.a.c(e),t,i)},fd:function(e,t,n){n=n||{};var o=n.params||{},a=n.includeFields||this.cc,s=e;if("object"==typeof e&&"form"===f.a.A(e))for(var s=e.action,l=a.length-1;0<=l;l--)for(var u=f.a.ec(e,a[l]),c=u.length-1;0<=c;c--)o[u[c].name]=u[c].value;t=f.a.c(t);var h=r.createElement("form");h.style.display="none",h.action=s,h.method="post";for(var d in t)e=r.createElement("input"),e.type="hidden",e.name=d,e.value=f.a.Eb(f.a.c(t[d])),h.appendChild(e);i(o,function(e,t){var i=r.createElement("input");i.type="hidden",i.name=e,i.value=t,h.appendChild(i)}),r.body.appendChild(h),n.submitter?n.submitter(h):h.submit(),setTimeout(function(){h.parentNode.removeChild(h)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.q),f.b("utils.arrayFirst",f.a.Sb),f.b("utils.arrayFilter",f.a.Ka),f.b("utils.arrayGetDistinctValues",f.a.Tb),f.b("utils.arrayIndexOf",f.a.o),f.b("utils.arrayMap",f.a.fb),f.b("utils.arrayPushAll",f.a.ra),f.b("utils.arrayRemoveItem",f.a.La),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.cc),f.b("utils.getFormFields",f.a.ec),f.b("utils.peekObservable",f.a.zb),f.b("utils.postJson",f.a.fd),f.b("utils.parseJson",f.a.ed),f.b("utils.registerEventHandler",f.a.p),f.b("utils.stringifyJson",f.a.Eb),f.b("utils.range",f.a.hd),f.b("utils.toggleDomNodeCssClass",f.a.bb),f.b("utils.triggerEvent",f.a.Da),f.b("utils.unwrapObservable",f.a.c),f.b("utils.objectForEach",f.a.D),f.b("utils.addOrRemoveItem",f.a.pa),f.b("utils.setTextContent",f.a.Za),f.b("unwrap",f.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var i=Array.prototype.slice.call(arguments,1);return function(){var r=i.slice(0);return r.push.apply(r,arguments),t.apply(e,r)}}),f.a.e=new function(){function t(t,o){var a=t[r];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[r]="ko"+i++,n[a]={}}return n[a]}var i=0,r="__ko__"+(new Date).getTime(),n={};return{get:function(i,r){var n=t(i,!1);return n===e?e:n[r]},set:function(i,r,n){n===e&&t(i,!1)===e||(t(i,!0)[r]=n)},clear:function(e){var t=e[r];return!!t&&(delete n[t],e[r]=null,!0)},I:function(){return i++ +r}}},f.b("utils.domData",f.a.e),f.b("utils.domData.clear",f.a.e.clear),f.a.F=new function(){function t(t,i){var n=f.a.e.get(t,r);return n===e&&i&&(n=[],f.a.e.set(t,r,n)),n}function i(e){var r=t(e,!1);if(r)for(var r=r.slice(0),n=0;n<r.length;n++)r[n](e);if(f.a.e.clear(e),f.a.F.cleanExternalData(e),a[e.nodeType])for(r=e.firstChild;e=r;)r=e.nextSibling,8===e.nodeType&&i(e)}var r=f.a.e.I(),n={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{oa:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},pc:function(i,n){var o=t(i,!1);o&&(f.a.La(o,n),0==o.length&&f.a.e.set(i,r,e))},$:function(e){if(n[e.nodeType]&&(i(e),a[e.nodeType])){var t=[];f.a.ra(t,e.getElementsByTagName("*"));for(var r=0,o=t.length;r<o;r++)i(t[r])}return e},removeNode:function(e){f.$(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){o&&"function"==typeof o.cleanData&&o.cleanData([e])}}},f.$=f.a.F.$,f.removeNode=f.a.F.removeNode,f.b("cleanNode",f.$),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.F),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.F.oa),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.F.pc),function(){var i=[0,"",""],n=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:n,tbody:n,tfoot:n,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},u=8>=f.a.C;f.a.ma=function(e,n){var a;if(o){if(o.parseHTML)a=o.parseHTML(e,n)||[];else if((a=o.clean([e],n))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=n)||(a=r);var c,s=a.parentWindow||a.defaultView||t,h=f.a.$a(e).toLowerCase(),d=a.createElement("div");for(c=(h=h.match(/^<([a-z]+)[ >]/))&&l[h[1]]||i,h=c[0],c="ignored<div>"+c[1]+e+c[2]+"</div>","function"==typeof s.innerShiv?d.appendChild(s.innerShiv(c)):(u&&a.appendChild(d),d.innerHTML=c,u&&d.parentNode.removeChild(d));h--;)d=d.lastChild;a=f.a.V(d.lastChild.childNodes)}return a},f.a.Cb=function(t,i){if(f.a.ob(t),i=f.a.c(i),null!==i&&i!==e)if("string"!=typeof i&&(i=i.toString()),o)o(t).html(i);else for(var r=f.a.ma(i,t.ownerDocument),n=0;n<r.length;n++)t.appendChild(r[n])}}(),f.b("utils.parseHtmlFragment",f.a.ma),f.b("utils.setHtml",f.a.Cb),f.M=function(){function t(e,i){if(e)if(8==e.nodeType){var r=f.M.lc(e.nodeValue);null!=r&&i.push({Lc:e,cd:r})}else if(1==e.nodeType)for(var r=0,n=e.childNodes,o=n.length;r<o;r++)t(n[r],i)}var i={};return{wb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return i[t]=e,"<!--[ko_memo:"+t+"]-->"},xc:function(t,r){var n=i[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,r||[]),!0}finally{delete i[t]}},yc:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;n<o;n++){var a=r[n].Lc,s=[a];i&&f.a.ra(s,i),f.M.xc(r[n].cd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},lc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),f.b("memoization",f.M),f.b("memoization.memoize",f.M.wb),f.b("memoization.unmemoize",f.M.xc),f.b("memoization.parseMemoText",f.M.lc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.M.yc),f.Y=function(){function e(){if(o)for(var e,t=o,i=0;s<o;)if(e=n[s++]){if(s>t){if(5e3<=++i){s=o,f.a.$b(Error("'Too much recursion' after processing "+i+" task groups."));break}t=o}try{e()}catch(e){f.a.$b(e)}}}function i(){e(),s=o=n.length=0}var n=[],o=0,a=1,s=0;return{scheduler:t.MutationObserver?function(e){var t=r.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(i):r&&"onreadystatechange"in r.createElement("script")?function(e){var t=r.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,r.documentElement.removeChild(t),t=null,e()},r.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},Wa:function(e){return o||f.Y.scheduler(i),n[o++]=e,a++},cancel:function(e){e-=a-o,e>=s&&e<o&&(n[e]=null)},resetForTesting:function(){var e=o-s;return s=o=n.length=0,e},md:e}}(),f.b("tasks",f.Y),f.b("tasks.schedule",f.Y.Wa),f.b("tasks.runEarly",f.Y.md),f.ya={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return f.B({read:e,write:function(r){clearTimeout(i),i=f.a.setTimeout(function(){e(r)},t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),e.cb=!1,n="notifyWhenChangesStop"==r?c:u,e.Ta(function(e){return n(e,i)})},deferred:function(t,i){if(!0!==i)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.cb||(t.cb=!0,t.Ta(function(i){var r;return function(){f.Y.cancel(r),r=f.Y.Wa(i),t.notifySubscribers(e,"dirty")}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var _={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.ya),f.vc=function(e,t,i){this.ia=e,this.gb=t,this.Kc=i,this.R=!1,f.G(this,"dispose",this.k)},f.vc.prototype.k=function(){this.R=!0,this.Kc()},f.J=function(){f.a.Ya(this,v),v.rb(this)};var g="change",v={rb:function(e){e.K={},e.Nb=1},X:function(e,t,i){var r=this;i=i||g;var n=new f.vc(r,t?e.bind(t):e,function(){f.a.La(r.K[i],n),r.Ia&&r.Ia(i)});return r.sa&&r.sa(i),r.K[i]||(r.K[i]=[]),r.K[i].push(n),n},notifySubscribers:function(e,t){if(t=t||g,t===g&&this.zc(),this.Pa(t))try{f.l.Ub();for(var i,r=this.K[t].slice(0),n=0;i=r[n];++n)i.R||i.gb(e)}finally{f.l.end()}},Na:function(){return this.Nb},Uc:function(e){return this.Na()!==e},zc:function(){++this.Nb},Ta:function(e){var t,i,r,n=this,o=f.H(n);n.Ha||(n.Ha=n.notifySubscribers,n.notifySubscribers=h);var a=e(function(){n.Mb=!1,o&&r===n&&(r=n()),t=!1,n.tb(i,r)&&n.Ha(i=r)});n.Lb=function(e){n.Mb=t=!0,r=e,a()},n.Kb=function(e){t||(i=e,n.Ha(e,"beforeChange"))}},Pa:function(e){return this.K[e]&&this.K[e].length},Sc:function(e){if(e)return this.K[e]&&this.K[e].length||0;var t=0;return f.a.D(this.K,function(e,i){"dirty"!==e&&(t+=i.length)}),t},tb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&f.a.D(e,function(e,i){var r=f.ya[e];"function"==typeof r&&(t=r(t,i)||t)}),t}};f.G(v,"subscribe",v.X),f.G(v,"extend",v.extend),f.G(v,"getSubscriptionsCount",v.Sc),f.a.ka&&f.a.Xa(v,Function.prototype),f.J.fn=v,f.hc=function(e){return null!=e&&"function"==typeof e.X&&"function"==typeof e.notifySubscribers},f.b("subscribable",f.J),f.b("isSubscribable",f.hc),f.va=f.l=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{Ub:e,end:t,oc:function(e){if(i){if(!f.hc(e))throw Error("Only subscribable things can act as dependencies");i.gb.call(i.Gc,e,e.Cc||(e.Cc=++n))}},w:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},Aa:function(){if(i)return i.m.Aa()},Sa:function(){if(i)return i.Sa}}}(),f.b("computedContext",f.va),f.b("computedContext.getDependenciesCount",f.va.Aa),f.b("computedContext.isInitial",f.va.Sa),f.b("ignoreDependencies",f.qd=f.l.w);var y=f.a.Yb("_latestValue");f.N=function(e){function t(){return 0<arguments.length?(t.tb(t[y],arguments[0])&&(t.ga(),t[y]=arguments[0],t.fa()),this):(f.l.oc(t),t[y])}return t[y]=e,f.a.ka||f.a.extend(t,f.J.fn),f.J.fn.rb(t),f.a.Ya(t,C),f.options.deferUpdates&&f.ya.deferred(t,!0),t};var C={equalityComparer:l,t:function(){return this[y]},fa:function(){this.notifySubscribers(this[y])},ga:function(){this.notifySubscribers(this[y],"beforeChange")}};f.a.ka&&f.a.Xa(C,f.J.fn);var w=f.N.gd="__ko_proto__";C[w]=f.N,f.Oa=function(t,i){return null!==t&&t!==e&&t[w]!==e&&(t[w]===i||f.Oa(t[w],i))},f.H=function(e){return f.Oa(e,f.N)},f.Ba=function(e){return!!("function"==typeof e&&e[w]===f.N||"function"==typeof e&&e[w]===f.B&&e.Vc)},f.b("observable",f.N),f.b("isObservable",f.H),f.b("isWriteableObservable",f.Ba),f.b("isWritableObservable",f.Ba),f.b("observable.fn",C),f.G(C,"peek",C.t),f.G(C,"valueHasMutated",C.fa),f.G(C,"valueWillMutate",C.ga),f.la=function(e){if(e=e||[],"object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=f.N(e),f.a.Ya(e,f.la.fn),e.extend({trackArrayChanges:!0})},f.la.fn={remove:function(e){for(var t=this.t(),i=[],r="function"!=typeof e||f.H(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];r(o)&&(0===i.length&&this.ga(),i.push(o),t.splice(n,1),n--)}return i.length&&this.fa(),i},removeAll:function(t){if(t===e){var i=this.t(),r=i.slice(0);return this.ga(),i.splice(0,i.length),this.fa(),r}return t?this.remove(function(e){return 0<=f.a.o(t,e)}):[]},destroy:function(e){var t=this.t(),i="function"!=typeof e||f.H(e)?function(t){return t===e}:e;this.ga();for(var r=t.length-1;0<=r;r--)i(t[r])&&(t[r]._destroy=!0);this.fa()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=f.a.o(t,e)}):[]},indexOf:function(e){var t=this();return f.a.o(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ga(),this.t()[i]=t,this.fa())}},f.a.ka&&f.a.Xa(f.la.fn,f.N.fn),f.a.q("pop push reverse shift sort splice unshift".split(" "),function(e){f.la.fn[e]=function(){var t=this.t();this.ga(),this.Vb(t,e,arguments);var i=t[e].apply(t,arguments);return this.fa(),i===t?this:i}}),f.a.q(["slice"],function(e){f.la.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),f.b("observableArray",f.la),f.ya.trackArrayChanges=function(e,t){function i(){if(!n){n=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,i){return i&&i!==g||++a,t.apply(this,arguments)};var i=[].concat(e.t()||[]);o=null,r=e.X(function(t){if(t=[].concat(t||[]),e.Pa("arrayChange")){var r;(!o||1<a)&&(o=f.a.ib(i,t,e.hb)),r=o}i=t,o=null,a=0,r&&r.length&&e.notifySubscribers(r,"arrayChange")})}}if(e.hb={},t&&"object"==typeof t&&f.a.extend(e.hb,t),e.hb.sparse=!0,!e.Vb){var r,n=!1,o=null,a=0,s=e.sa,l=e.Ia;e.sa=function(t){s&&s.call(e,t),"arrayChange"===t&&i()},e.Ia=function(t){l&&l.call(e,t),"arrayChange"!==t||e.Pa("arrayChange")||(r.k(),n=!1)},e.Vb=function(e,t,i){function r(e,t,i){return s[s.length]={status:e,value:t,index:i}}if(n&&!a){var s=[],l=e.length,u=i.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;t<u;t++)r("added",i[t],c+t);break;case"pop":c=l-1;case"shift":l&&r("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>i[0]?l+i[0]:i[0]),l);for(var l=1===u?l:Math.min(t+(i[1]||0),l),u=t+u-2,c=Math.max(l,u),h=[],d=[],p=2;t<c;++t,++p)t<l&&d.push(r("deleted",e[t],t)),t<u&&h.push(r("added",i[p],t));f.a.dc(d,h);break;default:return}o=s}}}};var S=f.a.Yb("_state");f.m=f.B=function(t,i,r){function n(){if(0<arguments.length){if("function"!=typeof o)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return o.apply(a.pb,arguments),this}return f.l.oc(n),(a.S||a.s&&n.Qa())&&n.aa(),a.T}if("object"==typeof t?r=t:(r=r||{},t&&(r.read=t)),"function"!=typeof r.read)throw Error("Pass a function that returns the value of the ko.computed");var o=r.write,a={T:e,S:!0,Ra:!1,Fb:!1,R:!1,Va:!1,s:!1,jd:r.read,pb:i||r.owner,i:r.disposeWhenNodeIsRemoved||r.i||null,wa:r.disposeWhen||r.wa,mb:null,r:{},L:0,bc:null};return n[S]=a,n.Vc="function"==typeof o,f.a.ka||f.a.extend(n,f.J.fn),f.J.fn.rb(n),f.a.Ya(n,E),r.pure?(a.Va=!0,a.s=!0,f.a.extend(n,b)):r.deferEvaluation&&f.a.extend(n,T),f.options.deferUpdates&&f.ya.deferred(n,!0),a.i&&(a.Fb=!0,a.i.nodeType||(a.i=null)),a.s||r.deferEvaluation||n.aa(),a.i&&n.ba()&&f.a.F.oa(a.i,a.mb=function(){n.k()}),n};var E={equalityComparer:l,Aa:function(){return this[S].L},Pb:function(e,t,i){if(this[S].Va&&t===this)throw Error("A 'pure' computed must not be called recursively");this[S].r[e]=i,i.Ga=this[S].L++,i.na=t.Na()},Qa:function(){var e,t,i=this[S].r;for(e in i)if(i.hasOwnProperty(e)&&(t=i[e],t.ia.Uc(t.na)))return!0},bd:function(){this.Fa&&!this[S].Ra&&this.Fa()},ba:function(){return this[S].S||0<this[S].L},ld:function(){this.Mb||this.ac()},uc:function(e){if(e.cb&&!this[S].i){var t=e.X(this.bd,this,"dirty"),i=e.X(this.ld,this);return{ia:e,k:function(){t.k(),i.k()}}}return e.X(this.ac,this)},ac:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[S].bc),this[S].bc=f.a.setTimeout(function(){e.aa(!0)},t)):e.Fa?e.Fa():e.aa(!0)},aa:function(e){var t=this[S],i=t.wa;if(!t.Ra&&!t.R){if(t.i&&!f.a.nb(t.i)||i&&i()){if(!t.Fb)return void this.k()}else t.Fb=!1;t.Ra=!0;try{this.Qc(e)}finally{t.Ra=!1}t.L||this.k()}},Qc:function(t){var i=this[S],r=i.Va?e:!i.L,n={Hc:this,Ma:i.r,lb:i.L};f.l.Ub({Gc:n,gb:p,m:this,Sa:r}),i.r={},i.L=0,n=this.Pc(i,n),this.tb(i.T,n)&&(i.s||this.notifySubscribers(i.T,"beforeChange"),i.T=n,i.s?this.zc():t&&this.notifySubscribers(i.T)),r&&this.notifySubscribers(i.T,"awake")},Pc:function(e,t){try{var i=e.jd;return e.pb?i.call(e.pb):i()}finally{f.l.end(),t.lb&&!e.s&&f.a.D(t.Ma,d),e.S=!1}},t:function(){var e=this[S];return(e.S&&!e.L||e.s&&this.Qa())&&this.aa(),e.T},Ta:function(e){f.J.fn.Ta.call(this,e),this.Fa=function(){this.Kb(this[S].T),this[S].S=!0,this.Lb(this)}},k:function(){var e=this[S];!e.s&&e.r&&f.a.D(e.r,function(e,t){t.k&&t.k()}),e.i&&e.mb&&f.a.F.pc(e.i,e.mb),e.r=null,e.L=0,e.R=!0,e.S=!1,e.s=!1,e.i=null}},b={sa:function(e){var t=this,i=t[S];if(!i.R&&i.s&&"change"==e){if(i.s=!1,i.S||t.Qa())i.r=null,i.L=0,i.S=!0,t.aa();else{var r=[];f.a.D(i.r,function(e,t){r[t.Ga]=e}),f.a.q(r,function(e,r){var n=i.r[e],o=t.uc(n.ia);o.Ga=r,o.na=n.na,i.r[e]=o})}i.R||t.notifySubscribers(i.T,"awake")}},Ia:function(t){var i=this[S];i.R||"change"!=t||this.Pa("change")||(f.a.D(i.r,function(e,t){t.k&&(i.r[e]={ia:t.ia,Ga:t.Ga,na:t.na},t.k())}),i.s=!0,this.notifySubscribers(e,"asleep"))},Na:function(){var e=this[S];return e.s&&(e.S||this.Qa())&&this.aa(),f.J.fn.Na.call(this)}},T={sa:function(e){"change"!=e&&"beforeChange"!=e||this.t()}};f.a.ka&&f.a.Xa(E,f.J.fn);var x=f.N.gd;f.m[x]=f.N,E[x]=f.m,f.Xc=function(e){return f.Oa(e,f.m)},f.Yc=function(e){return f.Oa(e,f.m)&&e[S]&&e[S].Va},f.b("computed",f.m),f.b("dependentObservable",f.m),f.b("isComputed",f.Xc),f.b("isPureComputed",f.Yc),f.b("computed.fn",E),f.G(E,"peek",E.t),f.G(E,"dispose",E.k),f.G(E,"isActive",E.ba),f.G(E,"getDependenciesCount",E.Aa),f.nc=function(e,t){return"function"==typeof e?f.m(e,t,{pure:!0}):(e=f.a.extend({},e),e.pure=!0,f.m(e,t))},f.b("pureComputed",f.nc),function(){function t(n,o,a){if(a=a||new r,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof RegExp||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),i(n,function(i){var r=o(n[i]);switch(typeof r){case"boolean":case"number":case"string":case"function":s[i]=r;break;case"object":case"undefined":var l=a.get(r);s[i]=l!==e?l:t(r,o,a)}}),s}function i(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}function r(){this.keys=[],this.Ib=[]}f.wc=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;f.H(e)&&10>t;t++)e=e();return e})},f.toJSON=function(e,t,i){return e=f.wc(e),f.a.Eb(e,t,i)},r.prototype={save:function(e,t){var i=f.a.o(this.keys,e);0<=i?this.Ib[i]=t:(this.keys.push(e),this.Ib.push(t))},get:function(t){return t=f.a.o(this.keys,t),0<=t?this.Ib[t]:e}}}(),f.b("toJS",f.wc),f.b("toJSON",f.toJSON),function(){f.j={u:function(t){switch(f.a.A(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?f.a.e.get(t,f.d.options.xb):7>=f.a.C?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?f.j.u(t.options[t.selectedIndex]):e;default:return t.value}},ha:function(t,i,r){switch(f.a.A(t)){case"option":switch(typeof i){case"string":f.a.e.set(t,f.d.options.xb,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i;break;default:f.a.e.set(t,f.d.options.xb,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:""}break;case"select":""!==i&&null!==i||(i=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if(n=f.j.u(t.options[a]),n==i||""==n&&i===e){o=a;break}(r||0<=o||i===e&&1<t.size)&&(t.selectedIndex=o);break;default:null!==i&&i!==e||(i=""),t.value=i}}}}(),f.b("selectExtensions",f.j),f.b("selectExtensions.readValue",f.j.u),f.b("selectExtensions.writeValue",f.j.ha),f.h=function(){function e(e){e=f.a.$a(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,i=[],a=e.match(r),s=[],l=0;if(a){a.push(",");for(var u,c=0;u=a[c];++c){var h=u.charCodeAt(0);if(44===h){if(0>=l){i.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===h){if(!l&&!t&&1===s.length){t=s.pop();continue}}else 47===h&&c&&1<u.length?(h=a[c-1].match(n))&&!o[h[0]]&&(e=e.substr(e.indexOf(u)+1),a=e.match(r),a.push(","),c=-1,u="/"):40===h||123===h||91===h?++l:41===h||125===h||93===h?--l:t||s.length||34!==h&&39!==h||(u=u.slice(1,-1));s.push(u)}}return i}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{ta:[],ea:a,yb:e,Ua:function(r,n){function o(e,r){var n;if(!c){var h=f.getBindingHandler(e);if(h&&h.preprocess&&!(r=h.preprocess(r,e,o)))return;(h=a[e])&&(n=r,0<=f.a.o(t,n)?n=!1:(h=n.match(i),n=null!==h&&(h[1]?"Object("+h[1]+")"+h[2]:n)),h=n),h&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(r="function(){return "+r+" }"),s.push("'"+e+"':"+r)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,h="string"==typeof r?e(r):r;return f.a.q(h,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},ad:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},Ea:function(e,t,i,r,n){e&&f.H(e)?!f.Ba(e)||n&&e.t()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),f.b("expressionRewriting",f.h),f.b("expressionRewriting.bindingRewriteValidators",f.h.ta),f.b("expressionRewriting.parseObjectLiteral",f.h.yb),f.b("expressionRewriting.preProcessBindings",f.h.Ua),f.b("expressionRewriting._twoWayBindings",f.h.ea),f.b("jsonExpressionRewriting",f.h),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.h.Ua),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function i(i,r){for(var n=i,o=1,a=[];n=n.nextSibling;){if(t(n)&&(o--,0===o))return a;a.push(n),e(n)&&o++}if(!r)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function n(e,t){var r=i(e,t);return r?0<r.length?r[r.length-1].nextSibling:e.nextSibling:null}var o=r&&"<!--test-->"===r.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};f.f={Z:{},childNodes:function(t){return e(t)?i(t):t.childNodes},xa:function(t){if(e(t)){t=f.f.childNodes(t);for(var i=0,r=t.length;i<r;i++)f.removeNode(t[i])}else f.a.ob(t)},da:function(t,i){if(e(t)){f.f.xa(t);for(var r=t.nextSibling,n=0,o=i.length;n<o;n++)r.parentNode.insertBefore(i[n],r)}else f.a.da(t,i)},mc:function(t,i){e(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},gc:function(t,i,r){r?e(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):f.f.mc(t,i)},firstChild:function(i){return e(i)?!i.nextSibling||t(i.nextSibling)?null:i.nextSibling:i.firstChild},nextSibling:function(i){return e(i)&&(i=n(i)),i.nextSibling&&t(i.nextSibling)?null:i.nextSibling},Tc:e,pd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},kc:function(i){if(l[f.a.A(i)]){var r=i.firstChild;if(r)do if(1===r.nodeType){var o;o=r.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=n(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=r.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}while(r=r.nextSibling)}}}}(),f.b("virtualElements",f.f),f.b("virtualElements.allowedBindings",f.f.Z),f.b("virtualElements.emptyNode",f.f.xa),f.b("virtualElements.insertAfter",f.f.gc),f.b("virtualElements.prepend",f.f.mc),f.b("virtualElements.setDomNodeChildren",f.f.da),function(){f.Q=function(){this.Fc={}},f.a.extend(f.Q.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||f.g.getComponentNameForNode(e);case 8:return f.f.Tc(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return f.g.Ob(i,e,t,!1)},getBindingAccessors:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return f.g.Ob(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return f.f.pd(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.Fc,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+f.h.Ua(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),f.Q.instance=new f.Q}(),f.b("bindingProvider",f.Q),function(){function i(e){return function(){return e}}function r(e){return e()}function n(e){return f.a.Ca(f.l.w(e),function(t,i){return function(){return e()[i]}})}function a(e,t,r){return"function"==typeof e?n(e.bind(null,t,r)):f.a.Ca(e,i)}function s(e,t){return n(this.getBindings.bind(this,e,t))}function l(e,t,i){var r,n=f.f.firstChild(t),o=f.Q.instance,a=o.preprocessNode;if(a){for(;r=n;)n=f.f.nextSibling(r),a.call(o,r);n=f.f.firstChild(t)}for(;r=n;)n=f.f.nextSibling(r),u(e,r,i)}function u(e,t,i){var r=!0,n=1===t.nodeType;n&&f.f.kc(t),(n&&i||f.Q.instance.nodeHasBindings(t))&&(r=h(t,null,e,i).shouldBindDescendants),r&&!p[f.a.A(t)]&&l(e,t,!n)}function c(e){var t=[],i={},r=[];return f.a.D(e,function n(o){if(!i[o]){var a=f.getBindingHandler(o);a&&(a.after&&(r.push(o),f.a.q(a.after,function(t){if(e[t]){if(-1!==f.a.o(r,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+r.join(", "));n(t)}}),r.length--),t.push({key:o,fc:a})),i[o]=!0}}),t}function h(t,i,n,o){var a=f.a.e.get(t,m);if(!i){if(a)throw Error("You cannot apply bindings multiple times to the same element.");f.a.e.set(t,m,!0)}!a&&o&&f.tc(t,n);var l;if(i&&"function"!=typeof i)l=i;else{var u=f.Q.instance,h=u.getBindingAccessors||s,d=f.B(function(){return(l=i?i(n,t):h.call(u,t,n))&&n.P&&n.P(),l},null,{i:t});l&&d.ba()||(d=null)}var p;if(l){var _=d?function(e){return function(){return r(d()[e])}}:function(e){return l[e]},g=function(){return f.a.Ca(d?d():l,r)};g.get=function(e){return l[e]&&r(_(e));
},g.has=function(e){return e in l},o=c(l),f.a.q(o,function(i){var r=i.fc.init,o=i.fc.update,a=i.key;if(8===t.nodeType&&!f.f.Z[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof r&&f.l.w(function(){var i=r(t,_(a),g,n.$data,n);if(i&&i.controlsDescendantBindings){if(p!==e)throw Error("Multiple bindings ("+p+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");p=a}}),"function"==typeof o&&f.B(function(){o(t,_(a),g,n.$data,n)},null,{i:t})}catch(e){throw e.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+e.message,e}})}return{shouldBindDescendants:p===e}}function d(e){return e&&e instanceof f.U?e:new f.U(e)}f.d={};var p={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(e){return f.d[e]},f.U=function(t,i,r,n){var o,a=this,s="function"==typeof t&&!f.H(t),l=f.B(function(){var e=s?t():t,o=f.a.c(e);return i?(i.P&&i.P(),f.a.extend(a,i),l&&(a.P=l)):(a.$parents=[],a.$root=o,a.ko=f),a.$rawData=e,a.$data=o,r&&(a[r]=o),n&&n(a,i,o),a.$data},null,{wa:function(){return o&&!f.a.Qb(o)},i:!0});l.ba()&&(a.P=l,l.equalityComparer=null,o=[],l.Ac=function(t){o.push(t),f.a.F.oa(t,function(t){f.a.La(o,t),o.length||(l.k(),a.P=l=e)})})},f.U.prototype.createChildContext=function(e,t,i){return new f.U(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),i&&i(e)})},f.U.prototype.extend=function(e){return new f.U(this.P||this.$data,this,null,function(t,i){t.$rawData=i.$rawData,f.a.extend(t,"function"==typeof e?e():e)})};var m=f.a.e.I(),_=f.a.e.I();f.tc=function(e,t){return 2!=arguments.length?f.a.e.get(e,_):(f.a.e.set(e,_,t),void(t.P&&t.P.Ac(e)))},f.Ja=function(e,t,i){return 1===e.nodeType&&f.f.kc(e),h(e,t,d(i),!0)},f.Dc=function(e,t,i){return i=d(i),f.Ja(e,a(t,i,e),i)},f.eb=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(d(e),t,!0)},f.Rb=function(e,i){if(!o&&t.jQuery&&(o=t.jQuery),i&&1!==i.nodeType&&8!==i.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");i=i||t.document.body,u(d(e),i,!0)},f.kb=function(t){switch(t.nodeType){case 1:case 8:var i=f.tc(t);if(i)return i;if(t.parentNode)return f.kb(t.parentNode)}return e},f.Jc=function(t){return(t=f.kb(t))?t.$data:e},f.b("bindingHandlers",f.d),f.b("applyBindings",f.Rb),f.b("applyBindingsToDescendants",f.eb),f.b("applyBindingAccessorsToNode",f.Ja),f.b("applyBindingsToNode",f.Dc),f.b("contextFor",f.kb),f.b("dataFor",f.Jc)}(),function(e){function t(t,r){var a,s=n.hasOwnProperty(t)?n[t]:e;s?s.X(r):(s=n[t]=new f.J,s.X(r),i(t,function(e,i){var r=!(!i||!i.synchronous);o[t]={definition:e,Zc:r},delete n[t],a||r?s.notifySubscribers(e):f.Y.Wa(function(){s.notifySubscribers(e)})}),a=!0)}function i(e,t){r("getConfig",[e],function(i){i?r("loadComponent",[e,i],function(e){t(e,i)}):t(null,null)})}function r(t,i,n,o){o||(o=f.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,i.concat(function(e){l?n(null):null!==e?n(e):r(t,i,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(t,i,n,o)}else n(null)}var n={},o={};f.g={get:function(i,r){var n=o.hasOwnProperty(i)?o[i]:e;n?n.Zc?f.l.w(function(){r(n.definition)}):f.Y.Wa(function(){r(n.definition)}):t(i,r)},Xb:function(e){delete o[e]},Jb:r},f.g.loaders=[],f.b("components",f.g),f.b("components.get",f.g.get),f.b("components.clearCachedDefinition",f.g.Xb)}(),function(){function e(e,t,i,r){function n(){0===--s&&r(o)}var o={},s=2,l=i.template;i=i.viewModel,l?a(t,l,function(t){f.g.Jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),i?a(t,i,function(t){f.g.Jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function i(e,t,r){if("function"==typeof t)r(function(e){return new t(e)});else if("function"==typeof t[c])r(t[c]);else if("instance"in t){var n=t.instance;r(function(){return n})}else"viewModel"in t?i(e,t.viewModel,r):e("Unknown viewModel value: "+t)}function n(e){switch(f.a.A(e)){case"script":return f.a.ma(e.text);case"textarea":return f.a.ma(e.value);case"template":if(o(e.content))return f.a.ua(e.content.childNodes)}return f.a.ua(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,i,r){"string"==typeof i.require?s||t.require?(s||t.require)([i.require],r):e("Uses require, but no AMD loader is present"):r(i)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};f.g.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(f.g.ub(e))throw Error("Component "+e+" is already registered");u[e]=t},f.g.ub=function(e){return u.hasOwnProperty(e)},f.g.od=function(e){delete u[e],f.g.Xb(e)},f.g.Zb={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,i,r){var n=l(t);a(n,i,function(i){e(t,n,i,r)})},loadTemplate:function(e,i,a){if(e=l(e),"string"==typeof i)a(f.a.ma(i));else if(i instanceof Array)a(i);else if(o(i))a(f.a.V(i.childNodes));else if(i.element)if(i=i.element,t.HTMLElement?i instanceof HTMLElement:i&&i.tagName&&1===i.nodeType)a(n(i));else if("string"==typeof i){var s=r.getElementById(i);s?a(n(s)):e("Cannot find element with ID "+i)}else e("Unknown element type: "+i);else e("Unknown template value: "+i)},loadViewModel:function(e,t,r){i(l(e),t,r)}};var c="createViewModel";f.b("components.register",f.g.register),f.b("components.isRegistered",f.g.ub),f.b("components.unregister",f.g.od),f.b("components.defaultLoader",f.g.Zb),f.g.loaders.push(f.g.Zb),f.g.Bc=u}(),function(){function e(e,i){var r=e.getAttribute("params");if(r){var r=t.parseBindingsString(r,i,e,{valueAccessors:!0,bindingParams:!0}),r=f.a.Ca(r,function(t){return f.m(t,null,{i:e})}),n=f.a.Ca(r,function(t){var i=t.t();return t.ba()?f.m({read:function(){return f.a.c(t())},write:f.Ba(i)&&function(e){t()(e)},i:e}):i});return n.hasOwnProperty("$raw")||(n.$raw=r),n}return{$raw:{}}}f.g.getComponentNameForNode=function(e){var t=f.a.A(e);if(f.g.ub(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=f.a.C&&e.tagName===t))return t},f.g.Ob=function(t,i,r,n){if(1===i.nodeType){var o=f.g.getComponentNameForNode(i);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(i,r)};t.component=n?function(){return a}:a}}return t};var t=new f.Q;9>f.a.C&&(f.g.register=function(e){return function(t){return r.createElement(t),e.apply(this,arguments)}}(f.g.register),r.createDocumentFragment=function(e){return function(){var t,i=e(),r=f.g.Bc;for(t in r)r.hasOwnProperty(t)&&i.createElement(t);return i}}(r.createDocumentFragment))}(),function(e){function t(e,t,i){if(t=t.template,!t)throw Error("Component '"+e+"' has no template");e=f.a.ua(t),f.f.da(i,e)}function i(e,t,i,r){var n=e.createViewModel;return n?n.call(e,r,{element:t,templateNodes:i}):r}var r=0;f.d.component={init:function(n,o,a,s,l){function u(){var e=c&&c.dispose;"function"==typeof e&&e.call(c),h=c=null}var c,h,d=f.a.V(f.f.childNodes(n));return f.a.F.oa(n,u),f.m(function(){var a,s,p=f.a.c(o());if("string"==typeof p?a=p:(a=f.a.c(p.name),s=f.a.c(p.params)),!a)throw Error("No component name specified");var m=h=++r;f.g.get(a,function(r){if(h===m){if(u(),!r)throw Error("Unknown component '"+a+"'");t(a,r,n);var o=i(r,n,d,s);r=l.createChildContext(o,e,function(e){e.$component=o,e.$componentTemplateNodes=d}),c=o,f.eb(r,n)}})},null,{i:n}),{controlsDescendantBindings:!0}}},f.f.Z.component=!0}();var A={class:"className",for:"htmlFor"};f.d.attr={update:function(t,i){var r=f.a.c(i())||{};f.a.D(r,function(i,r){r=f.a.c(r);var n=!1===r||null===r||r===e;n&&t.removeAttribute(i),8>=f.a.C&&i in A?(i=A[i],n?t.removeAttribute(i):t[i]=r):n||t.setAttribute(i,r.toString()),"name"===i&&f.a.rc(t,n?"":r.toString())})}},function(){f.d.checked={after:["value","attr"],init:function(t,i,r){function n(){var e=t.checked,n=p?a():e;if(!f.va.Sa()&&(!l||e)){var o=f.l.w(i);if(c){var s=h?o.t():o;d!==n?(e&&(f.a.pa(s,n,!0),f.a.pa(s,d,!1)),d=n):f.a.pa(s,n,e),h&&f.Ba(o)&&o(s)}else f.h.Ea(o,r,"checked",n,!0)}}function o(){var e=f.a.c(i());t.checked=c?0<=f.a.o(e,a()):s?e:a()===e}var a=f.nc(function(){return r.has("checkedValue")?f.a.c(r.get("checkedValue")):r.has("value")?f.a.c(r.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=i(),c=s&&f.a.c(u)instanceof Array,h=!(c&&u.push&&u.splice),d=c?a():e,p=l||c;l&&!t.name&&f.d.uniqueName.init(t,function(){return!0}),f.m(n,null,{i:t}),f.a.p(t,"click",n),f.m(o,null,{i:t}),u=e}}},f.h.ea.checked=!0,f.d.checkedValue={update:function(e,t){e.value=f.a.c(t())}}}(),f.d.css={update:function(e,t){var i=f.a.c(t());null!==i&&"object"==typeof i?f.a.D(i,function(t,i){i=f.a.c(i),f.a.bb(e,t,i)}):(i=f.a.$a(String(i||"")),f.a.bb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,f.a.bb(e,i,!0))}},f.d.enable={update:function(e,t){var i=f.a.c(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},f.d.disable={update:function(e,t){f.d.enable.update(e,function(){return!f.a.c(t())})}},f.d.event={init:function(e,t,i,r,n){var o=t()||{};f.a.D(o,function(o){"string"==typeof o&&f.a.p(e,o,function(e){var a,s=t()[o];if(s){try{var l=f.a.V(arguments);r=n.$data,l.unshift(r),a=s.apply(r,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},f.d.foreach={ic:function(e){return function(){var t=e(),i=f.a.zb(t);return i&&"number"!=typeof i.length?(f.a.c(t),{foreach:i.data,as:i.as,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:f.W.sb}):{foreach:t,templateEngine:f.W.sb}}},init:function(e,t){return f.d.template.init(e,f.d.foreach.ic(t))},update:function(e,t,i,r,n){return f.d.template.update(e,f.d.foreach.ic(t),i,r,n)}},f.h.ta.foreach=!1,f.f.Z.foreach=!0,f.d.hasfocus={init:function(e,t,i){function r(r){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(e){o=n.body}r=o===e}n=t(),f.h.Ea(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);f.a.p(e,"focus",n),f.a.p(e,"focusin",n),f.a.p(e,"blur",o),f.a.p(e,"focusout",o)},update:function(e,t){var i=!!f.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),f.l.w(f.a.Da,null,[e,i?"focusin":"focusout"]))}},f.h.ea.hasfocus=!0,f.d.hasFocus=f.d.hasfocus,f.h.ea.hasFocus=!0,f.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){f.a.Cb(e,t())}},m("if"),m("ifnot",!1,!0),m("with",!0,!1,function(e,t){return e.createChildContext(t)});var P={};f.d.options={init:function(e){if("select"!==f.a.A(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function n(){return f.a.Ka(t.options,function(e){return e.selected})}function o(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function a(e,i){if(m&&c)f.j.ha(t,f.a.c(r.get("value")),!0);else if(p.length){var n=0<=f.a.o(p,f.j.u(i[0]));f.a.sc(i[0],n),m&&!n&&f.l.w(f.a.Da,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=f.a.c(i()),c=r.get("valueAllowUnset")&&r.has("value"),h=r.get("optionsIncludeDestroyed");i={};var d,p=[];c||(s?p=f.a.fb(n(),f.j.u):0<=t.selectedIndex&&p.push(f.j.u(t.options[t.selectedIndex]))),u&&("undefined"==typeof u.length&&(u=[u]),d=f.a.Ka(u,function(t){return h||t===e||null===t||!f.a.c(t._destroy)}),r.has("optionsCaption")&&(u=f.a.c(r.get("optionsCaption")),null!==u&&u!==e&&d.unshift(P)));var m=!1;i.beforeRemove=function(e){t.removeChild(e)},u=a,r.has("optionsAfterRender")&&"function"==typeof r.get("optionsAfterRender")&&(u=function(t,i){a(0,i),f.l.w(r.get("optionsAfterRender"),null,[i[0],t!==P?t:e])}),f.a.Bb(t,d,function(i,n,a){return a.length&&(p=!c&&a[0].selected?[f.j.u(a[0])]:[],m=!0),n=t.ownerDocument.createElement("option"),i===P?(f.a.Za(n,r.get("optionsCaption")),f.j.ha(n,e)):(a=o(i,r.get("optionsValue"),i),f.j.ha(n,f.a.c(a)),i=o(i,r.get("optionsText"),a),f.a.Za(n,i)),[n]},i,u),f.l.w(function(){c?f.j.ha(t,f.a.c(r.get("value")),!0):(s?p.length&&n().length<p.length:p.length&&0<=t.selectedIndex?f.j.u(t.options[t.selectedIndex])!==p[0]:p.length||0<=t.selectedIndex)&&f.a.Da(t,"change")}),f.a.Nc(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},f.d.options.xb=f.a.e.I(),f.d.selectedOptions={after:["options","foreach"],init:function(e,t,i){f.a.p(e,"change",function(){var r=t(),n=[];f.a.q(e.getElementsByTagName("option"),function(e){e.selected&&n.push(f.j.u(e))}),f.h.Ea(r,i,"selectedOptions",n)})},update:function(e,t){if("select"!=f.a.A(e))throw Error("values binding applies only to SELECT elements");var i=f.a.c(t()),r=e.scrollTop;i&&"number"==typeof i.length&&f.a.q(e.getElementsByTagName("option"),function(e){var t=0<=f.a.o(i,f.j.u(e));e.selected!=t&&f.a.sc(e,t)}),e.scrollTop=r}},f.h.ea.selectedOptions=!0,f.d.style={update:function(t,i){var r=f.a.c(i()||{});f.a.D(r,function(i,r){r=f.a.c(r),null!==r&&r!==e&&!1!==r||(r=""),t.style[i]=r})}},f.d.submit={init:function(e,t,i,r,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");f.a.p(e,"submit",function(i){var r,o=t();try{r=o.call(n.$data,e)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}},f.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){f.a.Za(e,t())}},f.f.Z.text=!0,function(){if(t&&t.navigator)var i=function(e){if(e)return parseFloat(e[1])},r=t.opera&&t.opera.version&&parseInt(t.opera.version()),n=t.navigator.userAgent,o=i(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=i(n.match(/Firefox\/([^ ]*)/));if(10>f.a.C)var s=f.a.e.I(),l=f.a.e.I(),u=function(e){var t=this.activeElement;(t=t&&f.a.e.get(t,l))&&t(e)},c=function(e,t){var i=e.ownerDocument;f.a.e.get(i,s)||(f.a.e.set(i,s,!0),f.a.p(i,"selectionchange",u)),f.a.e.set(e,l,t)};f.d.textInput={init:function(t,i,n){function s(e,i){f.a.p(t,e,i)}function l(){var r=f.a.c(i());null!==r&&r!==e||(r=""),p!==e&&r===p?f.a.setTimeout(l,4):t.value!==r&&(m=r,t.value=r)}function u(){d||(p=t.value,d=f.a.setTimeout(h,4))}function h(){clearTimeout(d),p=d=e;var r=t.value;m!==r&&(m=r,f.h.Ea(i(),n,"textInput",r))}var d,p,m=t.value,_=9==f.a.C?u:h;10>f.a.C?(s("propertychange",function(e){"value"===e.propertyName&&_(e)}),8==f.a.C&&(s("keyup",h),s("keydown",h)),8<=f.a.C&&(c(t,_),s("dragend",u))):(s("input",h),5>o&&"textarea"===f.a.A(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>r?s("keydown",u):4>a&&(s("DOMAutoComplete",h),s("dragdrop",h),s("drop",h))),s("change",h),f.m(l,null,{i:t})}},f.h.ea.textInput=!0,f.d.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),f.d.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++f.d.uniqueName.Ic;f.a.rc(e,i)}}},f.d.uniqueName.Ic=0,f.d.value={after:["options","foreach"],init:function(e,t,i){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var r=["change"],n=i.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),f.a.ra(r,n),r=f.a.Tb(r));var s=function(){a=null,o=!1;var r=t(),n=f.j.u(e);f.h.Ea(r,i,"value",n)};!f.a.C||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=f.a.o(r,"propertychange")||(f.a.p(e,"propertychange",function(){o=!0}),f.a.p(e,"focus",function(){o=!1}),f.a.p(e,"blur",function(){o&&s()})),f.a.q(r,function(t){var i=s;f.a.nd(t,"after")&&(i=function(){a=f.j.u(e),f.a.setTimeout(s,0)},t=t.substring(5)),f.a.p(e,t,i)});var l=function(){var r=f.a.c(t()),n=f.j.u(e);if(null!==a&&r===a)f.a.setTimeout(l,0);else if(r!==n)if("select"===f.a.A(e)){var o=i.get("valueAllowUnset"),n=function(){f.j.ha(e,r,o)};n(),o||r===f.j.u(e)?f.a.setTimeout(n,0):f.l.w(f.a.Da,null,[e,"change"])}else f.j.ha(e,r)};f.m(l,null,{i:e})}else f.Ja(e,{checkedValue:t})},update:function(){}},f.h.ea.value=!0,f.d.visible={update:function(e,t){var i=f.a.c(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},function(e){f.d[e]={init:function(t,i,r,n,o){return f.d.event.init.call(this,t,function(){var t={};return t[e]=i(),t},r,n,o)}}}("click"),f.O=function(){},f.O.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.O.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.O.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||r;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new f.v.n(i)}if(1==e.nodeType||8==e.nodeType)return new f.v.qa(e);throw Error("Unknown template type: "+e)},f.O.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i,r)},f.O.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},f.O.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},f.b("templateEngine",f.O),f.Gb=function(){function e(e,t,i,r){e=f.h.yb(e);for(var n=f.h.ta,o=0;o<e.length;o++){var a=e[o].key;if(n.hasOwnProperty(a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.h.Ua(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Oc:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return f.Gb.dd(e,t)},i)},dd:function(r,n){return r.replace(t,function(t,i,r,o,a){return e(a,i,r,n)}).replace(i,function(t,i){return e(i,"<!-- ko -->","#comment",n)})},Ec:function(e,t){return f.M.wb(function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&f.Ja(n,e,r)})}}}(),f.b("__tr_ambtns",f.Gb.Ec),function(){f.v={},f.v.n=function(e){if(this.n=e){var t=f.a.A(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},f.v.n.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.n[e];var t=arguments[0];"innerHTML"===e?f.a.Cb(this.n,t):this.n[e]=t};var t=f.a.e.I()+"_";f.v.n.prototype.data=function(e){return 1===arguments.length?f.a.e.get(this.n,t+e):void f.a.e.set(this.n,t+e,arguments[1])};var i=f.a.e.I();f.v.n.prototype.nodes=function(){var t=this.n;return 0==arguments.length?(f.a.e.get(t,i)||{}).jb||(3===this.ab?t.content:4===this.ab?t:e):void f.a.e.set(t,i,{jb:arguments[0]})},f.v.qa=function(e){this.n=e},f.v.qa.prototype=new f.v.n,f.v.qa.prototype.text=function(){if(0==arguments.length){var t=f.a.e.get(this.n,i)||{};return t.Hb===e&&t.jb&&(t.Hb=t.jb.innerHTML),t.Hb}f.a.e.set(this.n,i,{Hb:arguments[0]})},f.b("templateSources",f.v),f.b("templateSources.domElement",f.v.n),f.b("templateSources.anonymousTemplate",f.v.qa)}(),function(){function t(e,t,i){var r;for(t=f.f.nextSibling(t);e&&(r=e)!==t;)e=f.f.nextSibling(r),i(r,e)}function i(e,i){if(e.length){var r=e[0],n=e[e.length-1],o=r.parentNode,a=f.Q.instance,s=a.preprocessNode;if(s){if(t(r,n,function(e,t){var i=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===n&&(n=o[o.length-1]||i))}),e.length=0,!r)return;r===n?e.push(r):(e.push(r,n),f.a.za(e,o))}t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||f.Rb(i,e)}),t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||f.M.yc(e,[i])}),f.a.za(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&r(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(f.Gb.Oc(n,u,l),n=u.renderTemplate(n,o,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":f.f.da(e,n),l=!0;break;case"replaceNode":f.a.qc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,o),s.afterRender&&f.l.w(s.afterRender,null,[n,o.$data])),n}function o(e,t,i){return f.H(e)?e():"function"==typeof e?e(t,i):e}var a;f.Db=function(t){if(t!=e&&!(t instanceof f.O))throw Error("templateEngine must inherit from ko.templateEngine");a=t},f.Ab=function(t,i,s,l,u){if(s=s||{},(s.templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(u=u||"replaceChildren",l){var c=r(l);return f.B(function(){var e=i&&i instanceof f.U?i:new f.U(f.a.c(i)),a=o(t,e.$data,e),e=n(l,u,a,e,s);"replaceNode"==u&&(l=e,c=r(l))},null,{wa:function(){return!c||!f.a.nb(c)},i:c&&"replaceNode"==u?c.parentNode:c})}return f.M.wb(function(e){f.Ab(t,i,s,e,"replaceNode")})},f.kd=function(t,r,a,s,l){function u(e,t){i(t,h),a.afterRender&&a.afterRender(t,e),h=null}function c(e,i){h=l.createChildContext(e,a.as,function(e){e.$index=i});var r=o(t,e,h);return n(null,"ignoreTargetNode",r,h,a)}var h;return f.B(function(){var t=f.a.c(r)||[];"undefined"==typeof t.length&&(t=[t]),t=f.a.Ka(t,function(t){return a.includeDestroyed||t===e||null===t||!f.a.c(t._destroy)}),f.l.w(f.a.Bb,null,[s,t,c,a,u])},null,{i:s})};var s=f.a.e.I();f.d.template={init:function(e,t){var i=f.a.c(t());if("string"==typeof i||i.name)f.f.xa(e);else{if("nodes"in i){if(i=i.nodes||[],f.H(i))throw Error('The "nodes" option must be a plain, non-observable array.')}else i=f.f.childNodes(e);i=f.a.jc(i),new f.v.qa(e).nodes(i)}return{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var a,l=i();i=f.a.c(l),r=!0,n=null,"string"==typeof i?i={}:(l=i.name,"if"in i&&(r=f.a.c(i.if)),r&&"ifnot"in i&&(r=!f.a.c(i.ifnot)),a=f.a.c(i.data)),"foreach"in i?n=f.kd(l||t,r&&i.foreach||[],i,t,o):r?(o="data"in i?o.createChildContext(a,i.as):o,n=f.Ab(l||t,o,i,t)):f.f.xa(t),o=n,(a=f.a.e.get(t,s))&&"function"==typeof a.k&&a.k(),f.a.e.set(t,s,o&&o.ba()?o:e)}},f.h.ta.template=function(e){return e=f.h.yb(e),1==e.length&&e[0].unknown||f.h.ad(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.f.Z.template=!0}(),f.b("setTemplateEngine",f.Db),f.b("renderTemplate",f.Ab),f.a.dc=function(e,t,i){if(e.length&&t.length){var r,n,o,a,s;for(r=n=0;(!i||r<i)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),r=o=0;break}r+=o}}},f.a.ib=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,h=Math.max,d=[],p=e.length,m=t.length,_=m-p||1,g=p+m+1;for(o=0;o<=p;o++)for(l=s,d.push(s=[]),u=c(m,o+_),a=h(0,o-1);a<=u;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||g,s[a-1]||g)+1:a+1:o+1;for(c=[],h=[],_=[],o=p,a=m;o||a;)m=d[o][a]-1,a&&m===d[o][a-1]?h.push(c[c.length]={status:i,value:t[--a],index:a}):o&&m===d[o-1][a]?_.push(c[c.length]={status:r,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return f.a.dc(_,h,!n.dontLimitMoves&&10*p),c.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<i.length?e(t,i,"added","deleted",r):e(i,t,"deleted","added",r)}}(),f.b("utils.compareArrays",f.a.ib),function(){function t(t,i,r,n,o){var a=[],s=f.B(function(){var e=i(r,o,f.a.za(a,t))||[];0<a.length&&(f.a.qc(a,e),n&&f.l.w(n,null,[r,e,o])),a.length=0,f.a.ra(a,e)},null,{i:t,wa:function(){return!f.a.Qb(a)}});return{ca:a,B:s.ba()?s:e}}var i=f.a.e.I(),r=f.a.e.I();f.a.Bb=function(n,o,a,s,l){function u(e,t){w=d[t],v!==t&&(b[e]=w),w.qb(v++),f.a.za(w.ca,n),_.push(w),C.push(w)}function c(e,t){if(e)for(var i=0,r=t.length;i<r;i++)t[i]&&f.a.q(t[i].ca,function(r){e(r,i,t[i].ja)})}o=o||[],s=s||{};var h=f.a.e.get(n,i)===e,d=f.a.e.get(n,i)||[],p=f.a.fb(d,function(e){return e.ja}),m=f.a.ib(p,o,s.dontLimitMoves),_=[],g=0,v=0,y=[],C=[];o=[];for(var w,S,E,b=[],p=[],T=0;S=m[T];T++)switch(E=S.moved,S.status){case"deleted":E===e&&(w=d[g],w.B&&(w.B.k(),w.B=e),f.a.za(w.ca,n).length&&(s.beforeRemove&&(_.push(w),C.push(w),w.ja===r?w=null:o[T]=w),w&&y.push.apply(y,w.ca))),g++;break;case"retained":u(T,g++);break;case"added":E!==e?u(T,E):(w={ja:S.value,qb:f.N(v++)},_.push(w),C.push(w),h||(p[T]=w))}f.a.e.set(n,i,_),c(s.beforeMove,b),f.a.q(y,s.beforeRemove?f.$:f.removeNode);for(var x,T=0,h=f.f.firstChild(n);w=C[T];T++){for(w.ca||f.a.extend(w,t(n,a,w.ja,l,w.qb)),g=0;m=w.ca[g];h=m.nextSibling,x=m,g++)m!==h&&f.f.gc(n,m,x);!w.Wc&&l&&(l(w.ja,w.ca,w.qb),w.Wc=!0)}for(c(s.beforeRemove,o),T=0;T<o.length;++T)o[T]&&(o[T].ja=r);c(s.afterMove,b),c(s.afterAdd,p)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.Bb),f.W=function(){this.allowTemplateRewriting=!1},f.W.prototype=new f.O,f.W.prototype.renderTemplateSource=function(e,t,i,r){return(t=(9>f.a.C?0:e.nodes)?e.nodes():null)?f.a.V(t.cloneNode(!0).childNodes):(e=e.text(),f.a.ma(e,r))},f.W.sb=new f.W,f.Db(f.W.sb),f.b("nativeTemplateEngine",f.W),function(){f.vb=function(){var e=this.$c=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,n,a){if(a=a||r,n=n||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=t.data("precompiled");return s||(s=t.text()||"",s=o.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[i.$data],i=o.extend({koBindingContext:i},n.templateOptions),i=o.tmpl(s,t,i),i.appendTo(a.createElement("div")),o.fragments={},i},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){r.write("<script type='text/html' id='"+e+"'>"+t+"</script>")},0<e&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.vb.prototype=new f.O;var e=new f.vb;0<e.$c&&f.Db(e),f.b("jqueryTmplTemplateEngine",f.vb)}()})}()}(),i("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,i){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,o=t(e,!0);return i=i||Object.getOwnPropertyNames(e),i.forEach(function(t){if(t!==h&&t!==d&&!(t in o)){var i=e[t],a=i instanceof Array,s=n.isObservable(i)?i:a?n.observableArray(i):n.observable(i);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&r(n,s)}}),e}function t(e,t){var i=e[h];return!i&&t&&(i={},Object.defineProperty(e,h,{value:i})),i}function i(t,i,r){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof r)o.read=r;else{if("value"in r)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof r.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=r.get,o.write=r.set}return t[i]=n.computed(o),e.call(n,t,[i]),t}function r(e,t){var i=null;e.computed(function(){i&&(i.dispose(),i=null);var r=t();r instanceof Array&&(i=n(e,t,r))})}function n(e,t,i){var r=o(e,i);return r.subscribe(t)}function o(e,t){var i=t[d];if(!i){i=new e.subscribable,Object.defineProperty(t,d,{value:i});var r={};a(t,i,r),s(e,t,i,r)}return i}function a(e,t,i){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(r){var n=e[r];e[r]=function(){var e=n.apply(this,arguments);return i.pause!==!0&&t.notifySubscribers(this),e}})}function s(e,t,i,r){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;r.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{r.pause=!1}return i.notifySubscribers(t),o}})})}function l(e,i){if(!e)return null;var r=t(e,!1);return r&&r[i]||null}function u(e,t){var i=l(e,t);i&&i.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=i}var h="__knockoutObservables",d="__knockoutSubscribable";return{attachToKo:c}}),i("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",i={register:function(i){i.bindingHandlers.cesiumSvgPath={init:function(r,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),i.virtualElements.setDomNodeChildren(r,[o]),i.computed({read:function(){var e=i.unwrap(n());a.setAttribute("d",i.unwrap(e.path));var r=i.unwrap(e.width),s=i.unwrap(e.height);o.setAttribute("width",r),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+r+" "+s),e.css&&o.setAttribute("class",t+" "+i.unwrap(e.css))},disposeWhenNodeIsRemoved:r}),{controlsDescendantBindings:!0}}},i.virtualElements.allowedBindings.cesiumSvgPath=!0}};return i}),i("ThirdParty/knockout",["./knockout-3.4.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,i){"use strict";return t.attachToKo(e),i.register(e),e}),i("ThirdParty/NoSleep",[],function(){"use strict";function e(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}var t={Android:"undefined"!=typeof navigator&&/Android/gi.test(navigator.userAgent),iOS:"undefined"!=typeof navigator&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)},i={WebM:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",MP4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw=="},r=function(){return t.iOS?this.noSleepTimer=null:t.Android&&(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("loop",""),e(this.noSleepVideo,"webm",i.WebM),e(this.noSleepVideo,"mp4",i.MP4)),this};return r.prototype.enable=function(e){t.iOS?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location=window.location,window.setTimeout(window.stop,0)},e||15e3)):t.Android&&this.noSleepVideo.play()},r.prototype.disable=function(){t.iOS?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):t.Android&&this.noSleepVideo.pause()},r}),i("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,i,r,n,o){return r.call(n,t[i]),e.getObservable(t,i).subscribe(r,n,o)}return t}),i("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a){
"use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(v,e.tagName);for(var i in e)if(e.hasOwnProperty(i)&&"tagName"!==i)if("children"===i){var r,n=e.children.length;for(r=0;r<n;++r)t.appendChild(l(e.children[r]))}else 0===i.indexOf("xlink:")?t.setAttributeNS(y,i.substring(6),e[i]):"textContent"===i?t.textContent=e[i]:t.setAttribute(i,e[i]);return t}function u(e,t,i){var r=document.createElementNS(v,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(v,"tspan");return n.textContent=i,r.appendChild(n),r}function c(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}function h(e,t){var i=t.alpha,r=1-i;return P.red=e.red*r+t.red*i,P.green=e.green*r+t.green*i,P.blue=e.blue*r+t.blue*i,P.toCssColorString()}function d(e,t,i){var r={tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function p(e,t,i){var r={tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"use",class:"cesium-animation-buttonGlow","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonMain","xlink:href":"#animation_pathWingButton"},{tagName:"use",class:"cesium-animation-buttonPath","xlink:href":i},{tagName:"title",textContent:""}]};return l(r)}function m(e,t){var i=e._viewModel,r=i.shuttleRingDragging;if(!r||g===e)if("mousedown"===t.type||r&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||r&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!r&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),h=n-a-u.left,d=o-s-u.top,p=180*Math.atan2(d,h)/Math.PI+90;p>180&&(p-=360);var m=i.shuttleRingAngle;r||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(g=e,i.shuttleRingDragging=!0,i.shuttleRingAngle=p):p<m?i.slower():p>m&&i.faster(),t.preventDefault()}else e===g&&(g=void 0),i.shuttleRingDragging=!1}function f(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]}function _(e,t){function i(e){m(x,e)}e=o(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var r=document.createElement("style");r.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",document.head.insertBefore(r,document.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var s=document.createElementNS(v,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var h=document.createElementNS(v,"g");this._topG=h,this._realtimeSVG=new f(p(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new f(d(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new f(d(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new f(d(84,99,"#animation_pathPause"),t.pauseViewModel);var _=document.createElementNS(v,"g");_.appendChild(this._realtimeSVG.svgElement),_.appendChild(this._playReverseSVG.svgElement),_.appendChild(this._playForwardSVG.svgElement),_.appendChild(this._pauseSVG.svgElement);var g=l({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=g;var C=l({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:"use",transform:"translate(100,97) scale(-1,1)","xlink:href":"#animation_pathSwooshFX"},{tagName:"use",transform:"translate(100,97)","xlink:href":"#animation_pathSwooshFX"},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=C,this._shuttleRingPointer=l({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var w=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var S=61,E=l({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:S});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var b=l({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:S}),T=document.createElementNS(v,"g");T.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),h.appendChild(T),h.appendChild(w),h.appendChild(_),T.appendChild(g),T.appendChild(C),T.appendChild(this._shuttleRingPointer),w.appendChild(this._knobOuter),w.appendChild(E),w.appendChild(this._knobDate),w.appendChild(this._knobTime),w.appendChild(this._knobStatus),w.appendChild(b),s.appendChild(h),e.appendChild(s);var x=this;this._mouseCallback=i,g.addEventListener("mousedown",i,!0),g.addEventListener("touchstart",i,!0),C.addEventListener("mousedown",i,!0),C.addEventListener("touchstart",i,!0),document.addEventListener("mousemove",i,!0),document.addEventListener("touchmove",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("touchend",i,!0),document.addEventListener("touchcancel",i,!0),this._shuttleRingPointer.addEventListener("mousedown",i,!0),this._shuttleRingPointer.addEventListener("touchstart",i,!0),this._knobOuter.addEventListener("mousedown",i,!0),this._knobOuter.addEventListener("touchstart",i,!0);var A,P=this._knobTime.childNodes[0],D=this._knobDate.childNodes[0],M=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){A!==e&&(A=e,A?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(x._shuttleRingPointer,x._knobOuter,e)}),a(t,"dateLabel",function(e){D.textContent!==e&&(D.textContent=e)}),a(t,"timeLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"multiplierLabel",function(e){M.textContent!==e&&(M.textContent=e)})],this.applyThemeChanges(),this.resize()}var g,v="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",C=e.fromCssColorString("rgba(247,250,255,0.384)"),w=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),E=e.fromCssColorString("rgba(255,255,255,0.086)"),b=e.fromCssColorString("rgba(255,255,255,0.267)"),T=e.fromCssColorString("rgba(255,255,255,0)"),x=e.fromCssColorString("rgba(66,67,68,0.3)"),A=e.fromCssColorString("rgba(0,0,0,0.5)"),P=new e;return f.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;t<i;t++)e[t].dispose();r(this)},f.prototype.isDestroyed=function(){return!1},f.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e)return void this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");if(this._toggled)return void this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");this.svgElement.setAttribute("class","cesium-animation-rectButton")}},f.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},f.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},i(_.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("touchcancel",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var t=this._subscriptions,i=0,n=t.length;i<n;i++)t[i].dispose();return r(this)},_.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var i=this._svgNode,r=200,n=132,o=e,a=t;0===e&&0===t?(o=r,a=n):0===e?(a=t,o=r*(t/n)):0===t&&(o=e,a=n*(e/r));var s=o/r,l=a/n;i.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",o),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},_.prototype.applyThemeChanges=function(){var e=s(this._themeNormal),i=s(this._themeHover),r=s(this._themeSelect),n=s(this._themeDisabled),o=s(this._themeKnob),a=s(this._themePointer),u=s(this._themeSwoosh),c=s(this._themeSwooshHover),d=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(e,C)},{tagName:"stop",offset:"12%","stop-color":h(e,w)},{tagName:"stop",offset:"46%","stop-color":h(e,S)},{tagName:"stop",offset:"81%","stop-color":h(e,E)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(i,C)},{tagName:"stop",offset:"12%","stop-color":h(i,w)},{tagName:"stop",offset:"46%","stop-color":h(i,S)},{tagName:"stop",offset:"81%","stop-color":h(i,E)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(r,C)},{tagName:"stop",offset:"12%","stop-color":h(r,w)},{tagName:"stop",offset:"46%","stop-color":h(r,S)},{tagName:"stop",offset:"81%","stop-color":h(r,E)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":h(n,b)},{tagName:"stop",offset:"75%","stop-color":h(n,T)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":u.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":u.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":h(a,A)},{tagName:"stop",offset:"100%","stop-color":h(a,A)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,C)},{tagName:"stop",offset:"60%","stop-color":h(o,x)},{tagName:"stop",offset:"85%","stop-color":h(o,w)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":h(o,x)},{tagName:"stop",offset:"60%","stop-color":h(o,C)},{tagName:"stop",offset:"85%","stop-color":h(o,E)}]},{id:"animation_pathReset",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},{id:"animation_pathPause",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},{id:"animation_pathPlay",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathPlayReverse",tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},{id:"animation_pathLoop",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},{id:"animation_pathClock",tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},{id:"animation_pathWingButton",tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},{id:"animation_pathPointer",tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},{id:"animation_pathSwooshFX",tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}]});t(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d},_}),i("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,i,r,n,o){"use strict";function a(t,r){function a(){var e,i={args:arguments,cancel:!1};return s.raiseEvent(i),i.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}r=e(r,!0);var s=new n,l=new n;return a.canExecute=r,o.track(a,["canExecute"]),i(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),i("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,i,r,n){"use strict";function o(t,i){this._command=t,i=e(i,e.EMPTY_OBJECT),this.toggled=e(i.toggled,!1),this.tooltip=e(i.tooltip,""),n.track(this,["toggled","tooltip"])}return i(o.prototype,{command:{get:function(){return this._command}}}),o}),i("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function h(e,t){return e-t}function d(t,i){var r=e(i,t,h);return r<0?~r:r}function p(e,t){if(Math.abs(e)<=g)return e/g;var i,r,n=g,o=v,a=0;return e>0?(i=Math.log(t[t.length-1]),r=(i-a)/(o-n),Math.exp(a+r*(e-n))):(i=Math.log(-t[0]),r=(i-a)/(o-n),-Math.exp(a+r*(Math.abs(e)-n)))}function m(e,t,r){if(r.clockStep===i.SYSTEM_CLOCK)return g;if(Math.abs(e)<=1)return e*g;var n=t[t.length-1];e>n?e=n:e<-n&&(e=-n);var o,a,s=g,l=v,u=0;return e>0?(o=Math.log(n),a=(o-u)/(l-s),(Math.log(e)-u)/a+s):(o=Math.log(-t[0]),a=(o-u)/(l-s),-((Math.log(Math.abs(e))-u)/a+s))}function f(e){var r=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=f.defaultDateFormatter,this._timeFormatter=f.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(f.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return r._timeFormatter(r._clockViewModel.currentTime,r)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return r._dateFormatter(r._clockViewModel.currentTime,r)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=r._clockViewModel;if(e.clockStep===i.SYSTEM_CLOCK)return"Today";var t=e.multiplier;return t%1===0?t.toFixed(0)+"x":t.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,s.defineProperty(this,"shuttleRingAngle",{get:function(){return m(e.multiplier,r._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,v),-v);var t=r._allShuttleRingTicks,n=r._clockViewModel;if(n.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===v)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=p(e,t);if(r.snapToTicks)o=t[d(o,t)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=Math.round(o/l)*l|0}else a>g?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=r._clockViewModel,i=e.clockRange;if(r.shuttleRingDragging||i===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(i===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&n>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&n>0||o.equals(u)&&n<0}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=r._clockViewModel,i=e.clockRange;if(i===t.UNBOUNDED)return!0;var n=e.systemTime;return a.greaterThanOrEquals(n,e.startTime)&&a.lessThanOrEquals(n,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return r._clockViewModel.shouldAnimate&&(r._canAnimate||r.shuttleRingDragging)});var n=u(function(){var e=r._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:r._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!r._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=r._clockViewModel,t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=r._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier>0&&e.clockStep!==i.SYSTEM_CLOCK}),tooltip:"Play Forward"});var h=u(function(){r._clockViewModel.clockStep=i.SYSTEM_CLOCK},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(h,{toggled:s.computed(function(){return e.clockStep===i.SYSTEM_CLOCK}),tooltip:s.computed(function(){return r._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=d(i,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=d(i,t)+1;n<t.length&&(e.multiplier=t[n])})}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g=15,v=105;return f.defaultDateFormatter=function(e,t){var i=a.toGregorianDate(e);return _[i.month-1]+" "+i.day+" "+i.year},f.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],f.defaultTimeFormatter=function(e,t){var i=a.toGregorianDate(e),r=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,r):l("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},f.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},f.prototype.setShuttleRingTicks=function(e){var t,i,r,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,i=e.length;t<i;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,o.push(r));o.sort(h);var a=[];for(i=o.length,t=i-1;t>=0;--t)r=o[t],0!==r&&a.push(-r);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(f.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}}),f._maxShuttleRingAngle=v,f._realtimeShuttleRingAngle=g,f}),i("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.globe,l=e(i.imageryProviderViewModels,[]),u=e(i.terrainProviderViewModels,[]);this._globe=r,this.imageryProviderViewModels=l.slice(0),this.terrainProviderViewModels=u.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,i=this.selectedTerrain,r=t(e)?e.name:void 0,n=t(i)?i.name:void 0;return t(r)&&t(n)?r+"\n"+n:t(r)?r:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var c=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(e){if(c()===e)return void(this.dropDownVisible=!1);var i,r=this._currentImageryProviders,n=r.length,a=this._globe.imageryLayers;for(i=0;i<n;i++)for(var s=a.length,l=0;l<s;l++){var u=a.get(l);if(u.imageryProvider===r[i]){a.remove(u);break}}if(t(e)){var h=e.creationCommand();if(o(h)){var d=h.length;for(i=d-1;i>=0;i--)a.addImageryProvider(h[i],0);this._currentImageryProviders=h.slice(0)}else this._currentImageryProviders=[h],a.addImageryProvider(h,0)}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var h=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return h()},set:function(e){if(h()===e)return void(this.dropDownVisible=!1);var i;t(e)&&(i=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(i instanceof n),this._globe.terrainProvider=i,h(e),this.dropDownVisible=!1}});var d=this;this._toggleDropDown=s(function(){d.dropDownVisible=!d.dropDownVisible}),this.selectedImagery=e(i.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(i.selectedTerrainProviderViewModel,u[0])}return i(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),i("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=a(e);var i=new s(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),r.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-sectionTitle",c.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),c.innerHTML="Imagery",u.appendChild(c);var h=document.createElement("div");h.className="cesium-baseLayerPicker-choices",h.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(h);var d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),h.appendChild(d);var p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);var m=document.createElement("div");m.className="cesium-baseLayerPicker-itemLabel",m.setAttribute("data-bind","text: name"),d.appendChild(m);var f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",u.appendChild(f);var _=document.createElement("div");_.className="cesium-baseLayerPicker-choices",_.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(_);var g=document.createElement("div");g.className="cesium-baseLayerPicker-item",g.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),_.appendChild(g);var v=document.createElement("img");v.className="cesium-baseLayerPicker-itemIcon",v.setAttribute("data-bind","attr: { src: iconUrl }"),v.setAttribute("draggable","false"),g.appendChild(v);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),g.appendChild(y),o.applyBindings(i,r),o.applyBindings(i,u),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=u,this._closeDropDown=function(e){r.contains(e.target)||u.contains(e.target)||(i.dropDownVisible=!1);
},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._element),o.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),i(this)},l}),i("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(t){var i=t.creationFunction;e(i.canExecute)||(i=n(i)),this._creationCommand=i,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,r.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),i("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(){var l=[];return l.push(new s({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL})}})),l.push(new s({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL_WITH_LABELS})}})),l.push(new s({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.ROAD})}})),l.push(new s({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new a({mapId:"mapbox.satellite"})}})),l.push(new s({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new a({mapId:"mapbox.streets"})}})),l.push(new s({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),creationFunction:function(){return new a({mapId:"mapbox.streets-basic"})}})),l.push(new s({name:"ESRI World Imagery",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide.  The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal.  Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI World Street Map",iconUrl:e("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI National Geographic",iconUrl:e("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),l.push(new s({name:"Open­Street­Map",iconUrl:e("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",creationFunction:function(){return n({url:"https://a.tile.openstreetmap.org/"})}})),l.push(new s({name:"Stamen Watercolor",iconUrl:e("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return n({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),l.push(new s({name:"The Black Marble",iconUrl:e("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return o({url:"https://cesiumjs.org/blackmarble",flipXY:!0,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),l.push(new s({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return o({url:e("Assets/Textures/NaturalEarthII")})}})),l}return l}),i("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r){"use strict";function n(){var n=[];return n.push(new r({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new i}})),n.push(new r({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"https://assets.agi.com/stk-terrain/world",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),i("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Rectangle","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h){"use strict";function d(t){var i;if(e(t)){i="Command Statistics";var r=t.commandsInFrustums;for(var n in r)if(r.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}i+="<br>&nbsp;&nbsp;&nbsp;&nbsp;"+r[n]+" in frustum "+o}i+="<br>Total: "+t.totalCommands}return i}function p(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}function m(t,i){function r(t){_.removeInputAction(a.LEFT_CLICK),m.pickPrimitiveActive=!1;var i=m._scene.pick({x:t.position.x,y:t.position.y});e(i)&&(m.primitive=e(i.collection)?i.collection:i.primitive)}function d(t){var i,r=g.ellipsoid,o=m._scene.camera.pickEllipsoid({x:t.position.x,y:t.position.y},r);if(e(o))for(var s=r.cartesianToCartographic(o),l=g._surface.tileProvider._tilesToRenderByTextureCount,u=0;!i&&u<l.length;++u){var c=l[u];if(e(c))for(var h=0;!i&&h<c.length;++h){var d=c[h];n.contains(d.rectangle,s)&&(i=d)}}m.tile=i,_.removeInputAction(a.LEFT_CLICK),m.pickTileActive=!1}var m=this,f=t.canvas,_=new o(f);this._eventHandler=_,this._scene=t,this._canvas=f,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=i;var g=this._scene.globe;g.depthTestAgainstTerrain=!0,this.frustums=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.globeDepth=!1,this.pickDepth=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.depthFrustumText="1 of 1",this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText="",this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.generalSwitchText="-",this.primitivesSwitchText="+",this.terrainSwitchText="+",c.track(this,["filterTile","suspendUpdates","dropDownVisible","shaderCacheText","frustums","frustumStatisticText","pickTileActive","pickPrimitiveActive","hasPickedPrimitive","hasPickedTile","tileText","generalVisible","generalSwitchText","primitivesVisible","primitivesSwitchText","terrainVisible","terrainSwitchText","depthFrustumText"]),this._toggleDropDown=h(function(){m.dropDownVisible=!m.dropDownVisible}),this._toggleGeneral=h(function(){m.generalVisible=!m.generalVisible,m.generalSwitchText=m.generalVisible?"-":"+"}),this._togglePrimitives=h(function(){m.primitivesVisible=!m.primitivesVisible,m.primitivesSwitchText=m.primitivesVisible?"-":"+"}),this._toggleTerrain=h(function(){m.terrainVisible=!m.terrainVisible,m.terrainSwitchText=m.terrainVisible?"-":"+"}),this._showFrustums=h(function(){return m.frustums?m._scene.debugShowFrustums=!0:m._scene.debugShowFrustums=!1,!0}),this._showPerformance=h(function(){return m.performance?m._performanceDisplay=new l({container:m._performanceContainer}):m._performanceContainer.innerHTML="",!0}),this._showPrimitiveBoundingSphere=h(function(){return m._primitive.debugShowBoundingVolume=m.primitiveBoundingSphere,!0}),this._showPrimitiveReferenceFrame=h(function(){if(m.primitiveReferenceFrame){var t=m._primitive.modelMatrix;m._modelMatrixPrimitive=new s({modelMatrix:t}),m._scene.primitives.add(m._modelMatrixPrimitive)}else e(m._modelMatrixPrimitive)&&(m._scene.primitives.remove(m._modelMatrixPrimitive),m._modelMatrixPrimitive=void 0);return!0}),this._doFilterPrimitive=h(function(){return m.filterPrimitive?m._scene.debugCommandFilter=function(t){return!(!e(m._modelMatrixPrimitive)||t.owner!==m._modelMatrixPrimitive._primitive)||!!e(m._primitive)&&(t.owner===m._primitive||t.owner===m._primitive._billboardCollection||t.owner.primitive===m._primitive)}:m._scene.debugCommandFilter=void 0,!0}),this._showWireframe=h(function(){return g._surface.tileProvider._debug.wireframe=m.wireframe,!0}),this._showGlobeDepth=h(function(){return m._scene.debugShowGlobeDepth=m.globeDepth,!0}),this._showPickDepth=h(function(){return m._scene.debugShowPickDepth=m.pickDepth,!0}),this._incrementDepthFrustum=h(function(){var e=m.depthFrustum+1;return m.depthFrustum=p(1,m._numberOfFrustums,e),m.scene.debugShowDepthFrustum=m.depthFrustum,!0}),this._decrementDepthFrustum=h(function(){var e=m.depthFrustum-1;return m.depthFrustum=p(1,m._numberOfFrustums,e),m.scene.debugShowDepthFrustum=m.depthFrustum,!0}),this._doSuspendUpdates=h(function(){return g._surface._debug.suspendLodUpdate=m.suspendUpdates,m.suspendUpdates||(m.filterTile=!1),!0});var v;this._showTileCoordinates=h(function(){return m.tileCoordinates&&!e(v)?v=t.imageryLayers.addImageryProvider(new u({tilingScheme:t.terrainProvider.tilingScheme})):!m.tileCoordinates&&e(v)&&(t.imageryLayers.remove(v),v=void 0),!0}),this._showTileBoundingSphere=h(function(){return m.tileBoundingSphere?g._surface.tileProvider._debug.boundingSphereTile=m._tile:g._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=h(function(){return m.filterTile?(m.suspendUpdates=!0,m.doSuspendUpdates(),g._surface._tilesToRender=[],e(m._tile)&&g._surface._tilesToRender.push(m._tile)):(m.suspendUpdates=!1,m.doSuspendUpdates()),!0}),this._pickPrimitive=h(function(){m.pickPrimitiveActive=!m.pickPrimitiveActive,m.pickPrimitiveActive?_.setInputAction(r,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)}),this._pickTile=h(function(){m.pickTileActive=!m.pickTileActive,m.pickTileActive?_.setInputAction(d,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)})}return t(m.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showFrustums:{get:function(){return this._showFrustums}},showPerformance:{get:function(){return this._showPerformance}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},showWireframe:{get:function(){return this._showWireframe}},showGlobeDepth:{get:function(){return this._showGlobeDepth}},showPickDepth:{get:function(){return this._showPickDepth}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},doSuspendUpdates:{get:function(){return this._doSuspendUpdates}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){var e=this;return h(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return h(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return h(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return h(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return h(function(){e.tile=e.tile.southeastChild})}},primitive:{set:function(t){var i=this._primitive;t!==i&&(this.hasPickedPrimitive=!0,e(i)&&(i.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,e(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=t,t.show=!1,setTimeout(function(){t.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())},get:function(){return this._primitive}},tile:{set:function(t){if(e(t)){this.hasPickedTile=!0;var i=this._tile;t!==i&&(this.tileText="L: "+t.level+" X: "+t.x+" Y: "+t.y,this.tileText+="<br>SW corner: "+t.rectangle.west+", "+t.rectangle.south,this.tileText+="<br>NE corner: "+t.rectangle.east+", "+t.rectangle.north,this.tileText+="<br>Min: "+t.data.minimumHeight+" Max: "+t.data.maximumHeight),this._tile=t,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0},get:function(){return this._tile}},update:{get:function(){var e=this;return function(){e.frustums&&(e.frustumStatisticText=d(e._scene.debugFrustumStatistics));var t=e._scene.numberOfFrustums;e._numberOfFrustums=t;var i=p(1,t,e.depthFrustum);e.depthFrustum=i,e.scene.debugShowDepthFrustum=i,e.depthFrustumText=i+" of "+t,e.performance&&e._performanceDisplay.update(),e.primitiveReferenceFrame&&(e._modelMatrixPrimitive.modelMatrix=e._primitive.modelMatrix),e.shaderCacheText="Cached shaders: "+e._scene.context.shaderCache.numberOfShaders}}}}),m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._eventHandler.destroy(),i(this)},m}),i("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=document.createElement("div"),r=new a(t,i);this._viewModel=r,this._container=e;var s=document.createElement("div");this._element=s;var l=document.createElement("div");l.textContent="Cesium Inspector",l.className="cesium-cesiumInspector-button",l.setAttribute("data-bind","click: toggleDropDown"),s.appendChild(l),s.className="cesium-cesiumInspector",s.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var u=document.createElement("div");this._panel=u,u.className="cesium-cesiumInspector-dropDown",s.appendChild(u);var c=document.createElement("div");c.className="cesium-cesiumInspector-sectionHeader";var h=document.createElement("span");h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),c.appendChild(h),c.appendChild(document.createTextNode("General")),u.appendChild(c);var d=document.createElement("div");d.className="cesium-cesiumInspector-section",d.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),u.appendChild(d);var p=document.createElement("div");d.appendChild(p);var m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStats",m.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText');var f=document.createElement("input");f.type="checkbox",f.setAttribute("data-bind","checked: frustums, click: showFrustums"),p.appendChild(f),p.appendChild(document.createTextNode("Show Frustums")),p.appendChild(m);var _=document.createElement("div");d.appendChild(_);var g=document.createElement("input");g.type="checkbox",g.setAttribute("data-bind","checked: performance, click: showPerformance"),_.appendChild(g),_.appendChild(document.createTextNode("Performance Display")),i.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(i);var v=document.createElement("div");v.className="cesium-cesiumInspector-shaderCache",v.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(v);var y=document.createElement("div");d.appendChild(y);var C=document.createElement("input");C.type="checkbox",C.setAttribute("data-bind","checked: globeDepth, click: showGlobeDepth"),y.appendChild(C),y.appendChild(document.createTextNode("Show globe depth"));var w=document.createElement("div");y.appendChild(w);var S=document.createElement("div");d.appendChild(S);var E=document.createElement("input");E.type="checkbox",E.setAttribute("data-bind","checked: pickDepth, click: showPickDepth"),S.appendChild(E),S.appendChild(document.createTextNode("Show pick depth"));var b=document.createElement("div");d.appendChild(b);var T=document.createElement("span");T.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),b.appendChild(T);var x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(x);var A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(A);var P=document.createElement("input");P.type="button",P.value="+",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(P);var D=document.createElement("div");D.className="cesium-cesiumInspector-sectionHeader",h=document.createElement("span"),h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),D.appendChild(h),D.appendChild(document.createTextNode("Primitives")),u.appendChild(D);var M=document.createElement("div");M.className="cesium-cesiumInspector-section",M.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),u.appendChild(M);var I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",M.appendChild(I);var R=document.createElement("input");R.type="button",R.value="Pick a primitive",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var O=document.createElement("div");O.className="cesium-cesiumInspector-center",O.appendChild(R),I.appendChild(O);var N=document.createElement("div");I.appendChild(N);var L=document.createElement("input");L.type="checkbox",L.setAttribute("data-bind","checked: primitiveBoundingSphere, click: showPrimitiveBoundingSphere, enable: hasPickedPrimitive"),N.appendChild(L),N.appendChild(document.createTextNode("Show bounding sphere"));var B=document.createElement("div");I.appendChild(B);var F=document.createElement("input");F.type="checkbox",F.setAttribute("data-bind","checked: primitiveReferenceFrame, click: showPrimitiveReferenceFrame, enable: hasPickedPrimitive"),B.appendChild(F),B.appendChild(document.createTextNode("Show reference frame"));var V=document.createElement("div");this._primitiveOnly=V,I.appendChild(V);var k=document.createElement("input");k.type="checkbox",k.setAttribute("data-bind","checked: filterPrimitive, click: doFilterPrimitive, enable: hasPickedPrimitive"),V.appendChild(k),V.appendChild(document.createTextNode("Show only selected"));var z=document.createElement("div");z.className="cesium-cesiumInspector-sectionHeader",h=document.createElement("span"),h.className="cesium-cesiumInspector-toggleSwitch",h.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),z.appendChild(h),z.appendChild(document.createTextNode("Terrain")),u.appendChild(z);var U=document.createElement("div");U.className="cesium-cesiumInspector-section",U.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),u.appendChild(U);var G=document.createElement("div");G.className="cesium-cesiumInspector-pickSection",U.appendChild(G);var W=document.createElement("input");W.type="button",W.value="Pick a tile",W.className="cesium-cesiumInspector-pickButton",W.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),O=document.createElement("div"),O.appendChild(W),O.className="cesium-cesiumInspector-center",G.appendChild(O);var H=document.createElement("div");G.appendChild(H);var q=document.createElement("input");q.type="button",q.value="Parent",q.className="cesium-cesiumInspector-pickButton",q.setAttribute("data-bind","click: selectParent");var j=document.createElement("input");j.type="button",j.value="NW",j.className="cesium-cesiumInspector-pickButton",j.setAttribute("data-bind","click: selectNW");var Y=document.createElement("input");Y.type="button",Y.value="NE",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectNE");var X=document.createElement("input");X.type="button",X.value="SW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSW");var Z=document.createElement("input");Z.type="button",Z.value="SE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectSE");var K=document.createElement("div");K.className="cesium-cesiumInspector-tileText",H.className="cesium-cesiumInspector-frustumStats",H.appendChild(K),H.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),K.setAttribute("data-bind","html: tileText");var Q=document.createElement("div");Q.className="cesium-cesiumInspector-relativeText",Q.textContent="Select relative:",H.appendChild(Q);var J=document.createElement("table"),$=document.createElement("tr"),ee=document.createElement("tr"),te=document.createElement("td");te.appendChild(q);var ie=document.createElement("td");ie.appendChild(j);var re=document.createElement("td");re.appendChild(Y),$.appendChild(te),$.appendChild(ie),$.appendChild(re);var ne=document.createElement("td"),oe=document.createElement("td");oe.appendChild(X);var ae=document.createElement("td");ae.appendChild(Z),ee.appendChild(ne),ee.appendChild(oe),ee.appendChild(ae),J.appendChild($),J.appendChild(ee),H.appendChild(J);var se=document.createElement("div");G.appendChild(se);var le=document.createElement("input");le.type="checkbox",le.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile, click: showTileBoundingSphere"),se.appendChild(le),se.appendChild(document.createTextNode("Show bounding volume"));var ue=document.createElement("div");G.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile, click: doFilterTile"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show only selected"));var he=document.createElement("div");U.appendChild(he);var de=document.createElement("input");de.type="checkbox",de.setAttribute("data-bind","checked: wireframe, click: showWireframe"),he.appendChild(de),he.appendChild(document.createTextNode("Wireframe"));var pe=document.createElement("div");U.appendChild(pe);var me=document.createElement("input");me.type="checkbox",me.setAttribute("data-bind","checked: suspendUpdates, click: doSuspendUpdates"),pe.appendChild(me),pe.appendChild(document.createTextNode("Suspend LOD update"));var fe=document.createElement("div");U.appendChild(fe);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: tileCoordinates, click: showTileCoordinates"),fe.appendChild(_e),fe.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(r,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i(this)},s}),i("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/Globe","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/ShadowMode","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E){"use strict";function b(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function T(e){function t(r){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=r-i;s>a&&(e.resize(),e.render(),i=r-s%a),d(t)}else e.resize(),e.render(),d(t)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var l="An error occurred while rendering.  Rendering has stopped.";e.showErrorPanel(l,void 0,t)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var i=0;d(t)}function x(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=i,e._canvasHeight=r,i*=o,r*=o,t.width=i,t.height=r,e._canRender=0!==i&&0!==r}function A(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function P(e,a){e=E(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas"),h=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=h,h&&(l.style.imageRendering=c.imageRenderingValue()),l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var d=document.createElement("div");d.className="cesium-widget-credits";var T=o(a.creditContainer)?E(a.creditContainer):s;T.appendChild(d);var P=n(a.showRenderLoopErrors,!0);this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=d,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=P,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new i,x(this);try{var M=new g({canvas:l,contextOptions:a.contextOptions,creditContainer:d,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration,shadows:a.shadows,mapMode2D:a.mapMode2D});this._scene=M,M.camera.constrainedAxis=t.UNIT_Z,A(this);var I=n(M.mapProjection.ellipsoid,u.WGS84),R=M.frameState.creditDisplay,O=new r("Cesium",D,"http://cesiumjs.org/");R.addDefaultCredit(O);var N=a.globe;o(N)||(N=new f(I)),N!==!1&&(M.globe=N,M.globe.shadows=n(a.terrainShadows,y.RECEIVE_ONLY));var L=a.skyBox;o(L)||(L=new w({sources:{positiveX:b("px"),negativeX:b("mx"),positiveY:b("py"),negativeY:b("my"),positiveZ:b("pz"),negativeZ:b("mz")}})),L!==!1&&(M.skyBox=L,M.sun=new S,M.moon=new _);var B=a.skyAtmosphere;o(B)||(B=new C(I)),B!==!1&&(M.skyAtmosphere=B);var F=a.globe!==!1&&a.imageryProvider;o(F)||(F=new m({url:"https://dev.virtualearth.net"})),F!==!1&&M.imageryLayers.addImageryProvider(F),o(a.terrainProvider)&&a.globe!==!1&&(M.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new p(l,!1),o(a.sceneMode)&&(a.sceneMode===v.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===v.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),
this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=a.targetFrameRate;var V=this;M.renderError.addEventListener(function(e,t){if(V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors){var i="An error occurred while rendering.  Rendering has stopped.";V.showErrorPanel(i,void 0,t)}})}catch(e){if(P){var k="Error constructing CesiumWidget.",z='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL.  Consider trying a different web browser or updating your video drivers.  Detailed error information is below:';this.showErrorPanel(k,z,e)}throw e}}var D="data:image/png;base64, ";return a(P.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&T(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}}}),P.prototype.showErrorPanel=function(e,t,i){function r(){u.style.maxHeight=Math.max(Math.round(.9*n.clientHeight-100),30)+"px"}var n=this._element,a=document.createElement("div");a.className="cesium-widget-errorPanel";var s=document.createElement("div");s.className="cesium-widget-errorPanel-content",a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-header",l.appendChild(document.createTextNode(e)),s.appendChild(l);var u=document.createElement("div");if(u.className="cesium-widget-errorPanel-scroll",s.appendChild(u),r(),o(window.addEventListener)&&window.addEventListener("resize",r,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var d="(no error details available)";o(i)&&(d=h(i));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(d)),u.appendChild(p);var m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(m);var f=document.createElement("button");f.setAttribute("type","button"),f.className="cesium-button",f.appendChild(document.createTextNode("OK")),f.onclick=function(){o(r)&&o(window.removeEventListener)&&window.removeEventListener("resize",r,!1),n.removeChild(a)},m.appendChild(f),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+d)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},P.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==i)&&(this._forceResize=!1,x(this),A(this))},P.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},P}),i("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,i,r,n,o,a){"use strict";function s(i){t(i)||(i=new e),this._clock=i,this._eventHelper=new n,this._eventHelper.add(i.onTick,this.synchronize,this),this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,this.startTime=a.observable(i.startTime),this.startTime.equalityComparer=o.equals,this.startTime.subscribe(function(e){i.startTime=e,this.synchronize()},this),this.stopTime=a.observable(i.stopTime),this.stopTime.equalityComparer=o.equals,this.stopTime.subscribe(function(e){i.stopTime=e,this.synchronize()},this),this.currentTime=a.observable(i.currentTime),this.currentTime.equalityComparer=o.equals,this.currentTime.subscribe(function(e){i.currentTime=e,this.synchronize()},this),this.multiplier=a.observable(i.multiplier),this.multiplier.subscribe(function(e){i.multiplier=e,this.synchronize()},this),this.clockStep=a.observable(i.clockStep),this.clockStep.subscribe(function(e){i.clockStep=e,this.synchronize()},this),this.clockRange=a.observable(i.clockRange),this.clockRange.subscribe(function(e){i.clockRange=e,this.synchronize()},this),this.canAnimate=a.observable(i.canAnimate),this.canAnimate.subscribe(function(e){i.canAnimate=e,this.synchronize()},this),this.shouldAnimate=a.observable(i.shouldAnimate),this.shouldAnimate.subscribe(function(e){i.shouldAnimate=e,this.synchronize()},this),a.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}return i(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock;this.systemTime=o.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},s}),i("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";function t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()}return t}),i("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){var i=this,r=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return l()},set:function(e){l(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(i._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){r(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)}return t(l.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),i(this)},l}),i("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=new a(t);i._exitFullScreenPath=u,i._enterFullScreenPath=l;var r=document.createElement("button");r.type="button",r.className="cesium-button cesium-fullscreenButton",r.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(r),n.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}var l="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",u="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsApi","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/loadJsonp","../../Core/Matrix4","../../Core/Rectangle","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,h,d){"use strict";function p(t){this._url=i(t.url,"https://dev.virtualearth.net/"),this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._key=e.getKey(t.key);var n=e.getErrorCredit(t.key);r(n)&&t.scene._frameState.creditDisplay.addDefaultCredit(n),this._scene=t.scene,this._flightDuration=t.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodeInProgress=void 0,this._complete=new a;var o=this;this._searchCommand=d(function(){o.isSearchInProgress?_(o):f(o)}),this.keepExpanded=!1,c.track(this,["_searchText","_isSearchInProgress","keepExpanded"]),this.isSearchInProgress=void 0,c.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,c.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,c.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function m(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:l.IDENTITY})}function f(e){var i=e.searchText;if(!/^\s*$/.test(i)){var r=i.match(/[^\s,\n]+/g);if(2===r.length||3===r.length){var n=+r[0],o=+r[1],a=3===r.length?+r[2]:300;if(!isNaN(n)&&!isNaN(o)&&!isNaN(a))return void m(e,t.fromDegrees(n,o,a))}e._isSearchInProgress=!0;var l=s(e._url+"REST/v1/Locations",{parameters:{query:i,key:e._key},callbackParameterName:"jsonp"}),c=e._geocodeInProgress=h(l,function(t){if(!c.cancel){if(e._isSearchInProgress=!1,0===t.resourceSets.length)return void(e.searchText=e._searchText+" (not found)");var i=t.resourceSets[0];if(0===i.resources.length)return void(e.searchText=e._searchText+" (not found)");var r=i.resources[0];e._searchText=r.name;var n=r.bbox,o=n[0],a=n[1],s=n[2],l=n[3];m(e,u.fromDegrees(a,o,l,s))}},function(){c.cancel||(e._isSearchInProgress=!1,e.searchText=e._searchText+" (error)")})}}function _(e){e._isSearchInProgress=!1,r(e._geocodeInProgress)&&(e._geocodeInProgress.cancel=!0,e._geocodeInProgress=void 0)}return n(p.prototype,{url:{get:function(){return this._url}},key:{get:function(){return this._key}},complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}}}),p}),i("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=a(e.container),i=new s(e);i._startSearchPath=u,i._stopSearchPath=c;var r=document.createElement("form");r.setAttribute("data-bind","submit: search");var l=document.createElement("input");l.type="search",l.className="cesium-geocoder-input",l.setAttribute("placeholder","Enter an address or landmark..."),l.setAttribute("data-bind",'value: searchText,valueUpdate: "afterkeydown",disable: isSearchInProgress,css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 }'),this._onTextBoxFocus=function(){setTimeout(function(){l.select()},0)},l.addEventListener("focus",this._onTextBoxFocus,!1),r.appendChild(l),this._textBox=l;var h=document.createElement("span");h.className="cesium-geocoder-searchButton",h.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),r.appendChild(h),t.appendChild(r),o.applyBindings(i,r),this._container=t,this._viewModel=i,this._form=r,this._onInputBegin=function(e){t.contains(e.target)||l.blur()},this._onInputEnd=function(e){t.contains(e.target)&&l.focus()},n.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0),document.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0),document.addEventListener("touchcancel",this._onInputEnd,!0))}var u="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",c="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),o.cleanNode(this._form),this._container.removeChild(this._form),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),i(this)},l}),i("Widgets/HomeButton/HomeButtonViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(e,t){this._scene=e,this._duration=t;var i=this;this._command=n(function(){i._scene.camera.flyHome(i._duration)}),this.tooltip="View Home",r.track(this,["tooltip"])}return t(o.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}}),o}),i("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-home-button",s.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,i,r){"use strict";function n(){this._cameraClicked=new i,this._closeClicked=new i,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",r.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,r.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),r.defineProperty(this,"_bodyless",{get:function(){return!e(this.description)||0===this.description.length}})}var o="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",a="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";return n.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},t(n.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),n}),i("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(r){r=s(r);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),r.appendChild(n);var o=document.createElement("div");o.className="cesium-infoBox-title",o.setAttribute("data-bind","text: titleText"),n.appendChild(o);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-infoBox-camera",c.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-infoBox-close",h.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),h.innerHTML="&times;",n.appendChild(h);var d=document.createElement("iframe");d.className="cesium-infoBox-iframe",d.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),d.setAttribute("allowfullscreen",!0),n.appendChild(d);var p=new u;a.applyBindings(p,n),this._container=r,this._element=n,this._frame=d,this._viewModel=p,this._descriptionSubscription=void 0;var m=this;d.addEventListener("load",function(){var r=d.contentDocument,o=r.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=r.createElement("div");a.className="cesium-infoBox-description",r.head.appendChild(o),r.body.appendChild(a),m._descriptionSubscription=l(p,"description",function(e){d.style.height="5px",a.innerHTML=e;var r=null,o=a.firstElementChild;if(null!==o&&1===a.childNodes.length){var s=window.getComputedStyle(o);if(null!==s){var l=s["background-color"],u=t.fromCssColorString(l);i(u)&&0!==u.alpha&&(r=s["background-color"])}}n.style["background-color"]=r;var c=a.getBoundingClientRect().height;d.style.height=c+"px"})}),d.setAttribute("src","about:blank")}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),i(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),n(this)},c}),i("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,i){"use strict";function r(){this.showInstructions=!1;var e=this;this._command=i(function(){e.showInstructions=!e.showInstructions}),this._showClick=i(function(){e._touch=!1}),this._showTouch=i(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(r.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),r}),i("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i){var r=l(i.container),n=new u,o=t(i.instructionsInitiallyVisible,!1);n.showInstructions=o,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",r.appendChild(c);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",h.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(h);var d=document.createElement("div");d.className="cesium-navigation-help",d.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(d);var p=document.createElement("button");p.type="button",p.className="cesium-navigation-button cesium-navigation-button-left",p.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var m=document.createElement("img");m.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),m.className="cesium-navigation-button-icon",m.style.width="25px",m.style.height="25px",p.appendChild(m),p.appendChild(document.createTextNode("Mouse"));var f=document.createElement("button");f.type="button",f.className="cesium-navigation-button cesium-navigation-button-right",f.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var _=document.createElement("img");_.src=e("Widgets/Images/NavigationHelp/Touch.svg"),_.className="cesium-navigation-button-icon",_.style.width="25px",_.style.height="25px",f.appendChild(_),f.appendChild(document.createTextNode("Touch")),d.appendChild(p),d.appendChild(f);var g=document.createElement("div");g.className="cesium-click-navigation-help cesium-navigation-help-instructions",g.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),g.innerHTML='            <table>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/MouseLeft.svg")+'" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">Pan view</div>                        <div class="cesium-navigation-help-details">Left click + drag</div>                    </td>                </tr>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/MouseRight.svg")+'" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">Zoom view</div>                        <div class="cesium-navigation-help-details">Right click + drag, or</div>                        <div class="cesium-navigation-help-details">Mouse wheel scroll</div>                    </td>                </tr>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/MouseMiddle.svg")+'" width="48" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">Rotate view</div>                        <div class="cesium-navigation-help-details">Middle click + drag, or</div>                        <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div>                    </td>                </tr>            </table>',
d.appendChild(g);var v=document.createElement("div");v.className="cesium-touch-navigation-help cesium-navigation-help-instructions",v.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),v.innerHTML='            <table>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/TouchDrag.svg")+'" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-pan">Pan view</div>                        <div class="cesium-navigation-help-details">One finger drag</div>                    </td>                </tr>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/TouchZoom.svg")+'" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-zoom">Zoom view</div>                        <div class="cesium-navigation-help-details">Two finger pinch</div>                    </td>                </tr>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/TouchTilt.svg")+'" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-rotate">Tilt view</div>                        <div class="cesium-navigation-help-details">Two finger drag, same direction</div>                    </td>                </tr>                <tr>                    <td><img src="'+e("Widgets/Images/NavigationHelp/TouchRotate.svg")+'" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-tilt">Rotate view</div>                        <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div>                    </td>                </tr>            </table>',d.appendChild(v),s.applyBindings(n,c),this._container=r,this._viewModel=n,this._wrapper=c,this._closeInstructions=function(e){c.contains(e.target)||(n.showInstructions=!1)},a.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return a.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),s.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},c}),i("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._scene=t.scene,this.lowFrameRateMessage=e(t.lowFrameRateMessage,"This application appears to be performing poorly on your system.  Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,a.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var i=this;this._dismissMessage=s(function(){i.showingLowFrameRateMessage=!1,i.lowFrameRateMessageDismissed=!0});var r=o.fromScene(t.scene);this._unsubscribeLowFrameRate=r.lowFrameRate.addEventListener(function(){i.lowFrameRateMessageDismissed||(i.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=r.nominalFrameRate.addEventListener(function(){i.showingLowFrameRateMessage=!1})}return i(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),r(this)},l}),i("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t=o(e.container),i=new a(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");var s=document.createElement("button");s.setAttribute("type","button"),s.className="cesium-performance-watchdog-message-dismiss",s.innerHTML="&times;",s.setAttribute("data-bind","click: dismissMessage"),r.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(l),t.appendChild(r),n.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i){this._scene=t;var r=this,n=function(e,t,i,n){r.sceneMode=i,r.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(i,2),this.sceneMode=t.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=r.sceneMode;return e===a.SCENE2D?r.tooltip2D:e===a.SCENE3D?r.tooltip3D:r.tooltipColumbusView}),this._toggleDropDown=l(function(){r.dropDownVisible=!r.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(r._duration)}),this._morphTo3D=l(function(){t.morphTo3D(r._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(r._duration)}),this._sceneMode=a}return i(u.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},u}),i("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i){e=a(e);var r=new s(t,i);r._globePath=u,r._flatMapPath=c,r._columbusViewPath=h;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button",d.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D,       "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),d.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',l.appendChild(d);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),l.appendChild(p);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D,       "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),l.appendChild(m);var f=document.createElement("button");f.type="button",f.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",f.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),l.appendChild(f),o.applyBindings(r,l),this._viewModel=r,this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878         -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132         -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285         11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z         M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201         5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461         -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",c="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",h="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i(this)},l}),i("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,r,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=r,this._scale=1,this.position=void 0,this.showSelection=!1,s.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,s.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&i(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,i){return a.wgs84ToWindowCoordinates(e,t,i)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&i(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(i(e)){var t=this._container,r=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),r+o)-a,e.y=Math.min(Math.max(e.y,-o),n+o)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=c,this._screenPositionY=c}},l.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},l.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},r(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),i("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",s="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",l=document.createElementNS(r,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(r,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(r,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),i.appendChild(l);var h=new a(t,this._element,this._container);this._viewModel=h,n.applyBindings(this._viewModel,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return n.cleanNode(this._element),e.removeChild(this._element),i(this)},s}),i("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function i(t,i,r){this._color=t,this._height=i,this._base=e(r,0)}return i.prototype.getHeight=function(){return this._height},i.prototype.getBase=function(){return this._base},i.prototype.getStartTime=function(){return this._start},i.prototype.getStopTime=function(){return this._stop},i.prototype.setRange=function(e,t){this._start=e,this._stop=t},i.prototype.render=function(e){var i="";if(this._start&&this._stop&&this._color){var r=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(r)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;n<0&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(i='<span class="cesium-timeline-highlight" style="left: '+n.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return i},i}),i("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,i){"use strict";function r(t,i,r,n){this.interval=t,this.height=i,this.color=r||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return r.prototype.render=function(e,r){var n=this.interval.start,o=this.interval.stop,a=r.startJulian,s=i.addSeconds(r.startJulian,r.duration,new i);if(i.lessThan(n,a)&&i.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height);else if(i.lessThanOrEquals(n,s)&&i.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<r.timeBarWidth;++l){var h=i.addSeconds(r.startJulian,l/r.timeBarWidth*r.duration,new i);!t(u)&&i.greaterThanOrEquals(h,n)?u=l:!t(c)&&i.greaterThanOrEquals(h,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height),t(u)&&(t(c)||(c=r.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,r.y,Math.max(c-u,1),this.height))}},r}),i("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var i=document.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=v.none,this._touchMode=y.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=c(this),this._onMouseUp=h(this),this._onMouseMove=d(this),this._onMouseWheel=p(this),this._onTouchStart=m(this),this._onTouchMove=_(this),this._onTouchEnd=f(this);var r=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return e<10?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==v.touchOnly&&(0===t.button?(e._mouseMode=v.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=v.zoom:e._mouseMode=v.slide)),t.preventDefault()}}function h(e){return function(t){e._mouseMode=v.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function d(e){return function(t){var i;if(e._mouseMode===v.scrub){t.preventDefault();var r=t.clientX-e._topDiv.getBoundingClientRect().left;r<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):r>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(r,r*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===v.slide){if(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i){var o=i*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===v.zoom&&(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i&&e.zoomFrom(Math.pow(1.01,i)))}}function p(e){return function(t){var i=t.wheelDeltaY||t.wheelDelta||-t.detail;g=Math.max(Math.min(Math.abs(i),g),1),i/=g,e.zoomFrom(Math.pow(1.05,-i))}}function m(e){return function(t){var i,r,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=v.touchOnly,1===o?(i=n.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function f(e){return function(t){var i=t.touches.length,r=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._onTouchMove(t)):e._touchMode===y.scrub&&e._onTouchMove(t),e._mouseMode=v.touchOnly,1!==i?e._touchMode=i>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-r),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _(e){return function(i){var r,o,a,s,l,u,c=1,h=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=v.touchOnly,e._touchMode===y.scrub?(i.preventDefault(),1===i.changedTouches.length&&(o=i.changedTouches[0].clientX-h,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(a=i.touches.length,2===a?(s=.5*(i.touches[0].clientX+i.touches[1].clientX)-h,l=Math.abs(i.touches[0].clientX-i.touches[1].clientX)):1===a&&(s=i.touches[0].clientX-h,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(r=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,r*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var g=1e12,v={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},C=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},l.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t,i){var r=new a(e,t,i);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,i,r){var n=new s(e,t,i,r);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,i){if(this._startJulian=t,this._endJulian=i,this._timeBarSecondsSpan=n.secondsDifference(i,t),
this._clock&&this._clock.clockRange!==e.UNBOUNDED){var r=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,r),s=n.secondsDifference(r,this._startJulian),l=n.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=n.addSeconds(this._endJulian,s,new n),this._startJulian=r,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):l<0&&(this._startJulian=n.addSeconds(this._startJulian,l,new n),this._endJulian=o,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,i*e-i,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),i=t.millisecond,r=" UTC";if(i>0&&this._timeBarSecondsSpan<3600){for(r=Math.floor(i).toString();r.length<3;)r="0"+r;r="."+r}return w[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+r},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(E/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function i(e){return(e-E)/_}function r(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.secondsDifference(this._scrubJulian,this._startJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var h="",d=.01,p=31536e6,m=1e-10,f=0,_=this._timeBarSecondsSpan;_<d?(_=d,this._timeBarSecondsSpan=d,this._endJulian=n.addSeconds(this._startJulian,d,new n)):_>p&&(_=p,this._timeBarSecondsSpan=p,this._endJulian=n.addSeconds(this._startJulian,p,new n));var g=this._timeBarEle.clientWidth;g<10&&(g=10);var v,y=this._startJulian,w=Math.min(_/g*1e-5,.4),S=n.toGregorianDate(y);v=_>31536e4?n.fromDate(new Date(Date.UTC(100*Math.floor(S.year/100),0))):_>31536e3?n.fromDate(new Date(Date.UTC(10*Math.floor(S.year/10),0))):_>86400?n.fromDate(new Date(Date.UTC(S.year,0))):n.fromDate(new Date(Date.UTC(S.year,S.month,S.day)));var E=n.secondsDifference(this._startJulian,n.addSeconds(v,w,new n)),b=E+_;this._epochJulian=v,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-d,new n));var T=this._rulerEle.offsetWidth+20;T<30&&(T=180);var x=f;f-=m;var A={startTime:E,startJulian:y,epochJulian:v,duration:_,timeBarWidth:g,getAlpha:i};this._highlightRanges.forEach(function(e){h+=e.render(A)});var P=0,D=0,M=0,I=T/g;I>1&&(I=1),I*=this._timeBarSecondsSpan;var R,O=-1,N=-1,L=C.length;for(R=0;R<L;++R){var B=C[R];if(++O,P=B,B>I&&B>f)break;N<0&&g*(B/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=O)}if(O>0){for(;O>0;)if(--O,Math.abs(r(P,C[O]))<1e-5){C[O]>=f&&(D=C[O]);break}if(N>=0)for(;N<O;){if(Math.abs(r(D,C[N]))<1e-5&&C[N]>=f){M=C[N];break}++N}}f=x,f>m&&M<1e-5&&Math.abs(f-P)>m&&(M=f,f<=P+m&&(D=0));var F,V=-999999;if(g*(M/this._timeBarSecondsSpan)>=3)for(o=e(M);o<=b;o=t(o,M))h+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(D/this._timeBarSecondsSpan)>=3)for(o=e(D);o<=b;o=t(o,D))h+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(P/this._timeBarSecondsSpan)>=2){this._mainTicSpan=P,b+=P,o=e(P);for(var k=n.computeTaiMinusUtc(v);o<=b;){var z=n.addSeconds(y,o-E,new n);if(P>2.1){var U=n.computeTaiMinusUtc(z);Math.abs(U-k)>.1&&(o+=U-k,z=n.addSeconds(y,o-E,new n))}var G=Math.round(g*i(o)),W=this.makeLabel(z);this._rulerEle.innerHTML=W,F=this._rulerEle.offsetWidth,F<10&&(F=T);var H=G-(F/2-1);H>V?(V=H+F+5,h+='<span class="cesium-timeline-ticMain" style="left: '+G.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+H.toString()+'px;">'+W+"</span>"):h+='<span class="cesium-timeline-ticSub" style="left: '+G.toString()+'px;"></span>',o=t(o,P)}}else this._mainTicSpan=-1;h+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0 0;"></span>',a.innerHTML=h,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),A.y=0,this._trackList.forEach(function(e){e.render(c._context,A),A.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var i=n.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==r&&(this._lastXPos=r,e.style.left=r-8+"px",this._needleEle.style.left=r+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),this._scrubElement){var i=e-8;this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var r=document.createEvent("Event");r.initEvent("settime",!0,!0),r.clientX=e,r.timeSeconds=t,r.timeJulian=this._scrubJulian,r.clock=this._clock,this._topDiv.dispatchEvent(r)},l.prototype.resize=function(){var e=this.container.clientWidth,t=this.container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){this._trackContainer.style.height=t+"px";var i=1;this._trackList.forEach(function(e){i+=e.height}),this._trackListEle.style.height=i.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=i,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t}},l}),i("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){var i=!1,r=window.screen;return t(r)&&(t(r.lockOrientation)?i=r.lockOrientation(e):t(r.mozLockOrientation)?i=r.mozLockOrientation(e):t(r.msLockOrientation)?i=r.msLockOrientation(e):t(r.orientation&&r.orientation.lock)&&(i=r.orientation.lock(e))),i}function h(){var e=window.screen;t(e)&&(t(e.unlockOrientation)?e.unlockOrientation():t(e.mozUnlockOrientation)?e.mozUnlockOrientation():t(e.msUnlockOrientation)?e.msUnlockOrientation():t(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function d(e,t,i){i()?(t.useWebVR=!1,e._locked&&(h(),e._locked=!1),e._noSleep.disable(),o.exitFullscreen(),i(!1)):(o.fullscreen||o.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=c("landscape")),t.useWebVR=!0,i(!0))}function p(t,i){var r=this,n=a.observable(o.enabled),c=a.observable(!1);this.isVRMode=void 0,a.defineProperty(this,"isVRMode",{get:function(){return c()}}),this.isVREnabled=void 0,a.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&o.enabled)}}),this.tooltip=void 0,a.defineProperty(this,"tooltip",function(){return n()?c()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"}),this._locked=!1,this._noSleep=new s,this._command=l(function(){d(r,t,c)},a.getObservable(this,"isVREnabled")),this._vrElement=e(u(i),document.body),this._callback=function(){!o.fullscreen&&c()&&(t.useWebVR=!1,r._locked&&(h(),r._locked=!1),r._noSleep.disable(),c(!1))},document.addEventListener(o.changeEventName,this._callback)}return i(p.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){r(this)},p}),i("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._exitVRPath=u,r._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}var l="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",u="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),i("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/isArray","../../Core/Matrix4","../../Core/Rectangle","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/ImageryLayer","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z){"use strict";function U(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function G(e,t){var n=e.scene.pick(t.position);if(r(n)){var o=i(n.id,n.primitive.id);if(o instanceof _)return o}if(r(e.scene.globe))return H(e,t.position)}function W(e,t,i){if(r(i)){var n=i.clock;r(n)&&(n.getValue(t),r(e)&&(e.updateFromClock(),e.zoomTo(n.startTime,n.stopTime)))}}function H(e,t){var i=e.scene,n=i.camera.getPickRay(t),o=i.imageryLayers.pickImageryLayerFeatures(n,i);if(r(o)){var a=new _({id:"Loading...",description:"Loading feature information..."});return S(o,function(t){if(e.selectedEntity===a){if(!r(t)||0===t.length)return void(e.selectedEntity=q());var i=t[0],n=new _({id:i.name,description:i.description});if(r(i.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,ee);n.position=new p(o)}e.selectedEntity=n}},function(){e.selectedEntity===a&&(e.selectedEntity=q())}),a}}function q(){return new _({id:"None",description:"No features found."})}function j(e,t){var i=e._geocoder,n=e._homeButton,o=e._sceneModePicker,a=e._baseLayerPicker,s=e._animation,l=e._timeline,u=e._fullscreenButton,c=e._infoBox,h=e._selectionIndicator,d=t?"hidden":"visible";if(r(i)&&(i.container.style.visibility=d),r(n)&&(n.container.style.visibility=d),r(o)&&(o.container.style.visibility=d),r(a)&&(a.container.style.visibility=d),r(s)&&(s.container.style.visibility=d),r(l)&&(l.container.style.visibility=d),r(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=d),r(c)&&(c.container.style.visibility=d),r(h)&&(h.container.style.visibility=d),e._container){var p=t||!r(u)?0:u.container.clientWidth;e._vrButton.container.style.right=p+"px",e.forceResize()}}function Y(e,t){function n(e){var t=G(l,e);r(t)&&(v.getValueOrUndefined(t.position,l.clock.currentTime)?l.trackedEntity=t:l.zoomTo(t))}function o(e){l.selectedEntity=G(l,e)}e=R(e),t=i(t,i.EMPTY_OBJECT);var a=!(r(t.globe)&&t.globe===!1||r(t.baseLayerPicker)&&t.baseLayerPicker===!1),l=this,u=document.createElement("div");u.className="cesium-viewer",e.appendChild(u);var c=document.createElement("div");c.className="cesium-viewer-cesiumWidgetContainer",u.appendChild(c);var d=document.createElement("div");d.className="cesium-viewer-bottom",u.appendChild(d);var p=i(t.scene3DOnly,!1),_=new P(c,{terrainProvider:t.terrainProvider,imageryProvider:!a&&t.imageryProvider,clock:t.clock,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,creditContainer:r(t.creditContainer)?t.creditContainer:d,scene3DOnly:p,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D}),g=t.dataSources,y=!1;r(g)||(g=new m,y=!0);var C=new f({scene:_.scene,dataSourceCollection:g}),S=_.clock,W=new D(S),H=new s;H.add(S.onTick,Y.prototype._onTick,this),H.add(_.scene.morphStart,Y.prototype._clearTrackedObject,this);var q;if(!r(t.selectionIndicator)||t.selectionIndicator!==!1){var X=document.createElement("div");X.className="cesium-viewer-selectionIndicatorContainer",u.appendChild(X),q=new F(X,_.scene)}var Z;if(!r(t.infoBox)||t.infoBox!==!1){var K=document.createElement("div");K.className="cesium-viewer-infoBoxContainer",u.appendChild(K),Z=new N(K);var Q=Z.viewModel;H.add(Q.cameraClicked,Y.prototype._onInfoBoxCameraClicked,this),H.add(Q.closeClicked,Y.prototype._onInfoBoxClockClicked,this)}var J=document.createElement("div");J.className="cesium-viewer-toolbar",u.appendChild(J);var $;if(!r(t.geocoder)||t.geocoder!==!1){var ee=document.createElement("div");ee.className="cesium-viewer-geocoderContainer",J.appendChild(ee),$=new I({container:ee,scene:_.scene}),H.add($.viewModel.search.beforeExecute,Y.prototype._clearObjects,this)}var te;r(t.homeButton)&&t.homeButton===!1||(te=new O(J,_.scene),r($)&&H.add(te.viewModel.command.afterExecute,function(){var e=$.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),H.add(te.viewModel.command.beforeExecute,Y.prototype._clearTrackedObject,this));var ie;p||r(t.sceneModePicker)&&t.sceneModePicker===!1||(ie=new B(J,_.scene));var re,ne;if(a){var oe=i(t.imageryProviderViewModels,x()),ae=i(t.terrainProviderViewModels,A());re=new T(J,{globe:_.scene.globe,imageryProviderViewModels:oe,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:ae,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var se=J.getElementsByClassName("cesium-baseLayerPicker-dropDown");ne=se[0]}var le;if(!r(t.navigationHelpButton)||t.navigationHelpButton!==!1){var ue=!0;try{if(r(window.localStorage)){var ce=window.localStorage.getItem("cesium-hasSeenNavHelp");r(ce)&&Boolean(ce)?ue=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}le=new L({container:J,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,ue)})}var he;if(!r(t.animation)||t.animation!==!1){var de=document.createElement("div");de.className="cesium-viewer-animationContainer",u.appendChild(de),he=new E(de,new b(W))}var pe;if(!r(t.timeline)||t.timeline!==!1){var me=document.createElement("div");me.className="cesium-viewer-timelineContainer",u.appendChild(me),pe=new k(me,S),pe.addEventListener("settime",U,!1),pe.zoomTo(S.startTime,S.stopTime)}var fe,_e;if(!r(t.fullscreenButton)||t.fullscreenButton!==!1){var ge=document.createElement("div");ge.className="cesium-viewer-fullscreenContainer",u.appendChild(ge),fe=new M(ge,t.fullscreenElement),_e=V(fe.viewModel,"isFullscreenEnabled",function(e){ge.style.display=e?"block":"none",r(pe)&&(pe.container.style.right=ge.clientWidth+"px",pe.resize())})}var ve,ye,Ce;if(t.vrButton){var we=document.createElement("div");we.className="cesium-viewer-vrContainer",u.appendChild(we),ve=new z(we,_.scene,t.fullScreenElement),ye=V(ve.viewModel,"isVREnabled",function(e){we.style.display=e?"block":"none",r(fe)&&(we.style.right=ge.clientWidth+"px"),r(pe)&&(pe.container.style.right=we.clientWidth+"px",pe.resize())}),Ce=V(ve.viewModel,"isVRMode",function(e){j(l,e)})}this._baseLayerPickerDropDown=ne,this._fullscreenSubscription=_e,this._vrSubscription=ye,this._vrModeSubscription=Ce,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=d,this._element=u,this._cesiumWidget=_,this._selectionIndicator=q,this._infoBox=Z,this._dataSourceCollection=g,this._destroyDataSourceCollection=y,this._dataSourceDisplay=C,this._clockViewModel=W,this._toolbar=J,this._homeButton=te,this._sceneModePicker=ie,this._baseLayerPicker=re,this._navigationHelpButton=le,this._animation=he,this._timeline=pe,this._fullscreenButton=fe,this._vrButton=ve,this._geocoder=$,this._eventHelper=H,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=r(Z)||r(q),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,w.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),H.add(g.dataSourceAdded,Y.prototype._onDataSourceAdded,this),H.add(g.dataSourceRemoved,Y.prototype._onDataSourceRemoved,this),H.add(_.scene.preRender,Y.prototype.resize,this),H.add(_.scene.postRender,Y.prototype._postRender,this);for(var Se=g.length,Ee=0;Ee<Se;Ee++)this._dataSourceAdded(g,g.get(Ee));this._dataSourceAdded(void 0,C.defaultDataSource),H.add(g.dataSourceAdded,Y.prototype._dataSourceAdded,this),H.add(g.dataSourceRemoved,Y.prototype._dataSourceRemoved,this),_.screenSpaceEventHandler.setInputAction(o,h.LEFT_CLICK),_.screenSpaceEventHandler.setInputAction(n,h.LEFT_DOUBLE_CLICK)}function X(e,t,n,o){K(e);var a=S.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=n,S(t,function(t){if(e._zoomPromise===a){if(t instanceof y)return void t.getViewableRectangle().then(function(t){e._zoomPromise===a&&(e._zoomTarget=t)});if(t.isLoading&&r(t.loadingEvent))var n=t.loadingEvent.addEventListener(function(){n(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else{if(l(t))return void(e._zoomTarget=t.slice(0));t=i(t.values,t),r(t.entities)&&(t=t.entities.values),l(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}}}),a.promise}function Z(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function K(e){var t=e._zoomPromise;r(t)&&(Z(e),t.resolve(!1))}function Q(t){var n=t._zoomTarget;if(r(n)&&t.scene.mode!==C.MORPHING){var o=t.scene,a=o.camera,s=t._zoomPromise,l=i(t._zoomOptions,{});if(n instanceof c){var h={destination:n,duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}};return t._zoomIsFlight?a.flyTo(h):(a.setView(h),s.resolve(!0)),void Z(t)}for(var p=[],m=0,f=n.length;m<f;m++){var _=t._dataSourceDisplay.getBoundingSphere(n[m],!1,$);if(_===d.PENDING)return;_!==d.FAILED&&p.push(e.clone($))}if(0===p.length)return void K(t);t.trackedEntity=void 0;var g=e.fromBoundingSpheres(p),v=o.screenSpaceCameraController;v.minimumZoomDistance=Math.min(v.minimumZoomDistance,.5*g.radius),t._zoomIsFlight?(Z(t),a.flyToBoundingSphere(g,{duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)},offset:l.offset})):(a.viewBoundingSphere(g,t._zoomOptions),a.lookAtTransform(u.IDENTITY),Z(t),s.resolve(!0))}}function J(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime,n=v.getValueOrUndefined(t.position,i);if(r(n)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,$);if(a!==d.PENDING){var s=o.mode;s!==C.COLUMBUS_VIEW&&s!==C.SCENE2D||(o.screenSpaceCameraController.enableTranslate=!1),s!==C.COLUMBUS_VIEW&&s!==C.SCENE3D||(o.screenSpaceCameraController.enableTilt=!1);var l=a!==d.FAILED?$:void 0;e._entityView=new g(t,o,o.mapProjection.ellipsoid),e._entityView.update(i,l),e._needTrackedEntityUpdate=!1}}}}var $=new e,ee=new t;return n(Y.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},clock:{get:function(){return this._cesiumWidget.clock}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e,this._forceResize=!0}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,K(this);var t=this.scene,i=t.mode;if(!r(e)||!r(e.position))return this._needTrackedEntityUpdate=!1,i!==C.COLUMBUS_VIEW&&i!==C.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==C.COLUMBUS_VIEW&&i!==C.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,void this.camera.lookAtTransform(u.IDENTITY);this._needTrackedEntityUpdate=!0}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(e)?r(t)&&t.animateAppear():r(t)&&t.animateDepart()}}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,W(this._timeline,this.clock,e))}}}),Y.prototype.extend=function(e,t){e(this,t)},Y.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,n=t.clientHeight,o=r(this._animation),a=r(this._timeline);if(this._forceResize||i!==this._lastWidth||n!==this._lastHeight){e.resize(),this._forceResize=!1;var s=n-125,l=this._baseLayerPickerDropDown;r(l)&&(l.style.maxHeight=s+"px"),r(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var u,c=this._timeline,h=0,d=0,p=0;if(o&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var m=this._lastWidth;u=this._animation.container,i>900?(h=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):i>=600?(h=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(h=106,(m>600||0===m)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=h+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var f=this._fullscreenButton,_=this._vrButton,g=c.container,v=g.style;p=g.clientHeight+3,v.left=h+"px";var y=0;r(f)&&(y+=f.container.clientWidth),r(_)&&(y+=_.container.clientWidth),v.right=y+"px",c.resize()}this._bottomContainer.style.left=d+"px",this._bottomContainer.style.bottom=p+"px",this._lastWidth=i,this._lastHeight=n}},Y.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Y.prototype.render=function(){this._cesiumWidget.render()},Y.prototype.isDestroyed=function(){return!1},Y.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(h.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(h.LEFT_DOUBLE_CLICK);var t=this.dataSources,i=t.length;for(e=0;e<i;e++)this._dataSourceRemoved(t,t.get(e));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),r(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),r(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),r(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),r(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),r(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),r(this._timeline)&&(this._timeline.removeEventListener("settime",U,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),r(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),r(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),r(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),r(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),o(this)},Y.prototype._dataSourceAdded=function(e,t){var i=t.entities;i.collectionChanged.addEventListener(Y.prototype._onEntityCollectionChanged,this)},Y.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(Y.prototype._onEntityCollectionChanged,this),r(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),r(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Y.prototype._onTick=function(e){var n=e.currentTime,o=this._dataSourceDisplay.update(n);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;if(r(a)){var s=this._trackedEntity,l=this._dataSourceDisplay.getBoundingSphere(s,!1,$);l===d.DONE&&a.update(n,$)}var u,c=!1,h=this.selectedEntity,p=r(h)&&this._enableInfoOrSelection;if(p&&h.isShowing&&h.isAvailable(n)){var m=this._dataSourceDisplay.getBoundingSphere(h,!0,$);m!==d.FAILED?u=$.center:r(h.position)&&(u=h.position.getValue(n,u)),c=r(u)}var f=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(f)&&(f.position=t.clone(u,f.position),f.showSelection=p&&c,f.update());var _=r(this._infoBox)?this._infoBox.viewModel:void 0;r(_)&&(_.showInfo=p,_.enableCamera=c,_.isCameraTracking=this.trackedEntity===this.selectedEntity,p?(_.titleText=i(h.name,h.id),_.description=v.getValueOrDefault(h.description,n,"")):(_.titleText="",_.description=""))},Y.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var o=i[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},Y.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,i=t.position;r(i)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity);
}},Y.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Y.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Y.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Y.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&W(this.timeline,this.clock,e)},Y.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,Y.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},Y.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,r=t.entities.id;if(this._dataSourceChangedListeners[r](),this._dataSourceChangedListeners[r]=void 0,i){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},Y.prototype.zoomTo=function(e,t){return X(this,e,t,!1)},Y.prototype.flyTo=function(e,t){return X(this,e,t,!0)},Y.prototype._postRender=function(){Q(this),J(this)},Y}),i("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,i,r){"use strict";function n(e){var i=document.createElement("div");i.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(i);var n=new r(i,e.scene);t(e,{cesiumInspector:{get:function(){return n}}}),e.scene.postRender.addEventListener(function(){e.cesiumInspector.viewModel.update()})}return n}),i("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../../DataSources/KmlDataSource","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r){function a(e){h(e),_&&(t.entities.removeAll(),t.dataSources.removeAll());for(var i=e.dataTransfer.files,r=i.length,n=0;n<r;n++){var o=i[n],a=new FileReader;a.onload=m(t,o,y,v),a.onerror=f(t,o),a.readAsText(o)}}r=e(r,e.EMPTY_OBJECT);var s=!0,l=e(r.flyToOnDrop,!0),c=new n,_=e(r.clearOnDrop,!0),g=e(r.dropTarget,t.container),v=e(r.clampToGround,!0),y=r.proxy;g=u(g),i(t,{dropTarget:{get:function(){return g},set:function(e){d(g,a),g=e,p(g,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?p(g,a):d(g,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return _},set:function(e){_=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return y},set:function(e){y=e}},clampToGround:{get:function(){return v},set:function(e){v=e}}}),p(g,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function h(e){e.stopPropagation(),e.preventDefault()}function d(e,i){var r=e;t(r)&&(r.removeEventListener("drop",i,!1),r.removeEventListener("dragenter",h,!1),r.removeEventListener("dragover",h,!1),r.removeEventListener("dragexit",h,!1))}function p(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",h,!1),e.addEventListener("dragover",h,!1),e.addEventListener("dragexit",h,!1)}function m(e,i,r,n){var o=e.scene;return function(u){var c=i.name;try{var h;if(/\.czml$/i.test(c))h=a.load(JSON.parse(u.target.result),{sourceUri:c});else if(/\.geojson$/i.test(c)||/\.json$/i.test(c)||/\.topojson$/i.test(c))h=s.load(JSON.parse(u.target.result),{sourceUri:c,clampToGround:n});else{if(!/\.(kml|kmz)$/i.test(c))return void e.dropError.raiseEvent(e,c,"Unrecognized file: "+c);h=l.load(i,{sourceUri:c,proxy:r,camera:o.camera,canvas:o.canvas})}t(h)&&e.dataSources.add(h).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,c,t)})}catch(t){e.dropError.raiseEvent(e,c,t)}}}function f(e,t){return function(i){e.dropError.raiseEvent(e,t.name,i.target.error)}}return c}),i("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,i,r,n){"use strict";function o(t,r){r=e(r,e.EMPTY_OBJECT);var o=new n({scene:t.scene,container:t.bottomContainer,lowFrameRateMessage:r.lowFrameRateMessage});i(t,{performanceWatchdog:{get:function(){return o}}})}return o}),i("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,i){"use strict";function r(r){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=r(l.parameters,o)}catch(e){e instanceof Error?a.error={name:e.name,message:e.message,stack:e.stack}:a.error=e}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(e){a.result=void 0,a.error="postMessage failed with error: "+i(e)+"\n  with responseMessage: "+JSON.stringify(a),n(a)}}}return r}),i("Cesium",["./Core/appendForwardSlash","./Core/ArcGisImageServerTerrainProvider","./Core/arrayRemoveDuplicates","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/Check","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/Credit","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/DistanceDisplayCondition","./Core/DistanceDisplayConditionGeometryInstanceAttribute","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidalOccluder","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/formatError","./Core/freezeObject","./Core/Fullscreen","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeadingPitchRoll","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/Intersections2D","./Core/IntersectionTests","./Core/Interval","./Core/isArray","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/Iso8601","./Core/joinUrls","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/MapboxApi","./Core/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/mergeSort","./Core/NearFarScalar","./Core/objectToQuery","./Core/Occluder","./Core/oneTimeWarning","./Core/OrientedBoundingBox","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PointGeometry","./Core/pointInsideTriangle","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/queryToObject","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/sampleTerrain","./Core/scaleToGeodeticSurface","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/subdivideArray","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/throttleRequestByServer","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/TrustedServers","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebGLConstants","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/BoundingSphereState","./DataSources/BoxGeometryUpdater","./DataSources/BoxGraphics","./DataSources/CallbackProperty","./DataSources/CheckerboardMaterialProperty","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CorridorGeometryUpdater","./DataSources/CorridorGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/CustomDataSource","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/dynamicGeometryGetBoundingSphere","./DataSources/DynamicGeometryUpdater","./DataSources/EllipseGeometryUpdater","./DataSources/EllipseGraphics","./DataSources/EllipsoidGeometryUpdater","./DataSources/EllipsoidGraphics","./DataSources/Entity","./DataSources/EntityCluster","./DataSources/EntityCollection","./DataSources/EntityView","./DataSources/GeoJsonDataSource","./DataSources/GeometryUpdater","./DataSources/GeometryVisualizer","./DataSources/GridMaterialProperty","./DataSources/ImageMaterialProperty","./DataSources/KmlDataSource","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVolumeGeometryUpdater","./DataSources/PolylineVolumeGraphics","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/PropertyBag","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/Rotation","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/ScaledPositionProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticGroundGeometryColorBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/VelocityVectorProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/RenderState","./Renderer/Sampler","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/BatchTable","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/ColorBlendMode","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./Scene/DebugCameraPrimitive","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/getAttributeOrUniformBySemantic","./Scene/getBinaryAccessor","./Scene/GetFeatureInfoFormat","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapboxImageryProvider","./Scene/MapMode2D","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMaterial","./Scene/modelMaterialsCommon","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OrthographicFrustum","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/PickDepth","./Scene/PointAppearance","./Scene/PointPrimitive","./Scene/PointPrimitiveCollection","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuadtreeOccluders","./Scene/QuadtreePrimitive","./Scene/QuadtreeTile","./Scene/QuadtreeTileLoadState","./Scene/QuadtreeTileProvider","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/ShadowMap","./Scene/ShadowMapShader","./Scene/ShadowMode","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingBox","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Shaders/AdjustTranslucentFS","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PointAppearanceFS","./Shaders/Appearances/PointAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/depthRange","./Shaders/Builtin/Constants/epsilon1","./Shaders/Builtin/Constants/epsilon2","./Shaders/Builtin/Constants/epsilon3","./Shaders/Builtin/Constants/epsilon4","./Shaders/Builtin/Constants/epsilon5","./Shaders/Builtin/Constants/epsilon6","./Shaders/Builtin/Constants/epsilon7","./Shaders/Builtin/Constants/infinity","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/passCompute","./Shaders/Builtin/Constants/passEnvironment","./Shaders/Builtin/Constants/passGlobe","./Shaders/Builtin/Constants/passGround","./Shaders/Builtin/Constants/passOpaque","./Shaders/Builtin/Constants/passOverlay","./Shaders/Builtin/Constants/passTranslucent","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/cascadeColor","./Shaders/Builtin/Functions/cascadeDistance","./Shaders/Builtin/Functions/cascadeMatrix","./Shaders/Builtin/Functions/cascadeWeights","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/cosineAndSine","./Shaders/Builtin/Functions/decompressTextureCoordinates","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/metersPerPixel","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/nearFarScalar","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/packDepth","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/shadowDepthCompare","./Shaders/Builtin/Functions/shadowVisibility","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/Builtin/Structs/shadowParameters","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/FXAA","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/earcut-2.1.1","./ThirdParty/gltfDefaults","./ThirdParty/kdbush","./ThirdParty/knockout-3.4.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/when","./ThirdParty/zip","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/createCommand","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/getElement","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/subscribeAndEvaluate","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,i,r,n,o,a,s,l,u,c,h,d,p,m,f,_,g,v,y,C,w,S,E,b,T,x,A,P,D,M,I,R,O,N,L,B,F,V,k,z,U,G,W,H,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,he,de,pe,me,fe,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,De,Me,Ie,Re,Oe,Ne,Le,Be,Fe,Ve,ke,ze,Ue,Ge,We,He,qe,je,Ye,Xe,Ze,Ke,Qe,Je,$e,et,tt,it,rt,nt,ot,at,st,lt,ut,ct,ht,dt,pt,mt,ft,_t,gt,vt,yt,Ct,wt,St,Et,bt,Tt,xt,At,Pt,Dt,Mt,It,Rt,Ot,Nt,Lt,Bt,Ft,Vt,kt,zt,Ut,Gt,Wt,Ht,qt,jt,Yt,Xt,Zt,Kt,Qt,Jt,$t,ei,ti,ii,ri,ni,oi,ai,si,li,ui,ci,hi,di,pi,mi,fi,_i,gi,vi,yi,Ci,wi,Si,Ei,bi,Ti,xi,Ai,Pi,Di,Mi,Ii,Ri,Oi,Ni,Li,Bi,Fi,Vi,ki,zi,Ui,Gi,Wi,Hi,qi,ji,Yi,Xi,Zi,Ki,Qi,Ji,$i,er,tr,ir,rr,nr,or,ar,sr,lr,ur,cr,hr,dr,pr,mr,fr,_r,gr,vr,yr,Cr,wr,Sr,Er,br,Tr,xr,Ar,Pr,Dr,Mr,Ir,Rr,Or,Nr,Lr,Br,Fr,Vr,kr,zr,Ur,Gr,Wr,Hr,qr,jr,Yr,Xr,Zr,Kr,Qr,Jr,$r,en,tn,rn,nn,on,an,sn,ln,un,cn,hn,dn,pn,mn,fn,_n,gn,vn,yn,Cn,wn,Sn,En,bn,Tn,xn,An,Pn,Dn,Mn,In,Rn,On,Nn,Ln,Bn,Fn,Vn,kn,zn,Un,Gn,Wn,Hn,qn,jn,Yn,Xn,Zn,Kn,Qn,Jn,$n,eo,to,io,ro,no,oo,ao,so,lo,uo,co,ho,po,mo,fo,_o,go,vo,yo,Co,wo,So,Eo,bo,To,xo,Ao,Po,Do,Mo,Io,Ro,Oo,No,Lo,Bo,Fo,Vo,ko,zo,Uo,Go,Wo,Ho,qo,jo,Yo,Xo,Zo,Ko,Qo,Jo,$o,ea,ta,ia,ra,na,oa,aa,sa,la,ua,ca,ha,da,pa,ma,fa,_a,ga,va,ya,Ca,wa,Sa,Ea,ba,Ta,xa,Aa,Pa,Da,Ma,Ia,Ra,Oa,Na,La,Ba,Fa,Va,ka,za,Ua,Ga,Wa,Ha,qa,ja,Ya,Xa,Za,Ka,Qa,Ja,$a,es,ts,is,rs,ns,os,as,ss,ls,us,cs,hs,ds,ps,ms,fs,_s,gs,vs,ys,Cs,ws,Ss,Es,bs,Ts,xs,As,Ps,Ds,Ms,Is,Rs,Os,Ns,Ls,Bs,Fs,Vs,ks,zs,Us,Gs,Ws,Hs,qs,js,Ys,Xs,Zs,Ks,Qs,Js,$s,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,hl,dl,pl,ml,fl,_l,gl,vl,yl,Cl,wl,Sl,El,bl,Tl,xl,Al,Pl,Dl,Ml,Il,Rl,Ol,Nl,Ll,Bl,Fl,Vl,kl,zl,Ul,Gl,Wl,Hl,ql,jl,Yl,Xl,Zl,Kl,Ql,Jl,$l,eu,tu,iu,ru,nu,ou,au,su,lu,uu,cu,hu,du,pu,mu,fu,_u,gu,vu,yu,Cu,wu,Su,Eu,bu,Tu,xu,Au,Pu,Du,Mu,Iu,Ru,Ou,Nu,Lu,Bu,Fu,Vu,ku,zu,Uu,Gu,Wu,Hu,qu,ju,Yu,Xu,Zu,Ku,Qu,Ju,$u,ec,tc,ic,rc,nc,oc,ac,sc,lc,uc,cc,hc,dc,pc,mc,fc,_c,gc,vc,yc,Cc,wc,Sc,Ec,bc,Tc,xc,Ac,Pc,Dc,Mc,Ic,Rc,Oc,Nc,Lc,Bc,Fc,Vc,kc,zc,Uc,Gc,Wc,Hc,qc,jc,Yc,Xc,Zc,Kc,Qc,Jc,$c,eh,th,ih,rh,nh,oh,ah,sh,lh,uh,ch,hh,dh,ph,mh,fh,_h,gh,vh,yh,Ch,wh,Sh,Eh,bh,Th,xh,Ah,Ph,Dh,Mh){"use strict";var Ih={VERSION:"1.29",_shaders:{}};return Ih.appendForwardSlash=e,Ih.ArcGisImageServerTerrainProvider=t,Ih.arrayRemoveDuplicates=i,Ih.AssociativeArray=r,Ih.AttributeCompression=n,Ih.AxisAlignedBoundingBox=o,Ih.barycentricCoordinates=a,Ih.binarySearch=s,Ih.BingMapsApi=l,Ih.BoundingRectangle=u,Ih.BoundingSphere=c,Ih.BoxGeometry=h,Ih.BoxOutlineGeometry=d,Ih.buildModuleUrl=p,Ih.cancelAnimationFrame=m,Ih.Cartesian2=f,Ih.Cartesian3=_,Ih.Cartesian4=g,Ih.Cartographic=v,Ih.CatmullRomSpline=y,Ih.CesiumTerrainProvider=C,Ih.Check=w,Ih.CircleGeometry=S,Ih.CircleOutlineGeometry=E,Ih.Clock=b,Ih.ClockRange=T,Ih.ClockStep=x,Ih.clone=A,Ih.Color=P,Ih.ColorGeometryInstanceAttribute=D,Ih.combine=M,Ih.ComponentDatatype=I,Ih.CornerType=R,Ih.CorridorGeometry=O,Ih.CorridorGeometryLibrary=N,Ih.CorridorOutlineGeometry=L,Ih.createGuid=B,Ih.Credit=F,Ih.CubicRealPolynomial=V,Ih.CylinderGeometry=k,Ih.CylinderGeometryLibrary=z,Ih.CylinderOutlineGeometry=U,Ih.DefaultProxy=G,Ih.defaultValue=W,Ih.defined=H,Ih.defineProperties=q,Ih.deprecationWarning=j,Ih.destroyObject=Y,Ih.DeveloperError=X,Ih.DistanceDisplayCondition=Z,Ih.DistanceDisplayConditionGeometryInstanceAttribute=K,Ih.EarthOrientationParameters=Q,Ih.EarthOrientationParametersSample=J,Ih.EasingFunction=$,Ih.EllipseGeometry=ee,Ih.EllipseGeometryLibrary=te,Ih.EllipseOutlineGeometry=ie,Ih.Ellipsoid=re,Ih.EllipsoidalOccluder=ne,Ih.EllipsoidGeodesic=oe,Ih.EllipsoidGeometry=ae,Ih.EllipsoidOutlineGeometry=se,Ih.EllipsoidTangentPlane=le,Ih.EllipsoidTerrainProvider=ue,Ih.EncodedCartesian3=ce,Ih.Event=he,Ih.EventHelper=de,Ih.ExtrapolationType=pe,Ih.FeatureDetection=me,Ih.formatError=fe,Ih.freezeObject=_e,Ih.Fullscreen=ge,Ih.GeographicProjection=ve,Ih.GeographicTilingScheme=ye,Ih.Geometry=Ce,Ih.GeometryAttribute=we,Ih.GeometryAttributes=Se,Ih.GeometryInstance=Ee,Ih.GeometryInstanceAttribute=be,Ih.GeometryPipeline=Te,Ih.GeometryType=xe,Ih.getAbsoluteUri=Ae,Ih.getBaseUri=Pe,Ih.getExtensionFromUri=De,Ih.getFilenameFromUri=Me,Ih.getImagePixels=Ie,Ih.getMagic=Re,Ih.getStringFromTypedArray=Oe,Ih.getTimestamp=Ne,Ih.GregorianDate=Le,Ih.HeadingPitchRange=Be,Ih.HeadingPitchRoll=Fe,Ih.HeightmapTerrainData=Ve,Ih.HeightmapTessellator=ke,Ih.HermitePolynomialApproximation=ze,Ih.HermiteSpline=Ue,Ih.Iau2000Orientation=Ge,Ih.Iau2006XysData=We,Ih.Iau2006XysSample=He,Ih.IauOrientationAxes=qe,Ih.IauOrientationParameters=je,Ih.IndexDatatype=Ye,Ih.InterpolationAlgorithm=Xe,Ih.Intersect=Ze,Ih.Intersections2D=Ke,Ih.IntersectionTests=Qe,Ih.Interval=Je,Ih.isArray=$e,Ih.isCrossOriginUrl=et,Ih.isLeapYear=tt,Ih.Iso8601=it,Ih.joinUrls=rt,Ih.JulianDate=nt,Ih.KeyboardEventModifier=ot,Ih.LagrangePolynomialApproximation=at,Ih.LeapSecond=st,Ih.LinearApproximation=lt,Ih.LinearSpline=ut,Ih.loadArrayBuffer=ct,Ih.loadBlob=ht,Ih.loadImage=dt,Ih.loadImageFromTypedArray=pt,Ih.loadImageViaBlob=mt,Ih.loadJson=ft,Ih.loadJsonp=_t,Ih.loadText=gt,Ih.loadWithXhr=vt,Ih.loadXML=yt,Ih.MapboxApi=Ct,Ih.MapProjection=wt,Ih.Math=St,Ih.Matrix2=Et,Ih.Matrix3=bt,Ih.Matrix4=Tt,Ih.mergeSort=xt,Ih.NearFarScalar=At,Ih.objectToQuery=Pt,Ih.Occluder=Dt,Ih.oneTimeWarning=Mt,Ih.OrientedBoundingBox=It,Ih.Packable=Rt,Ih.PackableForInterpolation=Ot,Ih.parseResponseHeaders=Nt,Ih.PinBuilder=Lt,Ih.PixelFormat=Bt,Ih.Plane=Ft,Ih.PointGeometry=Vt,Ih.pointInsideTriangle=kt,Ih.PolygonGeometry=zt,Ih.PolygonGeometryLibrary=Ut,Ih.PolygonHierarchy=Gt,Ih.PolygonOutlineGeometry=Wt,Ih.PolygonPipeline=Ht,Ih.PolylineGeometry=qt,
Ih.PolylinePipeline=jt,Ih.PolylineVolumeGeometry=Yt,Ih.PolylineVolumeGeometryLibrary=Xt,Ih.PolylineVolumeOutlineGeometry=Zt,Ih.PrimitiveType=Kt,Ih.QuadraticRealPolynomial=Qt,Ih.QuantizedMeshTerrainData=Jt,Ih.QuarticRealPolynomial=$t,Ih.Quaternion=ei,Ih.QuaternionSpline=ti,Ih.queryToObject=ii,Ih.Queue=ri,Ih.Ray=ni,Ih.Rectangle=oi,Ih.RectangleGeometry=ai,Ih.RectangleGeometryLibrary=si,Ih.RectangleOutlineGeometry=li,Ih.ReferenceFrame=ui,Ih.requestAnimationFrame=ci,Ih.RequestErrorEvent=hi,Ih.RuntimeError=di,Ih.sampleTerrain=pi,Ih.scaleToGeodeticSurface=mi,Ih.ScreenSpaceEventHandler=fi,Ih.ScreenSpaceEventType=_i,Ih.ShowGeometryInstanceAttribute=gi,Ih.Simon1994PlanetaryPositions=vi,Ih.SimplePolylineGeometry=yi,Ih.SphereGeometry=Ci,Ih.SphereOutlineGeometry=wi,Ih.Spherical=Si,Ih.Spline=Ei,Ih.subdivideArray=bi,Ih.TaskProcessor=Ti,Ih.TerrainData=xi,Ih.TerrainEncoding=Ai,Ih.TerrainMesh=Pi,Ih.TerrainProvider=Di,Ih.TerrainQuantization=Mi,Ih.throttleRequestByServer=Ii,Ih.TileProviderError=Ri,Ih.TilingScheme=Oi,Ih.TimeConstants=Ni,Ih.TimeInterval=Li,Ih.TimeIntervalCollection=Bi,Ih.TimeStandard=Fi,Ih.Tipsify=Vi,Ih.Transforms=ki,Ih.TranslationRotationScale=zi,Ih.TridiagonalSystemSolver=Ui,Ih.TrustedServers=Gi,Ih.VertexFormat=Wi,Ih.VideoSynchronizer=Hi,Ih.Visibility=qi,Ih.VRTheWorldTerrainProvider=ji,Ih.WallGeometry=Yi,Ih.WallGeometryLibrary=Xi,Ih.WallOutlineGeometry=Zi,Ih.WebGLConstants=Ki,Ih.WebMercatorProjection=Qi,Ih.WebMercatorTilingScheme=Ji,Ih.WindingOrder=$i,Ih.wrapFunction=er,Ih.writeTextToCanvas=tr,Ih.BillboardGraphics=ir,Ih.BillboardVisualizer=rr,Ih.BoundingSphereState=nr,Ih.BoxGeometryUpdater=or,Ih.BoxGraphics=ar,Ih.CallbackProperty=sr,Ih.CheckerboardMaterialProperty=lr,Ih.ColorMaterialProperty=ur,Ih.CompositeEntityCollection=cr,Ih.CompositeMaterialProperty=hr,Ih.CompositePositionProperty=dr,Ih.CompositeProperty=pr,Ih.ConstantPositionProperty=mr,Ih.ConstantProperty=fr,Ih.CorridorGeometryUpdater=_r,Ih.CorridorGraphics=gr,Ih.createMaterialPropertyDescriptor=vr,Ih.createPropertyDescriptor=yr,Ih.createRawPropertyDescriptor=Cr,Ih.CustomDataSource=wr,Ih.CylinderGeometryUpdater=Sr,Ih.CylinderGraphics=Er,Ih.CzmlDataSource=br,Ih.DataSource=Tr,Ih.DataSourceClock=xr,Ih.DataSourceCollection=Ar,Ih.DataSourceDisplay=Pr,Ih.dynamicGeometryGetBoundingSphere=Dr,Ih.DynamicGeometryUpdater=Mr,Ih.EllipseGeometryUpdater=Ir,Ih.EllipseGraphics=Rr,Ih.EllipsoidGeometryUpdater=Or,Ih.EllipsoidGraphics=Nr,Ih.Entity=Lr,Ih.EntityCluster=Br,Ih.EntityCollection=Fr,Ih.EntityView=Vr,Ih.GeoJsonDataSource=kr,Ih.GeometryUpdater=zr,Ih.GeometryVisualizer=Ur,Ih.GridMaterialProperty=Gr,Ih.ImageMaterialProperty=Wr,Ih.KmlDataSource=Hr,Ih.LabelGraphics=qr,Ih.LabelVisualizer=jr,Ih.MaterialProperty=Yr,Ih.ModelGraphics=Xr,Ih.ModelVisualizer=Zr,Ih.NodeTransformationProperty=Kr,Ih.PathGraphics=Qr,Ih.PathVisualizer=Jr,Ih.PointGraphics=$r,Ih.PointVisualizer=en,Ih.PolygonGeometryUpdater=tn,Ih.PolygonGraphics=rn,Ih.PolylineArrowMaterialProperty=nn,Ih.PolylineGeometryUpdater=on,Ih.PolylineGlowMaterialProperty=an,Ih.PolylineGraphics=sn,Ih.PolylineOutlineMaterialProperty=ln,Ih.PolylineVolumeGeometryUpdater=un,Ih.PolylineVolumeGraphics=cn,Ih.PositionProperty=hn,Ih.PositionPropertyArray=dn,Ih.Property=pn,Ih.PropertyArray=mn,Ih.PropertyBag=fn,Ih.RectangleGeometryUpdater=_n,Ih.RectangleGraphics=gn,Ih.ReferenceProperty=vn,Ih.Rotation=yn,Ih.SampledPositionProperty=Cn,Ih.SampledProperty=wn,Ih.ScaledPositionProperty=Sn,Ih.StaticGeometryColorBatch=En,Ih.StaticGeometryPerMaterialBatch=bn,Ih.StaticGroundGeometryColorBatch=Tn,Ih.StaticOutlineGeometryBatch=xn,Ih.StripeMaterialProperty=An,Ih.StripeOrientation=Pn,Ih.TimeIntervalCollectionPositionProperty=Dn,Ih.TimeIntervalCollectionProperty=Mn,Ih.VelocityOrientationProperty=In,Ih.VelocityVectorProperty=Rn,Ih.Visualizer=On,Ih.WallGeometryUpdater=Nn,Ih.WallGraphics=Ln,Ih.AutomaticUniforms=Bn,Ih.Buffer=Fn,Ih.BufferUsage=Vn,Ih.ClearCommand=kn,Ih.ComputeCommand=zn,Ih.ComputeEngine=Un,Ih.Context=Gn,Ih.ContextLimits=Wn,Ih.createUniform=Hn,Ih.createUniformArray=qn,Ih.CubeMap=jn,Ih.CubeMapFace=Yn,Ih.DrawCommand=Xn,Ih.Framebuffer=Zn,Ih.loadCubeMap=Kn,Ih.MipmapHint=Qn,Ih.Pass=Jn,Ih.PassState=$n,Ih.PickFramebuffer=eo,Ih.PixelDatatype=to,Ih.Renderbuffer=io,Ih.RenderbufferFormat=ro,Ih.RenderState=no,Ih.Sampler=oo,Ih.ShaderCache=ao,Ih.ShaderProgram=so,Ih.ShaderSource=lo,Ih.Texture=uo,Ih.TextureMagnificationFilter=co,Ih.TextureMinificationFilter=ho,Ih.TextureWrap=po,Ih.UniformState=mo,Ih.VertexArray=fo,Ih.VertexArrayFacade=_o,Ih.Appearance=go,Ih.ArcGisMapServerImageryProvider=vo,Ih.BatchTable=yo,Ih.Billboard=Co,Ih.BillboardCollection=wo,Ih.BingMapsImageryProvider=So,Ih.BingMapsStyle=Eo,Ih.BlendEquation=bo,Ih.BlendFunction=To,Ih.BlendingState=xo,Ih.Camera=Ao,Ih.CameraEventAggregator=Po,Ih.CameraEventType=Do,Ih.CameraFlightPath=Mo,Ih.ColorBlendMode=Io,Ih.createOpenStreetMapImageryProvider=Ro,Ih.createTangentSpaceDebugPrimitive=Oo,Ih.createTileMapServiceImageryProvider=No,Ih.CreditDisplay=Lo,Ih.CullFace=Bo,Ih.CullingVolume=Fo,Ih.DebugAppearance=Vo,Ih.DebugCameraPrimitive=ko,Ih.DebugModelMatrixPrimitive=zo,Ih.DepthFunction=Uo,Ih.DepthPlane=Go,Ih.DeviceOrientationCameraController=Wo,Ih.DiscardMissingTileImagePolicy=Ho,Ih.EllipsoidPrimitive=qo,Ih.EllipsoidSurfaceAppearance=jo,Ih.Fog=Yo,Ih.FrameRateMonitor=Xo,Ih.FrameState=Zo,Ih.FrustumCommands=Ko,Ih.FXAA=Qo,Ih.getAttributeOrUniformBySemantic=Jo,Ih.getBinaryAccessor=$o,Ih.GetFeatureInfoFormat=ea,Ih.Globe=ta,Ih.GlobeDepth=ia,Ih.GlobeSurfaceShaderSet=ra,Ih.GlobeSurfaceTile=na,Ih.GlobeSurfaceTileProvider=oa,Ih.GoogleEarthImageryProvider=aa,Ih.GridImageryProvider=sa,Ih.GroundPrimitive=la,Ih.HeightReference=ua,Ih.HorizontalOrigin=ca,Ih.Imagery=ha,Ih.ImageryLayer=da,Ih.ImageryLayerCollection=pa,Ih.ImageryLayerFeatureInfo=ma,Ih.ImageryProvider=fa,Ih.ImageryState=_a,Ih.Label=ga,Ih.LabelCollection=va,Ih.LabelStyle=ya,Ih.MapboxImageryProvider=Ca,Ih.MapMode2D=wa,Ih.Material=Sa,Ih.MaterialAppearance=Ea,Ih.Model=ba,Ih.ModelAnimation=Ta,Ih.ModelAnimationCache=xa,Ih.ModelAnimationCollection=Aa,Ih.ModelAnimationLoop=Pa,Ih.ModelAnimationState=Da,Ih.ModelMaterial=Ma,Ih.modelMaterialsCommon=Ia,Ih.ModelMesh=Ra,Ih.ModelNode=Oa,Ih.Moon=Na,Ih.NeverTileDiscardPolicy=La,Ih.OIT=Ba,Ih.OrthographicFrustum=Fa,Ih.PerformanceDisplay=Va,Ih.PerInstanceColorAppearance=ka,Ih.PerspectiveFrustum=za,Ih.PerspectiveOffCenterFrustum=Ua,Ih.PickDepth=Ga,Ih.PointAppearance=Wa,Ih.PointPrimitive=Ha,Ih.PointPrimitiveCollection=qa,Ih.Polyline=ja,Ih.PolylineCollection=Ya,Ih.PolylineColorAppearance=Xa,Ih.PolylineMaterialAppearance=Za,Ih.Primitive=Ka,Ih.PrimitiveCollection=Qa,Ih.PrimitivePipeline=Ja,Ih.PrimitiveState=$a,Ih.QuadtreeOccluders=es,Ih.QuadtreePrimitive=ts,Ih.QuadtreeTile=is,Ih.QuadtreeTileLoadState=rs,Ih.QuadtreeTileProvider=ns,Ih.Scene=os,Ih.SceneMode=as,Ih.SceneTransforms=ss,Ih.SceneTransitioner=ls,Ih.ScreenSpaceCameraController=us,Ih.ShadowMap=cs,Ih.ShadowMapShader=hs,Ih.ShadowMode=ds,Ih.SingleTileImageryProvider=ps,Ih.SkyAtmosphere=ms,Ih.SkyBox=fs,Ih.StencilFunction=_s,Ih.StencilOperation=gs,Ih.Sun=vs,Ih.SunPostProcess=ys,Ih.TerrainState=Cs,Ih.TextureAtlas=ws,Ih.TileBoundingBox=Ss,Ih.TileCoordinatesImageryProvider=Es,Ih.TileDiscardPolicy=bs,Ih.TileImagery=Ts,Ih.TileReplacementQueue=xs,Ih.TileState=As,Ih.TileTerrain=Ps,Ih.TweenCollection=Ds,Ih.UrlTemplateImageryProvider=Ms,Ih.VerticalOrigin=Is,Ih.ViewportQuad=Rs,Ih.WebMapServiceImageryProvider=Os,Ih.WebMapTileServiceImageryProvider=Ns,Ih._shaders.AdjustTranslucentFS=Ls,Ih._shaders.AllMaterialAppearanceFS=Bs,Ih._shaders.AllMaterialAppearanceVS=Fs,Ih._shaders.BasicMaterialAppearanceFS=Vs,Ih._shaders.BasicMaterialAppearanceVS=ks,Ih._shaders.EllipsoidSurfaceAppearanceFS=zs,Ih._shaders.EllipsoidSurfaceAppearanceVS=Us,Ih._shaders.PerInstanceColorAppearanceFS=Gs,Ih._shaders.PerInstanceColorAppearanceVS=Ws,Ih._shaders.PerInstanceFlatColorAppearanceFS=Hs,Ih._shaders.PerInstanceFlatColorAppearanceVS=qs,Ih._shaders.PointAppearanceFS=js,Ih._shaders.PointAppearanceVS=Ys,Ih._shaders.PolylineColorAppearanceVS=Xs,Ih._shaders.PolylineMaterialAppearanceVS=Zs,Ih._shaders.TexturedMaterialAppearanceFS=Ks,Ih._shaders.TexturedMaterialAppearanceVS=Qs,Ih._shaders.BillboardCollectionFS=Js,Ih._shaders.BillboardCollectionVS=$s,Ih._shaders.degreesPerRadian=el,Ih._shaders.depthRange=tl,Ih._shaders.epsilon1=il,Ih._shaders.epsilon2=rl,Ih._shaders.epsilon3=nl,Ih._shaders.epsilon4=ol,Ih._shaders.epsilon5=al,Ih._shaders.epsilon6=sl,Ih._shaders.epsilon7=ll,Ih._shaders.infinity=ul,Ih._shaders.oneOverPi=cl,Ih._shaders.oneOverTwoPi=hl,Ih._shaders.passCompute=dl,Ih._shaders.passEnvironment=pl,Ih._shaders.passGlobe=ml,Ih._shaders.passGround=fl,Ih._shaders.passOpaque=_l,Ih._shaders.passOverlay=gl,Ih._shaders.passTranslucent=vl,Ih._shaders.pi=yl,Ih._shaders.piOverFour=Cl,Ih._shaders.piOverSix=wl,Ih._shaders.piOverThree=Sl,Ih._shaders.piOverTwo=El,Ih._shaders.radiansPerDegree=bl,Ih._shaders.sceneMode2D=Tl,Ih._shaders.sceneMode3D=xl,Ih._shaders.sceneModeColumbusView=Al,Ih._shaders.sceneModeMorphing=Pl,Ih._shaders.solarRadius=Dl,Ih._shaders.threePiOver2=Ml,Ih._shaders.twoPi=Il,Ih._shaders.webMercatorMaxLatitude=Rl,Ih._shaders.CzmBuiltins=Ol,Ih._shaders.alphaWeight=Nl,Ih._shaders.antialias=Ll,Ih._shaders.cascadeColor=Bl,Ih._shaders.cascadeDistance=Fl,Ih._shaders.cascadeMatrix=Vl,Ih._shaders.cascadeWeights=kl,Ih._shaders.columbusViewMorph=zl,Ih._shaders.computePosition=Ul,Ih._shaders.cosineAndSine=Gl,Ih._shaders.decompressTextureCoordinates=Wl,Ih._shaders.eastNorthUpToEyeCoordinates=Hl,Ih._shaders.ellipsoidContainsPoint=ql,Ih._shaders.ellipsoidNew=jl,Ih._shaders.ellipsoidWgs84TextureCoordinates=Yl,Ih._shaders.equalsEpsilon=Xl,Ih._shaders.eyeOffset=Zl,Ih._shaders.eyeToWindowCoordinates=Kl,Ih._shaders.fog=Ql,Ih._shaders.geodeticSurfaceNormal=Jl,Ih._shaders.getDefaultMaterial=$l,Ih._shaders.getLambertDiffuse=eu,Ih._shaders.getSpecular=tu,Ih._shaders.getWaterNoise=iu,Ih._shaders.getWgs84EllipsoidEC=ru,Ih._shaders.hue=nu,Ih._shaders.isEmpty=ou,Ih._shaders.isFull=au,Ih._shaders.latitudeToWebMercatorFraction=su,Ih._shaders.luminance=lu,Ih._shaders.metersPerPixel=uu,Ih._shaders.modelToWindowCoordinates=cu,Ih._shaders.multiplyWithColorBalance=hu,Ih._shaders.nearFarScalar=du,Ih._shaders.octDecode=pu,Ih._shaders.packDepth=mu,Ih._shaders.phong=fu,Ih._shaders.pointAlongRay=_u,Ih._shaders.rayEllipsoidIntersectionInterval=gu,Ih._shaders.RGBToXYZ=vu,Ih._shaders.saturation=yu,Ih._shaders.shadowDepthCompare=Cu,Ih._shaders.shadowVisibility=wu,Ih._shaders.signNotZero=Su,Ih._shaders.tangentToEyeSpaceMatrix=Eu,Ih._shaders.translateRelativeToEye=bu,Ih._shaders.translucentPhong=Tu,Ih._shaders.transpose=xu,Ih._shaders.unpackDepth=Au,Ih._shaders.windowToEyeCoordinates=Pu,Ih._shaders.XYZToRGB=Du,Ih._shaders.depthRangeStruct=Mu,Ih._shaders.ellipsoid=Iu,Ih._shaders.material=Ru,Ih._shaders.materialInput=Ou,Ih._shaders.ray=Nu,Ih._shaders.raySegment=Lu,Ih._shaders.shadowParameters=Bu,Ih._shaders.CompositeOITFS=Fu,Ih._shaders.DepthPlaneFS=Vu,Ih._shaders.DepthPlaneVS=ku,Ih._shaders.EllipsoidFS=zu,Ih._shaders.EllipsoidVS=Uu,Ih._shaders.GlobeFS=Gu,Ih._shaders.GlobeVS=Wu,Ih._shaders.GroundAtmosphere=Hu,Ih._shaders.BumpMapMaterial=qu,Ih._shaders.CheckerboardMaterial=ju,Ih._shaders.DotMaterial=Yu,Ih._shaders.FadeMaterial=Xu,Ih._shaders.GridMaterial=Zu,Ih._shaders.NormalMapMaterial=Ku,Ih._shaders.PolylineArrowMaterial=Qu,Ih._shaders.PolylineGlowMaterial=Ju,Ih._shaders.PolylineOutlineMaterial=$u,Ih._shaders.RimLightingMaterial=ec,Ih._shaders.StripeMaterial=tc,Ih._shaders.Water=ic,Ih._shaders.PointPrimitiveCollectionFS=rc,Ih._shaders.PointPrimitiveCollectionVS=nc,Ih._shaders.PolylineCommon=oc,Ih._shaders.PolylineFS=ac,Ih._shaders.PolylineVS=sc,Ih._shaders.AdditiveBlend=lc,Ih._shaders.BrightPass=uc,Ih._shaders.FXAA=cc,Ih._shaders.GaussianBlur1D=hc,Ih._shaders.PassThrough=dc,Ih._shaders.ReprojectWebMercatorFS=pc,Ih._shaders.ReprojectWebMercatorVS=mc,Ih._shaders.ShadowVolumeFS=fc,Ih._shaders.ShadowVolumeVS=_c,Ih._shaders.SkyAtmosphereFS=gc,Ih._shaders.SkyAtmosphereVS=vc,Ih._shaders.SkyBoxFS=yc,Ih._shaders.SkyBoxVS=Cc,Ih._shaders.SunFS=wc,Ih._shaders.SunTextureFS=Sc,Ih._shaders.SunVS=Ec,Ih._shaders.ViewportQuadFS=bc,Ih._shaders.ViewportQuadVS=Tc,Ih.Autolinker=xc,Ih["earcut-2.1.1"]=Ac,Ih.gltfDefaults=Pc,Ih.kdbush=Dc,Ih["knockout-3.4.0"]=Mc,Ih["knockout-es5"]=Ic,Ih.knockout=Rc,Ih.measureText=Oc,Ih["mersenne-twister"]=Nc,Ih.NoSleep=Lc,Ih.sprintf=Bc,Ih.topojson=Fc,Ih.Tween=Vc,Ih.Uri=kc,Ih.when=zc,Ih.zip=Uc,Ih.Animation=Gc,Ih.AnimationViewModel=Wc,Ih.BaseLayerPicker=Hc,Ih.BaseLayerPickerViewModel=qc,Ih.createDefaultImageryProviderViewModels=jc,Ih.createDefaultTerrainProviderViewModels=Yc,Ih.ProviderViewModel=Xc,Ih.CesiumInspector=Zc,Ih.CesiumInspectorViewModel=Kc,Ih.CesiumWidget=Qc,Ih.ClockViewModel=Jc,Ih.Command=$c,Ih.createCommand=eh,Ih.FullscreenButton=th,Ih.FullscreenButtonViewModel=ih,Ih.Geocoder=rh,Ih.GeocoderViewModel=nh,Ih.getElement=oh,Ih.HomeButton=ah,Ih.HomeButtonViewModel=sh,Ih.InfoBox=lh,Ih.InfoBoxViewModel=uh,Ih.NavigationHelpButton=ch,Ih.NavigationHelpButtonViewModel=hh,Ih.PerformanceWatchdog=dh,Ih.PerformanceWatchdogViewModel=ph,Ih.SceneModePicker=mh,Ih.SceneModePickerViewModel=fh,Ih.SelectionIndicator=_h,Ih.SelectionIndicatorViewModel=gh,Ih.subscribeAndEvaluate=vh,Ih.SvgPathBindingHandler=yh,Ih.Timeline=Ch,Ih.TimelineHighlightRange=wh,Ih.TimelineTrack=Sh,Ih.ToggleButtonViewModel=Eh,Ih.Viewer=bh,Ih.viewerCesiumInspectorMixin=Th,Ih.viewerDragDropMixin=xh,Ih.viewerPerformanceWatchdogMixin=Ah,Ih.VRButton=Ph,Ih.VRButtonViewModel=Dh,Ih.createTaskProcessorWorker=Mh,Ih}),t(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}();
