/**
 * Cesium - https://github.com/AnalyticalGraphicsInc/cesium
 *
 * Copyright 2011-2017 Cesium Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Columbus View (Pat. Pend.)
 *
 * Portions licensed separately.
 * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details.
 */
/**
 * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
 * Released under MIT license, http://github.com/requirejs/almond/LICENSE
 */

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

/**
  @license
  when.js - https://github.com/cujojs/when

  MIT License (c) copyright B Cavalier & J Hann

 * A lightweight CommonJS Promises/A and when() implementation
 * when is part of the cujo.js family of libraries (http://cujojs.com/)
 *
 * Licensed under the MIT License at:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * @version 1.7.1
 */

/**
@license
sprintf.js from the php.js project - https://github.com/kvz/phpjs
Directly from https://github.com/kvz/phpjs/blob/master/functions/strings/sprintf.js

php.js is copyright 2012 Kevin van Zonneveld.

Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld
(http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White
(http://getsprink.com), Waldo Malqui Silva, Paulo Freitas, Jack, Jonas
Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Legaev
Andrey, Ates Goral (http://magnetiq.com), Alex, Ratheous, Martijn Wieringa,
Rafa? Kukawski (http://blog.kukawski.pl), lmeyrick
(https://sourceforge.net/projects/bcmath-js/), Nate, Philippe Baumann,
Enrique Gonzalez, Webtoolkit.info (http://www.webtoolkit.info/), Carlos R.
L. Rodrigues (http://www.jsfromhell.com), Ash Searle
(http://hexmen.com/blog/), Jani Hartikainen, travc, Ole Vrijenhoek,
Erkekjetter, Michael Grier, Rafa? Kukawski (http://kukawski.pl), Johnny
Mast (http://www.phpvrouwen.nl), T.Wild, d3x,
http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript,
Rafa? Kukawski (http://blog.kukawski.pl/), stag019, pilus, WebDevHobo
(http://webdevhobo.blogspot.com/), marrtins, GeekFG
(http://geekfg.blogspot.com), Andrea Giammarchi
(http://webreflection.blogspot.com), Arpad Ray (mailto:arpad@php.net),
gorthaur, Paul Smith, Tim de Koning (http://www.kingsquare.nl), Joris, Oleg
Eremeev, Steve Hilder, majak, gettimeofday, KELAN, Josh Fraser
(http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/),
Marc Palau, Martin
(http://www.erlenwiese.de/), Breaking Par Consulting Inc
(http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7),
Chris, Mirek Slugen, saulius, Alfonso Jimenez
(http://www.alfonsojimenez.com), Diplom@t (http://difane.com/), felix,
Mailfaker (http://www.weedem.fr/), Tyler Akins (http://rumkin.com), Caio
Ariede (http://caioariede.com), Robin, Kankrelune
(http://www.webfaktory.info/), Karol Kowalski, Imgen Tata
(http://www.myipdf.com/), mdsjack (http://www.mdsjack.bo.it), Dreamer,
Felix Geisendoerfer (http://www.debuggable.com/felix), Lars Fischer, AJ,
David, Aman Gupta, Michael White, Public Domain
(http://www.json.org/json2.js), Steven Levithan
(http://blog.stevenlevithan.com), Sakimori, Pellentesque Malesuada,
Thunder.m, Dj (http://phpjs.org/functions/htmlentities:425#comment_134018),
Steve Clay, David James, Francois, class_exists, nobbler, T. Wild, Itsacon
(http://www.itsacon.net/), date, Ole Vrijenhoek (http://www.nervous.nl/),
Fox, Raphael (Ao RUDLER), Marco, noname, Mateusz "loonquawl" Zalega, Frank
Forte, Arno, ger, mktime, john (http://www.jd-tech.net), Nick Kolosov
(http://sammy.ru), marc andreu, Scott Cariss, Douglas Crockford
(http://javascript.crockford.com), madipta, Slawomir Kaniecki,
ReverseSyntax, Nathan, Alex Wilson, kenneth, Bayron Guevara, Adam Wallner
(http://web2.bitbaro.hu/), paulo kuong, jmweb, Lincoln Ramsay, djmix,
Pyerre, Jon Hohle, Thiago Mata (http://thiagomata.blog.com), lmeyrick
(https://sourceforge.net/projects/bcmath-js/this.), Linuxworld, duncan,
Gilbert, Sanjoy Roy, Shingo, sankai, Oskar Larsson H?gfeldt
(http://oskar-lh.name/), Denny Wardhana, 0m3r, Everlasto, Subhasis Deb,
josh, jd, Pier Paolo Ramon (http://www.mastersoup.com/), P, merabi, Soren
Hansen, Eugene Bulkin (http://doubleaw.com/), Der Simon
(http://innerdom.sourceforge.net/), echo is bad, Ozh, XoraX
(http://www.xorax.info), EdorFaus, JB, J A R, Marc Jansen, Francesco, LH,
Stoyan Kyosev (http://www.svest.org/), nord_ua, omid
(http://phpjs.org/functions/380:380#comment_137122), Brad Touesnard, MeEtc
(http://yass.meetcweb.com), Peter-Paul Koch
(http://www.quirksmode.org/js/beat.html), Olivier Louvignes
(http://mg-crea.com/), T0bsn, Tim Wiel, Bryan Elliott, Jalal Berrami,
Martin, JT, David Randall, Thomas Beaucourt (http://www.webapp.fr), taith,
vlado houba, Pierre-Luc Paour, Kristof Coomans (SCK-CEN Belgian Nucleair
Research Centre), Martin Pool, Kirk Strobeck, Rick Waldron, Brant Messenger
(http://www.brantmessenger.com/), Devan Penner-Woelk, Saulo Vallory, Wagner
B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong
(http://carrot.org/), Christoph, Daniel Esteban, strftime, Mick@el, rezna,
Simon Willison (http://simonwillison.net), Anton Ongson, Gabriel Paderni,
Marco van Oort, penutbutterjelly, Philipp Lenssen, Bjorn Roesbeke
(http://www.bjornroesbeke.be/), Bug?, Eric Nagel, Tomasz Wesolowski,
Evertjan Garretsen, Bobby Drake, Blues (http://tech.bluesmoon.info/), Luke
Godfrey, Pul, uestla, Alan C, Ulrich, Rafal Kukawski, Yves Sucaet,
sowberry, Norman "zEh" Fuchs, hitwork, Zahlii, johnrembo, Nick Callen,
Steven Levithan (stevenlevithan.com), ejsanders, Scott Baker, Brian Tafoya
(http://www.premasolutions.com/), Philippe Jausions
(http://pear.php.net/user/jausions), Aidan Lister
(http://aidanlister.com/), Rob, e-mike, HKM, ChaosNo1, metjay, strcasecmp,
strcmp, Taras Bogach, jpfle, Alexander Ermolaev
(http://snippets.dzone.com/user/AlexanderErmolaev), DxGx, kilops, Orlando,
dptr1988, Le Torbi, James (http://www.james-bell.co.uk/), Pedro Tainha
(http://www.pedrotainha.com), James, Arnout Kazemier
(http://www.3rd-Eden.com), Chris McMacken, gabriel paderni, Yannoo,
FGFEmperor, baris ozdil, Tod Gentille, Greg Frazier, jakes, 3D-GRAF, Allan
Jensen (http://www.winternet.no), Howard Yeend, Benjamin Lupton, davook,
daniel airton wermann (http://wermann.com.br), Atli T¨®r, Maximusya, Ryan
W Tenney (http://ryan.10e.us), Alexander M Beedie, fearphage
(http://http/my.opera.com/fearphage/), Nathan Sepulveda, Victor, Matteo,
Billy, stensi, Cord, Manish, T.J. Leahy, Riddler
(http://www.frontierwebdev.com/), Rafa? Kukawski, FremyCompany, Matt
Bradley, Tim de Koning, Luis Salazar (http://www.freaky-media.com/), Diogo
Resende, Rival, Andrej Pavlovic, Garagoth, Le Torbi
(http://www.letorbi.de/), Dino, Josep Sanz (http://www.ws3.es/), rem,
Russell Walker (http://www.nbill.co.uk/), Jamie Beck
(http://www.terabit.ca/), setcookie, Michael, YUI Library:
http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at
http://hacks.bluesmoon.info/strftime/strftime.js, Ben
(http://benblume.co.uk/), DtTvB
(http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, William,
meo, incidence, Cagri Ekin, Amirouche, Amir Habibi
(http://www.residence-mixte.com/), Luke Smith (http://lucassmith.name),
Kheang Hok Chin (http://www.distantia.ca/), Jay Klehr, Lorenzo Pisani,
Tony, Yen-Wei Liu, Greenseed, mk.keck, Leslie Hoare, dude, booeyOH, Ben
Bryan

Licensed under the MIT (MIT-LICENSE.txt) license.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/

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

/*!
 * protobuf.js v6.7.0 (c) 2016, Daniel Wirtz
 * Compiled Wed, 22 Mar 2017 17:30:26 UTC
 * Licensed under the BSD-3-Clause License
 * see: https://github.com/dcodeIO/protobuf.js for details
 */

/**
         * Dictionary of provider id to copyright strings.
         * @type {Object}
         * @default {}
         */

/**
  @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) 2014-2015, NVIDIA CORPORATION. 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 NVIDIA CORPORATION 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 ``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
 * 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.
 */

/**
 * @licence
 * crunch/crnlib uses the ZLIB license:
 * http://opensource.org/licenses/Zlib
 *
 * Copyright (c) 2010-2016 Richard Geldreich, Jr. and Binomial LLC
 *
 * This software is provided 'as-is', without any express or implied
 * warranty.  In no event will the authors be held liable for any damages
 * arising from the use of this software.
 *
 * Permission is granted to anyone to use this software for any purpose,
 * including commercial applications, and to alter it and redistribute it
 * freely, subject to the following restrictions:
 *
 * 1. The origin of this software must not be misrepresented; you must not
 * claim that you wrote the original software. If you use this software
 * in a product, an acknowledgment in the product documentation would be
 * appreciated but is not required.
 *
 * 2. Altered source versions must be plainly marked as such, and must not be
 * misrepresented as being the original software.
 *
 * 3. This notice may not be removed or altered from any source distribution.
 */

/*!
 * Knockout JavaScript library v3.4.2
 * (c) The Knockout.js team - 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
 */

/*! NoSleep.js v0.7.0 - git.io/vfn01 - Rich Tibbett - MIT license */

!function(){var requirejs,require,define;!function(e){function t(e,t){return v.call(e,t)}function r(e,t){var r,i,n,o,a,s,l,u,c,d,h,p,f=t&&t.split("/"),m=g.map,_=m&&m["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,g.nodeIdCompat&&b.test(e[a])&&(e[a]=e[a].replace(b,"")),"."===e[0].charAt(0)&&f&&(p=f.slice(0,f.length-1),e=p.concat(e)),c=0;c<e.length;c++)if("."===(h=e[c]))e.splice(c,1),c-=1;else if(".."===h){if(0===c||1===c&&".."===e[2]||".."===e[c-1])continue;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((f||_)&&m){for(r=e.split("/"),c=r.length;c>0;c-=1){if(i=r.slice(0,c).join("/"),f)for(d=f.length;d>0;d-=1)if((n=m[f.slice(0,d).join("/")])&&(n=n[i])){o=n,s=c;break}if(o)break;!l&&_&&_[i]&&(l=_[i],u=c)}!o&&l&&(o=l,s=u),o&&(r.splice(0,s,o),e=r.join("/"))}return e}function i(t,r){return function(){var i=y.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),d.apply(e,i.concat([t,r]))}}function n(e){return function(t){return r(t,e)}}function o(e){return function(t){f[e]=t}}function a(r){if(t(m,r)){var i=m[r];delete m[r],_[r]=!0,c.apply(e,i)}if(!t(f,r)&&!t(_,r))throw new Error("No "+r);return f[r]}function s(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function l(e){return e?s(e):[]}function u(e){return function(){return g&&g.config&&g.config[e]||{}}}var c,d,h,p,f={},m={},g={},_={},v=Object.prototype.hasOwnProperty,y=[].slice,b=/\.js$/;h=function(e,t){var i,o=s(e),l=o[0],u=t[1];return e=o[1],l&&(l=r(l,u),i=a(l)),l?e=i&&i.normalize?i.normalize(e,n(u)):r(e,u):(e=r(e,u),o=s(e),l=o[0],e=o[1],l&&(i=a(l))),{f:l?l+"!"+e:e,n:e,pr:l,p:i}},p={require:function(e){return i(e)},exports:function(e){var t=f[e];return void 0!==t?t:f[e]={}},module:function(e){return{id:e,uri:"",exports:f[e],config:u(e)}}},c=function(r,n,s,u){var c,d,g,v,y,b,C,S=[],T=typeof s;if(u=u||r,b=l(u),"undefined"===T||"function"===T){for(n=!n.length&&s.length?["require","exports","module"]:n,y=0;y<n.length;y+=1)if(v=h(n[y],b),"require"===(d=v.f))S[y]=p.require(r);else if("exports"===d)S[y]=p.exports(r),C=!0;else if("module"===d)c=S[y]=p.module(r);else if(t(f,d)||t(m,d)||t(_,d))S[y]=a(d);else{if(!v.p)throw new Error(r+" missing "+d);v.p.load(v.n,i(u,!0),o(d),{}),S[y]=f[d]}g=s?s.apply(f[r],S):void 0,r&&(c&&c.exports!==e&&c.exports!==f[r]?f[r]=c.exports:g===e&&C||(f[r]=g))}else r&&(f[r]=s)},requirejs=require=d=function(t,r,i,n,o){if("string"==typeof t)return p[t]?p[t](r):a(h(t,l(r)).f);if(!t.splice){if(g=t,g.deps&&d(g.deps,g.callback),!r)return;r.splice?(t=r,r=i,i=null):t=e}return r=r||function(){},"function"==typeof i&&(i=n,n=o),n?c(e,t,r,i):setTimeout(function(){c(e,t,r,i)},4),d},d.config=function(e){return d(e)},requirejs._defined=f,define=function(e,r,i){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");r.splice||(i=r,r=[]),t(f,e)||t(m,e)||(m[e]=[e,r,i])},define.amd={jQuery:!0}}(),define("Core/appendForwardSlash",[],function(){"use strict";function e(e){return 0!==e.length&&"/"===e[e.length-1]||(e+="/"),e}return e}),define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(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}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function i(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var n={};return n.typeOf={},n.defined=function(i,n){if(!e(n))throw new t(r(i))},n.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(i(typeof r,"function",e))},n.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(i(typeof r,"string",e))},n.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(i(typeof r,"number",e))},n.typeOf.number.lessThan=function(e,r,i){if(n.typeOf.number(e,r),r>=i)throw new t("Expected "+e+" to be less than "+i+", actual value was "+r)},n.typeOf.number.lessThanOrEquals=function(e,r,i){if(n.typeOf.number(e,r),r>i)throw new t("Expected "+e+" to be less than or equal to "+i+", actual value was "+r)},n.typeOf.number.greaterThan=function(e,r,i){if(n.typeOf.number(e,r),r<=i)throw new t("Expected "+e+" to be greater than "+i+", actual value was "+r)},n.typeOf.number.greaterThanOrEquals=function(e,r,i){if(n.typeOf.number(e,r),r<i)throw new t("Expected "+e+" to be greater than or equal to"+i+", actual value was "+r)},n.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(i(typeof r,"object",e))},n.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(i(typeof r,"boolean",e))},n.typeOf.number.equals=function(e,r,i,o){if(n.typeOf.number(e,i),n.typeOf.number(r,o),i!==o)throw new t(e+" must be equal to "+r+", the actual values are "+i+" and "+o)},n}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e&&null!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/arrayFill",["./Check","./defaultValue","./defined"],function(e,t,r){"use strict";function i(e,r,i,n){if("function"==typeof e.fill)return e.fill(r,i,n);for(var o=e.length>>>0,a=t(i,0),s=a<0?Math.max(o+a,0):Math.min(a,o),l=t(n,o),u=l<0?Math.max(o+l,0):Math.min(l,o);s<u;)e[s]=r,s++;return e}return i}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";function n(e){var t=Math.pow(Math.abs(e),1/3);return e<0?-t:t}var o={};o.EPSILON1=.1,o.EPSILON2=.01,o.EPSILON3=.001,o.EPSILON4=1e-4,o.EPSILON5=1e-5,o.EPSILON6=1e-6,o.EPSILON7=1e-7,o.EPSILON8=1e-8,o.EPSILON9=1e-9,o.EPSILON10=1e-10,o.EPSILON11=1e-11,o.EPSILON12=1e-12,o.EPSILON13=1e-13,o.EPSILON14=1e-14,o.EPSILON15=1e-15,o.EPSILON16=1e-16,o.EPSILON17=1e-17,o.EPSILON18=1e-18,o.EPSILON19=1e-19,o.EPSILON20=1e-20,o.GRAVITATIONALPARAMETER=3986004418e5,o.SOLAR_RADIUS=6955e5,o.LUNAR_RADIUS=1737400,o.SIXTY_FOUR_KILOBYTES=65536,o.sign=function(e){return e>0?1:e<0?-1:0},o.signNotZero=function(e){return e<0?-1:1},o.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*o.clamp(e,-1,1)+.5)*r)},o.fromSNorm=function(e,r){return r=t(r,255),o.clamp(e,0,r)/r*2-1},o.sinh=function(e){return.5*(Math.pow(Math.E,e)-Math.pow(Math.E,-1*e))},o.cosh=function(e){return.5*(Math.pow(Math.E,e)+Math.pow(Math.E,-1*e))},o.lerp=function(e,t,r){return(1-r)*e+r*t},o.PI=Math.PI,o.ONE_OVER_PI=1/Math.PI,o.PI_OVER_TWO=.5*Math.PI,o.PI_OVER_THREE=Math.PI/3,o.PI_OVER_FOUR=Math.PI/4,o.PI_OVER_SIX=Math.PI/6,o.THREE_PI_OVER_TWO=3*Math.PI*.5,o.TWO_PI=2*Math.PI,o.ONE_OVER_TWO_PI=1/(2*Math.PI),o.RADIANS_PER_DEGREE=Math.PI/180,o.DEGREES_PER_RADIAN=180/Math.PI,o.RADIANS_PER_ARCSECOND=o.RADIANS_PER_DEGREE/3600,o.toRadians=function(e){return e*o.RADIANS_PER_DEGREE},o.toDegrees=function(e){return e*o.DEGREES_PER_RADIAN},o.convertLongitudeRange=function(e){var t=o.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},o.clampToLatitudeRange=function(e){return o.clamp(e,-1*o.PI_OVER_TWO,o.PI_OVER_TWO)},o.negativePiToPi=function(e){return o.zeroToTwoPi(e+o.PI)-o.PI},o.zeroToTwoPi=function(e){var t=o.mod(e,o.TWO_PI);return Math.abs(t)<o.EPSILON14&&Math.abs(e)>o.EPSILON14?o.TWO_PI:t},o.mod=function(e,t){return(e%t+t)%t},o.equalsEpsilon=function(e,r,i,n){n=t(n,i);var o=Math.abs(e-r);return o<=n||o<=i*Math.max(Math.abs(e),Math.abs(r))};var a=[1];o.factorial=function(e){var t=a.length;if(e>=t)for(var r=a[t-1],i=t;i<=e;i++)a.push(r*i);return a[e]},o.incrementWrap=function(e,r,i){return i=t(i,0),++e,e>r&&(e=i),e},o.isPowerOfTwo=function(e){return 0!==e&&0==(e&e-1)},o.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},o.clamp=function(e,t,r){return e<t?t:e>r?r:e};var s=new e;return o.setRandomNumberSeed=function(t){s=new e(t)},o.nextRandomNumber=function(){return s.random()},o.randomBetween=function(e,t){return o.nextRandomNumber()*(t-e)+e},o.acosClamped=function(e){return Math.acos(o.clamp(e,-1,1))},o.asinClamped=function(e){return Math.asin(o.clamp(e,-1,1))},o.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},o.logBase=function(e,t){return Math.log(e)/Math.log(t)},o.cbrt=r(Math.cbrt)?Math.cbrt:n,o.fog=function(e,t){var r=e*t;return 1-Math.exp(-r*r)},o}),define("Core/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(e,t,r,i){"use strict";function n(e,i,n){if(r(e)){n=t(n,!1);var a=e.length;if(a<2)return e;var s,l,u;for(s=1;s<a&&(l=e[s-1],u=e[s],!i(l,u,o));++s);if(s===a)return n&&i(e[0],e[e.length-1],o)?e.slice(1):e;for(var c=e.slice(0,s);s<a;++s)u=e[s],i(l,u,o)||(c.push(u),l=u);return n&&c.length>1&&i(c[0],c[c.length-1],o)&&c.shift(),c}}var o=i.EPSILON10;return n}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,i={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[i.fullscreenElement]}},changeEventName:{get:function(){if(n.supportsFullscreen())return i.fullscreenchange}},errorEventName:{get:function(){if(n.supportsFullscreen())return i.fullscreenerror}},enabled:{get:function(){if(n.supportsFullscreen())return document[i.fullscreenEnabled]}},fullscreen:{get:function(){if(n.supportsFullscreen())return null!==n.element}}}),n.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return i.requestFullscreen="requestFullscreen",i.exitFullscreen="exitFullscreen",i.fullscreenEnabled="fullscreenEnabled",i.fullscreenElement="fullscreenElement",i.fullscreenchange="fullscreenchange",i.fullscreenerror="fullscreenerror",r=!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]?(i.requestFullscreen=n,r=!0):(n=l+"RequestFullScreen","function"==typeof t[n]&&(i.requestFullscreen=n,r=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?i.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(i.exitFullscreen=n)),n=l+"FullscreenEnabled",void 0!==document[n]?i.fullscreenEnabled=n:(n=l+"FullScreenEnabled",void 0!==document[n]&&(i.fullscreenEnabled=n)),n=l+"FullscreenElement",void 0!==document[n]?i.fullscreenElement=n:(n=l+"FullScreenElement",void 0!==document[n]&&(i.fullscreenElement=n)),n=l+"fullscreenchange",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenChange"),i.fullscreenchange=n),n=l+"fullscreenerror",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenError"),i.fullscreenerror=n)}return r},n.requestFullscreen=function(e,t){n.supportsFullscreen()&&e[i.requestFullscreen]({vrDisplay:t})},n.exitFullscreen=function(){n.supportsFullscreen()&&document[i.exitFullscreen]()},n}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function i(e){for(var t=e.split("."),r=0,i=t.length;r<i;++r)t[r]=parseInt(t[r],10);return t}function n(){if(!t(C)&&(C=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(C=!0,S=i(e[1]))}return C}function o(){return n()&&S}function a(){if(!t(T)&&(T=!1,!n()&&!h()&&/ Safari\/[\.0-9]+/.test(b.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(T=!0,w=i(e[1]))}return T}function s(){return a()&&w}function l(){if(!t(A)){A=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(b.userAgent);null!==e&&(A=!0,E=i(e[1]),E.isNightly=!!e[2])}return A}function u(){return l()&&E}function c(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===b.appName?null!==(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(b.userAgent))&&(x=!0,P=i(e[1])):"Netscape"===b.appName&&null!==(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(b.userAgent))&&(x=!0,P=i(e[1]))}return x}function d(){return c()&&P}function h(){if(!t(I)){I=!1;var e=/ Edge\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(I=!0,D=i(e[1]))}return I}function p(){return h()&&D}function f(){if(!t(O)){O=!1;var e=/Firefox\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(O=!0,M=i(e[1]))}return O}function m(){return t(R)||(R=/Windows/i.test(b.appVersion)),R}function g(){return f()&&M}function _(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(b.pointerEnabled)||b.pointerEnabled)),L}function v(){if(!t(k)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;k=t(r)&&""!==r,k&&(N=r)}return k}function y(){return v()?N:void 0}var b;b="undefined"!=typeof navigator?navigator:{};var C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:d,isEdge:h,edgeVersion:p,isFirefox:f,firefoxVersion:g,isWindows:m,hardwareConcurrency:e(b.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:v,imageRenderingValue:y};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/arraySlice",["./Check","./defaultValue","./defined","./FeatureDetection"],function(e,t,r,i){"use strict";function n(e,t,r){return o(e,t,r)}var o=function(e,t,r){return e.slice(t,r)};if(i.supportsTypedArrays()){if("function"!=typeof new Uint8Array(1).slice){var a=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];o=function(e,t,r){if("function"==typeof e.slice)return e.slice(t,r);for(var i=Array.prototype.slice.call(e,t,r),n=a.length,o=0;o<n;++o)if(e instanceof a[o]){i=new a[o](i);break}return i}}}return n}),define("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";function i(){this._array=[],this._hash={}}return t(i.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),i.prototype.contains=function(t){return e(this._hash[t])},i.prototype.set=function(e,t){t!==this._hash[e]&&(this.remove(e),this._hash[e]=t,this._array.push(t))},i.prototype.get=function(e){return this._hash[e]},i.prototype.remove=function(t){var r=this._hash[t],i=e(r);if(i){var n=this._array;n.splice(n.indexOf(r),1),delete this._hash[t]}return i},i.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},i}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,r){this.x=t(e,0),this.y=t(r,0)}a.fromElements=function(e,t,i){return r(i)?(i.x=e,i.y=t,i):new a(e,t)},a.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.x,r[i]=e.y,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.x=e[i++],n.y=e[i],n},a.packArray=function(e,t){var i=e.length;r(t)?t.length=2*i:t=new Array(2*i);for(var n=0;n<i;++n)a.pack(e[n],t,2*n);return t},a.unpackArray=function(e,t){var i=e.length;r(t)?t.length=i/2:t=new Array(i/2);for(var n=0;n<i;n+=2){var o=n/2;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)},a.minimumComponent=function(e){return Math.min(e.x,e.y)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},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 r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},a.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var l=new a;a.lerp=function(e,t,r,i){return a.multiplyByScalar(t,r,l),i=a.multiplyByScalar(e,1-r,i),a.add(l,i,i)};var u=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,u),a.normalize(t,c),o.acosClamped(a.dot(u,c))};var d=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,d);return a.abs(r,r),t=r.x<=r.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,i,n)&&o.equalsEpsilon(e.y,t.y,i,n)},a.ZERO=n(new a(0,0)),a.UNIT_X=n(new a(1,0)),a.UNIT_Y=n(new a(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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,r,i){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0)}a.fromSpherical=function(e,i){r(i)||(i=new a);var n=e.clock,o=e.cone,s=t(e.magnitude,1),l=s*Math.sin(o);return i.x=l*Math.cos(n),i.y=l*Math.sin(n),i.z=s*Math.cos(o),i},a.fromElements=function(e,t,i,n){return r(n)?(n.x=e,n.y=t,n.z=i,n):new a(e,t,i)},a.clone=function(e,t){if(r(e))return r(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,r,i){return i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i]=e.z,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.x=e[i++],n.y=e[i++],n.z=e[i],n},a.packArray=function(e,t){var i=e.length;r(t)?t.length=3*i:t=new Array(3*i);for(var n=0;n<i;++n)a.pack(e[n],t,3*n);return t},a.unpackArray=function(e,t){var i=e.length;r(t)?t.length=i/3:t=new Array(i/3);for(var n=0;n<i;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,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},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 r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},a.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},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,r,i){return a.multiplyByScalar(t,r,l),i=a.multiplyByScalar(e,1-r,i),a.add(l,i,i)};var u=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,u),a.normalize(t,c);var r=a.dot(u,c),i=a.magnitude(a.cross(u,c,u));return Math.atan2(i,r)};var d=new a;a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,d);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):r.y<=r.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.projectVector=function(e,t,r){var i=a.dot(e,t)/a.dot(t,t);return a.multiplyByScalar(t,i,r)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,i,n)&&o.equalsEpsilon(e.y,t.y,i,n)&&o.equalsEpsilon(e.z,t.z,i,n)},a.cross=function(e,t,r){var i=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-i*l,d=i*s-n*a;return r.x=u,r.y=c,r.z=d,r},a.fromDegrees=function(e,t,r,i,n){return e=o.toRadians(e),t=o.toRadians(t),a.fromRadians(e,t,r,i,n)};var h=new a,p=new a,f=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(e,i,n,o,s){n=t(n,0);var l=r(o)?o.radiiSquared:f,u=Math.cos(i);h.x=u*Math.cos(e),h.y=u*Math.sin(e),h.z=Math.sin(i),h=a.normalize(h,h),a.multiplyComponents(l,h,p);var c=Math.sqrt(a.dot(h,p));return p=a.divideByScalar(p,c,p),h=a.multiplyByScalar(h,n,h),r(s)||(s=new a),a.add(p,h,s)},a.fromDegreesArray=function(e,t,i){var n=e.length;r(i)?i.length=n/2:i=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;i[u]=a.fromDegrees(s,l,0,t,i[u])}return i},a.fromRadiansArray=function(e,t,i){var n=e.length;r(i)?i.length=n/2:i=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;i[u]=a.fromRadians(s,l,0,t,i[u])}return i},a.fromDegreesArrayHeights=function(e,t,i){var n=e.length;r(i)?i.length=n/3:i=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;i[c]=a.fromDegrees(s,l,u,t,i[c])}return i},a.fromRadiansArrayHeights=function(e,t,i){var n=e.length;r(i)?i.length=n/3:i=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;i[c]=a.fromRadians(s,l,u,t,i[c])}return i},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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,r,i,n,o){"use strict";function a(e){return e>>1^-(1&e)}var s={};s.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var i=r.x,n=r.y;r.x=(1-Math.abs(n))*o.signNotZero(i),r.y=(1-Math.abs(i))*o.signNotZero(n)}return r.x=o.toSNorm(r.x,t),r.y=o.toSNorm(r.y,t),r},s.octEncode=function(e,t){return s.octEncodeInRange(e,255,t)},s.octDecodeInRange=function(e,r,i,n){if(n.x=o.fromSNorm(e,i),n.y=o.fromSNorm(r,i),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var a=n.x;n.x=(1-Math.abs(n.y))*o.signNotZero(a),n.y=(1-Math.abs(a))*o.signNotZero(n.y)}return t.normalize(n,n)},s.octDecode=function(e,t,r){return s.octDecodeInRange(e,t,255,r)},s.octPackFloat=function(e){return 256*e.x+e.y};var l=new e;return s.octEncodeFloat=function(e){return s.octEncode(e,l),s.octPackFloat(l)},s.octDecodeFloat=function(e,t){var r=e/256,i=Math.floor(r),n=256*(r-i);return s.octDecode(i,n,t)},s.octPack=function(e,t,r,i){var n=s.octEncodeFloat(e),o=s.octEncodeFloat(t),a=s.octEncode(r,l);return i.x=65536*a.x+n,i.y=65536*a.y+o,i},s.octUnpack=function(e,t,r,i){var n=e.x/65536,o=Math.floor(n),a=65536*(n-o);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);s.octDecodeFloat(a,t),s.octDecodeFloat(u,r),s.octDecode(o,l,i)},s.compressTextureCoordinates=function(e){return 4096*(4095*e.x|0)+(4095*e.y|0)},s.decompressTextureCoordinates=function(e,t){var r=e/4096,i=Math.floor(r);return t.x=i/4095,t.y=(e-4096*i)/4095,t},s.zigZagDeltaDecode=function(e,t,r){for(var n=e.length,o=0,s=0,l=0,u=0;u<n;++u)o+=a(e[u]),s+=a(t[u]),e[u]=o,t[u]=s,i(r)&&(l+=a(r[u]),r[u]=l)},s}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";return e({OUTSIDE:-1,INTERSECTING:0,INSIDE:1})}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,r,i,n){"use strict";function o(t,n,o){this.minimum=e.clone(r(t,e.ZERO)),this.maximum=e.clone(r(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,d=t.length,h=1;h<d;h++){var p=t[h],f=p.x,m=p.y,g=p.z;n=Math.min(f,n),l=Math.max(f,l),a=Math.min(m,a),u=Math.max(m,u),s=Math.min(g,s),c=Math.max(g,c)}var _=r.minimum;_.x=n,_.y=a,_.z=s;var v=r.maximum;v.x=l,v.y=u,v.z=c;var y=e.add(_,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,t.center)},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,r){a=e.subtract(t.maximum,t.minimum,a);var i=e.multiplyByScalar(a,.5,a),o=r.normal,s=i.x*Math.abs(o.x)+i.y*Math.abs(o.y)+i.z*Math.abs(o.z),l=e.dot(t.center,o)+r.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}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,r,i){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var d,h,p,f,m,g,_,v;i(n.z)?(d=t.subtract(l,n,o),h=t.subtract(u,n,a),p=t.subtract(r,n,s),f=t.dot(d,d),m=t.dot(d,h),g=t.dot(d,p),_=t.dot(h,h),v=t.dot(h,p)):(d=e.subtract(l,n,o),h=e.subtract(u,n,a),p=e.subtract(r,n,s),f=e.dot(d,d),m=e.dot(d,h),g=e.dot(d,p),_=e.dot(h,h),v=e.dot(h,p));var y=1/(f*_-m*m);return c.y=(_*g-m*v)*y,c.z=(f*v-m*g)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),define("Core/binarySearch",["./Check"],function(e){"use strict";function t(e,t,r){for(var i,n,o=0,a=e.length-1;o<=a;)if(i=~~((o+a)/2),(n=r(e[i],t))<0)o=i+1;else{if(!(n>0))return i;a=i-1}return~(a+1)}return t}),define("Core/Credit",["./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i){"use strict";function n(e){var r,i=document.createElement("span"),n=e.text,o=e.link;if(e._hasImage){var a=document.createElement("img");a.src=e.imageUrl,t(n)&&(a.alt=n,a.title=n),e._hasLink?(r=document.createElement("a"),r.appendChild(a),r.href=o,r.target="_blank",i.appendChild(r)):i.appendChild(a),i.className="cesium-credit-image"}else e._hasLink?(r=document.createElement("a"),r.textContent=n,r.href=o,r.target="_blank",i.appendChild(r)):i.textContent=n,i.className="cesium-credit-text";return i}function o(r){r=e(r,e.EMPTY_OBJECT);var i=r.text,n=r.imageUrl,o=r.link,l=e(r.showOnScreen,!1),u=t(o),c=t(n);t(i)||c||(i=o),this._text=i,this._imageUrl=n,this._link=o,this._hasLink=u,this._hasImage=c,this._showOnScreen=l;var d,h=JSON.stringify([i,n,o]);t(s[h])?d=s[h]:(d=a++,s[h]=d),this._id=d,this._element=void 0}var a=0,s={};return r(o.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}},showOnScreen:{get:function(){return this._showOnScreen}},element:{get:function(){return t(this._element)||(this._element=n(this)),this._element}}}),o.prototype.hasImage=function(){return this._hasImage},o.prototype.hasLink=function(){return this._hasLink},o.equals=function(e,r){return e===r||t(e)&&t(r)&&e._id===r._id},o.prototype.equals=function(e){return o.equals(this,e)},o}),define("Core/BingMapsApi",["./Credit","./defined"],function(e,t){"use strict";var r={};r.defaultKey=void 0;var i,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 r.getKey=function(e){return t(e)?e:t(r.defaultKey)?r.defaultKey:(n||(console.log(o),n=!0),"Ar9n20kTp-N8tEg3Dpx-Pgocmx3W0-GUnD_Bgt3h8g6pSeDL8yxByTVGHyMyjI2p")},r.getErrorCredit=function(n){if(!t(n)&&!t(r.defaultKey))return t(i)||(i=new e({text:o,showOnScreen:!0})),i},r}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(r,n,s,l,u){var c=r.x,d=r.y,h=r.z,p=n.x,f=n.y,m=n.z,g=c*c*p*p,_=d*d*f*f,v=h*h*m*m,y=g+_+v,b=Math.sqrt(1/y),C=e.multiplyByScalar(r,b,o);if(y<l)return isFinite(b)?e.clone(C,u):void 0;var S=s.x,T=s.y,w=s.z,A=a;A.x=C.x*S*2,A.y=C.y*T*2,A.z=C.z*w*2;var E,x,P,I,D,O,M,R,L,N,k,F=(1-b)*e.magnitude(r)/(.5*e.magnitude(A)),B=0;do{F-=B,P=1/(1+F*S),I=1/(1+F*T),D=1/(1+F*w),O=P*P,M=I*I,R=D*D,L=O*P,N=M*I,k=R*D,E=g*O+_*M+v*R-1,x=g*L*S+_*N*T+v*k*w;B=E/(-2*x)}while(Math.abs(E)>i.EPSILON12);return t(u)?(u.x=c*P,u.y=d*I,u.z=h*D,u):new e(c*P,d*I,h*D)}var o=new e,a=new e;return n}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,i){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(i,0)}s.fromRadians=function(e,t,n,o){return n=r(n,0),i(o)?(o.longitude=e,o.latitude=t,o.height=n,o):new s(e,t,n)},
s.fromDegrees=function(e,t,r,i){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,r,i)};var l=new e,u=new e,c=new e,d=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var f=i(r)?r.oneOverRadii:d,m=i(r)?r.oneOverRadiiSquared:h,g=i(r)?r._centerToleranceSquared:p,_=a(t,f,m,g,u);if(i(_)){var v=e.multiplyComponents(_,m,l);v=e.normalize(v,v);var y=e.subtract(t,_,c),b=Math.atan2(v.y,v.x),C=Math.asin(v.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=b,n.latitude=C,n.height=S,n):new s(b,C,S)}},s.toCartesian=function(t,r,i){return e.fromRadians(t.longitude,t.latitude,t.height,r,i)},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}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(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=l.EPSILON1,0!==t._radiiSquared.z&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function d(e,t,r){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,c(this,e,t,r)}o(d.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}}}),d.clone=function(t,r){if(n(t)){var i=t._radii;return n(r)?(e.clone(i,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new d(i.x,i.y,i.z)}},d.fromCartesian3=function(e,t){return n(t)||(t=new d),n(e)?(c(t,e.x,e.y,e.z),t):t},d.WGS84=s(new d(6378137,6378137,6356752.314245179)),d.UNIT_SPHERE=s(new d(1,1,1)),d.MOON=s(new d(l.LUNAR_RADIUS,l.LUNAR_RADIUS,l.LUNAR_RADIUS)),d.prototype.clone=function(e){return d.clone(this,e)},d.packedLength=e.packedLength,d.pack=function(t,r,n){return n=i(n,0),e.pack(t._radii,r,n),r},d.unpack=function(t,r,n){r=i(r,0);var o=e.unpack(t,r);return d.fromCartesian3(o,n)},d.prototype.geocentricSurfaceNormal=e.normalize,d.prototype.geodeticSurfaceNormalCartographic=function(t,r){var i=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(i),l=a*Math.sin(i),u=Math.sin(o);return n(r)||(r=new e),r.x=s,r.y=l,r.z=u,e.normalize(r,r)},d.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var h=new e,p=new e;d.prototype.cartographicToCartesian=function(t,r){var i=h,o=p;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,o);var a=Math.sqrt(e.dot(i,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(i,t.height,i),n(r)||(r=new e),e.add(o,i,r)},d.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var f=new e,m=new e,g=new e;return d.prototype.cartesianToCartographic=function(r,i){var o=this.scaleToGeodeticSurface(r,m);if(n(o)){var a=this.geodeticSurfaceNormal(o,f),s=e.subtract(r,o,g),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),d=l.sign(e.dot(s,r))*e.magnitude(s);return n(i)?(i.longitude=u,i.latitude=c,i.height=d,i):new t(u,c,d)}},d.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},d.prototype.scaleToGeodeticSurface=function(e,t){return u(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},d.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var i=t.x,o=t.y,a=t.z,s=this._oneOverRadiiSquared,l=1/Math.sqrt(i*i*s.x+o*o*s.y+a*a*s.z);return e.multiplyByScalar(t,l,r)},d.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},d.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},d.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},d.prototype.toString=function(){return this._radii.toString()},d.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,r,o){r=i(r,0);var a=this._squaredXOverSquaredZ;if(n(o)||(o=new e),o.x=0,o.y=0,o.z=t.z*(1-a),!(Math.abs(o.z)>=this._radii.z-r))return o},d}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i,n){this.west=r(e,0),this.south=r(t,0),this.east=r(i,0),this.north=r(n,0)}n(l.prototype,{width:{get:function(){return l.computeWidth(this)}},height:{get:function(){return l.computeHeight(this)}}}),l.packedLength=4,l.pack=function(e,t,i){return i=r(i,0),t[i++]=e.west,t[i++]=e.south,t[i++]=e.east,t[i]=e.north,t},l.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},l.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=s.TWO_PI),t-r},l.computeHeight=function(e){return e.north-e.south},l.fromDegrees=function(e,t,n,o,a){return e=s.toRadians(r(e,0)),t=s.toRadians(r(t,0)),n=s.toRadians(r(n,0)),o=s.toRadians(r(o,0)),i(a)?(a.west=e,a.south=t,a.east=n,a.north=o,a):new l(e,t,n,o)},l.fromRadians=function(e,t,n,o,a){return i(a)?(a.west=r(e,0),a.south=r(t,0),a.east=r(n,0),a.north=r(o,0),a):new l(e,t,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,d=0,h=e.length;d<h;d++){var p=e[d];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 f=p.longitude>=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,f),a=Math.max(a,f)}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,n){t=r(t,o.WGS84);for(var a=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=Number.MAX_VALUE,p=-Number.MAX_VALUE,f=0,m=e.length;f<m;f++){var g=t.cartesianToCartographic(e[f]);a=Math.min(a,g.longitude),u=Math.max(u,g.longitude),h=Math.min(h,g.latitude),p=Math.max(p,g.latitude);var _=g.longitude>=0?g.longitude:g.longitude+s.TWO_PI;c=Math.min(c,_),d=Math.max(d,_)}return u-a>d-c&&(a=c,u=d,u>s.PI&&(u-=s.TWO_PI),a>s.PI&&(a-=s.TWO_PI)),i(n)?(n.west=a,n.south=h,n.east=u,n.north=p,n):new l(a,h,u,p)},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)),d=s.negativePiToPi(Math.min(n,a));if(!((e.west<e.east||t.west<t.east)&&d<=c)){var h=Math.max(e.south,t.south),p=Math.min(e.north,t.north);if(!(h>=p))return i(r)?(r.west=c,r.south=h,r.east=d,r.north=p,r):new l(c,h,d,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)),d=s.convertLongitudeRange(Math.max(n,a));return r.west=c,r.south=Math.min(e.south,t.south),r.east=d,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 r=t.longitude,i=t.latitude,n=e.west,o=e.east;return o<n&&(o+=s.TWO_PI,r<0&&(r+=s.TWO_PI)),(r>n||s.equalsEpsilon(r,n,s.EPSILON14))&&(r<o||s.equalsEpsilon(r,o,s.EPSILON14))&&i>=e.south&&i<=e.north};var u=new e;return l.subsample=function(e,t,n,a){t=r(t,o.WGS84),n=r(n,0),i(a)||(a=[]);var c=0,d=e.north,h=e.south,p=e.east,f=e.west,m=u;m.height=n,m.longitude=f,m.latitude=d,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.latitude=h,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.latitude=d<0?d:h>0?h:0;for(var g=1;g<8;++g)m.longitude=-Math.PI+g*s.PI_OVER_TWO,l.contains(e,m)&&(a[c]=t.cartographicToCartesian(m,a[c]),c++);return 0===m.latitude&&(m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,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}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,i){if(null===r||"object"!=typeof r)return r;i=e(i,!1);var n=new r.constructor;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i&&(a=t(a,i)),n[o]=a}return n}return t}),define("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function r(i,n,o){o=e(o,!1);var a,s,l,u={},c=t(i),d=t(n);if(c)for(a in i)i.hasOwnProperty(a)&&(s=i[a],d&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],u[a]="object"==typeof l?r(s,l,o):s):u[a]=s);if(d)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return r}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(r,i){t(n[r])||(n[r]=!0,console.warn(e(i,r)))}var n={};return i.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.",i}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function i(e,t){r(e,t)}return i}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=i.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function r(e,t,r,i){return(t||"")+r.toLowerCase()+(i||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var i=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,r).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 r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],i=""==t[0];i&&t.shift();for(""==t[0]&&t.shift();t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),i&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";function n(e,t){return n._implementation(e,t,document)}return n._implementation=function(r,i,n){i=t(i,t(n.baseURI,n.location.href));var o=new e(i);return new e(r).resolve(o).toString()},n}),define("Core/getBaseUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(r,i){var n="",o=r.lastIndexOf("/");return-1!==o&&(n=r.substring(0,o+1)),i?(r=new e(r),t(r.query)&&(n+="?"+r.query),t(r.fragment)&&(n+="#"+r.fragment),n):n}return i}),define("Core/getExtensionFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t){var r=new e(t);r.normalize();var i=r.path,n=i.lastIndexOf("/");return-1!==n&&(i=i.substr(n+1)),n=i.lastIndexOf("."),i=-1===n?"":i.substr(n+1)}return i}),define("Core/isBlobUri",["./Check"],function(e){"use strict";function t(e){return r.test(e)}var r=/^blob:/i;return t}),define("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";function t(t){e(r)||(r=document.createElement("a")),r.href=window.location.href;var i=r.host,n=r.protocol;return r.href=t,r.href=r.href,n!==r.protocol||i!==r.host}var r;return t}),define("Core/isDataUri",["./Check"],function(e){"use strict";function t(e){return r.test(e)}var r=/^data:/i;return t}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,r){"use strict";function i(e){var t="";for(var i in e)if(e.hasOwnProperty(i)){var n=e[i],o=encodeURIComponent(i)+"=";if(r(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 i}),define("Core/queryToObject",["./defined","./DeveloperError","./isArray"],function(e,t,r){"use strict";function i(t){var i={};if(""===t)return i;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=i[l];"string"==typeof c?i[l]=[c,u]:r(c)?c.push(u):i[l]=u}return i}return i}),define("Core/RequestState",["../Core/freezeObject"],function(e){"use strict";return e({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5})}),define("Core/RequestType",["../Core/freezeObject"],function(e){"use strict";return e({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3})}),define("Core/Request",["./defaultValue","./defined","./RequestState","./RequestType"],function(e,t,r,i){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT);var n=e(t.throttleByServer,!1),o=n||e(t.throttle,!1);this.url=t.url,this.requestFunction=t.requestFunction,this.cancelFunction=t.cancelFunction,this.priorityFunction=t.priorityFunction,this.priority=e(t.priority,0),this.throttle=o,this.throttleByServer=n,this.type=e(t.type,i.OTHER),this.serverKey=void 0,this.state=r.UNISSUED,this.deferred=void 0,this.cancelled=!1}return n.prototype.cancel=function(){this.cancelled=!0},n.prototype.clone=function(e){return t(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new n(this)},n}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),i=0;i<r.length;++i){var n=r[i],o=n.indexOf(": ");if(o>0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,i){this.statusCode=e,this.response=r,this.responseHeaders=i,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,i,n){return t(e).then(r,i,n)}function t(e){var t,r;return e instanceof i?t=e:s(e)?(r=a(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=n(e),t}function r(t){return e(t,o)}function i(e){this.then=e}function n(e){return new i(function(r){try{return t(r?r(e):e)}catch(e){return o(e)}})}function o(e){return new i(function(r,i){try{return i?t(i(e)):o(e)}catch(e){return o(e)}})}function a(){function e(e,t,r){return h(e,t,r)}function r(e){return f(e)}function n(e){return f(o(e))}function s(e){return p(e)}var l,u,c,d,h,p,f;return u=new i(e),l={then:e,resolve:r,reject:n,progress:s,promise:u,resolver:{resolve:r,reject:n,progress:s}},c=[],d=[],h=function(e,t,r){var i,n;return i=a(),n="function"==typeof r?function(e){try{i.progress(r(e))}catch(e){i.progress(e)}}:function(e){i.progress(e)},c.push(function(r){r.then(e,t).then(i.resolve,i.reject,n)}),d.push(n),i.promise},p=function(e){return m(d,e),e},f=function(e){return e=t(e),h=e.then,f=t,p=_,m(c,e),d=c=C,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,r,i,n,o){return g(2,arguments),e(t,function(t){function s(e){m(e)}function l(e){f(e)}var u,c,d,h,p,f,m,g,v,y;if(v=t.length>>>0,u=Math.max(0,Math.min(r,v)),d=[],c=v-u+1,h=[],p=a(),u)for(g=p.progress,m=function(e){h.push(e),--c||(f=m=_,p.reject(h))},f=function(e){d.push(e),--u||(f=m=_,p.resolve(d))},y=0;y<v;++y)y in t&&e(t[y],l,s,g);else p.resolve(d);return p.then(i,n,o)})}function u(e,t,r,i){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,r,i)}function c(e,t,r,i){return g(1,arguments),h(e,v).then(t,r,i)}function d(){return h(arguments,v)}function h(t,r){return e(t,function(t){var i,n,o,s,l,u;if(o=n=t.length>>>0,i=[],u=a(),o)for(s=function(t,n){e(t,r).then(function(e){i[n]=e,--o||u.resolve(i)},u.reject)},l=0;l<n;l++)l in t?s(t[l],l):--o;else u.resolve(i);return u.promise})}function p(t,r){var i=b.call(arguments,1);return e(t,function(t){var n;return n=t.length,i[0]=function(t,i,o){return e(t,function(t){return e(i,function(e){return r(t,e,o,n)})})},y.apply(t,i)})}function f(t,r,i){var n=arguments.length>2;return e(t,function(e){return e=n?i:e,r.resolve(e),e},function(e){return r.reject(e),o(e)},r.progress)}function m(e,t){for(var r,i=0;r=e[i++];)r(t)}function g(e,t){for(var r,i=t.length;i>e;)if(null!=(r=t[--i])&&"function"!=typeof r)throw new Error("arg "+i+" must be a function")}function _(){}function v(e){return e}var y,b,C;return e.defer=a,e.resolve=t,e.reject=r,e.join=d,e.all=c,e.map=h,e.reduce=p,e.any=u,e.some=l,e.chain=f,e.isPromise=s,i.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(C,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(C,t)})})}},b=[].slice,y=[].reduce||function(e){var t,r,i,n,o;if(o=0,t=Object(this),n=t.length>>>0,r=arguments,r.length<=1)for(;;){if(o in t){i=t[o++];break}if(++o>=n)throw new TypeError}else i=r[1];for(;o<n;++o)o in t&&(i=e(i,t[o],o,t));return i},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/Event",["./Check","./defined","./defineProperties"],function(e,t,r){"use strict";function i(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function n(e,t){return t-e}return r(i.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),i.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var r=this;return function(){r.removeEventListener(e,t)}},i.prototype.removeEventListener=function(e,t){for(var r=this._listeners,i=this._scopes,n=-1,o=0;o<r.length;o++)if(r[o]===e&&i[o]===t){n=o;break}return-1!==n&&(this._insideRaiseEvent?(this._toRemove.push(n),r[n]=void 0,i[n]=void 0):(r.splice(n,1),i.splice(n,1)),!0)},i.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;var e,r=this._listeners,i=this._scopes,o=r.length;for(e=0;e<o;e++){var a=r[e];t(a)&&r[e].apply(i[e],arguments)}var s=this._toRemove;if((o=s.length)>0){for(s.sort(n),e=0;e<o;e++){var l=s[e];r.splice(l,1),i.splice(l,1)}s.length=0}this._insideRaiseEvent=!1},i}),define("Core/Heap",["./Check","./defaultValue","./defined","./defineProperties"],function(e,t,r,i){"use strict";function n(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function o(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}return i(n.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){this._maximumLength=e,this._length>e&&e>0&&(this._length=e,this._array.length=e)}},comparator:{get:function(){return this._comparator}}}),n.prototype.reserve=function(e){e=t(e,this._length),this._array.length=e},n.prototype.heapify=function(e){e=t(e,0);for(var r=this._length,i=this._comparator,n=this._array,a=-1,s=!0;s;){var l=2*(e+1),u=l-1;a=u<r&&i(n[u],n[e])<0?u:e,l<r&&i(n[l],n[a])<0&&(a=l),a!==e?(o(n,a,e),e=a):s=!1}},n.prototype.resort=function(){for(var e=this._length,t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},n.prototype.insert=function(e){var t=this._array,i=this._comparator,n=this._maximumLength,a=this._length++;for(a<t.length?t[a]=e:t.push(e);0!==a;){var s=Math.floor((a-1)/2);if(!(i(t[a],t[s])<0))break;o(t,a,s),a=s}var l;return r(n)&&this._length>n&&(l=t[n],this._length=n),l},n.prototype.pop=function(e){if(e=t(e,0),0!==this._length){var r=this._array,i=r[e];return o(r,e,--this._length),this.heapify(e),i}},n}),define("Core/RequestScheduler",["../ThirdParty/Uri","../ThirdParty/when","./Check","./defined","./defineProperties","./Event","./Heap","./isBlobUri","./isDataUri","./RequestState"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){return e.priority-t.priority}function d(){}function h(e){i(e.priorityFunction)&&(e.priority=e.priorityFunction())}function p(e){return A[e]<d.maximumRequestsPerServer}function f(e){return e.state===u.UNISSUED&&(e.state=u.ISSUED,e.deferred=t.defer()),e.deferred.promise}function m(e){return function(t){e.state!==u.CANCELLED&&(--C.numberOfActiveRequests,--A[e.serverKey],x.raiseEvent(),e.state=u.RECEIVED,e.deferred.resolve(t))}}function g(e){return function(t){e.state!==u.CANCELLED&&(++C.numberOfFailedRequests,--C.numberOfActiveRequests,--A[e.serverKey],x.raiseEvent(t),e.state=u.FAILED,e.deferred.reject(t))}}function _(e){var t=f(e);return e.state=u.ACTIVE,w.push(e),++C.numberOfActiveRequests,++C.numberOfActiveRequestsEver,++A[e.serverKey],e.requestFunction().then(m(e)).otherwise(g(e)),t}function v(e){var t=e.state===u.ACTIVE;e.state=u.CANCELLED,++C.numberOfCancelledRequests,e.deferred.reject(),t&&(--C.numberOfActiveRequests,--A[e.serverKey],++C.numberOfCancelledActiveRequests),i(e.cancelFunction)&&e.cancelFunction()}function y(){C.numberOfAttemptedRequests=0,C.numberOfCancelledRequests=0,C.numberOfCancelledActiveRequests=0}function b(){d.debugShowStatistics&&(C.numberOfAttemptedRequests>0&&console.log("Number of attempted requests: "+C.numberOfAttemptedRequests),C.numberOfActiveRequests>0&&console.log("Number of active requests: "+C.numberOfActiveRequests),C.numberOfCancelledRequests>0&&console.log("Number of cancelled requests: "+C.numberOfCancelledRequests),C.numberOfCancelledActiveRequests>0&&console.log("Number of cancelled active requests: "+C.numberOfCancelledActiveRequests),C.numberOfFailedRequests>0&&console.log("Number of failed requests: "+C.numberOfFailedRequests),y())}var C={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0},S=20,T=new a({comparator:c});T.maximumLength=S,T.reserve(S);var w=[],A={},E="undefined"!=typeof document?new e(document.location.href):new e,x=new o;return d.maximumRequests=50,d.maximumRequestsPerServer=6,d.throttleRequests=!0,d.debugShowStatistics=!1,d.requestCompletedEvent=x,n(d,{statistics:{get:function(){return C}},priorityHeapLength:{get:function(){return S},set:function(e){if(e<S)for(;T.length>e;){var t=T.pop();v(t)}S=e,T.maximumLength=e,T.reserve(e)}}}),d.update=function(){var e,t,r=0,i=w.length;for(e=0;e<i;++e)t=w[e],t.cancelled&&v(t),t.state===u.ACTIVE?r>0&&(w[e-r]=t):++r;w.length-=r;var n=T.internalArray,o=T.length;for(e=0;e<o;++e)h(n[e]);T.resort();for(var a=Math.max(d.maximumRequests-w.length,0),s=0;s<a&&T.length>0;)t=T.pop(),t.cancelled?v(t):!t.throttleByServer||p(t.serverKey)?(_(t),++s):v(t);b()},d.getServerKey=function(t){var r=new e(t).resolve(E);r.normalize();var n=r.authority;/:/.test(n)||(n=n+":"+("https"===r.scheme?"443":"80"));var o=A[n];return i(o)||(A[n]=0),n},d.request=function(e){if(l(e.url)||s(e.url))return x.raiseEvent(),e.state=u.RECEIVED,e.requestFunction();if(++C.numberOfAttemptedRequests,i(e.serverKey)||(e.serverKey=d.getServerKey(e.url)),!d.throttleRequests||!e.throttle)return _(e);if(!(w.length>=d.maximumRequests)&&(!e.throttleByServer||p(e.serverKey))){h(e);var t=T.insert(e);if(i(t)){if(t===e)return;v(t)}return f(e)}},d.clearForSpecs=function(){for(;T.length>0;){v(T.pop())}for(var e=w.length,t=0;t<e;++t)v(w[t]);w.length=0,A={},C.numberOfAttemptedRequests=0,C.numberOfActiveRequests=0,C.numberOfCancelledRequests=0,C.numberOfCancelledActiveRequests=0,C.numberOfFailedRequests=0,C.numberOfActiveRequestsEver=0},d.numberOfActiveRequestsByServer=function(e){return A[e]},d.requestHeap=T,d}),define("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}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(r){var i=new e(r);i.normalize();var n=i.getAuthority();if(t(n)){if(-1!==n.indexOf("@")){n=n.split("@")[1]}if(-1===n.indexOf(":")){var o=i.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)n+=":80";else{if("https"!==o)return;n+=":443"}}return n}}var n={},o={};return n.add=function(e,r){var i=e.toLowerCase()+":"+r;t(o[i])||(o[i]=!0)},n.remove=function(e,r){var i=e.toLowerCase()+":"+r;t(o[i])&&delete o[i]},n.contains=function(e){var r=i(e);return!(!t(r)||!t(o[r]))},n.clear=function(){o={}},n}),define("Core/Resource",["./appendForwardSlash","./Check","./clone","./combine","./defaultValue","./defined","./defineProperties","./deprecationWarning","./DeveloperError","./freezeObject","./getAbsoluteUri","./getBaseUri","./getExtensionFromUri","./isBlobUri","./isCrossOriginUrl","./isDataUri","./objectToQuery","./queryToObject","./Request","./RequestErrorEvent","./RequestScheduler","./RequestState","./RuntimeError","./TrustedServers","../ThirdParty/Uri","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A){"use strict";function E(e,t,r,i){var n=e.query;if(!o(n)||0===n.length)return{};var a;if(-1===n.indexOf("=")){var s={};s[n]=void 0,a=s}else a=_(n);t._queryParameters=r?D(a,t._queryParameters,i):a,e.query=void 0}function x(e,t){var r=t._queryParameters,i=Object.keys(r);1!==i.length||o(r[i[0]])?e.query=g(r):e.query=i[0]}function P(e,t){return o(e)?o(e.clone)?e.clone():r(e):t}function I(e){if(e.state===C.ISSUED||e.state===C.ACTIVE)throw new S("The Resource is already being fetched.");e.state=C.UNISSUED,e.deferred=void 0}function D(e,t,n){if(!n)return i(e,t);var a=r(e,!0);for(var s in t)if(t.hasOwnProperty(s)){var l=a[s],u=t[s];o(l)?(Array.isArray(l)||(l=a[s]=[l]),a[s]=l.concat(u)):a[s]=Array.isArray(u)?u.slice():u}return a}function O(e){e=n(e,n.EMPTY_OBJECT),"string"==typeof e&&(e={url:e}),this._url=void 0,this._templateValues=P(e.templateValues,{}),this._queryParameters=P(e.queryParameters,{}),this.headers=P(e.headers,{}),this.request=n(e.request,new v),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=n(e.retryAttempts,0),this._retryCount=0;var t=new w(e.url);E(t,this,!0,!0),t.fragment=void 0,this._url=t.toString()}function M(e,t){var r=e.request;r.url=e.url,r.requestFunction=function(){
var r=e.url,i=!1;e.isDataUri||e.isBlobUri||(i=e.isCrossOriginUrl);var n=A.defer();return O._Implementations.createImage(r,i&&t,n),n.promise};var i=b.request(r);if(o(i))return i.otherwise(function(i){return r.state!==C.FAILED?A.reject(i):e.retryOnError(i).then(function(n){return n?(r.state=C.UNISSUED,r.deferred=void 0,M(e,t)):A.reject(i)})})}function R(e,t,r){var i={};i[t]=r,e.setQueryParameters(i);var n=e.request;n.url=e.url,n.requestFunction=function(){var t=A.defer();return window[r]=function(e){t.resolve(e);try{delete window[r]}catch(e){window[r]=void 0}},O._Implementations.loadAndExecuteScript(e.url,r,t),t.promise};var a=b.request(n);if(o(a))return a.otherwise(function(i){return n.state!==C.FAILED?A.reject(i):e.retryOnError(i).then(function(o){return o?(n.state=C.UNISSUED,n.deferred=void 0,R(e,t,r)):A.reject(i)})})}function L(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function N(e,t){for(var r=L(e,t),i=new ArrayBuffer(r.length),n=new Uint8Array(i),o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return i}function k(e,t){t=n(t,"");var r=e[1],i=!!e[2],o=e[3];switch(t){case"":case"text":return L(i,o);case"arraybuffer":return N(i,o);case"blob":var a=N(i,o);return new Blob([a],{type:r});case"document":return(new DOMParser).parseFromString(L(i,o),r);case"json":return JSON.parse(L(i,o))}}var F=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();O.createIfNeeded=function(e,t){if(e instanceof O)return e.getDerivedResource({request:e.request});if("string"!=typeof e)return e;var r=P(t,{});return r.url=e,new O(r)},a(O,{isBlobSupported:{get:function(){return F}}}),a(O.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){var t=new w(e);E(t,this,!1),t.fragment=void 0,this._url=t.toString()}},extension:{get:function(){return h(this._url)}},isDataUri:{get:function(){return m(this._url)}},isBlobUri:{get:function(){return p(this._url)}},isCrossOriginUrl:{get:function(){return f(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}}}),O.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;var r=new w(this._url);e&&x(r,this);var i=r.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),n=this._templateValues,a=Object.keys(n);if(a.length>0)for(var s=0;s<a.length;s++){var l=a[s],u=n[l];i=i.replace(new RegExp("{"+l+"}","g"),encodeURIComponent(u))}return t&&o(this.proxy)&&(i=this.proxy.getURL(i)),i},O.prototype.setQueryParameters=function(e,t){this._queryParameters=t?D(this._queryParameters,e,!1):D(e,this._queryParameters,!1)},O.prototype.addQueryParameters=function(e,t){return s("Resource.addQueryParameters","addQueryParameters has been deprecated and will be removed 1.45. Use setQueryParameters or appendQueryParameters instead."),this.setQueryParameters(e,t)},O.prototype.appendQueryParameters=function(e){this._queryParameters=D(e,this._queryParameters,!0)},O.prototype.setTemplateValues=function(e,t){this._templateValues=t?i(this._templateValues,e):i(e,this._templateValues)},O.prototype.addTemplateValues=function(e,t){return s("Resource.addTemplateValues","addTemplateValues has been deprecated and will be removed 1.45. Use setTemplateValues."),this.setTemplateValues(e,t)},O.prototype.getDerivedResource=function(e){var t=this.clone();if(t._retryCount=0,o(e.url)){var r=new w(e.url);E(r,t,!0,n(e.preserveQueryParameters,!1)),r.fragment=void 0,t._url=r.resolve(new w(c(this._url))).toString()}return o(e.queryParameters)&&(t._queryParameters=i(e.queryParameters,t._queryParameters)),o(e.templateValues)&&(t._templateValues=i(e.templateValues,t.templateValues)),o(e.headers)&&(t.headers=i(e.headers,t.headers)),o(e.proxy)&&(t.proxy=e.proxy),o(e.request)&&(t.request=e.request),o(e.retryCallback)&&(t.retryCallback=e.retryCallback),o(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},O.prototype.retryOnError=function(e){var t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return A(!1);var r=this;return A(t(this,e)).then(function(e){return++r._retryCount,e})},O.prototype.clone=function(e){return o(e)||(e=new O({url:this._url})),e._url=this._url,e._queryParameters=r(this._queryParameters),e._templateValues=r(this._templateValues),e.headers=r(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},O.prototype.getBaseUri=function(e){return d(this.getUrlComponent(e),e)},O.prototype.appendForwardSlash=function(){this._url=e(this._url)},O.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},O.fetchArrayBuffer=function(e){return new O(e).fetchArrayBuffer()},O.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},O.fetchBlob=function(e){return new O(e).fetchBlob()},O.prototype.fetchImage=function(e,t){if(o(t)&&s("Resource.fetchImage.allowCrossOrigin","The allowCrossOrigin parameter has been deprecated and will be removed in Cesium 1.44. It no longer needs to be specified."),e=n(e,!1),t=n(t,!0),I(this.request),!F||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!e)return M(this,t);var r=this.fetchBlob();if(o(r)){var i,a;return r.then(function(e){if(o(e)){a=e;var t=window.URL.createObjectURL(e);return i=new O({url:t}),M(i)}}).then(function(e){if(o(e))return window.URL.revokeObjectURL(i.url),e.blob=a,e}).otherwise(function(e){return o(i)&&window.URL.revokeObjectURL(i.url),A.reject(e)})}},O.fetchImage=function(e){return new O(e).fetchImage(e.preferBlob,e.allowCrossOrigin)},O.prototype.fetchText=function(){return this.fetch({responseType:"text"})},O.fetchText=function(e){return new O(e).fetchText()},O.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(o(e))return e.then(function(e){if(o(e))return JSON.parse(e)})},O.fetchJson=function(e){return new O(e).fetchJson()},O.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},O.fetchXML=function(e){return new O(e).fetchXML()},O.prototype.fetchJsonp=function(e){e=n(e,"callback"),I(this.request);var t;do{t="loadJsonp"+Math.random().toString().substring(2,8)}while(o(window[t]));return R(this,e,t)},O.fetchJsonp=function(e){return new O(e).fetchJsonp(e.callbackParameterName)},O._makeRequest=function(e,t){I(e.request);var r=e.request;r.url=e.url,r.requestFunction=function(){var n=t.responseType,a=i(e.headers,t.headers),s=t.overrideMimeType,l=t.method,u=t.data,c=A.defer(),d=O._Implementations.loadWithXhr(e.url,n,l,u,a,c,s);return o(d)&&o(d.abort)&&(r.cancelFunction=function(){d.abort()}),c.promise};var n=b.request(r);if(o(n))return n.then(function(e){return e}).otherwise(function(i){return r.state!==C.FAILED?A.reject(i):e.retryOnError(i).then(function(n){return n?(r.state=C.UNISSUED,r.deferred=void 0,e.fetch(t)):A.reject(i)})})};var B=/^data:(.*?)(;base64)?,(.*)$/;return O.prototype.fetch=function(e){return e=P(e,{}),e.method="GET",O._makeRequest(this,e)},O.fetch=function(e){return new O(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},O.prototype.delete=function(e){return e=P(e,{}),e.method="DELETE",O._makeRequest(this,e)},O.delete=function(e){return new O(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},O.prototype.head=function(e){return e=P(e,{}),e.method="HEAD",O._makeRequest(this,e)},O.head=function(e){return new O(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},O.prototype.options=function(e){return e=P(e,{}),e.method="OPTIONS",O._makeRequest(this,e)},O.options=function(e){return new O(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},O.prototype.post=function(e,r){return t.defined("data",e),r=P(r,{}),r.method="POST",r.data=e,O._makeRequest(this,r)},O.post=function(e){return new O(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},O.prototype.put=function(e,r){return t.defined("data",e),r=P(r,{}),r.method="PUT",r.data=e,O._makeRequest(this,r)},O.put=function(e){return new O(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},O.prototype.patch=function(e,r){return t.defined("data",e),r=P(r,{}),r.method="PATCH",r.data=e,O._makeRequest(this,r)},O.patch=function(e){return new O(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},O._Implementations={},O._Implementations.createImage=function(e,t,r){var i=new Image;i.onload=function(){r.resolve(i)},i.onerror=function(e){r.reject(e)},t&&(T.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e},O._Implementations.loadWithXhr=function(e,t,r,i,n,a,s){var l=B.exec(e);if(null!==l)return void a.resolve(k(l,t));var u=new XMLHttpRequest;if(T.contains(e)&&(u.withCredentials=!0),o(s)&&o(u.overrideMimeType)&&u.overrideMimeType(s),u.open(r,e,!0),o(n))for(var c in n)n.hasOwnProperty(c)&&u.setRequestHeader(c,n[c]);o(t)&&(u.responseType=t);var d=!1;return"string"==typeof e&&(d=0===e.indexOf("file://")||"file://"===window.location.origin),u.onload=function(){if((u.status<200||u.status>=300)&&(!d||0!==u.status))return void a.reject(new y(u.status,u.response,u.getAllResponseHeaders()));var e=u.response,i=u.responseType;if("HEAD"===r||"OPTIONS"===r){var n=u.getAllResponseHeaders(),s=n.trim().split(/[\r\n]+/),l={};return s.forEach(function(e){var t=e.split(": "),r=t.shift();l[r]=t.join(": ")}),void a.resolve(l)}if(204===u.status)a.resolve();else if(!o(e)||o(t)&&i!==t)if("json"===t&&"string"==typeof e)try{a.resolve(JSON.parse(e))}catch(e){a.reject(e)}else(""===i||"document"===i)&&o(u.responseXML)&&u.responseXML.hasChildNodes()?a.resolve(u.responseXML):""!==i&&"text"!==i||!o(u.responseText)?a.reject(new S("Invalid XMLHttpRequest response type.")):a.resolve(u.responseText);else a.resolve(e)},u.onerror=function(e){a.reject(new y)},u.send(i),u},O._Implementations.loadAndExecuteScript=function(e,t,r){var i=document.createElement("script");i.async=!0,i.src=e;var n=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,n.removeChild(i)},i.onerror=function(e){r.reject(e)},n.appendChild(i)},O._DefaultImplementations={},O._DefaultImplementations.createImage=O._Implementations.createImage,O._DefaultImplementations.loadWithXhr=O._Implementations.loadWithXhr,O._DefaultImplementations.loadAndExecuteScript=O._Implementations.loadAndExecuteScript,O.DEFAULT=u(new O({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),O}),define("Core/BingMapsGeocoderService",["./BingMapsApi","./Check","./defaultValue","./defined","./defineProperties","./Rectangle","./Resource"],function(e,t,r,i,n,o,a){"use strict";function s(t){t=r(t,r.EMPTY_OBJECT);var n=t.key;if(this._key=e.getKey(n),i(n)){var o=e.getErrorCredit(n);i(o)&&t.scene._frameState.creditDisplay.addDefaultCredit(o)}this._resource=new a({url:l,queryParameters:{key:this._key}})}var l="https://dev.virtualearth.net/REST/v1/Locations";return n(s.prototype,{url:{get:function(){return l}},key:{get:function(){return this._key}}}),s.prototype.geocode=function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(e){return 0===e.resourceSets.length?[]:e.resourceSets[0].resources.map(function(e){var t=e.bbox,r=t[0],i=t[1],n=t[2],a=t[3];return{displayName:e.name,destination:o.fromDegrees(i,r,a,n)}})})},s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,i,n,o,a){"use strict";function s(e){this._ellipsoid=r(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,r){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},s.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,a=e.y*n,s=e.z;return i(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new t(o,a,s)},s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,r,i,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,r){return t=i(t,0),n(r)||(r=new l),r.x=e[t++],r.y=e[t++],r.width=e[t++],r.height=e[t],r},l.fromPoints=function(e,t){if(n(t)||(t=new l),!n(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var r=e.length,i=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;u<r;u++){var c=e[u],d=c.x,h=c.y;i=Math.min(d,i),a=Math.max(d,a),o=Math.min(h,o),s=Math.max(h,s)}return t.x=i,t.y=o,t.width=a-i,t.height=s-o,t};var u=new o,c=new t,d=new t;return l.fromRectangle=function(t,r,o){if(n(o)||(o=new l),!n(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;r=i(r,u);var a=r.project(s.southwest(t,c)),h=r.project(s.northeast(t,d));return e.subtract(h,a,h),o.x=a.x,o.y=a.y,o.width=h.x,o.height=h.y,o},l.clone=function(e,t){if(n(e))return n(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,r){n(r)||(r=new l);var i=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 r.x=i,r.y=o,r.width=a-i,r.height=s-o,r},l.expand=function(e,t,r){r=l.clone(e,r);var i=t.x-r.x,n=t.y-r.y;return i>r.width?r.width=i:i<0&&(r.width-=i,r.x=t.x),n>r.height?r.height=n:n<0&&(r.height-=n,r.y=t.y),r},l.intersect=function(e,t){var r=e.x,i=e.y,n=t.x,o=t.y;return r>n+t.width||r+e.width<n||i+e.height<o||i>o+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||n(e)&&n(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}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i,n,o,a,s,l,u){this[0]=r(e,0),this[1]=r(n,0),this[2]=r(s,0),this[3]=r(t,0),this[4]=r(o,0),this[5]=r(l,0),this[6]=r(i,0),this[7]=r(a,0),this[8]=r(u,0)}function u(e){for(var t=0,r=0;r<9;++r){var i=e[r];t+=i*i}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var i=e[l.getElementIndex(m[r],f[r])];t+=2*i*i}return Math.sqrt(t)}function d(e,t){for(var r=s.EPSILON15,i=0,n=1,o=0;o<3;++o){var a=Math.abs(e[l.getElementIndex(m[o],f[o])]);a>i&&(n=o,i=a)}var u=1,c=0,d=f[n],h=m[n];if(Math.abs(e[l.getElementIndex(h,d)])>r){var p,g=e[l.getElementIndex(h,h)],_=e[l.getElementIndex(d,d)],v=e[l.getElementIndex(h,d)],y=(g-_)/2/v;p=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+p*p),c=p*u}return t=l.clone(l.IDENTITY,t),t[l.getElementIndex(d,d)]=t[l.getElementIndex(h,h)]=u,t[l.getElementIndex(h,d)]=c,t[l.getElementIndex(d,h)]=-c,t}l.packedLength=9,l.pack=function(e,t,i){return i=r(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t},l.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new l),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},l.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 l(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},l.fromArray=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.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 l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},l.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,s=e.y*e.y,u=e.y*e.z,c=e.y*e.w,d=e.z*e.z,h=e.z*e.w,p=e.w*e.w,f=r-s-d+p,m=2*(n-h),g=2*(o+c),_=2*(n+h),v=-r+s-d+p,y=2*(u-a),b=2*(o-c),C=2*(u+a),S=-r-s+d+p;return i(t)?(t[0]=f,t[1]=_,t[2]=b,t[3]=m,t[4]=v,t[5]=C,t[6]=g,t[7]=y,t[8]=S,t):new l(f,m,g,_,v,y,b,C,S)},l.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),s=Math.sin(-e.heading),u=Math.sin(e.roll),c=r*n,d=-o*s+u*a*n,h=u*s+o*a*n,p=r*s,f=o*n+u*a*s,m=-u*n+o*a*s,g=-a,_=u*r,v=o*r;return i(t)?(t[0]=c,t[1]=p,t[2]=g,t[3]=d,t[4]=f,t[5]=_,t[6]=h,t[7]=m,t[8]=v,t):new l(c,d,h,p,f,m,g,_,v)},l.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 l(e.x,0,0,0,e.y,0,0,0,e.z)},l.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 l(e,0,0,0,e,0,0,0,e)},l.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 l(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},l.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 l(1,0,0,0,r,-n,0,n,r)},l.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 l(r,0,n,0,1,0,-n,0,r)},l.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 l(r,-n,0,n,r,0,0,0,1)},l.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]]},l.getElementIndex=function(e,t){return 3*e+t},l.getColumn=function(e,t,r){var i=3*t,n=e[i],o=e[i+1],a=e[i+2];return r.x=n,r.y=o,r.z=a,r},l.setColumn=function(e,t,r,i){i=l.clone(e,i);var n=3*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i},l.getRow=function(e,t,r){var i=e[t],n=e[t+3],o=e[t+6];return r.x=i,r.y=n,r.z=o,r},l.setRow=function(e,t,r,i){return i=l.clone(e,i),i[t]=r.x,i[t+3]=r.y,i[t+6]=r.z,i};var h=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var i=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],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=i,r[1]=n,r[2]=o,r[3]=a,r[4]=s,r[5]=l,r[6]=u,r[7]=c,r[8]=d,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},l.multiplyByVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[3]*n+e[6]*o,s=e[1]*i+e[4]*n+e[7]*o,l=e[2]*i+e[5]*n+e[8]*o;return r.x=a,r.y=s,r.z=l,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},l.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},l.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},l.transpose=function(e,t){var r=e[0],i=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]=r,t[1]=i,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var f=[1,0,0],m=[2,2,1],g=new l,_=new l;return l.computeEigenDecomposition=function(e,t){var r=s.EPSILON20,n=0,o=0;i(t)||(t={});for(var a=t.unitary=l.clone(l.IDENTITY,t.unitary),h=t.diagonal=l.clone(e,t.diagonal),p=r*u(h);o<10&&c(h)>p;)d(h,g),l.transpose(g,_),l.multiply(h,g,h),l.multiply(_,h,h),l.multiply(a,g,a),++n>2&&(++o,n=0);return t},l.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},l.determinant=function(e){var t=e[0],r=e[3],i=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*i-r*u)+s*(r*a-o*i)},l.inverse=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],d=e[8],h=l.determinant(e);t[0]=a*d-c*s,t[1]=c*n-i*d,t[2]=i*s-a*n,t[3]=u*s-o*d,t[4]=r*d-u*n,t[5]=o*n-r*s,t[6]=o*c-u*a,t[7]=u*i-r*c,t[8]=r*a-o*i;var p=1/h;return l.multiplyByScalar(t,p,t)},l.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]},l.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},l.IDENTITY=a(new l(1,0,0,0,1,0,0,0,1)),l.ZERO=a(new l(0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN1ROW0=3,l.COLUMN1ROW1=4,l.COLUMN1ROW2=5,l.COLUMN2ROW0=6,l.COLUMN2ROW1=7,l.COLUMN2ROW2=8,n(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},l}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,r,i,n){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0),this.w=t(n,0)}a.fromElements=function(e,t,i,n,o){return r(o)?(o.x=e,o.y=t,o.z=i,o.w=n,o):new a(e,t,i,n)},a.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i++]=e.z,r[i]=e.w,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.x=e[i++],n.y=e[i++],n.z=e[i++],n.w=e[i],n},a.packArray=function(e,t){var i=e.length;r(t)?t.length=4*i:t=new Array(4*i);for(var n=0;n<i;++n)a.pack(e[n],t,4*n);return t},a.unpackArray=function(e,t){var i=e.length;r(t)?t.length=i/4:t=new Array(i/4);for(var n=0;n<i;n+=4){var o=n/4;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,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var 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 r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},a.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var l=new a;a.lerp=function(e,t,r,i){return a.multiplyByScalar(t,r,l),i=a.multiplyByScalar(e,1-r,i),a.add(l,i,i)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,u);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):r.z<=r.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):r.y<=r.z?r.y<=r.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):r.z<=r.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,i,n)&&o.equalsEpsilon(e.y,t.y,i,n)&&o.equalsEpsilon(e.z,t.z,i,n)&&o.equalsEpsilon(e.w,t.w,i,n)},a.ZERO=n(new a(0,0,0,0)),a.UNIT_X=n(new a(1,0,0,0)),a.UNIT_Y=n(new a(0,1,0,0)),a.UNIT_Z=n(new a(0,0,1,0)),a.UNIT_W=n(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,n,o,a,s,l,u,c,d,h,p,f,m,g){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(f,0),this[8]=i(r,0),this[9]=i(s,0),this[10]=i(d,0),this[11]=i(m,0),this[12]=i(n,0),this[13]=i(l,0),this[14]=i(h,0),this[15]=i(g,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,r){return t=i(t,0),n(r)||(r=new c),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},c.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):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 n(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,r,o){return r=i(r,e.ZERO),n(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]=r.x,o[13]=r.y,o[14]=r.z,o[15]=1,o):new c(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,r,i){n(i)||(i=new c);var o=r.x,a=r.y,s=r.z,l=t.x*t.x,u=t.x*t.y,d=t.x*t.z,h=t.x*t.w,p=t.y*t.y,f=t.y*t.z,m=t.y*t.w,g=t.z*t.z,_=t.z*t.w,v=t.w*t.w,y=l-p-g+v,b=2*(u-_),C=2*(d+m),S=2*(u+_),T=-l+p-g+v,w=2*(f-h),A=2*(d-m),E=2*(f+h),x=-l-p+g+v;return i[0]=y*o,i[1]=S*o,i[2]=A*o,i[3]=0,i[4]=b*a,i[5]=T*a,i[6]=E*a,i[7]=0,i[8]=C*s,i[9]=w*s,i[10]=x*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},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 n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,h=new e,p=new e;c.fromCamera=function(t,r){var i=t.position,o=t.direction,a=t.up;e.normalize(o,d),e.normalize(e.cross(d,a,h),h),e.normalize(e.cross(h,d,p),p);var s=h.x,l=h.y,u=h.z,f=d.x,m=d.y,g=d.z,_=p.x,v=p.y,y=p.z,b=i.x,C=i.y,S=i.z,T=s*-b+l*-C+u*-S,w=_*-b+v*-C+y*-S,A=f*b+m*C+g*S;return n(r)?(r[0]=s,r[1]=_,r[2]=-f,r[3]=0,r[4]=l,r[5]=v,r[6]=-m,r[7]=0,r[8]=u,r[9]=y,r[10]=-g,r[11]=0,r[12]=T,r[13]=w,r[14]=A,r[15]=1,r):new c(s,l,u,T,_,v,y,w,-f,-m,-g,A,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,r,i,n){var o=Math.tan(.5*e),a=1/o,s=a/t,l=(i+r)/(r-i),u=2*i*r/(r-i);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,r,i,n,o,a){var s=1/(t-e),l=1/(i-r),u=1/(o-n),c=-(t+e)*s,d=-(i+r)*l,h=-(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]=d,a[14]=h,a[15]=1,a},c.computePerspectiveOffCenter=function(e,t,r,i,n,o,a){var s=2*n/(t-e),l=2*n/(i-r),u=(t+e)/(t-e),c=(i+r)/(i-r),d=-(o+n)/(o-n),h=-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]=d,a[11]=-1,a[12]=0,a[13]=0,a[14]=h,a[15]=0,a},c.computeInfinitePerspectiveOffCenter=function(e,t,r,i,n,o){var a=2*n/(t-e),s=2*n/(i-r),l=(t+e)/(t-e),u=(i+r)/(i-r),c=-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]=-1,o[11]=-1,o[12]=0,o[13]=0,o[14]=c,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,d=.5*(r-t),h=u,p=c,f=d,m=o+u,g=a+c,_=t+d;return n[0]=h,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]=f,n[11]=0,n[12]=m,n[13]=g,n[14]=_,n[15]=1,n},c.computeView=function(t,r,i,n,o){return o[0]=n.x,o[1]=i.x,o[2]=-r.x,o[3]=0,o[4]=n.y,o[5]=i.y,o[6]=-r.y,o[7]=0,o[8]=n.z,o[9]=i.z,o[10]=-r.z,o[11]=0,o[12]=-e.dot(n,t),o[13]=-e.dot(i,t),o[14]=e.dot(r,t),o[15]=1,o},c.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,r){var i=4*t,n=e[i],o=e[i+1],a=e[i+2],s=e[i+3];return r.x=n,r.y=o,
r.z=a,r.w=s,r},c.setColumn=function(e,t,r,i){i=c.clone(e,i);var n=4*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i[n+3]=r.w,i},c.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},c.getRow=function(e,t,r){var i=e[t],n=e[t+4],o=e[t+8],a=e[t+12];return r.x=i,r.y=n,r.z=o,r.w=a,r},c.setRow=function(e,t,r,i){return i=c.clone(e,i),i[t]=r.x,i[t+4]=r.y,i[t+8]=r.z,i[t+12]=r.w,i};var f=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],f)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],f)),r};var m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.multiply=function(e,t,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=e[9],p=e[10],f=e[11],m=e[12],g=e[13],_=e[14],v=e[15],y=t[0],b=t[1],C=t[2],S=t[3],T=t[4],w=t[5],A=t[6],E=t[7],x=t[8],P=t[9],I=t[10],D=t[11],O=t[12],M=t[13],R=t[14],L=t[15],N=i*y+s*b+d*C+m*S,k=n*y+l*b+h*C+g*S,F=o*y+u*b+p*C+_*S,B=a*y+c*b+f*C+v*S,U=i*T+s*w+d*A+m*E,V=n*T+l*w+h*A+g*E,z=o*T+u*w+p*A+_*E,G=a*T+c*w+f*A+v*E,H=i*x+s*P+d*I+m*D,W=n*x+l*P+h*I+g*D,j=o*x+u*P+p*I+_*D,q=a*x+c*P+f*I+v*D,Y=i*O+s*M+d*R+m*L,X=n*O+l*M+h*R+g*L,Q=o*O+u*M+p*R+_*L,Z=a*O+c*M+f*R+v*L;return r[0]=N,r[1]=k,r[2]=F,r[3]=B,r[4]=U,r[5]=V,r[6]=z,r[7]=G,r[8]=H,r[9]=W,r[10]=j,r[11]=q,r[12]=Y,r[13]=X,r[14]=Q,r[15]=Z,r},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},c.multiplyTransformation=function(e,t,r){var i=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],d=e[10],h=e[12],p=e[13],f=e[14],m=t[0],g=t[1],_=t[2],v=t[4],y=t[5],b=t[6],C=t[8],S=t[9],T=t[10],w=t[12],A=t[13],E=t[14],x=i*m+a*g+u*_,P=n*m+s*g+c*_,I=o*m+l*g+d*_,D=i*v+a*y+u*b,O=n*v+s*y+c*b,M=o*v+l*y+d*b,R=i*C+a*S+u*T,L=n*C+s*S+c*T,N=o*C+l*S+d*T,k=i*w+a*A+u*E+h,F=n*w+s*A+c*E+p,B=o*w+l*A+d*E+f;return r[0]=x,r[1]=P,r[2]=I,r[3]=0,r[4]=D,r[5]=O,r[6]=M,r[7]=0,r[8]=R,r[9]=L,r[10]=N,r[11]=0,r[12]=k,r[13]=F,r[14]=B,r[15]=1,r},c.multiplyByMatrix3=function(e,t,r){var i=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],d=e[10],h=t[0],p=t[1],f=t[2],m=t[3],g=t[4],_=t[5],v=t[6],y=t[7],b=t[8],C=i*h+a*p+u*f,S=n*h+s*p+c*f,T=o*h+l*p+d*f,w=i*m+a*g+u*_,A=n*m+s*g+c*_,E=o*m+l*g+d*_,x=i*v+a*y+u*b,P=n*v+s*y+c*b,I=o*v+l*y+d*b;return r[0]=C,r[1]=S,r[2]=T,r[3]=0,r[4]=w,r[5]=A,r[6]=E,r[7]=0,r[8]=x,r[9]=P,r[10]=I,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},c.multiplyByTranslation=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=i*e[0]+n*e[4]+o*e[8]+e[12],s=i*e[1]+n*e[5]+o*e[9]+e[13],l=i*e[2]+n*e[6]+o*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=a,r[13]=s,r[14]=l,r[15]=e[15],r};var g=new e;c.multiplyByUniformScale=function(e,t,r){return g.x=t,g.y=t,g.z=t,c.multiplyByScale(e,g,r)},c.multiplyByScale=function(e,t,r){var i=t.x,n=t.y,o=t.z;return 1===i&&1===n&&1===o?c.clone(e,r):(r[0]=i*e[0],r[1]=i*e[1],r[2]=i*e[2],r[3]=0,r[4]=n*e[4],r[5]=n*e[5],r[6]=n*e[6],r[7]=0,r[8]=o*e[8],r[9]=o*e[9],r[10]=o*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},c.multiplyByVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=t.w,s=e[0]*i+e[4]*n+e[8]*o+e[12]*a,l=e[1]*i+e[5]*n+e[9]*o+e[13]*a,u=e[2]*i+e[6]*n+e[10]*o+e[14]*a,c=e[3]*i+e[7]*n+e[11]*o+e[15]*a;return r.x=s,r.y=l,r.z=u,r.w=c,r},c.multiplyByPointAsVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[4]*n+e[8]*o,s=e[1]*i+e[5]*n+e[9]*o,l=e[2]*i+e[6]*n+e[10]*o;return r.x=a,r.y=s,r.z=l,r},c.multiplyByPoint=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[4]*n+e[8]*o+e[12],s=e[1]*i+e[5]*n+e[9]*o+e[13],l=e[2]*i+e[6]*n+e[10]*o+e[14];return r.x=a,r.y=s,r.z=l,r},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var r=e[1],i=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]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,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||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var _=new l,v=new l,y=new t,b=new t(0,0,0,1);return c.inverse=function(e,r){if(l.equalsEpsilon(c.getRotation(e,_),v,s.EPSILON7)&&t.equals(c.getRow(e,3,y),b))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var i=e[0],n=e[4],o=e[8],a=e[12],d=e[1],h=e[5],p=e[9],f=e[13],m=e[2],g=e[6],C=e[10],S=e[14],T=e[3],w=e[7],A=e[11],E=e[15],x=C*E,P=S*A,I=g*E,D=S*w,O=g*A,M=C*w,R=m*E,L=S*T,N=m*A,k=C*T,F=m*w,B=g*T,U=x*h+D*p+O*f-(P*h+I*p+M*f),V=P*d+R*p+k*f-(x*d+L*p+N*f),z=I*d+L*h+F*f-(D*d+R*h+B*f),G=M*d+N*h+B*p-(O*d+k*h+F*p),H=P*n+I*o+M*a-(x*n+D*o+O*a),W=x*i+L*o+N*a-(P*i+R*o+k*a),j=D*i+R*n+B*a-(I*i+L*n+F*a),q=O*i+k*n+F*o-(M*i+N*n+B*o);x=o*f,P=a*p,I=n*f,D=a*h,O=n*p,M=o*h,R=i*f,L=a*d,N=i*p,k=o*d,F=i*h,B=n*d;var Y=x*w+D*A+O*E-(P*w+I*A+M*E),X=P*T+R*A+k*E-(x*T+L*A+N*E),Q=I*T+L*w+F*E-(D*T+R*w+B*E),Z=M*T+N*w+B*A-(O*T+k*w+F*A),K=I*C+M*S+P*g-(O*S+x*g+D*C),J=N*S+x*m+L*C-(R*C+k*S+P*m),$=R*g+B*S+D*m-(F*S+I*m+L*g),ee=F*C+O*m+k*g-(N*g+B*C+M*m),te=i*U+n*V+o*z+a*G;if(Math.abs(te)<s.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=U*te,r[1]=V*te,r[2]=z*te,r[3]=G*te,r[4]=H*te,r[5]=W*te,r[6]=j*te,r[7]=q*te,r[8]=Y*te,r[9]=X*te,r[10]=Q*te,r[11]=Z*te,r[12]=K*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},c.inverseTransformation=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[4],a=e[5],s=e[6],l=e[8],u=e[9],c=e[10],d=e[12],h=e[13],p=e[14],f=-r*d-i*h-n*p,m=-o*d-a*h-s*p,g=-l*d-u*h-c*p;return t[0]=r,t[1]=o,t[2]=l,t[3]=0,t[4]=i,t[5]=a,t[6]=u,t[7]=0,t[8]=n,t[9]=s,t[10]=c,t[11]=0,t[12]=f,t[13]=m,t[14]=g,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,o(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,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Math","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var f=new e,m=new e,g=new e,_=new e,v=new e,y=new e,b=new e,C=new e,S=new e,T=new e,w=new e,A=new e,E=4/3*r.PI;p.fromPoints=function(t,r){if(o(r)||(r=new p),!o(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i,n=e.clone(t[0],b),a=e.clone(n,f),s=e.clone(n,m),l=e.clone(n,g),u=e.clone(n,_),c=e.clone(n,v),d=e.clone(n,y),h=t.length;for(i=1;i<h;i++){e.clone(t[i],n);var E=n.x,x=n.y,P=n.z;E<a.x&&e.clone(n,a),E>u.x&&e.clone(n,u),x<s.y&&e.clone(n,s),x>c.y&&e.clone(n,c),P<l.z&&e.clone(n,l),P>d.z&&e.clone(n,d)}var I=e.magnitudeSquared(e.subtract(u,a,C)),D=e.magnitudeSquared(e.subtract(c,s,C)),O=e.magnitudeSquared(e.subtract(d,l,C)),M=a,R=u,L=I;D>L&&(L=D,M=s,R=c),O>L&&(L=O,M=l,R=d);var N=S;N.x=.5*(M.x+R.x),N.y=.5*(M.y+R.y),N.z=.5*(M.z+R.z);var k=e.magnitudeSquared(e.subtract(R,N,C)),F=Math.sqrt(k),B=T;B.x=a.x,B.y=s.y,B.z=l.z;var U=w;U.x=u.x,U.y=c.y,U.z=d.z;var V=e.multiplyByScalar(e.add(B,U,C),.5,A),z=0;for(i=0;i<h;i++){e.clone(t[i],n);var G=e.magnitude(e.subtract(n,V,C));G>z&&(z=G);var H=e.magnitudeSquared(e.subtract(n,N,C));if(H>k){var W=Math.sqrt(H);F=.5*(F+W),k=F*F;var j=W-F;N.x=(F*N.x+j*n.x)/W,N.y=(F*N.y+j*n.y)/W,N.z=(F*N.z+j*n.z)/W}}return F<z?(e.clone(N,r.center),r.radius=F):(e.clone(V,r.center),r.radius=z),r};var x=new s,P=new e,I=new e,D=new t,O=new t;p.fromRectangle2D=function(e,t,r){return p.fromRectangleWithHeights2D(e,t,0,0,r)},p.fromRectangleWithHeights2D=function(t,r,i,a,s){if(o(s)||(s=new p),!o(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;r=n(r,x),h.southwest(t,D),D.height=i,h.northeast(t,O),O.height=a;var l=r.project(D,P),u=r.project(O,I),c=u.x-l.x,d=u.y-l.y,f=u.z-l.z;s.radius=.5*Math.sqrt(c*c+d*d+f*f);var m=s.center;return m.x=l.x+.5*c,m.y=l.y+.5*d,m.z=l.z+.5*f,s};var M=[];p.fromRectangle3D=function(t,r,i,s){if(r=n(r,a.WGS84),i=n(i,0),o(s)||(s=new p),!o(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;var l=h.subsample(t,r,i,M);return p.fromPoints(l,s)},p.fromVertices=function(t,r,i,a){if(o(a)||(a=new p),!o(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;r=n(r,e.ZERO),i=n(i,3);var s=b;s.x=t[0]+r.x,s.y=t[1]+r.y,s.z=t[2]+r.z;var l,u=e.clone(s,f),c=e.clone(s,m),d=e.clone(s,g),h=e.clone(s,_),E=e.clone(s,v),x=e.clone(s,y),P=t.length;for(l=0;l<P;l+=i){var I=t[l]+r.x,D=t[l+1]+r.y,O=t[l+2]+r.z;s.x=I,s.y=D,s.z=O,I<u.x&&e.clone(s,u),I>h.x&&e.clone(s,h),D<c.y&&e.clone(s,c),D>E.y&&e.clone(s,E),O<d.z&&e.clone(s,d),O>x.z&&e.clone(s,x)}var M=e.magnitudeSquared(e.subtract(h,u,C)),R=e.magnitudeSquared(e.subtract(E,c,C)),L=e.magnitudeSquared(e.subtract(x,d,C)),N=u,k=h,F=M;R>F&&(F=R,N=c,k=E),L>F&&(F=L,N=d,k=x);var B=S;B.x=.5*(N.x+k.x),B.y=.5*(N.y+k.y),B.z=.5*(N.z+k.z);var U=e.magnitudeSquared(e.subtract(k,B,C)),V=Math.sqrt(U),z=T;z.x=u.x,z.y=c.y,z.z=d.z;var G=w;G.x=h.x,G.y=E.y,G.z=x.z;var H=e.multiplyByScalar(e.add(z,G,C),.5,A),W=0;for(l=0;l<P;l+=i){s.x=t[l]+r.x,s.y=t[l+1]+r.y,s.z=t[l+2]+r.z;var j=e.magnitude(e.subtract(s,H,C));j>W&&(W=j);var q=e.magnitudeSquared(e.subtract(s,B,C));if(q>U){var Y=Math.sqrt(q);V=.5*(V+Y),U=V*V;var X=Y-V;B.x=(V*B.x+X*s.x)/Y,B.y=(V*B.y+X*s.y)/Y,B.z=(V*B.z+X*s.z)/Y}}return V<W?(e.clone(B,a.center),a.radius=V):(e.clone(H,a.center),a.radius=W),a},p.fromEncodedCartesianVertices=function(t,r,i){if(o(i)||(i=new p),!o(t)||!o(r)||t.length!==r.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var n=b;n.x=t[0]+r[0],n.y=t[1]+r[1],n.z=t[2]+r[2];var a,s=e.clone(n,f),l=e.clone(n,m),u=e.clone(n,g),c=e.clone(n,_),d=e.clone(n,v),h=e.clone(n,y),E=t.length;for(a=0;a<E;a+=3){var x=t[a]+r[a],P=t[a+1]+r[a+1],I=t[a+2]+r[a+2];n.x=x,n.y=P,n.z=I,x<s.x&&e.clone(n,s),x>c.x&&e.clone(n,c),P<l.y&&e.clone(n,l),P>d.y&&e.clone(n,d),I<u.z&&e.clone(n,u),I>h.z&&e.clone(n,h)}var D=e.magnitudeSquared(e.subtract(c,s,C)),O=e.magnitudeSquared(e.subtract(d,l,C)),M=e.magnitudeSquared(e.subtract(h,u,C)),R=s,L=c,N=D;O>N&&(N=O,R=l,L=d),M>N&&(N=M,R=u,L=h);var k=S;k.x=.5*(R.x+L.x),k.y=.5*(R.y+L.y),k.z=.5*(R.z+L.z);var F=e.magnitudeSquared(e.subtract(L,k,C)),B=Math.sqrt(F),U=T;U.x=s.x,U.y=l.y,U.z=u.z;var V=w;V.x=c.x,V.y=d.y,V.z=h.z;var z=e.multiplyByScalar(e.add(U,V,C),.5,A),G=0;for(a=0;a<E;a+=3){n.x=t[a]+r[a],n.y=t[a+1]+r[a+1],n.z=t[a+2]+r[a+2];var H=e.magnitude(e.subtract(n,z,C));H>G&&(G=H);var W=e.magnitudeSquared(e.subtract(n,k,C));if(W>F){var j=Math.sqrt(W);B=.5*(B+j),F=B*B;var q=j-B;k.x=(B*k.x+q*n.x)/j,k.y=(B*k.y+q*n.y)/j,k.z=(B*k.z+q*n.z)/j}}return B<G?(e.clone(k,i.center),i.radius=B):(e.clone(z,i.center),i.radius=G),i},p.fromCornerPoints=function(t,r,i){o(i)||(i=new p);var n=i.center;return e.add(t,r,n),e.multiplyByScalar(n,.5,n),i.radius=e.distance(n,r),i},p.fromEllipsoid=function(t,r){return o(r)||(r=new p),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var R=new e;p.fromBoundingSpheres=function(t,r){if(o(r)||(r=new p),!o(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=t.length;if(1===i)return p.clone(t[0],r);if(2===i)return p.union(t[0],t[1],r);var n,a=[];for(n=0;n<i;n++)a.push(t[n].center);r=p.fromPoints(a,r);var s=r.center,l=r.radius;for(n=0;n<i;n++){var u=t[n];l=Math.max(l,e.distance(s,u.center,R)+u.radius)}return r.radius=l,r};var L=new e,N=new e,k=new e;p.fromOrientedBoundingBox=function(t,r){o(r)||(r=new p);var i=t.halfAxes,n=c.getColumn(i,0,L),a=c.getColumn(i,1,N),s=c.getColumn(i,2,k);return e.add(n,a,n),e.add(n,s,n),r.center=e.clone(t.center,r.center),r.radius=e.magnitude(n),r},p.clone=function(t,r){if(o(t))return o(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new p(t.center,t.radius)},p.packedLength=4,p.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},p.unpack=function(e,t,r){t=n(t,0),o(r)||(r=new p);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var F=new e,B=new e;p.union=function(t,r,i){o(i)||(i=new p);var n=t.center,a=t.radius,s=r.center,l=r.radius,u=e.subtract(s,n,F),c=e.magnitude(u);if(a>=c+l)return t.clone(i),i;if(l>=c+a)return r.clone(i),i;var d=.5*(a+c+l),h=e.multiplyByScalar(u,(-a+d)/c,B);return e.add(h,n,h),e.clone(h,i.center),i.radius=d,i};var U=new e;p.expand=function(t,r,i){i=p.clone(t,i);var n=e.magnitude(e.subtract(r,i.center,U));return n>i.radius&&(i.radius=n),i},p.intersectPlane=function(t,r){var i=t.center,n=t.radius,o=r.normal,a=e.dot(o,i)+r.distance;return a<-n?l.OUTSIDE:a<n?l.INTERSECTING:l.INSIDE},p.transform=function(e,t,r){return o(r)||(r=new p),r.center=d.multiplyByPoint(t,e.center,r.center),r.radius=d.getMaximumScale(t)*e.radius,r};var V=new e;p.distanceSquaredTo=function(t,r){var i=e.subtract(t.center,r,V);return e.magnitudeSquared(i)-t.radius*t.radius},p.transformWithoutScale=function(e,t,r){return o(r)||(r=new p),r.center=d.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;p.computePlaneDistances=function(t,r,i,n){o(n)||(n=new u);var a=e.subtract(t.center,r,z),s=e.dot(i,a);return n.start=s-t.radius,n.stop=s+t.radius,n};for(var G=new e,H=new e,W=new e,j=new e,q=new e,Y=new t,X=new Array(8),Q=0;Q<8;++Q)X[Q]=new e;var Z=new s;return p.projectTo2D=function(t,r,i){r=n(r,Z);var o=r.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,G),u=e.cross(e.UNIT_Z,l,H);e.normalize(u,u);var c=e.cross(l,u,W);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var d=e.negate(c,q),h=e.negate(u,j),f=X,m=f[0];e.add(l,c,m),e.add(m,u,m),m=f[1],e.add(l,c,m),e.add(m,h,m),m=f[2],e.add(l,d,m),e.add(m,h,m),m=f[3],e.add(l,d,m),e.add(m,u,m),e.negate(l,l),m=f[4],e.add(l,c,m),e.add(m,u,m),m=f[5],e.add(l,c,m),e.add(m,h,m),m=f[6],e.add(l,d,m),e.add(m,h,m),m=f[7],e.add(l,d,m),e.add(m,u,m);for(var g=f.length,_=0;_<g;++_){var v=f[_];e.add(a,v,v);var y=o.cartesianToCartographic(v,Y);r.project(y,v)}i=p.fromPoints(f,i),a=i.center;var b=a.x,C=a.y,S=a.z;return a.x=S,a.y=b,a.z=C,i},p.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},p.equals=function(t,r){return t===r||o(t)&&o(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},p.prototype.intersectPlane=function(e){return p.intersectPlane(this,e)},p.prototype.distanceSquaredTo=function(e){return p.distanceSquaredTo(this,e)},p.prototype.computePlaneDistances=function(e,t,r){return p.computePlaneDistances(this,e,t,r)},p.prototype.isOccluded=function(e){return p.isOccluded(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.volume=function(){var e=this.radius;return E*e*e*e},p}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";return e({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047})}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,i,n,o){"use strict";if(!i.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,r,i,n){switch(i=e(i,0),n=e(n,(r.byteLength-i)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(r,i,n);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,n);case a.SHORT:return new Int16Array(r,i,n);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,n);case a.INT:return new Int32Array(r,i,n);case a.UNSIGNED_INT:return new Uint32Array(r,i,n);case a.FLOAT:return new Float32Array(r,i,n);case a.DOUBLE:return new Float64Array(r,i,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)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";return e({NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3})}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./Check","./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,o.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,n.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(e){var t=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&r(e.attributes[i])&&r(e.attributes[i].values)){var n=e.attributes[i],o=n.values.length/n.componentsPerAttribute;t=o}return t},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(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 i}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"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.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=i(new n({position:!0})),n.POSITION_AND_NORMAL=i(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=i(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=i(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=i(new n({position:!0,color:!0})),n.ALL=i(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,r,i){return i=e(i,0),r[i++]=t.position?1:0,r[i++]=t.normal?1:0,r[i++]=t.st?1:0,r[i++]=t.tangent?1:0,r[i++]=t.bitangent?1:0,r[i]=t.color?1:0,r},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.position=1===r[i++],o.normal=1===r[i++],o.st=1===r[i++],o.tangent=1===r[i++],o.bitangent=1===r[i++],o.color=1===r[i],o},n.clone=function(e,r){if(t(e))return t(r)||(r=new n),r.position=e.position,r.normal=e.normal,r.st=e.st,r.tangent=e.tangent,r.bitangent=e.bitangent,r.color=e.color,r},n}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){e=n(e,n.EMPTY_OBJECT);var r=e.minimum,i=e.maximum,o=n(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(r),this._maximum=t.clone(i),this._vertexFormat=o,this._workerName="createBoxGeometry"}var h=new t;d.fromDimensions=function(e){e=n(e,n.EMPTY_OBJECT);var r=e.dimensions,i=t.multiplyByScalar(r,.5,new t);return new d({minimum:t.negate(i,new t),maximum:i,vertexFormat:e.vertexFormat})},d.fromAxisAlignedBoundingBox=function(e){return new d({minimum:e.minimum,maximum:e.maximum})},d.packedLength=2*t.packedLength+c.packedLength,d.pack=function(e,r,i){return i=n(i,0),t.pack(e._minimum,r,i),t.pack(e._maximum,r,i+t.packedLength),c.pack(e._vertexFormat,r,i+2*t.packedLength),r};var p=new t,f=new t,m=new c,g={minimum:p,maximum:f,vertexFormat:m};d.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r,p),s=t.unpack(e,r+t.packedLength,f),l=c.unpack(e,r+2*t.packedLength,m);return o(i)?(i._minimum=t.clone(a,i._minimum),i._maximum=t.clone(s,i._maximum),i._vertexFormat=c.clone(l,i._vertexFormat),i):new d(g)},d.createGeometry=function(r){var n=r._minimum,o=r._maximum,c=r._vertexFormat;if(!t.equals(n,o)){var d,p,f=new l;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){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,f.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p})),c.normal){var m=new Float32Array(72);m[0]=0,m[1]=0,m[2]=1,m[3]=0,m[4]=0,m[5]=1,m[6]=0,m[7]=0,m[8]=1,m[9]=0,m[10]=0,m[11]=1,m[12]=0,m[13]=0,m[14]=-1,m[15]=0,m[16]=0,m[17]=-1,m[18]=0,m[19]=0,m[20]=-1,m[21]=0,m[22]=0,m[23]=-1,m[24]=1,m[25]=0,m[26]=0,m[27]=1,m[28]=0,m[29]=0,m[30]=1,m[31]=0,m[32]=0,m[33]=1,m[34]=0,m[35]=0,m[36]=-1,m[37]=0,m[38]=0,m[39]=-1,m[40]=0,m[41]=0,m[42]=-1,m[43]=0,m[44]=0,m[45]=-1,m[46]=0,m[47]=0,m[48]=0,m[49]=1,m[50]=0,m[51]=0,m[52]=1,m[53]=0,m[54]=0,m[55]=1,m[56]=0,m[57]=0,m[58]=1,m[59]=0,m[60]=0,m[61]=-1,m[62]=0,m[63]=0,m[64]=-1,m[65]=0,m[66]=0,m[67]=-1,m[68]=0,m[69]=0,m[70]=-1,m[71]=0,f.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:m})}if(c.st){var g=new Float32Array(48);g[0]=0,g[1]=0,g[2]=1,g[3]=0,g[4]=1,g[5]=1,g[6]=0,g[7]=1,g[8]=1,g[9]=0,g[10]=0,g[11]=0,g[12]=0,g[13]=1,g[14]=1,g[15]=1,g[16]=0,g[17]=0,g[18]=1,g[19]=0,g[20]=1,g[21]=1,g[22]=0,g[23]=1,g[24]=1,g[25]=0,g[26]=0,g[27]=0,g[28]=0,g[29]=1,g[30]=1,g[31]=1,g[32]=1,g[33]=0,g[34]=0,g[35]=0,g[36]=0,g[37]=1,g[38]=1,g[39]=1,g[40]=0,g[41]=0,g[42]=1,g[43]=0,g[44]=1,g[45]=1,g[46]=0,g[47]=1,f.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:g})}if(c.tangent){var _=new Float32Array(72);_[0]=1,_[1]=0,_[2]=0,_[3]=1,_[4]=0,_[5]=0,_[6]=1,_[7]=0,_[8]=0,_[9]=1,_[10]=0,_[11]=0,_[12]=-1,_[13]=0,_[14]=0,_[15]=-1,_[16]=0,_[17]=0,_[18]=-1,_[19]=0,_[20]=0,_[21]=-1,_[22]=0,_[23]=0,_[24]=0,_[25]=1,_[26]=0,_[27]=0,_[28]=1,_[29]=0,_[30]=0,_[31]=1,_[32]=0,_[33]=0,_[34]=1,_[35]=0,_[36]=0,_[37]=-1,_[38]=0,_[39]=0,_[40]=-1,_[41]=0,_[42]=0,_[43]=-1,_[44]=0,_[45]=0,_[46]=-1,_[47]=0,_[48]=-1,_[49]=0,_[50]=0,_[51]=-1,_[52]=0,_[53]=0,_[54]=-1,_[55]=0,_[56]=0,_[57]=-1,_[58]=0,_[59]=0,_[60]=1,_[61]=0,_[62]=0,_[63]=1,_[64]=0,_[65]=0,_[66]=1,_[67]=0,_[68]=0,_[69]=1,_[70]=0,_[71]=0,f.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:_})}if(c.bitangent){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,f.bitangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:v})}d=new Uint16Array(36),d[0]=0,d[1]=1,d[2]=2,d[3]=0,d[4]=2,d[5]=3,d[6]=6,d[7]=5,d[8]=4,d[9]=7,d[10]=6,d[11]=4,d[12]=8,d[13]=9,d[14]=10,d[15]=8,d[16]=10,d[17]=11,d[18]=14,d[19]=13,d[20]=12,d[21]=15,d[22]=14,d[23]=12,d[24]=18,d[25]=17,d[26]=16,d[27]=19,d[28]=18,d[29]=16,d[30]=20,d[31]=21,d[32]=22,d[33]=20,d[34]=22,d[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,f.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),d=new Uint16Array(36),d[0]=4,d[1]=5,d[2]=6,d[3]=4,d[4]=6,d[5]=7,d[6]=1,d[7]=0,d[8]=3,d[9]=1,d[10]=3,d[11]=2,d[12]=1,d[13]=6,d[14]=5,d[15]=1,d[16]=2,d[17]=6,d[18]=2,d[19]=3,d[20]=7,d[21]=2,d[22]=7,d[23]=6,d[24]=3,d[25]=0,d[26]=4,d[27]=3,d[28]=4,d[29]=7,d[30]=0,d[31]=1,d[32]=5,d[33]=0,d[34]=5,d[35]=4;var y=t.subtract(o,n,h),b=.5*t.magnitude(y);return new a({attributes:f,indices:d,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,b)})}};var _;return d.getUnitBox=function(){return o(_)||(_=d.createGeometry(d.fromDimensions({dimensions:new t(1,1,1),vertexFormat:c.POSITION_ONLY}))),_},d}),define("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e=n(e,n.EMPTY_OBJECT);var r=e.minimum,i=e.maximum;this._min=t.clone(r),this._max=t.clone(i),this._workerName="createBoxOutlineGeometry"}var d=new t;c.fromDimensions=function(e){e=n(e,n.EMPTY_OBJECT);var r=e.dimensions,i=t.multiplyByScalar(r,.5,new t);return new c({minimum:t.negate(i,new t),maximum:i})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._min,r,i),t.pack(e._max,r,i+t.packedLength),r};var h=new t,p=new t,f={minimum:h,maximum:p};return c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r,h),s=t.unpack(e,r+t.packedLength,p);return o(i)?(i._min=t.clone(a,i._min),i._max=t.clone(s,i._max),i):new c(f)},c.createGeometry=function(r){var n=r._min,o=r._max;if(!t.equals(n,o)){var c=new l,h=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}),h[0]=4,h[1]=5,h[2]=5,h[3]=6,h[4]=6,h[5]=7,h[6]=7,h[7]=4,h[8]=0,h[9]=1,h[10]=1,h[11]=2,h[12]=2,h[13]=3,h[14]=3,h[15]=0,h[16]=0,h[17]=4,h[18]=1,h[19]=5,h[20]=2,h[21]=6,h[22]=3,h[23]=7;var f=t.subtract(o,n,d),m=.5*t.magnitude(f);return new a({attributes:c,indices:h,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,m)})}},c}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./Resource","require"],function(e,t,r,i,n){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var i=e[t].getAttribute("src"),n=p.exec(i);if(null!==n)return n[1]}}function a(){if(t(c))return c;var e;return e="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),c=new i({url:e}),c.appendForwardSlash(),c}function s(e){return n.toUrl("../"+e)}function l(e){return a().getDerivedResource({url:e}).url}function u(e){t(d)||(d=t(define.amd)&&!define.amd.toUrlUndefined&&t(n.toUrl)?s:l),t(h)||(h=document.createElement("a"));var r=d(e);return h.href=r,h.href=h.href,h.href}var c,d,h,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return u._cesiumScriptRegex=p,u._buildModuleUrlFromBaseUrl=l,u._clearBaseResource=function(){c=void 0},u.setBaseUrl=function(e){c=i.DEFAULT.getDerivedResource({url:e})},u}),define("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){r(e)}if("undefined"!=typeof window){var r=window.cancelAnimationFrame;return function(){if(!e(r))for(var t=["webkit","moz","ms","o"],i=0,n=t.length;i<n&&!e(r);)r=window[t[i]+"CancelAnimationFrame"],e(r)||(r=window[t[i]+"CancelRequestAnimationFrame"]),++i;e(r)||(r=clearTimeout)}(),t}}),define("Core/CartographicGeocoderService",["../ThirdParty/when","./Cartesian3","./Check"],function(e,t,r){"use strict";function i(){}return i.prototype.geocode=function(r){var i=r.match(/[^\s,\n]+/g);if(2===i.length||3===i.length){var n=+i[0],o=+i[1],a=3===i.length?+i[2]:300;if(isNaN(n)&&isNaN(o))for(var s=/^(\d+.?\d*)([nsew])/i,l=0;l<i.length;++l){var u=i[l].match(s);s.test(i[l])&&3===u.length&&(/^[ns]/i.test(u[2])?o=/^[n]/i.test(u[2])?+u[1]:-u[1]:/^[ew]/i.test(u[2])&&(n=/^[e]/i.test(u[2])?+u[1]:-u[1]))}if(!isNaN(n)&&!isNaN(o)&&!isNaN(a)){var c={displayName:r,destination:t.fromDegrees(n,o,a)};return e.resolve([c])}}return e.resolve([])},i}),define("Core/Spline",["./Check","./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,i,n){"use strict";function o(){this.times=void 0,this.points=void 0,i.throwInstantiationError()}return o.prototype.evaluate=i.throwInstantiationError,o.prototype.findTimeInterval=function(e,r){var i=this.times,n=i.length;if(r=t(r,0),e>=i[r]){if(r+1<n&&e<i[r+1])return r;if(r+2<n&&e<i[r+2])return r+1}else if(r-1>=0&&e>=i[r-1])return r-1;var o;if(e>i[r])for(o=r;o<n-1&&!(e>=i[o]&&e<i[o+1]);++o);else for(o=r-1;o>=0&&!(e>=i[o]&&e<i[o+1]);--o);return o===n-1&&(o=n-2),o},o.prototype.wrapTime=function(e){var t,r=this.times,i=r[r.length-1],n=r[0],o=i-n;return e<n&&(t=Math.floor((n-e)/o)+1,e+=t*o),e>i&&(t=Math.floor((e-i)/o)+1,e-=t*o),e},o.prototype.clampTime=function(e){var t=this.times;return n.clamp(e,t[0],t[t.length-1])},o}),define("Core/LinearSpline",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Spline"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var r=e.points,i=e.times;this._times=i,this._points=r,this._lastTimeIndex=0}return i(a.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.wrapTime=o.prototype.wrapTime,a.prototype.clampTime=o.prototype.clampTime,a.prototype.evaluate=function(t,i){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 r(i)||(i=new e),e.lerp(n[a],n[a+1],s,i)},a}),define("Core/TridiagonalSystemSolver",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i={};return i.solve=function(t,r,i,n){var o,a=new Array(i.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]=i[0]/r[0],s[0]=e.multiplyByScalar(n[0],1/r[0],s[0]);var u;for(o=1;o<a.length;++o)u=1/(r[o]-a[o-1]*t[o-1]),a[o]=i[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/(r[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},i}),define("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r,n){var o=p,a=m,s=f,l=g;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var d=l[0];for(i(d)||(d=l[0]=new e),e.clone(r,d),c=1;c<o.length-1;++c)o[c]=a[c]=1,s[c]=4,d=l[c],i(d)||(d=l[c]=new e),e.subtract(t[c+1],t[c-1],d),e.multiplyByScalar(d,3,d);return o[c]=0,a[c]=1,s[c]=4,d=l[c],i(d)||(d=l[c]=new e),e.subtract(t[c+1],t[c-1],d),e.multiplyByScalar(d,3,d),s[c+1]=1,d=l[c+1],i(d)||(d=l[c+1]=new e),e.clone(n,d),u.solve(o,s,a,l)}function d(t){var r=p,n=m,o=f,a=g;r.length=n.length=t.length-1,o.length=a.length=t.length;var s;r[0]=n[0]=1,o[0]=2;var l=a[0];for(i(l)||(l=a[0]=new e),e.subtract(t[1],t[0],l),e.multiplyByScalar(l,3,l),s=1;s<r.length;++s)r[s]=n[s]=1,o[s]=4,l=a[s],i(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],i(l)||(l=a[s]=new e),e.subtract(t[s],t[s-1],l),e.multiplyByScalar(l,3,l),u.solve(r,o,n,a)}function h(e){e=r(e,r.EMPTY_OBJECT);var t=e.points,i=e.times,n=e.inTangents,o=e.outTangents;this._times=i,this._points=t,this._inTangents=n,this._outTangents=o,this._lastTimeIndex=0}var p=[],f=[],m=[],g=[];n(h.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}}}),h.createC1=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points,n=e.tangents,o=n.slice(0,n.length-1);return new h({times:t,points:i,inTangents:n.slice(1,n.length),outTangents:o})},h.createNaturalCubic=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points;if(i.length<3)return new a({points:i,times:t});var n=d(i),o=n.slice(0,n.length-1);return new h({times:t,points:i,inTangents:n.slice(1,n.length),outTangents:o})},h.createClampedCubic=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points,n=e.firstTangent,o=e.lastTangent;if(i.length<3)return new a({points:i,times:t});var s=c(i,n,o),l=s.slice(0,s.length-1);return new h({times:t,points:i,inTangents:s.slice(1,s.length),outTangents:l})},h.hermiteCoefficientMatrix=new s(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),h.prototype.findTimeInterval=l.prototype.findTimeInterval;var _=new t,v=new e;return h.prototype.wrapTime=l.prototype.wrapTime,h.prototype.clampTime=l.prototype.clampTime,h.prototype.evaluate=function(t,r){i(r)||(r=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]),d=_;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;var p=s.multiplyByVector(h.hermiteCoefficientMatrix,d,d);return r=e.multiplyByScalar(n[u],p.x,r),e.multiplyByScalar(n[u+1],p.y,v),e.add(r,v,r),e.multiplyByScalar(l[u],p.z,v),e.add(r,v,r),e.multiplyByScalar(a[u],p.w,v),e.add(r,v,r)},h}),define("Core/CatmullRomSpline",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./HermiteSpline","./Matrix4","./Spline"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t){var r=t.points,i=t.times;if(r.length<3){var o=i[0],l=1/(i[1]-o),u=r[0],f=r[1];return function(t,r){n(r)||(r=new e);var i=(t-o)*l;return e.lerp(u,f,i,r)}}return function(o,l){n(l)||(l=new e);var u=t._lastTimeIndex=t.findTimeInterval(o,t._lastTimeIndex),f=(o-i[u])/(i[u+1]-i[u]),m=d;m.z=f,m.y=f*f,m.x=m.y*f,m.w=1;var g,_,v,y,b;return 0===u?(g=r[0],_=r[1],v=t.firstTangent,y=e.subtract(r[2],g,h),e.multiplyByScalar(y,.5,y),b=s.multiplyByVector(a.hermiteCoefficientMatrix,m,m)):u===r.length-2?(g=r[u],_=r[u+1],y=t.lastTangent,v=e.subtract(_,r[u-1],h),e.multiplyByScalar(v,.5,v),b=s.multiplyByVector(a.hermiteCoefficientMatrix,m,m)):(g=r[u-1],_=r[u],v=r[u+1],y=r[u+2],b=s.multiplyByVector(c.catmullRomCoefficientMatrix,m,m)),l=e.multiplyByScalar(g,b.x,l),e.multiplyByScalar(_,b.y,p),e.add(l,p,l),e.multiplyByScalar(v,b.z,p),e.add(l,p,l),e.multiplyByScalar(y,b.w,p),e.add(l,p,l)}}function c(t){t=i(t,i.EMPTY_OBJECT);var r=t.points,o=t.times,a=t.firstTangent,s=t.lastTangent;if(r.length>2&&(n(a)||(a=f,e.multiplyByScalar(r[1],2,a),e.subtract(a,r[2],a),e.subtract(a,r[0],a),e.multiplyByScalar(a,.5,a)),!n(s))){var l=r.length-1;s=m,e.multiplyByScalar(r[l-1],2,s),e.subtract(r[l],s,s),e.add(s,r[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=r,this._firstTangent=e.clone(a),this._lastTangent=e.clone(s),this._evaluateFunction=u(this),this._lastTimeIndex=0}var d=new t,h=new e,p=new e,f=new e,m=new e;return o(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.wrapTime=l.prototype.wrapTime,c.prototype.clampTime=l.prototype.clampTime,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),define("Core/GeographicTilingScheme",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){e=r(e,{}),this._ellipsoid=r(e.ellipsoid,o.WGS84),this._rectangle=r(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=r(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=r(e.numberOfLevelZeroTilesY,1)}return n(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,r,i){var n=this.tileXYToRectangle(e,t,r,i);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,d=(e+1)*u+o.west,h=o.height/s,p=o.north-t*h,f=o.north-(t+1)*h;return i(n)||(n=new l(c,f,d,p)),n.west=c,n.south=f,n.east=d,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,d=o.height/u,h=t.longitude;o.east<o.west&&(h+=s.TWO_PI);var p=(h-o.west)/c|0;p>=a&&(p=a-1);var f=(o.north-t.latitude)/d|0;return f>=u&&(f=u-1),i(n)?(n.x=p,n.y=f,n):new e(p,f)}},u}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./Rectangle"],function(e,t,r,i,n,o,a){"use strict";function s(e,r){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,n(r)&&(this.cameraPosition=r)}function l(e,r,i){var n=e.transformPositionToScaledSpace(r,f),o=t.magnitudeSquared(n),a=Math.sqrt(o),s=t.divideByScalar(n,a,m);o=Math.max(1,o),a=Math.max(1,a);var l=t.dot(s,i),u=t.magnitude(t.cross(s,i,s)),c=1/a;return 1/(l*c-u*(Math.sqrt(o-1)*c))}function u(e,r,i){if(!(r<=0||r===1/0||r!==r))return t.multiplyByScalar(e,r,i)}function c(e,r){return t.equals(r,t.ZERO)?r:(e.transformPositionToScaledSpace(r,g),t.normalize(g,g))}o(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var r=this._ellipsoid,i=r.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=t.magnitudeSquared(i)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=i,this._distanceToLimbInScaledSpaceSquared=n}}});var d=new t;s.prototype.isPointVisible=function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,d);return this.isScaledSpacePointVisible(r)},s.prototype.isScaledSpacePointVisible=function(e){var r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared,n=t.subtract(e,r,d),o=-t.dot(n,r);return!(i<0?o>0:o>i&&o*o/t.magnitudeSquared(n)>i)},s.prototype.computeHorizonCullingPoint=function(e,r,i){n(i)||(i=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,d=0,h=r.length;d<h;++d){var p=r[d],f=l(o,p,a);s=Math.max(s,f)}return u(a,s,i)};var h=new t;s.prototype.computeHorizonCullingPointFromVertices=function(e,r,o,a,s){n(s)||(s=new t),a=i(a,t.ZERO);for(var d=this._ellipsoid,p=c(d,e),f=0,m=0,g=r.length;m<g;m+=o){h.x=r[m]+a.x,h.y=r[m+1]+a.y,h.z=r[m+2]+a.z;var _=l(d,h,p);f=Math.max(f,_)}return u(p,f,s)};var p=[];s.prototype.computeHorizonCullingPointFromRectangle=function(r,i,n){var o=a.subsample(r,i,0,p),s=e.fromPoints(o);if(!(t.magnitude(s.center)<.1*i.minimumRadius))return this.computeHorizonCullingPoint(s.center,o,n)};var f=new t,m=new t,g=new t;return s}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,i){var n=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))<i?0:n}var i={};return i.computeDiscriminant=function(e,t,r){return t*t-4*e*r},i.computeRealRoots=function(e,i,n){var o;if(0===e)return 0===i?[]:[-n/i];if(0===i){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)<0)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-i/e,o<0?[o,0]:[0,o];var u=i*i,c=4*e*n,d=r(u,-c,t.EPSILON14);if(d<0)return[];var h=-.5*r(i,t.sign(i)*Math.sqrt(d),t.EPSILON14);return i>0?[h/e,n/h]:[n/h,h/e]},i}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,i){var n,o,a=e,s=t/3,l=r/3,u=i,c=a*l,d=s*u,h=s*s,p=l*l,f=a*l-h,m=a*u-s*l,g=s*u-p,_=4*f*g-m*m;if(_<0){var v,y,b;h*d>=c*p?(v=a,y=f,b=-2*s*f+a*m):(v=u,y=g,b=-u*m+2*l*g);var C=b<0?-1:1,S=-C*Math.abs(v)*Math.sqrt(-_);o=-b+S;var T=o/2,w=T<0?-Math.pow(-T,1/3):Math.pow(T,1/3),A=o===S?-w:-y/w;return n=y<=0?w+A:-b/(w*w+A*A+y),h*d>=c*p?[(n-s)/a]:[-u/(n+l)]}var E=f,x=-2*s*f+a*m,P=g,I=-u*m+2*l*g,D=Math.sqrt(_),O=Math.sqrt(3)/2,M=Math.abs(Math.atan2(a*D,-x)/3);n=2*Math.sqrt(-E);var R=Math.cos(M);o=n*R;var L=n*(-R/2-O*Math.sin(M)),N=o+L>2*s?o-s:L-s,k=a,F=N/k;M=Math.abs(Math.atan2(u*D,-I)/3),n=2*Math.sqrt(-P),R=Math.cos(M),o=n*R,L=n*(-R/2-O*Math.sin(M));var B=-u,U=o+L<2*l?o+l:L+l,V=B/U,z=k*U,G=-N*U-k*B,H=N*B,W=(l*G-s*H)/(-s*G+l*z);return F<=W?F<=V?W<=V?[F,W,V]:[F,V,W]:[V,F,W]:F<=V?[W,F,V]:W<=V?[W,V,F]:[V,W,F]}var i={};return i.computeDiscriminant=function(e,t,r,i){var n=e*e,o=t*t,a=r*r;return 18*e*t*r*i+o*a-27*n*(i*i)-4*(e*a*r+o*t*i)},i.computeRealRoots=function(e,i,n,o){var a,s;if(0===e)return t.computeRealRoots(i,n,o);if(0===i){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]]):r(e,0,n,o)}return 0===n?0===o?(s=-i/e,s<0?[s,0,0]:[0,0,s]):r(e,i,0,o):0===o?(a=t.computeRealRoots(e,i,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]]):r(e,i,n,o)},i}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,i){"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,d=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(d.length>0){var h=-t/4,p=d[d.length-1];if(Math.abs(p)<r.EPSILON14){var f=i.computeRealRoots(1,l,c);if(2===f.length){var m,g=f[0],_=f[1];if(g>=0&&_>=0){var v=Math.sqrt(g),y=Math.sqrt(_);return[h-y,h-v,h+v,h+y]}if(g>=0&&_<0)return m=Math.sqrt(g),[h-m,h+m];if(g<0&&_>=0)return m=Math.sqrt(_),[h-m,h+m]}return[]}if(p>0){var b=Math.sqrt(p),C=(l+p-u/b)/2,S=(l+p+u/b)/2,T=i.computeRealRoots(1,b,C),w=i.computeRealRoots(1,-b,S);return 0!==T.length?(T[0]+=h,T[1]+=h,0!==w.length?(w[0]+=h,w[1]+=h,T[1]<=w[0]?[T[0],T[1],w[0],w[1]]:w[1]<=T[0]?[w[0],w[1],T[0],T[1]]:T[0]>=w[0]&&T[1]<=w[1]?[w[0],T[0],T[1],w[1]]:w[0]>=T[0]&&w[1]<=T[1]?[T[0],w[0],w[1],T[1]]:T[0]>w[0]&&T[0]<w[1]?[w[0],T[0],w[1],T[1]]:[T[0],w[0],T[1],w[1]]):T):0!==w.length?(w[0]+=h,w[1]+=h,w):[]}}return[]}function o(t,n,o,a){var s=o*o,l=n*n,u=t*t,c=-2*n,d=o*t+l-4*a,h=u*a-o*n*t+s,p=e.computeRealRoots(1,c,d,h);if(p.length>0){var f,m,g=p[0],_=n-g,v=_*_,y=t/2,b=_/2,C=v-4*a,S=v+4*Math.abs(a),T=u-4*g,w=u+4*Math.abs(g);if(g<0||C*w<T*S){var A=Math.sqrt(T);f=A/2,m=0===A?0:(t*b-o)/A}else{var E=Math.sqrt(C);f=0===E?0:(t*b-o)/E,m=E/2}var x,P;0===y&&0===f?(x=0,P=0):r.sign(y)===r.sign(f)?(x=y+f,P=g/x):(P=y-f,x=g/P);var I,D;0===b&&0===m?(I=0,D=0):r.sign(b)===r.sign(m)?(I=b+m,D=a/I):(D=b-m,I=a/D);var O=i.computeRealRoots(1,x,I),M=i.computeRealRoots(1,P,D);if(0!==O.length)return 0!==M.length?O[1]<=M[0]?[O[0],O[1],M[0],M[1]]:M[1]<=O[0]?[M[0],M[1],O[0],O[1]]:O[0]>=M[0]&&O[1]<=M[1]?[M[0],O[0],O[1],M[1]]:M[0]>=O[0]&&M[1]<=O[1]?[O[0],M[0],M[1],O[1]]:O[0]>M[0]&&O[0]<M[1]?[M[0],O[0],M[1],O[1]]:[O[0],M[0],O[1],M[1]]:O;if(0!==M.length)return M}return[]}var a={};return a.computeDiscriminant=function(e,t,r,i,n){var o=e*e,a=o*e,s=t*t,l=s*t,u=r*r,c=u*r,d=i*i,h=d*i,p=n*n;return s*u*d-4*l*h-4*e*c*d+18*e*t*r*h-27*o*d*d+256*a*(p*n)+n*(18*l*r*i-4*s*c+16*e*u*u-80*e*t*u*i-6*e*s*d+144*o*r*d)+p*(144*e*s*r-27*s*s-128*o*u-192*o*t*i)},a.computeRealRoots=function(t,i,a,s,l){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(i,a,s,l);var u=i/t,c=a/t,d=s/t,h=l/t,p=u<0?1:0;switch(p+=c<0?p+1:p,p+=d<0?p+1:p,p+=h<0?p+1:p){case 0:return n(u,c,d,h);case 1:case 2:return o(u,c,d,h);case 3:case 4:return n(u,c,d,h);case 5:return o(u,c,d,h);case 6:case 7:return n(u,c,d,h);case 8:return o(u,c,d,h);case 9:case 10:return n(u,c,d,h);case 11:return o(u,c,d,h);case 12:case 13:case 14:case 15:return n(u,c,d,h);default:return}},a}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";function n(r,i){i=e.clone(t(i,e.ZERO)),e.equals(i,e.ZERO)||e.normalize(i,i),this.origin=e.clone(t(r,e.ZERO)),this.direction=i}return n.getPoint=function(t,i,n){return r(n)||(n=new e),n=e.multiplyByScalar(t.direction,i,n),e.add(t.origin,n,n)},n}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t,r,i){var n=t*t-4*e*r;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?(i.root0=s,i.root1=l):(i.root0=l,i.root1=s),i}var u=-t/(2*e);if(0!==u)return i.root0=i.root1=u,i}}function h(t,r,n){i(n)||(n=new o)
;var a=t.origin,s=t.direction,l=r.center,u=r.radius*r.radius,c=e.subtract(a,l,v),h=e.dot(s,s),p=2*e.dot(s,c),f=e.magnitudeSquared(c)-u,m=d(h,p,f,S);if(i(m))return n.start=m.root0,n.stop=m.root1,n}function p(e,t,r){var i=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<r?0:i}function f(t,r,i,n,o){var c,d=n*n,h=o*o,f=(t[s.COLUMN1ROW1]-t[s.COLUMN2ROW2])*h,m=o*(n*p(t[s.COLUMN1ROW0],t[s.COLUMN0ROW1],a.EPSILON15)+r.y),g=t[s.COLUMN0ROW0]*d+t[s.COLUMN2ROW2]*h+n*r.x+i,_=h*p(t[s.COLUMN2ROW1],t[s.COLUMN1ROW2],a.EPSILON15),v=o*(n*p(t[s.COLUMN2ROW0],t[s.COLUMN0ROW2])+r.z),y=[];if(0===v&&0===_){if(c=l.computeRealRoots(f,m,g),0===c.length)return y;var b=c[0],C=Math.sqrt(Math.max(1-b*b,0));if(y.push(new e(n,o*b,o*-C)),y.push(new e(n,o*b,o*C)),2===c.length){var S=c[1],T=Math.sqrt(Math.max(1-S*S,0));y.push(new e(n,o*S,o*-T)),y.push(new e(n,o*S,o*T))}return y}var w=v*v,A=_*_,E=f*f,x=v*_,P=E+A,I=2*(m*f+x),D=2*g*f+m*m-A+w,O=2*(g*m-x),M=g*g-w;if(0===P&&0===I&&0===D&&0===O)return y;c=u.computeRealRoots(P,I,D,O,M);var R=c.length;if(0===R)return y;for(var L=0;L<R;++L){var N,k=c[L],F=k*k,B=Math.max(1-F,0),U=Math.sqrt(B);N=a.sign(f)===a.sign(g)?p(f*F+g,m*k,a.EPSILON12):a.sign(g)===a.sign(m*k)?p(f*F,m*k+g,a.EPSILON12):p(f*F+m*k,g,a.EPSILON12);var V=p(_*k,v,a.EPSILON15),z=N*V;z<0?y.push(new e(n,o*k,o*U)):z>0?y.push(new e(n,o*k,o*-U)):0!==U?(y.push(new e(n,o*k,o*-U)),y.push(new e(n,o*k,o*U)),++L):y.push(new e(n,o*k,o*U))}return y}var m={};m.rayPlane=function(t,r,n){i(n)||(n=new e);var o=t.origin,s=t.direction,l=r.normal,u=e.dot(l,s);if(!(Math.abs(u)<a.EPSILON15)){var c=(-r.distance-e.dot(l,o))/u;if(!(c<0))return n=e.multiplyByScalar(s,c,n),e.add(o,n,n)}};var g=new e,_=new e,v=new e,y=new e,b=new e;m.rayTriangleParametric=function(t,i,n,o,s){s=r(s,!1);var l,u,c,d,h,p=t.origin,f=t.direction,m=e.subtract(n,i,g),C=e.subtract(o,i,_),S=e.cross(f,C,v),T=e.dot(m,S);if(s){if(T<a.EPSILON6)return;if(l=e.subtract(p,i,y),(c=e.dot(l,S))<0||c>T)return;if(u=e.cross(l,m,b),(d=e.dot(f,u))<0||c+d>T)return;h=e.dot(C,u)/T}else{if(Math.abs(T)<a.EPSILON6)return;var w=1/T;if(l=e.subtract(p,i,y),(c=e.dot(l,S)*w)<0||c>1)return;if(u=e.cross(l,m,b),(d=e.dot(f,u)*w)<0||c+d>1)return;h=e.dot(C,u)*w}return h},m.rayTriangle=function(t,r,n,o,a,s){var l=m.rayTriangleParametric(t,r,n,o,a);if(i(l)&&!(l<0))return i(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var C=new c;m.lineSegmentTriangle=function(t,r,n,o,a,s,l){var u=C;e.clone(t,u.origin),e.subtract(r,t,u.direction),e.normalize(u.direction,u.direction);var c=m.rayTriangleParametric(u,n,o,a,s);if(!(!i(c)||c<0||c>e.distance(t,r)))return i(l)||(l=new e),e.multiplyByScalar(u.direction,c,l),e.add(u.origin,l,l)};var S={root0:0,root1:0};m.raySphere=function(e,t,r){if(r=h(e,t,r),i(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var T=new c;m.lineSegmentSphere=function(t,r,n,o){var a=T;e.clone(t,a.origin);var s=e.subtract(r,t,a.direction),l=e.magnitude(s);if(e.normalize(s,s),o=h(a,n,o),!(!i(o)||o.stop<0||o.start>l))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o};var w=new e,A=new e;m.rayEllipsoid=function(t,r){var i,n,a,s,l,u=r.oneOverRadii,c=e.multiplyComponents(u,t.origin,w),d=e.multiplyComponents(u,t.direction,A),h=e.magnitudeSquared(c),p=e.dot(c,d);if(h>1){if(p>=0)return;var f=p*p;if(i=h-1,n=e.magnitudeSquared(d),a=n*i,f<a)return;if(f>a){s=p*p-a,l=-p+Math.sqrt(s);var m=l/n,g=i/l;return m<g?new o(m,g):{start:g,stop:m}}var _=Math.sqrt(i/n);return new o(_,_)}return h<1?(i=h-1,n=e.magnitudeSquared(d),a=n*i,s=p*p-a,l=-p+Math.sqrt(s),new o(0,l/n)):p<0?(n=e.magnitudeSquared(d),new o(0,-p/n)):void 0};var E=new e,x=new e,P=new e,I=new e,D=new e,O=new s,M=new s,R=new s,L=new s,N=new s,k=new s,F=new s,B=new e,U=new e,V=new t;m.grazingAltitudeLocation=function(t,r){var n=t.origin,o=t.direction;if(!e.equals(n,e.ZERO)){var l=r.geodeticSurfaceNormal(n,E);if(e.dot(o,l)>=0)return n}var u=i(this.rayEllipsoid(t,r)),c=r.transformPositionToScaledSpace(o,E),d=e.normalize(c,c),h=e.mostOrthogonalAxis(c,I),p=e.normalize(e.cross(h,d,x),x),m=e.normalize(e.cross(d,p,P),P),g=O;g[0]=d.x,g[1]=d.y,g[2]=d.z,g[3]=p.x,g[4]=p.y,g[5]=p.z,g[6]=m.x,g[7]=m.y,g[8]=m.z;var _=s.transpose(g,M),v=s.fromScale(r.radii,R),y=s.fromScale(r.oneOverRadii,L),b=N;b[0]=0,b[1]=-o.z,b[2]=o.y,b[3]=o.z,b[4]=0,b[5]=-o.x,b[6]=-o.y,b[7]=o.x,b[8]=0;var C,S,T=s.multiply(s.multiply(_,y,k),b,k),w=s.multiply(s.multiply(T,v,F),g,F),A=s.multiplyByVector(T,n,D),z=f(w,e.negate(A,E),0,0,1),G=z.length;if(G>0){for(var H=e.clone(e.ZERO,U),W=Number.NEGATIVE_INFINITY,j=0;j<G;++j){C=s.multiplyByVector(v,s.multiplyByVector(g,z[j],B),B);var q=e.normalize(e.subtract(C,n,I),I),Y=e.dot(q,o);Y>W&&(W=Y,H=e.clone(C,H))}var X=r.cartesianToCartographic(H,V);return W=a.clamp(W,0,1),S=e.magnitude(e.subtract(H,n,I))*Math.sqrt(1-W*W),S=u?-S:S,X.height=S,r.cartographicToCartesian(X,new e)}};var z=new e;return m.lineSegmentPlane=function(t,r,n,o){i(o)||(o=new e);var s=e.subtract(r,t,z),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)<a.EPSILON6)){var c=e.dot(l,t),d=-(n.distance+c)/u;if(!(d<0||d>1))return e.multiplyByScalar(s,d,o),e.add(t,o,o),o}},m.trianglePlaneIntersection=function(t,r,i,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,r)+a<0,u=e.dot(o,i)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var d,h;if(1!==c&&2!==c||(d=new e,h=new e),1===c){if(s)return m.lineSegmentPlane(t,r,n,d),m.lineSegmentPlane(t,i,n,h),{positions:[t,r,i,d,h],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(r,i,n,d),m.lineSegmentPlane(r,t,n,h),{positions:[t,r,i,d,h],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(i,t,n,d),m.lineSegmentPlane(i,r,n,h),{positions:[t,r,i,d,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return m.lineSegmentPlane(r,t,n,d),m.lineSegmentPlane(i,t,n,h),{positions:[t,r,i,d,h],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(i,r,n,d),m.lineSegmentPlane(t,r,n,h),{positions:[t,r,i,d,h],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,i,n,d),m.lineSegmentPlane(r,i,n,h),{positions:[t,r,i,d,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./Check","./defined","./DeveloperError","./freezeObject","./Math","./Matrix4"],function(e,t,r,i,n,o,a){"use strict";function s(t,r){this.normal=e.clone(t),this.distance=r}s.fromPointNormal=function(t,i,n){var o=-e.dot(i,t);return r(n)?(e.clone(i,n.normal),n.distance=o,n):new s(i,o)};var l=new e;s.fromCartesian4=function(t,i){var n=e.fromCartesian4(t,l),o=t.w;return r(i)?(e.clone(n,i.normal),i.distance=o,i):new s(n,o)},s.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance};var u=new e;s.projectPointOntoPlane=function(t,i,n){r(n)||(n=new e);var o=s.getPointDistance(t,i),a=e.multiplyByScalar(t.normal,o,u);return e.subtract(i,a,n)};var c=new e;return s.transform=function(t,r,i){return a.multiplyByPointAsVector(r,t.normal,l),e.normalize(l,l),e.multiplyByScalar(t.normal,-t.distance,c),a.multiplyByPoint(r,c,c),s.fromPointNormal(c,l,i)},s.clone=function(t,i){return r(i)?(e.clone(t.normal,i.normal),i.distance=t.distance,i):new s(t.normal,t.distance)},s.equals=function(t,r){return t.distance===r.distance&&e.equals(t.normal,r.normal)},s.ORIGIN_XY_PLANE=n(new s(e.UNIT_Z,0)),s.ORIGIN_YZ_PLANE=n(new s(e.UNIT_X,0)),s.ORIGIN_ZX_PLANE=n(new s(e.UNIT_Y,0)),s}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,i,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=i,this.ut1MinusUtc=n}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,i=t[r++],n=function(e,t,r,i){r||(r=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return i?e+n:n+e},o=function(e,t,r,i,o,a){var s=i-e.length;return s>0&&(e=r||!o?n(e,i,a,r):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,r,i,a,s,l){var u=e>>>0;return r=r&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+n(u.toString(t),s||0,"0",!1),o(e,r,i,a,l)},s=function(e,t,r,i,n,a){return null!=i&&(e=e.slice(0,i)),o(e,"",t,r,n,a)},l=function(e,i,l,u,c,d,h){var p,f,m,g,_;if("%%"==e)return"%";for(var v=!1,y="",b=!1,C=!1,S=" ",T=l.length,w=0;l&&w<T;w++)switch(l.charAt(w)){case" ":y=" ";break;case"+":y="+";break;case"-":v=!0;break;case"'":S=l.charAt(w+1);break;case"0":b=!0;break;case"#":C=!0}if(u=u?"*"==u?+t[r++]:"*"==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(d=d?"*"==d?+t[r++]:"*"==d.charAt(0)?+t[d.slice(1,-1)]:+d:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,_=i?t[i.slice(0,-1)]:t[r++],h){case"s":return s(String(_),v,u,d,b,S);case"c":return s(String.fromCharCode(+_),v,u,d,b);case"b":return a(_,2,C,v,u,d,b);case"o":return a(_,8,C,v,u,d,b);case"x":return a(_,16,C,v,u,d,b);case"X":return a(_,16,C,v,u,d,b).toUpperCase();case"u":return a(_,10,C,v,u,d,b);case"i":case"d":return p=+_||0,p=Math.round(p-p%1),f=p<0?"-":y,_=f+n(String(Math.abs(p)),d,"0",!1),o(_,f,v,u,b);case"e":case"E":case"f":case"F":case"g":case"G":return p=+_,f=p<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],g=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],_=f+Math.abs(p)[m](d),o(_,f,v,u,b)[g]();default:return e}};return i.replace(e,l)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,i,n,o,a,s){this.year=e,this.month=t,this.day=r,this.hour=i,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4==0&&e%100!=0||e%400==0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";return e({SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5})}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";return e({UTC:0,TAI:1})}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){return m.compare(e.julianDate,t.julianDate)}function d(e){v.julianDate=e;var r=m.leapSeconds,i=t(r,v,c);i<0&&(i=~i),i>=r.length&&(i=r.length-1);var n=r[i].offset;if(i>0){m.secondsDifference(r[i].julianDate,e)>n&&(i--,n=r[i].offset)}m.addSeconds(e,n,e)}function h(e,r){v.julianDate=e;var i=m.leapSeconds,n=t(i,v,c);if(n<0&&(n=~n),0===n)return m.addSeconds(e,-i[0].offset,r);if(n>=i.length)return m.addSeconds(e,-i[n-1].offset,r);var o=m.secondsDifference(i[n].julianDate,e);return 0===o?m.addSeconds(e,-i[n].offset,r):o<=1?void 0:m.addSeconds(e,-i[--n].offset,r)}function p(e,t,r){var i=t/l.SECONDS_PER_DAY|0;return e+=i,t-=l.SECONDS_PER_DAY*i,t<0&&(e--,t+=l.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function f(e,t,r,i,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)+r-32075;(i-=12)<0&&(i+=24);var d=o+(i*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return d>=43200&&(c-=1),[c,d]}function m(e,t,i){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),i=r(i,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,p(n,t,this),i===u.UTC&&d(this)}var g=new o,_=[31,28,31,30,31,30,31,31,30,31,30,31],v=new s,y=/^(\d{4})$/,b=/^(\d{4})-(\d{2})$/,C=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,T=/^(\d{4})-?(\d{2})-?(\d{2})$/,w=/([Z+\-])?(\d{2})?:?(\d{2})?$/,A=/^(\d{2})(\.\d+)?/.source+w.source,E=/^(\d{2}):?(\d{2})(\.\d+)?/.source+w.source,x=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+w.source;m.fromGregorianDate=function(e,t){var r=f(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return i(t)?(p(r[0],r[1],t),d(t),t):new m(r[0],r[1],u.UTC)},m.fromDate=function(e,t){var r=f(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return i(t)?(p(r[0],r[1],t),d(t),t):new m(r[0],r[1],u.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var r,n,o,s=e.split("T"),l=1,c=1,h=0,g=0,v=0,w=0,P=s[0],I=s[1];if(null!==(s=P.match(T)))r=+s[1],l=+s[2],c=+s[3];else if(null!==(s=P.match(b)))r=+s[1],l=+s[2];else if(null!==(s=P.match(y)))r=+s[1];else{var D;if(null!==(s=P.match(C)))r=+s[1],D=+s[2],o=a(r);else if(null!==(s=P.match(S))){r=+s[1];var O=+s[2],M=+s[3]||0,R=new Date(Date.UTC(r,0,4));D=7*O+M-R.getUTCDay()-3}n=new Date(Date.UTC(r,0,1)),n.setUTCDate(D),l=n.getUTCMonth()+1,c=n.getUTCDate()}o=a(r);var L;if(i(I)){s=I.match(x),null!==s?(h=+s[1],g=+s[2],v=+s[3],w=1e3*+(s[4]||0),L=5):(s=I.match(E),null!==s?(h=+s[1],g=+s[2],v=60*+(s[3]||0),L=4):null!==(s=I.match(A))&&(h=+s[1],g=60*+(s[2]||0),L=3));var N=s[L],k=+s[L+1],F=+(s[L+2]||0);switch(N){case"+":h-=k,g-=F;break;case"-":h+=k,g+=F;break;case"Z":break;default:g+=new Date(Date.UTC(r,l-1,c,h,g)).getTimezoneOffset()}}var B=60===v;for(B&&v--;g>=60;)g-=60,h++;for(;h>=24;)h-=24,c++;for(n=o&&2===l?29:_[l-1];c>n;)c-=n,l++,l>12&&(l-=12,r++),n=o&&2===l?29:_[l-1];for(;g<0;)g+=60,h--;for(;h<0;)h+=24,c--;for(;c<1;)l--,l<1&&(l+=12,r--),n=o&&2===l?29:_[l-1],c+=n;var U=f(r,l,c,h,g,v,w);return i(t)?(p(U[0],U[1],t),d(t)):t=new m(U[0],U[1],u.UTC),B&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var P=new m(0,0,u.TAI);return m.toGregorianDate=function(e,t){var r=!1,n=h(e,P);i(n)||(m.addSeconds(e,-1,P),n=h(P,P),r=!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 d=4e3*(u+1)/1461001|0;u=u-(1461*d/4|0)+31|0;var p=80*u/2447|0,f=u-(2447*p/80|0)|0;u=p/11|0;var g=p+2-12*u|0,_=100*(c-49)+d+u|0,v=s/l.SECONDS_PER_HOUR|0,y=s-v*l.SECONDS_PER_HOUR,b=y/l.SECONDS_PER_MINUTE|0;y-=b*l.SECONDS_PER_MINUTE;var C=0|y,S=(y-C)/l.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),r&&(C+=1),i(t)?(t.year=_,t.month=g,t.day=f,t.hour=v,t.minute=b,t.second=C,t.millisecond=S,t.isLeapSecond=r,t):new o(_,g,f,v,b,C,S,r)},m.toDate=function(e){var t=m.toGregorianDate(e,g),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},m.toIso8601=function(t,r){var n,o=m.toGregorianDate(t,g);return i(r)||0===o.millisecond?i(r)&&0!==r?(n=(.01*o.millisecond).toFixed(r).replace(".","").slice(0,r),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))},m.clone=function(e,t){if(i(e))return i(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,u.TAI)},m.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||i(e)&&i(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(m.secondsDifference(e,t))<=r},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},m.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY},m.computeTaiMinusUtc=function(e){v.julianDate=e;var r=m.leapSeconds,i=t(r,v,c);return i<0&&(i=~i,--i<0&&(i=0)),r[i].offset},m.addSeconds=function(e,t,r){return p(e.dayNumber,e.secondsOfDay+t,r)},m.addMinutes=function(e,t,r){var i=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,i,r)},m.addHours=function(e,t,r){var i=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,i,r)},m.addDays=function(e,t,r){return p(e.dayNumber+t,e.secondsOfDay,r)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new s(new m(2441317,43210,u.TAI),10),new s(new m(2441499,43211,u.TAI),11),new s(new m(2441683,43212,u.TAI),12),new s(new m(2442048,43213,u.TAI),13),new s(new m(2442413,43214,u.TAI),14),new s(new m(2442778,43215,u.TAI),15),new s(new m(2443144,43216,u.TAI),16),new s(new m(2443509,43217,u.TAI),17),new s(new m(2443874,43218,u.TAI),18),new s(new m(2444239,43219,u.TAI),19),new s(new m(2444786,43220,u.TAI),20),new s(new m(2445151,43221,u.TAI),21),new s(new m(2445516,43222,u.TAI),22),new s(new m(2446247,43223,u.TAI),23),new s(new m(2447161,43224,u.TAI),24),new s(new m(2447892,43225,u.TAI),25),new s(new m(2448257,43226,u.TAI),26),new s(new m(2448804,43227,u.TAI),27),new s(new m(2449169,43228,u.TAI),28),new s(new m(2449534,43229,u.TAI),29),new s(new m(2450083,43230,u.TAI),30),new s(new m(2450630,43231,u.TAI),31),new s(new m(2451179,43232,u.TAI),32),new s(new m(2453736,43233,u.TAI),33),new s(new m(2454832,43234,u.TAI),34),new s(new m(2456109,43235,u.TAI),35),new s(new m(2457204,43236,u.TAI),36),new s(new m(2457754,43237,u.TAI),37)],m}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./Resource","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t){if(t=r(t,r.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=r(t.addNewLeapSeconds,!0),i(t.data))f(this,t.data);else if(i(t.url)){var n=l.createIfNeeded(t.url),o=this;this._downloadPromise=e(n.fetchJson(),function(e){f(o,e)},function(){o._dataError="An error occurred while retrieving the EOP data from the URL "+n.url+"."})}else f(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function p(e,t){return a.compare(e.julianDate,t)}function f(e,r){if(!i(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!i(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=r.columnNames.indexOf("modifiedJulianDateUtc"),o=r.columnNames.indexOf("xPoleWanderRadians"),l=r.columnNames.indexOf("yPoleWanderRadians"),u=r.columnNames.indexOf("ut1MinusUtcSeconds"),h=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),f=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||l<0||u<0||h<0||f<0||m<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 g=e._samples=r.samples,_=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=f,e._taiMinusUtcSecondsColumn=m,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var v,y=e._addNewLeapSeconds,b=0,C=g.length;b<C;b+=e._columnCount){var S=g[b+n],T=g[b+m],w=S+c.MODIFIED_JULIAN_DATE_DIFFERENCE,A=new a(w,T,d.TAI);if(_.push(A),y){if(T!==v&&i(v)){var E=a.leapSeconds,x=t(E,A,p);if(x<0){var P=new s(A,T);E.splice(~x,0,P)}}v=T}}}function m(e,t,r,i,n){var o=r*i;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 g(e,t,r){return t+e*(r-t)}function _(e,t,r,i,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)||i.equals(u))return m(e,r,n,l,s),s;if(i.equals(c))return m(e,r,o,l,s),s;var d=a.secondsDifference(i,u)/a.secondsDifference(c,u),h=n*l,p=o*l,f=r[h+e._ut1MinusUtcSecondsColumn],_=r[p+e._ut1MinusUtcSecondsColumn],v=_-f;if(v>.5||v<-.5){var y=r[h+e._taiMinusUtcSecondsColumn],b=r[p+e._taiMinusUtcSecondsColumn];y!==b&&(c.equals(i)?f=_:_-=b-y)}return s.xPoleWander=g(d,r[h+e._xPoleWanderRadiansColumn],r[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=g(d,r[h+e._yPoleWanderRadiansColumn],r[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=g(d,r[h+e._xCelestialPoleOffsetRadiansColumn],r[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=g(d,r[h+e._yCelestialPoleOffsetRadiansColumn],r[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=g(d,f,_),s}return h.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return i(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}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,r){if(i(this._samples)){if(i(r)||(r=new n(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var o=this._dates,s=this._lastIndex,l=0,c=0;if(i(s)){var d=o[s],h=o[s+1],p=a.lessThanOrEquals(d,e),f=!i(h),m=f||a.greaterThanOrEquals(h,e);if(p&&m)return l=s,!f&&h.equals(e)&&++l,c=l+1,_(this,o,this._samples,e,l,c,r),r}var g=t(o,e,a.compare,this._dateColumn);return g>=0?(g<o.length-1&&o[g+1].equals(e)&&++g,l=g,c=g):(c=~g,(l=c-1)<0&&(l=0)),this._lastIndex=l,_(this,o,this._samples,e,l,c,r),r}if(i(this._dataError))throw new u(this._dataError)},h}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./Resource","./TimeStandard"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=a.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new o(this._sampleZeroJulianEphemerisDate,0,s.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,i=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),l=Math.pow(this._stepSizeDays,t),u=0;u<=t;++u){i[u]=l,n[u]=u*this._stepSizeDays;for(var c=0;c<=t;++c)c!==u&&(i[u]*=u-c);i[u]=1/i[u]}this._work=new Array(t+1),this._coef=new Array(t+1)}function u(e,t,r){var i=d;return i.dayNumber=t,i.secondsOfDay=r,o.daysDifference(i,e._sampleZeroDateTT)}function c(r,n){if(r._chunkDownloadsInProgress[n])return r._chunkDownloadsInProgress[n];var o=e.defer();r._chunkDownloadsInProgress[n]=o;var s,l=r._xysFileUrlTemplate;return s=i(l)?l.getDerivedResource({templateValues:{0:n}}):new a({url:t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json")}),e(s.fetchJson(),function(e){r._chunkDownloadsInProgress[n]=!1;for(var t=r._samples,i=e.samples,a=n*r._samplesPerXysFile*3,s=0,l=i.length;s<l;++s)t[a+s]=i[s];o.resolve()}),o.promise}var d=new o(0,0,s.TAI);return l.prototype.preload=function(t,r,i,n){var o=u(this,t,r),a=u(this,i,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 d=s/this._samplesPerXysFile|0,h=l/this._samplesPerXysFile|0,p=[],f=d;f<=h;++f)p.push(c(this,f));return e.all(p)},l.prototype.computeXysRadians=function(e,t,r){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 d=l+s;d>=this._totalSamples&&(d=this._totalSamples-1,(l=d-s)<0&&(l=0));var h=!1,p=this._samples;if(i(p[3*l])||(c(this,l/this._samplesPerXysFile|0),h=!0),i(p[3*d])||(c(this,d/this._samplesPerXysFile|0),h=!0),!h){i(r)?(r.x=0,r.y=0,r.s=0):r=new n(0,0,0);var f,m,g=o-l*this._stepSizeDays,_=this._work,v=this._denominators,y=this._coef,b=this._xTable;for(f=0;f<=s;++f)_[f]=g-b[f];for(f=0;f<=s;++f){for(y[f]=1,m=0;m<=s;++m)m!==f&&(y[f]*=_[m]);y[f]*=v[f];var C=3*(l+f);r.x+=y[f]*p[C++],r.y+=y[f]*p[C++],r.s+=y[f]*p[C]}return r}}}},l}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./FeatureDetection","./freezeObject","./Math","./Matrix3"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i,n){this.x=r(e,0),this.y=r(t,0),this.z=r(i,0),this.w=r(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,d=u.z*a,h=Math.cos(o);return i(n)?(n.x=s,n.y=c,n.z=d,n.w=h,n):new l(s,c,d,h)};var c=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var r,n,o,a,u,h=e[s.COLUMN0ROW0],p=e[s.COLUMN1ROW1],f=e[s.COLUMN2ROW2],m=h+p+f;if(m>0)r=Math.sqrt(m+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 g=c,_=0;p>h&&(_=1),f>h&&f>p&&(_=2);var v=g[_],y=g[v];r=Math.sqrt(e[s.getElementIndex(_,_)]-e[s.getElementIndex(v,v)]-e[s.getElementIndex(y,y)]+1);var b=d;b[_]=.5*r,r=.5/r,u=(e[s.getElementIndex(y,v)]-e[s.getElementIndex(v,y)])*r,b[v]=(e[s.getElementIndex(v,_)]+e[s.getElementIndex(_,v)])*r,b[y]=(e[s.getElementIndex(y,_)]+e[s.getElementIndex(_,y)])*r,n=-b[0],o=-b[1],a=-b[2]}return i(t)?(t.x=n,t.y=o,t.z=a,t.w=u,t):new l(n,o,a,u)};var h=new l,p=new l,f=new l,m=new l;l.fromHeadingPitchRoll=function(t,r){return m=l.fromAxisAngle(e.UNIT_X,t.roll,h),f=l.fromAxisAngle(e.UNIT_Y,-t.pitch,r),r=l.multiply(f,m,f),p=l.fromAxisAngle(e.UNIT_Z,-t.heading,h),l.multiply(p,r,r)};var g=new e,_=new e,v=new l,y=new l,b=new l;l.packedLength=4,l.pack=function(e,t,i){return i=r(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},l.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,i){l.unpack(e,4*r,b),l.conjugate(b,b);for(var n=0,o=r-t+1;n<o;n++){var a=3*n;l.unpack(e,4*(t+n),v),l.multiply(v,b,v),v.w<0&&l.negate(v,v),l.computeAxis(v,g);var s=l.computeAngle(v);i[a]=g.x*s,i[a+1]=g.y*s,i[a+2]=g.z*s}},l.unpackInterpolationResult=function(t,r,n,o,a){i(a)||(a=new l),e.fromArray(t,0,_);var s=e.magnitude(_);return l.unpack(r,4*o,y),0===s?l.clone(l.IDENTITY,v):l.fromAxisAngle(_,s,v),l.multiply(v,y,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 r=1/l.magnitude(e),i=e.x*r,n=e.y*r,o=e.z*r,a=e.w*r;return t.x=i,t.y=n,t.z=o,t.w=a,t},l.inverse=function(e,t){var r=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/r,t)},l.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},l.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},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,r){var i=e.x,n=e.y,o=e.z,a=e.w,s=t.x,l=t.y,u=t.z,c=t.w,d=a*s+i*c+n*u-o*l,h=a*l-i*u+n*c+o*s,p=a*u+i*l-n*s+o*c,f=a*c-i*s-n*l-o*u;return r.x=d,r.y=h,r.z=p,r.w=f,r},l.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},l.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},l.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<a.EPSILON6)return t.x=t.y=t.z=0,t;var i=1/Math.sqrt(1-r*r);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},l.computeAngle=function(e){return Math.abs(e.w-1)<a.EPSILON6?0:2*Math.acos(e.w)};var C=new l;l.lerp=function(e,t,r,i){return C=l.multiplyByScalar(t,r,C),i=l.multiplyByScalar(e,1-r,i),l.add(C,i,i)};var S=new l,T=new l,w=new l;l.slerp=function(e,t,r,i){var n=l.dot(e,t),o=t;if(n<0&&(n=-n,o=S=l.negate(t,S)),1-n<a.EPSILON6)return l.lerp(e,o,r,i);var s=Math.acos(n);return T=l.multiplyByScalar(e,Math.sin((1-r)*s),T),w=l.multiplyByScalar(o,Math.sin(r*s),w),i=l.add(T,w,i),l.multiplyByScalar(i,1/Math.sin(s),i)},l.log=function(t,r){var i=a.acosClamped(t.w),n=0;return 0!==i&&(n=i/Math.sin(i)),e.multiplyByScalar(t,n,r)},l.exp=function(t,r){var i=e.magnitude(t),n=0;return 0!==i&&(n=Math.sin(i)/i),r.x=t.x*n,r.y=t.y*n,r.z=t.z*n,r.w=Math.cos(i),r};var A=new e,E=new e,x=new l,P=new l;l.computeInnerQuadrangle=function(t,r,i,n){var o=l.conjugate(r,x);l.multiply(o,i,P);var a=l.log(P,A);l.multiply(o,t,P);var s=l.log(P,E);return e.add(a,s,a),e.multiplyByScalar(a,.25,a),e.negate(a,a),l.exp(a,x),l.multiply(r,x,n)},l.squad=function(e,t,r,i,n,o){var a=l.slerp(e,t,n,x),s=l.slerp(r,i,n,P);return l.slerp(a,s,2*n*(1-n),o)};for(var I=new l,D=1.9011074535173003,O=n.supportsTypedArrays()?new Float32Array(8):[],M=n.supportsTypedArrays()?new Float32Array(8):[],R=n.supportsTypedArrays()?new Float32Array(8):[],L=n.supportsTypedArrays()?new Float32Array(8):[],N=0;N<7;++N){var k=N+1,F=2*k+1;O[N]=1/(k*F),M[N]=k/F}return O[7]=D/136,M[7]=8*D/17,l.fastSlerp=function(e,t,r,i){var n,o=l.dot(e,t);o>=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-r,u=r*r,c=s*s,d=7;d>=0;--d)R[d]=(O[d]*u-M[d])*a,L[d]=(O[d]*c-M[d])*a;var h=n*r*(1+R[0]*(1+R[1]*(1+R[2]*(1+R[3]*(1+R[4]*(1+R[5]*(1+R[6]*(1+R[7])))))))),p=s*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),f=l.multiplyByScalar(e,p,I);return l.multiplyByScalar(t,h,i),l.add(f,i,i)},l.fastSquad=function(e,t,r,i,n,o){var a=l.fastSlerp(e,t,n,x),s=l.fastSlerp(r,i,n,P);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}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y){"use strict";var b={},C={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",
down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},T={},w={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},A=new r,E=new r,x=new r;b.localFrameToFixedFrameGenerator=function(e,t){if(!C.hasOwnProperty(e)||!C[e].hasOwnProperty(t))throw new l("firstAxis and secondAxis must be east, north, up, west, south or down.");var i,n=C[e][t],o=e+t;return s(T[o])?i=T[o]:(i=function(i,o,l){if(s(l)||(l=new _),m.equalsEpsilon(i.x,0,m.EPSILON14)&&m.equalsEpsilon(i.y,0,m.EPSILON14)){var u=m.sign(i.z);r.unpack(S[e],0,A),"east"!==e&&"west"!==e&&r.multiplyByScalar(A,u,A),r.unpack(S[t],0,E),"east"!==t&&"west"!==t&&r.multiplyByScalar(E,u,E),r.unpack(S[n],0,x),"east"!==n&&"west"!==n&&r.multiplyByScalar(x,u,x)}else{o=a(o,d.WGS84),o.geodeticSurfaceNormal(i,w.up);var c=w.up,h=w.east;h.x=-i.y,h.y=i.x,h.z=0,r.normalize(h,w.east),r.cross(c,h,w.north),r.multiplyByScalar(w.up,-1,w.down),r.multiplyByScalar(w.east,-1,w.west),r.multiplyByScalar(w.north,-1,w.south),A=w[e],E=w[t],x=w[n]}return l[0]=A.x,l[1]=A.y,l[2]=A.z,l[3]=0,l[4]=E.x,l[5]=E.y,l[6]=E.z,l[7]=0,l[8]=x.x,l[9]=x.y,l[10]=x.z,l[11]=0,l[12]=i.x,l[13]=i.y,l[14]=i.z,l[15]=1,l},T[o]=i),i},b.eastNorthUpToFixedFrame=b.localFrameToFixedFrameGenerator("east","north"),b.northEastDownToFixedFrame=b.localFrameToFixedFrameGenerator("north","east"),b.northUpEastToFixedFrame=b.localFrameToFixedFrameGenerator("north","up"),b.northWestUpToFixedFrame=b.localFrameToFixedFrameGenerator("north","west");var P=new v,I=new r(1,1,1),D=new _;b.headingPitchRollToFixedFrame=function(e,t,i,n,o){n=a(n,b.eastNorthUpToFixedFrame);var s=v.fromHeadingPitchRoll(t,P),l=_.fromTranslationQuaternionRotationScale(r.ZERO,s,I,D);return o=n(e,i,o),_.multiply(o,l,o)};var O=new _,M=new g;b.headingPitchRollQuaternion=function(e,t,r,i,n){var o=b.headingPitchRollToFixedFrame(e,t,r,i,O),a=_.getRotation(o,M);return v.fromRotationMatrix(a,n)};var R=m.TWO_PI/86400,L=new f;b.computeTemeToPseudoFixedMatrix=function(e,t){L=f.addSeconds(e,-f.computeTaiMinusUtc(e),L);var r,i=L.dayNumber,n=L.secondsOfDay,o=i-2451545;r=n>=43200?(o+.5)/y.DAYS_PER_JULIAN_CENTURY:(o-.5)/y.DAYS_PER_JULIAN_CENTURY;var a=24110.54841+r*(8640184.812866+r*(.093104+-62e-7*r)),l=a*R%m.TWO_PI,u=72921158553e-15+1.1772758384668e-19*(i-2451545.5),c=(n+.5*y.SECONDS_PER_DAY)%y.SECONDS_PER_DAY,d=l+u*c,h=Math.cos(d),p=Math.sin(d);return s(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new g(h,p,0,-p,h,0,0,0,1)},b.iau2006XysData=new h,b.earthOrientationParameters=u.NONE;b.preloadIcrfFixed=function(t){var r=t.start.dayNumber,i=t.start.secondsOfDay+32.184,n=t.stop.dayNumber,o=t.stop.secondsOfDay+32.184,a=b.iau2006XysData.preload(r,i,n,o),s=b.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},b.computeIcrfToFixedMatrix=function(e,t){s(t)||(t=new g);var r=b.computeFixedToIcrfMatrix(e,t);if(s(r))return g.transpose(r,t)};var N=new p(0,0,0),k=new c(0,0,0,0,0,0),F=new g,B=new g;b.computeFixedToIcrfMatrix=function(e,t){s(t)||(t=new g);var r=b.earthOrientationParameters.compute(e,k);if(s(r)){var i=e.dayNumber,n=e.secondsOfDay+32.184,o=b.iau2006XysData.computeXysRadians(i,n,N);if(s(o)){var a=o.x+r.xPoleOffset,l=o.y+r.yPoleOffset,u=1/(1+Math.sqrt(1-a*a-l*l)),c=F;c[0]=1-u*a*a,c[3]=-u*a*l,c[6]=a,c[1]=-u*a*l,c[4]=1-u*l*l,c[7]=l,c[2]=-a,c[5]=-l,c[8]=1-u*(a*a+l*l);var d=g.fromRotationZ(-o.s,B),h=g.multiply(c,d,F),p=e.dayNumber,_=e.secondsOfDay-f.computeTaiMinusUtc(e)+r.ut1MinusUtc,v=p-2451545,C=_/y.SECONDS_PER_DAY,S=.779057273264+C+.00273781191135448*(v+C);S=S%1*m.TWO_PI;var T=g.fromRotationZ(S,B),w=g.multiply(h,T,F),A=Math.cos(r.xPoleWander),E=Math.cos(r.yPoleWander),x=Math.sin(r.xPoleWander),P=Math.sin(r.yPoleWander),I=i-2451545+n/y.SECONDS_PER_DAY;I/=36525;var D=-47e-6*I*m.RADIANS_PER_DEGREE/3600,O=Math.cos(D),M=Math.sin(D),R=B;return R[0]=A*O,R[1]=A*M,R[2]=x,R[3]=-E*M+P*x*O,R[4]=E*O+P*x*M,R[5]=-P*A,R[6]=-P*M-E*x*O,R[7]=P*O-E*x*M,R[8]=E*A,g.multiply(w,R,t)}}};var U=new i;b.pointToWindowCoordinates=function(e,t,r,i){return i=b.pointToGLWindowCoordinates(e,t,r,i),i.y=2*t[5]-i.y,i},b.pointToGLWindowCoordinates=function(e,r,n,o){s(o)||(o=new t);var a=U;return _.multiplyByVector(e,i.fromElements(n.x,n.y,n.z,1,a),a),i.multiplyByScalar(a,1/a.w,a),_.multiplyByVector(r,a,a),t.fromCartesian4(a,o)};var V=new r,z=new r,G=new r;b.rotationMatrixFromPositionVelocity=function(e,t,i,n){var o=a(i,d.WGS84).geodeticSurfaceNormal(e,V),l=r.cross(t,o,z);r.equalsEpsilon(l,r.ZERO,m.EPSILON6)&&(l=r.clone(r.UNIT_X,l));var u=r.cross(l,t,G);return r.cross(t,u,l),r.negate(l,l),s(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 H=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),W=new n,j=new r,q=new r,Y=new g,X=new _,Q=new _;return b.basisTo2D=function(e,t,i){var n=_.getTranslation(t,q),o=e.ellipsoid,a=o.cartesianToCartographic(n,W),s=e.project(a,j);r.fromElements(s.z,s.x,s.y,s);var l=b.eastNorthUpToFixedFrame(n,o,X),u=_.inverseTransformation(l,Q),c=_.getRotation(t,Y),d=_.multiplyByMatrix3(u,c,i);return _.multiply(H,d,i),_.setTranslation(i,s,i),i},b.wgs84To2DModelMatrix=function(e,t,i){var n=e.ellipsoid,o=b.eastNorthUpToFixedFrame(t,n,X),a=_.inverseTransformation(o,Q),s=n.cartesianToCartographic(t,W),l=e.project(s,j);r.fromElements(l.z,l.x,l.y,l);var u=_.fromTranslation(l,X);return _.multiply(H,a,i),_.multiply(u,i,i),i},b}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var i=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(c.getColumn(i,0,m)),this._yAxis=r.fromCartesian4(c.getColumn(i,1,m));var o=r.fromCartesian4(c.getColumn(i,2,m));this._plane=d.fromPointNormal(e,o)}var m=new i;a(f.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 g=new e;f.fromPoints=function(t,r){return new f(e.fromPoints(t,g).center,r)};var _=new h,v=new r;f.prototype.projectPointOntoPlane=function(e,i){var n=_;n.origin=e,r.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,v);if(o(a)||(r.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v)),o(a)){var s=r.subtract(a,this._origin,a),l=r.dot(this._xAxis,s),c=r.dot(this._yAxis,s);return o(i)?(i.x=l,i.y=c,i):new t(l,c)}},f.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var r=0,i=e.length,n=0;n<i;n++){var a=this.projectPointOntoPlane(e[n],t[r]);o(a)&&(t[r]=a,r++)}return t.length=r,t},f.prototype.projectPointToNearestOnPlane=function(e,i){o(i)||(i=new t);var n=_;n.origin=e,r.clone(this._plane.normal,n.direction);var a=u.rayPlane(n,this._plane,v);o(a)||(r.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v));var s=r.subtract(a,this._origin,a),l=r.dot(this._xAxis,s),c=r.dot(this._yAxis,s);return i.x=l,i.y=c,i},f.prototype.projectPointsToNearestOnPlane=function(e,t){o(t)||(t=[]);var r=e.length;t.length=r;for(var i=0;i<r;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var y=new r;return f.prototype.projectPointsOntoEllipsoid=function(e,t){var i=e.length;o(t)?t.length=i:t=new Array(i);for(var n=this._ellipsoid,a=this._origin,s=this._xAxis,l=this._yAxis,u=y,c=0;c<i;++c){var d=e[c];r.multiplyByScalar(s,d.x,u),o(t[c])||(t[c]=new r);var h=r.add(a,u,t[c]);r.multiplyByScalar(l,d.y,u),r.add(h,u,h),n.scaleToGeocentricSurface(h,h)}return t},f}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e,t){this.center=r.clone(o(e,r.ZERO)),this.halfAxes=p.clone(o(t,p.ZERO))}function _(e,t,i,n,o,s,l,u){a(u)||(u=new g);var c=u.halfAxes;p.setColumn(c,0,e.xAxis,c),p.setColumn(c,1,e.yAxis,c),p.setColumn(c,2,e.zAxis,c);var d=E;d.x=(t+i)/2,d.y=(n+o)/2,d.z=(s+l)/2;var h=x;h.x=(i-t)/2,h.y=(o-n)/2,h.z=(l-s)/2;var f=u.center;return d=p.multiplyByVector(c,d,d),r.add(e.origin,d,f),p.multiplyByScale(c,h,c),u}g.packedLength=r.packedLength+p.packedLength,g.pack=function(e,t,i){return i=o(i,0),r.pack(e.center,t,i),p.pack(e.halfAxes,t,i+r.packedLength),t},g.unpack=function(e,t,i){return t=o(t,0),a(i)||(i=new g),r.unpack(e,t,i.center),p.unpack(e,t+r.packedLength,i.halfAxes),i};var v=new r,y=new r,b=new r,C=new r,S=new r,T=new r,w=new p,A={unitary:new p,diagonal:new p};g.fromPoints=function(e,t){if(a(t)||(t=new g),!a(e)||0===e.length)return t.halfAxes=p.ZERO,t.center=r.ZERO,t;var i,n=e.length,o=r.clone(e[0],v);for(i=1;i<n;i++)r.add(o,e[i],o);var s=1/n;r.multiplyByScalar(o,s,o);var l,u=0,c=0,d=0,h=0,f=0,m=0;for(i=0;i<n;i++)l=r.subtract(e[i],o,y),u+=l.x*l.x,c+=l.x*l.y,d+=l.x*l.z,h+=l.y*l.y,f+=l.y*l.z,m+=l.z*l.z;u*=s,c*=s,d*=s,h*=s,f*=s,m*=s;var _=w;_[0]=u,_[1]=c,_[2]=d,_[3]=c,_[4]=h,_[5]=f,_[6]=d,_[7]=f,_[8]=m;var E=p.computeEigenDecomposition(_,A),x=p.clone(E.unitary,t.halfAxes),P=p.getColumn(x,0,C),I=p.getColumn(x,1,S),D=p.getColumn(x,2,T),O=-Number.MAX_VALUE,M=-Number.MAX_VALUE,R=-Number.MAX_VALUE,L=Number.MAX_VALUE,N=Number.MAX_VALUE,k=Number.MAX_VALUE;for(i=0;i<n;i++)l=e[i],O=Math.max(r.dot(P,l),O),M=Math.max(r.dot(I,l),M),R=Math.max(r.dot(D,l),R),L=Math.min(r.dot(P,l),L),N=Math.min(r.dot(I,l),N),k=Math.min(r.dot(D,l),k);P=r.multiplyByScalar(P,.5*(L+O),P),I=r.multiplyByScalar(I,.5*(N+M),I),D=r.multiplyByScalar(D,.5*(k+R),D);var F=r.add(P,I,t.center);r.add(F,D,F);var B=b;return B.x=O-L,B.y=M-N,B.z=R-k,r.multiplyByScalar(B,.5,B),p.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var E=new r,x=new r,P=new i,I=new r,D=[new i,new i,new i,new i,new i,new i,new i,new i],O=[new r,new r,new r,new r,new r,new r,new r,new r],M=[new t,new t,new t,new t,new t,new t,new t,new t];g.fromRectangle=function(e,t,r,i,n){t=o(t,0),r=o(r,0),i=o(i,l.WGS84);var a=m.center(e,P),s=i.cartographicToCartesian(a,I),c=new u(s,i),d=c.plane,h=D[0],p=D[1],g=D[2],v=D[3],y=D[4],b=D[5],C=D[6],S=D[7],T=a.longitude,w=e.south<0&&e.north>0?0:a.latitude;C.latitude=b.latitude=y.latitude=e.south,S.latitude=v.latitude=w,h.latitude=p.latitude=g.latitude=e.north,C.longitude=S.longitude=h.longitude=e.west,b.longitude=p.longitude=T,y.longitude=v.longitude=g.longitude=e.east,g.height=p.height=h.height=S.height=C.height=b.height=y.height=v.height=r,i.cartographicArrayToCartesianArray(D,O),c.projectPointsToNearestOnPlane(O,M);var A=Math.min(M[6].x,M[7].x,M[0].x),E=Math.max(M[2].x,M[3].x,M[4].x),x=Math.min(M[4].y,M[5].y,M[6].y),R=Math.max(M[0].y,M[1].y,M[2].y);return g.height=h.height=y.height=C.height=t,i.cartographicArrayToCartesianArray(D,O),_(c,A,E,x,R,Math.min(f.getPointDistance(d,O[0]),f.getPointDistance(d,O[2]),f.getPointDistance(d,O[4]),f.getPointDistance(d,O[6])),r,n)},g.clone=function(e,t){if(a(e))return a(t)?(r.clone(e.center,t.center),p.clone(e.halfAxes,t.halfAxes),t):new g(e.center,e.halfAxes)},g.intersectPlane=function(e,t){var i=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,u=Math.abs(a*o[p.COLUMN0ROW0]+s*o[p.COLUMN0ROW1]+l*o[p.COLUMN0ROW2])+Math.abs(a*o[p.COLUMN1ROW0]+s*o[p.COLUMN1ROW1]+l*o[p.COLUMN1ROW2])+Math.abs(a*o[p.COLUMN2ROW0]+s*o[p.COLUMN2ROW1]+l*o[p.COLUMN2ROW2]),d=r.dot(n,i)+t.distance;return d<=-u?c.OUTSIDE:d>=u?c.INSIDE:c.INTERSECTING};var R=new r,L=new r,N=new r,k=new r;g.distanceSquaredTo=function(e,t){var i=r.subtract(t,e.center,E),n=e.halfAxes,o=p.getColumn(n,0,R),a=p.getColumn(n,1,L),s=p.getColumn(n,2,N),l=r.magnitude(o),u=r.magnitude(a),c=r.magnitude(s);r.normalize(o,o),r.normalize(a,a),r.normalize(s,s);var d=k;d.x=r.dot(i,o),d.y=r.dot(i,a),d.z=r.dot(i,s);var h,f=0;return d.x<-l?(h=d.x+l,f+=h*h):d.x>l&&(h=d.x-l,f+=h*h),d.y<-u?(h=d.y+u,f+=h*h):d.y>u&&(h=d.y-u,f+=h*h),d.z<-c?(h=d.z+c,f+=h*h):d.z>c&&(h=d.z-c,f+=h*h),f};var F=new r,B=new r;g.computePlaneDistances=function(e,t,i,n){a(n)||(n=new d);var o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,c=p.getColumn(u,0,R),h=p.getColumn(u,1,L),f=p.getColumn(u,2,N),m=r.add(c,h,F);r.add(m,f,m),r.add(m,l,m);var g=r.subtract(m,t,B),_=r.dot(i,g);return o=Math.min(_,o),s=Math.max(_,s),r.add(l,c,m),r.add(m,h,m),r.subtract(m,f,m),r.subtract(m,t,g),_=r.dot(i,g),o=Math.min(_,o),s=Math.max(_,s),r.add(l,c,m),r.subtract(m,h,m),r.add(m,f,m),r.subtract(m,t,g),_=r.dot(i,g),o=Math.min(_,o),s=Math.max(_,s),r.add(l,c,m),r.subtract(m,h,m),r.subtract(m,f,m),r.subtract(m,t,g),_=r.dot(i,g),o=Math.min(_,o),s=Math.max(_,s),r.subtract(l,c,m),r.add(m,h,m),r.add(m,f,m),r.subtract(m,t,g),_=r.dot(i,g),o=Math.min(_,o),s=Math.max(_,s),r.subtract(l,c,m),r.add(m,h,m),r.subtract(m,f,m),r.subtract(m,t,g),_=r.dot(i,g),o=Math.min(_,o),s=Math.max(_,s),r.subtract(l,c,m),r.subtract(m,h,m),r.add(m,f,m),r.subtract(m,t,g),_=r.dot(i,g),o=Math.min(_,o),s=Math.max(_,s),r.subtract(l,c,m),r.subtract(m,h,m),r.subtract(m,f,m),r.subtract(m,t,g),_=r.dot(i,g),o=Math.min(_,o),s=Math.max(_,s),n.start=o,n.stop=s,n};var U=new e;return g.isOccluded=function(t,r){var i=e.fromOrientedBoundingBox(t,U);return!r.isBoundingSphereVisible(i)},g.prototype.intersectPlane=function(e){return g.intersectPlane(this,e)},g.prototype.distanceSquaredTo=function(e){return g.distanceSquaredTo(this,e)},g.prototype.computePlaneDistances=function(e,t,r){return g.computePlaneDistances(this,e,t,r)},g.prototype.isOccluded=function(e){return g.isOccluded(this,e)},g.equals=function(e,t){return e===t||a(e)&&a(t)&&r.equals(e.center,t.center)&&p.equals(e.halfAxes,t.halfAxes)},g.prototype.clone=function(e){return g.clone(this,e)},g.prototype.equals=function(e){return g.equals(this,e)},g}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";return e({NONE:0,BITS12:1})}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,i,a,u,h){var g,_,v,y;if(o(e)&&o(t)&&o(i)&&o(a)){var b=e.minimum,C=e.maximum,S=r.subtract(C,b,d),T=i-t;g=Math.max(r.maximumComponent(S),T)<m-1?l.BITS12:l.NONE,_=e.center,v=s.inverseTransformation(a,new s);var w=r.negate(b,c);s.multiply(s.fromTranslation(w,p),v,v);var A=c;A.x=1/S.x,A.y=1/S.y,A.z=1/S.z,s.multiply(s.fromScale(A,p),v,v),y=s.clone(a),s.setTranslation(y,r.ZERO,y),a=s.clone(a,new s);var E=s.fromTranslation(b,p),x=s.fromScale(S,f),P=s.multiply(E,x,p);s.multiply(a,P,a),s.multiply(y,P,y)}this.quantization=g,this.minimumHeight=t,this.maximumHeight=i,this.center=_,this.toScaledENU=v,this.fromScaledENU=a,this.matrix=y,this.hasVertexNormals=u,this.hasWebMercatorT=n(h,!1)}var c=new r,d=new r,h=new t,p=new s,f=new s,m=Math.pow(2,12);u.prototype.encode=function(i,n,o,u,d,p,f){var m=u.x,g=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 _=this.maximumHeight-this.minimumHeight,v=a.clamp((d-this.minimumHeight)/_,0,1);t.fromElements(o.x,o.y,h);var y=e.compressTextureCoordinates(h);t.fromElements(o.z,v,h);var b=e.compressTextureCoordinates(h);t.fromElements(m,g,h);var C=e.compressTextureCoordinates(h);if(i[n++]=y,i[n++]=b,i[n++]=C,this.hasWebMercatorT){t.fromElements(f,0,h);var S=e.compressTextureCoordinates(h);i[n++]=S}}else r.subtract(o,this.center,c),i[n++]=c.x,i[n++]=c.y,i[n++]=c.z,i[n++]=d,i[n++]=m,i[n++]=g,this.hasWebMercatorT&&(i[n++]=f);return this.hasVertexNormals&&(i[n++]=e.octPackFloat(p)),n},u.prototype.decodePosition=function(t,i,n){if(o(n)||(n=new r),i*=this.getStride(),this.quantization===l.BITS12){var a=e.decompressTextureCoordinates(t[i],h);n.x=a.x,n.y=a.y;var u=e.decompressTextureCoordinates(t[i+1],h);return n.z=u.x,s.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=t[i],n.y=t[i+1],n.z=t[i+2],r.add(n,this.center,n)},u.prototype.decodeTextureCoordinates=function(r,i,n){return o(n)||(n=new t),i*=this.getStride(),this.quantization===l.BITS12?e.decompressTextureCoordinates(r[i+2],n):t.fromElements(r[i+4],r[i+5],n)},u.prototype.decodeHeight=function(t,r){if(r*=this.getStride(),this.quantization===l.BITS12){return e.decompressTextureCoordinates(t[r+1],h).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[r+3]},u.prototype.getOctEncodedNormal=function(e,r,i){r=(r+1)*this.getStride()-1;var n=e[r]/256,o=Math.floor(n),a=256*(n-o);return t.fromElements(o,a,i)},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 g={position3DAndHeight:0,textureCoordAndEncodedNormals:1},_={compressed0:0,compressed1:1};return u.prototype.getAttributes=function(e){var t,r=i.FLOAT,n=i.getSizeInBytes(r);if(this.quantization===l.NONE){var o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(4+o)*n,[{index:g.position3DAndHeight,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:4,offsetInBytes:0,strideInBytes:t},{index:g.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:o,offsetInBytes:4*n,strideInBytes:t}]}var a=3,s=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++a,this.hasWebMercatorT&&this.hasVertexNormals?(++s,t=(a+s)*n,[{index:_.compressed0,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:a,offsetInBytes:0,strideInBytes:t},{index:_.compressed1,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:s,offsetInBytes:a*n,strideInBytes:t}]):[{index:_.compressed0,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:a}]},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=r.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}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){this._ellipsoid=r(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,r){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},l.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return i(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new t(o,a,s)},l}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";var _={};_.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var v=new i,y=new d,b=new i,C=new i;return _.computeVertices=function(a){var u,S,T,w,A=Math.cos,E=Math.sin,x=Math.sqrt,P=Math.atan,I=Math.exp,D=c.PI_OVER_TWO,O=c.toRadians,M=a.heightmap,R=a.width,L=a.height,N=a.skirtHeight,k=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),B=1/F.maximumRadius,U=a.nativeRectangle,V=a.rectangle;o(V)?(u=V.west,S=V.south,T=V.east,w=V.north):k?(u=O(U.west),S=O(U.south),T=O(U.east),w=O(U.north)):(u=U.west*B,S=D-2*P(I(-U.south*B)),T=U.east*B,w=D-2*P(I(-U.north*B)));var z=a.relativeToCenter,G=o(z);z=G?z:i.ZERO;var H=n(a.exaggeration,1),W=n(a.includeWebMercatorT,!1),j=n(a.structure,_.DEFAULT_STRUCTURE),q=n(j.heightScale,_.DEFAULT_STRUCTURE.heightScale),Y=n(j.heightOffset,_.DEFAULT_STRUCTURE.heightOffset),X=n(j.elementsPerHeight,_.DEFAULT_STRUCTURE.elementsPerHeight),Q=n(j.stride,_.DEFAULT_STRUCTURE.stride),Z=n(j.elementMultiplier,_.DEFAULT_STRUCTURE.elementMultiplier),K=n(j.isBigEndian,_.DEFAULT_STRUCTURE.isBigEndian),J=p.computeWidth(U),$=p.computeHeight(U),ee=J/(R-1),te=$/(L-1);k||(J*=B,$*=B);var re,ie,ne=F.radiiSquared,oe=ne.x,ae=ne.y,se=ne.z,le=65536,ue=-65536,ce=m.eastNorthUpToFixedFrame(z,F),de=d.inverseTransformation(ce,y);W&&(re=g.geodeticLatitudeToMercatorAngle(S),ie=1/(g.geodeticLatitudeToMercatorAngle(w)-re));var he=b;he.x=Number.POSITIVE_INFINITY,he.y=Number.POSITIVE_INFINITY,he.z=Number.POSITIVE_INFINITY;var pe=C;pe.x=Number.NEGATIVE_INFINITY,pe.y=Number.NEGATIVE_INFINITY,pe.z=Number.NEGATIVE_INFINITY;var fe=Number.POSITIVE_INFINITY,me=R+(N>0?2:0),ge=L+(N>0?2:0),_e=me*ge,ve=new Array(_e),ye=new Array(_e),be=new Array(_e),Ce=W?new Array(_e):[],Se=0,Te=L,we=0,Ae=R;N>0&&(--Se,++Te,--we,++Ae);for(var Ee=0,xe=Se;xe<Te;++xe){var Pe=xe;Pe<0&&(Pe=0),Pe>=L&&(Pe=L-1);var Ie=U.north-te*Pe;Ie=k?O(Ie):D-2*P(I(-Ie*B));var De=A(Ie),Oe=E(Ie),Me=se*Oe,Re=(Ie-S)/(w-S);Re=c.clamp(Re,0,1);var Le;W&&(Le=(g.geodeticLatitudeToMercatorAngle(Ie)-re)*ie);for(var Ne=we;Ne<Ae;++Ne){var ke=Ne;ke<0&&(ke=0),ke>=R&&(ke=R-1);var Fe=U.west+ee*ke;k?Fe=O(Fe):Fe*=B;var Be,Ue=Pe*(R*Q)+ke*Q;if(1===X)Be=M[Ue];else{Be=0;var Ve;if(K)for(Ve=0;Ve<X;++Ve)Be=Be*Z+M[Ue+Ve];else for(Ve=X-1;Ve>=0;--Ve)Be=Be*Z+M[Ue+Ve]}Be=(Be*q+Y)*H;var ze=(Fe-u)/(T-u);if(ze=c.clamp(ze,0,1),be[Ee]=new r(ze,Re),ue=Math.max(ue,Be),le=Math.min(le,Be),Ne!==ke||xe!==Pe){Ne<0?Fe-=1e-5*J:Fe+=1e-5*J,xe<0?Ie+=1e-5*$:Ie-=1e-5*$,De=A(Ie),Oe=E(Ie),Me=se*Oe,Be-=N}var Ge=De*A(Fe),He=De*E(Fe),We=oe*Ge,je=ae*He,qe=x(We*Ge+je*He+Me*Oe),Ye=1/qe,Xe=We*Ye,Qe=je*Ye,Ze=Me*Ye,Ke=new i;Ke.x=Xe+Ge*Be,Ke.y=Qe+He*Be,Ke.z=Ze+Oe*Be,ve[Ee]=Ke,ye[Ee]=Be,W&&(Ce[Ee]=Le),Ee++,d.multiplyByPoint(de,Ke,v),i.minimumByComponent(v,he,he),i.maximumByComponent(v,pe,pe),fe=Math.min(fe,Be)}}var Je,$e=t.fromPoints(ve);o(V)&&V.width<c.PI_OVER_TWO+c.EPSILON5&&(Je=h.fromRectangle(V,le,ue,F));var et;if(G){et=new l(F).computeHorizonCullingPoint(z,ve)}for(var tt=new e(he,pe,z),rt=new f(tt,fe,ue,ce,!1,W),it=new Float32Array(_e*rt.getStride()),nt=0,ot=0;ot<_e;++ot)nt=rt.encode(it,nt,ve[ot],be[ot],ye[ot],void 0,Ce[ot]);return{vertices:it,maximumHeight:ue,minimumHeight:le,encoding:rt,boundingSphere3D:$e,orientedBoundingBox:Je,occludeePointInScaledSpace:et}},_}),define("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function r(){return!0}function i(t,i){function n(){}i=e(i,"This object was destroyed, i.e., destroy() was called.");for(var o in t)"function"==typeof t[o]&&(t[o]=n);t.isDestroyed=r}return i}),define("Core/TaskProcessor",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./Event","./getAbsoluteUri","./isCrossOriginUrl","./RuntimeError","require"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(){if(!i(g._canTransferArrayBuffer)){var t=new Worker(p("Workers/transferTypedArrayTest.js"));t.postMessage=r(t.webkitPostMessage,t.postMessage);var n=new Int8Array([99]);try{t.postMessage({array:n},[n.buffer])}catch(e){return g._canTransferArrayBuffer=!1,g._canTransferArrayBuffer}var o=e.defer();t.onmessage=function(e){var r=e.data.array,n=i(r)&&99===r[0];o.resolve(n),t.terminate(),g._canTransferArrayBuffer=n},g._canTransferArrayBuffer=o.promise}return g._canTransferArrayBuffer}function h(e,t){--e._activeTasks;var r=t.id;if(i(r)){var n=e._deferreds,a=n[r];if(i(t.error)){var s=t.error;"RuntimeError"===s.name?(s=new u(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new o(t.error.message),s.stack=t.error.stack),v.raiseEvent(s),a.reject(s)}else v.raiseEvent(),a.resolve(t.result);delete n[r]}}function p(e){var r=t(e);if(l(r)){var i,n='importScripts("'+r+'");';try{i=new Blob([n],{type:"application/javascript"})}catch(e){var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new o;a.append(n),i=a.getBlob("application/javascript")}r=(window.URL||window.webkitURL).createObjectURL(i)}return r}function f(){return i(_)||(_=p("Workers/cesiumWorkerBootstrapper.js")),_}function m(e){var n=new Worker(f());n.postMessage=r(n.webkitPostMessage,n.postMessage);var o={loaderConfig:{},workerModule:g._workerModulePrefix+e._workerName};return i(g._loaderConfig)?o.loaderConfig=g._loaderConfig:i(define.amd)&&!define.amd.toUrlUndefined&&i(c.toUrl)?o.loaderConfig.baseUrl=s("..",t("Workers/cesiumWorkerBootstrapper.js")):o.loaderConfig.paths={Workers:t("Workers")},n.postMessage(o),n.onmessage=function(t){h(e,t.data)},n}function g(e,t){this._workerName=e,this._maximumActiveTasks=r(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0}var _,v=new a,y=[];return g.prototype.scheduleTask=function(t,r){if(i(this._worker)||(this._worker=m(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(d(),function(o){i(r)?o||(r.length=0):r=y;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},r),s.promise})}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return i(this._worker)&&this._worker.terminate(),n(this)},g.taskCompletedEvent=v,g._defaultWorkerModulePrefix="Workers/",g._workerModulePrefix=g._defaultWorkerModulePrefix,g._loaderConfig=void 0,g._canTransferArrayBuffer=void 0,g}),define("Core/TerrainMesh",["./defaultValue"],function(e){"use strict";function t(t,r,i,n,o,a,s,l,u,c,d){this.center=t,this.vertices=r,this.stride=e(l,6),this.indices=i,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c,this.exaggeration=d}return t}),define("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(){r.throwInstantiationError()}t(n.prototype,{errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},ready:{get:r.throwInstantiationError},readyPromise:{get:r.throwInstantiationError},hasWaterMask:{get:r.throwInstantiationError},hasVertexNormals:{get:r.throwInstantiationError},availability:{get:r.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,r){var i=o[t];e(i)||(o[t]=i=[]);var n=i[r];if(!e(n)){n=i[r]=new Uint16Array((t-1)*(r-1)*6);for(var a=0,s=0,l=0;l<r-1;++l){for(var u=0;u<t-1;++u){var c=a,d=c+t,h=d+1,p=c+1;n[s++]=c,n[s++]=d,n[s++]=p,n[s++]=p,n[s++]=d,n[s++]=h,++a}++a}}return n},n.heightmapTerrainQuality=.25,n.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*n.heightmapTerrainQuality/(t*r)},n.prototype.requestTileGeometry=r.throwInstantiationError,n.prototype.getLevelMaximumGeometricError=r.throwInstantiationError,n.prototype.getTileDataAvailable=r.throwInstantiationError,n}),define("Core/HeightmapTerrainData",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicTilingScheme","./HeightmapTessellator","./Math","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh","./TerrainProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=t(e.childTileMask,15);var i=a.DEFAULT_STRUCTURE,n=e.structure;r(n)?n!==i&&(n.heightScale=t(n.heightScale,i.heightScale),n.heightOffset=t(n.heightOffset,i.heightOffset),n.elementsPerHeight=t(n.elementsPerHeight,i.elementsPerHeight),n.stride=t(n.stride,i.stride),n.elementMultiplier=t(n.elementMultiplier,i.elementMultiplier),n.isBigEndian=t(n.isBigEndian,i.isBigEndian)):n=i,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 f(e,t,r,i,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),d=(u-o.south)*(s-1)/(o.north-o.south),h=0|c,p=h+1;p>=a&&(p=a-1,h=a-2);var f=0|d,m=f+1;m>=s&&(m=s-1,f=s-2);var v=c-h,y=d-f;return f=s-1-f,m=s-1-m,g(v,y,_(e,t,r,i,n,f*a+h),_(e,t,r,i,n,f*a+p),_(e,t,r,i,n,m*a+h),_(e,t,r,i,n,m*a+p))}function m(e,t,r,i,n,o,a,s,l,u,c){var d=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(d+=1,h+=1,a+=2,s+=2);var p=n>0?a-1:a,f=0|d,m=f+1;m>=p&&(m=a-1,f=a-2);var _=n>0?s-1:s,v=0|h,y=v+1;y>=_&&(y=s-1,v=s-2);var b=d-f,C=h-v;return v=s-1-v,y=s-1-y,g(b,C,(t.decodeHeight(e,v*a+f)/c-r)/i,(t.decodeHeight(e,v*a+m)/c-r)/i,(t.decodeHeight(e,y*a+f)/c-r)/i,(t.decodeHeight(e,y*a+m)/c-r)/i)}function g(e,t,r,i,n,o){return t<e?r+e*(i-r)+t*(o-i):r+e*(o-n)+t*(n-r)}function _(e,t,r,i,n,o){o*=i;var a,s=0;if(n)for(a=0;a<t;++a)s=s*r+e[o+a];else for(a=t-1;a>=0;--a)s=s*r+e[o+a];return s}function v(e,t,r,i,n,o,a,s){a*=n;var l;if(o)for(l=0;l<t-1;++l)e[a+l]=s/i|0,s-=e[a+l]*i,i/=r;else for(l=t-1;l>0;--l)e[a+l]=s/i|0,s-=e[a+l]*i,i/=r;e[a+l]=s}i(p.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(i,n,a,s,u){var p=i.ellipsoid,f=i.tileXYToNativeRectangle(n,a,s),m=i.tileXYToRectangle(n,a,s);u=t(u,1);var g=p.cartographicToCartesian(l.center(m)),_=this._structure,v=h.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,i.getNumberOfXTilesAtLevel(0)),b=v/(1<<s);this._skirtHeight=Math.min(4*b,1e3);var C=y.scheduleTask({heightmap:this._buffer,structure:_,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:f,rectangle:m,relativeToCenter:g,ellipsoid:p,skirtHeight:this._skirtHeight,isGeographic:i instanceof o,exaggeration:u});if(r(C)){var S=this;return e(C,function(e){return S._mesh=new d(g,new Float32Array(e.vertices),h.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,i){var n,o=this._width,a=this._height,s=this._structure,l=s.stride,u=s.elementsPerHeight,c=s.elementMultiplier,d=s.isBigEndian,h=s.heightOffset,p=s.heightScale;if(r(this._mesh)){n=m(this._mesh.vertices,this._mesh.encoding,h,p,this._skirtHeight,e,o,a,t,i,this._mesh.exaggeration)}else n=f(this._buffer,u,c,l,d,e,o,a,t,i),n=n*p+h;return n},p.prototype.upsample=function(e,t,i,n,o,a,l){var u=this._width,c=this._height,d=this._structure,h=this._skirtHeight,f=d.stride,g=new this._bufferType(u*c*f),_=this._mesh;if(r(_)){for(var y=_.vertices,b=_.encoding,C=e.tileXYToRectangle(t,i,n),S=e.tileXYToRectangle(o,a,l),T=d.heightOffset,w=d.heightScale,A=_.exaggeration,E=d.elementsPerHeight,x=d.elementMultiplier,P=d.isBigEndian,I=Math.pow(x,E-1),D=0;D<c;++D)for(var O=s.lerp(S.north,S.south,D/(c-1)),M=0;M<u;++M){var R=s.lerp(S.west,S.east,M/(u-1)),L=m(y,b,T,w,h,C,u,c,R,O,A);L=L<d.lowestEncodedHeight?d.lowestEncodedHeight:L,L=L>d.highestEncodedHeight?d.highestEncodedHeight:L,v(g,E,x,I,f,P,D*u+M,L)}return new p({buffer:g,width:u,height:c,childTileMask:0,
structure:this._structure,createdByUpsampling:!0})}},p.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},p.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},p}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,i,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>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},r(o)}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i={};return i.clipTriangleAtAxisAlignedThreshold=function(e,r,i,n,o,a){t(a)?a.length=0:a=[];var s,l,u;r?(s=i<e,l=n<e,u=o<e):(s=i>e,l=n>e,u=o>e);var c,d,h,p,f,m,g=s+l+u;return 1===g?s?(c=(e-i)/(n-i),d=(e-i)/(o-i),a.push(1),a.push(2),1!==d&&(a.push(-1),a.push(0),a.push(2),a.push(d)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(h=(e-n)/(o-n),p=(e-n)/(i-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==h&&(a.push(-1),a.push(1),a.push(2),a.push(h))):u&&(f=(e-o)/(i-o),m=(e-o)/(n-o),a.push(0),a.push(1),1!==m&&(a.push(-1),a.push(2),a.push(1),a.push(m)),1!==f&&(a.push(-1),a.push(2),a.push(0),a.push(f))):2===g?s||i===e?l||n===e?u||o===e||(d=(e-i)/(o-i),h=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(d),a.push(-1),a.push(1),a.push(2),a.push(h)):(m=(e-o)/(n-o),c=(e-i)/(n-i),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(m),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(i-n),f=(e-o)/(i-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(f)):3!==g&&(a.push(0),a.push(1),a.push(2)),a},i.computeBarycentricCoordinates=function(r,i,n,o,a,s,l,u,c){var d=n-l,h=l-a,p=s-u,f=o-u,m=1/(p*d+h*f),g=i-u,_=r-l,v=(p*_+h*g)*m,y=(-f*_+d*g)*m,b=1-v-y;return t(c)?(c.x=v,c.y=y,c.z=b,c):new e(v,y,b)},i}),define("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){function t(e,t){return a[e]-a[t]}function r(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,this._credits=e.credits;var i=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,i),a=this._vValues=this._quantizedVertices.subarray(i,2*i);this._heightValues=this._quantizedVertices.subarray(2*i,3*i),this._westIndices=g(e.westIndices,t,i),this._southIndices=g(e.southIndices,r,i),this._eastIndices=g(e.eastIndices,t,i),this._northIndices=g(e.northIndices,r,i),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 g(e,t,r){y.length=e.length;for(var i=!1,n=0,o=e.length;n<o;++n)y[n]=e[n],i=i||n>0&&t(e[n-1],e[n])>0;return i?(y.sort(t),l.createTypedArray(r,y)):e}function _(e,t,r){for(var i=e._mesh,n=i.vertices,o=i.encoding,a=i.indices,s=0,l=a.length;s<l;s+=3){var c=a[s],d=a[s+1],h=a[s+2],p=o.decodeTextureCoordinates(n,c,w),f=o.decodeTextureCoordinates(n,d,A),m=o.decodeTextureCoordinates(n,h,E),g=u.computeBarycentricCoordinates(t,r,p.x,p.y,f.x,f.y,m.x,m.y,T);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){var _=o.decodeHeight(n,c),v=o.decodeHeight(n,d),y=o.decodeHeight(n,h);return g.x*_+g.y*v+g.z*y}}}function v(e,t,r){for(var i=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s<l;s+=3){var d=a[s],h=a[s+1],p=a[s+2],f=i[d],m=i[h],g=i[p],_=n[d],v=n[h],y=n[p],b=u.computeBarycentricCoordinates(t,r,f,_,m,v,g,y,T);if(b.x>=-1e-15&&b.y>=-1e-15&&b.z>=-1e-15){var C=b.x*o[d]+b.y*o[h]+b.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,C/S)}}}a(m.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});var y=[],b=new h("createVerticesFromQuantizedTerrainMesh");m.prototype.createMesh=function(t,r,i,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(r,i,a);s=n(s,1);var d=b.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(d)){var h=this;return e(d,function(e){var t=h._quantizedVertices.length/3;t+=h._westIndices.length+h._southIndices.length+h._eastIndices.length+h._northIndices.length;var r=l.createTypedArray(t,e.indices),i=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,u=e.maximumHeight,c=n(e.boundingSphere,h._boundingSphere),d=n(e.orientedBoundingBox,h._orientedBoundingBox),m=h._horizonOcclusionPoint,g=e.vertexStride,_=p.clone(e.encoding);return h._skirtIndex=e.skirtIndex,h._vertexCountWithoutSkirts=h._quantizedVertices.length/3,h._mesh=new f(o,i,r,a,u,c,m,g,d,_,s),h._quantizedVertices=void 0,h._encodedNormals=void 0,h._indices=void 0,h._uValues=void 0,h._vValues=void 0,h._heightValues=void 0,h._westIndices=void 0,h._southIndices=void 0,h._eastIndices=void 0,h._northIndices=void 0,h._mesh})}};var C=new h("upsampleQuantizedTerrainMesh");m.prototype.upsample=function(r,n,a,s,u,c,h){var p=this._mesh;if(o(this._mesh)){var f=2*n!==u,g=2*a===c,_=r.ellipsoid,v=r.tileXYToRectangle(u,c,h),y=C.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:f,isNorthChild:g,childRectangle:v,ellipsoid:_,exaggeration:p.exaggeration});if(o(y)){var b=Math.min(this._westSkirtHeight,this._eastSkirtHeight);b=Math.min(b,this._southSkirtHeight),b=Math.min(b,this._northSkirtHeight);var S=f?.5*b:this._westSkirtHeight,T=g?.5*b:this._southSkirtHeight,w=f?this._eastSkirtHeight:.5*b,A=g?this._northSkirtHeight:.5*b,E=this._credits;return e(y).then(function(e){var r,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(r=new Uint8Array(e.encodedNormals)),new m({quantizedVertices:n,indices:a,encodedNormals:r,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:d.clone(e.orientedBoundingBox),horizonOcclusionPoint:i.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:S,southSkirtHeight:T,eastSkirtHeight:w,northSkirtHeight:A,childTileMask:0,credits:E,createdByUpsampling:!0})})}}};var S=32767,T=new i;m.prototype.interpolateHeight=function(e,t,r){var i=c.clamp((t-e.west)/e.width,0,1);i*=S;var n=c.clamp((r-e.south)/e.height,0,1);return n*=S,o(this._mesh)?_(this,i,n):v(this,i,n)};var w=new r,A=new r,E=new r;return m.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},m.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},m}),define("Core/TileAvailability",["./binarySearch","./Cartographic","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,r,i,n,o){"use strict";function a(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[];for(var r=0;r<e.getNumberOfYTilesAtLevel();++r)for(var i=0;i<e.getNumberOfXTilesAtLevel();++i)this._rootNodes.push(new s(e,void 0,0,i,r))}function s(e,t,r,i,n){this.tilingScheme=e,this.parent=t,this.level=r,this.x=i,this.y=n,this.extent=e.tileXYToRectangle(i,n,r),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}function l(e,t,r,i,n){this.level=e,this.west=t,this.south=r,this.east=i,this.north=n}function u(e,t){var r=Math.max(e.west,t.west),i=Math.max(e.south,t.south),n=Math.min(e.east,t.east);return i<Math.min(e.north,t.north)&&r<n}function c(t,r,i){for(;r.level<t;)if(h(r.nw.extent,i))r=r.nw;else if(h(r.ne.extent,i))r=r.ne;else if(h(r.sw.extent,i))r=r.sw;else{if(!h(r.se.extent,i))break;r=r.se}if(0===r.rectangles.length||r.rectangles[r.rectangles.length-1].level<=i.level)r.rectangles.push(i);else{var n=e(r.rectangles,i.level,d);n<=0&&(n=~n),r.rectangles.splice(n,0,i)}}function d(e,t){return e.level-t}function h(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function p(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function f(e,t,r){for(var i=0,n=!1;!n;){var o=t._nw&&p(t._nw.extent,r),a=t._ne&&p(t._ne.extent,r),s=t._sw&&p(t._sw.extent,r),l=t._se&&p(t._se.extent,r);if(o+a+s+l>1){o&&(i=Math.max(i,f(t,t._nw,r))),a&&(i=Math.max(i,f(t,t._ne,r))),s&&(i=Math.max(i,f(t,t._sw,r))),l&&(i=Math.max(i,f(t,t._se,r)));break}o?t=t._nw:a?t=t._ne:s?t=t._sw:l?t=t._se:n=!0}for(;t!==e;){for(var u=t.rectangles,c=u.length-1;c>=0&&u[c].level>i;--c){var d=u[c];p(d,r)&&(i=d.level)}t=t.parent}return i}function m(e,t,r){if(t){var i,n=!1;for(i=0;i<r.length;++i)n=n||u(t.extent,r[i]);if(n){var o=t.rectangles;for(i=0;i<o.length;++i){var a=o[i];e[a.level]||(e[a.level]=r),e[a.level]=g(e[a.level],a)}m(e,t._nw,r),m(e,t._ne,r),m(e,t._sw,r),m(e,t._se,r)}}}function g(e,t){for(var r=[],i=0;i<e.length;++i){var n=e[i];u(n,t)?(n.west<t.west&&r.push(new o(n.west,n.south,t.west,n.north)),n.east>t.east&&r.push(new o(t.east,n.south,n.east,n.north)),n.south<t.south&&r.push(new o(Math.max(t.west,n.west),n.south,Math.min(t.east,n.east),t.south)),n.north>t.north&&r.push(new o(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):r.push(n)}return r}var _=new o;a.prototype.addAvailableTileRange=function(e,t,r,i,n){var o=this._tilingScheme;o.tileXYToRectangle(t,r,e,_);var a=_.west,s=_.north;o.tileXYToRectangle(i,n,e,_);for(var d=_.east,h=_.south,p=new l(e,a,h,d,s),f=0;f<this._rootNodes.length;++f){var m=this._rootNodes[f];u(m.extent,p)&&c(this._maximumLevel,m,p)}},a.prototype.computeMaximumLevelAtPosition=function(e){for(var t,r=0;r<this._rootNodes.length;++r){var i=this._rootNodes[r];if(p(i.extent,e)){t=i;break}}return f(void 0,t,e)};var v=[],y=[],b=new o,C=new o;a.prototype.computeBestAvailableLevelOverRectangle=function(e){var t=v;t.length=0,e.east<e.west?(t.push(o.fromRadians(-Math.PI,e.south,e.east,e.north,b)),t.push(o.fromRadians(e.west,e.south,Math.PI,e.north,C))):t.push(e);var i=y;i.length=0;var n;for(n=0;n<this._rootNodes.length;++n)m(i,this._rootNodes[n],t);for(n=i.length-1;n>=0;--n)if(r(i[n])&&0===i[n].length)return n;return 0};var S=new t;return a.prototype.isTileAvailable=function(e,t,r){var i=this._tilingScheme.tileXYToRectangle(t,r,e,_);return o.center(i,S),this.computeMaximumLevelAtPosition(S)>=e},a.prototype.computeChildMaskForTile=function(e,t,r){var i=e+1;if(i>=this._maximumLevel)return 0;var n=0;return n|=this.isTileAvailable(i,2*t,2*r+1)?1:0,n|=this.isTileAvailable(i,2*t+1,2*r+1)?2:0,n|=this.isTileAvailable(i,2*t,2*r)?4:0,n|=this.isTileAvailable(i,2*t+1,2*r)?8:0},i(s.prototype,{nw:{get:function(){return this._nw||(this._nw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),a}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,i=t.name,n=t.message;r=e(i)&&e(n)?i+": "+n:t.toString();var o=t.stack;return e(o)&&(r+="\n"+o),r}return t}),define("Core/TileProviderError",["./defaultValue","./defined","./formatError"],function(e,t,r){"use strict";function i(t,r,i,n,o,a,s){this.provider=t,this.message=r,this.x=i,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1,this.error=s}return i.handleError=function(e,n,o,a,s,l,u,c,d){var h=e;return t(e)?(h.provider=n,h.message=a,h.x=s,h.y=l,h.level=u,h.retry=!1,h.error=d,++h.timesRetried):h=new i(n,a,s,l,u,0,d),o.numberOfListeners>0?o.raiseEvent(h):console.log('An error occurred in "'+n.constructor.name+'": '+r(a)),h.retry&&t(c)&&c(),h},i.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},i}),define("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./AttributeCompression","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./deprecationWarning","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./Resource","./RuntimeError","./TerrainProvider","./TileAvailability","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S){"use strict";function T(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.littleEndianExtensionSize=e.littleEndianExtensionSize}function w(r){function i(e){var r;if(!e.format)return r="The tile format is not specified in the layer.json file.",void(y=S.handleError(y,w,w._errorEvent,r,void 0,void 0,void 0,p));if(!e.tiles||0===e.tiles.length)return r="The layer.json file does not specify any tile URL templates.",void(y=S.handleError(y,w,w._errorEvent,r,void 0,void 0,void 0,p));var o=!1,a=!1,l=!0,u=!1;if("heightmap-1.0"===e.format)u=!0,s(w._heightmapStructure)||(w._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535}),a=!0,w._requestWaterMask=!0;else if(0!==e.format.indexOf("quantized-mesh-1."))return r='The tile format "'+e.format+'" is invalid or not supported.',void(y=S.handleError(y,w,w._errorEvent,r,void 0,void 0,void 0,p));var c,d=e.tiles,h=e.available;if(s(h)){c=new C(w._tilingScheme,h.length);for(var f=0;f<h.length;++f){var m=h[f],v=w._tilingScheme.getNumberOfYTilesAtLevel(f);s(x[f])||(x[f]=[]);for(var b=0;b<m.length;++b){var P=m[b],I=v-P.endY-1,D=v-P.startY-1;x[f].push([P.startX,I,P.endX,D]),c.addAvailableTileRange(f,P.startX,I,P.endX,D)}}}s(e.extensions)&&-1!==e.extensions.indexOf("octvertexnormals")?o=!0:s(e.extensions)&&-1!==e.extensions.indexOf("vertexnormals")&&(o=!0,l=!1),s(e.extensions)&&-1!==e.extensions.indexOf("watermask")&&(a=!0),w._hasWaterMask=w._hasWaterMask||a,w._hasVertexNormals=w._hasVertexNormals||o,s(e.attribution)&&(E.length>0&&(E+=" "),E+=e.attribution),A.push(new T({resource:g,version:e.version,isHeightmap:u,tileUrlTemplates:d,availability:c,hasVertexNormals:o,hasWaterMask:a,littleEndianExtensionSize:l}));var O=e.parentUrl;if(s(O)){if(!s(c))return console.log("A layer.json can't have a parentUrl if it does't have an available array."),t.resolve();g=g.getDerivedResource({url:O}),g.appendForwardSlash(),_=g.getDerivedResource({url:"layer.json"});var M=_.fetchJson();return t(M,i,n)}return t.resolve()}function n(e){var t="An error occurred while accessing "+_.url+".";y=S.handleError(y,w,w._errorEvent,t,void 0,void 0,void 0,p)}function l(e){i(e).then(function(){if(!s(y)){var e=x.length;if(e>0)for(var t=w._availability=new C(w._tilingScheme,e),r=0;r<e;++r)for(var i=x[r],n=0;n<i.length;++n){var a=i[n];t.addAvailableTileRange(r,a[0],a[1],a[2],a[3])}var l=new o({text:E});s(w._tileCredits)?w._tileCredits.push(l):w._tileCredits=[l],w._ready=!0,w._readyPromise.resolve(!0)}})}function c(e){if(s(e)&&404===e.statusCode)return void l({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]});n(e)}function p(){t(_.fetchJson()).then(l).otherwise(c)}s(r.proxy)&&u("CesiumTerrainProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there."),this._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=b.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=a(r.requestVertexNormals,!1),this._requestWaterMask=a(r.requestWaterMask,!1),this._errorEvent=new d;var f=r.credit;"string"==typeof f&&(f=new o({text:f})),this._credit=f,this._availability=void 0;var m=t.defer();this._ready=!1,this._readyPromise=m,this._tileCredits=void 0;var g,_,y,w=this,A=this._layers=[],E="",x=[];t(r.url).then(function(t){var i=v.createIfNeeded(t,{proxy:r.proxy});if(i.appendForwardSlash(),g=i,_=g.getDerivedResource({url:"layer.json"}),"assets.agi.com"===new e(_.url).authority){var n="The STK World Terrain tileset is deprecated and will be available until September 1, 2018",a="https://cesium.com/blog/2018/03/01/introducing-cesium-world-terrain/";w._tileCredits=[new o({text:n,showOnScreen:!0}),new o({text:"Check out the new high-resolution Cesium World Terrain",link:a,showOnScreen:!0})],u("assets.agi.com",n+" Check out the new high-resolution Cesium World Terrain "+a)}else w._tileCredits=i.credits;p()}).otherwise(function(e){m.reject(e)})}function A(e){return s(e)&&0!==e.length?{Accept:"application/vnd.quantized-mesh;extensions="+e.join("-")+",application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function E(e,t,r,i,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new p({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,credits:e._tileCredits})}function x(e,t,o,a,s,l,u){var c=0,d=3*Float64Array.BYTES_PER_ELEMENT,h=4*Float64Array.BYTES_PER_ELEMENT,p=3*Uint16Array.BYTES_PER_ELEMENT,v=Uint16Array.BYTES_PER_ELEMENT,y=3*v,b=new DataView(t),C=new n(b.getFloat64(c,!0),b.getFloat64(c+8,!0),b.getFloat64(c+16,!0));c+=d;var S=b.getFloat32(c,!0);c+=Float32Array.BYTES_PER_ELEMENT;var T=b.getFloat32(c,!0);c+=Float32Array.BYTES_PER_ELEMENT;var w=new i(new n(b.getFloat64(c,!0),b.getFloat64(c+8,!0),b.getFloat64(c+16,!0)),b.getFloat64(c+d,!0));c+=h;var A=new n(b.getFloat64(c,!0),b.getFloat64(c+8,!0),b.getFloat64(c+16,!0));c+=d;var E=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var x=new Uint16Array(t,c,3*E);c+=E*p,E>65536&&(v=Uint32Array.BYTES_PER_ELEMENT,y=3*v);var I=x.subarray(0,E),D=x.subarray(E,2*E),O=x.subarray(2*E,3*E);r.zigZagDeltaDecode(I,D,O),c%v!=0&&(c+=v-c%v);var M=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var R=f.createTypedArrayFromArrayBuffer(E,t,c,3*M);c+=M*y;for(var L=0,N=R.length,k=0;k<N;++k){var F=R[k];R[k]=L-F,0===F&&++L}var B=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var U=f.createTypedArrayFromArrayBuffer(E,t,c,B);c+=B*v;var V=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var z=f.createTypedArrayFromArrayBuffer(E,t,c,V);c+=V*v;var G=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var H=f.createTypedArrayFromArrayBuffer(E,t,c,G);c+=G*v;var W=b.getUint32(c,!0);c+=Uint32Array.BYTES_PER_ELEMENT;var j=f.createTypedArrayFromArrayBuffer(E,t,c,W);c+=W*v;for(var q,Y;c<b.byteLength;){var X=b.getUint8(c,!0);c+=Uint8Array.BYTES_PER_ELEMENT;var Q=b.getUint32(c,u);c+=Uint32Array.BYTES_PER_ELEMENT,X===P.OCT_VERTEX_NORMALS&&e._requestVertexNormals?q=new Uint8Array(t,c,2*E):X===P.WATER_MASK&&e._requestWaterMask&&(Y=new Uint8Array(t,c,Q)),c+=Q}var Z,K=5*e.getLevelMaximumGeometricError(o),J=e._tilingScheme.tileXYToRectangle(a,s,o);return J.width<m.PI_OVER_TWO+m.EPSILON5&&(Z=g.fromRectangle(J,S,T,e._tilingScheme.ellipsoid)),new _({center:C,minimumHeight:S,maximumHeight:T,boundingSphere:w,orientedBoundingBox:Z,horizonOcclusionPoint:A,quantizedVertices:x,encodedNormals:q,indices:R,westIndices:U,southIndices:z,eastIndices:H,northIndices:j,westSkirtHeight:K,southSkirtHeight:K,eastSkirtHeight:K,northSkirtHeight:K,childTileMask:e.availability.computeChildMaskForTile(o,a,s),waterMask:Y,credits:e._tileCredits})}var P={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return w.prototype.requestTileGeometry=function(e,r,i,n){var o,a=this._layers,l=a.length;if(1===l)o=a[0];else for(var u=0;u<l;++u){var c=a[u];if(!s(c.availability)||c.availability.isTileAvailable(i,e,r)){o=c;break}}if(!s(o))return t.reject(new y("Terrain tile doesn't exist"));var d=o.tileUrlTemplates;if(0!==d.length){var h=this._tilingScheme.getNumberOfYTilesAtLevel(i),p=h-r-1,f=[];this._requestVertexNormals&&o.hasVertexNormals&&f.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&o.hasWaterMask&&f.push("watermask");var m=o.resource.getDerivedResource({url:d[(e+p+i)%d.length],templateValues:{version:o.version,z:i,x:e,y:p},headers:A(f),request:n}),g=m.fetchArrayBuffer();if(s(g)){var _=this;return t(g,function(t){return s(_._heightmapStructure)?E(_,t,i,e,r,p):x(_,t,i,e,r,p,o.littleEndianExtensionSize)})}}},l(w.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}},availability:{get:function(){return this._availability}}}),w.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},w.prototype.getTileDataAvailable=function(e,t,r){if(s(this._availability))return this._availability.isTileAvailable(r,e,t)},w}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,i){"use strict";function n(t,n,o,c,d,h,p,f,m,g){var _=t+n;e.multiplyByScalar(c,Math.cos(_),a),e.multiplyByScalar(o,Math.sin(_),s),e.add(a,s,a);var v=Math.cos(t);v*=v;var y=Math.sin(t);y*=y;var b=h/Math.sqrt(p*v+d*y),C=b/f;return i.fromAxisAngle(a,C,l),r.fromQuaternion(l,u),r.multiplyByVector(u,m,g),e.normalize(g,g),e.multiplyByScalar(g,f,g),g}var o={},a=new e,s=new e,l=new i,u=new r,c=new e,d=new e,h=new e,p=new e;o.raisePositionsToHeight=function(t,r,i){for(var n=r.ellipsoid,o=r.height,a=r.extrudedHeight,s=i?t.length/3*2:t.length/3,l=new Float64Array(3*s),u=t.length,f=i?u:0,m=0;m<u;m+=3){var g=m+1,_=m+2,v=e.fromArray(t,m,c);n.scaleToGeodeticSurface(v,v);var y=e.clone(v,d),b=n.geodeticSurfaceNormal(v,p),C=e.multiplyByScalar(b,o,h);e.add(v,C,v),i&&(e.multiplyByScalar(b,a,C),e.add(y,C,y),l[m+f]=y.x,l[g+f]=y.y,l[_+f]=y.z),l[m]=v.x,l[g]=v.y,l[_]=v.z}return l};var f=new e,m=new e,g=new e;return o.computeEllipsePositions=function(r,i,o){var a=r.semiMinorAxis,s=r.semiMajorAxis,l=r.rotation,u=r.center,p=8*r.granularity,_=a*a,v=s*s,y=s*a,b=e.magnitude(u),C=e.normalize(u,f),S=e.cross(e.UNIT_Z,u,m);S=e.normalize(S,S);var T=e.cross(C,S,g),w=1+Math.ceil(t.PI_OVER_TWO/p),A=t.PI_OVER_TWO/(w-1),E=t.PI_OVER_TWO-w*A;E<0&&(w-=Math.ceil(Math.abs(E)/A));var x,P,I,D,O,M=w*(w+2)*2,R=i?new Array(3*M):void 0,L=0,N=c,k=d,F=4*w*3,B=F-1,U=0,V=o?new Array(F):void 0;for(E=t.PI_OVER_TWO,N=n(E,l,T,S,_,y,v,b,C,N),i&&(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z),o&&(V[B--]=N.z,V[B--]=N.y,V[B--]=N.x),E=t.PI_OVER_TWO-A,x=1;x<w+1;++x){if(N=n(E,l,T,S,_,y,v,b,C,N),k=n(Math.PI-E,l,T,S,_,y,v,b,C,k),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,I=2*x+2,P=1;P<I-1;++P)D=P/(I-1),O=e.lerp(N,k,D,h),R[L++]=O.x,R[L++]=O.y,R[L++]=O.z;R[L++]=k.x,R[L++]=k.y,R[L++]=k.z}o&&(V[B--]=N.z,V[B--]=N.y,V[B--]=N.x,V[U++]=k.x,V[U++]=k.y,V[U++]=k.z),E=t.PI_OVER_TWO-(x+1)*A}for(x=w;x>1;--x){if(E=t.PI_OVER_TWO-(x-1)*A,N=n(-E,l,T,S,_,y,v,b,C,N),k=n(E+Math.PI,l,T,S,_,y,v,b,C,k),i){for(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,I=2*(x-1)+2,P=1;P<I-1;++P)D=P/(I-1),O=e.lerp(N,k,D,h),R[L++]=O.x,R[L++]=O.y,R[L++]=O.z;R[L++]=k.x,R[L++]=k.y,R[L++]=k.z}o&&(V[B--]=N.z,V[B--]=N.y,V[B--]=N.x,V[U++]=k.x,V[U++]=k.y,V[U++]=k.z)}E=t.PI_OVER_TWO,N=n(-E,l,T,S,_,y,v,b,C,N);var z={};return i&&(R[L++]=N.x,R[L++]=N.y,R[L++]=N.z,z.positions=R,z.numPts=w),o&&(V[B--]=N.z,V[B--]=N.y,V[B--]=N.x,z.outerPositions=V),z},o}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,i){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=i.clone(e(t.modelMatrix,i.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return n}),define("Core/EncodedCartesian3",["./Cartesian3","./Check","./defined"],function(e,t,r){"use strict";function i(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}i.encode=function(e,t){r(t)||(t={high:0,low:0});var i;return e>=0?(i=65536*Math.floor(e/65536),t.high=i,t.low=e-i):(i=65536*Math.floor(-e/65536),t.high=-i,t.low=e+i),t};var n={high:0,low:0};i.fromCartesian=function(e,t){r(t)||(t=new i);var o=t.high,a=t.low;return i.encode(e.x,n),o.x=n.high,a.x=n.low,i.encode(e.y,n),o.y=n.high,a.y=n.low,i.encode(e.z,n),o.z=n.high,a.z=n.low,t};var o=new i;return i.writeElements=function(e,t,r){i.fromCartesian(e,o);var n=o.high,a=o.low;t[r]=n.x,t[r+1]=n.y,t[r+2]=n.z,t[r+3]=a.x,t[r+4]=a.y,t[r+5]=a.z},i}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i={};return i.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.indices,n=r.maximumIndex,o=e(r.cacheSize,24),a=i.length;if(!t(n)){n=0;for(var s=0,l=i[s];s<a;)l>n&&(n=l),++s,l=i[s]}for(var u=[],c=0;c<n+1;c++)u[c]=0;for(var d=o+1,h=0;h<a;++h)d-u[i[h]]>o&&(u[i[h]]=d,++d);return(d-o+1)/(a/3)},i.tipsify=function(r){function i(e,t,r,i){for(;t.length>=1;){var o=t[t.length-1];if(t.splice(t.length-1,1),e[o].numLiveTriangles>0)return o}for(;n<i;){if(e[n].numLiveTriangles>0)return++n-1;++n}return-1}r=e(r,e.EMPTY_OBJECT);var n,o=r.indices,a=r.maximumIndex,s=e(r.cacheSize,24),l=o.length,u=0,c=0,d=o[c],h=l;if(t(a))u=a+1;else{for(;c<h;)d>u&&(u=d),++c,d=o[c];if(-1===u)return 0;++u}var p,f=[];for(p=0;p<u;p++)f[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};c=0;for(var m=0;c<h;)f[o[c]].vertexTriangles.push(m),++f[o[c]].numLiveTriangles,f[o[c+1]].vertexTriangles.push(m),++f[o[c+1]].numLiveTriangles,f[o[c+2]].vertexTriangles.push(m),++f[o[c+2]].numLiveTriangles,++m,c+=3;var g=0,_=s+1;n=1;var v,y,b=[],C=[],S=0,T=[],w=l/3,A=[];for(p=0;p<w;p++)A[p]=!1;for(var E,x;-1!==g;){b=[],y=f[g],x=y.vertexTriangles.length;for(var P=0;P<x;++P)if(m=y.vertexTriangles[P],!A[m]){A[m]=!0,c=m+m+m;for(var I=0;I<3;++I)E=o[c],b.push(E),C.push(E),T[S]=E,++S,v=f[E],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++c}g=function(e,t,r,n,o,a,s){for(var l,u=-1,c=-1,d=0;d<r.length;){var h=r[d];n[h].numLiveTriangles&&(l=0,o-n[h].timeStamp+2*n[h].numLiveTriangles<=t&&(l=o-n[h].timeStamp),(l>c||-1===c)&&(c=l,u=h)),++d}return-1===u?i(n,a,e,s):u}(o,s,b,f,_,C,u)}return T},i}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w){"use strict";function A(e,t,r,i,n){e[t++]=r,e[t++]=i,e[t++]=i,e[t++]=n,e[t++]=n,e[t]=r}function E(e){for(var t=e.length,r=t/3*6,i=g.createTypedArray(t,r),n=0,o=0;o<t;o+=3,n+=6)A(i,n,e[o],e[o+1],e[o+2]);return i}function x(e){var t=e.length;if(t>=3){var r=6*(t-2),i=g.createTypedArray(t,r);A(i,0,e[0],e[1],e[2]);for(var n=6,o=3;o<t;++o,n+=6)A(i,n,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function P(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),i=g.createTypedArray(t,r),n=e[0],o=0,a=1;a<t;++a,o+=6)A(i,o,n,e[a],e[a+1]);return i}return new Uint16Array}function I(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&u(e[r])&&u(e[r].values)){var i=e[r];t[r]=new f({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function D(e,t,r){for(var i in t)if(t.hasOwnProperty(i)&&u(t[i])&&u(t[i].values))for(var n=t[i],o=0;o<n.componentsPerAttribute;++o)e[i].values.push(n.values[r*n.componentsPerAttribute+o])}function O(e,t){if(u(t))for(var r=t.values,i=r.length,o=0;o<i;o+=3)n.unpack(r,o,oe),C.multiplyByPoint(e,oe,oe),n.pack(oe,r,o)}function M(e,t){if(u(t))for(var r=t.values,i=r.length,o=0;o<i;o+=3)n.unpack(r,o,oe),b.multiplyByVector(e,oe,oe),oe=n.normalize(oe,oe),n.pack(oe,r,o)}function R(e,t){var r,i=e.length,n={},o=e[0][t].attributes;for(r in o)if(o.hasOwnProperty(r)&&u(o[r])&&u(o[r].values)){for(var a=o[r],l=a.values.length,c=!0,d=1;d<i;++d){var h=e[d][t].attributes[r];if(!u(h)||a.componentDatatype!==h.componentDatatype||a.componentsPerAttribute!==h.componentsPerAttribute||a.normalize!==h.normalize){c=!1;break}l+=h.values.length}c&&(n[r]=new f({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,l)}))}return n}function L(e,t){var i,o,a,s,l,c,d,h=e.length,f=(e[0].modelMatrix,u(e[0][t].indices)),m=e[0][t].primitiveType,_=R(e,t);for(i in _)if(_.hasOwnProperty(i))for(l=_[i].values,s=0,o=0;o<h;++o)for(c=e[o][t].attributes[i].values,d=c.length,a=0;a<d;++a)l[s++]=c[a];var v;if(f){var y=0;for(o=0;o<h;++o)y+=e[o][t].indices.length;var b=p.computeNumberOfVertices(new p({attributes:_,primitiveType:T.POINTS})),C=g.createTypedArray(b,y),S=0,w=0;for(o=0;o<h;++o){var A=e[o][t].indices,E=A.length;for(s=0;s<E;++s)C[S++]=w+A[s];w+=p.computeNumberOfVertices(e[o][t])}v=C}var x,P=new n,I=0;for(o=0;o<h;++o){if(x=e[o][t].boundingSphere,!u(x)){P=void 0;break}n.add(x.center,P,P)}if(u(P))for(n.divideByScalar(P,h,P),o=0;o<h;++o){x=e[o][t].boundingSphere;var D=n.magnitude(n.subtract(x.center,P,le))+x.radius;D>I&&(I=D)}return new p({attributes:_,indices:v,primitiveType:m,boundingSphere:u(P)?new r(P,I):void 0})}function N(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,t),i=0;i<t;++i)r[i]=i;return e.indices=r,e}function k(e){
var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var i=3,n=3;n<t;++n)r[i++]=n-1,r[i++]=0,r[i++]=n;return e.indices=r,e.primitiveType=T.TRIANGLES,e}function F(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var i=6,n=3;n<t-1;n+=2)r[i++]=n,r[i++]=n-1,r[i++]=n+1,n+2<t&&(r[i++]=n,r[i++]=n+1,r[i++]=n+2);return e.indices=r,e.primitiveType=T.TRIANGLES,e}function B(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,t),i=0;i<t;++i)r[i]=i;return e.indices=r,e}function U(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var i=2,n=2;n<t;++n)r[i++]=n-1,r[i++]=n;return e.indices=r,e.primitiveType=T.LINES,e}function V(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var i=2,n=2;n<t;++n)r[i++]=n-1,r[i++]=n;return r[i++]=t-1,r[i]=0,e.indices=r,e.primitiveType=T.LINES,e}function z(e){switch(e.primitiveType){case T.TRIANGLE_FAN:return k(e);case T.TRIANGLE_STRIP:return F(e);case T.TRIANGLES:return N(e);case T.LINE_STRIP:return U(e);case T.LINE_LOOP:return V(e);case T.LINES:return B(e)}return e}function G(e,t){Math.abs(e.y)<y.EPSILON6&&(e.y=t?-y.EPSILON6:y.EPSILON6)}function H(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return G(e,e.y<0),G(t,t.y<0),void G(r,r.y<0);var i,n=Math.abs(e.y),o=Math.abs(t.y),a=Math.abs(r.y);i=n>o?n>a?y.sign(e.y):y.sign(r.y):o>a?y.sign(t.y):y.sign(r.y);var s=i<0;G(e,s),G(t,s),G(r,s)}function W(e,t,r,i){n.add(e,n.multiplyByScalar(n.subtract(t,e,Ce),e.y/(e.y-t.y),Ce),r),n.clone(r,i),G(r,!0),G(i,!1)}function j(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){H(e,t,r);var i=e.y<0,n=t.y<0,o=r.y<0,a=0;a+=i?1:0,a+=n?1:0,a+=o?1:0;var s=Ee.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(W(e,t,Se,we),W(e,r,Te,Ae),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(W(t,r,Se,we),W(t,e,Te,Ae),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(W(r,e,Se,we),W(r,t,Te,Ae),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,i?n?o||(W(r,e,Se,we),W(r,t,Te,Ae),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(W(t,r,Se,we),W(t,e,Te,Ae),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(W(e,t,Se,we),W(e,r,Te,Ae),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=Ee.positions;return l[0]=e,l[1]=t,l[2]=r,l.length=3,1!==a&&2!==a||(l[3]=Se,l[4]=Te,l[5]=we,l[6]=Ae,l.length=7),Ee}}function q(e,t){var i=e.attributes;if(0!==i.position.values.length){for(var n in i)if(i.hasOwnProperty(n)&&u(i[n])&&u(i[n].values)){var o=i[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=p.computeNumberOfVertices(e);return e.indices=g.createTypedArray(a,e.indices),t&&(e.boundingSphere=r.fromVertices(i.position.values)),e}}function Y(e){var t=e.attributes,r={};for(var i in t)if(t.hasOwnProperty(i)&&u(t[i])&&u(t[i].values)){var n=t[i];r[i]=new f({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({attributes:r,indices:[],primitiveType:e.primitiveType})}function X(e,t,r){var i=u(e.geometry.boundingSphere);t=q(t,i),r=q(r,i),u(r)&&!u(t)?e.geometry=r:!u(r)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Q(e,r,o,a,s,l,c,d,h,p,f,m){if(u(l)||u(c)||u(d)||u(h)||u(p)){var g=n.fromArray(s,3*e,xe),_=n.fromArray(s,3*r,Pe),v=n.fromArray(s,3*o,Ie),y=t(a,g,_,v,De);if(u(l)){var b=n.fromArray(l,3*e,xe),C=n.fromArray(l,3*r,Pe),S=n.fromArray(l,3*o,Ie);n.multiplyByScalar(b,y.x,b),n.multiplyByScalar(C,y.y,C),n.multiplyByScalar(S,y.z,S);var T=n.add(b,C,b);n.add(T,S,T),n.normalize(T,T),n.pack(T,f.normal.values,3*m)}if(u(p)){var w=n.fromArray(p,3*e,xe),A=n.fromArray(p,3*r,Pe),E=n.fromArray(p,3*o,Ie);n.multiplyByScalar(w,y.x,w),n.multiplyByScalar(A,y.y,A),n.multiplyByScalar(E,y.z,E);var x;n.equals(w,n.ZERO)&&n.equals(A,n.ZERO)&&n.equals(E,n.ZERO)?(x=xe,x.x=0,x.y=0,x.z=0):(x=n.add(w,A,w),n.add(x,E,x),n.normalize(x,x)),n.pack(x,f.extrudeDirection.values,3*m)}if(u(c)){var P=n.fromArray(c,3*e,xe),I=n.fromArray(c,3*r,Pe),D=n.fromArray(c,3*o,Ie);n.multiplyByScalar(P,y.x,P),n.multiplyByScalar(I,y.y,I),n.multiplyByScalar(D,y.z,D);var O=n.add(P,I,P);n.add(O,D,O),n.normalize(O,O),n.pack(O,f.tangent.values,3*m)}if(u(d)){var M=n.fromArray(d,3*e,xe),R=n.fromArray(d,3*r,Pe),L=n.fromArray(d,3*o,Ie);n.multiplyByScalar(M,y.x,M),n.multiplyByScalar(R,y.y,R),n.multiplyByScalar(L,y.z,L);var N=n.add(M,R,M);n.add(N,L,N),n.normalize(N,N),n.pack(N,f.bitangent.values,3*m)}if(u(h)){var k=i.fromArray(h,2*e,Oe),F=i.fromArray(h,2*r,Me),B=i.fromArray(h,2*o,Re);i.multiplyByScalar(k,y.x,k),i.multiplyByScalar(F,y.y,F),i.multiplyByScalar(B,y.z,B);var U=i.add(k,F,k);i.add(U,B,U),i.pack(U,f.st.values,2*m)}}}function Z(e,t,r,i,n,o){var a=e.position.values.length/3;if(-1!==n){var s=i[n],l=r[s];return-1===l?(r[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 K(e){var t,r,i,o,a,s=e.geometry,l=s.attributes,c=l.position.values,d=u(l.normal)?l.normal.values:void 0,h=u(l.bitangent)?l.bitangent.values:void 0,p=u(l.tangent)?l.tangent.values:void 0,f=u(l.st)?l.st.values:void 0,m=u(l.extrudeDirection)?l.extrudeDirection.values:void 0,g=s.indices,_=Y(s),v=Y(s),y=[];y.length=c.length/3;var b=[];for(b.length=c.length/3,a=0;a<y.length;++a)y[a]=-1,b[a]=-1;var C=g.length;for(a=0;a<C;a+=3){var S=g[a],T=g[a+1],w=g[a+2],A=n.fromArray(c,3*S),E=n.fromArray(c,3*T),x=n.fromArray(c,3*w),P=j(A,E,x);if(u(P)&&P.positions.length>3)for(var I=P.positions,D=P.indices,O=D.length,M=0;M<O;++M){var R=D[M],L=I[R];L.y<0?(t=v.attributes,r=v.indices,i=y):(t=_.attributes,r=_.indices,i=b),o=Z(t,r,i,g,R<3?a+R:-1,L),Q(S,T,w,L,c,d,p,h,f,m,t,o)}else u(P)&&(A=P.positions[0],E=P.positions[1],x=P.positions[2]),A.y<0?(t=v.attributes,r=v.indices,i=y):(t=_.attributes,r=_.indices,i=b),o=Z(t,r,i,g,a,A),Q(S,T,w,A,c,d,p,h,f,m,t,o),o=Z(t,r,i,g,a+1,E),Q(S,T,w,E,c,d,p,h,f,m,t,o),o=Z(t,r,i,g,a+2,x),Q(S,T,w,x,c,d,p,h,f,m,t,o)}X(e,v,_)}function J(e){var t,r=e.geometry,i=r.attributes,o=i.position.values,a=r.indices,s=Y(r),l=Y(r),c=a.length,d=[];d.length=o.length/3;var h=[];for(h.length=o.length/3,t=0;t<d.length;++t)d[t]=-1,h[t]=-1;for(t=0;t<c;t+=2){var p=a[t],f=a[t+1],m=n.fromArray(o,3*p,xe),g=n.fromArray(o,3*f,Pe);Math.abs(m.y)<y.EPSILON6&&(m.y<0?m.y=-y.EPSILON6:m.y=y.EPSILON6),Math.abs(g.y)<y.EPSILON6&&(g.y<0?g.y=-y.EPSILON6:g.y=y.EPSILON6);var _=s.attributes,b=s.indices,C=h,S=l.attributes,T=l.indices,w=d,A=v.lineSegmentPlane(m,g,Le,Ie);if(u(A)){var E=n.multiplyByScalar(n.UNIT_Y,5*y.EPSILON9,Ne);m.y<0&&(n.negate(E,E),_=l.attributes,b=l.indices,C=d,S=s.attributes,T=s.indices,w=h);var x=n.add(A,E,ke);Z(_,b,C,a,t,m),Z(_,b,C,a,-1,x),n.negate(E,E),n.add(A,E,x),Z(S,T,w,a,-1,x),Z(S,T,w,a,t+1,g)}else{var P,I,D;m.y<0?(P=l.attributes,I=l.indices,D=d):(P=s.attributes,I=s.indices,D=h),Z(P,I,D,a,t,m),Z(P,I,D,a,t+1,g)}}X(e,l,s)}function $(e){for(var t=e.attributes,r=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,a=r.length,s=0;s<a;s+=3){var l=n.unpack(r,s,Ue);if(!(l.x>0)){var u=n.unpack(i,s,Ve);(l.y<0&&u.y>0||l.y>0&&u.y<0)&&(s-3>0?(i[s]=r[s-3],i[s+1]=r[s-2],i[s+2]=r[s-1]):n.pack(l,i,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]=r[s+3],o[s+1]=r[s+4],o[s+2]=r[s+5]):n.pack(l,o,s))}}}function ee(e){var t,r,a,s=e.geometry,l=s.attributes,c=l.position.values,d=l.prevPosition.values,h=l.nextPosition.values,p=l.expandAndWidth.values,f=u(l.st)?l.st.values:void 0,m=u(l.color)?l.color.values:void 0,g=Y(s),_=Y(s),b=!1,C=c.length/3;for(t=0;t<C;t+=4){var S=t,T=t+2,w=n.fromArray(c,3*S,Ue),A=n.fromArray(c,3*T,Ve);if(Math.abs(w.y)<Ye)for(w.y=Ye*(A.y<0?-1:1),c[3*t+1]=w.y,c[3*(t+1)+1]=w.y,r=3*S;r<3*S+12;r+=3)d[r]=c[3*t],d[r+1]=c[3*t+1],d[r+2]=c[3*t+2];if(Math.abs(A.y)<Ye)for(A.y=Ye*(w.y<0?-1:1),c[3*(t+2)+1]=A.y,c[3*(t+3)+1]=A.y,r=3*S;r<3*S+12;r+=3)h[r]=c[3*(t+2)],h[r+1]=c[3*(t+2)+1],h[r+2]=c[3*(t+2)+2];var E=g.attributes,x=g.indices,P=_.attributes,I=_.indices,D=v.lineSegmentPlane(w,A,Le,Ge);if(u(D)){b=!0;var O=n.multiplyByScalar(n.UNIT_Y,qe,He);w.y<0&&(n.negate(O,O),E=_.attributes,x=_.indices,P=g.attributes,I=g.indices);var M=n.add(D,O,We);E.position.values.push(w.x,w.y,w.z,w.x,w.y,w.z),E.position.values.push(M.x,M.y,M.z),E.position.values.push(M.x,M.y,M.z),E.prevPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),E.prevPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]),E.prevPosition.values.push(w.x,w.y,w.z,w.x,w.y,w.z),E.nextPosition.values.push(M.x,M.y,M.z),E.nextPosition.values.push(M.x,M.y,M.z),E.nextPosition.values.push(M.x,M.y,M.z),E.nextPosition.values.push(M.x,M.y,M.z),n.negate(O,O),n.add(D,O,M),P.position.values.push(M.x,M.y,M.z),P.position.values.push(M.x,M.y,M.z),P.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),P.prevPosition.values.push(M.x,M.y,M.z),P.prevPosition.values.push(M.x,M.y,M.z),P.prevPosition.values.push(M.x,M.y,M.z),P.prevPosition.values.push(M.x,M.y,M.z),P.nextPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),P.nextPosition.values.push(h[3*T],h[3*T+1],h[3*T+2]),P.nextPosition.values.push(h[3*T+3],h[3*T+4],h[3*T+5]);var R=i.fromArray(p,2*S,Fe),L=Math.abs(R.y);E.expandAndWidth.values.push(-1,L,1,L),E.expandAndWidth.values.push(-1,-L,1,-L),P.expandAndWidth.values.push(-1,L,1,L),P.expandAndWidth.values.push(-1,-L,1,-L);var N=n.magnitudeSquared(n.subtract(D,w,ze));if(N/=n.magnitudeSquared(n.subtract(A,w,ze)),u(m)){var k=o.fromArray(m,4*S,je),F=o.fromArray(m,4*T,je),B=y.lerp(k.x,F.x,N),U=y.lerp(k.y,F.y,N),V=y.lerp(k.z,F.z,N),z=y.lerp(k.w,F.w,N);for(r=4*S;r<4*S+8;++r)E.color.values.push(m[r]);for(E.color.values.push(B,U,V,z),E.color.values.push(B,U,V,z),P.color.values.push(B,U,V,z),P.color.values.push(B,U,V,z),r=4*T;r<4*T+8;++r)P.color.values.push(m[r])}if(u(f)){var G=i.fromArray(f,2*S,Fe),H=i.fromArray(f,2*(t+3),Be),W=y.lerp(G.x,H.x,N);for(r=2*S;r<2*S+4;++r)E.st.values.push(f[r]);for(E.st.values.push(W,G.y),E.st.values.push(W,H.y),P.st.values.push(W,G.y),P.st.values.push(W,H.y),r=2*T;r<2*T+4;++r)P.st.values.push(f[r])}a=E.position.values.length/3-4,x.push(a,a+2,a+1),x.push(a+1,a+2,a+3),a=P.position.values.length/3-4,I.push(a,a+2,a+1),I.push(a+1,a+2,a+3)}else{var j,q;for(w.y<0?(j=_.attributes,q=_.indices):(j=g.attributes,q=g.indices),j.position.values.push(w.x,w.y,w.z),j.position.values.push(w.x,w.y,w.z),j.position.values.push(A.x,A.y,A.z),j.position.values.push(A.x,A.y,A.z),r=3*t;r<3*t+12;++r)j.prevPosition.values.push(d[r]),j.nextPosition.values.push(h[r]);for(r=2*t;r<2*t+8;++r)j.expandAndWidth.values.push(p[r]),u(f)&&j.st.values.push(f[r]);if(u(m))for(r=4*t;r<4*t+16;++r)j.color.values.push(m[r]);a=j.position.values.length/3-4,q.push(a,a+2,a+1),q.push(a+1,a+2,a+3)}}b&&($(_),$(g)),X(e,_,g)}var te={};te.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case T.TRIANGLES:e.indices=E(t);break;case T.TRIANGLE_STRIP:e.indices=x(t);break;case T.TRIANGLE_FAN:e.indices=P(t)}e.primitiveType=T.LINES}return e},te.createLineSegmentsForVectors=function(e,t,i){t=l(t,"normal"),i=l(i,1e4);for(var n=e.attributes.position.values,o=e.attributes[t].values,a=n.length,c=new Float64Array(2*a),d=0,h=0;h<a;h+=3)c[d++]=n[h],c[d++]=n[h+1],c[d++]=n[h+2],c[d++]=n[h]+o[h]*i,c[d++]=n[h+1]+o[h+1]*i,c[d++]=n[h+2]+o[h+2]*i;var m,g=e.boundingSphere;return u(g)&&(m=new r(g.center,g.radius+i)),new p({attributes:{position:new f({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:T.LINES,boundingSphere:m})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],i=e.attributes,n={},o=0,a=r.length;for(t=0;t<a;++t){var s=r[t];u(i[s])&&(n[s]=o++)}for(var l in i)i.hasOwnProperty(l)&&!u(n[l])&&(n[l]=o++);return n},te.reorderForPreVertexCache=function(e){var t=p.computeNumberOfVertices(e),r=e.indices;if(u(r)){for(var i=new Int32Array(t),n=0;n<t;n++)i[n]=-1;for(var o,a=r,l=a.length,c=g.createTypedArray(t,l),d=0,h=0,f=0;d<l;)o=i[a[d]],-1!==o?c[h]=o:(o=a[d],i[o]=f,c[h]=f,++f),++d,++h;e.indices=c;var m=e.attributes;for(var _ in m)if(m.hasOwnProperty(_)&&u(m[_])&&u(m[_].values)){for(var v=m[_],y=v.values,b=0,C=v.componentsPerAttribute,S=s.createTypedArray(v.componentDatatype,f*C);b<t;){var T=i[b];if(-1!==T)for(var w=0;w<C;w++)S[C*T+w]=y[C*b+w];++b}v.values=S}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===T.TRIANGLES&&u(r)){for(var i=r.length,n=0,o=0;o<i;o++)r[o]>n&&(n=r[o]);e.indices=w.tipsify({indices:r,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=p.computeNumberOfVertices(e);if(u(e.indices)&&r>=y.SIXTY_FOUR_KILOBYTES){var i,n=[],o=[],a=0,s=I(e.attributes),l=e.indices,c=l.length;e.primitiveType===T.TRIANGLES?i=3:e.primitiveType===T.LINES?i=2:e.primitiveType===T.POINTS&&(i=1);for(var d=0;d<c;d+=i){for(var h=0;h<i;++h){var f=l[d+h],m=n[f];u(m)||(m=a++,n[f]=m,D(s,e.attributes,f)),o.push(m)}a+i>=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=I(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 re=new n,ie=new a;te.projectTo2D=function(e,t,r,i,o){var a=e.attributes[t];o=u(o)?o:new h;for(var l=o.ellipsoid,c=a.values,d=new Float64Array(c.length),p=0,m=0;m<c.length;m+=3){var g=n.fromArray(c,m,re),_=l.cartesianToCartographic(g,ie),v=o.project(_,re);d[p++]=v.x,d[p++]=v.y,d[p++]=v.z}return e.attributes[r]=a,e.attributes[i]=new f({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:d}),delete e.attributes[t],e};var ne={high:0,low:0};te.encodeAttribute=function(e,t,r,i){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)d.encode(o[c],ne),l[c]=ne.high,u[c]=ne.low;var h=n.componentsPerAttribute;return e.attributes[r]=new f({componentDatatype:s.FLOAT,componentsPerAttribute:h,values:l}),e.attributes[i]=new f({componentDatatype:s.FLOAT,componentsPerAttribute:h,values:u}),delete e.attributes[t],e};var oe=new n,ae=new C,se=new b;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(C.equals(t,C.IDENTITY))return e;var i=e.geometry.attributes;O(t,i.position),O(t,i.prevPosition),O(t,i.nextPosition),(u(i.normal)||u(i.tangent)||u(i.bitangent))&&(C.inverse(t,ae),C.transpose(ae,ae),C.getRotation(ae,se),M(se,i.normal),M(se,i.tangent),M(se,i.bitangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=r.transform(n,t,n)),e.modelMatrix=C.clone(C.IDENTITY),e};var le=new n;te.combineInstances=function(e){for(var t=[],r=[],i=e.length,n=0;n<i;++n){var o=e[n];u(o.geometry)?t.push(o):u(o.westHemisphereGeometry)&&u(o.eastHemisphereGeometry)&&r.push(o)}var a=[];return t.length>0&&a.push(L(t,"geometry")),r.length>0&&(a.push(L(r,"westHemisphereGeometry")),a.push(L(r,"eastHemisphereGeometry"))),a};var ue=new n,ce=new n,de=new n,he=new n;te.computeNormal=function(e){var t,r=e.indices,i=e.attributes,o=i.position.values,a=i.position.values.length/3,l=r.length,u=new Array(a),c=new Array(l/3),d=new Array(l);for(t=0;t<a;t++)u[t]={indexOffset:0,count:0,currentCount:0};var h=0;for(t=0;t<l;t+=3){var p=r[t],m=r[t+1],g=r[t+2],_=3*p,v=3*m,b=3*g;ce.x=o[_],ce.y=o[_+1],ce.z=o[_+2],de.x=o[v],de.y=o[v+1],de.z=o[v+2],he.x=o[b],he.y=o[b+1],he.z=o[b+2],u[p].count++,u[m].count++,u[g].count++,n.subtract(de,ce,de),n.subtract(he,ce,he),c[h]=n.cross(de,he,new n),h++}var C=0;for(t=0;t<a;t++)u[t].indexOffset+=C,C+=u[t].count;h=0;var S;for(t=0;t<l;t+=3){S=u[r[t]];var T=S.indexOffset+S.currentCount;d[T]=h,S.currentCount++,S=u[r[t+1]],T=S.indexOffset+S.currentCount,d[T]=h,S.currentCount++,S=u[r[t+2]],T=S.indexOffset+S.currentCount,d[T]=h,S.currentCount++,h++}var w=new Float32Array(3*a);for(t=0;t<a;t++){var A=3*t;if(S=u[t],n.clone(n.ZERO,ue),S.count>0){for(h=0;h<S.count;h++)n.add(ue,c[d[S.indexOffset+h]],ue);n.equalsEpsilon(n.ZERO,ue,y.EPSILON10)&&n.clone(c[d[S.indexOffset]],ue)}n.equalsEpsilon(n.ZERO,ue,y.EPSILON10)&&(ue.z=1),n.normalize(ue,ue),w[A]=ue.x,w[A+1]=ue.y,w[A+2]=ue.z}return e.attributes.normal=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:w}),e};var pe=new n,fe=new n,me=new n;te.computeTangentAndBitangent=function(e){var t,r=(e.attributes,e.indices),i=e.attributes.position.values,o=e.attributes.normal.values,a=e.attributes.st.values,l=e.attributes.position.values.length/3,u=r.length,c=new Array(3*l);for(t=0;t<c.length;t++)c[t]=0;var d,h,p;for(t=0;t<u;t+=3){var m=r[t],g=r[t+1],_=r[t+2];d=3*m,h=3*g,p=3*_;var v=2*m,y=2*g,b=2*_,C=i[d],S=i[d+1],T=i[d+2],w=a[v],A=a[v+1],E=a[y+1]-A,x=a[b+1]-A,P=1/((a[y]-w)*x-(a[b]-w)*E),I=(x*(i[h]-C)-E*(i[p]-C))*P,D=(x*(i[h+1]-S)-E*(i[p+1]-S))*P,O=(x*(i[h+2]-T)-E*(i[p+2]-T))*P;c[d]+=I,c[d+1]+=D,c[d+2]+=O,c[h]+=I,c[h+1]+=D,c[h+2]+=O,c[p]+=I,c[p+1]+=D,c[p+2]+=O}var M=new Float32Array(3*l),R=new Float32Array(3*l);for(t=0;t<l;t++){d=3*t,h=d+1,p=d+2;var L=n.fromArray(o,d,pe),N=n.fromArray(c,d,me),k=n.dot(L,N);n.multiplyByScalar(L,k,fe),n.normalize(n.subtract(N,fe,N),N),M[d]=N.x,M[h]=N.y,M[p]=N.z,n.normalize(n.cross(L,N,N),N),R[d]=N.x,R[h]=N.y,R[p]=N.z}return e.attributes.tangent=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:M}),e.attributes.bitangent=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e};var ge=new i,_e=new n,ve=new n,ye=new n,be=new i;te.compressVertices=function(t){var r,o,a=t.attributes.extrudeDirection;if(u(a)){var l=a.values;o=l.length/3;var c=new Float32Array(2*o),d=0;for(r=0;r<o;++r)n.fromArray(l,3*r,_e),n.equals(_e,n.ZERO)?d+=2:(be=e.octEncodeInRange(_e,65535,be),c[d++]=be.x,c[d++]=be.y);return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:c}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,p=t.attributes.st,m=u(h),g=u(p);if(!m&&!g)return t;var _,v,y,b,C=t.attributes.tangent,S=t.attributes.bitangent,T=u(C),w=u(S);m&&(_=h.values),g&&(v=p.values),T&&(y=C.values),w&&(b=S.values),o=(m?_.length:v.length)/(m?3:2);var A=o,E=g&&m?2:1;E+=T||w?1:0,A*=E;var x=new Float32Array(A),P=0;for(r=0;r<o;++r){g&&(i.fromArray(v,2*r,ge),x[P++]=e.compressTextureCoordinates(ge));var I=3*r;m&&u(y)&&u(b)?(n.fromArray(_,I,_e),n.fromArray(y,I,ve),n.fromArray(b,I,ye),e.octPack(_e,ve,ye,ge),x[P++]=ge.x,x[P++]=ge.y):(m&&(n.fromArray(_,I,_e),x[P++]=e.octEncodeFloat(_e)),T&&(n.fromArray(y,I,_e),x[P++]=e.octEncodeFloat(_e)),w&&(n.fromArray(b,I,_e),x[P++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:E,values:x}),m&&delete t.attributes.normal,g&&delete t.attributes.st,w&&delete t.attributes.bitangent,T&&delete t.attributes.tangent,t};var Ce=new n,Se=new n,Te=new n,we=new n,Ae=new n,Ee={positions:new Array(7),indices:new Array(9)},xe=new n,Pe=new n,Ie=new n,De=new n,Oe=new i,Me=new i,Re=new i,Le=S.fromPointNormal(n.ZERO,n.UNIT_Y),Ne=new n,ke=new n,Fe=new i,Be=new i,Ue=new n,Ve=new n,ze=new n,Ge=new n,He=new n,We=new n,je=new o,qe=5*y.EPSILON9,Ye=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,i=t.boundingSphere;if(u(i)){if(i.center.x-i.radius>0||r.intersectPlane(i,S.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:K(e);break;case m.LINES:J(e)}else z(t),t.primitiveType===T.TRIANGLES?K(e):t.primitiveType===T.LINES&&J(e);return e},te}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A){"use strict";function E(e,i,o){var a=i.vertexFormat,s=i.center,l=i.semiMajorAxis,c=i.semiMinorAxis,h=i.ellipsoid,m=i.stRotation,g=o?e.length/3*2:e.length/3,_=i.shadowVolume,v=a.st?new Float32Array(2*g):void 0,b=a.normal?new Float32Array(3*g):void 0,C=a.tangent?new Float32Array(3*g):void 0,T=a.bitangent?new Float32Array(3*g):void 0,w=_?new Float32Array(3*g):void 0,A=0,E=z,x=G,P=H,I=new d(h),D=I.project(h.cartesianToCartographic(s,W),j),O=h.scaleToGeodeticSurface(s,L);h.geodeticSurfaceNormal(O,O);for(var M=S.fromAxisAngle(O,m,V),R=y.fromQuaternion(M,U),F=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,q),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),Q=e.length,Z=o?Q:0,K=Z/3*2,J=0;J<Q;J+=3){var $=J+1,ee=J+2,te=r.fromArray(e,J,L);if(a.st){var re=y.multiplyByVector(R,te,N),ie=I.project(h.cartesianToCartographic(re,W),k);r.subtract(ie,D,ie),B.x=(ie.x+l)/(2*l),B.y=(ie.y+c)/(2*c),F.x=Math.min(B.x,F.x),F.y=Math.min(B.y,F.y),X.x=Math.max(B.x,X.x),X.y=Math.max(B.y,X.y),o&&(v[A+K]=B.x,v[A+1+K]=B.y),v[A++]=B.x,v[A++]=B.y}(a.normal||a.tangent||a.bitangent||_)&&(E=h.geodeticSurfaceNormal(te,E),_&&(w[J+Z]=-E.x,w[$+Z]=-E.y,w[ee+Z]=-E.z),(a.normal||a.tangent||a.bitangent)&&((a.tangent||a.bitangent)&&(x=r.normalize(r.cross(r.UNIT_Z,E,x),x),y.multiplyByVector(R,x,x)),a.normal&&(b[J]=E.x,b[$]=E.y,b[ee]=E.z,o&&(b[J+Z]=-E.x,b[$+Z]=-E.y,b[ee+Z]=-E.z)),a.tangent&&(C[J]=x.x,C[$]=x.y,C[ee]=x.z,o&&(C[J+Z]=-x.x,C[$+Z]=-x.y,C[ee+Z]=-x.z)),a.bitangent&&(P=r.normalize(r.cross(E,x,P),P),T[J]=P.x,T[$]=P.y,T[ee]=P.z,o&&(T[J+Z]=P.x,T[$+Z]=P.y,T[ee+Z]=P.z))))}if(a.st){Q=v.length;for(var ne=0;ne<Q;ne+=2)v[ne]=(v[ne]-F.x)/(X.x-F.x),v[ne+1]=(v[ne+1]-F.y)/(X.y-F.y)}var oe=new f;if(a.position){var ae=u.raisePositionsToHeight(e,i,o);oe.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:ae})}return a.st&&(oe.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:v})),a.normal&&(oe.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),a.tangent&&(oe.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),a.bitangent&&(oe.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T})),_&&(oe.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:w})),oe}function x(e){var t,r,i,n,o,a=new Array(e*(e+1)*12-6),s=0;for(t=0,i=1,n=0;n<3;n++)a[s++]=i++,a[s++]=t,a[s++]=i;for(n=2;n<e+1;++n){for(i=n*(n+1)-1,t=(n-1)*n-1,a[s++]=i++,a[s++]=t,a[s++]=i,r=2*n,o=0;o<r-1;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=i++,a[s++]=t,a[s++]=i}for(r=2*e,++i,++t,n=0;n<r-1;++n)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;for(a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t++,a[s++]=t,++t,n=e-1;n>1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=i,r=2*n,o=0;o<r-1;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=t++,a[s++]=t++,a[s++]=i++}for(n=0;n<3;n++)a[s++]=t++,a[s++]=t,a[s++]=i;return a}function P(t){var i=t.center;X=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(i,X),t.height,X),X=r.add(i,X,X);var n=new e(X,t.semiMajorAxis),o=u.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,l=E(a,t,!1),c=x(s);return c=_.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:l,indices:c}}function I(e,i){var o=i.vertexFormat,a=i.center,s=i.semiMajorAxis,l=i.semiMinorAxis,u=i.ellipsoid,c=i.height,h=i.extrudedHeight,m=i.stRotation,g=e.length/3*2,_=new Float64Array(3*g),v=o.st?new Float32Array(2*g):void 0,b=o.normal?new Float32Array(3*g):void 0,C=o.tangent?new Float32Array(3*g):void 0,T=o.bitangent?new Float32Array(3*g):void 0,w=i.shadowVolume,A=w?new Float32Array(3*g):void 0,E=0,x=z,P=G,I=H,D=new d(u),O=D.project(u.cartesianToCartographic(a,W),j),M=u.scaleToGeodeticSurface(a,L);u.geodeticSurfaceNormal(M,M);for(var R=S.fromAxisAngle(M,m,V),X=y.fromQuaternion(R,U),Q=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,q),Z=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),K=e.length,J=K/3*2,$=0;$<K;$+=3){var ee,te=$+1,re=$+2,ie=r.fromArray(e,$,L);if(o.st){var ne=y.multiplyByVector(X,ie,N),oe=D.project(u.cartesianToCartographic(ne,W),k);r.subtract(oe,O,oe),B.x=(oe.x+s)/(2*s),B.y=(oe.y+l)/(2*l),Q.x=Math.min(B.x,Q.x),Q.y=Math.min(B.y,Q.y),Z.x=Math.max(B.x,Z.x),Z.y=Math.max(B.y,Z.y),v[E+J]=B.x,v[E+1+J]=B.y,v[E++]=B.x,v[E++]=B.y}ie=u.scaleToGeodeticSurface(ie,ie),ee=r.clone(ie,N),x=u.geodeticSurfaceNormal(ie,x),w&&(A[$+K]=-x.x,A[te+K]=-x.y,A[re+K]=-x.z);var ae=r.multiplyByScalar(x,c,F);if(ie=r.add(ie,ae,ie),ae=r.multiplyByScalar(x,h,ae),ee=r.add(ee,ae,ee),o.position&&(_[$+K]=ee.x,_[te+K]=ee.y,_[re+K]=ee.z,_[$]=ie.x,_[te]=ie.y,_[re]=ie.z),o.normal||o.tangent||o.bitangent){I=r.clone(x,I);var se=r.fromArray(e,($+3)%K,F);r.subtract(se,ie,se);var le=r.subtract(ee,ie,k);x=r.normalize(r.cross(le,se,x),x),o.normal&&(b[$]=x.x,b[te]=x.y,b[re]=x.z,b[$+K]=x.x,b[te+K]=x.y,b[re+K]=x.z),o.tangent&&(P=r.normalize(r.cross(I,x,P),P),C[$]=P.x,C[te]=P.y,C[re]=P.z,C[$+K]=P.x,C[$+1+K]=P.y,C[$+2+K]=P.z),o.bitangent&&(T[$]=I.x,T[te]=I.y,T[re]=I.z,T[$+K]=I.x,T[te+K]=I.y,T[re+K]=I.z)}}if(o.st){K=v.length;for(var ue=0;ue<K;ue+=2)v[ue]=(v[ue]-Q.x)/(Z.x-Q.x),v[ue+1]=(v[ue+1]-Q.y)/(Z.y-Q.y)}var ce=new f;return o.position&&(ce.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:_})),o.st&&(ce.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:v})),o.normal&&(ce.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),o.tangent&&(ce.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),o.bitangent&&(ce.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T})),w&&(ce.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:A})),ce}function D(e){for(var t=e.length/3,r=_.createTypedArray(t,6*t),i=0,n=0;n<t;n++){var o=n,a=n+t,s=(o+1)%t,l=s+t;r[i++]=o,r[i++]=a,r[i++]=s,r[i++]=s,r[i++]=a,r[i++]=l}return r}function O(t){var i=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,L),t.height,L);Q.center=r.add(i,a,Q.center),Q.radius=o,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,a),t.extrudedHeight,a),Z.center=r.add(i,a,Z.center),Z.radius=o;var s=u.computeEllipsePositions(t,!0,!0),l=s.positions,c=s.numPts,d=s.outerPositions,p=e.union(Q,Z),f=E(l,t,!0),v=x(c),y=v.length;v.length=2*y;for(var b=l.length/3,S=0;S<y;S+=3)v[S+y]=v[S+2]+b,v[S+1+y]=v[S+1]+b,v[S+2+y]=v[S]+b;var T=_.createTypedArray(2*b/3,v),w=new h({attributes:f,indices:T,primitiveType:C.TRIANGLES}),A=I(d,t);v=D(d);var P=_.createTypedArray(2*d.length/3,v),O=new h({attributes:A,indices:P,primitiveType:C.TRIANGLES}),M=g.combineInstances([new m({geometry:w}),new m({geometry:O})]);return{boundingSphere:p,attributes:M[0].attributes,indices:M[0].indices}}function M(e,t,i,n,o){w.eastNorthUpToFixedFrame(e,t,K),b.inverseTransformation(K,J);var a;for(a=0;a<4;++a)r.clone(r.ZERO,ee[a]);for(ee[0].x+=i,ee[1].x-=i,ee[2].y+=n,ee[3].y-=n,y.fromRotationZ(o,$),a=0;a<4;++a)y.multiplyByVector($,ee[a],ee[a]),b.multiplyByPoint(K,ee[a],ee[a]),t.cartesianToCartographic(ee[a],te[a]);return T.fromCartographicArray(te)}function R(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,i=o(e.ellipsoid,c.WGS84),n=e.semiMajorAxis,s=e.semiMinorAxis,l=o(e.granularity,v.RADIANS_PER_DEGREE),u=o(e.height,0),d=e.extrudedHeight,h=a(d)&&Math.abs(u-d)>1,p=o(e.vertexFormat,A.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=c.clone(i),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=u,this._granularity=l,this._vertexFormat=A.clone(p),this._extrudedHeight=o(d,u),this._extrude=h,this._shadowVolume=o(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=M(this._center,this._ellipsoid,n,s,this._rotation)}var L=new r,N=new r,k=new r,F=new r,B=new t,U=new y,V=new S,z=new r,G=new r,H=new r,W=new i,j=new r,q=new t,Y=new t,X=new r,Q=new e,Z=new e,K=new b,J=new b,$=new y,ee=[new r,new r,new r,new r],te=[new i,new i,new i,new i];R.packedLength=r.packedLength+c.packedLength+A.packedLength+T.packedLength+9,R.pack=function(e,t,i){return i=o(i,0),r.pack(e._center,t,i),i+=r.packedLength,c.pack(e._ellipsoid,t,i),i+=c.packedLength,A.pack(e._vertexFormat,t,i),i+=A.packedLength,T.pack(e._rectangle,t,i),i+=T.packedLength,t[i++]=e._semiMajorAxis,t[i++]=e._semiMinorAxis,t[i++]=e._rotation,t[i++]=e._stRotation,t[i++]=e._height,t[i++]=e._granularity,t[i++]=e._extrudedHeight,t[i++]=e._extrude?1:0,t[i]=e._shadowVolume?1:0,t};var re=new r,ie=new c,ne=new A,oe=new T,ae={center:re,ellipsoid:ie,vertexFormat:ne,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return R.unpack=function(e,t,i){t=o(t,0);var n=r.unpack(e,t,re);t+=r.packedLength;var s=c.unpack(e,t,ie);t+=c.packedLength;var l=A.unpack(e,t,ne);t+=A.packedLength;var u=T.unpack(e,t,oe);t+=T.packedLength;var d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t++],g=e[t++],_=e[t++],v=1===e[t++],y=1===e[t];return a(i)?(i._center=r.clone(n,i._center),i._ellipsoid=c.clone(s,i._ellipsoid),i._vertexFormat=A.clone(l,i._vertexFormat),i._semiMajorAxis=d,i._semiMinorAxis=h,i._rotation=p,i._stRotation=f,i._height=m,i._granularity=g,i._extrudedHeight=_,i._extrude=v,i._shadowVolume=y,i._rectangle=T.clone(u),i):(ae.height=m,ae.extrudedHeight=_,ae.granularity=g,ae.stRotation=f,ae.rotation=p,ae.semiMajorAxis=d,ae.semiMinorAxis=h,ae.shadowVolume=y,new R(ae))},R.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={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?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),r.shadowVolume=e._shadowVolume,t=O(r)):t=P(r),new h({attributes:t.attributes,indices:t.indices,primitiveType:C.TRIANGLES,boundingSphere:t.boundingSphere})}},R.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new R({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:A.POSITION_ONLY,shadowVolume:!0})},s(R.prototype,{rectangle:{get:function(){return this._rectangle}}}),R}),define("Core/CircleGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT);var t=e.radius,i={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new o(i),this._workerName="createCircleGeometry"}l.packedLength=o.packedLength,l.pack=function(e,t,r){return o.pack(e._ellipseGeometry,t,r)};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,shadowVolume:void 0};return l.unpack=function(t,r,n){var d=o.unpack(t,r,u);return c.center=e.clone(d._center,c.center),c.ellipsoid=a.clone(d._ellipsoid,c.ellipsoid),c.height=d._height,c.extrudedHeight=d._extrudedHeight,c.granularity=d._granularity,c.vertexFormat=s.clone(d._vertexFormat,c.vertexFormat),c.stRotation=d._stRotation,c.shadowVolume=d._shadowVolume,i(n)?(c.semiMajorAxis=d._semiMajorAxis,c.semiMinorAxis=d._semiMinorAxis,
n._ellipseGeometry=new o(c),n):(c.radius=d._semiMajorAxis,new l(c))},l.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},l.createShadowVolume=function(e,t,r){var i=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(i,n),a=r(i,n);return new l({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:s.POSITION_ONLY,shadowVolume:!0})},n(l.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),l}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(i){var n=i.center;v=t.multiplyByScalar(i.ellipsoid.geodeticSurfaceNormal(n,v),i.height,v),v=t.add(n,v,v);for(var o=new e(v,i.semiMajorAxis),s=a.computeEllipsePositions(i,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,i,!1)})}),h=s.length/3,p=d.createTypedArray(h,2*h),f=0,m=0;m<h;++m)p[f++]=m,p[f++]=(m+1)%h;return{boundingSphere:o,attributes:l,indices:p}}function m(n){var o=n.center,s=n.ellipsoid,l=n.semiMajorAxis,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,_),n.height,_);y.center=t.add(o,p,y.center),y.radius=l,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,p),n.extrudedHeight,p),b.center=t.add(o,p,b.center),b.radius=l;var f=a.computeEllipsePositions(n,!1,!0).outerPositions,m=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(f,n,!0)})});f=m.position.values;var g=e.union(y,b),v=f.length/3,C=i(n.numberOfVerticalLines,16);C=h.clamp(C,0,v/2);var S=d.createTypedArray(v,2*v+2*C);v/=2;var T,w=0;for(T=0;T<v;++T)S[w++]=T,S[w++]=(T+1)%v,S[w++]=T+v,S[w++]=(T+1)%v+v;var A;if(C>0){var E=Math.min(C,v);A=Math.round(v/E);var x=Math.min(A*C,v);for(T=0;T<x;T+=A)S[w++]=T,S[w++]=T+v}return{boundingSphere:g,attributes:m,indices:S}}function g(e){e=i(e,i.EMPTY_OBJECT);var r=e.center,o=i(e.ellipsoid,s.WGS84),a=e.semiMajorAxis,l=e.semiMinorAxis,u=i(e.granularity,h.RADIANS_PER_DEGREE),c=i(e.height,0),d=e.extrudedHeight,p=n(d)&&Math.abs(c-d)>1;this._center=t.clone(r),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=i(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=d,this._extrude=p,this._numberOfVerticalLines=Math.max(i(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var _=new t,v=new t,y=new e,b=new e;g.packedLength=t.packedLength+s.packedLength+9,g.pack=function(e,r,o){return o=i(o,0),t.pack(e._center,r,o),o+=t.packedLength,s.pack(e._ellipsoid,r,o),o+=s.packedLength,r[o++]=e._semiMajorAxis,r[o++]=e._semiMinorAxis,r[o++]=e._rotation,r[o++]=e._height,r[o++]=e._granularity,r[o++]=n(e._extrudedHeight)?1:0,r[o++]=i(e._extrudedHeight,0),r[o++]=e._extrude?1:0,r[o]=e._numberOfVerticalLines,r};var C=new t,S=new s,T={center:C,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return g.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,C);r+=t.packedLength;var l=s.unpack(e,r,S);r+=s.packedLength;var u=e[r++],c=e[r++],d=e[r++],h=e[r++],p=e[r++],f=e[r++],m=e[r++],_=1===e[r++],v=e[r];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=d,o._height=h,o._granularity=p,o._extrudedHeight=f?m:void 0,o._extrude=_,o._numberOfVerticalLines=v,o):(T.height=h,T.extrudedHeight=f?m:void 0,T.granularity=p,T.rotation=d,T.semiMajorAxis=u,T.semiMinorAxis=c,T.numberOfVerticalLines=v,new g(T))},g.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={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?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=m(r)):t=f(r),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})}},g}),define("Core/CircleOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,r,i,n,o){"use strict";function a(e){e=r(e,r.EMPTY_OBJECT);var t=e.radius,i={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new n(i),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,r){return n.pack(e._ellipseGeometry,t,r)};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}),define("Core/Color",["./Check","./defaultValue","./defined","./FeatureDetection","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function s(e,r,i,n){this.red=t(e,1),this.green=t(r,1),this.blue=t(i,1),this.alpha=t(n,1)}s.fromCartesian4=function(e,t){return r(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(e,i,n,o,a){return e=s.byteToFloat(t(e,255)),i=s.byteToFloat(t(i,255)),n=s.byteToFloat(t(n,255)),o=s.byteToFloat(t(o,255)),r(a)?(a.red=e,a.green=i,a.blue=n,a.alpha=o,a):new s(e,i,n,o)},s.fromAlpha=function(e,t,i){return r(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=t,i):new s(e.red,e.green,e.blue,t)};var l,u,c;i.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(e,i,n,o,l){e=t(e,0)%1,i=t(i,0),n=t(n,0),o=t(o,1);var u=n,c=n,d=n;if(0!==i){var h;h=n<.5?n*(1+i):n+i-n*i;var p=2*n-h;u=a(p,h,e+1/3),c=a(p,h,e),d=a(p,h,e-1/3)}return r(l)?(l.red=u,l.green=c,l.blue=d,l.alpha=o,l):new s(u,c,d,o)},s.fromRandom=function(e,i){e=t(e,t.EMPTY_OBJECT);var n=e.red;if(!r(n)){var a=t(e.minimumRed,0),l=t(e.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=e.green;if(!r(u)){var c=t(e.minimumGreen,0),d=t(e.maximumGreen,1);u=c+o.nextRandomNumber()*(d-c)}var h=e.blue;if(!r(h)){var p=t(e.minimumBlue,0),f=t(e.maximumBlue,1);h=p+o.nextRandomNumber()*(f-p)}var m=e.alpha;if(!r(m)){var g=t(e.minimumAlpha,0),_=t(e.maximumAlpha,1);m=g+o.nextRandomNumber()*(_-g)}return r(i)?(i.red=n,i.green=u,i.blue=h,i.alpha=m,i):new s(n,u,h,m)};var d=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,h=/^#([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,f=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(e,i){r(i)||(i=new s);var n=s[e.toUpperCase()];if(r(n))return s.clone(n,i),i;var o=d.exec(e);return null!==o?(i.red=parseInt(o[1],16)/15,i.green=parseInt(o[2],16)/15,i.blue=parseInt(o[3],16)/15,i.alpha=1,i):null!==(o=h.exec(e))?(i.red=parseInt(o[1],16)/255,i.green=parseInt(o[2],16)/255,i.blue=parseInt(o[3],16)/255,i.alpha=1,i):null!==(o=p.exec(e))?(i.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),i.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),i.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),i.alpha=parseFloat(t(o[4],"1.0")),i):null!==(o=f.exec(e))?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0")),i):i=void 0},s.packedLength=4,s.pack=function(e,r,i){return i=t(i,0),r[i++]=e.red,r[i++]=e.green,r[i++]=e.blue,r[i]=e.alpha,r},s.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new s),n.red=e[i++],n.green=e[i++],n.blue=e[i++],n.alpha=e[i],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,t){if(r(e))return r(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha},s.equalsArray=function(e,t,r){return e.red===t[r]&&e.green===t[r+1]&&e.blue===t[r+2]&&e.alpha===t[r+3]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return this===e||r(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},s.prototype.toBytes=function(e){var t=s.floatToByte(this.red),i=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return r(e)?(e[0]=t,e[1]=i,e[2]=n,e[3]=o,e):[t,i,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,r){return r.red=e.red+t.red,r.green=e.green+t.green,r.blue=e.blue+t.blue,r.alpha=e.alpha+t.alpha,r},s.subtract=function(e,t,r){return r.red=e.red-t.red,r.green=e.green-t.green,r.blue=e.blue-t.blue,r.alpha=e.alpha-t.alpha,r},s.multiply=function(e,t,r){return r.red=e.red*t.red,r.green=e.green*t.green,r.blue=e.blue*t.blue,r.alpha=e.alpha*t.alpha,r},s.divide=function(e,t,r){return r.red=e.red/t.red,r.green=e.green/t.green,r.blue=e.blue/t.blue,r.alpha=e.alpha/t.alpha,r},s.mod=function(e,t,r){return r.red=e.red%t.red,r.green=e.green%t.green,r.blue=e.blue%t.blue,r.alpha=e.alpha%t.alpha,r},s.multiplyByScalar=function(e,t,r){return r.red=e.red*t,r.green=e.green*t,r.blue=e.blue*t,r.alpha=e.alpha*t,r},s.divideByScalar=function(e,t,r){return r.red=e.red/t,r.green=e.green/t,r.blue=e.blue/t,r.alpha=e.alpha/t,r},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.FUCHSIA=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}),define("Core/ClippingPlaneCollection",["./Cartesian3","./Cartesian4","./Check","./Color","./defaultValue","./defined","./defineProperties","./DeveloperError","./FeatureDetection","./Intersect","./Matrix4","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(e){e=n(e,n.EMPTY_OBJECT);var t=e.planes;o(t)?this._planes=t.slice(0):this._planes=[],this.enabled=n(e.enabled,!0),this.modelMatrix=c.clone(n(e.modelMatrix,c.IDENTITY)),this.edgeColor=i.clone(n(e.edgeColor,i.WHITE)),this.edgeWidth=n(e.edgeWidth,0),this._testIntersection=void 0,this._unionClippingRegions=void 0,this.unionClippingRegions=n(e.unionClippingRegions,!1)}function p(e){return e===u.OUTSIDE}function f(e){return e===u.INSIDE}function m(e,t){for(var r=e.length,i=0;i<r;++i)if(d.equals(e[i],t))return i;return-1}a(h.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?p:f)}}}),h.prototype.add=function(e){this._planes.push(e)},h.prototype.get=function(e){return this._planes[e]},h.prototype.contains=function(e){return-1!==m(this._planes,e)},h.prototype.remove=function(e){var t=this._planes,r=m(t,e);if(-1===r)return!1;for(var i=t.length-1,n=r;n<i;++n)t[n]=t[n+1];return t.length=i,!0},h.prototype.removeAll=function(){this._planes=[]};var g=new d(e.UNIT_X,0),_=new c;return h.prototype.transformAndPackPlanes=function(r,i){var n=this._planes,a=n.length,s=0;o(i)?(s=i.length,i.length=a):i=new Array(a);var l;for(l=s;l<a;++l)i[l]=new t;var u=c.multiply(r,this.modelMatrix,_);for(l=0;l<a;++l){var h=n[l],p=i[l];d.transform(h,u,g),e.clone(g.normal,p),p.w=g.distance}return i},h.prototype.clone=function(t){o(t)||(t=new h);var r,n=this.length;if(t.length!==n){var a=t._planes,s=a.length;for(a.length=n,r=s;r<n;++r)t._planes[r]=new d(e.UNIT_X,0)}for(r=0;r<n;++r)d.clone(this._planes[r],t._planes[r]);return t.enabled=this.enabled,c.clone(this.modelMatrix,t.modelMatrix),t.unionClippingRegions=this.unionClippingRegions,i.clone(this.edgeColor,t.edgeColor),t.edgeWidth=this.edgeWidth,t},h.prototype.computeIntersectionWithBoundingVolume=function(e,t){var r=this._planes,i=r.length,n=this.modelMatrix;o(t)&&(n=c.multiply(n,t,_));var a=u.INSIDE;!this.unionClippingRegions&&i>0&&(a=u.OUTSIDE);for(var s=0;s<i;++s){var l=r[s];d.transform(l,n,g);var h=e.intersectPlane(g);if(h===u.INTERSECTING)a=h;else if(this._testIntersection(h))return h}return a},h.isSupported=function(){return!l.isInternetExplorer()},h.MAX_CLIPPING_PLANES=6,h}),define("Core/ClockRange",["./freezeObject"],function(e){"use strict";return e({UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2})}),define("Core/ClockStep",["./freezeObject"],function(e){"use strict";return e({TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2})}),define("Core/getTimestamp",["./defined"],function(e){"use strict";return"undefined"!=typeof performance&&"function"==typeof performance.now&&isFinite(performance.now())?function(){return performance.now()}:function(){return Date.now()}}),define("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(n){n=r(n,r.EMPTY_OBJECT);var o=n.currentTime,u=n.startTime,c=n.stopTime;o=i(o)?l.clone(o):i(u)?l.clone(u):i(c)?l.addDays(c,-1,new l):l.now(),u=i(u)?l.clone(u):l.clone(o),c=i(c)?l.clone(c):l.addDays(u,1,new l),this.startTime=u,this.stopTime=c,this.clockRange=r(n.clockRange,e.UNBOUNDED),this.canAnimate=r(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=r(n.multiplier,1),this.shouldAnimate=r(n.shouldAnimate,!1),this.clockStep=r(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER)}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 r=s(),i=l.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var n=this._clockStep;if(n===t.SYSTEM_CLOCK)i=l.now(i);else{var o=this._multiplier;if(n===t.TICK_DEPENDENT)i=l.addSeconds(i,o,i);else{var a=r-this._lastSystemTime;i=l.addSeconds(i,o*(a/1e3),i)}var u=this.clockRange,c=this.startTime,d=this.stopTime;if(u===e.CLAMPED)l.lessThan(i,c)?i=l.clone(c,i):l.greaterThan(i,d)&&(i=l.clone(d,i));else if(u===e.LOOP_STOP)for(l.lessThan(i,c)&&(i=l.clone(c,i));l.greaterThan(i,d);)i=l.addSeconds(c,l.secondsDifference(i,d),i)}}return this._currentTime=i,this._lastSystemTime=r,this.onTick.raiseEvent(this),i},u}),define("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n,o){"use strict";function a(t,i,n,o){t=r(t,1),i=r(i,1),n=r(n,1),o=r(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(i),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 i(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||i(e)&&i(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}),define("Core/CompressedTextureBuffer",["./defined","./defineProperties"],function(e,t){"use strict";function r(e,t,r,i){this._format=e,this._width=t,this._height=r,this._buffer=i}return t(r.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),r.clone=function(t){if(e(t))return new r(t._format,t._width,t._height,t._buffer)},r.prototype.clone=function(){return r.clone(this)},r}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";return e({ROUNDED:0,MITERED:1,BEVELED:2})}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,n=(r-i)/r,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),d=l*a,h=d*d,p=1-h,f=Math.sqrt(p),m=t/4,g=m*m,_=g*m,v=g*g,y=1+m-3*g/4+5*_/4-175*v/64,b=1-m+15*g/8-35*_/8,C=1-3*m+35*g/4,S=1-5*m,T=y*c-b*Math.sin(2*c)*m/2-C*Math.sin(4*c)*g/16-S*Math.sin(6*c)*_/48-5*Math.sin(8*c)*v/512,w=e._constants;w.a=r,w.b=i,w.f=n,w.cosineHeading=o,w.sineHeading=a,w.tanU=s,w.cosineU=l,w.sineU=u,w.sigma=c,w.sineAlpha=d,w.sineSquaredAlpha=h,w.cosineSquaredAlpha=p,w.cosineAlpha=f,w.u2Over4=m,w.u4Over16=g,w.u6Over64=_,w.u8Over256=v,w.a0=y,w.a1=b,w.a2=C,w.a3=S,w.distanceRatio=T}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,r,i,n,o,a){var s=u(e,r);return(1-s)*e*t*(i+s*n*(a+s*o*(2*a*a-1)))}function d(e,t,r,i,n,o,a){var l,u,d,h,p,f=(t-r)/t,m=o-i,g=Math.atan((1-f)*Math.tan(n)),_=Math.atan((1-f)*Math.tan(a)),v=Math.cos(g),y=Math.sin(g),b=Math.cos(_),C=Math.sin(_),S=v*b,T=v*C,w=y*C,A=y*b,E=m,x=s.TWO_PI,P=Math.cos(E),I=Math.sin(E);do{P=Math.cos(E),I=Math.sin(E);var D=T-A*P;d=Math.sqrt(b*b*I*I+D*D),u=w+S*P,l=Math.atan2(d,u);var O;0===d?(O=0,h=1):(O=S*I/d,h=1-O*O),x=E,p=u-2*w/h,isNaN(p)&&(p=0),E=m+c(f,O,h,l,d,u,p)}while(Math.abs(E-x)>s.EPSILON12);var M=h*(t*t-r*r)/(r*r),R=1+M*(4096+M*(M*(320-175*M)-768))/16384,L=M*(256+M*(M*(74-47*M)-128))/1024,N=p*p,k=L*d*(p+L*(u*(2*N-1)-L*p*(4*d*d-3)*(4*N-3)/6)/4),F=r*R*(l-k),B=Math.atan2(b*I,T-A*P),U=Math.atan2(v*I,T*P-A);e._distance=F,e._startHeading=B,e._endHeading=U,e._uSquared=M}function h(r,i,n,o){e.normalize(o.cartographicToCartesian(i,m),f),e.normalize(o.cartographicToCartesian(n,m),m);d(r,o.maximumRadius,o.minimumRadius,i.longitude,i.latitude,n.longitude,n.latitude),r._start=t.clone(i,r._start),r._end=t.clone(n,r._end),r._start.height=0,r._end.height=0,l(r)}function p(e,r,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,n(e)&&n(r)&&h(this,e,r,s)}var f=new e,m=new e;return o(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){h(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,r){var i=this._constants,o=i.distanceRatio+e/i.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),d=Math.sin(4*o),h=Math.sin(6*o),p=Math.sin(8*o),f=o*o,m=o*f,g=i.u8Over256,_=i.u2Over4,v=i.u6Over64,y=i.u4Over16,b=2*m*g*a/3+o*(1-_+7*y/4-15*v/4+579*g/64-(y-15*v/4+187*g/16)*a-(5*v/4-115*g/16)*s-29*g*l/16)+(_/2-y+71*v/32-85*g/16)*u+(5*y/16-5*v/4+383*g/96)*d-f*((v-11*g/2)*u+5*g*d/2)+(29*v/96-29*g/16)*h+539*g*p/1536,C=Math.asin(Math.sin(b)*i.cosineAlpha),S=Math.atan(i.a/i.b*Math.tan(C));b-=i.sigma;var T=Math.cos(2*i.sigma+b),w=Math.sin(b),A=Math.cos(b),E=i.cosineU*A,x=i.sineU*w,P=Math.atan2(w*i.sineHeading,E-x*i.cosineHeading),I=P-c(i.f,i.sineAlpha,i.cosineSquaredAlpha,b,w,A,T);return n(r)?(r.longitude=this._start.longitude+I,r.latitude=S,r.height=0,r):new t(this._start.longitude+I,S,0)},p}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(e,t,r){var i=w;i.length=e;var n;if(t===r){for(n=0;n<e;n++)i[n]=t;return i}var o=r-t,a=o/e;for(n=0;n<e;n++){var s=t+n*a;i[n]=s}return i}function p(t,r,i,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,P),c=n.scaleToGeodeticSurface(r,I),d=f.numberOfPoints(t,r,i),p=n.cartesianToCartographic(u,A),m=n.cartesianToCartographic(c,E),g=h(d,o,a);D.setEndPoints(p,m);var _=D.surfaceDistance/d,v=l;p.height=o;var y=n.cartographicToCartesian(p,x);e.pack(y,s,v),v+=3;for(var b=1;b<d;b++){var C=D.interpolateUsingSurfaceDistance(b*_,E);C.height=g[b],y=n.cartographicToCartesian(C,x),e.pack(y,s,v),v+=3}return v}var f={};f.numberOfPoints=function(t,r,i){var n=e.distance(t,r);return Math.ceil(n/i)};var m=new t;f.extractHeights=function(e,t){for(var r=e.length,i=new Array(r),n=0;n<r;n++){var o=e[n];i[n]=t.cartesianToCartographic(o,m).height}return i};var g=new c,_=new e,v=new e,y=new d(e.UNIT_X,0),b=new e,C=new d(e.UNIT_X,0),S=new e,T=new e,w=[],A=new t,E=new t,x=new e,P=new e,I=new e,D=new a;return f.wrapLongitude=function(t,n){var o=[],a=[];if(i(t)&&t.length>0){n=r(n,c.IDENTITY);var l=c.inverseTransformation(n,g),u=c.multiplyByPoint(l,e.ZERO,_),h=e.normalize(c.multiplyByPointAsVector(l,e.UNIT_Y,v),v),p=d.fromPointNormal(u,h,y),f=e.normalize(c.multiplyByPointAsVector(l,e.UNIT_X,b),b),m=d.fromPointNormal(u,f,C),w=1;o.push(e.clone(t[0]));for(var A=o[0],E=t.length,x=1;x<E;++x){var P=t[x];if(d.getPointDistance(m,A)<0||d.getPointDistance(m,P)<0){var I=s.lineSegmentPlane(A,P,p,S);if(i(I)){var D=e.multiplyByScalar(h,5e-9,T);d.getPointDistance(p,A)<0&&e.negate(D,D),o.push(e.add(I,D,new e)),a.push(w+1),e.negate(D,D),o.push(e.add(I,D,new e)),w=1}}o.push(e.clone(t[x])),w++,A=P}a.push(w)}return{positions:o,lengths:a}},f.generateArc=function(t){i(t)||(t={});var n=t.positions,a=n.length,s=r(t.ellipsoid,o.WGS84),c=r(t.height,0),d=l(c);if(a<1)return[];if(1===a){var h=s.scaleToGeodeticSurface(n[0],P);if(0!==(c=d?c[0]:c)){var m=s.geodeticSurfaceNormal(h,x);e.multiplyByScalar(m,c,m),e.add(h,m,h)}return[h.x,h.y,h.z]}var g=t.minDistance;if(!i(g)){var _=r(t.granularity,u.RADIANS_PER_DEGREE);g=u.chordLength(_,s.maximumRadius)}var v,y=0;for(v=0;v<a-1;v++)y+=f.numberOfPoints(n[v],n[v+1],g);var b=3*(y+1),C=new Array(b),S=0;for(v=0;v<a-1;v++){S=p(n[v],n[v+1],g,s,d?c[v]:c,d?c[v+1]:c,C,S)}w.length=0;var T=n[a-1],E=s.cartesianToCartographic(T,A);E.height=d?c[a-1]:c;var I=s.cartographicToCartesian(E,x);return e.pack(I,C,b-3),C},f.generateCartesianArc=function(t){for(var r=f.generateArc(t),i=r.length/3,n=new Array(i),o=0;o<i;o++)n[o]=e.unpack(r,3*o);return n},f}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(e,t){for(var r=new Array(e.length),i=0;i<e.length;i++){var n=e[i];R=t.cartesianToCartographic(n,R),r[i]=R.height,e[i]=t.scaleToGeodeticSurface(n,n)}return r}function p(e,r,i,n){
var o,a=e[0],s=e[1],l=t.angleBetween(a,s),u=Math.ceil(l/n),c=new Array(u);if(r===i){for(o=0;o<u;o++)c[o]=r;return c.push(i),c}var d=i-r,h=d/u;for(o=1;o<u;o++){var p=r+o*h;c[o]=p}return c[0]=r,c.push(i),c}function f(r,i,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,r,L),L),u=s.projectPointOntoPlane(t.add(n,i,N),N),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function m(e,r,i,n,o,a,u,c){var h=z,p=G;F=d.eastNorthUpToFixedFrame(e,o,F),h=l.multiplyByPointAsVector(F,k,h),h=t.normalize(h,h);var m=f(h,r,e,o);U=s.fromRotationZ(m,U),H.z=a,F=l.multiplyTransformation(F,l.fromRotationTranslation(U,H,B),F);var g=V;g[0]=u;for(var _=0;_<c;_++)for(var v=0;v<i.length;v+=3)p=t.fromArray(i,v,p),p=s.multiplyByVector(g,p,p),p=l.multiplyByPoint(F,p,p),n.push(p.x,p.y,p.z);return n}function g(e,r,i,n,o,a,s){for(var l=0;l<e.length;l+=3){n=m(t.fromArray(e,l,W),r,i,n,o,a[l/3],s,1)}return n}function _(e,t){var r=e.length,i=new Array(6*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a;for(var l=1;l<r;l++){s=e[l];var u=s.x-o,c=s.y-a;i[n++]=u,i[n++]=0,i[n++]=c,i[n++]=u,i[n++]=0,i[n++]=c}return s=e[0],i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a,i}function v(e,t){for(var r=e.length,i=new Array(3*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;s<r;s++)i[n++]=e[s].x-o,i[n++]=0,i[n++]=e[s].y-a;return i}function y(e,r,i,o,l,u,d,h,p,f){var g,_=t.angleBetween(t.subtract(r,e,D),t.subtract(i,e,O)),v=o===n.BEVELED?0:Math.ceil(_/a.toRadians(5));g=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,D),_/(v+1),j),Y):s.fromQuaternion(c.fromAxisAngle(e,_/(v+1),j),Y);var y,b;if(r=t.clone(r,q),v>0)for(var C=f?2:1,S=0;S<v;S++)r=s.multiplyByVector(g,r,r),y=t.subtract(r,e,D),y=t.normalize(y,y),l||(y=t.negate(y,y)),b=u.scaleToGeodeticSurface(r,O),d=m(b,y,h,d,u,p,1,C);else y=t.subtract(r,e,D),y=t.normalize(y,y),l||(y=t.negate(y,y)),b=u.scaleToGeodeticSurface(r,O),d=m(b,y,h,d,u,p,1,1),i=t.clone(i,q),y=t.subtract(i,e,D),y=t.normalize(y,y),l||(y=t.negate(y,y)),b=u.scaleToGeodeticSurface(i,O),d=m(b,y,h,d,u,p,1,1);return d}var b=[new t,new t],C=new t,S=new t,T=new t,w=new t,A=new t,E=new t,x=new t,P=new t,I=new t,D=new t,O=new t,M={},R=new i,L=new t,N=new t,k=new t(-1,0,0),F=new l,B=new l,U=new s,V=s.IDENTITY.clone(),z=new t,G=new r,H=new t,W=new t,j=new c,q=new t,Y=new s;M.removeDuplicatesFromShape=function(t){for(var r=t.length,i=[],n=r-1,o=0;o<r;n=o++){var a=t[n],s=t[o];e.equals(a,s)||i.push(s)}return i},M.angleIsGreaterThanPi=function(e,r,i,n){var a=new o(i,n),s=a.projectPointOntoPlane(t.add(i,e,L),L),l=a.projectPointOntoPlane(t.add(i,r,N),N);return l.x*s.y-l.y*s.x>=0};var X=new t,Q=new t;return M.computePositions=function(e,r,i,o,s){var l=o._ellipsoid,c=h(e,l),d=o._granularity,f=o._cornerType,O=s?_(r,i):v(r,i),R=s?v(r,i):void 0,L=i.height/2,N=i.width/2,k=e.length,F=[],B=s?[]:void 0,U=C,V=S,z=T,G=w,H=A,W=E,j=x,q=P,Y=I,Z=e[0],K=e[1];G=l.geodeticSurfaceNormal(Z,G),U=t.subtract(K,Z,U),U=t.normalize(U,U),q=t.cross(G,U,q),q=t.normalize(q,q);var J=c[0],$=c[1];s&&(B=m(Z,q,R,B,l,J+L,1,1)),Y=t.clone(Z,Y),Z=K,V=t.negate(U,V);for(var ee,te,re=1;re<k-1;re++){var ie=s?2:1;K=e[re+1],U=t.subtract(K,Z,U),U=t.normalize(U,U),z=t.add(U,V,z),z=t.normalize(z,z),G=l.geodeticSurfaceNormal(Z,G);var ne=t.multiplyByScalar(G,t.dot(U,G),X);t.subtract(U,ne,ne),t.normalize(ne,ne);var oe=t.multiplyByScalar(G,t.dot(V,G),Q);t.subtract(V,oe,oe),t.normalize(oe,oe);if(!a.equalsEpsilon(Math.abs(t.dot(ne,oe)),1,a.EPSILON7)){z=t.cross(z,G,z),z=t.cross(G,z,z),z=t.normalize(z,z);var ae=1/Math.max(.25,t.magnitude(t.cross(z,V,D))),se=M.angleIsGreaterThanPi(U,V,Z,l);se?(H=t.add(Z,t.multiplyByScalar(z,ae*N,z),H),W=t.add(H,t.multiplyByScalar(q,N,W),W),b[0]=t.clone(Y,b[0]),b[1]=t.clone(W,b[1]),ee=p(b,J+L,$+L,d),te=u.generateArc({positions:b,granularity:d,ellipsoid:l}),F=g(te,q,O,F,l,ee,1),q=t.cross(G,U,q),q=t.normalize(q,q),j=t.add(H,t.multiplyByScalar(q,N,j),j),f===n.ROUNDED||f===n.BEVELED?y(H,W,j,f,se,l,F,O,$+L,s):(z=t.negate(z,z),F=m(Z,z,O,F,l,$+L,ae,ie)),Y=t.clone(j,Y)):(H=t.add(Z,t.multiplyByScalar(z,ae*N,z),H),W=t.add(H,t.multiplyByScalar(q,-N,W),W),b[0]=t.clone(Y,b[0]),b[1]=t.clone(W,b[1]),ee=p(b,J+L,$+L,d),te=u.generateArc({positions:b,granularity:d,ellipsoid:l}),F=g(te,q,O,F,l,ee,1),q=t.cross(G,U,q),q=t.normalize(q,q),j=t.add(H,t.multiplyByScalar(q,-N,j),j),f===n.ROUNDED||f===n.BEVELED?y(H,W,j,f,se,l,F,O,$+L,s):F=m(Z,z,O,F,l,$+L,ae,ie),Y=t.clone(j,Y)),V=t.negate(U,V)}else F=m(Y,q,O,F,l,J+L,1,1),Y=Z;J=$,$=c[re+1],Z=K}b[0]=t.clone(Y,b[0]),b[1]=t.clone(Z,b[1]),ee=p(b,J+L,$+L,d),te=u.generateArc({positions:b,granularity:d,ellipsoid:l}),F=g(te,q,O,F,l,ee,1),s&&(B=m(Z,q,R,B,l,$+L,1,1)),k=F.length;var le=s?k+B.length:k,ue=new Float64Array(le);return ue.set(F),s&&ue.set(B,k),ue},M}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,r,i,n,o,a,s){"use strict";function l(r,o,a,l,u){var c=e.angleBetween(e.subtract(o,r,p),e.subtract(a,r,f)),d=l===t.BEVELED?1:Math.ceil(c/i.toRadians(5))+1,h=3*d,m=new Array(h);m[h-3]=a.x,m[h-2]=a.y,m[h-1]=a.z;var g;g=u?n.fromQuaternion(s.fromAxisAngle(e.negate(r,p),c/d,P),I):n.fromQuaternion(s.fromAxisAngle(r,c/d,P),I);var _=0;o=e.clone(o,p);for(var v=0;v<d;v++)o=n.multiplyByVector(g,o,o),m[_++]=o.x,m[_++]=o.y,m[_++]=o.z;return m}function u(r){var i=v,n=y,o=b,a=r[1];n=e.fromArray(r[1],a.length-3,n),o=e.fromArray(r[0],0,o),i=e.multiplyByScalar(e.add(n,o,i),.5,i);var s=l(i,n,o,t.ROUNDED,!1),u=r.length-1,c=r[u-1];return a=r[u],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),i=e.multiplyByScalar(e.add(n,o,i),.5,i),[s,l(i,n,o,t.ROUNDED,!1)]}function c(t,r,i,n){var o=p;return n?o=e.add(t,r,o):(r=e.negate(r,r),o=e.add(t,r,o)),[o.x,o.y,o.z,i.x,i.y,i.z]}function d(t,r,i,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(r,i,p),l=e.negate(s,f),u=0,c=t.length-1,d=0;d<t.length;d+=3){var h=e.fromArray(t,d,m),_=e.add(h,l,g);o[u++]=_.x,o[u++]=_.y,o[u++]=_.z;var v=e.add(h,s,g);a[c--]=v.z,a[c--]=v.y,a[c--]=v.x}return n.push(o,a),n}var h={},p=new e,f=new e,m=new e,g=new e,_=[new e,new e],v=new e,y=new e,b=new e,C=new e,S=new e,T=new e,w=new e,A=new e,E=new e,x=new e,P=new s,I=new n;h.addAttribute=function(e,t,i,n){var o=t.x,a=t.y,s=t.z;r(i)&&(e[i]=o,e[i+1]=a,e[i+2]=s),r(n)&&(e[n]=s,e[n-1]=a,e[n-2]=o)};var D=new e,O=new e;return h.computePositions=function(r){var n=r.granularity,s=r.positions,h=r.ellipsoid,f=r.width/2,m=r.cornerType,g=r.saveAttributes,P=v,I=y,M=b,R=C,L=S,N=T,k=w,F=A,B=E,U=x,V=[],z=g?[]:void 0,G=g?[]:void 0,H=s[0],W=s[1];I=e.normalize(e.subtract(W,H,I),I),P=h.geodeticSurfaceNormal(H,P),R=e.normalize(e.cross(P,I,R),R),g&&(z.push(R.x,R.y,R.z),G.push(P.x,P.y,P.z)),k=e.clone(H,k),H=W,M=e.negate(I,M);var j,q,Y=[],X=s.length;for(q=1;q<X-1;q++){P=h.geodeticSurfaceNormal(H,P),W=s[q+1],I=e.normalize(e.subtract(W,H,I),I),L=e.normalize(e.add(I,M,L),L);var Q=e.multiplyByScalar(P,e.dot(I,P),D);e.subtract(I,Q,Q),e.normalize(Q,Q);var Z=e.multiplyByScalar(P,e.dot(M,P),O);e.subtract(M,Z,Z),e.normalize(Z,Z);if(!i.equalsEpsilon(Math.abs(e.dot(Q,Z)),1,i.EPSILON7)){L=e.cross(L,P,L),L=e.cross(P,L,L),L=e.normalize(L,L);var K=f/Math.max(.25,e.magnitude(e.cross(L,M,p))),J=a.angleIsGreaterThanPi(I,M,H,h);L=e.multiplyByScalar(L,K,L),J?(F=e.add(H,L,F),U=e.add(F,e.multiplyByScalar(R,f,U),U),B=e.add(F,e.multiplyByScalar(R,2*f,B),B),_[0]=e.clone(k,_[0]),_[1]=e.clone(U,_[1]),j=o.generateArc({positions:_,granularity:n,ellipsoid:h}),V=d(j,R,f,V),g&&(z.push(R.x,R.y,R.z),G.push(P.x,P.y,P.z)),N=e.clone(B,N),R=e.normalize(e.cross(P,I,R),R),B=e.add(F,e.multiplyByScalar(R,2*f,B),B),k=e.add(F,e.multiplyByScalar(R,f,k),k),m===t.ROUNDED||m===t.BEVELED?Y.push({leftPositions:l(F,N,B,m,J)}):Y.push({leftPositions:c(H,e.negate(L,L),B,J)})):(B=e.add(H,L,B),U=e.add(B,e.negate(e.multiplyByScalar(R,f,U),U),U),F=e.add(B,e.negate(e.multiplyByScalar(R,2*f,F),F),F),_[0]=e.clone(k,_[0]),_[1]=e.clone(U,_[1]),j=o.generateArc({positions:_,granularity:n,ellipsoid:h}),V=d(j,R,f,V),g&&(z.push(R.x,R.y,R.z),G.push(P.x,P.y,P.z)),N=e.clone(F,N),R=e.normalize(e.cross(P,I,R),R),F=e.add(B,e.negate(e.multiplyByScalar(R,2*f,F),F),F),k=e.add(B,e.negate(e.multiplyByScalar(R,f,k),k),k),m===t.ROUNDED||m===t.BEVELED?Y.push({rightPositions:l(B,N,F,m,J)}):Y.push({rightPositions:c(H,L,F,J)})),M=e.negate(I,M)}H=W}P=h.geodeticSurfaceNormal(H,P),_[0]=e.clone(k,_[0]),_[1]=e.clone(H,_[1]),j=o.generateArc({positions:_,granularity:n,ellipsoid:h}),V=d(j,R,f,V),g&&(z.push(R.x,R.y,R.z),G.push(P.x,P.y,P.z));var $;return m===t.ROUNDED&&($=u(V)),{positions:V,corners:Y,lefts:z,normals:G,endPositions:$}},h}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,r,n){n=n||2;var o=r&&r.length,a=o?r[0]*n:e.length,s=t(e,0,a,n,!0),u=[];if(!s)return u;var c,d,h,p,f,m,g;if(o&&(s=l(e,r,s,n)),e.length>80*n){c=h=e[0],d=p=e[1];for(var _=n;_<a;_+=n)f=e[_],m=e[_+1],f<c&&(c=f),m<d&&(d=m),f>h&&(h=f),m>p&&(p=m);g=Math.max(h-c,p-d)}return i(s,u,n,c,d,g),u}function t(e,t,r,i,n){var o,a;if(n===P(e,t,r,i)>0)for(o=t;o<r;o+=i)a=A(o,e[o],e[o+1],a);else for(o=r-i;o>=t;o-=i)a=A(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(E(a),a=a.next),a}function r(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!y(i,i.next)&&0!==v(i.prev,i,i.next))i=i.next;else{if(E(i),(i=t=i.prev)===i.next)return null;r=!0}}while(r||i!==t);return t}function i(e,t,l,u,c,d,p){if(e){!p&&d&&h(e,u,c,d);for(var f,m,g=e;e.prev!==e.next;)if(f=e.prev,m=e.next,d?o(e,u,c,d):n(e))t.push(f.i/l),t.push(e.i/l),t.push(m.i/l),E(e),e=m.next,g=m.next;else if((e=m)===g){p?1===p?(e=a(e,t,l),i(e,t,l,u,c,d,2)):2===p&&s(e,t,l,u,c,d):i(r(e),t,l,u,c,d,1);break}}}function n(e){var t=e.prev,r=e,i=e.next;if(v(t,r,i)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(g(t.x,t.y,r.x,r.y,i.x,i.y,n.x,n.y)&&v(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(e,t,r,i){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,d=f(s,l,t,r,i),h=f(u,c,t,r,i),p=e.nextZ;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(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>=d;){if(p!==e.prev&&p!==e.next&&g(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,r){var i=e;do{var n=i.prev,o=i.next.next;!y(n,o)&&b(n,i,i.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),E(i),E(i.next),i=e=o),i=i.next}while(i!==e);return i}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&&_(l,u)){var c=w(l,u);return l=r(l,l.next),c=r(c,c.next),i(l,t,n,o,a,s),void i(c,t,n,o,a,s)}u=u.next}l=l.next}while(l!==e)}function l(e,i,n,o){var a,s,l,d,h,p=[];for(a=0,s=i.length;a<s;a++)l=i[a]*o,d=a<s-1?i[a+1]*o:e.length,h=t(e,l,d,o,!1),h===h.next&&(h.steiner=!0),p.push(m(h));for(p.sort(u),a=0;a<p.length;a++)c(p[a],n),n=r(n,n.next);return n}function u(e,t){return e.x-t.x}function c(e,t){if(t=d(e,t)){var i=w(t,e);r(i,i.next)}}function d(e,t){var r,i=t,n=e.x,o=e.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a){if(a=s,s===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!r)return null;if(n===a)return r.prev;var l,u=r,c=r.x,d=r.y,h=1/0;for(i=r.next;i!==u;)n>=i.x&&i.x>=c&&g(o<d?n:a,o,c,d,o<d?a:n,o,i.x,i.y)&&((l=Math.abs(o-i.y)/(n-i.x))<h||l===h&&i.x>r.x)&&S(i,e)&&(r=i,h=l),i=i.next;return r}function h(e,t,r,i){var n=e;do{null===n.z&&(n.z=f(n.x,n.y,t,r,i)),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,r,i,n,o,a,s,l,u=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,i=r,s=0,t=0;t<u&&(s++,i=i.nextZ);t++);for(l=u;s>0||l>0&&i;)0===s?(n=i,i=i.nextZ,l--):0!==l&&i?r.z<=i.z?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--):(n=r,r=r.nextZ,s--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(a>1);return e}function f(e,t,r,i,n){return e=32767*(e-r)/n,t=32767*(t-i)/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 m(e){var t=e,r=e;do{t.x<r.x&&(r=t),t=t.next}while(t!==e);return r}function g(e,t,r,i,n,o,a,s){return(n-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(i-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(n-a)*(i-s)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!C(e,t)&&S(e,t)&&S(t,e)&&T(e,t)}function v(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,r,i){return!!(y(e,t)&&y(r,i)||y(e,i)&&y(r,t))||v(e,t,r)>0!=v(e,t,i)>0&&v(r,i,e)>0!=v(r,i,t)>0}function C(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&b(r,r.next,e,t))return!0;r=r.next}while(r!==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 T(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}function w(e,t){var r=new x(e.i,e.x,e.y),i=new x(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function A(e,t,r,i){var n=new x(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function E(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 x(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(e,t,r,i){for(var n=0,o=t,a=r-i;o<r;o+=i)n+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return n}return e.deviation=function(e,t,r,i){var n=t&&t.length,o=n?t[0]*r:e.length,a=Math.abs(P(e,0,o,r));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs(P(e,u,c,r))}var d=0;for(s=0;s<i.length;s+=3){var h=i[s]*r,p=i[s+1]*r,f=i[s+2]*r;d+=Math.abs((e[h]-e[f])*(e[p+1]-e[h+1])-(e[h]-e[p])*(e[f+1]-e[h+1]))}return 0===a&&0===d?0:Math.abs((d-a)/a)},e.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[n][o][a]);n>0&&(i+=e[n-1].length,r.holes.push(i))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";var p=new r,f=new r,m={};m.computeArea2D=function(e){for(var t=e.length,r=0,i=t-1,n=0;n<t;i=n++){var o=e[i],a=e[n];r+=o.x*a.y-a.x*o.y}return.5*r},m.computeWindingOrder2D=function(e){return m.computeArea2D(e)>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(r,i){var n=t.packArray(r);return e(n,i,2)};var g=new r,_=new r,v=new r,y=new r,b=new r,C=new r,S=new r;return m.computeSubdivision=function(e,t,i,s){s=o(s,c.RADIANS_PER_DEGREE);var h,p=i.slice(0),f=t.length,m=new Array(3*f),T=0;for(h=0;h<f;h++){var w=t[h];m[T++]=w.x,m[T++]=w.y,m[T++]=w.z}for(var A=[],E={},x=e.maximumRadius,P=c.chordLength(s,x),I=P*P;p.length>0;){var D,O,M=p.pop(),R=p.pop(),L=p.pop(),N=r.fromArray(m,3*L,g),k=r.fromArray(m,3*R,_),F=r.fromArray(m,3*M,v),B=r.multiplyByScalar(r.normalize(N,y),x,y),U=r.multiplyByScalar(r.normalize(k,b),x,b),V=r.multiplyByScalar(r.normalize(F,C),x,C),z=r.magnitudeSquared(r.subtract(B,U,S)),G=r.magnitudeSquared(r.subtract(U,V,S)),H=r.magnitudeSquared(r.subtract(V,B,S)),W=Math.max(z,G,H);W>I?z===W?(D=Math.min(L,R)+" "+Math.max(L,R),h=E[D],a(h)||(O=r.add(N,k,S),r.multiplyByScalar(O,.5,O),m.push(O.x,O.y,O.z),h=m.length/3-1,E[D]=h),p.push(L,h,M),p.push(h,R,M)):G===W?(D=Math.min(R,M)+" "+Math.max(R,M),h=E[D],a(h)||(O=r.add(k,F,S),r.multiplyByScalar(O,.5,O),m.push(O.x,O.y,O.z),h=m.length/3-1,E[D]=h),p.push(R,h,L),p.push(h,M,L)):H===W&&(D=Math.min(M,L)+" "+Math.max(M,L),h=E[D],a(h)||(O=r.add(F,N,S),r.multiplyByScalar(O,.5,O),m.push(O.x,O.y,O.z),h=m.length/3-1,E[D]=h),p.push(M,h,R),p.push(h,L,R)):(A.push(L),A.push(R),A.push(M))}return new l({attributes:{position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:m})},indices:A,primitiveType:d.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,i,n){i=o(i,s.WGS84);var l=p,u=f;if(t=o(t,0),n=o(n,!0),a(e))for(var c=e.length,d=0;d<c;d+=3)r.fromArray(e,d,u),n&&(u=i.scaleToGeodeticSurface(u,u)),0!==t&&(l=i.geodeticSurfaceNormal(u,l),r.multiplyByScalar(l,t,l),r.add(u,l,u)),e[d]=u.x,e[d+1]=u.y,e[d+2]=u.z;return e},m}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b){"use strict";function C(e,t){for(var r=0;r<e.length;r++)e[r]=t.scaleToGeodeticSurface(e[r],e[r]);return e}function S(e,t,i,n,o,s){var l=e.normals,u=e.tangents,c=e.bitangents,d=r.normalize(r.cross(i,t,k),k);s.normal&&a.addAttribute(l,t,n,o),s.tangent&&a.addAttribute(u,d,n,o),s.bitangent&&a.addAttribute(c,i,n,o)}function T(e,t,i){var o,s,u,c=e.positions,d=e.corners,h=e.endPositions,_=e.lefts,v=e.normals,y=new f,b=0,C=0,T=0;for(s=0;s<c.length;s+=2)u=c[s].length-3,b+=u,T+=2*u,C+=c[s+1].length-3;for(b+=3,C+=3,s=0;s<d.length;s++){o=d[s];var w=d[s].leftPositions;l(w)?(u=w.length,b+=u,T+=u):(u=d[s].rightPositions.length,C+=u,T+=u)}var A,E=l(h);E&&(A=h[0].length-3,b+=A,C+=A,A/=3,T+=6*A);var x,P,I,L,B,U,V=b+C,z=new Float64Array(V),G=t.normal?new Float32Array(V):void 0,H=t.tangent?new Float32Array(V):void 0,W=t.bitangent?new Float32Array(V):void 0,j={normals:G,tangents:H,bitangents:W},q=0,Y=V-1,X=D,Q=O,Z=A/2,K=m.createTypedArray(V/3,T),J=0;if(E){U=M,B=R;var $=h[0];for(X=r.fromArray(v,0,X),Q=r.fromArray(_,0,Q),s=0;s<Z;s++)U=r.fromArray($,3*(Z-1-s),U),B=r.fromArray($,3*(Z+s),B),a.addAttribute(z,B,q),a.addAttribute(z,U,void 0,Y),S(j,X,Q,q,Y,t),P=q/3,L=P+1,x=(Y-2)/3,I=x-1,K[J++]=x,K[J++]=P,K[J++]=I,K[J++]=I,K[J++]=P,K[J++]=L,q+=3,Y-=3}var ee=0,te=0,re=c[ee++],ie=c[ee++];z.set(re,q),z.set(ie,Y-ie.length+1),Q=r.fromArray(_,te,Q);var ne,oe;for(u=ie.length-3,s=0;s<u;s+=3)ne=i.geodeticSurfaceNormal(r.fromArray(re,s,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(ie,u-s,F),F),X=r.normalize(r.add(ne,oe,X),X),S(j,X,Q,q,Y,t),P=q/3,L=P+1,x=(Y-2)/3,I=x-1,K[J++]=x,K[J++]=P,K[J++]=I,K[J++]=I,K[J++]=P,K[J++]=L,q+=3,Y-=3;for(ne=i.geodeticSurfaceNormal(r.fromArray(re,u,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(ie,u,F),F),X=r.normalize(r.add(ne,oe,X),X),te+=3,s=0;s<d.length;s++){var ae;o=d[s];var se,le,ue=o.leftPositions,ce=o.rightPositions,de=N,he=M,pe=R;if(X=r.fromArray(v,te,X),l(ue)){for(S(j,X,Q,void 0,Y,t),Y-=3,se=L,le=I,ae=0;ae<ue.length/3;ae++)de=r.fromArray(ue,3*ae,de),K[J++]=se,K[J++]=le-ae-1,K[J++]=le-ae,a.addAttribute(z,de,void 0,Y),he=r.fromArray(z,3*(le-ae-1),he),pe=r.fromArray(z,3*se,pe),Q=r.normalize(r.subtract(he,pe,Q),Q),S(j,X,Q,void 0,Y,t),Y-=3;de=r.fromArray(z,3*se,de),he=r.subtract(r.fromArray(z,3*le,he),de,he),pe=r.subtract(r.fromArray(z,3*(le-ae),pe),de,pe),Q=r.normalize(r.add(he,pe,Q),Q),S(j,X,Q,q,void 0,t),q+=3}else{for(S(j,X,Q,q,void 0,t),q+=3,se=I,le=L,ae=0;ae<ce.length/3;ae++)de=r.fromArray(ce,3*ae,de),K[J++]=se,K[J++]=le+ae,K[J++]=le+ae+1,a.addAttribute(z,de,q),he=r.fromArray(z,3*se,he),pe=r.fromArray(z,3*(le+ae),pe),Q=r.normalize(r.subtract(he,pe,Q),Q),S(j,X,Q,q,void 0,t),q+=3;de=r.fromArray(z,3*se,de),he=r.subtract(r.fromArray(z,3*(le+ae),he),de,he),pe=r.subtract(r.fromArray(z,3*le,pe),de,pe),Q=r.normalize(r.negate(r.add(pe,he,Q),Q),Q),S(j,X,Q,void 0,Y,t),Y-=3}for(re=c[ee++],ie=c[ee++],re.splice(0,3),ie.splice(ie.length-3,3),z.set(re,q),z.set(ie,Y-ie.length+1),u=ie.length-3,te+=3,Q=r.fromArray(_,te,Q),ae=0;ae<ie.length;ae+=3)ne=i.geodeticSurfaceNormal(r.fromArray(re,ae,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(ie,u-ae,F),F),X=r.normalize(r.add(ne,oe,X),X),S(j,X,Q,q,Y,t),L=q/3,P=L-1,I=(Y-2)/3,x=I+1,K[J++]=x,K[J++]=P,K[J++]=I,K[J++]=I,K[J++]=P,K[J++]=L,q+=3,Y-=3;q-=3,Y+=3}if(X=r.fromArray(v,v.length-3,X),S(j,X,Q,q,Y,t),E){q+=3,Y-=3,U=M,B=R;var fe=h[1];for(s=0;s<Z;s++)U=r.fromArray(fe,3*(A-s-1),U),B=r.fromArray(fe,3*s,B),a.addAttribute(z,U,void 0,Y),a.addAttribute(z,B,q),S(j,X,Q,q,Y,t),L=q/3,P=L-1,I=(Y-2)/3,x=I+1,K[J++]=x,K[J++]=P,K[J++]=I,K[J++]=I,K[J++]=P,K[J++]=L,q+=3,Y-=3}if(y.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:z}),t.st){var me,ge,_e=new Float32Array(V/3*2),ve=0;if(E){b/=3,C/=3;var ye=Math.PI/(A+1);ge=1/(b-A+1),me=1/(C-A+1);var be,Ce=A/2;for(s=Ce+1;s<A+1;s++)be=g.PI_OVER_TWO+ye*s,_e[ve++]=me*(1+Math.cos(be)),_e[ve++]=.5*(1+Math.sin(be));for(s=1;s<C-A+1;s++)_e[ve++]=s*me,_e[ve++]=0;for(s=A;s>Ce;s--)be=g.PI_OVER_TWO-s*ye,_e[ve++]=1-me*(1+Math.cos(be)),_e[ve++]=.5*(1+Math.sin(be));for(s=Ce;s>0;s--)be=g.PI_OVER_TWO-ye*s,_e[ve++]=1-ge*(1+Math.cos(be)),_e[ve++]=.5*(1+Math.sin(be));for(s=b-A;s>0;s--)_e[ve++]=s*ge,_e[ve++]=1;for(s=1;s<Ce+1;s++)be=g.PI_OVER_TWO+ye*s,_e[ve++]=ge*(1+Math.cos(be)),_e[ve++]=.5*(1+Math.sin(be))}else{for(b/=3,C/=3,ge=1/(b-1),me=1/(C-1),s=0;s<C;s++)_e[ve++]=s*me,_e[ve++]=0;for(s=b;s>0;s--)_e[ve++]=(s-1)*ge,_e[ve++]=1}y.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:_e})}return t.normal&&(y.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.normals})),t.tangent&&(y.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.tangents})),t.bitangent&&(y.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.bitangents})),{attributes:y,indices:K}}function w(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var i,n,o=e.position.values;(t.normal||t.bitangent)&&(i=e.normal.values,n=e.bitangent.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,d=2*u;if(t.normal||t.bitangent||t.tangent){var h=t.normal?new Float32Array(6*u):void 0,p=t.tangent?new Float32Array(6*u):void 0,f=t.bitangent?new Float32Array(6*u):void 0,m=D,g=O,_=M,v=R,y=L,b=N,C=d;for(s=0;s<u;s+=3){var S=C+d;m=r.fromArray(o,s,m),g=r.fromArray(o,s+u,g),_=r.fromArray(o,(s+3)%u,_),g=r.subtract(g,m,g),_=r.subtract(_,m,_),v=r.normalize(r.cross(g,_,v),v),t.normal&&(a.addAttribute(h,v,S),a.addAttribute(h,v,S+3),a.addAttribute(h,v,C),a.addAttribute(h,v,C+3)),(t.tangent||t.bitangent)&&(b=r.fromArray(i,s,b),t.bitangent&&(a.addAttribute(f,b,S),a.addAttribute(f,b,S+3),a.addAttribute(f,b,C),a.addAttribute(f,b,C+3)),t.tangent&&(y=r.normalize(r.cross(b,v,y),y),a.addAttribute(p,y,S),a.addAttribute(p,y,S+3),a.addAttribute(p,y,C),a.addAttribute(p,y,C+3))),C+=6}if(t.normal){for(h.set(i),s=0;s<u;s+=3)h[s+u]=-i[s],h[s+u+1]=-i[s+1],h[s+u+2]=-i[s+2];e.normal.values=h}else e.normal=void 0;if(t.bitangent?(f.set(n),f.set(n,u),e.bitangent.values=f):e.bitangent=void 0,t.tangent){var T=e.tangent.values;p.set(T),p.set(T,u),e.tangent.values=p}}if(t.st){var w=e.st.values,A=new Float32Array(6*c);A.set(w),A.set(w,c);for(var E=2*c,x=0;x<2;x++){for(A[E++]=w[0],A[E++]=w[1],s=2;s<c;s+=2){var P=w[s],I=w[s+1];A[E++]=P,A[E++]=I,A[E++]=P,A[E++]=I}A[E++]=w[0],A[E++]=w[1]}e.st.values=A}return e}function A(e,t,r){r[t++]=e[0],r[t++]=e[1],r[t++]=e[2];for(var i=3;i<e.length;i+=3){var n=e[i],o=e[i+1],a=e[i+2];r[t++]=n,r[t++]=o,r[t++]=a,r[t++]=n,r[t++]=o,r[t++]=a}return r[t++]=e[0],r[t++]=e[1],r[t++]=e[2],r}function E(e,t){var r=new b({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=a.computePositions(e),s=T(o,r,i),l=e.height,u=e.extrudedHeight,c=s.attributes,d=s.indices,h=c.position.values,f=h.length,g=new Float64Array(6*f),v=new Float64Array(f);v.set(h);var y=new Float64Array(4*f);h=_.scaleToGeodeticHeight(h,l,i),y=A(h,0,y),v=_.scaleToGeodeticHeight(v,u,i),y=A(v,2*f,y),g.set(h),g.set(v,f),g.set(y,2*f),c.position.values=g,c=w(c,t);var C,S=f/3;if(e.shadowVolume){var E=c.normal.values;f=E.length;var x=new Float32Array(6*f);for(C=0;C<f;C++)E[C]=-E[C];x.set(E,f),x=A(E,4*f,x),c.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:x}),t.normal||(c.normal=void 0)}var P=d.length,I=S+S,D=m.createTypedArray(g.length/3,2*P+3*I);D.set(d);var O=P;for(C=0;C<P;C+=3){var M=d[C],R=d[C+1],L=d[C+2];D[O++]=L+S,D[O++]=R+S,D[O++]=M+S}var N,k,F,B;for(C=0;C<I;C+=2)N=C+I,k=N+I,F=N+1,B=k+1,D[O++]=N,D[O++]=k,D[O++]=F,D[O++]=F,D[O++]=k,D[O++]=B;return{attributes:c,indices:D}}function x(e,t,i,n,o,a){var s=r.subtract(t,e,B);r.normalize(s,s);var l=i.geodeticSurfaceNormal(e,U),u=r.cross(s,l,B);r.multiplyByScalar(u,n,u);var c=o.latitude,d=o.longitude,h=a.latitude,p=a.longitude;r.add(e,u,U),i.cartesianToCartographic(U,V);var f=V.latitude,m=V.longitude;c=Math.min(c,f),d=Math.min(d,m),h=Math.max(h,f),p=Math.max(p,m),r.subtract(e,u,U),i.cartesianToCartographic(U,V),f=V.latitude,m=V.longitude,c=Math.min(c,f),d=Math.min(d,m),h=Math.max(h,f),p=Math.max(p,m),o.latitude=c,o.longitude=d,a.latitude=h,a.longitude=p}function P(t,i,n,a){t=C(t,i);var s=e(t,r.equalsEpsilon),l=s.length;if(l<2||n<=0)return new y;var u=.5*n;H.latitude=Number.POSITIVE_INFINITY,H.longitude=Number.POSITIVE_INFINITY,W.latitude=Number.NEGATIVE_INFINITY,W.longitude=Number.NEGATIVE_INFINITY;var c,d;if(a===o.ROUNDED){var h=s[0];r.subtract(h,s[1],z),r.normalize(z,z),r.multiplyByScalar(z,u,z),r.add(h,z,G),i.cartesianToCartographic(G,V),c=V.latitude,d=V.longitude,H.latitude=Math.min(H.latitude,c),H.longitude=Math.min(H.longitude,d),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,d)}for(var p=0;p<l-1;++p)x(s[p],s[p+1],i,u,H,W);var f=s[l-1];r.subtract(f,s[l-2],z),r.normalize(z,z),r.multiplyByScalar(z,u,z),r.add(f,z,G),x(f,G,i,u,H,W),a===o.ROUNDED&&(i.cartesianToCartographic(G,V),c=V.latitude,d=V.longitude,H.latitude=Math.min(H.latitude,c),H.longitude=Math.min(H.longitude,d),W.latitude=Math.max(W.latitude,c),W.longitude=Math.max(W.longitude,d));var m=new y;return m.north=W.latitude,m.south=H.latitude,m.east=W.longitude,m.west=H.longitude,m}function I(e){e=s(e,s.EMPTY_OBJECT);var t=e.positions,i=e.width;this._positions=t,this._ellipsoid=d.clone(s(e.ellipsoid,d.WGS84)),this._vertexFormat=b.clone(s(e.vertexFormat,b.DEFAULT)),this._width=i,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,g.RADIANS_PER_DEGREE),this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._rectangle=P(t,this._ellipsoid,i,this._cornerType),this.packedLength=1+t.length*r.packedLength+d.packedLength+b.packedLength+y.packedLength+6}var D=new r,O=new r,M=new r,R=new r,L=new r,N=new r,k=new r,F=new r,B=new r,U=new r,V=new i,z=new r,G=new r,H=new i,W=new i;I.pack=function(e,t,i){i=s(i,0);var n=e._positions,o=n.length;t[i++]=o;for(var a=0;a<o;++a,i+=r.packedLength)r.pack(n[a],t,i);return d.pack(e._ellipsoid,t,i),i+=d.packedLength,b.pack(e._vertexFormat,t,i),i+=b.packedLength,y.pack(e._rectangle,t,i),i+=y.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i++]=e._granularity,t[i]=e._shadowVolume?1:0,t};var j=d.clone(d.UNIT_SPHERE),q=new b,Y=new y,X={positions:void 0,ellipsoid:j,vertexFormat:q,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0};return I.unpack=function(e,t,i){t=s(t,0);for(var n=e[t++],o=new Array(n),a=0;a<n;++a,t+=r.packedLength)o[a]=r.unpack(e,t);var u=d.unpack(e,t,j);t+=d.packedLength;var c=b.unpack(e,t,q);t+=b.packedLength;var h=y.unpack(e,t,Y);t+=y.packedLength;var p=e[t++],f=e[t++],m=e[t++],g=e[t++],_=e[t++],v=1===e[t];return l(i)?(i._positions=o,i._ellipsoid=d.clone(u,i._ellipsoid),i._vertexFormat=b.clone(c,i._vertexFormat),i._width=p,i._height=f,i._extrudedHeight=m,i._cornerType=g,i._granularity=_,i._rectangle=y.clone(h),i._shadowVolume=v,i):(X.positions=o,X.width=p,X.height=f,X.extrudedHeight=m,X.cornerType=g,X.granularity=_,X.shadowVolume=v,new I(X))},I.createGeometry=function(i){var n=i._positions,o=i._height,s=i._width,l=i._extrudedHeight,u=o!==l,c=i._ellipsoid;n=C(n,c);var d=e(n,r.equalsEpsilon);if(!(d.length<2||s<=0)){var p,f=i._vertexFormat,m={ellipsoid:c,positions:d,width:s,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!0};if(u){var g=Math.max(o,l);l=Math.min(o,l),o=g,m.height=o,m.extrudedHeight=l,m.shadowVolume=i._shadowVolume,p=E(m,f)}else{p=T(a.computePositions(m),f,c),p.attributes.position.values=_.scaleToGeodeticHeight(p.attributes.position.values,o,c)}var y=p.attributes,b=t.fromVertices(y.position.values,void 0,3);return f.position||(p.attributes.position.values=void 0),new h({attributes:y,indices:p.indices,primitiveType:v.TRIANGLES,boundingSphere:b})}},I.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new I({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:i,extrudedHeight:o,height:a,vertexFormat:b.POSITION_ONLY,shadowVolume:!0})},u(I.prototype,{rectangle:{get:function(){return this._rectangle}}}),I}),define("Core/CorridorOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(e,t){for(var r=0;r<e.length;r++)e[r]=t.scaleToGeodeticSurface(e[r],e[r]);return e}function v(e,t){var i,s,u,c=[],f=e.positions,m=e.corners,g=e.endPositions,_=new h,v=0,y=0,b=0;for(s=0;s<f.length;s+=2)u=f[s].length-3,v+=u,b+=u/3*4,y+=f[s+1].length-3;for(v+=3,y+=3,s=0;s<m.length;s++){i=m[s];var w=m[s].leftPositions;l(w)?(u=w.length,v+=u,b+=u/3*2):(u=m[s].rightPositions.length,y+=u,b+=u/3*2)}var A,E=l(g);E&&(A=g[0].length-3,v+=A,y+=A,A/=3,b+=4*A);var x,P,I,D,O,M,R=v+y,L=new Float64Array(R),N=0,k=R-1,F=A/2,B=p.createTypedArray(R/3,b+4),U=0;if(B[U++]=N/3,B[U++]=(k-2)/3,E){c.push(N/3),M=C,O=S;var V=g[0];for(s=0;s<F;s++)M=r.fromArray(V,3*(F-1-s),M),O=r.fromArray(V,3*(F+s),O),a.addAttribute(L,O,N),a.addAttribute(L,M,void 0,k),P=N/3,D=P+1,x=(k-2)/3,I=x-1,B[U++]=x,B[U++]=I,B[U++]=P,B[U++]=D,N+=3,k-=3}var z=0,G=f[z++],H=f[z++];for(L.set(G,N),L.set(H,k-H.length+1),u=H.length-3,c.push(N/3,(k-2)/3),s=0;s<u;s+=3)P=N/3,D=P+1,x=(k-2)/3,I=x-1,B[U++]=x,B[U++]=I,B[U++]=P,B[U++]=D,N+=3,k-=3;for(s=0;s<m.length;s++){var W;i=m[s];var j,q=i.leftPositions,Y=i.rightPositions,X=T;if(l(q)){for(k-=3,j=I,c.push(D),W=0;W<q.length/3;W++)X=r.fromArray(q,3*W,X),B[U++]=j-W-1,B[U++]=j-W,a.addAttribute(L,X,void 0,k),k-=3;c.push(j-Math.floor(q.length/6)),t===o.BEVELED&&c.push((k-2)/3+1),N+=3}else{for(N+=3,j=D,c.push(I),W=0;W<Y.length/3;W++)X=r.fromArray(Y,3*W,X),B[U++]=j+W,B[U++]=j+W+1,a.addAttribute(L,X,N),N+=3;c.push(j+Math.floor(Y.length/6)),t===o.BEVELED&&c.push(N/3-1),k-=3}for(G=f[z++],H=f[z++],G.splice(0,3),H.splice(H.length-3,3),L.set(G,N),L.set(H,k-H.length+1),u=H.length-3,W=0;W<H.length;W+=3)D=N/3,P=D-1,I=(k-2)/3,x=I+1,B[U++]=x,B[U++]=I,B[U++]=P,B[U++]=D,N+=3,k-=3;N-=3,k+=3,c.push(N/3,(k-2)/3)}if(E){N+=3,k-=3,M=C,O=S;var Q=g[1];for(s=0;s<F;s++)M=r.fromArray(Q,3*(A-s-1),M),O=r.fromArray(Q,3*s,O),a.addAttribute(L,M,void 0,k),a.addAttribute(L,O,N),D=N/3,P=D-1,I=(k-2)/3,x=I+1,B[U++]=x,B[U++]=I,B[U++]=P,B[U++]=D,N+=3,k-=3;c.push(N/3)}else c.push(N/3,(k-2)/3);return B[U++]=N/3,B[U++]=(k-2)/3,_.position=new d({componentDatatype:n.DOUBLE,
componentsPerAttribute:3,values:L}),{attributes:_,indices:B,wallIndices:c}}function y(e){var t=e.ellipsoid,r=a.computePositions(e),i=v(r,e.cornerType),n=i.wallIndices,o=e.height,s=e.extrudedHeight,l=i.attributes,u=i.indices,c=l.position.values,d=c.length,h=new Float64Array(d);h.set(c);var f=new Float64Array(2*d);c=m.scaleToGeodeticHeight(c,o,t),h=m.scaleToGeodeticHeight(h,s,t),f.set(c),f.set(h,d),l.position.values=f,d/=3;var g,_=u.length,y=p.createTypedArray(f.length/3,2*(_+n.length));y.set(u);var b=_;for(g=0;g<_;g+=2){var C=u[g],S=u[g+1];y[b++]=C+d,y[b++]=S+d}var T,w;for(g=0;g<n.length;g++)T=n[g],w=T+d,y[b++]=T,y[b++]=w;return{attributes:l,indices:y}}function b(e){e=s(e,s.EMPTY_OBJECT);var t=e.positions,i=e.width;this._positions=t,this._ellipsoid=u.clone(s(e.ellipsoid,u.WGS84)),this._width=i,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,f.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*r.packedLength+u.packedLength+5}var C=new r,S=new r,T=new r;b.pack=function(e,t,i){i=s(i,0);var n=e._positions,o=n.length;t[i++]=o;for(var a=0;a<o;++a,i+=r.packedLength)r.pack(n[a],t,i);return u.pack(e._ellipsoid,t,i),i+=u.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i]=e._granularity,t};var w=u.clone(u.UNIT_SPHERE),A={positions:void 0,ellipsoid:w,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return b.unpack=function(e,t,i){t=s(t,0);for(var n=e[t++],o=new Array(n),a=0;a<n;++a,t+=r.packedLength)o[a]=r.unpack(e,t);var c=u.unpack(e,t,w);t+=u.packedLength;var d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t];return l(i)?(i._positions=o,i._ellipsoid=u.clone(c,i._ellipsoid),i._width=d,i._height=h,i._extrudedHeight=p,i._cornerType=f,i._granularity=m,i):(A.positions=o,A.width=d,A.height=h,A.extrudedHeight=p,A.cornerType=f,A.granularity=m,new b(A))},b.createGeometry=function(i){var n=i._positions,o=i._height,s=i._width,l=i._extrudedHeight,u=o!==l,d=i._ellipsoid;n=_(n,d);var h=e(n,r.equalsEpsilon);if(!(h.length<2||s<=0)){var p,f={ellipsoid:d,positions:h,width:s,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!1};if(u){var b=Math.max(o,l);l=Math.min(o,l),o=b,f.height=o,f.extrudedHeight=l,p=y(f)}else{p=v(a.computePositions(f),f.cornerType),p.attributes.position.values=m.scaleToGeodeticHeight(p.attributes.position.values,o,d)}var C=p.attributes,S=t.fromVertices(C.position.values,void 0,3);return new c({attributes:C,indices:p.indices,primitiveType:g.LINES,boundingSphere:S})}},b}),define("Core/createGuid",[],function(){"use strict";function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}return e}),define("Core/Ion",["./Resource"],function(e){"use strict";var t={};return t.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0NDViM2NkNi0xYTE2LTRlZTUtODBlNy05M2Q4ODg4M2NmMTQiLCJpZCI6MjU5LCJpYXQiOjE1MTgxOTc4MDh9.sld5jPORDf_lWavMEsugh6vHPnjR6j3qd1aBkQTswNM",t.defaultServer=new e({url:"https://api.cesium.com/"}),t}),define("Core/IonResource",["./Check","./Credit","./defaultValue","./defined","./defineProperties","./Ion","./Resource","./RuntimeError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t){var r,n=e.externalType;if(i(n)){if("3DTILES"!==n&&"STK_TERRAIN_SERVER"!==n)throw new s("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");r={url:e.options.url}}else r={url:e.url,retryAttempts:1,queryParameters:{access_token:e.accessToken},retryCallback:c};a.call(this,r),this._ionEndpoint=e,this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0}function c(e,t){var n=r(e._ionRoot,e),o=n._ionEndpointResource;return i(t)&&(401===t.statusCode||t.target instanceof Image)?(i(n._pendingPromise)||(n._pendingPromise=o.fetchJson().then(function(e){return n._ionEndpoint=e,n.queryParameters.access_token=e.accessToken,e}).always(function(e){return n._pendingPromise=void 0,e})),n._pendingPromise.then(function(t){return e._ionEndpoint=t,e.queryParameters.access_token=t.accessToken,!0})):l.resolve(!1)}return i(Object.create)&&(u.prototype=Object.create(a.prototype),u.prototype.constructor=u),u.fromAssetId=function(e,t){var r=u._createEndpointResource(e,t);return r.fetchJson().then(function(e){return new u(e,r)})},n(u.prototype,{credits:{get:function(){return i(this._ionRoot)?this._ionRoot.credits:i(this._credits)?this._credits:(this._credits=this._ionEndpoint.attributions.map(function(e){return new t({text:e.text,link:e.url,imageUrl:e.image,showOnScreen:i(e.collapsible)&&!e.collapsible})}),this._credits)}}}),u.prototype.clone=function(e){var t=r(this._ionRoot,this);return i(e)||(e=new u(t._ionEndpoint,t._ionEndpointResource)),e=a.prototype.clone.call(this,e),e._ionRoot=t,i(t.queryParameters.access_token)&&(e.queryParameters.access_token=t.queryParameters.access_token),e},u._createEndpointResource=function(e,t){t=r(t,r.EMPTY_OBJECT);var n=r(t.server,o.defaultServer),s=r(t.accessToken,o.defaultAccessToken);n=a.createIfNeeded(n);var l={url:"v1/assets/"+e+"/endpoint"};return i(s)&&(l.queryParameters={access_token:s}),n.getDerivedResource(l)},u}),define("Core/createWorldTerrain",["./CesiumTerrainProvider","./defaultValue","./IonResource"],function(e,t,r){"use strict";function i(i){return i=t(i,t.EMPTY_OBJECT),new e({url:r.fromAssetId(1),requestVertexNormals:t(i.requestVertexNormals,!1),requestWaterMask:t(i.requestWaterMask,!1)})}return i}),define("Core/CullingVolume",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./DeveloperError","./Intersect","./Plane"],function(e,t,r,i,n,o,a){"use strict";function s(e){this.planes=r(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,d=new a(new e(1,0,0),0);return s.fromBoundingSphere=function(r,n){i(n)||(n=new s);var o=l.length,a=n.planes;a.length=2*o;for(var d=r.center,h=r.radius,p=0,f=0;f<o;++f){var m=l[f],g=a[p],_=a[p+1];i(g)||(g=a[p]=new t),i(_)||(_=a[p+1]=new t),e.multiplyByScalar(m,-h,u),e.add(d,u,u),g.x=m.x,g.y=m.y,g.z=m.z,g.w=-e.dot(m,u),e.multiplyByScalar(m,h,u),e.add(d,u,u),_.x=-m.x,_.y=-m.y,_.z=-m.z,_.w=-e.dot(e.negate(m,c),u),p+=2}return n},s.prototype.computeVisibility=function(e){for(var t=this.planes,r=!1,i=0,n=t.length;i<n;++i){var s=e.intersectPlane(a.fromCartesian4(t[i],d));if(s===o.OUTSIDE)return o.OUTSIDE;s===o.INTERSECTING&&(r=!0)}return r?o.INTERSECTING:o.INSIDE},s.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===s.MASK_OUTSIDE||t===s.MASK_INSIDE)return t;for(var r=s.MASK_INSIDE,i=this.planes,n=0,l=i.length;n<l;++n){var u=n<31?1<<n:0;if(!(n<31&&0==(t&u))){var c=e.intersectPlane(a.fromCartesian4(i[n],d));if(c===o.OUTSIDE)return s.MASK_OUTSIDE;c===o.INTERSECTING&&(r|=u)}}return r},s.MASK_OUTSIDE=4294967295,s.MASK_INSIDE=0,s.MASK_INDETERMINATE=2147483647,s}),define("Core/CylinderGeometryLibrary",["./Math"],function(e){"use strict";var t={};return t.computePositions=function(t,r,i,n,o){var a,s=.5*t,l=-s,u=n+n,c=o?2*u:u,d=new Float64Array(3*c),h=0,p=0,f=o?3*u:0,m=o?3*(u+n):3*n;for(a=0;a<n;a++){var g=a/n*e.TWO_PI,_=Math.cos(g),v=Math.sin(g),y=_*i,b=v*i,C=_*r,S=v*r;d[p+f]=y,d[p+f+1]=b,d[p+f+2]=l,d[p+m]=C,d[p+m+1]=S,d[p+m+2]=s,p+=3,o&&(d[h++]=y,d[h++]=b,d[h++]=l,d[h++]=C,d[h++]=S,d[h++]=s)}return d},t}),define("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=o(e.vertexFormat,f.DEFAULT),a=o(e.slices,128);this._length=t,this._topRadius=r,this._bottomRadius=i,this._vertexFormat=f.clone(n),this._slices=a,this._workerName="createCylinderGeometry"}var g=new t,_=new r,v=new r,y=new r,b=new r;m.packedLength=f.packedLength+4,m.pack=function(e,t,r){return r=o(r,0),f.pack(e._vertexFormat,t,r),r+=f.packedLength,t[r++]=e._length,t[r++]=e._topRadius,t[r++]=e._bottomRadius,t[r]=e._slices,t};var C=new f,S={vertexFormat:C,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};m.unpack=function(e,t,r){t=o(t,0);var i=f.unpack(e,t,C);t+=f.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(r)?(r._vertexFormat=f.clone(i,r._vertexFormat),r._length=n,r._topRadius=s,r._bottomRadius=l,r._slices=u,r):(S.length=n,S.topRadius=s,S.bottomRadius=l,S.slices=u,new m(S))},m.createGeometry=function(o){var a=o._length,s=o._topRadius,f=o._bottomRadius,m=o._vertexFormat,C=o._slices;if(!(a<=0||s<0||f<0||0===s&&0===f)){var S,T=C+C,w=C+T,A=T+T,E=n.computePositions(a,s,f,C,!0),x=m.st?new Float32Array(2*A):void 0,P=m.normal?new Float32Array(3*A):void 0,I=m.tangent?new Float32Array(3*A):void 0,D=m.bitangent?new Float32Array(3*A):void 0,O=m.normal||m.tangent||m.bitangent;if(O){var M=m.tangent||m.bitangent,R=0,L=0,N=0,k=_;k.z=0;var F=y,B=v;for(S=0;S<C;S++){var U=S/C*h.TWO_PI,V=Math.cos(U),z=Math.sin(U);O&&(k.x=V,k.y=z,M&&(F=r.normalize(r.cross(r.UNIT_Z,k,F),F)),m.normal&&(P[R++]=V,P[R++]=z,P[R++]=0,P[R++]=V,P[R++]=z,P[R++]=0),m.tangent&&(I[L++]=F.x,I[L++]=F.y,I[L++]=F.z,I[L++]=F.x,I[L++]=F.y,I[L++]=F.z),m.bitangent&&(B=r.normalize(r.cross(k,F,B),B),D[N++]=B.x,D[N++]=B.y,D[N++]=B.z,D[N++]=B.x,D[N++]=B.y,D[N++]=B.z))}for(S=0;S<C;S++)m.normal&&(P[R++]=0,P[R++]=0,P[R++]=-1),m.tangent&&(I[L++]=1,I[L++]=0,I[L++]=0),m.bitangent&&(D[N++]=0,D[N++]=-1,D[N++]=0);for(S=0;S<C;S++)m.normal&&(P[R++]=0,P[R++]=0,P[R++]=1),m.tangent&&(I[L++]=1,I[L++]=0,I[L++]=0),m.bitangent&&(D[N++]=0,D[N++]=1,D[N++]=0)}var G=12*C-12,H=d.createTypedArray(A,G),W=0,j=0;for(S=0;S<C-1;S++)H[W++]=j,H[W++]=j+2,H[W++]=j+3,H[W++]=j,H[W++]=j+3,H[W++]=j+1,j+=2;for(H[W++]=T-2,H[W++]=0,H[W++]=1,H[W++]=T-2,H[W++]=1,H[W++]=T-1,S=1;S<C-1;S++)H[W++]=T+S+1,H[W++]=T+S,H[W++]=T;for(S=1;S<C-1;S++)H[W++]=w,H[W++]=w+S,H[W++]=w+S+1;var q=0;if(m.st){var Y=Math.max(s,f);for(S=0;S<A;S++){var X=r.fromArray(E,3*S,b);x[q++]=(X.x+Y)/(2*Y),x[q++]=(X.y+Y)/(2*Y)}}var Q=new c;m.position&&(Q.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:E})),m.normal&&(Q.normal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:P})),m.tangent&&(Q.tangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:I})),m.bitangent&&(Q.bitangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:D})),m.st&&(Q.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:x})),g.x=.5*a,g.y=Math.max(f,s);var Z=new e(r.ZERO,t.magnitude(g));return new l({attributes:Q,indices:H,primitiveType:p.TRIANGLES,boundingSphere:Z})}};var T;return m.getUnitCylinder=function(){return a(T)||(T=m.createGeometry(new m({topRadius:1,bottomRadius:1,length:1,vertexFormat:f.POSITION_ONLY}))),T},m}),define("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Check","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){e=a(e,a.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=a(e.slices,128),o=Math.max(a(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=r,this._bottomRadius=i,this._slices=n,this._numberOfVerticalLines=o,this._workerName="createCylinderOutlineGeometry"}var f=new t;p.packedLength=5,p.pack=function(e,t,r){return r=a(r,0),t[r++]=e._length,t[r++]=e._topRadius,t[r++]=e._bottomRadius,t[r++]=e._slices,t[r]=e._numberOfVerticalLines,t};var m={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return p.unpack=function(e,t,r){t=a(t,0);var i=e[t++],n=e[t++],o=e[t++],l=e[t++],u=e[t];return s(r)?(r._length=i,r._topRadius=n,r._bottomRadius=o,r._slices=l,r._numberOfVerticalLines=u,r):(m.length=i,m.topRadius=n,m.bottomRadius=o,m.slices=l,m.numberOfVerticalLines=u,new p(m))},p.createGeometry=function(i){var a=i._length,s=i._topRadius,p=i._bottomRadius,m=i._slices,g=i._numberOfVerticalLines;if(!(a<=0||s<0||p<0||0===s&&0===p)){var _,v=2*m,y=o.computePositions(a,s,p,m,!1),b=2*m;if(g>0){var C=Math.min(g,m);_=Math.round(m/C),b+=C}var S,T=d.createTypedArray(v,2*b),w=0;for(S=0;S<m-1;S++)T[w++]=S,T[w++]=S+1,T[w++]=S+m,T[w++]=S+1+m;if(T[w++]=m-1,T[w++]=0,T[w++]=m+m-1,T[w++]=m,g>0)for(S=0;S<m;S+=_)T[w++]=S,T[w++]=S+m;var A=new c;A.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y}),f.x=.5*a,f.y=Math.max(p,s);var E=new e(r.ZERO,t.magnitude(f));return new l({attributes:A,indices:T,primitiveType:h.LINES,boundingSphere:E})}},p}),define("Core/decodeGoogleEarthEnterpriseData",["./Check","./RuntimeError"],function(e,t){"use strict";function r(e,o){if(r.passThroughDataForTesting)return o;var a=e.byteLength;if(0===a||a%4!=0)throw new t("The length of key must be greater than 0 and a multiple of 4.");var s=new DataView(o),l=s.getUint32(0,!0);if(l===i||l===n)return o;for(var u,c=new DataView(e),d=0,h=o.byteLength,p=h-h%8,f=a,m=8;d<p;)for(m=(m+8)%24,u=m;d<p&&u<f;)s.setUint32(d,s.getUint32(d,!0)^c.getUint32(u,!0),!0),s.setUint32(d+4,s.getUint32(d+4,!0)^c.getUint32(u+4,!0),!0),d+=8,u+=24;if(d<h)for(u>=f&&(m=(m+8)%24,u=m);d<h;)s.setUint8(d,s.getUint8(d)^c.getUint8(u)),d++,u++}var i=1953029805,n=2917034100;return r.passThroughDataForTesting=!1,r}),define("Core/DefaultProxy",[],function(){"use strict";function e(e){this.proxy=e}return e.prototype.getURL=function(e){var t=-1===this.proxy.indexOf("?")?"?":"";return this.proxy+t+encodeURIComponent(e)},e}),define("Core/DistanceDisplayCondition",["./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i){"use strict";function n(t,r){t=e(t,0),this._near=t,r=e(r,Number.MAX_VALUE),this._far=r}return r(n.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}}}),n.packedLength=2,n.pack=function(t,r,i){return i=e(i,0),r[i++]=t.near,r[i]=t.far,r},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.near=r[i++],o.far=r[i],o},n.equals=function(e,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.far===r.far},n.clone=function(e,r){if(t(e))return t(r)||(r=new n),r.near=e.near,r.far=e.far,r},n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n}),define("Core/DistanceDisplayConditionGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n){"use strict";function o(e,r){e=t(e,0),r=t(r,Number.MAX_VALUE),this.value=new Float32Array([e,r])}return i(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 r(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])},o}),define("Core/DoublyLinkedList",["../Core/defined","../Core/defineProperties"],function(e,t){"use strict";function r(){this.head=void 0,this.tail=void 0,this._length=0}function i(e,t,r){this.item=e,this.previous=t,this.next=r}function n(t,r){e(r.previous)&&e(r.next)?(r.previous.next=r.next,r.next.previous=r.previous):e(r.previous)?(r.previous.next=void 0,t.tail=r.previous):e(r.next)?(r.next.previous=void 0,t.head=r.next):(t.head=void 0,t.tail=void 0),r.next=void 0,r.previous=void 0}return t(r.prototype,{length:{get:function(){return this._length}}}),r.prototype.add=function(t){var r=new i(t,this.tail,void 0);return e(this.tail)?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),++this._length,r},r.prototype.remove=function(t){e(t)&&(n(this,t),--this._length)},r.prototype.splice=function(e,t){if(e!==t){n(this,t);var r=e.next;e.next=t,this.tail===e?this.tail=t:r.previous=t,t.next=r,t.previous=e}},r}),define("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 r=e.indexOf(t);-1!==r&&e.splice(r,1)},update:function(t){if(0===e.length)return!1;var r=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();r<e.length;)e[r].update(t)?r++:e.splice(r,1);return!0}}}();return e.Tween=function(t){var r=t,i={},n={},o={},a=1e3,s=0,l=!1,u=!1,c=!1,d=0,h=null,p=e.Easing.Linear.None,f=e.Interpolation.Linear,m=[],g=null,_=!1,v=null,y=null,b=null;for(var C in t)i[C]=parseFloat(t[C],10);this.to=function(e,t){return void 0!==t&&(a=t),n=e,this},this.start=function(t){e.add(this),u=!0,_=!1,h=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),h+=d;for(var a in n){if(n[a]instanceof Array){if(0===n[a].length)continue;n[a]=[r[a]].concat(n[a])}i[a]=r[a],i[a]instanceof Array==!1&&(i[a]*=1),o[a]=i[a]||0}return this},this.stop=function(){return u?(e.remove(this),u=!1,null!==b&&b.call(r),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=m.length;e<t;e++)m[e].stop()},this.delay=function(e){return d=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 f=e,this},this.chain=function(){return m=arguments,this},this.onStart=function(e){return g=e,this},this.onUpdate=function(e){return v=e,this},this.onComplete=function(e){return y=e,this},this.onStop=function(e){return b=e,this},this.update=function(e){var t;if(e<h)return!0;!1===_&&(null!==g&&g.call(r),_=!0);var u=(e-h)/a;u=u>1?1:u;var b=p(u);for(t in n){var C=i[t]||0,S=n[t];S instanceof Array?r[t]=f(S,b):("string"==typeof S&&(S=C+parseFloat(S,10)),"number"==typeof S&&(r[t]=C+(S-C)*b))}if(null!==v&&v.call(r,b),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 T=o[t];o[t]=n[t],n[t]=T}i[t]=o[t]}return l&&(c=!c),h=e+d,!0}null!==y&&y.call(r);for(var w=0,A=m.length;w<A;w++)m[w].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*(2-Math.pow(2,-10*(e-1)))}},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,r=.1;return 0===e?0:1===e?1:(!r||r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),-r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},Out:function(e){var t,r=.1;return 0===e?0:1===e?1:(!r||r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},InOut:function(e){var t,r=.1;return 0===e?0:1===e?1:(!r||r<1?(r=1,t=.1):t=.4*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*-.5:r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4)*.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?e*e*((t+1)*e-t)*.5:.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,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return r<0?a(t[0],t[1],n):r>1?a(t[i],t[i-1],i-n):a(t[o],t[o+1>i?i:o+1],n-o)},Bezier:function(t,r){var i,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(i=0;i<=o;i++)n+=a(1-r,o-i)*a(r,i)*t[i]*s(o,i);return n},CatmullRom:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(r<0&&(o=Math.floor(n=i*(1+r))),a(t[(o-1+i)%i],t[o],t[(o+1)%i],t[(o+2)%i],n-o)):r<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):r>1?t[i]-(a(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):a(t[o?o-1:0],t[o],t[i<o+1?i:o+1],t[i<o+2?i:o+2],n-o)},Utils:{Linear:function(e,t,r){return(t-e)*r+e},Bernstein:function(t,r){var i=e.Interpolation.Utils.Factorial;return i(t)/i(r)/i(t-r)},Factorial:function(){var e=[1];return function(t){var r,i=1;if(e[t])return e[t];for(r=t;r>1;r--)i*=r;return e[t]=i}}(),CatmullRom:function(e,t,r,i,n){var o=.5*(r-e),a=.5*(i-t),s=n*n;return(2*t-2*r+o+a)*(n*s)+(-3*t+3*r-2*o-a)*s+o*n+t}}},e}),define("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";return t({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})}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,C),i=Math.round(n(e.stackPartitions,64)),o=Math.round(n(e.slicePartitions,64)),a=n(e.vertexFormat,f.DEFAULT);this._radii=r.clone(t),this._stackPartitions=i,this._slicePartitions=o,this._vertexFormat=f.clone(a),this._workerName="createEllipsoidGeometry"}var g=new r,_=new r,v=new r,y=new r,b=new r,C=new r(1,1,1),S=Math.cos,T=Math.sin;m.packedLength=r.packedLength+f.packedLength+2,m.pack=function(e,t,i){return i=n(i,0),r.pack(e._radii,t,i),i+=r.packedLength,f.pack(e._vertexFormat,t,i),i+=f.packedLength,t[i++]=e._stackPartitions,t[i]=e._slicePartitions,t};var w=new r,A=new f,E={radii:w,vertexFormat:A,stackPartitions:void 0,slicePartitions:void 0};m.unpack=function(e,t,i){t=n(t,0);var a=r.unpack(e,t,w);t+=r.packedLength;var s=f.unpack(e,t,A);t+=f.packedLength;var l=e[t++],u=e[t];return o(i)?(i._radii=r.clone(a,i._radii),i._vertexFormat=f.clone(s,i._vertexFormat),i._stackPartitions=l,i._slicePartitions=u,i):(E.stackPartitions=l,E.slicePartitions=u,new m(E))},m.createGeometry=function(n){var o=n._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a,f,m=s.fromCartesian3(o),C=n._vertexFormat,w=n._slicePartitions+1,A=n._stackPartitions+1,E=A*w,x=new Float64Array(3*E),P=6*(w-1)*(A-2),I=d.createTypedArray(E,P),D=C.normal?new Float32Array(3*E):void 0,O=C.tangent?new Float32Array(3*E):void 0,M=C.bitangent?new Float32Array(3*E):void 0,R=C.st?new Float32Array(2*E):void 0,L=new Array(w),N=new Array(w),k=0;for(a=0;a<w;a++){var F=h.TWO_PI*a/(w-1);L[a]=S(F),N[a]=T(F),x[k++]=0,x[k++]=0,x[k++]=o.z}for(a=1;a<A-1;a++){var B=Math.PI*a/(A-1),U=T(B),V=o.x*U,z=o.y*U,G=o.z*S(B);for(f=0;f<w;f++)x[k++]=L[f]*V,x[k++]=N[f]*z,x[k++]=G}for(a=0;a<w;a++)x[k++]=0,x[k++]=0,x[k++]=-o.z;var H=new c;C.position&&(H.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:x}));var W=0,j=0,q=0,Y=0;if(C.st||C.normal||C.tangent||C.bitangent){for(a=0;a<E;a++){var X=r.fromArray(x,3*a,g),Q=m.geodeticSurfaceNormal(X,_);if(C.st){var Z=t.negate(Q,b);t.magnitude(Z)<h.EPSILON6&&(k=3*(a+w*Math.floor(.5*A)),k>x.length&&(k=3*(a-w*Math.floor(.5*A))),r.fromArray(x,k,Z),m.geodeticSurfaceNormal(Z,Z),t.negate(Z,Z)),R[W++]=Math.atan2(Z.y,Z.x)/h.TWO_PI+.5,R[W++]=Math.asin(Q.z)/Math.PI+.5}if(C.normal&&(D[j++]=Q.x,D[j++]=Q.y,D[j++]=Q.z),C.tangent||C.bitangent){var K=v;if(a<w||a>E-w-1?(r.cross(r.UNIT_X,Q,K),r.normalize(K,K)):(r.cross(r.UNIT_Z,Q,K),r.normalize(K,K)),C.tangent&&(O[q++]=K.x,O[q++]=K.y,O[q++]=K.z),C.bitangent){var J=r.cross(Q,K,y);r.normalize(J,J),M[Y++]=J.x,M[Y++]=J.y,M[Y++]=J.z}}}C.st&&(H.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:R})),C.normal&&(H.normal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:D})),C.tangent&&(H.tangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O})),C.bitangent&&(H.bitangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:M}))}for(k=0,f=0;f<w-1;f++)I[k++]=w+f,I[k++]=w+f+1,I[k++]=f+1;var $,ee;for(a=1;a<A-2;a++)for($=a*w,ee=(a+1)*w,f=0;f<w-1;f++)I[k++]=ee+f,I[k++]=ee+f+1,I[k++]=$+f+1,I[k++]=ee+f,I[k++]=$+f+1,I[k++]=$+f;for(a=A-2,$=a*w,ee=(a+1)*w,f=0;f<w-1;f++)I[k++]=ee+f,I[k++]=$+f+1,I[k++]=$+f;return new l({attributes:H,indices:I,primitiveType:p.TRIANGLES,boundingSphere:e.fromEllipsoid(m)})}};var x;return m.getUnitEllipsoid=function(){return o(x)||(x=m.createGeometry(new m({radii:new r(1,1,1),vertexFormat:f.POSITION_ONLY}))),x},m}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){e=i(e,i.EMPTY_OBJECT);var r=i(e.radii,f),n=Math.round(i(e.stackPartitions,10)),o=Math.round(i(e.slicePartitions,8)),a=Math.round(i(e.subdivisions,128));this._radii=t.clone(r),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"}var f=new t(1,1,1),m=Math.cos,g=Math.sin;p.packedLength=t.packedLength+3,p.pack=function(e,r,n){return n=i(n,0),t.pack(e._radii,r,n),n+=t.packedLength,r[n++]=e._stackPartitions,r[n++]=e._slicePartitions,r[n]=e._subdivisions,r};var _=new t,v={radii:_,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,_);r+=t.packedLength;var s=e[r++],l=e[r++],u=e[r++];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 i=t._radii;if(!(i.x<=0||i.y<=0||i.z<=0)){var n,o,p,f,_,v,y=a.fromCartesian3(i),b=t._stackPartitions,C=t._slicePartitions,S=t._subdivisions,T=S*(b+C-1),w=T-C+2,A=new Float64Array(3*w),E=c.createTypedArray(w,2*T),x=0,P=new Array(S),I=new Array(S);for(n=0;n<S;n++)p=d.TWO_PI*n/S,P[n]=m(p),I[n]=g(p);for(n=1;n<b;n++)for(f=Math.PI*n/b,_=m(f),v=g(f),o=0;o<S;o++)A[x++]=i.x*P[o]*v,A[x++]=i.y*I[o]*v,A[x++]=i.z*_;for(P.length=C,I.length=C,n=0;n<C;n++)p=d.TWO_PI*n/C,P[n]=m(p),I[n]=g(p);for(A[x++]=0,A[x++]=0,A[x++]=i.z,n=1;n<S;n++)for(f=Math.PI*n/S,_=m(f),v=g(f),o=0;o<C;o++)A[x++]=i.x*P[o]*v,A[x++]=i.y*I[o]*v,A[x++]=i.z*_;for(A[x++]=0,A[x++]=0,A[x++]=-i.z,x=0,n=0;n<b-1;++n){var D=n*S;for(o=0;o<S-1;++o)E[x++]=D+o,E[x++]=D+o+1;E[x++]=D+S-1,E[x++]=D}var O=S*(b-1);for(o=1;o<C+1;++o)E[x++]=O,E[x++]=O+o;for(n=0;n<S-2;++n){var M=n*C+1+O,R=(n+1)*C+1+O;for(o=0;o<C-1;++o)E[x++]=R+o,E[x++]=M+o;E[x++]=R+C-1,E[x++]=M+C-1}var L=A.length/3-1;for(o=L-1;o>L-C-1;--o)E[x++]=L,E[x++]=o;var N=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:A})});return new s({attributes:N,indices:E,primitiveType:h.LINES,boundingSphere:e.fromEllipsoid(y)})}},p}),define("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(i){i=t(i,{}),this._tilingScheme=i.tilingScheme,r(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(i.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 i(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,r,i){return new s({buffer:new Uint8Array(256),width:16,height:16})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},u.prototype.getTileDataAvailable=function(e,t,r){},u}),define("Core/EventHelper",["./defined","./DeveloperError"],function(e,t){"use strict";function r(){this._removalFunctions=[]}return r.prototype.add=function(e,t,r){var i=e.addEventListener(t,r);this._removalFunctions.push(i);var n=this;return function(){i();var e=n._removalFunctions;e.splice(e.indexOf(i),1)}},r.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,r=e.length;t<r;++t)e[t]();e.length=0},r}),define("Core/ExtrapolationType",["./freezeObject"],function(e){"use strict";return e({NONE:0,HOLD:1,EXTRAPOLATE:2})}),define("Core/OrthographicOffCenterFrustum",["./Cartesian3","./Cartesian4","./CullingVolume","./defaultValue","./defined","./defineProperties","./DeveloperError","./Matrix4"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=i(e.near,1),this._near=this.near,this.far=i(e.far,5e8),this._far=this.far,this._cullingVolume=new r,this._orthographicMatrix=new s}function u(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=s.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}o(l.prototype,{projectionMatrix:{get:function(){return u(this),this._orthographicMatrix}}});var c=new e,d=new e,h=new e,p=new e
;return l.prototype.computeCullingVolume=function(r,i,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,f=this.left,m=this.near,g=this.far,_=e.cross(i,o,c);e.normalize(_,_);var v=d;e.multiplyByScalar(i,m,v),e.add(r,v,v);var y=h;e.multiplyByScalar(_,f,y),e.add(v,y,y);var b=a[0];return n(b)||(b=a[0]=new t),b.x=_.x,b.y=_.y,b.z=_.z,b.w=-e.dot(_,y),e.multiplyByScalar(_,u,y),e.add(v,y,y),b=a[1],n(b)||(b=a[1]=new t),b.x=-_.x,b.y=-_.y,b.z=-_.z,b.w=-e.dot(e.negate(_,p),y),e.multiplyByScalar(o,l,y),e.add(v,y,y),b=a[2],n(b)||(b=a[2]=new t),b.x=o.x,b.y=o.y,b.z=o.z,b.w=-e.dot(o,y),e.multiplyByScalar(o,s,y),e.add(v,y,y),b=a[3],n(b)||(b=a[3]=new t),b.x=-o.x,b.y=-o.y,b.z=-o.z,b.w=-e.dot(e.negate(o,p),y),b=a[4],n(b)||(b=a[4]=new t),b.x=i.x,b.y=i.y,b.z=i.z,b.w=-e.dot(i,v),e.multiplyByScalar(i,g,y),e.add(r,y,y),b=a[5],n(b)||(b=a[5]=new t),b.x=-i.x,b.y=-i.y,b.z=-i.z,b.w=-e.dot(e.negate(i,p),y),this._cullingVolume},l.prototype.getPixelDimensions=function(e,t,r,i){u(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return i.x=a,i.y=s,i},l.prototype.clone=function(e){return n(e)||(e=new l),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},l.prototype.equals=function(e){return n(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},l}),define("Core/OrthographicFrustum",["./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./OrthographicOffCenterFrustum"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this._offCenterFrustum=new o,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=t(e.near,1),this._near=this.near,this.far=t(e.far,5e8),this._far=this.far}function s(e){var t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;var r=1/e.aspectRatio;t.right=.5*e.width,t.left=-t.right,t.top=r*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}return a.packedLength=4,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.width,r[i++]=e.aspectRatio,r[i++]=e.near,r[i]=e.far,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.width=e[i++],n.aspectRatio=e[i++],n.near=e[i++],n.far=e[i],n},i(a.prototype,{projectionMatrix:{get:function(){return s(this),this._offCenterFrustum.projectionMatrix}}}),a.prototype.computeCullingVolume=function(e,t,r){return s(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},a.prototype.getPixelDimensions=function(e,t,r,i){return s(this),this._offCenterFrustum.getPixelDimensions(e,t,r,i)},a.prototype.clone=function(e){return r(e)||(e=new a),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},a.prototype.equals=function(e){return!!r(e)&&(s(this),s(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this.near===e.near&&this.far===e.far&&this._offCenterFrustum.equals(e._offCenterFrustum))},a}),define("Core/PerspectiveOffCenterFrustum",["./Cartesian3","./Cartesian4","./CullingVolume","./defaultValue","./defined","./defineProperties","./DeveloperError","./Matrix4"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=i(e.near,1),this._near=this.near,this.far=i(e.far,5e8),this._far=this.far,this._cullingVolume=new r,this._perspectiveMatrix=new s,this._infinitePerspective=new s}function u(e){var t=e.top,r=e.bottom,i=e.right,n=e.left,o=e.near,a=e.far;t===e._top&&r===e._bottom&&n===e._left&&i===e._right&&o===e._near&&a===e._far||(e._left=n,e._right=i,e._top=t,e._bottom=r,e._near=o,e._far=a,e._perspectiveMatrix=s.computePerspectiveOffCenter(n,i,r,t,o,a,e._perspectiveMatrix),e._infinitePerspective=s.computeInfinitePerspectiveOffCenter(n,i,r,t,o,e._infinitePerspective))}o(l.prototype,{projectionMatrix:{get:function(){return u(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return u(this),this._infinitePerspective}}});var c=new e,d=new e,h=new e,p=new e;return l.prototype.computeCullingVolume=function(r,i,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,u=this.right,f=this.left,m=this.near,g=this.far,_=e.cross(i,o,c),v=d;e.multiplyByScalar(i,m,v),e.add(r,v,v);var y=h;e.multiplyByScalar(i,g,y),e.add(r,y,y);var b=p;e.multiplyByScalar(_,f,b),e.add(v,b,b),e.subtract(b,r,b),e.normalize(b,b),e.cross(b,o,b),e.normalize(b,b);var C=a[0];return n(C)||(C=a[0]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,r),e.multiplyByScalar(_,u,b),e.add(v,b,b),e.subtract(b,r,b),e.cross(o,b,b),e.normalize(b,b),C=a[1],n(C)||(C=a[1]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,r),e.multiplyByScalar(o,l,b),e.add(v,b,b),e.subtract(b,r,b),e.cross(_,b,b),e.normalize(b,b),C=a[2],n(C)||(C=a[2]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,r),e.multiplyByScalar(o,s,b),e.add(v,b,b),e.subtract(b,r,b),e.cross(b,_,b),e.normalize(b,b),C=a[3],n(C)||(C=a[3]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,r),C=a[4],n(C)||(C=a[4]=new t),C.x=i.x,C.y=i.y,C.z=i.z,C.w=-e.dot(i,v),e.negate(i,b),C=a[5],n(C)||(C=a[5]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,y),this._cullingVolume},l.prototype.getPixelDimensions=function(e,t,r,i){u(this);var n=1/this.near,o=this.top*n,a=2*r*o/t;o=this.right*n;var s=2*r*o/e;return i.x=s,i.y=a,i},l.prototype.clone=function(e){return n(e)||(e=new l),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},l.prototype.equals=function(e){return n(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},l}),define("Core/PerspectiveFrustum",["./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./PerspectiveOffCenterFrustum"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this._offCenterFrustum=new o,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=t(e.near,1),this._near=this.near,this.far=t(e.far,5e8),this._far=this.far,this.xOffset=t(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=t(e.yOffset,0),this._yOffset=this.yOffset}function s(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 a.packedLength=6,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.fov,r[i++]=e.aspectRatio,r[i++]=e.near,r[i++]=e.far,r[i++]=e.xOffset,r[i]=e.yOffset,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.fov=e[i++],n.aspectRatio=e[i++],n.near=e[i++],n.far=e[i++],n.xOffset=e[i++],n.yOffset=e[i],n},i(a.prototype,{projectionMatrix:{get:function(){return s(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return s(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return s(this),this._fovy}},sseDenominator:{get:function(){return s(this),this._sseDenominator}}}),a.prototype.computeCullingVolume=function(e,t,r){return s(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},a.prototype.getPixelDimensions=function(e,t,r,i){return s(this),this._offCenterFrustum.getPixelDimensions(e,t,r,i)},a.prototype.clone=function(e){return r(e)||(e=new a),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e},a.prototype.equals=function(e){return!!r(e)&&(s(this),s(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this.near===e.near&&this.far===e.far&&this._offCenterFrustum.equals(e._offCenterFrustum))},a}),define("Core/FrustumGeometry",["./BoundingSphere","./Cartesian3","./Cartesian4","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./Matrix3","./Matrix4","./OrthographicFrustum","./PerspectiveFrustum","./PrimitiveType","./Quaternion","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(e){var r,i,n=e.frustum,a=e.orientation,s=e.origin,l=o(e.vertexFormat,g.DEFAULT),u=o(e._drawNearPlane,!0);n instanceof p?(r=y,i=p.packedLength):n instanceof h&&(r=b,i=h.packedLength),this._frustumType=r,this._frustum=n.clone(),this._origin=t.clone(s),this._orientation=m.clone(a),this._drawNearPlane=u,this._vertexFormat=l,this._workerName="createFrustumGeometry",this.packedLength=2+i+t.packedLength+m.packedLength+g.packedLength}function v(e,t,r,i,n,o,s,l){for(var u=e/3*2,c=0;c<4;++c)a(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),a(r)&&(r[e]=s.x,r[e+1]=s.y,r[e+2]=s.z),a(i)&&(i[e]=l.x,i[e+1]=l.y,i[e+2]=l.z),e+=3;n[u]=0,n[u+1]=0,n[u+2]=1,n[u+3]=0,n[u+4]=1,n[u+5]=1,n[u+6]=0,n[u+7]=1}var y=0,b=1;_.pack=function(e,r,i){i=o(i,0);var n=e._frustumType,a=e._frustum;return r[i++]=n,n===y?(p.pack(a,r,i),i+=p.packedLength):(h.pack(a,r,i),i+=h.packedLength),t.pack(e._origin,r,i),i+=t.packedLength,m.pack(e._orientation,r,i),i+=m.packedLength,g.pack(e._vertexFormat,r,i),i+=g.packedLength,r[i]=e._drawNearPlane?1:0,r};var C=new p,S=new h,T=new m,w=new t,A=new g;_.unpack=function(e,r,i){r=o(r,0);var n,s=e[r++];s===y?(n=p.unpack(e,r,C),r+=p.packedLength):(n=h.unpack(e,r,S),r+=h.packedLength);var l=t.unpack(e,r,w);r+=t.packedLength;var u=m.unpack(e,r,T);r+=m.packedLength;var c=g.unpack(e,r,A);r+=g.packedLength;var d=1===e[r];if(!a(i))return new _({frustum:n,origin:l,orientation:u,vertexFormat:c,_drawNearPlane:d});var f=s===i._frustumType?i._frustum:void 0;return i._frustum=n.clone(f),i._frustumType=s,i._origin=t.clone(l,i._origin),i._orientation=m.clone(u,i._orientation),i._vertexFormat=g.clone(c,i._vertexFormat),i._drawNearPlane=d,i};var E=new c,x=new d,P=new d,I=new t,D=new t,O=new t,M=new t,R=new t,L=new t,N=new Array(3),k=new Array(4);k[0]=new r(-1,-1,1,1),k[1]=new r(1,-1,1,1),k[2]=new r(1,1,1,1),k[3]=new r(-1,1,1,1);for(var F=new Array(4),B=0;B<4;++B)F[B]=new r;return _._computeNearFarPlanes=function(e,i,n,s,l,u,h,p){var f=c.fromQuaternion(i,E),m=o(u,I),g=o(h,D),_=o(p,O);m=c.getColumn(f,0,m),g=c.getColumn(f,1,g),_=c.getColumn(f,2,_),t.normalize(m,m),t.normalize(g,g),t.normalize(_,_),t.negate(m,m);var v,b,C=d.computeView(e,_,g,m,x);if(n===y){var S=s.projectionMatrix,T=d.multiply(S,C,P);b=d.inverse(T,P)}else v=d.inverseTransformation(C,P);a(b)?(N[0]=s.near,N[1]=s.far):(N[0]=0,N[1]=s.near,N[2]=s.far);for(var w=0;w<2;++w)for(var A=0;A<4;++A){var M=r.clone(k[A],F[A]);if(a(b)){M=d.multiplyByVector(b,M,M);var R=1/M.w;t.multiplyByScalar(M,R,M),t.subtract(M,e,M),t.normalize(M,M);var L=t.dot(_,M);t.multiplyByScalar(M,N[w]/L,M),t.add(M,e,M)}else{a(s._offCenterFrustum)&&(s=s._offCenterFrustum);var B=N[w],U=N[w+1];M.x=.5*(M.x*(s.right-s.left)+s.left+s.right),M.y=.5*(M.y*(s.top-s.bottom)+s.bottom+s.top),M.z=.5*(M.z*(B-U)-B-U),M.w=1,d.multiplyByVector(v,M,M)}l[12*w+3*A]=M.x,l[12*w+3*A+1]=M.y,l[12*w+3*A+2]=M.z}},_.createGeometry=function(r){var i=r._frustumType,o=r._frustum,c=r._origin,d=r._orientation,h=r._drawNearPlane,p=r._vertexFormat,m=h?6:5,g=new Float64Array(72);_._computeNearFarPlanes(c,d,i,o,g);var y=24;g[y]=g[12],g[y+1]=g[13],g[y+2]=g[14],g[y+3]=g[0],g[y+4]=g[1],g[y+5]=g[2],g[y+6]=g[9],g[y+7]=g[10],g[y+8]=g[11],g[y+9]=g[21],g[y+10]=g[22],g[y+11]=g[23],y+=12,g[y]=g[15],g[y+1]=g[16],g[y+2]=g[17],g[y+3]=g[3],g[y+4]=g[4],g[y+5]=g[5],g[y+6]=g[0],g[y+7]=g[1],g[y+8]=g[2],g[y+9]=g[12],g[y+10]=g[13],g[y+11]=g[14],y+=12,g[y]=g[3],g[y+1]=g[4],g[y+2]=g[5],g[y+3]=g[15],g[y+4]=g[16],g[y+5]=g[17],g[y+6]=g[18],g[y+7]=g[19],g[y+8]=g[20],g[y+9]=g[6],g[y+10]=g[7],g[y+11]=g[8],y+=12,g[y]=g[6],g[y+1]=g[7],g[y+2]=g[8],g[y+3]=g[18],g[y+4]=g[19],g[y+5]=g[20],g[y+6]=g[21],g[y+7]=g[22],g[y+8]=g[23],g[y+9]=g[9],g[y+10]=g[10],g[y+11]=g[11],h||(g=g.subarray(12));var b=new u({position:new l({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:g})});if(a(p.normal)||a(p.tangent)||a(p.bitangent)||a(p.st)){var C=a(p.normal)?new Float32Array(12*m):void 0,S=a(p.tangent)?new Float32Array(12*m):void 0,T=a(p.bitangent)?new Float32Array(12*m):void 0,w=a(p.st)?new Float32Array(8*m):void 0,A=I,E=D,x=O,P=t.negate(A,M),N=t.negate(E,R),k=t.negate(x,L);y=0,h&&(v(y,C,S,T,w,k,A,E),y+=12),v(y,C,S,T,w,x,P,E),y+=12,v(y,C,S,T,w,P,k,E),y+=12,v(y,C,S,T,w,N,k,P),y+=12,v(y,C,S,T,w,A,x,E),y+=12,v(y,C,S,T,w,E,x,P),a(C)&&(b.normal=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),a(S)&&(b.tangent=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),a(T)&&(b.bitangent=new l({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T})),a(w)&&(b.st=new l({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:w}))}for(var F=new Uint16Array(6*m),B=0;B<m;++B){var U=6*B,V=4*B;F[U]=V,F[U+1]=V+1,F[U+2]=V+2,F[U+3]=V,F[U+4]=V+2,F[U+5]=V+3}return new s({attributes:b,indices:F,primitiveType:f.TRIANGLES,boundingSphere:e.fromVertices(g)})},_}),define("Core/FrustumOutlineGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./FrustumGeometry","./Geometry","./GeometryAttribute","./GeometryAttributes","./OrthographicFrustum","./PerspectiveFrustum","./PrimitiveType","./Quaternion"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){var r,i,o=e.frustum,a=e.orientation,s=e.origin,l=n(e._drawNearPlane,!0);o instanceof d?(r=m,i=d.packedLength):o instanceof c&&(r=g,i=c.packedLength),this._frustumType=r,this._frustum=o.clone(),this._origin=t.clone(s),this._orientation=p.clone(a),this._drawNearPlane=l,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+i+t.packedLength+p.packedLength}var m=0,g=1;f.pack=function(e,r,i){i=n(i,0);var o=e._frustumType,a=e._frustum;return r[i++]=o,o===m?(d.pack(a,r,i),i+=d.packedLength):(c.pack(a,r,i),i+=c.packedLength),t.pack(e._origin,r,i),i+=t.packedLength,p.pack(e._orientation,r,i),i+=p.packedLength,r[i]=e._drawNearPlane?1:0,r};var _=new d,v=new c,y=new p,b=new t;return f.unpack=function(e,r,i){r=n(r,0);var a,s=e[r++];s===m?(a=d.unpack(e,r,_),r+=d.packedLength):(a=c.unpack(e,r,v),r+=c.packedLength);var l=t.unpack(e,r,b);r+=t.packedLength;var u=p.unpack(e,r,y);r+=p.packedLength;var h=1===e[r];if(!o(i))return new f({frustum:a,origin:l,orientation:u,_drawNearPlane:h});var g=s===i._frustumType?i._frustum:void 0;return i._frustum=a.clone(g),i._frustumType=s,i._origin=t.clone(l,i._origin),i._orientation=p.clone(u,i._orientation),i._drawNearPlane=h,i},f.createGeometry=function(t){var r=t._frustumType,n=t._frustum,o=t._origin,c=t._orientation,d=t._drawNearPlane,p=new Float64Array(24);a._computeNearFarPlanes(o,c,r,n,p);for(var f,m,g=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p})}),_=d?2:1,v=new Uint16Array(8*(_+1)),y=d?0:1;y<2;++y)f=d?8*y:0,m=4*y,v[f]=m,v[f+1]=m+1,v[f+2]=m+1,v[f+3]=m+2,v[f+4]=m+2,v[f+5]=m+3,v[f+6]=m+3,v[f+7]=m;for(y=0;y<2;++y)f=8*(_+y),m=4*y,v[f]=m,v[f+1]=m+4,v[f+2]=m+1,v[f+3]=m+5,v[f+4]=m+2,v[f+5]=m+6,v[f+6]=m+3,v[f+7]=m+7;return new s({attributes:g,indices:v,primitiveType:h.LINES,boundingSphere:e.fromVertices(p)})},f}),define("Core/GeocoderService",["./DeveloperError"],function(e){"use strict";function t(){}return t.prototype.geocode=e.throwInstantiationError,t}),define("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(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 i}),define("Core/getFilenameFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t){var r=new e(t);r.normalize();var i=r.path,n=i.lastIndexOf("/");return-1!==n&&(i=i.substr(n+1)),i}return i}),define("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,i,n){e(i)||(i=t.width),e(n)||(n=t.height);var o=r[i];e(o)||(o={},r[i]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=i,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,i,n),a.getImageData(0,0,i,n).data}var r={};return t}),define("Core/getStringFromTypedArray",["./defaultValue","./defined","./DeveloperError","./RuntimeError"],function(e,t,r,i){"use strict";function n(t,r,i){return r=e(r,0),i=e(i,t.byteLength-r),t=t.subarray(r,r+i),n.decode(t)}function o(e,t,r){return t<=e&&e<=r}function a(e){for(var t=0,r=0,n=0,a=128,s=191,l=[],u=e.length,c=0;c<u;++c){var d=e[c];if(0===n){if(o(d,0,127)){l.push(d);continue}if(o(d,194,223)){n=1,t=31&d;continue}if(o(d,224,239)){224===d&&(a=160),237===d&&(s=159),n=2,t=15&d;continue}if(o(d,240,244)){240===d&&(a=144),244===d&&(s=143),n=3,t=7&d;continue}throw new i("String decoding failed.")}o(d,a,s)?(a=128,s=191,t=t<<6|63&d,++r===n&&(l.push(t),t=n=r=0)):(t=n=r=0,a=128,s=191,--c)}return l}return n.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)},n.decodeWithFromCharCode=function(e){for(var t="",r=a(e),i=r.length,n=0;n<i;++n){var o=r[n];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode(55296+(o>>10),56320+(1023&o)))}return t},"undefined"!=typeof TextDecoder?n.decode=n.decodeWithTextDecoder:n.decode=n.decodeWithFromCharCode,n}),define("Core/getMagic",["./defaultValue","./getStringFromTypedArray"],function(e,t){"use strict";function r(r,i){return i=e(i,0),t(r,i,Math.min(4,r.length))}return r}),function(global,undefined){"use strict";!function(e,t,r){function i(r){var n=t[r];return n||e[r][0].call(n=t[r]={exports:{}},i,n,n.exports),n.exports}var n=global.protobuf=i(r[0]);"function"==typeof define&&define.amd&&define("ThirdParty/protobuf-minimal",[],function(){return n.configure(),n}),"object"==typeof module&&module&&module.exports&&(module.exports=n)}({1:[function(e,t,r){function i(e,t){for(var r=[],i=2;i<arguments.length;)r.push(arguments[i++]);var n=!0;return new Promise(function(i,o){r.push(function(e){if(n)if(n=!1,e)o(e);else{for(var t=[],r=1;r<arguments.length;)t.push(arguments[r++]);i.apply(null,t)}});try{e.apply(t||this,r)}catch(e){n&&(n=!1,o(e))}})}t.exports=i},{}],2:[function(e,t,r){var i=r;i.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),o=new Array(123),a=0;a<64;)o[n[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;i.encode=function(e,t,r){for(var i,o=[],a=0,s=0;t<r;){var l=e[t++];switch(s){case 0:o[a++]=n[l>>2],i=(3&l)<<4,s=1;break;case 1:o[a++]=n[i|l>>4],i=(15&l)<<2,s=2;break;case 2:o[a++]=n[i|l>>6],o[a++]=n[63&l],s=0}}return s&&(o[a++]=n[i],o[a]=61,1===s&&(o[a+1]=61)),String.fromCharCode.apply(String,o)};i.decode=function(e,t,r){for(var i,n=r,a=0,s=0;s<e.length;){var l=e.charCodeAt(s++);if(61===l&&a>1)break;if((l=o[l])===undefined)throw Error("invalid encoding");switch(a){case 0:i=l,a=1;break;case 1:t[r++]=i<<2|(48&l)>>4,i=l,a=2;break;case 2:t[r++]=(15&i)<<4|(60&l)>>2,i=l,a=3;break;case 3:t[r++]=(3&i)<<6|l,a=0}}if(1===a)throw Error("invalid encoding");return r-n},i.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)}},{}],3:[function(e,t,r){function i(){this._listeners={}}t.exports=i,i.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},i.prototype.off=function(e,t){if(e===undefined)this._listeners={};else if(t===undefined)this._listeners[e]=[];else for(var r=this._listeners[e],i=0;i<r.length;)r[i].fn===t?r.splice(i,1):++i;return this},i.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,r)}return this}},{}],4:[function(require,module,exports){function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},{}],5:[function(e,t,r){function i(e,t,r){var i=r||8192,n=i>>>1,o=null,a=i;return function(r){if(r<1||r>n)return e(r);a+r>i&&(o=e(i),a=0);var s=t.call(o,a,a+=r);return 7&a&&(a=1+(7|a)),s}}t.exports=i},{}],6:[function(e,t,r){var i=r;i.length=function(e){for(var t=0,r=0,i=0;i<e.length;++i)r=e.charCodeAt(i),r<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(i+1))?(++i,t+=4):t+=3;return t},i.read=function(e,t,r){if(r-t<1)return"";for(var i,n=null,o=[],a=0;t<r;)i=e[t++],i<128?o[a++]=i:i>191&&i<224?o[a++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(i>>10),o[a++]=56320+(1023&i)):o[a++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),a=0);return n?(a&&n.push(String.fromCharCode.apply(String,o.slice(0,a))),n.join("")):String.fromCharCode.apply(String,o.slice(0,a))},i.write=function(e,t,r){for(var i,n,o=r,a=0;a<e.length;++a)i=e.charCodeAt(a),i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(a+1)))?(i=65536+((1023&i)<<10)+(1023&n),++a,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-o}},{}],7:[function(e,t,r){function i(){n.Reader._configure(n.BufferReader),n.util._configure()}var n=r;n.build="minimal",n.roots={},n.Writer=e(14),n.BufferWriter=e(15),n.Reader=e(8),n.BufferReader=e(9),n.util=e(13),n.rpc=e(10),n.configure=i,n.Writer._configure(n.BufferWriter),i()},{10:10,13:13,14:14,15:15,8:8,9:9}],8:[function(e,t,r){function i(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function n(e){this.buf=e,this.pos=0,this.len=e.length}function o(){var e=new c(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw i(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw i(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function a(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function s(){if(this.pos+8>this.len)throw i(this,8);return new c(a(this.buf,this.pos+=4),a(this.buf,this.pos+=4))}t.exports=n;var l,u=e(13),c=u.LongBits,d=u.utf8,h="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new n(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new n(e);throw Error("illegal buffer")};n.create=u.Buffer?function(e){return(n.create=function(e){return u.Buffer.isBuffer(e)?new l(e):h(e)})(e)}:h,n.prototype._slice=u.Array.prototype.subarray||u.Array.prototype.slice,n.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,i(this,10);return e}}(),n.prototype.int32=function(){return 0|this.uint32()},n.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},n.prototype.bool=function(){return 0!==this.uint32()},n.prototype.fixed32=function(){if(this.pos+4>this.len)throw i(this,4);return a(this.buf,this.pos+=4)},n.prototype.sfixed32=function(){if(this.pos+4>this.len)throw i(this,4);return 0|a(this.buf,this.pos+=4)};var p="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,i){return t[0]=r[i],t[1]=r[i+1],t[2]=r[i+2],t[3]=r[i+3],e[0]}:function(r,i){return t[0]=r[i+3],t[1]=r[i+2],t[2]=r[i+1],t[3]=r[i],e[0]}}():function(e,t){var r=a(e,t+4),i=2*(r>>31)+1,n=r>>>23&255,o=8388607&r;return 255===n?o?NaN:i*(1/0):0===n?1.401298464324817e-45*i*o:i*Math.pow(2,n-150)*(o+8388608)};n.prototype.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=p(this.buf,this.pos);return this.pos+=4,e};var f="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,i){return t[0]=r[i],t[1]=r[i+1],t[2]=r[i+2],t[3]=r[i+3],t[4]=r[i+4],t[5]=r[i+5],t[6]=r[i+6],t[7]=r[i+7],e[0]}:function(r,i){return t[0]=r[i+7],t[1]=r[i+6],t[2]=r[i+5],t[3]=r[i+4],t[4]=r[i+3],t[5]=r[i+2],t[6]=r[i+1],t[7]=r[i],e[0]}}():function(e,t){var r=a(e,t+4),i=a(e,t+8),n=2*(i>>31)+1,o=i>>>20&2047,s=4294967296*(1048575&i)+r;return 2047===o?s?NaN:n*(1/0):0===o?5e-324*n*s:n*Math.pow(2,o-1075)*(s+4503599627370496)};n.prototype.double=function(){if(this.pos+8>this.len)throw i(this,4);var e=f(this.buf,this.pos);return this.pos+=8,e},n.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw i(this,e);return this.pos+=e,t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},n.prototype.string=function(){var e=this.bytes();return d.read(e,0,e.length)},n.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw i(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw i(this)}while(128&this.buf[this.pos++]);return this},n.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},n._configure=function(e){l=e;var t=u.Long?"toLong":"toNumber";u.merge(n.prototype,{int64:function(){return o.call(this)[t](!1)},uint64:function(){return o.call(this)[t](!0)},sint64:function(){return o.call(this).zzDecode()[t](!1)},fixed64:function(){return s.call(this)[t](!0)},sfixed64:function(){return s.call(this)[t](!1)}})}},{13:13}],9:[function(e,t,r){function i(e){n.call(this,e)}t.exports=i;var n=e(8);(i.prototype=Object.create(n.prototype)).constructor=i;var o=e(13);o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice),i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}},{13:13,8:8}],10:[function(e,t,r){r.Service=e(11)},{11:11}],11:[function(e,t,r){function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}t.exports=i;var n=e(13);(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,i,o);if(!s.rpcImpl)return setTimeout(function(){a(Error("already ended"))},0),undefined;try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(e,r){if(e)return s.emit("error",e,t),a(e);if(null===r)return s.end(!0),undefined;if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)})}catch(e){return s.emit("error",e,t),setTimeout(function(){a(e)},0),undefined}},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{13:13}],12:[function(e,t,r){function i(e,t){this.lo=e>>>0,this.hi=t>>>0}t.exports=i;var n=e(13),o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?o:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},{13:13}],13:[function(e,t,r){function i(e,t,r){for(var i=Object.keys(t),n=0;n<i.length;++n)e[i[n]]!==undefined&&r||(e[i[n]]=t[i[n]]);return e}function n(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}var o=r;o.asPromise=e(1),o.base64=e(2),o.EventEmitter=e(3),o.inquire=e(4),o.utf8=e(6),o.pool=e(5),o.LongBits=e(12),o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isNode=Boolean(global.process&&global.process.versions&&global.process.versions.node),o.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},o.isString=function(e){return"string"==typeof e||e instanceof String},o.isObject=function(e){return e&&"object"==typeof e},o.Buffer=function(){try{var e=o.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(e){return"number"==typeof e?o.Buffer?o._Buffer_allocUnsafe(e):new o.Array(e):o.Buffer?o._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,
o.Long=global.dcodeIO&&global.dcodeIO.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.longFromHash=function(e,t){var r=o.LongBits.fromHash(e);return o.Long?o.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},o.merge=i,o.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},o.newError=n,o.ProtocolError=n("ProtocolError"),o.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&this[e[r]]!==undefined&&null!==this[e[r]])return e[r]}},o.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},o.lazyResolve=function(e,t){for(var r=0;r<t.length;++r)for(var i=Object.keys(t[r]),n=0;n<i.length;++n){for(var o=t[r][i[n]].split("."),a=e;o.length;)a=a[o.shift()];t[r][i[n]]=a}},o.toJSONOptions={longs:String,enums:String,bytes:String},o._configure=function(){var e=o.Buffer;if(!e)return void(o._Buffer_from=o._Buffer_allocUnsafe=null);o._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},o._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}}},{1:1,12:12,2:2,3:3,4:4,5:5,6:6}],14:[function(e,t,r){function i(e,t,r){this.fn=e,this.len=t,this.next=undefined,this.val=r}function n(){}function o(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function a(){this.len=0,this.head=new i(n,0,0),this.tail=this.head,this.states=null}function s(e,t,r){t[r]=255&e}function l(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e}function u(e,t){this.len=e,this.next=undefined,this.val=t}function c(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function d(e,t,r){t[r++]=255&e,t[r++]=e>>>8&255,t[r++]=e>>>16&255,t[r]=e>>>24}t.exports=a;var h,p=e(13),f=p.LongBits,m=p.base64,g=p.utf8;a.create=p.Buffer?function(){return(a.create=function(){return new h})()}:function(){return new a},a.alloc=function(e){return new p.Array(e)},p.Array!==Array&&(a.alloc=p.pool(a.alloc,p.Array.prototype.subarray)),a.prototype.push=function(e,t,r){return this.tail=this.tail.next=new i(e,t,r),this.len+=t,this},u.prototype=Object.create(i.prototype),u.prototype.fn=l,a.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new u((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},a.prototype.int32=function(e){return e<0?this.push(c,10,f.fromNumber(e)):this.uint32(e)},a.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},a.prototype.uint64=function(e){var t=f.from(e);return this.push(c,t.length(),t)},a.prototype.int64=a.prototype.uint64,a.prototype.sint64=function(e){var t=f.from(e).zzEncode();return this.push(c,t.length(),t)},a.prototype.bool=function(e){return this.push(s,1,e?1:0)},a.prototype.fixed32=function(e){return this.push(d,4,e>>>0)},a.prototype.sfixed32=a.prototype.fixed32,a.prototype.fixed64=function(e){var t=f.from(e);return this.push(d,4,t.lo).push(d,4,t.hi)},a.prototype.sfixed64=a.prototype.fixed64;var _="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,i,n){e[0]=r,i[n++]=t[0],i[n++]=t[1],i[n++]=t[2],i[n]=t[3]}:function(r,i,n){e[0]=r,i[n++]=t[3],i[n++]=t[2],i[n++]=t[1],i[n]=t[0]}}():function(e,t,r){var i=e<0?1:0;if(i&&(e=-e),0===e)d(1/e>0?0:2147483648,t,r);else if(isNaN(e))d(2147483647,t,r);else if(e>3.4028234663852886e38)d((i<<31|2139095040)>>>0,t,r);else if(e<1.1754943508222875e-38)d((i<<31|Math.round(e/1.401298464324817e-45))>>>0,t,r);else{var n=Math.floor(Math.log(e)/Math.LN2),o=8388607&Math.round(e*Math.pow(2,-n)*8388608);d((i<<31|n+127<<23|o)>>>0,t,r)}};a.prototype.float=function(e){return this.push(_,4,e)};var v="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,i,n){e[0]=r,i[n++]=t[0],i[n++]=t[1],i[n++]=t[2],i[n++]=t[3],i[n++]=t[4],i[n++]=t[5],i[n++]=t[6],i[n]=t[7]}:function(r,i,n){e[0]=r,i[n++]=t[7],i[n++]=t[6],i[n++]=t[5],i[n++]=t[4],i[n++]=t[3],i[n++]=t[2],i[n++]=t[1],i[n]=t[0]}}():function(e,t,r){var i=e<0?1:0;if(i&&(e=-e),0===e)d(0,t,r),d(1/e>0?0:2147483648,t,r+4);else if(isNaN(e))d(4294967295,t,r),d(2147483647,t,r+4);else if(e>1.7976931348623157e308)d(0,t,r),d((i<<31|2146435072)>>>0,t,r+4);else{var n;if(e<2.2250738585072014e-308)n=e/5e-324,d(n>>>0,t,r),d((i<<31|n/4294967296)>>>0,t,r+4);else{var o=Math.floor(Math.log(e)/Math.LN2);1024===o&&(o=1023),n=e*Math.pow(2,-o),d(4503599627370496*n>>>0,t,r),d((i<<31|o+1023<<20|1048576*n&1048575)>>>0,t,r+4)}}};a.prototype.double=function(e){return this.push(v,8,e)};var y=p.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i<e.length;++i)t[r+i]=e[i]};a.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this.push(s,1,0);if(p.isString(e)){var r=a.alloc(t=m.length(e));m.decode(e,r,0),e=r}return this.uint32(t).push(y,t,e)},a.prototype.string=function(e){var t=g.length(e);return t?this.uint32(t).push(g.write,t,e):this.push(s,1,0)},a.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new i(n,0,0),this.len=0,this},a.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new i(n,0,0),this.len=0),this},a.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},a.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},a._configure=function(e){h=e}},{13:13}],15:[function(e,t,r){function i(){o.call(this)}function n(e,t,r){e.length<40?a.utf8.write(e,t,r):t.utf8Write(e,r)}t.exports=i;var o=e(14);(i.prototype=Object.create(o.prototype)).constructor=i;var a=e(13),s=a.Buffer;i.alloc=function(e){return(i.alloc=a._Buffer_allocUnsafe)(e)};var l=s&&s.prototype instanceof Uint8Array&&"set"===s.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var i=0;i<e.length;)t[r++]=e[i++]};i.prototype.bytes=function(e){a.isString(e)&&(e=a._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this.push(l,t,e),this},i.prototype.string=function(e){var t=s.byteLength(e);return this.uint32(t),t&&this.push(n,t,e),this}},{13:13,14:14}]},{},[7])}("object"==typeof window&&window||"object"==typeof self&&self||this),define("ThirdParty/google-earth-dbroot-parser",["./protobuf-minimal"],function(e){"use strict";var t=e.Reader,r=(e.Writer,e.util),i=[],n=e.roots.default||(e.roots.default={});return n.keyhole=function(){var o={};return o.dbroot=function(){var o={};return o.StringEntryProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.stringId=0,i.prototype.stringValue="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StringEntryProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.stringId=e.fixed32();break;case 2:o.stringValue=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.stringId)?r.isString(e.stringValue)?null:"stringValue: string expected":"stringId: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StringEntryProto)return e;var t=new n.keyhole.dbroot.StringEntryProto;return void 0!==e.stringId&&null!==e.stringId&&(t.stringId=e.stringId>>>0),void 0!==e.stringValue&&null!==e.stringValue&&(t.stringValue=String(e.stringValue)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.stringId=0,r.stringValue=""),void 0!==e.stringId&&null!==e.stringId&&e.hasOwnProperty("stringId")&&(r.stringId=e.stringId),void 0!==e.stringValue&&null!==e.stringValue&&e.hasOwnProperty("stringValue")&&(r.stringValue=e.stringValue),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.StringIdOrValueProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.stringId=0,i.prototype.value="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StringIdOrValueProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.stringId=e.fixed32();break;case 2:o.value=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.stringId||r.isInteger(e.stringId)?void 0===e.value||r.isString(e.value)?null:"value: string expected":"stringId: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StringIdOrValueProto)return e;var t=new n.keyhole.dbroot.StringIdOrValueProto;return void 0!==e.stringId&&null!==e.stringId&&(t.stringId=e.stringId>>>0),void 0!==e.value&&null!==e.value&&(t.value=String(e.value)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.stringId=0,r.value=""),void 0!==e.stringId&&null!==e.stringId&&e.hasOwnProperty("stringId")&&(r.stringId=e.stringId),void 0!==e.value&&null!==e.value&&e.hasOwnProperty("value")&&(r.value=e.value),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.PlanetModelProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.radius=6378.137,i.prototype.flattening=.00335281066474748,i.prototype.elevationBias=0,i.prototype.negativeAltitudeExponentBias=0,i.prototype.compressedNegativeAltitudeThreshold=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.PlanetModelProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.radius=e.double();break;case 2:o.flattening=e.double();break;case 4:o.elevationBias=e.double();break;case 5:o.negativeAltitudeExponentBias=e.int32();break;case 6:o.compressedNegativeAltitudeThreshold=e.double();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.radius&&"number"!=typeof e.radius?"radius: number expected":void 0!==e.flattening&&"number"!=typeof e.flattening?"flattening: number expected":void 0!==e.elevationBias&&"number"!=typeof e.elevationBias?"elevationBias: number expected":void 0===e.negativeAltitudeExponentBias||r.isInteger(e.negativeAltitudeExponentBias)?void 0!==e.compressedNegativeAltitudeThreshold&&"number"!=typeof e.compressedNegativeAltitudeThreshold?"compressedNegativeAltitudeThreshold: number expected":null:"negativeAltitudeExponentBias: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PlanetModelProto)return e;var t=new n.keyhole.dbroot.PlanetModelProto;return void 0!==e.radius&&null!==e.radius&&(t.radius=Number(e.radius)),void 0!==e.flattening&&null!==e.flattening&&(t.flattening=Number(e.flattening)),void 0!==e.elevationBias&&null!==e.elevationBias&&(t.elevationBias=Number(e.elevationBias)),void 0!==e.negativeAltitudeExponentBias&&null!==e.negativeAltitudeExponentBias&&(t.negativeAltitudeExponentBias=0|e.negativeAltitudeExponentBias),void 0!==e.compressedNegativeAltitudeThreshold&&null!==e.compressedNegativeAltitudeThreshold&&(t.compressedNegativeAltitudeThreshold=Number(e.compressedNegativeAltitudeThreshold)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.radius=6378.137,r.flattening=.00335281066474748,r.elevationBias=0,r.negativeAltitudeExponentBias=0,r.compressedNegativeAltitudeThreshold=0),void 0!==e.radius&&null!==e.radius&&e.hasOwnProperty("radius")&&(r.radius=e.radius),void 0!==e.flattening&&null!==e.flattening&&e.hasOwnProperty("flattening")&&(r.flattening=e.flattening),void 0!==e.elevationBias&&null!==e.elevationBias&&e.hasOwnProperty("elevationBias")&&(r.elevationBias=e.elevationBias),void 0!==e.negativeAltitudeExponentBias&&null!==e.negativeAltitudeExponentBias&&e.hasOwnProperty("negativeAltitudeExponentBias")&&(r.negativeAltitudeExponentBias=e.negativeAltitudeExponentBias),void 0!==e.compressedNegativeAltitudeThreshold&&null!==e.compressedNegativeAltitudeThreshold&&e.hasOwnProperty("compressedNegativeAltitudeThreshold")&&(r.compressedNegativeAltitudeThreshold=e.compressedNegativeAltitudeThreshold),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.ProviderInfoProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.providerId=0,o.prototype.copyrightString=null,o.prototype.verticalPixelOffset=-1;var a={1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ProviderInfoProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.providerId=e.int32();break;case 2:o.copyrightString=a[1].decode(e,e.uint32());break;case 3:o.verticalPixelOffset=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.providerId))return"providerId: integer expected";if(void 0!==e.copyrightString&&null!==e.copyrightString){var t=a[1].verify(e.copyrightString);if(t)return"copyrightString."+t}return void 0===e.verticalPixelOffset||r.isInteger(e.verticalPixelOffset)?null:"verticalPixelOffset: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ProviderInfoProto)return e;var t=new n.keyhole.dbroot.ProviderInfoProto;if(void 0!==e.providerId&&null!==e.providerId&&(t.providerId=0|e.providerId),void 0!==e.copyrightString&&null!==e.copyrightString){if("object"!=typeof e.copyrightString)throw TypeError(".keyhole.dbroot.ProviderInfoProto.copyrightString: object expected");t.copyrightString=a[1].fromObject(e.copyrightString)}return void 0!==e.verticalPixelOffset&&null!==e.verticalPixelOffset&&(t.verticalPixelOffset=0|e.verticalPixelOffset),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.providerId=0,r.copyrightString=null,r.verticalPixelOffset=-1),void 0!==e.providerId&&null!==e.providerId&&e.hasOwnProperty("providerId")&&(r.providerId=e.providerId),void 0!==e.copyrightString&&null!==e.copyrightString&&e.hasOwnProperty("copyrightString")&&(r.copyrightString=a[1].toObject(e.copyrightString,t)),void 0!==e.verticalPixelOffset&&null!==e.verticalPixelOffset&&e.hasOwnProperty("verticalPixelOffset")&&(r.verticalPixelOffset=e.verticalPixelOffset),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.PopUpProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.isBalloonStyle=!1,o.prototype.text=null,o.prototype.backgroundColorAbgr=4294967295,o.prototype.textColorAbgr=4278190080;var a={1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.PopUpProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.isBalloonStyle=e.bool();break;case 2:o.text=a[1].decode(e,e.uint32());break;case 3:o.backgroundColorAbgr=e.fixed32();break;case 4:o.textColorAbgr=e.fixed32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.isBalloonStyle&&"boolean"!=typeof e.isBalloonStyle)return"isBalloonStyle: boolean expected";if(void 0!==e.text&&null!==e.text){var t=a[1].verify(e.text);if(t)return"text."+t}return void 0===e.backgroundColorAbgr||r.isInteger(e.backgroundColorAbgr)?void 0===e.textColorAbgr||r.isInteger(e.textColorAbgr)?null:"textColorAbgr: integer expected":"backgroundColorAbgr: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PopUpProto)return e;var t=new n.keyhole.dbroot.PopUpProto;if(void 0!==e.isBalloonStyle&&null!==e.isBalloonStyle&&(t.isBalloonStyle=Boolean(e.isBalloonStyle)),void 0!==e.text&&null!==e.text){if("object"!=typeof e.text)throw TypeError(".keyhole.dbroot.PopUpProto.text: object expected");t.text=a[1].fromObject(e.text)}return void 0!==e.backgroundColorAbgr&&null!==e.backgroundColorAbgr&&(t.backgroundColorAbgr=e.backgroundColorAbgr>>>0),void 0!==e.textColorAbgr&&null!==e.textColorAbgr&&(t.textColorAbgr=e.textColorAbgr>>>0),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.isBalloonStyle=!1,r.text=null,r.backgroundColorAbgr=4294967295,r.textColorAbgr=4278190080),void 0!==e.isBalloonStyle&&null!==e.isBalloonStyle&&e.hasOwnProperty("isBalloonStyle")&&(r.isBalloonStyle=e.isBalloonStyle),void 0!==e.text&&null!==e.text&&e.hasOwnProperty("text")&&(r.text=a[1].toObject(e.text,t)),void 0!==e.backgroundColorAbgr&&null!==e.backgroundColorAbgr&&e.hasOwnProperty("backgroundColorAbgr")&&(r.backgroundColorAbgr=e.backgroundColorAbgr),void 0!==e.textColorAbgr&&null!==e.textColorAbgr&&e.hasOwnProperty("textColorAbgr")&&(r.textColorAbgr=e.textColorAbgr),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.StyleAttributeProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.styleId="",o.prototype.providerId=0,o.prototype.polyColorAbgr=4294967295,o.prototype.lineColorAbgr=4294967295,o.prototype.lineWidth=1,o.prototype.labelColorAbgr=4294967295,o.prototype.labelScale=1,o.prototype.placemarkIconColorAbgr=4294967295,o.prototype.placemarkIconScale=1,o.prototype.placemarkIconPath=null,o.prototype.placemarkIconX=0,o.prototype.placemarkIconY=0,o.prototype.placemarkIconWidth=32,o.prototype.placemarkIconHeight=32,o.prototype.popUp=null,o.prototype.drawFlag=r.emptyArray;var a={9:"keyhole.dbroot.StringIdOrValueProto",14:"keyhole.dbroot.PopUpProto",15:"keyhole.dbroot.DrawFlagProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StyleAttributeProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.styleId=e.string();break;case 3:o.providerId=e.int32();break;case 4:o.polyColorAbgr=e.fixed32();break;case 5:o.lineColorAbgr=e.fixed32();break;case 6:o.lineWidth=e.float();break;case 7:o.labelColorAbgr=e.fixed32();break;case 8:o.labelScale=e.float();break;case 9:o.placemarkIconColorAbgr=e.fixed32();break;case 10:o.placemarkIconScale=e.float();break;case 11:o.placemarkIconPath=a[9].decode(e,e.uint32());break;case 12:o.placemarkIconX=e.int32();break;case 13:o.placemarkIconY=e.int32();break;case 14:o.placemarkIconWidth=e.int32();break;case 15:o.placemarkIconHeight=e.int32();break;case 16:o.popUp=a[14].decode(e,e.uint32());break;case 17:o.drawFlag&&o.drawFlag.length||(o.drawFlag=[]),o.drawFlag.push(a[15].decode(e,e.uint32()));break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.styleId))return"styleId: string expected";if(void 0!==e.providerId&&!r.isInteger(e.providerId))return"providerId: integer expected";if(void 0!==e.polyColorAbgr&&!r.isInteger(e.polyColorAbgr))return"polyColorAbgr: integer expected";if(void 0!==e.lineColorAbgr&&!r.isInteger(e.lineColorAbgr))return"lineColorAbgr: integer expected";if(void 0!==e.lineWidth&&"number"!=typeof e.lineWidth)return"lineWidth: number expected";if(void 0!==e.labelColorAbgr&&!r.isInteger(e.labelColorAbgr))return"labelColorAbgr: integer expected";if(void 0!==e.labelScale&&"number"!=typeof e.labelScale)return"labelScale: number expected";if(void 0!==e.placemarkIconColorAbgr&&!r.isInteger(e.placemarkIconColorAbgr))return"placemarkIconColorAbgr: integer expected";if(void 0!==e.placemarkIconScale&&"number"!=typeof e.placemarkIconScale)return"placemarkIconScale: number expected";if(void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath){var t=a[9].verify(e.placemarkIconPath);if(t)return"placemarkIconPath."+t}if(void 0!==e.placemarkIconX&&!r.isInteger(e.placemarkIconX))return"placemarkIconX: integer expected";if(void 0!==e.placemarkIconY&&!r.isInteger(e.placemarkIconY))return"placemarkIconY: integer expected";if(void 0!==e.placemarkIconWidth&&!r.isInteger(e.placemarkIconWidth))return"placemarkIconWidth: integer expected";if(void 0!==e.placemarkIconHeight&&!r.isInteger(e.placemarkIconHeight))return"placemarkIconHeight: integer expected";if(void 0!==e.popUp&&null!==e.popUp){var t=a[14].verify(e.popUp);if(t)return"popUp."+t}if(void 0!==e.drawFlag){if(!Array.isArray(e.drawFlag))return"drawFlag: array expected";for(var i=0;i<e.drawFlag.length;++i){var t=a[15].verify(e.drawFlag[i]);if(t)return"drawFlag."+t}}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StyleAttributeProto)return e;var t=new n.keyhole.dbroot.StyleAttributeProto;if(void 0!==e.styleId&&null!==e.styleId&&(t.styleId=String(e.styleId)),void 0!==e.providerId&&null!==e.providerId&&(t.providerId=0|e.providerId),void 0!==e.polyColorAbgr&&null!==e.polyColorAbgr&&(t.polyColorAbgr=e.polyColorAbgr>>>0),void 0!==e.lineColorAbgr&&null!==e.lineColorAbgr&&(t.lineColorAbgr=e.lineColorAbgr>>>0),void 0!==e.lineWidth&&null!==e.lineWidth&&(t.lineWidth=Number(e.lineWidth)),void 0!==e.labelColorAbgr&&null!==e.labelColorAbgr&&(t.labelColorAbgr=e.labelColorAbgr>>>0),void 0!==e.labelScale&&null!==e.labelScale&&(t.labelScale=Number(e.labelScale)),void 0!==e.placemarkIconColorAbgr&&null!==e.placemarkIconColorAbgr&&(t.placemarkIconColorAbgr=e.placemarkIconColorAbgr>>>0),void 0!==e.placemarkIconScale&&null!==e.placemarkIconScale&&(t.placemarkIconScale=Number(e.placemarkIconScale)),void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath){if("object"!=typeof e.placemarkIconPath)throw TypeError(".keyhole.dbroot.StyleAttributeProto.placemarkIconPath: object expected");t.placemarkIconPath=a[9].fromObject(e.placemarkIconPath)}if(void 0!==e.placemarkIconX&&null!==e.placemarkIconX&&(t.placemarkIconX=0|e.placemarkIconX),void 0!==e.placemarkIconY&&null!==e.placemarkIconY&&(t.placemarkIconY=0|e.placemarkIconY),void 0!==e.placemarkIconWidth&&null!==e.placemarkIconWidth&&(t.placemarkIconWidth=0|e.placemarkIconWidth),void 0!==e.placemarkIconHeight&&null!==e.placemarkIconHeight&&(t.placemarkIconHeight=0|e.placemarkIconHeight),void 0!==e.popUp&&null!==e.popUp){if("object"!=typeof e.popUp)throw TypeError(".keyhole.dbroot.StyleAttributeProto.popUp: object expected");t.popUp=a[14].fromObject(e.popUp)}if(e.drawFlag){if(!Array.isArray(e.drawFlag))throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: array expected");t.drawFlag=[];for(var r=0;r<e.drawFlag.length;++r){if("object"!=typeof e.drawFlag[r])throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: object expected");t.drawFlag[r]=a[15].fromObject(e.drawFlag[r])}}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.drawFlag=[]),t.defaults&&(r.styleId="",r.providerId=0,r.polyColorAbgr=4294967295,r.lineColorAbgr=4294967295,r.lineWidth=1,r.labelColorAbgr=4294967295,r.labelScale=1,r.placemarkIconColorAbgr=4294967295,r.placemarkIconScale=1,r.placemarkIconPath=null,r.placemarkIconX=0,r.placemarkIconY=0,r.placemarkIconWidth=32,r.placemarkIconHeight=32,r.popUp=null),void 0!==e.styleId&&null!==e.styleId&&e.hasOwnProperty("styleId")&&(r.styleId=e.styleId),void 0!==e.providerId&&null!==e.providerId&&e.hasOwnProperty("providerId")&&(r.providerId=e.providerId),void 0!==e.polyColorAbgr&&null!==e.polyColorAbgr&&e.hasOwnProperty("polyColorAbgr")&&(r.polyColorAbgr=e.polyColorAbgr),void 0!==e.lineColorAbgr&&null!==e.lineColorAbgr&&e.hasOwnProperty("lineColorAbgr")&&(r.lineColorAbgr=e.lineColorAbgr),void 0!==e.lineWidth&&null!==e.lineWidth&&e.hasOwnProperty("lineWidth")&&(r.lineWidth=e.lineWidth),void 0!==e.labelColorAbgr&&null!==e.labelColorAbgr&&e.hasOwnProperty("labelColorAbgr")&&(r.labelColorAbgr=e.labelColorAbgr),void 0!==e.labelScale&&null!==e.labelScale&&e.hasOwnProperty("labelScale")&&(r.labelScale=e.labelScale),void 0!==e.placemarkIconColorAbgr&&null!==e.placemarkIconColorAbgr&&e.hasOwnProperty("placemarkIconColorAbgr")&&(r.placemarkIconColorAbgr=e.placemarkIconColorAbgr),void 0!==e.placemarkIconScale&&null!==e.placemarkIconScale&&e.hasOwnProperty("placemarkIconScale")&&(r.placemarkIconScale=e.placemarkIconScale),void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath&&e.hasOwnProperty("placemarkIconPath")&&(r.placemarkIconPath=a[9].toObject(e.placemarkIconPath,t)),void 0!==e.placemarkIconX&&null!==e.placemarkIconX&&e.hasOwnProperty("placemarkIconX")&&(r.placemarkIconX=e.placemarkIconX),void 0!==e.placemarkIconY&&null!==e.placemarkIconY&&e.hasOwnProperty("placemarkIconY")&&(r.placemarkIconY=e.placemarkIconY),void 0!==e.placemarkIconWidth&&null!==e.placemarkIconWidth&&e.hasOwnProperty("placemarkIconWidth")&&(r.placemarkIconWidth=e.placemarkIconWidth),void 0!==e.placemarkIconHeight&&null!==e.placemarkIconHeight&&e.hasOwnProperty("placemarkIconHeight")&&(r.placemarkIconHeight=e.placemarkIconHeight),void 0!==e.popUp&&null!==e.popUp&&e.hasOwnProperty("popUp")&&(r.popUp=a[14].toObject(e.popUp,t)),void 0!==e.drawFlag&&null!==e.drawFlag&&e.hasOwnProperty("drawFlag")){r.drawFlag=[];for(var i=0;i<e.drawFlag.length;++i)r.drawFlag[i]=a[15].toObject(e.drawFlag[i],t)}return r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.StyleMapProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.styleMapId=0,i.prototype.channelId=r.emptyArray,i.prototype.normalStyleAttribute=0,i.prototype.highlightStyleAttribute=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StyleMapProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.styleMapId=e.int32();break;case 2:if(o.channelId&&o.channelId.length||(o.channelId=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)o.channelId.push(e.int32());else o.channelId.push(e.int32());break;case 3:o.normalStyleAttribute=e.int32();break;case 4:o.highlightStyleAttribute=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.styleMapId))return"styleMapId: integer expected";if(void 0!==e.channelId){if(!Array.isArray(e.channelId))return"channelId: array expected";for(var t=0;t<e.channelId.length;++t)if(!r.isInteger(e.channelId[t]))return"channelId: integer[] expected"}return void 0===e.normalStyleAttribute||r.isInteger(e.normalStyleAttribute)?void 0===e.highlightStyleAttribute||r.isInteger(e.highlightStyleAttribute)?null:"highlightStyleAttribute: integer expected":"normalStyleAttribute: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StyleMapProto)return e;var t=new n.keyhole.dbroot.StyleMapProto;if(void 0!==e.styleMapId&&null!==e.styleMapId&&(t.styleMapId=0|e.styleMapId),e.channelId){if(!Array.isArray(e.channelId))throw TypeError(".keyhole.dbroot.StyleMapProto.channelId: array expected");t.channelId=[];for(var r=0;r<e.channelId.length;++r)t.channelId[r]=0|e.channelId[r]}return void 0!==e.normalStyleAttribute&&null!==e.normalStyleAttribute&&(t.normalStyleAttribute=0|e.normalStyleAttribute),void 0!==e.highlightStyleAttribute&&null!==e.highlightStyleAttribute&&(t.highlightStyleAttribute=0|e.highlightStyleAttribute),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.channelId=[]),t.defaults&&(r.styleMapId=0,r.normalStyleAttribute=0,r.highlightStyleAttribute=0),void 0!==e.styleMapId&&null!==e.styleMapId&&e.hasOwnProperty("styleMapId")&&(r.styleMapId=e.styleMapId),void 0!==e.channelId&&null!==e.channelId&&e.hasOwnProperty("channelId")){r.channelId=[];for(var i=0;i<e.channelId.length;++i)r.channelId[i]=e.channelId[i]}return void 0!==e.normalStyleAttribute&&null!==e.normalStyleAttribute&&e.hasOwnProperty("normalStyleAttribute")&&(r.normalStyleAttribute=e.normalStyleAttribute),void 0!==e.highlightStyleAttribute&&null!==e.highlightStyleAttribute&&e.hasOwnProperty("highlightStyleAttribute")&&(r.highlightStyleAttribute=e.highlightStyleAttribute),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.ZoomRangeProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.minZoom=0,i.prototype.maxZoom=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ZoomRangeProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.minZoom=e.int32();break;case 2:o.maxZoom=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.minZoom)?r.isInteger(e.maxZoom)?null:"maxZoom: integer expected":"minZoom: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ZoomRangeProto)return e;var t=new n.keyhole.dbroot.ZoomRangeProto;return void 0!==e.minZoom&&null!==e.minZoom&&(t.minZoom=0|e.minZoom),void 0!==e.maxZoom&&null!==e.maxZoom&&(t.maxZoom=0|e.maxZoom),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.minZoom=0,r.maxZoom=0),void 0!==e.minZoom&&null!==e.minZoom&&e.hasOwnProperty("minZoom")&&(r.minZoom=e.minZoom),void 0!==e.maxZoom&&null!==e.maxZoom&&e.hasOwnProperty("maxZoom")&&(r.maxZoom=e.maxZoom),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.DrawFlagProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.drawFlagType=1;var o={0:"keyhole.dbroot.DrawFlagProto.DrawFlagType"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DrawFlagProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.drawFlagType=e.uint32();break;default:e.skipType(7&a)}}return o},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";switch(e.drawFlagType){default:return"drawFlagType: enum value expected";case 1:case 2:case 3:case 4:case 5:}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DrawFlagProto)return e;var t=new n.keyhole.dbroot.DrawFlagProto;switch(e.drawFlagType){case"TYPE_FILL_ONLY":case 1:t.drawFlagType=1;break;case"TYPE_OUTLINE_ONLY":case 2:t.drawFlagType=2;break;case"TYPE_FILL_AND_OUTLINE":case 3:t.drawFlagType=3;break;case"TYPE_ANTIALIASING":case 4:t.drawFlagType=4;break;case"TYPE_CENTER_LABEL":case 5:t.drawFlagType=5}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.drawFlagType=t.enums===String?"TYPE_FILL_ONLY":1),void 0!==e.drawFlagType&&null!==e.drawFlagType&&e.hasOwnProperty("drawFlagType")&&(r.drawFlagType=t.enums===String?o[0][e.drawFlagType]:e.drawFlagType),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r.DrawFlagType=function(){var e={},t=Object.create(e);return t.TYPE_FILL_ONLY=1,t.TYPE_OUTLINE_ONLY=2,t.TYPE_FILL_AND_OUTLINE=3,
t.TYPE_ANTIALIASING=4,t.TYPE_CENTER_LABEL=5,t}(),r}(),o.LayerProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.zoomRange=r.emptyArray,o.prototype.preserveTextLevel=30,o.prototype.lodBeginTransition=!1,o.prototype.lodEndTransition=!1;var a={0:"keyhole.dbroot.ZoomRangeProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.LayerProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.zoomRange&&o.zoomRange.length||(o.zoomRange=[]),o.zoomRange.push(a[0].decode(e,e.uint32()));break;case 2:o.preserveTextLevel=e.int32();break;case 4:o.lodBeginTransition=e.bool();break;case 5:o.lodEndTransition=e.bool();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.zoomRange){if(!Array.isArray(e.zoomRange))return"zoomRange: array expected";for(var t=0;t<e.zoomRange.length;++t){var i=a[0].verify(e.zoomRange[t]);if(i)return"zoomRange."+i}}return void 0===e.preserveTextLevel||r.isInteger(e.preserveTextLevel)?void 0!==e.lodBeginTransition&&"boolean"!=typeof e.lodBeginTransition?"lodBeginTransition: boolean expected":void 0!==e.lodEndTransition&&"boolean"!=typeof e.lodEndTransition?"lodEndTransition: boolean expected":null:"preserveTextLevel: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LayerProto)return e;var t=new n.keyhole.dbroot.LayerProto;if(e.zoomRange){if(!Array.isArray(e.zoomRange))throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: array expected");t.zoomRange=[];for(var r=0;r<e.zoomRange.length;++r){if("object"!=typeof e.zoomRange[r])throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: object expected");t.zoomRange[r]=a[0].fromObject(e.zoomRange[r])}}return void 0!==e.preserveTextLevel&&null!==e.preserveTextLevel&&(t.preserveTextLevel=0|e.preserveTextLevel),void 0!==e.lodBeginTransition&&null!==e.lodBeginTransition&&(t.lodBeginTransition=Boolean(e.lodBeginTransition)),void 0!==e.lodEndTransition&&null!==e.lodEndTransition&&(t.lodEndTransition=Boolean(e.lodEndTransition)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.zoomRange=[]),t.defaults&&(r.preserveTextLevel=30,r.lodBeginTransition=!1,r.lodEndTransition=!1),void 0!==e.zoomRange&&null!==e.zoomRange&&e.hasOwnProperty("zoomRange")){r.zoomRange=[];for(var i=0;i<e.zoomRange.length;++i)r.zoomRange[i]=a[0].toObject(e.zoomRange[i],t)}return void 0!==e.preserveTextLevel&&null!==e.preserveTextLevel&&e.hasOwnProperty("preserveTextLevel")&&(r.preserveTextLevel=e.preserveTextLevel),void 0!==e.lodBeginTransition&&null!==e.lodBeginTransition&&e.hasOwnProperty("lodBeginTransition")&&(r.lodBeginTransition=e.lodBeginTransition),void 0!==e.lodEndTransition&&null!==e.lodEndTransition&&e.hasOwnProperty("lodEndTransition")&&(r.lodEndTransition=e.lodEndTransition),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.FolderProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.isExpandable=!0,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.FolderProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.isExpandable=e.bool();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.isExpandable&&"boolean"!=typeof e.isExpandable?"isExpandable: boolean expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.FolderProto)return e;var t=new n.keyhole.dbroot.FolderProto;return void 0!==e.isExpandable&&null!==e.isExpandable&&(t.isExpandable=Boolean(e.isExpandable)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.isExpandable=!0),void 0!==e.isExpandable&&null!==e.isExpandable&&e.hasOwnProperty("isExpandable")&&(r.isExpandable=e.isExpandable),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.RequirementProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.requiredVram="",i.prototype.requiredClientVer="",i.prototype.probability="",i.prototype.requiredUserAgent="",i.prototype.requiredClientCapabilities="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.RequirementProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 3:o.requiredVram=e.string();break;case 4:o.requiredClientVer=e.string();break;case 5:o.probability=e.string();break;case 6:o.requiredUserAgent=e.string();break;case 7:o.requiredClientCapabilities=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.requiredVram||r.isString(e.requiredVram)?void 0===e.requiredClientVer||r.isString(e.requiredClientVer)?void 0===e.probability||r.isString(e.probability)?void 0===e.requiredUserAgent||r.isString(e.requiredUserAgent)?void 0===e.requiredClientCapabilities||r.isString(e.requiredClientCapabilities)?null:"requiredClientCapabilities: string expected":"requiredUserAgent: string expected":"probability: string expected":"requiredClientVer: string expected":"requiredVram: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.RequirementProto)return e;var t=new n.keyhole.dbroot.RequirementProto;return void 0!==e.requiredVram&&null!==e.requiredVram&&(t.requiredVram=String(e.requiredVram)),void 0!==e.requiredClientVer&&null!==e.requiredClientVer&&(t.requiredClientVer=String(e.requiredClientVer)),void 0!==e.probability&&null!==e.probability&&(t.probability=String(e.probability)),void 0!==e.requiredUserAgent&&null!==e.requiredUserAgent&&(t.requiredUserAgent=String(e.requiredUserAgent)),void 0!==e.requiredClientCapabilities&&null!==e.requiredClientCapabilities&&(t.requiredClientCapabilities=String(e.requiredClientCapabilities)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.requiredVram="",r.requiredClientVer="",r.probability="",r.requiredUserAgent="",r.requiredClientCapabilities=""),void 0!==e.requiredVram&&null!==e.requiredVram&&e.hasOwnProperty("requiredVram")&&(r.requiredVram=e.requiredVram),void 0!==e.requiredClientVer&&null!==e.requiredClientVer&&e.hasOwnProperty("requiredClientVer")&&(r.requiredClientVer=e.requiredClientVer),void 0!==e.probability&&null!==e.probability&&e.hasOwnProperty("probability")&&(r.probability=e.probability),void 0!==e.requiredUserAgent&&null!==e.requiredUserAgent&&e.hasOwnProperty("requiredUserAgent")&&(r.requiredUserAgent=e.requiredUserAgent),void 0!==e.requiredClientCapabilities&&null!==e.requiredClientCapabilities&&e.hasOwnProperty("requiredClientCapabilities")&&(r.requiredClientCapabilities=e.requiredClientCapabilities),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.LookAtProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.longitude=0,r.prototype.latitude=0,r.prototype.range=0,r.prototype.tilt=0,r.prototype.heading=0,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.LookAtProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.longitude=e.float();break;case 2:o.latitude=e.float();break;case 3:o.range=e.float();break;case 4:o.tilt=e.float();break;case 5:o.heading=e.float();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":"number"!=typeof e.longitude?"longitude: number expected":"number"!=typeof e.latitude?"latitude: number expected":void 0!==e.range&&"number"!=typeof e.range?"range: number expected":void 0!==e.tilt&&"number"!=typeof e.tilt?"tilt: number expected":void 0!==e.heading&&"number"!=typeof e.heading?"heading: number expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LookAtProto)return e;var t=new n.keyhole.dbroot.LookAtProto;return void 0!==e.longitude&&null!==e.longitude&&(t.longitude=Number(e.longitude)),void 0!==e.latitude&&null!==e.latitude&&(t.latitude=Number(e.latitude)),void 0!==e.range&&null!==e.range&&(t.range=Number(e.range)),void 0!==e.tilt&&null!==e.tilt&&(t.tilt=Number(e.tilt)),void 0!==e.heading&&null!==e.heading&&(t.heading=Number(e.heading)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.longitude=0,r.latitude=0,r.range=0,r.tilt=0,r.heading=0),void 0!==e.longitude&&null!==e.longitude&&e.hasOwnProperty("longitude")&&(r.longitude=e.longitude),void 0!==e.latitude&&null!==e.latitude&&e.hasOwnProperty("latitude")&&(r.latitude=e.latitude),void 0!==e.range&&null!==e.range&&e.hasOwnProperty("range")&&(r.range=e.range),void 0!==e.tilt&&null!==e.tilt&&e.hasOwnProperty("tilt")&&(r.tilt=e.tilt),void 0!==e.heading&&null!==e.heading&&e.hasOwnProperty("heading")&&(r.heading=e.heading),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.NestedFeatureProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.featureType=1,o.prototype.kmlUrl=null,o.prototype.databaseUrl="",o.prototype.layer=null,o.prototype.folder=null,o.prototype.requirement=null,o.prototype.channelId=0,o.prototype.displayName=null,o.prototype.isVisible=!0,o.prototype.isEnabled=!0,o.prototype.isChecked=!1,o.prototype.layerMenuIconPath="icons/773_l.png",o.prototype.description=null,o.prototype.lookAt=null,o.prototype.assetUuid="",o.prototype.isSaveLocked=!0,o.prototype.children=r.emptyArray,o.prototype.clientConfigScriptName="",o.prototype.dioramaDataChannelBase=-1,o.prototype.replicaDataChannelBase=-1;var a={0:"keyhole.dbroot.NestedFeatureProto.FeatureType",1:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.LayerProto",4:"keyhole.dbroot.FolderProto",5:"keyhole.dbroot.RequirementProto",7:"keyhole.dbroot.StringIdOrValueProto",12:"keyhole.dbroot.StringIdOrValueProto",13:"keyhole.dbroot.LookAtProto",16:"keyhole.dbroot.NestedFeatureProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.NestedFeatureProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.featureType=e.uint32();break;case 2:o.kmlUrl=a[1].decode(e,e.uint32());break;case 21:o.databaseUrl=e.string();break;case 3:o.layer=a[3].decode(e,e.uint32());break;case 4:o.folder=a[4].decode(e,e.uint32());break;case 5:o.requirement=a[5].decode(e,e.uint32());break;case 6:o.channelId=e.int32();break;case 7:o.displayName=a[7].decode(e,e.uint32());break;case 8:o.isVisible=e.bool();break;case 9:o.isEnabled=e.bool();break;case 10:o.isChecked=e.bool();break;case 11:o.layerMenuIconPath=e.string();break;case 12:o.description=a[12].decode(e,e.uint32());break;case 13:o.lookAt=a[13].decode(e,e.uint32());break;case 15:o.assetUuid=e.string();break;case 16:o.isSaveLocked=e.bool();break;case 17:o.children&&o.children.length||(o.children=[]),o.children.push(a[16].decode(e,e.uint32()));break;case 18:o.clientConfigScriptName=e.string();break;case 19:o.dioramaDataChannelBase=e.int32();break;case 20:o.replicaDataChannelBase=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.featureType)switch(e.featureType){default:return"featureType: enum value expected";case 1:case 2:case 3:case 4:}if(void 0!==e.kmlUrl&&null!==e.kmlUrl){var t=a[1].verify(e.kmlUrl);if(t)return"kmlUrl."+t}if(void 0!==e.databaseUrl&&!r.isString(e.databaseUrl))return"databaseUrl: string expected";if(void 0!==e.layer&&null!==e.layer){var t=a[3].verify(e.layer);if(t)return"layer."+t}if(void 0!==e.folder&&null!==e.folder){var t=a[4].verify(e.folder);if(t)return"folder."+t}if(void 0!==e.requirement&&null!==e.requirement){var t=a[5].verify(e.requirement);if(t)return"requirement."+t}if(!r.isInteger(e.channelId))return"channelId: integer expected";if(void 0!==e.displayName&&null!==e.displayName){var t=a[7].verify(e.displayName);if(t)return"displayName."+t}if(void 0!==e.isVisible&&"boolean"!=typeof e.isVisible)return"isVisible: boolean expected";if(void 0!==e.isEnabled&&"boolean"!=typeof e.isEnabled)return"isEnabled: boolean expected";if(void 0!==e.isChecked&&"boolean"!=typeof e.isChecked)return"isChecked: boolean expected";if(void 0!==e.layerMenuIconPath&&!r.isString(e.layerMenuIconPath))return"layerMenuIconPath: string expected";if(void 0!==e.description&&null!==e.description){var t=a[12].verify(e.description);if(t)return"description."+t}if(void 0!==e.lookAt&&null!==e.lookAt){var t=a[13].verify(e.lookAt);if(t)return"lookAt."+t}if(void 0!==e.assetUuid&&!r.isString(e.assetUuid))return"assetUuid: string expected";if(void 0!==e.isSaveLocked&&"boolean"!=typeof e.isSaveLocked)return"isSaveLocked: boolean expected";if(void 0!==e.children){if(!Array.isArray(e.children))return"children: array expected";for(var i=0;i<e.children.length;++i){var t=a[16].verify(e.children[i]);if(t)return"children."+t}}return void 0===e.clientConfigScriptName||r.isString(e.clientConfigScriptName)?void 0===e.dioramaDataChannelBase||r.isInteger(e.dioramaDataChannelBase)?void 0===e.replicaDataChannelBase||r.isInteger(e.replicaDataChannelBase)?null:"replicaDataChannelBase: integer expected":"dioramaDataChannelBase: integer expected":"clientConfigScriptName: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.NestedFeatureProto)return e;var t=new n.keyhole.dbroot.NestedFeatureProto;switch(e.featureType){case"TYPE_POINT_Z":case 1:t.featureType=1;break;case"TYPE_POLYGON_Z":case 2:t.featureType=2;break;case"TYPE_LINE_Z":case 3:t.featureType=3;break;case"TYPE_TERRAIN":case 4:t.featureType=4}if(void 0!==e.kmlUrl&&null!==e.kmlUrl){if("object"!=typeof e.kmlUrl)throw TypeError(".keyhole.dbroot.NestedFeatureProto.kmlUrl: object expected");t.kmlUrl=a[1].fromObject(e.kmlUrl)}if(void 0!==e.databaseUrl&&null!==e.databaseUrl&&(t.databaseUrl=String(e.databaseUrl)),void 0!==e.layer&&null!==e.layer){if("object"!=typeof e.layer)throw TypeError(".keyhole.dbroot.NestedFeatureProto.layer: object expected");t.layer=a[3].fromObject(e.layer)}if(void 0!==e.folder&&null!==e.folder){if("object"!=typeof e.folder)throw TypeError(".keyhole.dbroot.NestedFeatureProto.folder: object expected");t.folder=a[4].fromObject(e.folder)}if(void 0!==e.requirement&&null!==e.requirement){if("object"!=typeof e.requirement)throw TypeError(".keyhole.dbroot.NestedFeatureProto.requirement: object expected");t.requirement=a[5].fromObject(e.requirement)}if(void 0!==e.channelId&&null!==e.channelId&&(t.channelId=0|e.channelId),void 0!==e.displayName&&null!==e.displayName){if("object"!=typeof e.displayName)throw TypeError(".keyhole.dbroot.NestedFeatureProto.displayName: object expected");t.displayName=a[7].fromObject(e.displayName)}if(void 0!==e.isVisible&&null!==e.isVisible&&(t.isVisible=Boolean(e.isVisible)),void 0!==e.isEnabled&&null!==e.isEnabled&&(t.isEnabled=Boolean(e.isEnabled)),void 0!==e.isChecked&&null!==e.isChecked&&(t.isChecked=Boolean(e.isChecked)),void 0!==e.layerMenuIconPath&&null!==e.layerMenuIconPath&&(t.layerMenuIconPath=String(e.layerMenuIconPath)),void 0!==e.description&&null!==e.description){if("object"!=typeof e.description)throw TypeError(".keyhole.dbroot.NestedFeatureProto.description: object expected");t.description=a[12].fromObject(e.description)}if(void 0!==e.lookAt&&null!==e.lookAt){if("object"!=typeof e.lookAt)throw TypeError(".keyhole.dbroot.NestedFeatureProto.lookAt: object expected");t.lookAt=a[13].fromObject(e.lookAt)}if(void 0!==e.assetUuid&&null!==e.assetUuid&&(t.assetUuid=String(e.assetUuid)),void 0!==e.isSaveLocked&&null!==e.isSaveLocked&&(t.isSaveLocked=Boolean(e.isSaveLocked)),e.children){if(!Array.isArray(e.children))throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: array expected");t.children=[];for(var r=0;r<e.children.length;++r){if("object"!=typeof e.children[r])throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: object expected");t.children[r]=a[16].fromObject(e.children[r])}}return void 0!==e.clientConfigScriptName&&null!==e.clientConfigScriptName&&(t.clientConfigScriptName=String(e.clientConfigScriptName)),void 0!==e.dioramaDataChannelBase&&null!==e.dioramaDataChannelBase&&(t.dioramaDataChannelBase=0|e.dioramaDataChannelBase),void 0!==e.replicaDataChannelBase&&null!==e.replicaDataChannelBase&&(t.replicaDataChannelBase=0|e.replicaDataChannelBase),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.children=[]),t.defaults&&(r.featureType=t.enums===String?"TYPE_POINT_Z":1,r.kmlUrl=null,r.databaseUrl="",r.layer=null,r.folder=null,r.requirement=null,r.channelId=0,r.displayName=null,r.isVisible=!0,r.isEnabled=!0,r.isChecked=!1,r.layerMenuIconPath="icons/773_l.png",r.description=null,r.lookAt=null,r.assetUuid="",r.isSaveLocked=!0,r.clientConfigScriptName="",r.dioramaDataChannelBase=-1,r.replicaDataChannelBase=-1),void 0!==e.featureType&&null!==e.featureType&&e.hasOwnProperty("featureType")&&(r.featureType=t.enums===String?a[0][e.featureType]:e.featureType),void 0!==e.kmlUrl&&null!==e.kmlUrl&&e.hasOwnProperty("kmlUrl")&&(r.kmlUrl=a[1].toObject(e.kmlUrl,t)),void 0!==e.databaseUrl&&null!==e.databaseUrl&&e.hasOwnProperty("databaseUrl")&&(r.databaseUrl=e.databaseUrl),void 0!==e.layer&&null!==e.layer&&e.hasOwnProperty("layer")&&(r.layer=a[3].toObject(e.layer,t)),void 0!==e.folder&&null!==e.folder&&e.hasOwnProperty("folder")&&(r.folder=a[4].toObject(e.folder,t)),void 0!==e.requirement&&null!==e.requirement&&e.hasOwnProperty("requirement")&&(r.requirement=a[5].toObject(e.requirement,t)),void 0!==e.channelId&&null!==e.channelId&&e.hasOwnProperty("channelId")&&(r.channelId=e.channelId),void 0!==e.displayName&&null!==e.displayName&&e.hasOwnProperty("displayName")&&(r.displayName=a[7].toObject(e.displayName,t)),void 0!==e.isVisible&&null!==e.isVisible&&e.hasOwnProperty("isVisible")&&(r.isVisible=e.isVisible),void 0!==e.isEnabled&&null!==e.isEnabled&&e.hasOwnProperty("isEnabled")&&(r.isEnabled=e.isEnabled),void 0!==e.isChecked&&null!==e.isChecked&&e.hasOwnProperty("isChecked")&&(r.isChecked=e.isChecked),void 0!==e.layerMenuIconPath&&null!==e.layerMenuIconPath&&e.hasOwnProperty("layerMenuIconPath")&&(r.layerMenuIconPath=e.layerMenuIconPath),void 0!==e.description&&null!==e.description&&e.hasOwnProperty("description")&&(r.description=a[12].toObject(e.description,t)),void 0!==e.lookAt&&null!==e.lookAt&&e.hasOwnProperty("lookAt")&&(r.lookAt=a[13].toObject(e.lookAt,t)),void 0!==e.assetUuid&&null!==e.assetUuid&&e.hasOwnProperty("assetUuid")&&(r.assetUuid=e.assetUuid),void 0!==e.isSaveLocked&&null!==e.isSaveLocked&&e.hasOwnProperty("isSaveLocked")&&(r.isSaveLocked=e.isSaveLocked),void 0!==e.children&&null!==e.children&&e.hasOwnProperty("children")){r.children=[];for(var i=0;i<e.children.length;++i)r.children[i]=a[16].toObject(e.children[i],t)}return void 0!==e.clientConfigScriptName&&null!==e.clientConfigScriptName&&e.hasOwnProperty("clientConfigScriptName")&&(r.clientConfigScriptName=e.clientConfigScriptName),void 0!==e.dioramaDataChannelBase&&null!==e.dioramaDataChannelBase&&e.hasOwnProperty("dioramaDataChannelBase")&&(r.dioramaDataChannelBase=e.dioramaDataChannelBase),void 0!==e.replicaDataChannelBase&&null!==e.replicaDataChannelBase&&e.hasOwnProperty("replicaDataChannelBase")&&(r.replicaDataChannelBase=e.replicaDataChannelBase),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.FeatureType=function(){var e={},t=Object.create(e);return t.TYPE_POINT_Z=1,t.TYPE_POLYGON_Z=2,t.TYPE_LINE_Z=3,t.TYPE_TERRAIN=4,t}(),o}(),o.MfeDomainFeaturesProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.countryCode="",o.prototype.domainName="",o.prototype.supportedFeatures=r.emptyArray;var a={2:"keyhole.dbroot.MfeDomainFeaturesProto.SupportedFeature"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.MfeDomainFeaturesProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.countryCode=e.string();break;case 2:o.domainName=e.string();break;case 3:if(o.supportedFeatures&&o.supportedFeatures.length||(o.supportedFeatures=[]),2==(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)o.supportedFeatures.push(e.uint32());else o.supportedFeatures.push(e.uint32());break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.countryCode))return"countryCode: string expected";if(!r.isString(e.domainName))return"domainName: string expected";if(void 0!==e.supportedFeatures){if(!Array.isArray(e.supportedFeatures))return"supportedFeatures: array expected";for(var t=0;t<e.supportedFeatures.length;++t)switch(e.supportedFeatures[t]){default:return"supportedFeatures: enum value[] expected";case 0:case 1:case 2:}}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.MfeDomainFeaturesProto)return e;var t=new n.keyhole.dbroot.MfeDomainFeaturesProto;if(void 0!==e.countryCode&&null!==e.countryCode&&(t.countryCode=String(e.countryCode)),void 0!==e.domainName&&null!==e.domainName&&(t.domainName=String(e.domainName)),e.supportedFeatures){if(!Array.isArray(e.supportedFeatures))throw TypeError(".keyhole.dbroot.MfeDomainFeaturesProto.supportedFeatures: array expected");t.supportedFeatures=[];for(var r=0;r<e.supportedFeatures.length;++r)switch(e.supportedFeatures[r]){default:case"GEOCODING":case 0:t.supportedFeatures[r]=0;break;case"LOCAL_SEARCH":case 1:t.supportedFeatures[r]=1;break;case"DRIVING_DIRECTIONS":case 2:t.supportedFeatures[r]=2}}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.supportedFeatures=[]),t.defaults&&(r.countryCode="",r.domainName=""),void 0!==e.countryCode&&null!==e.countryCode&&e.hasOwnProperty("countryCode")&&(r.countryCode=e.countryCode),void 0!==e.domainName&&null!==e.domainName&&e.hasOwnProperty("domainName")&&(r.domainName=e.domainName),void 0!==e.supportedFeatures&&null!==e.supportedFeatures&&e.hasOwnProperty("supportedFeatures")){r.supportedFeatures=[];for(var i=0;i<e.supportedFeatures.length;++i)r.supportedFeatures[i]=t.enums===String?a[2][e.supportedFeatures[i]]:e.supportedFeatures[i]}return r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.SupportedFeature=function(){var e={},t=Object.create(e);return t.GEOCODING=0,t.LOCAL_SEARCH=1,t.DRIVING_DIRECTIONS=2,t}(),o}(),o.ClientOptionsProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.disableDiskCache=!1,o.prototype.disableEmbeddedBrowserVista=!1,o.prototype.drawAtmosphere=!0,o.prototype.drawStars=!0,o.prototype.shaderFilePrefix="",o.prototype.useProtobufQuadtreePackets=!1,o.prototype.useExtendedCopyrightIds=!0,o.prototype.precipitationsOptions=null,o.prototype.captureOptions=null,o.prototype.show_2dMapsIcon=!0,o.prototype.disableInternalBrowser=!1,o.prototype.internalBrowserBlacklist="",o.prototype.internalBrowserOriginWhitelist="*",o.prototype.polarTileMergingLevel=0,o.prototype.jsBridgeRequestWhitelist="http://*.google.com/*",o.prototype.mapsOptions=null;var a={7:"keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions",8:"keyhole.dbroot.ClientOptionsProto.CaptureOptions",15:"keyhole.dbroot.ClientOptionsProto.MapsOptions"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.disableDiskCache=e.bool();break;case 2:o.disableEmbeddedBrowserVista=e.bool();break;case 3:o.drawAtmosphere=e.bool();break;case 4:o.drawStars=e.bool();break;case 5:o.shaderFilePrefix=e.string();break;case 6:o.useProtobufQuadtreePackets=e.bool();break;case 7:o.useExtendedCopyrightIds=e.bool();break;case 8:o.precipitationsOptions=a[7].decode(e,e.uint32());break;case 9:o.captureOptions=a[8].decode(e,e.uint32());break;case 10:o.show_2dMapsIcon=e.bool();break;case 11:o.disableInternalBrowser=e.bool();break;case 12:o.internalBrowserBlacklist=e.string();break;case 13:o.internalBrowserOriginWhitelist=e.string();break;case 14:o.polarTileMergingLevel=e.int32();break;case 15:o.jsBridgeRequestWhitelist=e.string();break;case 16:o.mapsOptions=a[15].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.disableDiskCache&&"boolean"!=typeof e.disableDiskCache)return"disableDiskCache: boolean expected";if(void 0!==e.disableEmbeddedBrowserVista&&"boolean"!=typeof e.disableEmbeddedBrowserVista)return"disableEmbeddedBrowserVista: boolean expected";if(void 0!==e.drawAtmosphere&&"boolean"!=typeof e.drawAtmosphere)return"drawAtmosphere: boolean expected";if(void 0!==e.drawStars&&"boolean"!=typeof e.drawStars)return"drawStars: boolean expected";if(void 0!==e.shaderFilePrefix&&!r.isString(e.shaderFilePrefix))return"shaderFilePrefix: string expected";if(void 0!==e.useProtobufQuadtreePackets&&"boolean"!=typeof e.useProtobufQuadtreePackets)return"useProtobufQuadtreePackets: boolean expected";if(void 0!==e.useExtendedCopyrightIds&&"boolean"!=typeof e.useExtendedCopyrightIds)return"useExtendedCopyrightIds: boolean expected";if(void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions){var t=a[7].verify(e.precipitationsOptions);if(t)return"precipitationsOptions."+t}if(void 0!==e.captureOptions&&null!==e.captureOptions){var t=a[8].verify(e.captureOptions);if(t)return"captureOptions."+t}if(void 0!==e.show_2dMapsIcon&&"boolean"!=typeof e.show_2dMapsIcon)return"show_2dMapsIcon: boolean expected";if(void 0!==e.disableInternalBrowser&&"boolean"!=typeof e.disableInternalBrowser)return"disableInternalBrowser: boolean expected";if(void 0!==e.internalBrowserBlacklist&&!r.isString(e.internalBrowserBlacklist))return"internalBrowserBlacklist: string expected";if(void 0!==e.internalBrowserOriginWhitelist&&!r.isString(e.internalBrowserOriginWhitelist))return"internalBrowserOriginWhitelist: string expected";if(void 0!==e.polarTileMergingLevel&&!r.isInteger(e.polarTileMergingLevel))return"polarTileMergingLevel: integer expected";if(void 0!==e.jsBridgeRequestWhitelist&&!r.isString(e.jsBridgeRequestWhitelist))return"jsBridgeRequestWhitelist: string expected";if(void 0!==e.mapsOptions&&null!==e.mapsOptions){var t=a[15].verify(e.mapsOptions);if(t)return"mapsOptions."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto)return e;var t=new n.keyhole.dbroot.ClientOptionsProto;if(void 0!==e.disableDiskCache&&null!==e.disableDiskCache&&(t.disableDiskCache=Boolean(e.disableDiskCache)),void 0!==e.disableEmbeddedBrowserVista&&null!==e.disableEmbeddedBrowserVista&&(t.disableEmbeddedBrowserVista=Boolean(e.disableEmbeddedBrowserVista)),void 0!==e.drawAtmosphere&&null!==e.drawAtmosphere&&(t.drawAtmosphere=Boolean(e.drawAtmosphere)),void 0!==e.drawStars&&null!==e.drawStars&&(t.drawStars=Boolean(e.drawStars)),void 0!==e.shaderFilePrefix&&null!==e.shaderFilePrefix&&(t.shaderFilePrefix=String(e.shaderFilePrefix)),void 0!==e.useProtobufQuadtreePackets&&null!==e.useProtobufQuadtreePackets&&(t.useProtobufQuadtreePackets=Boolean(e.useProtobufQuadtreePackets)),void 0!==e.useExtendedCopyrightIds&&null!==e.useExtendedCopyrightIds&&(t.useExtendedCopyrightIds=Boolean(e.useExtendedCopyrightIds)),void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions){if("object"!=typeof e.precipitationsOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.precipitationsOptions: object expected");t.precipitationsOptions=a[7].fromObject(e.precipitationsOptions)}if(void 0!==e.captureOptions&&null!==e.captureOptions){if("object"!=typeof e.captureOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.captureOptions: object expected");t.captureOptions=a[8].fromObject(e.captureOptions)}if(void 0!==e.show_2dMapsIcon&&null!==e.show_2dMapsIcon&&(t.show_2dMapsIcon=Boolean(e.show_2dMapsIcon)),void 0!==e.disableInternalBrowser&&null!==e.disableInternalBrowser&&(t.disableInternalBrowser=Boolean(e.disableInternalBrowser)),void 0!==e.internalBrowserBlacklist&&null!==e.internalBrowserBlacklist&&(t.internalBrowserBlacklist=String(e.internalBrowserBlacklist)),void 0!==e.internalBrowserOriginWhitelist&&null!==e.internalBrowserOriginWhitelist&&(t.internalBrowserOriginWhitelist=String(e.internalBrowserOriginWhitelist)),void 0!==e.polarTileMergingLevel&&null!==e.polarTileMergingLevel&&(t.polarTileMergingLevel=0|e.polarTileMergingLevel),void 0!==e.jsBridgeRequestWhitelist&&null!==e.jsBridgeRequestWhitelist&&(t.jsBridgeRequestWhitelist=String(e.jsBridgeRequestWhitelist)),void 0!==e.mapsOptions&&null!==e.mapsOptions){if("object"!=typeof e.mapsOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.mapsOptions: object expected");t.mapsOptions=a[15].fromObject(e.mapsOptions)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.disableDiskCache=!1,r.disableEmbeddedBrowserVista=!1,r.drawAtmosphere=!0,r.drawStars=!0,r.shaderFilePrefix="",r.useProtobufQuadtreePackets=!1,r.useExtendedCopyrightIds=!0,r.precipitationsOptions=null,r.captureOptions=null,r.show_2dMapsIcon=!0,r.disableInternalBrowser=!1,r.internalBrowserBlacklist="",r.internalBrowserOriginWhitelist="*",r.polarTileMergingLevel=0,r.jsBridgeRequestWhitelist="http://*.google.com/*",r.mapsOptions=null),void 0!==e.disableDiskCache&&null!==e.disableDiskCache&&e.hasOwnProperty("disableDiskCache")&&(r.disableDiskCache=e.disableDiskCache),void 0!==e.disableEmbeddedBrowserVista&&null!==e.disableEmbeddedBrowserVista&&e.hasOwnProperty("disableEmbeddedBrowserVista")&&(r.disableEmbeddedBrowserVista=e.disableEmbeddedBrowserVista),void 0!==e.drawAtmosphere&&null!==e.drawAtmosphere&&e.hasOwnProperty("drawAtmosphere")&&(r.drawAtmosphere=e.drawAtmosphere),void 0!==e.drawStars&&null!==e.drawStars&&e.hasOwnProperty("drawStars")&&(r.drawStars=e.drawStars),void 0!==e.shaderFilePrefix&&null!==e.shaderFilePrefix&&e.hasOwnProperty("shaderFilePrefix")&&(r.shaderFilePrefix=e.shaderFilePrefix),void 0!==e.useProtobufQuadtreePackets&&null!==e.useProtobufQuadtreePackets&&e.hasOwnProperty("useProtobufQuadtreePackets")&&(r.useProtobufQuadtreePackets=e.useProtobufQuadtreePackets),void 0!==e.useExtendedCopyrightIds&&null!==e.useExtendedCopyrightIds&&e.hasOwnProperty("useExtendedCopyrightIds")&&(r.useExtendedCopyrightIds=e.useExtendedCopyrightIds),void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions&&e.hasOwnProperty("precipitationsOptions")&&(r.precipitationsOptions=a[7].toObject(e.precipitationsOptions,t)),void 0!==e.captureOptions&&null!==e.captureOptions&&e.hasOwnProperty("captureOptions")&&(r.captureOptions=a[8].toObject(e.captureOptions,t)),void 0!==e.show_2dMapsIcon&&null!==e.show_2dMapsIcon&&e.hasOwnProperty("show_2dMapsIcon")&&(r.show_2dMapsIcon=e.show_2dMapsIcon),void 0!==e.disableInternalBrowser&&null!==e.disableInternalBrowser&&e.hasOwnProperty("disableInternalBrowser")&&(r.disableInternalBrowser=e.disableInternalBrowser),void 0!==e.internalBrowserBlacklist&&null!==e.internalBrowserBlacklist&&e.hasOwnProperty("internalBrowserBlacklist")&&(r.internalBrowserBlacklist=e.internalBrowserBlacklist),
void 0!==e.internalBrowserOriginWhitelist&&null!==e.internalBrowserOriginWhitelist&&e.hasOwnProperty("internalBrowserOriginWhitelist")&&(r.internalBrowserOriginWhitelist=e.internalBrowserOriginWhitelist),void 0!==e.polarTileMergingLevel&&null!==e.polarTileMergingLevel&&e.hasOwnProperty("polarTileMergingLevel")&&(r.polarTileMergingLevel=e.polarTileMergingLevel),void 0!==e.jsBridgeRequestWhitelist&&null!==e.jsBridgeRequestWhitelist&&e.hasOwnProperty("jsBridgeRequestWhitelist")&&(r.jsBridgeRequestWhitelist=e.jsBridgeRequestWhitelist),void 0!==e.mapsOptions&&null!==e.mapsOptions&&e.hasOwnProperty("mapsOptions")&&(r.mapsOptions=a[15].toObject(e.mapsOptions,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.PrecipitationsOptions=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.imageUrl="",o.prototype.imageExpireTime=900,o.prototype.maxColorDistance=20,o.prototype.imageLevel=5,o.prototype.weatherMapping=r.emptyArray,o.prototype.cloudsLayerUrl="",o.prototype.animationDecelerationDelay=20;var a={4:"keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.imageUrl=e.string();break;case 2:o.imageExpireTime=e.int32();break;case 3:o.maxColorDistance=e.int32();break;case 4:o.imageLevel=e.int32();break;case 5:o.weatherMapping&&o.weatherMapping.length||(o.weatherMapping=[]),o.weatherMapping.push(a[4].decode(e,e.uint32()));break;case 6:o.cloudsLayerUrl=e.string();break;case 7:o.animationDecelerationDelay=e.float();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.imageUrl&&!r.isString(e.imageUrl))return"imageUrl: string expected";if(void 0!==e.imageExpireTime&&!r.isInteger(e.imageExpireTime))return"imageExpireTime: integer expected";if(void 0!==e.maxColorDistance&&!r.isInteger(e.maxColorDistance))return"maxColorDistance: integer expected";if(void 0!==e.imageLevel&&!r.isInteger(e.imageLevel))return"imageLevel: integer expected";if(void 0!==e.weatherMapping){if(!Array.isArray(e.weatherMapping))return"weatherMapping: array expected";for(var t=0;t<e.weatherMapping.length;++t){var i=a[4].verify(e.weatherMapping[t]);if(i)return"weatherMapping."+i}}return void 0===e.cloudsLayerUrl||r.isString(e.cloudsLayerUrl)?void 0!==e.animationDecelerationDelay&&"number"!=typeof e.animationDecelerationDelay?"animationDecelerationDelay: number expected":null:"cloudsLayerUrl: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions;if(void 0!==e.imageUrl&&null!==e.imageUrl&&(t.imageUrl=String(e.imageUrl)),void 0!==e.imageExpireTime&&null!==e.imageExpireTime&&(t.imageExpireTime=0|e.imageExpireTime),void 0!==e.maxColorDistance&&null!==e.maxColorDistance&&(t.maxColorDistance=0|e.maxColorDistance),void 0!==e.imageLevel&&null!==e.imageLevel&&(t.imageLevel=0|e.imageLevel),e.weatherMapping){if(!Array.isArray(e.weatherMapping))throw TypeError(".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: array expected");t.weatherMapping=[];for(var r=0;r<e.weatherMapping.length;++r){if("object"!=typeof e.weatherMapping[r])throw TypeError(".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: object expected");t.weatherMapping[r]=a[4].fromObject(e.weatherMapping[r])}}return void 0!==e.cloudsLayerUrl&&null!==e.cloudsLayerUrl&&(t.cloudsLayerUrl=String(e.cloudsLayerUrl)),void 0!==e.animationDecelerationDelay&&null!==e.animationDecelerationDelay&&(t.animationDecelerationDelay=Number(e.animationDecelerationDelay)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.weatherMapping=[]),t.defaults&&(r.imageUrl="",r.imageExpireTime=900,r.maxColorDistance=20,r.imageLevel=5,r.cloudsLayerUrl="",r.animationDecelerationDelay=20),void 0!==e.imageUrl&&null!==e.imageUrl&&e.hasOwnProperty("imageUrl")&&(r.imageUrl=e.imageUrl),void 0!==e.imageExpireTime&&null!==e.imageExpireTime&&e.hasOwnProperty("imageExpireTime")&&(r.imageExpireTime=e.imageExpireTime),void 0!==e.maxColorDistance&&null!==e.maxColorDistance&&e.hasOwnProperty("maxColorDistance")&&(r.maxColorDistance=e.maxColorDistance),void 0!==e.imageLevel&&null!==e.imageLevel&&e.hasOwnProperty("imageLevel")&&(r.imageLevel=e.imageLevel),void 0!==e.weatherMapping&&null!==e.weatherMapping&&e.hasOwnProperty("weatherMapping")){r.weatherMapping=[];for(var i=0;i<e.weatherMapping.length;++i)r.weatherMapping[i]=a[4].toObject(e.weatherMapping[i],t)}return void 0!==e.cloudsLayerUrl&&null!==e.cloudsLayerUrl&&e.hasOwnProperty("cloudsLayerUrl")&&(r.cloudsLayerUrl=e.cloudsLayerUrl),void 0!==e.animationDecelerationDelay&&null!==e.animationDecelerationDelay&&e.hasOwnProperty("animationDecelerationDelay")&&(r.animationDecelerationDelay=e.animationDecelerationDelay),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.WeatherMapping=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.colorAbgr=0,o.prototype.weatherType=0,o.prototype.elongation=1,o.prototype.opacity=0,o.prototype.fogDensity=0,o.prototype.speed0=0,o.prototype.speed1=0,o.prototype.speed2=0,o.prototype.speed3=0;var a={1:"keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.WeatherType"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.colorAbgr=e.uint32();break;case 2:o.weatherType=e.uint32();break;case 3:o.elongation=e.float();break;case 4:o.opacity=e.float();break;case 5:o.fogDensity=e.float();break;case 6:o.speed0=e.float();break;case 7:o.speed1=e.float();break;case 8:o.speed2=e.float();break;case 9:o.speed3=e.float();break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.colorAbgr))return"colorAbgr: integer expected";switch(e.weatherType){default:return"weatherType: enum value expected";case 0:case 1:case 2:}return void 0!==e.elongation&&"number"!=typeof e.elongation?"elongation: number expected":void 0!==e.opacity&&"number"!=typeof e.opacity?"opacity: number expected":void 0!==e.fogDensity&&"number"!=typeof e.fogDensity?"fogDensity: number expected":void 0!==e.speed0&&"number"!=typeof e.speed0?"speed0: number expected":void 0!==e.speed1&&"number"!=typeof e.speed1?"speed1: number expected":void 0!==e.speed2&&"number"!=typeof e.speed2?"speed2: number expected":void 0!==e.speed3&&"number"!=typeof e.speed3?"speed3: number expected":null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;switch(void 0!==e.colorAbgr&&null!==e.colorAbgr&&(t.colorAbgr=e.colorAbgr>>>0),e.weatherType){case"NO_PRECIPITATION":case 0:t.weatherType=0;break;case"RAIN":case 1:t.weatherType=1;break;case"SNOW":case 2:t.weatherType=2}return void 0!==e.elongation&&null!==e.elongation&&(t.elongation=Number(e.elongation)),void 0!==e.opacity&&null!==e.opacity&&(t.opacity=Number(e.opacity)),void 0!==e.fogDensity&&null!==e.fogDensity&&(t.fogDensity=Number(e.fogDensity)),void 0!==e.speed0&&null!==e.speed0&&(t.speed0=Number(e.speed0)),void 0!==e.speed1&&null!==e.speed1&&(t.speed1=Number(e.speed1)),void 0!==e.speed2&&null!==e.speed2&&(t.speed2=Number(e.speed2)),void 0!==e.speed3&&null!==e.speed3&&(t.speed3=Number(e.speed3)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.colorAbgr=0,r.weatherType=t.enums===String?"NO_PRECIPITATION":0,r.elongation=1,r.opacity=0,r.fogDensity=0,r.speed0=0,r.speed1=0,r.speed2=0,r.speed3=0),void 0!==e.colorAbgr&&null!==e.colorAbgr&&e.hasOwnProperty("colorAbgr")&&(r.colorAbgr=e.colorAbgr),void 0!==e.weatherType&&null!==e.weatherType&&e.hasOwnProperty("weatherType")&&(r.weatherType=t.enums===String?a[1][e.weatherType]:e.weatherType),void 0!==e.elongation&&null!==e.elongation&&e.hasOwnProperty("elongation")&&(r.elongation=e.elongation),void 0!==e.opacity&&null!==e.opacity&&e.hasOwnProperty("opacity")&&(r.opacity=e.opacity),void 0!==e.fogDensity&&null!==e.fogDensity&&e.hasOwnProperty("fogDensity")&&(r.fogDensity=e.fogDensity),void 0!==e.speed0&&null!==e.speed0&&e.hasOwnProperty("speed0")&&(r.speed0=e.speed0),void 0!==e.speed1&&null!==e.speed1&&e.hasOwnProperty("speed1")&&(r.speed1=e.speed1),void 0!==e.speed2&&null!==e.speed2&&e.hasOwnProperty("speed2")&&(r.speed2=e.speed2),void 0!==e.speed3&&null!==e.speed3&&e.hasOwnProperty("speed3")&&(r.speed3=e.speed3),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.WeatherType=function(){var e={},t=Object.create(e);return t.NO_PRECIPITATION=0,t.RAIN=1,t.SNOW=2,t}(),o}(),o}(),o.CaptureOptions=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.allowSaveAsImage=!0,i.prototype.maxFreeCaptureRes=2400,i.prototype.maxPremiumCaptureRes=4800,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.allowSaveAsImage=e.bool();break;case 2:o.maxFreeCaptureRes=e.int32();break;case 3:o.maxPremiumCaptureRes=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.allowSaveAsImage&&"boolean"!=typeof e.allowSaveAsImage?"allowSaveAsImage: boolean expected":void 0===e.maxFreeCaptureRes||r.isInteger(e.maxFreeCaptureRes)?void 0===e.maxPremiumCaptureRes||r.isInteger(e.maxPremiumCaptureRes)?null:"maxPremiumCaptureRes: integer expected":"maxFreeCaptureRes: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.CaptureOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;return void 0!==e.allowSaveAsImage&&null!==e.allowSaveAsImage&&(t.allowSaveAsImage=Boolean(e.allowSaveAsImage)),void 0!==e.maxFreeCaptureRes&&null!==e.maxFreeCaptureRes&&(t.maxFreeCaptureRes=0|e.maxFreeCaptureRes),void 0!==e.maxPremiumCaptureRes&&null!==e.maxPremiumCaptureRes&&(t.maxPremiumCaptureRes=0|e.maxPremiumCaptureRes),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.allowSaveAsImage=!0,r.maxFreeCaptureRes=2400,r.maxPremiumCaptureRes=4800),void 0!==e.allowSaveAsImage&&null!==e.allowSaveAsImage&&e.hasOwnProperty("allowSaveAsImage")&&(r.allowSaveAsImage=e.allowSaveAsImage),void 0!==e.maxFreeCaptureRes&&null!==e.maxFreeCaptureRes&&e.hasOwnProperty("maxFreeCaptureRes")&&(r.maxFreeCaptureRes=e.maxFreeCaptureRes),void 0!==e.maxPremiumCaptureRes&&null!==e.maxPremiumCaptureRes&&e.hasOwnProperty("maxPremiumCaptureRes")&&(r.maxPremiumCaptureRes=e.maxPremiumCaptureRes),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.MapsOptions=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.enableMaps=!1,i.prototype.docsAutoDownloadEnabled=!1,i.prototype.docsAutoDownloadInterval=0,i.prototype.docsAutoUploadEnabled=!1,i.prototype.docsAutoUploadDelay=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.enableMaps=e.bool();break;case 2:o.docsAutoDownloadEnabled=e.bool();break;case 3:o.docsAutoDownloadInterval=e.int32();break;case 4:o.docsAutoUploadEnabled=e.bool();break;case 5:o.docsAutoUploadDelay=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.enableMaps&&"boolean"!=typeof e.enableMaps?"enableMaps: boolean expected":void 0!==e.docsAutoDownloadEnabled&&"boolean"!=typeof e.docsAutoDownloadEnabled?"docsAutoDownloadEnabled: boolean expected":void 0===e.docsAutoDownloadInterval||r.isInteger(e.docsAutoDownloadInterval)?void 0!==e.docsAutoUploadEnabled&&"boolean"!=typeof e.docsAutoUploadEnabled?"docsAutoUploadEnabled: boolean expected":void 0===e.docsAutoUploadDelay||r.isInteger(e.docsAutoUploadDelay)?null:"docsAutoUploadDelay: integer expected":"docsAutoDownloadInterval: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.MapsOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;return void 0!==e.enableMaps&&null!==e.enableMaps&&(t.enableMaps=Boolean(e.enableMaps)),void 0!==e.docsAutoDownloadEnabled&&null!==e.docsAutoDownloadEnabled&&(t.docsAutoDownloadEnabled=Boolean(e.docsAutoDownloadEnabled)),void 0!==e.docsAutoDownloadInterval&&null!==e.docsAutoDownloadInterval&&(t.docsAutoDownloadInterval=0|e.docsAutoDownloadInterval),void 0!==e.docsAutoUploadEnabled&&null!==e.docsAutoUploadEnabled&&(t.docsAutoUploadEnabled=Boolean(e.docsAutoUploadEnabled)),void 0!==e.docsAutoUploadDelay&&null!==e.docsAutoUploadDelay&&(t.docsAutoUploadDelay=0|e.docsAutoUploadDelay),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.enableMaps=!1,r.docsAutoDownloadEnabled=!1,r.docsAutoDownloadInterval=0,r.docsAutoUploadEnabled=!1,r.docsAutoUploadDelay=0),void 0!==e.enableMaps&&null!==e.enableMaps&&e.hasOwnProperty("enableMaps")&&(r.enableMaps=e.enableMaps),void 0!==e.docsAutoDownloadEnabled&&null!==e.docsAutoDownloadEnabled&&e.hasOwnProperty("docsAutoDownloadEnabled")&&(r.docsAutoDownloadEnabled=e.docsAutoDownloadEnabled),void 0!==e.docsAutoDownloadInterval&&null!==e.docsAutoDownloadInterval&&e.hasOwnProperty("docsAutoDownloadInterval")&&(r.docsAutoDownloadInterval=e.docsAutoDownloadInterval),void 0!==e.docsAutoUploadEnabled&&null!==e.docsAutoUploadEnabled&&e.hasOwnProperty("docsAutoUploadEnabled")&&(r.docsAutoUploadEnabled=e.docsAutoUploadEnabled),void 0!==e.docsAutoUploadDelay&&null!==e.docsAutoUploadDelay&&e.hasOwnProperty("docsAutoUploadDelay")&&(r.docsAutoUploadDelay=e.docsAutoUploadDelay),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o}(),o.FetchingOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.maxRequestsPerQuery=1,i.prototype.forceMaxRequestsPerQuery=!1,i.prototype.sortBatches=!1,i.prototype.maxDrawable=2,i.prototype.maxImagery=2,i.prototype.maxTerrain=5,i.prototype.maxQuadtree=5,i.prototype.maxDioramaMetadata=1,i.prototype.maxDioramaData=0,i.prototype.maxConsumerFetchRatio=1,i.prototype.maxProEcFetchRatio=0,i.prototype.safeOverallQps=0,i.prototype.safeImageryQps=0,i.prototype.domainsForHttps="google.com gstatic.com",i.prototype.hostsForHttp="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.FetchingOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.maxRequestsPerQuery=e.int32();break;case 12:o.forceMaxRequestsPerQuery=e.bool();break;case 13:o.sortBatches=e.bool();break;case 2:o.maxDrawable=e.int32();break;case 3:o.maxImagery=e.int32();break;case 4:o.maxTerrain=e.int32();break;case 5:o.maxQuadtree=e.int32();break;case 6:o.maxDioramaMetadata=e.int32();break;case 7:o.maxDioramaData=e.int32();break;case 8:o.maxConsumerFetchRatio=e.float();break;case 9:o.maxProEcFetchRatio=e.float();break;case 10:o.safeOverallQps=e.float();break;case 11:o.safeImageryQps=e.float();break;case 14:o.domainsForHttps=e.string();break;case 15:o.hostsForHttp=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.maxRequestsPerQuery||r.isInteger(e.maxRequestsPerQuery)?void 0!==e.forceMaxRequestsPerQuery&&"boolean"!=typeof e.forceMaxRequestsPerQuery?"forceMaxRequestsPerQuery: boolean expected":void 0!==e.sortBatches&&"boolean"!=typeof e.sortBatches?"sortBatches: boolean expected":void 0===e.maxDrawable||r.isInteger(e.maxDrawable)?void 0===e.maxImagery||r.isInteger(e.maxImagery)?void 0===e.maxTerrain||r.isInteger(e.maxTerrain)?void 0===e.maxQuadtree||r.isInteger(e.maxQuadtree)?void 0===e.maxDioramaMetadata||r.isInteger(e.maxDioramaMetadata)?void 0===e.maxDioramaData||r.isInteger(e.maxDioramaData)?void 0!==e.maxConsumerFetchRatio&&"number"!=typeof e.maxConsumerFetchRatio?"maxConsumerFetchRatio: number expected":void 0!==e.maxProEcFetchRatio&&"number"!=typeof e.maxProEcFetchRatio?"maxProEcFetchRatio: number expected":void 0!==e.safeOverallQps&&"number"!=typeof e.safeOverallQps?"safeOverallQps: number expected":void 0!==e.safeImageryQps&&"number"!=typeof e.safeImageryQps?"safeImageryQps: number expected":void 0===e.domainsForHttps||r.isString(e.domainsForHttps)?void 0===e.hostsForHttp||r.isString(e.hostsForHttp)?null:"hostsForHttp: string expected":"domainsForHttps: string expected":"maxDioramaData: integer expected":"maxDioramaMetadata: integer expected":"maxQuadtree: integer expected":"maxTerrain: integer expected":"maxImagery: integer expected":"maxDrawable: integer expected":"maxRequestsPerQuery: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.FetchingOptionsProto)return e;var t=new n.keyhole.dbroot.FetchingOptionsProto;return void 0!==e.maxRequestsPerQuery&&null!==e.maxRequestsPerQuery&&(t.maxRequestsPerQuery=0|e.maxRequestsPerQuery),void 0!==e.forceMaxRequestsPerQuery&&null!==e.forceMaxRequestsPerQuery&&(t.forceMaxRequestsPerQuery=Boolean(e.forceMaxRequestsPerQuery)),void 0!==e.sortBatches&&null!==e.sortBatches&&(t.sortBatches=Boolean(e.sortBatches)),void 0!==e.maxDrawable&&null!==e.maxDrawable&&(t.maxDrawable=0|e.maxDrawable),void 0!==e.maxImagery&&null!==e.maxImagery&&(t.maxImagery=0|e.maxImagery),void 0!==e.maxTerrain&&null!==e.maxTerrain&&(t.maxTerrain=0|e.maxTerrain),void 0!==e.maxQuadtree&&null!==e.maxQuadtree&&(t.maxQuadtree=0|e.maxQuadtree),void 0!==e.maxDioramaMetadata&&null!==e.maxDioramaMetadata&&(t.maxDioramaMetadata=0|e.maxDioramaMetadata),void 0!==e.maxDioramaData&&null!==e.maxDioramaData&&(t.maxDioramaData=0|e.maxDioramaData),void 0!==e.maxConsumerFetchRatio&&null!==e.maxConsumerFetchRatio&&(t.maxConsumerFetchRatio=Number(e.maxConsumerFetchRatio)),void 0!==e.maxProEcFetchRatio&&null!==e.maxProEcFetchRatio&&(t.maxProEcFetchRatio=Number(e.maxProEcFetchRatio)),void 0!==e.safeOverallQps&&null!==e.safeOverallQps&&(t.safeOverallQps=Number(e.safeOverallQps)),void 0!==e.safeImageryQps&&null!==e.safeImageryQps&&(t.safeImageryQps=Number(e.safeImageryQps)),void 0!==e.domainsForHttps&&null!==e.domainsForHttps&&(t.domainsForHttps=String(e.domainsForHttps)),void 0!==e.hostsForHttp&&null!==e.hostsForHttp&&(t.hostsForHttp=String(e.hostsForHttp)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.maxRequestsPerQuery=1,r.forceMaxRequestsPerQuery=!1,r.sortBatches=!1,r.maxDrawable=2,r.maxImagery=2,r.maxTerrain=5,r.maxQuadtree=5,r.maxDioramaMetadata=1,r.maxDioramaData=0,r.maxConsumerFetchRatio=1,r.maxProEcFetchRatio=0,r.safeOverallQps=0,r.safeImageryQps=0,r.domainsForHttps="google.com gstatic.com",r.hostsForHttp=""),void 0!==e.maxRequestsPerQuery&&null!==e.maxRequestsPerQuery&&e.hasOwnProperty("maxRequestsPerQuery")&&(r.maxRequestsPerQuery=e.maxRequestsPerQuery),void 0!==e.forceMaxRequestsPerQuery&&null!==e.forceMaxRequestsPerQuery&&e.hasOwnProperty("forceMaxRequestsPerQuery")&&(r.forceMaxRequestsPerQuery=e.forceMaxRequestsPerQuery),void 0!==e.sortBatches&&null!==e.sortBatches&&e.hasOwnProperty("sortBatches")&&(r.sortBatches=e.sortBatches),void 0!==e.maxDrawable&&null!==e.maxDrawable&&e.hasOwnProperty("maxDrawable")&&(r.maxDrawable=e.maxDrawable),void 0!==e.maxImagery&&null!==e.maxImagery&&e.hasOwnProperty("maxImagery")&&(r.maxImagery=e.maxImagery),void 0!==e.maxTerrain&&null!==e.maxTerrain&&e.hasOwnProperty("maxTerrain")&&(r.maxTerrain=e.maxTerrain),void 0!==e.maxQuadtree&&null!==e.maxQuadtree&&e.hasOwnProperty("maxQuadtree")&&(r.maxQuadtree=e.maxQuadtree),void 0!==e.maxDioramaMetadata&&null!==e.maxDioramaMetadata&&e.hasOwnProperty("maxDioramaMetadata")&&(r.maxDioramaMetadata=e.maxDioramaMetadata),void 0!==e.maxDioramaData&&null!==e.maxDioramaData&&e.hasOwnProperty("maxDioramaData")&&(r.maxDioramaData=e.maxDioramaData),void 0!==e.maxConsumerFetchRatio&&null!==e.maxConsumerFetchRatio&&e.hasOwnProperty("maxConsumerFetchRatio")&&(r.maxConsumerFetchRatio=e.maxConsumerFetchRatio),void 0!==e.maxProEcFetchRatio&&null!==e.maxProEcFetchRatio&&e.hasOwnProperty("maxProEcFetchRatio")&&(r.maxProEcFetchRatio=e.maxProEcFetchRatio),void 0!==e.safeOverallQps&&null!==e.safeOverallQps&&e.hasOwnProperty("safeOverallQps")&&(r.safeOverallQps=e.safeOverallQps),void 0!==e.safeImageryQps&&null!==e.safeImageryQps&&e.hasOwnProperty("safeImageryQps")&&(r.safeImageryQps=e.safeImageryQps),void 0!==e.domainsForHttps&&null!==e.domainsForHttps&&e.hasOwnProperty("domainsForHttps")&&(r.domainsForHttps=e.domainsForHttps),void 0!==e.hostsForHttp&&null!==e.hostsForHttp&&e.hasOwnProperty("hostsForHttp")&&(r.hostsForHttp=e.hostsForHttp),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.TimeMachineOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.serverUrl="",i.prototype.isTimemachine=!1,i.prototype.dwellTimeMs=500,i.prototype.discoverabilityAltitudeMeters=15e3,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.TimeMachineOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.serverUrl=e.string();break;case 2:o.isTimemachine=e.bool();break;case 3:o.dwellTimeMs=e.int32();break;case 4:o.discoverabilityAltitudeMeters=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.serverUrl||r.isString(e.serverUrl)?void 0!==e.isTimemachine&&"boolean"!=typeof e.isTimemachine?"isTimemachine: boolean expected":void 0===e.dwellTimeMs||r.isInteger(e.dwellTimeMs)?void 0===e.discoverabilityAltitudeMeters||r.isInteger(e.discoverabilityAltitudeMeters)?null:"discoverabilityAltitudeMeters: integer expected":"dwellTimeMs: integer expected":"serverUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.TimeMachineOptionsProto)return e;var t=new n.keyhole.dbroot.TimeMachineOptionsProto;return void 0!==e.serverUrl&&null!==e.serverUrl&&(t.serverUrl=String(e.serverUrl)),void 0!==e.isTimemachine&&null!==e.isTimemachine&&(t.isTimemachine=Boolean(e.isTimemachine)),void 0!==e.dwellTimeMs&&null!==e.dwellTimeMs&&(t.dwellTimeMs=0|e.dwellTimeMs),void 0!==e.discoverabilityAltitudeMeters&&null!==e.discoverabilityAltitudeMeters&&(t.discoverabilityAltitudeMeters=0|e.discoverabilityAltitudeMeters),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.serverUrl="",r.isTimemachine=!1,r.dwellTimeMs=500,r.discoverabilityAltitudeMeters=15e3),void 0!==e.serverUrl&&null!==e.serverUrl&&e.hasOwnProperty("serverUrl")&&(r.serverUrl=e.serverUrl),void 0!==e.isTimemachine&&null!==e.isTimemachine&&e.hasOwnProperty("isTimemachine")&&(r.isTimemachine=e.isTimemachine),void 0!==e.dwellTimeMs&&null!==e.dwellTimeMs&&e.hasOwnProperty("dwellTimeMs")&&(r.dwellTimeMs=e.dwellTimeMs),void 0!==e.discoverabilityAltitudeMeters&&null!==e.discoverabilityAltitudeMeters&&e.hasOwnProperty("discoverabilityAltitudeMeters")&&(r.discoverabilityAltitudeMeters=e.discoverabilityAltitudeMeters),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.AutopiaOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.metadataServerUrl="http://cbk0.google.com/cbk",i.prototype.depthmapServerUrl="http://cbk0.google.com/cbk",i.prototype.coverageOverlayUrl="",i.prototype.maxImageryQps=0,i.prototype.maxMetadataDepthmapQps=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.AutopiaOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.metadataServerUrl=e.string();break;case 2:o.depthmapServerUrl=e.string();break;case 3:o.coverageOverlayUrl=e.string();break;case 4:o.maxImageryQps=e.float();break;case 5:o.maxMetadataDepthmapQps=e.float();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.metadataServerUrl||r.isString(e.metadataServerUrl)?void 0===e.depthmapServerUrl||r.isString(e.depthmapServerUrl)?void 0===e.coverageOverlayUrl||r.isString(e.coverageOverlayUrl)?void 0!==e.maxImageryQps&&"number"!=typeof e.maxImageryQps?"maxImageryQps: number expected":void 0!==e.maxMetadataDepthmapQps&&"number"!=typeof e.maxMetadataDepthmapQps?"maxMetadataDepthmapQps: number expected":null:"coverageOverlayUrl: string expected":"depthmapServerUrl: string expected":"metadataServerUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.AutopiaOptionsProto)return e;var t=new n.keyhole.dbroot.AutopiaOptionsProto;return void 0!==e.metadataServerUrl&&null!==e.metadataServerUrl&&(t.metadataServerUrl=String(e.metadataServerUrl)),void 0!==e.depthmapServerUrl&&null!==e.depthmapServerUrl&&(t.depthmapServerUrl=String(e.depthmapServerUrl)),void 0!==e.coverageOverlayUrl&&null!==e.coverageOverlayUrl&&(t.coverageOverlayUrl=String(e.coverageOverlayUrl)),void 0!==e.maxImageryQps&&null!==e.maxImageryQps&&(t.maxImageryQps=Number(e.maxImageryQps)),void 0!==e.maxMetadataDepthmapQps&&null!==e.maxMetadataDepthmapQps&&(t.maxMetadataDepthmapQps=Number(e.maxMetadataDepthmapQps)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.metadataServerUrl="http://cbk0.google.com/cbk",r.depthmapServerUrl="http://cbk0.google.com/cbk",r.coverageOverlayUrl="",r.maxImageryQps=0,r.maxMetadataDepthmapQps=0),void 0!==e.metadataServerUrl&&null!==e.metadataServerUrl&&e.hasOwnProperty("metadataServerUrl")&&(r.metadataServerUrl=e.metadataServerUrl),void 0!==e.depthmapServerUrl&&null!==e.depthmapServerUrl&&e.hasOwnProperty("depthmapServerUrl")&&(r.depthmapServerUrl=e.depthmapServerUrl),void 0!==e.coverageOverlayUrl&&null!==e.coverageOverlayUrl&&e.hasOwnProperty("coverageOverlayUrl")&&(r.coverageOverlayUrl=e.coverageOverlayUrl),void 0!==e.maxImageryQps&&null!==e.maxImageryQps&&e.hasOwnProperty("maxImageryQps")&&(r.maxImageryQps=e.maxImageryQps),void 0!==e.maxMetadataDepthmapQps&&null!==e.maxMetadataDepthmapQps&&e.hasOwnProperty("maxMetadataDepthmapQps")&&(r.maxMetadataDepthmapQps=e.maxMetadataDepthmapQps),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.CSIOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.samplingPercentage=0,i.prototype.experimentId="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.CSIOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.samplingPercentage=e.int32();break;case 2:o.experimentId=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.samplingPercentage||r.isInteger(e.samplingPercentage)?void 0===e.experimentId||r.isString(e.experimentId)?null:"experimentId: string expected":"samplingPercentage: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CSIOptionsProto)return e;var t=new n.keyhole.dbroot.CSIOptionsProto;return void 0!==e.samplingPercentage&&null!==e.samplingPercentage&&(t.samplingPercentage=0|e.samplingPercentage),void 0!==e.experimentId&&null!==e.experimentId&&(t.experimentId=String(e.experimentId)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.samplingPercentage=0,r.experimentId=""),void 0!==e.samplingPercentage&&null!==e.samplingPercentage&&e.hasOwnProperty("samplingPercentage")&&(r.samplingPercentage=e.samplingPercentage),void 0!==e.experimentId&&null!==e.experimentId&&e.hasOwnProperty("experimentId")&&(r.experimentId=e.experimentId),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.SearchTabProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.isVisible=!1,o.prototype.tabLabel=null,o.prototype.baseUrl="",o.prototype.viewportPrefix="",o.prototype.inputBox=r.emptyArray,o.prototype.requirement=null;var a={1:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.SearchTabProto.InputBoxInfo",5:"keyhole.dbroot.RequirementProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.SearchTabProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.isVisible=e.bool();break;case 2:o.tabLabel=a[1].decode(e,e.uint32());break;case 3:o.baseUrl=e.string();break;case 4:o.viewportPrefix=e.string();break;case 5:o.inputBox&&o.inputBox.length||(o.inputBox=[]),o.inputBox.push(a[4].decode(e,e.uint32()));break;case 6:o.requirement=a[5].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if("boolean"!=typeof e.isVisible)return"isVisible: boolean expected";if(void 0!==e.tabLabel&&null!==e.tabLabel){var t=a[1].verify(e.tabLabel);if(t)return"tabLabel."+t}if(void 0!==e.baseUrl&&!r.isString(e.baseUrl))return"baseUrl: string expected";if(void 0!==e.viewportPrefix&&!r.isString(e.viewportPrefix))return"viewportPrefix: string expected";if(void 0!==e.inputBox){if(!Array.isArray(e.inputBox))return"inputBox: array expected";for(var i=0;i<e.inputBox.length;++i){var t=a[4].verify(e.inputBox[i]);if(t)return"inputBox."+t}}if(void 0!==e.requirement&&null!==e.requirement){var t=a[5].verify(e.requirement);if(t)return"requirement."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SearchTabProto)return e;var t=new n.keyhole.dbroot.SearchTabProto;if(void 0!==e.isVisible&&null!==e.isVisible&&(t.isVisible=Boolean(e.isVisible)),void 0!==e.tabLabel&&null!==e.tabLabel){if("object"!=typeof e.tabLabel)throw TypeError(".keyhole.dbroot.SearchTabProto.tabLabel: object expected");t.tabLabel=a[1].fromObject(e.tabLabel)}if(void 0!==e.baseUrl&&null!==e.baseUrl&&(t.baseUrl=String(e.baseUrl)),void 0!==e.viewportPrefix&&null!==e.viewportPrefix&&(t.viewportPrefix=String(e.viewportPrefix)),e.inputBox){if(!Array.isArray(e.inputBox))throw TypeError(".keyhole.dbroot.SearchTabProto.inputBox: array expected");t.inputBox=[];for(var r=0;r<e.inputBox.length;++r){if("object"!=typeof e.inputBox[r])throw TypeError(".keyhole.dbroot.SearchTabProto.inputBox: object expected");t.inputBox[r]=a[4].fromObject(e.inputBox[r])}}if(void 0!==e.requirement&&null!==e.requirement){
if("object"!=typeof e.requirement)throw TypeError(".keyhole.dbroot.SearchTabProto.requirement: object expected");t.requirement=a[5].fromObject(e.requirement)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.inputBox=[]),t.defaults&&(r.isVisible=!1,r.tabLabel=null,r.baseUrl="",r.viewportPrefix="",r.requirement=null),void 0!==e.isVisible&&null!==e.isVisible&&e.hasOwnProperty("isVisible")&&(r.isVisible=e.isVisible),void 0!==e.tabLabel&&null!==e.tabLabel&&e.hasOwnProperty("tabLabel")&&(r.tabLabel=a[1].toObject(e.tabLabel,t)),void 0!==e.baseUrl&&null!==e.baseUrl&&e.hasOwnProperty("baseUrl")&&(r.baseUrl=e.baseUrl),void 0!==e.viewportPrefix&&null!==e.viewportPrefix&&e.hasOwnProperty("viewportPrefix")&&(r.viewportPrefix=e.viewportPrefix),void 0!==e.inputBox&&null!==e.inputBox&&e.hasOwnProperty("inputBox")){r.inputBox=[];for(var i=0;i<e.inputBox.length;++i)r.inputBox[i]=a[4].toObject(e.inputBox[i],t)}return void 0!==e.requirement&&null!==e.requirement&&e.hasOwnProperty("requirement")&&(r.requirement=a[5].toObject(e.requirement,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.InputBoxInfo=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.label=null,o.prototype.queryVerb="",o.prototype.queryPrepend="";var a={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.label=a[0].decode(e,e.uint32());break;case 2:o.queryVerb=e.string();break;case 3:o.queryPrepend=e.string();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t=a[0].verify(e.label);return t?"label."+t:r.isString(e.queryVerb)?void 0===e.queryPrepend||r.isString(e.queryPrepend)?null:"queryPrepend: string expected":"queryVerb: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SearchTabProto.InputBoxInfo)return e;var t=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;if(void 0!==e.label&&null!==e.label){if("object"!=typeof e.label)throw TypeError(".keyhole.dbroot.SearchTabProto.InputBoxInfo.label: object expected");t.label=a[0].fromObject(e.label)}return void 0!==e.queryVerb&&null!==e.queryVerb&&(t.queryVerb=String(e.queryVerb)),void 0!==e.queryPrepend&&null!==e.queryPrepend&&(t.queryPrepend=String(e.queryPrepend)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.label=null,r.queryVerb="",r.queryPrepend=""),void 0!==e.label&&null!==e.label&&e.hasOwnProperty("label")&&(r.label=a[0].toObject(e.label,t)),void 0!==e.queryVerb&&null!==e.queryVerb&&e.hasOwnProperty("queryVerb")&&(r.queryVerb=e.queryVerb),void 0!==e.queryPrepend&&null!==e.queryPrepend&&e.hasOwnProperty("queryPrepend")&&(r.queryPrepend=e.queryPrepend),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o}(),o.CobrandProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.logoUrl="",o.prototype.xCoord=null,o.prototype.yCoord=null,o.prototype.tiePoint=6,o.prototype.screenSize=0;var a={1:"keyhole.dbroot.CobrandProto.Coord",2:"keyhole.dbroot.CobrandProto.Coord",3:"keyhole.dbroot.CobrandProto.TiePoint"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.CobrandProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.logoUrl=e.string();break;case 2:o.xCoord=a[1].decode(e,e.uint32());break;case 3:o.yCoord=a[2].decode(e,e.uint32());break;case 4:o.tiePoint=e.uint32();break;case 5:o.screenSize=e.double();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.logoUrl))return"logoUrl: string expected";if(void 0!==e.xCoord&&null!==e.xCoord){var t=a[1].verify(e.xCoord);if(t)return"xCoord."+t}if(void 0!==e.yCoord&&null!==e.yCoord){var t=a[2].verify(e.yCoord);if(t)return"yCoord."+t}if(void 0!==e.tiePoint)switch(e.tiePoint){default:return"tiePoint: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:}return void 0!==e.screenSize&&"number"!=typeof e.screenSize?"screenSize: number expected":null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CobrandProto)return e;var t=new n.keyhole.dbroot.CobrandProto;if(void 0!==e.logoUrl&&null!==e.logoUrl&&(t.logoUrl=String(e.logoUrl)),void 0!==e.xCoord&&null!==e.xCoord){if("object"!=typeof e.xCoord)throw TypeError(".keyhole.dbroot.CobrandProto.xCoord: object expected");t.xCoord=a[1].fromObject(e.xCoord)}if(void 0!==e.yCoord&&null!==e.yCoord){if("object"!=typeof e.yCoord)throw TypeError(".keyhole.dbroot.CobrandProto.yCoord: object expected");t.yCoord=a[2].fromObject(e.yCoord)}switch(e.tiePoint){case"TOP_LEFT":case 0:t.tiePoint=0;break;case"TOP_CENTER":case 1:t.tiePoint=1;break;case"TOP_RIGHT":case 2:t.tiePoint=2;break;case"MID_LEFT":case 3:t.tiePoint=3;break;case"MID_CENTER":case 4:t.tiePoint=4;break;case"MID_RIGHT":case 5:t.tiePoint=5;break;case"BOTTOM_LEFT":case 6:t.tiePoint=6;break;case"BOTTOM_CENTER":case 7:t.tiePoint=7;break;case"BOTTOM_RIGHT":case 8:t.tiePoint=8}return void 0!==e.screenSize&&null!==e.screenSize&&(t.screenSize=Number(e.screenSize)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.logoUrl="",r.xCoord=null,r.yCoord=null,r.tiePoint=t.enums===String?"BOTTOM_LEFT":6,r.screenSize=0),void 0!==e.logoUrl&&null!==e.logoUrl&&e.hasOwnProperty("logoUrl")&&(r.logoUrl=e.logoUrl),void 0!==e.xCoord&&null!==e.xCoord&&e.hasOwnProperty("xCoord")&&(r.xCoord=a[1].toObject(e.xCoord,t)),void 0!==e.yCoord&&null!==e.yCoord&&e.hasOwnProperty("yCoord")&&(r.yCoord=a[2].toObject(e.yCoord,t)),void 0!==e.tiePoint&&null!==e.tiePoint&&e.hasOwnProperty("tiePoint")&&(r.tiePoint=t.enums===String?a[3][e.tiePoint]:e.tiePoint),void 0!==e.screenSize&&null!==e.screenSize&&e.hasOwnProperty("screenSize")&&(r.screenSize=e.screenSize),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.Coord=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.value=0,r.prototype.isRelative=!1,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.CobrandProto.Coord;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.value=e.double();break;case 2:o.isRelative=e.bool();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":"number"!=typeof e.value?"value: number expected":void 0!==e.isRelative&&"boolean"!=typeof e.isRelative?"isRelative: boolean expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CobrandProto.Coord)return e;var t=new n.keyhole.dbroot.CobrandProto.Coord;return void 0!==e.value&&null!==e.value&&(t.value=Number(e.value)),void 0!==e.isRelative&&null!==e.isRelative&&(t.isRelative=Boolean(e.isRelative)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.value=0,r.isRelative=!1),void 0!==e.value&&null!==e.value&&e.hasOwnProperty("value")&&(r.value=e.value),void 0!==e.isRelative&&null!==e.isRelative&&e.hasOwnProperty("isRelative")&&(r.isRelative=e.isRelative),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.TiePoint=function(){var e={},t=Object.create(e);return t.TOP_LEFT=0,t.TOP_CENTER=1,t.TOP_RIGHT=2,t.MID_LEFT=3,t.MID_CENTER=4,t.MID_RIGHT=5,t.BOTTOM_LEFT=6,t.BOTTOM_CENTER=7,t.BOTTOM_RIGHT=8,t}(),o}(),o.DatabaseDescriptionProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.databaseName=null,o.prototype.databaseUrl="";var a={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DatabaseDescriptionProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.databaseName=a[0].decode(e,e.uint32());break;case 2:o.databaseUrl=e.string();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.databaseName&&null!==e.databaseName){var t=a[0].verify(e.databaseName);if(t)return"databaseName."+t}return r.isString(e.databaseUrl)?null:"databaseUrl: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DatabaseDescriptionProto)return e;var t=new n.keyhole.dbroot.DatabaseDescriptionProto;if(void 0!==e.databaseName&&null!==e.databaseName){if("object"!=typeof e.databaseName)throw TypeError(".keyhole.dbroot.DatabaseDescriptionProto.databaseName: object expected");t.databaseName=a[0].fromObject(e.databaseName)}return void 0!==e.databaseUrl&&null!==e.databaseUrl&&(t.databaseUrl=String(e.databaseUrl)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.databaseName=null,r.databaseUrl=""),void 0!==e.databaseName&&null!==e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=a[0].toObject(e.databaseName,t)),void 0!==e.databaseUrl&&null!==e.databaseUrl&&e.hasOwnProperty("databaseUrl")&&(r.databaseUrl=e.databaseUrl),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.ConfigScriptProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.scriptName="",i.prototype.scriptData="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ConfigScriptProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.scriptName=e.string();break;case 2:o.scriptData=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isString(e.scriptName)?r.isString(e.scriptData)?null:"scriptData: string expected":"scriptName: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ConfigScriptProto)return e;var t=new n.keyhole.dbroot.ConfigScriptProto;return void 0!==e.scriptName&&null!==e.scriptName&&(t.scriptName=String(e.scriptName)),void 0!==e.scriptData&&null!==e.scriptData&&(t.scriptData=String(e.scriptData)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.scriptName="",r.scriptData=""),void 0!==e.scriptName&&null!==e.scriptName&&e.hasOwnProperty("scriptName")&&(r.scriptName=e.scriptName),void 0!==e.scriptData&&null!==e.scriptData&&e.hasOwnProperty("scriptData")&&(r.scriptData=e.scriptData),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.SwoopParamsProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.startDistInMeters=0,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.SwoopParamsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.startDistInMeters=e.double();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.startDistInMeters&&"number"!=typeof e.startDistInMeters?"startDistInMeters: number expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SwoopParamsProto)return e;var t=new n.keyhole.dbroot.SwoopParamsProto;return void 0!==e.startDistInMeters&&null!==e.startDistInMeters&&(t.startDistInMeters=Number(e.startDistInMeters)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.startDistInMeters=0),void 0!==e.startDistInMeters&&null!==e.startDistInMeters&&e.hasOwnProperty("startDistInMeters")&&(r.startDistInMeters=e.startDistInMeters),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.PostingServerProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.name=null,r.prototype.baseUrl=null,r.prototype.postWizardPath=null,r.prototype.fileSubmitPath=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.PostingServerProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.name=o[0].decode(e,e.uint32());break;case 2:a.baseUrl=o[1].decode(e,e.uint32());break;case 3:a.postWizardPath=o[2].decode(e,e.uint32());break;case 4:a.fileSubmitPath=o[3].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.name&&null!==e.name){var t=o[0].verify(e.name);if(t)return"name."+t}if(void 0!==e.baseUrl&&null!==e.baseUrl){var t=o[1].verify(e.baseUrl);if(t)return"baseUrl."+t}if(void 0!==e.postWizardPath&&null!==e.postWizardPath){var t=o[2].verify(e.postWizardPath);if(t)return"postWizardPath."+t}if(void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath){var t=o[3].verify(e.fileSubmitPath);if(t)return"fileSubmitPath."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PostingServerProto)return e;var t=new n.keyhole.dbroot.PostingServerProto;if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.PostingServerProto.name: object expected");t.name=o[0].fromObject(e.name)}if(void 0!==e.baseUrl&&null!==e.baseUrl){if("object"!=typeof e.baseUrl)throw TypeError(".keyhole.dbroot.PostingServerProto.baseUrl: object expected");t.baseUrl=o[1].fromObject(e.baseUrl)}if(void 0!==e.postWizardPath&&null!==e.postWizardPath){if("object"!=typeof e.postWizardPath)throw TypeError(".keyhole.dbroot.PostingServerProto.postWizardPath: object expected");t.postWizardPath=o[2].fromObject(e.postWizardPath)}if(void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath){if("object"!=typeof e.fileSubmitPath)throw TypeError(".keyhole.dbroot.PostingServerProto.fileSubmitPath: object expected");t.fileSubmitPath=o[3].fromObject(e.fileSubmitPath)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.name=null,r.baseUrl=null,r.postWizardPath=null,r.fileSubmitPath=null),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[0].toObject(e.name,t)),void 0!==e.baseUrl&&null!==e.baseUrl&&e.hasOwnProperty("baseUrl")&&(r.baseUrl=o[1].toObject(e.baseUrl,t)),void 0!==e.postWizardPath&&null!==e.postWizardPath&&e.hasOwnProperty("postWizardPath")&&(r.postWizardPath=o[2].toObject(e.postWizardPath,t)),void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath&&e.hasOwnProperty("fileSubmitPath")&&(r.fileSubmitPath=o[3].toObject(e.fileSubmitPath,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.PlanetaryDatabaseProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null,r.prototype.name=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.PlanetaryDatabaseProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;case 2:a.name=o[1].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t=o[0].verify(e.url);if(t)return"url."+t;var t=o[1].verify(e.name);return t?"name."+t:null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PlanetaryDatabaseProto)return e;var t=new n.keyhole.dbroot.PlanetaryDatabaseProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.url: object expected");t.url=o[0].fromObject(e.url)}if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.name: object expected");t.name=o[1].fromObject(e.name)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.name=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[1].toObject(e.name,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.LogServerProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.url=null,o.prototype.enable=!1,o.prototype.throttlingFactor=1;var a={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.LogServerProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.url=a[0].decode(e,e.uint32());break;case 2:o.enable=e.bool();break;case 3:o.throttlingFactor=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=a[0].verify(e.url);if(t)return"url."+t}return void 0!==e.enable&&"boolean"!=typeof e.enable?"enable: boolean expected":void 0===e.throttlingFactor||r.isInteger(e.throttlingFactor)?null:"throttlingFactor: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LogServerProto)return e;var t=new n.keyhole.dbroot.LogServerProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.LogServerProto.url: object expected");t.url=a[0].fromObject(e.url)}return void 0!==e.enable&&null!==e.enable&&(t.enable=Boolean(e.enable)),void 0!==e.throttlingFactor&&null!==e.throttlingFactor&&(t.throttlingFactor=0|e.throttlingFactor),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.enable=!1,r.throttlingFactor=1),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[0].toObject(e.url,t)),void 0!==e.enable&&null!==e.enable&&e.hasOwnProperty("enable")&&(r.enable=e.enable),void 0!==e.throttlingFactor&&null!==e.throttlingFactor&&e.hasOwnProperty("throttlingFactor")&&(r.throttlingFactor=e.throttlingFactor),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.EndSnippetProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.model=null,o.prototype.authServerUrl=null,o.prototype.disableAuthentication=!1,o.prototype.mfeDomains=r.emptyArray,o.prototype.mfeLangParam="hl=$5Bhl5D",o.prototype.adsUrlPatterns="",o.prototype.reverseGeocoderUrl=null,o.prototype.reverseGeocoderProtocolVersion=3,o.prototype.skyDatabaseIsAvailable=!0,o.prototype.skyDatabaseUrl=null,o.prototype.defaultWebPageIntlUrl=null,o.prototype.numStartUpTips=17,o.prototype.startUpTipsUrl=null,o.prototype.numProStartUpTips=0,o.prototype.proStartUpTipsUrl=null,o.prototype.startupTipsIntlUrl=null,o.prototype.userGuideIntlUrl=null,o.prototype.supportCenterIntlUrl=null,o.prototype.businessListingIntlUrl=null,o.prototype.supportAnswerIntlUrl=null,o.prototype.supportTopicIntlUrl=null,o.prototype.supportRequestIntlUrl=null,o.prototype.earthIntlUrl=null,o.prototype.addContentUrl=null,o.prototype.sketchupNotInstalledUrl=null,o.prototype.sketchupErrorUrl=null,o.prototype.freeLicenseUrl=null,o.prototype.proLicenseUrl=null,o.prototype.tutorialUrl=null,o.prototype.keyboardShortcutsUrl=null,o.prototype.releaseNotesUrl=null,o.prototype.hideUserData=!1,o.prototype.useGeLogo=!0,o.prototype.dioramaDescriptionUrlBase=null,o.prototype.dioramaDefaultColor=4291281607,o.prototype.dioramaBlacklistUrl=null,o.prototype.clientOptions=null,o.prototype.fetchingOptions=null,o.prototype.timeMachineOptions=null,o.prototype.csiOptions=null,o.prototype.searchTab=r.emptyArray,o.prototype.cobrandInfo=r.emptyArray,o.prototype.validDatabase=r.emptyArray,o.prototype.configScript=r.emptyArray,o.prototype.deauthServerUrl=null,o.prototype.swoopParameters=null,o.prototype.bbsServerInfo=null,o.prototype.dataErrorServerInfo=null,o.prototype.planetaryDatabase=r.emptyArray,o.prototype.logServer=null,o.prototype.autopiaOptions=null,o.prototype.searchConfig=null,o.prototype.searchInfo=null,o.prototype.elevationServiceBaseUrl="http://maps.google.com/maps/api/elevation/",o.prototype.elevationProfileQueryDelay=500,o.prototype.proUpgradeUrl=null,o.prototype.earthCommunityUrl=null,o.prototype.googleMapsUrl=null,o.prototype.sharingUrl=null,o.prototype.privacyPolicyUrl=null,o.prototype.doGplusUserCheck=!1,o.prototype.rocktreeDataProto=null,o.prototype.filmstripConfig=r.emptyArray,o.prototype.showSigninButton=!1,o.prototype.proMeasureUpsellUrl=null,o.prototype.proPrintUpsellUrl=null,o.prototype.starDataProto=null,o.prototype.feedbackUrl=null,o.prototype.oauth2LoginUrl=null;var a={0:"keyhole.dbroot.PlanetModelProto",1:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.MfeDomainFeaturesProto",6:"keyhole.dbroot.StringIdOrValueProto",9:"keyhole.dbroot.StringIdOrValueProto",10:"keyhole.dbroot.StringIdOrValueProto",12:"keyhole.dbroot.StringIdOrValueProto",14:"keyhole.dbroot.StringIdOrValueProto",15:"keyhole.dbroot.StringIdOrValueProto",16:"keyhole.dbroot.StringIdOrValueProto",17:"keyhole.dbroot.StringIdOrValueProto",18:"keyhole.dbroot.StringIdOrValueProto",19:"keyhole.dbroot.StringIdOrValueProto",20:"keyhole.dbroot.StringIdOrValueProto",21:"keyhole.dbroot.StringIdOrValueProto",22:"keyhole.dbroot.StringIdOrValueProto",23:"keyhole.dbroot.StringIdOrValueProto",24:"keyhole.dbroot.StringIdOrValueProto",25:"keyhole.dbroot.StringIdOrValueProto",26:"keyhole.dbroot.StringIdOrValueProto",27:"keyhole.dbroot.StringIdOrValueProto",28:"keyhole.dbroot.StringIdOrValueProto",29:"keyhole.dbroot.StringIdOrValueProto",30:"keyhole.dbroot.StringIdOrValueProto",33:"keyhole.dbroot.StringIdOrValueProto",35:"keyhole.dbroot.StringIdOrValueProto",36:"keyhole.dbroot.ClientOptionsProto",37:"keyhole.dbroot.FetchingOptionsProto",38:"keyhole.dbroot.TimeMachineOptionsProto",39:"keyhole.dbroot.CSIOptionsProto",40:"keyhole.dbroot.SearchTabProto",41:"keyhole.dbroot.CobrandProto",42:"keyhole.dbroot.DatabaseDescriptionProto",43:"keyhole.dbroot.ConfigScriptProto",44:"keyhole.dbroot.StringIdOrValueProto",45:"keyhole.dbroot.SwoopParamsProto",46:"keyhole.dbroot.PostingServerProto",47:"keyhole.dbroot.PostingServerProto",48:"keyhole.dbroot.PlanetaryDatabaseProto",49:"keyhole.dbroot.LogServerProto",50:"keyhole.dbroot.AutopiaOptionsProto",51:"keyhole.dbroot.EndSnippetProto.SearchConfigProto",52:"keyhole.dbroot.EndSnippetProto.SearchInfoProto",55:"keyhole.dbroot.StringIdOrValueProto",56:"keyhole.dbroot.StringIdOrValueProto",57:"keyhole.dbroot.StringIdOrValueProto",58:"keyhole.dbroot.StringIdOrValueProto",59:"keyhole.dbroot.StringIdOrValueProto",61:"keyhole.dbroot.EndSnippetProto.RockTreeDataProto",62:"keyhole.dbroot.EndSnippetProto.FilmstripConfigProto",64:"keyhole.dbroot.StringIdOrValueProto",65:"keyhole.dbroot.StringIdOrValueProto",66:"keyhole.dbroot.EndSnippetProto.StarDataProto",67:"keyhole.dbroot.StringIdOrValueProto",68:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.model=a[0].decode(e,e.uint32());break;case 2:o.authServerUrl=a[1].decode(e,e.uint32());break;case 3:o.disableAuthentication=e.bool();break;case 4:o.mfeDomains&&o.mfeDomains.length||(o.mfeDomains=[]),o.mfeDomains.push(a[3].decode(e,e.uint32()));break;case 5:o.mfeLangParam=e.string();break;case 6:o.adsUrlPatterns=e.string();break;case 7:o.reverseGeocoderUrl=a[6].decode(e,e.uint32());break;case 8:o.reverseGeocoderProtocolVersion=e.int32();break;case 9:o.skyDatabaseIsAvailable=e.bool();break;case 10:o.skyDatabaseUrl=a[9].decode(e,e.uint32());break;case 11:o.defaultWebPageIntlUrl=a[10].decode(e,e.uint32());break;case 12:o.numStartUpTips=e.int32();break;case 13:o.startUpTipsUrl=a[12].decode(e,e.uint32());break;case 51:o.numProStartUpTips=e.int32();break;case 52:o.proStartUpTipsUrl=a[14].decode(e,e.uint32());break;case 64:o.startupTipsIntlUrl=a[15].decode(e,e.uint32());break;case 14:o.userGuideIntlUrl=a[16].decode(e,e.uint32());break;case 15:o.supportCenterIntlUrl=a[17].decode(e,e.uint32());break;case 16:o.businessListingIntlUrl=a[18].decode(e,e.uint32());break;case 17:o.supportAnswerIntlUrl=a[19].decode(e,e.uint32());break;case 18:o.supportTopicIntlUrl=a[20].decode(e,e.uint32());break;case 19:o.supportRequestIntlUrl=a[21].decode(e,e.uint32());break;case 20:o.earthIntlUrl=a[22].decode(e,e.uint32());break;case 21:o.addContentUrl=a[23].decode(e,e.uint32());break;case 22:o.sketchupNotInstalledUrl=a[24].decode(e,e.uint32());break;case 23:o.sketchupErrorUrl=a[25].decode(e,e.uint32());break;case 24:o.freeLicenseUrl=a[26].decode(e,e.uint32());break;case 25:o.proLicenseUrl=a[27].decode(e,e.uint32());break;case 48:o.tutorialUrl=a[28].decode(e,e.uint32());break;case 49:o.keyboardShortcutsUrl=a[29].decode(e,e.uint32());break;case 50:o.releaseNotesUrl=a[30].decode(e,e.uint32());break;case 26:o.hideUserData=e.bool();break;case 27:o.useGeLogo=e.bool();break;case 28:o.dioramaDescriptionUrlBase=a[33].decode(e,e.uint32());break;case 29:o.dioramaDefaultColor=e.uint32();break;case 53:o.dioramaBlacklistUrl=a[35].decode(e,e.uint32());break;case 30:o.clientOptions=a[36].decode(e,e.uint32());break;case 31:o.fetchingOptions=a[37].decode(e,e.uint32());break;case 32:o.timeMachineOptions=a[38].decode(e,e.uint32());break;case 33:o.csiOptions=a[39].decode(e,e.uint32());break;case 34:o.searchTab&&o.searchTab.length||(o.searchTab=[]),o.searchTab.push(a[40].decode(e,e.uint32()));break;case 35:o.cobrandInfo&&o.cobrandInfo.length||(o.cobrandInfo=[]),o.cobrandInfo.push(a[41].decode(e,e.uint32()));break;case 36:o.validDatabase&&o.validDatabase.length||(o.validDatabase=[]),o.validDatabase.push(a[42].decode(e,e.uint32()));break;case 37:o.configScript&&o.configScript.length||(o.configScript=[]),o.configScript.push(a[43].decode(e,e.uint32()));break;case 38:o.deauthServerUrl=a[44].decode(e,e.uint32());break;case 39:o.swoopParameters=a[45].decode(e,e.uint32());break;case 40:o.bbsServerInfo=a[46].decode(e,e.uint32());break;case 41:o.dataErrorServerInfo=a[47].decode(e,e.uint32());break;case 42:o.planetaryDatabase&&o.planetaryDatabase.length||(o.planetaryDatabase=[]),o.planetaryDatabase.push(a[48].decode(e,e.uint32()));break;case 43:o.logServer=a[49].decode(e,e.uint32());break;case 44:o.autopiaOptions=a[50].decode(e,e.uint32());break;case 54:o.searchConfig=a[51].decode(e,e.uint32());break;case 45:o.searchInfo=a[52].decode(e,e.uint32());break;case 46:o.elevationServiceBaseUrl=e.string();break;case 47:o.elevationProfileQueryDelay=e.int32();break;case 55:o.proUpgradeUrl=a[55].decode(e,e.uint32());break;case 56:o.earthCommunityUrl=a[56].decode(e,e.uint32());break;case 57:o.googleMapsUrl=a[57].decode(e,e.uint32());break;case 58:o.sharingUrl=a[58].decode(e,e.uint32());break;case 59:o.privacyPolicyUrl=a[59].decode(e,e.uint32());break;case 60:o.doGplusUserCheck=e.bool();break;case 61:o.rocktreeDataProto=a[61].decode(e,e.uint32());break;case 62:o.filmstripConfig&&o.filmstripConfig.length||(o.filmstripConfig=[]),o.filmstripConfig.push(a[62].decode(e,e.uint32()));break;case 63:o.showSigninButton=e.bool();break;case 65:o.proMeasureUpsellUrl=a[64].decode(e,e.uint32());break;case 66:o.proPrintUpsellUrl=a[65].decode(e,e.uint32());break;case 67:o.starDataProto=a[66].decode(e,e.uint32());break;case 68:o.feedbackUrl=a[67].decode(e,e.uint32());break;case 69:o.oauth2LoginUrl=a[68].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.model&&null!==e.model){var t=a[0].verify(e.model);if(t)return"model."+t}if(void 0!==e.authServerUrl&&null!==e.authServerUrl){var t=a[1].verify(e.authServerUrl);if(t)return"authServerUrl."+t}if(void 0!==e.disableAuthentication&&"boolean"!=typeof e.disableAuthentication)return"disableAuthentication: boolean expected";if(void 0!==e.mfeDomains){if(!Array.isArray(e.mfeDomains))return"mfeDomains: array expected";for(var i=0;i<e.mfeDomains.length;++i){var t=a[3].verify(e.mfeDomains[i]);if(t)return"mfeDomains."+t}}if(void 0!==e.mfeLangParam&&!r.isString(e.mfeLangParam))return"mfeLangParam: string expected";if(void 0!==e.adsUrlPatterns&&!r.isString(e.adsUrlPatterns))return"adsUrlPatterns: string expected";if(void 0!==e.reverseGeocoderUrl&&null!==e.reverseGeocoderUrl){var t=a[6].verify(e.reverseGeocoderUrl);if(t)return"reverseGeocoderUrl."+t}if(void 0!==e.reverseGeocoderProtocolVersion&&!r.isInteger(e.reverseGeocoderProtocolVersion))return"reverseGeocoderProtocolVersion: integer expected";if(void 0!==e.skyDatabaseIsAvailable&&"boolean"!=typeof e.skyDatabaseIsAvailable)return"skyDatabaseIsAvailable: boolean expected";if(void 0!==e.skyDatabaseUrl&&null!==e.skyDatabaseUrl){var t=a[9].verify(e.skyDatabaseUrl);if(t)return"skyDatabaseUrl."+t}if(void 0!==e.defaultWebPageIntlUrl&&null!==e.defaultWebPageIntlUrl){var t=a[10].verify(e.defaultWebPageIntlUrl);if(t)return"defaultWebPageIntlUrl."+t}if(void 0!==e.numStartUpTips&&!r.isInteger(e.numStartUpTips))return"numStartUpTips: integer expected";if(void 0!==e.startUpTipsUrl&&null!==e.startUpTipsUrl){var t=a[12].verify(e.startUpTipsUrl);if(t)return"startUpTipsUrl."+t}if(void 0!==e.numProStartUpTips&&!r.isInteger(e.numProStartUpTips))return"numProStartUpTips: integer expected";if(void 0!==e.proStartUpTipsUrl&&null!==e.proStartUpTipsUrl){var t=a[14].verify(e.proStartUpTipsUrl);if(t)return"proStartUpTipsUrl."+t}if(void 0!==e.startupTipsIntlUrl&&null!==e.startupTipsIntlUrl){var t=a[15].verify(e.startupTipsIntlUrl);if(t)return"startupTipsIntlUrl."+t}if(void 0!==e.userGuideIntlUrl&&null!==e.userGuideIntlUrl){var t=a[16].verify(e.userGuideIntlUrl);if(t)return"userGuideIntlUrl."+t}if(void 0!==e.supportCenterIntlUrl&&null!==e.supportCenterIntlUrl){var t=a[17].verify(e.supportCenterIntlUrl);if(t)return"supportCenterIntlUrl."+t}if(void 0!==e.businessListingIntlUrl&&null!==e.businessListingIntlUrl){var t=a[18].verify(e.businessListingIntlUrl);if(t)return"businessListingIntlUrl."+t}if(void 0!==e.supportAnswerIntlUrl&&null!==e.supportAnswerIntlUrl){var t=a[19].verify(e.supportAnswerIntlUrl);if(t)return"supportAnswerIntlUrl."+t}if(void 0!==e.supportTopicIntlUrl&&null!==e.supportTopicIntlUrl){var t=a[20].verify(e.supportTopicIntlUrl);if(t)return"supportTopicIntlUrl."+t}if(void 0!==e.supportRequestIntlUrl&&null!==e.supportRequestIntlUrl){var t=a[21].verify(e.supportRequestIntlUrl);if(t)return"supportRequestIntlUrl."+t}if(void 0!==e.earthIntlUrl&&null!==e.earthIntlUrl){var t=a[22].verify(e.earthIntlUrl);if(t)return"earthIntlUrl."+t}if(void 0!==e.addContentUrl&&null!==e.addContentUrl){var t=a[23].verify(e.addContentUrl);if(t)return"addContentUrl."+t}if(void 0!==e.sketchupNotInstalledUrl&&null!==e.sketchupNotInstalledUrl){
var t=a[24].verify(e.sketchupNotInstalledUrl);if(t)return"sketchupNotInstalledUrl."+t}if(void 0!==e.sketchupErrorUrl&&null!==e.sketchupErrorUrl){var t=a[25].verify(e.sketchupErrorUrl);if(t)return"sketchupErrorUrl."+t}if(void 0!==e.freeLicenseUrl&&null!==e.freeLicenseUrl){var t=a[26].verify(e.freeLicenseUrl);if(t)return"freeLicenseUrl."+t}if(void 0!==e.proLicenseUrl&&null!==e.proLicenseUrl){var t=a[27].verify(e.proLicenseUrl);if(t)return"proLicenseUrl."+t}if(void 0!==e.tutorialUrl&&null!==e.tutorialUrl){var t=a[28].verify(e.tutorialUrl);if(t)return"tutorialUrl."+t}if(void 0!==e.keyboardShortcutsUrl&&null!==e.keyboardShortcutsUrl){var t=a[29].verify(e.keyboardShortcutsUrl);if(t)return"keyboardShortcutsUrl."+t}if(void 0!==e.releaseNotesUrl&&null!==e.releaseNotesUrl){var t=a[30].verify(e.releaseNotesUrl);if(t)return"releaseNotesUrl."+t}if(void 0!==e.hideUserData&&"boolean"!=typeof e.hideUserData)return"hideUserData: boolean expected";if(void 0!==e.useGeLogo&&"boolean"!=typeof e.useGeLogo)return"useGeLogo: boolean expected";if(void 0!==e.dioramaDescriptionUrlBase&&null!==e.dioramaDescriptionUrlBase){var t=a[33].verify(e.dioramaDescriptionUrlBase);if(t)return"dioramaDescriptionUrlBase."+t}if(void 0!==e.dioramaDefaultColor&&!r.isInteger(e.dioramaDefaultColor))return"dioramaDefaultColor: integer expected";if(void 0!==e.dioramaBlacklistUrl&&null!==e.dioramaBlacklistUrl){var t=a[35].verify(e.dioramaBlacklistUrl);if(t)return"dioramaBlacklistUrl."+t}if(void 0!==e.clientOptions&&null!==e.clientOptions){var t=a[36].verify(e.clientOptions);if(t)return"clientOptions."+t}if(void 0!==e.fetchingOptions&&null!==e.fetchingOptions){var t=a[37].verify(e.fetchingOptions);if(t)return"fetchingOptions."+t}if(void 0!==e.timeMachineOptions&&null!==e.timeMachineOptions){var t=a[38].verify(e.timeMachineOptions);if(t)return"timeMachineOptions."+t}if(void 0!==e.csiOptions&&null!==e.csiOptions){var t=a[39].verify(e.csiOptions);if(t)return"csiOptions."+t}if(void 0!==e.searchTab){if(!Array.isArray(e.searchTab))return"searchTab: array expected";for(var i=0;i<e.searchTab.length;++i){var t=a[40].verify(e.searchTab[i]);if(t)return"searchTab."+t}}if(void 0!==e.cobrandInfo){if(!Array.isArray(e.cobrandInfo))return"cobrandInfo: array expected";for(var i=0;i<e.cobrandInfo.length;++i){var t=a[41].verify(e.cobrandInfo[i]);if(t)return"cobrandInfo."+t}}if(void 0!==e.validDatabase){if(!Array.isArray(e.validDatabase))return"validDatabase: array expected";for(var i=0;i<e.validDatabase.length;++i){var t=a[42].verify(e.validDatabase[i]);if(t)return"validDatabase."+t}}if(void 0!==e.configScript){if(!Array.isArray(e.configScript))return"configScript: array expected";for(var i=0;i<e.configScript.length;++i){var t=a[43].verify(e.configScript[i]);if(t)return"configScript."+t}}if(void 0!==e.deauthServerUrl&&null!==e.deauthServerUrl){var t=a[44].verify(e.deauthServerUrl);if(t)return"deauthServerUrl."+t}if(void 0!==e.swoopParameters&&null!==e.swoopParameters){var t=a[45].verify(e.swoopParameters);if(t)return"swoopParameters."+t}if(void 0!==e.bbsServerInfo&&null!==e.bbsServerInfo){var t=a[46].verify(e.bbsServerInfo);if(t)return"bbsServerInfo."+t}if(void 0!==e.dataErrorServerInfo&&null!==e.dataErrorServerInfo){var t=a[47].verify(e.dataErrorServerInfo);if(t)return"dataErrorServerInfo."+t}if(void 0!==e.planetaryDatabase){if(!Array.isArray(e.planetaryDatabase))return"planetaryDatabase: array expected";for(var i=0;i<e.planetaryDatabase.length;++i){var t=a[48].verify(e.planetaryDatabase[i]);if(t)return"planetaryDatabase."+t}}if(void 0!==e.logServer&&null!==e.logServer){var t=a[49].verify(e.logServer);if(t)return"logServer."+t}if(void 0!==e.autopiaOptions&&null!==e.autopiaOptions){var t=a[50].verify(e.autopiaOptions);if(t)return"autopiaOptions."+t}if(void 0!==e.searchConfig&&null!==e.searchConfig){var t=a[51].verify(e.searchConfig);if(t)return"searchConfig."+t}if(void 0!==e.searchInfo&&null!==e.searchInfo){var t=a[52].verify(e.searchInfo);if(t)return"searchInfo."+t}if(void 0!==e.elevationServiceBaseUrl&&!r.isString(e.elevationServiceBaseUrl))return"elevationServiceBaseUrl: string expected";if(void 0!==e.elevationProfileQueryDelay&&!r.isInteger(e.elevationProfileQueryDelay))return"elevationProfileQueryDelay: integer expected";if(void 0!==e.proUpgradeUrl&&null!==e.proUpgradeUrl){var t=a[55].verify(e.proUpgradeUrl);if(t)return"proUpgradeUrl."+t}if(void 0!==e.earthCommunityUrl&&null!==e.earthCommunityUrl){var t=a[56].verify(e.earthCommunityUrl);if(t)return"earthCommunityUrl."+t}if(void 0!==e.googleMapsUrl&&null!==e.googleMapsUrl){var t=a[57].verify(e.googleMapsUrl);if(t)return"googleMapsUrl."+t}if(void 0!==e.sharingUrl&&null!==e.sharingUrl){var t=a[58].verify(e.sharingUrl);if(t)return"sharingUrl."+t}if(void 0!==e.privacyPolicyUrl&&null!==e.privacyPolicyUrl){var t=a[59].verify(e.privacyPolicyUrl);if(t)return"privacyPolicyUrl."+t}if(void 0!==e.doGplusUserCheck&&"boolean"!=typeof e.doGplusUserCheck)return"doGplusUserCheck: boolean expected";if(void 0!==e.rocktreeDataProto&&null!==e.rocktreeDataProto){var t=a[61].verify(e.rocktreeDataProto);if(t)return"rocktreeDataProto."+t}if(void 0!==e.filmstripConfig){if(!Array.isArray(e.filmstripConfig))return"filmstripConfig: array expected";for(var i=0;i<e.filmstripConfig.length;++i){var t=a[62].verify(e.filmstripConfig[i]);if(t)return"filmstripConfig."+t}}if(void 0!==e.showSigninButton&&"boolean"!=typeof e.showSigninButton)return"showSigninButton: boolean expected";if(void 0!==e.proMeasureUpsellUrl&&null!==e.proMeasureUpsellUrl){var t=a[64].verify(e.proMeasureUpsellUrl);if(t)return"proMeasureUpsellUrl."+t}if(void 0!==e.proPrintUpsellUrl&&null!==e.proPrintUpsellUrl){var t=a[65].verify(e.proPrintUpsellUrl);if(t)return"proPrintUpsellUrl."+t}if(void 0!==e.starDataProto&&null!==e.starDataProto){var t=a[66].verify(e.starDataProto);if(t)return"starDataProto."+t}if(void 0!==e.feedbackUrl&&null!==e.feedbackUrl){var t=a[67].verify(e.feedbackUrl);if(t)return"feedbackUrl."+t}if(void 0!==e.oauth2LoginUrl&&null!==e.oauth2LoginUrl){var t=a[68].verify(e.oauth2LoginUrl);if(t)return"oauth2LoginUrl."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto;if(void 0!==e.model&&null!==e.model){if("object"!=typeof e.model)throw TypeError(".keyhole.dbroot.EndSnippetProto.model: object expected");t.model=a[0].fromObject(e.model)}if(void 0!==e.authServerUrl&&null!==e.authServerUrl){if("object"!=typeof e.authServerUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.authServerUrl: object expected");t.authServerUrl=a[1].fromObject(e.authServerUrl)}if(void 0!==e.disableAuthentication&&null!==e.disableAuthentication&&(t.disableAuthentication=Boolean(e.disableAuthentication)),e.mfeDomains){if(!Array.isArray(e.mfeDomains))throw TypeError(".keyhole.dbroot.EndSnippetProto.mfeDomains: array expected");t.mfeDomains=[];for(var r=0;r<e.mfeDomains.length;++r){if("object"!=typeof e.mfeDomains[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.mfeDomains: object expected");t.mfeDomains[r]=a[3].fromObject(e.mfeDomains[r])}}if(void 0!==e.mfeLangParam&&null!==e.mfeLangParam&&(t.mfeLangParam=String(e.mfeLangParam)),void 0!==e.adsUrlPatterns&&null!==e.adsUrlPatterns&&(t.adsUrlPatterns=String(e.adsUrlPatterns)),void 0!==e.reverseGeocoderUrl&&null!==e.reverseGeocoderUrl){if("object"!=typeof e.reverseGeocoderUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.reverseGeocoderUrl: object expected");t.reverseGeocoderUrl=a[6].fromObject(e.reverseGeocoderUrl)}if(void 0!==e.reverseGeocoderProtocolVersion&&null!==e.reverseGeocoderProtocolVersion&&(t.reverseGeocoderProtocolVersion=0|e.reverseGeocoderProtocolVersion),void 0!==e.skyDatabaseIsAvailable&&null!==e.skyDatabaseIsAvailable&&(t.skyDatabaseIsAvailable=Boolean(e.skyDatabaseIsAvailable)),void 0!==e.skyDatabaseUrl&&null!==e.skyDatabaseUrl){if("object"!=typeof e.skyDatabaseUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.skyDatabaseUrl: object expected");t.skyDatabaseUrl=a[9].fromObject(e.skyDatabaseUrl)}if(void 0!==e.defaultWebPageIntlUrl&&null!==e.defaultWebPageIntlUrl){if("object"!=typeof e.defaultWebPageIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.defaultWebPageIntlUrl: object expected");t.defaultWebPageIntlUrl=a[10].fromObject(e.defaultWebPageIntlUrl)}if(void 0!==e.numStartUpTips&&null!==e.numStartUpTips&&(t.numStartUpTips=0|e.numStartUpTips),void 0!==e.startUpTipsUrl&&null!==e.startUpTipsUrl){if("object"!=typeof e.startUpTipsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.startUpTipsUrl: object expected");t.startUpTipsUrl=a[12].fromObject(e.startUpTipsUrl)}if(void 0!==e.numProStartUpTips&&null!==e.numProStartUpTips&&(t.numProStartUpTips=0|e.numProStartUpTips),void 0!==e.proStartUpTipsUrl&&null!==e.proStartUpTipsUrl){if("object"!=typeof e.proStartUpTipsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proStartUpTipsUrl: object expected");t.proStartUpTipsUrl=a[14].fromObject(e.proStartUpTipsUrl)}if(void 0!==e.startupTipsIntlUrl&&null!==e.startupTipsIntlUrl){if("object"!=typeof e.startupTipsIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.startupTipsIntlUrl: object expected");t.startupTipsIntlUrl=a[15].fromObject(e.startupTipsIntlUrl)}if(void 0!==e.userGuideIntlUrl&&null!==e.userGuideIntlUrl){if("object"!=typeof e.userGuideIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.userGuideIntlUrl: object expected");t.userGuideIntlUrl=a[16].fromObject(e.userGuideIntlUrl)}if(void 0!==e.supportCenterIntlUrl&&null!==e.supportCenterIntlUrl){if("object"!=typeof e.supportCenterIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportCenterIntlUrl: object expected");t.supportCenterIntlUrl=a[17].fromObject(e.supportCenterIntlUrl)}if(void 0!==e.businessListingIntlUrl&&null!==e.businessListingIntlUrl){if("object"!=typeof e.businessListingIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.businessListingIntlUrl: object expected");t.businessListingIntlUrl=a[18].fromObject(e.businessListingIntlUrl)}if(void 0!==e.supportAnswerIntlUrl&&null!==e.supportAnswerIntlUrl){if("object"!=typeof e.supportAnswerIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportAnswerIntlUrl: object expected");t.supportAnswerIntlUrl=a[19].fromObject(e.supportAnswerIntlUrl)}if(void 0!==e.supportTopicIntlUrl&&null!==e.supportTopicIntlUrl){if("object"!=typeof e.supportTopicIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportTopicIntlUrl: object expected");t.supportTopicIntlUrl=a[20].fromObject(e.supportTopicIntlUrl)}if(void 0!==e.supportRequestIntlUrl&&null!==e.supportRequestIntlUrl){if("object"!=typeof e.supportRequestIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportRequestIntlUrl: object expected");t.supportRequestIntlUrl=a[21].fromObject(e.supportRequestIntlUrl)}if(void 0!==e.earthIntlUrl&&null!==e.earthIntlUrl){if("object"!=typeof e.earthIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.earthIntlUrl: object expected");t.earthIntlUrl=a[22].fromObject(e.earthIntlUrl)}if(void 0!==e.addContentUrl&&null!==e.addContentUrl){if("object"!=typeof e.addContentUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.addContentUrl: object expected");t.addContentUrl=a[23].fromObject(e.addContentUrl)}if(void 0!==e.sketchupNotInstalledUrl&&null!==e.sketchupNotInstalledUrl){if("object"!=typeof e.sketchupNotInstalledUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.sketchupNotInstalledUrl: object expected");t.sketchupNotInstalledUrl=a[24].fromObject(e.sketchupNotInstalledUrl)}if(void 0!==e.sketchupErrorUrl&&null!==e.sketchupErrorUrl){if("object"!=typeof e.sketchupErrorUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.sketchupErrorUrl: object expected");t.sketchupErrorUrl=a[25].fromObject(e.sketchupErrorUrl)}if(void 0!==e.freeLicenseUrl&&null!==e.freeLicenseUrl){if("object"!=typeof e.freeLicenseUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.freeLicenseUrl: object expected");t.freeLicenseUrl=a[26].fromObject(e.freeLicenseUrl)}if(void 0!==e.proLicenseUrl&&null!==e.proLicenseUrl){if("object"!=typeof e.proLicenseUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proLicenseUrl: object expected");t.proLicenseUrl=a[27].fromObject(e.proLicenseUrl)}if(void 0!==e.tutorialUrl&&null!==e.tutorialUrl){if("object"!=typeof e.tutorialUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.tutorialUrl: object expected");t.tutorialUrl=a[28].fromObject(e.tutorialUrl)}if(void 0!==e.keyboardShortcutsUrl&&null!==e.keyboardShortcutsUrl){if("object"!=typeof e.keyboardShortcutsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.keyboardShortcutsUrl: object expected");t.keyboardShortcutsUrl=a[29].fromObject(e.keyboardShortcutsUrl)}if(void 0!==e.releaseNotesUrl&&null!==e.releaseNotesUrl){if("object"!=typeof e.releaseNotesUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.releaseNotesUrl: object expected");t.releaseNotesUrl=a[30].fromObject(e.releaseNotesUrl)}if(void 0!==e.hideUserData&&null!==e.hideUserData&&(t.hideUserData=Boolean(e.hideUserData)),void 0!==e.useGeLogo&&null!==e.useGeLogo&&(t.useGeLogo=Boolean(e.useGeLogo)),void 0!==e.dioramaDescriptionUrlBase&&null!==e.dioramaDescriptionUrlBase){if("object"!=typeof e.dioramaDescriptionUrlBase)throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaDescriptionUrlBase: object expected");t.dioramaDescriptionUrlBase=a[33].fromObject(e.dioramaDescriptionUrlBase)}if(void 0!==e.dioramaDefaultColor&&null!==e.dioramaDefaultColor&&(t.dioramaDefaultColor=e.dioramaDefaultColor>>>0),void 0!==e.dioramaBlacklistUrl&&null!==e.dioramaBlacklistUrl){if("object"!=typeof e.dioramaBlacklistUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaBlacklistUrl: object expected");t.dioramaBlacklistUrl=a[35].fromObject(e.dioramaBlacklistUrl)}if(void 0!==e.clientOptions&&null!==e.clientOptions){if("object"!=typeof e.clientOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.clientOptions: object expected");t.clientOptions=a[36].fromObject(e.clientOptions)}if(void 0!==e.fetchingOptions&&null!==e.fetchingOptions){if("object"!=typeof e.fetchingOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.fetchingOptions: object expected");t.fetchingOptions=a[37].fromObject(e.fetchingOptions)}if(void 0!==e.timeMachineOptions&&null!==e.timeMachineOptions){if("object"!=typeof e.timeMachineOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.timeMachineOptions: object expected");t.timeMachineOptions=a[38].fromObject(e.timeMachineOptions)}if(void 0!==e.csiOptions&&null!==e.csiOptions){if("object"!=typeof e.csiOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.csiOptions: object expected");t.csiOptions=a[39].fromObject(e.csiOptions)}if(e.searchTab){if(!Array.isArray(e.searchTab))throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: array expected");t.searchTab=[];for(var r=0;r<e.searchTab.length;++r){if("object"!=typeof e.searchTab[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: object expected");t.searchTab[r]=a[40].fromObject(e.searchTab[r])}}if(e.cobrandInfo){if(!Array.isArray(e.cobrandInfo))throw TypeError(".keyhole.dbroot.EndSnippetProto.cobrandInfo: array expected");t.cobrandInfo=[];for(var r=0;r<e.cobrandInfo.length;++r){if("object"!=typeof e.cobrandInfo[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.cobrandInfo: object expected");t.cobrandInfo[r]=a[41].fromObject(e.cobrandInfo[r])}}if(e.validDatabase){if(!Array.isArray(e.validDatabase))throw TypeError(".keyhole.dbroot.EndSnippetProto.validDatabase: array expected");t.validDatabase=[];for(var r=0;r<e.validDatabase.length;++r){if("object"!=typeof e.validDatabase[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.validDatabase: object expected");t.validDatabase[r]=a[42].fromObject(e.validDatabase[r])}}if(e.configScript){if(!Array.isArray(e.configScript))throw TypeError(".keyhole.dbroot.EndSnippetProto.configScript: array expected");t.configScript=[];for(var r=0;r<e.configScript.length;++r){if("object"!=typeof e.configScript[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.configScript: object expected");t.configScript[r]=a[43].fromObject(e.configScript[r])}}if(void 0!==e.deauthServerUrl&&null!==e.deauthServerUrl){if("object"!=typeof e.deauthServerUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.deauthServerUrl: object expected");t.deauthServerUrl=a[44].fromObject(e.deauthServerUrl)}if(void 0!==e.swoopParameters&&null!==e.swoopParameters){if("object"!=typeof e.swoopParameters)throw TypeError(".keyhole.dbroot.EndSnippetProto.swoopParameters: object expected");t.swoopParameters=a[45].fromObject(e.swoopParameters)}if(void 0!==e.bbsServerInfo&&null!==e.bbsServerInfo){if("object"!=typeof e.bbsServerInfo)throw TypeError(".keyhole.dbroot.EndSnippetProto.bbsServerInfo: object expected");t.bbsServerInfo=a[46].fromObject(e.bbsServerInfo)}if(void 0!==e.dataErrorServerInfo&&null!==e.dataErrorServerInfo){if("object"!=typeof e.dataErrorServerInfo)throw TypeError(".keyhole.dbroot.EndSnippetProto.dataErrorServerInfo: object expected");t.dataErrorServerInfo=a[47].fromObject(e.dataErrorServerInfo)}if(e.planetaryDatabase){if(!Array.isArray(e.planetaryDatabase))throw TypeError(".keyhole.dbroot.EndSnippetProto.planetaryDatabase: array expected");t.planetaryDatabase=[];for(var r=0;r<e.planetaryDatabase.length;++r){if("object"!=typeof e.planetaryDatabase[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.planetaryDatabase: object expected");t.planetaryDatabase[r]=a[48].fromObject(e.planetaryDatabase[r])}}if(void 0!==e.logServer&&null!==e.logServer){if("object"!=typeof e.logServer)throw TypeError(".keyhole.dbroot.EndSnippetProto.logServer: object expected");t.logServer=a[49].fromObject(e.logServer)}if(void 0!==e.autopiaOptions&&null!==e.autopiaOptions){if("object"!=typeof e.autopiaOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.autopiaOptions: object expected");t.autopiaOptions=a[50].fromObject(e.autopiaOptions)}if(void 0!==e.searchConfig&&null!==e.searchConfig){if("object"!=typeof e.searchConfig)throw TypeError(".keyhole.dbroot.EndSnippetProto.searchConfig: object expected");t.searchConfig=a[51].fromObject(e.searchConfig)}if(void 0!==e.searchInfo&&null!==e.searchInfo){if("object"!=typeof e.searchInfo)throw TypeError(".keyhole.dbroot.EndSnippetProto.searchInfo: object expected");t.searchInfo=a[52].fromObject(e.searchInfo)}if(void 0!==e.elevationServiceBaseUrl&&null!==e.elevationServiceBaseUrl&&(t.elevationServiceBaseUrl=String(e.elevationServiceBaseUrl)),void 0!==e.elevationProfileQueryDelay&&null!==e.elevationProfileQueryDelay&&(t.elevationProfileQueryDelay=0|e.elevationProfileQueryDelay),void 0!==e.proUpgradeUrl&&null!==e.proUpgradeUrl){if("object"!=typeof e.proUpgradeUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proUpgradeUrl: object expected");t.proUpgradeUrl=a[55].fromObject(e.proUpgradeUrl)}if(void 0!==e.earthCommunityUrl&&null!==e.earthCommunityUrl){if("object"!=typeof e.earthCommunityUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.earthCommunityUrl: object expected");t.earthCommunityUrl=a[56].fromObject(e.earthCommunityUrl)}if(void 0!==e.googleMapsUrl&&null!==e.googleMapsUrl){if("object"!=typeof e.googleMapsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.googleMapsUrl: object expected");t.googleMapsUrl=a[57].fromObject(e.googleMapsUrl)}if(void 0!==e.sharingUrl&&null!==e.sharingUrl){if("object"!=typeof e.sharingUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.sharingUrl: object expected");t.sharingUrl=a[58].fromObject(e.sharingUrl)}if(void 0!==e.privacyPolicyUrl&&null!==e.privacyPolicyUrl){if("object"!=typeof e.privacyPolicyUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.privacyPolicyUrl: object expected");t.privacyPolicyUrl=a[59].fromObject(e.privacyPolicyUrl)}if(void 0!==e.doGplusUserCheck&&null!==e.doGplusUserCheck&&(t.doGplusUserCheck=Boolean(e.doGplusUserCheck)),void 0!==e.rocktreeDataProto&&null!==e.rocktreeDataProto){if("object"!=typeof e.rocktreeDataProto)throw TypeError(".keyhole.dbroot.EndSnippetProto.rocktreeDataProto: object expected");t.rocktreeDataProto=a[61].fromObject(e.rocktreeDataProto)}if(e.filmstripConfig){if(!Array.isArray(e.filmstripConfig))throw TypeError(".keyhole.dbroot.EndSnippetProto.filmstripConfig: array expected");t.filmstripConfig=[];for(var r=0;r<e.filmstripConfig.length;++r){if("object"!=typeof e.filmstripConfig[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.filmstripConfig: object expected");t.filmstripConfig[r]=a[62].fromObject(e.filmstripConfig[r])}}if(void 0!==e.showSigninButton&&null!==e.showSigninButton&&(t.showSigninButton=Boolean(e.showSigninButton)),void 0!==e.proMeasureUpsellUrl&&null!==e.proMeasureUpsellUrl){if("object"!=typeof e.proMeasureUpsellUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proMeasureUpsellUrl: object expected");t.proMeasureUpsellUrl=a[64].fromObject(e.proMeasureUpsellUrl)}if(void 0!==e.proPrintUpsellUrl&&null!==e.proPrintUpsellUrl){if("object"!=typeof e.proPrintUpsellUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proPrintUpsellUrl: object expected");t.proPrintUpsellUrl=a[65].fromObject(e.proPrintUpsellUrl)}if(void 0!==e.starDataProto&&null!==e.starDataProto){if("object"!=typeof e.starDataProto)throw TypeError(".keyhole.dbroot.EndSnippetProto.starDataProto: object expected");t.starDataProto=a[66].fromObject(e.starDataProto)}if(void 0!==e.feedbackUrl&&null!==e.feedbackUrl){if("object"!=typeof e.feedbackUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.feedbackUrl: object expected");t.feedbackUrl=a[67].fromObject(e.feedbackUrl)}if(void 0!==e.oauth2LoginUrl&&null!==e.oauth2LoginUrl){if("object"!=typeof e.oauth2LoginUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.oauth2LoginUrl: object expected");t.oauth2LoginUrl=a[68].fromObject(e.oauth2LoginUrl)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.mfeDomains=[],r.searchTab=[],r.cobrandInfo=[],r.validDatabase=[],r.configScript=[],r.planetaryDatabase=[],r.filmstripConfig=[]),t.defaults&&(r.model=null,r.authServerUrl=null,r.disableAuthentication=!1,r.mfeLangParam="hl=$5Bhl5D",r.adsUrlPatterns="",r.reverseGeocoderUrl=null,r.reverseGeocoderProtocolVersion=3,r.skyDatabaseIsAvailable=!0,r.skyDatabaseUrl=null,r.defaultWebPageIntlUrl=null,r.numStartUpTips=17,r.startUpTipsUrl=null,r.numProStartUpTips=0,r.proStartUpTipsUrl=null,r.startupTipsIntlUrl=null,r.userGuideIntlUrl=null,r.supportCenterIntlUrl=null,r.businessListingIntlUrl=null,r.supportAnswerIntlUrl=null,r.supportTopicIntlUrl=null,r.supportRequestIntlUrl=null,r.earthIntlUrl=null,r.addContentUrl=null,r.sketchupNotInstalledUrl=null,r.sketchupErrorUrl=null,r.freeLicenseUrl=null,r.proLicenseUrl=null,r.tutorialUrl=null,r.keyboardShortcutsUrl=null,r.releaseNotesUrl=null,r.hideUserData=!1,r.useGeLogo=!0,r.dioramaDescriptionUrlBase=null,r.dioramaDefaultColor=4291281607,r.dioramaBlacklistUrl=null,r.clientOptions=null,r.fetchingOptions=null,r.timeMachineOptions=null,r.csiOptions=null,r.deauthServerUrl=null,r.swoopParameters=null,r.bbsServerInfo=null,r.dataErrorServerInfo=null,r.logServer=null,r.autopiaOptions=null,r.searchConfig=null,r.searchInfo=null,r.elevationServiceBaseUrl="http://maps.google.com/maps/api/elevation/",r.elevationProfileQueryDelay=500,r.proUpgradeUrl=null,r.earthCommunityUrl=null,r.googleMapsUrl=null,r.sharingUrl=null,r.privacyPolicyUrl=null,r.doGplusUserCheck=!1,r.rocktreeDataProto=null,r.showSigninButton=!1,r.proMeasureUpsellUrl=null,r.proPrintUpsellUrl=null,r.starDataProto=null,r.feedbackUrl=null,r.oauth2LoginUrl=null),void 0!==e.model&&null!==e.model&&e.hasOwnProperty("model")&&(r.model=a[0].toObject(e.model,t)),void 0!==e.authServerUrl&&null!==e.authServerUrl&&e.hasOwnProperty("authServerUrl")&&(r.authServerUrl=a[1].toObject(e.authServerUrl,t)),void 0!==e.disableAuthentication&&null!==e.disableAuthentication&&e.hasOwnProperty("disableAuthentication")&&(r.disableAuthentication=e.disableAuthentication),void 0!==e.mfeDomains&&null!==e.mfeDomains&&e.hasOwnProperty("mfeDomains")){r.mfeDomains=[];for(var i=0;i<e.mfeDomains.length;++i)r.mfeDomains[i]=a[3].toObject(e.mfeDomains[i],t)}if(void 0!==e.mfeLangParam&&null!==e.mfeLangParam&&e.hasOwnProperty("mfeLangParam")&&(r.mfeLangParam=e.mfeLangParam),void 0!==e.adsUrlPatterns&&null!==e.adsUrlPatterns&&e.hasOwnProperty("adsUrlPatterns")&&(r.adsUrlPatterns=e.adsUrlPatterns),void 0!==e.reverseGeocoderUrl&&null!==e.reverseGeocoderUrl&&e.hasOwnProperty("reverseGeocoderUrl")&&(r.reverseGeocoderUrl=a[6].toObject(e.reverseGeocoderUrl,t)),void 0!==e.reverseGeocoderProtocolVersion&&null!==e.reverseGeocoderProtocolVersion&&e.hasOwnProperty("reverseGeocoderProtocolVersion")&&(r.reverseGeocoderProtocolVersion=e.reverseGeocoderProtocolVersion),void 0!==e.skyDatabaseIsAvailable&&null!==e.skyDatabaseIsAvailable&&e.hasOwnProperty("skyDatabaseIsAvailable")&&(r.skyDatabaseIsAvailable=e.skyDatabaseIsAvailable),void 0!==e.skyDatabaseUrl&&null!==e.skyDatabaseUrl&&e.hasOwnProperty("skyDatabaseUrl")&&(r.skyDatabaseUrl=a[9].toObject(e.skyDatabaseUrl,t)),void 0!==e.defaultWebPageIntlUrl&&null!==e.defaultWebPageIntlUrl&&e.hasOwnProperty("defaultWebPageIntlUrl")&&(r.defaultWebPageIntlUrl=a[10].toObject(e.defaultWebPageIntlUrl,t)),void 0!==e.numStartUpTips&&null!==e.numStartUpTips&&e.hasOwnProperty("numStartUpTips")&&(r.numStartUpTips=e.numStartUpTips),void 0!==e.startUpTipsUrl&&null!==e.startUpTipsUrl&&e.hasOwnProperty("startUpTipsUrl")&&(r.startUpTipsUrl=a[12].toObject(e.startUpTipsUrl,t)),void 0!==e.numProStartUpTips&&null!==e.numProStartUpTips&&e.hasOwnProperty("numProStartUpTips")&&(r.numProStartUpTips=e.numProStartUpTips),void 0!==e.proStartUpTipsUrl&&null!==e.proStartUpTipsUrl&&e.hasOwnProperty("proStartUpTipsUrl")&&(r.proStartUpTipsUrl=a[14].toObject(e.proStartUpTipsUrl,t)),void 0!==e.startupTipsIntlUrl&&null!==e.startupTipsIntlUrl&&e.hasOwnProperty("startupTipsIntlUrl")&&(r.startupTipsIntlUrl=a[15].toObject(e.startupTipsIntlUrl,t)),void 0!==e.userGuideIntlUrl&&null!==e.userGuideIntlUrl&&e.hasOwnProperty("userGuideIntlUrl")&&(r.userGuideIntlUrl=a[16].toObject(e.userGuideIntlUrl,t)),void 0!==e.supportCenterIntlUrl&&null!==e.supportCenterIntlUrl&&e.hasOwnProperty("supportCenterIntlUrl")&&(r.supportCenterIntlUrl=a[17].toObject(e.supportCenterIntlUrl,t)),void 0!==e.businessListingIntlUrl&&null!==e.businessListingIntlUrl&&e.hasOwnProperty("businessListingIntlUrl")&&(r.businessListingIntlUrl=a[18].toObject(e.businessListingIntlUrl,t)),void 0!==e.supportAnswerIntlUrl&&null!==e.supportAnswerIntlUrl&&e.hasOwnProperty("supportAnswerIntlUrl")&&(r.supportAnswerIntlUrl=a[19].toObject(e.supportAnswerIntlUrl,t)),void 0!==e.supportTopicIntlUrl&&null!==e.supportTopicIntlUrl&&e.hasOwnProperty("supportTopicIntlUrl")&&(r.supportTopicIntlUrl=a[20].toObject(e.supportTopicIntlUrl,t)),void 0!==e.supportRequestIntlUrl&&null!==e.supportRequestIntlUrl&&e.hasOwnProperty("supportRequestIntlUrl")&&(r.supportRequestIntlUrl=a[21].toObject(e.supportRequestIntlUrl,t)),void 0!==e.earthIntlUrl&&null!==e.earthIntlUrl&&e.hasOwnProperty("earthIntlUrl")&&(r.earthIntlUrl=a[22].toObject(e.earthIntlUrl,t)),void 0!==e.addContentUrl&&null!==e.addContentUrl&&e.hasOwnProperty("addContentUrl")&&(r.addContentUrl=a[23].toObject(e.addContentUrl,t)),void 0!==e.sketchupNotInstalledUrl&&null!==e.sketchupNotInstalledUrl&&e.hasOwnProperty("sketchupNotInstalledUrl")&&(r.sketchupNotInstalledUrl=a[24].toObject(e.sketchupNotInstalledUrl,t)),void 0!==e.sketchupErrorUrl&&null!==e.sketchupErrorUrl&&e.hasOwnProperty("sketchupErrorUrl")&&(r.sketchupErrorUrl=a[25].toObject(e.sketchupErrorUrl,t)),void 0!==e.freeLicenseUrl&&null!==e.freeLicenseUrl&&e.hasOwnProperty("freeLicenseUrl")&&(r.freeLicenseUrl=a[26].toObject(e.freeLicenseUrl,t)),void 0!==e.proLicenseUrl&&null!==e.proLicenseUrl&&e.hasOwnProperty("proLicenseUrl")&&(r.proLicenseUrl=a[27].toObject(e.proLicenseUrl,t)),void 0!==e.tutorialUrl&&null!==e.tutorialUrl&&e.hasOwnProperty("tutorialUrl")&&(r.tutorialUrl=a[28].toObject(e.tutorialUrl,t)),void 0!==e.keyboardShortcutsUrl&&null!==e.keyboardShortcutsUrl&&e.hasOwnProperty("keyboardShortcutsUrl")&&(r.keyboardShortcutsUrl=a[29].toObject(e.keyboardShortcutsUrl,t)),void 0!==e.releaseNotesUrl&&null!==e.releaseNotesUrl&&e.hasOwnProperty("releaseNotesUrl")&&(r.releaseNotesUrl=a[30].toObject(e.releaseNotesUrl,t)),void 0!==e.hideUserData&&null!==e.hideUserData&&e.hasOwnProperty("hideUserData")&&(r.hideUserData=e.hideUserData),void 0!==e.useGeLogo&&null!==e.useGeLogo&&e.hasOwnProperty("useGeLogo")&&(r.useGeLogo=e.useGeLogo),void 0!==e.dioramaDescriptionUrlBase&&null!==e.dioramaDescriptionUrlBase&&e.hasOwnProperty("dioramaDescriptionUrlBase")&&(r.dioramaDescriptionUrlBase=a[33].toObject(e.dioramaDescriptionUrlBase,t)),void 0!==e.dioramaDefaultColor&&null!==e.dioramaDefaultColor&&e.hasOwnProperty("dioramaDefaultColor")&&(r.dioramaDefaultColor=e.dioramaDefaultColor),void 0!==e.dioramaBlacklistUrl&&null!==e.dioramaBlacklistUrl&&e.hasOwnProperty("dioramaBlacklistUrl")&&(r.dioramaBlacklistUrl=a[35].toObject(e.dioramaBlacklistUrl,t)),void 0!==e.clientOptions&&null!==e.clientOptions&&e.hasOwnProperty("clientOptions")&&(r.clientOptions=a[36].toObject(e.clientOptions,t)),void 0!==e.fetchingOptions&&null!==e.fetchingOptions&&e.hasOwnProperty("fetchingOptions")&&(r.fetchingOptions=a[37].toObject(e.fetchingOptions,t)),void 0!==e.timeMachineOptions&&null!==e.timeMachineOptions&&e.hasOwnProperty("timeMachineOptions")&&(r.timeMachineOptions=a[38].toObject(e.timeMachineOptions,t)),void 0!==e.csiOptions&&null!==e.csiOptions&&e.hasOwnProperty("csiOptions")&&(r.csiOptions=a[39].toObject(e.csiOptions,t)),void 0!==e.searchTab&&null!==e.searchTab&&e.hasOwnProperty("searchTab")){r.searchTab=[];for(var i=0;i<e.searchTab.length;++i)r.searchTab[i]=a[40].toObject(e.searchTab[i],t)}if(void 0!==e.cobrandInfo&&null!==e.cobrandInfo&&e.hasOwnProperty("cobrandInfo")){r.cobrandInfo=[];for(var i=0;i<e.cobrandInfo.length;++i)r.cobrandInfo[i]=a[41].toObject(e.cobrandInfo[i],t)}if(void 0!==e.validDatabase&&null!==e.validDatabase&&e.hasOwnProperty("validDatabase")){r.validDatabase=[];for(var i=0;i<e.validDatabase.length;++i)r.validDatabase[i]=a[42].toObject(e.validDatabase[i],t)}if(void 0!==e.configScript&&null!==e.configScript&&e.hasOwnProperty("configScript")){r.configScript=[];for(var i=0;i<e.configScript.length;++i)r.configScript[i]=a[43].toObject(e.configScript[i],t)}if(void 0!==e.deauthServerUrl&&null!==e.deauthServerUrl&&e.hasOwnProperty("deauthServerUrl")&&(r.deauthServerUrl=a[44].toObject(e.deauthServerUrl,t)),void 0!==e.swoopParameters&&null!==e.swoopParameters&&e.hasOwnProperty("swoopParameters")&&(r.swoopParameters=a[45].toObject(e.swoopParameters,t)),void 0!==e.bbsServerInfo&&null!==e.bbsServerInfo&&e.hasOwnProperty("bbsServerInfo")&&(r.bbsServerInfo=a[46].toObject(e.bbsServerInfo,t)),void 0!==e.dataErrorServerInfo&&null!==e.dataErrorServerInfo&&e.hasOwnProperty("dataErrorServerInfo")&&(r.dataErrorServerInfo=a[47].toObject(e.dataErrorServerInfo,t)),void 0!==e.planetaryDatabase&&null!==e.planetaryDatabase&&e.hasOwnProperty("planetaryDatabase")){r.planetaryDatabase=[];for(var i=0;i<e.planetaryDatabase.length;++i)r.planetaryDatabase[i]=a[48].toObject(e.planetaryDatabase[i],t)}if(void 0!==e.logServer&&null!==e.logServer&&e.hasOwnProperty("logServer")&&(r.logServer=a[49].toObject(e.logServer,t)),void 0!==e.autopiaOptions&&null!==e.autopiaOptions&&e.hasOwnProperty("autopiaOptions")&&(r.autopiaOptions=a[50].toObject(e.autopiaOptions,t)),void 0!==e.searchConfig&&null!==e.searchConfig&&e.hasOwnProperty("searchConfig")&&(r.searchConfig=a[51].toObject(e.searchConfig,t)),void 0!==e.searchInfo&&null!==e.searchInfo&&e.hasOwnProperty("searchInfo")&&(r.searchInfo=a[52].toObject(e.searchInfo,t)),void 0!==e.elevationServiceBaseUrl&&null!==e.elevationServiceBaseUrl&&e.hasOwnProperty("elevationServiceBaseUrl")&&(r.elevationServiceBaseUrl=e.elevationServiceBaseUrl),void 0!==e.elevationProfileQueryDelay&&null!==e.elevationProfileQueryDelay&&e.hasOwnProperty("elevationProfileQueryDelay")&&(r.elevationProfileQueryDelay=e.elevationProfileQueryDelay),
void 0!==e.proUpgradeUrl&&null!==e.proUpgradeUrl&&e.hasOwnProperty("proUpgradeUrl")&&(r.proUpgradeUrl=a[55].toObject(e.proUpgradeUrl,t)),void 0!==e.earthCommunityUrl&&null!==e.earthCommunityUrl&&e.hasOwnProperty("earthCommunityUrl")&&(r.earthCommunityUrl=a[56].toObject(e.earthCommunityUrl,t)),void 0!==e.googleMapsUrl&&null!==e.googleMapsUrl&&e.hasOwnProperty("googleMapsUrl")&&(r.googleMapsUrl=a[57].toObject(e.googleMapsUrl,t)),void 0!==e.sharingUrl&&null!==e.sharingUrl&&e.hasOwnProperty("sharingUrl")&&(r.sharingUrl=a[58].toObject(e.sharingUrl,t)),void 0!==e.privacyPolicyUrl&&null!==e.privacyPolicyUrl&&e.hasOwnProperty("privacyPolicyUrl")&&(r.privacyPolicyUrl=a[59].toObject(e.privacyPolicyUrl,t)),void 0!==e.doGplusUserCheck&&null!==e.doGplusUserCheck&&e.hasOwnProperty("doGplusUserCheck")&&(r.doGplusUserCheck=e.doGplusUserCheck),void 0!==e.rocktreeDataProto&&null!==e.rocktreeDataProto&&e.hasOwnProperty("rocktreeDataProto")&&(r.rocktreeDataProto=a[61].toObject(e.rocktreeDataProto,t)),void 0!==e.filmstripConfig&&null!==e.filmstripConfig&&e.hasOwnProperty("filmstripConfig")){r.filmstripConfig=[];for(var i=0;i<e.filmstripConfig.length;++i)r.filmstripConfig[i]=a[62].toObject(e.filmstripConfig[i],t)}return void 0!==e.showSigninButton&&null!==e.showSigninButton&&e.hasOwnProperty("showSigninButton")&&(r.showSigninButton=e.showSigninButton),void 0!==e.proMeasureUpsellUrl&&null!==e.proMeasureUpsellUrl&&e.hasOwnProperty("proMeasureUpsellUrl")&&(r.proMeasureUpsellUrl=a[64].toObject(e.proMeasureUpsellUrl,t)),void 0!==e.proPrintUpsellUrl&&null!==e.proPrintUpsellUrl&&e.hasOwnProperty("proPrintUpsellUrl")&&(r.proPrintUpsellUrl=a[65].toObject(e.proPrintUpsellUrl,t)),void 0!==e.starDataProto&&null!==e.starDataProto&&e.hasOwnProperty("starDataProto")&&(r.starDataProto=a[66].toObject(e.starDataProto,t)),void 0!==e.feedbackUrl&&null!==e.feedbackUrl&&e.hasOwnProperty("feedbackUrl")&&(r.feedbackUrl=a[67].toObject(e.feedbackUrl,t)),void 0!==e.oauth2LoginUrl&&null!==e.oauth2LoginUrl&&e.hasOwnProperty("oauth2LoginUrl")&&(r.oauth2LoginUrl=a[68].toObject(e.oauth2LoginUrl,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.SearchConfigProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.searchServer=r.emptyArray,o.prototype.oneboxService=r.emptyArray,o.prototype.kmlSearchUrl=null,o.prototype.kmlRenderUrl=null,o.prototype.searchHistoryUrl=null,o.prototype.errorPageUrl=null;var a={0:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer",1:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto",2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto",5:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.searchServer&&o.searchServer.length||(o.searchServer=[]),o.searchServer.push(a[0].decode(e,e.uint32()));break;case 2:o.oneboxService&&o.oneboxService.length||(o.oneboxService=[]),o.oneboxService.push(a[1].decode(e,e.uint32()));break;case 3:o.kmlSearchUrl=a[2].decode(e,e.uint32());break;case 4:o.kmlRenderUrl=a[3].decode(e,e.uint32());break;case 6:o.searchHistoryUrl=a[4].decode(e,e.uint32());break;case 5:o.errorPageUrl=a[5].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.searchServer){if(!Array.isArray(e.searchServer))return"searchServer: array expected";for(var t=0;t<e.searchServer.length;++t){var r=a[0].verify(e.searchServer[t]);if(r)return"searchServer."+r}}if(void 0!==e.oneboxService){if(!Array.isArray(e.oneboxService))return"oneboxService: array expected";for(var t=0;t<e.oneboxService.length;++t){var r=a[1].verify(e.oneboxService[t]);if(r)return"oneboxService."+r}}if(void 0!==e.kmlSearchUrl&&null!==e.kmlSearchUrl){var r=a[2].verify(e.kmlSearchUrl);if(r)return"kmlSearchUrl."+r}if(void 0!==e.kmlRenderUrl&&null!==e.kmlRenderUrl){var r=a[3].verify(e.kmlRenderUrl);if(r)return"kmlRenderUrl."+r}if(void 0!==e.searchHistoryUrl&&null!==e.searchHistoryUrl){var r=a[4].verify(e.searchHistoryUrl);if(r)return"searchHistoryUrl."+r}if(void 0!==e.errorPageUrl&&null!==e.errorPageUrl){var r=a[5].verify(e.errorPageUrl);if(r)return"errorPageUrl."+r}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto;if(e.searchServer){if(!Array.isArray(e.searchServer))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: array expected");t.searchServer=[];for(var r=0;r<e.searchServer.length;++r){if("object"!=typeof e.searchServer[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: object expected");t.searchServer[r]=a[0].fromObject(e.searchServer[r])}}if(e.oneboxService){if(!Array.isArray(e.oneboxService))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: array expected");t.oneboxService=[];for(var r=0;r<e.oneboxService.length;++r){if("object"!=typeof e.oneboxService[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: object expected");t.oneboxService[r]=a[1].fromObject(e.oneboxService[r])}}if(void 0!==e.kmlSearchUrl&&null!==e.kmlSearchUrl){if("object"!=typeof e.kmlSearchUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlSearchUrl: object expected");t.kmlSearchUrl=a[2].fromObject(e.kmlSearchUrl)}if(void 0!==e.kmlRenderUrl&&null!==e.kmlRenderUrl){if("object"!=typeof e.kmlRenderUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlRenderUrl: object expected");t.kmlRenderUrl=a[3].fromObject(e.kmlRenderUrl)}if(void 0!==e.searchHistoryUrl&&null!==e.searchHistoryUrl){if("object"!=typeof e.searchHistoryUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchHistoryUrl: object expected");t.searchHistoryUrl=a[4].fromObject(e.searchHistoryUrl)}if(void 0!==e.errorPageUrl&&null!==e.errorPageUrl){if("object"!=typeof e.errorPageUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.errorPageUrl: object expected");t.errorPageUrl=a[5].fromObject(e.errorPageUrl)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.searchServer=[],r.oneboxService=[]),t.defaults&&(r.kmlSearchUrl=null,r.kmlRenderUrl=null,r.searchHistoryUrl=null,r.errorPageUrl=null),void 0!==e.searchServer&&null!==e.searchServer&&e.hasOwnProperty("searchServer")){r.searchServer=[];for(var i=0;i<e.searchServer.length;++i)r.searchServer[i]=a[0].toObject(e.searchServer[i],t)}if(void 0!==e.oneboxService&&null!==e.oneboxService&&e.hasOwnProperty("oneboxService")){r.oneboxService=[];for(var i=0;i<e.oneboxService.length;++i)r.oneboxService[i]=a[1].toObject(e.oneboxService[i],t)}return void 0!==e.kmlSearchUrl&&null!==e.kmlSearchUrl&&e.hasOwnProperty("kmlSearchUrl")&&(r.kmlSearchUrl=a[2].toObject(e.kmlSearchUrl,t)),void 0!==e.kmlRenderUrl&&null!==e.kmlRenderUrl&&e.hasOwnProperty("kmlRenderUrl")&&(r.kmlRenderUrl=a[3].toObject(e.kmlRenderUrl,t)),void 0!==e.searchHistoryUrl&&null!==e.searchHistoryUrl&&e.hasOwnProperty("searchHistoryUrl")&&(r.searchHistoryUrl=a[4].toObject(e.searchHistoryUrl,t)),void 0!==e.errorPageUrl&&null!==e.errorPageUrl&&e.hasOwnProperty("errorPageUrl")&&(r.errorPageUrl=a[5].toObject(e.errorPageUrl,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.SearchServer=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.name=null,o.prototype.url=null,o.prototype.type=0,o.prototype.htmlTransformUrl=null,o.prototype.kmlTransformUrl=null,o.prototype.supplementalUi=null,o.prototype.suggestion=r.emptyArray,o.prototype.searchlet=r.emptyArray,o.prototype.requirements=null,o.prototype.suggestServer=null;var a={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.ResultType",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto",5:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi",6:"keyhole.dbroot.StringIdOrValueProto",7:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto",8:"keyhole.dbroot.RequirementProto",9:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.name=a[0].decode(e,e.uint32());break;case 2:o.url=a[1].decode(e,e.uint32());break;case 3:o.type=e.uint32();break;case 4:o.htmlTransformUrl=a[3].decode(e,e.uint32());break;case 5:o.kmlTransformUrl=a[4].decode(e,e.uint32());break;case 6:o.supplementalUi=a[5].decode(e,e.uint32());break;case 9:o.suggestion&&o.suggestion.length||(o.suggestion=[]),o.suggestion.push(a[6].decode(e,e.uint32()));break;case 7:o.searchlet&&o.searchlet.length||(o.searchlet=[]),o.searchlet.push(a[7].decode(e,e.uint32()));break;case 8:o.requirements=a[8].decode(e,e.uint32());break;case 10:o.suggestServer=a[9].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.name&&null!==e.name){var t=a[0].verify(e.name);if(t)return"name."+t}if(void 0!==e.url&&null!==e.url){var t=a[1].verify(e.url);if(t)return"url."+t}if(void 0!==e.type)switch(e.type){default:return"type: enum value expected";case 0:case 1:}if(void 0!==e.htmlTransformUrl&&null!==e.htmlTransformUrl){var t=a[3].verify(e.htmlTransformUrl);if(t)return"htmlTransformUrl."+t}if(void 0!==e.kmlTransformUrl&&null!==e.kmlTransformUrl){var t=a[4].verify(e.kmlTransformUrl);if(t)return"kmlTransformUrl."+t}if(void 0!==e.supplementalUi&&null!==e.supplementalUi){var t=a[5].verify(e.supplementalUi);if(t)return"supplementalUi."+t}if(void 0!==e.suggestion){if(!Array.isArray(e.suggestion))return"suggestion: array expected";for(var r=0;r<e.suggestion.length;++r){var t=a[6].verify(e.suggestion[r]);if(t)return"suggestion."+t}}if(void 0!==e.searchlet){if(!Array.isArray(e.searchlet))return"searchlet: array expected";for(var r=0;r<e.searchlet.length;++r){var t=a[7].verify(e.searchlet[r]);if(t)return"searchlet."+t}}if(void 0!==e.requirements&&null!==e.requirements){var t=a[8].verify(e.requirements);if(t)return"requirements."+t}if(void 0!==e.suggestServer&&null!==e.suggestServer){var t=a[9].verify(e.suggestServer);if(t)return"suggestServer."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer;if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.name: object expected");t.name=a[0].fromObject(e.name)}if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.url: object expected");t.url=a[1].fromObject(e.url)}switch(e.type){case"RESULT_TYPE_KML":case 0:t.type=0;break;case"RESULT_TYPE_XML":case 1:t.type=1}if(void 0!==e.htmlTransformUrl&&null!==e.htmlTransformUrl){if("object"!=typeof e.htmlTransformUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.htmlTransformUrl: object expected");t.htmlTransformUrl=a[3].fromObject(e.htmlTransformUrl)}if(void 0!==e.kmlTransformUrl&&null!==e.kmlTransformUrl){if("object"!=typeof e.kmlTransformUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.kmlTransformUrl: object expected");t.kmlTransformUrl=a[4].fromObject(e.kmlTransformUrl)}if(void 0!==e.supplementalUi&&null!==e.supplementalUi){if("object"!=typeof e.supplementalUi)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.supplementalUi: object expected");t.supplementalUi=a[5].fromObject(e.supplementalUi)}if(e.suggestion){if(!Array.isArray(e.suggestion))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: array expected");t.suggestion=[];for(var r=0;r<e.suggestion.length;++r){if("object"!=typeof e.suggestion[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: object expected");t.suggestion[r]=a[6].fromObject(e.suggestion[r])}}if(e.searchlet){if(!Array.isArray(e.searchlet))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: array expected");t.searchlet=[];for(var r=0;r<e.searchlet.length;++r){if("object"!=typeof e.searchlet[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: object expected");t.searchlet[r]=a[7].fromObject(e.searchlet[r])}}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.requirements: object expected");t.requirements=a[8].fromObject(e.requirements)}if(void 0!==e.suggestServer&&null!==e.suggestServer){if("object"!=typeof e.suggestServer)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestServer: object expected");t.suggestServer=a[9].fromObject(e.suggestServer)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.suggestion=[],r.searchlet=[]),t.defaults&&(r.name=null,r.url=null,r.type=t.enums===String?"RESULT_TYPE_KML":0,r.htmlTransformUrl=null,r.kmlTransformUrl=null,r.supplementalUi=null,r.requirements=null,r.suggestServer=null),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=a[0].toObject(e.name,t)),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[1].toObject(e.url,t)),void 0!==e.type&&null!==e.type&&e.hasOwnProperty("type")&&(r.type=t.enums===String?a[2][e.type]:e.type),void 0!==e.htmlTransformUrl&&null!==e.htmlTransformUrl&&e.hasOwnProperty("htmlTransformUrl")&&(r.htmlTransformUrl=a[3].toObject(e.htmlTransformUrl,t)),void 0!==e.kmlTransformUrl&&null!==e.kmlTransformUrl&&e.hasOwnProperty("kmlTransformUrl")&&(r.kmlTransformUrl=a[4].toObject(e.kmlTransformUrl,t)),void 0!==e.supplementalUi&&null!==e.supplementalUi&&e.hasOwnProperty("supplementalUi")&&(r.supplementalUi=a[5].toObject(e.supplementalUi,t)),void 0!==e.suggestion&&null!==e.suggestion&&e.hasOwnProperty("suggestion")){r.suggestion=[];for(var i=0;i<e.suggestion.length;++i)r.suggestion[i]=a[6].toObject(e.suggestion[i],t)}if(void 0!==e.searchlet&&null!==e.searchlet&&e.hasOwnProperty("searchlet")){r.searchlet=[];for(var i=0;i<e.searchlet.length;++i)r.searchlet[i]=a[7].toObject(e.searchlet[i],t)}return void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=a[8].toObject(e.requirements,t)),void 0!==e.suggestServer&&null!==e.suggestServer&&e.hasOwnProperty("suggestServer")&&(r.suggestServer=a[9].toObject(e.suggestServer,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.ResultType=function(){var e={},t=Object.create(e);return t.RESULT_TYPE_KML=0,t.RESULT_TYPE_XML=1,t}(),o.SupplementalUi=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.url=null,o.prototype.label=null,o.prototype.height=160;var a={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.url=a[0].decode(e,e.uint32());break;case 2:o.label=a[1].decode(e,e.uint32());break;case 3:o.height=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=a[0].verify(e.url);if(t)return"url."+t}if(void 0!==e.label&&null!==e.label){var t=a[1].verify(e.label);if(t)return"label."+t}return void 0===e.height||r.isInteger(e.height)?null:"height: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.url: object expected");t.url=a[0].fromObject(e.url)}if(void 0!==e.label&&null!==e.label){if("object"!=typeof e.label)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.label: object expected");t.label=a[1].fromObject(e.label)}return void 0!==e.height&&null!==e.height&&(t.height=0|e.height),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.label=null,r.height=160),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[0].toObject(e.url,t)),void 0!==e.label&&null!==e.label&&e.hasOwnProperty("label")&&(r.label=a[1].toObject(e.label,t)),void 0!==e.height&&null!==e.height&&e.hasOwnProperty("height")&&(r.height=e.height),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.SearchletProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null,r.prototype.name=null,r.prototype.requirements=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.RequirementProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;case 2:a.name=o[1].decode(e,e.uint32());break;case 3:a.requirements=o[2].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}if(void 0!==e.name&&null!==e.name){var t=o[1].verify(e.name);if(t)return"name."+t}if(void 0!==e.requirements&&null!==e.requirements){var t=o[2].verify(e.requirements);if(t)return"requirements."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.url: object expected");t.url=o[0].fromObject(e.url)}if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.name: object expected");t.name=o[1].fromObject(e.name)}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.requirements: object expected");t.requirements=o[2].fromObject(e.requirements)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.name=null,r.requirements=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[1].toObject(e.name,t)),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=o[2].toObject(e.requirements,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.OneboxServiceProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.serviceUrl=null,r.prototype.requirements=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.RequirementProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.serviceUrl=o[0].decode(e,e.uint32());break;case 2:a.requirements=o[1].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.serviceUrl&&null!==e.serviceUrl){var t=o[0].verify(e.serviceUrl);if(t)return"serviceUrl."+t}if(void 0!==e.requirements&&null!==e.requirements){var t=o[1].verify(e.requirements);if(t)return"requirements."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;if(void 0!==e.serviceUrl&&null!==e.serviceUrl){if("object"!=typeof e.serviceUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.serviceUrl: object expected");t.serviceUrl=o[0].fromObject(e.serviceUrl)}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.requirements: object expected");t.requirements=o[1].fromObject(e.requirements)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.serviceUrl=null,r.requirements=null),void 0!==e.serviceUrl&&null!==e.serviceUrl&&e.hasOwnProperty("serviceUrl")&&(r.serviceUrl=o[0].toObject(e.serviceUrl,t)),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=o[1].toObject(e.requirements,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.SearchInfoProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.defaultUrl="http://maps.google.com/maps",i.prototype.geocodeParam="q",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.defaultUrl=e.string();break;case 2:o.geocodeParam=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.defaultUrl||r.isString(e.defaultUrl)?void 0===e.geocodeParam||r.isString(e.geocodeParam)?null:"geocodeParam: string expected":"defaultUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchInfoProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;return void 0!==e.defaultUrl&&null!==e.defaultUrl&&(t.defaultUrl=String(e.defaultUrl)),void 0!==e.geocodeParam&&null!==e.geocodeParam&&(t.geocodeParam=String(e.geocodeParam)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.defaultUrl="http://maps.google.com/maps",r.geocodeParam="q"),void 0!==e.defaultUrl&&null!==e.defaultUrl&&e.hasOwnProperty("defaultUrl")&&(r.defaultUrl=e.defaultUrl),void 0!==e.geocodeParam&&null!==e.geocodeParam&&e.hasOwnProperty("geocodeParam")&&(r.geocodeParam=e.geocodeParam),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.RockTreeDataProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null;var o={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.RockTreeDataProto.url: object expected");t.url=o[0].fromObject(e.url)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.FilmstripConfigProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.requirements=null,o.prototype.alleycatUrlTemplate=null,o.prototype.fallbackAlleycatUrlTemplate=null,o.prototype.metadataUrlTemplate=null,o.prototype.thumbnailUrlTemplate=null,o.prototype.kmlUrlTemplate=null,o.prototype.featuredToursUrl=null,o.prototype.enableViewportFallback=!1,o.prototype.viewportFallbackDistance=0,o.prototype.imageryType=r.emptyArray;var a={0:"keyhole.dbroot.RequirementProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto",5:"keyhole.dbroot.StringIdOrValueProto",6:"keyhole.dbroot.StringIdOrValueProto",9:"keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.requirements=a[0].decode(e,e.uint32());break;case 2:o.alleycatUrlTemplate=a[1].decode(e,e.uint32());break;case 9:o.fallbackAlleycatUrlTemplate=a[2].decode(e,e.uint32());break;case 3:o.metadataUrlTemplate=a[3].decode(e,e.uint32());break;case 4:o.thumbnailUrlTemplate=a[4].decode(e,e.uint32());break;case 5:o.kmlUrlTemplate=a[5].decode(e,e.uint32());break;case 6:o.featuredToursUrl=a[6].decode(e,e.uint32());break;case 7:o.enableViewportFallback=e.bool();break;case 8:o.viewportFallbackDistance=e.uint32();break;case 10:o.imageryType&&o.imageryType.length||(o.imageryType=[]),o.imageryType.push(a[9].decode(e,e.uint32()));break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.requirements&&null!==e.requirements){var t=a[0].verify(e.requirements);if(t)return"requirements."+t}if(void 0!==e.alleycatUrlTemplate&&null!==e.alleycatUrlTemplate){var t=a[1].verify(e.alleycatUrlTemplate);if(t)return"alleycatUrlTemplate."+t}if(void 0!==e.fallbackAlleycatUrlTemplate&&null!==e.fallbackAlleycatUrlTemplate){var t=a[2].verify(e.fallbackAlleycatUrlTemplate);if(t)return"fallbackAlleycatUrlTemplate."+t}if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){var t=a[3].verify(e.metadataUrlTemplate);if(t)return"metadataUrlTemplate."+t}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){var t=a[4].verify(e.thumbnailUrlTemplate);if(t)return"thumbnailUrlTemplate."+t}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){var t=a[5].verify(e.kmlUrlTemplate);if(t)return"kmlUrlTemplate."+t}if(void 0!==e.featuredToursUrl&&null!==e.featuredToursUrl){var t=a[6].verify(e.featuredToursUrl);if(t)return"featuredToursUrl."+t}if(void 0!==e.enableViewportFallback&&"boolean"!=typeof e.enableViewportFallback)return"enableViewportFallback: boolean expected";if(void 0!==e.viewportFallbackDistance&&!r.isInteger(e.viewportFallbackDistance))return"viewportFallbackDistance: integer expected";if(void 0!==e.imageryType){if(!Array.isArray(e.imageryType))return"imageryType: array expected";for(var i=0;i<e.imageryType.length;++i){var t=a[9].verify(e.imageryType[i]);if(t)return"imageryType."+t}}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto;if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.requirements: object expected");t.requirements=a[0].fromObject(e.requirements)}if(void 0!==e.alleycatUrlTemplate&&null!==e.alleycatUrlTemplate){if("object"!=typeof e.alleycatUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.alleycatUrlTemplate: object expected");t.alleycatUrlTemplate=a[1].fromObject(e.alleycatUrlTemplate)}if(void 0!==e.fallbackAlleycatUrlTemplate&&null!==e.fallbackAlleycatUrlTemplate){if("object"!=typeof e.fallbackAlleycatUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.fallbackAlleycatUrlTemplate: object expected");t.fallbackAlleycatUrlTemplate=a[2].fromObject(e.fallbackAlleycatUrlTemplate)}if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){if("object"!=typeof e.metadataUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.metadataUrlTemplate: object expected");t.metadataUrlTemplate=a[3].fromObject(e.metadataUrlTemplate)}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){if("object"!=typeof e.thumbnailUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.thumbnailUrlTemplate: object expected");t.thumbnailUrlTemplate=a[4].fromObject(e.thumbnailUrlTemplate)}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){if("object"!=typeof e.kmlUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.kmlUrlTemplate: object expected");t.kmlUrlTemplate=a[5].fromObject(e.kmlUrlTemplate)}if(void 0!==e.featuredToursUrl&&null!==e.featuredToursUrl){if("object"!=typeof e.featuredToursUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.featuredToursUrl: object expected");t.featuredToursUrl=a[6].fromObject(e.featuredToursUrl)}if(void 0!==e.enableViewportFallback&&null!==e.enableViewportFallback&&(t.enableViewportFallback=Boolean(e.enableViewportFallback)),void 0!==e.viewportFallbackDistance&&null!==e.viewportFallbackDistance&&(t.viewportFallbackDistance=e.viewportFallbackDistance>>>0),e.imageryType){if(!Array.isArray(e.imageryType))throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: array expected");t.imageryType=[];for(var r=0;r<e.imageryType.length;++r){if("object"!=typeof e.imageryType[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: object expected");t.imageryType[r]=a[9].fromObject(e.imageryType[r])}}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.imageryType=[]),t.defaults&&(r.requirements=null,r.alleycatUrlTemplate=null,r.fallbackAlleycatUrlTemplate=null,r.metadataUrlTemplate=null,r.thumbnailUrlTemplate=null,r.kmlUrlTemplate=null,r.featuredToursUrl=null,r.enableViewportFallback=!1,
r.viewportFallbackDistance=0),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=a[0].toObject(e.requirements,t)),void 0!==e.alleycatUrlTemplate&&null!==e.alleycatUrlTemplate&&e.hasOwnProperty("alleycatUrlTemplate")&&(r.alleycatUrlTemplate=a[1].toObject(e.alleycatUrlTemplate,t)),void 0!==e.fallbackAlleycatUrlTemplate&&null!==e.fallbackAlleycatUrlTemplate&&e.hasOwnProperty("fallbackAlleycatUrlTemplate")&&(r.fallbackAlleycatUrlTemplate=a[2].toObject(e.fallbackAlleycatUrlTemplate,t)),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate&&e.hasOwnProperty("metadataUrlTemplate")&&(r.metadataUrlTemplate=a[3].toObject(e.metadataUrlTemplate,t)),void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate&&e.hasOwnProperty("thumbnailUrlTemplate")&&(r.thumbnailUrlTemplate=a[4].toObject(e.thumbnailUrlTemplate,t)),void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate&&e.hasOwnProperty("kmlUrlTemplate")&&(r.kmlUrlTemplate=a[5].toObject(e.kmlUrlTemplate,t)),void 0!==e.featuredToursUrl&&null!==e.featuredToursUrl&&e.hasOwnProperty("featuredToursUrl")&&(r.featuredToursUrl=a[6].toObject(e.featuredToursUrl,t)),void 0!==e.enableViewportFallback&&null!==e.enableViewportFallback&&e.hasOwnProperty("enableViewportFallback")&&(r.enableViewportFallback=e.enableViewportFallback),void 0!==e.viewportFallbackDistance&&null!==e.viewportFallbackDistance&&e.hasOwnProperty("viewportFallbackDistance")&&(r.viewportFallbackDistance=e.viewportFallbackDistance),void 0!==e.imageryType&&null!==e.imageryType&&e.hasOwnProperty("imageryType")){r.imageryType=[];for(var i=0;i<e.imageryType.length;++i)r.imageryType[i]=a[9].toObject(e.imageryType[i],t)}return r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.AlleycatImageryTypeProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.imageryTypeId=0,o.prototype.imageryTypeLabel="",o.prototype.metadataUrlTemplate=null,o.prototype.thumbnailUrlTemplate=null,o.prototype.kmlUrlTemplate=null;var a={2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.imageryTypeId=e.int32();break;case 2:o.imageryTypeLabel=e.string();break;case 3:o.metadataUrlTemplate=a[2].decode(e,e.uint32());break;case 4:o.thumbnailUrlTemplate=a[3].decode(e,e.uint32());break;case 5:o.kmlUrlTemplate=a[4].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.imageryTypeId&&!r.isInteger(e.imageryTypeId))return"imageryTypeId: integer expected";if(void 0!==e.imageryTypeLabel&&!r.isString(e.imageryTypeLabel))return"imageryTypeLabel: string expected";if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){var t=a[2].verify(e.metadataUrlTemplate);if(t)return"metadataUrlTemplate."+t}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){var t=a[3].verify(e.thumbnailUrlTemplate);if(t)return"thumbnailUrlTemplate."+t}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){var t=a[4].verify(e.kmlUrlTemplate);if(t)return"kmlUrlTemplate."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;if(void 0!==e.imageryTypeId&&null!==e.imageryTypeId&&(t.imageryTypeId=0|e.imageryTypeId),void 0!==e.imageryTypeLabel&&null!==e.imageryTypeLabel&&(t.imageryTypeLabel=String(e.imageryTypeLabel)),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){if("object"!=typeof e.metadataUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.metadataUrlTemplate: object expected");t.metadataUrlTemplate=a[2].fromObject(e.metadataUrlTemplate)}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){if("object"!=typeof e.thumbnailUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.thumbnailUrlTemplate: object expected");t.thumbnailUrlTemplate=a[3].fromObject(e.thumbnailUrlTemplate)}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){if("object"!=typeof e.kmlUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.kmlUrlTemplate: object expected");t.kmlUrlTemplate=a[4].fromObject(e.kmlUrlTemplate)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.imageryTypeId=0,r.imageryTypeLabel="",r.metadataUrlTemplate=null,r.thumbnailUrlTemplate=null,r.kmlUrlTemplate=null),void 0!==e.imageryTypeId&&null!==e.imageryTypeId&&e.hasOwnProperty("imageryTypeId")&&(r.imageryTypeId=e.imageryTypeId),void 0!==e.imageryTypeLabel&&null!==e.imageryTypeLabel&&e.hasOwnProperty("imageryTypeLabel")&&(r.imageryTypeLabel=e.imageryTypeLabel),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate&&e.hasOwnProperty("metadataUrlTemplate")&&(r.metadataUrlTemplate=a[2].toObject(e.metadataUrlTemplate,t)),void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate&&e.hasOwnProperty("thumbnailUrlTemplate")&&(r.thumbnailUrlTemplate=a[3].toObject(e.thumbnailUrlTemplate,t)),void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate&&e.hasOwnProperty("kmlUrlTemplate")&&(r.kmlUrlTemplate=a[4].toObject(e.kmlUrlTemplate,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o}(),o.StarDataProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null;var o={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.StarDataProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.StarDataProto.url: object expected");t.url=o[0].fromObject(e.url)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.DbRootRefProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.url="",o.prototype.isCritical=!1,o.prototype.requirements=null;var a={2:"keyhole.dbroot.RequirementProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DbRootRefProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 2:o.url=e.string();break;case 1:o.isCritical=e.bool();break;case 3:o.requirements=a[2].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.url))return"url: string expected";if(void 0!==e.isCritical&&"boolean"!=typeof e.isCritical)return"isCritical: boolean expected";if(void 0!==e.requirements&&null!==e.requirements){var t=a[2].verify(e.requirements);if(t)return"requirements."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DbRootRefProto)return e;var t=new n.keyhole.dbroot.DbRootRefProto;if(void 0!==e.url&&null!==e.url&&(t.url=String(e.url)),void 0!==e.isCritical&&null!==e.isCritical&&(t.isCritical=Boolean(e.isCritical)),void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.DbRootRefProto.requirements: object expected");t.requirements=a[2].fromObject(e.requirements)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url="",r.isCritical=!1,r.requirements=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=e.url),void 0!==e.isCritical&&null!==e.isCritical&&e.hasOwnProperty("isCritical")&&(r.isCritical=e.isCritical),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=a[2].toObject(e.requirements,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.DatabaseVersionProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.quadtreeVersion=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DatabaseVersionProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.quadtreeVersion=e.uint32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.quadtreeVersion)?null:"quadtreeVersion: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DatabaseVersionProto)return e;var t=new n.keyhole.dbroot.DatabaseVersionProto;return void 0!==e.quadtreeVersion&&null!==e.quadtreeVersion&&(t.quadtreeVersion=e.quadtreeVersion>>>0),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.quadtreeVersion=0),void 0!==e.quadtreeVersion&&null!==e.quadtreeVersion&&e.hasOwnProperty("quadtreeVersion")&&(r.quadtreeVersion=e.quadtreeVersion),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.DbRootProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.databaseName=null,o.prototype.imageryPresent=!0,o.prototype.protoImagery=!1,o.prototype.terrainPresent=!1,o.prototype.providerInfo=r.emptyArray,o.prototype.nestedFeature=r.emptyArray,o.prototype.styleAttribute=r.emptyArray,o.prototype.styleMap=r.emptyArray,o.prototype.endSnippet=null,o.prototype.translationEntry=r.emptyArray,o.prototype.language="en",o.prototype.version=5,o.prototype.dbrootReference=r.emptyArray,o.prototype.databaseVersion=null,o.prototype.refreshTimeout=0;var a={0:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.ProviderInfoProto",5:"keyhole.dbroot.NestedFeatureProto",6:"keyhole.dbroot.StyleAttributeProto",7:"keyhole.dbroot.StyleMapProto",8:"keyhole.dbroot.EndSnippetProto",9:"keyhole.dbroot.StringEntryProto",12:"keyhole.dbroot.DbRootRefProto",13:"keyhole.dbroot.DatabaseVersionProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DbRootProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 15:o.databaseName=a[0].decode(e,e.uint32());break;case 1:o.imageryPresent=e.bool();break;case 14:o.protoImagery=e.bool();break;case 2:o.terrainPresent=e.bool();break;case 3:o.providerInfo&&o.providerInfo.length||(o.providerInfo=[]),o.providerInfo.push(a[4].decode(e,e.uint32()));break;case 4:o.nestedFeature&&o.nestedFeature.length||(o.nestedFeature=[]),o.nestedFeature.push(a[5].decode(e,e.uint32()));break;case 5:o.styleAttribute&&o.styleAttribute.length||(o.styleAttribute=[]),o.styleAttribute.push(a[6].decode(e,e.uint32()));break;case 6:o.styleMap&&o.styleMap.length||(o.styleMap=[]),o.styleMap.push(a[7].decode(e,e.uint32()));break;case 7:o.endSnippet=a[8].decode(e,e.uint32());break;case 8:o.translationEntry&&o.translationEntry.length||(o.translationEntry=[]),o.translationEntry.push(a[9].decode(e,e.uint32()));break;case 9:o.language=e.string();break;case 10:o.version=e.int32();break;case 11:o.dbrootReference&&o.dbrootReference.length||(o.dbrootReference=[]),o.dbrootReference.push(a[12].decode(e,e.uint32()));break;case 13:o.databaseVersion=a[13].decode(e,e.uint32());break;case 16:o.refreshTimeout=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.databaseName&&null!==e.databaseName){var t=a[0].verify(e.databaseName);if(t)return"databaseName."+t}if(void 0!==e.imageryPresent&&"boolean"!=typeof e.imageryPresent)return"imageryPresent: boolean expected";if(void 0!==e.protoImagery&&"boolean"!=typeof e.protoImagery)return"protoImagery: boolean expected";if(void 0!==e.terrainPresent&&"boolean"!=typeof e.terrainPresent)return"terrainPresent: boolean expected";if(void 0!==e.providerInfo){if(!Array.isArray(e.providerInfo))return"providerInfo: array expected";for(var i=0;i<e.providerInfo.length;++i){var t=a[4].verify(e.providerInfo[i]);if(t)return"providerInfo."+t}}if(void 0!==e.nestedFeature){if(!Array.isArray(e.nestedFeature))return"nestedFeature: array expected";for(var i=0;i<e.nestedFeature.length;++i){var t=a[5].verify(e.nestedFeature[i]);if(t)return"nestedFeature."+t}}if(void 0!==e.styleAttribute){if(!Array.isArray(e.styleAttribute))return"styleAttribute: array expected";for(var i=0;i<e.styleAttribute.length;++i){var t=a[6].verify(e.styleAttribute[i]);if(t)return"styleAttribute."+t}}if(void 0!==e.styleMap){if(!Array.isArray(e.styleMap))return"styleMap: array expected";for(var i=0;i<e.styleMap.length;++i){var t=a[7].verify(e.styleMap[i]);if(t)return"styleMap."+t}}if(void 0!==e.endSnippet&&null!==e.endSnippet){var t=a[8].verify(e.endSnippet);if(t)return"endSnippet."+t}if(void 0!==e.translationEntry){if(!Array.isArray(e.translationEntry))return"translationEntry: array expected";for(var i=0;i<e.translationEntry.length;++i){var t=a[9].verify(e.translationEntry[i]);if(t)return"translationEntry."+t}}if(void 0!==e.language&&!r.isString(e.language))return"language: string expected";if(void 0!==e.version&&!r.isInteger(e.version))return"version: integer expected";if(void 0!==e.dbrootReference){if(!Array.isArray(e.dbrootReference))return"dbrootReference: array expected";for(var i=0;i<e.dbrootReference.length;++i){var t=a[12].verify(e.dbrootReference[i]);if(t)return"dbrootReference."+t}}if(void 0!==e.databaseVersion&&null!==e.databaseVersion){var t=a[13].verify(e.databaseVersion);if(t)return"databaseVersion."+t}return void 0===e.refreshTimeout||r.isInteger(e.refreshTimeout)?null:"refreshTimeout: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DbRootProto)return e;var t=new n.keyhole.dbroot.DbRootProto;if(void 0!==e.databaseName&&null!==e.databaseName){if("object"!=typeof e.databaseName)throw TypeError(".keyhole.dbroot.DbRootProto.databaseName: object expected");t.databaseName=a[0].fromObject(e.databaseName)}if(void 0!==e.imageryPresent&&null!==e.imageryPresent&&(t.imageryPresent=Boolean(e.imageryPresent)),void 0!==e.protoImagery&&null!==e.protoImagery&&(t.protoImagery=Boolean(e.protoImagery)),void 0!==e.terrainPresent&&null!==e.terrainPresent&&(t.terrainPresent=Boolean(e.terrainPresent)),e.providerInfo){if(!Array.isArray(e.providerInfo))throw TypeError(".keyhole.dbroot.DbRootProto.providerInfo: array expected");t.providerInfo=[];for(var r=0;r<e.providerInfo.length;++r){if("object"!=typeof e.providerInfo[r])throw TypeError(".keyhole.dbroot.DbRootProto.providerInfo: object expected");t.providerInfo[r]=a[4].fromObject(e.providerInfo[r])}}if(e.nestedFeature){if(!Array.isArray(e.nestedFeature))throw TypeError(".keyhole.dbroot.DbRootProto.nestedFeature: array expected");t.nestedFeature=[];for(var r=0;r<e.nestedFeature.length;++r){if("object"!=typeof e.nestedFeature[r])throw TypeError(".keyhole.dbroot.DbRootProto.nestedFeature: object expected");t.nestedFeature[r]=a[5].fromObject(e.nestedFeature[r])}}if(e.styleAttribute){if(!Array.isArray(e.styleAttribute))throw TypeError(".keyhole.dbroot.DbRootProto.styleAttribute: array expected");t.styleAttribute=[];for(var r=0;r<e.styleAttribute.length;++r){if("object"!=typeof e.styleAttribute[r])throw TypeError(".keyhole.dbroot.DbRootProto.styleAttribute: object expected");t.styleAttribute[r]=a[6].fromObject(e.styleAttribute[r])}}if(e.styleMap){if(!Array.isArray(e.styleMap))throw TypeError(".keyhole.dbroot.DbRootProto.styleMap: array expected");t.styleMap=[];for(var r=0;r<e.styleMap.length;++r){if("object"!=typeof e.styleMap[r])throw TypeError(".keyhole.dbroot.DbRootProto.styleMap: object expected");t.styleMap[r]=a[7].fromObject(e.styleMap[r])}}if(void 0!==e.endSnippet&&null!==e.endSnippet){if("object"!=typeof e.endSnippet)throw TypeError(".keyhole.dbroot.DbRootProto.endSnippet: object expected");t.endSnippet=a[8].fromObject(e.endSnippet)}if(e.translationEntry){if(!Array.isArray(e.translationEntry))throw TypeError(".keyhole.dbroot.DbRootProto.translationEntry: array expected");t.translationEntry=[];for(var r=0;r<e.translationEntry.length;++r){if("object"!=typeof e.translationEntry[r])throw TypeError(".keyhole.dbroot.DbRootProto.translationEntry: object expected");t.translationEntry[r]=a[9].fromObject(e.translationEntry[r])}}if(void 0!==e.language&&null!==e.language&&(t.language=String(e.language)),void 0!==e.version&&null!==e.version&&(t.version=0|e.version),e.dbrootReference){if(!Array.isArray(e.dbrootReference))throw TypeError(".keyhole.dbroot.DbRootProto.dbrootReference: array expected");t.dbrootReference=[];for(var r=0;r<e.dbrootReference.length;++r){if("object"!=typeof e.dbrootReference[r])throw TypeError(".keyhole.dbroot.DbRootProto.dbrootReference: object expected");t.dbrootReference[r]=a[12].fromObject(e.dbrootReference[r])}}if(void 0!==e.databaseVersion&&null!==e.databaseVersion){if("object"!=typeof e.databaseVersion)throw TypeError(".keyhole.dbroot.DbRootProto.databaseVersion: object expected");t.databaseVersion=a[13].fromObject(e.databaseVersion)}return void 0!==e.refreshTimeout&&null!==e.refreshTimeout&&(t.refreshTimeout=0|e.refreshTimeout),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.providerInfo=[],r.nestedFeature=[],r.styleAttribute=[],r.styleMap=[],r.translationEntry=[],r.dbrootReference=[]),t.defaults&&(r.databaseName=null,r.imageryPresent=!0,r.protoImagery=!1,r.terrainPresent=!1,r.endSnippet=null,r.language="en",r.version=5,r.databaseVersion=null,r.refreshTimeout=0),void 0!==e.databaseName&&null!==e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=a[0].toObject(e.databaseName,t)),void 0!==e.imageryPresent&&null!==e.imageryPresent&&e.hasOwnProperty("imageryPresent")&&(r.imageryPresent=e.imageryPresent),void 0!==e.protoImagery&&null!==e.protoImagery&&e.hasOwnProperty("protoImagery")&&(r.protoImagery=e.protoImagery),void 0!==e.terrainPresent&&null!==e.terrainPresent&&e.hasOwnProperty("terrainPresent")&&(r.terrainPresent=e.terrainPresent),void 0!==e.providerInfo&&null!==e.providerInfo&&e.hasOwnProperty("providerInfo")){r.providerInfo=[];for(var i=0;i<e.providerInfo.length;++i)r.providerInfo[i]=a[4].toObject(e.providerInfo[i],t)}if(void 0!==e.nestedFeature&&null!==e.nestedFeature&&e.hasOwnProperty("nestedFeature")){r.nestedFeature=[];for(var i=0;i<e.nestedFeature.length;++i)r.nestedFeature[i]=a[5].toObject(e.nestedFeature[i],t)}if(void 0!==e.styleAttribute&&null!==e.styleAttribute&&e.hasOwnProperty("styleAttribute")){r.styleAttribute=[];for(var i=0;i<e.styleAttribute.length;++i)r.styleAttribute[i]=a[6].toObject(e.styleAttribute[i],t)}if(void 0!==e.styleMap&&null!==e.styleMap&&e.hasOwnProperty("styleMap")){r.styleMap=[];for(var i=0;i<e.styleMap.length;++i)r.styleMap[i]=a[7].toObject(e.styleMap[i],t)}if(void 0!==e.endSnippet&&null!==e.endSnippet&&e.hasOwnProperty("endSnippet")&&(r.endSnippet=a[8].toObject(e.endSnippet,t)),void 0!==e.translationEntry&&null!==e.translationEntry&&e.hasOwnProperty("translationEntry")){r.translationEntry=[];for(var i=0;i<e.translationEntry.length;++i)r.translationEntry[i]=a[9].toObject(e.translationEntry[i],t)}if(void 0!==e.language&&null!==e.language&&e.hasOwnProperty("language")&&(r.language=e.language),void 0!==e.version&&null!==e.version&&e.hasOwnProperty("version")&&(r.version=e.version),void 0!==e.dbrootReference&&null!==e.dbrootReference&&e.hasOwnProperty("dbrootReference")){r.dbrootReference=[];for(var i=0;i<e.dbrootReference.length;++i)r.dbrootReference[i]=a[12].toObject(e.dbrootReference[i],t)}return void 0!==e.databaseVersion&&null!==e.databaseVersion&&e.hasOwnProperty("databaseVersion")&&(r.databaseVersion=a[13].toObject(e.databaseVersion,t)),void 0!==e.refreshTimeout&&null!==e.refreshTimeout&&e.hasOwnProperty("refreshTimeout")&&(r.refreshTimeout=e.refreshTimeout),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.EncryptedDbRootProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.encryptionType=0,o.prototype.encryptionData=r.newBuffer([]),o.prototype.dbrootData=r.newBuffer([]);var a={0:"keyhole.dbroot.EncryptedDbRootProto.EncryptionType"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EncryptedDbRootProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.encryptionType=e.uint32();break;case 2:o.encryptionData=e.bytes();break;case 3:o.dbrootData=e.bytes();break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.encryptionType)switch(e.encryptionType){default:return"encryptionType: enum value expected";case 0:}return void 0===e.encryptionData||e.encryptionData&&"number"==typeof e.encryptionData.length||r.isString(e.encryptionData)?void 0===e.dbrootData||e.dbrootData&&"number"==typeof e.dbrootData.length||r.isString(e.dbrootData)?null:"dbrootData: buffer expected":"encryptionData: buffer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EncryptedDbRootProto)return e;var t=new n.keyhole.dbroot.EncryptedDbRootProto;switch(e.encryptionType){case"ENCRYPTION_XOR":case 0:t.encryptionType=0}return void 0!==e.encryptionData&&null!==e.encryptionData&&("string"==typeof e.encryptionData?r.base64.decode(e.encryptionData,t.encryptionData=r.newBuffer(r.base64.length(e.encryptionData)),0):e.encryptionData.length&&(t.encryptionData=e.encryptionData)),void 0!==e.dbrootData&&null!==e.dbrootData&&("string"==typeof e.dbrootData?r.base64.decode(e.dbrootData,t.dbrootData=r.newBuffer(r.base64.length(e.dbrootData)),0):e.dbrootData.length&&(t.dbrootData=e.dbrootData)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.encryptionType=t.enums===String?"ENCRYPTION_XOR":0,i.encryptionData=t.bytes===String?"":[],i.dbrootData=t.bytes===String?"":[]),void 0!==e.encryptionType&&null!==e.encryptionType&&e.hasOwnProperty("encryptionType")&&(i.encryptionType=t.enums===String?a[0][e.encryptionType]:e.encryptionType),void 0!==e.encryptionData&&null!==e.encryptionData&&e.hasOwnProperty("encryptionData")&&(i.encryptionData=t.bytes===String?r.base64.encode(e.encryptionData,0,e.encryptionData.length):t.bytes===Array?Array.prototype.slice.call(e.encryptionData):e.encryptionData),void 0!==e.dbrootData&&null!==e.dbrootData&&e.hasOwnProperty("dbrootData")&&(i.dbrootData=t.bytes===String?r.base64.encode(e.dbrootData,0,e.dbrootData.length):t.bytes===Array?Array.prototype.slice.call(e.dbrootData):e.dbrootData),i},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.EncryptionType=function(){var e={},t=Object.create(e);return t.ENCRYPTION_XOR=0,t}(),o}(),o}(),o}(),r.lazyResolve(n,i),n.keyhole.dbroot}),define("Core/isBitSet",[],function(){"use strict";function e(e,t){return 0!=(e&t)}return e}),define("Core/GoogleEarthEnterpriseTileInformation",["./defined","./isBitSet"],function(e,t){"use strict";function r(e,t,r,i,n,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=r,this.terrainVersion=i,this.imageryProvider=n,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}var i=[1,2,4,8];return r.clone=function(t,i){return e(i)?(i._bits=t._bits,i.cnodeVersion=t.cnodeVersion,i.imageryVersion=t.imageryVersion,i.terrainVersion=t.terrainVersion,i.imageryProvider=t.imageryProvider,i.terrainProvider=t.terrainProvider):i=new r(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),i.ancestorHasTerrain=t.ancestorHasTerrain,i.terrainState=t.terrainState,i},r.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},r.prototype.hasSubtree=function(){return t(this._bits,16)},r.prototype.hasImagery=function(){return t(this._bits,64)},r.prototype.hasTerrain=function(){return t(this._bits,128)},r.prototype.hasChildren=function(){return t(this._bits,15)},r.prototype.hasChild=function(e){return t(this._bits,i[e])},r.prototype.getChildBitmask=function(){return 15&this._bits},r}),define("Core/GoogleEarthEnterpriseMetadata",["../ThirdParty/google-earth-dbroot-parser","../ThirdParty/when","./appendForwardSlash","./Check","./Credit","./defaultValue","./defined","./defineProperties","./deprecationWarning","./GoogleEarthEnterpriseTileInformation","./isBitSet","./Math","./Request","./Resource","./RuntimeError","./TaskProcessor"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e){var r,i=e;"string"==typeof i||i instanceof p||(a(e.proxy)&&l("GoogleEarthEnterpriseMetadata","The options.url & options.proxy parameters have been deprecated. Specify a URL string or a Resource as the only parameter."),i=e.url,r=e.proxy);var n=p.createIfNeeded(i,{proxy:r});n.appendForwardSlash(),this._resource=n,this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=d.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={};var o=this;this._readyPromise=y(this).then(function(){return o.getQuadTreePacket("",o._quadPacketVersion)}).then(function(){return!0}).otherwise(function(e){var r="An error occurred while accessing "+v(o,"",1).url+".";return t.reject(new f(r))})}function _(e,r,i){var n=e._tileInfo,o=r,s=n[o];if(a(s)&&(!s.hasSubtree()||s.hasChildren()))return s;for(;void 0===s&&o.length>1;)o=o.substring(0,o.length-1),s=n[o];var l,u=e._subtreePromises,c=u[o];return a(c)?c.then(function(){return l=new h({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),_(e,r,l)}):a(s)&&s.hasSubtree()?(c=e.getQuadTreePacket(o,s.cnodeVersion,i),a(c)?(u[o]=c,c.then(function(){return l=new h({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction}),_(e,r,l)}).always(function(){delete u[o]})):void 0):t.reject(new f("Couldn't load metadata for tile "+r))}function v(e,t,r,i){return e._resource.getDerivedResource({url:"flatfile?q2-0"+t+"-q."+r.toString(),request:i})}function y(t){var r=t._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});return r.fetchArrayBuffer().then(function(r){var i=e.EncryptedDbRootProto.decode(new Uint8Array(r)),n=i.encryptionData,o=n.byteOffset,a=o+n.byteLength,s=t.key=n.buffer.slice(o,a);n=i.dbrootData,o=n.byteOffset,a=o+n.byteLength;var l=n.buffer.slice(o,a);return C.scheduleTask({buffer:l,type:"DbRoot",key:s},[l])}).then(function(r){var i=e.DbRootProto.decode(new Uint8Array(r.buffer));if(t.imageryPresent=o(i.imageryPresent,t.imageryPresent),t.protoImagery=i.protoImagery,t.terrainPresent=o(i.terrainPresent,t.terrainPresent),a(i.endSnippet)&&a(i.endSnippet.model)){var s=i.endSnippet.model;t.negativeAltitudeExponentBias=o(s.negativeAltitudeExponentBias,t.negativeAltitudeExponentBias),t.negativeAltitudeThreshold=o(s.compressedNegativeAltitudeThreshold,t.negativeAltitudeThreshold)}a(i.databaseVersion)&&(t._quadPacketVersion=o(i.databaseVersion.quadtreeVersion,t._quadPacketVersion));for(var l=t.providers,u=o(i.providerInfo,[]),c=u.length,d=0;d<c;++d){var h=u[d],p=h.copyrightString;a(p)&&(l[h.providerId]=new n({text:p.value}))}}).otherwise(function(){console.log("Failed to retrieve "+r.url+". Using defaults."),t.key=b})}var b=function(e){for(var t=e.length,r=new ArrayBuffer(t),i=new Uint8Array(r),n=0;n<t;++n)i[n]=e.charCodeAt(n);return r}('Eô½\vyâjE"’,ÍqøIFgQ\0B%Æèa,f)\bÆ4Üjb%y\nwmiÖðœk“¡½NuàA[ß@V\fÙ»r›|3SîOlÔq°{ÀEVZ­wUe\v3’*¬l5Å0sø3>mF8J´Ýð.ÝuڌDt"úa"\f3"So¯9D\vŒ9Ù9L¹¿«\\ŒP_Ÿ"uxéq‘h;Áěð<VqH‚\'UfYNe˜u£aF}a?A\0Ÿ×´4M·F°Õ¸Š\'{‹Ü+»Mg0ÈÑö\\Pú[/F›n5/\'C.ë\n\f^¥se4ål.jC\'c#U©?q{gC}:¯ÍâTUœýKÆâŸ/(íË\\Æ-fˆ§;/*"N°k.Ý\r•}}GºC²²+>Mª>}æÎI‰Ææx\fa1-¤O¥~q ˆì\r1èN\v\0nPh}=\b\r•¦n£h—$[kó#ó¶s³\r\v@ÀŸØQ]ú".jßI\0¹ wUÆïj¿{GLƒîÜÜF…©­S+S4ÿ”Yä8è1ƒN¹XFkË-#†’p\x005ˆ"Ï1²&/çÃu-6,rt°#G·ÓÑ&…7râ\0ŒDÏÚ3-Þ`†i#i*|ÍKQ\r•T9w.)ê¦P¢joP™\\>TûïP[\vE‰m(w7ێJfJo™ åpâ¹q~\fmI-zþrÇòY0»]såÉ êxì ðŠB|G`°½&·q¶ÇŸÑ3‚=Ó«îc™È+S D\\qÆÌD2O<ÊÀ)=RÓaX©}e´ÜÏ\rô=ñ\b©BÚ#\tØ¿^PIøMÀËGLO÷{+ØÅ1’;µoÜl\r’ˆўÛ?âéÚ_ԄâFaZÞUϤ\0¾ýÎgñJi—æ HØ]~®q N®ÀV©‘<‚rçvì)IÖ]-ƒãÛ6©;f—‡jÕ¶=P^R¹KÇsWxÉô.Y•“oÐKW>\'\'Ç`Û;íšSD>?’mw¢\në?R¨ÆU^1I7…ôÅ&-©¿‹\'TÚÃj å*x°Öprª‹h½ˆ÷_H±~ÀXL?fù>áeÀp§Ï8i¯ðVldIœ\'­xtO‡ÞV9\0Úw\vË-‰û5Oõ\bQ`Á\nZGM&30xÚÀœFGâ[y`In7gS\n>éìF9²ñ4\rƄSuná\fYÙÞ)…{II¥wy¾IV.6ç\v:»Ob{ÒM1•/½8{¨O!áìFpv•})"xˆ\nÝ\\ÚÞQÏðüYRe|3ßóHÚ»*uÛ`²Ôüíì5¨ÿ(1-È܈F|Š["');s(g.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return this._readyPromise}}}),g.tileXYToQuadKey=function(e,t,r){for(var i="",n=r;n>=0;--n){var o=1<<n,a=0;c(t,o)?c(e,o)&&(a|=1):(a|=2,c(e,o)||(a|=1)),i+=a}return i},g.quadKeyToTileXY=function(e){for(var t=0,r=0,i=e.length-1,n=i;n>=0;--n){var o=1<<n,a=+e[i-n];c(a,2)?c(a,1)||(t|=o):(r|=o,c(a,1)&&(t|=o))}return{x:t,y:r,level:i}},g.prototype.isValid=function(e){var t=this.getTileInformationFromQuadKey(e);if(a(t))return null!==t;for(var r,i=!0,n=e;n.length>1;){if(r=n.substring(n.length-1),n=n.substring(0,n.length-1),t=this.getTileInformationFromQuadKey(n),a(t)){t.hasSubtree()||t.hasChild(parseInt(r))||(i=!1);break}if(null===t){i=!1;break}}return i};var C=new m("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY);return g.prototype.getQuadTreePacket=function(e,t,r){t=o(t,1),e=o(e,"");var i=v(this,e,t,r),n=i.fetchArrayBuffer();if(a(n)){var s=this._tileInfo,l=this.key;return n.then(function(t){return C.scheduleTask({buffer:t,quadKey:e,type:"Metadata",key:l},[t]).then(function(t){var r,i=-1;if(""!==e){i=e.length+1;var n=t[e];r=s[e],r._bits|=n._bits,delete t[e]}var o=Object.keys(t);o.sort(function(e,t){return e.length-t.length});for(var a=o.length,l=0;l<a;++l){var c=o[l];if(null!==t[c]){var d=u.clone(t[c]),h=c.length;if(h===i)d.setParent(r);else if(h>1){var p=s[c.substring(0,c.length-1)];d.setParent(p)}s[c]=d}else s[c]=null}})})}},g.prototype.populateSubtree=function(e,t,r,i){return _(this,g.tileXYToQuadKey(e,t,r),i)},g.prototype.getTileInformation=function(e,t,r){var i=g.tileXYToQuadKey(e,t,r);return this._tileInfo[i]},g.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]},g}),
define("Core/GoogleEarthEnterpriseTerrainData",["./BoundingSphere","./Cartesian2","./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(e){e=n(e,n.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;var t=n(e.childTileMask,15),r=3&t;r|=4&t?8:0,r|=8&t?4:0,this._childTileMask=r,this._createdByUpsampling=n(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0,this._vertexCountWithoutSkirts=void 0,this._skirtIndex=void 0}function v(e,t,r){for(var i=e._mesh,n=i.vertices,o=i.encoding,a=i.indices,s=0,l=a.length;s<l;s+=3){var c=a[s],d=a[s+1],h=a[s+2],p=o.decodeTextureCoordinates(n,c,w),f=o.decodeTextureCoordinates(n,d,A),m=o.decodeTextureCoordinates(n,h,E),g=u.computeBarycentricCoordinates(t,r,p.x,p.y,f.x,f.y,m.x,m.y,x);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){var _=o.decodeHeight(n,c),v=o.decodeHeight(n,d),y=o.decodeHeight(n,h);return g.x*_+g.y*v+g.z*y}}}function y(e,t,r,i){var n=e._buffer,o=0,a=0,s=0;r>.5?(t>.5?(o=2,a=.5):o=3,s=.5):t>.5&&(o=1,a=.5);for(var l=new DataView(n),d=0,h=0;h<o;++h)d+=l.getUint32(d,!0),d+=I;d+=I,d+=2*M;var p=c.toRadians(180*l.getFloat64(d,!0));d+=M;var f=c.toRadians(180*l.getFloat64(d,!0));d+=M;var m=i.width/p/2,g=i.height/f/2,_=l.getInt32(d,!0);d+=D;var v=3*l.getInt32(d,!0);d+=D,d+=D;var y,b=new Array(_),C=new Array(_),S=new Array(_);for(y=0;y<_;++y)b[y]=a+l.getUint8(d++)*m,C[y]=s+l.getUint8(d++)*g,S[y]=6371010*l.getFloat32(d,!0),d+=O;var T=new Array(v);for(y=0;y<v;++y)T[y]=l.getUint16(d,!0),d+=P;for(y=0;y<v;y+=3){var w=T[y],A=T[y+1],E=T[y+2],R=b[w],L=b[A],N=b[E],k=C[w],F=C[A],B=C[E],U=u.computeBarycentricCoordinates(t,r,R,k,L,F,N,B,x);if(U.x>=-1e-15&&U.y>=-1e-15&&U.z>=-1e-15)return U.x*S[w]+U.y*S[A]+U.z*S[E]}}a(_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var b=new f("createVerticesFromGoogleEarthEnterpriseBuffer"),C=new p,S=new p;_.prototype.createMesh=function(e,t,r,i,a){var s=e.ellipsoid;e.tileXYToNativeRectangle(t,r,i,C),e.tileXYToRectangle(t,r,i,S),a=n(a,1);var l=s.cartographicToCartesian(p.center(S)),u=40075.16/(1<<i);this._skirtHeight=Math.min(8*u,1e3);var c=b.scheduleTask({buffer:this._buffer,nativeRectangle:C,rectangle:S,relativeToCenter:l,ellipsoid:s,skirtHeight:this._skirtHeight,exaggeration:a,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(o(c)){var d=this;return c.then(function(e){return d._mesh=new g(l,new Float32Array(e.vertices),new Uint16Array(e.indices),e.minimumHeight,e.maximumHeight,e.boundingSphere3D,e.occludeePointInScaledSpace,e.numberOfAttributes,e.orientedBoundingBox,m.clone(e.encoding),a),d._vertexCountWithoutSkirts=e.vertexCountWithoutSkirts,d._skirtIndex=e.skirtIndex,d._minimumHeight=e.minimumHeight,d._maximumHeight=e.maximumHeight,d._buffer=void 0,d._mesh})}},_.prototype.interpolateHeight=function(e,t,r){var i=c.clamp((t-e.west)/e.width,0,1),n=c.clamp((r-e.south)/e.height,0,1);return o(this._mesh)?v(this,i,n):y(this,i,n,e)};var T=new f("upsampleQuantizedTerrainMesh");_.prototype.upsample=function(t,i,n,a,s,u,c){var p=this._mesh;if(o(this._mesh)){var f=2*i!==s,m=2*n===u,g=t.ellipsoid,_=t.tileXYToRectangle(s,u,c),v=T.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:f,isNorthChild:m,childRectangle:_,ellipsoid:g,exaggeration:p.exaggeration});if(o(v)){var y=this;return v.then(function(t){var i=new Uint16Array(t.vertices),n=l.createTypedArray(i.length/3,t.indices),o=y._skirtHeight;return new h({quantizedVertices:i,indices:n,minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight,boundingSphere:e.clone(t.boundingSphere),orientedBoundingBox:d.clone(t.orientedBoundingBox),horizonOcclusionPoint:r.clone(t.horizonOcclusionPoint),westIndices:t.westIndices,southIndices:t.southIndices,eastIndices:t.eastIndices,northIndices:t.northIndices,westSkirtHeight:o,southSkirtHeight:o,eastSkirtHeight:o,northSkirtHeight:o,childTileMask:0,createdByUpsampling:!0,credits:y._credits})})}}},_.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!=(this._childTileMask&1<<n)},_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var w=new t,A=new t,E=new t,x=new r,P=Uint16Array.BYTES_PER_ELEMENT,I=Uint32Array.BYTES_PER_ELEMENT,D=Int32Array.BYTES_PER_ELEMENT,O=Float32Array.BYTES_PER_ELEMENT,M=Float64Array.BYTES_PER_ELEMENT;return _}),define("Core/GoogleEarthEnterpriseTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./deprecationWarning","./DeveloperError","./Event","./GeographicTilingScheme","./GoogleEarthEnterpriseMetadata","./GoogleEarthEnterpriseTerrainData","./HeightmapTerrainData","./JulianDate","./Math","./Rectangle","./Request","./RequestState","./RequestType","./Resource","./RuntimeError","./TaskProcessor","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C){"use strict";function S(){this._terrainCache={},this._lastTidy=h.now()}function T(n){n=r(n,{}),i(n.proxy)&&o("GoogleEarthEnterpriseTerrainProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var a;if(i(n.metadata))a=n.metadata;else{var c=v.createIfNeeded(n.url,{proxy:n.proxy});a=new u(c)}this._metadata=a,this._tilingScheme=new l({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new f(-p.PI,-p.PI,p.PI,p.PI),ellipsoid:n.ellipsoid});var d=n.credit;"string"==typeof d&&(d=new t({text:d})),this._credit=d,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new S,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new s,this._ready=!1;var h,m=this;this._readyPromise=a.readyPromise.then(function(t){if(!a.terrainPresent){var r=new y("The server "+a.url+" doesn't have terrain");return h=C.handleError(h,m,m._errorEvent,r.message,void 0,void 0,void 0,r),e.reject(r)}return C.handleSuccess(h),m._ready=t,t}).otherwise(function(t){return h=C.handleError(h,m,m._errorEvent,t.message,void 0,void 0,void 0,t),e.reject(t)})}function w(e,t,r){var n=t.getChildBitmask();if(t.terrainState===E.PARENT){n=0;for(var o=0;o<4;++o){var a=r.getTileInformationFromQuadKey(e+o.toString());i(a)&&a.hasTerrain()&&(n|=1<<o)}}return n}function A(e,t,r,n){return r=i(r)&&r>0?r:1,e._metadata.resource.getDerivedResource({url:"flatfile?f1c-0"+t+"-t."+r.toString(),request:n})}var E={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},x=new h;S.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:h.now()}},S.prototype.get=function(e){var t=this._terrainCache,r=t[e];if(i(r))return delete this._terrainCache[e],r.buffer},S.prototype.tidy=function(){if(h.now(x),h.secondsDifference(x,this._lastTidy)>10){for(var e=this._terrainCache,t=Object.keys(e),r=t.length,i=0;i<r;++i){var n=t[i],o=e[n];h.secondsDifference(x,o.timestamp)>10&&delete e[n]}h.clone(x,this._lastTidy)}},n(T.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});var P=new b("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY);return T.prototype.requestTileGeometry=function(t,r,n,o){var a=u.tileXYToQuadKey(t,r,n),s=this._terrainCache,l=this._metadata,h=l.getTileInformationFromQuadKey(a);if(!i(h))return e.reject(new y("Terrain tile doesn't exist"));var p=h.terrainState;i(p)||(p=h.terrainState=E.UNKNOWN);var f=s.get(a);if(i(f)){var m=l.providers[h.terrainProvider];return new c({buffer:f,childTileMask:w(a,h,l),credits:i(m)?[m]:void 0,negativeAltitudeExponentBias:l.negativeAltitudeExponentBias,negativeElevationThreshold:l.negativeAltitudeThreshold})}if(s.tidy(),!h.ancestorHasTerrain)return new d({buffer:new Uint8Array(256),width:16,height:16});if(p===E.NONE)return e.reject(new y("Terrain tile doesn't exist"));var _,v=a,b=-1;switch(p){case E.SELF:b=h.terrainVersion;break;case E.PARENT:v=v.substring(0,v.length-1),_=l.getTileInformationFromQuadKey(v),b=_.terrainVersion;break;case E.UNKNOWN:h.hasTerrain()?b=h.terrainVersion:(v=v.substring(0,v.length-1),_=l.getTileInformationFromQuadKey(v),i(_)&&_.hasTerrain()&&(b=_.terrainVersion))}if(b<0)return e.reject(new y("Terrain tile doesn't exist"));var C,S,T=this._terrainPromises,x=this._terrainRequests;if(i(T[v]))C=T[v],S=x[v];else{S=o;var I=A(this,v,b,S).fetchArrayBuffer();if(!i(I))return;C=I.then(function(t){return i(t)?P.scheduleTask({buffer:t,type:"Terrain",key:l.key},[t]).then(function(e){var t=l.getTileInformationFromQuadKey(v);t.terrainState=E.SELF,s.add(v,e[0]);for(var r=t.terrainProvider,n=e.length-1,o=0;o<n;++o){var a=v+o.toString(),u=l.getTileInformationFromQuadKey(a);i(u)&&(s.add(a,e[o+1]),u.terrainState=E.PARENT,0===u.terrainProvider&&(u.terrainProvider=r))}}):e.reject(new y("Failed to load terrain."))}),T[v]=C,x[v]=S,C=C.always(function(){delete T[v],delete x[v]})}return C.then(function(){var t=s.get(a);if(i(t)){var r=l.providers[h.terrainProvider];return new c({buffer:t,childTileMask:w(a,h,l),credits:i(r)?[r]:void 0,negativeAltitudeExponentBias:l.negativeAltitudeExponentBias,negativeElevationThreshold:l.negativeAltitudeThreshold})}return e.reject(new y("Failed to load terrain."))}).otherwise(function(t){return S.state===g.CANCELLED?(o.state=S.state,e.reject(t)):(h.terrainState=E.NONE,e.reject(t))})},T.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},T.prototype.getTileDataAvailable=function(e,t,r){var n=this._metadata,o=u.tileXYToQuadKey(e,t,r),a=n.getTileInformation(e,t,r);if(null===a)return!1;if(i(a)){if(!a.ancestorHasTerrain)return!0;var s=a.terrainState;if(s===E.NONE)return!1;if(!(i(s)&&s!==E.UNKNOWN||(a.terrainState=E.UNKNOWN,a.hasTerrain()))){o=o.substring(0,o.length-1);var l=n.getTileInformationFromQuadKey(o);if(!i(l)||!l.hasTerrain())return!1}return!0}if(n.isValid(o)){var c=new m({throttle:!0,throttleByServer:!0,type:_.TERRAIN});n.populateSubtree(e,t,r,c)}return!1},T}),define("Core/HeadingPitchRange",["./defaultValue","./defined"],function(e,t){"use strict";function r(t,r,i){this.heading=e(t,0),this.pitch=e(r,0),this.range=e(i,0)}return r.clone=function(e,i){if(t(e))return t(i)||(i=new r),i.heading=e.heading,i.pitch=e.pitch,i.range=e.range,i},r}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(t,r,i){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(i,0)}return n.fromQuaternion=function(e,r){t(r)||(r=new n);var i=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 r.heading=-Math.atan2(l,s),r.roll=Math.atan2(a,o),r.pitch=-Math.asin(i),r},n.fromDegrees=function(e,r,o,a){return t(a)||(a=new n),a.heading=e*i.RADIANS_PER_DEGREE,a.pitch=r*i.RADIANS_PER_DEGREE,a.roll=o*i.RADIANS_PER_DEGREE,a},n.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new n(e.heading,e.pitch,e.roll)},n.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},n.equalsEpsilon=function(e,r,n,o){return e===r||t(e)&&t(r)&&i.equalsEpsilon(e.heading,r.heading,n,o)&&i.equalsEpsilon(e.pitch,r.pitch,n,o)&&i.equalsEpsilon(e.roll,r.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,r){return n.equalsEpsilon(this,e,t,r)},n.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},n}),define("Core/HermitePolynomialApproximation",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(e,t,r,i,o,a){var s,l,u,c=0;if(i>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,r,i-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-r[t[l]])}return c}function o(e,t,r,n,o,a){for(var s,l,u=-1,c=t.length,d=c*(c+1)/2,h=0;h<o;h++){var p=Math.floor(h*d);for(s=0;s<c;s++)l=t[s]*o*(a+1)+h,e[p+s]=n[l];for(var f=1;f<c;f++){var m=0,g=Math.floor(f*(1-f)/2)+c*f,_=!1;for(s=0;s<c-f;s++){var v,y,b=r[t[s]],C=r[t[s+f]];if(C-b<=0)l=t[s]*o*(a+1)+o*f+h,v=n[l],y=v/i.factorial(f),e[p+g+m]=y,m++;else{var S=Math.floor((f-1)*(2-f)/2)+c*(f-1);v=e[p+S+s+1]-e[p+S+s],y=v/(C-b),e[p+g+m]=y,m++}_=_||0!==v}_&&(u=Math.max(u,f))}}return u}var a=i.factorial,s={type:"Hermite"};s.getRequiredDataPoints=function(t,r){return r=e(r,0),Math.max(Math.floor((t+1)/(r+1)),2)},s.interpolateOrderZero=function(e,r,i,o,s){t(s)||(s=new Array(o));var l,u,c,d,h,p,f=r.length,m=new Array(o);for(l=0;l<o;l++){s[l]=0;var g=new Array(f);for(m[l]=g,u=0;u<f;u++)g[u]=[]}var _=f,v=new Array(_);for(l=0;l<_;l++)v[l]=l;var y=f-1;for(d=0;d<o;d++){for(u=0;u<_;u++)p=v[u]*o+d,m[d][0].push(i[p]);for(l=1;l<_;l++){var b=!1;for(u=0;u<_-l;u++){var C,S=r[v[u]],T=r[v[u+l]];T-S<=0?(p=v[u]*o+o*l+d,C=i[p],m[d][l].push(C/a(l))):(C=m[d][l-1][u+1]-m[d][l-1][u],m[d][l].push(C/(T-S))),b=b||0!==C}b||(y=l-1)}}for(c=0,h=0;c<=h;c++)for(l=c;l<=y;l++){var w=n(e,v,r,c,l,[]);for(d=0;d<o;d++){var A=m[d][l][0];s[d+c*o]+=A*w}}return s};var l=[];return s.interpolate=function(e,r,i,a,s,u,c){var d=a*(u+1);t(c)||(c=new Array(d));for(var h=0;h<d;h++)c[h]=0;var p,f=r.length,m=new Array(f*(s+1));for(p=0;p<f;p++)for(var g=0;g<s+1;g++)m[p*(s+1)+g]=p;for(var _=m.length,v=l,y=o(v,m,r,i,a,s),b=[],C=_*(_+1)/2,S=Math.min(y,u),T=0;T<=S;T++)for(p=T;p<=y;p++){b.length=0;for(var w=n(e,m,r,T,p,b),A=Math.floor(p*(1-p)/2)+_*p,E=0;E<a;E++){var x=Math.floor(E*C),P=v[x+A];c[E+T*a]+=P*w}}return c},s}),define("Core/IauOrientationParameters",[],function(){"use strict";function e(e,t,r,i){this.rightAscension=e,this.declination=t,this.rotation=r,this.rotationRate=i}return e}),define("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,r,i,n){"use strict";var o={},a=-.0529921,s=-.1059842,l=13.0120009,u=13.3407154,c=26.4057084,d=13.064993,h=1.7484877,p=new r;return o.ComputeMoon=function(o,f){e(o)||(o=r.now()),p=r.addSeconds(o,32.184,p);var m=r.totalDays(p)-2451545,g=m/n.DAYS_PER_JULIAN_CENTURY,_=(125.045+a*m)*i.RADIANS_PER_DEGREE,v=(250.089+s*m)*i.RADIANS_PER_DEGREE,y=(260.008+l*m)*i.RADIANS_PER_DEGREE,b=(176.625+u*m)*i.RADIANS_PER_DEGREE,C=(357.529+.9856003*m)*i.RADIANS_PER_DEGREE,S=(311.589+c*m)*i.RADIANS_PER_DEGREE,T=(134.963+d*m)*i.RADIANS_PER_DEGREE,w=(276.617+.3287146*m)*i.RADIANS_PER_DEGREE,A=(34.226+h*m)*i.RADIANS_PER_DEGREE,E=(15.134+-.1589763*m)*i.RADIANS_PER_DEGREE,x=(119.743+.0036096*m)*i.RADIANS_PER_DEGREE,P=(239.961+.1643573*m)*i.RADIANS_PER_DEGREE,I=(25.053+12.9590088*m)*i.RADIANS_PER_DEGREE,D=Math.sin(_),O=Math.sin(v),M=Math.sin(y),R=Math.sin(b),L=Math.sin(C),N=Math.sin(S),k=Math.sin(T),F=Math.sin(w),B=Math.sin(A),U=Math.sin(E),V=Math.sin(x),z=Math.sin(P),G=Math.sin(I),H=Math.cos(_),W=Math.cos(v),j=Math.cos(y),q=Math.cos(b),Y=Math.cos(C),X=Math.cos(S),Q=Math.cos(T),Z=Math.cos(w),K=Math.cos(A),J=Math.cos(E),$=Math.cos(x),ee=Math.cos(P),te=Math.cos(I),re=(269.9949+.0031*g-3.8787*D-.1204*O+.07*M-.0172*R+.0072*N-.0052*U+.0043*G)*i.RADIANS_PER_DEGREE,ie=(66.5392+.013*g+1.5419*H+.0239*W-.0278*j+.0068*q-.0029*X+9e-4*Q+8e-4*J-9e-4*te)*i.RADIANS_PER_DEGREE,ne=(38.3213+13.17635815*m-1.4e-12*m*m+3.561*D+.1208*O-.0642*M+.0158*R+.0252*L-.0066*N-.0047*k-.0046*F+.0028*B+.0052*U+.004*V+.0019*z-.0044*G)*i.RADIANS_PER_DEGREE,oe=(13.17635815-2*m*1.4e-12+3.561*H*a+.1208*W*s-.0642*j*l+.0158*q*u+.0252*Y*.9856003-.0066*X*c-.0047*Q*d-.0046*Z*.3287146+.0028*K*h+.0052*J*-.1589763+.004*$*.0036096+.0019*ee*.1643573-.0044*te*12.9590088)/86400*i.RADIANS_PER_DEGREE;return e(f)||(f=new t),f.rightAscension=re,f.declination=ie,f.rotation=ne,f.rotationRate=oe,f},o}),define("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,r,i,n,o,a){"use strict";function s(e){t(e)&&"function"==typeof e||(e=r.ComputeMoon),this._computeFunction=e}function l(r,i,a){var s=u;s.x=Math.cos(r+n.PI_OVER_TWO),s.y=Math.sin(r+n.PI_OVER_TWO),s.z=0;var l=Math.cos(i),h=d;h.x=l*Math.cos(r),h.y=l*Math.sin(r),h.z=Math.sin(i);var p=e.cross(h,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=p.x,a[2]=h.x,a[3]=s.y,a[4]=p.y,a[5]=h.y,a[6]=s.z,a[7]=p.z,a[8]=h.z,a}var u=new e,c=new e,d=new e,h=new o,p=new a;return s.prototype.evaluate=function(r,s){t(r)||(r=i.now());var u=this._computeFunction(r),c=l(u.rightAscension,u.declination,s),d=n.zeroToTwoPi(u.rotation),f=a.fromAxisAngle(e.UNIT_Z,d,p),m=o.fromQuaternion(a.conjugate(f,f),h);return o.multiply(m,c,c)},s}),define("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}),define("Core/TimeInterval",["./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./JulianDate"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.start=r(e.start)?o.clone(e.start):new o,this.stop=r(e.stop)?o.clone(e.stop):new o,this.data=e.data,this.isStartIncluded=t(e.isStartIncluded,!0),this.isStopIncluded=t(e.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(e,i){var n=e.iso8601.split("/"),l=o.fromIso8601(n[0]),u=o.fromIso8601(n[1]),c=t(e.isStartIncluded,!0),d=t(e.isStopIncluded,!0),h=e.data;return r(i)?(i.start=l,i.stop=u,i.isStartIncluded=c,i.isStopIncluded=d,i.data=h,i):(s.start=l,s.stop=u,s.isStartIncluded=c,s.isStopIncluded=d,s.data=h,new a(s))},a.toIso8601=function(e,t){return o.toIso8601(e.start,t)+"/"+o.toIso8601(e.stop,t)},a.clone=function(e,t){if(r(e))return r(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new a(e)},a.equals=function(e,t,i){return e===t||r(e)&&r(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&o.equals(e.start,t.start)&&o.equals(e.stop,t.stop)&&(e.data===t.data||r(i)&&i(e.data,t.data)))},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&o.equalsEpsilon(e.start,t.start,i)&&o.equalsEpsilon(e.stop,t.stop,i)&&(e.data===t.data||r(n)&&n(e.data,t.data)))},a.intersect=function(e,t,i,n){if(!r(t))return a.clone(a.EMPTY,i);var s=e.start,l=e.stop,u=t.start,c=t.stop,d=o.greaterThanOrEquals(u,s)&&o.greaterThanOrEquals(l,u),h=!d&&o.lessThanOrEquals(u,s)&&o.lessThanOrEquals(s,c);if(!d&&!h)return a.clone(a.EMPTY,i);var p=e.isStartIncluded,f=e.isStopIncluded,m=t.isStartIncluded,g=t.isStopIncluded,_=o.lessThan(l,c);return i.start=d?u:s,i.isStartIncluded=p&&m||!o.equals(u,s)&&(d&&m||h&&p),i.stop=_?l:c,i.isStopIncluded=_?f:f&&g||!o.equals(c,l)&&g,i.data=r(n)?n(e.data,t.data):e.data,i},a.contains=function(e,t){if(e.isEmpty)return!1;var r=o.compare(e.start,t);if(0===r)return e.isStartIncluded;var i=o.compare(t,e.stop);return 0===i?e.isStopIncluded:r<0&&i<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,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return a.toIso8601(this)},a.EMPTY=n(new a({start:new o,stop:new o,isStartIncluded:!1,isStopIncluded:!1})),a}),define("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,r){"use strict";var i=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z"));return{MINIMUM_VALUE:i,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:e(new r({start:i,stop:n}))}}),define("Core/KeyboardEventModifier",["./freezeObject"],function(e){"use strict";return e({SHIFT:0,CTRL:1,ALT:2})}),define("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,r,i,n,o){e(o)||(o=new Array(n));var a,s,l=r.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=r[a]-r[s];u*=(t-r[s])/c}for(s=0;s<n;s++)o[s]+=u*i[a*n+s]}return o},t}),define("Core/LinearApproximation",["./defined","./DeveloperError"],function(e,t){"use strict";var r={type:"Linear"};return r.getRequiredDataPoints=function(e){return 2},r.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l,u=r[0],c=r[1];for(a=0;a<n;a++)s=i[a],l=i[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},r}),define("Core/loadArrayBuffer",["./Check","./defined","./deprecationWarning","./Resource"],function(e,t,r,i){"use strict";function n(e,t,n){return r("loadArrayBuffer","loadArrayBuffer is deprecated and will be removed in Cesium 1.44. Please use Resource.fetchArrayBuffer instead."),i.createIfNeeded(e,{headers:t,request:n}).fetchArrayBuffer()}return n}),define("Core/loadBlob",["./Check","./defined","./deprecationWarning","./Resource"],function(e,t,r,i){"use strict";function n(e,t,n){return r("loadBlob","loadBlob is deprecated and will be removed in Cesium 1.44. Please use Resource.fetchBlob instead."),i.createIfNeeded(e,{headers:t,request:n}).fetchBlob()}return n});define("Core/loadCRN",["../ThirdParty/when","./CompressedTextureBuffer","./defined","./deprecationWarning","./DeveloperError","./Resource","./TaskProcessor"],function(e,t,r,i,n,o,a){"use strict";function s(n,a,s){r(a)&&i("loadCRN.headers","The headers parameter has been deprecated. Set the headers property on the Resource parameter."),r(s)&&i("loadCRN.request","The request parameter has been deprecated. Set the request property on the Resource parameter.");var u;if(n instanceof ArrayBuffer||ArrayBuffer.isView(n))u=e.resolve(n);else{u=o.createIfNeeded(n,{headers:a,request:s}).fetchArrayBuffer()}if(r(u))return u.then(function(e){if(r(e)){var t=[];return e instanceof ArrayBuffer?t.push(e):0===e.byteOffset&&e.byteLength===e.buffer.byteLength?t.push(e.buffer):(e=e.slice(0,e.length),t.push(e.buffer)),l.scheduleTask(e,t)}}).then(function(e){return t.clone(e)})}var l=new a("transcodeCRNToDXT",Number.POSITIVE_INFINITY);return s}),define("Core/loadImage",["./Check","./defined","./defineProperties","./deprecationWarning","./Resource"],function(e,t,r,i,n){"use strict";function o(e,t,r){return i("loadImage","loadImage is deprecated and will be removed in Cesium 1.44. Please use Resource.fetchImage instead."),n.createIfNeeded(e,{request:r}).fetchImage(!1,t)}return r(o,{createImage:{get:function(){return n._Implementations.createImage},set:function(e){n._Implementations.createImage=e}},defaultCreateImage:{get:function(){return n._DefaultImplementations.createImage}}}),o}),define("Core/loadImageFromTypedArray",["../ThirdParty/when","./Check","./Resource"],function(e,t,r){"use strict";function i(t,i,n){var o=new Blob([t],{type:i}),a=window.URL.createObjectURL(o);return new r({url:a,request:n}).fetchImage().then(function(e){return window.URL.revokeObjectURL(a),e},function(t){return window.URL.revokeObjectURL(a),e.reject(t)})}return i}),define("Core/loadImageViaBlob",["./Check","./defined","./deprecationWarning","./Resource"],function(e,t,r,i){"use strict";function n(e,t){return r("loadImageViaBlob","loadImageViaBlob is deprecated and will be removed in Cesium 1.44. Please use Resource.fetchImage instead."),i.createIfNeeded(e,{request:t}).fetchImage(!0)}return n}),define("Core/loadJson",["./clone","./defined","./deprecationWarning","./DeveloperError","./Resource"],function(e,t,r,i,n){"use strict";function o(e,t,i){return r("loadJson","loadJson is deprecated and will be removed in Cesium 1.44. Please use Resource.fetchJson instead."),n.createIfNeeded(e,{headers:t,request:i}).fetchJson()}return o}),define("Core/loadJsonp",["./clone","./defined","./defineProperties","./deprecationWarning","./DeveloperError","./Resource"],function(e,t,r,i,n,o){"use strict";function a(r,n,a){i("loadJsonp","loadJsonp is deprecated and will be removed in Cesium 1.44. Please use Resource.fetchJsonp instead.");var s,l;if("object"==typeof n){var u=n;t(u.parameters)&&(l=e(u.parameters)),t(u.proxy)&&(s=u.proxy),n=u.callbackParameterName}return o.createIfNeeded(r,{proxy:s,queryParameters:l,request:a}).fetchJsonp(n)}return r(a,{loadAndExecuteScript:{get:function(){return o._Implementations.loadAndExecuteScript},set:function(e){o._Implementations.loadAndExecuteScript=e}},defaultLoadAndExecuteScript:{get:function(){return o._DefaultImplementations.loadAndExecuteScript}}}),a}),define("Renderer/PixelDatatype",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={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,isPacked:function(e){return e===r.UNSIGNED_INT_24_8||e===r.UNSIGNED_SHORT_4_4_4_4||e===r.UNSIGNED_SHORT_5_5_5_1||e===r.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(e){switch(e){case r.UNSIGNED_BYTE:return 1;case r.UNSIGNED_SHORT:case r.UNSIGNED_SHORT_4_4_4_4:case r.UNSIGNED_SHORT_5_5_5_1:case r.UNSIGNED_SHORT_5_6_5:return 2;case r.UNSIGNED_INT:case r.FLOAT:case r.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT||e===r.FLOAT||e===r.UNSIGNED_INT_24_8||e===r.UNSIGNED_SHORT_4_4_4_4||e===r.UNSIGNED_SHORT_5_5_5_1||e===r.UNSIGNED_SHORT_5_6_5}};return e(r)}),define("Core/PixelFormat",["../Renderer/PixelDatatype","./freezeObject","./WebGLConstants"],function(e,t,r){"use strict";var i={DEPTH_COMPONENT:r.DEPTH_COMPONENT,DEPTH_STENCIL:r.DEPTH_STENCIL,ALPHA:r.ALPHA,RGB:r.RGB,RGBA:r.RGBA,LUMINANCE:r.LUMINANCE,LUMINANCE_ALPHA:r.LUMINANCE_ALPHA,RGB_DXT1:r.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:r.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:r.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:r.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:r.COMPRESSED_RGB_ETC1_WEBGL,componentsLength:function(e){switch(e){case i.RGB:case i.RGBA:return 4;case i.LUMINANCE_ALPHA:return 2;case i.ALPHA:case i.LUMINANCE:default:return 1}},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||e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5||e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1||e===i.RGB_ETC1},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},isCompressedFormat:function(e){return e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5||e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1||e===i.RGB_ETC1},isDXTFormat:function(e){return e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5},isPVRTCFormat:function(e){return e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===i.RGB_ETC1},compressedTextureSizeInBytes:function(e,t,r){switch(e){case i.RGB_DXT1:case i.RGBA_DXT1:case i.RGB_ETC1:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*8;case i.RGBA_DXT3:case i.RGBA_DXT5:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case i.RGB_PVRTC_4BPPV1:case i.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case i.RGB_PVRTC_2BPPV1:case i.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);default:return 0}},textureSizeInBytes:function(t,r,n,o){var a=i.componentsLength(t);return e.isPacked(r)&&(a=1),a*e.sizeInBytes(r)*n*o}};return t(i)}),define("Core/loadKTX",["../ThirdParty/when","./Check","./CompressedTextureBuffer","./defined","./deprecationWarning","./PixelFormat","./Resource","./RuntimeError"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,r,o){i(r)&&n("loadCRN.headers","The headers parameter has been deprecated. Set the headers property on the Resource parameter."),i(o)&&n("loadCRN.request","The request parameter has been deprecated. Set the request property on the Resource parameter.");var s;if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))s=e.resolve(t);else{s=a.createIfNeeded(t,{headers:r,request:o}).fetchArrayBuffer()}if(i(s))return s.then(function(e){if(i(e))return u(e)})}function u(e){for(var t=new Uint8Array(e),n=!0,a=0;a<c.length;++a)if(c[a]!==t[a]){n=!1;break}if(!n)throw new s("Invalid KTX file.");var l,u;i(e.buffer)?(l=new DataView(e.buffer),u=e.byteOffset):(l=new DataView(e),u=0),u+=12;var p=l.getUint32(u,!0);if(u+=h,p!==d)throw new s("File is the wrong endianness.");var f=l.getUint32(u,!0);u+=h;var m=l.getUint32(u,!0);u+=h;var g=l.getUint32(u,!0);u+=h;var _=l.getUint32(u,!0);u+=h;var v=l.getUint32(u,!0);u+=h;var y=l.getUint32(u,!0);u+=h;var b=l.getUint32(u,!0);u+=h;var C=l.getUint32(u,!0);u+=h;var S=l.getUint32(u,!0);u+=h;var T=l.getUint32(u,!0);u+=h;var w=l.getUint32(u,!0);u+=h;var A=l.getUint32(u,!0);u+=h,u+=A;var E=l.getUint32(u,!0);u+=h;var x;if(x=i(e.buffer)?new Uint8Array(e.buffer,u,E):new Uint8Array(e,u,E),32849===_?_=o.RGB:32856===_&&(_=o.RGBA),!o.validate(_))throw new s("glInternalFormat is not a valid format.");if(o.isCompressedFormat(_)){if(0!==f)throw new s("glType must be zero when the texture is compressed.");if(1!==m)throw new s("The type size for compressed textures must be 1.");if(0!==g)throw new s("glFormat must be zero when the texture is compressed.")}else if(v!==g)throw new s("The base internal format must be the same as the format for uncompressed textures.");if(0!==C)throw new s("3D textures are unsupported.");if(0!==S)throw new s("Texture arrays are unsupported.");if(1!==T)throw new s("Cubemaps are unsupported.");if(w>1){var P=o.isCompressedFormat(_)?o.compressedTextureSizeInBytes(_,y,b):o.textureSizeInBytes(_,y,b);x=new Uint8Array(x.buffer,x.byteOffset,P)}return new r(_,y,b,x)}var c=[171,75,84,88,32,49,49,187,13,10,26,10],d=67305985,h=4;return l}),define("Core/loadText",["./Check","./defined","./deprecationWarning","./Resource"],function(e,t,r,i){"use strict";function n(e,t,n){return r("loadText","loadText is deprecated and will be removed in Cesium 1.44. Please use Resource.fetchText instead."),i.createIfNeeded(e,{headers:t,request:n}).fetchText()}return n}),define("Core/loadWithXhr",["../ThirdParty/when","./Check","./defaultValue","./defineProperties","./deprecationWarning","./Resource"],function(e,t,r,i,n,o){"use strict";function a(e){
n("loadWithXhr","loadWithXhr is deprecated and will be removed in Cesium 1.44. Please use Resource.fetch instead.");var t=new o(e);return o._makeRequest(t,{responseType:e.responseType,overrideMimeType:e.overrideMimeType,method:r(e.method,"GET"),data:e.data})}return i(a,{load:{get:function(){return o._Implementations.loadWithXhr},set:function(e){o._Implementations.loadWithXhr=e}},defaultLoad:{get:function(){return o._DefaultImplementations.loadWithXhr}}}),a}),define("Core/loadXML",["./Check","./defined","./deprecationWarning","./Resource"],function(e,t,r,i){"use strict";function n(e,t,n){return r("loadXML","loadXML is deprecated and will be removed in Cesium 1.44. Please use Resource.fetchXML instead."),i.createIfNeeded(e,{headers:t,request:n}).fetchXML()}return n}),define("Core/ManagedArray",["./Check","./defaultValue","./defineProperties"],function(e,t,r){"use strict";function i(e){e=t(e,0),this._array=new Array(e),this._length=e}return r(i.prototype,{length:{get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},values:{get:function(){return this._array}}}),i.prototype.get=function(e){return this._array[e]},i.prototype.set=function(e,t){e>=this.length&&(this.length=e+1),this._array[e]=t},i.prototype.push=function(e){var t=this.length++;this._array[t]=e},i.prototype.pop=function(){return this._array[--this.length]},i.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)},i.prototype.resize=function(e){this.length=e},i.prototype.trim=function(e){e=t(e,this.length),this._array.length=e},i}),define("Core/MapboxApi",["./Credit","./defined"],function(e,t){"use strict";var r={};r.defaultAccessToken=void 0;var i,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 r.getAccessToken=function(e){return t(e)?e:t(r.defaultAccessToken)?r.defaultAccessToken:(n||(console.log(o),n=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6ImNpd204Zm4wejAwNzYyeW5uNjYyZmFwdWEifQ.7i-VIZZWX8pd1bTfxIVj9g")},r.getErrorCredit=function(n){if(!t(n)&&!t(r.defaultAccessToken))return t(i)||(i=new e({text:o,showOnScreen:!0})),i},r}),define("Core/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return e(r.prototype,{ellipsoid:{get:t.throwInstantiationError}}),r.prototype.project=t.throwInstantiationError,r.prototype.unproject=t.throwInstantiationError,r}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,r,i,n,o){"use strict";function a(e,t,i,n){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(t,0),this[3]=r(n,0)}a.packedLength=4,a.pack=function(e,t,i){return i=r(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t},a.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new a),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],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,t,n){return t=r(t,0),i(n)||(n=new a),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+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,r){var i=2*t,n=e[i],o=e[i+1];return r.x=n,r.y=o,r},a.setColumn=function(e,t,r,i){i=a.clone(e,i);var n=2*t;return i[n]=r.x,i[n+1]=r.y,i},a.getRow=function(e,t,r){var i=e[t],n=e[t+2];return r.x=i,r.y=n,r},a.setRow=function(e,t,r,i){return i=a.clone(e,i),i[t]=r.x,i[t+2]=r.y,i};var s=new e;a.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],s)),r.y=e.magnitude(e.fromElements(t[2],t[3],s)),r};var l=new e;return a.getMaximumScale=function(t){return a.getScale(t,l),e.maximumComponent(l)},a.multiply=function(e,t,r){var i=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 r[0]=i,r[1]=o,r[2]=n,r[3]=a,r},a.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r},a.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r},a.multiplyByVector=function(e,t,r){var i=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return r.x=i,r.y=n,r},a.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r},a.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.y,r[3]=e[3]*t.y,r},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 r=e[0],i=e[2],n=e[1],o=e[3];return t[0]=r,t[1]=i,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,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+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,n(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}),define("Core/mergeSort",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r,i,n,s){var l,u,c=n-i+1,d=s-n,h=o,p=a;for(l=0;l<c;++l)h[l]=e[i+l];for(u=0;u<d;++u)p[u]=e[n+u+1];l=0,u=0;for(var f=i;f<=s;++f){var m=h[l],g=p[u];l<c&&(u>=d||t(m,g,r)<=0)?(e[f]=m,++l):u<d&&(e[f]=g,++u)}}function i(e,t,n,o,a){if(!(o>=a)){var s=Math.floor(.5*(o+a));i(e,t,n,o,s),i(e,t,n,s+1,a),r(e,t,n,o,s,a)}}function n(e,t,r){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,i(e,t,r,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),define("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t,r,i,n){this.near=e(t,0),this.nearValue=e(r,0),this.far=e(i,1),this.farValue=e(n,0)}return i.clone=function(e,r){if(t(e))return t(r)?(r.near=e.near,r.nearValue=e.nearValue,r.far=e.far,r.farValue=e.farValue,r):new i(e.near,e.nearValue,e.far,e.farValue)},i.packedLength=4,i.pack=function(t,r,i){return i=e(i,0),r[i++]=t.near,r[i++]=t.nearValue,r[i++]=t.far,r[i]=t.farValue,r},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.near=r[n++],o.nearValue=r[n++],o.far=r[n++],o.farValue=r[n],o},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.nearValue===r.nearValue&&e.far===r.far&&e.farValue===r.farValue},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Visibility",["./freezeObject"],function(e){"use strict";return e({NONE:-1,PARTIAL:0,FULL:1})}),define("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r){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=r}var d=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 r,i,n,o=t.subtract(this._occluderPosition,e,d),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){r=Math.sqrt(a-s),a=1/Math.sqrt(a),i=t.multiplyByScalar(o,a,d);var l=r*r*a;n=t.add(e,t.multiplyByScalar(i,l,d),d)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=i,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,r,n){return i(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=r,n):new c(e,r)};var h=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var r=t.subtract(e,this._occluderPosition,h),i=this._occluderRadius;if((i=t.magnitudeSquared(r)-i*i)>0)return i=Math.sqrt(i)+this._horizonDistance,r=t.subtract(e,this._cameraPosition,r),i*i>t.magnitudeSquared(r)}return!1};var p=new t;c.prototype.isBoundingSphereVisible=function(e){var r=t.clone(e.center,p),i=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(r,this._occluderPosition,h),o=this._occluderRadius-i;if(o=t.magnitudeSquared(n)-o*o,i<this._occluderRadius)return o>0&&(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(r,this._cameraPosition,n),o*o+i*i>t.magnitudeSquared(n));if(o>0){n=t.subtract(r,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=i*i;return(this._horizonDistance*this._horizonDistance+s)*l>a*s||(o=Math.sqrt(o)+this._horizonDistance)*o+l>a}return!0}return!1};var f=new t;c.prototype.computeVisibility=function(e){var r=t.clone(e.center),i=e.radius;if(i>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(r,this._occluderPosition,f),o=this._occluderRadius-i,a=t.magnitudeSquared(n);if((o=a-o*o)>0){o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(r,this._cameraPosition,n);var s=t.magnitudeSquared(n);return o*o+i*i<s?u.NONE:(o=this._occluderRadius+i,(o=a-o*o)>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+i*i?u.FULL:u.PARTIAL):(n=t.subtract(r,this._horizonPlanePosition,n),t.dot(n,this._horizonPlaneNormal)>-i?u.PARTIAL:u.FULL))}}return u.NONE};var m=new t;c.computeOccludeePoint=function(e,r,i){var n=t.clone(r),o=t.clone(e.center),a=e.radius,s=i.length,l=t.normalize(t.subtract(n,o,m),m),u=-t.dot(l,o),d=c._anyRotationVector(o,l,u),h=c._horizonToPlaneNormalDotProduct(e,l,u,d,i[0]);if(h){for(var p,f=1;f<s;++f){if(!(p=c._horizonToPlaneNormalDotProduct(e,l,u,d,i[f])))return;p<h&&(h=p)}if(!(h<.0017453283658983088)){var g=a/h;return t.add(o,t.multiplyByScalar(l,g,m),m)}}};var g=[];c.computeOccludeePointFromRectangle=function(i,n){n=r(n,a.WGS84);var o=l.subsample(i,n,0,g),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 _=new t;c._anyRotationVector=function(e,r,i){var n=t.abs(r,_),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(r,n)+i)/-t.dot(r,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,r,i,n,o){var a=t.subtract(n,e,v);if(a=t.normalize(a,a),t.dot(r,a)<.9999999847691291){var l=t.cross(r,a,a);if(t.magnitude(l)>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,b=new t,C=new t,S=new t;return c._horizonToPlaneNormalDotProduct=function(e,r,i,n,o){var a=t.clone(o,y),s=t.clone(e.center,b),l=e.radius,u=t.subtract(s,a,C),c=t.magnitudeSquared(u),d=l*l;if(c<d)return!1;var h=c-d,p=Math.sqrt(h),f=Math.sqrt(c),m=1/f,g=p*m,_=g*p;u=t.normalize(u,u);var v=t.add(a,t.multiplyByScalar(u,_,S),S),T=Math.sqrt(h-_*_),w=this._rotationVector(s,r,i,a,n),A=t.fromElements(w.x*w.x*u.x+(w.x*w.y-w.z)*u.y+(w.x*w.z+w.y)*u.z,(w.x*w.y+w.z)*u.x+w.y*w.y*u.y+(w.y*w.z-w.x)*u.z,(w.x*w.z-w.y)*u.x+(w.y*w.z+w.x)*u.y+w.z*w.z*u.z,y);A=t.normalize(A,A);var E=t.multiplyByScalar(A,T,y);w=t.normalize(t.subtract(t.add(v,E,C),s,C),C);var x=t.dot(r,w);w=t.normalize(t.subtract(t.subtract(v,E,w),s,w),w);var P=t.dot(r,w);return x<P?x:P},c}),define("Core/Packable",["./DeveloperError"],function(e){"use strict";return{packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError}}),define("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";return{packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError}}),define("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)};return function(t,r,i,n){var o=t.measureText(r),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(r);o.fontsize=s;var d=document.createElement("div");d.style.position="absolute",d.style.opacity=0,d.style.font=l+" "+u+" "+s+"px "+a,d.innerHTML=r+"<br/>"+r,document.body.appendChild(d),o.leading=1.2*s;var h=e(d,"height");if(h=h.replace("px",""),h>=2*s&&(o.leading=h/2|0),document.body.removeChild(d),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");p.width=o.width+100,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 m=p.width,g=p.height,_=g/2;f.fillStyle="white",f.fillRect(-1,-1,m+2,g+2),i&&(f.strokeStyle="black",f.lineWidth=t.lineWidth,f.strokeText(r,50,_)),n&&(f.fillStyle="black",f.fillText(r,50,_));for(var v=f.getImageData(0,0,m,g).data,y=0,b=4*m,C=v.length;++y<C&&255===v[y];);var S=y/b|0;for(y=C-1;--y>0&&255===v[y];);var T=y/b|0;for(y=0;y<C&&255===v[y];)(y+=b)>=C&&(y=y-C+4);var w=y%b/4|0,A=1;for(y=C-3;y>=0&&255===v[y];)(y-=b)<0&&(y=C-3-4*A++);var E=y%b/4+1|0;o.ascent=_-S,o.descent=T-_,o.bounds={minx:w-50,maxx:E-50,miny:0,maxy:T-S},o.height=T-S+1}return o}}),define("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i,n){"use strict";function o(n,o){if(""!==n){o=r(o,r.EMPTY_OBJECT);var s=r(o.font,"10px sans-serif"),l=r(o.stroke,!1),u=r(o.fill,!0),c=r(o.strokeWidth,1),d=r(o.backgroundColor,t.TRANSPARENT),h=r(o.padding,0),p=2*h,f=document.createElement("canvas");f.width=1,f.height=1,f.style.font=s;var m=f.getContext("2d");i(a)||(i(m.imageSmoothingEnabled)?a="imageSmoothingEnabled":i(m.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":i(m.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":i(m.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),m.font=s,m.lineJoin="round",m.lineWidth=c,m[a]=!1,m.textBaseline=r(o.textBaseline,"bottom"),f.style.visibility="hidden",document.body.appendChild(f);var g=e(m,n,l,u);f.dimensions=g,document.body.removeChild(f),f.style.visibility="";var _=-g.bounds.minx,v=Math.ceil(g.width)+_+p,y=g.height+p,b=y-g.ascent+p,C=y-b+p;if(f.width=v,f.height=y,m.font=s,m.lineJoin="round",m.lineWidth=c,m[a]=!1,d!==t.TRANSPARENT&&(m.fillStyle=d.toCssColorString(),m.fillRect(0,0,f.width,f.height)),l){var S=r(o.strokeColor,t.BLACK);m.strokeStyle=S.toCssColorString(),m.strokeText(n,_+h,C)}if(u){var T=r(o.fillColor,t.WHITE);m.fillStyle=T.toCssColorString(),m.fillText(n,_+h,C)}return f}}var a;return o}),define("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./Resource","./writeTextToCanvas"],function(e,t,r,i,n,o){"use strict";function a(){this._cache={}}function s(e,t,r){e.save(),e.scale(r/24,r/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,r,i){var n=i/2.5,o=n,a=n;r.width>r.height?a=n*(r.height/r.width):r.width<r.height&&(o=n*(r.width/r.height));var s=Math.round((i-o)/2),l=Math.round(7/24*i-a/2);e.globalCompositeOperation="destination-out",e.drawImage(r,s-1,l,o,a),e.drawImage(r,s,l-1,o,a),e.drawImage(r,s+1,l,o,a),e.drawImage(r,s,l+1,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.BLACK.toCssColorString(),e.fillRect(s-1,l-1,o+2,a+2),e.globalCompositeOperation="destination-out",e.drawImage(r,s,l,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.WHITE.toCssColorString(),e.fillRect(s-1,l-2,o+2,a+2)}function u(e,t,i,a,u){d[0]=e,d[1]=t,d[2]=i,d[3]=a;var c=JSON.stringify(d),h=u[c];if(r(h))return h;var p=document.createElement("canvas");p.width=a,p.height=a;var f=p.getContext("2d");if(s(f,i,a),r(e)){var m=n.createIfNeeded(e),g=m.fetchImage().then(function(e){return l(f,e,a),u[c]=p,p});return u[c]=g,g}if(r(t)){var _=o(t,{font:"bold "+a+"px sans-serif"});l(f,_,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,r){return u(e,void 0,t,r,this._cache)},a.prototype.fromMakiIconId=function(t,r,i){return u(e("Assets/Textures/maki/"+encodeURIComponent(t)+".png"),void 0,r,i,this._cache)},a.prototype.fromText=function(e,t,r){return u(void 0,e,t,r,this._cache)};var c=new t,d=new Array(4);return a}),define("Core/PlaneGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.vertexFormat,c.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}d.packedLength=c.packedLength,d.pack=function(e,t,r){return r=n(r,0),c.pack(e._vertexFormat,t,r),t};var h=new c,p={vertexFormat:h};d.unpack=function(e,t,r){t=n(t,0);var i=c.unpack(e,t,h);return o(r)?(r._vertexFormat=c.clone(i,r._vertexFormat),r):new d(p)};var f=new t(-.5,-.5,0),m=new t(.5,.5,0);return d.createGeometry=function(r){var n,o,c=r._vertexFormat,d=new l;if(c.position){if(o=new Float64Array(12),o[0]=f.x,o[1]=f.y,o[2]=0,o[3]=m.x,o[4]=f.y,o[5]=0,o[6]=m.x,o[7]=m.y,o[8]=0,o[9]=f.x,o[10]=m.y,o[11]=0,d.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o}),c.normal){var h=new Float32Array(12);h[0]=0,h[1]=0,h[2]=1,h[3]=0,h[4]=0,h[5]=1,h[6]=0,h[7]=0,h[8]=1,h[9]=0,h[10]=0,h[11]=1,d.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:h})}if(c.st){var p=new Float32Array(8);p[0]=0,p[1]=0,p[2]=1,p[3]=0,p[4]=1,p[5]=1,p[6]=0,p[7]=1,d.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:p})}if(c.tangent){var g=new Float32Array(12);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,d.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(c.bitangent){var _=new Float32Array(12);_[0]=0,_[1]=1,_[2]=0,_[3]=0,_[4]=1,_[5]=0,_[6]=0,_[7]=1,_[8]=0,_[9]=0,_[10]=1,_[11]=0,d.bitangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:_})}n=new Uint16Array(6),n[0]=0,n[1]=1,n[2]=2,n[3]=0,n[4]=2,n[5]=3}return new a({attributes:d,indices:n,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,Math.sqrt(2))})},d}),define("Core/PlaneOutlineGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(){this._workerName="createPlaneOutlineGeometry"}c.packedLength=0,c.pack=function(e,t){return t},c.unpack=function(e,t,r){return o(r)?r:new c};var d=new t(-.5,-.5,0),h=new t(.5,.5,0);return c.createGeometry=function(){var r=new l,n=new Uint16Array(8),o=new Float64Array(12);return o[0]=d.x,o[1]=d.y,o[2]=d.z,o[3]=h.x,o[4]=d.y,o[5]=d.z,o[6]=h.x,o[7]=h.y,o[8]=d.z,o[9]=d.x,o[10]=h.y,o[11]=d.z,r.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:o}),n[0]=0,n[1]=1,n[2]=1,n[3]=2,n[4]=2,n[5]=3,n[6]=3,n[7]=0,new a({attributes:r,indices:n,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,Math.sqrt(2))})},c}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function r(t,r,n,o){return e(t,r,n,o,i),i.x>0&&i.y>0&&i.z>0}var i=new t;return r}),define("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,r=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--,r}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return-1!==this._array.indexOf(e)},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}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e,r,i,n){return t.subtract(r,e,v),t.multiplyByScalar(v,i/n,v),t.add(e,v,v),[v.x,v.y,v.z]}var _={};_.computeHierarchyPackedLength=function(e){for(var r=0,i=[e];i.length>0;){var o=i.pop();if(n(o)){r+=2;var a=o.positions,s=o.holes;if(n(a)&&(r+=a.length*t.packedLength),n(s))for(var l=s.length,u=0;u<l;++u)i.push(s[u])}}return r},_.packPolygonHierarchy=function(e,r,i){for(var o=[e];o.length>0;){var a=o.pop();if(n(a)){var s=a.positions,l=a.holes;if(r[i++]=n(s)?s.length:0,r[i++]=n(l)?l.length:0,n(s))for(var u=s.length,c=0;c<u;++c,i+=3)t.pack(s[c],r,i);if(n(l))for(var d=l.length,h=0;h<d;++h)o.push(l[h])}}return i},_.unpackPolygonHierarchy=function(e,r){for(var i=e[r++],n=e[r++],o=new Array(i),a=n>0?new Array(n):void 0,s=0;s<i;++s,r+=t.packedLength)o[s]=t.unpack(e,r);for(var l=0;l<n;++l)a[l]=_.unpackPolygonHierarchy(e,r),r=a[l].startingIndex,delete a[l].startingIndex;return{positions:o,holes:a,startingIndex:r}};var v=new t;_.subdivideLineCount=function(e,r,i){var n=t.distance(e,r),o=n/i,a=Math.max(0,Math.ceil(Math.log(o)/Math.log(2)));return Math.pow(2,a)},_.subdivideLine=function(e,r,i,o){var a=_.subdivideLineCount(e,r,i),s=t.distance(e,r),l=s/a;n(o)||(o=[]);var u=o;u.length=3*a;for(var c=0,d=0;d<a;d++){var h=g(e,r,d*l,s);u[c++]=h[0],u[c++]=h[1],u[c++]=h[2]}return u};var y=new t,b=new t,C=new t,S=new t;_.scaleToGeodeticHeightExtruded=function(e,r,a,s,l){s=i(s,o.WGS84);var u=y,c=b,d=C,h=S;if(n(e)&&n(e.attributes)&&n(e.attributes.position))for(var p=e.attributes.position.values,f=p.length/2,m=0;m<f;m+=3)t.fromArray(p,m,d),s.geodeticSurfaceNormal(d,u),h=s.scaleToGeodeticSurface(d,h),c=t.multiplyByScalar(u,a,c),c=t.add(h,c,c),p[m+f]=c.x,p[m+1+f]=c.y,p[m+2+f]=c.z,l&&(h=t.clone(d,h)),c=t.multiplyByScalar(u,r,c),c=t.add(h,c,c),p[m]=c.x,p[m+1]=c.y,p[m+2]=c.z;return e},_.polygonsFromHierarchy=function(r,i,o,a){var s=[],l=[],u=new f;for(u.enqueue(r);0!==u.length;){var c=u.dequeue(),d=c.positions,p=c.holes;if(d=e(d,t.equalsEpsilon,!0),!(d.length<3)){var g=o.projectPointsOntoPlane(d),_=[],v=h.computeWindingOrder2D(g);v===m.CLOCKWISE&&(g.reverse(),d=d.slice().reverse());var y,b,C=d.slice(),S=n(p)?p.length:0,T=[];for(y=0;y<S;y++){var w=p[y],A=e(w.positions,t.equalsEpsilon,!0);if(!(A.length<3)){var E=o.projectPointsOntoPlane(A);v=h.computeWindingOrder2D(E),v===m.CLOCKWISE&&(E.reverse(),A=A.slice().reverse()),T.push(A),_.push(C.length),C=C.concat(A),g=g.concat(E);var x=0;for(n(w.holes)&&(x=w.holes.length),b=0;b<x;b++)u.enqueue(w.holes[b])}}if(!i){for(y=0;y<d.length;y++)a.scaleToGeodeticSurface(d[y],d[y]);for(y=0;y<T.length;y++){var P=T[y];for(b=0;b<P.length;++b)a.scaleToGeodeticSurface(P[b],P[b])}}s.push({outerRing:d,holes:T}),l.push({positions:C,positions2D:g,holes:_})}}return{hierarchy:s,polygons:l}},_.createGeometryFromPositions=function(e,t,i,n,o){var l=h.triangulate(t.positions2D,t.holes);l.length<3&&(l=[0,1,2]);var c=t.positions;if(n){for(var d=c.length,f=new Array(3*d),m=0,g=0;g<d;g++){var _=c[g];f[m++]=_.x,f[m++]=_.y,f[m++]=_.z}var v=new a({attributes:{position:new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:f})},indices:l,primitiveType:p.TRIANGLES});return o.normal?u.computeNormal(v):v}return h.computeSubdivision(e,c,l,i)};var T=[],w=new t,A=new t;return _.computeWallGeometry=function(e,i,n,o){var u,h,f,m,g,v=e.length,y=0;if(o)for(h=3*v*2,u=new Array(2*h),f=0;f<v;f++)m=e[f],g=e[(f+1)%v],u[y]=u[y+h]=m.x,++y,u[y]=u[y+h]=m.y,++y,u[y]=u[y+h]=m.z,++y,u[y]=u[y+h]=g.x,++y,u[y]=u[y+h]=g.y,++y,u[y]=u[y+h]=g.z,++y;else{var b=d.chordLength(n,i.maximumRadius),C=0;for(f=0;f<v;f++)C+=_.subdivideLineCount(e[f],e[(f+1)%v],b);for(h=3*(C+v),u=new Array(2*h),f=0;f<v;f++){m=e[f],g=e[(f+1)%v];for(var S=_.subdivideLine(m,g,b,T),E=S.length,x=0;x<E;++x,++y)u[y]=S[x],u[y+h]=S[x];u[y]=g.x,u[y+h]=g.x,++y,u[y]=g.y,u[y+h]=g.y,++y,u[y]=g.z,u[y+h]=g.z,++y}}v=u.length;var P=c.createTypedArray(v/3,v-6*e.length),I=0;for(v/=6,f=0;f<v;f++){var D=f,O=D+1,M=D+v,R=M+1;m=t.fromArray(u,3*D,w),g=t.fromArray(u,3*O,A),t.equalsEpsilon(m,g,d.EPSILON14)||(P[I++]=D,P[I++]=M,P[I++]=O,P[I++]=O,P[I++]=M,P[I++]=R)}return new a({attributes:new l({position:new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:u})}),indices:P,primitiveType:p.TRIANGLES})},_}),define("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./Rectangle","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A){"use strict";function E(e,t,r,n){for(var o=S.fromAxisAngle(e._plane.normal,r,R),a=y.fromQuaternion(o,L),s=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=t.length,p=0;p<h;++p){var f=i.clone(t[p],M);y.multiplyByVector(a,f,f);var m=e.projectPointOntoPlane(f,O);l(m)&&(s=Math.min(s,m.x),u=Math.max(u,m.x),c=Math.min(c,m.y),d=Math.max(d,m.y))}return n.x=s,n.y=c,n.width=u-s,n.height=d-c,n}function x(e,t,r,i){var n=i.cartesianToCartographic(e,N),o=n.height,a=i.cartesianToCartographic(t,k);a.height=o,i.cartographicToCartesian(a,t);var s=i.cartesianToCartographic(r,k);s.height=o-100,i.cartographicToCartesian(s,r)}function P(e){var t=e.vertexFormat,n=e.geometry,o=e.shadowVolume;if(t.st||t.normal||t.tangent||t.bitangent||o){var s=e.boundingRectangle,l=e.tangentPlane,u=e.ellipsoid,c=e.stRotation,d=e.wall,h=e.top||d,p=e.bottom||d,m=e.perPositionHeight,g=Y;g.x=s.x,g.y=s.y;var _,b=n.attributes.position.values,C=b.length,T=t.st?new Float32Array(C/3*2):void 0;t.normal&&(_=m&&h&&!d?n.attributes.normal.values:new Float32Array(C));var w=t.tangent?new Float32Array(C):void 0,A=t.bitangent?new Float32Array(C):void 0,E=o?new Float32Array(C):void 0,P=0,I=0,D=U,O=V,M=z,R=!0,L=S.fromAxisAngle(l._plane.normal,c,Z),N=y.fromQuaternion(L,K),k=0,F=0;h&&p&&(k=C/2,F=C/3,C/=2);for(var J=0;J<C;J+=3){var $=i.fromArray(b,J,Q);if(t.st){var ee=y.multiplyByVector(N,$,B);ee=u.scaleToGeodeticSurface(ee,ee);var te=l.projectPointOntoPlane(ee,X);r.subtract(te,g,te);var re=v.clamp(te.x/s.width,0,1),ie=v.clamp(te.y/s.height,0,1);p&&(T[P+F]=re,T[P+1+F]=ie),h&&(T[P]=re,T[P+1]=ie),P+=2}if(t.normal||t.tangent||t.bitangent||o){var ne=I+1,oe=I+2;if(d){if(J+3<C){var ae=i.fromArray(b,J+3,G);if(R){var se=i.fromArray(b,J+C,H);m&&x($,ae,se,u),i.subtract(ae,$,ae),i.subtract(se,$,se),D=i.normalize(i.cross(se,ae,D),D),R=!1}i.equalsEpsilon(ae,$,v.EPSILON10)&&(R=!0)}(t.tangent||t.bitangent)&&(M=u.geodeticSurfaceNormal($,M),t.tangent&&(O=i.normalize(i.cross(M,D,O),O)))}else D=u.geodeticSurfaceNormal($,D),(t.tangent||t.bitangent)&&(m&&(W=i.fromArray(_,I,W),j=i.cross(i.UNIT_Z,W,j),j=i.normalize(y.multiplyByVector(N,j,j),j),t.bitangent&&(q=i.normalize(i.cross(W,j,q),q))),O=i.cross(i.UNIT_Z,D,O),O=i.normalize(y.multiplyByVector(N,O,O),O),t.bitangent&&(M=i.normalize(i.cross(D,O,M),M)));t.normal&&(e.wall?(_[I+k]=D.x,_[ne+k]=D.y,_[oe+k]=D.z):p&&(_[I+k]=-D.x,_[ne+k]=-D.y,_[oe+k]=-D.z),(h&&!m||d)&&(_[I]=D.x,_[ne]=D.y,_[oe]=D.z)),o&&(d&&(D=u.geodeticSurfaceNormal($,D)),E[I+k]=-D.x,E[ne+k]=-D.y,E[oe+k]=-D.z),t.tangent&&(e.wall?(w[I+k]=O.x,w[ne+k]=O.y,w[oe+k]=O.z):p&&(w[I+k]=-O.x,w[ne+k]=-O.y,w[oe+k]=-O.z),h&&(m?(w[I]=j.x,w[ne]=j.y,w[oe]=j.z):(w[I]=O.x,w[ne]=O.y,w[oe]=O.z))),t.bitangent&&(p&&(A[I+k]=M.x,A[ne+k]=M.y,A[oe+k]=M.z),h&&(m?(A[I]=q.x,A[ne]=q.y,A[oe]=q.z):(A[I]=M.x,A[ne]=M.y,A[oe]=M.z))),I+=3}}t.st&&(n.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:T})),t.normal&&(n.attributes.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:_})),t.tangent&&(n.attributes.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:w})),t.bitangent&&(n.attributes.bitangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:A})),o&&(n.attributes.extrudeDirection=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:E}))}return n}function I(e,t,r,i,n,o,a,s){var l,u={walls:[]};if(o||a){var c,d,p=b.createGeometryFromPositions(e,t,r,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 y=g.length,S=c/2;for(l=0;l<y;l+=3){var T=d[l]+S,w=d[l+1]+S,E=d[l+2]+S;d[l+y]=E,d[l+1+y]=w,d[l+2+y]=T}if(p.attributes.position.values=v,n){var x=p.attributes.normal.values;p.attributes.normal.values=new Float32Array(v.length),p.attributes.normal.values.set(x)}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=i.outerRing,I=h.fromPoints(P,e),D=I.projectPointsOntoPlane(P,J),O=C.computeWindingOrder2D(D);O===A.CLOCKWISE&&(P=P.slice().reverse());var M=b.computeWallGeometry(P,e,r,n);u.walls.push(new m({geometry:M}));var R=i.holes;for(l=0;l<R.length;l++){var L=R[l];I=h.fromPoints(L,e),D=I.projectPointsOntoPlane(L,J),O=C.computeWindingOrder2D(D),O===A.COUNTER_CLOCKWISE&&(L=L.slice().reverse()),M=b.computeWallGeometry(L,e,r),u.walls.push(new m({geometry:M}))}return u}function D(e){var t=e.polygonHierarchy,r=s(e.vertexFormat,w.DEFAULT),i=s(e.ellipsoid,d.WGS84),n=s(e.granularity,v.RADIANS_PER_DEGREE),o=s(e.stRotation,0),a=s(e.height,0),u=s(e.perPositionHeight,!1),c=e.extrudedHeight,h=l(c);if(!u&&h)if(v.equalsEpsilon(a,c,v.EPSILON10))c=void 0,h=!1;else{var p=c;c=Math.min(p,a),a=Math.max(p,a)}this._vertexFormat=w.clone(r),this._ellipsoid=d.clone(i),this._granularity=n,this._stRotation=o,this._height=a,this._extrudedHeight=s(c,0),this._extrude=h,
this._closeTop=s(e.closeTop,!0),this._closeBottom=s(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=u,this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createPolygonGeometry";var f=t.positions;!l(f)||f.length<3?this._rectangle=new T:this._rectangle=T.fromCartesianArray(f,i),this.packedLength=b.computeHierarchyPackedLength(t)+d.packedLength+w.packedLength+T.packedLength+10}var O=new r,M=new i,R=new S,L=new y,N=new n,k=new n,F=new e,B=new i,U=new i,V=new i,z=new i,G=new i,H=new i,W=new i,j=new i,q=new i,Y=new r,X=new r,Q=new i,Z=new S,K=new y,J=[];D.fromPositions=function(e){return e=s(e,s.EMPTY_OBJECT),new D({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})},D.pack=function(e,t,r){return r=s(r,0),r=b.packPolygonHierarchy(e._polygonHierarchy,t,r),d.pack(e._ellipsoid,t,r),r+=d.packedLength,w.pack(e._vertexFormat,t,r),r+=w.packedLength,T.pack(e._rectangle,t,r),r+=T.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._stRotation,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._closeTop?1:0,t[r++]=e._closeBottom?1:0,t[r++]=e._shadowVolume?1:0,t[r]=e.packedLength,t};var $=d.clone(d.UNIT_SPHERE),ee=new w,te=new T,re={polygonHierarchy:{}};return D.unpack=function(e,t,r){t=s(t,0);var i=b.unpackPolygonHierarchy(e,t);t=i.startingIndex,delete i.startingIndex;var n=d.unpack(e,t,$);t+=d.packedLength;var o=w.unpack(e,t,ee);t+=w.packedLength;var a=T.unpack(e,t,te);t+=T.packedLength;var u=e[t++],c=e[t++],h=e[t++],p=e[t++],f=1===e[t++],m=1===e[t++],g=1===e[t++],_=1===e[t++],v=1===e[t++],y=e[t];return l(r)||(r=new D(re)),r._polygonHierarchy=i,r._ellipsoid=d.clone(n,r._ellipsoid),r._vertexFormat=w.clone(o,r._vertexFormat),r._height=u,r._extrudedHeight=c,r._granularity=h,r._stRotation=p,r._extrude=f,r._perPositionHeight=m,r._closeTop=g,r._closeBottom=_,r._rectangle=T.clone(a),r._shadowVolume=v,r.packedLength=y,r},D.createGeometry=function(e){var r=e._vertexFormat,i=e._ellipsoid,n=e._granularity,o=e._stRotation,a=e._height,s=e._extrudedHeight,l=e._extrude,u=e._polygonHierarchy,c=e._perPositionHeight,d=e._closeTop,f=e._closeBottom,v=u.positions;if(!(v.length<3)){var y=h.fromPoints(v,i),S=b.polygonsFromHierarchy(u,c,y,i),T=S.hierarchy,w=S.polygons;if(0!==T.length){v=T[0].outerRing;var A,x,D=E(y,v,o,F),O=[],M={perPositionHeight:c,vertexFormat:r,geometry:void 0,tangentPlane:y,boundingRectangle:D,ellipsoid:i,stRotation:o,bottom:!1,top:!0,wall:!1};if(l)for(M.top=d,M.bottom=f,M.shadowVolume=e._shadowVolume,x=0;x<w.length;x++){A=I(i,w[x],n,T[x],c,d,f,r);var R;d&&f?(R=A.topAndBottom,M.geometry=b.scaleToGeodeticHeightExtruded(R.geometry,a,s,i,c)):d?(R=A.topAndBottom,R.geometry.attributes.position.values=C.scaleToGeodeticHeight(R.geometry.attributes.position.values,a,i,!c),M.geometry=R.geometry):f&&(R=A.topAndBottom,R.geometry.attributes.position.values=C.scaleToGeodeticHeight(R.geometry.attributes.position.values,s,i,!0),M.geometry=R.geometry),(d||f)&&(M.wall=!1,R.geometry=P(M),O.push(R));var L=A.walls;M.wall=!0;for(var N=0;N<L.length;N++){var k=L[N];M.geometry=b.scaleToGeodeticHeightExtruded(k.geometry,a,s,i,c),k.geometry=P(M),O.push(k)}}else for(x=0;x<w.length;x++)A=new m({geometry:b.createGeometryFromPositions(i,w[x],n,c,r)}),A.geometry.attributes.position.values=C.scaleToGeodeticHeight(A.geometry.attributes.position.values,a,i,!c),M.geometry=A.geometry,A.geometry=P(M),O.push(A);A=g.combineInstances(O)[0],A.attributes.position.values=new Float64Array(A.attributes.position.values),A.indices=_.createTypedArray(A.attributes.position.values.length/3,A.indices);var B=A.attributes,U=t.fromVertices(B.position.values);return r.position||delete B.position,new p({attributes:B,indices:A.indices,primitiveType:A.primitiveType,boundingSphere:U})}}},D.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new D({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:w.POSITION_ONLY,shadowVolume:!0})},u(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),define("Core/PolygonHierarchy",["./defined"],function(e){"use strict";function t(t,r){this.positions=e(t)?t:[],this.holes=e(r)?r:[]}return t}),define("Core/PolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C){"use strict";function S(e,t,r,i){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,A);v.computeWindingOrder2D(a)===C.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var s,l,f=t.length,g=0;if(i)for(s=new Float64Array(2*f*3),l=0;l<f;l++){var b=t[l],S=t[(l+1)%f];s[g++]=b.x,s[g++]=b.y,s[g++]=b.z,s[g++]=S.x,s[g++]=S.y,s[g++]=S.z}else{var T=0;for(l=0;l<f;l++)T+=_.subdivideLineCount(t[l],t[(l+1)%f],r);for(s=new Float64Array(3*T),l=0;l<f;l++)for(var w=_.subdivideLine(t[l],t[(l+1)%f],r,E),x=w.length,P=0;P<x;++P)s[g++]=w[P]}f=s.length/3;var I=2*f,D=m.createTypedArray(f,I);for(g=0,l=0;l<f-1;l++)D[g++]=l,D[g++]=l+1;return D[g++]=f-1,D[g++]=0,new p({geometry:new c({attributes:new h({position:new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:s})}),indices:D,primitiveType:y.LINES})})}function T(e,t,r,i){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,A);v.computeWindingOrder2D(a)===C.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var s,l,f=t.length,g=new Array(f),b=0;if(i)for(s=new Float64Array(2*f*3*2),l=0;l<f;++l){g[l]=b/3;var S=t[l],T=t[(l+1)%f];s[b++]=S.x,s[b++]=S.y,s[b++]=S.z,s[b++]=T.x,s[b++]=T.y,s[b++]=T.z}else{var w=0;for(l=0;l<f;l++)w+=_.subdivideLineCount(t[l],t[(l+1)%f],r);for(s=new Float64Array(3*w*2),l=0;l<f;++l){g[l]=b/3;for(var x=_.subdivideLine(t[l],t[(l+1)%f],r,E),P=x.length,I=0;I<P;++I)s[b++]=x[I]}}f=s.length/6;var D=g.length,O=2*(2*f+D),M=m.createTypedArray(f,O);for(b=0,l=0;l<f;++l)M[b++]=l,M[b++]=(l+1)%f,M[b++]=l+f,M[b++]=(l+1)%f+f;for(l=0;l<D;l++){var R=g[l];M[b++]=R,M[b++]=R+f}return new p({geometry:new c({attributes:new h({position:new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:s})}),indices:M,primitiveType:y.LINES})})}function w(e){var t=e.polygonHierarchy,r=o(e.ellipsoid,l.WGS84),i=o(e.granularity,g.RADIANS_PER_DEGREE),n=o(e.height,0),s=o(e.perPositionHeight,!1),u=e.extrudedHeight,c=a(u);if(c&&!s){var d=u;u=Math.min(d,n),n=Math.max(d,n)}this._ellipsoid=l.clone(r),this._granularity=i,this._height=n,this._extrudedHeight=o(u,0),this._extrude=c,this._polygonHierarchy=t,this._perPositionHeight=s,this._workerName="createPolygonOutlineGeometry",this.packedLength=_.computeHierarchyPackedLength(t)+l.packedLength+6}var A=[],E=[];w.pack=function(e,t,r){return r=o(r,0),r=_.packPolygonHierarchy(e._polygonHierarchy,t,r),l.pack(e._ellipsoid,t,r),r+=l.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e.packedLength,t};var x=l.clone(l.UNIT_SPHERE),P={polygonHierarchy:{}};return w.unpack=function(e,t,r){t=o(t,0);var i=_.unpackPolygonHierarchy(e,t);t=i.startingIndex,delete i.startingIndex;var n=l.unpack(e,t,x);t+=l.packedLength;var s=e[t++],u=e[t++],c=e[t++],d=1===e[t++],h=1===e[t++],p=e[t++];return a(r)||(r=new w(P)),r._polygonHierarchy=i,r._ellipsoid=l.clone(n,r._ellipsoid),r._height=s,r._extrudedHeight=u,r._granularity=c,r._extrude=d,r._perPositionHeight=h,r.packedLength=p,r},w.fromPositions=function(e){return e=o(e,o.EMPTY_OBJECT),new w({polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight})},w.createGeometry=function(i){var n=i._ellipsoid,o=i._granularity,s=i._height,l=i._extrudedHeight,u=i._extrude,d=i._polygonHierarchy,h=i._perPositionHeight,p=[],m=new b;m.enqueue(d);for(var y;0!==m.length;){var C=m.dequeue(),w=C.positions;if(w=e(w,r.equalsEpsilon,!0),!(w.length<3)){var A=C.holes?C.holes.length:0;for(y=0;y<A;y++){var E=C.holes[y];if(E.positions=e(E.positions,r.equalsEpsilon,!0),!(E.positions.length<3)){p.push(E.positions);var x=0;a(E.holes)&&(x=E.holes.length);for(var P=0;P<x;P++)m.enqueue(E.holes[P])}}p.push(w)}}if(0!==p.length){var I,D=[],O=g.chordLength(o,n.maximumRadius);if(u)for(y=0;y<p.length;y++)I=T(n,p[y],O,h),I.geometry=_.scaleToGeodeticHeightExtruded(I.geometry,s,l,n,h),D.push(I);else for(y=0;y<p.length;y++)I=S(n,p[y],O,h),I.geometry.attributes.position.values=v.scaleToGeodeticHeight(I.geometry.attributes.position.values,s,n,!h),D.push(I);I=f.combineInstances(D)[0];var M=t.fromVertices(I.attributes.position.values);return new c({attributes:I.attributes,indices:I.indices,primitiveType:I.primitiveType,boundingSphere:M})}},w}),define("Core/PolylineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_){"use strict";function v(e,t,r,n,o){var a=b;a.length=o;var s,l=r.red,u=r.green,c=r.blue,d=r.alpha,h=n.red,p=n.green,f=n.blue,m=n.alpha;if(i.equals(r,n)){for(s=0;s<o;s++)a[s]=i.clone(r);return a}var g=(h-l)/o,_=(p-u)/o,v=(f-c)/o,y=(m-d)/o;for(s=0;s<o;s++)a[s]=new i(l+s*g,u+s*_,c+s*v,d+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=_.clone(o(e.vertexFormat,_.DEFAULT)),this._followSurface=o(e.followSurface,!0),this._granularity=o(e.granularity,f.RADIANS_PER_DEGREE),this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._workerName="createPolylineGeometry";var c=1+t.length*r.packedLength;c+=a(n)?1+n.length*i.packedLength:1,this.packedLength=c+l.packedLength+_.packedLength+4}var b=[];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+=r.packedLength)r.pack(u[s],t,n);var d=e._colors;for(c=a(d)?d.length:0,t[n++]=c,s=0;s<c;++s,n+=i.packedLength)i.pack(d[s],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,_.pack(e._vertexFormat,t,n),n+=_.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._followSurface?1:0,t[n]=e._granularity,t};var C=l.clone(l.UNIT_SPHERE),S=new _,T={positions:void 0,colors:void 0,ellipsoid:C,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+=r.packedLength)c[s]=r.unpack(e,t);u=e[t++];var d=u>0?new Array(u):void 0;for(s=0;s<u;++s,t+=i.packedLength)d[s]=i.unpack(e,t);var h=l.unpack(e,t,C);t+=l.packedLength;var p=_.unpack(e,t,S);t+=_.packedLength;var f=e[t++],m=1===e[t++],g=1===e[t++],v=e[t];return a(n)?(n._positions=c,n._colors=d,n._ellipsoid=l.clone(h,n._ellipsoid),n._vertexFormat=_.clone(p,n._vertexFormat),n._width=f,n._colorsPerVertex=m,n._followSurface=g,n._granularity=v,n):(T.positions=c,T.colors=d,T.width=f,T.colorsPerVertex=m,T.followSurface=g,T.granularity=v,new y(T))};var w=new r,A=new r,E=new r,x=new r;return y.createGeometry=function(o){var s,l,_,y=o._width,C=o._vertexFormat,S=o._colors,T=o._colorsPerVertex,P=o._followSurface,I=o._granularity,D=o._ellipsoid,O=e(o._positions,r.equalsEpsilon),M=O.length;if(!(M<2||y<=0)){if(P){var R=m.extractHeights(O,D),L=f.chordLength(I,D.maximumRadius);if(a(S)){var N=1;for(s=0;s<M-1;++s)N+=m.numberOfPoints(O[s],O[s+1],L);var k=new Array(N),F=0;for(s=0;s<M-1;++s){var B=O[s],U=O[s+1],V=S[s],z=m.numberOfPoints(B,U,L);if(T&&s<N){var G=S[s+1],H=v(B,U,V,G,z),W=H.length;for(l=0;l<W;++l)k[F++]=H[l]}else for(l=0;l<z;++l)k[F++]=i.clone(V)}k[F]=i.clone(S[S.length-1]),S=k,b.length=0}O=m.generateCartesianArc({positions:O,minDistance:L,ellipsoid:D,height:R})}M=O.length;var j,q=4*M-4,Y=new Float64Array(3*q),X=new Float64Array(3*q),Q=new Float64Array(3*q),Z=new Float32Array(2*q),K=C.st?new Float32Array(2*q):void 0,J=a(S)?new Uint8Array(4*q):void 0,$=0,ee=0,te=0,re=0;for(l=0;l<M;++l){0===l?(j=w,r.subtract(O[0],O[1],j),r.add(O[0],j,j)):j=O[l-1],r.clone(j,E),r.clone(O[l],A),l===M-1?(j=w,r.subtract(O[M-1],O[M-2],j),r.add(O[M-1],j,j)):j=O[l+1],r.clone(j,x);var ie,ne;a(J)&&(ie=0===l||T?S[l]:S[l-1],l!==M-1&&(ne=S[l]));var oe=0===l?2:0,ae=l===M-1?2:4;for(_=oe;_<ae;++_){r.pack(A,Y,$),r.pack(E,X,$),r.pack(x,Q,$),$+=3;var se=_-2<0?-1:1;if(Z[ee++]=_%2*2-1,Z[ee++]=se*y,C.st&&(K[te++]=l/(M-1),K[te++]=Math.max(Z[ee-2],0)),a(J)){var le=_<2?ie:ne;J[re++]=i.floatToByte(le.red),J[re++]=i.floatToByte(le.green),J[re++]=i.floatToByte(le.blue),J[re++]=i.floatToByte(le.alpha)}}}var ue=new d;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:Q}),ue.expandAndWidth=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:Z}),C.st&&(ue.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:K})),a(J)&&(ue.color=new c({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:J,normalize:!0}));var ce=p.createTypedArray(q,6*M-6),de=0,he=0,pe=M-1;for(l=0;l<pe;++l)ce[he++]=de,ce[he++]=de+2,ce[he++]=de+1,ce[he++]=de+1,ce[he++]=de+2,ce[he++]=de+3,de+=4;return new u({attributes:ue,indices:ce,primitiveType:g.TRIANGLES,boundingSphere:t.fromPoints(O),geometryType:h.POLYLINES})}},y}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S){"use strict";function T(e,t,i,n){var a=new p;n.position&&(a.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e}));var s,l,u,c,g,y,C=t.length,S=e.length/3,T=(S-2*C)/(2*C),w=v.triangulate(t),A=(T-1)*C*6+2*w.length,E=m.createTypedArray(S,A),x=2*C,P=0;for(s=0;s<T-1;s++){for(l=0;l<C-1;l++)u=2*l+s*C*2,y=u+x,c=u+1,g=c+x,E[P++]=c,E[P++]=u,E[P++]=g,E[P++]=g,E[P++]=u,E[P++]=y;u=2*C-2+s*C*2,c=u+1,g=c+x,y=u+x,E[P++]=c,E[P++]=u,E[P++]=g,E[P++]=g,E[P++]=u,E[P++]=y}if(n.st||n.tangent||n.bitangent){var I,D,O=new Float32Array(2*S),M=1/(T-1),R=1/i.height,L=i.height/2,N=0;for(s=0;s<T;s++){for(I=s*M,D=R*(t[0].y+L),O[N++]=I,O[N++]=D,l=1;l<C;l++)D=R*(t[l].y+L),O[N++]=I,O[N++]=D,O[N++]=I,O[N++]=D;D=R*(t[0].y+L),O[N++]=I,O[N++]=D}for(l=0;l<C;l++)I=0,D=R*(t[l].y+L),O[N++]=I,O[N++]=D;for(l=0;l<C;l++)I=(T-1)*M,D=R*(t[l].y+L),O[N++]=I,O[N++]=D;a.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:new Float32Array(O)})}var k=S-2*C;for(s=0;s<w.length;s+=3){var F=w[s]+k,B=w[s+1]+k,U=w[s+2]+k;E[P++]=F,E[P++]=B,E[P++]=U,E[P++]=U+C,E[P++]=B+C,E[P++]=F+C}var V=new d({attributes:a,indices:E,boundingSphere:r.fromVertices(e),primitiveType:b.TRIANGLES});if(n.normal&&(V=f.computeNormal(V)),n.tangent||n.bitangent){try{V=f.computeTangentAndBitangent(V)}catch(e){_("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}n.tangent||(V.attributes.tangent=void 0),n.bitangent||(V.attributes.bitangent=void 0),n.st||(V.attributes.st=void 0)}return V}function w(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;this._positions=t,this._shape=r,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._vertexFormat=C.clone(s(e.vertexFormat,C.DEFAULT)),this._granularity=s(e.granularity,g.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var o=1+t.length*n.packedLength;o+=1+r.length*i.packedLength,this.packedLength=o+c.packedLength+C.packedLength+2}w.pack=function(e,t,r){r=s(r,0);var o,a=e._positions,l=a.length;for(t[r++]=l,o=0;o<l;++o,r+=n.packedLength)n.pack(a[o],t,r);var u=e._shape;for(l=u.length,t[r++]=l,o=0;o<l;++o,r+=i.packedLength)i.pack(u[o],t,r);return c.pack(e._ellipsoid,t,r),r+=c.packedLength,C.pack(e._vertexFormat,t,r),r+=C.packedLength,t[r++]=e._cornerType,t[r]=e._granularity,t};var A=c.clone(c.UNIT_SPHERE),E=new C,x={polylinePositions:void 0,shapePositions:void 0,ellipsoid:A,vertexFormat:E,cornerType:void 0,granularity:void 0};w.unpack=function(e,t,r){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 d=new Array(a);for(o=0;o<a;++o,t+=i.packedLength)d[o]=i.unpack(e,t);var h=c.unpack(e,t,A);t+=c.packedLength;var p=C.unpack(e,t,E);t+=C.packedLength;var f=e[t++],m=e[t];return l(r)?(r._positions=u,r._shape=d,r._ellipsoid=c.clone(h,r._ellipsoid),r._vertexFormat=C.clone(p,r._vertexFormat),r._cornerType=f,r._granularity=m,r):(x.polylinePositions=u,x.shapePositions=d,x.cornerType=f,x.granularity=m,new w(x))};var P=new t;return w.createGeometry=function(r){var i=r._positions,o=e(i,n.equalsEpsilon),a=r._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);return T(y.computePositions(o,a,s,r,!0),a,s,r._vertexFormat)}},w}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y){"use strict";function b(e,t){var i=new p;i.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e});var n,a,s=t.length,l=i.position.values.length/3,u=e.length/3,c=u/s,m=f.createTypedArray(l,2*s*(c+1)),g=0;n=0;var _=n*s;for(a=0;a<s-1;a++)m[g++]=a+_,m[g++]=a+_+1;for(m[g++]=s-1+_,m[g++]=_,n=c-1,_=n*s,a=0;a<s-1;a++)m[g++]=a+_,m[g++]=a+_+1;for(m[g++]=s-1+_,m[g++]=_,n=0;n<c-1;n++){var y=s*n,b=y+s;for(a=0;a<s;a++)m[g++]=a+y,m[g++]=a+b}return new d({attributes:i,indices:f.createTypedArray(l,m),boundingSphere:r.fromVertices(e),primitiveType:v.LINES})}function C(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;this._positions=t,this._shape=r,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._granularity=s(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var o=1+t.length*n.packedLength;o+=1+r.length*i.packedLength,this.packedLength=o+c.packedLength+2}C.pack=function(e,t,r){r=s(r,0);var o,a=e._positions,l=a.length;for(t[r++]=l,o=0;o<l;++o,r+=n.packedLength)n.pack(a[o],t,r);var u=e._shape;for(l=u.length,t[r++]=l,o=0;o<l;++o,r+=i.packedLength)i.pack(u[o],t,r);return c.pack(e._ellipsoid,t,r),r+=c.packedLength,t[r++]=e._cornerType,t[r]=e._granularity,t};var S=c.clone(c.UNIT_SPHERE),T={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};C.unpack=function(e,t,r){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 d=new Array(a);for(o=0;o<a;++o,t+=i.packedLength)d[o]=i.unpack(e,t);var h=c.unpack(e,t,S);t+=c.packedLength;var p=e[t++],f=e[t];return l(r)?(r._positions=u,r._shape=d,r._ellipsoid=c.clone(h,r._ellipsoid),r._cornerType=p,r._granularity=f,r):(T.polylinePositions=u,T.shapePositions=d,T.cornerType=p,T.granularity=f,new C(T))};var w=new t;return C.createGeometry=function(r){var i=r._positions,o=e(i,n.equalsEpsilon),a=r._shape;if(a=_.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){g.computeWindingOrder2D(a)===y.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,w);return b(_.computePositions(o,a,s,r,!1),a)}},C}),define("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,r,i,n,o){"use strict";function a(e){var r=e.points,i=e.times;return function(o,a){t(a)||(a=new n);var s=e._lastTimeIndex=e.findTimeInterval(o,e._lastTimeIndex),l=(o-i[s])/(i[s+1]-i[s]),u=r[s],c=r[s+1];return n.fastSlerp(u,c,l,a)}}function s(t){t=e(t,e.EMPTY_OBJECT);var r=t.points,i=t.times;this._times=i,this._points=r,this._evaluateFunction=a(this),this._lastTimeIndex=0}return r(s.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),s.prototype.findTimeInterval=o.prototype.findTimeInterval,s.prototype.wrapTime=o.prototype.wrapTime,s.prototype.clampTime=o.prototype.clampTime,s.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},s}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,r,i,n,o,s,l){var u=Math.cos(r),c=n*u,d=i*u,h=Math.sin(r),m=n*h,v=i*h;f=_.project(t,f),f=e.subtract(f,g,f);var y=a.fromRotation(r,p);f=a.multiplyByVector(y,f,f),f=e.add(f,g,f),t=_.unproject(f,t),s-=1,l-=1;var b=t.latitude,C=b+s*v,S=b-c*l,T=b-c*l+s*v,w=Math.max(b,C,S,T),A=Math.min(b,C,S,T),E=t.longitude,x=E+s*d,P=E+l*m,I=E+l*m+s*d;return{north:w,south:A,east:Math.max(E,x,P,I),west:Math.min(E,x,P,I),granYCos:c,granYSin:m,granXCos:d,granXSin:v,nwCorner:t}}var u=Math.cos,c=Math.sin,d=Math.sqrt,h={};h.computePosition=function(e,t,i,n,o){var a=e.ellipsoid.radiiSquared,s=e.nwCorner,l=e.rectangle,h=s.latitude-e.granYCos*t+i*e.granXSin,p=u(h),f=c(h),m=a.z*f,g=s.longitude+t*e.granYSin+i*e.granXCos,_=p*u(g),v=p*c(g),y=a.x*_,b=a.y*v,C=d(y*_+b*v+m*f);if(n.x=y/C,n.y=b/C,n.z=m/C,r(e.vertexFormat)&&e.vertexFormat.st){var S=e.stNwCorner;r(S)?(h=S.latitude-e.stGranYCos*t+i*e.stGranXSin,g=S.longitude+t*e.stGranYSin+i*e.stGranXCos,o.x=(g-e.stWest)*e.lonScalar,o.y=(h-e.stSouth)*e.latScalar):(o.x=(g-l.west)*e.lonScalar,o.y=(h-l.south)*e.latScalar)}};var p=new a,f=new e,m=new t,g=new e,_=new n;return h.computeOptions=function(e,t,r,i){var n,a,u,c,d,h=e._granularity,p=e._ellipsoid,f=e._surfaceHeight,v=e._rotation,y=e._stRotation,b=e._extrudedHeight,C=t.east,S=t.west,T=t.north,w=t.south,A=T-w;S>C?(d=o.TWO_PI-S+C,n=Math.ceil(d/h)+1,a=Math.ceil(A/h)+1,u=d/(n-1),c=A/(a-1)):(d=C-S,n=Math.ceil(d/h)+1,a=Math.ceil(A/h)+1,u=d/(n-1),c=A/(a-1)),r=s.northwest(t,r);var E=s.center(t,m);0===v&&0===y||(E.longitude<r.longitude&&(E.longitude+=o.TWO_PI),g=_.project(E,g));var x=c,P=u,I={granYCos:x,granYSin:0,granXCos:P,granXSin:0,ellipsoid:p,surfaceHeight:f,extrudedHeight:b,nwCorner:r,rectangle:t,width:n,height:a};if(0!==v){var D=l(r,v,u,c,E,n,a);T=D.north,w=D.south,C=D.east,S=D.west,I.granYCos=D.granYCos,I.granYSin=D.granYSin,I.granXCos=D.granXCos,I.granXSin=D.granXSin,t.north=T,t.south=w,t.east=C,t.west=S}if(0!==y){v-=y,i=s.northwest(t,i);var O=l(i,v,u,c,E,n,a);I.stGranYCos=O.granYCos,I.stGranXCos=O.granXCos,I.stGranYSin=O.granYSin,I.stGranXSin=O.granXSin,I.stNwCorner=i,I.stWest=O.west,I.stSouth=O.south}return I},h}),define("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w){"use strict";function A(e,t){var r=new d({attributes:new p,primitiveType:b.TRIANGLES});return r.attributes.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(r.attributes.normal=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(r.attributes.tangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(r.attributes.bitangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.bitangents})),r}function E(e,t,i,n){var o=e.length,a=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,l=t.bitangent?new Float32Array(o):void 0,u=0,c=F,d=k,h=N;if(t.normal||t.tangent||t.bitangent)for(var p=0;p<o;p+=3){var f=r.fromArray(e,p,L),m=u+1,g=u+2;h=i.geodeticSurfaceNormal(f,h),(t.tangent||t.bitangent)&&(r.cross(r.UNIT_Z,h,d),v.multiplyByVector(n,d,d),r.normalize(d,d),t.bitangent&&r.normalize(r.cross(h,d,c),c)),t.normal&&(a[u]=h.x,a[m]=h.y,a[g]=h.z),t.tangent&&(s[u]=d.x,s[m]=d.y,s[g]=d.z),t.bitangent&&(l[u]=c.x,l[m]=c.y,l[g]=c.z),u+=3}return A(t,{positions:e,normals:a,tangents:s,bitangents:l})}function x(e,t,i){var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.bitangent?new Float32Array(n):void 0,l=0,u=0,c=0,d=!0,h=F,p=k,f=N;if(t.normal||t.tangent||t.bitangent)for(var m=0;m<n;m+=6){var g=r.fromArray(e,m,L),v=r.fromArray(e,(m+6)%n,G);if(d){var y=r.fromArray(e,(m+3)%n,H);r.subtract(v,g,v),r.subtract(y,g,y),f=r.normalize(r.cross(y,v,f),f),d=!1}r.equalsEpsilon(v,g,_.EPSILON10)&&(d=!0),(t.tangent||t.bitangent)&&(h=i.geodeticSurfaceNormal(g,h),t.tangent&&(p=r.normalize(r.cross(h,f,p),p))),t.normal&&(o[l++]=f.x,o[l++]=f.y,o[l++]=f.z,o[l++]=f.x,o[l++]=f.y,o[l++]=f.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.bitangent&&(s[c++]=h.x,s[c++]=h.y,s[c++]=h.z,s[c++]=h.x,s[c++]=h.y,s[c++]=h.z)}return A(t,{positions:e,normals:o,tangents:a,bitangents:s})}function P(e){for(var t=e.vertexFormat,r=e.ellipsoid,i=e.size,n=e.height,a=e.width,s=t.position?new Float64Array(3*i):void 0,l=t.st?new Float32Array(2*i):void 0,u=0,c=0,d=L,p=U,f=Number.MAX_VALUE,m=Number.MAX_VALUE,_=-Number.MAX_VALUE,v=-Number.MAX_VALUE,y=0;y<n;++y)for(var b=0;b<a;++b)T.computePosition(e,y,b,d,p),s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,t.st&&(l[c++]=p.x,l[c++]=p.y,f=Math.min(f,p.x),m=Math.min(m,p.y),_=Math.max(_,p.x),v=Math.max(v,p.y));if(t.st&&(f<0||m<0||_>1||v>1))for(var C=0;C<l.length;C+=2)l[C]=(l[C]-f)/(_-f),l[C+1]=(l[C+1]-m)/(v-m);for(var S=E(s,t,r,e.tangentRotationMatrix),w=6*(a-1)*(n-1),A=g.createTypedArray(i,w),x=0,P=0,I=0;I<n-1;++I){for(var D=0;D<a-1;++D){var O=x,M=O+a,R=M+1,N=O+1;A[P++]=O,A[P++]=M,A[P++]=N,A[P++]=N,A[P++]=M,A[P++]=R,++x}++x}return S.indices=A,t.st&&(S.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:l})),S}function I(e,t,r,i,n){return e[t++]=i[r],e[t++]=i[r+1],e[t++]=i[r+2],e[t++]=n[r],e[t++]=n[r+1],e[t++]=n[r+2],e}function D(e,t,r,i){return e[t++]=i[r],e[t++]=i[r+1],e[t++]=i[r],e[t++]=i[r+1],e}function O(e){var t,i=e.shadowVolume,n=e.vertexFormat,a=e.surfaceHeight,s=e.extrudedHeight,l=Math.min(s,a),u=Math.max(s,a),c=e.height,d=e.width,p=e.ellipsoid;i&&(e.vertexFormat=w.clone(n,W),e.vertexFormat.normal=!0);var v=P(e);if(_.equalsEpsilon(l,u,_.EPSILON10))return v;var b=y.scaleToGeodeticHeight(v.attributes.position.values,u,p,!1);b=new Float64Array(b);var C=b.length,S=2*C,T=new Float64Array(S);T.set(b);var A=y.scaleToGeodeticHeight(v.attributes.position.values,l,p);T.set(A,C),v.attributes.position.values=T;var E,O,M=n.normal?new Float32Array(S):void 0,R=n.tangent?new Float32Array(S):void 0,L=n.bitangent?new Float32Array(S):void 0,N=n.st?new Float32Array(S/3*2):void 0;if(n.normal){for(O=v.attributes.normal.values,M.set(O),t=0;t<C;t++)O[t]=-O[t];M.set(O,C),v.attributes.normal.values=M}if(i){O=v.attributes.normal.values,n.normal||(v.attributes.normal=void 0);var k=new Float32Array(S);for(t=0;t<C;t++)O[t]=-O[t];k.set(O,C),v.attributes.extrudeDirection=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:k})}if(n.tangent){var F=v.attributes.tangent.values;for(R.set(F),t=0;t<C;t++)F[t]=-F[t];R.set(F,C),v.attributes.tangent.values=R}if(n.bitangent){var B=v.attributes.bitangent.values;L.set(B),L.set(B,C),v.attributes.bitangent.values=L}n.st&&(E=v.attributes.st.values,N.set(E),N.set(E,C/3*2),v.attributes.st.values=N);var U=v.indices,V=U.length,z=C/3,j=g.createTypedArray(S/3,2*V);for(j.set(U),t=0;t<V;t+=3)j[t+V]=U[t+2]+z,j[t+1+V]=U[t+1]+z,j[t+2+V]=U[t]+z;v.indices=j;var q,Y=2*d+2*c-4,X=2*(Y+4),Q=new Float64Array(3*X),Z=i?new Float32Array(3*X):void 0,K=n.st?new Float32Array(2*X):void 0,J=0,$=0,ee=0,te=d*c;for(t=0;t<te;t+=d)q=3*t,Q=I(Q,J,q,b,A),J+=6,n.st&&(K=D(K,$,2*t,E),$+=4),i&&(ee+=3,Z[ee++]=O[q],Z[ee++]=O[q+1],Z[ee++]=O[q+2]);for(t=te-d;t<te;t++)q=3*t,Q=I(Q,J,q,b,A),J+=6,n.st&&(K=D(K,$,2*t,E),$+=4),i&&(ee+=3,Z[ee++]=O[q],Z[ee++]=O[q+1],Z[ee++]=O[q+2]);for(t=te-1;t>0;t-=d)q=3*t,Q=I(Q,J,q,b,A),J+=6,n.st&&(K=D(K,$,2*t,E),$+=4),i&&(ee+=3,Z[ee++]=O[q],Z[ee++]=O[q+1],Z[ee++]=O[q+2]);for(t=d-1;t>=0;t--)q=3*t,Q=I(Q,J,q,b,A),J+=6,n.st&&(K=D(K,$,2*t,E),$+=4),i&&(ee+=3,Z[ee++]=O[q],Z[ee++]=O[q+1],Z[ee++]=O[q+2]);var re=x(Q,n,p);n.st&&(re.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:K})),i&&(re.attributes.extrudeDirection=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:Z}));var ie,ne,oe,ae,se=g.createTypedArray(X,6*Y);C=Q.length/3;var le=0;for(t=0;t<C-1;t+=2){ie=t,ae=(ie+2)%C;var ue=r.fromArray(Q,3*ie,G),ce=r.fromArray(Q,3*ae,H);r.equalsEpsilon(ue,ce,_.EPSILON10)||(ne=(ie+1)%C,oe=(ne+2)%C,se[le++]=ie,se[le++]=ne,se[le++]=ae,se[le++]=ae,se[le++]=ne,se[le++]=oe)}return re.indices=se,re=m.combineInstances([new f({geometry:v}),new f({geometry:re})]),re[0]}function M(e,t,r){if(0===r)return S.clone(e);S.northeast(e,Q[0]),S.northwest(e,Q[1]),S.southeast(e,Q[2]),S.southwest(e,Q[3]),t.cartographicArrayToCartesianArray(Q,X);var i=t.geodeticSurfaceNormalCartographic(S.center(e,q));C.fromAxisAngle(i,r,Y),v.fromQuaternion(Y,j);for(var n=0;n<4;++n)v.multiplyByVector(j,X[n],X[n]);return t.cartesianArrayToCartographicArray(X,Q),S.fromCartographicArray(Q)}function R(e){e=a(e,a.EMPTY_OBJECT);var t=e.rectangle,r=a(e.rotation,0);this._rectangle=t,this._granularity=a(e.granularity,_.RADIANS_PER_DEGREE),this._ellipsoid=c.clone(a(e.ellipsoid,c.WGS84)),this._surfaceHeight=a(e.height,0),this._rotation=r,this._stRotation=a(e.stRotation,0),this._vertexFormat=w.clone(a(e.vertexFormat,w.DEFAULT)),this._extrudedHeight=a(e.extrudedHeight,0),this._extrude=s(e.extrudedHeight),this._shadowVolume=a(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._rotatedRectangle=M(this._rectangle,this._ellipsoid,r)}var L=new r,N=new r,k=new r,F=new r,B=new S,U=new t,V=new e,z=new e,G=new r,H=new r,W=new w,j=new v,q=new r,Y=new C,X=[new r,new r,new r,new r],Q=[new i,new i,new i,new i];R.packedLength=S.packedLength+c.packedLength+w.packedLength+S.packedLength+7,R.pack=function(e,t,r){return r=a(r,0),S.pack(e._rectangle,t,r),r+=S.packedLength,c.pack(e._ellipsoid,t,r),r+=c.packedLength,w.pack(e._vertexFormat,t,r),r+=w.packedLength,S.pack(e._rotatedRectangle,t,r),r+=S.packedLength,t[r++]=e._granularity,t[r++]=e._surfaceHeight,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._extrudedHeight,t[r++]=e._extrude?1:0,t[r]=e._shadowVolume?1:0,t};var Z=new S,K=new S,J=c.clone(c.UNIT_SPHERE),$={rectangle:Z,ellipsoid:J,vertexFormat:W,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0};R.unpack=function(e,t,r){t=a(t,0);var i=S.unpack(e,t,Z);t+=S.packedLength;var n=c.unpack(e,t,J);t+=c.packedLength;var o=w.unpack(e,t,W)
;t+=w.packedLength;var l=S.unpack(e,t,K);t+=S.packedLength;var u=e[t++],d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=1===e[t++],g=1===e[t];return s(r)?(r._rectangle=S.clone(i,r._rectangle),r._ellipsoid=c.clone(n,r._ellipsoid),r._vertexFormat=w.clone(o,r._vertexFormat),r._granularity=u,r._surfaceHeight=d,r._rotation=h,r._stRotation=p,r._extrudedHeight=m?f:void 0,r._extrude=m,r._rotatedRectangle=l,r._shadowVolume=g,r):($.granularity=u,$.height=d,$.rotation=h,$.stRotation=p,$.extrudedHeight=m?f:void 0,$.shadowVolume=g,new R($))};var ee=new v,te=new i,re=new i,ie=new C,ne=new i;return R.createGeometry=function(t){if(!_.equalsEpsilon(t._rectangle.north,t._rectangle.south,_.EPSILON10)&&!_.equalsEpsilon(t._rectangle.east,t._rectangle.west,_.EPSILON10)){var r=S.clone(t._rectangle,B),i=t._ellipsoid,n=t._surfaceHeight,o=t._extrude,a=t._extrudedHeight,s=t._rotation,l=t._stRotation,u=t._vertexFormat,c=T.computeOptions(t,r,te,re),h=ee;if(0!==l||0!==s){var p=S.center(r,ne),f=i.geodeticSurfaceNormalCartographic(p,G);C.fromAxisAngle(f,-l,ie),v.fromQuaternion(ie,h)}else v.clone(v.IDENTITY,h);c.lonScalar=1/t._rectangle.width,c.latScalar=1/t._rectangle.height,c.vertexFormat=u,c.rotation=s,c.stRotation=l,c.tangentRotationMatrix=h,c.size=c.width*c.height;var m,g;if(r=t._rectangle,o){c.shadowVolume=t._shadowVolume,m=O(c);var b=e.fromRectangle3D(r,i,n,z),w=e.fromRectangle3D(r,i,a,V);g=e.union(b,w)}else m=P(c),m.attributes.position.values=y.scaleToGeodeticHeight(m.attributes.position.values,n,i,!1),g=e.fromRectangle3D(r,i,n);return u.position||delete m.attributes.position,new d({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:g})}},R.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new R({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:i,extrudedHeight:a,height:o,vertexFormat:w.POSITION_ONLY,shadowVolume:!0})},l(R.prototype,{rectangle:{get:function(){return this._rotatedRectangle}}}),R}),define("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(e){var t,r=e.size,n=e.height,o=e.width,a=new Float64Array(3*r),s=0,h=0,p=S;for(t=0;t<o;t++)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=o-1,h=1;h<n;h++)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(h=n-1,t=o-2;t>=0;t--)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,h=n-2;h>0;h--)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var m=a.length/3*2,_=d.createTypedArray(a.length/3,m),v=0,y=0;y<a.length/3-1;y++)_[v++]=y,_[v++]=y+1;_[v++]=a.length/3-1,_[v++]=0;var b=new l({attributes:new c,primitiveType:f.LINES});return b.attributes.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a}),b.indices=_,b}function v(e){var t=e.surfaceHeight,r=e.extrudedHeight,i=e.ellipsoid,n=Math.min(r,t),o=Math.max(r,t),a=_(e);if(h.equalsEpsilon(n,o,h.EPSILON10))return a;var s=e.height,l=e.width,u=p.scaleToGeodeticHeight(a.attributes.position.values,o,i,!1),c=u.length,f=new Float64Array(2*c);f.set(u);var m=p.scaleToGeodeticHeight(a.attributes.position.values,n,i);f.set(m,c),a.attributes.position.values=f;var g=f.length/3*2+8,v=d.createTypedArray(f.length/3,g);c=f.length/6;for(var y=0,b=0;b<c-1;b++)v[y++]=b,v[y++]=b+1,v[y++]=b+c,v[y++]=b+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,r=n(e.granularity,h.RADIANS_PER_DEGREE),i=n(e.ellipsoid,s.WGS84),o=n(e.height,0),a=n(e.rotation,0),l=e.extrudedHeight;this._rectangle=t,this._granularity=r,this._ellipsoid=i,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=l,this._workerName="createRectangleOutlineGeometry"}var b=new e,C=new e,S=new t,T=new m;y.packedLength=m.packedLength+s.packedLength+5,y.pack=function(e,t,r){return r=n(r,0),m.pack(e._rectangle,t,r),r+=m.packedLength,s.pack(e._ellipsoid,t,r),r+=s.packedLength,t[r++]=e._granularity,t[r++]=e._surfaceHeight,t[r++]=e._rotation,t[r++]=o(e._extrudedHeight)?1:0,t[r]=n(e._extrudedHeight,0),t};var w=new m,A=s.clone(s.UNIT_SPHERE),E={rectangle:w,ellipsoid:A,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};y.unpack=function(e,t,r){t=n(t,0);var i=m.unpack(e,t,w);t+=m.packedLength;var a=s.unpack(e,t,A);t+=s.packedLength;var l=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t];return o(r)?(r._rectangle=m.clone(i,r._rectangle),r._ellipsoid=s.clone(a,r._ellipsoid),r._surfaceHeight=u,r._rotation=c,r._extrudedHeight=d?h:void 0,r):(E.granularity=l,E.height=u,E.rotation=c,E.extrudedHeight=d?h:void 0,new y(E))};var x=new r;return y.createGeometry=function(t){var r=m.clone(t._rectangle,T),i=t._ellipsoid,n=t._surfaceHeight,a=t._extrudedHeight,s=g.computeOptions(t,r,x);s.size=2*s.width+2*s.height-4;var u,c;if(r=t._rectangle,!h.equalsEpsilon(r.north,r.south,h.EPSILON10)&&!h.equalsEpsilon(r.east,r.west,h.EPSILON10)){if(o(a)){u=v(s);var d=e.fromRectangle3D(r,i,n,C),y=e.fromRectangle3D(r,i,a,b);c=e.union(d,y)}else u=_(s),u.attributes.position.values=p.scaleToGeodeticHeight(u.attributes.position.values,n,i,!1),c=e.fromRectangle3D(r,i,n);return new l({attributes:u.attributes,indices:u.indices,primitiveType:f.LINES,boundingSphere:c})}},y}),define("Core/ReferenceFrame",["./freezeObject"],function(e){"use strict";return e({FIXED:0,INERTIAL:1})}),define("Core/requestAnimationFrame",["./defined","./getTimestamp"],function(e,t){"use strict";function r(e){return i(e)}if("undefined"!=typeof window){var i=window.requestAnimationFrame;return function(){if(!e(i))for(var r=["webkit","moz","ms","o"],n=0,o=r.length;n<o&&!e(i);)i=window[r[n]+"RequestAnimationFrame"],++n;if(!e(i)){var a=0;i=function(e){var r=t(),i=Math.max(1e3/60-(r-a),0);return a=r+i,setTimeout(function(){e(a)},i)}}}(),r}}),define("Core/sampleTerrain",["../ThirdParty/when","./Check"],function(e,t){"use strict";function r(e,t,r){return e.readyPromise.then(function(){return i(e,t,r)})}function i(t,r,i){var a,s=t.tilingScheme,l=[],u={};for(a=0;a<i.length;++a){var c=s.positionToTileXY(i[a],r),d=c.toString();if(!u.hasOwnProperty(d)){var h={x:c.x,y:c.y,level:r,tilingScheme:s,terrainProvider:t,positions:[]};u[d]=h,l.push(h)}u[d].positions.push(i[a])}var p=[];for(a=0;a<l.length;++a){var f=l[a],m=f.terrainProvider.requestTileGeometry(f.x,f.y,f.level),g=e(m,n(f),o(f));p.push(g)}return e.all(p,function(){return i})}function n(e){var t=e.positions,r=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(e){for(var i=0;i<t.length;++i){var n=t[i];n.height=e.interpolateHeight(r,n.longitude,n.latitude)}}}function o(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){t[e].height=void 0}}}return r}),define("Core/sampleTerrainMostDetailed",["../ThirdParty/when","./defined","./DeveloperError","./sampleTerrain"],function(e,t,r,i){"use strict";function n(r,n){return r.readyPromise.then(function(){for(var o=[],a=r.availability,s=0;s<n.length;++s){var l=n[s],u=a.computeMaximumLevelAtPosition(l),c=o[u];t(c)||(o[u]=c=[]),c.push(l)}return e.all(o.map(function(e,n){if(t(e))return i(r,n,e)})).then(function(){return n})})}return n}),define("Core/ScreenSpaceEventType",["./freezeObject"],function(e){"use strict";return e({LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19})}),define("Core/ScreenSpaceEventHandler",["./AssociativeArray","./Cartesian2","./defaultValue","./defined","./destroyObject","./DeveloperError","./FeatureDetection","./getTimestamp","./KeyboardEventModifier","./ScreenSpaceEventType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r){var i=e._element;if(i===document)return r.x=t.clientX,r.y=t.clientY,r;var n=i.getBoundingClientRect();return r.x=t.clientX-n.left,r.y=t.clientY-n.top,r}function d(e,t){var r=e;return i(t)&&(r+="+"+t),r}function h(e){return e.shiftKey?l.SHIFT:e.ctrlKey?l.CTRL:e.altKey?l.ALT:void 0}function p(e,t,r,i){function n(t){i(e,t)}r.addEventListener(t,n,!1),e._removalFunctions.push(function(){r.removeEventListener(t,n,!1)})}function f(e){var t=e._element,r=i(t.disableRootEvents)?t:document;a.supportsPointerEvents()?(p(e,"pointerdown",t,P),p(e,"pointerup",t,I),p(e,"pointermove",t,D),p(e,"pointercancel",t,I)):(p(e,"mousedown",t,v),p(e,"mouseup",r,y),p(e,"mousemove",r,b),p(e,"touchstart",t,T),p(e,"touchend",r,w),p(e,"touchmove",r,E),p(e,"touchcancel",r,w)),p(e,"dblclick",t,C);var n;n="onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",p(e,n,t,S)}function m(e){for(var t=e._removalFunctions,r=0;r<t.length;++r)t[r]()}function g(e){e._lastSeenTouchEvent=s()}function _(e){return s()-e._lastSeenTouchEvent>O.mouseEmulationIgnoreMilliseconds}function v(e,r){if(_(e)){var n=r.button;e._buttonDown=n;var o;if(n===M.LEFT)o=u.LEFT_DOWN;else if(n===M.MIDDLE)o=u.MIDDLE_DOWN;else{if(n!==M.RIGHT)return;o=u.RIGHT_DOWN}var a=c(e,r,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=h(r),l=e.getInputAction(o,s);i(l)&&(t.clone(a,R.position),l(R),r.preventDefault())}}function y(e,r){if(_(e)){var n=r.button;e._buttonDown=void 0;var o,a;if(n===M.LEFT)o=u.LEFT_UP,a=u.LEFT_CLICK;else if(n===M.MIDDLE)o=u.MIDDLE_UP,a=u.MIDDLE_CLICK;else{if(n!==M.RIGHT)return;o=u.RIGHT_UP,a=u.RIGHT_CLICK}var s=h(r),l=e.getInputAction(o,s),d=e.getInputAction(a,s);if(i(l)||i(d)){var p=c(e,r,e._primaryPosition);if(i(l)&&(t.clone(p,L.position),l(L)),i(d)){var f=e._primaryStartPosition,m=f.x-p.x,g=f.y-p.y;Math.sqrt(m*m+g*g)<e._clickPixelTolerance&&(t.clone(p,N.position),d(N))}}}}function b(e,r){if(_(e)){var n=h(r),o=c(e,r,e._primaryPosition),a=e._primaryPreviousPosition,s=e.getInputAction(u.MOUSE_MOVE,n);i(s)&&(t.clone(a,k.startPosition),t.clone(o,k.endPosition),s(k)),t.clone(o,a),i(e._buttonDown)&&r.preventDefault()}}function C(e,t){var r,n=t.button;if(n===M.LEFT){r=u.LEFT_DOUBLE_CLICK;var o=h(t),a=e.getInputAction(r,o);i(a)&&(c(e,t,F.position),a(F))}}function S(e,t){var r;if(i(t.deltaY)){var n=t.deltaMode;r=n===t.DOM_DELTA_PIXEL?-t.deltaY:n===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else r=t.detail>0?-120*t.detail:t.wheelDelta;if(i(r)){var o=h(t),a=e.getInputAction(u.WHEEL,o);i(a)&&(a(r),t.preventDefault())}}function T(e,r){g(e);var i,n,o,a=r.changedTouches,s=a.length,l=e._positions;for(i=0;i<s;++i)n=a[i],o=n.identifier,l.set(o,c(e,n,new t));A(e,r);var u=e._previousPositions;for(i=0;i<s;++i)n=a[i],o=n.identifier,u.set(o,t.clone(l.get(o)))}function w(e,t){g(e);var r,i,n,o=t.changedTouches,a=o.length,s=e._positions;for(r=0;r<a;++r)i=o[r],n=i.identifier,s.remove(n);A(e,t);var l=e._previousPositions;for(r=0;r<a;++r)i=o[r],n=i.identifier,l.remove(n)}function A(e,r){var n,o,a=h(r),s=e._positions,l=e._previousPositions,c=s.length;if(1!==c&&e._buttonDown===M.LEFT&&(e._buttonDown=void 0,n=e.getInputAction(u.LEFT_UP,a),i(n)&&(t.clone(e._primaryPosition,V.position),n(V)),0===c&&(o=e.getInputAction(u.LEFT_CLICK,a),i(o)))){var d=e._primaryStartPosition,p=l.values[0],f=d.x-p.x,m=d.y-p.y;Math.sqrt(f*f+m*m)<e._clickPixelTolerance&&(t.clone(e._primaryPosition,z.position),o(z))}if(2!==c&&e._isPinching&&(e._isPinching=!1,n=e.getInputAction(u.PINCH_END,a),i(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=M.LEFT,n=e.getInputAction(u.LEFT_DOWN,a),i(n)&&(t.clone(g,B.position),n(B)),r.preventDefault()}2===c&&(e._isPinching=!0,n=e.getInputAction(u.PINCH_START,a),i(n)&&(t.clone(s.values[0],U.position1),t.clone(s.values[1],U.position2),n(U),r.preventDefault()))}function E(e,r){g(e);var n,o,a,s=r.changedTouches,l=s.length,u=e._positions;for(n=0;n<l;++n){o=s[n],a=o.identifier;var d=u.get(a);i(d)&&c(e,o,d)}x(e,r);var h=e._previousPositions;for(n=0;n<l;++n)o=s[n],a=o.identifier,t.clone(u.get(a),h.get(a))}function x(e,r){var n,o=h(r),a=e._positions,s=e._previousPositions,l=a.length;if(1===l&&e._buttonDown===M.LEFT){var c=a.values[0];t.clone(c,e._primaryPosition);var d=e._primaryPreviousPosition;n=e.getInputAction(u.MOUSE_MOVE,o),i(n)&&(t.clone(d,G.startPosition),t.clone(c,G.endPosition),n(G)),t.clone(c,d),r.preventDefault()}else if(2===l&&e._isPinching&&(n=e.getInputAction(u.PINCH_MOVE,o),i(n))){var p=a.values[0],f=a.values[1],m=s.values[0],g=s.values[1],_=f.x-p.x,v=f.y-p.y,y=.25*Math.sqrt(_*_+v*v),b=g.x-m.x,C=g.y-m.y,S=.25*Math.sqrt(b*b+C*C),T=.125*(f.y+p.y),w=.125*(g.y+m.y),A=Math.atan2(v,_),E=Math.atan2(C,b);t.fromElements(0,S,H.distance.startPosition),t.fromElements(0,y,H.distance.endPosition),t.fromElements(E,w,H.angleAndHeight.startPosition),t.fromElements(A,T,H.angleAndHeight.endPosition),n(H)}}function P(e,r){if(r.target.setPointerCapture(r.pointerId),"touch"===r.pointerType){var i=e._positions,n=r.pointerId;i.set(n,c(e,r,new t)),A(e,r);e._previousPositions.set(n,t.clone(i.get(n)))}else v(e,r)}function I(e,t){if("touch"===t.pointerType){var r=e._positions,i=t.pointerId;r.remove(i),A(e,t);e._previousPositions.remove(i)}else y(e,t)}function D(e,r){if("touch"===r.pointerType){var n=e._positions,o=r.pointerId,a=n.get(o);if(!i(a))return;c(e,r,a),x(e,r);var s=e._previousPositions;t.clone(n.get(o),s.get(o))}else b(e,r)}function O(i){this._inputEvents={},this._buttonDown=void 0,this._isPinching=!1,this._lastSeenTouchEvent=-O.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=r(i,document),f(this)}var M={LEFT:0,MIDDLE:1,RIGHT:2},R={position:new t},L={position:new t},N={position:new t},k={startPosition:new t,endPosition:new t},F={position:new t},B={position:new t},U={position1:new t,position2:new t},V={position:new t},z={position:new t},G={startPosition:new t,endPosition:new t},H={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}};return O.prototype.setInputAction=function(e,t,r){var i=d(t,r);this._inputEvents[i]=e},O.prototype.getInputAction=function(e,t){var r=d(e,t);return this._inputEvents[r]},O.prototype.removeInputAction=function(e,t){var r=d(e,t);delete this._inputEvents[r]},O.prototype.isDestroyed=function(){return!1},O.prototype.destroy=function(){return m(this),n(this)},O.mouseEmulationIgnoreMilliseconds=800,O}),define("Core/ShowGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n){"use strict";function o(e){e=t(e,!0),this.value=o.toValue(e)}return i(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 r(t)?(t[0]=e,t):new Uint8Array([e])},o}),define("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,r,i,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=i.addSeconds(e,b,t);var r=i.totalDays(t)-C;return t=i.addSeconds(t,l(r),t)}function c(r,i,a,s,l,u,c){a<0&&(a=-a,l+=n.PI);var p=r*(1-i),f=s-l,g=l,_=h(u-s,i);d(i,0);m(f,a,g,E);var v=p*(1+i),y=Math.cos(_),b=Math.sin(_),C=1+i*y,S=v/C;return t(c)?(c.x=S*y,c.y=S*b,c.z=0):c=new e(S*y,S*b,0),o.multiplyByVector(E,c,c)}function d(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function h(e,t){return f(p(e,t),t)}function p(e,t){var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var i,o=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),a=Number.MAX_VALUE;for(i=0;i<x&&Math.abs(a-o)>P;++i){a=o;o=a-(a-t*Math.sin(a)-e)/(1-t*Math.cos(a))}return a=o+r*n.TWO_PI}function f(e,t){var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),a=Math.atan2(o,i);return a=n.zeroToTwoPi(a),e<0&&(a-=n.TWO_PI),a+=r*n.TWO_PI}function m(e,r,i,n){var a=Math.cos(e),s=Math.sin(e),l=Math.cos(r),u=Math.sin(r),c=Math.cos(i),d=Math.sin(i);return t(n)?(n[0]=c*a-d*s*l,n[1]=d*a+c*s*l,n[2]=s*u,n[3]=-c*s-d*a*l,n[4]=-d*s+c*a*l,n[5]=a*u,n[6]=d*u,n[7]=-c*u,n[8]=l):n=new o(c*a-d*s*l,-c*s-d*a*l,d*u,d*a+c*s*l,-d*s+c*a*l,-c*u,s*u,a*u,l),n}function g(e,t){u(e,Ee);var r=Ee.dayNumber-S.dayNumber+(Ee.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,i=r/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*i,o=I+V*Math.cos(M*n)+X*Math.sin(M*n)+z*Math.cos(R*n)+Q*Math.sin(R*n)+G*Math.cos(L*n)+Z*Math.sin(L*n)+H*Math.cos(N*n)+K*Math.sin(N*n)+W*Math.cos(k*n)+J*Math.sin(k*n)+j*Math.cos(F*n)+$*Math.sin(F*n)+q*Math.cos(B*n)+ee*Math.sin(B*n)+Y*Math.cos(U*n)+te*Math.sin(U*n),s=D+O*i+ce*Math.cos(re*n)+ve*Math.sin(re*n)+de*Math.cos(ie*n)+ye*Math.sin(ie*n)+he*Math.cos(ne*n)+be*Math.sin(ne*n)+pe*Math.cos(oe*n)+Ce*Math.sin(oe*n)+fe*Math.cos(ae*n)+Se*Math.sin(ae*n)+me*Math.cos(se*n)+Te*Math.sin(se*n)+ge*Math.cos(le*n)+we*Math.sin(le*n)+_e*Math.cos(ue*n)+Ae*Math.sin(ue*n);return c(o,.0167086342-.0004203654*i,469.97289*A*i,102.93734808*w+11612.3529*A*i,174.87317577*w-8679.27034*A*i,s,t)}function _(e,t){u(e,Ee);var r=Ee.dayNumber-S.dayNumber+(Ee.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,i=r/a.DAYS_PER_JULIAN_CENTURY,n=i*i,o=n*i,s=o*i,l=383397.7725+.004*i,d=.055545526-1.6e-8*i,h=5.15668983*w,p=-8e-5*i+.02966*n-42e-6*o-1.3e-7*s,f=83.35324312*w,m=14643420.2669*i-38.2702*n-.045047*o+21301e-8*s,g=125.04455501*w,_=-6967919.3631*i+6.3602*n+.007625*o-3586e-8*s,v=218.31664563*w,y=1732559343.4847*i-6.391*n+.006588*o-3169e-8*s,b=297.85019547*w+A*(1602961601.209*i-6.3706*n+.006593*o-3169e-8*s),C=93.27209062*w+A*(1739527262.8478*i-12.7512*n-.001037*o+417e-8*s),E=134.96340251*w+A*(1717915923.2178*i+31.8792*n+.051635*o-2447e-7*s),x=357.52910918*w+A*(129596581.0481*i-.5532*n+136e-6*o-1149e-8*s),P=310.17137918*w-A*(6967051.436*i+6.2068*n+.007618*o-3219e-8*s),I=2*b,D=4*b,O=6*b,M=2*E,R=3*E,L=4*E,N=2*C;l+=3400.4*Math.cos(I)-635.6*Math.cos(I-E)-235.6*Math.cos(E)+218.1*Math.cos(I-x)+181*Math.cos(I+E),d+=.014216*Math.cos(I-E)+.008551*Math.cos(I-M)-.001383*Math.cos(E)+.001356*Math.cos(I+E)-.001147*Math.cos(D-R)-914e-6*Math.cos(D-M)+869e-6*Math.cos(I-x-E)-627e-6*Math.cos(I)-394e-6*Math.cos(D-L)+282e-6*Math.cos(I-x-M)-279e-6*Math.cos(b-E)-236e-6*Math.cos(M)+231e-6*Math.cos(D)+229e-6*Math.cos(O-L)-201e-6*Math.cos(M-N),p+=486.26*Math.cos(I-N)-40.13*Math.cos(I)+37.51*Math.cos(N)+25.73*Math.cos(M-N)+19.97*Math.cos(I-x-N),m+=-55609*Math.sin(I-E)-34711*Math.sin(I-M)-9792*Math.sin(E)+9385*Math.sin(D-R)+7505*Math.sin(D-M)+5318*Math.sin(I+E)+3484*Math.sin(D-L)-3417*Math.sin(I-x-E)-2530*Math.sin(O-L)-2376*Math.sin(I)-2075*Math.sin(I-R)-1883*Math.sin(M)-1736*Math.sin(O-5*E)+1626*Math.sin(x)-1370*Math.sin(O-R),_+=-5392*Math.sin(I-N)-540*Math.sin(x)-441*Math.sin(I)+423*Math.sin(N)-288*Math.sin(M-N),y+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-E)-662.5*Math.sin(x)+396.3*Math.sin(E)-218*Math.sin(I-x);var k=2*P,F=3*P;p+=46.997*Math.cos(P)*i-.614*Math.cos(I-N+P)*i+.614*Math.cos(I-N-P)*i-.0297*Math.cos(k)*n-.0335*Math.cos(P)*n+.0012*Math.cos(I-N+k)*n-16e-5*Math.cos(P)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(k)*o;var B=2.116*Math.sin(P)*i-.111*Math.sin(I-N-P)*i-.0015*Math.sin(P)*n;return m+=B,y+=B,_+=-520.77*Math.sin(P)*i+13.66*Math.sin(I-N+P)*i+1.12*Math.sin(I-P)*i-1.06*Math.sin(N-P)*i+.66*Math.sin(k)*n+.371*Math.sin(P)*n-.035*Math.sin(I-N+k)*n-.015*Math.sin(I-N+P)*n+.0014*Math.sin(P)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(k)*o,l*=T,c(l,d,h+p*A,f+m*A,g+_*A,v+y*A,t)}function v(t,r){return r=_(t,r),e.multiplyByScalar(r,xe,r)}var y={},b=32.184,C=2451545,S=new i(2451545,0,s.TAI),T=1e3,w=n.RADIANS_PER_DEGREE,A=n.RADIANS_PER_ARCSECOND,E=new o,x=50,P=n.EPSILON8,I=149598022260.7121,D=100.46645683*w,O=1295977422.83429*A,M=16002,R=21863,L=32004,N=10931,k=14529,F=16368,B=15318,U=32794,V=64e-7*14959787e4,z=-2273887.624,G=927506.794,H=14959787e4*-8e-7,W=32e-7*14959787e4,j=-613351.267,q=284235.953,Y=-164557.657,X=-2243968.05,Q=-688150.202,Z=1017265.516,K=807828.498,J=14e-7*14959787e4,$=359034.888,ee=14959787e4*-28e-7,te=329115.314,re=10,ie=16002,ne=21863,oe=10931,ae=1473,se=32004,le=4387,ue=73,ce=-325e-7,de=-322e-7,he=1e-7*-79,pe=232*1e-7,fe=1e-7*-52,me=97e-7,ge=55e-7,_e=-41e-7,ve=-105e-7,ye=-137e-7,be=258e-7,Ce=35e-7,Se=1e-7*-116,Te=-88e-7,we=-112e-7,Ae=-8e-6,Ee=new i(0,0,s.TAI),xe=-.01215058143522694,Pe=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(r,n){return t(r)||(r=i.now()),t(n)||(n=new e),Ie=g(r,Ie),n=e.negate(Ie,n),v(r,Ie),e.subtract(n,Ie,n),o.multiplyByVector(Pe,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,r){return t(e)||(e=i.now()),r=_(e,r),o.multiplyByVector(Pe,r,r),r},y}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e,t,i,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=i.red,d=i.green,h=i.blue,f=i.alpha,m=n.red,g=n.green,_=n.blue,v=n.alpha;if(r.equals(i,n)){for(l=0;l<u;l++)a[s++]=r.floatToByte(c),a[s++]=r.floatToByte(d),a[s++]=r.floatToByte(h),a[s++]=r.floatToByte(f);return s}var y=(m-c)/u,b=(g-d)/u,C=(_-h)/u,S=(v-f)/u,T=s;for(l=0;l<u;l++)a[T++]=r.floatToByte(c+l*y),a[T++]=r.floatToByte(d+l*b),a[T++]=r.floatToByte(h+l*C),a[T++]=r.floatToByte(f+l*S);return T}function g(e){e=n(e,n.EMPTY_OBJECT);var i=e.positions,a=e.colors,l=n(e.colorsPerVertex,!1);this._positions=i,this._colors=a,this._colorsPerVertex=l,this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,h.RADIANS_PER_DEGREE),this._ellipsoid=n(e.ellipsoid,s.WGS84),this._workerName="createSimplePolylineGeometry";var u=1+i.length*t.packedLength;u+=o(a)?1+a.length*r.packedLength:1,this.packedLength=u+s.packedLength+3}g.pack=function(e,i,a){a=n(a,0);var l,u=e._positions,c=u.length;for(i[a++]=c,l=0;l<c;++l,a+=t.packedLength)t.pack(u[l],i,a);var d=e._colors;for(c=o(d)?d.length:0,i[a++]=c,l=0;l<c;++l,a+=r.packedLength)r.pack(d[l],i,a);return s.pack(e._ellipsoid,i,a),a+=s.packedLength,i[a++]=e._colorsPerVertex?1:0,i[a++]=e._followSurface?1:0,i[a]=e._granularity,i},g.unpack=function(e,i,a){i=n(i,0);var l,u=e[i++],c=new Array(u);for(l=0;l<u;++l,i+=t.packedLength)c[l]=t.unpack(e,i);u=e[i++];var d=u>0?new Array(u):void 0;for(l=0;l<u;++l,i+=r.packedLength)d[l]=r.unpack(e,i);var h=s.unpack(e,i);i+=s.packedLength;var p=1===e[i++],f=1===e[i++],m=e[i];return o(a)?(a._positions=c,a._colors=d,a._ellipsoid=h,a._colorsPerVertex=p,a._followSurface=f,a._granularity=m,a):new g({positions:c,colors:d,ellipsoid:h,colorsPerVertex:p,followSurface:f,granularity:m})};var _=new Array(2),v=new Array(2),y={positions:_,height:v,ellipsoid:void 0,minDistance:void 0};return g.createGeometry=function(n){var a,s,g,b,C,S=n._positions,T=n._colors,w=n._colorsPerVertex,A=n._followSurface,E=n._granularity,x=n._ellipsoid,P=h.chordLength(E,x.maximumRadius),I=o(T)&&!w,D=S.length,O=0;if(A){var M=p.extractHeights(S,x),R=y;if(R.minDistance=P,R.ellipsoid=x,I){var L=0;for(a=0;a<D-1;a++)L+=p.numberOfPoints(S[a],S[a+1],P)+1;s=new Float64Array(3*L),b=new Uint8Array(4*L),R.positions=_,R.height=v;var N=0;for(a=0;a<D-1;++a){_[0]=S[a],_[1]=S[a+1],v[0]=M[a],v[1]=M[a+1];var k=p.generateArc(R);if(o(T)){var F=k.length/3;C=T[a];for(var B=0;B<F;++B)b[N++]=r.floatToByte(C.red),b[N++]=r.floatToByte(C.green),b[N++]=r.floatToByte(C.blue),b[N++]=r.floatToByte(C.alpha)}s.set(k,O),O+=k.length}}else if(R.positions=S,R.height=M,s=new Float64Array(p.generateArc(R)),o(T)){for(b=new Uint8Array(s.length/3*4),a=0;a<D-1;++a){var U=S[a],V=S[a+1],z=T[a],G=T[a+1];O=m(U,V,z,G,P,b,O)}var H=T[D-1];b[O++]=r.floatToByte(H.red),b[O++]=r.floatToByte(H.green),b[O++]=r.floatToByte(H.blue),b[O++]=r.floatToByte(H.alpha)}}else{g=I?2*D-2:D,s=new Float64Array(3*g),b=o(T)?new Uint8Array(4*g):void 0;var W=0,j=0;for(a=0;a<D;++a){var q=S[a];if(I&&a>0&&(t.pack(q,s,W),W+=3,C=T[a-1],b[j++]=r.floatToByte(C.red),b[j++]=r.floatToByte(C.green),b[j++]=r.floatToByte(C.blue),b[j++]=r.floatToByte(C.alpha)),I&&a===D-1)break;t.pack(q,s,W),W+=3,o(T)&&(C=T[a],b[j++]=r.floatToByte(C.red),b[j++]=r.floatToByte(C.green),b[j++]=r.floatToByte(C.blue),b[j++]=r.floatToByte(C.alpha))}}var Y=new c;Y.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s}),o(T)&&(Y.color=new u({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,values:b,normalize:!0})),g=s.length/3;var X=2*(g-1),Q=d.createTypedArray(g,X),Z=0;for(a=0;a<g-1;++a)Q[Z++]=a,Q[Z++]=a+1;return new l({attributes:Y,indices:Q,primitiveType:f.LINES,boundingSphere:e.fromPoints(S)})},g}),define("Core/SphereGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidGeometry","./VertexFormat"],function(e,t,r,i,n,o){"use strict";function a(t){var i=r(t.radius,1),o=new e(i,i,i),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,vertexFormat:t.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,r){return n.pack(e._ellipsoidGeometry,t,r)};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}),define("Core/SphereOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidOutlineGeometry"],function(e,t,r,i,n){"use strict";function o(t){var i=r(t.radius,1),o=new e(i,i,i),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"}o.packedLength=n.packedLength,o.pack=function(e,t,r){return n.pack(e._ellipsoidGeometry,t,r)};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}),define("Core/Spherical",["./Check","./defaultValue","./defined"],function(e,t,r){"use strict";function i(e,r,i){this.clock=t(e,0),this.cone=t(r,0),this.magnitude=t(i,1)}return i.fromCartesian3=function(e,t){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return r(t)||(t=new i),t.clock=Math.atan2(o,n),t.cone=Math.atan2(Math.sqrt(s),a),t.magnitude=Math.sqrt(s+a*a),t},i.clone=function(e,t){if(r(e))return r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new i(e.clock,e.cone,e.magnitude)},i.normalize=function(e,t){return r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new i(e.clock,e.cone,1)},i.equals=function(e,t){return e===t||r(e)&&r(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},i.equalsEpsilon=function(e,i,n){return n=t(n,0),e===i||r(e)&&r(i)&&Math.abs(e.clock-i.clock)<=n&&Math.abs(e.cone-i.cone)<=n&&Math.abs(e.magnitude-i.magnitude)<=n},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equalsEpsilon=function(e,t){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},i}),define("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t){for(var r=[],i=e.length,n=0;n<i;){var o=Math.ceil((i-n)/t--);r.push(e.slice(n,n+o)),n+=o}return r}return r}),define("Core/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return e(r.prototype,{credits:{get:t.throwInstantiationError},waterMask:{get:t.throwInstantiationError}}),r.prototype.interpolateHeight=t.throwInstantiationError,r.prototype.isChildAvailable=t.throwInstantiationError,r.prototype.createMesh=t.throwInstantiationError,r.prototype.upsample=t.throwInstantiationError,r.prototype.wasCreatedByUpsampling=t.throwInstantiationError,r}),define("Core/TilingScheme",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function r(e){}return e(r.prototype,{ellipsoid:{get:t.throwInstantiationError},rectangle:{get:t.throwInstantiationError},projection:{get:t.throwInstantiationError}}),r.prototype.getNumberOfXTilesAtLevel=t.throwInstantiationError,r.prototype.getNumberOfYTilesAtLevel=t.throwInstantiationError,r.prototype.rectangleToNativeRectangle=t.throwInstantiationError,r.prototype.tileXYToNativeRectangle=t.throwInstantiationError,r.prototype.tileXYToRectangle=t.throwInstantiationError,r.prototype.positionToTileXY=t.throwInstantiationError,r}),define("Core/TimeIntervalCollection",["./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GregorianDate","./isLeapYear","./Iso8601","./JulianDate","./TimeInterval"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t){return u.compare(e.start,t.start)}function h(e){if(this._intervals=[],this._changedEvent=new o,r(e))for(var t=e.length,i=0;i<t;i++)this.addInterval(e[i])}function p(e,t,i){r(i)||(i=new u),u.toGregorianDate(e,g);var n=g.millisecond+t.millisecond,o=g.second+t.second,a=g.minute+t.minute,l=g.hour+t.hour,c=g.day+t.day,d=g.month+t.month,h=g.year+t.year;for(n>=1e3&&(o+=Math.floor(n/1e3),n%=1e3),o>=60&&(a+=Math.floor(o/60),o%=60),a>=60&&(l+=Math.floor(a/60),a%=60),l>=24&&(c+=Math.floor(l/24),l%=24),_[2]=s(h)?29:28;c>_[d]||d>=13;)c>_[d]&&(c-=_[d],++d),d>=13&&(--d,h+=Math.floor(d/12),d%=12,++d),_[2]=s(h)?29:28;return g.millisecond=n,g.second=o,g.minute=a,g.hour=l,g.day=c,g.month=d,g.year=h,u.fromGregorianDate(g,i)}function f(e,t){if(!r(e)||0===e.length)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,"P"===e[0]){var i=e.match(y);if(!r(i))return!1;if(r(i[1])&&(t.year=Number(i[1].replace(",","."))),r(i[2])&&(t.month=Number(i[2].replace(",","."))),r(i[3])&&(t.day=7*Number(i[3].replace(",","."))),r(i[4])&&(t.day+=Number(i[4].replace(",","."))),r(i[5])&&(t.hour=Number(i[5].replace(",","."))),r(i[6])&&(t.minute=Number(i[6].replace(",","."))),r(i[7])){var n=Number(i[7].replace(",","."));t.second=Math.floor(n),t.millisecond=n%1*1e3}}else"Z"!==e[e.length-1]&&(e+="Z"),u.toGregorianDate(u.fromIso8601(e,v),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}i(h.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}}}),
h.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof h))return!1;var r=this._intervals,i=e._intervals,n=r.length;if(n!==i.length)return!1;for(var o=0;o<n;o++)if(!c.equals(r[o],i[o],t))return!1;return!0},h.prototype.get=function(e){return this._intervals[e]},h.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},h.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},h.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},h.prototype.contains=function(e){return this.indexOf(e)>=0};var m=new c;h.prototype.indexOf=function(t){var r=this._intervals;m.start=t,m.stop=t;var i=e(r,m,d);return i>=0?r[i].isStartIncluded?i:i>0&&r[i-1].stop.equals(t)&&r[i-1].isStopIncluded?i-1:~i:(i=~i,i>0&&i-1<r.length&&c.contains(r[i-1],t)?i-1:~i)},h.prototype.findInterval=function(e){e=t(e,t.EMPTY_OBJECT);for(var i=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((!r(i)||c.start.equals(i))&&(!r(n)||c.stop.equals(n))&&(!r(o)||c.isStartIncluded===o)&&(!r(a)||c.isStopIncluded===a))return s[l]}},h.prototype.addInterval=function(t,i){if(!t.isEmpty){var n,o,a=this._intervals;if(0===a.length||u.greaterThan(t.start,a[a.length-1].stop))return a.push(t),void this._changedEvent.raiseEvent(this);for(o=e(a,t,d),o<0?o=~o:o>0&&t.isStartIncluded&&a[o-1].isStartIncluded&&a[o-1].start.equals(t.start)?--o:o<a.length&&!t.isStartIncluded&&a[o].isStartIncluded&&a[o].start.equals(t.start)&&++o,o>0&&((n=u.compare(a[o-1].stop,t.start))>0||0===n&&(a[o-1].isStopIncluded||t.isStartIncluded))&&((r(i)?i(a[o-1].data,t.data):a[o-1].data===t.data)?(t=new c(u.greaterThan(t.stop,a[o-1].stop)?{start:a[o-1].start,stop:t.stop,isStartIncluded:a[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:a[o-1].start,stop:a[o-1].stop,isStartIncluded:a[o-1].isStartIncluded,isStopIncluded:a[o-1].isStopIncluded||t.stop.equals(a[o-1].stop)&&t.isStopIncluded,data:t.data}),a.splice(o-1,1),--o):(n=u.compare(a[o-1].stop,t.stop),n>0||0===n&&a[o-1].isStopIncluded&&!t.isStopIncluded?a.splice(o-1,1,new c({start:a[o-1].start,stop:t.start,isStartIncluded:a[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:a[o-1].data}),new c({start:t.stop,stop:a[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:a[o-1].isStopIncluded,data:a[o-1].data})):a[o-1]=new c({start:a[o-1].start,stop:t.start,isStartIncluded:a[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:a[o-1].data})));o<a.length&&((n=u.compare(t.stop,a[o].start))>0||0===n&&(t.isStopIncluded||a[o].isStartIncluded));)if(r(i)?i(a[o].data,t.data):a[o].data===t.data)t=new c({start:t.start,stop:u.greaterThan(a[o].stop,t.stop)?a[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:u.greaterThan(a[o].stop,t.stop)?a[o].isStopIncluded:t.isStopIncluded,data:t.data}),a.splice(o,1);else{if(a[o]=new c({start:t.stop,stop:a[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:a[o].isStopIncluded,data:a[o].data}),!a[o].isEmpty)break;a.splice(o,1)}a.splice(o,0,t),this._changedEvent.raiseEvent(this)}},h.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var r=!1,i=this._intervals,n=e(i,t,d);n<0&&(n=~n);var o=t.start,a=t.stop,s=t.isStartIncluded,l=t.isStopIncluded;if(n>0){var h=i[n-1],p=h.stop;(u.greaterThan(p,o)||c.equals(p,o)&&h.isStopIncluded&&s)&&(r=!0,(u.greaterThan(p,a)||h.isStopIncluded&&!l&&c.equals(p,a))&&i.splice(n,0,new c({start:a,stop:p,isStartIncluded:!l,isStopIncluded:h.isStopIncluded,data:h.data})),i[n-1]=new c({start:h.start,stop:o,isStartIncluded:h.isStartIncluded,isStopIncluded:!s,data:h.data}))}var f=i[n];for(n<i.length&&!s&&f.isStartIncluded&&o.equals(f.start)&&(r=!0,i.splice(n,0,new c({start:f.start,stop:f.start,isStartIncluded:!0,isStopIncluded:!0,data:f.data})),++n,f=i[n]);n<i.length&&u.greaterThan(a,f.stop);)r=!0,i.splice(n,1),f=i[n];return n<i.length&&a.equals(f.stop)&&(r=!0,!l&&f.isStopIncluded?(n+1<i.length&&i[n+1].start.equals(a)&&f.data===i[n+1].data?(i.splice(n,1),f=new c({start:f.start,stop:f.stop,isStartIncluded:!0,isStopIncluded:f.isStopIncluded,data:f.data})):f=new c({start:a,stop:a,isStartIncluded:!0,isStopIncluded:!0,data:f.data}),i[n]=f):i.splice(n,1)),n<i.length&&(u.greaterThan(a,f.start)||a.equals(f.start)&&l&&f.isStartIncluded)&&(r=!0,i[n]=new c({start:a,stop:f.stop,isStartIncluded:!l,isStopIncluded:f.isStopIncluded,data:f.data})),r&&this._changedEvent.raiseEvent(this),r},h.prototype.intersect=function(e,t,i){for(var n=0,o=0,a=new h,s=this._intervals,l=e._intervals;n<s.length&&o<l.length;){var d=s[n],p=l[o];if(u.lessThan(d.stop,p.start))++n;else if(u.lessThan(p.stop,d.start))++o;else{if(r(i)||r(t)&&t(d.data,p.data)||!r(t)&&p.data===d.data){var f=c.intersect(d,p,new c,i);f.isEmpty||a.addInterval(f,t)}u.lessThan(d.stop,p.stop)||d.stop.equals(p.stop)&&!d.isStopIncluded&&p.isStopIncluded?++n:++o}}return a},h.fromJulianDateArray=function(e,i){r(i)||(i=new h);var n,o=e.julianDates,a=o.length,s=e.dataCallback,u=t(e.isStartIncluded,!0),d=t(e.isStopIncluded,!0),p=t(e.leadingInterval,!1),f=t(e.trailingInterval,!1),m=0;p&&(++m,n=new c({start:l.MINIMUM_VALUE,stop:o[0],isStartIncluded:!0,isStopIncluded:!u}),n.data=r(s)?s(n,i.length):i.length,i.addInterval(n));for(var g=0;g<a-1;++g){var _=o[g],v=o[g+1];n=new c({start:_,stop:v,isStartIncluded:i.length!==m||u,isStopIncluded:g===a-2&&d}),n.data=r(s)?s(n,i.length):i.length,i.addInterval(n),_=v}return f&&(n=new c({start:o[a-1],stop:l.MAXIMUM_VALUE,isStartIncluded:!d,isStopIncluded:!0}),n.data=r(s)?s(n,i.length):i.length,i.addInterval(n)),i};var g=new a,_=[0,31,28,31,30,31,30,31,31,30,31,30,31],v=new u,y=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/,b=new a;return h.fromIso8601=function(e,t){var r=e.iso8601.split("/"),i=u.fromIso8601(r[0]),n=u.fromIso8601(r[1]),o=[];if(f(r[2],b)){var a=u.clone(i);for(o.push(a);u.compare(a,n)<0;){a=p(a,b);u.compare(n,a)<=0&&u.clone(n,a),o.push(a)}}else o.push(i,n);return h.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},h.fromIso8601DateArray=function(e,t){return h.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(e){return u.fromIso8601(e)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},h.fromIso8601DurationArray=function(e,i){for(var n,o,a=e.epoch,s=e.iso8601Durations,l=t(e.relativeToPrevious,!1),u=[],c=s.length,d=0;d<c;++d)(f(s[d],b)||0===d)&&(n=l&&r(o)?p(o,b):p(a,b),u.push(n),o=n);return h.fromJulianDateArray({julianDates:u,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},i)},h}),define("Core/TranslationRotationScale",["./Cartesian3","./defaultValue","./defined","./Quaternion"],function(e,t,r,i){"use strict";var n=new e(1,1,1),o=e.ZERO,a=i.IDENTITY,s=function(r,s,l){this.translation=e.clone(t(r,o)),this.rotation=i.clone(t(s,a)),this.scale=e.clone(t(l,n))};return s.prototype.equals=function(t){return this===t||r(t)&&e.equals(this.translation,t.translation)&&i.equals(this.rotation,t.rotation)&&e.equals(this.scale,t.scale)},s}),define("Core/VideoSynchronizer",["./defaultValue","./defined","./defineProperties","./destroyObject","./Iso8601","./JulianDate"],function(e,t,r,i,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 r(a.prototype,{clock:{get:function(){return this._clock},set:function(e){var r=this._clock;r!==e&&(t(r)&&(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 r=this._element;r!==e&&(t(r)&&r.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,i(this)},a.prototype.isDestroyed=function(){return!1},a.prototype._onTick=function(r){var i=this._element;if(t(i)&&!(i.readyState<2)){var a=i.paused,s=r.shouldAnimate;if(s===a&&(s?i.play():i.pause()),this._seeking||this._firstTickAfterSeek)return void(this._firstTickAfterSeek=!1);i.playbackRate=r.multiplier;var l,u=r.currentTime,c=e(this.epoch,n.MINIMUM_VALUE),d=o.secondsDifference(u,c),h=i.duration,p=i.currentTime;i.loop?(d%=h,d<0&&(d=h-d),l=d):l=d>h?h:d<0?0:d;var f=s?e(this.tolerance,1):.001;Math.abs(l-p)>f&&(this._seeking=!0,i.currentTime=l)}},a}),define("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./deprecationWarning","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./Math","./Rectangle","./Resource","./TerrainProvider","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(e,t){this.rectangle=e,this.maxLevel=t}function v(n){function a(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void c("SRS "+t+" is not supported.");C._tilingScheme=new u({ellipsoid:S});var r=e.getElementsByTagName("TileFormat")[0];C._heightmapWidth=parseInt(r.getAttribute("width"),10),C._heightmapHeight=parseInt(r.getAttribute("height"),10),C._levelZeroMaximumGeometricError=m.getEstimatedLevelZeroGeometricErrorForAHeightmap(S,Math.min(C._heightmapWidth,C._heightmapHeight),C._tilingScheme.getNumberOfXTilesAtLevel(0));for(var i=e.getElementsByTagName("DataExtent"),n=0;n<i.length;++n){var o=i[n],a=h.toRadians(parseFloat(o.getAttribute("minx"))),s=h.toRadians(parseFloat(o.getAttribute("miny"))),l=h.toRadians(parseFloat(o.getAttribute("maxx"))),d=h.toRadians(parseFloat(o.getAttribute("maxy"))),f=parseInt(o.getAttribute("maxlevel"),10);C._rectangles.push(new _(new p(a,s,l,d),f))}C._ready=!0,C._readyPromise.resolve(!0)}function c(e){var t=r(e,"An error occurred while accessing "+C._resource.url+".");b=g.handleError(b,C,C._errorEvent,t,void 0,void 0,void 0,d)}function d(){e(C._resource.fetchXML(),a,c)}n=r(n,r.EMPTY_OBJECT),i(n.proxy)&&o("VRTheWorldTerrainProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var v=f.createIfNeeded(n.url,{proxy:n.proxy});this._resource=v,this._errorEvent=new l,this._ready=!1,this._readyPromise=e.defer(),this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var y=n.credit;"string"==typeof y&&(y=new t({text:y})),this._credit=y,this._tilingScheme=void 0,this._rectangles=[];var b,C=this,S=r(n.ellipsoid,s.WGS84);d()}function y(e,t,r,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,r,n),l=0,u=0;u<a.length&&15!==l;++u){var c=a[u];if(!(c.maxLevel<=n)){var d=c.rectangle,h=p.intersection(d,s,C);i(h)&&(b(o,d,2*t,2*r,n+1)&&(l|=4),b(o,d,2*t+1,2*r,n+1)&&(l|=8),b(o,d,2*t,2*r+1,n+1)&&(l|=1),b(o,d,2*t+1,2*r+1,n+1)&&(l|=2))}}return l}function b(e,t,r,n,o){var a=e.tileXYToRectangle(r,n,o);return i(p.intersection(a,t,C))}n(v.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}}}),v.prototype.requestTileGeometry=function(t,r,n,o){var a=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:n+"/"+t+"/"+(a-r-1)+".tif",queryParameters:{cesium:!0},request:o}),l=s.fetchImage();if(i(l)){var u=this;return e(l,function(e){return new d({buffer:c(e),width:u._heightmapWidth,height:u._heightmapHeight,childTileMask:y(u,t,r,n),structure:u._terrainDataStructure})})}},v.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var C=new p;return v.prototype.getTileDataAvailable=function(e,t,r){},v}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){return i.equalsEpsilon(e.latitude,t.latitude,i.EPSILON14)&&i.equalsEpsilon(e.longitude,t.longitude,i.EPSILON14)}function l(r,i,n,o){var a=i.length;if(!(a<2)){var l=t(o),u=t(n),h=!0,p=new Array(a),f=new Array(a),m=new Array(a),g=i[0];p[0]=g;var _=r.cartesianToCartographic(g,c);u&&(_.height=n[0]),h=h&&_.height<=0,f[0]=_.height,m[0]=l?o[0]:0;for(var v=1,y=1;y<a;++y){var b=i[y],C=r.cartesianToCartographic(b,d);u&&(C.height=n[y]),h=h&&C.height<=0,s(_,C)?_.height<C.height&&(f[v-1]=C.height):(p[v]=b,f[v]=C.height,m[v]=l?o[y]:0,e.clone(C,_),++v)}if(!(h||v<2))return p.length=v,f.length=v,m.length=v,{positions:p,topHeights:f,bottomHeights:m}}}var u={},c=new e,d=new e,h=new Array(2),p=new Array(2),f={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return u.computePositions=function(e,s,u,c,d,m){var g=l(e,s,u,c);if(t(g)){if(s=g.positions,u=g.topHeights,c=g.bottomHeights,s.length>=3){var _=r.fromPoints(s,e),v=_.projectPointsOntoPlane(s);n.computeWindingOrder2D(v)===a.CLOCKWISE&&(s.reverse(),u.reverse(),c.reverse())}var y,b,C=s.length,S=C-2,T=i.chordLength(d,e.maximumRadius),w=f;if(w.minDistance=T,w.ellipsoid=e,m){var A,E=0;for(A=0;A<C-1;A++)E+=o.numberOfPoints(s[A],s[A+1],T)+1;y=new Float64Array(3*E),b=new Float64Array(3*E);var x=h,P=p;w.positions=x,w.height=P;var I=0;for(A=0;A<C-1;A++){x[0]=s[A],x[1]=s[A+1],P[0]=u[A],P[1]=u[A+1];var D=o.generateArc(w);y.set(D,I),P[0]=c[A],P[1]=c[A+1],b.set(o.generateArc(w),I),I+=D.length}}else w.positions=s,w.height=u,y=new Float64Array(o.generateArc(w)),w.height=c,b=new Float64Array(o.generateArc(w));return{bottomPositions:b,topPositions:y,numCorners:S}}},u}),define("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=i(e,i.EMPTY_OBJECT);var r=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=i(e.vertexFormat,p.DEFAULT),u=i(e.granularity,d.RADIANS_PER_DEGREE),c=i(e.ellipsoid,a.WGS84);this._positions=r,this._minimumHeights=s,this._maximumHeights=o,this._vertexFormat=p.clone(l),this._granularity=u,this._ellipsoid=a.clone(c),this._workerName="createWallGeometry";var h=1+r.length*t.packedLength+2;n(s)&&(h+=s.length),n(o)&&(h+=o.length),this.packedLength=h+a.packedLength+p.packedLength+1}var g=new t,_=new t,v=new t,y=new t,b=new t,C=new t,S=new t,T=new t;m.pack=function(e,r,o){o=i(o,0);var s,l=e._positions,u=l.length;for(r[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],r,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,r[o++]=u,n(c))for(s=0;s<u;++s)r[o++]=c[s];var d=e._maximumHeights;if(u=n(d)?d.length:0,r[o++]=u,n(d))for(s=0;s<u;++s)r[o++]=d[s];return a.pack(e._ellipsoid,r,o),o+=a.packedLength,p.pack(e._vertexFormat,r,o),o+=p.packedLength,r[o]=e._granularity,r};var w=a.clone(a.UNIT_SPHERE),A=new p,E={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:w,vertexFormat:A,granularity:void 0};return m.unpack=function(e,r,o){r=i(r,0);var s,l=e[r++],u=new Array(l);for(s=0;s<l;++s,r+=t.packedLength)u[s]=t.unpack(e,r);l=e[r++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[r++];l=e[r++];var d;if(l>0)for(d=new Array(l),s=0;s<l;++s)d[s]=e[r++];var h=a.unpack(e,r,w);r+=a.packedLength;var f=p.unpack(e,r,A);r+=p.packedLength;var g=e[r];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=d,o._ellipsoid=a.clone(h,o._ellipsoid),o._vertexFormat=p.clone(f,o._vertexFormat),o._granularity=g,o):(E.positions=u,E.minimumHeights=c,E.maximumHeights=d,E.granularity=g,new m(E))},m.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t,r,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,r=u?new Array(c):void 0;for(var d=0;d<c;++d)l&&(t[d]=a),u&&(r[d]=s)}return new m({positions:o,maximumHeights:r,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat})},m.createGeometry=function(i){var o=i._positions,a=i._minimumHeights,p=i._maximumHeights,m=i._vertexFormat,w=i._granularity,A=i._ellipsoid,E=f.computePositions(A,o,p,a,w,!0);if(n(E)){var x=E.bottomPositions,P=E.topPositions,I=E.numCorners,D=P.length,O=2*D,M=m.position?new Float64Array(O):void 0,R=m.normal?new Float32Array(O):void 0,L=m.tangent?new Float32Array(O):void 0,N=m.bitangent?new Float32Array(O):void 0,k=m.st?new Float32Array(O/3*2):void 0,F=0,B=0,U=0,V=0,z=0,G=T,H=S,W=C,j=!0;D/=3;var q,Y=0,X=1/(D-o.length+1);for(q=0;q<D;++q){var Q=3*q,Z=t.fromArray(P,Q,g),K=t.fromArray(x,Q,_);if(m.position&&(M[F++]=K.x,M[F++]=K.y,M[F++]=K.z,M[F++]=Z.x,M[F++]=Z.y,M[F++]=Z.z),m.st&&(k[z++]=Y,k[z++]=0,k[z++]=Y,k[z++]=1),m.normal||m.tangent||m.bitangent){var J,$=t.clone(t.ZERO,b),ee=A.scaleToGeodeticSurface(t.fromArray(P,Q,_),_);if(q+1<D&&(J=A.scaleToGeodeticSurface(t.fromArray(P,Q+3,v),v),$=t.fromArray(P,Q+3,b)),j){var te=t.subtract($,Z,y),re=t.subtract(ee,Z,g);G=t.normalize(t.cross(re,te,G),G),j=!1}t.equalsEpsilon(J,ee,d.EPSILON10)?j=!0:(Y+=X,m.tangent&&(H=t.normalize(t.subtract(J,ee,H),H)),m.bitangent&&(W=t.normalize(t.cross(G,H,W),W))),m.normal&&(R[B++]=G.x,R[B++]=G.y,R[B++]=G.z,R[B++]=G.x,R[B++]=G.y,R[B++]=G.z),m.tangent&&(L[V++]=H.x,L[V++]=H.y,L[V++]=H.z,L[V++]=H.x,L[V++]=H.y,L[V++]=H.z),m.bitangent&&(N[U++]=W.x,N[U++]=W.y,N[U++]=W.z,N[U++]=W.x,N[U++]=W.y,N[U++]=W.z)}}var ie=new u;m.position&&(ie.position=new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:M})),m.normal&&(ie.normal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R})),m.tangent&&(ie.tangent=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),m.bitangent&&(ie.bitangent=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:N})),m.st&&(ie.st=new l({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:k}));var ne=O/3;O-=6*(I+1);var oe=c.createTypedArray(ne,O),ae=0;for(q=0;q<ne-2;q+=2){var se=q,le=q+2,ue=t.fromArray(M,3*se,g),ce=t.fromArray(M,3*le,_);if(!t.equalsEpsilon(ue,ce,d.EPSILON10)){var de=q+1,he=q+3;oe[ae++]=de,oe[ae++]=se,oe[ae++]=he,oe[ae++]=he,oe[ae++]=se,oe[ae++]=le}}return new s({attributes:ie,indices:oe,primitiveType:h.TRIANGLES,boundingSphere:new e.fromVertices(M)})}},m}),define("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){e=i(e,i.EMPTY_OBJECT);var r=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=i(e.granularity,d.RADIANS_PER_DEGREE),u=i(e.ellipsoid,a.WGS84);this._positions=r,this._minimumHeights=s,this._maximumHeights=o,this._granularity=l,this._ellipsoid=a.clone(u),this._workerName="createWallOutlineGeometry";var c=1+r.length*t.packedLength+2;n(s)&&(c+=s.length),n(o)&&(c+=o.length),this.packedLength=c+a.packedLength+1}var m=new t,g=new t;f.pack=function(e,r,o){o=i(o,0);var s,l=e._positions,u=l.length;for(r[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],r,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,r[o++]=u,n(c))for(s=0;s<u;++s)r[o++]=c[s];var d=e._maximumHeights;if(u=n(d)?d.length:0,r[o++]=u,n(d))for(s=0;s<u;++s)r[o++]=d[s];return a.pack(e._ellipsoid,r,o),o+=a.packedLength,r[o]=e._granularity,r};var _=a.clone(a.UNIT_SPHERE),v={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:_,granularity:void 0};return f.unpack=function(e,r,o){r=i(r,0);var s,l=e[r++],u=new Array(l);for(s=0;s<l;++s,r+=t.packedLength)u[s]=t.unpack(e,r);l=e[r++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[r++];l=e[r++];var d;if(l>0)for(d=new Array(l),s=0;s<l;++s)d[s]=e[r++];var h=a.unpack(e,r,_);r+=a.packedLength;var p=e[r];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=d,o._ellipsoid=a.clone(h,o._ellipsoid),o._granularity=p,o):(v.positions=u,v.minimumHeights=c,v.maximumHeights=d,v.granularity=p,new f(v))},f.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t,r,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,r=u?new Array(c):void 0;for(var d=0;d<c;++d)l&&(t[d]=a),u&&(r[d]=s)}return new f({positions:o,maximumHeights:r,minimumHeights:t,ellipsoid:e.ellipsoid})},f.createGeometry=function(i){var o=i._positions,a=i._minimumHeights,f=i._maximumHeights,_=i._granularity,v=i._ellipsoid,y=p.computePositions(v,o,f,a,_,!1);if(n(y)){var b=y.bottomPositions,C=y.topPositions,S=C.length,T=2*S,w=new Float64Array(T),A=0;S/=3;var E;for(E=0;E<S;++E){var x=3*E,P=t.fromArray(C,x,m),I=t.fromArray(b,x,g);w[A++]=I.x,w[A++]=I.y,w[A++]=I.z,w[A++]=P.x,w[A++]=P.y,w[A++]=P.z}var D=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:w})}),O=T/3;T=2*O-4+O;var M=c.createTypedArray(O,T),R=0;for(E=0;E<O-2;E+=2){var L=E,N=E+2,k=t.fromArray(w,3*L,m),F=t.fromArray(w,3*N,g);if(!t.equalsEpsilon(k,F,d.EPSILON10)){var B=E+1,U=E+3;M[R++]=B,M[R++]=L,M[R++]=B,M[R++]=U,M[R++]=L,M[R++]=N}}return M[R++]=O-2,M[R++]=O-1,new s({attributes:D,indices:M,primitiveType:h.LINES,boundingSphere:new e.fromVertices(w)})}},f}),define("Core/WebMercatorTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Rectangle","./WebMercatorProjection"],function(e,t,r,i,n,o,a){"use strict";function s(i){if(i=t(i,{}),this._ellipsoid=t(i.ellipsoid,n.WGS84),this._numberOfLevelZeroTilesX=t(i.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=t(i.numberOfLevelZeroTilesY,1),this._projection=new a(this._ellipsoid),r(i.rectangleSouthwestInMeters)&&r(i.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=i.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=i.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 i(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 i=this._projection,n=i.project(o.southwest(e)),a=i.project(o.northeast(e));return r(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,i,n){var a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),l=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/a,u=this._rectangleSouthwestInMeters.x+e*l,c=this._rectangleSouthwestInMeters.x+(e+1)*l,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,h=this._rectangleNortheastInMeters.y-t*d,p=this._rectangleNortheastInMeters.y-(t+1)*d;return r(n)?(n.west=u,n.south=p,n.east=c,n.north=h,n):new o(u,p,c,h)},s.prototype.tileXYToRectangle=function(t,r,i,n){var o=this.tileXYToNativeRectangle(t,r,i,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,i,n){var a=this._rectangle;if(o.contains(a,t)){var s=this.getNumberOfXTilesAtLevel(i),l=this.getNumberOfYTilesAtLevel(i),u=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,c=u/s,d=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,h=d/l,p=this._projection,f=p.project(t),m=f.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-f.y,_=m/c|0;_>=s&&(_=s-1);var v=g/h|0;return v>=l&&(v=l-1),r(n)?(n.x=_,n.y=v,n):new e(_,v)}},s}),define("Core/WeightSpline",["./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./Spline"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var r=e.weights,i=e.times;this._times=i,this._weights=r,this._count=r.length/i.length,this._lastTimeIndex=0}return i(a.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.wrapTime=o.prototype.wrapTime,a.prototype.clampTime=o.prototype.clampTime,a.prototype.evaluate=function(e,t){var i=this.weights,n=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),a=(e-n[o])/(n[o+1]-n[o]);r(t)||(t=new Array(this._count));for(var s=0;s<this._count;s++){var l=o*this._count+s;t[s]=i[l]*(1-a)+i[l+this._count]*a}return t},a}),define("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,r){return function(){r.apply(e,arguments),t.apply(e,arguments)}}return t}),define("DataSources/ConstantProperty",["../Core/defined","../Core/defineProperties","../Core/Event"],function(e,t,r){"use strict";function i(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new r,this.setValue(e)}return t(i.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),i.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},i.prototype.setValue=function(t){var r=this._value;if(r!==t){var i=e(t),n=i&&"function"==typeof t.clone,o=i&&"function"==typeof t.equals;(!o||!t.equals(r))&&(this._hasClone=n,this._hasEquals=o,this._value=n?t.clone(this._value):t,this._definitionChanged.raiseEvent(this))}},i.prototype.equals=function(e){return this===e||e instanceof i&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},i.prototype.valueOf=function(){return this._value},i.prototype.toString=function(){return String(this._value)},i}),define("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,r){"use strict";function i(e,r,i,n,o){return{configurable:n,get:function(){return this[r]},set:function(n){var a=this[r],s=this[i];t(s)&&(s(),this[i]=void 0),!(void 0!==n)||t(n)&&t(n.getValue)||!t(o)||(n=o(n)),a!==n&&(this[r]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[i]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new r(e)}function o(t,r,o){return i(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(r,!1),e(o,n))}return o}),define("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,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._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(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"),disableDepthTestDistance:o("disableDepthTestDistance")}),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.disableDepthTestDistance=this._disableDepthTestDistance,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),this.disableDepthTestDistance=e(this._disableDepthTestDistance,t.disableDepthTestDistance)},a}),define("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";return e({NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2})}),define("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";return e({CENTER:0,LEFT:1,RIGHT:-1})}),define("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";return e({CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1})}),define("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";return e({DONE:0,PENDING:1,FAILED:2})}),define("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,r,i){"use strict";function n(){i.throwInstantiationError()}return r(n.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError}}),n.prototype.getValue=i.throwInstantiationError,n.prototype.equals=i.throwInstantiationError,n.equals=function(e,r){return e===r||t(e)&&e.equals(r)},n.arrayEquals=function(e,r){if(e===r)return!0;if(!t(e)||!t(r)||e.length!==r.length)return!1;for(var i=e.length,o=0;o<i;o++)if(!n.equals(e[o],r[o]))return!1;return!0},n.isConstant=function(e){return!t(e)||e.isConstant},n.getValueOrUndefined=function(e,r,i){return t(e)?e.getValue(r,i):void 0},n.getValueOrDefault=function(r,i,n,o){return t(r)?e(r.getValue(i,o),n):n},n.getValueOrClonedDefault=function(e,r,i,n){var o;return t(e)&&(o=e.getValue(r,n)),t(o)||(o=i.clone(o)),o},n}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function g(t,r){r.collectionChanged.addEventListener(g.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function _(e,t,r){o(e)&&(e.billboard=void 0,r.removeBillboard(t))}var v=n.WHITE,y=i.ZERO,b=c.NONE,C=r.ZERO,S=i.ZERO,T=d.CENTER,w=h.CENTER,A=new i,E=new n,x=new i,P=new r,I=new u,D=new u,O=new u,M=new t,R=new l;return g.prototype.update=function(e){for(var t=this._items.values,r=this._cluster,i=0,n=t.length;i<n;i++){var a,s=t[i],l=s.entity,u=l._billboard,c=s.billboard,d=l.isShowing&&l.isAvailable(e)&&f.getValueOrDefault(u._show,e,!0);if(d&&(A=f.getValueOrUndefined(l._position,e,A),a=f.getValueOrUndefined(u._image,e),d=o(A)&&o(a)),d){f.isConstant(l._position)||(r._clusterDirty=!0),o(c)||(c=r.getBillboard(l),c.id=l,c.image=void 0,s.billboard=c),c.show=d,o(c.image)&&s.textureValue===a||(c.image=a,s.textureValue=a),c.position=A,c.color=f.getValueOrDefault(u._color,e,v,E),c.eyeOffset=f.getValueOrDefault(u._eyeOffset,e,y,x),c.heightReference=f.getValueOrDefault(u._heightReference,e,b),c.pixelOffset=f.getValueOrDefault(u._pixelOffset,e,C,P),c.scale=f.getValueOrDefault(u._scale,e,1),c.rotation=f.getValueOrDefault(u._rotation,e,0),c.alignedAxis=f.getValueOrDefault(u._alignedAxis,e,S),c.horizontalOrigin=f.getValueOrDefault(u._horizontalOrigin,e,T),c.verticalOrigin=f.getValueOrDefault(u._verticalOrigin,e,w),c.width=f.getValueOrUndefined(u._width,e),c.height=f.getValueOrUndefined(u._height,e),c.scaleByDistance=f.getValueOrUndefined(u._scaleByDistance,e,I),c.translucencyByDistance=f.getValueOrUndefined(u._translucencyByDistance,e,D),c.pixelOffsetScaleByDistance=f.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,O),c.sizeInMeters=f.getValueOrDefault(u._sizeInMeters,e,!1),c.distanceDisplayCondition=f.getValueOrUndefined(u._distanceDisplayCondition,e,R),c.disableDepthTestDistance=f.getValueOrDefault(u._disableDepthTestDistance,e,0);var h=f.getValueOrUndefined(u._imageSubRegion,e,M);o(h)&&c.setImageSubRegion(c._imageId,h)}else _(s,l,r)}return!0},g.prototype.getBoundingSphere=function(e,t){var r=this._items.get(e.id);if(!o(r)||!o(r.billboard))return p.FAILED;var n=r.billboard;if(n.heightReference===c.NONE)t.center=i.clone(n.position,t.center);else{if(!o(n._clampedPosition))return p.PENDING;t.center=i.clone(n._clampedPosition,t.center)}return t.radius=0,p.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.removeBillboard(e[t]);return a(this)},g.prototype._onCollectionChanged=function(e,t,r,i){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 m(a));for(n=i.length-1;n>-1;n--)a=i[n],o(a._billboard)&&o(a._position)?s.contains(a.id)||s.set(a.id,new m(a)):(_(s.get(a.id),a,l),s.remove(a.id));for(n=r.length-1;n>-1;n--)a=r[n],_(s.get(a.id),a,l),s.remove(a.id)},g}),define("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\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"}),define("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 bitangent;\nattribute vec2 st;\nattribute float batchId;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\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_bitangentEC = czm_normal * bitangent;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n"}),define("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"}),define("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"}),define("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"}),define("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"}),define("Scene/BlendEquation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT,MIN:t.MIN,MAX:t.MAX})}),define("Scene/BlendFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({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})}),define("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,r){"use strict";return e({DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.SOURCE_ALPHA,functionSourceAlpha:r.SOURCE_ALPHA,functionDestinationRgb:r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.ONE,functionSourceAlpha:r.ONE,functionDestinationRgb:r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.SOURCE_ALPHA,functionSourceAlpha:r.SOURCE_ALPHA,functionDestinationRgb:r.ONE,functionDestinationAlpha:r.ONE})})}),define("Scene/CullFace",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK})}),define("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this.material=e.material,this.translucent=r(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=r(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"),i(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return i(this.material)&&this.material.isTranslucent()||!i(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),r=e(this.renderState,!1);return t?(r.depthMask=!1,r.blending=o.ALPHA_BLEND):r.depthMask=!0,r},s.getDefaultRenderState=function(e,r,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),r&&(s.cull={enabled:!0,face:a.BACK}),i(n)&&(s=t(n,s,!0)),s},s}),define("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}),define("Renderer/CubeMapFace",["../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,r,i,n){"use strict";function o(e,t,r,i,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=r,this._targetFace=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return r(o.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),o.prototype.copyFrom=function(e,r,i){r=t(r,0),i=t(i,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),e.arrayBufferView?n.texSubImage2D(this._targetFace,0,r,i,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(this._targetFace,0,r,i,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},o.prototype.copyFromFramebuffer=function(e,r,i,n,o,a){e=t(e,0),r=t(r,0),i=t(i,0),n=t(n,0),o=t(o,this._size),a=t(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,r,i,n,o,a),s.bindTexture(l,null)},o}),define("Renderer/MipmapHint",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===r.DONT_CARE||e===r.FASTEST||e===r.NICEST}};return e(r)}),define("Renderer/TextureMagnificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===r.NEAREST||e===r.LINEAR}};return e(r)}),define("Renderer/TextureMinificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={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===r.NEAREST||e===r.LINEAR||e===r.NEAREST_MIPMAP_NEAREST||e===r.LINEAR_MIPMAP_NEAREST||e===r.NEAREST_MIPMAP_LINEAR||e===r.LINEAR_MIPMAP_LINEAR}};return e(r)}),define("Renderer/TextureWrap",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===r.CLAMP_TO_EDGE||e===r.REPEAT||e===r.MIRRORED_REPEAT}};return e(r)}),define("Renderer/Sampler",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var i=t(e.wrapS,s.CLAMP_TO_EDGE),n=t(e.wrapT,s.CLAMP_TO_EDGE),l=t(e.minificationFilter,a.LINEAR),u=t(e.magnificationFilter,o.LINEAR),c=r(e.maximumAnisotropy)?e.maximumAnisotropy:1;this._wrapS=i,this._wrapT=n,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return i(l.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}}}),l}),define("Renderer/CubeMap",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){function i(e,t){t.arrayBufferView?v.texImage2D(e,0,p,c,c,0,p,f,t.arrayBufferView):v.texImage2D(e,0,p,p,f,t)}e=t(e,t.EMPTY_OBJECT);var n,o=e.context,a=e.source;if(r(a)){var l=[a.positiveX,a.negativeX,a.positiveY,a.negativeY,a.positiveZ,a.negativeZ];n=l[0].width,l[0].height}else n=e.width,e.height;var c=n,p=t(e.pixelFormat,s.RGBA),f=t(e.pixelDatatype,d.UNSIGNED_BYTE),m=6*s.textureSizeInBytes(p,f,c,c),g=e.preMultiplyAlpha||p===s.RGB||p===s.LUMINANCE,_=t(e.flipY,!0),v=o._gl,y=v.TEXTURE_CUBE_MAP,b=v.createTexture();v.activeTexture(v.TEXTURE0),v.bindTexture(y,b),r(a)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,_),i(v.TEXTURE_CUBE_MAP_POSITIVE_X,a.positiveX),i(v.TEXTURE_CUBE_MAP_NEGATIVE_X,a.negativeX),i(v.TEXTURE_CUBE_MAP_POSITIVE_Y,a.positiveY),i(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,a.negativeY),i(v.TEXTURE_CUBE_MAP_POSITIVE_Z,a.positiveZ),i(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,a.negativeZ)):(v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_X,0,p,c,c,0,p,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_X,0,p,c,c,0,p,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Y,0,p,c,c,0,p,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,p,c,c,0,p,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Z,0,p,c,c,0,p,f,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,p,c,c,0,p,f,null)),v.bindTexture(y,null),this._gl=v,this._textureFilterAnisotropic=o._textureFilterAnisotropic,this._textureTarget=y,this._texture=b,this._pixelFormat=p,this._pixelDatatype=f,this._size=c,this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=g,this._flipY=_,this._sampler=void 0,this._positiveX=new u(v,b,y,v.TEXTURE_CUBE_MAP_POSITIVE_X,p,f,c,g,_),this._negativeX=new u(v,b,y,v.TEXTURE_CUBE_MAP_NEGATIVE_X,p,f,c,g,_),this._positiveY=new u(v,b,y,v.TEXTURE_CUBE_MAP_POSITIVE_Y,p,f,c,g,_),this._negativeY=new u(v,b,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Y,p,f,c,g,_),this._positiveZ=new u(v,b,y,v.TEXTURE_CUBE_MAP_POSITIVE_Z,p,f,c,g,_),this._negativeZ=new u(v,b,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Z,p,f,c,g,_),this.sampler=r(e.sampler)?e.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 t=e.minificationFilter,i=e.magnificationFilter,n=t===f.NEAREST_MIPMAP_NEAREST||t===f.NEAREST_MIPMAP_LINEAR||t===f.LINEAR_MIPMAP_NEAREST||t===f.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===d.FLOAT&&(t=n?f.NEAREST_MIPMAP_NEAREST:f.NEAREST,i=p.NEAREST);var o=this._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,i),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),r(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}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),m.prototype.generateMipmap=function(e){e=t(e,c.DONT_CARE),this._hasMipmap=!0;var r=this._gl,i=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,e),r.activeTexture(r.TEXTURE0),r.bindTexture(i,this._texture),r.generateMipmap(i),r.bindTexture(i,null)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=n(this._positiveX),this._negativeX=n(this._negativeX),this._positiveY=n(this._positiveY),this._negativeY=n(this._negativeY),this._positiveZ=n(this._positiveZ),this._negativeZ=n(this._negativeZ),n(this)},m}),define("Renderer/Texture",["../Core/Cartesian2","../Core/Check","../Core/createGuid","../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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(t){t=i(t,i.EMPTY_OBJECT);var o=t.context,a=t.width,s=t.height,l=t.source;n(l)&&(n(a)||(a=i(l.videoWidth,l.width)),n(s)||(s=i(l.videoHeight,l.height)));var d=i(t.pixelFormat,u.RGBA),h=i(t.pixelDatatype,p.UNSIGNED_BYTE),m=d,g=u.isCompressedFormat(m);if(o.webgl2&&(d===u.DEPTH_STENCIL?m=c.DEPTH24_STENCIL8:d===u.DEPTH_COMPONENT&&(h===p.UNSIGNED_SHORT?m=c.DEPTH_COMPONENT16:h===p.UNSIGNED_INT&&(m=c.DEPTH_COMPONENT24)),h===p.FLOAT))switch(d){case u.RGBA:m=c.RGBA32F;break;case u.RGB:m=c.RGB32F;break;case u.RG:m=c.RG32F;break;case u.R:m=c.R32F}var _=t.preMultiplyAlpha||d===u.RGB||d===u.LUMINANCE,v=i(t.flipY,!0),y=o._gl,b=y.TEXTURE_2D,C=y.createTexture();y.activeTexture(y.TEXTURE0),y.bindTexture(b,C),n(l)?(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,v),n(l.arrayBufferView)?g?y.compressedTexImage2D(b,0,m,a,s,0,l.arrayBufferView):y.texImage2D(b,0,m,a,s,0,d,h,l.arrayBufferView):n(l.framebuffer)?(l.framebuffer!==o.defaultFramebuffer&&l.framebuffer._bind(),y.copyTexImage2D(b,0,m,l.xOffset,l.yOffset,a,s,0),l.framebuffer!==o.defaultFramebuffer&&l.framebuffer._unBind()):y.texImage2D(b,0,m,d,h,l)):y.texImage2D(b,0,m,a,s,0,d,h,null),y.bindTexture(b,null);var S;S=g?u.compressedTextureSizeInBytes(d,a,s):u.textureSizeInBytes(d,h,a,s),this._id=r(),this._context=o,this._textureFilterAnisotropic=o._textureFilterAnisotropic,this._textureTarget=b,this._texture=C,this._pixelFormat=d,this._pixelDatatype=h,this._width=a,this._height=s,this._dimensions=new e(a,s),this._hasMipmap=!1,this._sizeInBytes=S,this._preMultiplyAlpha=_,this._flipY=v,this._sampler=void 0,this.sampler=n(t.sampler)?t.sampler:new f}return _.fromFramebuffer=function(e){e=i(e,i.EMPTY_OBJECT);var t=e.context,r=t._gl,o=i(e.pixelFormat,u.RGB),a=i(e.framebufferXOffset,0),s=i(e.framebufferYOffset,0),l=i(e.width,r.drawingBufferWidth),c=i(e.height,r.drawingBufferHeight),d=e.framebuffer;return new _({context:t,width:l,height:c,pixelFormat:o,source:{framebuffer:n(d)?d:t.defaultFramebuffer,xOffset:a,yOffset:s,width:l,height:c}})},o(_.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,i=t===g.NEAREST_MIPMAP_NEAREST||t===g.NEAREST_MIPMAP_LINEAR||t===g.LINEAR_MIPMAP_NEAREST||t===g.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===p.FLOAT&&(t=i?g.NEAREST_MIPMAP_NEAREST:g.NEAREST,r=m.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),n(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}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}}),_.prototype.copyFrom=function(e,t,r){t=i(t,0),r=i(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,t,r,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,t,r,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},_.prototype.copyFromFramebuffer=function(e,t,r,n,o,a){e=i(e,0),t=i(t,0),r=i(r,0),n=i(n,0),o=i(o,this._width),a=i(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,t,r,n,o,a),s.bindTexture(l,null)},_.prototype.generateMipmap=function(e){e=i(e,h.DONT_CARE),this._hasMipmap=!0;var t=this._context._gl,r=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(r,this._texture),t.generateMipmap(r),t.bindTexture(r,null)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),a(this)},_}),define("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"}),define("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"}),define("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"}),define("Shaders/Materials/ElevationContourMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float spacing;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat distanceToContour = mod(materialInput.height, spacing);\n#ifdef GL_OES_standard_derivatives\nfloat dxc = abs(dFdx(materialInput.height));\nfloat dyc = abs(dFdy(materialInput.height));\nfloat dF = max(dxc, dyc) * width;\nmaterial.alpha = (distanceToContour < dF) ? 1.0 : 0.0;\n#else\nmaterial.alpha = (distanceToContour < (czm_resolutionScale * width)) ? 1.0 : 0.0;\n#endif\nmaterial.diffuse = color.rgb;\nreturn material;\n}\n"}),define("Shaders/Materials/ElevationRampMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float minimumHeight;\nuniform float maximumHeight;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\nvec4 rampColor = texture2D(image, vec2(scaledHeight, 0.5));\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.a;\nreturn material;\n}\n"}),define("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"}),define("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"}),define("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"}),define("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\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;\n#ifdef GL_OES_standard_derivatives\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\n#else\nfloat base = 0.99;\n#endif\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"}),define("Shaders/Materials/PolylineDashMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 gapColor;\nuniform float dashLength;\nuniform float dashPattern;\nvarying float v_polylineAngle;\nconst float maskLength = 16.0;\nmat2 rotate(float rad) {\nfloat c = cos(rad);\nfloat s = sin(rad);\nreturn mat2(\nc, s,\n-s, c\n);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\nfloat dashPosition = fract(pos.x / dashLength);\nfloat maskIndex = floor(dashPosition * maskLength);\nfloat maskTest = floor(dashPattern / pow(2.0, maskIndex));\nvec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\nif (fragColor.a < 0.005) {\ndiscard;\n}\nmaterial.emission = fragColor.rgb;\nmaterial.alpha = fragColor.a;\nreturn material;\n}\n"}),define("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"}),define("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"}),define("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"}),define("Shaders/Materials/SlopeRampMaterial",[],function(){"use strict";return"uniform sampler2D image;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 rampColor = texture2D(image, vec2(materialInput.slope, 0.5));\nmaterial.diffuse = rampColor.rgb;\nmaterial.alpha = rampColor.a;\nreturn material;\n}\n"}),define("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"}),define("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"}),define("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/loadCRN","../Core/loadKTX","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/Resource","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/ElevationContourMaterial","../Shaders/Materials/ElevationRampMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineDashMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/SlopeRampMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N){"use strict";function k(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,F(e,this),s(this,{type:{value:this.type,writable:!1}}),a(k._uniformList[this.type])||(k._uniformList[this.type]=Object.keys(this._uniforms))}function F(e,r){e=o(e,o.EMPTY_OBJECT),r._strict=o(e.strict,!1),r._count=o(e.count,0),r._template=t(o(e.fabric,o.EMPTY_OBJECT)),r._template.uniforms=t(o(r._template.uniforms,o.EMPTY_OBJECT)),r._template.materials=t(o(r._template.materials,o.EMPTY_OBJECT)),r.type=a(r._template.type)?r._template.type:n(),r.shaderSource="",r.materials={},r.uniforms={},r._uniforms={},r._translucentFunctions=[];var s,l=k._materialCache.getMaterial(r.type);if(a(l)){var u=t(l.fabric,!0);r._template=i(r._template,u,!0),s=l.translucent}z(r),a(l)||k._materialCache.addMaterial(r.type,r),G(r),j(r),X(r);var c=0===r._translucentFunctions.length||void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var d=function(){return s(r)};r._translucentFunctions.push(d)}else r._translucentFunctions.push(s)}function B(e,t,r,i){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=-1!==t.indexOf(n);(i&&!o||!i&&o)&&r(n,t)}}function U(e,t){}function V(e,t){}function z(e){var t=e._template,r=t.uniforms,i=t.materials,n=t.components;B(t,K,U,!0),B(n,J,U,!0);var o=[];for(var a in i)i.hasOwnProperty(a)&&o.push(a);B(r,o,V,!1)}function G(e){var t=e._template.components,r=e._template.source;if(a(r))e.shaderSource+=r+"\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 i in t)t.hasOwnProperty(i)&&(e.shaderSource+="material."+i+" = "+t[i]+";\n");e.shaderSource+="return material;\n}\n"}}function H(e){var t;return function(r,i){var n=r.uniforms,o=n[e],s=t!==o;t=o;var l,u,c=r._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(s&&a(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===i.defaultTexture)return c=new v({context:i,source:o}),void(r._textures[e]=c);c.copyFrom(o)}else a(c)||(r._textures[e]=i.defaultTexture);else{if(o instanceof v&&o!==c){r._texturePaths[e]=void 0;var p=r._textures[e];return p!==r._defaultTexture&&p.destroy(),r._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}if(a(c)||(r._texturePaths[e]=void 0,a(r._defaultTexture)||(r._defaultTexture=i.defaultTexture),c=r._textures[e]=r._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==k.DefaultImageId&&o!==r._texturePaths[e]){if("string"==typeof o||o instanceof g){var f,m=g.createIfNeeded(o);f=ee.test(o)?h(m):te.test(o)?d(m):m.fetchImage(),N(f,function(t){r._loadedImages.push({id:e,image:t})})}else o instanceof HTMLCanvasElement&&r._loadedImages.push({id:e,image:o});r._texturePaths[e]=o}}}}function W(e){return function(t,r){var i=t.uniforms[e];if(i instanceof _){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=i)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=r.defaultCubeMap),i!==k.DefaultCubeMapId){var o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){var s=[g.createIfNeeded(i.positiveX).fetchImage(),g.createIfNeeded(i.negativeX).fetchImage(),g.createIfNeeded(i.positiveY).fetchImage(),g.createIfNeeded(i.negativeY).fetchImage(),g.createIfNeeded(i.positiveZ).fetchImage(),g.createIfNeeded(i.negativeZ).fetchImage()];N.all(s).then(function(r){t._loadedCubeMaps.push({id:e,images:r})}),t._texturePaths[e]=o}}}}function j(e){var t=e._template.uniforms;for(var r in t)t.hasOwnProperty(r)&&q(e,r)}function q(e,t){var r=(e._strict,e._template.uniforms),i=r[t],n=Y(i);if("channels"===n)Q(e,t,i,!1);else{if("sampler2D"===n){var o=t+"Dimensions";Z(e,o)>0&&(r[o]={type:"ivec3",x:1,y:1},q(e,o))}if(!new RegExp("uniform\\s+"+n+"\\s+"+t+"\\s*;").test(e.shaderSource)){var a="uniform "+n+" "+t+";";e.shaderSource=a+e.shaderSource}var s=t+"_"+e._count++;if(Q(e,t,s),e.uniforms[t]=i,"sampler2D"===n)e._uniforms[s]=function(){return e._textures[t]},e._updateFunctions.push(H(t));else if("samplerCube"===n)e._uniforms[s]=function(){return e._textures[t]},e._updateFunctions.push(W(t));else if(-1!==n.indexOf("mat")){var l=new $[n];e._uniforms[s]=function(){return $[n].fromColumnMajorArray(e.uniforms[t],l)}}else e._uniforms[s]=function(){return e.uniforms[t]}}}function Y(e){var t=e.type;if(!a(t)){var r=typeof e;if("number"===r)t="float";else if("boolean"===r)t="bool";else if("string"===r||e instanceof g||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===k.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===r)if(c(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{var i=0;for(var n in e)e.hasOwnProperty(n)&&(i+=1);i>=2&&i<=4?t="vec"+i:6===i&&(t="samplerCube")}}return t}function X(e){var t=e._strict,r=e._template.materials;for(var n in r)if(r.hasOwnProperty(n)){var o=new k({strict:t,fabric:r[n],count:e._count});e._count=o._count,e._uniforms=i(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial_"+e._count++;Q(o,"czm_getMaterial",a),e.shaderSource=o.shaderSource+e.shaderSource;var s=a+"(materialInput)";Q(e,n,s)}}function Q(e,t,r,i){i=o(i,!0);var n=0,a="([\\w"+(i?".":"")+"])?",s=new RegExp(a+t+"([\\w])?","g");return e.shaderSource=e.shaderSource.replace(s,function(e,t,i){return t||i?e:(n+=1,r)}),n}function Z(e,t,r){return Q(e,t,t,r)}k._uniformList={},k.fromType=function(e,t){var r=new k({fabric:{type:e}});if(a(t))for(var i in t)t.hasOwnProperty(i)&&(r.uniforms[i]=t[i]);return r},k.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,r=t.length,i=0;i<r;++i){var n=t[i];if(!(e="function"==typeof n?e&&n():e&&n))break}return e},k.prototype.update=function(e){var t,r,i=this._loadedImages,n=i.length;for(t=0;t<n;++t){var o=i[t];r=o.id;var s,l=o.image;s=new v(a(l.internalFormat)?{context:e,pixelFormat:l.internalFormat,width:l.width,height:l.height,source:{arrayBufferView:l.bufferView}}:{context:e,source:l}),this._textures[r]=s;var u=r+"Dimensions";if(this.uniforms.hasOwnProperty(u)){var c=this.uniforms[u];c.x=s._width,c.y=s._height}}i.length=0;var d=this._loadedCubeMaps;for(n=d.length,t=0;t<n;++t){var h=d[t];r=h.id;var p=h.images,f=new _({context:e,source:{positiveX:p[0],negativeX:p[1],positiveY:p[2],negativeY:p[3],positiveZ:p[4],negativeZ:p[5]}});this._textures[r]=f}d.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 y in g)g.hasOwnProperty(y)&&g[y].update(e)},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){var e=this._textures;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];r!==this._defaultTexture&&r.destroy()}var i=this.materials;for(var n in i)i.hasOwnProperty(n)&&i[n].destroy();return l(this)};var K=["type","materials","uniforms","components","source"],J=["diffuse","specular","shininess","normal","emission","alpha"],$={mat2:p,mat3:f,mat4:m},ee=/\.ktx$/i,te=/\.crn$/i;return k._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},k.DefaultImageId="czm_defaultImage",k.DefaultCubeMapId="czm_defaultCubeMap",k.ColorType="Color",k._materialCache.addMaterial(k.ColorType,{fabric:{type:k.ColorType,uniforms:{color:new r(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),k.ImageType="Image",k._materialCache.addMaterial(k.ImageType,{fabric:{type:k.ImageType,uniforms:{image:k.DefaultImageId,repeat:new e(1,1),color:new r(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}}),k.DiffuseMapType="DiffuseMap",k._materialCache.addMaterial(k.DiffuseMapType,{fabric:{type:k.DiffuseMapType,uniforms:{image:k.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),k.AlphaMapType="AlphaMap",k._materialCache.addMaterial(k.AlphaMapType,{fabric:{type:k.AlphaMapType,uniforms:{image:k.DefaultImageId,channel:"a",repeat:new e(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),k.SpecularMapType="SpecularMap",k._materialCache.addMaterial(k.SpecularMapType,{fabric:{type:k.SpecularMapType,uniforms:{image:k.DefaultImageId,channel:"r",repeat:new e(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),k.EmissionMapType="EmissionMap",k._materialCache.addMaterial(k.EmissionMapType,{fabric:{type:k.EmissionMapType,uniforms:{image:k.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),k.BumpMapType="BumpMap",k._materialCache.addMaterial(k.BumpMapType,{fabric:{type:k.BumpMapType,uniforms:{image:k.DefaultImageId,channel:"r",strength:.8,repeat:new e(1,1)},source:y},translucent:!1}),k.NormalMapType="NormalMap",k._materialCache.addMaterial(k.NormalMapType,{fabric:{type:k.NormalMapType,uniforms:{image:k.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:E},translucent:!1}),k.GridType="Grid",k._materialCache.addMaterial(k.GridType,{fabric:{type:k.GridType,uniforms:{color:new r(0,1,0,1),cellAlpha:.1,lineCount:new e(8,8),lineThickness:new e(1,1),lineOffset:new e(0,0)},source:A},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),k.StripeType="Stripe",k._materialCache.addMaterial(k.StripeType,{fabric:{type:k.StripeType,uniforms:{horizontal:!0,evenColor:new r(1,1,1,.5),oddColor:new r(0,0,1,.5),offset:0,repeat:5},source:R},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),k.CheckerboardType="Checkerboard",k._materialCache.addMaterial(k.CheckerboardType,{fabric:{type:k.CheckerboardType,uniforms:{lightColor:new r(1,1,1,.5),darkColor:new r(0,0,0,.5),repeat:new e(5,5)},source:b},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),k.DotType="Dot",k._materialCache.addMaterial(k.DotType,{fabric:{type:k.DotType,uniforms:{lightColor:new r(1,1,0,.75),darkColor:new r(0,1,1,.75),repeat:new e(5,5)},source:C},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),k.WaterType="Water",k._materialCache.addMaterial(k.WaterType,{fabric:{type:k.WaterType,uniforms:{baseWaterColor:new r(.2,.3,.6,1),blendColor:new r(0,1,.699,1),specularMap:k.DefaultImageId,normalMap:k.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:L},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),k.RimLightingType="RimLighting",k._materialCache.addMaterial(k.RimLightingType,{fabric:{type:k.RimLightingType,uniforms:{color:new r(1,0,0,.7),rimColor:new r(1,1,1,.4),width:.3},source:O},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),k.FadeType="Fade",k._materialCache.addMaterial(k.FadeType,{fabric:{type:k.FadeType,uniforms:{fadeInColor:new r(1,0,0,1),fadeOutColor:new r(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new e(.5,.5)},source:w},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),k.PolylineArrowType="PolylineArrow",k._materialCache.addMaterial(k.PolylineArrowType,{fabric:{type:k.PolylineArrowType,uniforms:{color:new r(1,1,1,1)},source:x},translucent:!0}),k.PolylineDashType="PolylineDash",k._materialCache.addMaterial(k.PolylineDashType,{fabric:{type:k.PolylineDashType,uniforms:{color:new r(1,0,1,1),gapColor:new r(0,0,0,0),dashLength:16,dashPattern:255},source:P},translucent:!0}),k.PolylineGlowType="PolylineGlow",k._materialCache.addMaterial(k.PolylineGlowType,{fabric:{type:k.PolylineGlowType,uniforms:{color:new r(0,.5,1,1),glowPower:.25},source:I},translucent:!0}),k.PolylineOutlineType="PolylineOutline",k._materialCache.addMaterial(k.PolylineOutlineType,{fabric:{type:k.PolylineOutlineType,uniforms:{color:new r(1,1,1,1),outlineColor:new r(1,0,0,1),outlineWidth:1},source:D},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),k.ElevationContourType="ElevationContour",k._materialCache.addMaterial(k.ElevationContourType,{fabric:{type:k.ElevationContourType,uniforms:{spacing:100,color:new r(1,0,0,1),width:1},source:S},translucent:!1}),k.ElevationRampType="ElevationRamp",k._materialCache.addMaterial(k.ElevationRampType,{fabric:{type:k.ElevationRampType,uniforms:{image:k.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:T},translucent:!1}),k.SlopeRampMaterialType="SlopeRamp",k._materialCache.addMaterial(k.SlopeRampMaterialType,{fabric:{type:k.SlopeRampMaterialType,uniforms:{image:k.DefaultImageId},source:M},translucent:!1}),k}),define("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,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),n=e(r.closed,!1),o=e(r.materialSupport,p.MaterialSupport.TEXTURED);this.material=t(r.material)?r.material:h.fromType(h.ColorType),this.translucent=i,this._vertexShaderSource=e(r.vertexShaderSource,o.vertexShaderSource),this._fragmentShaderSource=e(r.fragmentShaderSource,o.fragmentShaderSource),this._renderState=d.getDefaultRenderState(i,n,r.renderState),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,!n)}return r(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=d.prototype.getFragmentShaderSource,p.prototype.isTranslucent=d.prototype.isTranslucent,p.prototype.getRenderState=d.prototype.getRenderState,p.MaterialSupport={BASIC:i({vertexFormat:n.POSITION_AND_NORMAL,vertexShaderSource:l,fragmentShaderSource:s}),TEXTURED:i({vertexFormat:n.POSITION_NORMAL_AND_ST,vertexShaderSource:c,fragmentShaderSource:u}),ALL:i({vertexFormat:n.ALL,vertexShaderSource:a,fragmentShaderSource:o})},p}),define("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"}),define("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"}),define("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),define("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"}),define("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Appearance"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),d=c?a:n,h=c?o:i,p=c?l.FLAT_VERTEX_FORMAT:l.VERTEX_FORMAT;this.material=void 0,this.translucent=r,this._vertexShaderSource=e(t.vertexShaderSource,d),this._fragmentShaderSource=e(t.fragmentShaderSource,h),this._renderState=s.getDefaultRenderState(r,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=r.POSITION_AND_NORMAL,l.FLAT_VERTEX_FORMAT=r.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),define("DataSources/ColorMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o){"use strict";function a(e){this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this.color=e}return r(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(r,i){return t(i)||(i={}),i.color=o.getValueOrClonedDefault(this._color,r,e.WHITE,i.color),i},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),define("Renderer/Pass",["../Core/freezeObject"],function(e){"use strict";return e({ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,CLASSIFICATION:7,OPAQUE:8,TRANSLUCENT:9,OVERLAY:10,NUMBER_OF_PASSES:11})}),define("Renderer/DrawCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/PrimitiveType"],function(e,t,r,i){"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,i.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 r(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,r){if(t(e))return t(r)||(r=new n),r._boundingVolume=e._boundingVolume,r._orientedBoundingBox=e._orientedBoundingBox,r._cull=e._cull,r._modelMatrix=e._modelMatrix,r._primitiveType=e._primitiveType,r._vertexArray=e._vertexArray,r._count=e._count,r._offset=e._offset,r._instanceCount=e._instanceCount,r._shaderProgram=e._shaderProgram,r._uniformMap=e._uniformMap,r._renderState=e._renderState,r._framebuffer=e._framebuffer,r._pass=e._pass,r._executeInClosestFrustum=e._executeInClosestFrustum,r._owner=e._owner,r._debugShowBoundingVolume=e._debugShowBoundingVolume,r._debugOverlappingFrustums=e._debugOverlappingFrustums,r._castShadows=e._castShadows,r._receiveShadows=e._receiveShadows,r.dirty=!0,r.lastDirtyTime=0,r},n.prototype.execute=function(e,t){e.draw(this,t)},n}),define("Renderer/freezeRenderState",["../Core/freezeObject"],function(e){"use strict";function t(r){if("object"!=typeof r||null===r)return r;for(var i,n=Object.keys(r),o=0;o<n.length;o++)i=n[o],r.hasOwnProperty(i)&&"_applyFunctions"!==i&&(r[i]=t(r[i]));return e(r)}return t}),define("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/WebGLConstants","../Core/WindingOrder","./ContextLimits","./freezeRenderState"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(n){var s=r(n,{}),l=r(s.cull,{}),u=r(s.polygonOffset,{}),c=r(s.scissorTest,{}),d=r(c.rectangle,{}),h=r(s.depthRange,{}),p=r(s.depthTest,{}),f=r(s.colorMask,{}),m=r(s.blending,{}),g=r(m.color,{}),_=r(s.stencilTest,{}),v=r(_.frontOperation,{}),y=r(_.backOperation,{}),b=r(s.sampleCoverage,{}),C=s.viewport;this.frontFace=r(s.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:r(l.enabled,!1),face:r(l.face,o.BACK)},this.lineWidth=r(s.lineWidth,1),this.polygonOffset={enabled:r(u.enabled,!1),factor:r(u.factor,0),units:r(u.units,0)},this.scissorTest={enabled:r(c.enabled,!1),rectangle:e.clone(d)},this.depthRange={near:r(h.near,0),far:r(h.far,1)},this.depthTest={enabled:r(p.enabled,!1),func:r(p.func,o.LESS)},this.colorMask={red:r(f.red,!0),green:r(f.green,!0),blue:r(f.blue,!0),alpha:r(f.alpha,!0)},this.depthMask=r(s.depthMask,!0),this.stencilMask=r(s.stencilMask,-1),this.blending={enabled:r(m.enabled,!1),color:new t(r(g.red,0),r(g.green,0),r(g.blue,0),r(g.alpha,0)),equationRgb:r(m.equationRgb,o.FUNC_ADD),equationAlpha:r(m.equationAlpha,o.FUNC_ADD),functionSourceRgb:r(m.functionSourceRgb,o.ONE),functionSourceAlpha:r(m.functionSourceAlpha,o.ONE),functionDestinationRgb:r(m.functionDestinationRgb,o.ZERO),functionDestinationAlpha:r(m.functionDestinationAlpha,o.ZERO)},this.stencilTest={enabled:r(_.enabled,!1),frontFunction:r(_.frontFunction,o.ALWAYS),backFunction:r(_.backFunction,o.ALWAYS),reference:r(_.reference,0),mask:r(_.mask,-1),frontOperation:{fail:r(v.fail,o.KEEP),zFail:r(v.zFail,o.KEEP),zPass:r(v.zPass,o.KEEP)},backOperation:{fail:r(y.fail,o.KEEP),zFail:r(y.zFail,o.KEEP),zPass:r(y.zPass,o.KEEP)}},this.sampleCoverage={enabled:r(b.enabled,!1),value:r(b.value,1),invert:r(b.invert,!1)},this.viewport=i(C)?new e(C.x,C.y,C.width,C.height):void 0,this.id=0,this._applyFunctions=[]}function c(e,t,r){r?e.enable(t):e.disable(t)}function d(e,t){e.frontFace(t.frontFace)}function h(e,t){var r=t.cull,i=r.enabled;c(e,e.CULL_FACE,i),i&&e.cullFace(r.face)}function p(e,t){e.lineWidth(t.lineWidth)}function f(e,t){var r=t.polygonOffset,i=r.enabled;c(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(r.factor,r.units)}function m(e,t,r){var n=t.scissorTest,o=i(r.scissorTest)?r.scissorTest.enabled:n.enabled;if(c(e,e.SCISSOR_TEST,o),o){var a=i(r.scissorTest)?r.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function g(e,t){var r=t.depthRange;e.depthRange(r.near,r.far)}function _(e,t){var r=t.depthTest,i=r.enabled;c(e,e.DEPTH_TEST,i),i&&e.depthFunc(r.func)}function v(e,t){var r=t.colorMask;e.colorMask(r.red,r.green,r.blue,r.alpha)}function y(e,t){e.depthMask(t.depthMask)}function b(e,t){e.stencilMask(t.stencilMask)}function C(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function S(e,t,r){var n=t.blending,o=i(r.blendingEnabled)?r.blendingEnabled:n.enabled;c(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 T(e,t){var r=t.stencilTest,i=r.enabled;if(c(e,e.STENCIL_TEST,i),i){var n=r.frontFunction,o=r.backFunction,a=r.reference,s=r.mask;e.stencilFunc(n,a,s),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=r.frontOperation,u=l.fail,d=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,d,h);var p=r.backOperation,f=p.fail,m=p.zFail,g=p.zPass;e.stencilOpSeparate(e.BACK,f,m,g)}}function w(e,t){var r=t.sampleCoverage,i=r.enabled;c(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(r.value,r.invert)}function A(e,t,n){var o=r(t.viewport,n.viewport);i(o)||(o=I,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 E(e,t){var r=[];return e.frontFace!==t.frontFace&&r.push(d),e.cull.enabled===t.cull.enabled&&e.cull.face===t.cull.face||r.push(h),e.lineWidth!==t.lineWidth&&r.push(p),e.polygonOffset.enabled===t.polygonOffset.enabled&&e.polygonOffset.factor===t.polygonOffset.factor&&e.polygonOffset.units===t.polygonOffset.units||r.push(f),e.depthRange.near===t.depthRange.near&&e.depthRange.far===t.depthRange.far||r.push(g),e.depthTest.enabled===t.depthTest.enabled&&e.depthTest.func===t.depthTest.func||r.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||r.push(v),e.depthMask!==t.depthMask&&r.push(y),e.stencilMask!==t.stencilMask&&r.push(b),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||r.push(T),e.sampleCoverage.enabled===t.sampleCoverage.enabled&&e.sampleCoverage.value===t.sampleCoverage.value&&e.sampleCoverage.invert===t.sampleCoverage.invert||r.push(w),r}var x=0,P={};u.fromCache=function(e){var t=JSON.stringify(e),r=P[t];if(i(r))return++r.referenceCount,r.state;var n=new u(e),o=JSON.stringify(n);return r=P[o],i(r)||(n.id=x++,r={referenceCount:0,state:n},P[o]=r),++r.referenceCount,P[t]={referenceCount:1,state:r.state},r.state},u.removeFromCache=function(e){var t=new u(e),r=JSON.stringify(t),n=P[r],o=JSON.stringify(e),a=P[o];i(a)&&0===--a.referenceCount&&(delete P[o],i(n)&&--n.referenceCount),i(n)&&0===n.referenceCount&&delete P[r]},u.getCache=function(){return P},u.clearCache=function(){P={}};var I=new e;return u.apply=function(e,t,r){d(e,t),h(e,t),p(e,t),f(e,t),g(e,t),_(e,t),v(e,t),y(e,t),b(e,t),T(e,t),w(e,t),m(e,t,r),S(e,t,r),A(e,t,r)},u.partialApply=function(e,t,r,n,o,a){if(t!==r){var s=r._applyFunctions[t.id];i(s)||(s=E(t,r),r._applyFunctions[t.id]=s);for(var l=s.length,u=0;u<l;++u)s[u](e,r)}((i(n.scissorTest)?n.scissorTest:t.scissorTest)!==(i(o.scissorTest)?o.scissorTest:r.scissorTest)||a)&&m(e,r,o);var c=i(n.blendingEnabled)?n.blendingEnabled:t.blending.enabled,d=i(o.blendingEnabled)?o.blendingEnabled:r.blending.enabled;(c!==d||d&&t.blending!==r.blending)&&S(e,r,o),t===r&&n===o&&n.context===o.context||A(e,r,o)},u.getState=function(r){return{frontFace:r.frontFace,cull:{enabled:r.cull.enabled,face:r.cull.face},lineWidth:r.lineWidth,polygonOffset:{enabled:r.polygonOffset.enabled,factor:r.polygonOffset.factor,units:r.polygonOffset.units},scissorTest:{enabled:r.scissorTest.enabled,rectangle:e.clone(r.scissorTest.rectangle)},depthRange:{near:r.depthRange.near,far:r.depthRange.far},depthTest:{enabled:r.depthTest.enabled,func:r.depthTest.func},colorMask:{red:r.colorMask.red,green:r.colorMask.green,blue:r.colorMask.blue,alpha:r.colorMask.alpha},depthMask:r.depthMask,stencilMask:r.stencilMask,blending:{enabled:r.blending.enabled,color:t.clone(r.blending.color),equationRgb:r.blending.equationRgb,equationAlpha:r.blending.equationAlpha,functionSourceRgb:r.blending.functionSourceRgb,functionSourceAlpha:r.blending.functionSourceAlpha,functionDestinationRgb:r.blending.functionDestinationRgb,functionDestinationAlpha:r.blending.functionDestinationAlpha},stencilTest:{enabled:r.stencilTest.enabled,frontFunction:r.stencilTest.frontFunction,backFunction:r.stencilTest.backFunction,reference:r.stencilTest.reference,mask:r.stencilTest.mask,frontOperation:{fail:r.stencilTest.frontOperation.fail,zFail:r.stencilTest.frontOperation.zFail,zPass:r.stencilTest.frontOperation.zPass},backOperation:{fail:r.stencilTest.backOperation.fail,zFail:r.stencilTest.backOperation.zFail,zPass:r.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:r.sampleCoverage.enabled,value:r.sampleCoverage.value,invert:r.sampleCoverage.invert},viewport:i(r.viewport)?e.clone(r.viewport):void 0}},u}),define("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4","../Core/WebGLConstants"],function(e,t,r){"use strict";function i(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var n=new e;if("undefined"==typeof WebGLRenderingContext)return{};var o={};return o[r.FLOAT]="float",o[r.FLOAT_VEC2]="vec2",o[r.FLOAT_VEC3]="vec3",o[r.FLOAT_VEC4]="vec4",o[r.INT]="int",o[r.INT_VEC2]="ivec2",o[r.INT_VEC3]="ivec3",o[r.INT_VEC4]="ivec4",o[r.BOOL]="bool",o[r.BOOL_VEC2]="bvec2",o[r.BOOL_VEC3]="bvec3",o[r.BOOL_VEC4]="bvec4",o[r.FLOAT_MAT2]="mat2",o[r.FLOAT_MAT3]="mat3",o[r.FLOAT_MAT4]="mat4",o[r.SAMPLER_2D]="sampler2D",o[r.SAMPLER_CUBE]="samplerCube",i.prototype.getDeclaration=function(e){var t="uniform "+o[this._datatype]+" "+e,r=this._size;return t+=1===r?";":"["+r.toString()+"];"},{czm_viewport:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new i({size:1,datatype:r.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new i({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new i({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new i({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_sunPositionWC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return t.getTranslation(e.inverseView,n)}}),czm_frameNumber:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new i({size:1,datatype:r.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new i({size:1,datatype:r.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_temeToPseudoFixed:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.resolutionScale}}),czm_fogDensity:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.fogDensity}}),czm_imagerySplitPosition:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.imagerySplitPosition}}),czm_geometricToleranceOverMeter:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}})}}),define("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,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,i){switch(t.type){case e.FLOAT:return new d(e,t,r,i);case e.FLOAT_VEC2:return new h(e,t,r,i);case e.FLOAT_VEC3:return new p(e,t,r,i);case e.FLOAT_VEC4:return new f(e,t,r,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new m(e,t,r,i);case e.INT:case e.BOOL:return new g(e,t,r,i);case e.INT_VEC2:case e.BOOL_VEC2:return new _(e,t,r,i);case e.INT_VEC3:case e.BOOL_VEC3:return new v(e,t,r,i);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,r,i);case e.FLOAT_MAT2:return new b(e,t,r,i);case e.FLOAT_MAT3:return new C(e,t,r,i);case e.FLOAT_MAT4:return new S(e,t,r,i);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+r+'".')}}function d(e,t,r,i){this.name=r,this.value=void 0,this._value=0,this._gl=e,this._location=i}function h(t,r,i,n){this.name=i,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function p(e,t,r,i){this.name=r,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}function f(e,t,r,i){this.name=r,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}function m(e,t,r,i){this.name=r,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}function g(e,t,r,i){this.name=r,this.value=void 0,this._value=0,this._gl=e,this._location=i}function _(t,r,i,n){this.name=i,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function v(e,r,i,n){this.name=i,this.value=void 0,this._value=new t,this._gl=e,this._location=n}function y(e,t,i,n){this.name=i,this.value=void 0,this._value=new r,this._gl=e,this._location=n}function b(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(4),this._gl=e,this._location=i}function C(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(9),this._gl=e,this._location=i}function S(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(16),this._gl=e,this._location=i}return d.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},h.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)?i.equals(e,this._value)||(this._value=i.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)))},f.prototype.set=function(){var e=this.value;n(e.red)?i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):n(e.x)&&(r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))},m.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},m.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},g.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},_.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;r.equals(e,this._value)||(r.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))},b.prototype.set=function(){a.equalsArray(this.value,this._value,0)||(a.toArray(this.value,this._value),this._gl.uniformMatrix2fv(this._location,!1,this._value))},C.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}),define("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,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,i){switch(t.type){case e.FLOAT:return new d(e,t,r,i);case e.FLOAT_VEC2:return new h(e,t,r,i);case e.FLOAT_VEC3:return new p(e,t,r,i);case e.FLOAT_VEC4:return new f(e,t,r,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new m(e,t,r,i);case e.INT:case e.BOOL:return new g(e,t,r,i);case e.INT_VEC2:case e.BOOL_VEC2:return new _(e,t,r,i);case e.INT_VEC3:case e.BOOL_VEC3:return new v(e,t,r,i);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,r,i);case e.FLOAT_MAT2:return new b(e,t,r,i);case e.FLOAT_MAT3:return new C(e,t,r,i);case e.FLOAT_MAT4:return new S(e,t,r,i);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+r+'".')}}function d(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=i[0]}function h(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=i[0]}function p(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=i[0]}function f(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=i[0]}function m(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}function g(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=i[0]}function _(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=i[0]}function v(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=i[0]}function y(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=i[0]}function b(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=i[0]}function C(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=i[0]}function S(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=i[0]}return d.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0;n<t;++n){var o=e[n];o!==r[n]&&(r[n]=o,i=!0)}i&&this._gl.uniform1fv(this._location,r)},h.prototype.set=function(){for(var t=this.value,r=t.length,i=this._value,n=!1,o=0,a=0;a<r;++a){var s=t[a];e.equalsArray(s,i,o)||(e.pack(s,i,o),n=!0),o+=2}n&&this._gl.uniform2fv(this._location,i)},p.prototype.set=function(){for(var e=this.value,r=e.length,i=this._value,o=!1,a=0,s=0;s<r;++s){var l=e[s];n(l.red)?l.red===i[a]&&l.green===i[a+1]&&l.blue===i[a+2]||(i[a]=l.red,i[a+1]=l.green,i[a+2]=l.blue,o=!0):n(l.x)&&(t.equalsArray(l,i,a)||(t.pack(l,i,a),o=!0)),a+=3}o&&this._gl.uniform3fv(this._location,i)},f.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)?i.equalsArray(u,o,s)||(i.pack(u,o,s),a=!0):n(u.x)&&(r.equalsArray(u,o,s)||(r.pack(u,o,s),a=!0)),s+=4}a&&this._gl.uniform4fv(this._location,o)},m.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,r=this.value,i=r.length,n=0;n<i;++n){var o=r[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture)}},m.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,r=t.length,i=0;i<r;++i){var n=e+i;this._gl.uniform1i(t[i],n)}return e+r},g.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0;n<t;++n){var o=e[n];o!==r[n]&&(r[n]=o,i=!0)}i&&this._gl.uniform1iv(this._location,r)},_.prototype.set=function(){for(var t=this.value,r=t.length,i=this._value,n=!1,o=0,a=0;a<r;++a){var s=t[a];e.equalsArray(s,i,o)||(e.pack(s,i,o),n=!0),o+=2}n&&this._gl.uniform2iv(this._location,i)},v.prototype.set=function(){for(var e=this.value,r=e.length,i=this._value,n=!1,o=0,a=0;a<r;++a){var s=e[a];t.equalsArray(s,i,o)||(t.pack(s,i,o),n=!0),o+=3}n&&this._gl.uniform3iv(this._location,i)},y.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,n=!1,o=0,a=0;a<t;++a){var s=e[a];r.equalsArray(s,i,o)||(r.pack(s,i,o),n=!0),o+=4}n&&this._gl.uniform4iv(this._location,i)},b.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;o<t;++o){var s=e[o];a.equalsArray(s,r,n)||(a.pack(s,r,n),i=!0),n+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,r)},C.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;o<t;++o){var a=e[o];s.equalsArray(a,r,n)||(s.pack(a,r,n),i=!0),n+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,r)},S.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;o<t;++o){var a=e[o];l.equalsArray(a,r,n)||(l.pack(a,r,n),i=!0),n+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,r)},c}),define("Renderer/ShaderProgram",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/RuntimeError","./AutomaticUniforms","./ContextLimits","./createUniform","./createUniformArray"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){var t=p(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=b++}function h(e){var t=[],i=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(r(i))for(var n=i.length,o=0;o<n;o++){var a=i[o].trim(),s=a.slice(a.lastIndexOf(" ")+1);t.push(s)}return t}function p(e,t){var r={};if(!l.highpFloatSupported||!l.highpIntSupported){var i,n,o,a,s=h(e),u=h(t),c=s.length,d=u.length;for(i=0;i<c;i++)for(n=0;n<d;n++)if(s[i]===u[n]){o=s[i],a="czm_mediump_"+o;var p=new RegExp(o+"\\b","g");t=t.replace(p,a),r[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:r}}function f(e,t){var i=t._vertexShaderText,n=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,i),e.compileShader(o);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,n),e.compileShader(s);var l=e.createProgram();e.attachShader(l,o),e.attachShader(l,s),e.deleteShader(o),e.deleteShader(s);var u=t._attributeLocations;if(r(u))for(var c in u)u.hasOwnProperty(c)&&e.bindAttribLocation(l,u[c],c);e.linkProgram(l);var d;if(!e.getProgramParameter(l,e.LINK_STATUS)){var h=t._debugShaders;if(!e.getShaderParameter(s,e.COMPILE_STATUS)){if(d=e.getShaderInfoLog(s),console.error(C+"Fragment shader compile log: "+d),r(h)){var p=h.getTranslatedShaderSource(s);""!==p?console.error(C+"Translated fragment shader source:\n"+p):console.error(C+"Fragment shader translation failed.")}throw e.deleteProgram(l),new a("Fragment shader failed to compile.  Compile log: "+d)}if(!e.getShaderParameter(o,e.COMPILE_STATUS)){if(d=e.getShaderInfoLog(o),console.error(C+"Vertex shader compile log: "+d),r(h)){var f=h.getTranslatedShaderSource(o);""!==f?console.error(C+"Translated vertex shader source:\n"+f):console.error(C+"Vertex shader translation failed.")}throw e.deleteProgram(l),new a("Vertex shader failed to compile.  Compile log: "+d)}throw d=e.getProgramInfoLog(l),console.error(C+"Shader program link log: "+d),r(h)&&(console.error(C+"Translated vertex shader source:\n"+h.getTranslatedShaderSource(o)),console.error(C+"Translated fragment shader source:\n"+h.getTranslatedShaderSource(s))),
e.deleteProgram(l),new a("Program failed to link.  Link log: "+d)}var m=t._logShaderCompilation;return m&&(d=e.getShaderInfoLog(o),r(d)&&d.length>0&&console.log(C+"Vertex shader compile log: "+d)),m&&(d=e.getShaderInfoLog(s),r(d)&&d.length>0&&console.log(C+"Fragment shader compile log: "+d)),m&&(d=e.getProgramInfoLog(l),r(d)&&d.length>0&&console.log(C+"Shader program link log: "+d)),l}function m(e,t,r){for(var i={},n=0;n<r;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:a}}return i}function g(e,t){for(var i={},n=[],o=[],a=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),s=0;s<a;++s){var l=e.getActiveUniform(t,s),d=-1!==l.name.indexOf("[0]",l.name.length-"[0]".length)?l.name.slice(0,l.name.length-3):l.name;if(0!==d.indexOf("gl_"))if(l.name.indexOf("[")<0){var h=e.getUniformLocation(t,d);if(null!==h){var p=u(e,l,d,h);i[d]=p,n.push(p),p._setSampler&&o.push(p)}}else{var f,m,g,_,v=d.indexOf("[");if(v>=0){if(f=i[d.slice(0,v)],!r(f))continue;m=f._locations,m.length<=1&&(g=f.value,null!==(_=e.getUniformLocation(t,d))&&(m.push(_),g.push(e.getUniform(t,_))))}else{m=[];for(var y=0;y<l.size;++y)null!==(_=e.getUniformLocation(t,d+"["+y+"]"))&&m.push(_);f=c(e,l,d,m),i[d]=f,n.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:i,uniforms:n,samplerUniforms:o}}function _(e,t){var i=[],n=[];for(var o in t)if(t.hasOwnProperty(o)){var a=t[o],l=o,u=e._duplicateUniformNames[l];r(u)&&(a.name=u,l=u);var c=s[l];r(c)?i.push({uniform:a,automaticUniform:c}):n.push(a)}return{automaticUniforms:i,manualUniforms:n}}function v(e,t,r){e.useProgram(t);for(var i=0,n=r.length,o=0;o<n;++o)i=r[o]._setSampler(i);return e.useProgram(null),i}function y(e){if(!r(e._program)){var t=e._gl,i=f(t,e,e._debugShaders),n=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES),o=g(t,i),a=_(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=n,e._vertexAttributes=m(t,i,n),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=v(t,i,o.samplerUniforms)}}var b=0;d.fromCache=function(e){return e=t(e,t.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)},d.replaceCache=function(e){return e=t(e,t.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)},i(d.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return y(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return y(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return y(this),this._uniformsByName}}});var C="[Cesium WebGL] ";return d.prototype._bind=function(){y(this),this._gl.useProgram(this._program)},d.prototype._setUniforms=function(e,t,i){var n,o;if(r(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(t)}var c=this._uniforms;for(n=c.length,o=0;o<n;++o)c[o].set();if(i){var d=this._gl,h=this._program;d.validateProgram(h)}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},d.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),n(this)},d}),define("Renderer/modernizeShader",["../Core/defined","../Core/DeveloperError"],function(e,t){"use strict";function r(e,r){var n=/#define OUTPUT_DECLARATION/,c=e.split("\n");if(/#version 300 es/g.test(e))return e;var d,h,p=-1;for(d=0;d<c.length;++d)if(h=c[d],n.test(h)){p=d;break}if(-1===p)throw new t("Could not find a #define OUTPUT_DECLARATION!");var f=[];for(d=0;d<10;d++){var m="gl_FragData\\["+d+"\\]",g="czm_out"+d;new RegExp(m,"g").test(e)&&(s(g,f),i(m,g,c),c.splice(p,0,"layout(location = "+d+") out vec4 "+g+";"),p+=1)}o("gl_FragColor",c)&&(s("czm_fragColor",f),i("gl_FragColor","czm_fragColor",c),c.splice(p,0,"layout(location = 0) out vec4 czm_fragColor;"),p+=1);var _=l(f,c),v={};for(d=0;d<c.length;d++){h=c[d];for(var y in _)if(_.hasOwnProperty(y)){var b=new RegExp("(layout)[^]+(out)[^]+("+y+")[^]+","g");b.test(h)&&(v[h]=y)}}for(var C in v)if(v.hasOwnProperty(C)){var S,T=v[C],w=c.indexOf(C),A=_[T],E=A.length;for(S=0;S<E;S++)c.splice(w,0,A[S]);for(w+=E+1,S=E-1;S>=0;S--)c.splice(w,0,"#endif //"+A[S])}var x=!1;for(d=0;d<c.length;d++)/#version/.test(c[d])&&(c[d]="#version 300 es",x=!0);return x||c.splice(0,0,"#version 300 es"),u("EXT_draw_buffers",c),u("EXT_frag_depth",c),i("texture2D","texture",c),i("texture3D","texture",c),i("textureCube","texture",c),i("gl_FragDepthEXT","gl_FragDepth",c),r?i("varying","in",c):(i("attribute","in",c),i("varying","out",c)),a(c)}function i(e,t,r){for(var i="(^|[^\\w])("+e+")($|[^\\w])",n=new RegExp(i,"g"),o=r.length,a=0;a<o;++a){var s=r[a];r[a]=s.replace(n,"$1"+t+"$3")}}function n(e,t,r){for(var i=r.length,n=0;n<i;++n){var o=r[n];r[n]=o.replace(e,t)}}function o(e,t){for(var r="(^|[^\\w])("+e+")($|[^\\w])",i=new RegExp(r,"g"),n=t.length,o=0;o<n;++o){var a=t[o];if(i.test(a))return!0}return!1}function a(e){for(var t="",r=e.length,i=0;i<r;++i)t+=e[i]+"\n";return t}function s(e,t){-1===t.indexOf(e)&&t.push(e)}function l(t,r){for(var i={},n=t.length,o=[],a=0;a<r.length;++a){var s=r[a],l=/(#ifdef|#if)/g.test(s),u=/#else/g.test(s),c=/#endif/g.test(s);if(l)o.push(s);else if(u){var d=o[o.length-1],h=d.replace("ifdef","ifndef");/if/g.test(h)&&(h=h.replace(/(#if\s+)(\S*)([^]*)/,"$1!($2)$3")),o.pop(),o.push(h)}else if(c)o.pop();else if(!/layout/g.test(s))for(var p=0;p<n;++p){var f=t[p];-1!==s.indexOf(f)&&(e(i[f])?i[f]=i[f].filter(function(e){return o.indexOf(e)>=0}):i[f]=o.slice())}}return i}function u(e,t){var r="#extension\\s+GL_"+e+"\\s+:\\s+[a-zA-Z0-9]+\\s*$";n(new RegExp(r,"g"),"",t)}return r}),define("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),define("Shaders/Builtin/Constants/depthRange",[],function(){"use strict";return"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n"}),define("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),define("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),define("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),define("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),define("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),define("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),define("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),define("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),define("Shaders/Builtin/Constants/maxClippingPlanes",[],function(){"use strict";return"const int czm_maxClippingPlanes = 6;\n"}),define("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),define("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),define("Shaders/Builtin/Constants/passCesium3DTile",[],function(){"use strict";return"const float czm_passCesium3DTile = 4.0;\n"}),define("Shaders/Builtin/Constants/passCesium3DTileClassification",[],function(){"use strict";return"const float czm_passCesium3DTileClassification = 5.0;\n"}),define("Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow",[],function(){"use strict";return"const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\n"}),define("Shaders/Builtin/Constants/passClassification",[],function(){"use strict";return"const float czm_passClassification = 7.0;\n"}),define("Shaders/Builtin/Constants/passCompute",[],function(){"use strict";return"const float czm_passCompute = 1.0;\n"}),define("Shaders/Builtin/Constants/passEnvironment",[],function(){"use strict";return"const float czm_passEnvironment = 0.0;\n"}),define("Shaders/Builtin/Constants/passGlobe",[],function(){"use strict";return"const float czm_passGlobe = 2.0;\n"}),define("Shaders/Builtin/Constants/passOpaque",[],function(){"use strict";return"const float czm_passOpaque = 8.0;\n"}),define("Shaders/Builtin/Constants/passOverlay",[],function(){"use strict";return"const float czm_passOverlay = 10.0;\n"}),define("Shaders/Builtin/Constants/passTerrainClassification",[],function(){"use strict";return"const float czm_passTerrainClassification = 3.0;\n"}),define("Shaders/Builtin/Constants/passTranslucent",[],function(){"use strict";return"const float czm_passTranslucent = 9.0;\n"}),define("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),define("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict";return"const float czm_piOverFour = 0.7853981633974483;\n"}),define("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),define("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),define("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),define("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n"}),define("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 2.0;\n"}),define("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 3.0;\n"}),define("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),define("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 0.0;\n"}),define("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),define("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),define("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),define("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),define("Shaders/Builtin/Structs/depthRangeStruct",[],function(){"use strict";return"struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n"}),define("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),define("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"}),define("Shaders/Builtin/Structs/materialInput",[],function(){"use strict";return"struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\nfloat height;\nfloat slope;\n};\n"}),define("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/alphaWeight",[],function(){"use strict";return"float czm_alphaWeight(float a)\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;\nfloat z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 0.0);\nq /= gl_FragCoord.w;\nif (czm_inverseProjection != mat4(0.0)) {\nq = czm_inverseProjection * q;\n} else {\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nq.x = (q.x * (right - left) + left + right) * 0.5;\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\nq.z = (q.z * (near - far) - near - far) * 0.5;\nq.w = 1.0;\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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/depthClampFarPlane",[],function(){"use strict";return"varying float v_WindowZ;\nvec4 czm_depthClampFarPlane(vec4 coords)\n{\nv_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;\ncoords.z = min(coords.z, coords.w);\nreturn coords;\n}\n"}),define("Shaders/Builtin/Functions/discardIfClippedWithIntersect",[],function(){"use strict";return"float czm_discardIfClippedWithIntersect(vec4 clippingPlanes[czm_maxClippingPlanes], int clippingPlanesLength)\n{\nif (clippingPlanesLength > 0)\n{\nbool clipped = true;\nvec4 position = czm_windowToEyeCoordinates(gl_FragCoord);\nvec3 clipNormal = vec3(0.0);\nvec3 clipPosition = vec3(0.0);\nfloat clipAmount = 0.0;\nfloat pixelWidth = czm_metersPerPixel(position);\nfor (int i = 0; i < czm_maxClippingPlanes; ++i)\n{\nif (i == clippingPlanesLength)\n{\nbreak;\n}\nclipNormal = clippingPlanes[i].xyz;\nclipPosition = -clippingPlanes[i].w * clipNormal;\nfloat amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\nclipAmount = max(amount, clipAmount);\nclipped = clipped && (amount <= 0.0);\n}\nif (clipped)\n{\ndiscard;\n}\nreturn clipAmount;\n}\nreturn 0.0;\n}\n"}),define("Shaders/Builtin/Functions/discardIfClippedWithUnion",[],function(){"use strict";return"float czm_discardIfClippedWithUnion(vec4 clippingPlanes[czm_maxClippingPlanes], int clippingPlanesLength)\n{\nif (clippingPlanesLength > 0)\n{\nvec4 position = czm_windowToEyeCoordinates(gl_FragCoord);\nvec3 clipNormal = vec3(0.0);\nvec3 clipPosition = vec3(0.0);\nfloat clipAmount = 0.0;\nfloat pixelWidth = czm_metersPerPixel(position);\nfor (int i = 0; i < czm_maxClippingPlanes; ++i)\n{\nif (i == clippingPlanesLength)\n{\nbreak;\n}\nclipNormal = clippingPlanes[i].xyz;\nclipPosition = -clippingPlanes[i].w * clipNormal;\nfloat amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\nclipAmount = max(amount, clipAmount);\nif (amount <= 0.0)\n{\ndiscard;\n}\n}\nreturn clipAmount;\n}\nreturn 0.0;\n}\n"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/HSBToRGB",[],function(){"use strict";return"const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 czm_HSBToRGB(vec3 hsb)\n{\nvec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\n}\n"});define("Shaders/Builtin/Functions/HSLToRGB",[],function(){"use strict";return"vec3 hueToRGB(float hue)\n{\nfloat r = abs(hue * 6.0 - 3.0) - 1.0;\nfloat g = 2.0 - abs(hue * 6.0 - 2.0);\nfloat b = 2.0 - abs(hue * 6.0 - 4.0);\nreturn clamp(vec3(r, g, b), 0.0, 1.0);\n}\nvec3 czm_HSLToRGB(vec3 hsl)\n{\nvec3 rgb = hueToRGB(hsl.x);\nfloat c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\nreturn (rgb - 0.5) * c + hsl.z;\n}\n"}),define("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"}),define("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded, float range)\n{\nif (encoded.x == 0.0 && encoded.y == 0.0) {\nreturn vec3(0.0, 0.0, 0.0);\n}\nencoded = encoded / range * 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(vec2 encoded)\n{\nreturn czm_octDecode(encoded, 255.0);\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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/RGBToHSB",[],function(){"use strict";return"const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec3 czm_RGBToHSB(vec3 rgb)\n{\nvec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\nvec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.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}\n"}),define("Shaders/Builtin/Functions/RGBToHSL",[],function(){"use strict";return"vec3 RGBtoHCV(vec3 rgb)\n{\nvec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\nvec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\nfloat c = q.x - min(q.w, q.y);\nfloat h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\nreturn vec3(h, c, q.x);\n}\nvec3 czm_RGBToHSL(vec3 rgb)\n{\nvec3 hcv = RGBtoHCV(rgb);\nfloat l = hcv.z - hcv.y * 0.5;\nfloat s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\nreturn vec3(hcv.x, s, l);\n}\n"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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"}),define("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 bitangent = normalize(bitangentEC);\nreturn mat3(tangent.x  , tangent.y  , tangent.z,\nbitangent.x, bitangent.y, bitangent.z,\nnormal.x   , normal.y   , normal.z);\n}\n"}),define("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"}),define("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"}),define("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"}),define("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"}),define("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;\nif (czm_inverseProjection != mat4(0.0)) {\nq = czm_inverseProjection * q;\n} else {\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nq.x = (q.x * (right - left) + left + right) * 0.5;\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\nq.z = (q.z * (near - far) - near - far) * 0.5;\nq.w = 1.0;\n}\nreturn q;\n}\n"}),define("Shaders/Builtin/Functions/writeDepthClampedToFarPlane",[],function(){"use strict";return"varying float v_WindowZ;\nvoid czm_writeDepthClampedToFarPlane()\n{\n#ifdef GL_EXT_frag_depth\ngl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\n"}),define("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"}),define("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/maxClippingPlanes","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/passCesium3DTile","./Constants/passCesium3DTileClassification","./Constants/passCesium3DTileClassificationIgnoreShow","./Constants/passClassification","./Constants/passCompute","./Constants/passEnvironment","./Constants/passGlobe","./Constants/passOpaque","./Constants/passOverlay","./Constants/passTerrainClassification","./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/depthClampFarPlane","./Functions/discardIfClippedWithIntersect","./Functions/discardIfClippedWithUnion","./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/HSBToRGB","./Functions/HSLToRGB","./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/RGBToHSB","./Functions/RGBToHSL","./Functions/RGBToXYZ","./Functions/saturation","./Functions/shadowDepthCompare","./Functions/shadowVisibility","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/writeDepthClampedToFarPlane","./Functions/XYZToRGB"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,_e,ve,ye,be,Ce,Se,Te,we,Ae,Ee,xe,Pe,Ie,De,Oe,Me,Re,Le,Ne,ke,Fe,Be,Ue,Ve,ze,Ge,He,We,je,qe,Ye,Xe){"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:r,czm_epsilon2:i,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_maxClippingPlanes:c,czm_oneOverPi:d,czm_oneOverTwoPi:h,czm_passCesium3DTile:p,czm_passCesium3DTileClassification:f,czm_passCesium3DTileClassificationIgnoreShow:m,czm_passClassification:g,czm_passCompute:_,czm_passEnvironment:v,czm_passGlobe:y,czm_passOpaque:b,czm_passOverlay:C,czm_passTerrainClassification:S,czm_passTranslucent:T,czm_pi:w,czm_piOverFour:A,czm_piOverSix:E,czm_piOverThree:x,czm_piOverTwo:P,czm_radiansPerDegree:I,czm_sceneMode2D:D,czm_sceneMode3D:O,czm_sceneModeColumbusView:M,czm_sceneModeMorphing:R,czm_solarRadius:L,czm_threePiOver2:N,czm_twoPi:k,czm_webMercatorMaxLatitude:F,czm_depthRangeStruct:B,czm_ellipsoid:U,czm_material:V,czm_materialInput:z,czm_ray:G,czm_raySegment:H,czm_shadowParameters:W,czm_alphaWeight:j,czm_antialias:q,czm_cascadeColor:Y,czm_cascadeDistance:X,czm_cascadeMatrix:Q,czm_cascadeWeights:Z,czm_columbusViewMorph:K,czm_computePosition:J,czm_cosineAndSine:$,czm_decompressTextureCoordinates:ee,czm_depthClampFarPlane:te,czm_discardIfClippedWithIntersect:re,czm_discardIfClippedWithUnion:ie,czm_eastNorthUpToEyeCoordinates:ne,czm_ellipsoidContainsPoint:oe,czm_ellipsoidNew:ae,czm_ellipsoidWgs84TextureCoordinates:se,czm_equalsEpsilon:le,czm_eyeOffset:ue,czm_eyeToWindowCoordinates:ce,czm_fog:de,czm_geodeticSurfaceNormal:he,czm_getDefaultMaterial:pe,czm_getLambertDiffuse:fe,czm_getSpecular:me,czm_getWaterNoise:ge,czm_getWgs84EllipsoidEC:_e,czm_HSBToRGB:ve,czm_HSLToRGB:ye,czm_hue:be,czm_isEmpty:Ce,czm_isFull:Se,czm_latitudeToWebMercatorFraction:Te,czm_luminance:we,czm_metersPerPixel:Ae,czm_modelToWindowCoordinates:Ee,czm_multiplyWithColorBalance:xe,czm_nearFarScalar:Pe,czm_octDecode:Ie,czm_packDepth:De,czm_phong:Oe,czm_pointAlongRay:Me,czm_rayEllipsoidIntersectionInterval:Re,czm_RGBToHSB:Le,czm_RGBToHSL:Ne,czm_RGBToXYZ:ke,czm_saturation:Fe,czm_shadowDepthCompare:Be,czm_shadowVisibility:Ue,czm_signNotZero:Ve,czm_tangentToEyeSpaceMatrix:ze,czm_translateRelativeToEye:Ge,czm_translucentPhong:He,czm_transpose:We,czm_unpackDepth:je,czm_windowToEyeCoordinates:qe,czm_writeDepthClampedToFarPlane:Ye,czm_XYZToRGB:Xe}}),define("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Renderer/modernizeShader","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,r,i,n,o){"use strict";function a(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,r="",i=0;i<t;++i)r+="\n";return r})}function s(e,r,i){for(var n,o=0;o<i.length;++o)i[o].name===e&&(n=i[o]);return t(n)||(r=a(r),n={name:e,glslSource:r,dependsOn:[],requiredBy:[],evaluated:!1},i.push(n)),n}function l(e,r){if(!e.evaluated){e.evaluated=!0;var i=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);t(i)&&null!==i&&(i=i.filter(function(e,t){return i.indexOf(e)===t}),i.forEach(function(t){if(t!==e.name&&h._czmBuiltinsAndUniforms.hasOwnProperty(t)){var i=s(t,h._czmBuiltinsAndUniforms[t],r);e.dependsOn.push(i),i.requiredBy.push(e),l(i,r)}}))}}function u(e){for(var t=[],r=[];e.length>0;){var i=e.pop();r.push(i),0===i.requiredBy.length&&t.push(i)}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<r.length;++u)0!==r[u].requiredBy.length&&l.push(r[u])}function c(e){var t=[],r=s("main",e,t);l(r,t),u(t);for(var i="",n=t.length-1;n>=0;--n)i=i+t[n].glslSource+"\n";return i.replace(r.glslSource,"")}function d(e,r,n){var o,s,l="",u=e.sources;if(t(u))for(o=0,s=u.length;o<s;++o)l+="\n#line 0\n"+u[o];l=a(l);var d;l=l.replace(/#version\s+(.*?)\n/gm,function(e,t){return d=t,"\n"});var p=[];l=l.replace(/#extension.*\n/gm,function(e){return p.push(e),"\n"}),l=l.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var f=e.pickColorQualifier;t(f)&&(l=h.createPickFragmentShaderSource(l,f));var m="";t(d)&&(m="#version "+d+"\n");var g=p.length;for(o=0;o<g;o++)m+=p[o];r&&(m+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n    precision highp float;\n#else\n    precision mediump float;\n#endif\n\n");var _=e.defines;if(t(_))for(o=0,s=_.length;o<s;++o){var v=_[o];0!==v.length&&(m+="#define "+v+"\n")}return n.webgl2&&(m+="#define OUTPUT_DECLARATION\n\n"),e.includeBuiltIns&&(m+=c(l)),m+="\n#line 0\n",m+=l,n.webgl2&&(m=i(m,r,!0)),m}function h(r){r=e(r,e.EMPTY_OBJECT);var i=r.pickColorQualifier;this.defines=t(r.defines)?r.defines.slice(0):[],this.sources=t(r.sources)?r.sources.slice(0):[],this.pickColorQualifier=i,this.includeBuiltIns=e(r.includeBuiltIns,!0)}h.prototype.clone=function(){return new h({sources:this.sources,defines:this.defines,pickColorQualifier: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(e){return d(this,!1,e)},h.prototype.createCombinedFragmentShader=function(e){return d(this,!0,e)},h._czmBuiltinsAndUniforms={};for(var p in n)n.hasOwnProperty(p)&&(h._czmBuiltinsAndUniforms[p]=n[p]);for(var f in o)if(o.hasOwnProperty(f)){var m=o[f];"function"==typeof m.getDeclaration&&(h._czmBuiltinsAndUniforms[f]=m.getDeclaration(f))}h.createPickVertexShaderSource=function(e){return h.replaceMain(e,"czm_old_main")+"\nattribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n    czm_old_main(); \n    czm_pickColor = pickColor; \n}"},h.createPickFragmentShaderSource=function(e,t){return h.replaceMain(e,"czm_old_main")+"\n"+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}"},h.findVarying=function(e,t){for(var r=e.sources,i=t.length,n=0;n<i;++n)for(var o=t[n],a=r.length,s=0;s<a;++s)if(-1!==r[s].indexOf(o))return o};var g=["v_normalEC","v_normal"];h.findNormalVarying=function(e){return h.findVarying(e,g)};var _=["v_positionEC"];return h.findPositionVarying=function(e){return h.findVarying(e,_)},h}),define("Shaders/ShadowVolumeFS",[],function(){"use strict";return"#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main(void)\n{\n#ifdef VECTOR_TILE\ngl_FragColor = u_highlightColor;\n#else\ngl_FragColor = v_color;\n#endif\nczm_writeDepthClampedToFarPlane();\n}\n"}),define("Shaders/ShadowVolumeVS",[],function(){"use strict";return"#ifdef VECTOR_TILE\nattribute vec3 position;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelViewProjection;\n#else\nattribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\n#endif\n#ifdef EXTRUDED_GEOMETRY\nattribute vec3 extrudeDirection;\nuniform float u_globeMinimumAltitude;\n#endif\n#ifndef VECTOR_TILE\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef VECTOR_TILE\ngl_Position = czm_depthClampFarPlane(u_modifiedModelViewProjection * vec4(position, 1.0));\n#else\nv_color = color;\nvec4 position = czm_computePosition();\n#ifdef EXTRUDED_GEOMETRY\nfloat delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\ndelta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\nposition = position + vec4(extrudeDirection * delta, 0.0);\n#endif\ngl_Position = czm_depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n#endif\n}\n"}),define("Scene/ClassificationType",["../Core/freezeObject"],function(e){"use strict";return e({TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2,NUMBER_OF_CLASSIFICATION_TYPES:3})}),define("Scene/DepthFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({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})}),define("Renderer/BufferUsage",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={STREAM_DRAW:t.STREAM_DRAW,STATIC_DRAW:t.STATIC_DRAW,DYNAMIC_DRAW:t.DYNAMIC_DRAW,validate:function(e){return e===r.STREAM_DRAW||e===r.STATIC_DRAW||e===r.DYNAMIC_DRAW}};return e(r)}),define("Renderer/Buffer",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/IndexDatatype","../Core/WebGLConstants","./BufferUsage"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){e=t(e,t.EMPTY_OBJECT);var i=e.context._gl,n=e.bufferTarget,o=e.typedArray,a=e.sizeInBytes,s=e.usage,l=r(o);l&&(a=o.byteLength);var u=i.createBuffer();i.bindBuffer(n,u),i.bufferData(n,l?o:a,s),i.bindBuffer(n,null),this._gl=i,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=a,this._usage=s,this._buffer=u,this.vertexArrayDestroyable=!0}return u.createVertexBuffer=function(e){return new u({context:e.context,bufferTarget:s.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},u.createIndexBuffer=function(e){var t=e.context,r=e.indexDatatype,n=a.getSizeInBytes(r),o=new u({context:t,bufferTarget:s.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),l=o.sizeInBytes/n;return i(o,{indexDatatype:{get:function(){return r}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return l}}}),o},i(u.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),u.prototype._getBuffer=function(){return this._buffer},u.prototype.copyFromArrayView=function(e,r){r=t(r,0);var i=this._gl,n=this._bufferTarget;i.bindBuffer(n,this._buffer),i.bufferSubData(n,r,e),i.bindBuffer(n,null)},u.prototype.copyFromBuffer=function(e,t,r,i){var n=s.COPY_READ_BUFFER,o=s.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(o,this._buffer),a.bindBuffer(n,e._buffer),a.copyBufferSubData(n,o,t,r,i),a.bindBuffer(o,null),a.bindBuffer(n,null)},u.prototype.getBufferData=function(e,r,i,n){r=t(r,0),i=t(i,0);var o=this._gl,a=s.COPY_READ_BUFFER;o.bindBuffer(a,this._buffer),o.getBufferSubData(a,r,e,i,n),o.bindBuffer(a,null)},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),n(this)},u}),define("Renderer/VertexArray",["../Core/Check","../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,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,n,o,a){var s=i(n.vertexBuffer),l=i(n.value),u=n.value?n.value.length:n.componentsPerAttribute,c={index:r(n.index,o),enabled:r(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:l?n.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:r(n.componentDatatype,t.FLOAT),normalize:r(n.normalize,!1),offsetInBytes:r(n.offsetInBytes,0),strideInBytes:r(n.strideInBytes,0),instanceDivisor:r(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){}}e.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 g(e){e=r(e,r.EMPTY_OBJECT);var n,o=e.context,a=o._gl,s=e.attributes,l=e.indexBuffer,u=[],c=1,d=!1,h=!1,p=s.length;for(n=0;n<p;++n)f(u,s[n],n,o);for(p=u.length,n=0;n<p;++n){var g=u[n];if(i(g.vertexBuffer)&&0===g.instanceDivisor){var _=g.strideInBytes||g.componentsPerAttribute*t.getSizeInBytes(g.componentDatatype);c=g.vertexBuffer.sizeInBytes/_;break}}for(n=0;n<p;++n)u[n].instanceDivisor>0&&(d=!0),i(u[n].value)&&(h=!0);var v;o.vertexArrayObject&&(v=o.glCreateVertexArray(),o.glBindVertexArray(v),m(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=d,this._hasConstantAttributes=h,this._context=o,this._gl=a,this._vao=v,this._attributes=u,this._indexBuffer=l}function _(e){return e.values.length/e.componentsPerAttribute}function v(e){return t.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function y(e){var r,n,o,a=[];for(n in e)e.hasOwnProperty(n)&&i(e[n])&&i(e[n].values)&&(a.push(n),e[n].componentDatatype===t.DOUBLE&&(e[n].componentDatatype=t.FLOAT,e[n].values=t.createTypedArray(t.FLOAT,e[n].values)));var s,l=a.length;if(l>0)for(s=_(e[a[0]]),r=1;r<l;++r){var u=_(e[a[r]])
;if(u!==s)throw new c("Each attribute list must have the same number of vertices.  Attribute "+a[r]+" has a different number of vertices ("+u.toString()+") than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(r,i){return t.getSizeInBytes(e[i].componentDatatype)-t.getSizeInBytes(e[r].componentDatatype)});var d=0,h={};for(r=0;r<l;++r)n=a[r],o=e[n],h[n]=d,d+=v(o);if(d>0){var p=t.getSizeInBytes(e[a[0]].componentDatatype),f=d%p;0!==f&&(d+=p-f);var m=s*d,g=new ArrayBuffer(m),y={};for(r=0;r<l;++r){n=a[r];var b=t.getSizeInBytes(e[n].componentDatatype);y[n]={pointer:t.createTypedArray(e[n].componentDatatype,g),index:h[n]/b,strideInComponentType:d/b}}for(r=0;r<s;++r)for(var C=0;C<l;++C){n=a[C],o=e[n];for(var S=o.values,T=y[n],w=T.pointer,A=o.componentsPerAttribute,E=0;E<A;++E)w[T.index+E]=S[r*A+E];T.index+=T.strideInComponentType}return{buffer:g,offsetsInBytes:h,vertexSizeInBytes:d}}}function b(e){var t=e._context,r=e._hasInstancedAttributes;if(r||t._previousDrawInstanced){t._previousDrawInstanced=r;var i,n=t._vertexAttribDivisors,o=e._attributes,a=p.maximumVertexAttributes;if(r){var s=o.length;for(i=0;i<s;++i){var l=o[i];if(l.enabled){var u=l.instanceDivisor,c=l.index;u!==n[c]&&(t.glVertexAttribDivisor(c,u),n[c]=u)}}}else for(i=0;i<a;++i)n[i]>0&&(t.glVertexAttribDivisor(i,0),n[i]=0)}}function C(e,t){for(var r=e._attributes,n=r.length,o=0;o<n;++o){var a=r[o];a.enabled&&i(a.value)&&a.vertexAttrib(t)}}return g.fromGeometry=function(e){e=r(e,r.EMPTY_OBJECT);var n,o,a,c=e.context,p=r(e.geometry,r.EMPTY_OBJECT),f=r(e.bufferUsage,h.DYNAMIC_DRAW),m=r(e.attributeLocations,r.EMPTY_OBJECT),_=r(e.interleave,!1),v=e.vertexArrayAttributes,b=i(v)?v:[],C=p.attributes;if(_){var S=y(C);if(i(S)){a=d.createVertexBuffer({context:c,typedArray:S.buffer,usage:f});var T=S.offsetsInBytes,w=S.vertexSizeInBytes;for(n in C)C.hasOwnProperty(n)&&i(C[n])&&(o=C[n],i(o.values)?b.push({index:m[n],vertexBuffer:a,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:T[n],strideInBytes:w}):b.push({index:m[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in C)if(C.hasOwnProperty(n)&&i(C[n])){o=C[n];var A=o.componentDatatype;A===t.DOUBLE&&(A=t.FLOAT),a=void 0,i(o.values)&&(a=d.createVertexBuffer({context:c,typedArray:t.createTypedArray(A,o.values),usage:f})),b.push({index:m[n],vertexBuffer:a,value:o.value,componentDatatype:A,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var E,x=p.indices;return i(x)&&(E=s.computeNumberOfVertices(p)>=u.SIXTY_FOUR_KILOBYTES&&c.elementIndexUint?d.createIndexBuffer({context:c,typedArray:new Uint32Array(x),usage:f,indexDatatype:l.UNSIGNED_INT}):d.createIndexBuffer({context:c,typedArray:new Uint16Array(x),usage:f,indexDatatype:l.UNSIGNED_SHORT})),new g({context:c,attributes:b,indexBuffer:E})},n(g.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),g.prototype.getAttribute=function(e){return this._attributes[e]},g.prototype._bind=function(){i(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&b(this),this._hasConstantAttributes&&C(this,this._gl)):m(this._gl,this._attributes,this._indexBuffer)},g.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)}},g.prototype.isDestroyed=function(){return!1},g.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 n=this._indexBuffer;return i(n)&&!n.isDestroyed()&&n.vertexArrayDestroyable&&n.destroy(),i(this._vao)&&this._context.glDeleteVertexArray(this._vao),o(this)},g}),define("Scene/BatchTable",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/combine","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Math","../Core/PixelFormat","../Renderer/ContextLimits","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_){"use strict";function v(t,i,n){if(this._attributes=i,this._numberOfInstances=n,0!==i.length){var o=y(i),a=t.floatingPointTexture,s=o===p.FLOAT&&!a,l=C(i,s),u=S(l,i,s),c=Math.floor(h.maximumTextureSize/u),d=Math.min(n,c),f=u*d,m=Math.ceil(n/d),g=1/f,_=.5*g,v=1/m,b=.5*v;this._textureDimensions=new e(f,m),this._textureStep=new r(g,_,v,b),this._pixelDatatype=s?p.UNSIGNED_BYTE:o,this._packFloats=s,this._offsets=l,this._stride=u,this._texture=void 0;var T=4*f*m;this._batchValues=o!==p.FLOAT||s?new Uint8Array(T):new Float32Array(T),this._batchValuesDirty=!1}}function y(e){for(var t=!1,r=e.length,i=0;i<r;++i)if(e[i].componentDatatype!==n.UNSIGNED_BYTE){t=!0;break}return t?p.FLOAT:p.UNSIGNED_BYTE}function b(i,n){var o=i[n].componentsPerAttribute;return 2===o?e:3===o?t:4===o?r:Number}function C(e,t){for(var r=new Array(e.length),i=0,o=e.length,a=0;a<o;++a){var s=e[a],l=s.componentDatatype;r[a]=i,l!==n.UNSIGNED_BYTE&&t?i+=4:++i}return r}function S(e,t,r){var i=e.length,o=e[i-1];return t[i-1].componentDatatype!==n.UNSIGNED_BYTE&&r?o+4:o+1}function T(e){var t=e.w/2,r=Math.floor(t),i=2*(t-r);if(r-=U,i=2*i-1,i=-i,r>=U)return i<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=i*e.x*k;return n+=i*e.y*F,(n+=i*e.z*B)*Math.pow(10,r)}function w(e,t,i){var n=r.unpack(e,t,L),o=T(n);n=r.unpack(e,t+4,L);var a=T(n);n=r.unpack(e,t+8,L);var s=T(n);n=r.unpack(e,t+12,L);var l=T(n);return r.fromElements(o,a,s,l,i)}function A(e,t){if(V[0]=e,0===(e=V[0]))return r.clone(r.ZERO,t);var i,n=e<0?1:0;isFinite(e)?(e=Math.abs(e),i=Math.floor(c.logBase(e,10))+1,e/=Math.pow(10,i)):(e=.1,i=U);var o=e*N;return t.x=Math.floor(o),o=(o-t.x)*N,t.y=Math.floor(o),o=(o-t.y)*N,t.z=Math.floor(o),t.w=2*(i+U)+n,t}function E(e,t,i){var n=A(e.x,L);r.pack(n,t,i),n=A(e.y,n),r.pack(n,t,i+4),n=A(e.z,n),r.pack(n,t,i+8),n=A(e.w,n),r.pack(n,t,i+12)}function x(e,t){var r=e._textureDimensions;e._texture=new m({context:t,pixelFormat:d.RGBA,pixelDatatype:e._pixelDatatype,width:r.x,height:r.y,sampler:new f({minificationFilter:_.NEAREST,magnificationFilter:g.NEAREST})})}function P(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function I(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 D(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("+k+"); \n    unpacked += sign * value.y * float("+F+"); \n    unpacked += sign * value.z * float("+B+"); \n    return unpacked * pow(10.0, exponent); \n} \n":""}function O(e){return 1===e?"float":"vec"+e}function M(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function R(e,t){var r=e._attributes,i=r[t],o=i.componentsPerAttribute,a=i.functionName,s=O(o),l=M(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 e._packFloats&&i.componentDatatype!==p.UNSIGNED_BYTE?c+="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":c+="    vec4 textureValue = texture2D(batchTexture, st); \n",c+="    "+s+" value = textureValue"+l+"; \n",e._pixelDatatype!==p.UNSIGNED_BYTE||i.componentDatatype!==n.UNSIGNED_BYTE||i.normalize?e._pixelDatatype===p.FLOAT&&i.componentDatatype===n.UNSIGNED_BYTE&&i.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 L=new r,N=256,k=1/N,F=1/65536,B=1/16777216,U=38;if(u.supportsTypedArrays()){var V=new Float32Array(1),z=new r;v.prototype.getBatchedAttribute=function(e,t,i){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?w(this._batchValues,u,z):r.unpack(this._batchValues,u,z);var c=b(a,t);return o(c.fromCartesian4)?c.fromCartesian4(n,i):o(c.clone)?c.clone(n,i):n.x};var G=[void 0,void 0,new e,new t,new r],H=new r;return v.prototype.setBatchedAttribute=function(e,t,i){var n=this._attributes,a=G[n[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,a),l=b(this._attributes,t);if(!(o(l.equals)?l.equals(s,i):s===i)){var u=H;u.x=o(i.x)?i.x:i,u.y=o(i.y)?i.y:0,u.z=o(i.z)?i.z:0,u.w=o(i.w)?i.w:0;var c=this._offsets[t],d=this._stride,h=4*d*e+4*c;this._packFloats&&n[t].componentDatatype!==p.UNSIGNED_BYTE?E(u,this._batchValues,h):r.pack(u,this._batchValues,h),this._batchValuesDirty=!0}},v.prototype.update=function(e){o(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,o(this._texture)||x(this,e.context),P(this))},v.prototype.getUniformMapCallback=function(){var e=this;return function(t){return 0===e._attributes.length?t:i(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}},v.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform sampler2D batchTexture; \n";t+=I(this)+"\n",t+=D(this)+"\n";for(var r=e.length,i=0;i<r;++i)t+=R(this,i);return function(e){var r=e.indexOf("void main"),i=e.substring(0,r),n=e.substring(r);return i+"\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}}),define("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,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t,i){var n,o=!i,a=e.length;if(!o&&a>1){var s=e[0].modelMatrix;for(n=1;n<a;++n)if(!h.equals(s,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;n<a;++n)r(e[n].geometry)&&c.transformToWorldCoordinates(e[n]);else h.multiplyTransformation(t,e[0].modelMatrix,t)}function m(e,r){var i=e.attributes,n=i.position,o=n.values.length/n.componentsPerAttribute;i.batchId=new l({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});for(var a=i.batchId.values,s=0;s<o;++s)a[s]=r}function g(e){for(var t=e.length,i=0;i<t;++i){var n=e[i];r(n.geometry)?m(n.geometry,i):r(n.westHemisphereGeometry)&&r(n.eastHemisphereGeometry)&&(m(n.westHemisphereGeometry,i),m(n.eastHemisphereGeometry,i))}}function _(i){var n,o,a=i.instances,s=i.projection,l=i.elementIndexUintSupported,u=i.scene3DOnly,d=i.vertexCacheOptimize,h=i.compressVertices,p=i.modelMatrix,m=a.length;for(n=0;n<m;++n)if(r(a[n].geometry)){a[n].geometry.primitiveType;break}if(f(a,p,u),!u)for(n=0;n<m;++n)r(a[n].geometry)&&c.splitLongitude(a[n]);if(g(a),d)for(n=0;n<m;++n){var _=a[n];r(_.geometry)?(c.reorderForPostVertexCache(_.geometry),c.reorderForPreVertexCache(_.geometry)):r(_.westHemisphereGeometry)&&r(_.eastHemisphereGeometry)&&(c.reorderForPostVertexCache(_.westHemisphereGeometry),c.reorderForPreVertexCache(_.westHemisphereGeometry),c.reorderForPostVertexCache(_.eastHemisphereGeometry),c.reorderForPreVertexCache(_.eastHemisphereGeometry))}var v=c.combineInstances(a);for(m=v.length,n=0;n<m;++n){o=v[n];var y,b=o.attributes;if(u)for(y in b)b.hasOwnProperty(y)&&b[y].componentDatatype===t.DOUBLE&&c.encodeAttribute(o,y,y+"3DHigh",y+"3DLow");else for(y in b)if(b.hasOwnProperty(y)&&b[y].componentDatatype===t.DOUBLE){var C=y+"3D",S=y+"2D";c.projectTo2D(o,y,C,S,s),r(o.boundingSphere)&&"position"===y&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),c.encodeAttribute(o,C,C+"High",C+"Low"),c.encodeAttribute(o,S,S+"High",S+"Low")}h&&c.compressVertices(o)}if(!l){var T=[];for(m=v.length,n=0;n<m;++n)o=v[n],T=T.concat(c.fitToUnsignedShortIndices(o));v=T}return v}function v(e,t,i,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=i[s].indices.length}else o=0,s=0,a=i[s].indices.length;for(var c=e.length,d=0;d<c;++d){var h=e[d],p=h[t];if(r(p)){var f=p.indices.length;o+f>a&&(o=0,a=i[++s].indices.length),n.push({index:s,offset:o,count:f}),o+=f}}}function y(e,t){var r=[];return v(e,"geometry",t,r),v(e,"westHemisphereGeometry",t,r),v(e,"eastHemisphereGeometry",t,r),r}function b(e,t){var i=e.attributes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];r(o)&&r(o.values)&&t.push(o.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function C(e,t){for(var r=e.length,i=0;i<r;++i)b(e[i],t)}function S(t){for(var i=1,n=t.length,o=0;o<n;o++){var a=t[o];if(++i,r(a)){var s=a.attributes;i+=6+2*e.packedLength+(r(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&r(s[l])){var u=s[l];i+=5+u.values.length}}}return i}function T(e,t){var r=e.length,i=new Float64Array(1+16*r),n=0;i[n++]=r;for(var o=0;o<r;o++){var a=e[o];h.pack(a.modelMatrix,i,n),n+=h.packedLength}return t.push(i.buffer),i}function w(e){for(var t=e,r=new Array(t[0]),i=0,n=1;n<t.length;){var o=h.unpack(t,n);n+=h.packedLength,r[i++]={modelMatrix:o}}return r}function A(t){var i=t.length,n=1+(e.packedLength+1)*i,o=new Float32Array(n),a=0;o[a++]=i;for(var s=0;s<i;++s){var l=t[s];r(l)?(o[a++]=1,e.pack(t[s],o,a)):o[a++]=0,a+=e.packedLength}return o}function E(t){for(var r=new Array(t[0]),i=0,n=1;n<t.length;)1===t[n++]&&(r[i]=e.unpack(t,n)),++i,n+=e.packedLength;return r}if(!o.supportsTypedArrays())return{};var x={};return x.combineGeometry=function(t){var i,n,o,a=t.instances,s=a.length;s>0&&(i=_(t),i.length>0&&(n=c.createAttributeLocations(i[0]),t.createPickOffsets&&(o=y(a,i))));for(var l=new Array(s),u=new Array(s),d=0;d<s;++d){var h=a[d],p=h.geometry;r(p)&&(l[d]=p.boundingSphere,u[d]=p.boundingSphereCV);var f=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;r(f)&&r(m)&&(r(f.boundingSphere)&&r(m.boundingSphere)&&(l[d]=e.union(f.boundingSphere,m.boundingSphere)),r(f.boundingSphereCV)&&r(m.boundingSphereCV)&&(u[d]=e.union(f.boundingSphereCV,m.boundingSphereCV)))}return{geometries:i,modelMatrix:t.modelMatrix,attributeLocations:n,pickOffsets:o,boundingSpheres:l,boundingSpheresCV:u}},x.packCreateGeometryResults=function(t,i){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],d=r(c);if(n[l++]=d?1:0,d){n[l++]=c.primitiveType,n[l++]=c.geometryType;var h=r(c.boundingSphere)?1:0;n[l++]=h,h&&e.pack(c.boundingSphere,n,l),l+=e.packedLength;var p=r(c.boundingSphereCV)?1:0;n[l++]=p,p&&e.pack(c.boundingSphereCV,n,l),l+=e.packedLength;var f=c.attributes,m=[];for(var g in f)f.hasOwnProperty(g)&&r(f[g])&&(m.push(g),r(a[g])||(a[g]=o.length,o.push(g)));n[l++]=m.length;for(var _=0;_<m.length;_++){var v=m[_],y=f[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 b=r(c.indices)?c.indices.length:0;n[l++]=b,b>0&&(n.set(c.indices,l),l+=b)}}return i.push(n.buffer),{stringTable:o,packedData:n}},x.unpackCreateGeometryResults=function(r){for(var i,n=r.stringTable,o=r.packedData,a=new Array(o[0]),c=0,h=1;h<o.length;){if(1===o[h++]){var p,f,m=o[h++],g=o[h++];1===o[h++]&&(p=e.unpack(o,h)),h+=e.packedLength;1===o[h++]&&(f=e.unpack(o,h)),h+=e.packedLength;var _,v,y,b=new u,C=o[h++];for(i=0;i<C;i++){var S=n[o[h++]],T=o[h++];y=o[h++];var w=0!==o[h++];_=o[h++],v=t.createTypedArray(T,_);for(var A=0;A<_;A++)v[A]=o[h++];b[S]=new l({componentDatatype:T,componentsPerAttribute:y,normalize:w,values:v})}var E;if((_=o[h++])>0){var x=v.length/y;for(E=d.createTypedArray(x,_),i=0;i<_;i++)E[i]=o[h++]}a[c++]=new s({primitiveType:m,geometryType:g,boundingSphere:p,boundingSphereCV:f,indices:E,attributes:b})}else a[c++]=void 0}return a},x.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,i=r.length,n=0;n<i;n++)t.push(r[n].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:T(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}},x.unpackCombineGeometryParameters=function(e){for(var t=w(e.packedInstances),r=e.createGeometryResults,i=r.length,o=0,s=0;s<i;s++)for(var l=x.unpackCreateGeometryResults(r[s]),u=l.length,c=0;c<u;c++){var d=l[c],f=t[o];f.geometry=d,++o}var m=n.clone(e.ellipsoid);return{instances:t,ellipsoid:m,projection:e.isGeographic?new a(m):new p(m),elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:h.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},x.packCombineGeometryResults=function(e,t){r(e.geometries)&&C(e.geometries,t);var i=A(e.boundingSpheres),n=A(e.boundingSpheresCV);return t.push(i.buffer,n.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:i,boundingSpheresCV:n}},x.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:E(e.boundingSpheres),boundingSpheresCV:E(e.boundingSpheresCV)}},x}),define("Scene/PrimitiveState",["../Core/freezeObject"],function(e){"use strict";return e({READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6})}),define("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)}),define("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,r){return e&&r?t.ENABLED:e?t.CAST_ONLY:r?t.RECEIVE_ONLY:t.DISABLED},e(t)}),define("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","./DepthFunction","./PrimitivePipeline","./PrimitiveState","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U){"use strict";function V(e){e=u(e,u.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=b.clone(u(e.modelMatrix,b.IDENTITY)),this._modelMatrix=new b,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,U.DISABLED),this._translucent=void 0,this._state=F.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._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=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=M.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,r=e.length,i=[],n=e[0].attributes;for(t in n)if(n.hasOwnProperty(t)){for(var o=n[t],a=!0,s=1;s<r;++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&&i.push(t)}return i}function G(e){var n=e.length;return 1===n?e[0]:2===n?t.unpack(e,0,de):3===n?r.unpack(e,0,he):4===n?i.unpack(e,0,pe):void 0}function H(e,t){var r=e.geometryInstances,i=y(r)?r:[r],n=i.length;if(0!==n){var o,s,d,h=z(i),p=h.length,f=e.allowPicking,m=[],g={},_={},v=i[0],b=v.attributes;for(o=0;o<p;++o)s=h[o],d=b[s],g[s]=o,m.push({functionName:"czm_batchTable_"+s,componentDatatype:d.componentDatatype,componentsPerAttribute:d.componentsPerAttribute,normalize:d.normalize});-1!==h.indexOf("distanceDisplayCondition")&&(m.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}),_.center3DHigh=m.length-5,_.center3DLow=m.length-4,_.center2DHigh=m.length-3,_.center2DLow=m.length-2,_.radius=m.length-1),f&&m.push({functionName:"czm_batchTable_pickColor",componentDatatype:l.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var C=m.length,S=new R(t,m,n);for(o=0;o<n;++o){var T=i[o];b=T.attributes;for(var w=0;w<p;++w){s=h[w],d=b[s];var A=G(d.value),E=g[s];S.setBatchedAttribute(o,E,A)}if(f){var x={primitive:u(T.pickPrimitive,e)};c(T.id)&&(x.id=T.id);var P=t.createPickId(x);e._pickIds.push(P);var I=P.color,D=pe;D.x=a.floatToByte(I.red),D.y=a.floatToByte(I.green),D.z=a.floatToByte(I.blue),D.w=a.floatToByte(I.alpha),S.setBatchedAttribute(o,C-1,D)}}e._batchTable=S,e._batchTableAttributeIndices=g,e._batchTableBoundingSphereAttributeIndices=_}}function W(e){var t;return t=y(e.values)?e.values.slice(0):new e.values.constructor(e.values),new _({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function j(t){var r=t.attributes,i=new v;for(var n in r)r.hasOwnProperty(n)&&c(r[n])&&(i[n]=W(r[n]));var o;if(c(t.indices)){var a=t.indices;o=y(a)?a.slice(0):new a.constructor(a)}return new g({attributes:i,indices:o,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function q(e,t){return{geometry:t,modelMatrix:b.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}function Y(e,t){if(!e.compressVertices)return t;var r=-1!==t.search(/attribute\s+vec3\s+normal;/g),i=-1!==t.search(/attribute\s+vec2\s+st;/g);if(!r&&!i)return t;var n=-1!==t.search(/attribute\s+vec3\s+tangent;/g),o=-1!==t.search(/attribute\s+vec3\s+bitangent;/g),a=i&&r?2:1;a+=n||o?1:0;var s=a>1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",d="";if(i){c+="vec2 st;\n";d+="    st = czm_decompressTextureCoordinates("+(a>1?l+".x":l)+");\n"}r&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",d+="    czm_octDecode("+l+"."+(i?"yz":"xy")+", normal, tangent, bitangent);\n"):(r&&(c+="vec3 normal;\n",d+="    normal = czm_octDecode("+l+(a>1?"."+(i?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",d+="    tangent = czm_octDecode("+l+"."+(i&&r?"z":"y")+");\n"),o&&(c+="vec3 bitangent;\n",d+="    bitangent = czm_octDecode("+l+"."+(i&&r?"z":"y")+");\n"));var h=t;return h=h.replace(/attribute\s+vec3\s+normal;/g,""),h=h.replace(/attribute\s+vec2\s+st;/g,""),h=h.replace(/attribute\s+vec3\s+tangent;/g,""),h=h.replace(/attribute\s+vec3\s+bitangent;/g,""),h=D.replaceMain(h,"czm_non_compressed_main"),[u,c,h,"void main() \n{ \n"+d+"    czm_non_compressed_main(); \n}"].join("\n")}function X(e){var t=D.replaceMain(e,"czm_non_depth_clamp_main");return t+="varying float v_WindowZ;\nvoid main() {\n    czm_non_depth_clamp_main();\n    vec4 position = gl_Position;\n    v_WindowZ = (0.5 * (position.z / position.w) + 0.5) * position.w;\n    position.z = min(position.z, position.w);\n    gl_Position = position;}\n"}function Q(e){var t=D.replaceMain(e,"czm_non_depth_clamp_main");return t+="varying float v_WindowZ;\nvoid main() {\n    czm_non_depth_clamp_main();\n#ifdef GL_EXT_frag_depth\n    gl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\n",t="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n"+t}function Z(e,t){e.vertexAttributes}function K(e,t){return function(){return e[t]}}function J(e,t){var r,i,n,o,a=e._instanceIds;if(e._state===F.READY){r=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var s=e._numberOfInstances=r.length,l=[],d=[];for(n=0;n<s;++n)i=r[n].geometry,a.push(r[n].id),d.push({moduleName:i._workerName,geometry:i});if(!c(me))for(me=new Array(ge),n=0;n<ge;n++)me[n]=new T("createGeometry",Number.POSITIVE_INFINITY);var h;for(d=S(d,ge),n=0;n<d.length;n++){var p=0,f=d[n],m=f.length;for(o=0;o<m;++o)h=f[o],i=h.geometry,c(i.constructor.pack)&&(h.offset=p,p+=u(i.constructor.packedLength,i.packedLength));var g;if(p>0){var _=new Float64Array(p);for(g=[_.buffer],o=0;o<m;++o)h=f[o],i=h.geometry,c(i.constructor.pack)&&(i.constructor.pack(i,_,h.offset),h.geometry=_)}l.push(me[n].scheduleTask({subTasks:d[n]},g))}e._state=F.CREATING,M.all(l,function(t){e._createGeometryResults=t,e._state=F.CREATED}).otherwise(function(r){ce(e,t,F.FAILED,r)})}else if(e._state===F.CREATED){var v=[];r=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var C=t.scene3DOnly,w=t.mapProjection,A=_e.scheduleTask(k.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:r,ellipsoid:w.ellipsoid,projection:w,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:C,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},v),v);e._createGeometryResults=void 0,e._state=F.COMBINING,M(A,function(r){var i=k.unpackCombineGeometryResults(r);e._geometries=i.geometries,e._attributeLocations=i.attributeLocations,e.modelMatrix=b.clone(i.modelMatrix,e.modelMatrix),e._pickOffsets=i.pickOffsets,e._instanceBoundingSpheres=i.boundingSpheres,e._instanceBoundingSpheresCV=i.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=F.COMBINED:ce(e,t,F.FAILED,void 0)}).otherwise(function(r){ce(e,t,F.FAILED,r)})}}function $(e,t){var r,i,n=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),s=e._instanceIds,l=0;for(i=0;i<o;i++){r=n[i];var u,d=r.geometry;u=c(d.attributes)&&c(d.primitiveType)?j(d):d.constructor.createGeometry(d),a[l++]=q(r,u),s.push(r.id)}a.length=l;var h=t.scene3DOnly,p=t.mapProjection,f=k.combineGeometry({instances:a,ellipsoid:p.ellipsoid,projection:p,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:h,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=f.geometries,e._attributeLocations=f.attributeLocations,e.modelMatrix=b.clone(f.modelMatrix,e.modelMatrix),e._pickOffsets=f.pickOffsets,e._instanceBoundingSpheres=f.boundingSpheres,e._instanceBoundingSpheresCV=f.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=F.COMBINED:ce(e,t,F.FAILED,void 0)}function ee(t,r){if(c(t._batchTableAttributeIndices.distanceDisplayCondition)&&!t._batchTableBoundingSpheresUpdated){for(var i=t._batchTableBoundingSphereAttributeIndices,n=i.center3DHigh,o=i.center3DLow,a=i.center2DHigh,s=i.center2DLow,l=i.radius,u=r.mapProjection,d=u.ellipsoid,h=t._batchTable,p=t._instanceBoundingSpheres,m=p.length,g=0;g<m;++g){var _=p[g];if(c(_)){var v=t.modelMatrix;c(v)&&(_=e.transform(_,v,Ce));var y=_.center,b=_.radius,C=f.fromCartesian(y,ve);h.setBatchedAttribute(g,n,C.high),h.setBatchedAttribute(g,o,C.low);var S=d.cartesianToCartographic(y,ye),T=u.project(S,be);C=f.fromCartesian(T,ve),h.setBatchedAttribute(g,a,C.high),h.setBatchedAttribute(g,s,C.low),h.setBatchedAttribute(g,l,b)}}t._batchTableBoundingSpheresUpdated=!0}}function te(t,r){for(var i=t._attributeLocations,n=t._geometries,o=r.scene3DOnly,a=r.context,s=[],l=n.length,u=0;u<l;++u){var d=n[u];if(s.push(O.fromGeometry({context:a,geometry:d,attributeLocations:i,bufferUsage:w.STATIC_DRAW,interleave:t._interleave})),
c(t._createBoundingVolumeFunction))t._createBoundingVolumeFunction(r,d);else if(t._boundingSpheres.push(e.clone(d.boundingSphere)),t._boundingSphereWC.push(new e),!o){var h=d.boundingSphereCV.center,p=h.x,f=h.y,m=h.z;h.x=m,h.y=p,h.z=f,t._boundingSphereCV.push(e.clone(d.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,ce(t,r,F.COMPLETE,void 0)}function re(e,t,r,i){var n,a=r.getRenderState();i?(n=o(a,!1),n.cull={enabled:!0,face:L.BACK},e._frontFaceRS=P.fromCache(n),n.cull.face=L.FRONT,e._backFaceRS=P.fromCache(n)):(e._frontFaceRS=P.fromCache(a),e._backFaceRS=e._frontFaceRS),n=o(a,!1),c(e._depthFailAppearance)&&(n.depthTest.enabled=!1),e.allowPicking?i?(n.cull={enabled:!1},e._pickRS=P.fromCache(n)):e._pickRS=P.fromCache(n):(n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i?(n.cull={enabled:!1},e._pickRS=P.fromCache(n)):e._pickRS=P.fromCache(n)),c(e._depthFailAppearance)&&(a=e._depthFailAppearance.getRenderState(),n=o(a,!1),n.depthTest.func=N.GREATER,i?(n.cull={enabled:!0,face:L.BACK},e._frontFaceDepthFailRS=P.fromCache(n),n.cull.face=L.FRONT,e._backFaceDepthFailRS=P.fromCache(n)):(e._frontFaceDepthFailRS=P.fromCache(n),e._backFaceDepthFailRS=e._frontFaceRS))}function ie(e,t,r){var i=t.context,n=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(r.vertexShaderSource);o=V._appendShowToShader(e,o),o=V._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=V._updateColorAttribute(e,o,!1),o=Y(e,o),o=V._modifyShaderPosition(e,o,t.scene3DOnly);var a=r.getFragmentShaderSource();if(e.allowPicking){var s=D.createPickVertexShaderSource(o);s=V._updatePickColorAttribute(s),e._pickSP=I.replaceCache({context:i,shaderProgram:e._pickSP,vertexShaderSource:s,fragmentShaderSource:D.createPickFragmentShaderSource(a,"varying"),attributeLocations:n})}else e._pickSP=I.fromCache({context:i,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n});Z(e._pickSP,n),e._sp=I.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),Z(e._sp,n),c(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=V._appendShowToShader(e,o),o=V._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=V._updateColorAttribute(e,o,!0),o=Y(e,o),o=V._modifyShaderPosition(e,o,t.scene3DOnly),o=X(o),a=Q(e._depthFailAppearance.getFragmentShaderSource()),e._spDepthFail=I.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),Z(e._spDepthFail,n))}function ne(e,t,r,i){var n=c(r)?r._uniforms:void 0,o={},a=t.uniforms;if(c(a))for(var l in a)a.hasOwnProperty(l)&&(o[l]=K(a,l));var u=s(o,n);return u=e._batchTable.getUniformMapCallback()(u),c(e.rtcCenter)&&(u.u_modifiedModelView=function(){var t=i.context.uniformState.view;return b.multiply(t,e._modelMatrix,Se),b.multiplyByPoint(Se,e.rtcCenter,Te),b.setTranslation(Se,Te,Se),Se}),u}function oe(e,t,r,i,n,o,a,s){var l,u=ne(e,t,r,s);c(e._depthFailAppearance)&&(l=ne(e,e._depthFailAppearance,e._depthFailAppearance.material,s));var d=i?x.TRANSLUCENT:x.OPAQUE,h=n?2:1;h*=c(e._depthFailAppearance)?2:1,o.length=e._va.length*h,a.length=e._va.length;for(var p=o.length,f=0,m=0,g=0;g<p;++g){var _;n&&(_=o[g],c(_)||(_=o[g]=new E({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[m],_.renderState=e._backFaceRS,_.shaderProgram=e._sp,_.uniformMap=u,_.pass=d,++g),_=o[g],c(_)||(_=o[g]=new E({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[m],_.renderState=e._frontFaceRS,_.shaderProgram=e._sp,_.uniformMap=u,_.pass=d,c(e._depthFailAppearance)&&(n&&(++g,_=o[g],c(_)||(_=o[g]=new E({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[m],_.renderState=e._backFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=l,_.pass=d),++g,_=o[g],c(_)||(_=o[g]=new E({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[m],_.renderState=e._frontFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=l,_.pass=d);var v=a[f];c(v)||(v=a[f]=new E({owner:e,primitiveType:e._primitiveType})),v.vertexArray=e._va[m],v.renderState=e._pickRS,v.shaderProgram=e._pickSP,v.uniformMap=u,v.pass=d,++f,++m}}function ae(e,t,r,i,n,o,a,s){V._updateBoundingVolumes(e,t,n);var l;t.mode===B.SCENE3D?l=e._boundingSphereWC:t.mode===B.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===B.SCENE2D&&c(e._boundingSphere2D)?l=e._boundingSphere2D:c(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);var u=t.commandList,d=t.passes;if(d.render){var h=U.castShadows(e.shadows),p=U.receiveShadows(e.shadows),f=r.length,m=s?2:1;m*=c(e._depthFailAppearance)?2:1;for(var g=0;g<f;++g){var _=Math.floor(g/m),v=r[g];v.modelMatrix=n,v.boundingVolume=l[_],v.cull=o,v.debugShowBoundingVolume=a,v.castShadows=h,v.receiveShadows=p,u.push(v)}}if(d.pick)for(var y=i.length,b=0;b<y;++b){var C=i[b];C.modelMatrix=n,C.boundingVolume=l[b],C.cull=o,u.push(C)}}function se(e,t,r){return function(){var i=e.getBatchedAttribute(t,r),n=e.attributes[r],o=n.componentsPerAttribute,a=l.createTypedArray(n.componentDatatype,o);return c(i.constructor.pack)?i.constructor.pack(i,a,0):a[0]=i,a}}function le(e,t,r){return function(i){var n=G(i);e.setBatchedAttribute(t,r,n)}}function ue(t,r,i){r.boundingSphere={get:function(){var r=t._instanceBoundingSpheres[i],n=t.modelMatrix;return c(n)&&c(r)&&(r=e.transform(r,n)),r}},r.boundingSphereCV={get:function(){return t._instanceBoundingSpheresCV[i]}}}function ce(e,t,r,i){e._error=i,e._state=r,t.afterRender.push(function(){e._ready=e._state===F.COMPLETE||e._state===F.FAILED,c(i)?e._readyPromise.reject(i):e._readyPromise.resolve(e)})}d(V.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 de=new t,he=new r,pe=new i,fe=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;V._modifyShaderPosition=function(e,t,r){for(var i,n="",o="",a="";null!==(i=fe.exec(t));){var s=i[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")):r?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")},V._appendShowToShader=function(e,t){if(!c(e._batchTableAttributeIndices.show))return t;return D.replaceMain(t,"czm_non_show_main")+"\nvoid main() \n{ \n    czm_non_show_main(); \n    gl_Position *= czm_batchTable_show(batchId); \n}"},V._updateColorAttribute=function(e,t,r){if(!c(e._batchTableAttributeIndices.color)&&!c(e._batchTableAttributeIndices.depthFailColor))return t;if(-1===t.search(/attribute\s+vec4\s+color;/g))return t;var i=t;return i=i.replace(/attribute\s+vec4\s+color;/g,""),i=r?i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},V._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")},V._appendDistanceDisplayConditionToShader=function(e,t,r){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;var i=D.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+=r?"    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}",i+"\n"+n};var me,ge=Math.max(m.hardwareConcurrency-1,1),_e=new T("combineGeometry",Number.POSITIVE_INFINITY),ve=new f,ye=new n,be=new r,Ce=new e,Se=new b,Te=new r;return V._updateBoundingVolumes=function(t,r,i){var n,o,a,s=t.appearance.pixelSize;if(c(s))for(o=t._boundingSpheres.length,n=0;n<o;++n){a=t._boundingSpheres[n];var l=t._boundingSphereWC[n],u=r.camera.getPixelSize(a,r.context.drawingBufferWidth,r.context.drawingBufferHeight),d=u*s;l.radius=a.radius+d}if(!b.equals(i,t._modelMatrix))for(b.clone(i,t._modelMatrix),o=t._boundingSpheres.length,n=0;n<o;++n)a=t._boundingSpheres[n],c(a)&&(t._boundingSphereWC[n]=e.transform(a,i,t._boundingSphereWC[n]),r.scene3DOnly||(t._boundingSphere2D[n]=e.clone(t._boundingSphereCV[n],t._boundingSphere2D[n]),t._boundingSphere2D[n].center.x=0,t._boundingSphereMorph[n]=e.union(t._boundingSphereWC[n],t._boundingSphereCV[n])))},V.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!==B.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(c(this._error))throw this._error;if(this._state!==F.FAILED){var t=e.context;if(c(this._batchTable)||H(this,t),this._batchTable.attributes.length>0){if(0===A.maximumVertexTextureImageUnits)throw new C("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!==F.COMPLETE&&this._state!==F.COMBINED&&(this.asynchronous?J(this,e):$(this,e)),this._state===F.COMBINED&&(ee(this,e),te(this,e)),this.show&&this._state===F.COMPLETE){var r=this.appearance,i=r.material,n=!1,o=!1;this._appearance!==r?(this._appearance=r,this._material=i,n=!0,o=!0):this._material!==i&&(this._material=i,o=!0);var a=this.depthFailAppearance,s=c(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=s,n=!0,o=!0):this._depthFailMaterial!==s&&(this._depthFailMaterial=s,o=!0);var l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,n=!0),c(this._material)&&this._material.update(t);var d=r.closed&&l;if(n){u(this._createRenderStatesFunction,re)(this,t,r,d)}if(o){u(this._createShaderProgramFunction,ie)(this,e,r)}if(n||o){u(this._createCommandsFunction,oe)(this,r,i,l,d,this._colorCommands,this._pickCommands,e)}u(this._updateAndQueueCommandsFunction,ae)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)}}}},V.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,r=this._lastPerInstanceAttributeIndex,i=this._instanceIds,n=i.length,o=0;o<n;++o){var a=(r+o)%n;if(e===i[a]){t=a;break}}if(-1!==t){var s=this._perInstanceAttributeCache[t];if(c(s))return s;var l=this._batchTable,u=this._batchTableAttributeIndices;s={};var h={};for(var p in u)if(u.hasOwnProperty(p)){var f=u[p];h[p]={get:se(l,t,f)};var m=!0,g=this._readOnlyInstanceAttributes;if(m&&c(g)){n=g.length;for(var _=0;_<n;++_)if(p===g[_]){m=!1;break}}m&&(h[p].set=le(l,t,f))}return ue(this,h,t),d(s,h),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=s,s}},V.prototype.isDestroyed=function(){return!1},V.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();var r=this._va;for(e=r.length,t=0;t<e;++t)r[t].destroy();this._va=void 0;var i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[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,h(this)},V}),define("Scene/StencilFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({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})}),define("Scene/StencilOperation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";return e({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})}),define("Scene/ClassificationPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryInstance","../Core/isArray","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeVS","../ThirdParty/when","./BlendingState","./ClassificationType","./DepthFunction","./PerInstanceColorAppearance","./Primitive","./SceneMode","./StencilFunction","./StencilOperation"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T){"use strict";function w(e){e=t(e,t.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.show=t(e.show,!0),this.classificationType=t(e.classificationType,_.BOTH),this.debugShowBoundingVolume=t(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=t(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=t(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilDepthPass=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._readyPromise=m.defer(),this._primitive=void 0,this._pickPrimitive=e._pickPrimitive;var i,n=new y({flat:!0});r(this.geometryInstances)&&s(this.geometryInstances)&&this.geometryInstances.length>1&&(i=k),this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._primitiveOptions={geometryInstances:void 0,appearance:n,vertexCacheOptimize:t(e.vertexCacheOptimize,!1),interleave:t(e.interleave,!1),releaseGeometryInstances:t(e.releaseGeometryInstances,!0),allowPicking:t(e.allowPicking,!0),asynchronous:t(e.asynchronous,!0),compressVertices:t(e.compressVertices,!0),_readOnlyInstanceAttributes:i,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}function A(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:S.ALWAYS,frontOperation:{fail:T.KEEP,zFail:T.DECREMENT_WRAP,zPass:T.DECREMENT_WRAP},backFunction:S.ALWAYS,backOperation:{fail:T.KEEP,zFail:T.INCREMENT_WRAP,zPass:T.INCREMENT_WRAP},reference:B,mask:F},depthTest:{enabled:!1},depthMask:!1}}function E(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:S.ALWAYS,frontOperation:{fail:T.KEEP,zFail:T.KEEP,zPass:T.INCREMENT_WRAP},backFunction:S.ALWAYS,backOperation:{fail:T.KEEP,zFail:T.KEEP,zPass:T.DECREMENT_WRAP},reference:B,mask:F},depthTest:{enabled:!0,func:v.LESS_OR_EQUAL},depthMask:!1}}function x(e){return{stencilTest:{enabled:e,frontFunction:S.NOT_EQUAL,frontOperation:{fail:T.KEEP,zFail:T.KEEP,zPass:T.DECREMENT_WRAP},backFunction:S.NOT_EQUAL,backOperation:{fail:T.KEEP,zFail:T.KEEP,zPass:T.DECREMENT_WRAP},reference:B,mask:F},depthTest:{enabled:!1},depthMask:!1,blending:g.ALPHA_BLEND}}function P(e,t,i,n){if(!r(e._rsStencilPreloadPass)){var o=!e.debugShowShadowVolume;e._rsStencilPreloadPass=c.fromCache(A(o)),e._rsStencilDepthPass=c.fromCache(E(o)),e._rsColorPass=c.fromCache(x(o)),e._rsPickPass=c.fromCache(U)}}function I(e,t){if(!e.compressVertices)return t;if(-1!==t.search(/attribute\s+vec3\s+extrudeDirection;/g)){var r=t;r=r.replace(/attribute\s+vec3\s+extrudeDirection;/g,""),r=h.replaceMain(r,"czm_non_compressed_main");return["attribute vec2 compressedAttributes;","vec3 extrudeDirection;\n",r,"void main() \n{ \n    extrudeDirection = czm_octDecode(compressedAttributes, 65535.0);\n    czm_non_compressed_main(); \n}"].join("\n")}}function D(e,t,i){if(!r(e._sp)){var n=t.context,o=e._primitive,a=f;a=e._primitive._batchTable.getVertexShaderCallback()(a),a=b._appendDistanceDisplayConditionToShader(o,a),a=b._modifyShaderPosition(e,a,t.scene3DOnly),a=b._updateColorAttribute(o,a),e._extruded&&(a=I(o,a));var s=e._extruded?"EXTRUDED_GEOMETRY":"",l=new h({defines:[s],sources:[a]}),u=new h({sources:[p]}),c=e._primitive._attributeLocations;if(e._spStencil=d.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:c}),e._primitive.allowPicking){var m=h.createPickVertexShaderSource(a);m=b._appendShowToShader(o,m),m=b._updatePickColorAttribute(m);var g=new h({defines:[s],sources:[m]}),_=new h({sources:[p],pickColorQualifier:"varying"});e._spPick=d.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:g,fragmentShaderSource:_,attributeLocations:c})}else e._spPick=d.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:c});a=b._appendShowToShader(o,a),l=new h({defines:[s],sources:[a]}),e._sp=d.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:c})}}function O(e,t){var i=e._primitive,n=3*i._va.length;t.length=n;var o,a,s=0,c=i._batchTable.getUniformMapCallback()(e._uniformMap);for(o=0;o<n;o+=3){var d=i._va[s++];a=t[o],r(a)||(a=t[o]=new l({owner:e,primitiveType:i._primitiveType})),a.vertexArray=d,a.renderState=e._rsStencilPreloadPass,a.shaderProgram=e._sp,a.uniformMap=c,a=t[o+1],r(a)||(a=t[o+1]=new l({owner:e,primitiveType:i._primitiveType})),a.vertexArray=d,a.renderState=e._rsStencilDepthPass,a.shaderProgram=e._sp,a.uniformMap=c,a=t[o+2],r(a)||(a=t[o+2]=new l({owner:e,primitiveType:i._primitiveType})),a.vertexArray=d,a.renderState=e._rsColorPass,a.shaderProgram=e._sp,a.uniformMap=c}var h=e._commandsIgnoreShow,p=e._spStencil,f=0;n=h.length=n/3*2;for(var m=0;m<n;m+=2){var g=h[m]=l.shallowClone(t[f],h[m]);g.shaderProgram=p,g.pass=u.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,g=h[m+1]=l.shallowClone(t[f+1],h[m+1]),g.shaderProgram=p,g.pass=u.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,f+=3}}function M(e,t){var i=e._primitive,n=i._pickOffsets,o=3*n.length;t.length=o;var a,s,u=0,c=i._batchTable.getUniformMapCallback()(e._uniformMap);for(a=0;a<o;a+=3){var d=n[u++],h=d.offset,p=d.count,f=i._va[d.index];s=t[a],r(s)||(s=t[a]=new l({owner:e,primitiveType:i._primitiveType})),s.vertexArray=f,s.offset=h,s.count=p,s.renderState=e._rsStencilPreloadPass,s.shaderProgram=e._spStencil,s.uniformMap=c,s=t[a+1],r(s)||(s=t[a+1]=new l({owner:e,primitiveType:i._primitiveType})),s.vertexArray=f,s.offset=h,s.count=p,s.renderState=e._rsStencilDepthPass,s.shaderProgram=e._spStencil,s.uniformMap=c,s=t[a+2],r(s)||(s=t[a+2]=new l({owner:e,primitiveType:i._primitiveType})),s.vertexArray=f,s.offset=h,s.count=p,s.renderState=e._rsPickPass,s.shaderProgram=e._spPick,s.uniformMap=c}}function R(e,t,r,i,n,o,a){O(e,o),M(e,a)}function L(e,t){return Math.floor(e%t/3)}function N(e,t,i,n,o,a,s,l){var c=e._primitive;b._updateBoundingVolumes(c,t,o);var d;t.mode===C.SCENE3D?d=c._boundingSphereWC:t.mode===C.COLUMBUS_VIEW?d=c._boundingSphereCV:t.mode===C.SCENE2D&&r(c._boundingSphere2D)?d=c._boundingSphere2D:r(c._boundingSphereMorph)&&(d=c._boundingSphereMorph);var h,p,f=t.commandList,m=t.passes;switch(e.classificationType){case _.TERRAIN:p=u.TERRAIN_CLASSIFICATION;break;case _.CESIUM_3D_TILE:p=u.CESIUM_3D_TILE_CLASSIFICATION;break;default:p=u.CLASSIFICATION}if(m.render){var g,v=i.length;for(h=0;h<v;++h)g=i[h],g.modelMatrix=o,g.boundingVolume=d[L(h,v)],g.cull=a,g.debugShowBoundingVolume=s,g.pass=p,f.push(g);if(t.invertClassification){var y=e._commandsIgnoreShow,S=y.length;for(h=0;h<S;++h){var T=Math.floor(h/2);g=y[h],g.modelMatrix=o,g.boundingVolume=d[T],g.cull=a,g.debugShowBoundingVolume=s,f.push(g)}}}if(m.pick){var w=n.length,A=c._pickOffsets;for(h=0;h<w;++h){var E=A[L(h,w)],x=n[h];x.modelMatrix=o,x.boundingVolume=d[E.index],x.cull=a,x.pass=p,f.push(x)}}}var k=["color"];i(w.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}}}),w.isSupported=function(e){return e.context.stencilBuffer};var F=15,B=0,U={stencilTest:{enabled:!0,frontFunction:S.NOT_EQUAL,frontOperation:{fail:T.KEEP,zFail:T.KEEP,zPass:T.DECREMENT_WRAP},backFunction:S.NOT_EQUAL,backOperation:{fail:T.KEEP,zFail:T.KEEP,zPass:T.DECREMENT_WRAP},reference:B,mask:F},depthTest:{enabled:!1},depthMask:!1};return w.prototype.update=function(e){if(this.show&&(r(this._primitive)||r(this.geometryInstances))){var i=this,n=this._primitiveOptions;if(!r(this._primitive)){var o,l,u=s(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],d=u.length,h=new Array(d);for(o=0;o<d;++o)l=u[o],h[o]=new a({geometry:l.geometry,attributes:l.attributes,modelMatrix:l.modelMatrix,id:l.id,pickPrimitive:t(this._pickPrimitive,i)});n.geometryInstances=h,r(this._createBoundingVolumeFunction)&&(n._createBoundingVolumeFunction=function(e,t){i._createBoundingVolumeFunction(e,t)}),n._createRenderStatesFunction=function(e,t,r,n){P(i,t)},n._createShaderProgramFunction=function(e,t,r){D(i,t)},n._createCommandsFunction=function(e,t,r,n,o,a,s){R(i,void 0,void 0,!0,!1,a,s)},r(this._updateAndQueueCommandsFunction)?n._updateAndQueueCommandsFunction=function(e,t,r,n,o,a,s,l){i._updateAndQueueCommandsFunction(e,t,r,n,o,a,s,l)}:n._updateAndQueueCommandsFunction=function(e,t,r,n,o,a,s,l){N(i,t,r,n,o,a,s,l)},this._primitive=new b(n),this._primitive.readyPromise.then(function(e){i._ready=!0,i.releaseGeometryInstances&&(i.geometryInstances=void 0);var t=e._error;r(t)?i._readyPromise.reject(t):i._readyPromise.resolve(i)})}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilPreloadPass=c.fromCache(A(!1)),this._rsStencilDepthPass=c.fromCache(E(!1)),this._rsColorPass=c.fromCache(x(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilPreloadPass=c.fromCache(A(!0)),this._rsStencilDepthPass=c.fromCache(E(!0)),this._rsColorPass=c.fromCache(x(!0))),this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},w.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},w.prototype.isDestroyed=function(){return!1},w.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),n(this)},w}),define("Scene/GroundPrimitive",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/GeometryInstance","../Core/isArray","../Core/Math","../Core/OrientedBoundingBox","../Core/Rectangle","../Core/Resource","../Renderer/Pass","../ThirdParty/when","./ClassificationPrimitive","./ClassificationType","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C){"use strict";function S(e){e=o(e,o.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.show=o(e.show,!0),this.classificationType=o(e.classificationType,b.BOTH),this.debugShowBoundingVolume=o(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=o(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=v.defer(),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=S._defaultMaxTerrainHeight,this._minTerrainHeight=S._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[];var t=this;this._primitiveOptions={geometryInstances:void 0,vertexCacheOptimize:o(e.vertexCacheOptimize,!1),interleave:o(e.interleave,!1),releaseGeometryInstances:o(e.releaseGeometryInstances,!0),allowPicking:o(e.allowPicking,!0),asynchronous:o(e.asynchronous,!0),compressVertices:o(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:t,_extruded:!0,_uniformMap:M}}function T(e){return function(t,r){var i=r.maximumRadius,n=i/Math.cos(.5*t)-i;return e._maxHeight+n}}function w(e){return function(t,r){return e._minHeight}}function A(e,t){var r=e.mapProjection.ellipsoid;{if(a(t.attributes)&&a(t.attributes.position3DHigh)){for(var n=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,s=n.length,l=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=0;h<s;h+=3){var p=i.unpack(n,h,R),f=i.unpack(o,h,L),m=i.add(p,f,N),g=r.cartesianToCartographic(m,k),_=g.latitude,v=g.longitude;l=Math.min(l,_),u=Math.min(u,v),c=Math.max(c,_),d=Math.max(d,v)}var y=F;return y.north=c,y.south=l,y.east=d,y.west=u,y}if(a(t.rectangle))return t.rectangle}}function E(e){n.fromRadians(e.east,e.north,0,U[0]),n.fromRadians(e.west,e.north,0,U[1]),n.fromRadians(e.east,e.south,0,U[2]),n.fromRadians(e.west,e.south,0,U[3]);var t,r=0,i=0,o=0,a=0,s=S._terrainHeightsMaxLevel;for(t=0;t<=s;++t){for(var l=!1,u=0;u<4;++u){var c=U[u];if(B.positionToTileXY(c,t,V),0===u)o=V.x,a=V.y;else if(o!==V.x||a!==V.y){l=!0;break}}if(l)break;r=o,i=a}if(0!==t)return{x:r,y:i,level:t>s?s:t-1}}function x(e,t,r){var n=E(t),o=S._defaultMinTerrainHeight,s=S._defaultMaxTerrainHeight;if(a(n)){var l=n.level+"-"+n.x+"-"+n.y,u=S._terrainHeights[l];a(u)&&(o=u[0],s=u[1]),r.cartographicToCartesian(m.northeast(t,H),z),r.cartographicToCartesian(m.southwest(t,H),G),i.subtract(G,z,W),i.add(z,i.multiplyByScalar(W,.5,W),W);var c=r.scaleToGeodeticSurface(W,j);if(a(c)){var d=i.distance(W,c);o=Math.min(o,-d)}else o=S._defaultMinTerrainHeight}e._minTerrainHeight=Math.max(S._defaultMinTerrainHeight,o),e._maxTerrainHeight=s}function P(t,r){var i=E(t),n=S._defaultMaxTerrainHeight;if(a(i)){var o=i.level+"-"+i.x+"-"+i.y,s=S._terrainHeights[o];a(s)&&(n=s[1])}var l=e.fromRectangle3D(t,r,0);return e.fromRectangle3D(t,r,n,q),e.union(l,q,l)}function I(t,r,n){var o=r.mapProjection.ellipsoid,a=A(r,n);if(a.width<p.PI){var s=f.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(!r.scene3DOnly){var c=r.mapProjection,d=e.fromRectangleWithHeights2D(a,c,t._maxHeight,t._minHeight);i.fromElements(d.center.z,d.center.x,d.center.y,d.center),t._boundingVolumes2D.push(d)}}function D(e,t){return Math.floor(e%t/3)}function O(e,t,r,i,n,o,a,s){var l;l=t.mode===C.SCENE3D?e._boundingVolumes:e._boundingVolumes2D;var u;switch(e.classificationType){case b.TERRAIN:u=_.TERRAIN_CLASSIFICATION;break;case b.CESIUM_3D_TILE:u=_.CESIUM_3D_TILE_CLASSIFICATION;break;default:u=_.CLASSIFICATION}var c=t.commandList,d=t.passes;if(d.render){var h,p,f=r.length;for(h=0;h<f;++h)p=r[h],p.owner=e,p.modelMatrix=n,p.boundingVolume=l[D(h,f)],p.cull=o,p.debugShowBoundingVolume=a,p.pass=u,c.push(p);if(t.invertClassification){var m=e._primitive._commandsIgnoreShow,g=m.length;for(h=0;h<g;++h){var v=Math.floor(h/2);p=m[h],p.modelMatrix=n,p.boundingVolume=l[v],p.cull=o,p.debugShowBoundingVolume=a,c.push(p)}}}if(d.pick)for(var y=i.length,S=e._primitive._primitive,T=S._pickOffsets,w=0;w<y;++w){var A=T[D(w,y)],E=l[A.index],x=i[w];x.owner=e,x.modelMatrix=n,x.boundingVolume=E,x.cull=o,x.pass=u,c.push(x)}}var M={u_globeMinimumAltitude:function(){return 55e3}};s(S.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}}}),S.isSupported=y.isSupported,S._defaultMaxTerrainHeight=9e3,S._defaultMinTerrainHeight=-1e5,S._terrainHeights=void 0,S._terrainHeightsMaxLevel=6;var R=new i,L=new i,N=new i,k=new n,F=new m,B=new c,U=[new n,new n,new n,new n],V=new r,z=new i,G=new i,H=new n,W=new i,j=new i,q=new e;return S._initialized=!1,S._initPromise=void 0,S.initializeTerrainHeights=function(){var e=S._initPromise;return a(e)?e:(S._initPromise=g.fetchJson(t("Assets/approximateTerrainHeights.json")).then(function(e){S._initialized=!0,S._terrainHeights=e}),S._initPromise)},S.prototype.update=function(e){if(this.show&&(a(this._primitive)||a(this.geometryInstances))){
if(!S._initialized)return void S.initializeTerrainHeights();var t=this,r=this._primitiveOptions;if(!a(this._primitive)){var i,n,o,s,l,u=e.mapProjection.ellipsoid,c=h(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],p=c.length,f=new Array(p);for(s=0;s<p;++s){i=c[s],n=i.geometry;var g=A(e,n);a(l)?a(g)&&m.union(l,g,l):l=g;var _=i.id;if(a(_)&&a(g)){var v=P(g,u);this._boundingSpheresKeys.push(_),this._boundingSpheres.push(v)}o=n.constructor,!a(o)||a(o.createShadowVolume)}x(this,l,e.mapProjection.ellipsoid);var b=e.terrainExaggeration;for(this._minHeight=this._minTerrainHeight*b,this._maxHeight=this._maxTerrainHeight*b,s=0;s<p;++s)i=c[s],n=i.geometry,o=n.constructor,f[s]=new d({geometry:o.createShadowVolume(n,w(this),T(this)),attributes:i.attributes,id:i.id});r.geometryInstances=f,r._createBoundingVolumeFunction=function(e,r){I(t,e,r)},r._updateAndQueueCommandsFunction=function(e,r,i,n,o,a,s,l){O(t,r,i,n,o,a,s,l)},this._primitive=new y(r),this._primitive.readyPromise.then(function(e){t._ready=!0,t.releaseGeometryInstances&&(t.geometryInstances=void 0);var r=e._error;a(r)?t._readyPromise.reject(r):t._readyPromise.resolve(t)})}this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},S.prototype.getBoundingSphere=function(e){var t=this._boundingSpheresKeys.indexOf(e);if(-1!==t)return this._boundingSpheres[t]},S.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),l(this)},S}),define("DataSources/MaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,r,i,n){"use strict";function o(){i.throwInstantiationError()}return r(o.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError}}),o.prototype.getType=i.throwInstantiationError,o.prototype.getValue=i.throwInstantiationError,o.prototype.equals=i.throwInstantiationError,o.getValue=function(r,i,o){var a;return t(i)&&(a=i.getType(r),t(a))?(t(o)&&o.type===a||(o=n.fromType(a)),i.getValue(r,o.uniforms),o):(t(o)&&o.type===n.ColorType||(o=n.fromType(n.ColorType)),e.clone(e.WHITE,o.uniforms.color),o)},o}),define("DataSources/DynamicGeometryUpdater",["../Core/defined","../Core/destroyObject","../Core/BoundingSphere","../Core/Check","../Core/DeveloperError","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t,r){this._primitives=t,this._groundPrimitives=r,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}return p.prototype._isHidden=function(e,t,r){return!e.isShowing||!e.isAvailable(r)||!h.getValueOrDefault(t.show,r,!0)},p.prototype._setOptions=n.throwInstantiationError,p.prototype.update=function(t){var r=this._geometryUpdater,i=r._onTerrain,n=this._primitives,u=this._groundPrimitives;i?u.removeAndDestroy(this._primitive):(n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var p=this._entity,f=p[this._geometryUpdater._geometryPropertyName];if(this._setOptions(p,f,t),!this._isHidden(p,f,t)){var m=this._geometryUpdater.shadowsProperty.getValue(t),g=this._options;if(!e(f.fill)||f.fill.getValue(t))if(i)g.vertexFormat=s.VERTEX_FORMAT,this._primitive=u.add(new o({geometryInstances:this._geometryUpdater.createFillGeometryInstance(t),asynchronous:!1,shadows:m}));else{var _,v=r.fillMaterialProperty,y=v instanceof c,b=r._getIsClosed(g);if(y)_=new s({closed:b});else{var C=d.getValue(t,v,this._material);this._material=C,_=new a({material:C,translucent:C.isTranslucent(),closed:b})}g.vertexFormat=_.vertexFormat;var S=this._geometryUpdater.createFillGeometryInstance(t);y&&(_.translucent=255!==S.attributes.color.value[3]),this._primitive=n.add(new l({geometryInstances:S,appearance:_,asynchronous:!1,shadows:m}))}if(!i&&e(f.outline)&&f.outline.getValue(t)){var T=this._geometryUpdater.createOutlineGeometryInstance(t),w=h.getValueOrDefault(f.outlineWidth,t,1);this._outlinePrimitive=n.add(new l({geometryInstances:T,appearance:new s({flat:!0,translucent:255!==T.attributes.color.value[3],renderState:{lineWidth:r._scene.clampLineWidth(w)}}),asynchronous:!1,shadows:m}))}}},p.prototype.getBoundingSphere=function(t){var i,n=this._entity,o=this._primitive,a=this._outlinePrimitive;return e(o)&&o.show&&o.ready&&(i=o.getGeometryInstanceAttributes(n),e(i)&&e(i.boundingSphere))?(r.clone(i.boundingSphere,t),u.DONE):e(a)&&a.show&&a.ready&&(i=a.getGeometryInstanceAttributes(n),e(i)&&e(i.boundingSphere))?(r.clone(i.boundingSphere,t),u.DONE):e(o)&&!o.ready||e(a)&&!a.ready?u.PENDING:u.FAILED},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){var e=this._primitives,r=this._groundPrimitives;this._geometryUpdater._onTerrain?r.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),t(this)},p}),define("DataSources/GeometryUpdater",["../Core/Check","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Event","../Core/Iso8601","../Core/oneTimeWarning","../Scene/ClassificationType","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e){var t=e.entity,r=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new l,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=r,this._id=r+"-"+t.id,this._observedPropertyNames=e.observedPropertyNames,this._onEntityPropertyChanged(t,r,t[r],void 0)}var _=new p(t.WHITE),v=new f(!0),y=new f(!0),b=new f(!1),C=new f(t.BLACK),S=new f(h.DISABLED),T=new f(new s),w=new f(d.BOTH);return n(g.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&m.isConstant(this._showProperty)&&m.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&m.isConstant(this._showProperty)&&m.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}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),g.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},g.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},g.prototype.createFillGeometryInstance=a.throwInstantiationError,g.prototype.createOutlineGeometryInstance=a.throwInstantiationError,g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){o(this)},g.prototype._isHidden=function(e,t){var r=t.show;return i(r)&&r.isConstant&&!r.getValue(u.MINIMUM_VALUE)},g.prototype._isOnTerrain=function(e,t){return!1},g.prototype._getIsClosed=function(e){return!0},g.prototype._isDynamic=a.throwInstantiationError,g.prototype._setStaticOptions=a.throwInstantiationError,g.prototype._onEntityPropertyChanged=function(e,t,n,o){if(-1!==this._observedPropertyNames.indexOf(t)){var a=this._entity[this._geometryPropertyName];if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(u.MINIMUM_VALUE),d=a.outline,h=i(d);if(h&&d.isConstant&&(h=d.getValue(u.MINIMUM_VALUE)),!l&&!h)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var p=a.show;if(this._isHidden(e,a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));this._materialProperty=r(a.material,_),this._fillProperty=r(s,y),this._showProperty=r(p,v),this._showOutlineProperty=r(a.outline,b),this._outlineColorProperty=h?r(a.outlineColor,C):void 0,this._shadowsProperty=r(a.shadows,S),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,T),this._classificationTypeProperty=r(a.classificationType,w),this._fillEnabled=l;var f=this._isOnTerrain(e,a);if(h&&f&&(c(c.geometryOutlines),h=!1),this._onTerrain=f,this._outlineEnabled=h,this._isDynamic(e,a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,a),this._isClosed=this._getIsClosed(this._options);var m=a.outlineWidth;this._outlineWidth=i(m)?m.getValue(u.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}}},g.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)},g}),define("DataSources/BoxGeometryUpdater",["../Core/BoxGeometry","../Core/BoxOutlineGeometry","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_){"use strict";function v(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0}function y(e,t){g.call(this,{entity:e,scene:t,geometryOptions:new v(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]})}function b(e,t,r){m.call(this,e,t,r)}var C=new r,S=new n;return a(Object.create)&&(y.prototype=Object.create(g.prototype),y.prototype.constructor=y),y.prototype.createFillGeometryInstance=function(t){var r,i,s=this._entity,c=s.isAvailable(t),h=new d(c&&s.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t)),p=this._distanceDisplayConditionProperty.getValue(t),m=l.fromDistanceDisplayCondition(p);if(this._materialProperty instanceof f){var g;a(this._materialProperty.color)&&(this._materialProperty.color.isConstant||c)&&(g=this._materialProperty.color.getValue(t,S)),a(g)||(g=n.WHITE),i=o.fromColor(g),r={show:h,distanceDisplayCondition:m,color:i}}else r={show:h,distanceDisplayCondition:m};return new u({id:s,geometry:e.fromDimensions(this._options),modelMatrix:s.computeModelMatrix(t),attributes:r})},y.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,i=r.isAvailable(e),a=_.getValueOrDefault(this._outlineColorProperty,e,n.BLACK,S),s=this._distanceDisplayConditionProperty.getValue(e);return new u({id:r,geometry:t.fromDimensions(this._options),modelMatrix:r.computeModelMatrix(e),attributes:{show:new d(i&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:o.fromColor(a),distanceDisplayCondition:l.fromDistanceDisplayCondition(s)}})},y.prototype._isHidden=function(e,t){return!a(t.dimensions)||!a(e.position)||g.prototype._isHidden.call(this,e,t)},y.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&_.isConstant(e.orientation)&&t.dimensions.isConstant&&_.isConstant(t.outlineWidth))},y.prototype._setStaticOptions=function(e,t){var r=this._materialProperty instanceof f,i=this._options;i.vertexFormat=r?p.VERTEX_FORMAT:h.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(c.MINIMUM_VALUE,i.dimensions)},y.DynamicGeometryUpdater=b,a(Object.create)&&(b.prototype=Object.create(m.prototype),b.prototype.constructor=b),b.prototype._isHidden=function(e,t,r){var i=_.getValueOrUndefined(e.position,r,C),n=this._options.dimensions;return!a(i)||!a(n)||m.prototype._isHidden.call(this,e,t,r)},b.prototype._setOptions=function(e,t,r){this._options.dimensions=_.getValueOrUndefined(t.dimensions,r,this._options.dimensions)},y}),define("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.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=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 i(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,c,t.color),s.getValueOrDefault(this._transparent,e,!1)&&(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}),define("DataSources/createMaterialPropertyDescriptor",["../Core/Color","../Core/DeveloperError","../Core/Resource","./ColorMaterialProperty","./createPropertyDescriptor","./ImageMaterialProperty"],function(e,t,r,i,n,o){"use strict";function a(t){if(t instanceof e)return new i(t);if("string"==typeof t||t instanceof r||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){var n=new o;return n.image=t,n}}function s(e,t){return n(e,t,a)}return s}),define("DataSources/BoxGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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 r(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}),define("DataSources/CallbackProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,r,i){"use strict";function n(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new i,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 r=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,r&&this._definitionChanged.raiseEvent(this)},n.prototype.equals=function(e){return this===e||e instanceof n&&this._callback===e._callback&&this._isConstant===e._isConstant},n}),define("DataSources/CheckerboardMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.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,d=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 i(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,d),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}),define("DataSources/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,r,i,n,o,a){"use strict";function s(){i.throwInstantiationError()}r(s.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError},referenceFrame:{get:i.throwInstantiationError}}),s.prototype.getValue=i.throwInstantiationError,s.prototype.getValueInReferenceFrame=i.throwInstantiationError,s.prototype.equals=i.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(r,i,s,u,c){if(!t(i))return i;if(t(c)||(c=new e),s===u)return e.clone(i,c);var d=a.computeIcrfToFixedMatrix(r,l);return t(d)||(d=a.computeTemeToPseudoFixedMatrix(r,l)),s===o.INERTIAL?n.multiplyByVector(d,i,c):s===o.FIXED?n.multiplyByVector(n.transpose(d,l),i,c):void 0},s}),define("DataSources/ConstantPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty"],function(e,t,r,i,n,o,a,s){"use strict";function l(r,i){this._definitionChanged=new o,this._value=e.clone(r),this._referenceFrame=t(i,a.FIXED)}return i(l.prototype,{isConstant:{get:function(){return!r(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,i){var n=!1;e.equals(this._value,t)||(n=!0,this._value=e.clone(t)),r(i)&&this._referenceFrame!==i&&(n=!0,this._referenceFrame=i),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(e,t,r){return s.convertToReferenceFrame(e,this._value,this._referenceFrame,t,r)},l.prototype.equals=function(t){return this===t||t instanceof l&&e.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame},l}),define("DataSources/CorridorGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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._classificationType=void 0,this._classificationTypeSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(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"),classificationType:a("classificationType")}),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.classificationType=this.classificationType,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),this.classificationType=e(this.classificationType,t.classificationType)},s}),define("DataSources/createRawPropertyDescriptor",["./createPropertyDescriptor"],function(e){"use strict";function t(e){return e}function r(r,i){return e(r,i,t)}return r}),define("DataSources/CylinderGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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 r(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}),define("DataSources/EllipseGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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._classificationType=void 0,this._classificationTypeSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(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"),classificationType:a("classificationType")}),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.classificationType=this.classificationType,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),this.classificationType=e(this.classificationType,t.classificationType)},s}),define("DataSources/EllipsoidGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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 r(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}),define("DataSources/LabelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,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._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(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"),scaleByDistance:o("scaleByDistance"),distanceDisplayCondition:o("distanceDisplayCondition"),disableDepthTestDistance:o("disableDepthTestDistance")}),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.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,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.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=e(this.disableDepthTestDistance,t.disableDepthTestDistance)},a}),define("DataSources/NodeTransformationProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TranslationRotationScale","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=new n,l=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new i,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 r(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,r){return t(r)||(r=new n),r.translation=a.getValueOrClonedDefault(this._translation,e,s.translation,r.translation),r.rotation=a.getValueOrClonedDefault(this._rotation,e,s.rotation,r.rotation),r.scale=a.getValueOrClonedDefault(this._scale,e,s.scale,r.scale),r},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}),define("DataSources/PropertyBag",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){return new o(e)}function u(e,t){var r=e._propertyNames,i=t._propertyNames,n=r.length;if(n!==i.length)return!1;for(var o=0;o<n;++o){var a=r[o];if(-1===i.indexOf(a))return!1;if(!s.equals(e[a],t[a]))return!1}return!0}var c=function(e,r){this._propertyNames=[],this._definitionChanged=new n,t(e)&&this.merge(e,r)};return r(c.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){for(var e=this._propertyNames,t=0,r=e.length;t<r;t++)if(!s.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.hasProperty=function(e){return-1!==this._propertyNames.indexOf(e)},c.prototype.addProperty=function(r,i,n){this._propertyNames.push(r),Object.defineProperty(this,r,a(r,!0,e(n,l))),t(i)&&(this[r]=i),this._definitionChanged.raiseEvent(this)},c.prototype.removeProperty=function(e){var t=this._propertyNames,r=t.indexOf(e);this._propertyNames.splice(r,1),delete this[e],this._definitionChanged.raiseEvent(this)},c.prototype.getValue=function(e,r){t(r)||(r={});for(var i=this._propertyNames,n=0,o=i.length;n<o;n++){var a=i[n];r[a]=s.getValueOrUndefined(this[a],e,r[a])}return r},c.prototype.merge=function(e,r){for(var i=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];void 0===l&&-1===i.indexOf(s)&&this.addProperty(s,void 0,r),void 0!==u&&(void 0!==l?t(l)&&t(l.merge)&&l.merge(u):t(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}),define("DataSources/ModelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor","./NodeTransformationProperty","./PropertyBag"],function(e,t,r,i,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._clampAnimations=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._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(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"),clampAnimations:o("clampAnimations"),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"),clippingPlanes:o("clippingPlanes")}),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.clampAnimations=this.clampAnimations,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.clippingPlanes=this.clippingPlanes,e):new c(this)},c.prototype.merge=function(r){this.show=e(this.show,r.show),this.scale=e(this.scale,r.scale),this.minimumPixelSize=e(this.minimumPixelSize,r.minimumPixelSize),this.maximumScale=e(this.maximumScale,r.maximumScale),this.incrementallyLoadTextures=e(this.incrementallyLoadTextures,r.incrementallyLoadTextures),this.shadows=e(this.shadows,r.shadows),this.uri=e(this.uri,r.uri),this.runAnimations=e(this.runAnimations,r.runAnimations),this.clampAnimations=e(this.clampAnimations,r.clampAnimations),this.heightReference=e(this.heightReference,r.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,r.distanceDisplayCondition),this.silhouetteColor=e(this.silhouetteColor,r.silhouetteColor),this.silhouetteSize=e(this.silhouetteSize,r.silhouetteSize),this.color=e(this.color,r.color),this.colorBlendMode=e(this.colorBlendMode,r.colorBlendMode),this.colorBlendAmount=e(this.colorBlendAmount,r.colorBlendAmount),this.clippingPlanes=e(this.clippingPlanes,r.clippingPlanes);var i=r.nodeTransformations;if(t(i)){var n=this.nodeTransformations;t(n)?n.merge(i):this.nodeTransformations=new s(i,l)}},c}),define("DataSources/PathGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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 r(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}),define("DataSources/PlaneGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._plane=void 0,this._planeSubscription=void 0,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 r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),plane:a("plane"),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.plane=this.plane,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.plane=e(this.plane,t.plane),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}),define("DataSources/PointGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,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._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(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"),disableDepthTestDistance:o("disableDepthTestDistance")}),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.disableDepthTestDistance=this.disableDepthTestDistance,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),this.disableDepthTestDistance=e(this.disableDepthTestDistance,t.disableDepthTestDistance)},a}),define("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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._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._classificationType=void 0,this._classificationTypeSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(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"),classificationType:a("classificationType")}),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.classificationType=this.classificationType,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),this.classificationType=e(this.classificationType,t.classificationType)},s}),define("DataSources/PolylineGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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._depthFailMaterial=void 0,this._depthFailMaterialSubscription=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 r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),depthFailMaterial:o("depthFailMaterial"),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.depthFailMaterial=this.depthFailMaterial,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.depthFailMaterial=e(this.depthFailMaterial,t.depthFailMaterial),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}),define("DataSources/PolylineVolumeGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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 r(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}),define("DataSources/RectangleGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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._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._classificationType=void 0,this._classificationTypeSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(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"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition"),classificationType:a("classificationType")}),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.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,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.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=e(this.classificationType,t.classificationType)},s}),define("DataSources/WallGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,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 r(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}),define("DataSources/Entity",["../Core/Cartesian3","../Core/Check","../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","./PlaneGraphics","./PointGraphics","./PolygonGraphics","./PolylineGraphics","./PolylineVolumeGraphics","./Property","./PropertyBag","./RectangleGraphics","./WallGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M){"use strict";function R(e){return new f(e)}function L(e,t){return g(e,void 0,function(e){return e instanceof t?e:new t(e)})}function N(e){e=i(e,i.EMPTY_OBJECT);var t=e.id;n(t)||(t=r()),this._availability=void 0,this._id=t,this._definitionChanged=new s,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","plane","point","polygon","polyline","polylineVolume","position","properties","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._plane=void 0,this._planeSubscription=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._properties=void 0,this._propertiesSubscription=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 k(e,t,r){for(var i=t.length,n=0;n<i;n++){var o=t[n],a=o._show;(!r&&a)!==(r&&a)&&k(o,o._children,r)}e._definitionChanged.raiseEvent(e,"isShowing",r,!r)}o(N.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 r=this.isShowing;t!==r&&k(this,this._children,r),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!n(this.entityCollection)||this.entityCollection.show)&&(!n(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){var t=this._parent;if(t!==e){var r=this.isShowing;if(n(t)){var i=t._children.indexOf(this);t._children.splice(i,1)}this._parent=e,n(e)&&e._children.push(this);var o=this.isShowing;r!==o&&k(this,this._children,o),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},propertyNames:{get:function(){return this._propertyNames}},billboard:L("billboard",h),box:L("box",p),corridor:L("corridor",m),cylinder:L("cylinder",v),description:g("description"),ellipse:L("ellipse",y),ellipsoid:L("ellipsoid",b),label:L("label",C),model:L("model",S),orientation:g("orientation"),path:L("path",T),plane:L("plane",w),point:L("point",A),polygon:L("polygon",E),polyline:L("polyline",x),polylineVolume:L("polylineVolume",P),properties:L("properties",D),position:function(e){return g(e,void 0,R)}("position"),rectangle:L("rectangle",O),viewFrom:g("viewFrom"),wall:L("wall",M)}),N.prototype.isAvailable=function(e){var t=this._availability;return!n(t)||t.contains(e)},N.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,_(e,!0))},N.prototype.removeProperty=function(e){var t=this._propertyNames,r=t.indexOf(e);this._propertyNames.splice(r,1),delete this[e]},N.prototype.merge=function(e){this.name=i(this.name,e.name),this.availability=i(e.availability,this.availability);for(var t=this._propertyNames,r=n(e._propertyNames)?e._propertyNames:Object.keys(e),o=r.length,a=0;a<o;a++){var s=r[a];if("parent"!==s){var l=this[s],u=e[s];n(l)||-1!==t.indexOf(s)||this.addProperty(s),n(u)&&(n(l)?n(l.merge)&&l.merge(u):n(u.merge)&&n(u.clone)?this[s]=u.clone():this[s]=u)}}};var F=new l,B=new e,U=new c;return N.prototype.computeModelMatrix=function(e,r){t.typeOf.object("time",e);var i=I.getValueOrUndefined(this._position,e,B);if(n(i)){var o=I.getValueOrUndefined(this._orientation,e,U);return r=n(o)?u.fromRotationTranslation(l.fromQuaternion(o,F),i,r):d.eastNorthUpToFixedFrame(i,void 0,r)}},N}),define("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,r,i,n,o,a,s,l,u,c){"use strict";function d(e){if(e._firing)return void(e._refire=!0);if(0===e._suspendCount){var t=e._addedEntities,r=e._removedEntities,i=e._changedEntities;if(0!==i.length||0!==t.length||0!==r.length){e._firing=!0;do{e._refire=!1;var n=t.values.slice(0),o=r.values.slice(0),a=i.values.slice(0);t.removeAll(),r.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,n,o,a)}while(e._refire);e._firing=!1}}}function h(r){this._owner=r,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 h.prototype.suspendEvents=function(){this._suspendCount++},h.prototype.resumeEvents=function(){this._suspendCount--,d(this)},h.collectionChangedEventCallback=void 0,i(h.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,r=[],i=this._entities.values,n=i.length;for(t=0;t<n;t++)r.push(i[t].isShowing);for(this._show=e,t=0;t<n;t++){var o=r[t],a=i[t];o!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,o)}this.resumeEvents()}}},owner:{get:function(){return this._owner}}}),h.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,i=this._entities.values,n=0,o=i.length;n<o;n++){var l=i[n],c=l.availability;if(r(c)){var d=c.start,h=c.stop;s.lessThan(d,e)&&!d.equals(a.MINIMUM_VALUE)&&(e=d),s.greaterThan(h,t)&&!h.equals(a.MAXIMUM_VALUE)&&(t=h)}}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})},h.prototype.add=function(e){e instanceof c||(e=new c(e));var t=e.id,r=this._entities;if(r.contains(t))throw new l("An entity with id "+t+" already exists in this collection.");return e.entityCollection=this,r.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(h.prototype._onEntityDefinitionChanged,this),d(this),e},h.prototype.remove=function(e){return!!r(e)&&this.removeById(e.id)},h.prototype.contains=function(e){return this._entities.get(e.id)===e},h.prototype.removeById=function(e){if(!r(e))return!1;var t=this._entities,i=t.get(e);return!!this._entities.remove(e)&&(this._addedEntities.remove(e)||(this._removedEntities.set(e,i),this._changedEntities.remove(e)),this._entities.remove(e),i.definitionChanged.removeEventListener(h.prototype._onEntityDefinitionChanged,this),d(this),!0)},h.prototype.removeAll=function(){for(var e=this._entities,t=e.length,i=e.values,n=this._addedEntities,o=this._removedEntities,a=0;a<t;a++){var s=i[a],l=s.id,u=n.get(l);r(u)||(s.definitionChanged.removeEventListener(h.prototype._onEntityDefinitionChanged,this),o.set(l,s))}e.removeAll(),n.removeAll(),this._changedEntities.removeAll(),d(this)},h.prototype.getById=function(e){return this._entities.get(e)},h.prototype.getOrCreateEntity=function(e){var t=this._entities.get(e);return r(t)||(p.id=e,t=new c(p),this.add(t)),t},h.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),d(this)},h}),define("DataSources/CompositeEntityCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./Entity","./EntityCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,r=t.length,i=0;i<r;i++)e[t[i]]=void 0}function l(e,t,r,i){m[0]=r,m[1]=i.id,t[JSON.stringify(m)]=i.definitionChanged.addEventListener(d.prototype._onDefinitionChanged,e)}function u(e,t,r,i){m[0]=r,m[1]=i.id;var n=JSON.stringify(m);t[n](),t[n]=void 0}function c(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var r,i,n,c,h,p,m=e._collections,g=m.length,_=e._collectionsCopy,v=_.length,y=e._composite,b=new a(e),C=e._eventHash;for(r=0;r<v;r++)for(h=_[r],h.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,e),n=h.values,p=h.id,c=n.length-1;c>-1;c--)i=n[c],u(e,C,p,i);for(r=g-1;r>=0;r--)for(h=m[r],h.collectionChanged.addEventListener(d.prototype._onCollectionChanged,e),n=h.values,p=h.id,c=n.length-1;c>-1;c--){i=n[c],l(e,C,p,i);var S=b.getById(i.id);t(S)||(S=y.getById(i.id),t(S)?s(S):(f.id=i.id,S=new o(f)),b.add(S)),S.merge(i)}e._collectionsCopy=m.slice(0),y.suspendEvents(),y.removeAll();var T=b.values;for(r=0;r<T.length;r++)y.add(T[r]);y.resumeEvents()}}function d(r,i){this._owner=i,this._composite=new a(this),this._suspendCount=0,this._collections=t(r)?r.slice():[],this._collectionsCopy=[],this._id=e(),this._eventHash={},c(this),this._shouldRecomposite=!1}function h(e,t){return e.indexOf(t)}function p(e,t,r){var i=e._collections;if(t=n.clamp(t,0,i.length-1),r=n.clamp(r,0,i.length-1),t!==r){var o=i[t];i[t]=i[r],i[r]=o,c(e)}}var f={id:void 0},m=new Array(2);return r(d.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}}}),d.prototype.addCollection=function(e,r){t(r)?this._collections.splice(r,0,e):(r=this._collections.length,this._collections.push(e)),c(this)},d.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return-1!==t&&(this._collections.splice(t,1),c(this),!0)},d.prototype.removeAllCollections=function(){this._collections.length=0,c(this)},d.prototype.containsCollection=function(e){return-1!==this._collections.indexOf(e)},d.prototype.contains=function(e){return this._composite.contains(e)},d.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},d.prototype.getCollection=function(e){return this._collections[e]},d.prototype.getCollectionsLength=function(){return this._collections.length},d.prototype.raiseCollection=function(e){var t=h(this._collections,e);p(this,t,t+1)},d.prototype.lowerCollection=function(e){var t=h(this._collections,e);p(this,t,t-1)},d.prototype.raiseCollectionToTop=function(e){var t=h(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),c(this))},d.prototype.lowerCollectionToBottom=function(e){var t=h(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),c(this))},d.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},d.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(c(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},d.prototype.computeAvailability=function(){return this._composite.computeAvailability()},d.prototype.getById=function(e){return this._composite.getById(e)},d.prototype._onCollectionChanged=function(e,r,i){var n=this._collectionsCopy,a=n.length,c=this._composite;c.suspendEvents();var d,h,p,m,g=i.length,_=this._eventHash,v=e.id;for(d=0;d<g;d++){var y=i[d];u(this,_,v,y);var b=y.id;for(h=a-1;h>=0;h--)p=n[h].getById(b),t(p)&&(t(m)||(m=c.getById(b),s(m)),m.merge(p));t(m)||c.removeById(b),m=void 0}var C=r.length;for(d=0;d<C;d++){var S=r[d];l(this,_,v,S);var T=S.id;for(h=a-1;h>=0;h--)p=n[h].getById(T),t(p)&&(t(m)||(m=c.getById(T),t(m)?s(m):(f.id=T,m=new o(f),c.add(m))),m.merge(p));m=void 0}c.resumeEvents()},d.prototype._onDefinitionChanged=function(e,r,i,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[r],d=!t(c),h=!0,p=s-1;p>=0;p--){var f=o[p].getById(e.id);if(t(f)){var m=f[r];if(t(m)){if(h){if(h=!1,!t(m.merge)||!t(m.clone)){c=m;break}c=m.clone(c)}c.merge(m)}}}d&&-1===u.propertyNames.indexOf(r)&&u.addProperty(r),u[r]=c},d}),define("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(t,r,i,n){function o(){i.raiseEvent(t)}var a=[];r.removeAll();for(var s=n.length,l=0;l<s;l++){var u=n.get(l);e(u.data)&&-1===a.indexOf(u.data)&&r.add(u.data.definitionChanged,o)}}function l(){this._eventHelper=new n,this._definitionChanged=new i,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,r){var i=this._intervals.findDataForIntervalContainingDate(t);if(e(i))return i.getValue(t,r)},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}),define("DataSources/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,r,i,n,o){"use strict";function a(){this._definitionChanged=new i,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 r=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(r))return r.getType(t)},a.prototype.getValue=function(t,r){var i=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(i))return i.getValue(t,r)},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}),define("DataSources/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,r,i,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 r(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,r,i){var n=this._composite._intervals.findDataForIntervalContainingDate(e);if(t(n))return n.getValueInReferenceFrame(e,r,i)},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}),define("DataSources/CorridorGeometryUpdater",["../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CorridorGeometry","../Core/CorridorOutlineGeometry","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_){"use strict";function v(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 y(e,t){g.call(this,{entity:e,scene:t,geometryOptions:new v(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]})}function b(e,t,r){m.call(this,e,t,r)}var C=new t;return o(Object.create)&&(y.prototype=Object.create(g.prototype),y.prototype.constructor=y),y.prototype.createFillGeometryInstance=function(e){var n,a,u=this._entity,d=u.isAvailable(e),h=new c(d&&u.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),p=s.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e));if(this._materialProperty instanceof f){var m;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||d)&&(m=this._materialProperty.color.getValue(e,C)),o(m)||(m=t.WHITE),a=r.fromColor(m),n={show:h,distanceDisplayCondition:p,color:a}}else n={show:h,distanceDisplayCondition:p};return new l({id:u,geometry:new i(this._options),attributes:n})},y.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,o=i.isAvailable(e),a=_.getValueOrDefault(this._outlineColorProperty,e,t.BLACK,C);return new l({id:i,geometry:new n(this._options),attributes:{show:new c(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(a),distanceDisplayCondition:s.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e))}})},y.prototype._isHidden=function(e,t){return!o(t.positions)||g.prototype._isHidden.call(this,e,t)},y.prototype._isOnTerrain=function(e,t){var r=this._materialProperty instanceof f;return this._fillEnabled&&!o(t.height)&&!o(t.extrudedHeight)&&r&&d.isSupported(this._scene)},y.prototype._getIsClosed=function(e){var t=e.height,r=e.extrudedHeight;return 0===t||o(r)&&r!==t},y.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!_.isConstant(t.height)||!_.isConstant(t.extrudedHeight)||!_.isConstant(t.granularity)||!_.isConstant(t.width)||!_.isConstant(t.outlineWidth)||!_.isConstant(t.cornerType)||this._onTerrain&&!_.isConstant(this._materialProperty)},y.prototype._setStaticOptions=function(e,t){var r=t.height,i=t.extrudedHeight,n=t.granularity,a=t.width,s=t.cornerType,l=this._materialProperty instanceof f,c=this._options;c.vertexFormat=l?p.VERTEX_FORMAT:h.MaterialSupport.TEXTURED.vertexFormat,c.positions=t.positions.getValue(u.MINIMUM_VALUE,c.positions),c.height=o(r)?r.getValue(u.MINIMUM_VALUE):void 0,c.extrudedHeight=o(i)?i.getValue(u.MINIMUM_VALUE):void 0,c.granularity=o(n)?n.getValue(u.MINIMUM_VALUE):void 0,c.width=o(a)?a.getValue(u.MINIMUM_VALUE):void 0,c.cornerType=o(s)?s.getValue(u.MINIMUM_VALUE):void 0},y.DynamicGeometryUpdater=b,o(Object.create)&&(b.prototype=Object.create(m.prototype),b.prototype.constructor=b),b.prototype._isHidden=function(e,t,r){var i=this._options;return!o(i.positions)||!o(i.width)||m.prototype._isHidden.call(this,e,t,r)},b.prototype._setOptions=function(e,t,r){var i=this._options;i.positions=_.getValueOrUndefined(t.positions,r),i.width=_.getValueOrUndefined(t.width,r),i.height=_.getValueOrUndefined(t.height,r),i.extrudedHeight=_.getValueOrUndefined(t.extrudedHeight,r),i.granularity=_.getValueOrUndefined(t.granularity,r),i.cornerType=_.getValueOrUndefined(t.cornerType,r)},y}),define("DataSources/DataSource",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return e(r.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}}),r.prototype.update=t.throwInstantiationError,r.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))},r}),define("Scene/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/Transforms","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t,n,o){var a=n.viewMatrix,s=l.multiplyByVector(a,i.fromElements(e.x,e.y,e.z,1,b),b),u=r.multiplyComponents(t,r.normalize(s,C),C);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 f={},m=new i(0,0,0,1),g=new i,_=new e,v=new t,y=new t;f.wgs84ToWindowCoordinates=function(e,t,i){return f.wgs84WithEyeOffsetToWindowCoordinates(e,t,r.ZERO,i)};var b=new i,C=new r,S=new n(Math.PI,s.PI_OVER_TWO),T=new r,w=new r;f.wgs84WithEyeOffsetToWindowCoordinates=function(e,i,n,a){var b=e.frameState,C=f.computeActualWgs84Position(b,i,m);if(o(C)){var A=e.canvas,E=_;E.x=0,E.y=0,E.width=A.clientWidth,E.height=A.clientHeight;var x=e.camera,P=!1;if(b.mode===h.SCENE2D){var I=e.mapProjection,D=S,O=I.project(D,T),M=r.clone(x.position,w),R=x.frustum.clone(),L=l.computeViewportTransformation(E,0,1,new l),N=x.frustum.projectionMatrix,k=x.positionWC.y,F=r.fromElements(s.sign(k)*O.x-k,0,-x.positionWC.x),B=d.pointToGLWindowCoordinates(N,L,F);if(0===k||B.x<=0||B.x>=A.clientWidth)P=!0;else{if(B.x>.5*A.clientWidth){E.width=B.x,x.frustum.right=O.x-k,g=p(C,n,x,g),f.clipToGLWindowCoordinates(E,g,v),E.x+=B.x,x.position.x=-x.position.x;var U=x.frustum.right;x.frustum.right=-x.frustum.left,x.frustum.left=-U,g=p(C,n,x,g),f.clipToGLWindowCoordinates(E,g,y)}else{E.x+=B.x,E.width-=B.x,x.frustum.left=-O.x-k,g=p(C,n,x,g),f.clipToGLWindowCoordinates(E,g,v),E.x=E.x-E.width,x.position.x=-x.position.x;var V=x.frustum.left;x.frustum.left=-x.frustum.right,x.frustum.right=-V,g=p(C,n,x,g),f.clipToGLWindowCoordinates(E,g,y)}r.clone(M,x.position),x.frustum=R.clone(),a=t.clone(v,a),(a.x<0||a.x>A.clientWidth)&&(a.x=y.x)}}if(b.mode!==h.SCENE2D||P){if(g=p(C,n,x,g),g.z<0&&!(x.frustum instanceof u)&&!(x.frustum instanceof c))return;a=f.clipToGLWindowCoordinates(E,g,a)}return a.y=A.clientHeight-a.y,a}},f.wgs84ToDrawingBufferCoordinates=function(e,t,r){if(r=f.wgs84ToWindowCoordinates(e,t,r),o(r))return f.transformWindowToDrawingBuffer(e,r,r)};var A=new r,E=new n;f.computeActualWgs84Position=function(e,t,i){var n=e.mode;if(n===h.SCENE3D)return r.clone(t,i);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,E);if(o(l)){if(a.project(l,A),n===h.COLUMBUS_VIEW)return r.fromElements(A.z,A.x,A.y,i);if(n===h.SCENE2D)return r.fromElements(0,A.x,A.y,i);var u=e.morphTime;return r.fromElements(s.lerp(A.z,t.x,u),s.lerp(A.x,t.y,u),s.lerp(A.y,t.z,u),i)}};var x=new r,P=new r,I=new l;f.clipToGLWindowCoordinates=function(e,i,n){return r.divideByScalar(i,i.w,x),l.computeViewportTransformation(e,0,1,I),l.multiplyByPoint(I,x,P),t.fromCartesian3(P,n)},f.transformWindowToDrawingBuffer=function(e,r,i){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(r.x*o,r.y*a,i)};var D=new i,O=new i;return f.drawingBufferToWgs84Coordinates=function(e,t,n,a){var s=e.context,u=s.uniformState,c=e._passState.viewport,d=i.clone(i.UNIT_W,D);d.x=(t.x-c.x)/c.width*2-1,d.y=(t.y-c.y)/c.height*2-1,d.z=2*n-1,d.w=1;var h,p=e.camera.frustum;if(o(p.fovy)){h=l.multiplyByVector(u.inverseViewProjection,d,O);var f=1/h.w;r.multiplyByScalar(h,f,h)}else{o(p._offCenterFrustum)&&(p=p._offCenterFrustum);var m=u.currentFrustum;h=O,h.x=.5*(d.x*(p.right-p.left)+p.left+p.right),h.y=.5*(d.y*(p.top-p.bottom)+p.bottom+p.top),h.z=.5*(d.z*(m.x-m.y)-m.x-m.y),h.w=1,h=l.multiplyByVector(u.inverseView,h,h)}return r.fromCartesian4(h,a)},f}),define("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","../Core/Resource","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y){"use strict";function b(e,i){e=s(e,s.EMPTY_OBJECT);var n=e.translucencyByDistance,u=e.pixelOffsetScaleByDistance,c=e.scaleByDistance,h=e.distanceDisplayCondition;l(n)&&(n=p.clone(n)),l(u)&&(u=p.clone(u)),l(c)&&(c=p.clone(c)),l(h)&&(h=d.clone(h)),this._show=s(e.show,!0),this._position=r.clone(s(e.position,r.ZERO)),this._actualPosition=r.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=r.clone(s(e.eyeOffset,r.ZERO)),this._heightReference=s(e.heightReference,m.NONE),this._verticalOrigin=s(e.verticalOrigin,y.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,g.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=r.clone(s(e.alignedAxis,r.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=c,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=u,this._sizeInMeters=s(e.sizeInMeters,!1),this._distanceDisplayCondition=h,this._disableDepthTestDistance=s(e.disableDepthTestDistance,0),this._id=e.id,this._collection=s(e.collection,i),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=i,this._dirty=!1,this._index=-1,this._batchIndex=void 0,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 f=e.image,v=e.imageId;l(f)&&(l(v)||(v="string"==typeof f?f:l(f.src)?f.src:a()),this._imageId=v,this._image=f),l(e.imageSubRegion)&&(this._imageId=v,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 r=e._billboardCollection;l(r)&&(r._updateBillboard(e,t),e._dirty=!0)}var S=b.SHOW_INDEX=0,T=b.POSITION_INDEX=1,w=b.PIXEL_OFFSET_INDEX=2,A=b.EYE_OFFSET_INDEX=3,E=b.HORIZONTAL_ORIGIN_INDEX=4,x=b.VERTICAL_ORIGIN_INDEX=5,P=b.SCALE_INDEX=6,I=b.IMAGE_INDEX_INDEX=7,D=b.COLOR_INDEX=8,O=b.ROTATION_INDEX=9,M=b.ALIGNED_AXIS_INDEX=10,R=b.SCALE_BY_DISTANCE_INDEX=11,L=b.TRANSLUCENCY_BY_DISTANCE_INDEX=12,N=b.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,k=b.DISTANCE_DISPLAY_CONDITION=14,F=b.DISABLE_DEPTH_DISTANCE=15;b.NUMBER_OF_PROPERTIES=16,u(b.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,C(this,S))}},position:{get:function(){return this._position},set:function(e){var t=this._position;r.equals(t,e)||(r.clone(e,t),r.clone(e,this._actualPosition),this._updateClamping(),C(this,T))}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightReference=e,this._updateClamping(),C(this,T))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var r=this._pixelOffset;t.equals(r,e)||(t.clone(e,r),C(this,w))}},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,L))}},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;r.equals(t,e)||(r.clone(e,t),C(this,A))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,C(this,E))}},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,P))}},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,O))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;r.equals(t,e)||(r.clone(e,t),C(this,M))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,C(this,I))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,C(this,I))}},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){d.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=d.clone(e,this._distanceDisplayCondition),C(this,k))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,C(this,F))}},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):e instanceof f?this.setImage(e.url,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,I))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=r.clone(e,this._actualClampedPosition),C(this,T)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,C(this,S))}}}),b.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},b.prototype._updateClamping=function(){b._updateClamping(this._billboardCollection,this)};var B=new n,U=new r;b._updateClamping=function(e,t){function i(e){if(t._heightReference===m.RELATIVE_TO_GROUND)if(t._mode===_.SCENE3D){var i=s.cartesianToCartographic(e,B);i.height+=h.height,s.cartographicToCartesian(i,e)}else e.x+=h.height;t._clampedPosition=r.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)&&l(o.globe)){var a=o.globe,s=a.ellipsoid,u=a._surface,c=o.frameState.mode,d=c!==t._mode;if(t._mode=c,(t._heightReference===m.NONE||d)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==m.NONE&&l(t._position)){var h=s.cartesianToCartographic(t._position);if(!l(h))return void(t._actualClampedPosition=void 0);l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(h,i),n.clone(h,B);var p=a.getHeight(h);l(p)&&(B.height=p),s.cartographicToCartesian(B,U),i(U)}}},b.prototype._loadImage=function(){var t,r=this._billboardCollection._textureAtlas,i=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=r.addImage(i,n)),l(o)&&(t=r.addSubRegion(i,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===i&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=r.textureCoordinates[t];a._imageWidth=r.texture.width*s.width,a._imageHeight=r.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,C(a,I)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},b.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())},b.prototype.setImageSubRegion=function(t,r){this._imageId===t&&e.equals(this._imageSubRegion,r)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(r),l(this._billboardCollection._textureAtlas)&&this._loadImage())},b.prototype._setTranslate=function(e){var r=this._translate;t.equals(r,e)||(t.clone(e,r),C(this,w))},b.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},b.prototype._setActualPosition=function(e){l(this._clampedPosition)||r.clone(e,this._actualPosition),C(this,T)};var V=new i;b._computeActualPosition=function(e,t,r,i){return l(e._clampedPosition)?(r.mode!==e._mode&&e._updateClamping(),e._clampedPosition):r.mode===_.SCENE3D?t:(h.multiplyByPoint(i,t,V),v.computeActualWgs84Position(r,V))};var z=new r;b._computeScreenSpacePosition=function(e,r,i,n,o,a){var s=h.multiplyByPoint(e,r,z),u=v.wgs84WithEyeOffsetToWindowCoordinates(o,s,i,a);if(l(u))return t.add(u,n,u),u};var G=new t(0,0);return b.prototype.computeScreenSpacePosition=function(e,r){var i=this._billboardCollection;l(r)||(r=new t),t.clone(this._pixelOffset,G),t.add(G,this._translate,G);var n=i.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==_.SCENE3D)){var a=e.mapProjection,s=a.ellipsoid,u=a.unproject(o,B);o=s.cartographicToCartesian(u,z),n=h.IDENTITY}return b._computeScreenSpacePosition(n,o,this._eyeOffset,G,e,r)},b.getScreenSpaceBoundingBox=function(t,r,i){var n=t.width,o=t.height,a=t.scale;n*=a,o*=a;var s=r.x;t.horizontalOrigin===g.RIGHT?s-=n:t.horizontalOrigin===g.CENTER&&(s-=.5*n);var u=r.y;return t.verticalOrigin===y.BOTTOM||t.verticalOrigin===y.BASELINE?u-=o:t.verticalOrigin===y.CENTER&&(u-=.5*o),l(i)||(i=new e),i.x=s,i.y=u,i.width=n,i.height=o,i},b.prototype.equals=function(i){return this===i||l(i)&&this._id===i._id&&r.equals(this._position,i._position)&&this._imageId===i._imageId&&this._show===i._show&&this._scale===i._scale&&this._verticalOrigin===i._verticalOrigin&&this._horizontalOrigin===i._horizontalOrigin&&this._heightReference===i._heightReference&&e.equals(this._imageSubRegion,i._imageSubRegion)&&o.equals(this._color,i._color)&&t.equals(this._pixelOffset,i._pixelOffset)&&t.equals(this._translate,i._translate)&&r.equals(this._eyeOffset,i._eyeOffset)&&p.equals(this._scaleByDistance,i._scaleByDistance)&&p.equals(this._translucencyByDistance,i._translucencyByDistance)&&p.equals(this._pixelOffsetScaleByDistance,i._pixelOffsetScaleByDistance)&&d.equals(this._distanceDisplayCondition,i._distanceDisplayCondition)&&this._disableDepthTestDistance===i._disableDepthTestDistance},b.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},b}),define("Renderer/VertexArrayFacade",["../Core/Check","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./Buffer","./BufferUsage","./VertexArray"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,n,o,a){function s(e,r){return t.getSizeInBytes(r.componentDatatype)-t.getSizeInBytes(e.componentDatatype)}var l=c._verifyAttributes(n);o=r(o,0);for(var u,d,h=[],p={},f=l.length,m=0;m<f;++m){var g=l[m];g.vertexBuffer?h.push(g):(d=g.usage,u=p[d],i(u)||(u=p[d]=[]),u.push(g))}this._allBuffers=[];for(d in p)if(p.hasOwnProperty(d)){u=p[d],u.sort(s);var _=c._vertexSizeInBytes(u),v=u[0].usage,y={vertexSizeInBytes:_,vertexBuffer:void 0,usage:v,needsCommit:!1,arrayBuffer:void 0,arrayViews:c._createArrayViews(u,_)};this._allBuffers.push(y)}this._size=0,this._instanced=r(a,!1),this._precreated=h,this._context=e,this.writers=void 0,this.va=void 0,this.resize(o)}function d(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=s.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,r){if(e.needsCommit&&e.vertexSizeInBytes>0){var i=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*r;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,n),i)}}function p(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}}c._verifyAttributes=function(e){for(var i=[],n=0;n<e.length;++n){var o=e[n],a={index:r(o.index,n),enabled:r(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:r(o.componentDatatype,t.FLOAT),normalize:r(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:r(o.usage,l.STATIC_DRAW)};i.push(a)}for(var s=new Array(i.length),u=0;u<i.length;++u){s[i[u].index]=!0}return i},c._vertexSizeInBytes=function(e){for(var r=0,i=e.length,n=0;n<i;++n){var o=e[n];r+=o.componentsPerAttribute*t.getSizeInBytes(o.componentDatatype)}var a=i>0?t.getSizeInBytes(e[0].componentDatatype):0,s=a>0?r%a:0;return r+=0===s?0:a-s},c._createArrayViews=function(e,r){for(var i=[],n=0,o=e.length,a=0;a<o;++a){var s=e[a],l=s.componentDatatype;i.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:r/t.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*t.getSizeInBytes(l)}return i},c.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var r=0,i=t.length;r<i;++r){var n=t[r];c._resize(n,this._size),c._appendWriters(this.writers,n)}p(this)},c._resize=function(e,r){if(e.vertexSizeInBytes>0){var n=new ArrayBuffer(r*e.vertexSizeInBytes);if(i(e.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(e.arrayBuffer),s=a.length,l=0;l<s;++l)o[l]=a[l];for(var u=e.arrayViews,c=u.length,d=0;d<c;++d){var h=u[d];h.view=t.createArrayBufferView(h.componentDatatype,n,h.offsetInBytes)}e.arrayBuffer=n}};var f=[function(e,t,r){return function(i,n){t[i*r]=n,e.needsCommit=!0}},function(e,t,r){return function(i,n,o){var a=i*r;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a){var s=i*r;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a,s){var l=i*r;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return c._appendWriters=function(e,t){for(var r=t.arrayViews,i=r.length,n=0;n<i;++n){var o=r[n];e[o.index]=f[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},c.prototype.commit=function(e){var t,r,n,o=!1,s=this._allBuffers;for(r=0,n=s.length;r<n;++r)t=s[r],o=d(this,t)||o;if(o||!i(this.va)){p(this);for(var l=this.va=[],h=i(e)?Math.ceil(this._size/(a.SIXTY_FOUR_KILOBYTES-1)):1,f=0;f<h;++f){var m=[];for(r=0,n=s.length;r<n;++r){t=s[r];var g=f*(t.vertexSizeInBytes*(a.SIXTY_FOUR_KILOBYTES-1));c._appendAttributes(m,t,g,this._instanced)}m=m.concat(this._precreated),l.push({va:new u({context:this._context,attributes:m,indexBuffer:e}),indicesCount:1.5*(f!==h-1?a.SIXTY_FOUR_KILOBYTES-1:this._size%(a.SIXTY_FOUR_KILOBYTES-1))})}}},c._appendAttributes=function(e,t,r,i){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:r+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}},c.prototype.subCommit=function(e,t){for(var r=this._allBuffers,i=0,n=r.length;i<n;++i)h(r[i],e,t)},c.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,r=e.length;t<r;++t)e[t].needsCommit=!1},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){for(var e=this._allBuffers,t=0,r=e.length;t<r;++t){var i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return p(this),n(this)},c}),define("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\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;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef VECTOR_TILE\ncolor *= u_highlightColor;\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("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 vec3 distanceDisplayConditionAndDisableDepth;\n#ifdef VECTOR_TILE\nattribute float a_batchId;\n#endif\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{\nvec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);\nangle += sign(-projectedAlignedAxis.x) * acos( sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\n(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y) );\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 /= 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) || defined(DISABLE_DEPTH_DISTANCE)\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\nfloat distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\nscale *= distanceScale;\ntranslate *= distanceScale;\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 = distanceDisplayConditionAndDisableDepth.x;\nfloat farSq = distanceDisplayConditionAndDisableDepth.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 DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\nfloat zclip = gl_Position.z / gl_Position.w;\nbool clipped = (zclip < -1.0 || zclip > 1.0);\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n}\n}\n#endif\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),define("Scene/BlendOption",["../Core/freezeObject"],function(e){"use strict";return e({OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2})}),define("Renderer/Framebuffer",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){var i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,r._target,r._texture,0)}function u(e,t,r){var i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,r._getRenderbuffer())}function c(e){e=t(e,t.EMPTY_OBJECT);var i=e.context._gl;s.maximumColorAttachments;this._gl=i,this._framebuffer=i.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=t(e.destroyAttachments,!0);r(e.depthTexture)||r(e.depthRenderbuffer),r(e.depthStencilTexture)||r(e.depthStencilRenderbuffer);this._bind();var n,o,a,c,d;if(r(e.colorTextures)){var h=e.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=h.length,a=0;a<c;++a)n=h[a],d=this._gl.COLOR_ATTACHMENT0+a,l(this,d,n),this._activeColorAttachments[a]=d,this._colorTextures[a]=n}if(r(e.colorRenderbuffers)){var p=e.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=p.length,a=0;a<c;++a)o=p[a],d=this._gl.COLOR_ATTACHMENT0+a,u(this,d,o),this._activeColorAttachments[a]=d,this._colorRenderbuffers[a]=o}r(e.depthTexture)&&(n=e.depthTexture,l(this,this._gl.DEPTH_ATTACHMENT,n),this._depthTexture=n),r(e.depthRenderbuffer)&&(o=e.depthRenderbuffer,u(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o),r(e.stencilRenderbuffer)&&(o=e.stencilRenderbuffer,u(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o),r(e.depthStencilTexture)&&(n=e.depthStencilTexture,l(this,this._gl.DEPTH_STENCIL_ATTACHMENT,n),this._depthStencilTexture=n),r(e.depthStencilRenderbuffer)&&(o=e.depthStencilRenderbuffer,u(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o),this._unBind()}return i(c.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)}}}),c.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},c.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},c.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},c.prototype.getColorTexture=function(e){return this._colorTextures[e]},c.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,t=this._colorTextures,i=t.length;e<i;++e){var o=t[e];r(o)&&o.destroy()}var a=this._colorRenderbuffers;for(i=a.length,e=0;e<i;++e){var s=a[e];r(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),n(this)},c}),define("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","../Core/Resource","../Core/RuntimeError","../Renderer/Framebuffer","../Renderer/Texture","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,r,n,o,a){this.bottomLeft=i(e,t.ZERO),this.topRight=i(r,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function m(e){e=i(e,i.EMPTY_OBJECT);var t=i(e.borderWidthInPixels,1),n=i(e.initialSize,y);this._context=e.context,this._pixelFormat=i(e.pixelFormat,l.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=r(),this._idHash={},this._initialSize=n,this._root=void 0}function g(e,r){var i=e._context,o=e.numberOfImages,a=e._borderWidthInPixels;if(o>0){for(var s=e._texture.width,l=e._texture.height,u=2*(s+r.width+a),c=2*(l+r.height+a),p=s/u,m=l/c,g=new f(new t(s+a,a),new t(u,l)),_=new f(new t,new t(u,l),e._root,g),v=new f(new t(a,l+a),new t(u,c)),y=new f(new t,new t(u,c),_,v),b=0;b<e._textureCoordinates.length;b++){var C=e._textureCoordinates[b];n(C)&&(C.x*=p,C.y*=m,C.width*=p,C.height*=m)}var S=new h({context:e._context,width:u,height:c,pixelFormat:e._pixelFormat}),T=new d({context:i,colorTextures:[e._texture],destroyAttachments:!1});T._bind(),S.copyFromFramebuffer(0,0,0,0,u,c),T._unBind(),T.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=S,e._root=y}else{var w=2*(r.width+2*a),A=2*(r.height+2*a);w<e._initialSize.x&&(w=e._initialSize.x),A<e._initialSize.y&&(A=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new h({context:e._context,width:w,height:A,pixelFormat:e._pixelFormat}),e._root=new f(new t(a,a),new t(w,A))}}function _(e,r,i){if(n(r)){if(!n(r.childNode1)&&!n(r.childNode2)){if(n(r.imageIndex))return;var o=r.topRight.x-r.bottomLeft.x,a=r.topRight.y-r.bottomLeft.y,s=o-i.width,l=a-i.height;if(s<0||l<0)return;if(0===s&&0===l)return r;if(s>l){r.childNode1=new f(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.bottomLeft.x+i.width,r.topRight.y));var u=r.bottomLeft.x+i.width+e._borderWidthInPixels;u<r.topRight.x&&(r.childNode2=new f(new t(u,r.bottomLeft.y),new t(r.topRight.x,r.topRight.y)))}else{r.childNode1=new f(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.topRight.x,r.bottomLeft.y+i.height));var c=r.bottomLeft.y+i.height+e._borderWidthInPixels;c<r.topRight.y&&(r.childNode2=new f(new t(r.bottomLeft.x,c),new t(r.topRight.x,r.topRight.y)))}return _(e,r.childNode1,i)}return _(e,r.childNode1,i)||_(e,r.childNode2,i)}}function v(t,i,o){var a=_(t,t._root,i);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,d=a.bottomLeft.x/s,h=a.bottomLeft.y/l,p=u/s,f=c/l;t._textureCoordinates[o]=new e(d,h,p,f),t._texture.copyFrom(i,a.bottomLeft.x,a.bottomLeft.y)}else g(t,i),v(t,i,o);t._guid=r()}var y=new t(16,16);return o(m.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return n(this._texture)||(this._texture=new h({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}}}),m.prototype.addImage=function(e,t){var r=this._idHash[e];if(n(r))return r;if("function"==typeof t)t=t(e);else if("string"==typeof t||t instanceof u){var i=u.createIfNeeded(t);t=i.fetchImage()}var o=this;return r=p(t,function(e){if(o.isDestroyed())return-1;var t=o.numberOfImages;return v(o,e,t),t}),this._idHash[e]=r,r},m.prototype.addSubRegion=function(t,i){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(-1===t)return-1;var n=a._texture.width,o=a._texture.height,s=a.numberOfImages,l=a._textureCoordinates[t],u=l.x+i.x/n,c=l.y+i.y/o,d=i.width/n,h=i.height/o;return a._textureCoordinates.push(new e(u,c,d,h)),a._guid=r(),s})},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),a(this)},m}),define("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","./BlendOption","./HeightReference","./HorizontalOrigin","./SceneMode","./TextureAtlas","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R){"use strict";function L(e){e=a(e,a.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=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._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistancePick=!1,this._propertiesChanged=new Uint32Array(_e),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=f.clone(a(e.modelMatrix,f.IDENTITY)),this._modelMatrix=f.clone(f.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.blendOption=a(e.blendOption,P.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=O.SCENE3D,this._buffersUsage=[_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW,_.STATIC_DRAW],this._highlightColor=n.clone(n.WHITE);var r=this;this._uniforms={u_atlas:function(){return r._textureAtlas.texture},u_highlightColor:function(){return r._highlightColor}};var i=this._scene;s(i)&&s(i.terrainProviderChanged)&&(this._removeCallbackFunc=i.terrainProviderChanged.addEventListener(function(){for(var e=this._billboards,t=e.length,r=0;r<t;++r)e[r]._updateClamping()},this))}function N(e){for(var t=e.length,r=0;r<t;++r)e[r]&&e[r]._destroy()}function k(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],r=e._billboards,i=r.length,n=0,o=0;n<i;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function F(e){var t=e.cache.billboardCollection_indexBufferBatched;if(s(t))return t;for(var r=new Uint16Array(98298),i=0,n=0;i<98298;i+=6,
n+=4)r[i]=n,r[i+1]=n+1,r[i+2]=n+2,r[i+3]=n+0,r[i+4]=n+2,r[i+5]=n+3;return t=g.createIndexBuffer({context:e,typedArray:r,usage:_.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=t,t}function B(e){var t=e.cache.billboardCollection_indexBufferInstanced;return s(t)?t:(t=g.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:_.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t,t)}function U(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return s(t)?t:(t=g.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:_.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t,t)}function V(e,t,r,i,n){var a=[{index:ee.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[re]},{index:ee.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[re]},{index:ee.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[ie]},{index:ee.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[pe]},{index:ee.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[ue]},{index:ee.eyeOffset,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[ne]},{index:ee.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[he]},{index:ee.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[fe]},{index:ee.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:o.FLOAT,usage:r[me]}];return i&&a.push({index:ee.direction,componentsPerAttribute:2,componentDatatype:o.FLOAT,vertexBuffer:U(e)}),s(n)&&a.push({index:ee.a_batchId,componentsPerAttribute:1,componentDatatyps:o.FLOAT,bufferUsage:_.STATIC_DRAW}),new T(e,a,i?t:4*t,i)}function z(e,r,i,n,o){var a,s=n[ee.positionHighAndScale],l=n[ee.positionLowAndRotation],u=o._getActualPosition();e._mode===O.SCENE3D&&(t.expand(e._baseVolume,u,e._baseVolume),e._boundingVolumeDirty=!0),d.fromCartesian(u,Ce);var c=o.scale,h=o.rotation;0!==h&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);var p=Ce.high,f=Ce.low;e._instanced?(a=o._index,s(a,p.x,p.y,p.z,c),l(a,f.x,f.y,f.z,h)):(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,f.x,f.y,f.z,h),l(a+1,f.x,f.y,f.z,h),l(a+2,f.x,f.y,f.z,h),l(a+3,f.x,f.y,f.z,h))}function G(t,r,i,n,o){var a,s=n[ee.compressedAttribute0],l=o.pixelOffset,u=l.x,c=l.y,d=o._translate,h=d.x,f=d.y;t._maxPixelOffset=Math.max(t._maxPixelOffset,Math.abs(u+h),Math.abs(-c+f));var m=o.horizontalOrigin,g=o._verticalOrigin,_=o.show&&o.clusterShow;0===o.color.alpha&&(_=!1),g===R.BASELINE&&(g=R.BOTTOM),t._allHorizontalCenter=t._allHorizontalCenter&&m===D.CENTER,t._allVerticalCenter=t._allVerticalCenter&&g===R.CENTER;var v=0,y=0,b=0,C=0,S=o._imageIndex;if(-1!==S){var T=i[S];v=T.x,y=T.y,b=T.width,C=T.height}var w=v+b,A=y+C,E=Math.floor(p.clamp(u,-Te,Te)+Te)*Ee;E+=(m+1)*xe,E+=(g+1)*Pe,E+=(_?1:0)*Ie;var x=Math.floor(p.clamp(c,-Te,Te)+Te)*Ae,P=Math.floor(p.clamp(h,-Te,Te)+Te)*Ae,I=(p.clamp(f,-Te,Te)+Te)*De,O=Math.floor(I),M=Math.floor((I-O)*Ae);x+=O,P+=M,Se.x=v,Se.y=y;var L=e.compressTextureCoordinates(Se);Se.x=w;var N=e.compressTextureCoordinates(Se);Se.y=A;var k=e.compressTextureCoordinates(Se);Se.x=v;var F=e.compressTextureCoordinates(Se);t._instanced?(a=o._index,s(a,E,x,P,L)):(a=4*o._index,s(a+0,E+Oe,x,P,L),s(a+1,E+Me,x,P,N),s(a+2,E+Re,x,P,k),s(a+3,E+Le,x,P,F))}function H(t,r,n,o,l){var u,c=o[ee.compressedAttribute1],d=l.alignedAxis;i.equals(d,i.ZERO)||(t._shaderAlignedAxis=!0);var h=0,f=1,m=1,g=1,_=l.translucencyByDistance;s(_)&&(h=_.near,f=_.nearValue,m=_.far,g=_.farValue,1===f&&1===g||(t._shaderTranslucencyByDistance=!0));var v=0,y=l._imageIndex;if(-1!==y){v=n[y].width}var b=t._textureAtlas.texture.width,C=Math.round(a(l.width,b*v));t._maxSize=Math.max(t._maxSize,C);var S=p.clamp(C,0,we),T=0;Math.abs(i.magnitudeSquared(d)-1)<p.EPSILON6&&(T=e.octEncodeFloat(d)),f=p.clamp(f,0,1),f=1===f?255:255*f|0,S=S*Ae+f,g=p.clamp(g,0,1),g=1===g?255:255*g|0,T=T*Ae+g,t._instanced?(u=l._index,c(u,S,T,h,m)):(u=4*l._index,c(u+0,S,T,h,m),c(u+1,S,T,h,m),c(u+2,S,T,h,m),c(u+3,S,T,h,m))}function W(e,t,r,o,l){var u,c=o[ee.compressedAttribute2],d=l.color,h=s(e._batchTable)?n.WHITE:l.getPickId(t).color,f=l.sizeInMeters?1:0,m=Math.abs(i.magnitudeSquared(l.alignedAxis)-1)<p.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===f;var g=0,_=l._imageIndex;if(-1!==_){g=r[_].height}var v=e._textureAtlas.texture.dimensions,y=Math.round(a(l.height,v.y*g));e._maxSize=Math.max(e._maxSize,y);var b=n.floatToByte(d.red),C=n.floatToByte(d.green),S=n.floatToByte(d.blue),T=b*we+C*Ae+S;b=n.floatToByte(h.red),C=n.floatToByte(h.green),S=n.floatToByte(h.blue);var w=b*we+C*Ae+S,A=n.floatToByte(d.alpha)*we+n.floatToByte(h.alpha)*Ae;A+=2*f+m,e._instanced?(u=l._index,c(u,T,w,A,y)):(u=4*l._index,c(u+0,T,w,A,y),c(u+1,T,w,A,y),c(u+2,T,w,A,y),c(u+3,T,w,A,y))}function j(t,r,i,n,o){var a,s=n[ee.eyeOffset],l=o.eyeOffset,u=l.z;if(o._heightReference!==I.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,d=0,h=o._imageIndex;if(-1!==h){var p=i[h];c=p.width,d=p.height}Se.x=c,Se.y=d;var f=e.compressTextureCoordinates(Se);a=o._index,s(a,l.x,l.y,u,f)}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,r,i,n){var o,a=i[ee.scaleByDistance],l=0,u=1,c=1,d=1,h=n.scaleByDistance;s(h)&&(l=h.near,u=h.nearValue,c=h.far,d=h.farValue,1===u&&1===d||(e._shaderScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,d)):(o=4*n._index,a(o+0,l,u,c,d),a(o+1,l,u,c,d),a(o+2,l,u,c,d),a(o+3,l,u,c,d))}function Y(e,t,r,i,n){var o,a=i[ee.pixelOffsetScaleByDistance],l=0,u=1,c=1,d=1,h=n.pixelOffsetScaleByDistance;s(h)&&(l=h.near,u=h.nearValue,c=h.far,d=h.farValue,1===u&&1===d||(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,d)):(o=4*n._index,a(o+0,l,u,c,d),a(o+1,l,u,c,d),a(o+2,l,u,c,d),a(o+3,l,u,c,d))}function X(e,t,r,i,n){var o,a=i[ee.distanceDisplayConditionAndDisableDepth],l=0,u=Number.MAX_VALUE,c=n.distanceDisplayCondition;s(c)&&(l=c.near,u=c.far,l*=l,u*=u,e._shaderDistanceDisplayCondition=!0);var d=n.disableDepthTestDistance;d*=d,d>0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1)),e._instanced?(o=n._index,a(o,l,u,d)):(o=4*n._index,a(o+0,l,u,d),a(o+1,l,u,d),a(o+2,l,u,d),a(o+3,l,u,d))}function Q(e,t,r,i,n){if(s(e._batchTable)){var o,a=i[ee.a_batchId],l=n._batchIndex;e._instanced?(o=n._index,a(o,l)):(o=4*n._index,a(o+0,l),a(o+1,l),a(o+2,l),a(o+3,l))}}function Z(e,t,r,i,n){z(e,t,r,i,n),G(e,t,r,i,n),H(e,t,r,i,n),W(e,t,r,i,n),j(e,t,r,i,n),q(e,t,r,i,n),Y(e,t,r,i,n),X(e,t,r,i,n),Q(e,t,r,i,n)}function K(e,r,i,n,o,a){var l;n.mode===O.SCENE3D?(l=e._baseVolume,e._boundingVolumeDirty=!0):l=e._baseVolume2D;for(var u=[],c=0;c<i;++c){var d=r[c],h=d.position,p=E._computeActualPosition(d,h,n,o);s(p)&&(d._setActualPosition(p),a?u.push(p):t.expand(l,p,l))}a&&t.fromPoints(u,l)}function J(e,t){var r=t.mode,i=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==r||r!==O.SCENE3D&&!f.equals(o,e.modelMatrix)?(e._mode=r,f.clone(e.modelMatrix,o),e._createVertexArray=!0,r!==O.SCENE3D&&r!==O.SCENE2D&&r!==O.COLUMBUS_VIEW||K(e,i,i.length,t,o,!0)):r===O.MORPHING?K(e,i,i.length,t,o,!0):r!==O.SCENE2D&&r!==O.COLUMBUS_VIEW||K(e,n,e._billboardsToUpdateIndex,t,o,!1)}function $(e,t,r){var i=1;e._allSizedInMeters&&0===e._maxPixelOffset||(i=t.camera.getPixelSize(r,t.context.drawingBufferWidth,t.context.drawingBufferHeight));var n=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(n*=.5);var o=i*e._maxPixelOffset+e._maxEyeOffset;r.radius+=n+o}var ee,te=E.SHOW_INDEX,re=E.POSITION_INDEX,ie=E.PIXEL_OFFSET_INDEX,ne=E.EYE_OFFSET_INDEX,oe=E.HORIZONTAL_ORIGIN_INDEX,ae=E.VERTICAL_ORIGIN_INDEX,se=E.SCALE_INDEX,le=E.IMAGE_INDEX_INDEX,ue=E.COLOR_INDEX,ce=E.ROTATION_INDEX,de=E.ALIGNED_AXIS_INDEX,he=E.SCALE_BY_DISTANCE_INDEX,pe=E.TRANSLUCENCY_BY_DISTANCE_INDEX,fe=E.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,me=E.DISTANCE_DISPLAY_CONDITION_INDEX,ge=E.DISABLE_DEPTH_DISTANCE,_e=E.NUMBER_OF_PROPERTIES,ve={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,distanceDisplayConditionAndDisableDepth:8,a_batchId:9},ye={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,distanceDisplayConditionAndDisableDepth:9,a_batchId:10};l(L.prototype,{length:{get:function(){return k(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}}}),L.prototype.add=function(e){var t=new E(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},L.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},L.prototype.removeAll=function(){N(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},L.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},L.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},L.prototype.get=function(e){return k(this),this._billboards[e]};var be;L.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;i<_e;++i){var n=0===r[i]?_.STATIC_DRAW:_.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var Ce=new d,Se=new r,Te=32768,we=65536,Ae=256,Ee=128,xe=32,Pe=8,Ie=4,De=1/256,Oe=0,Me=2,Re=3,Le=1,Ne=[];return L.prototype.update=function(e){k(this);var r=this._billboards,i=r.length,n=e.context;this._instanced=n.instancedArrays,ee=this._instanced?ye:ve,be=this._instanced?B:F;var o=this._textureAtlas;if(!s(o)){o=this._textureAtlas=new M({context:n});for(var a=0;a<i;++a)r[a]._loadImage()}var l=o.textureCoordinates;if(0!==l.length){J(this,e),r=this._billboards,i=r.length;var u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,d=this._propertiesChanged,h=o.guid,p=this._createVertexArray||this._textureAtlasGUID!==h;this._textureAtlasGUID=h;var g,_=e.passes,T=_.pick;if(p||!T&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var E=0;E<_e;++E)d[E]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=V(n,i,this._buffersUsage,this._instanced,this._batchTable),g=this._vaf.writers;for(var I=0;I<i;++I){var D=this._billboards[I];D._dirty=!1,Z(this,n,l,g,D)}this._vaf.commit(be(n))}this._billboardsToUpdateIndex=0}else if(c>0){var R=Ne;R.length=0,(d[re]||d[ce]||d[se])&&R.push(z),(d[le]||d[ie]||d[oe]||d[ae]||d[te])&&(R.push(G),this._instanced&&R.push(j)),(d[le]||d[de]||d[pe])&&(R.push(H),R.push(W)),(d[le]||d[ue])&&R.push(W),d[ne]&&R.push(j),d[he]&&R.push(q),d[fe]&&R.push(Y),(d[me]||d[ge])&&R.push(X);var L=R.length;if(g=this._vaf.writers,c/i>.1){for(var N=0;N<c;++N){var U=u[N];U._dirty=!1;for(var Q=0;Q<L;++Q)R[Q](this,n,l,g,U)}this._vaf.commit(be(n))}else{for(var K=0;K<c;++K){var Ce=u[K];Ce._dirty=!1;for(var Se=0;Se<L;++Se)R[Se](this,n,l,g,Ce);this._instanced?this._vaf.subCommit(Ce._index,1):this._vaf.subCommit(4*Ce._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>1.5*i&&(u.length=i),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var Te,we=f.IDENTITY;e.mode===O.SCENE3D?(we=this.modelMatrix,Te=t.clone(this._baseVolumeWC,this._boundingVolume)):Te=t.clone(this._baseVolume2D,this._boundingVolume),$(this,e,Te);var Ae=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,Ae){this._blendOption===P.OPAQUE||this._blendOption===P.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=b.fromCache({depthTest:{enabled:!0,func:m.LESS},depthMask:!0}):this._rsOpaque=void 0;var Ee=this._blendOption===P.TRANSLUCENT;this._blendOption===P.TRANSLUCENT||this._blendOption===P.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=b.fromCache({depthTest:{enabled:!0,func:Ee?m.LEQUAL:m.LESS},depthMask:Ee,blending:x.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance;var xe,Pe,Ie,De,Oe;if(Ae||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance){xe=A,Pe=w,Oe=[],s(this._batchTable)&&(Oe.push("VECTOR_TILE"),xe=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(xe),Pe=this._batchTable.getFragmentShaderCallback(!1,void 0)(Pe)),Ie=new S({defines:Oe,sources:[xe]}),this._instanced&&Ie.defines.push("INSTANCED"),this._shaderRotation&&Ie.defines.push("ROTATION"),this._shaderAlignedAxis&&Ie.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Ie.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Ie.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Ie.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Ie.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&Ie.defines.push("DISABLE_DEPTH_DISTANCE");var Me=s(this._batchTable)?"VECTOR_TILE":"";this._blendOption===P.OPAQUE_AND_TRANSLUCENT&&(De=new S({defines:["OPAQUE",Me],sources:[Pe]}),this._sp=C.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Ie,fragmentShaderSource:De,attributeLocations:ee}),De=new S({defines:["TRANSLUCENT",Me],sources:[Pe]}),this._spTranslucent=C.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Ie,fragmentShaderSource:De,attributeLocations:ee})),this._blendOption===P.OPAQUE&&(De=new S({defines:[Me],sources:[Pe]}),this._sp=C.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Ie,fragmentShaderSource:De,attributeLocations:ee})),this._blendOption===P.TRANSLUCENT&&(De=new S({defines:[Me],sources:[Pe]}),this._spTranslucent=C.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Ie,fragmentShaderSource:De,attributeLocations:ee})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance}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&&this._shaderDisableDepthDistance===this._compiledShaderDisableDepthDistancePick||(xe=A,Pe=w,Oe=[],s(this._batchTable)&&(Oe.push("VECTOR_TILE"),xe=this._batchTable.getPickVertexShaderCallback("a_batchId")(xe),Pe=this._batchTable.getPickFragmentShaderCallback()(Pe)),Oe.push(s(this._batchTable)?"":"RENDER_FOR_PICK"),Ie=new S({defines:Oe,sources:[xe]}),this._instanced&&Ie.defines.push("INSTANCED"),this._shaderRotation&&Ie.defines.push("ROTATION"),this._shaderAlignedAxis&&Ie.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Ie.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Ie.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Ie.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Ie.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&Ie.defines.push("DISABLE_DEPTH_DISTANCE"),De=new S({defines:Oe,sources:[Pe]}),this._spPick=C.replaceCache({context:n,shaderProgram:this._spPick,vertexShaderSource:Ie,fragmentShaderSource:De,attributeLocations:ee}),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistancePick=this._shaderDisableDepthDistance);var Re,Le,ke,Fe,Be,Ue=e.commandList;if(_.render){var Ve=this._colorCommands,ze=this._blendOption===P.OPAQUE,Ge=this._blendOption===P.OPAQUE_AND_TRANSLUCENT;Re=this._vaf.va,Le=Re.length,Fe=this._uniforms,s(this._batchTable)&&(Fe=this._batchTable.getUniformMapCallback()(Fe)),Ve.length=Le;var He=Ge?2*Le:Le;for(Be=0;Be<He;++Be){ke=Ve[Be],s(ke)||(ke=Ve[Be]=new v);var We=ze||Ge&&Be%2==0;ke.pass=We||!Ge?y.OPAQUE:y.TRANSLUCENT,ke.owner=this;var je=Ge?Math.floor(Be/2):Be;ke.boundingVolume=Te,ke.modelMatrix=we,ke.count=Re[je].indicesCount,ke.shaderProgram=We?this._sp:this._spTranslucent,ke.uniformMap=Fe,ke.vertexArray=Re[je].va,ke.renderState=We?this._rsOpaque:this._rsTranslucent,ke.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(ke.count=6,ke.instanceCount=i),Ue.push(ke)}}if(T){var qe=this._pickCommands;for(Re=this._vaf.va,Le=Re.length,Fe=this._uniforms,s(this._batchTable)&&(Fe=this._batchTable.getPickUniformMapCallback()(Fe)),qe.length=Le,Be=0;Be<Le;++Be)ke=qe[Be],s(ke)||(ke=qe[Be]=new v({pass:y.OPAQUE,owner:this})),ke.boundingVolume=Te,ke.modelMatrix=we,ke.count=Re[Be].indicesCount,ke.shaderProgram=this._spPick,ke.uniformMap=Fe,ke.vertexArray=Re[Be].va,ke.renderState=this._rsOpaque,this._instanced&&(ke.count=6,ke.instanceCount=i),Ue.push(ke)}}}},L.prototype.isDestroyed=function(){return!1},L.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._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),N(this._billboards),u(this)},L}),define("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";return e({FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2})}),define("Scene/Label",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/freezeObject","../Core/NearFarScalar","./Billboard","./HeightReference","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(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 v(e,a){e=n(e,n.EMPTY_OBJECT);var s=e.translucencyByDistance,u=e.pixelOffsetScaleByDistance,d=e.scaleByDistance,g=e.distanceDisplayCondition;o(s)&&(s=c.clone(s)),o(u)&&(u=c.clone(u)),o(d)&&(d=c.clone(d)),o(g)&&(g=l.clone(g)),this._renderedText=void 0,this._text=void 0,this._show=n(e.show,!0),this._font=n(e.font,"30px sans-serif"),this._fillColor=i.clone(n(e.fillColor,i.WHITE)),this._outlineColor=i.clone(n(e.outlineColor,i.BLACK)),this._outlineWidth=n(e.outlineWidth,1),this._showBackground=n(e.showBackground,!1),this._backgroundColor=n(e.backgroundColor,new i(.165,.165,.165,.8)),this._backgroundPadding=n(e.backgroundPadding,new t(7,5)),this._style=n(e.style,f.FILL),this._verticalOrigin=n(e.verticalOrigin,m.BASELINE),this._horizontalOrigin=n(e.horizontalOrigin,p.LEFT),this._pixelOffset=t.clone(n(e.pixelOffset,t.ZERO)),this._eyeOffset=r.clone(n(e.eyeOffset,r.ZERO)),this._position=r.clone(n(e.position,r.ZERO)),this._scale=n(e.scale,1),this._id=e.id,this._translucencyByDistance=s,this._pixelOffsetScaleByDistance=u,this._scaleByDistance=d,this._heightReference=n(e.heightReference,h.NONE),this._distanceDisplayCondition=g,this._disableDepthTestDistance=n(e.disableDepthTestDistance,0),this._labelCollection=a,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=n(e.text,""),this._updateClamping()}function y(e,t){for(var r=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,n=[],o="",a=w.LTR,s="",l=e.length,u=0;u<l;++u){var c=e.charAt(u);s=t.test(c)?w.RTL:r.test(c)?w.LTR:i.test(c)?w.BRACKETS:w.WEAK,0===u&&(a=s),a===s&&s!==w.BRACKETS?o+=c:(""!==o&&n.push({Type:a,Word:o}),a=s,o=c)}return n.push({Type:s,Word:o}),n}function b(e){return e.split("").reverse().join("")}function C(e,t,r){return e.slice(0,t)+r+e.slice(t)}function S(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}function T(e){for(var t=e.split("\n"),r="",i=0;i<t.length;i++){for(var n=t[i],o=A.test(n.charAt(0)),a=y(n,A),s=0,l="",u=0;u<a.length;++u){var c=a[u],d=c.Type===w.BRACKETS?S(c.Word):c.Word;o?c.Type===w.RTL?(l=b(c.Word)+l,s=0):c.Type===w.LTR?(l=C(l,s,c.Word),s+=c.Word.length):c.Type!==w.WEAK&&c.Type!==w.BRACKETS||(c.Type===w.WEAK&&a[u-1].Type===w.BRACKETS?l=b(c.Word)+l:a[u-1].Type===w.RTL?(l=d+l,s=0):a.length>u+1?a[u+1].Type===w.RTL?(l=d+l,s=0):(l=C(l,s,c.Word),s+=c.Word.length):l=C(l,0,d)):c.Type===w.RTL?l=C(l,s,b(c.Word)):c.Type===w.LTR?(l+=c.Word,s=l.length):c.Type!==w.WEAK&&c.Type!==w.BRACKETS||(u>0&&a[u-1].Type===w.RTL?a.length>u+1?a[u+1].Type===w.RTL?l=C(l,s,d):(l+=c.Word,s=l.length):l+=c.Word:(l+=c.Word,s=l.length))}r+=l,i<t.length-1&&(r+="\n")}return r}var w=u({LTR:0,RTL:1,WEAK:2,BRACKETS:3});a(v.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r].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(!r.equals(t,e)){r.clone(e,t);for(var i=this._glyphs,n=0,a=i.length;n<a;n++){var s=i[n].billboard;o(s)&&(s.position=e)}var l=this._backgroundBillboard;o(l)&&(l.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r].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,this._renderedText=v.enableRightToLeftDetection?T(e):e,g(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,g(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;i.equals(t,e)||(i.clone(e,t),g(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;i.equals(t,e)||(i.clone(e,t),g(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,g(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,g(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){var t=this._backgroundColor;if(!i.equals(t,e)){i.clone(e,t);var r=this._backgroundBillboard;o(r)&&(r.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){var r=this._backgroundPadding;t.equals(r,e)||(t.clone(e,r),_(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,g(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var r=this._pixelOffset;if(!t.equals(r,e)){t.clone(e,r);for(var i=this._glyphs,n=0,a=i.length;n<a;n++){var s=i[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(!c.equals(t,e)){this._translucencyByDistance=c.clone(e,t);for(var r=this._glyphs,i=0,n=r.length;i<n;i++){var a=r[i];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(!c.equals(t,e)){this._pixelOffsetScaleByDistance=c.clone(e,t);for(var r=this._glyphs,i=0,n=r.length;i<n;i++){var a=r[i];o(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;if(!c.equals(t,e)){this._scaleByDistance=c.clone(e,t);for(var r=this._glyphs,i=0,n=r.length;i<n;i++){var a=r[i];o(a.billboard)&&(a.billboard.scaleByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;if(!r.equals(t,e)){r.clone(e,t);for(var i=this._glyphs,n=0,a=i.length;n<a;n++){var s=i[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,r=0,i=t.length;r<i;r++){var n=t[r];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,r=0,i=t.length;r<i;r++){var n=t[r];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,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.distanceDisplayCondition=e)}var a=this._backgroundBillboard;o(a)&&(a.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.disableDepthTestDistance=e)}var a=this._backgroundBillboard;o(a)&&(a.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];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=r.clone(e,this._actualClampedPosition);for(var t=this._glyphs,i=0,n=t.length;i<n;i++){var a=t[i];o(a.billboard)&&(a.billboard._clampedPosition=e)}var s=this._backgroundBillboard;o(s)&&(s._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.clusterShow=e)}var a=this._backgroundBillboard;o(a)&&(a.clusterShow=e)}}}}),v.prototype._updateClamping=function(){d._updateClamping(this._labelCollection,this)},v.prototype.computeScreenSpacePosition=function(e,r){o(r)||(r=new t);var i=this._labelCollection,n=i.modelMatrix,a=o(this._actualClampedPosition)?this._actualClampedPosition:this._position;return d._computeScreenSpacePosition(n,a,this._eyeOffset,this._pixelOffset,e,r)},v.getScreenSpaceBoundingBox=function(t,r,i){var n=0,a=0,s=0,l=0,u=t.scale,c=t._labelCollection._resolutionScale,d=t._backgroundBillboard;if(o(d))n=r.x+d._translate.x/c,a=r.y-d._translate.y/c,s=d.width*u,l=d.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 h=0,p=0,f=t._glyphs,g=f.length,_=0;_<g;++_){var v=f[_],y=v.billboard;if(o(y)){var b=r.x+y._translate.x/c,C=r.y-y._translate.y/c,S=y.width*u,T=y.height*u;t.verticalOrigin===m.BOTTOM||t.verticalOrigin===m.BASELINE?C-=T:t.verticalOrigin===m.CENTER&&(C-=.5*T),n=Math.min(n,b),a=Math.min(a,C),h=Math.max(h,b+S),p=Math.max(p,C+T)}}s=h-n,l=p-a}return o(i)||(i=new e),i.x=n,i.y=a,i.width=s,i.height=l,i},v.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._renderedText===e._renderedText&&this._font===e._font&&r.equals(this._position,e._position)&&i.equals(this._fillColor,e._fillColor)&&i.equals(this._outlineColor,e._outlineColor)&&i.equals(this._backgroundColor,e._backgroundColor)&&t.equals(this._backgroundPadding,e._backgroundPadding)&&t.equals(this._pixelOffset,e._pixelOffset)&&r.equals(this._eyeOffset,e._eyeOffset)&&c.equals(this._translucencyByDistance,e._translucencyByDistance)&&c.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&c.equals(this._scaleByDistance,e._scaleByDistance)&&l.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},v.prototype.isDestroyed=function(){return!1},v.enableRightToLeftDetection=!1;var A=new RegExp("[א-ת؀-ۿݐ-ݿࢠ-ࣿ]");return v}),define("Scene/LabelCollection",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./BlendOption","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(){this.textureInfo=void 0,
this.dimensions=void 0,this.billboard=void 0}function v(e,t,r){this.labelCollection=e,this.index=t,this.dimensions=r}function y(e,t){var r=document.createElement("canvas");r.width=D.x,r.height=D.y;var i=r.getContext("2d");i.fillStyle="#fff",i.fillRect(0,0,r.width,r.height),e.addImage(I,r).then(function(e){t._whitePixelIndex=e})}function b(e,t,r,i,n,o,a){return M.font=t,M.fillColor=r,M.strokeColor=i,M.strokeWidth=n,a===g.CENTER?M.textBaseline="middle":a===g.TOP?M.textBaseline="top":M.textBaseline="bottom",M.fill=o===f.FILL||o===f.FILL_AND_OUTLINE,M.stroke=o===f.OUTLINE||o===f.FILL_AND_OUTLINE,u(e,M)}function C(e,t){t.textureInfo=void 0,t.dimensions=void 0;var r=t.billboard;n(r)&&(r.show=!1,r.image=void 0,n(r._removeCallbackFunc)&&(r._removeCallbackFunc(),r._removeCallbackFunc=void 0),e._spareBillboards.push(r),t.billboard=void 0)}function S(e,t,r,i){e.addImage(t,r).then(function(e){i.index=e})}function T(e,t){var r,i,o,a=t._renderedText,s=a.length,l=t._glyphs,u=l.length;if(s<u)for(i=s;i<u;++i)C(e,l[i]);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:I,imageSubRegion:O}),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.scaleByDistance=t._scaleByDistance,d.distanceDisplayCondition=t._distanceDisplayCondition,d.disableDepthTestDistance=t._disableDepthTestDistance):n(d)&&(p.remove(d),t._backgroundBillboard=d=void 0);var f=e._glyphTextureCache;for(o=0;o<s;++o){var m=a.charAt(o),g=t._font,y=t._fillColor,T=t._outlineColor,w=t._outlineWidth,A=t._style,E=t._verticalOrigin,x=JSON.stringify([m,g,y.toRgba(),T.toRgba(),w,+A,+E]),P=f[x];if(!n(P)){var D=b(m,g,y,T,w,A,E);P=new v(e,-1,D.dimensions),f[x]=P,D.width>0&&D.height>0&&S(e._textureAtlas,x,D,P)}if(r=l[o],n(r)?-1===P.index?C(e,r):n(r.textureInfo)&&(r.textureInfo=void 0):(r=new _,l[o]=r),r.textureInfo=P,r.dimensions=P.dimensions,-1!==P.index){var M=r.billboard,R=e._spareBillboards;n(M)||(M=R.length>0?R.pop():e._billboardCollection.add({collection:e}),r.billboard=M),M.show=t._show,M.position=t._position,M.eyeOffset=t._eyeOffset,M.pixelOffset=t._pixelOffset,M.horizontalOrigin=h.LEFT,M.verticalOrigin=t._verticalOrigin,M.heightReference=t._heightReference,M.scale=t._scale,M.pickPrimitive=t,M.id=t._id,M.image=x,M.translucencyByDistance=t._translucencyByDistance,M.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,M.scaleByDistance=t._scaleByDistance,M.distanceDisplayCondition=t._distanceDisplayCondition,M.disableDepthTestDistance=t._disableDepthTestDistance,M._batchIndex=t._batchIndex}}t._repositionAllGlyphs=!0}function w(e,t,r){return t===h.CENTER?-e/2:t===h.RIGHT?-(e+r.x):r.x}function A(e,r){var i,o,a=e._glyphs,s=e._renderedText,l=0,u=0,c=[],d=Number.NEGATIVE_INFINITY,p=0,f=1,m=0,_=a.length,v=e._backgroundBillboard,y=L;for(t.clone(n(v)?e._backgroundPadding:t.ZERO,y),m=0;m<_;++m)"\n"===s.charAt(m)?(c.push(l),++f,l=0):(i=a[m],o=i.dimensions,p=Math.max(p,o.height-o.descent),d=Math.max(d,o.descent),l+=o.width-o.bounds.minx,m<_-1&&(l+=a[m+1].dimensions.bounds.minx),u=Math.max(u,l));c.push(l);var b=p+d,C=e._scale,S=e._horizontalOrigin,T=e._verticalOrigin,A=0,E=c[A],x=w(E,S,y),I=P*b,D=I*(f-1);R.x=x*C*r,R.y=0;var O=0;for(m=0;m<_;++m)if("\n"===s.charAt(m))++A,O+=I,E=c[A],x=w(E,S,y),R.x=x*C*r;else if(i=a[m],o=i.dimensions,T===g.TOP?R.y=o.height-p-y.y:T===g.CENTER?R.y=(D+o.height-p)/2:T===g.BASELINE?R.y=D:R.y=D+d+y.y,R.y=(R.y-o.descent-O)*C*r,n(i.billboard)&&i.billboard._setTranslate(R),m<_-1){var M=a[m+1];R.x+=(o.width-o.bounds.minx+M.dimensions.bounds.minx)*C*r}n(v)&&s.split("\n").join("").length>0&&(x=S===h.CENTER?-u/2-y.x:S===h.RIGHT?-(u+2*y.x):0,R.x=x*C*r,T===g.TOP?R.y=b-p-d:T===g.CENTER?R.y=(b-p)/2-d:T===g.BASELINE?R.y=-y.y-d:R.y=0,R.y=R.y*C*r,v.width=u+2*y.x,v.height=b+D+2*y.y,v._setTranslate(R))}function E(e,t){for(var r=t._glyphs,i=0,o=r.length;i<o;++i)C(e,r[i]);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=i(e,i.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,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,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this._highlightColor=r.clone(r.WHITE),this.modelMatrix=l.clone(i(e.modelMatrix,l.IDENTITY)),this.debugShowBoundingVolume=i(e.debugShowBoundingVolume,!1),this.blendOption=i(e.blendOption,d.OPAQUE_AND_TRANSLUCENT)}var P=1.2,I="ID_WHITE_PIXEL",D=new t(4,4),O=new e(1,1,1,1),M={},R=new t,L=new t;return o(x.prototype,{length:{get:function(){return this._labels.length}}}),x.prototype.add=function(e){var t=new p(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(-1!==t)return this._labels.splice(t,1),E(this,e),!0}return!1},x.prototype.removeAll=function(){for(var e=this._labels,t=0,r=e.length;t<r;++t)E(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,r=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,r.modelMatrix=this.modelMatrix,r.debugShowBoundingVolume=this.debugShowBoundingVolume;var i=e.context;n(this._textureAtlas)||(this._textureAtlas=new m({context:i}),t.textureAtlas=this._textureAtlas),n(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new m({context:i,initialSize:D}),r.textureAtlas=this._backgroundTextureAtlas,y(this._backgroundTextureAtlas,this));var o=i.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 p=h._glyphs.length;h._rebindAllGlyphs&&(T(this,h),h._rebindAllGlyphs=!1),(s||h._repositionAllGlyphs)&&(A(h,a),h._repositionAllGlyphs=!1);var f=h._glyphs.length-p;this._totalGlyphCount+=f}}var g=r.length>0?d.TRANSLUCENT:this.blendOption;t.blendOption=g,r.blendOption=g,t._highlightColor=this._highlightColor,r._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,r.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}),define("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,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){e=o(e,o.EMPTY_OBJECT);var i=e.translucencyByDistance,s=e.scaleByDistance,l=e.distanceDisplayCondition;a(i)&&(i=d.clone(i)),a(s)&&(s=d.clone(s)),a(l)&&(l=u.clone(l)),this._show=o(e.show,!0),this._position=r.clone(o(e.position,r.ZERO)),this._actualPosition=r.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=s,this._translucencyByDistance=i,this._distanceDisplayCondition=l,this._disableDepthTestDistance=o(e.disableDepthTestDistance,0),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 m(e,t){var r=e._pointPrimitiveCollection;a(r)&&(r._updatePointPrimitive(e,t),e._dirty=!0)}var g=f.SHOW_INDEX=0,_=f.POSITION_INDEX=1,v=f.COLOR_INDEX=2,y=f.OUTLINE_COLOR_INDEX=3,b=f.OUTLINE_WIDTH_INDEX=4,C=f.PIXEL_SIZE_INDEX=5,S=f.SCALE_BY_DISTANCE_INDEX=6,T=f.TRANSLUCENCY_BY_DISTANCE_INDEX=7,w=f.DISTANCE_DISPLAY_CONDITION_INDEX=8,A=f.DISABLE_DEPTH_DISTANCE_INDEX=9;f.NUMBER_OF_PROPERTIES=10,s(f.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,m(this,g))}},position:{get:function(){return this._position},set:function(e){var t=this._position;r.equals(t,e)||(r.clone(e,t),r.clone(e,this._actualPosition),m(this,_))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;d.equals(t,e)||(this._scaleByDistance=d.clone(e,t),m(this,S))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;d.equals(t,e)||(this._translucencyByDistance=d.clone(e,t),m(this,T))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,m(this,C))}},color:{get:function(){return this._color},set:function(e){var t=this._color;n.equals(t,e)||(n.clone(e,t),m(this,v))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;n.equals(t,e)||(n.clone(e,t),m(this,y))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,m(this,b))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){u.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=u.clone(e,this._distanceDisplayCondition),m(this,w))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,m(this,A))}},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,m(this,g))}}}),f.prototype.getPickId=function(e){return a(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},f.prototype._getActualPosition=function(){return this._actualPosition},f.prototype._setActualPosition=function(e){r.clone(e,this._actualPosition),m(this,_)};var E=new i;f._computeActualPosition=function(e,t,r){return t.mode===h.SCENE3D?e:(c.multiplyByPoint(r,e,E),p.computeActualWgs84Position(t,E))};var x=new i;return f._computeScreenSpacePosition=function(e,t,r,n){var o=c.multiplyByVector(e,i.fromElements(t.x,t.y,t.z,1,x),x);return p.wgs84ToWindowCoordinates(r,o,n)},f.prototype.computeScreenSpacePosition=function(e,r){var i=this._pointPrimitiveCollection;a(r)||(r=new t);var n=i.modelMatrix,o=f._computeScreenSpacePosition(n,this._actualPosition,e,r);if(a(o))return o.y=e.canvas.clientHeight-o.y,o},f.getScreenSpaceBoundingBox=function(t,r,i){var n=t.pixelSize,o=.5*n,s=r.x-o,l=r.y-o,u=n,c=n;return a(i)||(i=new e),i.x=s,i.y=l,i.width=u,i.height=c,i},f.prototype.equals=function(e){return this===e||a(e)&&this._id===e._id&&r.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)&&d.equals(this._scaleByDistance,e._scaleByDistance)&&d.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},f.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0},f}),define("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;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("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 vec3 distanceDisplayConditionAndDisableDepth;\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) || defined(DISABLE_DEPTH_DISTANCE)\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 = distanceDisplayConditionAndDisableDepth.x;\nfloat farSq = distanceDisplayConditionAndDisableDepth.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);\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\nfloat zclip = gl_Position.z / gl_Position.w;\nbool clipped = (zclip < -1.0 || zclip > 1.0);\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n}\n}\n#endif\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"}),define("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","./BlendOption","./PointPrimitive","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E){"use strict";function x(t){t=i(t,i.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=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._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistancePick=!1,this._propertiesChanged=new Uint32Array(Z),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(i(t.modelMatrix,c.IDENTITY)),this._modelMatrix=c.clone(c.IDENTITY),this.debugShowBoundingVolume=i(t.debugShowBoundingVolume,!1),this.blendOption=i(t.blendOption,w.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=E.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 r=this;this._uniforms={u_maxTotalPointSize:function(){return r._maxTotalPointSize}}}function P(e){for(var t=e.length,r=0;r<t;++r)e[r]&&e[r]._destroy()}function I(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],r=e._pointPrimitives,i=r.length,n=0,o=0;n<i;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}function D(e,t,i){return new b(e,[{index:K.positionHighAndSize,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[z]},{index:K.positionLowAndShow,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[z]},{index:K.compressedAttribute0,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[G]},{index:K.compressedAttribute1,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[Y]},{index:K.scaleByDistance,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[q]},{index:K.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:r.FLOAT,usage:i[X]}],t)}function O(t,r,i,n){var o=n._index,a=n._getActualPosition();t._mode===E.SCENE3D&&(e.expand(t._baseVolume,a,t._baseVolume),t._boundingVolumeDirty=!0),l.fromCartesian(a,J);var s=n.pixelSize,u=n.outlineWidth;t._maxPixelSize=Math.max(t._maxPixelSize,s+u);var c=i[K.positionHighAndSize],d=J.high;c(o,d.x,d.y,d.z,s);var h=i[K.positionLowAndOutline],p=J.low;h(o,p.x,p.y,p.z,u)}function M(e,r,i,n){var o=n._index,a=n.color,s=n.getPickId(r).color,l=n.outlineColor,u=t.floatToByte(a.red),c=t.floatToByte(a.green),d=t.floatToByte(a.blue),h=u*$+c*ee+d;u=t.floatToByte(l.red),c=t.floatToByte(l.green),d=t.floatToByte(l.blue);var p=u*$+c*ee+d;u=t.floatToByte(s.red),c=t.floatToByte(s.green),d=t.floatToByte(s.blue);var f=u*$+c*ee+d,m=t.floatToByte(a.alpha)*$+t.floatToByte(l.alpha)*ee+t.floatToByte(s.alpha);(0,i[K.compressedAttribute0])(o,h,p,f,m)}function R(e,t,r,i){var o=i._index,a=0,s=1,l=1,c=1,d=i.translucencyByDistance;n(d)&&(a=d.near,s=d.nearValue,l=d.far,c=d.farValue,1===s&&1===c||(e._shaderTranslucencyByDistance=!0));var h=i.show&&i.clusterShow;0===i.color.alpha&&0===i.outlineColor.alpha&&(h=!1),s=u.clamp(s,0,1),s=1===s?255:255*s|0;var p=(h?1:0)*ee+s;c=u.clamp(c,0,1),c=1===c?255:255*c|0;var f=c;(0,r[K.compressedAttribute1])(o,p,f,a,l)}function L(e,t,r,i){var o=i._index,a=r[K.scaleByDistance],s=0,l=1,u=1,c=1,d=i.scaleByDistance;n(d)&&(s=d.near,l=d.nearValue,u=d.far,c=d.farValue,1===l&&1===c||(e._shaderScaleByDistance=!0)),a(o,s,l,u,c)}function N(e,t,r,i){var o=i._index,a=r[K.distanceDisplayConditionAndDisableDepth],s=0,l=Number.MAX_VALUE,u=i.distanceDisplayCondition;n(u)&&(s=u.near,l=u.far,s*=s,l*=l,e._shaderDistanceDisplayCondition=!0);var c=i.disableDepthTestDistance;c*=c,c>0&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1)),a(o,s,l,c)}function k(e,t,r,i){O(e,t,r,i),M(e,t,r,i),R(e,t,r,i),L(e,t,r,i),N(e,t,r,i)}function F(t,r,i,o,a,s){var l;o.mode===E.SCENE3D?(l=t._baseVolume,t._boundingVolumeDirty=!0):l=t._baseVolume2D;for(var u=[],c=0;c<i;++c){var d=r[c],h=d.position,p=A._computeActualPosition(h,o,a);n(p)&&(d._setActualPosition(p),s?u.push(p):e.expand(l,p,l))}s&&e.fromPoints(u,l)}function B(e,t){var r=t.mode,i=e._pointPrimitives,n=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==r||r!==E.SCENE3D&&!c.equals(o,e.modelMatrix)?(e._mode=r,c.clone(e.modelMatrix,o),e._createVertexArray=!0,r!==E.SCENE3D&&r!==E.SCENE2D&&r!==E.COLUMBUS_VIEW||F(e,i,i.length,t,o,!0)):r===E.MORPHING?F(e,i,i.length,t,o,!0):r!==E.SCENE2D&&r!==E.COLUMBUS_VIEW||F(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1)}function U(e,t,r){var i=t.camera.getPixelSize(r,t.context.drawingBufferWidth,t.context.drawingBufferHeight),n=i*e._maxPixelSize;r.radius+=n}var V=A.SHOW_INDEX,z=A.POSITION_INDEX,G=A.COLOR_INDEX,H=A.OUTLINE_COLOR_INDEX,W=A.OUTLINE_WIDTH_INDEX,j=A.PIXEL_SIZE_INDEX,q=A.SCALE_BY_DISTANCE_INDEX,Y=A.TRANSLUCENCY_BY_DISTANCE_INDEX,X=A.DISTANCE_DISPLAY_CONDITION_INDEX,Q=A.DISABLE_DEPTH_DISTANCE_INDEX,Z=A.NUMBER_OF_PROPERTIES,K={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};o(x.prototype,{length:{get:function(){return I(this),this._pointPrimitives.length}}}),x.prototype.add=function(e){var t=new A(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(){P(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 I(this),this._pointPrimitives[e]},x.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;i<Z;++i){var n=0===r[i]?p.STATIC_DRAW:p.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var J=new l,$=65536,ee=256,te=[];return x.prototype.update=function(t){I(this),this._maxTotalPointSize=f.maximumAliasedPointSize,B(this,t);var r,i=this._pointPrimitives,o=i.length,a=this._pointPrimitivesToUpdate,s=this._pointPrimitivesToUpdateIndex,l=this._propertiesChanged,u=this._createVertexArray,p=t.context,b=t.passes,A=b.pick;if(u||!A&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var x=0;x<Z;++x)l[x]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),o>0){this._vaf=D(p,o,this._buffersUsage),r=this._vaf.writers;for(var P=0;P<o;++P){var F=this._pointPrimitives[P];F._dirty=!1,k(this,p,r,F)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(s>0){var J=te;J.length=0,(l[z]||l[W]||l[j])&&J.push(O),(l[G]||l[H])&&J.push(M),(l[V]||l[Y])&&J.push(R),l[q]&&J.push(L),(l[X]||l[Q])&&J.push(N);var $=J.length;if(r=this._vaf.writers,s/o>.1){for(var ee=0;ee<s;++ee){var re=a[ee];re._dirty=!1;for(var ie=0;ie<$;++ie)J[ie](this,p,r,re)}this._vaf.commit()}else{for(var ne=0;ne<s;++ne){var oe=a[ne];oe._dirty=!1;for(var ae=0;ae<$;++ae)J[ae](this,p,r,oe);this._vaf.subCommit(oe._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 se,le=c.IDENTITY;t.mode===E.SCENE3D?(le=this.modelMatrix,se=e.clone(this._baseVolumeWC,this._boundingVolume)):se=e.clone(this._baseVolume2D,this._boundingVolume),U(this,t,se);var ue=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,ue&&(this._blendOption===w.OPAQUE||this._blendOption===w.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=_.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===w.TRANSLUCENT||this._blendOption===w.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=_.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!1,blending:T.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==t.minimumDisableDepthTestDistance;var ce,de;(ue||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(ce=new y({sources:[S]}),this._shaderScaleByDistance&&ce.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&ce.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&ce.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&ce.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===w.OPAQUE_AND_TRANSLUCENT&&(de=new y({defines:["OPAQUE"],sources:[C]}),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:K}),de=new y({defines:["TRANSLUCENT"],sources:[C]}),this._spTranslucent=v.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:K})),this._blendOption===w.OPAQUE&&(de=new y({sources:[C]}),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:K})),this._blendOption===w.TRANSLUCENT&&(de=new y({sources:[C]}),this._spTranslucent=v.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:K})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance),(!n(this._spPick)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayConditionPick||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistancePick)&&(ce=new y({defines:["RENDER_FOR_PICK"],sources:[S]}),this._shaderScaleByDistance&&ce.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&ce.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&ce.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&ce.defines.push("DISABLE_DEPTH_DISTANCE"),de=new y({defines:["RENDER_FOR_PICK"],sources:[C]}),this._spPick=v.replaceCache({context:p,shaderProgram:this._spPick,vertexShaderSource:ce,fragmentShaderSource:de,attributeLocations:K}),this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistancePick=this._shaderDisableDepthDistance);var he,pe,fe,me,ge=t.commandList;if(b.render){var _e=this._colorCommands,ve=this._blendOption===w.OPAQUE,ye=this._blendOption===w.OPAQUE_AND_TRANSLUCENT;he=this._vaf.va,pe=he.length,_e.length=pe;var be=ye?2*pe:pe;for(me=0;me<be;++me){var Ce=ve||ye&&me%2==0;fe=_e[me],n(fe)||(fe=_e[me]=new m),fe.primitiveType=d.POINTS,fe.pass=Ce||!ye?g.OPAQUE:g.TRANSLUCENT,fe.owner=this;var Se=ye?Math.floor(me/2):me;fe.boundingVolume=se,fe.modelMatrix=le,fe.shaderProgram=Ce?this._sp:this._spTranslucent,fe.uniformMap=this._uniforms,fe.vertexArray=he[Se].va,fe.renderState=Ce?this._rsOpaque:this._rsTranslucent,fe.debugShowBoundingVolume=this.debugShowBoundingVolume,ge.push(fe)}}if(A){var Te=this._pickCommands;for(he=this._vaf.va,pe=he.length,Te.length=pe,me=0;me<pe;++me)fe=Te[me],n(fe)||(fe=Te[me]=new m({primitiveType:d.POINTS,pass:g.OPAQUE,owner:this})),fe.boundingVolume=se,fe.modelMatrix=le,fe.shaderProgram=this._spPick,fe.uniformMap=this._uniforms,fe.vertexArray=he[me].va,fe.renderState=this._rsOpaque,ge.push(fe)}}},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),P(this._pointPrimitives),a(this)},x}),
define("ThirdParty/kdbush",[],function(){"use strict";function e(e,r,i,n,o){return new t(e,r,i,n,o)}function t(e,t,n,a,s){t=t||r,n=n||i,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 r(e){return e[0]}function i(e){return e[1]}function n(e,t,r,i,n,o,a){for(var s,l,u=[0,e.length-1,0],c=[];u.length;){var d=u.pop(),h=u.pop(),p=u.pop();if(h-p<=a)for(var f=p;f<=h;f++)s=t[2*f],l=t[2*f+1],s>=r&&s<=n&&l>=i&&l<=o&&c.push(e[f]);else{var m=Math.floor((p+h)/2);s=t[2*m],l=t[2*m+1],s>=r&&s<=n&&l>=i&&l<=o&&c.push(e[m]);var g=(d+1)%2;(0===d?r<=s:i<=l)&&(u.push(p),u.push(m-1),u.push(g)),(0===d?n>=s:o>=l)&&(u.push(m+1),u.push(h),u.push(g))}}return c}function o(e,t,r,i,n,s){if(!(n-i<=r)){var l=Math.floor((i+n)/2);a(e,t,l,i,n,s%2),o(e,t,r,i,l-1,s+1),o(e,t,r,l+1,n,s+1)}}function a(e,t,r,i,n,o){for(;n>i;){if(n-i>600){var l=n-i+1,u=r-i+1,c=Math.log(l),d=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*d*(l-d)/l)*(u-l/2<0?-1:1);a(e,t,r,Math.max(i,Math.floor(r-u*d/l+h)),Math.min(n,Math.floor(r+(l-u)*d/l+h)),o)}var p=t[2*r+o],f=i,m=n;for(s(e,t,i,r),t[2*n+o]>p&&s(e,t,i,n);f<m;){for(s(e,t,f,m),f++,m--;t[2*f+o]<p;)f++;for(;t[2*m+o]>p;)m--}t[2*i+o]===p?s(e,t,i,m):(m++,s(e,t,m,n)),m<=r&&(i=m+1),r<=m&&(n=m-1)}}function s(e,t,r,i){l(e,r,i),l(t,2*r,2*i),l(t,2*r+1,2*i+1)}function l(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function u(e,t,r,i,n,o){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),d=a.pop(),h=a.pop();if(d-h<=o)for(var p=h;p<=d;p++)c(t[2*p],t[2*p+1],r,i)<=l&&s.push(e[p]);else{var f=Math.floor((h+d)/2),m=t[2*f],g=t[2*f+1];c(m,g,r,i)<=l&&s.push(e[f]);var _=(u+1)%2;(0===u?r-n<=m:i-n<=g)&&(a.push(h),a.push(f-1),a.push(_)),(0===u?r+n>=m:i+n>=g)&&(a.push(f+1),a.push(d),a.push(_))}}return s}function c(e,t,r,i){var n=e-r,o=t-i;return n*n+o*o}return t.prototype={range:function(e,t,r,i){return n(this.ids,this.coords,e,t,r,i,this.nodeSize)},within:function(e,t,r){return u(this.ids,this.coords,e,t,r,this.nodeSize)}},e}),define("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","../Scene/SceneMode","../ThirdParty/kdbush"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(e){e=i(e,i.EMPTY_OBJECT),this._enabled=i(e.enabled,!1),this._pixelRange=i(e.pixelRange,80),this._minimumClusterSize=i(e.minimumClusterSize,2),this._clusterBillboards=i(e.clusterBillboards,!0),this._clusterLabels=i(e.clusterLabels,!0),this._clusterPoints=i(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 v(e){return e.coord.x}function y(e){return e.coord.y}function b(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}function C(t,r,i,o,a){if(n(t._labelCollection)&&o._clusterLabels?a=d.getScreenSpaceBoundingBox(t,r,a):n(t._billboardCollection)&&o._clusterBillboards?a=u.getScreenSpaceBoundingBox(t,r,a):n(t._pointPrimitiveCollection)&&o._clusterPoints&&(a=p.getScreenSpaceBoundingBox(t,r,a)),b(a,i),o._clusterLabels&&!n(t._labelCollection)&&n(t.id)&&w(o,t.id)&&n(t.id._label)){var s=o._collectionIndicesByEntity[t.id],l=o._labelCollection.get(s),c=d.getScreenSpaceBoundingBox(l,r,O);b(c,i),a=e.union(a,c,a)}return a}function S(e,t){if(e.clusterShow=!0,!n(e._labelCollection)&&n(e.id)&&w(t,e.id)&&n(e.id._label)){var r=t._collectionIndicesByEntity[e.id];t._labelCollection.get(r).clusterShow=!0}}function T(e,t,r,i){var n={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.label.id=r,n.billboard.position=n.label.position=n.point.position=e,i._clusterEvent.raiseEvent(r,n)}function w(e,t){return n(e)&&n(e._collectionIndicesByEntity[t])&&n(e._collectionIndicesByEntity[t].labelIndex)}function A(e,t,r,i,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&&(o._scene.mode!==m.SCENE3D||i.isPointVisible(l.position))){var u=o._clusterLabels&&n(l._labelCollection),c=o._clusterBillboards&&n(l.id._billboard),d=o._clusterPoints&&n(l.id._point);if(!u||!d&&!c){var h=l.computeScreenSpacePosition(r);n(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}}}function E(i){return function(o){if(!(n(o)&&o<.05)&&i.enabled){var s=i._scene,d=i._labelCollection,p=i._billboardCollection,m=i._pointCollection;if((n(d)||n(p)||n(m))&&(i._clusterBillboards||i._clusterLabels||i._clusterPoints)){var _=i._clusterLabelCollection,b=i._clusterBillboardCollection,w=i._clusterPointCollection;n(_)?_.removeAll():_=i._clusterLabelCollection=new h({scene:s}),n(b)?b.removeAll():b=i._clusterBillboardCollection=new c({scene:s}),n(w)?w.removeAll():w=i._clusterPointCollection=new f;var E=i._pixelRange,x=i._minimumClusterSize,P=i._previousClusters,I=[],D=i._previousHeight,O=s.camera.positionCartographic.height,N=s.mapProjection.ellipsoid,k=s.camera.positionWC,F=new a(N,k),B=[];i._clusterLabels&&A(d,B,s,F,i),i._clusterBillboards&&A(p,B,s,F,i),i._clusterPoints&&A(m,B,s,F,i);var U,V,z,G,H,W,j,q,Y,X,Q,Z,K=g(B,v,y,64,Int32Array);if(O<D)for(z=P.length,U=0;U<z;++U){var J=P[U];if(F.isPointVisible(J.position)){var $=u._computeScreenSpacePosition(l.IDENTITY,J.position,r.ZERO,t.ZERO,s);if(n($)){var ee=1-O/D,te=J.width=J.width*ee,re=J.height=J.height*ee;te=Math.max(te,J.minimumWidth),re=Math.max(re,J.minimumHeight);var ie=$.x-.5*te,ne=$.y-.5*re,oe=$.x+te,ae=$.y+re;for(H=K.range(ie,ne,oe,ae),W=H.length,X=0,Y=[],V=0;V<W;++V)j=H[V],q=B[j],q.clustered||(++X,Q=q.collection,Z=q.index,Y.push(Q.get(Z).id));if(X>=x)for(T(J.position,X,Y,i),I.push(J),V=0;V<W;++V)B[H[V]].clustered=!0}}}for(z=B.length,U=0;U<z;++U){var se=B[U];if(!se.clustered){se.clustered=!0,Q=se.collection,Z=se.index;var le=Q.get(Z);G=C(le,se.coord,E,i,M);var ue=e.clone(G,R);H=K.range(G.x,G.y,G.x+G.width,G.y+G.height),W=H.length;var ce=r.clone(le.position);for(X=1,Y=[le.id],V=0;V<W;++V)if(j=H[V],q=B[j],!q.clustered){var de=q.collection.get(q.index),he=C(de,q.coord,E,i,L);r.add(de.position,ce,ce),e.union(ue,he,ue),++X,Y.push(de.id)}if(X>=x){var pe=r.multiplyByScalar(ce,1/X,ce);for(T(pe,X,Y,i),I.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),V=0;V<W;++V)B[H[V]].clustered=!0}else S(le,i)}}0===_.length&&(_.destroy(),i._clusterLabelCollection=void 0),0===b.length&&(b.destroy(),i._clusterBillboardCollection=void 0),0===w.length&&(w.destroy(),i._clusterPointCollection=void 0),i._previousClusters=I,i._previousHeight=O}}}}function x(e,t,r,i){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[i]))return a.get(s[i]);n(a)||(a=this[e]=new t({scene:this._scene}));var l,u,c=this[r];return c.length>0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[i]=l,this._clusterDirty=!0,u}}function P(e,t){var r=e._collectionIndicesByEntity[t];n(r.billboardIndex)||n(r.labelIndex)||n(r.pointIndex)||delete e._collectionIndicesByEntity[t]}function I(e){if(n(e))for(var t=e.length,r=0;r<t;++r)e.get(r).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,I(e._labelCollection),I(e._billboardCollection),I(e._pointCollection))}var O=new e,M=new e,R=new e,L=new e;return _.prototype._initialize=function(e){this._scene=e;var t=E(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",h,"_unusedLabelIndices","labelIndex"),_.prototype.removeLabel=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._labelCollection)&&n(t)&&n(t.labelIndex)){var r=t.labelIndex;t.labelIndex=void 0,P(this,e.id);var i=this._labelCollection.get(r);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(r),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 r=t.billboardIndex;t.billboardIndex=void 0,P(this,e.id);var i=this._billboardCollection.get(r);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(r),this._clusterDirty=!0}},_.prototype.getPoint=x("_pointCollection",f,"_unusedPointIndices","pointIndex"),_.prototype.removePoint=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._pointCollection)&&n(t)&&n(t.pointIndex)){var r=t.pointIndex;t.pointIndex=void 0,P(this,e.id);var i=this._pointCollection.get(r);i.show=!1,i.id=void 0,this._unusedPointIndices.push(r),this._clusterDirty=!0}},_.prototype.update=function(e){var t;n(this._labelCollection)&&this._labelCollection.length>0&&0===this._labelCollection.get(0)._glyphs.length&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),n(this._billboardCollection)&&this._billboardCollection.length>0&&!n(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.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},_}),define("DataSources/CustomDataSource",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./DataSource","./EntityCluster","./EntityCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){this._name=e,this._clock=void 0,this._changed=new i,this._error=new i,this._isLoading=!1,this._loading=new i,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}),define("DataSources/CylinderGeometryUpdater",["../Core/Cartesian3","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_){"use strict";function v(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 y(e,t){g.call(this,{entity:e,scene:t,geometryOptions:new v(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]})}function b(e,t,r){m.call(this,e,t,r)}var C=new e,S=new r;return a(Object.create)&&(y.prototype=Object.create(g.prototype),y.prototype.constructor=y),y.prototype.createFillGeometryInstance=function(e){var t,o,s=this._entity,c=s.isAvailable(e),h=new d(c&&s.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),p=this._distanceDisplayConditionProperty.getValue(e),m=l.fromDistanceDisplayCondition(p);if(this._materialProperty instanceof f){var g;a(this._materialProperty.color)&&(this._materialProperty.color.isConstant||c)&&(g=this._materialProperty.color.getValue(e,S)),a(g)||(g=r.WHITE),o=i.fromColor(g),t={show:h,distanceDisplayCondition:m,color:o}}else t={show:h,distanceDisplayCondition:m};return new u({id:s,geometry:new n(this._options),modelMatrix:s.computeModelMatrix(e),attributes:t})},y.prototype.createOutlineGeometryInstance=function(e){var t=this._entity,n=t.isAvailable(e),a=_.getValueOrDefault(this._outlineColorProperty,e,r.BLACK,S),s=this._distanceDisplayConditionProperty.getValue(e);return new u({id:t,geometry:new o(this._options),modelMatrix:t.computeModelMatrix(e),attributes:{show:new d(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(a),distanceDisplayCondition:l.fromDistanceDisplayCondition(s)}})},y.prototype._isHidden=function(e,t){return!a(e.position)||!a(t.length)||!a(t.topRadius)||!a(t.bottomRadius)||g.prototype._isHidden.call(this,e,t)},y.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&_.isConstant(e.orientation)&&t.length.isConstant&&t.topRadius.isConstant&&t.bottomRadius.isConstant&&_.isConstant(t.slices)&&_.isConstant(t.outlineWidth)&&_.isConstant(t.numberOfVerticalLines))},y.prototype._setStaticOptions=function(e,t){var r=t.slices,i=t.numberOfVerticalLines,n=this._options,o=this._materialProperty instanceof f;n.vertexFormat=o?p.VERTEX_FORMAT:h.MaterialSupport.TEXTURED.vertexFormat,n.length=t.length.getValue(c.MINIMUM_VALUE),n.topRadius=t.topRadius.getValue(c.MINIMUM_VALUE),n.bottomRadius=t.bottomRadius.getValue(c.MINIMUM_VALUE),n.slices=a(r)?r.getValue(c.MINIMUM_VALUE):void 0,n.numberOfVerticalLines=a(i)?i.getValue(c.MINIMUM_VALUE):void 0},y.DynamicGeometryUpdater=b,a(Object.create)&&(b.prototype=Object.create(m.prototype),b.prototype.constructor=b),b.prototype._isHidden=function(e,t,r){var i=this._options,n=_.getValueOrUndefined(e.position,r,C);return!a(n)||!a(i.length)||!a(i.topRadius)||!a(i.bottomRadius)||m.prototype._isHidden.call(this,e,t,r)},b.prototype._setOptions=function(e,t,r){var i=this._options;i.length=_.getValueOrUndefined(t.length,r),i.topRadius=_.getValueOrUndefined(t.topRadius,r),i.bottomRadius=_.getValueOrUndefined(t.bottomRadius,r),i.slices=_.getValueOrUndefined(t.slices,r),i.numberOfVerticalLines=_.getValueOrUndefined(t.numberOfVerticalLines,r)},y}),define("Scene/ColorBlendMode",["../Core/freezeObject","../Core/Math"],function(e,t){"use strict";var r={HIGHLIGHT:0,REPLACE:1,MIX:2};return r.getColorBlend=function(e,i){return e===r.HIGHLIGHT?0:e===r.REPLACE?1:e===r.MIX?t.clamp(i,t.EPSILON4,1):void 0},e(r)}),define("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,r,i,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 i(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 r(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||r(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(i){return r(i)||(i=new e),i.startTime=t(this.startTime,i.startTime),i.stopTime=t(this.stopTime,i.stopTime),i.currentTime=t(this.currentTime,i.currentTime),i.clockRange=t(this.clockRange,i.clockRange),i.multiplier=t(this.multiplier,i.multiplier),i.clockStep=t(this.clockStep,i.clockStep),i},l}),define("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.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=new e(8,8),d=new e(0,0),h=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 i(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,.1),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,c,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,h,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}),define("DataSources/PolylineArrowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o){"use strict";function a(e){this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this.color=e}return r(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(r,i){return t(i)||(i={}),i.color=o.getValueOrClonedDefault(this._color,r,e.WHITE,i.color),i},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),define("DataSources/PolylineDashMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,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._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}var l=e.WHITE,u=e.TRANSPARENT;return i(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._gapColor)&&a.isConstant(this._dashLength)&&a.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),gapColor:o("gapColor"),dashLength:o("dashLength"),dashPattern:o("dashPattern")}),s.prototype.getType=function(e){return"PolylineDash"},s.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.gapColor=a.getValueOrClonedDefault(this._gapColor,e,u,t.gapColor),t.dashLength=a.getValueOrDefault(this._dashLength,e,16,t.dashLength),t.dashPattern=a.getValueOrDefault(this._dashPattern,e,255,t.dashPattern),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._gapColor,e._gapColor)&&a.equals(this._dashLength,e._dashLength)&&a.equals(this._dashPattern,e._dashPattern)},s}),define("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,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;return i(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 r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,.25,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}),define("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,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;return i(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 r(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,1),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}),define("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,r){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(r,a.FIXED),this.setValue(t)}return r(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var r=e.length,i=0;i<r;i++)if(!s.isConstant(e[i]))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,r,i){var n=this._value;if(t(n)){var o=n.length;t(i)||(i=new Array(o));for(var a=0,s=0;a<o;){var l=n[a],u=l.getValueInReferenceFrame(e,r,i[a]);t(u)&&(i[s]=u,s++),a++}return i.length=s,i}},l.prototype.setValue=function(e){var r=this._eventHelper;if(r.removeAll(),t(e)){this._value=e.slice();for(var i=e.length,n=0;n<i;n++){var o=e[n];t(o)&&r.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}),define("DataSources/PropertyArray",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","./Property"],function(e,t,r,i,n,o){"use strict";function a(e){this._value=void 0,this._definitionChanged=new i,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 r=t.length,i=0;i<r;i++)if(!o.isConstant(t[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getValue=function(t,r){var i=this._value;if(e(i)){var n=i.length;e(r)||(r=new Array(n));for(var o=0,a=0;o<n;){var s=this._value[o],l=s.getValue(t,r[o]);e(l)&&(r[a]=l,a++),o++}return r.length=a,r}},a.prototype.setValue=function(t){var r=this._eventHelper;if(r.removeAll(),e(t)){this._value=t.slice();for(var i=t.length,n=0;n<i;n++){var o=t[n];e(o)&&r.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}),define("DataSources/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/RuntimeError","./Property"],function(e,t,r,i,n,o){"use strict";function a(t){var r=!0;if(t._resolveEntity){var i=t._targetCollection.getById(t._targetId);if(e(i)?(i.definitionChanged.addEventListener(l.prototype._onTargetEntityDefinitionChanged,t),t._targetEntity=i,t._resolveEntity=!1):(i=t._targetEntity,r=!1),!e(i))throw new n('target entity "'+t._targetId+'" could not be resolved.')}return r}function s(t){var r=t._targetProperty;if(t._resolveProperty){var i=a(t),o=t._targetPropertyNames;r=t._targetEntity;for(var s=o.length,l=0;l<s&&e(r);l++)r=r[o[l]];if(e(r))t._targetProperty=r,t._resolveProperty=!i;else if(!e(t._targetProperty))throw new n('targetProperty "'+t._targetId+"."+o.join(".")+'" could not be resolved.')}return r}function l(e,t,r){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=r,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new i,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 r,i=[],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?(r=a,n=!1,a=""):n||"."!==u?a+=u:(i.push(a),a="")}return i.push(a),new l(e,r,i)},l.prototype.getValue=function(e,t){return s(this).getValue(e,t)},l.prototype.getValueInReferenceFrame=function(e,t,r){return s(this).getValueInReferenceFrame(e,t,r)},l.prototype.getType=function(e){return s(this).getType(e)},l.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,r=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==r.length)return!1;for(var i=this._targetPropertyNames.length,n=0;n<i;n++)if(t[n]!==r[n])return!1;return!0},l.prototype._onTargetEntityDefinitionChanged=function(e,t,r,i){
this._targetPropertyNames[0]===t&&(this._resolveProperty=!0,this._definitionChanged.raiseEvent(this))},l.prototype._onCollectionChanged=function(t,r,i){var n=this._targetEntity;e(n)&&(-1!==i.indexOf(n)?(n.definitionChanged.removeEventListener(l.prototype._onTargetEntityDefinitionChanged,this),this._resolveEntity=!0,this._resolveProperty=!0):this._resolveEntity&&(s(this),this._resolveEntity||this._definitionChanged.raiseEvent(this)))},l}),define("DataSources/Rotation",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math"],function(e,t,r,i){"use strict";return{packedLength:1,pack:function(t,r,i){return i=e(i,0),r[i]=t,r},unpack:function(t,r,i){return r=e(r,0),t[r]},convertPackedArrayForInterpolation:function(t,r,n,o){r=e(r,0),n=e(n,t.length);for(var a,s=0,l=n-r+1;s<l;s++){var u=t[r+s];0===s||Math.abs(a-u)<Math.PI?o[s]=u:o[s]=u-i.TWO_PI,a=u}},unpackInterpolationResult:function(e,t,r,n,o){return o=e[0],o<0?o+i.TWO_PI:o}}}),define("DataSources/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ExtrapolationType","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,r){var i,n=e.length,o=r.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;i<o;i++)e[t++]=r[i]}function c(e,t){return e instanceof s?e:"string"==typeof e?s.fromIso8601(e):s.addSeconds(t,e,new s)}function d(t,i,n,o,a){for(var l,d,h,p,g,_,v=0;v<o.length;){g=c(o[v],t),h=e(i,g,s.compare);var y=0,b=0;if(h<0){for(h=~h,p=h*a,d=void 0,_=i[h];v<o.length&&(g=c(o[v],t),!(r(d)&&s.compare(d,g)>=0||r(_)&&s.compare(g,_)>=0));){for(f[y++]=g,v+=1,l=0;l<a;l++)m[b++]=o[v],v+=1;d=g}y>0&&(m.length=b,u(n,p,m),f.length=y,u(i,h,f))}else{for(l=0;l<a;l++)v++,n[h*a+l]=o[v];v++}}}function h(e,i){var n=e;n===Number&&(n=p);var s,u=n.packedLength,c=t(n.packedInterpolationLength,u),d=0;if(r(i)){var h=i.length;s=new Array(h);for(var f=0;f<h;f++){var m=i[f];m===Number&&(m=p);var g=m.packedLength;u+=g,c+=t(m.packedInterpolationLength,g),s[f]=m}d=h}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=i,this._innerDerivativeTypes=s,this._inputOrder=d,this._forwardExtrapolationType=a.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=a.NONE,this._backwardExtrapolationDuration=0}var p={packedLength:1,pack:function(e,r,i){i=t(i,0),r[i]=e},unpack:function(e,r,i){return r=t(r,0),e[r]}},f=[],m=[];return i(h.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))}}}),h.prototype.getValue=function(t,i){var n=this._times,o=n.length;if(0!==o){var l,u=this._innerType,c=this._values,d=e(n,t,s.compare);if(d<0){if(0===(d=~d)){var h=n[d];if(l=this._backwardExtrapolationDuration,this._backwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(h,t)>l)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,i)}if(d>=o){d=o-1;var p=n[d];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return d=o-1,u.unpack(c,d*u.packedLength,i)}var f=this._xTable,m=this._yTable,g=this._interpolationAlgorithm,_=this._packedInterpolationLength,v=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(g.getRequiredDataPoints(this._interpolationDegree,v),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,f.length=y,m.length=y*_)}var b=this._numberOfPoints-1;if(b<1)return;var C=0,S=o-1;if(S-C+1>=b+1){var T=d-(b/2|0)-1;T<C&&(T=C);var w=T+b;w>S&&(w=S,(T=w-b)<C&&(T=C)),C=T,S=w}for(var A=S-C+1,E=0;E<A;++E)f[E]=s.secondsDifference(n[C+E],n[S]);if(r(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,C,S,m);else for(var x=0,P=this._packedLength,I=C*P,D=(S+1)*P;I<D;)m[x]=c[I],I++,x++;var O,M=s.secondsDifference(t,n[S]);if(0!==v&&r(g.interpolate)){var R=Math.floor(_/(v+1));O=g.interpolate(M,f,m,R,v,v,this._interpolationResult)}else O=g.interpolateOrderZero(M,f,m,_,this._interpolationResult);return r(u.unpackInterpolationResult)?u.unpackInterpolationResult(O,c,C,S,i):u.unpack(O,0,i)}return u.unpack(c,d*this._packedLength,i)}},h.prototype.setInterpolationOptions=function(e){if(r(e)){var t=!1,i=e.interpolationAlgorithm,n=e.interpolationDegree;r(i)&&this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),r(n)&&this._interpolationDegree!==n&&(this._interpolationDegree=n,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))}},h.prototype.addSample=function(e,t,i){var n=this._innerDerivativeTypes,o=r(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(i[u],s,s.length);d(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.addSamples=function(e,t,i){for(var n=this._innerDerivativeTypes,o=r(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=i[u],h=n.length,p=0;p<h;p++)n[p].pack(c[p],l,l.length);d(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.addSamplesPackedArray=function(e,t){d(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.equals=function(e){if(this===e)return!0;if(!r(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,i=r(t),n=e._derivativeTypes;if(i!==r(n))return!1;var o,a;if(i){if((a=t.length)!==n.length)return!1;for(o=0;o<a;o++)if(t[o]!==n[o])return!1}var l=this._times,u=e._times;if((a=l.length)!==u.length)return!1;for(o=0;o<a;o++)if(!s.equals(l[o],u[o]))return!1;var c=this._values,d=e._values;for(o=0;o<a;o++)if(c[o]!==d[o])return!1;return!0},h._mergeNewSamples=d,h}),define("DataSources/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(r,i){i=t(i,0);var n;if(i>0){n=new Array(i);for(var s=0;s<i;s++)n[s]=e}this._numberOfDerivatives=i,this._property=new u(e,n),this._definitionChanged=new o,this._referenceFrame=t(r,a.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}return i(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,i){if(i=this._property.getValue(e,i),r(i))return s.convertToReferenceFrame(e,i,this._referenceFrame,t,i)},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t,r){this._numberOfDerivatives;this._property.addSample(e,t,r)},c.prototype.addSamples=function(e,t,r){this._property.addSamples(e,t,r)},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}),define("DataSources/StripeOrientation",["../Core/freezeObject"],function(e){"use strict";return e({HORIZONTAL:0,VERTICAL:1})}),define("DataSources/StripeMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,r,i,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,d=e.BLACK;return i(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 r(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,d,t.oddColor),t.offset=a.getValueOrDefault(this._offset,e,0),t.repeat=a.getValueOrDefault(this._repeat,e,1),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}),define("DataSources/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,r,i,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 r(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,r,i){var n=this._intervals.findDataForIntervalContainingDate(e);if(t(n))return s.convertToReferenceFrame(e,n,this._referenceFrame,r,i)},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}),define("DataSources/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o){"use strict";function a(){this._definitionChanged=new i,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,r){var i=this._intervals.findDataForIntervalContainingDate(t);return e(i)&&"function"==typeof i.clone?i.clone(r):i},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}),define("DataSources/VelocityVectorProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,r){this._position=void 0,this._subscription=void 0,this._definitionChanged=new o,this._normalize=t(r,!0),this.position=e}i(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&&(r(t)&&this._subscription(),this._position=e,r(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,d=new a;return l.prototype.getValue=function(e,t){return this._getValue(e,t)},l.prototype._getValue=function(t,i,n){r(i)||(i=new e);var o=this._position;if(s.isConstant(o))return this._normalize?void 0:e.clone(e.ZERO,i);var l=o.getValue(t,u),h=o.getValue(a.addSeconds(t,1/60,d),c);if(r(l)&&(r(h)||(h=l,l=o.getValue(a.addSeconds(t,-1/60,d),c),r(l)))){if(e.equals(l,h))return this._normalize?void 0:e.clone(e.ZERO,i);r(n)&&l.clone(n);var p=e.subtract(h,l,i);return this._normalize?e.normalize(p,i):e.divideByScalar(p,1/60,i)}},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._position,e._position)},l}),define("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,r,i,n,o,a,s,l,u,c){"use strict";function d(e,r){this._velocityVectorProperty=new c(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new o,this.ellipsoid=t(r,n.WGS84);var i=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){i._definitionChanged.raiseEvent(i)})}i(d.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){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var h=new e,p=new e,f=new a;return d.prototype.getValue=function(e,t){var i=this._velocityVectorProperty._getValue(e,p,h);if(r(i))return l.rotationMatrixFromPositionVelocity(h,i,this._ellipsoid,f),s.fromRotationMatrix(f,t)},d.prototype.equals=function(e){return this===e||e instanceof d&&u.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},d}),define("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/deprecationWarning","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Ellipsoid","../Core/Event","../Core/ExtrapolationType","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/Math","../Core/NearFarScalar","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/Resource","../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","./PolylineDashMaterialProperty","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./PropertyArray","./PropertyBag","./RectangleGraphics","./ReferenceProperty","./Rotation","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./VelocityOrientationProperty","./VelocityVectorProperty","./WallGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,_e,ve,ye,be,Ce,Se,Te,we,Ae,Ee,xe,Pe,Ie,De,Oe,Me){"use strict";function Re(){}function Le(e,t){return"#"===t[0]&&(t=Ft+t),Se.fromString(e,t)}function Ne(e,t,i){if(c(i.reference))return Le(t,i.reference);if(c(i.velocityReference)){var n=Le(t,i.velocityReference);switch(e){case r:case Re:return new Oe(n,e===Re);case x:return new De(n)}}throw new O(JSON.stringify(i)+" is not valid CZML.")}function ke(e){var t=e.rgbaf;if(c(t))return t;var r=e.rgba;if(c(r)){var i=r.length;if(i===a.packedLength)return[a.byteToFloat(r[0]),a.byteToFloat(r[1]),a.byteToFloat(r[2]),a.byteToFloat(r[3])];t=new Array(i);for(var n=0;n<i;n+=5)t[n]=r[n],t[n+1]=a.byteToFloat(r[n+1]),t[n+2]=a.byteToFloat(r[n+2]),t[n+3]=a.byteToFloat(r[n+3]),t[n+4]=a.byteToFloat(r[n+4]);return t}}function Fe(e,t){var r=u(e.uri,e);return c(t)?t.getDerivedResource({url:r}):D.createIfNeeded(r)}function Be(e){var t=e.wsen;if(c(t))return t;var r=e.wsenDegrees;if(c(r)){var i=r.length;if(i===P.packedLength)return[A.toRadians(r[0]),A.toRadians(r[1]),A.toRadians(r[2]),A.toRadians(r[3])];t=new Array(i);for(var n=0;n<i;n+=5)t[n]=r[n],t[n+1]=A.toRadians(r[n+1]),t[n+2]=A.toRadians(r[n+2]),t[n+3]=A.toRadians(r[n+3]),t[n+4]=A.toRadians(r[n+4]);return t}}function Ue(e){var t=e.length;if(Ut.magnitude=1,2===t)return Ut.clock=e[0],Ut.cone=e[1],r.fromSpherical(Ut,Bt),[Bt.x,Bt.y,Bt.z];for(var i=new Array(t/3*4),n=0,o=0;n<t;n+=3,o+=4)i[o]=e[n],Ut.clock=e[n+1],Ut.cone=e[n+2],r.fromSpherical(Ut,Bt),i[o+1]=Bt.x,i[o+2]=Bt.y,i[o+3]=Bt.z;return i}function Ve(e){var t=e.length;if(3===t)return Ut.clock=e[0],Ut.cone=e[1],Ut.magnitude=e[2],r.fromSpherical(Ut,Bt),[Bt.x,Bt.y,Bt.z];for(var i=new Array(t),n=0;n<t;n+=4)i[n]=e[n],Ut.clock=e[n+1],Ut.cone=e[n+2],Ut.magnitude=e[n+3],r.fromSpherical(Ut,Bt),i[n+1]=Bt.x,i[n+2]=Bt.y,i[n+3]=Bt.z;return i}function ze(e){var t=e.length;if(3===t)return Vt.longitude=e[0],Vt.latitude=e[1],Vt.height=e[2],m.WGS84.cartographicToCartesian(Vt,Bt),[Bt.x,Bt.y,Bt.z];for(var r=new Array(t),i=0;i<t;i+=4)r[i]=e[i],Vt.longitude=e[i+1],Vt.latitude=e[i+2],Vt.height=e[i+3],m.WGS84.cartographicToCartesian(Vt,Bt),r[i+1]=Bt.x,r[i+2]=Bt.y,r[i+3]=Bt.z;return r}function Ge(e){var t=e.length;if(3===t)return Vt.longitude=A.toRadians(e[0]),Vt.latitude=A.toRadians(e[1]),Vt.height=e[2],m.WGS84.cartographicToCartesian(Vt,Bt),[Bt.x,Bt.y,Bt.z];for(var r=new Array(t),i=0;i<t;i+=4)r[i]=e[i],Vt.longitude=A.toRadians(e[i+1]),Vt.latitude=A.toRadians(e[i+2]),Vt.height=e[i+3],m.WGS84.cartographicToCartesian(Vt,Bt),r[i+1]=Bt.x,r[i+2]=Bt.y,r[i+3]=Bt.z;return r}function He(e){var t=e.cartesian;if(c(t))return t;var r=e.cartesianVelocity;if(c(r))return r;var i=e.unitCartesian;if(c(i))return i;var n=e.unitSpherical;if(c(n))return Ue(n);var o=e.spherical;if(c(o))return Ve(o);var a=e.cartographicRadians;if(c(a))return ze(a);var s=e.cartographicDegrees;if(c(s))return Ge(s);throw new O(JSON.stringify(e)+" is not a valid CZML interval.")}function We(e,t){r.unpack(e,t,Bt),r.normalize(Bt,Bt),r.pack(Bt,e,t)}function je(e){var t=He(e);if(3===t.length)return We(t,0),t;for(var r=1;r<t.length;r+=4)We(t,r);return t}function qe(e,t){x.unpack(e,t,Gt),x.normalize(Gt,Gt),x.pack(Gt,e,t)}function Ye(e){var t=e.unitQuaternion;if(c(t)){if(4===t.length)return qe(t,0),t;for(var r=1;r<t.length;r+=5)qe(t,r)}return t}function Xe(i){return"boolean"==typeof i?Boolean:"number"==typeof i?Number:"string"==typeof i?String:i.hasOwnProperty("array")?Array:i.hasOwnProperty("boolean")?Boolean:i.hasOwnProperty("boundingRectangle")?e:i.hasOwnProperty("cartesian2")?t:i.hasOwnProperty("cartesian")||i.hasOwnProperty("spherical")||i.hasOwnProperty("cartographicRadians")||i.hasOwnProperty("cartographicDegrees")?r:i.hasOwnProperty("unitCartesian")||i.hasOwnProperty("unitSpherical")?Re:i.hasOwnProperty("rgba")||i.hasOwnProperty("rgbaf")?a:i.hasOwnProperty("colorBlendMode")?N:i.hasOwnProperty("cornerType")?s:i.hasOwnProperty("heightReference")?k:i.hasOwnProperty("horizontalOrigin")?F:i.hasOwnProperty("date")?S:i.hasOwnProperty("labelStyle")?B:i.hasOwnProperty("number")?Number:i.hasOwnProperty("nearFarScalar")?E:i.hasOwnProperty("distanceDisplayCondition")?f:i.hasOwnProperty("object")||i.hasOwnProperty("value")?Object:i.hasOwnProperty("unitQuaternion")?x:i.hasOwnProperty("shadowMode")?U:i.hasOwnProperty("string")?String:i.hasOwnProperty("stripeOrientation")?xe:i.hasOwnProperty("wsen")||i.hasOwnProperty("wsenDegrees")?P:i.hasOwnProperty("uri")?z:i.hasOwnProperty("verticalOrigin")?V:Object}function Qe(i,n,o){switch(i){case Array:return n.array;case Boolean:return u(n.boolean,n);case e:return n.boundingRectangle;case t:return n.cartesian2;case r:return He(n);case Re:return je(n);case a:return ke(n);case N:return N[u(n.colorBlendMode,n)];case s:return s[u(n.cornerType,n)];case k:return k[u(n.heightReference,n)];case F:return F[u(n.horizontalOrigin,n)];case Image:return Fe(n,o);case S:return S.fromIso8601(u(n.date,n));case B:return B[u(n.labelStyle,n)];case Number:return u(n.number,n);case E:return n.nearFarScalar;case f:return n.distanceDisplayCondition;case Object:return u(u(n.object,n.value),n);case x:return Ye(n);case Te:return u(n.number,n);case U:return U[u(u(n.shadowMode,n.shadows),n)];case String:return u(n.string,n);case xe:return xe[u(n.stripeOrientation,n)];case P:return Be(n);case z:return Fe(n,o);case V:return V[u(n.verticalOrigin,n)];default:throw new O(i)}}function Ze(e,t){var r=e.interpolationAlgorithm;(c(r)||c(e.interpolationDegree))&&t.setInterpolationOptions({interpolationAlgorithm:Ht[r],interpolationDegree:e.interpolationDegree});var i=e.forwardExtrapolationType;c(i)&&(t.forwardExtrapolationType=_[i]);var n=e.forwardExtrapolationDuration;c(n)&&(t.forwardExtrapolationDuration=n);var o=e.backwardExtrapolationType;c(o)&&(t.backwardExtrapolationType=_[o]);var a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}function Ke(e,t,r,i,n,o,a){var s,l=i.interval;c(l)?(Wt.iso8601=l,s=R.fromIso8601(Wt),c(n)&&(s=R.intersect(s,n,zt))):c(n)&&(s=n);var d,h,p,f,m=!c(i.reference)&&!c(i.velocityReference),g=c(s)&&!s.equals(C.MAXIMUM_INTERVAL);m&&(p=Qe(e,i,o),d=u(e.packedLength,1),f=u(p.length,1),h=!c(i.array)&&"string"!=typeof p&&f>d&&e!==Object);var _="function"==typeof e.unpack&&e!==Te;if(!h&&!g)return void(t[r]=m?new Z(_?e.unpack(p,0):p):Ne(e,a,i));var v,y=t[r],b=i.epoch;if(c(b)&&(v=S.fromIso8601(b)),h&&!g)return y instanceof Ae||(y=new Ae(e),t[r]=y),y.addSamplesPackedArray(p,v),void Ze(i,y);var T;if(!h&&g)return s=s.clone(),s.data=m?_?e.unpack(p,0):p:Ne(e,a,i),c(y)||(y=m?new Ie:new X,t[r]=y),void(m&&y instanceof Ie?y.intervals.addInterval(s):y instanceof X?(m&&(s.data=new Z(s.data)),y.intervals.addInterval(s)):(T=C.MAXIMUM_INTERVAL.clone(),T.data=y,y=new X,t[r]=y,y.intervals.addInterval(T),m&&(s.data=new Z(s.data)),y.intervals.addInterval(s)));c(y)||(y=new X,t[r]=y),y instanceof X||(T=C.MAXIMUM_INTERVAL.clone(),T.data=y,y=new X,t[r]=y,y.intervals.addInterval(T));var w=y.intervals;T=w.findInterval(s),c(T)&&T.data instanceof Ae||(T=s.clone(),T.data=new Ae(e),w.addInterval(T)),T.data.addSamplesPackedArray(p,v),Ze(i,T.data)}function Je(e,t,r,i,n,o,a){if(c(i))if(b(i))for(var s=0,l=i.length;s<l;s++)Ke(e,t,r,i[s],n,o,a);else Ke(e,t,r,i,n,o,a)}function $e(e,t,i,n,o,a){var s,l=i.interval;c(l)?(Wt.iso8601=l,s=R.fromIso8601(Wt),c(n)&&(s=R.intersect(s,n,zt))):c(n)&&(s=n);var d,h,p,f=!1,m=c(i.cartesianVelocity)?1:0,g=r.packedLength*(m+1),_=!c(i.reference),v=c(s)&&!s.equals(C.MAXIMUM_INTERVAL);if(_&&(c(i.referenceFrame)&&(d=I[i.referenceFrame]),d=u(d,I.FIXED),h=He(i),p=u(h.length,1),f=p>g),!f&&!v)return void(e[t]=_?new Q(r.unpack(h),d):Le(a,i.reference));var y,b=e[t],T=i.epoch;if(c(T)&&(y=S.fromIso8601(T)),f&&!v)return b instanceof we&&(!c(d)||b.referenceFrame===d)||(b=new we(d,m),e[t]=b),b.addSamplesPackedArray(h,y),void Ze(i,b);var w;if(!f&&v)return s=s.clone(),s.data=_?r.unpack(h):Le(a,i.reference),c(b)||(b=_?new Pe(d):new Y(d),e[t]=b),void(_&&b instanceof Pe&&c(d)&&b.referenceFrame===d?b.intervals.addInterval(s):b instanceof Y?(_&&(s.data=new Q(s.data,d)),b.intervals.addInterval(s)):(w=C.MAXIMUM_INTERVAL.clone(),w.data=b,b=new Y(b.referenceFrame),e[t]=b,b.intervals.addInterval(w),_&&(s.data=new Q(s.data,d)),b.intervals.addInterval(s)));c(b)?b instanceof Y||(w=C.MAXIMUM_INTERVAL.clone(),w.data=b,b=new Y(b.referenceFrame),e[t]=b,b.intervals.addInterval(w)):(b=new Y(d),e[t]=b);var A=b.intervals;w=A.findInterval(s),c(w)&&w.data instanceof we&&(!c(d)||w.data.referenceFrame===d)||(w=s.clone(),w.data=new we(d,m),A.addInterval(w)),w.data.addSamplesPackedArray(h,y),Ze(i,w.data)}function et(e,t,r,i,n,o){if(c(r))if(b(r))for(var a=0,s=r.length;a<s;a++)$e(e,t,r[a],i,n,o);else $e(e,t,r,i,n,o)}function tt(e,r,i,n,o,s){var l,u=i.interval;c(u)?(Wt.iso8601=u,l=R.fromIso8601(Wt),c(n)&&(l=R.intersect(l,n,zt))):c(n)&&(l=n);var d,h,p=e[r];if(c(l)){p instanceof q||(p=new q,e[r]=p);var f=p.intervals;h=f.findInterval({start:l.start,stop:l.stop}),c(h)?d=h.data:(h=l.clone(),f.addInterval(h))}else d=p;var m;c(i.solidColor)?(d instanceof j||(d=new j),m=i.solidColor,Je(a,d,"color",m.color,void 0,void 0,s)):c(i.grid)?(d instanceof oe||(d=new oe),m=i.grid,Je(a,d,"color",m.color,void 0,o,s),Je(Number,d,"cellAlpha",m.cellAlpha,void 0,o,s),Je(t,d,"lineCount",m.lineCount,void 0,o,s),Je(t,d,"lineThickness",m.lineThickness,void 0,o,s),Je(t,d,"lineOffset",m.lineOffset,void 0,o,s)):c(i.image)?(d instanceof ae||(d=new ae),m=i.image,Je(Image,d,"image",m.image,void 0,o,s),Je(t,d,"repeat",m.repeat,void 0,o,s),Je(a,d,"color",m.color,void 0,o,s),Je(Boolean,d,"transparent",m.transparent,void 0,o,s)):c(i.stripe)?(d instanceof Ee||(d=new Ee),m=i.stripe,Je(xe,d,"orientation",m.orientation,void 0,o,s),Je(a,d,"evenColor",m.evenColor,void 0,o,s),Je(a,d,"oddColor",m.oddColor,void 0,o,s),Je(Number,d,"offset",m.offset,void 0,o,s),Je(Number,d,"repeat",m.repeat,void 0,o,s)):c(i.polylineOutline)?(d instanceof _e||(d=new _e),m=i.polylineOutline,Je(a,d,"color",m.color,void 0,o,s),Je(a,d,"outlineColor",m.outlineColor,void 0,o,s),Je(Number,d,"outlineWidth",m.outlineWidth,void 0,o,s)):c(i.polylineGlow)?(d instanceof me||(d=new me),m=i.polylineGlow,Je(a,d,"color",m.color,void 0,o,s),Je(Number,d,"glowPower",m.glowPower,void 0,o,s)):c(i.polylineArrow)?(d instanceof pe||(d=new pe),m=i.polylineArrow,Je(a,d,"color",m.color,void 0,void 0,s)):c(i.polylineDash)&&(d instanceof fe||(d=new fe),m=i.polylineDash,Je(a,d,"color",m.color,void 0,void 0,s),Je(a,d,"gapColor",m.gapColor,void 0,void 0,s),Je(Number,d,"dashLength",m.dashLength,void 0,o,s),Je(Number,d,"dashPattern",m.dashPattern,void 0,o,s)),c(h)?h.data=d:e[r]=d}function rt(e,t,r,i,n,o){if(c(r))if(b(r))for(var a=0,s=r.length;a<s;a++)tt(e,t,r[a],i,n,o);else tt(e,t,r,i,n,o)}function it(e,t,r,i){e.name=u(t.name,e.name)}function nt(e,t,r,i){var n=t.description;c(n)&&Je(String,e,"description",n,void 0,i,r)}function ot(e,t,r,i){var n=t.position;c(n)&&et(e,"position",n,void 0,i,r)}function at(e,t,i,n){var o=t.viewFrom;c(o)&&Je(r,e,"viewFrom",o,void 0,n,i)}function st(e,t,r,i){var n=t.orientation;c(n)&&Je(x,e,"orientation",n,void 0,i,r)}function lt(e,t,r,i){var n=t.properties;if(c(n)){c(e.properties)||(e.properties=new be);for(var o in n)if(n.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);var a=n[o];if(b(a))for(var s=0,l=a.length;s<l;s++)Ke(Xe(a[s]),e.properties,o,a[s],void 0,i,r);else Ke(Xe(a),e.properties,o,a,void 0,i,r)}}}function ut(e,t,r,i){var n=r.references;if(c(n)){var o=n.map(function(e){return Le(i,e)}),a=r.interval;if(c(a)){if(a=R.fromIso8601(a),!(e[t]instanceof Y)){a.data=new ye(o);var s=new X;s.intervals.addInterval(a),e[t]=s}}else e[t]=new ye(o)}else Je(Array,e,t,r,void 0,void 0,i)}function ct(e,t,r,i){if(c(r))if(b(r))for(var n=0,o=r.length;n<o;++n)ut(e,t,r[n],i);else ut(e,t,r,i)}function dt(e,t,i,n){if(c(i.references)){var o=i.references.map(function(e){return Le(n,e)}),a=i.interval;if(c(a)){if(a=R.fromIso8601(a),!(e[t]instanceof Y)){a.data=new ve(o);var s=new Y;s.intervals.addInterval(a),e[t]=s}}else e[t]=new ve(o)}else c(i.cartesian)?i.array=r.unpackArray(i.cartesian):c(i.cartographicRadians)?i.array=r.fromRadiansArrayHeights(i.cartographicRadians):c(i.cartographicDegrees)&&(i.array=r.fromDegreesArrayHeights(i.cartographicDegrees)),c(i.array)&&Je(Array,e,t,i,void 0,void 0,n)}function ht(e,t,r,i){if(c(r))if(b(r))for(var n=0,o=r.length;n<o;n++)dt(e,t,r[n],i);else dt(e,t,r,i)}function pt(e,t,r,i){var n,o=t.availability;if(c(o)){var a;if(b(o))for(var s=o.length,l=0;l<s;l++)c(a)||(a=new L),Wt.iso8601=o[l],n=R.fromIso8601(Wt),a.addInterval(n);else Wt.iso8601=o,n=R.fromIso8601(Wt),a=new L,a.addInterval(n);e.availability=a}}
function ft(e,t,r,i,n){c(t)&&Je(Re,e,"alignedAxis",t,r,i,n)}function mt(i,n,o,s){var l=n.billboard;if(c(l)){var u,d=l.interval;c(d)&&(Wt.iso8601=d,u=R.fromIso8601(Wt));var h=i.billboard;c(h)||(i.billboard=h=new H),Je(Boolean,h,"show",l.show,u,s,o),Je(Image,h,"image",l.image,u,s,o),Je(Number,h,"scale",l.scale,u,s,o),Je(t,h,"pixelOffset",l.pixelOffset,u,s,o),Je(r,h,"eyeOffset",l.eyeOffset,u,s,o),Je(F,h,"horizontalOrigin",l.horizontalOrigin,u,s,o),Je(V,h,"verticalOrigin",l.verticalOrigin,u,s,o),Je(k,h,"heightReference",l.heightReference,u,s,o),Je(a,h,"color",l.color,u,s,o),Je(Te,h,"rotation",l.rotation,u,s,o),ft(h,l.alignedAxis,u,s,o),Je(Boolean,h,"sizeInMeters",l.sizeInMeters,u,s,o),Je(Number,h,"width",l.width,u,s,o),Je(Number,h,"height",l.height,u,s,o),Je(E,h,"scaleByDistance",l.scaleByDistance,u,s,o),Je(E,h,"translucencyByDistance",l.translucencyByDistance,u,s,o),Je(E,h,"pixelOffsetScaleByDistance",l.pixelOffsetScaleByDistance,u,s,o),Je(e,h,"imageSubRegion",l.imageSubRegion,u,s,o),Je(f,h,"distanceDisplayCondition",l.distanceDisplayCondition,u,s,o),Je(Number,h,"disableDepthTestDistance",l.disableDepthTestDistance,u,s,o)}}function gt(e,t,i,n){var o=t.box;if(c(o)){var s,l=o.interval;c(l)&&(Wt.iso8601=l,s=R.fromIso8601(Wt));var u=e.box;c(u)||(e.box=u=new W),Je(Boolean,u,"show",o.show,s,n,i),Je(r,u,"dimensions",o.dimensions,s,n,i),Je(Boolean,u,"fill",o.fill,s,n,i),rt(u,"material",o.material,s,n,i),Je(Boolean,u,"outline",o.outline,s,n,i),Je(a,u,"outlineColor",o.outlineColor,s,n,i),Je(Number,u,"outlineWidth",o.outlineWidth,s,n,i),Je(U,u,"shadows",o.shadows,s,n,i),Je(f,u,"distanceDisplayCondition",o.distanceDisplayCondition,s,n,i)}}function _t(e,t,r,i){var n=t.corridor;if(c(n)){var o,l=n.interval;c(l)&&(Wt.iso8601=l,o=R.fromIso8601(Wt));var u=e.corridor;c(u)||(e.corridor=u=new K),Je(Boolean,u,"show",n.show,o,i,r),ht(u,"positions",n.positions,r),Je(Number,u,"width",n.width,o,i,r),Je(Number,u,"height",n.height,o,i,r),Je(Number,u,"extrudedHeight",n.extrudedHeight,o,i,r),Je(s,u,"cornerType",n.cornerType,o,i,r),Je(Number,u,"granularity",n.granularity,o,i,r),Je(Boolean,u,"fill",n.fill,o,i,r),rt(u,"material",n.material,o,i,r),Je(Boolean,u,"outline",n.outline,o,i,r),Je(a,u,"outlineColor",n.outlineColor,o,i,r),Je(Number,u,"outlineWidth",n.outlineWidth,o,i,r),Je(U,u,"shadows",n.shadows,o,i,r),Je(f,u,"distanceDisplayCondition",n.distanceDisplayCondition,o,i,r)}}function vt(e,t,r,i){var n=t.cylinder;if(c(n)){var o,s=n.interval;c(s)&&(Wt.iso8601=s,o=R.fromIso8601(Wt));var l=e.cylinder;c(l)||(e.cylinder=l=new J),Je(Boolean,l,"show",n.show,o,i,r),Je(Number,l,"length",n.length,o,i,r),Je(Number,l,"topRadius",n.topRadius,o,i,r),Je(Number,l,"bottomRadius",n.bottomRadius,o,i,r),Je(Boolean,l,"fill",n.fill,o,i,r),rt(l,"material",n.material,o,i,r),Je(Boolean,l,"outline",n.outline,o,i,r),Je(a,l,"outlineColor",n.outlineColor,o,i,r),Je(Number,l,"outlineWidth",n.outlineWidth,o,i,r),Je(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,i,r),Je(Number,l,"slices",n.slices,o,i,r),Je(U,l,"shadows",n.shadows,o,i,r),Je(f,l,"distanceDisplayCondition",n.distanceDisplayCondition,o,i,r)}}function yt(e,t){var r=e.version;if(c(r)&&"string"==typeof r){var i=r.split(".");if(2===i.length){if("1"!==i[0])throw new O("Cesium only supports CZML version 1.");t._version=r}}if(!c(t._version))throw new O("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 bt(e,t,r,i){var n=t.ellipse;if(c(n)){var o,s=n.interval;c(s)&&(Wt.iso8601=s,o=R.fromIso8601(Wt));var l=e.ellipse;c(l)||(e.ellipse=l=new te),Je(Boolean,l,"show",n.show,o,i,r),Je(Number,l,"semiMajorAxis",n.semiMajorAxis,o,i,r),Je(Number,l,"semiMinorAxis",n.semiMinorAxis,o,i,r),Je(Number,l,"height",n.height,o,i,r),Je(Number,l,"extrudedHeight",n.extrudedHeight,o,i,r),Je(Te,l,"rotation",n.rotation,o,i,r),Je(Te,l,"stRotation",n.stRotation,o,i,r),Je(Number,l,"granularity",n.granularity,o,i,r),Je(Boolean,l,"fill",n.fill,o,i,r),rt(l,"material",n.material,o,i,r),Je(Boolean,l,"outline",n.outline,o,i,r),Je(a,l,"outlineColor",n.outlineColor,o,i,r),Je(Number,l,"outlineWidth",n.outlineWidth,o,i,r),Je(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,i,r),Je(U,l,"shadows",n.shadows,o,i,r),Je(f,l,"distanceDisplayCondition",n.distanceDisplayCondition,o,i,r)}}function Ct(e,t,i,n){var o=t.ellipsoid;if(c(o)){var s,l=o.interval;c(l)&&(Wt.iso8601=l,s=R.fromIso8601(Wt));var u=e.ellipsoid;c(u)||(e.ellipsoid=u=new re),Je(Boolean,u,"show",o.show,s,n,i),Je(r,u,"radii",o.radii,s,n,i),Je(Boolean,u,"fill",o.fill,s,n,i),rt(u,"material",o.material,s,n,i),Je(Boolean,u,"outline",o.outline,s,n,i),Je(a,u,"outlineColor",o.outlineColor,s,n,i),Je(Number,u,"outlineWidth",o.outlineWidth,s,n,i),Je(Number,u,"stackPartitions",o.stackPartitions,s,n,i),Je(Number,u,"slicePartitions",o.slicePartitions,s,n,i),Je(Number,u,"subdivisions",o.subdivisions,s,n,i),Je(U,u,"shadows",o.shadows,s,n,i),Je(f,u,"distanceDisplayCondition",o.distanceDisplayCondition,s,n,i)}}function St(e,i,n,o){var s=i.label;if(c(s)){var l,u=s.interval;c(u)&&(Wt.iso8601=u,l=R.fromIso8601(Wt));var d=e.label;c(d)||(e.label=d=new se),Je(Boolean,d,"show",s.show,l,o,n),Je(String,d,"text",s.text,l,o,n),Je(String,d,"font",s.font,l,o,n),Je(B,d,"style",s.style,l,o,n),Je(Number,d,"scale",s.scale,l,o,n),Je(Boolean,d,"showBackground",s.showBackground,l,o,n),Je(a,d,"backgroundColor",s.backgroundColor,l,o,n),Je(t,d,"backgroundPadding",s.backgroundPadding,l,o,n),Je(t,d,"pixelOffset",s.pixelOffset,l,o,n),Je(r,d,"eyeOffset",s.eyeOffset,l,o,n),Je(F,d,"horizontalOrigin",s.horizontalOrigin,l,o,n),Je(V,d,"verticalOrigin",s.verticalOrigin,l,o,n),Je(k,d,"heightReference",s.heightReference,l,o,n),Je(a,d,"fillColor",s.fillColor,l,o,n),Je(a,d,"outlineColor",s.outlineColor,l,o,n),Je(Number,d,"outlineWidth",s.outlineWidth,l,o,n),Je(E,d,"translucencyByDistance",s.translucencyByDistance,l,o,n),Je(E,d,"pixelOffsetScaleByDistance",s.pixelOffsetScaleByDistance,l,o,n),Je(E,d,"scaleByDistance",s.scaleByDistance,l,o,n),Je(f,d,"distanceDisplayCondition",s.distanceDisplayCondition,l,o,n),Je(Number,d,"disableDepthTestDistance",s.disableDepthTestDistance,l,o,n)}}function Tt(e,t,r,i){var n=t.model;if(c(n)){var o,s=n.interval;c(s)&&(Wt.iso8601=s,o=R.fromIso8601(Wt));var l=e.model;c(l)||(e.model=l=new le),Je(Boolean,l,"show",n.show,o,i,r),Je(z,l,"uri",n.gltf,o,i,r),Je(Number,l,"scale",n.scale,o,i,r),Je(Number,l,"minimumPixelSize",n.minimumPixelSize,o,i,r),Je(Number,l,"maximumScale",n.maximumScale,o,i,r),Je(Boolean,l,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,i,r),Je(Boolean,l,"runAnimations",n.runAnimations,o,i,r),Je(Boolean,l,"clampAnimations",n.clampAnimations,o,i,r),Je(U,l,"shadows",n.shadows,o,i,r),Je(k,l,"heightReference",n.heightReference,o,i,r),Je(a,l,"silhouetteColor",n.silhouetteColor,o,i,r),Je(Number,l,"silhouetteSize",n.silhouetteSize,o,i,r),Je(a,l,"color",n.color,o,i,r),Je(N,l,"colorBlendMode",n.colorBlendMode,o,i,r),Je(Number,l,"colorBlendAmount",n.colorBlendAmount,o,i,r),Je(f,l,"distanceDisplayCondition",n.distanceDisplayCondition,o,i,r);var u=n.nodeTransformations;if(c(u))if(b(u))for(var d=0,h=u.length;d<h;d++)wt(l,u[d],o,i,r);else wt(l,u,o,i,r)}}function wt(e,t,i,n,o){var a,s=t.interval;c(s)?(Wt.iso8601=s,a=R.fromIso8601(Wt),c(i)&&(a=R.intersect(a,i,zt))):c(i)&&(a=i);for(var l=e.nodeTransformations,u=Object.keys(t),d=0,h=u.length;d<h;++d){var p=u[d];if("interval"!==p){var f=t[p];if(c(f)){c(l)||(e.nodeTransformations=l=new be),l.hasProperty(p)||l.addProperty(p);var m=l[p];c(m)||(l[p]=m=new ue),Je(r,m,"translation",f.translation,a,n,o),Je(x,m,"rotation",f.rotation,a,n,o),Je(r,m,"scale",f.scale,a,n,o)}}}}function At(e,t,r,i){var n=t.path;if(c(n)){var o,a=n.interval;c(a)&&(Wt.iso8601=a,o=R.fromIso8601(Wt));var s=e.path;c(s)||(e.path=s=new ce),Je(Boolean,s,"show",n.show,o,i,r),Je(Number,s,"width",n.width,o,i,r),Je(Number,s,"resolution",n.resolution,o,i,r),Je(Number,s,"leadTime",n.leadTime,o,i,r),Je(Number,s,"trailTime",n.trailTime,o,i,r),rt(s,"material",n.material,o,i,r),Je(f,s,"distanceDisplayCondition",n.distanceDisplayCondition,o,i,r)}}function Et(e,t,r,i){var n=t.point;if(c(n)){var o,s=n.interval;c(s)&&(Wt.iso8601=s,o=R.fromIso8601(Wt));var l=e.point;c(l)||(e.point=l=new de),Je(Boolean,l,"show",n.show,o,i,r),Je(Number,l,"pixelSize",n.pixelSize,o,i,r),Je(k,l,"heightReference",n.heightReference,o,i,r),Je(a,l,"color",n.color,o,i,r),Je(a,l,"outlineColor",n.outlineColor,o,i,r),Je(Number,l,"outlineWidth",n.outlineWidth,o,i,r),Je(E,l,"scaleByDistance",n.scaleByDistance,o,i,r),Je(E,l,"translucencyByDistance",n.translucencyByDistance,o,i,r),Je(f,l,"distanceDisplayCondition",n.distanceDisplayCondition,o,i,r),Je(Number,l,"disableDepthTestDistance",n.disableDepthTestDistance,o,i,r)}}function xt(e,t,r,i){var n=t.polygon;if(c(n)){var o,s=n.interval;c(s)&&(Wt.iso8601=s,o=R.fromIso8601(Wt));var l=e.polygon;c(l)||(e.polygon=l=new he),Je(Boolean,l,"show",n.show,o,i,r),ht(l,"hierarchy",n.positions,r),Je(Number,l,"height",n.height,o,i,r),Je(Number,l,"extrudedHeight",n.extrudedHeight,o,i,r),Je(Te,l,"stRotation",n.stRotation,o,i,r),Je(Number,l,"granularity",n.granularity,o,i,r),Je(Boolean,l,"fill",n.fill,o,i,r),rt(l,"material",n.material,o,i,r),Je(Boolean,l,"outline",n.outline,o,i,r),Je(a,l,"outlineColor",n.outlineColor,o,i,r),Je(Number,l,"outlineWidth",n.outlineWidth,o,i,r),Je(Boolean,l,"perPositionHeight",n.perPositionHeight,o,i,r),Je(Boolean,l,"closeTop",n.closeTop,o,i,r),Je(Boolean,l,"closeBottom",n.closeBottom,o,i,r),Je(U,l,"shadows",n.shadows,o,i,r),Je(f,l,"distanceDisplayCondition",n.distanceDisplayCondition,o,i,r)}}function Pt(e,t,r,i){var n=t.polyline;if(c(n)){var o,a=n.interval;c(a)&&(Wt.iso8601=a,o=R.fromIso8601(Wt));var s=e.polyline;c(s)||(e.polyline=s=new ge),Je(Boolean,s,"show",n.show,o,i,r),ht(s,"positions",n.positions,r),Je(Number,s,"width",n.width,o,i,r),Je(Number,s,"granularity",n.granularity,o,i,r),rt(s,"material",n.material,o,i,r),rt(s,"depthFailMaterial",n.depthFailMaterial,o,i,r),Je(Boolean,s,"followSurface",n.followSurface,o,i,r),Je(U,s,"shadows",n.shadows,o,i,r),Je(f,s,"distanceDisplayCondition",n.distanceDisplayCondition,o,i,r)}}function It(e,t,r,i){var n=t.rectangle;if(c(n)){var o,s=n.interval;c(s)&&(Wt.iso8601=s,o=R.fromIso8601(Wt));var l=e.rectangle;c(l)||(e.rectangle=l=new Ce),Je(Boolean,l,"show",n.show,o,i,r),Je(P,l,"coordinates",n.coordinates,o,i,r),Je(Number,l,"height",n.height,o,i,r),Je(Number,l,"extrudedHeight",n.extrudedHeight,o,i,r),Je(Te,l,"rotation",n.rotation,o,i,r),Je(Te,l,"stRotation",n.stRotation,o,i,r),Je(Number,l,"granularity",n.granularity,o,i,r),Je(Boolean,l,"fill",n.fill,o,i,r),rt(l,"material",n.material,o,i,r),Je(Boolean,l,"outline",n.outline,o,i,r),Je(a,l,"outlineColor",n.outlineColor,o,i,r),Je(Number,l,"outlineWidth",n.outlineWidth,o,i,r),Je(U,l,"shadows",n.shadows,o,i,r),Je(f,l,"distanceDisplayCondition",n.distanceDisplayCondition,o,i,r)}}function Dt(e,t,r,i){var n=t.wall;if(c(n)){var o,s=n.interval;c(s)&&(Wt.iso8601=s,o=R.fromIso8601(Wt));var l=e.wall;c(l)||(e.wall=l=new Me),Je(Boolean,l,"show",n.show,o,i,r),ht(l,"positions",n.positions,r),ct(l,"minimumHeights",n.minimumHeights,r),ct(l,"maximumHeights",n.maximumHeights,r),Je(Number,l,"granularity",n.granularity,o,i,r),Je(Boolean,l,"fill",n.fill,o,i,r),rt(l,"material",n.material,o,i,r),Je(Boolean,l,"outline",n.outline,o,i,r),Je(a,l,"outlineColor",n.outlineColor,o,i,r),Je(Number,l,"outlineWidth",n.outlineWidth,o,i,r),Je(U,l,"shadows",n.shadows,o,i,r),Je(f,l,"distanceDisplayCondition",n.distanceDisplayCondition,o,i,r)}}function Ot(e,t,r,i,n){var o=e.id;if(c(o)||(o=l()),Ft=o,!c(n._version)&&"document"!==o)throw new O("The first CZML packet is required to be the document object.");if(!0===e.delete)t.removeById(o);else if("document"===o)yt(e,n);else{var a=t.getOrCreateEntity(o),s=e.parent;c(s)&&(a.parent=t.getOrCreateEntity(s));for(var u=r.length-1;u>-1;u--)r[u](a,e,t,i)}Ft=void 0}function Mt(e){var t,r=e._documentPacket.clock;if(!c(r)){if(!c(e._clock)){var i=e._entityCollection.computeAvailability();if(!i.start.equals(C.MINIMUM_VALUE)){var a=i.start,s=i.stop,l=S.secondsDifference(s,a),d=Math.round(l/120);return t=new ee,t.startTime=S.clone(a),t.stopTime=S.clone(s),t.clockRange=n.LOOP_STOP,t.multiplier=d,t.currentTime=S.clone(a),t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(c(e._clock)?t=e._clock.clone():(t=new ee,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(r.interval)){Wt.iso8601=r.interval;var h=R.fromIso8601(Wt);t.startTime=h.start,t.stopTime=h.stop}return c(r.currentTime)&&(t.currentTime=S.fromIso8601(r.currentTime)),c(r.range)&&(t.clockRange=u(n[r.range],n.LOOP_STOP)),c(r.step)&&(t.clockStep=u(o[r.step],o.SYSTEM_CLOCK_MULTIPLIER)),c(r.multiplier)&&(t.multiplier=r.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function Rt(e,t,r,i){r=u(r,u.EMPTY_OBJECT),c(r.query)&&h("CzmlDataSource.query","The options.query parameter has been deprecated. Specify czml or options.sourceUri as a Resource instance and add query parameters there.");var n=t,o=r.sourceUri,a=r.query;return("string"==typeof t||t instanceof D)&&(t=D.createIfNeeded(t,{queryParameters:a}),n=t.fetchJson(),o=u(o,t.clone())),o=D.createIfNeeded(o,{queryParameters:a}),$.setLoading(e,!0),G(n,function(t){return Lt(e,t,o,i)}).otherwise(function(t){return $.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),G.reject(t)})}function Lt(e,t,r,i){$.setLoading(e,!0);var n=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Nt,n.removeAll()),kt._processCzml(t,n,r,void 0,e);var o=Mt(e),a=e._documentPacket;return c(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!c(e._name)&&c(r)&&(e._name=v(r.getUrlComponent()),o=!0),$.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function Nt(){this.name=void 0,this.clock=void 0}function kt(e){this._name=e,this._changed=new g,this._error=new g,this._isLoading=!1,this._loading=new g,this._clock=void 0,this._documentPacket=new Nt,this._version=void 0,this._entityCollection=new ne(this),this._entityCluster=new ie}Re.packedLength=r.packedLength,Re.unpack=r.unpack,Re.pack=r.pack;var Ft,Bt=new r,Ut=new M,Vt=new i,zt=new R,Gt=new x,Ht={HERMITE:y,LAGRANGE:T,LINEAR:w},Wt={iso8601:void 0};return kt.load=function(e,t){return(new kt).load(e,t)},d(kt.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}}}),kt.updaters=[mt,gt,_t,vt,bt,Ct,St,Tt,it,nt,At,Et,xt,Pt,lt,It,ot,at,Dt,st,pt],kt.prototype.process=function(e,t){return Rt(this,e,t,!1)},kt.prototype.load=function(e,t){return Rt(this,e,t,!0)},kt.processPacketData=Je,kt.processPositionPacketData=et,kt.processMaterialPacketData=rt,kt._processCzml=function(e,t,r,i,n){if(i=c(i)?i:kt.updaters,b(e))for(var o=0,a=e.length;o<a;o++)Ot(e[o],t,i,r,n);else Ot(e,t,i,r,n)},kt}),define("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../ThirdParty/when"],function(e,t,r,i,n,o,a){"use strict";function s(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o}return r(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,r=this._dataSources;return a(e,function(e){return r===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},s.prototype.remove=function(t,r){r=e(r,!1);var i=this._dataSources.indexOf(t);return-1!==i&&(this._dataSources.splice(i,1),this._dataSourceRemoved.raiseEvent(this,t),r&&"function"==typeof t.destroy&&t.destroy(),!0)},s.prototype.removeAll=function(t){t=e(t,!1);for(var r=this._dataSources,i=0,n=r.length;i<n;++i){var o=r[i];this._dataSourceRemoved.raiseEvent(this,o),t&&"function"==typeof o.destroy&&o.destroy()}this._dataSources=[]},s.prototype.contains=function(e){return-1!==this.indexOf(e)},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),i(this)},s}),define("DataSources/DynamicGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r){this._primitives=t,this._groundPrimitives=r,this._dynamicUpdaters=new e}return h.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._groundPrimitives))},h.prototype.remove=function(e){var t=e.id,r=this._dynamicUpdaters.get(t);i(r)&&(this._dynamicUpdaters.remove(t),r.destroy())},h.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,r=0,i=t.length;r<i;r++)t[r].update(e);return!0},h.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,r=e.length;t<r;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},h.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),i(e)&&i(e.getBoundingSphere)?e.getBoundingSphere(t):l.FAILED},h}),define("DataSources/EllipseGeometryUpdater",["../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_){"use strict";function v(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 y(e,t){g.call(this,{entity:e,scene:t,geometryOptions:new v(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]})}function b(e,t,r){m.call(this,e,t,r)}var C=new t;return i(Object.create)&&(y.prototype=Object.create(g.prototype),y.prototype.constructor=y),y.prototype.createFillGeometryInstance=function(e){var n,s,u=this._entity,d=u.isAvailable(e),h=new c(d&&u.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),p=this._distanceDisplayConditionProperty.getValue(e),m=o.fromDistanceDisplayCondition(p);if(this._materialProperty instanceof f){var g;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||d)&&(g=this._materialProperty.color.getValue(e,C)),i(g)||(g=t.WHITE),s=r.fromColor(g),n={show:h,distanceDisplayCondition:m,color:s}}else n={show:h,distanceDisplayCondition:m};return new l({id:u,geometry:new a(this._options),attributes:n})},y.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,n=i.isAvailable(e),a=_.getValueOrDefault(this._outlineColorProperty,e,t.BLACK,C),u=this._distanceDisplayConditionProperty.getValue(e);return new l({id:i,geometry:new s(this._options),attributes:{show:new c(n&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(a),distanceDisplayCondition:o.fromDistanceDisplayCondition(u)}})},y.prototype._isHidden=function(e,t){var r=e.position;return!i(r)||!i(t.semiMajorAxis)||!i(t.semiMinorAxis)||g.prototype._isHidden.call(this,e,t)},y.prototype._isOnTerrain=function(e,t){var r=this._materialProperty instanceof f;return this._fillEnabled&&!i(t.height)&&!i(t.extrudedHeight)&&r&&d.isSupported(this._scene)},y.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!_.isConstant(t.rotation)||!_.isConstant(t.height)||!_.isConstant(t.extrudedHeight)||!_.isConstant(t.granularity)||!_.isConstant(t.stRotation)||!_.isConstant(t.outlineWidth)||!_.isConstant(t.numberOfVerticalLines)||this._onTerrain&&!_.isConstant(this._materialProperty)},y.prototype._getIsClosed=function(e){var t=e.height,r=e.extrudedHeight;return 0===t||i(r)&&r!==t},y.prototype._setStaticOptions=function(e,t){var r=t.rotation,n=t.height,o=t.extrudedHeight,a=t.granularity,s=t.stRotation,l=t.numberOfVerticalLines,c=this._materialProperty instanceof f,d=this._options;d.vertexFormat=c?p.VERTEX_FORMAT:h.MaterialSupport.TEXTURED.vertexFormat,d.center=e.position.getValue(u.MINIMUM_VALUE,d.center),d.semiMajorAxis=t.semiMajorAxis.getValue(u.MINIMUM_VALUE,d.semiMajorAxis),d.semiMinorAxis=t.semiMinorAxis.getValue(u.MINIMUM_VALUE,d.semiMinorAxis),d.rotation=i(r)?r.getValue(u.MINIMUM_VALUE):void 0,d.height=i(n)?n.getValue(u.MINIMUM_VALUE):void 0,d.extrudedHeight=i(o)?o.getValue(u.MINIMUM_VALUE):void 0,d.granularity=i(a)?a.getValue(u.MINIMUM_VALUE):void 0,d.stRotation=i(s)?s.getValue(u.MINIMUM_VALUE):void 0,d.numberOfVerticalLines=i(l)?l.getValue(u.MINIMUM_VALUE):void 0},y.DynamicGeometryUpdater=b,i(Object.create)&&(b.prototype=Object.create(m.prototype),b.prototype.constructor=b),b.prototype._isHidden=function(e,t,r){var n=this._options;return!i(n.center)||!i(n.semiMajorAxis)||!i(n.semiMinorAxis)||m.prototype._isHidden.call(this,e,t,r)},b.prototype._setOptions=function(e,t,r){var i=this._options;i.center=_.getValueOrUndefined(e.position,r,i.center),i.semiMajorAxis=_.getValueOrUndefined(t.semiMajorAxis,r),i.semiMinorAxis=_.getValueOrUndefined(t.semiMinorAxis,r),i.rotation=_.getValueOrUndefined(t.rotation,r),i.height=_.getValueOrUndefined(t.height,r),i.extrudedHeight=_.getValueOrUndefined(t.extrudedHeight,r),i.granularity=_.getValueOrUndefined(t.granularity,r),i.stRotation=_.getValueOrUndefined(t.stRotation,r),i.numberOfVerticalLines=_.getValueOrUndefined(t.numberOfVerticalLines,r)},y}),define("DataSources/EllipsoidGeometryUpdater",["../Core/Check","../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S){"use strict";function T(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 w(e,t){b.call(this,{entity:e,scene:t,geometryOptions:new T(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._isClosed=!0}function A(e,t,r){y.call(this,e,t,r),this._scene=e._scene,this._modelMatrix=new h,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,this._material={}}var E=new v(r.WHITE),x=new t,P=new r,I=new t(1,1,1);return o(Object.create)&&(w.prototype=Object.create(b.prototype),w.prototype.constructor=w),w.prototype.createFillGeometryInstance=function(e,t,n){var a,u,d=this._entity,h=d.isAvailable(e),f=new p(h&&d.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),m=this._distanceDisplayConditionProperty.getValue(e),g=s.fromDistanceDisplayCondition(m);if(this._materialProperty instanceof v){var _;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||h)&&(_=this._materialProperty.color.getValue(e,P)),o(_)||(_=r.WHITE),u=i.fromColor(_),a={show:f,distanceDisplayCondition:g,color:u}}else a={show:f,distanceDisplayCondition:g};return new c({id:d,geometry:new l(this._options),modelMatrix:t?void 0:d.computeModelMatrix(e,n),attributes:a})},w.prototype.createOutlineGeometryInstance=function(e,t,n){var o=this._entity,a=o.isAvailable(e),l=S.getValueOrDefault(this._outlineColorProperty,e,r.BLACK,P),d=this._distanceDisplayConditionProperty.getValue(e);return new c({id:o,geometry:new u(this._options),modelMatrix:t?void 0:o.computeModelMatrix(e,n),attributes:{show:new p(a&&o.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(l),distanceDisplayCondition:s.fromDistanceDisplayCondition(d)}})},w.prototype._isHidden=function(e,t){return!o(e.position)||!o(t.radii)||b.prototype._isHidden.call(this,e,t)},w.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&S.isConstant(e.orientation)&&t.radii.isConstant&&S.isConstant(t.stackPartitions)&&S.isConstant(t.slicePartitions)&&S.isConstant(t.outlineWidth)&&S.isConstant(t.subdivisions))},w.prototype._setStaticOptions=function(e,t){var r=t.stackPartitions,i=t.slicePartitions,n=t.subdivisions,a=this._materialProperty instanceof v,s=this._options;s.vertexFormat=a?m.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat,s.radii=t.radii.getValue(d.MINIMUM_VALUE,s.radii),s.stackPartitions=o(r)?r.getValue(d.MINIMUM_VALUE):void 0,s.slicePartitions=o(i)?i.getValue(d.MINIMUM_VALUE):void 0,s.subdivisions=o(n)?n.getValue(d.MINIMUM_VALUE):void 0},w.DynamicGeometryUpdater=A,o(Object.create)&&(A.prototype=Object.create(y.prototype),A.prototype.constructor=A),A.prototype.update=function(e){var t=this._entity,l=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!S.getValueOrDefault(l.show,e,!0))return o(this._primitive)&&(this._primitive.show=!1),void(o(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var u=S.getValueOrUndefined(l.radii,e,x),c=t.computeModelMatrix(e,this._modelMatrix);if(!o(c)||!o(u))return o(this._primitive)&&(this._primitive.show=!1),void(o(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var d=S.getValueOrDefault(l.fill,e,!0),v=S.getValueOrDefault(l.outline,e,!1),y=S.getValueOrClonedDefault(l.outlineColor,e,r.BLACK,P),b=C.getValue(e,n(l.material,E),this._material),T=S.getValueOrUndefined(l.stackPartitions,e),w=S.getValueOrUndefined(l.slicePartitions,e),A=S.getValueOrUndefined(l.subdivisions,e),D=S.getValueOrDefault(l.outlineWidth,e,1),O=this._scene.mode,M=O===_.SCENE3D,R=this._options,L=this._geometryUpdater.shadowsProperty.getValue(e),N=this._geometryUpdater.distanceDisplayConditionProperty,k=N.getValue(e);if(M&&this._lastSceneMode===O&&o(this._primitive)&&R.stackPartitions===T&&R.slicePartitions===w&&R.subdivisions===A&&this._lastOutlineWidth===D){if(this._primitive.ready){var F=this._primitive,B=this._outlinePrimitive;F.show=!0,B.show=!0,F.appearance.material=b;var U=this._attributes;o(U)||(U=F.getGeometryInstanceAttributes(t),this._attributes=U),d!==this._lastShow&&(U.show=p.toValue(d,U.show),this._lastShow=d);var V=this._outlineAttributes;o(V)||(V=B.getGeometryInstanceAttributes(t),this._outlineAttributes=V),v!==this._lastOutlineShow&&(V.show=p.toValue(v,V.show),this._lastOutlineShow=v),r.equals(y,this._lastOutlineColor)||(V.color=i.toValue(y,V.color),r.clone(y,this._lastOutlineColor)),a.equals(k,this._lastDistanceDisplayCondition)||(U.distanceDisplayCondition=s.toValue(k,U.distanceDisplayCondition),V.distanceDisplayCondition=s.toValue(k,V.distanceDisplayCondition),a.clone(k,this._lastDistanceDisplayCondition))}}else{var z=this._primitives;z.removeAndDestroy(this._primitive),z.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=O,this._lastOutlineWidth=D,R.stackPartitions=T,R.slicePartitions=w,R.subdivisions=A,R.radii=M?I:u;var G=new f({material:b,translucent:b.isTranslucent(),closed:!0});R.vertexFormat=G.vertexFormat;var H=this._geometryUpdater.createFillGeometryInstance(e,M,this._modelMatrix);this._primitive=z.add(new g({geometryInstances:H,appearance:G,asynchronous:!1,shadows:L}));var W=this._geometryUpdater.createOutlineGeometryInstance(e,M,this._modelMatrix);this._outlinePrimitive=z.add(new g({geometryInstances:W,appearance:new m({flat:!0,translucent:255!==W.attributes.color.value[3],renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(D)}}),asynchronous:!1,shadows:L})),this._lastShow=d,this._lastOutlineShow=v,this._lastOutlineColor=r.clone(y,this._lastOutlineColor),this._lastDistanceDisplayCondition=k}M&&(u.x=Math.max(u.x,.001),u.y=Math.max(u.y,.001),u.z=Math.max(u.z,.001),c=h.multiplyByScale(c,u,c),this._primitive.modelMatrix=c,this._outlinePrimitive.modelMatrix=c)},w}),define("DataSources/PlaneGeometryUpdater",["../Core/PlaneGeometry","../Core/PlaneOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Core/Quaternion","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b){"use strict";function C(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function S(e,t){y.call(this,{entity:e,scene:t,geometryOptions:new C(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]})}function T(e,t,r){v.call(this,e,t,r)}function w(e,t,n,o){var a,l;s(e)?(a=e.normal,l=e.distance):(a=i.clone(i.UNIT_X,I),l=0),s(t)||(t=new r(1,1));var u=i.multiplyByScalar(a,-l,P);u=h.multiplyByPoint(n,u,u);var c=h.multiplyByPointAsVector(n,a,I);i.normalize(c,c);var d=A(c,i.UNIT_Z),p=r.clone(t,D);return p.z=1,h.fromTranslationQuaternionRotationScale(u,d,p,o)}function A(e,t){var r=i.angleBetween(e,t);if(0===r)return f.clone(f.IDENTITY,M);var n=i.cross(t,e,O);return f.fromAxisAngle(n,r,M)}var E=new i,x=new o;s(Object.create)&&(S.prototype=Object.create(y.prototype),S.prototype.constructor=S),S.prototype.createFillGeometryInstance=function(t){var r,i,n=this._entity,l=n.isAvailable(t),d=new p(l&&n.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t)),h=this._distanceDisplayConditionProperty.getValue(t),f=u.fromDistanceDisplayCondition(h);if(this._materialProperty instanceof _){var m;s(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(m=this._materialProperty.color.getValue(t,x)),s(m)||(m=o.WHITE),i=a.fromColor(m),r={show:d,distanceDisplayCondition:f,color:i}}else r={show:d,distanceDisplayCondition:f}
;var g=n.plane,v=this._options,y=n.computeModelMatrix(t),C=b.getValueOrDefault(g.plane,t,v.plane),S=b.getValueOrUndefined(g.dimensions,t,v.dimensions);return v.plane=C,v.dimensions=S,y=w(C,S,y,y),new c({id:n,geometry:new e(this._options),modelMatrix:y,attributes:r})},S.prototype.createOutlineGeometryInstance=function(e){var r=this._entity,i=r.isAvailable(e),n=b.getValueOrDefault(this._outlineColorProperty,e,o.BLACK,x),s=this._distanceDisplayConditionProperty.getValue(e),l=r.plane,d=this._options,h=r.computeModelMatrix(e),f=b.getValueOrDefault(l.plane,e,d.plane),m=b.getValueOrUndefined(l.dimensions,e,d.dimensions);return d.plane=f,d.dimensions=m,h=w(f,m,h,h),new c({id:r,geometry:new t,modelMatrix:h,attributes:{show:new p(i&&r.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:a.fromColor(n),distanceDisplayCondition:u.fromDistanceDisplayCondition(s)}})},S.prototype._isHidden=function(e,t){return!s(t.plane)||!s(t.dimensions)||!s(e.position)||y.prototype._isHidden.call(this,e,t)},S.prototype._getIsClosed=function(e){return!1},S.prototype._isDynamic=function(e,t){return!(e.position.isConstant&&b.isConstant(e.orientation)&&t.plane.isConstant&&t.dimensions.isConstant&&b.isConstant(t.outlineWidth))},S.prototype._setStaticOptions=function(e,t){var r=this._materialProperty instanceof _,i=this._options;i.vertexFormat=r?g.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(d.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(d.MINIMUM_VALUE,i.dimensions)},S.DynamicGeometryUpdater=T,s(Object.create)&&(T.prototype=Object.create(v.prototype),T.prototype.constructor=T),T.prototype._isHidden=function(e,t,r){var i=this._options,n=b.getValueOrUndefined(e.position,r,E);return!s(n)||!s(i.plane)||!s(i.dimensions)||v.prototype._isHidden.call(this,e,t,r)},T.prototype._setOptions=function(e,t,r){var i=this._options;i.plane=b.getValueOrDefault(t.plane,r,i.plane),i.dimensions=b.getValueOrUndefined(t.dimensions,r,i.dimensions)};var P=new i,I=new i,D=new i,O=new i,M=new f;return S}),define("DataSources/PolygonGeometryUpdater",["../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y){"use strict";function b(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 C(e,t){v.call(this,{entity:e,scene:t,geometryOptions:new b(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]})}function S(e,t,r){_.call(this,e,t,r)}var T=new t;return i(Object.create)&&(C.prototype=Object.create(v.prototype),C.prototype.constructor=C),C.prototype.createFillGeometryInstance=function(e){var n,s,l=this._entity,c=l.isAvailable(e),d=new h(c&&l.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),p=this._distanceDisplayConditionProperty.getValue(e),f=o.fromDistanceDisplayCondition(p);if(this._materialProperty instanceof g){var m;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||c)&&(m=this._materialProperty.color.getValue(e,T)),i(m)||(m=t.WHITE),s=r.fromColor(m),n={show:d,distanceDisplayCondition:f,color:s}}else n={show:d,distanceDisplayCondition:f};return new a({id:l,geometry:new u(this._options),attributes:n})},C.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,n=i.isAvailable(e),s=y.getValueOrDefault(this._outlineColorProperty,e,t.BLACK,T),l=this._distanceDisplayConditionProperty.getValue(e);return new a({id:i,geometry:new d(this._options),attributes:{show:new h(n&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(s),distanceDisplayCondition:o.fromDistanceDisplayCondition(l)}})},C.prototype._isHidden=function(e,t){return!i(t.hierarchy)||v.prototype._isHidden.call(this,e,t)},C.prototype._isOnTerrain=function(e,t){var r=this._materialProperty instanceof g,n=t.perPositionHeight,o=i(n)&&(!n.isConstant||n.getValue(l.MINIMUM_VALUE));return this._fillEnabled&&!i(t.height)&&!i(t.extrudedHeight)&&r&&!o&&p.isSupported(this._scene)},C.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!y.isConstant(t.height)||!y.isConstant(t.extrudedHeight)||!y.isConstant(t.granularity)||!y.isConstant(t.stRotation)||!y.isConstant(t.outlineWidth)||!y.isConstant(t.perPositionHeight)||!y.isConstant(t.closeTop)||!y.isConstant(t.closeBottom)||this._onTerrain&&!y.isConstant(this._materialProperty)},C.prototype._setStaticOptions=function(e,t){var r=this._materialProperty instanceof g,n=this._options;n.vertexFormat=r?m.VERTEX_FORMAT:f.MaterialSupport.TEXTURED.vertexFormat;var o=t.hierarchy.getValue(l.MINIMUM_VALUE);s(o)&&(o=new c(o));var a=y.getValueOrUndefined(t.height,l.MINIMUM_VALUE),u=y.getValueOrDefault(t.closeTop,l.MINIMUM_VALUE,!0),d=y.getValueOrDefault(t.closeBottom,l.MINIMUM_VALUE,!0),h=y.getValueOrUndefined(t.extrudedHeight,l.MINIMUM_VALUE),p=y.getValueOrUndefined(t.perPositionHeight,l.MINIMUM_VALUE);!i(h)||i(a)||i(p)||(a=0),n.polygonHierarchy=o,n.height=a,n.extrudedHeight=h,n.granularity=y.getValueOrUndefined(t.granularity,l.MINIMUM_VALUE),n.stRotation=y.getValueOrUndefined(t.stRotation,l.MINIMUM_VALUE),n.perPositionHeight=p,n.closeTop=u,n.closeBottom=d},C.prototype._getIsClosed=function(e){var t=e.height,r=e.extrudedHeight,n=i(r)&&r!==t;return!e.perPositionHeight&&(!n&&0===t||n&&e.closeTop&&e.closeBottom)},C.DynamicGeometryUpdater=S,i(Object.create)&&(S.prototype=Object.create(_.prototype),S.prototype.constructor=S),S.prototype._isHidden=function(e,t,r){return!i(this._options.polygonHierarchy)||_.prototype._isHidden.call(this,e,t,r)},S.prototype._setOptions=function(e,t,r){var i=this._options,n=y.getValueOrUndefined(t.hierarchy,r);s(n)?i.polygonHierarchy=new c(n):i.polygonHierarchy=n,i.height=y.getValueOrUndefined(t.height,r),i.extrudedHeight=y.getValueOrUndefined(t.extrudedHeight,r),i.granularity=y.getValueOrUndefined(t.granularity,r),i.stRotation=y.getValueOrUndefined(t.stRotation,r),i.perPositionHeight=y.getValueOrUndefined(t.perPositionHeight,r),i.closeTop=y.getValueOrDefault(t.closeTop,r,!0),i.closeBottom=y.getValueOrDefault(t.closeBottom,r,!0)},C}),define("DataSources/PolylineVolumeGeometryUpdater",["../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(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 v(e,t){m.call(this,{entity:e,scene:t,geometryOptions:new _(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]})}function y(e,t,r){f.call(this,e,t,r)}var b=new t;return i(Object.create)&&(v.prototype=Object.create(m.prototype),v.prototype.constructor=v),v.prototype.createFillGeometryInstance=function(e){var n,s,u=this._entity,d=u.isAvailable(e),h=new c(d&&u.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),f=this._distanceDisplayConditionProperty.getValue(e),m=o.fromDistanceDisplayCondition(f);if(this._materialProperty instanceof p){var g;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||d)&&(g=this._materialProperty.color.getValue(e,b)),i(g)||(g=t.WHITE),s=r.fromColor(g),n={show:h,distanceDisplayCondition:m,color:s}}else n={show:h,distanceDisplayCondition:m};return new a({id:u,geometry:new l(this._options),attributes:n})},v.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,n=i.isAvailable(e),s=g.getValueOrDefault(this._outlineColorProperty,e,t.BLACK,b),l=this._distanceDisplayConditionProperty.getValue(e);return new a({id:i,geometry:new u(this._options),attributes:{show:new c(n&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(s),distanceDisplayCondition:o.fromDistanceDisplayCondition(l)}})},v.prototype._isHidden=function(e,t){return!i(t.positions)||!i(t.shape)||m.prototype._isHidden.call(this,e,t)},v.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&t.shape.isConstant&&g.isConstant(t.granularity)&&g.isConstant(t.outlineWidth)&&g.isConstant(t.cornerType))},v.prototype._setStaticOptions=function(e,t){var r=t.granularity,n=t.cornerType,o=this._options,a=this._materialProperty instanceof p;o.vertexFormat=a?h.VERTEX_FORMAT:d.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(s.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(s.MINIMUM_VALUE,o.shape),o.granularity=i(r)?r.getValue(s.MINIMUM_VALUE):void 0,o.cornerType=i(n)?n.getValue(s.MINIMUM_VALUE):void 0},v.DynamicGeometryUpdater=y,i(Object.create)&&(y.prototype=Object.create(f.prototype),y.prototype.constructor=y),y.prototype._isHidden=function(e,t,r){var n=this._options;return!i(n.polylinePositions)||!i(n.shapePositions)||f.prototype._isHidden.call(this,e,t,r)},y.prototype._setOptions=function(e,t,r){var i=this._options;i.polylinePositions=g.getValueOrUndefined(t.positions,r,i.polylinePositions),i.shapePositions=g.getValueOrUndefined(t.shape,r),i.granularity=g.getValueOrUndefined(t.granularity,r),i.cornerType=g.getValueOrUndefined(t.cornerType,r)},v}),define("DataSources/RectangleGeometryUpdater",["../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/Iso8601","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_){"use strict";function v(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function y(e,t){g.call(this,{entity:e,scene:t,geometryOptions:new v(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]})}function b(e,t,r){m.call(this,e,t,r)}var C=new t;return i(Object.create)&&(y.prototype=Object.create(g.prototype),y.prototype.constructor=y),y.prototype.createFillGeometryInstance=function(e){var n,s,u=this._entity,d=u.isAvailable(e),h=new c(d&&u.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),p=this._distanceDisplayConditionProperty.getValue(e),m=o.fromDistanceDisplayCondition(p);if(this._materialProperty instanceof f){var g;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||d)&&(g=this._materialProperty.color.getValue(e,C)),i(g)||(g=t.WHITE),s=r.fromColor(g),n={show:h,distanceDisplayCondition:m,color:s}}else n={show:h,distanceDisplayCondition:m};return new a({id:u,geometry:new l(this._options),attributes:n})},y.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,n=i.isAvailable(e),s=_.getValueOrDefault(this._outlineColorProperty,e,t.BLACK,C),l=this._distanceDisplayConditionProperty.getValue(e);return new a({id:i,geometry:new u(this._options),attributes:{show:new c(n&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(s),distanceDisplayCondition:o.fromDistanceDisplayCondition(l)}})},y.prototype._isHidden=function(e,t){return!i(t.coordinates)||g.prototype._isHidden.call(this,e,t)},y.prototype._isOnTerrain=function(e,t){var r=this._materialProperty instanceof f;return this._fillEnabled&&!i(t.height)&&!i(t.extrudedHeight)&&r&&d.isSupported(this._scene)},y.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!_.isConstant(t.height)||!_.isConstant(t.extrudedHeight)||!_.isConstant(t.granularity)||!_.isConstant(t.stRotation)||!_.isConstant(t.rotation)||!_.isConstant(t.outlineWidth)||this._onTerrain&&!_.isConstant(this._materialProperty)},y.prototype._setStaticOptions=function(e,t){var r=this._materialProperty instanceof f,n=t.height,o=t.extrudedHeight,a=t.granularity,l=t.stRotation,u=t.rotation,c=this._options;c.vertexFormat=r?p.VERTEX_FORMAT:h.MaterialSupport.TEXTURED.vertexFormat,c.rectangle=t.coordinates.getValue(s.MINIMUM_VALUE,c.rectangle),c.height=i(n)?n.getValue(s.MINIMUM_VALUE):void 0,c.extrudedHeight=i(o)?o.getValue(s.MINIMUM_VALUE):void 0,c.granularity=i(a)?a.getValue(s.MINIMUM_VALUE):void 0,c.stRotation=i(l)?l.getValue(s.MINIMUM_VALUE):void 0,c.rotation=i(u)?u.getValue(s.MINIMUM_VALUE):void 0},y.prototype._getIsClosed=function(e){var t=e.height,r=e.extrudedHeight;return 0===t||i(r)&&r!==t},y.DynamicGeometryUpdater=b,i(Object.create)&&(b.prototype=Object.create(m.prototype),b.prototype.constructor=b),b.prototype._isHidden=function(e,t,r){return!i(this._options.rectangle)||m.prototype._isHidden.call(this,e,t,r)},b.prototype._setOptions=function(e,t,r){var i=this._options;i.rectangle=_.getValueOrUndefined(t.coordinates,r,i.rectangle),i.height=_.getValueOrUndefined(t.height,r),i.extrudedHeight=_.getValueOrUndefined(t.extrudedHeight,r),i.granularity=_.getValueOrUndefined(t.granularity,r),i.stRotation=_.getValueOrUndefined(t.stRotation,r),i.rotation=_.getValueOrUndefined(t.rotation,r)},y}),define("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r,n,o,a,s,l){this.translucent=r,this.appearanceType=n,this.depthFailAppearanceType=o,this.depthFailMaterialProperty=a,this.depthFailMaterial=void 0,this.closed=s,this.shadows=l,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=[],this.invalidated=!1;var u;i(a)&&(u=a.definitionChanged.addEventListener(h.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=u}function p(e,t,r,i,n){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=r,this._closed=i,this._shadows=n}function f(e,t){for(var r=e.length,i=r-1;i>=0;i--){var n=e[i];if(n.remove(t)&&0===n.updaters.length)return e.splice(i,1),n.destroy(),!0}return!1}function m(e,t,r){for(var i=!1,n=t.length,o=0;o<n;++o){var a=t[o],s=a.itemsToRemove,l=s.length;if(l>0)for(o=0;o<l;o++){var u=s[o];a.remove(u),e.add(r,u),i=!0}}return i}function g(e,t,r,i){var n,o=t.length;for(n=o-1;n>=0;n--){var a=t[n];if(a.invalidated){t.splice(n,1);for(var s=a.updaters.values,l=s.length,u=0;u<l;u++)e.add(r,s[u]);a.destroy()}}for(o=t.length,n=0;n<o;++n)i=t[n].update(r)&&i;return i}function _(e,t,r){for(var i=e.length,n=0;n<i;n++){var o=e[n];if(o.contains(t))return o.getBoundingSphere(t,r)}return l.FAILED}function v(e){for(var t=e.length,r=0;r<t;r++)e[r].destroy();e.length=0}var y=new t,b=new n;return h.prototype.onMaterialChanged=function(){this.invalidated=!0},h.prototype.isMaterial=function(e){var t=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;return r===t||!!i(t)&&t.equals(r)},h.prototype.add=function(e,t){var r=e.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&d.isConstant(e.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r,n,o){"isShowing"===r&&i.showsUpdated.set(e.id,e)}))}else this.updatersWithAttributes.set(r,e)},h.prototype.remove=function(e){var t=e.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))}},h.prototype.update=function(e){var l,h,p=!0,f=0,m=this.primitive,g=this.primitives;if(this.createPrimitive){var _=this.geometry.values,v=_.length;if(v>0){for(i(m)&&(i(this.oldPrimitive)?g.remove(m):this.oldPrimitive=m),h=0;h<v;h++){var C=_[h],S=C.attributes;l=this.attributes.get(C.id.id),i(l)&&(i(S.show)&&(S.show.value=l.show),i(S.color)&&(S.color.value=l.color),i(S.depthFailColor)&&(S.depthFailColor.value=l.depthFailColor))}var T;i(this.depthFailAppearanceType)&&(i(this.depthFailMaterialProperty)&&(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),T=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),m=new s({asynchronous:!0,geometryInstances:_,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:T,shadows:this.shadows}),g.add(m),p=!1}else{i(m)&&(g.remove(m),m=void 0);var w=this.oldPrimitive;i(w)&&(g.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(i(m)&&m.ready){i(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0),!i(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof u||(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var A=this.updatersWithAttributes.values,E=A.length,x=this.waitingOnCreate;for(h=0;h<E;h++){var P=A[h],I=this.geometry.get(P.id);if(l=this.attributes.get(I.id.id),i(l)||(l=m.getGeometryInstanceAttributes(I.id),this.attributes.set(I.id.id,l)),!P.fillMaterialProperty.isConstant||x){var D=P.fillMaterialProperty.color,O=D.getValue(e,y);t.equals(l._lastColor,O)||(l._lastColor=t.clone(O,l._lastColor),l.color=r.toValue(O,l.color),(this.translucent&&255===l.color[3]||!this.translucent&&255!==l.color[3])&&(this.itemsToRemove[f++]=P))}if(i(this.depthFailAppearanceType)&&P.depthFailMaterialProperty instanceof u&&(!P.depthFailMaterialProperty.isConstant||x)){var M=P.depthFailMaterialProperty.color,R=M.getValue(e,y);t.equals(l._lastDepthFailColor,R)||(l._lastDepthFailColor=t.clone(R,l._lastDepthFailColor),l.depthFailColor=r.toValue(R,l.depthFailColor))}var L=P.entity.isShowing&&(P.hasConstantFill||P.isFilled(e)),N=1===l.show[0];L!==N&&(l.show=a.toValue(L,l.show));var k=P.distanceDisplayConditionProperty;if(!d.isConstant(k)){var F=k.getValue(e,b);n.equals(F,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=n.clone(F,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=o.toValue(F,l.distanceDisplayCondition))}}this.updateShows(m),this.waitingOnCreate=!1}else i(m)&&!m.ready&&(p=!1);return this.itemsToRemove.length=f,p},h.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var o=t[n],s=this.geometry.get(o.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing;u!==(1===l.show[0])&&(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 r=this.primitive;if(!r.ready)return l.PENDING;var n=r.getGeometryInstanceAttributes(e.entity);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?l.FAILED:(n.boundingSphere.clone(t),l.DONE)},h.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)},h.prototype.destroy=function(){var e=this.primitive,t=this.primitives;i(e)&&t.remove(e);var r=this.oldPrimitive;i(r)&&t.remove(r),i(this.removeMaterialSubscription)&&this.removeMaterialSubscription()},p.prototype.add=function(e,t){var r,i,n=t.createFillGeometryInstance(e);255===n.attributes.color.value[3]?(r=this._solidItems,i=!1):(r=this._translucentItems,i=!0);for(var o=r.length,a=0;a<o;a++){var s=r[a];if(s.isMaterial(t))return void s.add(t,n)}var l=new h(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);l.add(t,n),r.push(l)},p.prototype.remove=function(e){f(this._solidItems,e)||f(this._translucentItems,e)},p.prototype.update=function(e){var t=g(this,this._solidItems,e,!0);t=g(this,this._translucentItems,e,t)&&t;var r=m(this,this._solidItems,e),i=m(this,this._translucentItems,e);return(r||i)&&(t=g(this,this._solidItems,e,t)&&t,t=g(this,this._translucentItems,e,t)&&t),t},p.prototype.getBoundingSphere=function(e,t){var r=_(this._solidItems,e,t);return r===l.FAILED?_(this._translucentItems,e,t):r},p.prototype.removeAllPrimitives=function(){v(this._solidItems),v(this._translucentItems)},p}),define("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r,i,n,o,a,s){this.primitives=t,this.appearanceType=r,this.materialProperty=i,this.depthFailAppearanceType=n,this.depthFailMaterialProperty=o,this.closed=a,this.shadows=s,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(h.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function p(e,t,r,i,n){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=r,this._closed=i,this._shadows=n}var f=new n;h.prototype.onMaterialChanged=function(){this.invalidated=!0},h.prototype.isMaterial=function(e){var t=this.materialProperty,r=e.fillMaterialProperty,n=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(r===t&&o===n)return!0;var a=i(t)&&t.equals(r);return a=(!i(n)&&!i(o)||i(n)&&n.equals(o))&&a},h.prototype.add=function(e,t){var r=t.id;if(this.updaters.set(r,t),this.geometry.set(r,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&d.isConstant(t.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,t.entity.definitionChanged.addEventListener(function(e,r,n,o){"isShowing"===r&&i.showsUpdated.set(t.id,t)}))}else this.updatersWithAttributes.set(r,t);this.createPrimitive=!0},h.prototype.remove=function(e){var t=e.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))}return this.createPrimitive};var m=new t;return h.prototype.update=function(e){var l,h,p=!0,g=this.primitive,_=this.primitives,v=this.geometry.values;if(this.createPrimitive){var y=v.length;if(y>0){for(i(g)&&(i(this.oldPrimitive)?_.remove(g):this.oldPrimitive=g),h=0;h<y;h++){var b=v[h],C=b.attributes;l=this.attributes.get(b.id.id),i(l)&&(i(C.show)&&(C.show.value=l.show),i(C.color)&&(C.color.value=l.color),i(C.depthFailColor)&&(C.depthFailColor.value=l.depthFailColor))}this.material=c.getValue(e,this.materialProperty,this.material);var S;if(i(this.depthFailMaterialProperty)){var T;this.depthFailMaterialProperty instanceof c?(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),T=this.depthFailMaterial.isTranslucent()):T=this.material.isTranslucent(),S=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:T,closed:this.closed})}g=new s({asynchronous:!0,geometryInstances:v,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:S,shadows:this.shadows}),_.add(g),p=!1}else{i(g)&&(_.remove(g),g=void 0);var w=this.oldPrimitive;i(w)&&(_.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=g,this.createPrimitive=!1}else if(i(g)&&g.ready){i(this.oldPrimitive)&&(_.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=c.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,!i(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof u||(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var A=this.updatersWithAttributes.values,E=A.length;for(h=0;h<E;h++){var x=A[h],P=x.entity,I=this.geometry.get(x.id);if(l=this.attributes.get(I.id.id),i(l)||(l=g.getGeometryInstanceAttributes(I.id),this.attributes.set(I.id.id,l)),i(this.depthFailAppearanceType)&&this.depthFailAppearanceType instanceof u&&!x.depthFailMaterialProperty.isConstant){var D=x.depthFailMaterialProperty.color;D.getValue(e,m),t.equals(l._lastDepthFailColor,m)||(l._lastDepthFailColor=t.clone(m,l._lastDepthFailColor),l.depthFailColor=r.toValue(m,l.depthFailColor))}var O=P.isShowing&&(x.hasConstantFill||x.isFilled(e)),M=1===l.show[0];O!==M&&(l.show=a.toValue(O,l.show));var R=x.distanceDisplayConditionProperty;if(!d.isConstant(R)){var L=R.getValue(e,f);n.equals(L,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=n.clone(L,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=o.toValue(L,l.distanceDisplayCondition))}}this.updateShows(g)}else i(g)&&!g.ready&&(p=!1);return p},h.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var o=t[n],s=o.entity,l=this.geometry.get(o.id),u=this.attributes.get(l.id.id);i(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=s.isShowing;c!==(1===u.show[0])&&(u.show=a.toValue(c,u.show))}this.showsUpdated.removeAll()},h.prototype.contains=function(e){return this.updaters.contains(e.id)},h.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return l.PENDING;var n=r.getGeometryInstanceAttributes(e.entity);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?l.FAILED:(n.boundingSphere.clone(t),l.DONE)},h.prototype.destroy=function(){var e=this.primitive,t=this.primitives;i(e)&&t.remove(e);var r=this.oldPrimitive;i(r)&&t.remove(r),this.removeMaterialSubscription()},p.prototype.add=function(e,t){for(var r=this._items,i=r.length,n=0;n<i;n++){var o=r[n];if(o.isMaterial(t))return void o.add(e,t)}var a=new h(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(e,t),r.push(a)},p.prototype.remove=function(e){for(var t=this._items,r=t.length,i=r-1;i>=0;i--){var n=t[i];if(n.remove(e)){0===n.updaters.length&&(t.splice(i,1),n.destroy());break}}},p.prototype.update=function(e){var t,r=this._items,i=r.length;for(t=i-1;t>=0;t--){var n=r[t];if(n.invalidated){r.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<i;t++)l=r[t].update(e)&&l;return l},p.prototype.getBoundingSphere=function(e,t){for(var r=this._items,i=r.length,n=0;n<i;n++){var o=r[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return l.FAILED},p.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,r=0;r<t;r++)e[r].destroy();this._items.length=0},p}),define("DataSources/StaticGroundGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t,r,i,n){this.primitives=t,this.classificationType=r,this.color=i,this.key=n,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,r){this._batches=new e,this._primitives=t,this._classificationType=r}var d=new t,h=new i;u.prototype.add=function(e,t){var r=e.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&l.isConstant(e.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r,n,o){"isShowing"===r&&i.showsUpdated.set(e.id,e)}))}else this.updatersWithAttributes.set(r,e)},u.prototype.remove=function(e){var t=e.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 Array(4);return u.prototype.update=function(e){var s,u,c=!0,f=0,m=this.primitive,g=this.primitives;if(this.createPrimitive){var _=this.geometry.values,v=_.length;if(v>0){for(r(m)&&(r(this.oldPrimitive)?g.remove(m):this.oldPrimitive=m),u=0;u<v;u++){var y=_[u],b=y.attributes;s=this.attributes.get(y.id.id),r(s)&&(r(b.show)&&(b.show.value=s.show),r(b.color)&&(b.color.value=s.color))}m=new a({asynchronous:!0,geometryInstances:_,classificationType:this.classificationType}),g.add(m),c=!1}else{r(m)&&(g.remove(m),m=void 0);var C=this.oldPrimitive;r(C)&&(g.remove(C),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(m)&&m.ready){r(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0);var S=this.updatersWithAttributes.values,T=S.length,w=this.waitingOnCreate;for(u=0;u<T;u++){var A=S[u],E=this.geometry.get(A.id);if(s=this.attributes.get(E.id.id),r(s)||(s=m.getGeometryInstanceAttributes(E.id),this.attributes.set(E.id.id,s)),!A.fillMaterialProperty.isConstant||w){var x=A.fillMaterialProperty.color;if(x.getValue(e,d),!t.equals(s._lastColor,d)){s._lastColor=t.clone(d,s._lastColor);var P=this.color,I=d.toBytes(p);P[0]===I[0]&&P[1]===I[1]&&P[2]===I[2]&&P[3]===I[3]||(this.itemsToRemove[f++]=A)}}var D=A.entity.isShowing&&(A.hasConstantFill||A.isFilled(e)),O=1===s.show[0];D!==O&&(s.show=o.toValue(D,s.show));var M=A.distanceDisplayConditionProperty;if(!l.isConstant(M)){var R=M.getValue(e,h);i.equals(R,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=i.clone(R,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=n.toValue(R,s.distanceDisplayCondition))}}this.updateShows(m),this.waitingOnCreate=!1}else r(m)&&!m.ready&&(c=!1);return this.itemsToRemove.length=f,c},
u.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,n=0;n<i;n++){var a=t[n],s=this.geometry.get(a.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing;u!==(1===l.show[0])&&(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 i=this.primitive;if(!i.ready)return s.PENDING;var n=i.getBoundingSphere(e.entity);return r(n)?(n.clone(t),s.DONE):s.FAILED},u.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)},c.prototype.add=function(e,t){var r,i=t.createFillGeometryInstance(e),n=this._batches,o=new Uint32Array(i.attributes.color.value.buffer)[0];return n.contains(o)?r=n.get(o):(r=new u(this._primitives,this._classificationType,i.attributes.color.value,o),n.set(o,r)),r.add(t,i),r},c.prototype.remove=function(e){for(var t=this._batches.values,r=t.length,i=0;i<r;++i)if(t[i].remove(e))return},c.prototype.update=function(e){var t,r,i=!0,n=this._batches,o=n.values,a=o.length;for(t=0;t<a;++t)i=o[t].update(e)&&i;for(t=0;t<a;++t)for(var s=o[t],l=s.itemsToRemove,u=l.length,c=0;c<u;c++){r=l[c],s.remove(r);var d=this.add(e,r);s.isDirty=!0,d.isDirty=!0}var h=o.slice(),p=h.length;for(t=0;t<p;++t){var f=h[t];f.isDirty&&(i=h[t].update(e)&&i,f.isDirty=!1),0===f.geometry.length&&n.remove(f.key)}return i},c.prototype.getBoundingSphere=function(e,t){for(var r=this._batches.values,i=r.length,n=0;n<i;++n){var o=r[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,r=0;r<t;++r)e[r].removeAllPrimitives()},c}),define("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,r,i,n,o,a,s,l,u,c){"use strict";function d(t,r,i,n){this.translucent=r,this.width=i,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 h(t,r,i){this._primitives=t,this._scene=r,this._shadows=i,this._solidBatches=new e,this._translucentBatches=new e}d.prototype.add=function(e,t){var r=e.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant&&c.isConstant(e.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r,n,o){"isShowing"===r&&i.showsUpdated.set(e.id,e)}))}else this.updatersWithAttributes.set(r,e)},d.prototype.remove=function(e){var t=e.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 t,f=new n;return d.prototype.update=function(e){var u,d,h=!0,m=0,g=this.primitive,_=this.primitives;if(this.createPrimitive){var v=this.geometry.values,y=v.length;if(y>0){for(i(g)&&(i(this.oldPrimitive)?_.remove(g):this.oldPrimitive=g),d=0;d<y;d++){var b=v[d],C=b.attributes;u=this.attributes.get(b.id.id),i(u)&&(i(C.show)&&(C.show.value=u.show),i(C.color)&&(C.color.value=u.color))}g=new l({asynchronous:!0,geometryInstances:v,appearance:new s({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),_.add(g),h=!1}else{i(g)&&(_.remove(g),g=void 0);var S=this.oldPrimitive;i(S)&&(_.remove(S),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=g,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(i(g)&&g.ready){i(this.oldPrimitive)&&(_.remove(this.oldPrimitive),this.oldPrimitive=void 0);var T=this.updatersWithAttributes.values,w=T.length,A=this.waitingOnCreate;for(d=0;d<w;d++){var E=T[d],x=this.geometry.get(E.id);if(u=this.attributes.get(x.id.id),i(u)||(u=g.getGeometryInstanceAttributes(x.id),this.attributes.set(x.id.id,u)),!E.outlineColorProperty.isConstant||A){var P=E.outlineColorProperty;P.getValue(e,p),t.equals(u._lastColor,p)||(u._lastColor=t.clone(p,u._lastColor),u.color=r.toValue(p,u.color),(this.translucent&&255===u.color[3]||!this.translucent&&255!==u.color[3])&&(this.itemsToRemove[m++]=E))}var I=E.entity.isShowing&&(E.hasConstantOutline||E.isOutlineVisible(e)),D=1===u.show[0];I!==D&&(u.show=a.toValue(I,u.show));var O=E.distanceDisplayConditionProperty;if(!c.isConstant(O)){var M=O.getValue(e,f);n.equals(M,u._lastDistanceDisplayCondition)||(u._lastDistanceDisplayCondition=n.clone(M,u._lastDistanceDisplayCondition),u.distanceDisplayCondition=o.toValue(M,u.distanceDisplayCondition))}}this.updateShows(g),this.waitingOnCreate=!1}else i(g)&&!g.ready&&(h=!1);return this.itemsToRemove.length=m,h},d.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var o=t[n],s=this.geometry.get(o.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing;u!==(1===l.show[0])&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},d.prototype.contains=function(e){return this.updaters.contains(e.id)},d.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return u.PENDING;var n=r.getGeometryInstanceAttributes(e.entity);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?u.FAILED:(n.boundingSphere.clone(t),u.DONE)},d.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)},h.prototype.add=function(e,t){var r,n,o=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===o.attributes.color.value[3]?(r=this._solidBatches,n=r.get(a),i(n)||(n=new d(this._primitives,!1,a,this._shadows),r.set(a,n)),n.add(t,o)):(r=this._translucentBatches,n=r.get(a),i(n)||(n=new d(this._primitives,!0,a,this._shadows),r.set(a,n)),n.add(t,o))},h.prototype.remove=function(e){var t,r=this._solidBatches.values,i=r.length;for(t=0;t<i;t++)if(r[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;t<o;t++)if(n[t].remove(e))return},h.prototype.update=function(e){var t,r,i,n,o,a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,u=l.length,c=!0,d=!1;do{for(d=!1,r=0;r<s;r++){n=a[r],c=n.update(e),o=n.itemsToRemove;var h=o.length;if(h>0)for(d=!0,t=0;t<h;t++)i=o[t],n.remove(i),this.add(e,i)}for(r=0;r<u;r++){n=l[r],c=n.update(e),o=n.itemsToRemove;var p=o.length;if(p>0)for(d=!0,t=0;t<p;t++)i=o[t],n.remove(i),this.add(e,i)}}while(d);return c},h.prototype.getBoundingSphere=function(e,t){var r,i=this._solidBatches.values,n=i.length;for(r=0;r<n;r++){var o=i[r];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,s=a.length;for(r=0;r<s;r++){var l=a[r];if(l.contains(e))return l.getBoundingSphere(e,t)}return u.FAILED},h.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,r=t.length;for(e=0;e<r;e++)t[e].removeAllPrimitives();var i=this._translucentBatches.values,n=i.length;for(e=0;e<n;e++)i[e].removeAllPrimitives()},h}),define("DataSources/WallGeometryUpdater",["../Core/Check","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DeveloperError","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","./ColorMaterialProperty","./DynamicGeometryUpdater","./GeometryUpdater","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(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 v(e,t){m.call(this,{entity:e,scene:t,geometryOptions:new _(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]})}function y(e,t,r){f.call(this,e,t,r)}var b=new t;return i(Object.create)&&(v.prototype=Object.create(m.prototype),v.prototype.constructor=v),v.prototype.createFillGeometryInstance=function(e){var n,s,c=this._entity,d=c.isAvailable(e),h=new l(d&&c.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),f=this._distanceDisplayConditionProperty.getValue(e),m=o.fromDistanceDisplayCondition(f);if(this._materialProperty instanceof p){var g;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||d)&&(g=this._materialProperty.color.getValue(e,b)),i(g)||(g=t.WHITE),s=r.fromColor(g),n={show:h,distanceDisplayCondition:m,color:s}}else n={show:h,distanceDisplayCondition:m};return new a({id:c,geometry:new u(this._options),attributes:n})},v.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,n=i.isAvailable(e),s=g.getValueOrDefault(this._outlineColorProperty,e,t.BLACK,b),u=this._distanceDisplayConditionProperty.getValue(e);return new a({id:i,geometry:new c(this._options),attributes:{show:new l(n&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(s),distanceDisplayCondition:o.fromDistanceDisplayCondition(u)}})},v.prototype._isHidden=function(e,t){return!i(t.positions)||m.prototype._isHidden.call(this,e,t)},v.prototype._getIsClosed=function(e){return!1},v.prototype._isDynamic=function(e,t){return!(t.positions.isConstant&&g.isConstant(t.minimumHeights)&&g.isConstant(t.maximumHeights)&&g.isConstant(t.outlineWidth)&&g.isConstant(t.granularity))},v.prototype._setStaticOptions=function(e,t){var r=t.minimumHeights,n=t.maximumHeights,o=t.granularity,a=this._materialProperty instanceof p,l=this._options;l.vertexFormat=a?h.VERTEX_FORMAT:d.MaterialSupport.TEXTURED.vertexFormat,l.positions=t.positions.getValue(s.MINIMUM_VALUE,l.positions),l.minimumHeights=i(r)?r.getValue(s.MINIMUM_VALUE,l.minimumHeights):void 0,l.maximumHeights=i(n)?n.getValue(s.MINIMUM_VALUE,l.maximumHeights):void 0,l.granularity=i(o)?o.getValue(s.MINIMUM_VALUE):void 0},v.DynamicGeometryUpdater=y,i(Object.create)&&(y.prototype=Object.create(f.prototype),y.prototype.constructor=y),y.prototype._isHidden=function(e,t,r){return!i(this._options.positions)||f.prototype._isHidden.call(this,e,t,r)},y.prototype._setOptions=function(e,t,r){var i=this._options;i.positions=g.getValueOrUndefined(t.positions,r,i.positions),i.minimumHeights=g.getValueOrUndefined(t.minimumHeights,r,i.minimumHeights),i.maximumHeights=g.getValueOrUndefined(t.maximumHeights,r,i.maximumHeights),i.granularity=g.getValueOrUndefined(t.granularity,r)},v}),define("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Check","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Scene/ClassificationType","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/ShadowMode","./BoxGeometryUpdater","./BoundingSphereState","./ColorMaterialProperty","./CorridorGeometryUpdater","./CylinderGeometryUpdater","./DynamicGeometryBatch","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./PlaneGeometryUpdater","./PolygonGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticGroundGeometryColorBatch","./StaticOutlineGeometryBatch","./WallGeometryUpdater"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P){"use strict";function I(e,t){function r(e){n.raiseEvent(e)}this.entity=e,this.scene=t;for(var i=new Array(M.length),n=new a,o=new s,l=0;l<i.length;l++){var u=new M[l](e,t);o.add(u.geometryChanged,r),i[l]=u}this.updaters=i,this.geometryChanged=n,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(I.prototype._onEntityPropertyChanged,this)}function D(t,r){var i=t.primitives,n=t.groundPrimitives;this._scene=t,this._primitives=i,this._groundPrimitives=n,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e;var o=d.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o),this._closedColorBatches=new Array(o),this._closedMaterialBatches=new Array(o),this._openColorBatches=new Array(o),this._openMaterialBatches=new Array(o);var a;for(a=0;a<o;++a)this._outlineBatches[a]=new x(i,t,a),this._closedColorBatches[a]=new w(i,c,void 0,!0,a),this._closedMaterialBatches[a]=new A(i,u,void 0,!0,a),this._openColorBatches[a]=new w(i,c,void 0,!1,a),this._openMaterialBatches[a]=new A(i,u,void 0,!1,a);var s=l.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundColorBatches=new Array(s),a=0;a<s;++a)this._groundColorBatches[a]=new E(n,a);this._dynamicBatch=new _(i,n),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._dynamicBatch),this._subscriptions=new e,this._updaterSets=new e,this._entityCollection=r,r.collectionChanged.addEventListener(D.prototype._onCollectionChanged,this),this._onCollectionChanged(r,r.values,O)}var O=[],M=[h,g,m,v,y,b,C,S,T,P];I.prototype._onEntityPropertyChanged=function(e,t,r,i){for(var n=this.updaters,o=0;o<n.length;o++)n[o]._onEntityPropertyChanged(e,t,r,i)},I.prototype.forEach=function(e){for(var t=this.updaters,r=0;r<t.length;r++)e(t[r])},I.prototype.destroy=function(){this.eventHelper.removeAll();for(var e=this.updaters,t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),n(this)},D.prototype.update=function(e){var t,r,i,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values,d=this;for(t=c.length-1;t>-1;t--)r=c[t],i=r.id,n=this._updaterSets.get(i),n.entity===r?n.forEach(function(t){d._removeUpdater(t),d._insertUpdaterIntoBatch(e,t)}):(l.push(r),a.push(r));for(t=l.length-1;t>-1;t--)r=l[t],i=r.id,n=this._updaterSets.get(i),n.forEach(this._removeUpdater.bind(this)),n.destroy(),this._updaterSets.remove(i),this._subscriptions.get(i)(),this._subscriptions.remove(i);for(t=a.length-1;t>-1;t--)r=a[t],i=r.id,n=new I(r,this._scene),this._updaterSets.set(i,n),n.forEach(function(t){d._insertUpdaterIntoBatch(e,t)}),this._subscriptions.set(i,n.geometryChanged.addEventListener(D._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var h=!0,p=this._batches,f=p.length;for(t=0;t<f;t++)h=p[t].update(e)&&h;return h};var R=[],L=new t;return D.prototype.getBoundingSphere=function(e,r){for(var i=R,n=L,o=0,a=p.DONE,s=this._batches,l=s.length,u=e.id,c=this._updaterSets.get(u).updaters,d=0;d<c.length;d++)for(var h=c[d],f=0;f<l;f++){if((a=s[f].getBoundingSphere(h,n))===p.PENDING)return p.PENDING;a===p.DONE&&(i[o]=t.clone(n,i[o]),o++)}return 0===o?p.FAILED:(i.length=o,t.fromBoundingSpheres(i,r),p.DONE)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(D.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,r=t.length;for(e=0;e<r;e++)t[e].removeAllPrimitives();var i=this._subscriptions.values;for(r=i.length,e=0;e<r;e++)i[e]();return this._subscriptions.removeAll(),n(this)},D.prototype._removeUpdater=function(e){for(var t=this._batches,r=t.length,i=0;i<r;i++)t[i].remove(e)},D.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic)return void this._dynamicBatch.add(e,t);var r;if((t.outlineEnabled||t.fillEnabled)&&(r=t.shadowsProperty.getValue(e)),t.outlineEnabled&&this._outlineBatches[r].add(e,t),t.fillEnabled)if(t.onTerrain){var i=t.classificationTypeProperty.getValue(e);this._groundColorBatches[i].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof f?this._closedColorBatches[r].add(e,t):this._closedMaterialBatches[r].add(e,t):t.fillMaterialProperty instanceof f?this._openColorBatches[r].add(e,t):this._openMaterialBatches[r].add(e,t)},D._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)},D.prototype._onCollectionChanged=function(e,t,r){var i,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(i=r.length-1;i>-1;i--)o=r[i],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(i=t.length-1;i>-1;i--)o=t[i],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},D}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e){this.entity=e,this.label=void 0,this.index=void 0}function _(t,r){r.collectionChanged.addEventListener(_.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function v(e,t,r){o(e)&&(e.label=void 0,r.removeLabel(t))}var y=h.FILL,b=i.WHITE,C=i.BLACK,S=new i(.165,.165,.165,.8),T=new t(7,5),w=t.ZERO,A=r.ZERO,E=c.NONE,x=d.CENTER,P=p.CENTER,I=new r,D=new i,O=new i,M=new i,R=new t,L=new r,N=new t,k=new u,F=new u,B=new u,U=new l;return _.prototype.update=function(e){for(var t=this._items.values,r=this._cluster,i=0,n=t.length;i<n;i++){var a,s=t[i],l=s.entity,u=l._label,c=s.label,d=l.isShowing&&l.isAvailable(e)&&m.getValueOrDefault(u._show,e,!0);d&&(I=m.getValueOrUndefined(l._position,e,I),a=m.getValueOrUndefined(u._text,e),d=o(I)&&o(a)),d?(m.isConstant(l._position)||(r._clusterDirty=!0),o(c)||(c=r.getLabel(l),c.id=l,s.label=c),c.show=!0,c.position=I,c.text=a,c.scale=m.getValueOrDefault(u._scale,e,1),c.font=m.getValueOrDefault(u._font,e,"30px sans-serif"),c.style=m.getValueOrDefault(u._style,e,y),c.fillColor=m.getValueOrDefault(u._fillColor,e,b,D),c.outlineColor=m.getValueOrDefault(u._outlineColor,e,C,O),c.outlineWidth=m.getValueOrDefault(u._outlineWidth,e,1),c.showBackground=m.getValueOrDefault(u._showBackground,e,!1),c.backgroundColor=m.getValueOrDefault(u._backgroundColor,e,S,M),c.backgroundPadding=m.getValueOrDefault(u._backgroundPadding,e,T,R),c.pixelOffset=m.getValueOrDefault(u._pixelOffset,e,w,N),c.eyeOffset=m.getValueOrDefault(u._eyeOffset,e,A,L),c.heightReference=m.getValueOrDefault(u._heightReference,e,E),c.horizontalOrigin=m.getValueOrDefault(u._horizontalOrigin,e,x),c.verticalOrigin=m.getValueOrDefault(u._verticalOrigin,e,P),c.translucencyByDistance=m.getValueOrUndefined(u._translucencyByDistance,e,k),c.pixelOffsetScaleByDistance=m.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,F),c.scaleByDistance=m.getValueOrUndefined(u._scaleByDistance,e,B),c.distanceDisplayCondition=m.getValueOrUndefined(u._distanceDisplayCondition,e,U),c.disableDepthTestDistance=m.getValueOrDefault(u._disableDepthTestDistance,e,0)):v(s,l,r)}return!0},_.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);if(!o(i)||!o(i.label))return f.FAILED;var a=i.label;return t.center=r.clone(n(a._clampedPosition,a.position),t.center),t.radius=0,f.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.removeLabel(e[t]);return a(this)},_.prototype._onCollectionChanged=function(e,t,r,i){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 g(a));for(n=i.length-1;n>-1;n--)a=i[n],o(a._label)&&o(a._position)?s.contains(a.id)||s.set(a.id,new g(a)):(v(s.get(a.id),a,l),s.remove(a.id));for(n=r.length-1;n>-1;n--)a=r[n],v(s.get(a.id),a,l),s.remove(a.id)},_}),define("ThirdParty/GltfPipeline/addToArray",[],function(){"use strict";function e(e,t){return e.push(t),e.length-1}return e}),define("ThirdParty/GltfPipeline/ForEach",["../../Core/defined"],function(e){"use strict";var t={};return t.object=function(t,r){if(e(t))for(var i=0;i<t.length;i++){var n=t[i],o=r(n,i);if("number"==typeof o)i+=o;else if(o)break}},t.topLevel=function(e,r,i){var n=e[r];t.object(n,i)},t.accessor=function(e,r){t.topLevel(e,"accessors",r)},t.accessorWithSemantic=function(e,r,i){t.mesh(e,function(e){t.meshPrimitive(e,function(e){t.meshPrimitiveAttribute(e,function(t,n){0===n.indexOf(r)&&i(t,n,e)})})})},t.animation=function(e,r){t.topLevel(e,"animations",r)},t.animationSampler=function(r,i){var n=r.samplers;e(n)&&t.object(n,i)},t.buffer=function(e,r){t.topLevel(e,"buffers",r)},t.bufferView=function(e,r){t.topLevel(e,"bufferViews",r)},t.camera=function(e,r){t.topLevel(e,"cameras",r)},t.image=function(e,r){t.topLevel(e,"images",r)},t.material=function(e,r){t.topLevel(e,"materials",r)},t.materialValue=function(t,r){var i=t.values;if(e(i))for(var n in i)i.hasOwnProperty(n)&&r(i[n],n)},t.mesh=function(e,r){t.topLevel(e,"meshes",r)},t.meshPrimitive=function(t,r){var i=t.primitives;if(e(i))for(var n=i.length,o=0;o<n;o++){var a=i[o];r(a,o)}},t.meshPrimitiveAttribute=function(t,r){var i=t.attributes;if(e(i))for(var n in i)i.hasOwnProperty(n)&&r(i[n],n)},t.meshPrimitiveTargetAttribute=function(t,r){var i=t.targets;if(e(i))for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];for(var a in o)o.hasOwnProperty(a)&&"extras"!==a&&r(o[a],a)}},t.node=function(e,r){t.topLevel(e,"nodes",r)},t.nodeInTree=function(r,i,n){var o=r.nodes;if(e(o))for(var a=0;a<i.length;a++){var s=i[a],l=o[s];if(e(l)){n(l,s);var u=l.children;e(u)&&t.nodeInTree(r,u,n)}}},t.nodeInScene=function(r,i,n){var o=i.nodes;e(o)&&t.nodeInTree(r,o,n)},t.program=function(e,r){t.topLevel(e,"programs",r)},t.sampler=function(e,r){t.topLevel(e,"samplers",r)},t.scene=function(e,r){t.topLevel(e,"scenes",r)},t.shader=function(e,r){t.topLevel(e,"shaders",r)},t.skin=function(e,r){t.topLevel(e,"skins",r)},t.techniqueAttribute=function(t,r){var i=t.attributes;if(e(i))for(var n in i)if(i.hasOwnProperty(n)&&r(i[n],n))break},t.techniqueParameter=function(t,r){var i=t.parameters;if(e(i))for(var n in i)if(i.hasOwnProperty(n)&&r(i[n],n))break},t.technique=function(e,r){t.topLevel(e,"techniques",r)},t.texture=function(e,r){t.topLevel(e,"textures",r)},t}),define("ThirdParty/GltfPipeline/addDefaults",["./addToArray","./ForEach","../../Core/clone","../../Core/defaultValue","../../Core/defined","../../Core/WebGLConstants"],function(e,t,r,i,n,o){"use strict";function a(e,t){for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if("function"==typeof o&&(o=o(e)),n(o))if("object"==typeof o)if(Array.isArray(o)){var s=i(e[r],[]);if(o.length>0){var l=o[0];if("object"==typeof l)for(var u=s.length,c=0;c<u;c++)a(s[c],l);else s=i(e[r],o)}e[r]=s}else{var d=o["*"];e[r]=i(e[r],{});var h=e[r];if(n(d)){for(var p in h)if(h.hasOwnProperty(p)&&"extras"!==p){var f=h[p];a(f,d)}}else a(h,o)}else e[r]=i(e[r],o)}}function s(t){for(var i,o=t.materials,a=t.meshes,s=a.length,l=0;l<s;l++)for(var u=a[l],c=u.primitives,d=c.length,h=0;h<d;h++){var p=c[h];n(p.material)||(n(i)||(i=e(o,r(m,!0))),p.material=i)}}function l(t){for(var o,a=t.materials,s=t.techniques,l=t.programs,u=t.shaders,c=a.length,d=0;d<c;d++){var h=a[d],p=h.technique,f=i(h.extensions,{}),m=f.KHR_materials_common;if(!n(p)){if(!n(o)&&!n(m)){var b=r(g,!0);o=e(s,b);var C=r(_,!0);b.program=e(l,C);var S=r(v,!0);C.vertexShader=e(u,S);var T=r(y,!0);C.fragmentShader=e(u,T)}h.technique=o}}}function u(e){for(var t=e.accessors,r=t.length,i=0;i<r;i++){var o=t[i];n(o.byteOffset)||(o.byteOffset=0)}for(var a=e.bufferViews,s=a.length,l=0;l<s;l++){var u=a[l];n(u.byteOffset)||(u.byteOffset=0)}}function c(e){n(e.scenes)&&!n(e.scene)&&(e.scene=0)}function d(e){for(var t=e.techniques,r=t.length,i=0;i<r;i++){var o=t[i],a=o.parameters;n(a.diffuse)&&(a.diffuse.semantic="_3DTILESDIFFUSE")}}function h(e){var r={},i=0;if(t.bufferView(e,function(e,t){n(e.target)||(r[t]=!0,i++)}),i>0){var a=e.accessors,s=e.bufferViews;t.mesh(e,function(e){if(t.meshPrimitive(e,function(e){var l=e.indices;if(n(l)){var u=a[l],c=u.bufferView;if(r[c]){var d=s[c];n(d)&&(d.target=o.ELEMENT_ARRAY_BUFFER,r[c]=!1,i--)}}t.meshPrimitiveAttribute(e,function(e){var t=a[e],l=t.bufferView;if(r[l]){var u=s[l];n(u)&&(u.target=o.ARRAY_BUFFER,r[l]=!1,i--)}}),t.meshPrimitiveTargetAttribute(e,function(e){var t=a[e].bufferView;if(r[t]){var l=s[t];n(l)&&(l.target=o.ARRAY_BUFFER,r[t]=!1,i--)}})}),0===i)return!0})}}function p(e,t){return t=i(t,{}),a(e,f),s(e),l(e),u(e),c(e),h(e),t.optimizeForCesium&&d(e),e}var f={accessors:[],animations:[{channels:[],samplers:[{interpolation:"LINEAR"}]}],asset:{},buffers:[{byteLength:0,type:"arraybuffer"}],bufferViews:[{byteLength:0}],cameras:[],images:[],materials:[{values:function(e){var t=i(e.extensions,{}),r=t.KHR_materials_common;if(!n(r))return{}},extensions:function(e){var t=i(e.extensions,{}),r=t.KHR_materials_common;if(n(r)){var o=r.technique,a={ambient:[0,0,0,1],emission:[0,0,0,1],transparency:1};return"CONSTANT"!==o&&(a.diffuse=[0,0,0,1],"LAMBERT"!==o&&(a.specular=[0,0,0,1],a.shininess=0)),{KHR_materials_common:{doubleSided:!1,transparent:!1,values:a}}}}}],meshes:[{primitives:[{attributes:{},mode:o.TRIANGLES}]}],nodes:[{children:[],matrix:function(e){if(!n(e.translation)&&!n(e.rotation)&&!n(e.scale))return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},rotation:function(e){if(n(e.translation)||n(e.scale))return[0,0,0,1]},scale:function(e){if(n(e.translation)||n(e.rotation))return[1,1,1]},translation:function(e){if(n(e.rotation)||n(e.scale))return[0,0,0]}}],programs:[{attributes:[]}],samplers:[{magFilter:o.LINEAR,minFilter:o.NEAREST_MIPMAP_LINEAR,wrapS:o.REPEAT,wrapT:o.REPEAT}],scenes:[{nodes:[]}],shaders:[],skins:[{bindShapeMatrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}],techniques:[{parameters:{},attributes:{},uniforms:{},states:{enable:[]}}],textures:[{format:o.RGBA,internalFormat:o.RGBA,target:o.TEXTURE_2D,type:o.UNSIGNED_BYTE}],extensionsUsed:[],extensionsRequired:[]},m={values:{emission:[.5,.5,.5,1]},extras:{_pipeline:{}}},g={attributes:{a_position:"position"},parameters:{modelViewMatrix:{semantic:"MODELVIEW",type:o.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:o.FLOAT_MAT4},emission:{type:o.FLOAT_VEC4,value:[.5,.5,.5,1]},position:{semantic:"POSITION",type:o.FLOAT_VEC3}},states:{enable:[o.CULL_FACE,o.DEPTH_TEST]},uniforms:{u_modelViewMatrix:"modelViewMatrix",u_projectionMatrix:"projectionMatrix",u_emission:"emission"}},_={attributes:["a_position"]},v={type:o.VERTEX_SHADER,extras:{_pipeline:{extension:".vert",source:"precision highp float;\n\nuniform mat4 u_modelViewMatrix;\nuniform mat4 u_projectionMatrix;\n\nattribute vec3 a_position;\n\nvoid main (void)\n{\n    gl_Position = u_projectionMatrix * u_modelViewMatrix * vec4(a_position, 1.0);\n}\n"}}},y={type:o.FRAGMENT_SHADER,extras:{_pipeline:{extension:".frag",source:"precision highp float;\n\nuniform vec4 u_emission;\n\nvoid main(void)\n{\n    gl_FragColor = u_emission;\n}\n"}}};return p}),define("ThirdParty/GltfPipeline/addPipelineExtras",["../../Core/defaultValue","../../Core/defined"],function(e,t){"use strict";function r(r){var n=[];for(var o in r)if(r.hasOwnProperty(o))for(var a=r[o],s=a.length,l=0;l<s;l++){var u=a[l];t(u)&&"object"==typeof u&&(u.extras=e(u.extras,{}),u.extras._pipeline=e(u.extras._pipeline,{}),n.push(u))}for(;n.length>0;){var c=n.pop();for(var d in c)if(c.hasOwnProperty(d)){var h=c[d];t(h)&&"object"==typeof h&&"extras"!==d&&(n.push(h),i[d]||Array.isArray(h)||(h.extras=e(h.extras,{}),h.extras._pipeline=e(h.extras._pipeline,{})))}}return r.extras=e(r.extras,{}),r.extras._pipeline=e(r.extras._pipeline,{}),r.asset=e(r.asset,{}),r.asset.extras=e(r.asset.extras,{}),t(r.asset.extras)&&"object"!=typeof r.asset.extras&&(r.asset.extras={extras:r.asset.extras}),r.asset.extras._pipeline=e(r.asset.extras._pipeline,{}),r}var i={attributes:!0,uniforms:!0,extensions:!0,values:!0,samplers:!0};return r}),define("ThirdParty/GltfPipeline/byteLengthForComponentType",["../../Core/WebGLConstants"],function(e){"use strict";function t(t){switch(t){case e.BYTE:case e.UNSIGNED_BYTE:return 1;case e.SHORT:case e.UNSIGNED_SHORT:return 2;case e.FLOAT:case e.UNSIGNED_INT:return 4}}return t}),define("ThirdParty/GltfPipeline/numberOfComponentsForType",[],function(){"use strict";function e(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}return e}),define("ThirdParty/GltfPipeline/getAccessorByteStride",["./byteLengthForComponentType","./numberOfComponentsForType","../../Core/defined"],function(e,t,r){"use strict";function i(i,n){var o=i.bufferViews[n.bufferView];return r(o.byteStride)&&o.byteStride>0?o.byteStride:e(n.componentType)*t(n.type)}return i}),define("ThirdParty/GltfPipeline/removeExtensionsRequired",["../../Core/defined"],function(e){"use strict";function t(t,r){var i=t.extensionsRequired;if(e(i)){var n=i.indexOf(r);n>=0&&i.splice(n,1),0===i.length&&delete t.extensionsRequired}}return t}),define("ThirdParty/GltfPipeline/removeExtensionsUsed",["./removeExtensionsRequired","../../Core/defined"],function(e,t){"use strict";function r(r,i){var n=r.extensionsUsed;if(t(n)){var o=n.indexOf(i);o>=0&&n.splice(o,1),e(r,i),0===n.length&&delete r.extensionsUsed}}return r}),define("ThirdParty/GltfPipeline/addExtensionsUsed",["../../Core/defined"],function(e){"use strict";function t(t,r){var i=t.extensionsUsed;e(i)||(i=[],t.extensionsUsed=i),i.indexOf(r)<0&&i.push(r)}return t}),define("ThirdParty/GltfPipeline/addExtensionsRequired",["./addExtensionsUsed","../../Core/defined"],function(e,t){"use strict";function r(r,i){var n=r.extensionsRequired;t(n)||(n=[],r.extensionsRequired=n),n.indexOf(i)<0&&n.push(i),e(r,i)}return r}),define("ThirdParty/GltfPipeline/updateVersion",["./addExtensionsRequired","./addToArray","./ForEach","./getAccessorByteStride","./numberOfComponentsForType","../../Core/Cartesian3","../../Core/Math","../../Core/clone","../../Core/ComponentDatatype","../../Core/defaultValue","../../Core/defined","../../Core/Quaternion","../../Core/WebGLConstants"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t){t=u(t,{});var r=t.targetVersion,i=e.version;e.asset=u(e.asset,{version:"1.0"}),i=u(i,e.asset.version),F.hasOwnProperty(i)||(c(i)&&(i=(""+i).substring(0,3)),F.hasOwnProperty(i)||(i="1.0"));for(var n=F[i];c(n)&&i!==r;)n(e),i=e.asset.version,n=F[i];return e}function f(e){var t=e.materials;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r],n=i.instanceTechnique;c(n)&&(i.technique=n.technique,i.values=n.values,delete i.instanceTechnique)}}function m(e){var t=e.meshes;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r],n=i.primitives;if(c(n))for(var o=n.length,a=0;a<o;a++){var s=n[a],l=u(s.primitive,h.TRIANGLES);s.mode=u(s.mode,l),delete s.primitive}}}function g(e){var t=e.nodes,r=new o,i=new d;for(var n in t)if(t.hasOwnProperty(n)){var a=t[n];if(c(a.rotation)){var s=a.rotation;o.fromArray(s,0,r),d.fromAxisAngle(r,s[3],i),a.rotation=[i.x,i.y,i.z,i.w]}var l=a.instanceSkin;c(l)&&(a.skeletons=l.skeletons,a.skin=l.skin,a.meshes=l.meshes,delete a.instanceSkin)}}function _(e){var t=e.animations,r=e.accessors,i=e.bufferViews,a=e.buffers,s={},u=new o,h=new d;for(var p in t)if(t.hasOwnProperty(p)){
var f=t[p],m=f.channels,g=f.parameters,_=f.samplers;if(c(m))for(var v=m.length,y=0;y<v;++y){var b=m[y];if("rotation"===b.target.path){var C=g[_[b.sampler].output];if(c(s[C]))continue;s[C]=!0;for(var S=r[C],T=i[S.bufferView],w=a[T.buffer],A=w.extras._pipeline.source,E=A.byteOffset+T.byteOffset+S.byteOffset,x=S.componentType,P=S.count,I=n(S.type),D=S.count*I,O=l.createArrayBufferView(x,A.buffer,E,D),M=0;M<P;M++){var R=M*I;o.unpack(O,R,u);var L=O[R+3];d.fromAxisAngle(u,L,h),d.pack(h,O,R)}}}}}function v(e){var t=e.techniques;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r],n=i.passes;if(c(n)){var o=u(i.pass,"defaultPass");if(n.hasOwnProperty(o)){var a=n[o],s=a.instanceProgram;i.attributes=u(i.attributes,s.attributes),i.program=u(i.program,s.program),i.uniforms=u(i.uniforms,s.uniforms),i.states=u(i.states,a.states)}delete i.passes,delete i.pass}}}function y(e){c(e.asset)||(e.asset={});var t=e.asset;if(t.version="1.0",c(t.profile)&&"string"!=typeof t.profile||(t.profile={}),c(e.version)&&delete e.version,f(e),m(e),g(e),_(e),v(e),c(e.lights)){var r=u(e.extensions,{});e.extensions=r;var i=u(r.KHR_materials_common,{});r.KHR_materials_common=i,i.lights=e.lights,delete e.lights}c(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,e.allExtensions=void 0)}function b(e){var t=e.animations;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r],n=i.parameters;if(c(n)){var o=i.samplers;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];s.input=n[s.input],s.output=n[s.output]}delete i.parameters}}}function C(e,t){var r=[];for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];t[i]=r.length,r.push(n),c(n.name)||"object"!=typeof n||(n.name=i)}return r}function S(e){var i,n,o={accessors:{},animations:{},bufferViews:{},buffers:{},cameras:{},materials:{},meshes:{},nodes:{},programs:{},shaders:{},skins:{},techniques:{}},a={},s=e.nodes;for(var l in s)s.hasOwnProperty(l)&&(n=s[l].jointName,c(n)&&(a[n]=l));for(var u in e)if(e.hasOwnProperty(u)&&"extras"!==u&&"asset"!==u&&"extensions"!==u){var d={},h=e[u];"object"!=typeof h||Array.isArray(h)||(e[u]=C(h,d),o[u]=d,"animations"===u&&(d={},h.samplers=C(h.samplers,d),o[u].samplers=d))}for(n in a)a.hasOwnProperty(n)&&(a[n]=o.nodes[a[n]]);c(e.scene)&&(e.scene=o.scenes[e.scene]),r.bufferView(e,function(e){c(e.buffer)&&(e.buffer=o.buffers[e.buffer])}),r.accessor(e,function(e){c(e.bufferView)&&(e.bufferView=o.bufferViews[e.bufferView])}),r.shader(e,function(e){var t=e.extensions;if(c(t)){var r=t.KHR_binary_glTF;c(r)&&(e.bufferView=o.bufferViews[r.bufferView],delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}}),r.program(e,function(e){c(e.vertexShader)&&(e.vertexShader=o.shaders[e.vertexShader]),c(e.fragmentShader)&&(e.fragmentShader=o.shaders[e.fragmentShader])}),r.technique(e,function(e){c(e.program)&&(e.program=o.programs[e.program]),r.techniqueParameter(e,function(e){c(e.node)&&(e.node=o.nodes[e.node]);var t=e.value;if(c(t))if(Array.isArray(t)){if(1===t.length){var r=t[0];"string"==typeof r&&(t[0]=o.textures[r])}}else"string"==typeof t&&(e.value=[o.textures[t]])})}),r.mesh(e,function(e){r.meshPrimitive(e,function(e){c(e.indices)&&(e.indices=o.accessors[e.indices]),r.meshPrimitiveAttribute(e,function(t,r){e.attributes[r]=o.accessors[t]}),c(e.material)&&(e.material=o.materials[e.material])})}),r.node(e,function(r){var n=r.children;if(c(n)){var a=n.length;for(i=0;i<a;i++)n[i]=o.nodes[n[i]]}if(c(r.meshes)){var s=r.meshes,l=s.length;if(l>0)for(r.mesh=o.meshes[s[0]],i=1;i<l;i++){var u={mesh:o.meshes[s[i]],extras:{_pipeline:{}}},d=t(e.nodes,u);c(n)||(n=[],r.children=n),n.push(d)}delete r.meshes}if(c(r.camera)&&(r.camera=o.cameras[r.camera]),c(r.skeletons)){var h=r.skeletons;if(h.length>0&&c(r.skin)){e.skins[o.skins[r.skin]].skeleton=o.nodes[h[0]]}delete r.skeletons}c(r.skin)&&(r.skin=o.skins[r.skin]),c(r.jointName)&&delete r.jointName}),r.skin(e,function(e){c(e.inverseBindMatrices)&&(e.inverseBindMatrices=o.accessors[e.inverseBindMatrices]);var t=[],r=e.jointNames;if(c(r)){for(i=0;i<r.length;i++)t[i]=a[r[i]];e.joints=t,delete e.jointNames}}),r.scene(e,function(e){var t=e.nodes;if(c(t)){var r=t.length;for(i=0;i<r;i++)t[i]=o.nodes[t[i]]}}),r.animation(e,function(e){var t={};e.samplers=C(e.samplers,t),r.animationSampler(e,function(e){e.input=o.accessors[e.input],e.output=o.accessors[e.output]});var n=e.channels;if(c(n)){var a=n.length;for(i=0;i<a;i++){var s=n[i];s.sampler=t[s.sampler];var l=s.target;c(l)&&(l.node=o.nodes[l.id],delete l.id)}}}),r.material(e,function(e){c(e.technique)&&(e.technique=o.techniques[e.technique]),r.materialValue(e,function(t,r){if(Array.isArray(t)){if(1===t.length){var i=t[0];"string"==typeof i&&(t[0]=o.textures[i])}}else"string"==typeof t&&(e.values[r]={index:o.textures[t]})});var t=e.extensions;if(c(t)){var i=t.KHR_materials_common;c(i)&&r.materialValue(i,function(e,t){if(Array.isArray(e)){if(1===e.length){var r=e[0];"string"==typeof r&&(e[0]=o.textures[r])}}else"string"==typeof e&&(i.values[t]={index:o.textures[e]})})}}),r.image(e,function(e){var t=e.extensions;if(c(t)){var r=t.KHR_binary_glTF;c(r)&&(e.bufferView=o.bufferViews[r.bufferView],e.mimeType=r.mimeType,delete t.KHR_binary_glTF),0===Object.keys(t).length&&delete e.extensions}if(c(e.extras)){var i=e.extras.compressedImage3DTiles;for(var n in i)if(i.hasOwnProperty(n)){var a=i[n],s=a.extensions;if(c(s)){var l=s.KHR_binary_glTF;c(l)&&(a.bufferView=o.bufferViews[l.bufferView],a.mimeType=l.mimeType,delete s.KHR_binary_glTF),0===Object.keys(s).length&&delete a.extensions}}}}),r.texture(e,function(e){c(e.sampler)&&(e.sampler=o.samplers[e.sampler]),c(e.source)&&(e.source=o.images[e.source])})}function T(e){delete e.asset.profile}function w(e){var t=e.extensionsUsed;if(e.extensionsRequired=u(e.extensionsRequired,[]),c(t))for(var r=t.length,i=0;i<r;i++){var n=t[i];c(B[n])&&e.extensionsRequired.push(n)}}function A(e){r.buffer(e,function(e){delete e.type})}function E(e){r.mesh(e,function(e){r.meshPrimitive(e,function(e){r.meshPrimitiveAttribute(e,function(t,r){"TEXCOORD"===r?e.attributes.TEXCOORD_0=t:"COLOR"===r&&(e.attributes.COLOR_0=t)}),delete e.attributes.TEXCOORD,delete e.attributes.COLOR})}),r.technique(e,function(e){r.techniqueParameter(e,function(e){var t=e.semantic;c(t)&&("TEXCOORD"===t?e.semantic="TEXCOORD_0":"COLOR"===t&&(e.semantic="COLOR_0"))})})}function x(e){var t={};r.mesh(e,function(e){r.meshPrimitive(e,function(e){r.meshPrimitiveAttribute(e,function(e,r){if("_"!==r.charAt(0)){var i=r.search(/_[0-9]+/g),n=r;if(i>=0&&(n=r.substring(0,i)),!c(U[n])){var o="_"+r;t[r]=o}}});for(var i in t)if(t.hasOwnProperty(i)){var n=t[i],o=e.attributes[i];c(o)&&(delete e.attributes[i],e.attributes[n]=o)}})}),r.technique(e,function(e){r.techniqueParameter(e,function(e){var r=t[e.semantic];c(r)&&(e.semantic=r)})})}function P(e){r.technique(e,function(e){var t=e.states;if(c(t)){var r=t.functions;c(r)&&delete r.scissor;var i=t.enable;if(c(i)){var n=i.indexOf(h.SCISSOR_TEST);n>=0&&i.splice(n,1)}}})}function I(e){r.technique(e,function(e){var t=e.states;if(c(t)){var r=t.functions;if(c(r)){var i=r.blendColor;if(c(i))for(var n=0;n<4;n++)i[n]=a.clamp(i[n],0,1);var o=r.depthRange;c(o)&&(o[1]=a.clamp(o[1],0,1),o[0]=a.clamp(o[0],0,o[1]))}}})}function D(e){r.camera(e,function(e){var t=e.perspective;if(c(t)){var r=t.aspectRatio;c(r)&&0===r&&delete t.aspectRatio;var i=t.yfov;c(i)&&0===i&&(t.yfov=1)}})}function O(e){r.buffer(e,function(e){c(e.byteLength)||(e.byteLength=e.extras._pipeline.source.length)}),r.bufferView(e,function(t){if(!c(t.byteLength)){var r=t.buffer,i=e.buffers[r];t.byteLength=i.byteLength}})}function M(e){var n=e.bufferViews,o={};r.accessor(e,function(r){var a=r.bufferView;if(c(a)){c(o[a])||(o[a]=!0);var l=s(n[a]),u=c(r.byteStride)&&0!==r.byteStride?r.byteStride:i(e,r);c(u)&&(l.byteStride=u,0!==l.byteStride&&(l.byteLength=r.count*u),l.byteOffset+=r.byteOffset,r.byteOffset=0,delete r.byteStride),r.bufferView=t(n,l)}});var a={},l=0;r.bufferView(e,function(e,t){c(o[t])?l++:a[t]=t-l});var u=0;for(var d in o)if(c(d)){var h=parseInt(d)-u;n.splice(h,1),u++}r.accessor(e,function(e){var t=e.bufferView;c(t)&&(e.bufferView=a[t])}),r.shader(e,function(e){var t=e.bufferView;c(t)&&(e.bufferView=a[t])}),r.image(e,function(e){var t=e.bufferView;if(c(t)&&(e.bufferView=a[t]),c(e.extras)){var r=e.extras.compressedImage3DTiles;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i],o=n.bufferView;c(o)&&(n.bufferView=a[o])}}})}function R(e){r.technique(e,function(e){r.techniqueAttribute(e,function(t){var r=e.parameters[t];c(r.value)&&delete r.value})})}function L(e){r.technique(e,function(e){r.techniqueParameter(e,function(e){if(c(e.count)){var t=e.semantic;(!c(t)||"JOINTMATRIX"!==t&&0!==t.indexOf("_"))&&delete e.count}})})}function N(t){var r=t.techniques;c(r)&&r.length>0&&e(t,"KHR_technique_webgl")}function k(e){c(e.asset)||(e.asset={}),e.asset.version="2.0",f(e),b(e),S(e),T(e),w(e),O(e),M(e),A(e),E(e),x(e),P(e),I(e),D(e),R(e),L(e),N(e)}var F={.8:y,"1.0":k,"2.0":void 0},B={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0},U={POSITION:!0,NORMAL:!0,TEXCOORD:!0,COLOR:!0,JOINT:!0,WEIGHT:!0};return p}),define("ThirdParty/GltfPipeline/parseBinaryGltf",["./addPipelineExtras","./removeExtensionsUsed","./updateVersion","../../Core/ComponentDatatype","../../Core/defined","../../Core/DeveloperError","../../Core/getMagic","../../Core/getStringFromTypedArray","../../Core/WebGLConstants"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(u){var c=i.createArrayBufferView(l.INT,u.buffer,u.byteOffset,5);if("glTF"!==a(u))throw new o("File is not valid binary glTF");var d=c[1];if(1!==d&&2!==d)throw new o("Binary glTF version is not 1 or 2");var h,p,f;if(1===d){f=c[2];var m=c[3];if(0!==c[4])throw new o("Binary glTF scene format is not JSON");var g=20+m,_=s(u,20,m);h=JSON.parse(_);var v=u.subarray(g,f);if(p=h.buffers,n(p)&&Object.keys(p).length>0){var y=p.binary_glTF;n(y)||(y=p.KHR_binary_glTF),n(y)&&(y.extras={_pipeline:{source:v}})}r(h),t(h,"KHR_binary_glTF"),e(h)}if(2===d){f=c[2];for(var b,C=12;C<f;){var S=i.createArrayBufferView(l.INT,u.buffer,u.byteOffset+C,2),T=S[0],w=S[1];C+=8;var A=u.subarray(C,C+T);if(C+=T,1313821514===w){var E=s(A);h=JSON.parse(E),e(h)}else 5130562===w&&(b=A)}if(n(h)&&n(b)&&(p=h.buffers,n(p)&&p.length>0)){p[0].extras._pipeline.source=b}}return h}return u}),define("ThirdParty/GltfPipeline/techniqueParameterForSemantic",["../../Core/defined"],function(e){"use strict";function t(t,r){var i=t.parameters;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n],a=o.semantic;if(e(a)&&a===r)return n}}return t}),define("ThirdParty/GltfPipeline/webGLConstantToGlslType",["../../Core/WebGLConstants"],function(e){"use strict";function t(t){switch(t){case e.FLOAT:return"float";case e.FLOAT_VEC2:return"vec2";case e.FLOAT_VEC3:return"vec3";case e.FLOAT_VEC4:return"vec4";case e.FLOAT_MAT2:return"mat2";case e.FLOAT_MAT3:return"mat3";case e.FLOAT_MAT4:return"mat4";case e.SAMPLER_2D:return"sampler2D";case e.BOOL:return"bool"}}return t}),define("ThirdParty/GltfPipeline/glslTypeToWebGLConstant",["../../Core/WebGLConstants"],function(e){"use strict";function t(t){switch(t){case"float":return e.FLOAT;case"vec2":return e.FLOAT_VEC2;case"vec3":return e.FLOAT_VEC3;case"vec4":return e.FLOAT_VEC4;case"mat2":return e.FLOAT_MAT2;case"mat3":return e.FLOAT_MAT3;case"mat4":return e.FLOAT_MAT4;case"sampler2D":return e.SAMPLER_2D}}return t}),define("ThirdParty/GltfPipeline/processModelMaterialsCommon",["./addToArray","./ForEach","./numberOfComponentsForType","./techniqueParameterForSemantic","./webGLConstantToGlslType","./glslTypeToWebGLConstant","../../Core/clone","../../Core/defined","../../Core/defaultValue","../../Core/WebGLConstants"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r){if(r=l(r,{}),s(e)){var i=!1,n=e.extensionsRequired,o=e.extensionsUsed;if(s(o)){var a=o.indexOf("KHR_materials_common");a>=0&&(o.splice(a,1),i=!0),s(n)&&(a=n.indexOf("KHR_materials_common"))>=0&&n.splice(a,1)}if(i){s(e.programs)||(e.programs=[]),s(e.shaders)||(e.shaders=[]),s(e.techniques)||(e.techniques=[]),m(e);var u=d(e);y(e);var c={};t.material(e,function(t){if(s(t.extensions)&&s(t.extensions.KHR_materials_common)){var i=t.extensions.KHR_materials_common,n=f(i),o=c[n];s(o)||(o=h(e,i,u,r),c[n]=o),t.values={};var a=i.values;for(var l in a)if(a.hasOwnProperty(l)){var d=a[l];t.values[l]=d}t.technique=o,delete t.extensions.KHR_materials_common,0===Object.keys(t.extensions).length&&delete t.extensions}}),s(e.extensions)&&(delete e.extensions.KHR_materials_common,0===Object.keys(e.extensions).length&&delete e.extensions),v(e)}return e}}function d(e){var t,r={};if(s(e.extensions)&&s(e.extensions.KHR_materials_common)&&(t=e.extensions.KHR_materials_common.lights),s(t)){var i=e.nodes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];if(s(o.extensions)&&s(o.extensions.KHR_materials_common)){var a=o.extensions.KHR_materials_common.light;s(a)&&s(t[a])&&(t[a].node=n),delete o.extensions.KHR_materials_common}}var l=0;for(var c in t)if(t.hasOwnProperty(c)){var d=t[c],h=d.type;if("ambient"!==h&&!s(d.node)){delete t[c];continue}var p="light"+l.toString();switch(d.baseName=p,h){case"ambient":var f=d.ambient;r[p+"Color"]={type:u.FLOAT_VEC3,value:f.color};break;case"directional":var m=d.directional;r[p+"Color"]={type:u.FLOAT_VEC3,value:m.color},s(d.node)&&(r[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:u.FLOAT_MAT4});break;case"point":var g=d.point;r[p+"Color"]={type:u.FLOAT_VEC3,value:g.color},s(d.node)&&(r[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:u.FLOAT_MAT4}),r[p+"Attenuation"]={type:u.FLOAT_VEC3,value:[g.constantAttenuation,g.linearAttenuation,g.quadraticAttenuation]};break;case"spot":var _=d.spot;r[p+"Color"]={type:u.FLOAT_VEC3,value:_.color},s(d.node)&&(r[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:u.FLOAT_MAT4},r[p+"InverseTransform"]={node:d.node,semantic:"MODELVIEWINVERSE",type:u.FLOAT_MAT4,useInFragment:!0}),r[p+"Attenuation"]={type:u.FLOAT_VEC3,value:[_.constantAttenuation,_.linearAttenuation,_.quadraticAttenuation]},r[p+"FallOff"]={type:u.FLOAT_VEC2,value:[_.fallOffAngle,_.fallOffExponent]}}++l}}return r}function h(t,i,a,c){var d,h=l(c.optimizeForCesium,!1),f=s(t.extensions)&&s(t.extensions.CESIUM_RTC),m=l(c.addBatchIdToGeneratedShaders,!1),_=t.techniques,v=t.shaders,y=t.programs,b=i.technique.toUpperCase();s(t.extensions)&&s(t.extensions.KHR_materials_common)&&(d=t.extensions.KHR_materials_common.lights);var C=i.values;s(i.transparent)&&(C.transparent=i.transparent),s(i.doubleSided)&&(C.doubleSided=i.doubleSided);var S=l(i.jointCount,0),T=S>0,w=i.extras._pipeline.primitive,A=w.skinning,E=w.hasVertexColors,x="precision highp float;\n",P="precision highp float;\n",I="CONSTANT"!==b,D={modelViewMatrix:{semantic:f?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:u.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:u.FLOAT_MAT4}};I&&(D.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:u.FLOAT_MAT3}),T&&(D.jointMatrix={count:S,semantic:"JOINTMATRIX",type:u.FLOAT_MAT4});var O,M=!1;for(var R in C)if(C.hasOwnProperty(R)&&"transparent"!==R&&"doubleSided"!==R){var L=p(R,C[R]);O=R.toLowerCase(),M||L!==u.SAMPLER_2D||(M=!0),D[O]={type:L}}if(s(D.diffuse)&&h&&(D.diffuse.semantic="_3DTILESDIFFUSE"),s(a))for(var N in a)a.hasOwnProperty(N)&&(D[N]=a[N]);var k={};for(var F in D)if(D.hasOwnProperty(F)&&"extras"!==F){var B=D[F];k["u_"+F]=F;var U=s(B.count)?"["+B.count+"]":"";B.type!==u.FLOAT_MAT3&&B.type!==u.FLOAT_MAT4||B.useInFragment?(P+="uniform "+n(B.type)+" u_"+F+U+";\n",delete B.useInFragment):x+="uniform "+n(B.type)+" u_"+F+U+";\n"}var V="";if(T){var z,G,H=r(A.type),W=!1;if(0===A.type.indexOf("MAT")&&(W=!0,H=Math.sqrt(H)),W)for(z=0;z<H;z++)for(G=0;G<H;G++)V+=0===z&&0===G?"  mat4 skinMat = ":"  skinMat += ",V+="a_weight["+z+"]["+G+"] * u_jointMatrix[int(a_joint["+z+"]["+G+"])];\n";else for(z=0;z<H;z++)V+=0===z?"  mat4 skinMat = ":"  skinMat += ",V+="a_weight["+z+"] * u_jointMatrix[int(a_joint["+z+"])];\n"}var j={a_position:"position"};D.position={semantic:"POSITION",type:u.FLOAT_VEC3},x+="attribute vec3 a_position;\n",x+="varying vec3 v_positionEC;\n",V+=T?"  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",P+="varying vec3 v_positionEC;\n",I&&(j.a_normal="normal",D.normal={semantic:"NORMAL",type:u.FLOAT_VEC3},x+="attribute vec3 a_normal;\n",x+="varying vec3 v_normal;\n",V+=T?"  v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":"  v_normal = u_normalMatrix * a_normal;\n",P+="varying vec3 v_normal;\n");var q;if(M&&(j.a_texcoord_0="texcoord_0",D.texcoord_0={semantic:"TEXCOORD_0",type:u.FLOAT_VEC2},q="v_texcoord_0",x+="attribute vec2 a_texcoord_0;\n",x+="varying vec2 "+q+";\n",V+="  "+q+" = a_texcoord_0;\n",P+="varying vec2 "+q+";\n"),T){j.a_joint="joint";var Y=g(A.type),X=o(Y);D.joint={semantic:"JOINT",type:X},j.a_weight="weight",D.weight={semantic:"WEIGHT",type:X},x+="attribute "+Y+" a_joint;\n",x+="attribute "+Y+" a_weight;\n"}E&&(j.a_vertexColor="vertexColor",D.vertexColor={semantic:"COLOR_0",type:u.FLOAT_VEC4},x+="attribute vec4 a_vertexColor;\n",x+="varying vec4 v_vertexColor;\n",V+="  v_vertexColor = a_vertexColor;\n",P+="varying vec4 v_vertexColor;\n"),m&&(j.a_batchId="batchId",D.batchId={semantic:"_BATCHID",type:u.FLOAT},x+="attribute float a_batchId;\n");var Q=I&&("BLINN"===b||"PHONG"===b)&&s(D.specular)&&s(D.shininess)&&D.shininess>0,Z=!1,K=!1,J="";for(var $ in d)if(d.hasOwnProperty($)){var ee=d[$],te=ee.type.toLowerCase(),re=ee.baseName;J+="  {\n";var ie,ne,oe="u_"+re+"Color";"ambient"===te?(K=!0,J+="    ambientLight += "+oe+";\n"):I&&(Z=!0,ie="v_"+re+"Direction",ne="v_"+re+"Position","point"!==te&&(x+="varying vec3 "+ie+";\n",P+="varying vec3 "+ie+";\n",V+="  "+ie+" = mat3(u_"+re+"Transform) * vec3(0.,0.,1.);\n","directional"===te&&(J+="    vec3 l = normalize("+ie+");\n")),"directional"!==te?(x+="varying vec3 "+ne+";\n",P+="varying vec3 "+ne+";\n",V+="  "+ne+" = u_"+re+"Transform[3].xyz;\n",J+="    vec3 VP = "+ne+" - v_positionEC;\n",J+="    vec3 l = normalize(VP);\n",J+="    float range = length(VP);\n",J+="    float attenuation = 1.0 / (u_"+re+"Attenuation.x + ",J+="(u_"+re+"Attenuation.y * range) + ",J+="(u_"+re+"Attenuation.z * range * range));\n"):J+="    float attenuation = 1.0;\n","spot"===te&&(J+="    float spotDot = dot(l, normalize("+ie+"));\n",J+="    if (spotDot < cos(u_"+re+"FallOff.x * 0.5))\n",J+="    {\n",J+="      attenuation = 0.0;\n",J+="    }\n",J+="    else\n",J+="    {\n",J+="        attenuation *= max(0.0, pow(spotDot, u_"+re+"FallOff.y));\n",J+="    }\n"),J+="    diffuseLight += "+oe+"* max(dot(normal,l), 0.) * attenuation;\n",Q&&("BLINN"===b?(J+="    vec3 h = normalize(l + viewDir);\n",J+="    float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(J+="    vec3 reflectDir = reflect(-l, normal);\n",J+="    float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),J+="    specularLight += "+oe+" * specularIntensity;\n")),J+="  }\n"}if(K||(J+="  ambientLight += vec3(0.2, 0.2, 0.2);\n"),!Z&&"CONSTANT"!==b){J+=h?"  vec3 l = normalize(czm_sunDirectionEC);\n":"  vec3 l = vec3(0.0, 0.0, 1.0);\n";J+="  diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), "+(h?"0.2":"0.0")+");\n",Q&&("BLINN"===b?(J+="  vec3 h = normalize(l + viewDir);\n",J+="  float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(J+="  vec3 reflectDir = reflect(-l, normal);\n",J+="  float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),J+="  specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")}x+="void main(void) {\n",x+=V,x+="}\n",P+="void main(void) {\n";var ae="  vec3 color = vec3(0.0, 0.0, 0.0);\n";I&&(P+="  vec3 normal = normalize(v_normal);\n",i.doubleSided&&(P+="  if (gl_FrontFacing == false)\n",P+="  {\n",P+="    normal = -normal;\n",P+="  }\n"));var se;"CONSTANT"!==b?(s(D.diffuse)&&(D.diffuse.type===u.SAMPLER_2D?P+="  vec4 diffuse = texture2D(u_diffuse, "+q+");\n":P+="  vec4 diffuse = u_diffuse;\n",P+="  vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",ae+="  color += diffuse.rgb * diffuseLight;\n"),Q&&(D.specular.type===u.SAMPLER_2D?P+="  vec3 specular = texture2D(u_specular, "+q+").rgb;\n":P+="  vec3 specular = u_specular.rgb;\n",P+="  vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",ae+="  color += specular * specularLight;\n"),se=s(D.transparency)?"  gl_FragColor = vec4(color * diffuse.a * u_transparency, diffuse.a * u_transparency);\n":"  gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):se=s(D.transparency)?"  gl_FragColor = vec4(color * u_transparency, u_transparency);\n":"  gl_FragColor = vec4(color, 1.0);\n",E&&(ae+="  color *= v_vertexColor.rgb;\n"),s(D.emission)&&(D.emission.type===u.SAMPLER_2D?P+="  vec3 emission = texture2D(u_emission, "+q+").rgb;\n":P+="  vec3 emission = u_emission.rgb;\n",ae+="  color += emission;\n"),(s(D.ambient)||"CONSTANT"!==b)&&(s(D.ambient)?D.ambient.type===u.SAMPLER_2D?P+="  vec3 ambient = texture2D(u_ambient, "+q+").rgb;\n":P+="  vec3 ambient = u_ambient.rgb;\n":P+="  vec3 ambient = diffuse.rgb;\n",ae+="  color += ambient * ambientLight;\n"),P+="  vec3 viewDir = -normalize(v_positionEC);\n",P+="  vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",P+=J,P+=ae,P+=se,P+="}\n";var le;le=C.transparent?{enable:[u.DEPTH_TEST,u.BLEND],functions:{depthMask:[!1],blendEquationSeparate:[u.FUNC_ADD,u.FUNC_ADD],blendFuncSeparate:[u.ONE,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA]}}:i.doubleSided?{enable:[u.DEPTH_TEST]}:{enable:[u.CULL_FACE,u.DEPTH_TEST]};var ue=e(v,{type:u.VERTEX_SHADER,extras:{_pipeline:{source:x,extension:".glsl"}}}),ce=e(v,{type:u.FRAGMENT_SHADER,extras:{_pipeline:{source:P,extension:".glsl"}}}),de=Object.keys(j),he=e(y,{attributes:de,fragmentShader:ce,vertexShader:ue});return e(_,{attributes:j,parameters:D,program:he,states:le,uniforms:k})}function p(e,t){var r;switch(r=s(t.value)?t.value:s(t.index)?[t.index]:t,e){case"ambient":case"diffuse":case"emission":case"specular":return 1===r.length?u.SAMPLER_2D:u.FLOAT_VEC4;case"shininess":case"transparency":return u.FLOAT;case"transparent":case"doubleSided":return u.BOOL}}function f(e){var t="";t+="technique:"+e.technique+";";for(var r=e.values,i=Object.keys(r).sort(),n=i.length,o=0;o<n;++o){var a=i[o];r.hasOwnProperty(a)&&(t+=a+":"+p(a,r[a]),t+=";")}t+=l(e.doubleSided,l(e.values.doubleSided,!1)).toString()+";",t+=l(e.transparent,l(e.values.transparent,!1)).toString()+";";var s=l(e.jointCount,0);t+=s.toString()+";";var u=e.extras._pipeline.primitive,c=u.skinning;return s>0&&(t+=c.type+";"),t+=u.hasVertexColors}function m(e){s(e.extensions)||(e.extensions={});var t=e.extensions;s(t.KHR_materials_common)||(t.KHR_materials_common={});var r=t.KHR_materials_common;s(r.lights)||(r.lights={});for(var i=r.lights,n=i.length,o=0;o<n;o++){var a=i[o];if("ambient"===a.type){s(a.ambient)||(a.ambient={});var u=a.ambient;s(u.color)||(u.color=[1,1,1])}else if("directional"===a.type){s(a.directional)||(a.directional={});var c=a.directional;s(c.color)||(c.color=[1,1,1])}else if("point"===a.type){s(a.point)||(a.point={});var d=a.point;s(d.color)||(d.color=[1,1,1]),d.constantAttenuation=l(d.constantAttenuation,1),d.linearAttenuation=l(d.linearAttenuation,0),d.quadraticAttenuation=l(d.quadraticAttenuation,0)}else if("spot"===a.type){s(a.spot)||(a.spot={});var h=a.spot;s(h.color)||(h.color=[1,1,1]),h.constantAttenuation=l(h.constantAttenuation,1),h.fallOffAngle=l(h.fallOffAngle,3.14159265),h.fallOffExponent=l(h.fallOffExponent,0),h.linearAttenuation=l(h.linearAttenuation,0),h.quadraticAttenuation=l(h.quadraticAttenuation,0)}}}function g(e){return"SCALAR"===e?"float":e.toLowerCase()}function _(e,t){var r=e.accessors,n=e.materials,o=e.techniques,a=e.programs,l=e.shaders,u=t.attributes,c=n[t.material],d=o[c.technique],h=a[d.program],p=l[h.vertexShader];for(var f in u)if(u.hasOwnProperty(f)&&!s(i(d,f))){var m=u[f],_=r[m],v=f.toLowerCase();"_"===v.charAt(0)&&(v=v.slice(1));var y="a_"+v;d.parameters[v]={semantic:f,type:_.componentType},d.attributes[y]=v,h.attributes.push(y);var b=p.extras._pipeline,C=b.source;C="attribute "+g(_.type)+" "+y+";\n"+C,b.source=C}}function v(e){t.mesh(e,function(r){t.meshPrimitive(r,function(t){_(e,t)})})}function y(r){var i=r.accessors,n=r.materials;t.mesh(r,function(r){t.meshPrimitive(r,function(t){var r=t.material,o=n[r];if(s(o.extensions)&&s(o.extensions.KHR_materials_common)){var l,u,c=o.extensions.KHR_materials_common,d=t.attributes.JOINT;if(s(d)){var h=i[d];l=h.componentType,u=h.type}var p=s(d),f=s(t.attributes.COLOR_0),m=c.extras._pipeline.primitive;if(s(m)){if(m.skinning.skinned!==p||m.skinning.type!==u||m.hasVertexColors!==f){var g=a(o,!0);g.extensions.KHR_materials_common.extras._pipeline.primitive={skinning:{skinned:p,componentType:l,type:u},hasVertexColors:f},r=e(n,g),t.material=r}}else c.extras._pipeline.primitive={skinning:{skinned:p,componentType:l,type:u},hasVertexColors:f}}})})}return c}),define("ThirdParty/GltfPipeline/processPbrMetallicRoughness",["./addToArray","./ForEach","./numberOfComponentsForType","./techniqueParameterForSemantic","./webGLConstantToGlslType","./glslTypeToWebGLConstant","../../Core/clone","../../Core/defined","../../Core/defaultValue","../../Core/WebGLConstants"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r){r=l(r,{});var i=!1;return t.material(e,function(e){s(e.pbrMetallicRoughness)&&(i=!0)}),i&&(s(e.programs)||(e.programs=[]),s(e.shaders)||(e.shaders=[]),s(e.techniques)||(e.techniques=[]),g(e),t.material(e,function(t){var i=t.pbrMetallicRoughness;if(s(i)){var n=d(e,t,r);t.values=i,t.technique=n,delete t.pbrMetallicRoughness}}),m(e)),e}function d(i,a,c){var d=l(c.optimizeForCesium,!1),f=s(i.extensions)&&s(i.extensions.CESIUM_RTC),m=l(c.addBatchIdToGeneratedShaders,!1),g=i.techniques,_=i.shaders,v=i.programs,y=a.pbrMetallicRoughness;for(var b in a)(a.hasOwnProperty(b)&&(b.indexOf("Texture")>=0||b.indexOf("Factor")>=0)||"doubleSided"===b)&&(y[b]=a[b]);var C,S="precision highp float;\n",T="precision highp float;\n";s(i.skins)&&(C=i.skins[0]);var w,A=s(C)?C.joints:[],E=A.length,x=a.extras._pipeline.primitive,P=x.skinning,I=P.skinned,D=x.hasVertexColors,O=!1,M=!1;t.mesh(i,function(e){t.meshPrimitive(e,function(e){var t=e.targets;!M&&s(t)&&(M=!0,w=t);var r=e.attributes;for(var i in r)i.indexOf("TANGENT")>=0&&(O=!0)})});var R={modelViewMatrix:{semantic:f?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:u.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:u.FLOAT_MAT4}};R.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:u.FLOAT_MAT3},I&&(R.jointMatrix={count:E,semantic:"JOINTMATRIX",type:u.FLOAT_MAT4}),M&&(R.morphWeights={count:w.length,semantic:"MORPHWEIGHTS",type:u.FLOAT});var L=!1;for(var N in y)if(y.hasOwnProperty(N)){var k=h(N);L||k!==u.SAMPLER_2D||(L=!0),R[N]={type:k}}var F={};for(var B in R)if(R.hasOwnProperty(B)&&"extras"!==B){var U=R[B];F["u_"+B]=B;var V=s(U.count)?"["+U.count+"]":"";U.type!==u.FLOAT_MAT3&&U.type!==u.FLOAT_MAT4&&"morphWeights"!==B||U.useInFragment?(T+="uniform "+n(U.type)+" u_"+B+V+";\n",delete U.useInFragment):S+="uniform "+n(U.type)+" u_"+B+V+";\n"}var z="";if(I){var G,H,W=r(P.type),j=!1;if(0===P.type.indexOf("MAT")&&(j=!0,W=Math.sqrt(W)),j)for(G=0;G<W;G++)for(H=0;H<W;H++)z+=0===G&&0===H?"    mat4 skinMatrix = ":"    skinMatrix += ",z+="a_weight["+G+"]["+H+"] * u_jointMatrix[int(a_joint["+G+"]["+H+"])];\n";else for(G=0;G<W;G++)z+=0===G?"    mat4 skinMatrix = ":"    skinMatrix += ",z+="a_weight["+G+"] * u_jointMatrix[int(a_joint["+G+"])];\n"}var q={a_position:"position"};if(R.position={semantic:"POSITION",type:u.FLOAT_VEC3},S+="attribute vec3 a_position;\n",S+="varying vec3 v_positionEC;\n",d&&(S+="varying vec3 v_positionWC;\n"),z+="    vec3 weightedPosition = a_position;\n",z+="    vec3 weightedNormal = a_normal;\n",O&&(z+="    vec3 weightedTangent = a_tangent;\n"),M)for(var Y=0;Y<w.length;Y++){var X=w[Y];for(var Q in X)if(X.hasOwnProperty(Q)&&"extras"!==Q){var Z=Q.toLowerCase()+"_"+Y;q["a_"+Z]=Z,R[Z]={semantic:Q+"_"+Y,type:u.FLOAT_VEC3},S+="attribute vec3 a_"+Z+";\n","POSITION"===Q?z+="    weightedPosition += u_morphWeights["+Y+"] * a_"+Z+";\n":"NORMAL"===Q?z+="    weightedNormal += u_morphWeights["+Y+"] * a_"+Z+";\n":"TANGENT"===Q&&(z+="    weightedTangent += u_morphWeights["+Y+"] * a_"+Z+";\n")}}z+=I?"    vec4 position = skinMatrix * vec4(weightedPosition, 1.0);\n":"    vec4 position = vec4(weightedPosition, 1.0);\n",d&&(z+="    v_positionWC = (czm_model * position).xyz;\n"),z+="    position = u_modelViewMatrix * position;\n",z+="    v_positionEC = position.xyz;\n",z+="    gl_Position = u_projectionMatrix * position;\n",T+="varying vec3 v_positionEC;\n",d&&(T+="varying vec3 v_positionWC;\n"),q.a_normal="normal",R.normal={semantic:"NORMAL",type:u.FLOAT_VEC3},S+="attribute vec3 a_normal;\n",S+="varying vec3 v_normal;\n",z+=I?"    v_normal = u_normalMatrix * mat3(skinMatrix) * weightedNormal;\n":"    v_normal = u_normalMatrix * weightedNormal;\n",T+="varying vec3 v_normal;\n",O&&(q.a_tangent="tangent",R.tangent={semantic:"TANGENT",type:u.FLOAT_VEC3},S+="attribute vec3 a_tangent;\n",S+="varying vec3 v_tangent;\n",z+="    v_tangent = (u_modelViewMatrix * vec4(weightedTangent, 1.0)).xyz;\n",T+="varying vec3 v_tangent;\n");var K;if(L&&(q.a_texcoord_0="texcoord_0",R.texcoord_0={semantic:"TEXCOORD_0",type:u.FLOAT_VEC2},K="v_texcoord_0",S+="attribute vec2 a_texcoord_0;\n",S+="varying vec2 "+K+";\n",z+="    "+K+" = a_texcoord_0;\n",T+="varying vec2 "+K+";\n"),I){q.a_joint="joint";var J=p(P.type),$=o(J);R.joint={semantic:"JOINTS_0",type:$},q.a_weight="weight",R.weight={semantic:"WEIGHTS_0",type:$},S+="attribute "+J+" a_joint;\n",S+="attribute "+J+" a_weight;\n"}D&&(q.a_vertexColor="vertexColor",R.vertexColor={semantic:"COLOR_0",type:u.FLOAT_VEC4},S+="attribute vec4 a_vertexColor;\n",S+="varying vec4 v_vertexColor;\n",z+="  v_vertexColor = a_vertexColor;\n",T+="varying vec4 v_vertexColor;\n"),m&&(q.a_batchId="batchId",R.batchId={semantic:"_BATCHID",type:u.FLOAT},S+="attribute float a_batchId;\n"),S+="void main(void) \n{\n",S+=z,S+="}\n",T+="const float M_PI = 3.141592653589793;\n",T+="vec3 lambertianDiffuse(vec3 baseColor) \n{\n    return baseColor / M_PI;\n}\n\n",T+="vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) \n{\n    return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\n\n",T+="vec3 fresnelSchlick(float metalness, float VdotH) \n{\n    return metalness + (vec3(1.0) - metalness) * pow(1.0 - VdotH, 5.0);\n}\n\n",T+="float smithVisibilityG1(float NdotV, float roughness) \n{\n    float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n    return NdotV / (NdotV * (1.0 - k) + k);\n}\n\n",T+="float smithVisibilityGGX(float roughness, float NdotL, float NdotV) \n{\n    return smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness);\n}\n\n",T+="float GGX(float roughness, float NdotH) \n{\n    float roughnessSquared = roughness * roughness;\n    float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n    return roughnessSquared / (M_PI * f * f);\n}\n\n",T+="void main(void) \n{\n",T+="    vec3 ng = normalize(v_normal);\n",s(y.normalTexture)?O?(T+="    vec3 t = normalize(v_tangent);\n",T+="    vec3 b = normalize(cross(ng, t));\n",T+="    mat3 tbn = mat3(t, b, ng);\n",T+="    vec3 n = texture2D(u_normalTexture, "+K+").rgb;\n",T+="    n = normalize(tbn * (2.0 * n - 1.0));\n"):(T="#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"+T,T+="#ifdef GL_OES_standard_derivatives\n",T+="    vec3 pos_dx = dFdx(v_positionEC);\n",T+="    vec3 pos_dy = dFdy(v_positionEC);\n",T+="    vec3 tex_dx = dFdx(vec3("+K+",0.0));\n",T+="    vec3 tex_dy = dFdy(vec3("+K+",0.0));\n",T+="    vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n",T+="    t = normalize(t - ng * dot(ng, t));\n",T+="    vec3 b = normalize(cross(ng, t));\n",T+="    mat3 tbn = mat3(t, b, ng);\n",T+="    vec3 n = texture2D(u_normalTexture, "+K+").rgb;\n",
T+="    n = normalize(tbn * (2.0 * n - 1.0));\n",T+="#else\n",T+="    vec3 n = ng;\n",T+="#endif\n"):T+="    vec3 n = ng;\n",y.doubleSided&&(T+="    if (!gl_FrontFacing)\n",T+="    {\n",T+="        n = -n;\n",T+="    }\n"),s(y.baseColorTexture)?(T+="    vec4 baseColorWithAlpha = texture2D(u_baseColorTexture, "+K+");\n",s(y.baseColorFactor)&&(T+="    baseColorWithAlpha *= u_baseColorFactor;\n")):s(y.baseColorFactor)?T+="    vec4 baseColorWithAlpha = u_baseColorFactor;\n":T+="    vec4 baseColorWithAlpha = vec4(1.0);\n",D&&(T+="    baseColorWithAlpha *= v_vertexColor;\n"),T+="    vec3 baseColor = baseColorWithAlpha.rgb;\n",s(y.metallicRoughnessTexture)?(T+="    vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, "+K+").rgb;\n",T+="    float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n",T+="    float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n",s(y.metallicFactor)&&(T+="    metalness *= u_metallicFactor;\n"),s(y.roughnessFactor)&&(T+="    roughness *= u_roughnessFactor;\n")):(s(y.metallicFactor)?T+="    float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n":T+="    float metalness = 1.0;\n",s(y.roughnessFactor)?T+="    float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n":T+="    float roughness = 1.0;\n"),T+="    vec3 v = -normalize(v_positionEC);\n",T+="    vec3 lightColor = vec3(1.0, 1.0, 1.0);\n",T+=d?"    vec3 l = normalize(czm_sunDirectionEC);\n":"    vec3 l = vec3(0.0, 0.0, 1.0);\n",T+="    vec3 h = normalize(v + l);\n",d?(T+="    vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n",T+="    czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n",T+="    float vertexRadius = length(v_positionWC);\n",T+="    float horizonDotNadir = 1.0 - ellipsoid.radii.x / vertexRadius;\n",T+="    float reflectionDotNadir = dot(r, normalize(v_positionWC));\n",T+="    r.x = -r.x;\n",T+="    r = -normalize(czm_temeToPseudoFixed * r);\n",T+="    r.x = -r.x;\n"):T+="    vec3 r = normalize(reflect(v, n));\n",T+="    float NdotL = clamp(dot(n, l), 0.001, 1.0);\n",T+="    float NdotV = abs(dot(n, v)) + 0.001;\n",T+="    float NdotH = clamp(dot(n, h), 0.0, 1.0);\n",T+="    float LdotH = clamp(dot(l, h), 0.0, 1.0);\n",T+="    float VdotH = clamp(dot(v, h), 0.0, 1.0);\n",T+="    vec3 f0 = vec3(0.04);\n",T+="    float alpha = roughness * roughness;\n",T+="    vec3 diffuseColor = baseColor * (1.0 - metalness);\n",T+="    vec3 specularColor = mix(f0, baseColor, metalness);\n",T+="    float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n",T+="    vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n",T+="    vec3 r0 = specularColor.rgb;\n",T+="    vec3 F = fresnelSchlick2(r0, r90, VdotH);\n",T+="    float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n",T+="    float D = GGX(alpha, NdotH);\n",T+="    vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(baseColor);\n",T+="    vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n",T+="    vec3 color = NdotL * lightColor * (diffuseContribution + specularContribution);\n",d&&(T+="    float inverseRoughness = 1.0 - roughness;\n",T+="    inverseRoughness *= inverseRoughness;\n",T+="    vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n",T+="    float atmosphereHeight = 0.05;\n",T+="    float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n",T+="    float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n",T+="    float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n",T+="    float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n",T+="    float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n",T+="    float lightScale = smoothstepHeight * 1.5 + 1.0;\n",T+="    vec3 diffuseIrradiance = mix(vec3(0.5), vec3(0.05), smoothstepHeight);\n",T+="    vec3 belowHorizonColor = mix(vec3(0.1, 0.2, 0.4), vec3(0.2, 0.5, 0.7), smoothstepHeight);\n",T+="    vec3 nadirColor = belowHorizonColor * 0.5;\n",T+="    vec3 aboveHorizonColor = vec3(0.8, 0.9, 0.95);\n",T+="    vec3 blueSkyColor = mix(vec3(0.09, 0.13, 0.24), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.5);\n",T+="    vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n",T+="    vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * inverseRoughness);\n",T+="    specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n",T+="    specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n",T+="    vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, 1.0 - roughness)).rg;\n",T+="    vec3 IBLColor = (diffuseIrradiance * diffuseColor) + (specularIrradiance * (specularColor * brdfLut.x + brdfLut.y));\n",T+="    color = color * lightScale + IBLColor;\n"),s(y.occlusionTexture)&&(T+="    color *= texture2D(u_occlusionTexture, "+K+").r;\n"),s(y.emissiveTexture)?(T+="    vec3 emissive = texture2D(u_emissiveTexture, "+K+").rgb;\n",s(y.emissiveFactor)&&(T+="    emissive *= u_emissiveFactor;\n"),T+="    color += emissive;\n"):s(y.emissiveFactor)&&(T+="    color += u_emissiveFactor;\n");var ee=a.alphaMode;if(s(ee))if("MASK"===ee){var te=a.alphaCutoff;s(te)?T+="    gl_FragColor = vec4(color, int(baseColorWithAlpha.a >= "+te+"));\n":T+="    gl_FragColor = vec4(color, 1.0);\n"}else T+="BLEND"===ee?"    gl_FragColor = vec4(color, baseColorWithAlpha.a);\n":"    gl_FragColor = vec4(color, 1.0);\n";else T+="    gl_FragColor = vec4(color, 1.0);\n";T+="}\n";var re;re=s(ee)&&"OPAQUE"!==ee?{enable:[u.DEPTH_TEST,u.BLEND],functions:{depthMask:[!1],blendEquationSeparate:[u.FUNC_ADD,u.FUNC_ADD],blendFuncSeparate:[u.ONE,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA]}}:y.doubleSided?{enable:[u.DEPTH_TEST]}:{enable:[u.CULL_FACE,u.DEPTH_TEST]};var ie=e(_,{type:u.VERTEX_SHADER,extras:{_pipeline:{source:S,extension:".glsl"}}}),ne=e(_,{type:u.FRAGMENT_SHADER,extras:{_pipeline:{source:T,extension:".glsl"}}}),oe=Object.keys(q),ae=e(v,{attributes:oe,fragmentShader:ne,vertexShader:ie});return e(g,{attributes:q,parameters:R,program:ae,states:re,uniforms:F})}function h(e){switch(e){case"baseColorFactor":return u.FLOAT_VEC4;case"metallicFactor":case"roughnessFactor":return u.FLOAT;case"baseColorTexture":case"metallicRoughnessTexture":case"normalTexture":case"occlusionTexture":case"emissiveTexture":return u.SAMPLER_2D;case"emissiveFactor":return u.FLOAT_VEC3;case"doubleSided":return u.BOOL}}function p(e){return"SCALAR"===e?"float":e.toLowerCase()}function f(e,t){var r=e.accessors,n=e.materials,o=e.techniques,a=e.programs,l=e.shaders,u=t.targets,c=t.attributes;for(var d in u)if(s(d)){var h=u[d];for(var f in h)"extras"!==f&&(c[f+"_"+d]=h[f])}var m=n[t.material],g=o[m.technique],_=a[g.program],v=l[_.vertexShader];for(var y in c)if(c.hasOwnProperty(y)&&!s(i(g,y))){var b=c[y],C=r[b],S=y.toLowerCase();"_"===S.charAt(0)&&(S=S.slice(1));var T="a_"+S;g.parameters[S]={semantic:y,type:C.componentType},g.attributes[T]=S,_.attributes.push(T);var w=v.extras._pipeline,A=w.source;A="attribute "+p(C.type)+" "+T+";\n"+A,w.source=A}}function m(e){t.mesh(e,function(r){t.meshPrimitive(r,function(t){f(e,t)})})}function g(r){var i=r.accessors,n=r.materials;t.mesh(r,function(r){t.meshPrimitive(r,function(t){var r,o,l=t.material,u=n[l],c=t.attributes.JOINTS_0;if(s(c)){var d=i[c];r=d.componentType,o=d.type}var h=s(c),p=s(t.attributes.COLOR_0),f=u.extras._pipeline.primitive;if(s(f)){if(f.skinning.skinned!==h||f.skinning.type!==o||f.hasVertexColors!==p){var m=a(u,!0);m.extras._pipeline.skinning={skinning:{skinned:h,componentType:r,type:o},hasVertexColors:p},l=e(n,m),t.material=l}}else u.extras._pipeline.primitive={skinning:{skinned:h,componentType:r,type:o},hasVertexColors:p}})})}return c}),define("Scene/AttributeType",["../Core/freezeObject"],function(e){"use strict";return e({SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"})}),define("Scene/Axis",["../Core/Check","../Core/freezeObject","../Core/Math","../Core/Matrix3","../Core/Matrix4"],function(e,t,r,i,n){"use strict";var o={X:0,Y:1,Z:2,Y_UP_TO_Z_UP:n.fromRotationTranslation(i.fromRotationX(r.PI_OVER_TWO)),Z_UP_TO_Y_UP:n.fromRotationTranslation(i.fromRotationX(-r.PI_OVER_TWO)),X_UP_TO_Z_UP:n.fromRotationTranslation(i.fromRotationY(-r.PI_OVER_TWO)),Z_UP_TO_X_UP:n.fromRotationTranslation(i.fromRotationY(r.PI_OVER_TWO)),X_UP_TO_Y_UP:n.fromRotationTranslation(i.fromRotationZ(r.PI_OVER_TWO)),Y_UP_TO_X_UP:n.fromRotationTranslation(i.fromRotationZ(-r.PI_OVER_TWO)),fromName:function(e){return o[e]}};return t(o)}),define("Scene/JobType",["../Core/freezeObject"],function(e){"use strict";return e({TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3})}),define("Scene/ModelAnimationCache",["./AttributeType","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Core/WebGLConstants","../Core/WeightSpline","../ThirdParty/GltfPipeline/getAccessorByteStride","../ThirdParty/GltfPipeline/numberOfComponentsForType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(){}function f(e,t){var r=e.gltf,i=r.buffers,n=r.bufferViews,o=n[t.bufferView],a=i[o.buffer],s=o.byteOffset+t.byteOffset,l=t.count*h(t.type),u=_.test(a.uri)?"":a.uri;return e.cacheKey+"//"+u+"/"+s+"/"+l}function m(e,t,r){return e.cacheKey+"//"+t+"/"+r}function g(e){this._value=e}var _=/^data\:/i,v={};p.getAnimationParameterValues=function(e,o){var a=f(e,o),l=v[a];if(!n(l)){var u=e.gltf,c=u.buffers,p=u.bufferViews,m=p[o.bufferView],g=m.buffer,_=c[g],y=_.extras._pipeline.source,b=o.componentType,C=o.type,S=h(C),T=o.count,w=d(u,o);l=new Array(T);for(var A=i(o.byteOffset,0),E=m.byteOffset+A,x=0;x<T;x++){var P=r.createArrayBufferView(b,y.buffer,y.byteOffset+E,S);"SCALAR"===C?l[x]=P[0]:"VEC3"===C?l[x]=t.fromArray(P):"VEC4"===C&&(l[x]=s.unpack(P)),E+=w}n(e.cacheKey)&&(v[a]=l)}return l};var y={};g.prototype.evaluate=function(e,t){return this._value},p.getAnimationSpline=function(e,t,r,i,a,s,u,d){var h=m(e,t,i),p=y[h];if(!n(p)){var f=s,_=d;1===f.length&&1===_.length?p=new g(_[0]):"LINEAR"===a.interpolation&&("translation"===u||"scale"===u?p=new o({times:f,points:_}):"rotation"===u?p=new l({times:f,points:_}):"weights"===u&&(p=new c({times:f,weights:_}))),n(e.cacheKey)&&(y[h]=p)}return p};var b={};return p.getSkinInverseBindMatrices=function(t,i){var o=f(t,i),s=b[o];if(!n(s)){var l=t.gltf,c=l.buffers,p=l.bufferViews,m=i.bufferView,g=p[m],_=g.buffer,v=c[_],y=v.extras._pipeline.source,C=i.componentType,S=i.type,T=i.count,w=d(l,i),A=g.byteOffset+i.byteOffset,E=h(S);if(s=new Array(T),C===u.FLOAT&&S===e.MAT4)for(var x=0;x<T;++x){var P=r.createArrayBufferView(C,y.buffer,y.byteOffset+A,E);s[x]=a.fromArray(P),A+=w}b[o]=s}return s},p}),define("Scene/ModelAnimationLoop",["../Core/freezeObject"],function(e){"use strict";return e({NONE:0,REPEAT:1,MIRRORED_REPEAT:2})}),define("Scene/ModelAnimationState",["../Core/freezeObject"],function(e){"use strict";return e({STOPPED:0,ANIMATING:1})}),define("Scene/ModelAnimation",["../Core/defaultValue","../Core/defineProperties","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i,n,o){"use strict";function a(t,a,s){this._name=s.name,this._startTime=i.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 r,this.update=new r,this.stop=new r,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}),define("Scene/ModelAnimationCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/Math","./ModelAnimation","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){this.animationAdded=new n,this.animationRemoved=new n,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function d(e,t,r){var i=e._model,n=i._runtime.animations,o=n[t],a=new s(r,i,o);return e._scheduledAnimations.push(a),e.animationAdded.raiseEvent(i,a),a}function h(e,t){for(var r=e.channelEvaluators,i=r.length,n=0;n<i;++n)r[n](t)}function p(e,t,r){return function(){e.animationRemoved.raiseEvent(t,r)}}r(c.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),c.prototype.add=function(r){r=e(r,e.EMPTY_OBJECT);var i=this._model,n=i._runtime.animations;if(t(r.index))return d(this,r.index,r);for(var o,a=n.length,s=0;s<a;++s)if(n[s].name===r.name){o=s;break}return d(this,o,r)},c.prototype.addAll=function(t){t=e(t,e.EMPTY_OBJECT);for(var r=[],i=this._model,n=i._runtime.animations,o=n.length,a=0;a<o;++a)r.push(d(this,a,t));return r},c.prototype.remove=function(e){if(t(e)){var r=this._scheduledAnimations,i=r.indexOf(e);if(-1!==i)return r.splice(i,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},c.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,r=t.length;this._scheduledAnimations=[];for(var i=0;i<r;++i)this.animationRemoved.raiseEvent(e,t[i])},c.prototype.contains=function(e){return!!t(e)&&-1!==this._scheduledAnimations.indexOf(e)},c.prototype.get=function(e){return this._scheduledAnimations[e]};var f=[];return c.prototype.update=function(r){var i=this._scheduledAnimations,n=i.length;if(0===n)return this._previousTime=void 0,!1;if(o.equals(r.time,this._previousTime))return!1;this._previousTime=o.clone(r.time,this._previousTime);for(var s=!1,c=r.time,d=this._model,m=0;m<n;++m){var g=i[m],_=g._runtimeAnimation;t(g._computedStartTime)||(g._computedStartTime=o.addSeconds(e(g.startTime,c),g.delay,new o)),t(g._duration)||(g._duration=_.stopTime*(1/g.speedup));var v=g._computedStartTime,y=g._duration,b=g.stopTime,C=0!==y?o.secondsDifference(c,v)/y:0,S=C>=0,T=g.loop===l.REPEAT||g.loop===l.MIRRORED_REPEAT;if((S||T&&!t(g.startTime))&&(C<=1||T)&&(!t(b)||o.lessThanOrEquals(c,b))){if(g._state===u.STOPPED&&(g._state=u.ANIMATING,g.start.numberOfListeners>0&&r.afterRender.push(g._raiseStartEvent)),g.loop===l.REPEAT)C-=Math.floor(C);else if(g.loop===l.MIRRORED_REPEAT){var w=Math.floor(C),A=C-w;C=w%2==1?1-A:A}g.reverse&&(C=1-C);var E=C*y*g.speedup;E=a.clamp(E,_.startTime,_.stopTime),h(_,E),g.update.numberOfListeners>0&&(g._updateEventTime=E,r.afterRender.push(g._raiseUpdateEvent)),s=!0}else S&&g._state===u.ANIMATING&&(g._state=u.STOPPED,g.stop.numberOfListeners>0&&r.afterRender.push(g._raiseStopEvent),g.removeOnStop&&f.push(g))}n=f.length;for(var x=0;x<n;++x){var P=f[x];i.splice(i.indexOf(P),1),r.afterRender.push(p(this,d,P))}return f.length=0,s},c}),define("Scene/ModelLoadResources",["../Core/Queue"],function(e){"use strict";function t(){this.vertexBuffersToCreate=new e,this.indexBuffersToCreate=new e,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new e,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new e,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new e,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 r(e,t,r){return e.subarray(t,t+r)}return t.prototype.getBuffer=function(e){return r(this.buffers[e.buffer],e.byteOffset,e.byteLength)},t.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},t.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length},t.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},t.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},t.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return e&&t},t.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},t}),define("Scene/ModelMaterial",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,r){"use strict";function i(e,t,r){this._name=t.name,this._id=r,this._uniformMap=e._uniformMaps[r]}return t(i.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),i.prototype.setValue=function(e,t){var r=this._uniformMap.values[e];r.value=r.clone(t,r.value)},i.prototype.getValue=function(t){var r=this._uniformMap.values[t];if(e(r))return r.value},i}),define("Scene/ModelMesh",["../Core/defineProperties"],function(e){"use strict";function t(e,t,r){for(var i=[],n=e.primitives,o=n.length,a=0;a<o;++a){var s=n[a];i[a]=t[s.material]}this._name=e.name,this._materials=i,this._id=r}return e(t.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),t}),define("Scene/ModelNode",["../Core/defineProperties","../Core/Matrix4"],function(e,t){"use strict";function r(e,r,i,n,o){this._model=e,this._runtimeNode=i,this._name=r.name,this._id=n,this.useMatrix=!1,this._show=!0,this._matrix=t.clone(o)}return e(r.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 r=this._model;r._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=r._maxDirtyNumber}}}),r.prototype.setMatrix=function(e){t.clone(e,this._matrix)},r}),define("Scene/ModelUtility",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/RuntimeError","../Core/WebGLConstants","../Renderer/ShaderSource","./AttributeType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t,r){var i=e.indexOf(t);return e.replace(new RegExp(t,"g"),function(e,t){return i===t?e:r})}function f(e,t){var r=e.accessors[t],n=r.extensions;if(i(n))return n.WEB3D_quantized_attributes}function m(e,t,r){var i=t.material,n=e.materials[i],o=n.technique,a=e.techniques[o];for(var s in a.parameters)if(a.parameters.hasOwnProperty(s)){var l=a.parameters[s].semantic;if(l===r){var u=a.attributes;for(var c in u)if(u.hasOwnProperty(c)){var d=u[c];if(d===s)return c}}}}function g(e){var t={value:e,clone:function(e,t){return e},func:function(){return t.value}};return t}function _(t){var r={value:e.fromArray(t),clone:e.clone,func:function(){return r.value}};return r}function v(e){var r={value:t.fromArray(e),clone:t.clone,func:function(){return r.value}};return r}function y(e){var t={value:r.fromArray(e),clone:r.clone,func:function(){return t.value}};return t}function b(e){var t={value:o.fromColumnMajorArray(e),clone:o.clone,func:function(){return t.value}};return t}function C(e){var t={value:a.fromColumnMajorArray(e),clone:a.clone,func:function(){return t.value}};return t}function S(e){var t={value:s.fromColumnMajorArray(e),clone:s.clone,func:function(){return t.value}};return t}function T(e,t,r){this._value=void 0,this._textureId=e.index,this._textures=t,this._defaultTexture=r}function w(e,t,r){var i=new T(e,t,r);return i.func=function(){return i.value},i}function A(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 E(e){return[e[20],e[21],e[22],e[23]]}var x={};x.getAccessorMinMax=function(e,t){var r=e.accessors[t],n=r.extensions,o=r.min,a=r.max;if(i(n)){var s=n.WEB3D_quantized_attributes;i(s)&&(o=s.decodedMin,a=s.decodedMax)}return{min:o,max:a}},x.getAttributeOrUniformBySemantic=function(e,t,r){var n,o=e.techniques;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if(i(r)&&s.program!==r)continue;var l=s.parameters,u=s.attributes,c=s.uniforms;for(var d in u)if(u.hasOwnProperty(d)&&(n=l[u[d]],i(n)&&n.semantic===t))return d;for(var h in c)if(c.hasOwnProperty(h)&&(n=l[c[h]],i(n)&&n.semantic===t))return h}},x.getDiffuseAttributeOrUniform=function(e,t){var r=x.getAttributeOrUniformBySemantic(e,"COLOR_0",t);return i(r)||(r=x.getAttributeOrUniformBySemantic(e,"_3DTILESDIFFUSE",t)),r};var P=new t,I=new l,D=new t;x.getTransform=function(e,r){return i(e.matrix)?s.fromColumnMajorArray(e.matrix,r):s.fromTranslationQuaternionRotationScale(t.fromArray(e.translation,0,P),l.unpack(e.rotation,0,I),t.fromArray(e.scale,0,D),r)},x.getUsedExtensions=function(e){var t=e.extensionsUsed,r={};if(i(t))for(var n=t.length,o=0;o<n;o++){var a=t[o];r[a]=!0}return r},x.getRequiredExtensions=function(e){var t=e.extensionsRequired,r={};if(i(t))for(var n=t.length,o=0;o<n;o++){var a=t[o];r[a]=!0}return r},x.checkSupportedExtensions=function(e){for(var t in e)if(e.hasOwnProperty(t)&&"CESIUM_RTC"!==t&&"KHR_technique_webgl"!==t&&"KHR_binary_glTF"!==t&&"KHR_materials_common"!==t&&"WEB3D_quantized_attributes"!==t)throw new u("Unsupported glTF Extension: "+t)},x.checkSupportedGlExtensions=function(e,t){if(i(e))for(var r=e.length,n=0;n<r;n++){var o=e[n];if("OES_element_index_uint"!==o)throw new u("Unsupported WebGL Extension: "+o);if(!t.elementIndexUint)throw new u("OES_element_index_uint WebGL extension is not enabled.")}},x.modifyShaderForQuantizedAttributes=function(e,t,r){var n={},o=t.attributes;for(var a in o)if(o.hasOwnProperty(a)){var s=m(e,t,a),l=t.attributes[a];"_"===a.charAt(0)&&(a=a.substring(1));var u="gltf_u_dec_"+a.toLowerCase(),c=u+"_scale",h=u+"_translate";if(!i(n[u])&&!i(n[c])){var g=f(e,l);if(i(g)){var _=g.decodeMatrix,v="gltf_decoded_"+a,y=s.replace("a_","gltf_a_dec_"),b=Math.floor(Math.sqrt(_.length));r=p(r,s,y);var C;C=b>2?"vec"+(b-1):"float",r=C+" "+y+";\n"+r;var S="";5===b?(r="uniform mat4 "+c+";\n"+r,r="uniform vec4 "+h+";\n"+r,S="\nvoid main() {\n    "+y+" = "+c+" * "+s+" + "+h+";\n    "+v+"();\n}\n",n[c]={mat:4},n[h]={vec:4}):(r="uniform mat"+b+" "+u+";\n"+r,S="\nvoid main() {\n    "+y+" = "+C+"("+u+" * vec"+b+"("+s+",1.0));\n    "+v+"();\n}\n",n[u]={mat:b}),r=d.replaceMain(r,v),r+=S}}}return{shader:r,uniforms:n}},n(T.prototype,{value:{get:function(){if(!i(this._value)){var e=this._textures[this._textureId];if(!i(e))return this._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),T.prototype.clone=function(e){return e},T.prototype.func=void 0;var O={};O[c.FLOAT]=g,O[c.FLOAT_VEC2]=_,O[c.FLOAT_VEC3]=v,O[c.FLOAT_VEC4]=y,O[c.INT]=g,O[c.INT_VEC2]=_,O[c.INT_VEC3]=v,O[c.INT_VEC4]=y,O[c.BOOL]=g,O[c.BOOL_VEC2]=_,O[c.BOOL_VEC3]=v,O[c.BOOL_VEC4]=y,O[c.FLOAT_MAT2]=b,O[c.FLOAT_MAT3]=C,O[c.FLOAT_MAT4]=S,O[c.SAMPLER_2D]=w,x.createUniformFunction=function(e,t,r,i){return O[e](t,r,i)},x.createUniformsForQuantizedAttributes=function(e,t,r){var n=e.accessors,l={},u={},c=t.attributes;for(var d in c)if(c.hasOwnProperty(d)){var p=c[d],f=n[p],m=f.extensions;if("_"===d.charAt(0)&&(d=d.substring(1)),i(m)){var g=m.WEB3D_quantized_attributes;if(i(g)){var _=g.decodeMatrix,v="gltf_u_dec_"+d.toLowerCase();switch(f.type){case h.SCALAR:u[v]=b(_).func,l[v]=!0;break;case h.VEC2:u[v]=C(_).func,l[v]=!0;break;case h.VEC3:u[v]=S(_).func,l[v]=!0;break;case h.VEC4:var T=v+"_scale",w=v+"_translate";u[T]=S(A(_)).func,u[w]=y(E(_)).func,l[T]=!0,l[w]=!0}}}}for(var x in r)if(r.hasOwnProperty(x)&&!l[x]){var P=r[x];i(P.mat)&&(2===P.mat?u[x]=b(o.IDENTITY).func:3===P.mat?u[x]=C(a.IDENTITY).func:4===P.mat&&(u[x]=S(s.IDENTITY).func)),i(P.vec)&&4===P.vec&&(u[x]=y([0,0,0,0]).func)}return u};var M=new t,R={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,r){var n=new s;return function(){return i(r._rtcCenter)?(s.getTranslation(e.model,M),t.add(M,r._rtcCenter,M),s.multiplyByPoint(e.view,M,M),s.setTranslation(e.modelView,M,n)):e.modelView}},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}}};return x.getGltfSemanticUniforms=function(){return R},x}),define("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/ClippingPlaneCollection","../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getMagic","../Core/getStringFromTypedArray","../Core/IndexDatatype","../Core/loadCRN","../Core/loadImageFromTypedArray","../Core/loadKTX","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PixelFormat","../Core/Plane","../Core/PrimitiveType","../Core/Resource","../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/GltfPipeline/addDefaults","../ThirdParty/GltfPipeline/addPipelineExtras","../ThirdParty/GltfPipeline/ForEach","../ThirdParty/GltfPipeline/getAccessorByteStride","../ThirdParty/GltfPipeline/numberOfComponentsForType","../ThirdParty/GltfPipeline/parseBinaryGltf","../ThirdParty/GltfPipeline/processModelMaterialsCommon","../ThirdParty/GltfPipeline/processPbrMetallicRoughness","../ThirdParty/GltfPipeline/updateVersion","../ThirdParty/Uri","../ThirdParty/when","./AttributeType","./Axis","./BlendingState","./ColorBlendMode","./HeightReference","./JobType","./ModelAnimationCache","./ModelAnimationCollection","./ModelLoadResources","./ModelMaterial","./ModelMesh","./ModelNode","./ModelUtility","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,_e,ve,ye,be){"use strict";function Ce(e,t){e._cachedGltf=t}function Se(e){this._gltf=e.gltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}function Te(t){t=u(t,u.EMPTY_OBJECT);var r=t.cacheKey;this._cacheKey=r,this._cachedGltf=void 0,this._releaseGltfJson=u(t.releaseGltfJson,!1);var i;if(c(r)&&c(hr[r])&&hr[r].ready)i=hr[r],++i.count;else{var n=t.gltf;if(c(n)){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array){i=new Se({gltf:ee(n),ready:!0})}else i=new Se({gltf:t.gltf,ready:!0});i.count=1,c(r)&&(hr[r]=i)}}Ce(this,i);var o=u(t.basePath,"");this._resource=O.createIfNeeded(o),this.show=u(t.show,!0),this.silhouetteColor=u(t.silhouetteColor,s.RED),this._silhouetteColor=new s,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=u(t.silhouetteSize,0),this.modelMatrix=x.clone(u(t.modelMatrix,x.IDENTITY)),this._modelMatrix=x.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=u(t.scale,1),this._scale=this.scale,this.minimumPixelSize=u(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=u(t.heightReference,ce.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;var a=t.scene;this._scene=a,c(a)&&c(a.terrainProviderChanged)&&(this._terrainProviderChangedCallback=a.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this)),this._pickObject=t.pickObject,this._allowPicking=u(t.allowPicking,!0),this._ready=!1,this._readyPromise=oe.defer(),this.activeAnimations=new pe(this),this.clampAnimations=u(t.clampAnimations,!0),this._defaultTexture=void 0,this._incrementallyLoadTextures=u(t.incrementallyLoadTextures,!0),this._asynchronous=u(t.asynchronous,!0),this.shadows=u(t.shadows,be.ENABLED),this._shadows=this.shadows,this.color=u(t.color,s.WHITE),this._color=new s,this._colorPreviousAlpha=1,this.colorBlendMode=u(t.colorBlendMode,ue.HIGHLIGHT),this.colorBlendAmount=u(t.colorBlendAmount,.5),this.clippingPlanes=t.clippingPlanes,this.debugShowBoundingVolume=u(t.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=u(t.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=t.distanceDisplayCondition,this._addBatchIdToGeneratedShaders=t.addBatchIdToGeneratedShaders,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=u(t.ignoreCommands,!1),this._requestType=t.requestType,this._upAxis=u(t.upAxis,se.Y),this.cull=u(t.cull,!0),this.opaquePass=u(t.opaquePass,V.OPAQUE),this._computedModelMatrix=new x,this._modelViewMatrix=x.clone(x.IDENTITY),this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=dr.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._extensionsRequired=void 0,this._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._updatedGltfVersion=!1,this._cachedGeometryByteLength=0,this._cachedTexturesByteLength=0,this._geometryByteLength=0,
this._texturesByteLength=0,this._trianglesLength=0,this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0,this._packedClippingPlanes=[]}function we(e){return e.stencilBuffer}function Ae(e){return"glTF"===v(e)}function Ee(e,t,r){return e._runtime[t][r]}function xe(t){for(var i=t.gltf,n=i.nodes,o=i.meshes,a=i.scenes[i.scene].nodes,s=a.length,l=[],u=new r(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=new r(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),h=0;h<s;++h){var p=n[a[h]];for(p._transformToRoot=ve.getTransform(p),l.push(p);l.length>0;){p=l.pop();var f=p._transformToRoot,m=p.mesh;if(c(m))for(var g=o[m],_=g.primitives,v=_.length,y=0;y<v;++y){var b=_[y].attributes.POSITION;if(c(b)){var C=ve.getAccessorMinMax(i,b),S=r.fromArray(C.min,0,pr),T=r.fromArray(C.max,0,fr);c(u)&&c(d)&&(x.multiplyByPoint(f,S,S),x.multiplyByPoint(f,T,T),r.minimumByComponent(u,S,u),r.maximumByComponent(d,T,d))}}for(var w=p.children,A=w.length,E=0;E<A;++E){var P=n[w[E]];P._transformToRoot=ve.getTransform(P),x.multiplyTransformation(f,P._transformToRoot,P._transformToRoot),l.push(P)}delete p._transformToRoot}}var I=e.fromCornerPoints(u,d);return t._upAxis===se.Y?e.transformWithoutScale(I,se.Y_UP_TO_Z_UP,I):t._upAxis===se.X&&e.transformWithoutScale(I,se.X_UP_TO_Z_UP,I),I}function Pe(e,t,r){return function(){e._state=dr.FAILED,e._readyPromise.reject(new L("Failed to load "+t+": "+r))}}function Ie(e){var t=e.gltf,r=e._loadResources;K.buffer(t,function(e,t){r.buffers[t]=e.extras._pipeline.source})}function De(e,t){return function(r){var i=e._loadResources,n=new Uint8Array(r);--i.pendingBufferLoads,e.gltf.buffers[t].extras._pipeline.source=n}}function Oe(e){var t=e._loadResources,r=e.gltf.buffers;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i];if(n.extras=u(n.extras,{}),n.extras._pipeline=u(n.extras._pipeline,{}),c(n.extras._pipeline.source))t.buffers[i]=n.extras._pipeline.source;else{var o=e._resource.getDerivedResource({url:n.uri});++t.pendingBufferLoads,o.fetchArrayBuffer().then(De(e,i)).otherwise(Pe(e,"buffer",o.url))}}}function Me(e){var t=e.gltf.bufferViews,r=e._loadResources.vertexBuffersToCreate;K.bufferView(e.gltf,function(e,t){e.target===k.ARRAY_BUFFER&&r.enqueue(t)});var i=e._loadResources.indexBuffersToCreate,n={};K.accessor(e.gltf,function(e){var r=e.bufferView;t[r].target!==k.ELEMENT_ARRAY_BUFFER||c(n[r])||(n[r]=!0,i.enqueue({id:r,componentType:e.componentType}))})}function Re(e,t,r){return function(i){var n=e._loadResources;n.shaders[r]={source:i,type:t,bufferView:void 0},--n.pendingShaderLoads,e.gltf.shaders[r].extras._pipeline.source=i}}function Le(e){var t=e.gltf,r=t.buffers,i=t.bufferViews;K.shader(t,function(t,n){if(c(t.bufferView)){var o=t.bufferView,a=i[o],s=a.buffer,l=r[s],u=y(l.extras._pipeline.source,a.byteOffset,a.byteLength);e._loadResources.shaders[n]={source:u,bufferView:void 0},t.extras._pipeline.source=u}else if(c(t.extras._pipeline.source))e._loadResources.shaders[n]={source:t.extras._pipeline.source,bufferView:void 0};else{++e._loadResources.pendingShaderLoads;var d=e._resource.getDerivedResource({url:t.uri});d.fetchText().then(Re(e,t.type,n)).otherwise(Pe(e,"shader",d.url))}})}function Ne(e){K.program(e.gltf,function(t,r){e._loadResources.programsToCreate.enqueue(r)})}function ke(e,t,r){return function(i){var n=e.gltf,o=e._loadResources;--o.pendingTextureLoads,o.texturesToCreate.enqueue({id:t,image:i,bufferView:i.bufferView,width:i.width,height:i.height,internalFormat:i.internalFormat}),n.images[r].extras._pipeline.source=i}}function Fe(e,t){var r,i=e.gltf,n=i.images;K.texture(i,function(i,o){var a=i.source,s=n[a],l=s.extras,u=s.bufferView,d=s.mimeType;if(r=s.uri,c(l)&&c(l.compressedImage3DTiles)){var h=l.compressedImage3DTiles.crunch,p=l.compressedImage3DTiles.s3tc,f=l.compressedImage3DTiles.pvrtc1,m=l.compressedImage3DTiles.etc1;t.s3tc&&c(h)?(d=h.mimeType,c(h.bufferView)?u=h.bufferView:r=h.uri):t.s3tc&&c(p)?(d=p.mimeType,c(p.bufferView)?u=p.bufferView:r=p.uri):t.pvrtc&&c(f)?(d=f.mimeType,c(f.bufferView)?u=f.bufferView:r=f.uri):t.etc1&&c(m)&&(d=m.mimeType,c(m.bufferView)?u=m.bufferView:r=m.uri)}if(c(u))e._loadResources.texturesToCreateFromBufferView.enqueue({id:o,image:void 0,bufferView:u,mimeType:d});else{++e._loadResources.pendingTextureLoads;var g,_=e._resource.getDerivedResource({url:r});g=mr.test(r)?T(_):gr.test(r)?C(_):_.fetchImage(),g.then(ke(e,o,a)).otherwise(Pe(e,"image",_.url))}})}function Be(e){var t={},r={},i=[],n=e._loadResources.skinnedNodesIds;K.node(e.gltf,function(o,a){var s={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new x,computedMatrix:new x,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:o.jointName,weights:[],children:[],parents:[],publicNode:void 0};s.publicNode=new _e(e,o,s,a,ve.getTransform(o)),t[a]=s,r[o.name]=s,c(o.skin)&&(n.push(a),i.push(s))}),e._runtime.nodes=t,e._runtime.nodesByName=r,e._runtime.skinnedNodes=i}function Ue(e){var t={},r={},i=e._uniformMaps;K.material(e.gltf,function(n,o){i[o]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0,morphWeightsUniformName:void 0};var a=new me(e,n,o);t[n.name]=a,r[o]=a}),e._runtime.materialsByName=t,e._runtime.materialsById=r}function Ve(e){var t={},r=e._runtime.materialsById;K.mesh(e.gltf,function(i,n){if(t[i.name]=new ge(i,r,n),c(e.extensionsUsed.WEB3D_quantized_attributes))for(var o=i.primitives,a=o.length,s=0;s<a;s++){var l=o[s],u=je(e,l),d=e._programPrimitives[u];c(d)||(d=[],e._programPrimitives[u]=d),d.push(l)}}),e._runtime.meshesByName=t}function ze(e,t,r){var i=t._loadResources,n=t.gltf.bufferViews,o=n[e],a=F.createVertexBuffer({context:r,typedArray:i.getBuffer(o),usage:B.STATIC_DRAW});a.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=a,t._geometryByteLength+=a.sizeInBytes}function Ge(e,t,r,i){var n=r._loadResources,o=r.gltf.bufferViews,a=o[e],s=F.createIndexBuffer({context:i,typedArray:n.getBuffer(a),usage:B.STATIC_DRAW,indexDatatype:t});s.vertexArrayDestroyable=!1,r._rendererResources.buffers[e]=s,r._geometryByteLength+=s.sizeInBytes}function He(e,t){var r=e._loadResources;if(0===r.pendingBufferLoads){var i,n=t.context,o=r.vertexBuffersToCreate,a=r.indexBuffersToCreate;if(e.asynchronous){for(;o.length>0&&(yr.set(o.peek(),e,n),t.jobScheduler.execute(yr,de.BUFFER));)o.dequeue();for(;a.length>0&&(i=a.peek(),br.set(i.id,i.componentType,e,n),t.jobScheduler.execute(br,de.BUFFER));)a.dequeue()}else{for(;o.length>0;)ze(o.dequeue(),e,n);for(;a.length>0;)i=a.dequeue(),Ge(i.id,i.componentType,e,n)}}}function We(e,t){var r,i={},n=t.length;for(r=1;r<n;++r){var o=t[r];if(/pos/i.test(o)){t[r]=t[0],t[0]=o;break}}for(r=0;r<n;++r)i[t[r]]=r;return i}function je(e,t){var r=e.gltf,i=t.material,n=r.materials[i],o=n.technique;return r.techniques[o].program}function qe(e,t,r){for(var i,n=r._programPrimitives[t],o=0;o<n.length&&(i=n[o],je(r,i)!==t);o++);var a=ve.modifyShaderForQuantizedAttributes(r.gltf,i,e);return r._quantizedUniforms[t]=a.uniforms,r._programPrimitives[t]=void 0,a.shader}function Ye(e){var t=e.gltf;return!!c(t.asset)&&u(t.asset.premultipliedAlpha,!1)}function Xe(e,t){return e=W.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,r){return c(r)&&(e=r(e,t)),e}function Ze(e,t,r){var i=t.gltf.programs,n=t.gltf.shaders,a=i[e],s=We(t,a.attributes),l=n[a.vertexShader].extras._pipeline.source,u=n[a.fragmentShader].extras._pipeline.source,d=a.attributes.length,h=t._precreatedAttributes;if(c(h))for(var p in h)h.hasOwnProperty(p)&&(s[p]=d++);t.extensionsUsed.WEB3D_quantized_attributes&&(l=qe(l,e,t));var f=Ye(t),m=Xe(u,f);o.isSupported()&&(m=Jt(m));var g=Qe(l,e,t._vertexShaderLoaded),_=Qe(m,e,t._fragmentShaderLoaded);if(t._rendererResources.programs[e]=H.fromCache({context:r,vertexShaderSource:g,fragmentShaderSource:_,attributeLocations:s}),t.allowPicking){var v=Qe(l,e,t._pickVertexShaderLoaded),y=Qe(u,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(y=W.createPickFragmentShaderSource(u,"uniform")),t._rendererResources.pickPrograms[e]=H.fromCache({context:r,vertexShaderSource:v,fragmentShaderSource:y,attributeLocations:s})}}function Ke(e,t){var r=e._loadResources,i=r.programsToCreate;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads){var n=t.context;if(e.asynchronous)for(;i.length>0&&(Sr.set(i.peek(),e,n),t.jobScheduler.execute(Sr,de.PROGRAM));)i.dequeue();else for(;i.length>0;)Ze(i.dequeue(),e,n)}}function Je(e,t){return function(r){e.texturesToCreate.enqueue({id:t.id,image:r,bufferView:void 0}),--e.pendingBufferViewToImage}}function $e(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var r=t.texturesToCreateFromBufferView.dequeue(),i=e.gltf,n=i.bufferViews[r.bufferView],o=i.textures[r.id].source,a=Pe(e,"image","id: "+r.id+", bufferView: "+r.bufferView);if("image/ktx"===r.mimeType)T(t.getBuffer(n)).then(ke(e,r.id,o)).otherwise(a),++e._loadResources.pendingTextureLoads;else if("image/crn"===r.mimeType)C(t.getBuffer(n)).then(ke(e,r.id,o)).otherwise(a),++e._loadResources.pendingTextureLoads;else{var s=Je(t,r);S(t.getBuffer(n),r.mimeType).then(s).otherwise(a),++t.pendingBufferViewToImage}}}function et(e,t){var r=e._loadResources;if(r.createSamplers){r.createSamplers=!1;var i=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];i[o]=new G({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function tt(e,t,r){var i=t.gltf.textures,n=i[e.id],o=t._rendererResources.samplers,a=o[n.sampler];a=u(a,new G({wrapS:Y.REPEAT,wrapT:Y.REPEAT}));var s,l=e.internalFormat,d=!(c(l)&&P.isCompressedFormat(l)||a.minificationFilter!==q.NEAREST_MIPMAP_NEAREST&&a.minificationFilter!==q.NEAREST_MIPMAP_LINEAR&&a.minificationFilter!==q.LINEAR_MIPMAP_NEAREST&&a.minificationFilter!==q.LINEAR_MIPMAP_LINEAR),h=d||a.wrapS===Y.REPEAT||a.wrapS===Y.MIRRORED_REPEAT||a.wrapT===Y.REPEAT||a.wrapT===Y.MIRRORED_REPEAT,p=e.image;if(c(l)&&n.target===k.TEXTURE_2D)s=new j({context:r,source:{arrayBufferView:e.bufferView},width:e.width,height:e.height,pixelFormat:l,sampler:a});else if(c(p)){var f=!w.isPowerOfTwo(p.width)||!w.isPowerOfTwo(p.height);if(h&&f){var m=document.createElement("canvas");m.width=w.nextPowerOfTwo(p.width),m.height=w.nextPowerOfTwo(p.height);var g=m.getContext("2d");g.drawImage(p,0,0,p.width,p.height,0,0,m.width,m.height),p=m}n.target===k.TEXTURE_2D&&(s=new j({context:r,source:p,pixelFormat:n.internalFormat,pixelDatatype:n.type,sampler:a,flipY:!1}),d&&s.generateMipmap())}c(s)&&(t._rendererResources.textures[e.id]=s,t._texturesByteLength+=s.sizeInBytes)}function rt(e,t){var r=t.context,i=e._loadResources.texturesToCreate;if(e.asynchronous)for(;i.length>0&&(wr.set(i.peek(),e,r),t.jobScheduler.execute(wr,de.TEXTURE));)i.dequeue();else for(;i.length>0;)tt(i.dequeue(),e,r)}function it(e,t){var r,i,n=e.gltf,o=n.techniques,a=n.materials,s={},l=o[a[t.material].technique],u=l.parameters,d=l.attributes,h=e._rendererResources.programs[l.program],p=h.vertexAttributes,f=h._attributeLocations;for(r in p)if(p.hasOwnProperty(r)){var m=d[r];if(i=p[r].index,c(m)){var g=u[m];s[g.semantic]=i}}var _=e._precreatedAttributes;if(c(_))for(r in _)_.hasOwnProperty(r)&&(i=f[r],s[r]=i);return s}function nt(e,t){for(var r=e.length,i={},n=0;n<r;++n)for(var o=[e[n]];o.length>0;){var a=o.pop(),s=t[a];c(s)&&(i[a]=a);for(var l=s.children,u=l.length,d=0;d<u;++d)o.push(l[d])}return i}function ot(e,t){for(var r=e.gltf,i=r.skins,n=r.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length,l=0;l<s;++l){var u=a[l],d=o[u],h=n[u],p=t[h.skin];d.inverseBindMatrices=p.inverseBindMatrices,d.bindShapeMatrix=p.bindShapeMatrix;var f=[],m=i[h.skin];c(m.skeleton)&&f.push(m.skeleton);for(var g=nt(f,n),_=i[h.skin].joints,v=_.length,y=0;y<v;++y){var b=_[y],C=g[b],S=o[C];d.joints.push(S)}}}function at(e){var t=e._loadResources;if(0===t.pendingBufferLoads&&t.createSkins){t.createSkins=!1;var r=e.gltf,i=r.accessors,n={};K.skin(r,function(t,r){var o,a=i[t.inverseBindMatrices];x.equals(t.bindShapeMatrix,x.IDENTITY)||(o=x.clone(t.bindShapeMatrix)),n[r]={inverseBindMatrices:he.getSkinInverseBindMatrices(e,a),bindShapeMatrix:o}}),ot(e,n)}}function st(e,t,r,i){return function(n){c(i)&&(n=e.clampAnimations?i.clampTime(n):i.wrapTime(n),t[r]=i.evaluate(n,t[r]),t.dirtyNumber=e._maxDirtyNumber)}}function lt(e){var t=e._loadResources;if(t.finishedPendingBufferLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations=[];for(var r=e._runtime.nodes,i=e.gltf.animations,n=e.gltf.accessors,o=i.length,a=0;a<o;++a){for(var s=i[a],l=s.channels,u=s.samplers,c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=l.length,p=new Array(h),f=0;f<h;++f){var m=l[f],g=m.target,_=g.path,v=u[m.sampler],y=he.getAnimationParameterValues(e,n[v.input]),b=he.getAnimationParameterValues(e,n[v.output]);c=Math.min(c,y[0]),d=Math.max(d,y[y.length-1]);var C=he.getAnimationSpline(e,a,s,m.sampler,v,y,_,b);p[f]=st(e,r[g.node],g.path,C)}e._runtime.animations[a]={name:s.name,startTime:c,stopTime:d,channelEvaluators:p}}}}function ut(e,t){var r=e._loadResources;if(r.finishedBuffersCreation()&&r.finishedProgramCreation()&&r.createVertexArrays){r.createVertexArrays=!1;var i=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 u=s[l].primitives,d=u.length,h=0;h<d;++h){var p,f,m,g=u[h],_=it(e,g),v=[],y=g.attributes;for(p in y)if(y.hasOwnProperty(p)&&(f=_[p],c(f))){var b=a[y[p]],C=!1;c(b.normalized)&&b.normalized&&(C=!0),v.push({index:f,vertexBuffer:i[b.bufferView],componentsPerAttribute:$(b.type),componentDatatype:b.componentType,normalize:C,offsetInBytes:b.byteOffset,strideInBytes:J(o,b)})}var S=e._precreatedAttributes;if(c(S))for(p in S)S.hasOwnProperty(p)&&(f=_[p],c(f)&&(m=S[p],m.index=f,v.push(m)));var T;if(c(g.indices)){var w=a[g.indices];T=i[w.bufferView]}n[l+".primitive."+h]=new X({context:t,attributes:v,indexBuffer:T})}}}function ct(e){var t={};t[k.BLEND]=!1,t[k.CULL_FACE]=!1,t[k.DEPTH_TEST]=!1,t[k.POLYGON_OFFSET_FILL]=!1;var r,i=e.enable,n=i.length;for(r=0;r<n;++r)t[i[r]]=!0;return t}function dt(e,t){var r=e._loadResources,i=e.gltf.techniques;if(r.createRenderStates){r.createRenderStates=!1;for(var n in i)i.hasOwnProperty(n)&&ht(e,n,t)}}function ht(e,t,r){var i=e._rendererResources.renderStates,n=e.gltf.techniques,o=n[t],a=o.states,s=ct(a),l=u(a.functions,u.EMPTY_OBJECT),d=u(l.blendColor,[0,0,0,0]),h=u(l.blendEquationSeparate,[k.FUNC_ADD,k.FUNC_ADD]),p=u(l.blendFuncSeparate,[k.ONE,k.ZERO,k.ONE,k.ZERO]),f=u(l.colorMask,[!0,!0,!0,!0]),m=u(l.depthRange,[0,1]),g=u(l.polygonOffset,[0,0]);s[k.BLEND]&&Ye(e)&&p[0]===k.ONE&&p[1]===k.ONE_MINUS_SRC_ALPHA&&(p[0]=k.SRC_ALPHA,p[1]=k.ONE_MINUS_SRC_ALPHA,p[2]=k.SRC_ALPHA,p[3]=k.ONE_MINUS_SRC_ALPHA),i[t]=z.fromCache({frontFace:c(l.frontFace)?l.frontFace[0]:k.CCW,cull:{enabled:s[k.CULL_FACE],face:c(l.cullFace)?l.cullFace[0]:k.BACK},lineWidth:c(l.lineWidth)?l.lineWidth[0]:1,polygonOffset:{enabled:s[k.POLYGON_OFFSET_FILL],factor:g[0],units:g[1]},depthRange:{near:m[0],far:m[1]},depthTest:{enabled:s[k.DEPTH_TEST],func:c(l.depthFunc)?l.depthFunc[0]:k.LESS},colorMask:{red:f[0],green:f[1],blue:f[2],alpha:f[3]},depthMask:!c(l.depthMask)||l.depthMask[0],blending:{enabled:s[k.BLEND],color:{red:d[0],green:d[1],blue:d[2],alpha:d[3]},equationRgb:h[0],equationAlpha:h[1],functionSourceRgb:p[0],functionDestinationRgb:p[1],functionSourceAlpha:p[2],functionDestinationAlpha:p[3]}})}function pt(e,t,r,i){var n=t._runtime.nodes[e];return Ar[r](i,t,n)}function ft(e,t){var r=e._loadResources;if(r.finishedProgramCreation()&&r.createUniformMaps){r.createUniformMaps=!1;var i=e.gltf,n=i.materials,o=i.techniques,a=e._uniformMaps,s=e._rendererResources.textures,l=e._defaultTexture;for(var u in n)if(n.hasOwnProperty(u)){var d,h=n[u];d=h.values;var p,f,m=o[h.technique],g=m.parameters,_=m.uniforms,v={},y={};for(var b in _)if(_.hasOwnProperty(b)&&"extras"!==b){var C=_[b],S=g[C];if(c(d[C])){var T=ve.createUniformFunction(S.type,d[C],s,l);v[b]=T.func,y[C]=T}else if(c(S.node))v[b]=pt(S.node,e,S.semantic,t.uniformState);else if(c(S.semantic))"JOINTMATRIX"===S.semantic?p=b:"MORPHWEIGHTS"===S.semantic?f=b:v[b]=ve.getGltfSemanticUniforms()[S.semantic](t.uniformState,e);else if(c(S.value)){var w=ve.createUniformFunction(S.type,S.value,s,l);v[b]=w.func,y[C]=w}}var A=a[u];A.uniformMap=v,A.values=y,A.jointMatrixUniformName=p,A.morphWeightsUniformName=f}}}function mt(e,t){var r=je(e,t),i=e._quantizedUniforms[r];return ve.createUniformsForQuantizedAttributes(e.gltf,t,i)}function gt(e){return function(){return e}}function _t(e){return function(){return e.computedJointMatrices}}function vt(e){return function(){return e.weights}}function yt(e){return function(){return e.silhouetteColor}}function bt(e){return function(){return e.silhouetteSize}}function Ct(e){return function(){return e.color}}function St(e){return function(){return e._packedClippingPlanes.length}}function Tt(e){return function(){var t=e.clippingPlanes;return!!c(t)&&t.unionClippingRegions}}function wt(e){return function(){var t=e.clippingPlanes,r=e._packedClippingPlanes;return c(t)&&t.enabled&&t.transformAndPackPlanes(e._modelViewMatrix,r),r}}function At(e){return function(){var t=e.clippingPlanes;if(!c(t))return s.WHITE.withAlpha(0);var r=s.clone(t.edgeColor);return r.alpha=t.edgeWidth,r}}function Et(e){return function(){return ue.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function xt(e,t){switch(e.mode){case D.TRIANGLES:return t/3;case D.TRIANGLE_STRIP:case D.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Pt(t,i,n,o,a){for(var s=t._nodeCommands,u=t._pickIds,d=t.allowPicking,h=t._runtime.meshesByName,p=t._rendererResources,f=p.vertexArrays,m=p.programs,g=p.pickPrograms,_=p.renderStates,v=t._uniformMaps,y=t.gltf,C=y.accessors,S=y.meshes,T=y.techniques,w=y.materials,A=i.mesh,E=S[A],P=E.primitives,I=P.length,D=0;D<I;++D){var O,M=P[D],R=C[M.indices],L=w[M.material],N=T[L.technique],k=N.program,F=M.attributes.POSITION;if(c(F)){var B=ve.getAccessorMinMax(y,F);O=e.fromCornerPoints(r.fromArray(B.min),r.fromArray(B.max))}var z,G,H=f[A+".primitive."+D];if(c(R))G=R.count,z=R.byteOffset/b.getSizeInBytes(R.componentType);else{G=C[M.attributes.POSITION].count,z=0}t._trianglesLength+=xt(M,G);var W=v[M.material],j=W.uniformMap;if(c(W.jointMatrixUniformName)){var q={};q[W.jointMatrixUniformName]=_t(n),j=l(j,q)}if(c(W.morphWeightsUniformName)){var Y={};Y[W.morphWeightsUniformName]=vt(n),j=l(j,Y)}if(j=l(j,{gltf_color:Ct(t),gltf_colorBlend:Et(t),gltf_clippingPlanesLength:St(t),gltf_clippingPlanesUnionRegions:Tt(t),gltf_clippingPlanes:wt(t,o),gltf_clippingPlanesEdgeStyle:At(t)}),c(t._uniformMapLoaded)&&(j=t._uniformMapLoaded(j,k,n)),t.extensionsUsed.WEB3D_quantized_attributes){var X=mt(t,M);j=l(j,X)}var Q=_[L.technique],Z=Q.blending.enabled,K=t._pickObject;c(K)||(K={primitive:t,id:t.id,node:n.publicNode,mesh:h[E.name]});var J,$=be.castShadows(t._shadows),ee=be.receiveShadows(t._shadows),te=new U({boundingVolume:new e,cull:t.cull,modelMatrix:new x,primitiveType:M.mode,vertexArray:H,count:G,offset:z,shaderProgram:m[N.program],castShadows:$,receiveShadows:ee,uniformMap:j,renderState:Q,owner:K,pass:Z?V.TRANSLUCENT:t.opaquePass});if(d){var re;if(c(t._pickFragmentShaderLoaded))re=c(t._pickUniformMapLoaded)?t._pickUniformMapLoaded(j):l(j);else{var ie=o.createPickId(K);u.push(ie);var ne={czm_pickColor:gt(ie.color)};re=l(j,ne)}J=new U({boundingVolume:new e,cull:t.cull,modelMatrix:new x,primitiveType:M.mode,vertexArray:H,count:G,offset:z,shaderProgram:g[N.program],uniformMap:re,renderState:Q,owner:K,pass:Z?V.TRANSLUCENT:t.opaquePass})}var oe,ae;a||(oe=U.shallowClone(te),oe.boundingVolume=new e,oe.modelMatrix=new x,d&&(ae=U.shallowClone(J),ae.boundingVolume=new e,ae.modelMatrix=new x));var se={show:!0,boundingSphere:O,command:te,pickCommand:J,command2D:oe,pickCommand2D:ae,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0};n.commands.push(se),s.push(se)}}function It(e,t,i){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,u=s.skins,d=s.scenes[s.scene],h=d.nodes,p=h.length,f=[],m={},g=0;g<p;++g){f.push({parentRuntimeNode:void 0,gltfNode:l[h[g]],id:h[g]});for(var _=[];f.length>0;){var v=f.pop();m[v.id]=!0;var y=v.parentRuntimeNode,b=v.gltfNode,C=a[v.id];if(0===C.parents.length)if(c(b.matrix))C.matrix=x.fromColumnMajorArray(b.matrix);else{var S=b.rotation;C.translation=r.fromArray(b.translation),C.rotation=M.unpack(S),C.scale=r.fromArray(b.scale)}c(y)?(y.children.push(C),C.parents.push(y)):o.push(C),c(b.mesh)&&Pt(e,b,C,t,i);for(var T=b.children,w=T.length,A=0;A<w;A++){var E=T[A];m[E]||f.push({parentRuntimeNode:C,gltfNode:l[E],id:T[A]})}var P=b.skin;if(c(P)&&_.push(u[P].skeleton),0===f.length)for(var I=0;I<_.length;I++){var D=_[I];m[D]||f.push({parentRuntimeNode:void 0,gltfNode:l[D],id:D})}}}e._runtime.rootNodes=o,e._runtime.nodes=a}}function Dt(e){var t=0;for(var r in e)e.hasOwnProperty(r)&&(t+=e[r].sizeInBytes);return t}function Ot(e){var t=0;for(var r in e)e.hasOwnProperty(r)&&(t+=e[r].sizeInBytes);return t}function Mt(e,t){var r=t.context,i=t.scene3DOnly;if(ve.checkSupportedGlExtensions(e.gltf.glExtensionsUsed,r),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,c(e._precreatedAttributes)&&ut(e,r),e._cachedGeometryByteLength+=Dt(o.buffers),e._cachedTexturesByteLength+=Ot(o.textures)}else He(e,t),Ke(e,t),et(e,r),$e(e),rt(e,t);at(e),lt(e),e._loadRendererResourcesFromCache||(ut(e,r),dt(e,r)),ft(e,r),It(e,r,i)}function Rt(e,t){var r=e.publicNode,i=r.matrix;r.useMatrix&&c(i)?x.clone(i,t):c(e.matrix)?x.clone(e.matrix,t):(x.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),r.setMatrix(t))}function Lt(t,n,o,a){var s=t._maxDirtyNumber,l=t.allowPicking,u=t._runtime.rootNodes,d=u.length,h=Er,p=t._computedModelMatrix;if(t._mode!==ye.SCENE3D&&!t._ignoreCommands){var f=x.getColumn(p,3,xr);if(i.equals(f,i.UNIT_W)){var m=t.boundingSphere.center,g=N.wgs84To2DModelMatrix(a,m,Pr);p=x.multiply(g,p,Pr),c(t._rtcCenter)&&(x.setTranslation(p,i.UNIT_W,p),t._rtcCenter=t._rtcCenter2D)}else p=N.basisTo2D(a,p,Pr),t._rtcCenter=t._rtcCenter3D}for(var _=0;_<d;++_){var v=u[_];for(Rt(v,v.transformToRoot),h.push(v);h.length>0;){v=h.pop();var y=v.transformToRoot,b=v.commands;if(v.dirtyNumber===s||n||o){var C=x.multiplyTransformation(p,y,v.computedMatrix),S=b.length;if(S>0)for(var T=0;T<S;++T){var A=b[T],E=A.command;if(x.clone(C,E.modelMatrix),e.transform(A.boundingSphere,E.modelMatrix,E.boundingVolume),c(t._rtcCenter)&&r.add(t._rtcCenter,E.boundingVolume.center,E.boundingVolume.center),l){var P=A.pickCommand;x.clone(E.modelMatrix,P.modelMatrix),e.clone(E.boundingVolume,P.boundingVolume)}if(E=A.command2D,c(E)&&t._mode===ye.SCENE2D&&(x.clone(C,E.modelMatrix),E.modelMatrix[13]-=2*w.sign(E.modelMatrix[13])*w.PI*a.ellipsoid.maximumRadius,e.transform(A.boundingSphere,E.modelMatrix,E.boundingVolume),l)){var I=A.pickCommand2D;x.clone(E.modelMatrix,I.modelMatrix),e.clone(E.boundingVolume,I.boundingVolume)}}}for(var D=v.children,O=D.length,M=0;M<O;++M){var R=D[M];R.dirtyNumber=Math.max(R.dirtyNumber,v.dirtyNumber),(R.dirtyNumber===s||o)&&(Rt(R,R.transformToRoot),x.multiplyTransformation(y,R.transformToRoot,R.transformToRoot)),h.push(R)}}}++t._maxDirtyNumber}function Nt(e){for(var t=e._runtime.skinnedNodes,r=t.length,i=0;i<r;++i){var n=t[i];Ir=x.inverseTransformation(n.transformToRoot,Ir);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,l=n.inverseBindMatrices,u=l.length,d=0;d<u;++d)c(o[d])||(o[d]=new x),o[d]=x.multiplyTransformation(Ir,a[d].transformToRoot,o[d]),o[d]=x.multiplyTransformation(o[d],l[d],o[d]),c(s)&&(o[d]=x.multiplyTransformation(o[d],s,o[d]))}}function kt(e){for(var t=e._runtime.rootNodes,r=t.length,i=Er,n=0;n<r;++n){var o=t[n];for(o.computedShow=o.publicNode.show,i.push(o);i.length>0;){o=i.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,d=c.length,h=0;h<d;++h){var p=c[h];p.computedShow=a&&p.publicNode.show,i.push(p)}}}}function Ft(e,t){var r=e.id;if(e._id!==r){e._id=r;for(var i=e._pickIds,n=i.length,o=0;o<n;++o)i[o].object.id=r}}function Bt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?D.LINES:D.TRIANGLES,r=e._nodeCommands,i=r.length,n=0;n<i;++n)r[n].command.primitiveType=t}}function Ut(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,r=e._nodeCommands,i=r.length,n=0;n<i;++n)r[n].command.debugShowBoundingVolume=t}}function Vt(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=be.castShadows(e.shadows),r=be.receiveShadows(e.shadows),i=e._nodeCommands,n=i.length,o=0;o<n;o++){var a=i[o];a.command.castShadows=t,a.command.receiveShadows=r}}}function zt(e){var t=a(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=le.ALPHA_BLEND,z.fromCache(t)}function Gt(e){var t=U.shallowClone(e);return t.pass=V.TRANSLUCENT,t.renderState=zt(e.renderState),t}function Ht(e,t){var r=t.scene3DOnly,i=e.color.alpha;if(i>0&&i<1){var n=e._nodeCommands,o=n.length;if(!c(n[0].translucentCommand))for(var a=0;a<o;++a){var s=n[a],l=s.command;if(s.translucentCommand=Gt(l),!r){var u=s.command2D;s.translucentCommand2D=Gt(u)}}}}function Wt(e,t){var r=e._rendererResources.programs;for(var i in r)if(r.hasOwnProperty(i)&&r[i]===t)return i}function jt(e,t,r){var i=t.vertexShaderSource.sources[0],n=t._attributeLocations,o=e._normalAttributeName;i=W.replaceMain(i,"gltf_silhouette_main"),i+="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}";return H.fromCache({context:r.context,vertexShaderSource:i,fragmentShaderSource:"uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n    gl_FragColor = gltf_silhouetteColor; \n}",attributeLocations:n})}function qt(e,t){return we(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&c(e._normalAttributeName)}function Yt(e){for(var t=e._nodeCommands,r=t.length,i=0;i<r;++i){if(t[i].command.pass===V.TRANSLUCENT)return!0}return!1}function Xt(e){return e.color.alpha>0&&e.color.alpha<1}function Qt(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 r=++Dr%255,i=Yt(e)||Xt(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,o=t.scene3DOnly,s=e._nodeCommands,u=s.length,d=0;d<u;++d){var h=s[d],p=h.command,f=Xt(e)?h.translucentCommand:p,m=U.shallowClone(f),g=a(f.renderState);g.stencilTest={enabled:!0,frontFunction:k.ALWAYS,backFunction:k.ALWAYS,reference:r,mask:-1,frontOperation:{fail:k.KEEP,zFail:k.KEEP,zPass:k.REPLACE},backOperation:{fail:k.KEEP,zFail:k.KEEP,zPass:k.REPLACE}},Qt(e)&&(g.colorMask={red:!1,green:!1,blue:!1,alpha:!1},g.depthMask=!1),g=z.fromCache(g),m.renderState=g,h.silhouetteModelCommand=m;var _=U.shallowClone(p);g=a(p.renderState,!0),g.depthTest.enabled=!0,g.cull.enabled=!1,i&&(_.pass=V.TRANSLUCENT,g.depthMask=!1,g.blending=le.ALPHA_BLEND),g.stencilTest={enabled:!0,frontFunction:k.NOTEQUAL,backFunction:k.NOTEQUAL,reference:r,mask:-1,frontOperation:{fail:k.KEEP,zFail:k.KEEP,zPass:k.KEEP},backOperation:{fail:k.KEEP,zFail:k.KEEP,zPass:k.KEEP}},g=z.fromCache(g);var v=p.shaderProgram,y=Wt(e,v),b=n[y];c(b)||(b=jt(e,v,t),n[y]=b);var C=l(p.uniformMap,{gltf_silhouetteColor:yt(e),gltf_silhouetteSize:bt(e)});if(_.renderState=g,_.shaderProgram=b,_.uniformMap=C,_.castShadows=!1,_.receiveShadows=!1,h.silhouetteColorCommand=_,!o){var S=h.command2D,T=U.shallowClone(m);T.boundingVolume=S.boundingVolume,T.modelMatrix=S.modelMatrix,h.silhouetteModelCommand2D=T;var w=U.shallowClone(_);T.boundingVolume=S.boundingVolume,T.modelMatrix=S.modelMatrix,h.silhouetteColorCommand2D=w}}}function Jt(e){return e=W.replaceMain(e,"gltf_clip_main"),e+="uniform int gltf_clippingPlanesLength; \nuniform bool gltf_clippingPlanesUnionRegions; \nuniform vec4 gltf_clippingPlanes[czm_maxClippingPlanes]; \nuniform vec4 gltf_clippingPlanesEdgeStyle; \nvoid main() \n{ \n    gltf_clip_main(); \n    if (gltf_clippingPlanesLength > 0) \n    { \n        float clipDistance; \n        if (gltf_clippingPlanesUnionRegions) \n        { \n            clipDistance = czm_discardIfClippedWithUnion(gltf_clippingPlanes, gltf_clippingPlanesLength); \n        } \n        else \n        { \n            clipDistance = czm_discardIfClippedWithIntersect(gltf_clippingPlanes, gltf_clippingPlanesLength); \n        } \n        \n        vec4 clippingPlanesEdgeColor = vec4(1.0); \n        clippingPlanesEdgeColor.rgb = gltf_clippingPlanesEdgeStyle.rgb; \n        float clippingPlanesEdgeWidth = gltf_clippingPlanesEdgeStyle.a; \n        if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n        { \n            gl_FragColor = clippingPlanesEdgeColor; \n        } \n    } \n} \n"}function $t(e,t){if(qt(e,t)){var r=e._nodeCommands,i=Zt(e.color.alpha,e._colorPreviousAlpha)||Zt(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!c(r[0].silhouetteModelCommand);e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,i&&Kt(e,t)}}function er(e){var t=e.clippingPlanes,r=0;c(t)&&t.enabled&&(r=t.length);var n=e._packedClippingPlanes,o=n.length;if(o!==r){n.length=r;for(var a=o;a<r;++a)n[a]=new i}}function tr(e,t,r){return Or.center=e,Or.radius=t,r.camera.getPixelSize(Or,r.context.drawingBufferWidth,r.context.drawingBufferHeight)}function rr(e,t){var i=e.scale;if(0!==e.minimumPixelSize){var n=t.context,o=Math.max(n.drawingBufferWidth,n.drawingBufferHeight),a=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(Mr.x=a[12],Mr.y=a[13],Mr.z=a[14],c(e._rtcCenter)&&r.add(e._rtcCenter,Mr,Mr),e._mode!==ye.SCENE3D){var s=t.mapProjection,l=s.ellipsoid.cartesianToCartographic(Mr,Rr);s.project(l,Mr),r.fromElements(Mr.z,Mr.x,Mr.y,Mr)}var u=e.boundingSphere.radius,d=tr(Mr,u,t),h=1/d;Math.min(h*(2*u),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*d/(2*e._initialRadius))}return c(e.maximumScale)?Math.min(e.maximumScale,i):i}function ir(e){c(e._cacheKey)&&c(e._cachedGltf)&&0==--e._cachedGltf.count&&delete hr[e._cacheKey],e._cachedGltf=void 0}function nr(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 or(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function ar(e){or(e.buffers),or(e.vertexArrays),or(e.programs),or(e.pickPrograms),or(e.silhouettePrograms),or(e.textures)}function sr(e,t,r){return function(i){if(e.heightReference===ce.RELATIVE_TO_GROUND){var n=t.cartesianToCartographic(i,Rr);n.height+=r.height,
t.cartographicToCartesian(n,i)}var o=e._clampedModelMatrix;x.clone(e.modelMatrix,o),o[12]=i.x,o[13]=i.y,o[14]=i.z,e._heightChanged=!0}}function lr(e){c(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);var t=e._scene;if(!c(t)||!c(t.globe)||e.heightReference===ce.NONE)return void(e._clampedModelMatrix=void 0);var r=t.globe,i=r.ellipsoid,o=e.modelMatrix;Mr.x=o[12],Mr.y=o[13],Mr.z=o[14];var a=i.cartesianToCartographic(Mr);c(e._clampedModelMatrix)||(e._clampedModelMatrix=x.clone(o,new x));var s=r._surface;e._removeUpdateHeightCallback=s.updateHeight(a,sr(e,i,a));var l=r.getHeight(a);if(c(l)){var u=sr(e,i,a);n.clone(a,Rr),Rr.height=l,i.cartographicToCartesian(Rr,Mr),u(Mr)}}function ur(e,t){var i,n=e.distanceDisplayCondition,o=n.near*n.near,a=n.far*n.far;if(t.mode===ye.SCENE2D){i=.5*(t.camera.frustum.right-t.camera.frustum.left),i*=i}else{var s=x.getTranslation(e.modelMatrix,Lr);if(t.mode===ye.COLUMBUS_VIEW){var l=t.mapProjection,u=l.ellipsoid,c=u.cartesianToCartographic(s,Nr);s=l.project(c,s),r.fromElements(s.z,s.x,s.y,s)}i=r.distanceSquared(s,t.camera.positionWC)}return i>=o&&i<=a}if(!g.supportsTypedArrays())return{};var cr=new r,dr={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};d(Se.prototype,{gltf:{set:function(e){this._gltf=e},get:function(){return this._gltf}}}),Se.prototype.makeReady=function(e){this.gltf=e;for(var t=this.modelsToLoad,r=t.length,i=0;i<r;++i){var n=t[i];n.isDestroyed()||Ce(n,this)}this.modelsToLoad=void 0,this.ready=!0};var hr={};d(Te.prototype,{gltf:{get:function(){return c(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._resource.url}},boundingSphere:{get:function(){var e=this.modelMatrix;this.heightReference!==ce.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);var t=x.getScale(e,cr),i=c(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;r.multiplyByScalar(t,i,t);var n=this._scaledBoundingSphere;return n.center=r.multiplyComponents(this._boundingSphere.center,t,n.center),n.radius=r.maximumComponent(t)*this._initialRadius,c(this._rtcCenter)&&r.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 c(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=m.clone(e,this._distanceDisplayCondition)}},extensionsUsed:{get:function(){return c(this._extensionsUsed)||(this._extensionsUsed=ve.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return c(this._extensionsRequired)||(this._extensionsRequired=ve.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return this._texturesByteLength}},cachedGeometryByteLength:{get:function(){return this._cachedGeometryByteLength}},cachedTexturesByteLength:{get:function(){return this._cachedTexturesByteLength}}}),Te.silhouetteSupported=function(e){return we(e.context)},Te.fromGltf=function(e){c(e.headers)&&h("Model.fromGltf.headers","The options.headers parameter has been deprecated. Specify options.url as a Resource instance and set the headers property there.");var t=e.url;e=a(e);var r=O.createIfNeeded(t,{headers:e.headers}),i=u(e.basePath,r.clone()),n=O.createIfNeeded(i,{headers:e.headers}),o=u(e.cacheKey,_(r.url));c(e.basePath)&&!c(e.cacheKey)&&(o+=n.url),e.cacheKey=o,e.basePath=n;var s=new Te(e),l=hr[o];return c(l)?l.ready||(++l.count,l.modelsToLoad.push(s)):(l=new Se({ready:!1}),l.count=1,l.modelsToLoad.push(s),Ce(s,l),hr[o]=l,c(r.headers.Accept)||(r.headers.Accept="model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01"),r.fetchArrayBuffer().then(function(e){var t=new Uint8Array(e);if(Ae(t)){var r=ee(t);l.makeReady(r,t)}else{var i=y(t);l.makeReady(JSON.parse(i))}}).otherwise(Pe(s,"model",t))),s},Te._gltfCache=hr,Te.prototype.getNode=function(e){var t=Ee(this,"nodesByName",e);return c(t)?t.publicNode:void 0},Te.prototype.getMesh=function(e){return Ee(this,"meshesByName",e)},Te.prototype.getMaterial=function(e){return Ee(this,"materialsByName",e)};var pr=new r,fr=new r,mr=/(^data:image\/ktx)|(\.ktx$)/i,gr=/(^data:image\/crn)|(\.crn$)/i,_r=function(){this.id=void 0,this.model=void 0,this.context=void 0};_r.prototype.set=function(e,t,r){this.id=e,this.model=t,this.context=r},_r.prototype.execute=function(){ze(this.id,this.model,this.context)};var vr=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};vr.prototype.set=function(e,t,r,i){this.id=e,this.componentType=t,this.model=r,this.context=i},vr.prototype.execute=function(){Ge(this.id,this.componentType,this.model,this.context)};var yr=new _r,br=new vr,Cr=function(){this.id=void 0,this.model=void 0,this.context=void 0};Cr.prototype.set=function(e,t,r){this.id=e,this.model=t,this.context=r},Cr.prototype.execute=function(){Ze(this.id,this.model,this.context)};var Sr=new Cr,Tr=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};Tr.prototype.set=function(e,t,r){this.gltfTexture=e,this.model=t,this.context=r},Tr.prototype.execute=function(){tt(this.gltfTexture,this.model,this.context)};var wr=new Tr,Ar={MODEL:function(e,t,r){return function(){return r.computedMatrix}},VIEW:function(e,t,r){return function(){return e.view}},PROJECTION:function(e,t,r){return function(){return e.projection}},MODELVIEW:function(e,t,r){var i=new x;return function(){return x.multiplyTransformation(e.view,r.computedMatrix,i)}},CESIUM_RTC_MODELVIEW:function(e,t,r){var i=new x;return function(){return x.multiplyTransformation(e.view,r.computedMatrix,i),x.setTranslation(i,t._rtcCenterEye,i)}},MODELVIEWPROJECTION:function(e,t,r){var i=new x;return function(){return x.multiplyTransformation(e.view,r.computedMatrix,i),x.multiply(e._projection,i,i)}},MODELINVERSE:function(e,t,r){var i=new x;return function(){return x.inverse(r.computedMatrix,i)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,r){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,r){var i=new x,n=new x;return function(){return x.multiplyTransformation(e.view,r.computedMatrix,i),x.inverse(i,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,r){var i=new x,n=new x;return function(){return x.multiplyTransformation(e.view,r.computedMatrix,i),x.multiply(e._projection,i,i),x.inverse(i,n)}},MODELINVERSETRANSPOSE:function(e,t,r){var i=new x,n=new E;return function(){return x.inverse(r.computedMatrix,i),x.getRotation(i,n),E.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,r){var i=new x,n=new x,o=new E;return function(){return x.multiplyTransformation(e.view,r.computedMatrix,i),x.inverse(i,n),x.getRotation(n,o),E.transpose(o,o)}},VIEWPORT:function(e,t,r){return function(){return e.viewportCartesian4}}},Er=[],xr=new i,Pr=new x,Ir=new x,Dr=0,Or=new e,Mr=new r,Rr=new n;nr.prototype.release=function(){if(0==--this.count)return c(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],ar(this),p(this)};var Lr=new r,Nr=new n;return Te.prototype.update=function(e){if(e.mode!==ye.MORPHING){var t=e.context;if(this._defaultTexture=t.defaultTexture,this._state===dr.NEEDS_LOAD&&c(this.gltf)){var i,n=this.cacheKey;if(c(n)){t.cache.modelRendererResourceCache=u(t.cache.modelRendererResourceCache,{});var o=t.cache.modelRendererResourceCache;if(i=o[this.cacheKey],c(i)){if(!i.ready)return;++i.count,this._loadRendererResourcesFromCache=!0}else i=new nr(t,n),i.count=1,o[this.cacheKey]=i;this._cachedRendererResources=i}else i=new nr(t),i.count=1,this._cachedRendererResources=i;if(this._state=dr.LOADING,this._state!==dr.FAILED){var a=this.gltf.extensions;if(c(a)&&c(a.CESIUM_RTC)){var s=r.fromArray(a.CESIUM_RTC.center);if(!r.equals(s,r.ZERO)){this._rtcCenter3D=s;var l=e.mapProjection,d=l.ellipsoid,h=d.cartesianToCartographic(this._rtcCenter3D),p=l.project(h);r.fromElements(p.z,p.x,p.y,p),this._rtcCenter2D=p,this._rtcCenterEye=new r,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new fe,this._loadRendererResourcesFromCache||Oe(this)}}var f=this._loadResources,m=this._incrementallyLoadTextures,g=!1;if(this._state===dr.LOADING){if(0===f.pendingBufferLoads){if(!this._updatedGltfVersion){var _={optimizeForCesium:!0,addBatchIdToGeneratedShaders:this._addBatchIdToGeneratedShaders};e.brdfLutGenerator.update(e),ie(this.gltf),ve.checkSupportedExtensions(this.extensionsRequired),Z(this.gltf),Q(this.gltf),te(this.gltf,_),re(this.gltf,_),Ie(this),this._loadRendererResourcesFromCache||(Me(this),Le(this),Ne(this),Fe(this,t)),Ue(this),Ve(this),Be(this),this._boundingSphere=xe(this),this._initialRadius=this._boundingSphere.radius,this._updatedGltfVersion=!0}this._updatedGltfVersion&&0===f.pendingShaderLoads&&Mt(this,e)}(f.finished()||m&&f.finishedEverythingButTextureCreation())&&(this._state=dr.LOADED,g=!0)}if(c(f)&&this._state===dr.LOADED&&(m&&!g&&Mt(this,e),f.finished())){this._loadResources=void 0;var v=this._rendererResources,y=this._cachedRendererResources;y.buffers=v.buffers,y.vertexArrays=v.vertexArrays,y.programs=v.programs,y.pickPrograms=v.pickPrograms,y.silhouettePrograms=v.silhouettePrograms,y.textures=v.textures,y.samplers=v.samplers,y.renderStates=v.renderStates,y.ready=!0,this._normalAttributeName=ve.getAttributeOrUniformBySemantic(this.gltf,"NORMAL"),c(this._precreatedAttributes)&&(y.vertexArrays={}),this.releaseGltfJson&&ir(this)}var b=qt(this,e),C=Xt(this),S=Qt(this),T=!c(this.distanceDisplayCondition)||ur(this,e),A=this.show&&T&&0!==this.scale&&(!S||b);if(A&&this._state===dr.LOADED||g){var E=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var P=this.modelMatrix,I=e.mode!==this._mode;this._mode=e.mode;var D=!x.equals(this._modelMatrix,P)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||I;if(D||g){x.clone(P,this._modelMatrix),lr(this),c(this._clampedModelMatrix)&&(P=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;var O=rr(this,e),M=this._computedModelMatrix;x.multiplyByUniformScale(P,O,M),this._upAxis===se.Y?x.multiplyTransformation(M,se.Y_UP_TO_Z_UP,M):this._upAxis===se.X&&x.multiplyTransformation(M,se.X_UP_TO_Z_UP,M)}var R=this.clippingPlanes;c(R)&&R.enabled&&x.multiply(t.uniformState.view3D,P,this._modelViewMatrix),(E||D||g)&&(Lt(this,D,g,e.mapProjection),this._dirty=!0,(E||g)&&Nt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,kt(this)),Ft(this,t),Bt(this),Ut(this),Vt(this),Ht(this,e),$t(this,e),er(this)}if(g){var L=this;return void e.afterRender.push(function(){L._ready=!0,L._readyPromise.resolve(L)})}if(A&&!this._ignoreCommands){var N,k,F,B=e.commandList,U=e.passes,V=this._nodeCommands,z=V.length,G=e.mapProjection.ellipsoid.maximumRadius*w.PI;if(U.render){for(N=0;N<z;++N)if(k=V[N],k.show){var H=C?k.translucentCommand:k.command;if(H=b?k.silhouetteModelCommand:H,B.push(H),F=k.command.boundingVolume,e.mode===ye.SCENE2D&&(F.center.y+F.radius>G||F.center.y-F.radius<G)){var W=C?k.translucentCommand2D:k.command2D;W=b?k.silhouetteModelCommand2D:W,B.push(W)}}if(b)for(N=0;N<z;++N)k=V[N],k.show&&(B.push(k.silhouetteColorCommand),F=k.command.boundingVolume,e.mode===ye.SCENE2D&&(F.center.y+F.radius>G||F.center.y-F.radius<G)&&B.push(k.silhouetteColorCommand2D))}if(U.pick&&this.allowPicking)for(N=0;N<z;++N)if(k=V[N],k.show){var j=k.pickCommand;B.push(j),F=j.boundingVolume,e.mode===ye.SCENE2D&&(F.center.y+F.radius>G||F.center.y-F.radius<G)&&B.push(k.pickCommand2D)}}}},Te.prototype.isDestroyed=function(){return!1},Te.prototype.destroy=function(){c(this._precreatedAttributes)&&or(this._rendererResources.vertexArrays),c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),c(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release();for(var e=this._pickIds,t=e.length,r=0;r<t;++r)e[r].destroy();return ir(this),p(this)},Te}),define("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/Resource","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/Model","../Scene/ModelAnimationLoop","../Scene/ShadowMode","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(t,r){r.collectionChanged.addEventListener(m.prototype._onCollectionChanged,this),this._scene=t,this._primitives=t.primitives,this._entityCollection=r,this._modelHash={},this._entitiesToVisualize=new e,this._onCollectionChanged(r,r.values,[],[])}function g(e,t,r,n){var o=r[t.id];i(o)&&(n.removeAndDestroy(o.modelPrimitive),delete r[t.id])}function _(e,t){var r=t[e.id];i(r)&&(r.nodeTransformationsScratch={})}function v(e){console.error(e)}var y=h.ENABLED,b=u.NONE,C=r.RED,S=r.WHITE,T=l.HIGHLIGHT,w=new a,A=new a;return m.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,r=this._modelHash,n=this._primitives,o=0,l=t.length;o<l;o++){var u,h,p=t[o],m=p._model,g=r[p.id],_=p.isShowing&&p.isAvailable(e)&&f.getValueOrDefault(m._show,e,!0);if(_&&(h=p.computeModelMatrix(e,w),u=s.createIfNeeded(f.getValueOrUndefined(m._uri,e)),_=i(h)&&i(u)),_){var E=i(g)?g.modelPrimitive:void 0;if(i(E)&&u.url===g.url||(i(E)&&(n.removeAndDestroy(E),delete r[p.id]),E=c.fromGltf({url:u,incrementallyLoadTextures:f.getValueOrDefault(m._incrementallyLoadTextures,e,!0),scene:this._scene}),E.readyPromise.otherwise(v),E.id=p,n.add(E),g={modelPrimitive:E,url:u.url,animationsRunning:!1,nodeTransformationsScratch:{},originalNodeMatrixHash:{}},r[p.id]=g),E.show=!0,E.scale=f.getValueOrDefault(m._scale,e,1),E.minimumPixelSize=f.getValueOrDefault(m._minimumPixelSize,e,0),E.maximumScale=f.getValueOrUndefined(m._maximumScale,e),E.modelMatrix=a.clone(h,E.modelMatrix),E.shadows=f.getValueOrDefault(m._shadows,e,y),E.heightReference=f.getValueOrDefault(m._heightReference,e,b),E.distanceDisplayCondition=f.getValueOrUndefined(m._distanceDisplayCondition,e),E.silhouetteColor=f.getValueOrDefault(m._silhouetteColor,e,C,E._silhouetteColor),E.silhouetteSize=f.getValueOrDefault(m._silhouetteSize,e,0),E.color=f.getValueOrDefault(m._color,e,S,E._color),E.colorBlendMode=f.getValueOrDefault(m._colorBlendMode,e,T),E.colorBlendAmount=f.getValueOrDefault(m._colorBlendAmount,e,.5),E.clippingPlanes=f.getValueOrUndefined(m._clippingPlanes,e),E.clampAnimations=f.getValueOrDefault(m._clampAnimations,e,!0),E.ready){var x=f.getValueOrDefault(m._runAnimations,e,!0);g.animationsRunning!==x&&(x?E.activeAnimations.addAll({loop:d.REPEAT}):E.activeAnimations.removeAll(),g.animationsRunning=x);var P=f.getValueOrUndefined(m._nodeTransformations,e,g.nodeTransformationsScratch);if(i(P))for(var I=g.originalNodeMatrixHash,D=Object.keys(P),O=0,M=D.length;O<M;++O){var R=D[O],L=P[R];if(i(L)){var N=E.getNode(R);if(i(N)){var k=I[R];i(k)||(k=N.matrix.clone(),I[R]=k);var F=a.fromTranslationRotationScale(L,A);N.matrix=a.multiply(k,F,F)}}}}}else i(g)&&(g.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,r=this._primitives,i=e.length-1;i>-1;i--)g(this,e[i],t,r);return n(this)},m.prototype.getBoundingSphere=function(e,r){var n=this._modelHash[e.id];if(!i(n))return p.FAILED;var o=n.modelPrimitive;if(!i(o)||!o.show)return p.FAILED;if(!o.ready)return p.PENDING;if(o.heightReference===u.NONE)t.transform(o.boundingSphere,o.modelMatrix,r);else{if(!i(o._clampedModelMatrix))return p.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,r)}return p.DONE},m.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],i(a._model)&&i(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],i(a._model)&&i(a._position)?(_(a,l),s.set(a.id,a)):(g(this,a,l,u),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],g(this,a,l,u),s.remove(a.id)},m}),define("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 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)\n{\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\n#ifdef POLYLINE_DASH\nvec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\nvec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\nvec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\nvec2 lineDir;\nif (usePrevious) {\nlineDir = normalize(positionWindow.xy - previousWindow.xy);\n}\nelse {\nlineDir = normalize(nextWindow.xy - positionWindow.xy);\n}\nangle = atan(lineDir.x, lineDir.y) - 1.570796327;\nangle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n#endif\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(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(nextEC.xyz - positionEC.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}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)\n{\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nreturn getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);\n}\n"}),define("Shaders/PolylineFS",[],function(){"use strict";return"#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\nvarying 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#ifdef VECTOR_TILE\ngl_FragColor *= u_highlightColor;\n#endif\n}\n"}),define("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;\nvarying float v_polylineAngle;\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, v_polylineAngle);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),define("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,r,i,n,o,a,s,l,u,c,d){"use strict";function h(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=d.fromType(d.ColorType,{color:new i(1,1,1,1)}));var l=a.positions;o(l)||(l=[]),this._positions=l,this._actualPositions=e(l,r.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=l.slice()),this._actualPositions.push(r.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=a.id;var h;o(s)&&(h=u.clone(s.modelMatrix)),this._modelMatrix=h,this._segments=c.wrapLongitude(this._actualPositions,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(b),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 r=e._polylineCollection;o(r)&&(r._updatePolyline(e,t),e._dirty=!0)}var f=h.POSITION_INDEX=0,m=h.SHOW_INDEX=1,g=h.WIDTH_INDEX=2,_=h.MATERIAL_INDEX=3,v=h.POSITION_SIZE_INDEX=4,y=h.DISTANCE_DISPLAY_CONDITION=5,b=h.NUMBER_OF_PROPERTIES=6;return a(h.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,p(this,m))}},positions:{get:function(){return this._positions},set:function(i){var n=e(i,r.equalsEpsilon);this._loop&&n.length>2&&(n===i&&(n=i.slice()),n.push(r.clone(n[0]))),this._actualPositions.length===n.length&&this._actualPositions.length===this._length||p(this,v),this._positions=i,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,f),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,p(this,_))}},width:{get:function(){return this._width},set:function(e){e!==this._width&&(this._width=e,p(this,g))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var t=this._actualPositions;e?t.length>2&&!r.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(r.clone(t[0]))):t.length>2&&r.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))}}}),h.prototype.update=function(){var e=u.IDENTITY;o(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var r=this._segments.positions.length,i=this._segments.lengths,n=this._propertiesChanged[f]>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=u.clone(e,this._modelMatrix),this._segments.positions.length!==r)p(this,v);else for(var a=i.length,s=0;s<a;++s)if(i[s]!==this._segments.lengths[s]){p(this,v);break}},h.prototype.getPickId=function(e){return o(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},h.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;t<b-1;++t)e[t]=0},h.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},h}),define("Scene/PolylineCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/combine","../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/Texture","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BatchTable","./BlendingState","./Material","./Polyline","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F){"use strict";function B(e){e=l(e,l.EMPTY_OBJECT),this.modelMatrix=_.clone(l(e.modelMatrix,_.IDENTITY)),this._modelMatrix=_.clone(_.IDENTITY),this.debugShowBoundingVolume=l(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(ae),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,this._useHighlightColor=!1,this._highlightColor=o.clone(o.WHITE);var t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}function U(e,t){u(e._batchTable)&&e._batchTable.destroy();var r=[{functionName:"batchTable_getWidthAndShow",componentDatatype:s.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:s.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:s.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:s.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:s.FLOAT,componentsPerAttribute:2}];e._batchTable=new R(t,r,e._polylines.length)}function V(t,r,i,n,o){for(var s=r.context,l=r.commandList,c=i.length,d=0,h=!0,p=t._vertexArrays,f=t.debugShowBoundingVolume,m=t._batchTable,g=m.getUniformMapCallback(),_=p.length,v=0;v<_;++v)for(var y=p[v],b=y.buckets,C=b.length,S=0;S<C;++S){for(var A,E,x,P,I=b[S],D=I.offset,O=o?I.bucket.shaderProgram:I.bucket.pickShaderProgram,M=I.bucket.polylines,R=M.length,L=0,N=0;N<R;++N){var k=M[N],B=W(k._material);if(B!==A){if(u(A)&&L>0){var U=E.isTranslucent();d>=c?(x=new T({owner:t}),i.push(x)):x=i[d],++d,P=a(g(E._uniforms),t._uniformMap),x.boundingVolume=e.clone(de,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=O,x.vertexArray=y.va,x.renderState=U?t._translucentRS:t._opaqueRS,x.pass=U?w.TRANSLUCENT:w.OPAQUE,x.debugShowBoundingVolume=!!o&&f,x.uniformMap=P,x.count=L,x.offset=D,D+=L,L=0,h=!0,l.push(x)}E=k._material,E.update(s),A=B}for(var V=k._locatorBuckets,z=V.length,G=0;G<z;++G){var H=V[G];H.locator===I&&(L+=H.count)}var j
;r.mode===F.SCENE3D?j=k._boundingVolumeWC:r.mode===F.COLUMBUS_VIEW?j=k._boundingVolume2D:r.mode===F.SCENE2D?u(k._boundingVolume2D)&&(j=e.clone(k._boundingVolume2D,he),j.center.x=0):u(k._boundingVolumeWC)&&u(k._boundingVolume2D)&&(j=e.union(k._boundingVolumeWC,k._boundingVolume2D,he)),h?(h=!1,e.clone(j,de)):e.union(j,de,de)}u(A)&&L>0&&(d>=c?(x=new T({owner:t}),i.push(x)):x=i[d],++d,P=a(g(E._uniforms),t._uniformMap),x.boundingVolume=e.clone(de,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=O,x.vertexArray=y.va,x.renderState=E.isTranslucent()?t._translucentRS:t._opaqueRS,x.pass=E.isTranslucent()?w.TRANSLUCENT:w.OPAQUE,x.debugShowBoundingVolume=!!o&&f,x.uniformMap=P,x.count=L,x.offset=D,h=!0,l.push(x)),A=void 0}i.length=d}function z(e){var t=!1,r=e._propertiesChanged,i=e._positionBufferUsage;return r[re]?i.bufferUsage!==C.STREAM_DRAW?(t=!0,i.bufferUsage=C.STREAM_DRAW,i.frameCount=100):i.frameCount=100:i.bufferUsage!==C.STATIC_DRAW&&(0===i.frameCount?(t=!0,i.bufferUsage=C.STATIC_DRAW):i.frameCount--),t}function G(e,t,r){e._createVertexArray=!1,X(e),Q(e),j(e);var i,n,o=[[]],a=o[0],l=e._batchTable,c=e._useHighlightColor,d=[0],h=0,p=[[]],m=0,_=e._polylineBuckets;for(i in _)_.hasOwnProperty(i)&&(n=_[i],n.updateShader(t,l,c),m+=n.lengthOfPositions);if(m>0){var v,y=e._mode,S=new Float32Array(6*m*3),T=new Float32Array(4*m),w=0,A=0,E=0;for(i in _)if(_.hasOwnProperty(i)){n=_[i],n.write(S,T,w,A,E,l,t,r),y===F.MORPHING&&(u(v)||(v=new Float32Array(6*m*3)),n.writeForMorph(v,w));var x=n.lengthOfPositions;w+=6*x*3,A+=4*x,E+=4*x,h=n.updateIndices(o,d,p,h)}var P=e._positionBufferUsage.bufferUsage,D=C.STATIC_DRAW;e._positionBuffer=b.createVertexBuffer({context:t,typedArray:S,usage:P});var O;u(v)&&(O=b.createVertexBuffer({context:t,typedArray:v,usage:P})),e._texCoordExpandAndBatchIndexBuffer=b.createVertexBuffer({context:t,typedArray:T,usage:D});for(var M=3*Float32Array.BYTES_PER_ELEMENT,R=4*Float32Array.BYTES_PER_ELEMENT,L=0,N=o.length,k=0;k<N;++k)if(a=o[k],a.length>0){var B=new Uint16Array(a),U=b.createIndexBuffer({context:t,typedArray:B,usage:C.STATIC_DRAW,indexDatatype:f.UNSIGNED_SHORT});L+=d[k];var V,z,G,H,W=6*(k*(M*g.SIXTY_FOUR_KILOBYTES)-L*M),q=M+W,Y=M+q,Z=M+Y,K=M+Z,J=M+K,$=k*(R*g.SIXTY_FOUR_KILOBYTES)-L*R,ee=[{index:se.position3DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:W,strideInBytes:6*M},{index:se.position3DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:q,strideInBytes:6*M},{index:se.position2DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:W,strideInBytes:6*M},{index:se.position2DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:q,strideInBytes:6*M},{index:se.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:Y,strideInBytes:6*M},{index:se.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:Z,strideInBytes:6*M},{index:se.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:Y,strideInBytes:6*M},{index:se.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:Z,strideInBytes:6*M},{index:se.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:K,strideInBytes:6*M},{index:se.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:J,strideInBytes:6*M},{index:se.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:K,strideInBytes:6*M},{index:se.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:s.FLOAT,offsetInBytes:J,strideInBytes:6*M},{index:se.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:s.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:$}];y===F.SCENE3D?(V=e._positionBuffer,z="vertexBuffer",G=pe,H="value"):y===F.SCENE2D||y===F.COLUMBUS_VIEW?(V=pe,z="value",G=e._positionBuffer,H="vertexBuffer"):(V=O,z="vertexBuffer",G=e._positionBuffer,H="vertexBuffer"),ee[0][z]=V,ee[1][z]=V,ee[2][H]=G,ee[3][H]=G,ee[4][z]=V,ee[5][z]=V,ee[6][H]=G,ee[7][H]=G,ee[8][z]=V,ee[9][z]=V,ee[10][H]=G,ee[11][H]=G;var te=new I({context:t,attributes:ee,indexBuffer:U});e._vertexArrays.push({va:te,buckets:p[k]})}}}function H(e,t){return t instanceof P?t.id:t}function W(e){var t=N._uniformList[e.type],r=t.length;fe.length=2*r;for(var i=0,n=0;n<r;++n){var o=t[n];fe[i]=o,fe[i+1]=e._uniforms[o](),i+=2}return e.type+":"+JSON.stringify(fe,H)}function j(e){for(var t=e._mode,r=e._modelMatrix,i=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 l=s.material,c=i[l.type];u(c)||(c=i[l.type]=new J(l,t,r)),c.addPolyline(s)}}}function q(e,t){var r=t.mode;e._mode===r&&_.equals(e._modelMatrix,e.modelMatrix)||(e._mode=r,e._modelMatrix=_.clone(e.modelMatrix),e._createVertexArray=!0)}function Y(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],r=e._polylines.length,i=0,n=0;i<r;++i){var o=e._polylines[i];u(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function X(e){for(var t=e._polylines,r=t.length,i=0;i<r;++i)if(u(t[i])){var n=t[i]._bucket;u(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function Q(e){for(var t=e._vertexArrays.length,r=0;r<t;++r)e._vertexArrays[r].va.destroy();e._vertexArrays.length=0}function Z(e){for(var t=e._polylines,r=t.length,i=0;i<r;++i)u(t[i])&&t[i]._destroy()}function K(e,t,r){this.count=e,this.offset=t,this.bucket=r}function J(e,t,r){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.modelMatrix=r}function $(e){return r.dot(r.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(v.ORIGIN_ZX_PLANE)===m.INTERSECTING}var ee=k.SHOW_INDEX,te=k.WIDTH_INDEX,re=k.POSITION_INDEX,ie=k.MATERIAL_INDEX,ne=k.POSITION_SIZE_INDEX,oe=k.DISTANCE_DISPLAY_CONDITION,ae=k.NUMBER_OF_PROPERTIES,se={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};c(B.prototype,{length:{get:function(){return Y(this),this._polylines.length}}}),B.prototype.add=function(e){var t=new k(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,u(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(){X(this),Z(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},B.prototype.contains=function(e){return u(e)&&e._polylineCollection===this},B.prototype.get=function(e){return Y(this),this._polylines[e]};var le=new p,ue=new i,ce=new t;B.prototype.update=function(e){if(Y(this),0!==this._polylines.length){q(this,e);var r,n=e.context,o=e.mapProjection,a=this._propertiesChanged;if(this._createBatchTable){if(0===S.maximumVertexTextureImageUnits)throw new y("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");U(this,n),this._createBatchTable=!1}if(this._createVertexArray||z(this))G(this,n,o);else if(this._polylinesUpdated){var s=this._polylinesToUpdate;if(this._mode!==F.SCENE3D)for(var l=s.length,c=0;c<l;++c)r=s[c],r.update();if(a[ne]||a[ie])G(this,n,o);else for(var d=s.length,h=this._polylineBuckets,f=0;f<d;++f){r=s[f],a=r._propertiesChanged;var m=r._bucket,g=0;for(var v in h)if(h.hasOwnProperty(v)){if(h[v]===m){a[re]&&m.writeUpdate(g,r,this._positionBuffer,o);break}g+=h[v].lengthOfPositions}if((a[ee]||a[te])&&this._batchTable.setBatchedAttribute(r._index,0,new t(r._width,r._show)),this._batchTable.attributes.length>2){if(a[re]||a[ne]){var b=e.mode===F.SCENE2D?r._boundingVolume2D:r._boundingVolumeWC,C=p.fromCartesian(b.center,le),T=i.fromElements(C.low.x,C.low.y,C.low.z,b.radius,ue);this._batchTable.setBatchedAttribute(r._index,2,C.high),this._batchTable.setBatchedAttribute(r._index,3,T)}if(a[oe]){var w=ce;w.x=0,w.y=Number.MAX_VALUE;var E=r.distanceDisplayCondition;u(E)&&(w.x=E.near,w.y=E.far),this._batchTable.setBatchedAttribute(r._index,4,w)}}r._clean()}s.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(var x=0;x<ae;++x)a[x]=0;var P=_.IDENTITY;e.mode===F.SCENE3D&&(P=this.modelMatrix);var I=e.passes,D=0!==e.morphTime;if(u(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===D||(this._opaqueRS=A.fromCache({depthMask:D,depthTest:{enabled:D}})),u(this._translucentRS)&&this._translucentRS.depthTest.enabled===D||(this._translucentRS=A.fromCache({blending:L.ALPHA_BLEND,depthMask:!D,depthTest:{enabled:D}})),this._batchTable.update(e),I.render){V(this,e,this._colorCommands,P,!0)}if(I.pick){V(this,e,this._pickCommands,P,!1)}}};var de=new e,he=new e;B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){return Q(this),X(this),Z(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),d(this)};var pe=[0,0,0],fe=[];B.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},J.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},J.prototype.updateShader=function(e,t,r){if(!u(this.shaderProgram)){var i=["DISTANCE_DISPLAY_CONDITION"];r&&i.push("VECTOR_TILE"),-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&i.push("POLYLINE_DASH");var n=new x({defines:i,sources:[this.material.shaderSource,O]}),o=t.getVertexShaderCallback()(M),a=new x({defines:i,sources:[D,o]}),s=new x({sources:n.sources,pickColorQualifier:"varying"});this.shaderProgram=E.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:n,attributeLocations:se}),this.pickShaderProgram=E.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:se})}},J.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===F.SCENE3D||!$(e))return 4*(t=e._actualPositions.length)-4;var r=0,i=e._segments.lengths;t=i.length;for(var n=0;n<t;++n)r+=4*i[n]-4;return r};var me=new r,ge=new r,_e=new r,ve=new r,ye=new i,be=new t;J.prototype.write=function(e,t,n,a,s,l,c,d){for(var h=this.mode,f=d.ellipsoid.maximumRadius*g.PI,m=this.polylines,_=m.length,v=0;v<_;++v){for(var y,b=m[v],C=b.width,S=b.show&&C>0,T=b._index,w=this.getSegments(b,d),A=w.positions,E=w.lengths,x=A.length,P=b.getPickId(c).color,I=0,D=0,O=0;O<x;++O){0===O?b._loop?y=A[x-2]:(y=ve,r.subtract(A[0],A[1],y),r.add(A[0],y,y)):y=A[O-1],r.clone(y,ge),r.clone(A[O],me),O===x-1?b._loop?y=A[1]:(y=ve,r.subtract(A[x-1],A[x-2],y),r.add(A[x-1],y,y)):y=A[O+1],r.clone(y,_e);var M=E[I];O===D+M&&(D+=M,++I);var R=O-D==0,L=O===D+E[I]-1;h===F.SCENE2D&&(ge.z=0,me.z=0,_e.z=0),h!==F.SCENE2D&&h!==F.MORPHING||(R||L)&&f-Math.abs(me.x)<1&&((me.x<0&&ge.x>0||me.x>0&&ge.x<0)&&r.clone(me,ge),(me.x<0&&_e.x>0||me.x>0&&_e.x<0)&&r.clone(me,_e));for(var N=R?2:0,k=L?2:4,B=N;B<k;++B){p.writeElements(me,e,n),p.writeElements(ge,e,n+6),p.writeElements(_e,e,n+12);var U=B-2<0?-1:1;t[s]=O/(x-1),t[s+1]=B%2*2-1,t[s+2]=U,t[s+3]=T,n+=18,s+=4}}var V=ye;V.x=o.floatToByte(P.red),V.y=o.floatToByte(P.green),V.z=o.floatToByte(P.blue),V.w=o.floatToByte(P.alpha);var z=be;z.x=C,z.y=S?1:0;var G=h===F.SCENE2D?b._boundingVolume2D:b._boundingVolumeWC,H=p.fromCartesian(G.center,le),W=H.high,j=i.fromElements(H.low.x,H.low.y,H.low.z,G.radius,ue),q=ce;q.x=0,q.y=Number.MAX_VALUE;var Y=b.distanceDisplayCondition;u(Y)&&(q.x=Y.near,q.y=Y.far),l.setBatchedAttribute(T,0,z),l.setBatchedAttribute(T,1,V),l.attributes.length>2&&(l.setBatchedAttribute(T,2,W),l.setBatchedAttribute(T,3,j),l.setBatchedAttribute(T,4,q))}};var Ce=new r,Se=new r,Te=new r,we=new r;J.prototype.writeForMorph=function(e,t){for(var i=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,d=0,h=0,f=0;f<c;++f){var m;0===f?s._loop?m=l[c-2]:(m=we,r.subtract(l[0],l[1],m),r.add(l[0],m,m)):m=l[f-1],m=_.multiplyByPoint(i,m,Se);var g,v=_.multiplyByPoint(i,l[f],Ce);f===c-1?s._loop?g=l[1]:(g=we,r.subtract(l[c-1],l[c-2],g),r.add(l[c-1],g,g)):g=l[f+1],g=_.multiplyByPoint(i,g,Te);var y=u[d];f===h+y&&(h+=y,++d);for(var b=f-h==0,C=f===h+u[d]-1,S=b?2:0,T=C?2:4,w=S;w<T;++w)p.writeElements(v,e,t),p.writeElements(m,e,t+6),p.writeElements(g,e,t+12),t+=18}};var Ae=new Array(1);J.prototype.updateIndices=function(e,t,r,i){var n=r.length-1,o=new K(0,i,this);r[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,d=0;d<c;++d){var h=u[d];h._locatorBuckets=[];var p;if(this.mode===F.SCENE3D){p=Ae;var f=h._actualPositions.length;if(!(f>0))continue;p[0]=f}else p=h._segments.lengths;var m=p.length;if(m>0){for(var _=0,v=0;v<m;++v)for(var y=p[v]-1,b=0;b<y;++b)l+4>g.SIXTY_FOUR_KILOBYTES&&(h._locatorBuckets.push({locator:o,count:_}),_=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,i=0,o=new K(0,0,this),r[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),_+=6,a+=6,i+=6,l+=4;h._locatorBuckets.push({locator:o,count:_}),l+4>g.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),l=0,o.count=a,i=0,a=0,o=new K(0,0,this),r[++n]=[o])}h._clean()}return o.count=a,i},J.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,r=0,i=t.length,n=0;n<i;++n){var o=t[n];if(o===e)break;r+=o._actualLength}return r};var Ee={positions:void 0,lengths:void 0},xe=new Array(1),Pe=new r,Ie=new n;J.prototype.getSegments=function(t,i){var n=t._actualPositions;if(this.mode===F.SCENE3D)return xe[0]=n.length,Ee.positions=n,Ee.lengths=xe,Ee;$(t)&&(n=t._segments.positions);for(var o,a=i.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=Pe,d=0;d<u;++d)o=n[d],c=_.multiplyByPoint(l,o,c),s.push(i.project(a.cartesianToCartographic(c,Ie)));if(s.length>0){t._boundingVolume2D=e.fromPoints(s,t._boundingVolume2D);var h=t._boundingVolume2D.center;t._boundingVolume2D.center=new r(h.z,h.x,h.y)}return Ee.positions=s,Ee.lengths=t._segments.lengths,Ee};var De;return J.prototype.writeUpdate=function(e,t,i,n){var o=this.mode,a=n.ellipsoid.maximumRadius*g.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);var l=De,c=6*s*3;!u(l)||l.length<c?l=De=new Float32Array(c):l.length>c&&(l=new Float32Array(l.buffer,0,c));var d,h=this.getSegments(t,n),f=h.positions,m=h.lengths,_=0,v=0,y=0;s=f.length;for(var b=0;b<s;++b){0===b?t._loop?d=f[s-2]:(d=ve,r.subtract(f[0],f[1],d),r.add(f[0],d,d)):d=f[b-1],r.clone(d,ge),r.clone(f[b],me),b===s-1?t._loop?d=f[1]:(d=ve,r.subtract(f[s-1],f[s-2],d),r.add(f[s-1],d,d)):d=f[b+1],r.clone(d,_e);var C=m[v];b===y+C&&(y+=C,++v);var S=b-y==0,T=b===y+m[v]-1;o===F.SCENE2D&&(ge.z=0,me.z=0,_e.z=0),o!==F.SCENE2D&&o!==F.MORPHING||(S||T)&&a-Math.abs(me.x)<1&&((me.x<0&&ge.x>0||me.x>0&&ge.x<0)&&r.clone(me,ge),(me.x<0&&_e.x>0||me.x>0&&_e.x<0)&&r.clone(me,_e));for(var w=S?2:0,A=T?2:4,E=w;E<A;++E)p.writeElements(me,l,_),p.writeElements(ge,l,_+6),p.writeElements(_e,l,_+12),_+=18}i.copyFromArrayView(l,18*Float32Array.BYTES_PER_ELEMENT*e)}},B}),define("DataSources/ScaledPositionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ReferenceFrame","./Property"],function(e,t,r,i,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,r,n){if(e(this._value))return n=this._value.getValueInReferenceFrame(t,r,n),e(n)?i.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}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b){"use strict";function C(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function S(e,t,i,n,a,s,l,u,c){var d,h=u;d=e.getValueInReferenceFrame(t,s,c[h]),r(d)&&(c[h++]=d);for(var p,f,m,g=!r(a)||o.lessThanOrEquals(a,t)||o.greaterThanOrEquals(a,i),_=0,v=n.length,y=n[_],b=i,C=!1;_<v;){if(!g&&o.greaterThanOrEquals(y,a)&&(d=e.getValueInReferenceFrame(a,s,c[h]),r(d)&&(c[h++]=d),g=!0),o.greaterThan(y,t)&&o.lessThan(y,b)&&!y.equals(a)&&(d=e.getValueInReferenceFrame(y,s,c[h]),r(d)&&(c[h++]=d)),_<v-1){if(l>0&&!C){var S=n[_+1],T=o.secondsDifference(S,y);C=T>l,C&&(p=Math.ceil(T/l),f=0,m=T/Math.max(p,2),p=Math.max(p-1,1))}if(C&&f<p){y=o.addSeconds(y,m,new o),f++;continue}}C=!1,_++,y=n[_]}return d=e.getValueInReferenceFrame(i,s,c[h]),r(d)&&(c[h++]=d),h}function T(e,t,i,n,a,s,l,u){for(var c,d=0,h=l,p=t,f=Math.max(s,60),m=!r(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,i);o.lessThan(p,i);)!m&&o.greaterThanOrEquals(p,n)&&(m=!0,c=e.getValueInReferenceFrame(n,a,u[h]),r(c)&&(u[h]=c,h++)),c=e.getValueInReferenceFrame(p,a,u[h]),r(c)&&(u[h]=c,h++),d++,p=o.addSeconds(t,f*d,new o);return c=e.getValueInReferenceFrame(i,a,u[h]),r(c)&&(u[h]=c,h++),h}function w(e,t,i,n,a,s,l,c){R.start=t,R.stop=i;for(var d=l,h=e.intervals,p=0;p<h.length;p++){var f=h.get(p);if(!u.intersect(f,R,O).isEmpty){var m=f.start;f.isStartIncluded||(m=f.isStopIncluded?f.stop:o.addSeconds(f.start,o.secondsDifference(f.stop,f.start)/2,new o));var g=e.getValueInReferenceFrame(m,a,c[d]);r(g)&&(c[d]=g,d++)}}return d}function A(e,t,i,n,o,a,s,l){var u=e.getValueInReferenceFrame(t,o,l[s]);return r(u)&&(l[s++]=u),s}function E(e,t,r,i,n,a,s,l){M.start=t,M.stop=r;for(var c=s,d=e.intervals,h=0;h<d.length;h++){var p=d.get(h);if(!u.intersect(p,M,O).isEmpty){var f=p.start,m=p.stop,g=t;o.greaterThan(f,g)&&(g=f);var _=r;o.lessThan(m,_)&&(_=m),c=x(p.data,g,_,i,n,a,c,l)}}return c}function x(e,t,r,i,n,o,a,s){for(;e instanceof _;)e=e.resolvedProperty;if(e instanceof v){a=S(e,t,r,e._property._times,i,n,o,a,s)}else a=e instanceof p?E(e,t,r,i,n,o,a,s):e instanceof b?w(e,t,r,i,n,o,a,s):e instanceof f||e instanceof y&&g.isConstant(e)?A(e,t,r,i,n,o,a,s):T(e,t,r,i,n,o,a,s);return a}function P(e,t,i,n,o,a,s){r(s)||(s=[]);var l=x(e,t,i,n,o,a,0,s);return s.length=l,s}function I(e,t){this._unusedIndexes=[],this._polylineCollection=new d,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function D(t,r){r.collectionChanged.addEventListener(D.prototype._onCollectionChanged,this),this._scene=t,this._updaters={},this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}var O=new u,M=new u,R=new u,L=new a;return I.prototype.update=function(e){if(this._referenceFrame===l.INERTIAL){var i=c.computeIcrfToFixedMatrix(e,L);r(i)||(i=c.computeTemeToPseudoFixedMatrix(e,L)),s.fromRotationTranslation(i,t.ZERO,this._polylineCollection.modelMatrix)}},I.prototype.updateObject=function(e,t){var i,n,a=t.entity,s=a._path,l=a._position,u=s._show,c=t.polyline,d=a.isShowing&&(!r(u)||u.getValue(e));if(d){var h=g.getValueOrUndefined(s._leadTime,e),p=g.getValueOrUndefined(s._trailTime,e),f=a._availability,_=r(f),v=r(h),y=r(p);if(d=_||v&&y){if(y&&(i=o.addSeconds(e,-p,new o)),v&&(n=o.addSeconds(e,h,new o)),_){var b=f.start,C=f.stop;y&&!o.greaterThan(b,i)||(i=b),v&&!o.lessThan(C,n)||(n=C)}d=o.lessThan(i,n)}}if(!d)return void(r(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0));if(!r(c)){var S=this._unusedIndexes;if(S.length>0){var T=S.pop();c=this._polylineCollection.get(T),t.index=T}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var w=g.getValueOrDefault(s._resolution,e,60);c.show=!0,c.positions=P(l,i,n,e,this._referenceFrame,w,c.positions.slice()),c.material=m.getValue(e,s._material,c.material),c.width=g.getValueOrDefault(s._width,e,1),c.distanceDisplayCondition=g.getValueOrUndefined(s._distanceDisplayCondition,e,c.distanceDisplayCondition)},I.prototype.removeObject=function(e){var t=e.polyline;r(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},I.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),i(this)},D.prototype.update=function(e){var t=this._updaters;for(var i in t)t.hasOwnProperty(i)&&t[i].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,d=s.updater,p=l.FIXED;this._scene.mode===h.SCENE3D&&(p=c.referenceFrame);var f=this._updaters[p];d===f&&r(f)?f.updateObject(e,s):(r(d)&&d.removeObject(s),r(f)||(f=new I(this._scene,p),f.update(e),this._updaters[p]=f),s.updater=f,r(f)&&f.updateObject(e,s))}return!0},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(D.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return i(this)},D.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],r(a._path)&&r(a._position)&&l.set(a.id,new C(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._path)&&r(a._position)?l.contains(a.id)||l.set(a.id,new C(a)):(s=l.get(a.id),r(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=i.length-1;o>-1;o--)a=i[o],s=l.get(a.id),r(s)&&(r(s.updater)&&s.updater.removeObject(s),l.remove(a.id))},D._subSample=P,D}),define("Scene/createBillboardPointCallback",[],function(){"use strict";function e(e,t,r,i,n){return function(){var o=document.createElement("canvas"),a=n+2*i;o.height=o.width=a;var s=o.getContext("2d");return s.clearRect(0,0,a,a),0!==i&&(s.beginPath(),s.arc(a/2,a/2,a/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=r,s.fill(),e<1&&(s.save(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(a/2,a/2,n/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle="black",s.fill(),s.restore())),s.beginPath(),s.arc(a/2,a/2,n/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=t,s.fill(),o}}return e}),define("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/createBillboardPointCallback","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d){"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 p(t,r){r.collectionChanged.addEventListener(p.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function f(e,t,r){if(i(e)){var n=e.pointPrimitive;if(i(n))return e.pointPrimitive=void 0,void r.removePoint(t);var o=e.billboard;i(o)&&(e.billboard=void 0,r.removeBillboard(t))}}var m=r.WHITE,g=r.BLACK,_=new r,v=new t,y=new r,b=new s,C=new s,S=new a;return p.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],c=s.entity,h=c._point,p=s.pointPrimitive,T=s.billboard,w=d.getValueOrDefault(h._heightReference,e,u.NONE),A=c.isShowing&&c.isAvailable(e)&&d.getValueOrDefault(h._show,e,!0);if(A&&(v=d.getValueOrUndefined(c._position,e,v),A=i(v)),A){d.isConstant(c._position)||(n._clusterDirty=!0);var E=!1;if(w===u.NONE||i(T)?w!==u.NONE||i(p)||(i(T)&&(f(s,c,n),T=void 0),p=n.getPoint(c),p.id=c,s.pointPrimitive=p):(i(p)&&(f(s,c,n),p=void 0),T=n.getBillboard(c),T.id=c,T.image=void 0,s.billboard=T,E=!0),i(p))p.show=!0,p.position=v,p.scaleByDistance=d.getValueOrUndefined(h._scaleByDistance,e,b),p.translucencyByDistance=d.getValueOrUndefined(h._translucencyByDistance,e,C),p.color=d.getValueOrDefault(h._color,e,m,_),p.outlineColor=d.getValueOrDefault(h._outlineColor,e,g,y),p.outlineWidth=d.getValueOrDefault(h._outlineWidth,e,0),p.pixelSize=d.getValueOrDefault(h._pixelSize,e,1),p.distanceDisplayCondition=d.getValueOrUndefined(h._distanceDisplayCondition,e,S),p.disableDepthTestDistance=d.getValueOrDefault(h._disableDepthTestDistance,e,0);else if(i(T)){T.show=!0,T.position=v,T.scaleByDistance=d.getValueOrUndefined(h._scaleByDistance,e,b),T.translucencyByDistance=d.getValueOrUndefined(h._translucencyByDistance,e,C),T.distanceDisplayCondition=d.getValueOrUndefined(h._distanceDisplayCondition,e,S),T.disableDepthTestDistance=d.getValueOrDefault(h._disableDepthTestDistance,e,0),T.heightReference=w;var x=d.getValueOrDefault(h._color,e,m,_),P=d.getValueOrDefault(h._outlineColor,e,g,y),I=Math.round(d.getValueOrDefault(h._outlineWidth,e,0)),D=Math.max(1,Math.round(d.getValueOrDefault(h._pixelSize,e,1)));if(I>0?(T.scale=1,E=E||I!==s.outlineWidth||D!==s.pixelSize||!r.equals(x,s.color)||!r.equals(P,s.outlineColor)):(T.scale=D/50,D=50,E=E||I!==s.outlineWidth||!r.equals(x,s.color)||!r.equals(P,s.outlineColor)),E){s.color=r.clone(x,s.color),s.outlineColor=r.clone(P,s.outlineColor),s.pixelSize=D,s.outlineWidth=I;var O=x.alpha,M=x.toCssColorString(),R=P.toCssColorString(),L=JSON.stringify([M,D,R,I]);T.setImage(L,l(O,M,R,I,D))}}}else f(s,c,n)}return!0},p.prototype.getBoundingSphere=function(e,r){var n=this._items.get(e.id);if(!i(n)||!i(n.pointPrimitive)&&!i(n.billboard))return c.FAILED;if(i(n.pointPrimitive))r.center=t.clone(n.pointPrimitive.position,r.center);else{var o=n.billboard;if(!i(o._clampedPosition))return c.PENDING;r.center=t.clone(o._clampedPosition,r.center)}return r.radius=0,c.DONE},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(p.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return n(this)},p.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._items,l=this._cluster;for(o=t.length-1;o>-1;o--)a=t[o],i(a._point)&&i(a._position)&&s.set(a.id,new h(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._point)&&i(a._position)?s.contains(a.id)||s.set(a.id,new h(a)):(f(s.get(a.id),a,l),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],f(s.get(a.id),a,l),s.remove(a.id)},p}),define("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;\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),define("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,r,i,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.translucent,!0),i=s.VERTEX_FORMAT;this.material=void 0,this.translucent=r,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(r,!1,t.renderState),this._closed=!1,this._vertexFormat=i}var l=o+"\n"+n,u=i;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=r.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),define("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;\nvarying float v_polylineAngle;\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, v_polylineAngle);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),define("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),n=u.VERTEX_FORMAT;this.material=t(r.material)?r.material:l.fromType(l.ColorType),this.translucent=i,this._vertexShaderSource=e(r.vertexShaderSource,c),this._fragmentShaderSource=e(r.fragmentShaderSource,d),this._renderState=s.getDefaultRenderState(i,!1,r.renderState),this._closed=!1,this._vertexFormat=n}var c=o+"\n"+n,d=a;return r(u.prototype,{vertexShaderSource:{get:function(){var e=this._vertexShaderSource;return-1!==this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g)&&(e="#define POLYLINE_DASH\n"+e),e}},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=i.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),
define("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Check","../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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A){"use strict";function E(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 d,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._depthFailMaterialProperty=void 0,this._options=new E(e),this._id="polyline-"+e.id,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function P(e,t){var r=t._scene.id,i=I[r];!o(i)||i.isDestroyed()?(i=new _,I[r]=i,e.add(i)):e.contains(i)||e.add(i);var n=i.add();n.id=t._entity,this._line=n,this._primitives=e,this._geometryUpdater=t,this._positions=[]}var I={},D=new r,O=new S(r.WHITE),M=new T(!0),R=new T(b.DISABLED),L=new T(new u);a(x.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&A.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},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 t,n=this._entity,a=n.isAvailable(e),s=new g(a&&n.isShowing&&this._showProperty.getValue(e)),l=this._distanceDisplayConditionProperty.getValue(e),u=c.fromDistanceDisplayCondition(l),d={show:s,distanceDisplayCondition:u};return this._materialProperty instanceof S&&(o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||a)&&(t=this._materialProperty.color.getValue(e,D)),o(t)||(t=r.WHITE),d.color=i.fromColor(t)),o(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof S&&(o(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||a)&&(t=this._depthFailMaterialProperty.color.getValue(e,D)),o(t)||(t=r.WHITE),d.depthFailColor=i.fromColor(t)),new h({id:n,geometry:new f(this._options),attributes:d})},x.prototype.createOutlineGeometryInstance=function(e){},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),s(this)},x.prototype._onEntityPropertyChanged=function(e,t,r,i){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!o(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(o(l)&&l.isConstant&&!l.getValue(p.MINIMUM_VALUE)||!o(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=n(a.material,O),c=u instanceof S;this._materialProperty=u,this._depthFailMaterialProperty=a.depthFailMaterial,this._showProperty=n(l,M),this._shadowsProperty=n(a.shadows,R),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,L),this._fillEnabled=!0;var d=a.width,h=a.followSurface,f=a.granularity;if(s.isConstant&&A.isConstant(d)&&A.isConstant(h)&&A.isConstant(f)){var m=this._options,g=s.getValue(p.MINIMUM_VALUE,m.positions);if(!o(g)||g.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var _;_=c&&(!o(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof S)?v.VERTEX_FORMAT:y.VERTEX_FORMAT,m.vertexFormat=_,m.positions=g,m.width=o(d)?d.getValue(p.MINIMUM_VALUE):void 0,m.followSurface=o(h)?h.getValue(p.MINIMUM_VALUE):void 0,m.granularity=o(f)?f.getValue(p.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 P(e,this)};var N={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return P.prototype.update=function(e){var t=this._geometryUpdater,r=t._entity,i=r.polyline,n=this._line;if(!r.isShowing||!r.isAvailable(e)||!A.getValueOrDefault(i._show,e,!0))return void(n.show=!1);var a=i.positions,s=A.getValueOrUndefined(a,e,this._positions);if(!o(s)||s.length<2)return void(n.show=!1);var l=A.getValueOrDefault(i._followSurface,e,!0),u=t._scene.globe;l&&o(u)&&(N.ellipsoid=u.ellipsoid,N.positions=s,N.granularity=A.getValueOrUndefined(i._granularity,e),N.height=m.extractHeights(s,u.ellipsoid),s=m.generateCartesianArc(N)),n.show=!0,n.positions=s.slice(),n.material=w.getValue(e,t.fillMaterialProperty,n.material),n.width=A.getValueOrDefault(i._width,e,1),n.distanceDisplayCondition=A.getValueOrUndefined(i._distanceDisplayCondition,e,n.distanceDisplayCondition)},P.prototype.getBoundingSphere=function(t){var r=this._line;return r.show&&r.positions.length>0?(e.fromPoints(r.positions,t),C.DONE):C.FAILED},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,r=I[t];r.remove(this._line),0===r.length&&(this._primitives.removeAndDestroy(r),delete I[t]),s(this)},x}),define("DataSources/PolylineVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Check","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./DynamicGeometryBatch","./PolylineGeometryUpdater","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e,t){for(var r=e._batches,i=r.length,n=0;n<i;n++)r[n].remove(t)}function g(e,t,r){if(r.isDynamic)return void e._dynamicBatch.add(t,r);var n;r.fillEnabled&&(n=r.shadowsProperty.getValue(t));var o=0;i(r.depthFailMaterialProperty)&&(o=r.depthFailMaterialProperty instanceof c?1:2);var a;i(n)&&(a=n+o*l.NUMBER_OF_SHADOW_MODES),r.fillEnabled&&(r.fillMaterialProperty instanceof c?e._colorBatches[a].add(t,r):e._materialBatches[a].add(t,r))}function _(t,r){var i=t.primitives;this._scene=t,this._primitives=i,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e;var n=l.NUMBER_OF_SHADOW_MODES;this._colorBatches=new Array(3*n),this._materialBatches=new Array(3*n);for(var o=0;o<n;++o)this._colorBatches[o]=new p(i,a,void 0,!1,o),this._materialBatches[o]=new f(i,s,void 0,!1,o),this._colorBatches[o+n]=new p(i,a,a,!1,o),this._materialBatches[o+n]=new f(i,s,a,!1,o),this._colorBatches[o+2*n]=new p(i,a,s,!1,o),this._materialBatches[o+2*n]=new f(i,s,s,!1,o);this._dynamicBatch=new d(i),this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch),this._subscriptions=new e,this._updaters=new e,this._entityCollection=r,r.collectionChanged.addEventListener(_.prototype._onCollectionChanged,this),this._onCollectionChanged(r,r.values,v)}var v=[];_.prototype.update=function(e){var t,r,i,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--)r=c[t],i=r.id,n=this._updaters.get(i),n.entity===r?(m(this,n),g(this,e,n)):(l.push(r),a.push(r));for(t=l.length-1;t>-1;t--)r=l[t],i=r.id,n=this._updaters.get(i),m(this,n),n.destroy(),this._updaters.remove(i),this._subscriptions.get(i)(),this._subscriptions.remove(i);for(t=a.length-1;t>-1;t--)r=a[t],i=r.id,n=new h(r,this._scene),this._updaters.set(i,n),g(this,e,n),this._subscriptions.set(i,n.geometryChanged.addEventListener(_._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var d=!0,p=this._batches,f=p.length;for(t=0;t<f;t++)d=p[t].update(e)&&d;return d};var y=[],b=new t;return _.prototype.getBoundingSphere=function(e,r){for(var i=y,n=b,o=0,a=u.DONE,s=this._batches,l=s.length,c=this._updaters.get(e.id),d=0;d<l;d++){if((a=s[d].getBoundingSphere(c,n))===u.PENDING)return u.PENDING;a===u.DONE&&(i[o]=t.clone(n,i[o]),o++)}return 0===o?u.FAILED:(i.length=o,t.fromBoundingSpheres(i,r),u.DONE)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,r=t.length;for(e=0;e<r;e++)t[e].removeAllPrimitives();var i=this._subscriptions.values;for(r=i.length,e=0;e<r;e++)i[e]();return this._subscriptions.removeAll(),n(this)},_._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)},_.prototype._onCollectionChanged=function(e,t,r){var i,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(i=r.length-1;i>-1;i--)o=r[i],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(i=t.length-1;i>-1;i--)o=t[i],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},_}),define("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","../Scene/GroundPrimitive","./BillboardVisualizer","./BoundingSphereState","./CustomDataSource","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolylineVisualizer"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_){"use strict";function v(e){l.initializeTerrainHeights();var t=e.scene,i=e.dataSourceCollection;this._eventHelper=new s,this._eventHelper.add(i.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(i.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=i,this._scene=t,this._visualizersCallback=r(e.visualizersCallback,v.defaultVisualizersCallback);for(var n=0,o=i.length;n<o;n++)this._onDataSourceAdded(i,i.get(n));var a=new d;this._onDataSourceAdded(void 0,a),this._defaultDataSource=a,this._ready=!1}v.defaultVisualizersCallback=function(e,t,r){var i=r.entities;return[new u(t,i),new h(e,i),new p(t,i),new f(e,i),new g(t,i),new m(e,i),new _(e,i)]},n(v.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}}}),v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,r=e.length;t<r;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),o(this)},v.prototype.update=function(e){if(!l._initialized)return this._ready=!1,!1;var t,r,n,o,a=!0,s=this._dataSourceCollection,u=s.length;for(t=0;t<u;t++){var c=s.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 y=[],b=new e;return v.prototype.getBoundingSphere=function(t,r,n){if(!this._ready)return c.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 u=l.get(o);if(u.entities.contains(t)){s=u;break}}}if(!i(s))return c.FAILED;var d=y,h=b,p=0,f=c.DONE,m=s._visualizers,g=m.length;for(o=0;o<g;o++){var _=m[o];if(i(_.getBoundingSphere)){if(f=m[o].getBoundingSphere(t,h),!r&&f===c.PENDING)return c.PENDING;f===c.DONE&&(d[p]=e.clone(h,d[p]),p++)}}return 0===p?c.FAILED:(d.length=p,e.fromBoundingSpheres(d,n),c.DONE)},v.prototype._onDataSourceAdded=function(e,t){var r=this._scene,i=t.clustering;i._initialize(r),r.primitives.add(i),t._visualizers=this._visualizersCallback(r,i,t)},v.prototype._onDataSourceRemoved=function(e,t){var r=this._scene,i=t.clustering;r.primitives.remove(i);for(var n=t._visualizers,o=n.length,a=0;a<o;a++)n[a].destroy();t._visualizers=void 0},v}),define("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,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(t,i,n,o,a,c,p){var f=t.scene.mode,x=a.getValue(c,t._lastCartesian);if(r(x)){var P,I,D,O=!1,M=!1;if(f===h.SCENE3D){s.addSeconds(c,.001,A);var R=a.getValue(A,y);if(r(R)||(s.addSeconds(c,-.001,A),R=a.getValue(A,y),M=!0),r(R)){var L,N=d.computeFixedToIcrfMatrix(c,m),k=d.computeFixedToIcrfMatrix(A,g);r(N)&&r(k)?L=u.transpose(N,_):(L=d.computeTemeToPseudoFixedMatrix(c,_),N=u.transpose(L,m),k=d.computeTemeToPseudoFixedMatrix(A,g),u.transpose(k,k));var F=u.multiplyByVector(N,x,T),B=u.multiplyByVector(k,R,w);e.subtract(F,B,S);var U=1e3*e.magnitude(S),V=3986004418e5,z=-V/(U*U-2*V/e.magnitude(F));z<0||z>E*p.maximumRadius?(P=b,e.normalize(x,P),e.negate(P,P),D=e.clone(e.UNIT_Z,C),I=e.cross(D,P,y),e.magnitude(I)>l.EPSILON7&&(e.normalize(P,P),e.normalize(I,I),D=e.cross(P,I,C),e.normalize(D,D),O=!0)):e.equalsEpsilon(x,R,l.EPSILON7)||(D=b,e.normalize(F,D),e.normalize(B,B),I=e.cross(D,B,C),M&&(I=e.multiplyByScalar(I,-1,I)),e.equalsEpsilon(I,e.ZERO,l.EPSILON7)||(P=e.cross(I,D,y),u.multiplyByVector(L,P,P),u.multiplyByVector(L,I,I),u.multiplyByVector(L,D,D),e.normalize(P,P),e.normalize(I,I),e.normalize(D,D),O=!0))}}r(t.boundingSphere)&&(x=t.boundingSphere.center);var G,H,W;o&&(G=e.clone(i.position,S),H=e.clone(i.direction,T),W=e.clone(i.up,w));var j=v;O?(j[0]=P.x,j[1]=P.y,j[2]=P.z,j[3]=0,j[4]=I.x,j[5]=I.y,j[6]=I.z,j[7]=0,j[8]=D.x,j[9]=D.y,j[10]=D.z,j[11]=0,j[12]=x.x,j[13]=x.y,j[14]=x.z,j[15]=0):d.eastNorthUpToFixedFrame(x,p,j),i._setTransform(j),o&&(e.clone(G,i.position),e.clone(H,i.direction),e.clone(W,i.up),e.cross(H,W,i.right))}if(n){var q=f===h.SCENE2D||e.equals(t._offset3D,e.ZERO)?void 0:t._offset3D;i.lookAtTransform(i.transform,q)}}function f(r,i,n){this.entity=r,this.scene=i,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 m=new u,g=new u,_=new u,v=new c,y=new e,b=new e,C=new e,S=new e,T=new e,w=new e,A=new s,E=1.25;i(f,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(t){this._defaultOffset3D=e.clone(t,new e)}}}),f.defaultOffset3D=new e(-14e3,3500,3500);var x=new a,P=new e;return f.prototype.update=function(t,i){var n=this.scene,o=this.entity,a=this.ellipsoid,s=n.mode;if(s!==h.MORPHING){var u=o.position,c=o!==this._lastEntity,d=s!==this._mode,m=this._offset3D,g=n.camera,_=c||d,v=!0;if(c){var y=o.viewFrom,b=r(y);if(!b&&r(i)){x.pitch=-l.PI_OVER_FOUR,x.range=0;var C=u.getValue(t,P);if(r(C)){var S=2-1/Math.max(1,e.magnitude(C)/a.maximumRadius);x.pitch*=S}g.viewBoundingSphere(i,x),this.boundingSphere=i,_=!1,v=!1}else b&&r(y.getValue(t,m))||e.clone(f._defaultOffset3D,m)}else d||n.mode===h.MORPHING||this._mode===h.SCENE2D||e.clone(g.position,m);this._lastEntity=o,this._mode=n.mode!==h.MORPHING?n.mode:this._mode,n.mode!==h.MORPHING&&p(this,g,_,v,u,t,a)}},f}),function(){function e(e,t){function r(t){var r,i=e.arcs[t<0?~t:t],n=i[0];return e.transform?(r=[0,0],i.forEach(function(e){r[0]+=e[0],r[1]+=e[1]})):r=i[i.length-1],t<0?[r,n]:[n,r]}function i(e,t){for(var r in e){var i=e[r];delete t[i.start],delete i.start,delete i.end,i.forEach(function(e){n[e<0?~e:e]=1}),s.push(i)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(r,i){var n,o=e.arcs[r<0?~r:r];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=r,t[i]=n)}),t.forEach(function(e){var t,i,n=r(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=l,i=o[l]){delete o[i.start];var u=i===t?t:t.concat(i);o[u.start=t.start]=a[u.end=i.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,i=a[s]){delete a[i.end];var c=i===t?t:i.concat(t);o[c.start=i.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}),i(a,o),i(o,a),t.forEach(function(e){n[e<0?~e:e]||s.push([e])}),s}function t(t,r,i){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 d&&(u=e,d[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],d={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(r),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){i(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var h=0,p=t.arcs.length;h<p;++h)l.push(h);return{type:"MultiLineString",arcs:e(t,l)}}function r(t,r){function i(e){e.forEach(function(t){t.forEach(function(t){(s[t=t<0?~t:t]||(s[t]=[])).push(e)})}),l.push(e)}function o(e){return d(a(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var s={},l=[],u=[];return r.forEach(function(e){"Polygon"===e.type?i(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(i)}),l.forEach(function(e){if(!e._){var t=[],r=[e];for(e._=1,u.push(t);e=r.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].forEach(function(e){e._||(e._=1,r.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(r){var i=[];if(r.forEach(function(e){e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].length<2&&i.push(e)})})}),i=e(t,i),(n=i.length)>1)for(var a,l=o(r[0][0]),u=0;u<n;++u)if(l===o(i[u])){a=i[0],i[0]=i[u],i[u]=a;break}return i})}}function i(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return o(e,t)})}:o(e,t)}function o(e,t){var r={type:"Feature",id:t.id,properties:t.properties||{},geometry:a(e,t)};return null==t.id&&delete r.id,r}function a(e,t){function r(e,t){t.length&&t.pop();for(var r,i=c[e<0?~e:e],n=0,o=i.length;n<o;++n)t.push(r=i[n].slice()),u(r,n);e<0&&s(t,o)}function i(e){return e=e.slice(),u(e,0),e}function n(e){for(var t=[],i=0,n=e.length;i<n;++i)r(e[i],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 l(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(l)}:t in d?{type:t,coordinates:d[t](e)}:null}var u=m(e.transform),c=e.arcs,d={Point:function(e){return i(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(i)},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 l(t)}function s(e,t){for(var r,i=e.length,n=i-t;n<--i;)r=e[n],e[n++]=e[i],e[i]=r}function l(e,t){for(var r=0,i=e.length;r<i;){var n=r+i>>>1;e[n]<t?r=n+1:i=n}return r}function u(e){function t(e,t){e.forEach(function(e){e<0&&(e=~e);var r=n[e];r?r.push(t):n[e]=[t]})}function r(e,r){e.forEach(function(e){t(e,r)})}function i(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){i(e,t)}):e.type in a&&a[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),a={LineString:t,MultiLineString:r,Polygon:r,MultiPolygon:function(e,t){e.forEach(function(e){r(e,t)})}};e.forEach(i);for(var s in n)for(var u=n[s],c=u.length,d=0;d<c;++d)for(var h=d+1;h<c;++h){var p,f=u[d],m=u[h];(p=o[f])[s=l(p,m)]!==m&&p.splice(s,0,m),(p=o[m])[s=l(p,f)]!==f&&p.splice(s,0,f)}return o}function c(e,t){function r(e){o.remove(e),e[1][2]=t(e),o.push(e)}var i=m(e.transform),n=g(e.transform),o=f();return t||(t=h),e.arcs.forEach(function(e){for(var a,s,l=[],u=0,c=0,d=e.length;c<d;++c)s=e[c],i(e[c]=[s[0],s[1],1/0],c);for(var c=1,d=e.length-1;c<d;++c)a=e.slice(c-1,c+2),a[1][2]=t(a),l.push(a),o.push(a);for(var c=0,d=l.length;c<d;++c)a=l[c],a.previous=l[c-1],a.next=l[c+1];for(;a=o.pop();){var h=a.previous,p=a.next;a[1][2]<u?a[1][2]=u:u=a[1][2],h&&(h.next=p,h[2]=a[2],r(h)),p&&(p.previous=h,p[0]=a[0],r(p))}e.forEach(n)}),e}function d(e){for(var t,r=-1,i=e.length,n=e[i-1],o=0;++r<i;)t=n,n=e[r],o+=t[0]*n[1]-t[1]*n[0];return.5*o}function h(e){var t=e[0],r=e[1],i=e[2];return Math.abs((t[0]-i[0])*(r[1]-t[1])-(t[0]-r[0])*(i[1]-t[1]))}function p(e,t){return e[1][2]-t[1][2]}function f(){function e(e,t){for(;t>0;){var r=(t+1>>1)-1,n=i[r];if(p(e,n)>=0)break;i[n._=t]=n,i[e._=t=r]=e}}function t(e,t){for(;;){var r=t+1<<1,o=r-1,a=t,s=i[a];if(o<n&&p(i[o],s)<0&&(s=i[a=o]),r<n&&p(i[r],s)<0&&(s=i[a=r]),a===t)break;i[s._=t]=s,i[e._=t=a]=e}}var r={},i=[],n=0;return r.push=function(t){return e(i[t._=n]=t,n++),n},r.pop=function(){if(!(n<=0)){var e,r=i[0];return--n>0&&(e=i[n],t(i[e._=0]=e,0)),r}},r.remove=function(r){var o,a=r._;if(i[a]===r)return a!==--n&&(o=i[n],(p(o,r)<0?e:t)(i[o._=a]=o,a)),a},r}function m(e){if(!e)return _;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0),e[0]=(t+=e[0])*i+o,e[1]=(r+=e[1])*n+a}}function g(e){if(!e)return _;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0);var l=(e[0]-o)/i|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-r,t=l,r=u}}function _(){}var v={version:"1.6.18",mesh:function(e){return a(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return a(e,r.apply(this,arguments))},mergeArcs:r,feature:i,neighbors:u,presimplify:c};"function"==typeof define&&define.amd?define("ThirdParty/topojson",v):"object"==typeof module&&module.exports?module.exports=v:this.topojson=v}(),define("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Resource","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./DataSource","./EntityCluster","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x){"use strict";function P(t){return e.fromDegrees(t[0],t[1],t[2])}function I(e,t){var r="";for(var i in e)if(e.hasOwnProperty(i)){if(i===t||-1!==ae.indexOf(i))continue;var o=e[i];n(o)&&(r+="object"==typeof o?"<tr><th>"+i+"</th><td>"+I(o)+"</td></tr>":"<tr><th>"+i+"</th><td>"+o+"</td></tr>")}return r.length>0&&(r='<table class="cesium-infoBox-defaultTable"><tbody>'+r+"</tbody></table>"),r}function D(e,t,r){var i;return function(o,a){return n(i)||(i=e(t,r)),i}}function O(e,t){return new v(D(I,e,t),!0)}function M(e,t,i){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=r();var l=t.getOrCreateEntity(o),u=e.properties;if(n(u)){l.properties=u;var c,d=u.title;if(n(d))l.name=d,c="title";else{var h=Number.MAX_VALUE;for(var p in u)if(u.hasOwnProperty(p)&&u[p]){var f=p.toLowerCase();if(h>1&&"title"===f){h=1,c=p;break}h>2&&"name"===f?(h=2,c=p):h>3&&/title/i.test(p)?(h=3,c=p):h>4&&/name/i.test(p)&&(h=4,c=p)}n(c)&&(l.name=u[c])}var m=u.description;null!==m&&(l.description=n(m)?new C(m):i(u,c))}return l}function R(e,t){for(var r=new Array(e.length),i=0;i<e.length;i++)r[i]=t(e[i]);return r}function L(e,t,r,i,o){if(null===t.geometry)return void M(t,e._entityCollection,o.describe);if(!n(t.geometry))throw new h("feature.geometry is required.");var a=t.geometry.type,s=le[a];if(!n(s))throw new h("Unknown geometry type: "+a);s(e,t,t.geometry,i,o)}function N(e,t,r,i,n){for(var o=t.features,a=0,s=o.length;a<s;a++)L(e,o[a],void 0,i,n)}function k(e,t,r,i,o){for(var a=r.geometries,s=0,l=a.length;s<l;s++){var u=a[s],c=u.type,d=le[c];if(!n(d))throw new h("Unknown geometry type: "+c);d(e,t,u,i,o)}}function F(e,r,o,a,s){var l=s.markerSymbol,u=s.markerColor,c=s.markerSize,d=r.properties;if(n(d)){var h=d["marker-color"];n(h)&&(u=t.fromCssColorString(h)),c=i(oe[d["marker-size"]],c);var m=d["marker-symbol"];n(m)&&(l=m)}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 _;y.verticalOrigin=new C(f.BOTTOM),2===a.length&&s.clampToGround&&(y.heightReference=p.CLAMP_TO_GROUND);var S=M(r,e._entityCollection,s.describe);S.billboard=y,S.position=new b(o(a));var T=g(v).then(function(e){y.image=new C(e)}).otherwise(function(){y.image=new C(e._pinBuilder.fromColor(u,c))});e._promises.push(T)}function B(e,t,r,i,n){F(e,t,i,r.coordinates,n)}function U(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)F(e,t,i,o[a],n)}function V(e,r,i,o,a){var s=a.strokeMaterialProperty,l=a.strokeWidthProperty,u=r.properties;if(n(u)){var c=u["stroke-width"];n(c)&&(l=new C(c));var d,h=u.stroke;n(h)&&(d=t.fromCssColorString(h));var p=u["stroke-opacity"];n(p)&&1!==p&&(n(d)||(d=s.color.clone()),d.alpha=p),n(d)&&(s=new y(d))}var f,m=M(r,e._entityCollection,a.describe);a.clampToGround?(f=new S,m.corridor=f):(f=new x,m.polyline=f),f.material=s,f.width=l,f.positions=new C(R(o,i))}function z(e,t,r,i,n){V(e,t,i,r.coordinates,n)}function G(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)V(e,t,i,o[a],n)}function H(e,r,i,o,a){if(0!==o.length&&0!==o[0].length){var s=a.strokeMaterialProperty.color,l=a.fillMaterialProperty,u=a.strokeWidthProperty,d=r.properties;if(n(d)){var h=d["stroke-width"];n(h)&&(u=new C(h));var p,f=d.stroke;n(f)&&(p=t.fromCssColorString(f));var m=d["stroke-opacity"];n(m)&&1!==m&&(n(p)||(p=a.strokeMaterialProperty.color.clone()),p.alpha=m),n(p)&&(s=new C(p));var g,_=d.fill;n(_)&&(g=t.fromCssColorString(_),g.alpha=l.color.alpha),m=d["fill-opacity"],n(m)&&m!==l.color.alpha&&(n(g)||(g=l.color.clone()),g.alpha=m),n(g)&&(l=new y(g))}var v=new E;v.outline=new C(!0),v.outlineColor=s,v.outlineWidth=u,v.material=l;for(var b=[],S=1,T=o.length;S<T;S++)b.push(new c(R(o[S],i)));var w=o[0];v.hierarchy=new C(new c(R(w,i),b)),w[0].length>2?v.perPositionHeight=new C(!0):a.clampToGround||(v.height=0);M(r,e._entityCollection,a.describe).polygon=v}}function W(e,t,r,i,n){H(e,t,i,r.coordinates,n)}function j(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)H(e,t,i,o[a],n)}function q(e,t,r,i,n){for(var o in r.objects)if(r.objects.hasOwnProperty(o)){var a=m.feature(r,r.objects[o]),s=se[a.type];s(e,a,a,i,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 A(this),this._promises=[],this._pinBuilder=new u,this._entityCluster=new w}function X(e,t,r,i){var o;n(i)&&(o=l(i)),n(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));var a=se[t.type];if(!n(a))throw new h("Unsupported GeoJSON object type: "+t.type);var s=t.crs,u=null!==s?P:null;if(n(s)){if(!n(s.properties))throw new h("crs.properties is undefined.");var c=s.properties;if("name"===s.type){if(u=Z[c.name],!n(u))throw new h("Unknown crs name: "+c.name)}else if("link"===s.type){var d=K[c.href];if(n(d)||(d=J[c.type]),!n(d))throw new h("Unable to resolve crs link: "+JSON.stringify(c));u=d(c)}else{if("EPSG"!==s.type)throw new h("Unknown crs type: "+s.type);if(u=Z["EPSG:"+c.code],!n(u))throw new h("Unknown crs EPSG code: "+c.code)}}return g(u,function(i){return e._entityCollection.removeAll(),null!==i&&a(e,t,t,i,r),g.all(e._promises,function(){return e._promises.length=0,T.setLoading(e,!1),e})})}var Q,Z={"urn:ogc:def:crs:OGC:1.3:CRS84":P,"EPSG:4326":P,"urn:ogc:def:crs:EPSG::4326":P},K={},J={},$=48,ee=t.ROYALBLUE,te=t.YELLOW,re=2,ie=t.fromBytes(255,255,0,100),ne=!1,oe={small:24,medium:48,large:64},ae=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"],se={Feature:L,FeatureCollection:N,GeometryCollection:k,LineString:z,MultiLineString:G,MultiPoint:U,MultiPolygon:j,Point:B,Polygon:W,Topology:q},le={GeometryCollection:k,LineString:z,MultiLineString:G,MultiPoint:U,MultiPolygon:j,Point:B,Polygon:W,Topology:q};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 Q},set:function(e){Q=e}},markerColor:{get:function(){return ee},set:function(e){ee=e}},stroke:{get:function(){return te},set:function(e){te=e}},strokeWidth:{get:function(){return re},set:function(e){re=e}},fill:{get:function(){return ie},set:function(e){ie=e}},clampToGround:{get:function(){return ne},set:function(e){ne=e}},crsNames:{get:function(){return Z}},crsLinkHrefs:{get:function(){return K}},crsLinkTypes:{get:function(){return J}}}),o(Y.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},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){T.setLoading(this,!0);var r=e;t=i(t,i.EMPTY_OBJECT);var n=t.sourceUri;("string"==typeof e||e instanceof d)&&(e=d.createIfNeeded(e),r=e.fetchJson(),n=i(n,e.getUrlComponent())),t={describe:i(t.describe,O),markerSize:i(t.markerSize,$),markerSymbol:i(t.markerSymbol,Q),markerColor:i(t.markerColor,ee),strokeWidthProperty:new C(i(t.strokeWidth,re)),strokeMaterialProperty:new y(i(t.stroke,te)),fillMaterialProperty:new y(i(t.fill,ie)),clampToGround:i(t.clampToGround,ne)};var o=this;return g(r,function(e){return X(o,e,t,n)}).otherwise(function(e){return T.setLoading(o,!1),o._error.raiseEvent(o,e),console.log(e),g.reject(e)})},Y}),define("DataSources/KmlCamera",[],function(){"use strict";function e(e,t){this.position=e,this.headingPitchRoll=t}return e}),function(e,t){"function"==typeof define&&define.amd?define("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 r=this.hashtag;if(!1!==r&&"twitter"!==r&&"facebook"!==r)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(),r=t.parse(e),i=0,n=[],o=0,a=r.length;o<a;o++){var s=r[o],l=s.getType(),u=s.getText();if("element"===l)"a"===s.getTagName()&&(s.isClosing()?i=Math.max(i-1,0):i++),
n.push(u);else if("entity"===l||"comment"===l)n.push(u);else if(0===i){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 r;return this.replaceFn&&(r=this.replaceFn.call(this,this,t)),"string"==typeof r?r:!1===r?t.getMatchedText():r instanceof e.HtmlTag?r.toAnchorString():this.getTagBuilder().build(t).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,r){return new e(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 r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},extend:function(t,r){var i=t.prototype,n=function(){};n.prototype=i;var o;o=r.hasOwnProperty("constructor")?r.constructor:function(){i.constructor.apply(this,arguments)};var a=o.prototype=new n;return a.constructor=o,a.superclass=i,delete r.constructor,e.Util.assign(a,r),o},ellipsis:function(e,t,r){return e.length>t&&(r=null==r?"..":r,e=e.substring(0,t-r.length)+r),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var r,i=[],n=0;r=t.exec(e);)i.push(e.substring(n,r.index)),i.push(r[0]),n=r.index+r[0].length;return i.push(e.substring(n)),i},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){return this.getAttrs()[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var r=this.getAttrs();return e.Util.assign(r,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var r,i=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=i?i.split(n):[],s=t.split(n);r=s.shift();)-1===o(a,r)&&a.push(r);return this.getAttrs().class=a.join(" "),this},removeClass:function(t){for(var r,i=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=i?i.split(n):[],s=t.split(n);a.length&&(r=s.shift());){var l=o(a,r);-1!==l&&a.splice(l,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},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 r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){return new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())})},createAttrs:function(e,t){var r={href:t},i=this.createCssClass(e);return i&&(r.class=i),this.newWindow&&(r.target="_blank"),r},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:]*/,r=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,i=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=r.source+"(?:\\s*=\\s*"+i.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",i.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,r,i=this.htmlRegex,n=0,o=[];null!==(t=i.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(r=this.parseTextAndEntityNodes(c),o.push.apply(o,r)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n<e.length){var d=e.substring(n);d&&(r=this.parseTextAndEntityNodes(d),o.push.apply(o,r))}return o},parseTextAndEntityNodes:function(t){for(var r=[],i=e.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),n=0,o=i.length;n<o;n+=2){var a=i[n],s=i[n+1];a&&r.push(this.createTextNode(a)),s&&r.push(this.createEntityNode(s))}return r},createCommentNode:function(t,r){return new e.htmlParser.CommentNode({text:t,comment:e.Util.trim(r)})},createElementNode:function(t,r,i){return new e.htmlParser.ElementNode({text:t,tagName:r.toLowerCase(),closing:i})},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})/,r=/(?:[\-;:&=\+\$,\w\.]+@)/,i=/(?:\+?\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,")","|","(",r.source,a.source,s.source,")","|","(","(?:","(",n.source,a.source,")","|","(?:","(.?//)?",o.source,a.source,")","|","(?:","(.?//)?",a.source,s.source,")",")","(?:"+l.source+")?",")","|","(",i.source,")","|","(",t.source,")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,r){var i=this;return e.replace(this.matcherRegex,function(e,n,o,a,s,l,u,c,d,h,p,f,m){var g=i.processCandidateMatch(e,n,o,a,s,l,u,c,d,h,p,f,m);if(g){var _=t.call(r,g.match);return g.prefixStr+_+g.suffixStr}return e})},processCandidateMatch:function(t,r,i,n,o,a,s,l,u,c,d,h,p){var f,m=l||u,g="",_="";if(a&&!this.urls||o&&!this.email||c&&!this.phone||r&&!this.twitter||d&&!this.hashtag||!this.matchValidator.isValidMatch(a,s,m))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),_=")"),o)f=new e.match.Email({matchedText:t,email:o});else if(r)i&&(g=i,t=t.slice(1)),f=new e.match.Twitter({matchedText:t,twitterHandle:n});else if(c){var v=t.replace(/\D/g,"");f=new e.match.Phone({matchedText:t,number:v})}else if(d)h&&(g=h,t=t.slice(1)),f=new e.match.Hashtag({matchedText:t,serviceName:this.hashtag,hashtag:p});else{if(m){var y=m.match(this.charBeforeProtocolRelMatchRegex)[1]||"";y&&(g=y,t=t.slice(1))}f=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!m,stripPrefix:this.stripPrefix})}return{prefixStr:g,suffixStr:_,match:f}},matchHasUnbalancedClosingParen:function(e){if(")"===e.charAt(e.length-1)){var t=e.match(/\(/g),r=e.match(/\)/g);if((t&&t.length||0)<(r&&r.length||0))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,r){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(r))},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)||-1!==e.indexOf("."))},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(){return this.getUrl().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}),define("ThirdParty/zip",["../Core/buildModuleUrl","../Core/defineProperties"],function(e,t){var r={};return function(r){function i(){var e=-1,t=this;t.append=function(r){var i,n=t.table;for(i=0;i<r.length;i++)e=e>>>8^n[255&(e^r[i])]},t.get=function(){return~e}}function n(e,t,r){return e.slice?e.slice(t,t+r):e.webkitSlice?e.webkitSlice(t,t+r):e.mozSlice?e.mozSlice(t,t+r):e.msSlice?e.msSlice(t,t+r):void 0}function o(e,t){var r,i;return r=new ArrayBuffer(e),i=new Uint8Array(r),t&&i.set(t,0),{buffer:r,array:i,view:new DataView(r)}}function a(){}function s(e){function t(t,r){var o=new Blob([e],{type:V});i=new u(o),i.init(function(){n.size=i.size,t()},r)}function r(e,t,r,n){i.readUint8Array(e,t,r,n)}var i,n=this;n.size=0,n.init=t,n.readUint8Array=r}function l(e){function t(t){for(var r=e.length;"="==e.charAt(r-1);)r--;i=e.indexOf(",")+1,n.size=Math.floor(.75*(r-i)),t()}function r(t,r,n){var a,s=o(r),l=4*Math.floor(t/3),u=4*Math.ceil((t+r)/3),c=window.atob(e.substring(l+i,u+i)),d=t-3*Math.floor(l/4);for(a=d;a<d+r;a++)s.array[a-d]=c.charCodeAt(a);n(s.array)}var i,n=this;n.size=0,n.init=t,n.readUint8Array=r}function u(e){function t(t){this.size=e.size,t()}function r(t,r,i,o){var a=new FileReader;a.onload=function(e){i(new Uint8Array(e.target.result))},a.onerror=o,a.readAsArrayBuffer(n(e,t,r))}var i=this;i.size=0,i.init=t,i.readUint8Array=r}function c(){}function d(e){function t(e){n=new Blob([],{type:V}),e()}function r(e,t){n=new Blob([n,P?e:e.buffer],{type:V}),t()}function i(t,r){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=r,i.readAsText(n,e)}var n,o=this;o.init=t,o.writeUint8Array=r,o.getData=i}function h(e){function t(t){o+="data:"+(e||"")+";base64,",t()}function r(e,t){var r,i=a.length,n=a;for(a="",r=0;r<3*Math.floor((i+e.length)/3)-i;r++)n+=String.fromCharCode(e[r]);for(;r<e.length;r++)a+=String.fromCharCode(e[r]);n.length>2?o+=window.btoa(n):a=n,t()}function i(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=r,n.getData=i}function p(e){function t(t){n=new Blob([],{type:e}),t()}function r(t,r){n=new Blob([n,P?t:t.buffer],{type:e}),r()}function i(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=r,o.getData=i}function f(e,t,r,i,n,o,a,s,l,u){function c(){e.removeEventListener(z,d,!1),s(f)}function d(e){var t=e.data,i=t.data;t.onappend&&(f+=i.length,r.writeUint8Array(i,function(){o(!1,i),h()},u)),t.onflush&&(i?(f+=i.length,r.writeUint8Array(i,function(){o(!1,i),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function h(){p=m*F,p<n?t.readUint8Array(i+p,Math.min(F,n-p),function(t){e.postMessage({append:!0,data:t}),m++,a&&a(p,n),o(!0,t)},l):e.postMessage({flush:!0})}var p,f,m=0;f=0,e.addEventListener(z,d,!1),h()}function m(e,t,r,i,n,o,a,s,l,u){function c(){var f;d=h*F,d<n?t.readUint8Array(i+d,Math.min(F,n-d),function(t){var s=e.append(t,function(){a&&a(i+d,n)});p+=s.length,o(!0,t),r.writeUint8Array(s,function(){o(!1,s),h++,setTimeout(c,1)},u),a&&a(d,n)},l):(f=e.flush(),f?(p+=f.length,r.writeUint8Array(f,function(){o(!1,f),s(p)},u)):s(p))}var d,h=0,p=0;c()}function g(e,t,n,o,a,s,l,u,c){function d(e,t){a&&!e&&g.append(t)}function h(e){s(e,g.get())}var p,g=new i;return r.zip.useWebWorkers?(p=new Worker(r.zip.workerScriptsPath+B),f(p,e,t,n,o,d,l,h,u,c)):m(new r.zip.Inflater,e,t,n,o,d,l,h,u,c),p}function _(e,t,n,o,a,s,l){function u(e,t){e&&p.append(t)}function c(e){o(e,p.get())}function d(){h.removeEventListener(z,d,!1),f(h,e,t,0,e.size,u,a,c,s,l)}var h,p=new i;return r.zip.useWebWorkers?(h=new Worker(r.zip.workerScriptsPath+U),h.addEventListener(z,d,!1),h.postMessage({init:!0,level:n})):m(new r.zip.Deflater,e,t,0,e.size,u,a,c,s,l),h}function v(e,t,r,n,o,a,s,l,u){function c(){var i=d*F;i<n?e.readUint8Array(r+i,Math.min(F,n-i),function(e){o&&h.append(e),s&&s(i,n,e),t.writeUint8Array(e,function(){d++,c()},u)},l):a(n,h.get())}var d=0,h=new i;c()}function y(e){var t,r,i="",n=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)r=255&e.charCodeAt(t),i+=r>127?n[r-128]:String.fromCharCode(r);return i}function b(e){return decodeURIComponent(escape(e))}function C(e){var t,r="";for(t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);return r}function S(e){var t=(4294901760&e)>>16,r=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&r)>>11,(2016&r)>>5,2*(31&r),0)}catch(e){}}function T(e,t,r,i,n){return e.version=t.view.getUint16(r,!0),e.bitFlag=t.view.getUint16(r+2,!0),e.compressionMethod=t.view.getUint16(r+4,!0),e.lastModDateRaw=t.view.getUint32(r+6,!0),e.lastModDate=S(e.lastModDateRaw),1==(1&e.bitFlag)?void n(D):((i||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(r+10,!0),e.compressedSize=t.view.getUint32(r+14,!0),e.uncompressedSize=t.view.getUint32(r+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(O):(e.filenameLength=t.view.getUint16(r+22,!0),void(e.extraFieldLength=t.view.getUint16(r+24,!0))))}function w(e,t){function r(){}function i(r,n){e.readUint8Array(e.size-r,r,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?i(r+1,n):n(t)},function(){t(M)})}return r.prototype.getData=function(r,i,n,a){function s(e,t){h&&h.terminate(),h=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():r.getData(function(e){s(i,e)})}function c(){s(t,N)}function d(){s(t,L)}var h,p=this;e.readUint8Array(p.offset,30,function(i){var s,l=o(i.length,i);if(1347093252!=l.view.getUint32(0))return void t(I);T(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,r.init(function(){0===p.compressionMethod?v(e,r,s,p.compressedSize,a,u,n,c,d):h=g(e,r,s,p.compressedSize,a,u,n,c,d)},d)},c)},{getEntries:function(n){if(e.size<22)return void t(I);i(22,function(i){var a,s;a=i.getUint32(16,!0),s=i.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var i,a,l,u,c=0,d=[],h=o(e.length,e);for(i=0;i<s;i++){if(a=new r,1347092738!=h.view.getUint32(c))return void t(I);T(a,h,c+6,!0,t),a.commentLength=h.view.getUint16(c+32,!0),a.directory=16==(16&h.view.getUint8(c+38)),a.offset=h.view.getUint32(c+42,!0),l=C(h.array.subarray(c+46,c+46+a.filenameLength)),a.filename=2048==(2048&a.bitFlag)?b(l):y(l),a.directory||"/"!=a.filename.charAt(a.filename.length-1)||(a.directory=!0),u=C(h.array.subarray(c+46+a.filenameLength+a.extraFieldLength,c+46+a.filenameLength+a.extraFieldLength+a.commentLength)),a.comment=2048==(2048&a.bitFlag)?b(u):y(u),d.push(a),c+=46+a.filenameLength+a.extraFieldLength+a.commentLength}n(d)},function(){t(M)})})},close:function(e){e&&e()}}}function A(e){return unescape(encodeURIComponent(e))}function E(e){var t,r=[];for(t=0;t<e.length;t++)r.push(e.charCodeAt(t));return r}function x(e,t,r){function i(e,t){s&&s.terminate(),s=null,e&&e(t)}function n(){i(t,R)}function a(){i(t,N)}var s,l={},u=[],c=0;return{add:function(d,h,p,f,m){function g(t){var i;T=m.lastModDate||new Date,C=o(26),l[d]={headerArray:C.array,directory:m.directory,filename:S,offset:c,comment:E(A(m.comment||""))},C.view.setUint32(0,335546376),m.version&&C.view.setUint8(0,m.version),r||0===m.level||m.directory||C.view.setUint16(4,2048),C.view.setUint16(6,(T.getHours()<<6|T.getMinutes())<<5|T.getSeconds()/2,!0),C.view.setUint16(8,(T.getFullYear()-1980<<4|T.getMonth()+1)<<5|T.getDate(),!0),C.view.setUint16(22,S.length,!0),i=o(30+S.length),i.view.setUint32(0,1347093252),i.array.set(C.array,4),i.array.set(S,30),c+=i.array.length,e.writeUint8Array(i.array,t,n)}function y(t,r){var a=o(16);c+=t||0,a.view.setUint32(0,1347094280),void 0!==r&&(C.view.setUint32(10,r,!0),a.view.setUint32(4,r,!0)),h&&(a.view.setUint32(8,t,!0),C.view.setUint32(14,t,!0),a.view.setUint32(12,h.size,!0),C.view.setUint32(18,h.size,!0)),e.writeUint8Array(a.array,function(){c+=16,i(p)},n)}function b(){if(m=m||{},d=d.trim(),m.directory&&"/"!=d.charAt(d.length-1)&&(d+="/"),l.hasOwnProperty(d))return void t(k);S=E(A(d)),u.push(d),g(function(){h?r||0===m.level?v(h,e,0,h.size,!0,y,f,a,n):s=_(h,e,m.level,y,f,a,n):y()},n)}var C,S,T;h?h.init(b,a):b()},close:function(t){var r,a,s,d=0,h=0;for(a=0;a<u.length;a++)s=l[u[a]],d+=46+s.filename.length+s.comment.length;for(r=o(d+22),a=0;a<u.length;a++)s=l[u[a]],r.view.setUint32(h,1347092738),r.view.setUint16(h+4,5120),r.array.set(s.headerArray,h+6),r.view.setUint16(h+32,s.comment.length,!0),s.directory&&r.view.setUint8(h+38,16),r.view.setUint32(h+42,s.offset,!0),r.array.set(s.filename,h+46),r.array.set(s.comment,h+46+s.filename.length),h+=46+s.filename.length+s.comment.length;r.view.setUint32(h,1347093766),r.view.setUint16(h+8,u.length,!0),r.view.setUint16(h+10,u.length,!0),r.view.setUint32(h+12,d,!0),r.view.setUint32(h+16,c,!0),e.writeUint8Array(r.array,function(){i(function(){e.getData(t)})},n)}}}var P,I="File format is not recognized.",D="File contains encrypted entry.",O="File is using Zip64 (4gb+ file size).",M="Error while reading zip file.",R="Error while writing zip file.",L="Error while writing file data.",N="Error while reading file data.",k="File already exists.",F=524288,B="inflate.js",U="deflate.js",V="text/plain",z="message";try{P=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}i.prototype.table=function(){var e,t,r,i=[];for(e=0;e<256;e++){for(r=e,t=0;t<8;t++)1&r?r=r>>>1^3988292384:r>>>=1;i[e]=r}return i}(),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)},d.prototype=new c,d.prototype.constructor=d,h.prototype=new c,h.prototype.constructor=h,p.prototype=new c,p.prototype.constructor=p,r.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:h,TextWriter:d,createReader:function(e,t,r){e.init(function(){t(w(e,r))},r)},createWriter:function(e,t,r,i){e.init(function(){t(x(e,r,i))},r)},useWebWorkers:!0};var G;t(r.zip,{workerScriptsPath:{get:function(){return void 0===G&&(G=e("ThirdParty/Workers/")),G}}})}(r),r.zip}),define("DataSources/KmlLookAt",[],function(){"use strict";function e(e,t){this.position=e,this.headingPitchRange=t}return e}),define("DataSources/KmlTour",["../Core/Event","../Core/defined"],function(e,t){"use strict";function r(t,r){this.id=r,this.name=t,this.playlistIndex=0,this.playlist=[],this.tourStart=new e,this.tourEnd=new e,this.entryStart=new e,this.entryEnd=new e,this._activeEntries=[]}function i(e){for(var t=e.pop();void 0!==t;t=e.pop())t.stop()}function n(e,r,i){var n=this.playlist[this.playlistIndex];if(n){var a=o.bind(this,e,r,i);if(this._activeEntries.push(n),this.entryStart.raiseEvent(n),n.blocking)n.play(a,e.scene.camera,r);else{var s=this;n.play(function(){s.entryEnd.raiseEvent(n);var e=s._activeEntries.indexOf(n);e>=0&&s._activeEntries.splice(e,1)}),a(e,r,i)}}else t(i)&&i(!1)}function o(e,t,r,i){var o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)r(i);else{var a=this._activeEntries.indexOf(o);a>=0&&this._activeEntries.splice(a,1),this.playlistIndex++,n.call(this,e,t,r)}}return r.prototype.addPlaylistEntry=function(e){this.playlist.push(e)},r.prototype.play=function(e,t){this.tourStart.raiseEvent();var r=this;n.call(this,e,t,function(e){r.playlistIndex=0,e||i(r._activeEntries),r.tourEnd.raiseEvent(e)})},r.prototype.stop=function(){i(this._activeEntries)},r}),define("DataSources/KmlTourFlyTo",["../Core/defined","../Core/combine","../Core/BoundingSphere","../Core/EasingFunction"],function(e,t,r,i){"use strict";function n(e,t,r){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=r,this.flyToMode=t}return n.prototype.play=function(t,i,n){if(this.activeCamera=i,e(t)&&null!==t){var o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,t(!e(r)&&r)}}var a=this.getCameraOptions(n);if(this.view.headingPitchRoll)i.flyTo(a);else if(this.view.headingPitchRange){var s=new r(this.view.position);i.flyToBoundingSphere(s,a)}},n.prototype.stop=function(){e(this.activeCamera)&&this.activeCamera.cancelFlight(),e(this.activeCallback)&&this.activeCallback(!0)},n.prototype.getCameraOptions=function(r){var n={duration:this.duration};return e(this.activeCallback)&&(n.complete=this.activeCallback),"smooth"===this.flyToMode&&(n.easingFunction=i.LINEAR_NONE),this.view.headingPitchRoll?(n.destination=this.view.position,n.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(n.offset=this.view.headingPitchRange),e(r)&&(n=t(n,r)),n},n}),define("DataSources/KmlTourWait",["../Core/defined"],function(e){"use strict";function t(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}return t.prototype.play=function(e){var t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},1e3*this.duration)},t.prototype.stop=function(){clearTimeout(this.timeout),e(this.activeCallback)&&this.activeCallback(!0)},t}),define("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/deprecationWarning","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/JulianDate","../Core/Math","../Core/NearFarScalar","../Core/objectToQuery","../Core/oneTimeWarning","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/queryToObject","../Core/Rectangle","../Core/Resource","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Core/HeadingPitchRoll","../Core/HeadingPitchRange","../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","./KmlLookAt","./KmlCamera","./KmlTour","./KmlTourFlyTo","./KmlTourWait"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de){"use strict";function he(e){var t=e.slice(0,Math.min(4,e.size)),r=V.defer(),i=new FileReader;return i.addEventListener("load",function(){r.resolve(1347093252===new DataView(i.result).getUint32(0,!1))}),i.addEventListener("error",function(){r.reject(i.error)}),i.readAsArrayBuffer(t),r.promise}function pe(e){var t=V.defer(),r=new FileReader;return r.addEventListener("load",function(){t.resolve(r.result)}),r.addEventListener("error",function(){t.reject(r.error)}),r.readAsText(e),t.promise}function fe(e){var t,r,i,n,o={xsi:"http://www.w3.org/2001/XMLSchema-instance"};for(var a in o)o.hasOwnProperty(a)&&(i=RegExp("[< ]"+a+":"),n="xmlns:"+a+"=",i.test(e)&&-1===e.indexOf(n)&&(c(t)||(t=e.substr(0,e.indexOf("<kml")+4),r=e.substr(t.length)),t+=" "+n+'"'+o[a]+'"'));return c(t)&&(e=t+r),e}function me(e){for(var t,r,i,n=e.indexOf("xmlns:"),o=e.indexOf(">",n);-1!==n&&n<o;)t=e.slice(n,e.indexOf('"',n)),r=n,n=e.indexOf(t,n+1),-1!==n?(i=e.indexOf('"',e.indexOf('"',n)+1),e=e.slice(0,n-1)+e.slice(i+1,e.length),n=e.indexOf("xmlns:",r-1)):n=e.indexOf("xmlns:",r+1);return e}function ge(e,t,r){e.getData(new z.TextWriter,function(e){e=fe(e),e=me(e),t.kml=Mt.parseFromString(e,"application/xml"),r.resolve()})}function _e(e,t,r){var i=u(Ot.detectFromFilename(e.filename),"application/octet-stream");e.getData(new z.Data64URIWriter(i),function(i){t[e.filename]=i,r.resolve()})}function ve(e,t,r,i){for(var n=i.keys,o=new U("."),a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=l.getAttribute(r),c=new U(u).resolve(o).toString(),d=n.indexOf(c);if(-1!==d){var h=n[d];l.setAttribute(r,i[h]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",h)}}}function ye(e,t,r,i){for(var n=e.querySelectorAll(t),o=0;o<n.length;o++){var a=n[o],s=a.getAttribute(r),l=Me(s,i);a.setAttribute(r,l.url)}}function be(e,t,r){var i=Ae(e,"id");i=c(i)&&0!==i.length?i:l(),c(r)&&(i=r+i);var n=t.getById(i);return c(n)&&(i=l(),c(r)&&(i=r+i)),n=t.add(new Y({id:i})),c(n.kml)||(n.addProperty("kml"),n.kml=new Dt),n}function Ce(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function Se(e,t){if(!c(e))return i.fromDegrees(0,0,0,t);var r=e.match(/[^\s,\n]+/g);if(!c(r))return i.fromDegrees(0,0,0,t);var n=parseFloat(r[0]),o=parseFloat(r[1]),a=parseFloat(r[2]);return n=isNaN(n)?0:n,o=isNaN(o)?0:o,a=isNaN(a)?0:a,i.fromDegrees(n,o,a,t)}function Te(e,t){if(c(e)){var r=e.textContent.match(/[^\s\n]+/g);if(c(r)){for(var i=r.length,n=new Array(i),o=0,a=0;a<i;a++)n[o++]=Se(r[a],t);return n}}}function we(e,t){if(c(e)){var r=e.getAttribute(t);if(null!==r){var i=parseFloat(r);return isNaN(i)?void 0:i}}}function Ae(e,t){if(c(e)){var r=e.getAttribute(t);return null!==r?r:void 0}}function Ee(e,t,r){if(c(e))for(var i=e.childNodes,n=i.length,o=0;o<n;o++){var a=i[o];if(a.localName===t&&-1!==r.indexOf(a.namespaceURI))return a}}function xe(e,t,r){if(c(e)){for(var i=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==r.indexOf(s.namespaceURI)&&i.push(s)}return i}}function Pe(e,t,r){if(!c(e))return[];for(var i=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&-1!==r.indexOf(s.namespaceURI)&&i.push(s)}return i}function Ie(e,t,r){var i=Ee(e,t,r);if(c(i)){var n=parseFloat(i.textContent);return isNaN(n)?void 0:n}}function De(e,t,r){var i=Ee(e,t,r);if(c(i))return i.textContent.trim()}function Oe(e,t,r){var i=Ee(e,t,r);if(c(i)){
var n=i.textContent.trim();return"1"===n||/^true$/i.test(n)}}function Me(e,t,r){if(c(e)){var i;if(c(r)){var n=r[e];if(c(n))i=new P({url:n});else{var o=new U(t.getUrlComponent());n=r[new U(e).resolve(o)],c(n)&&(i=new P({url:n}))}}return c(i)||(i=t.getDerivedResource({url:e})),i}}function Re(e,t){if(c(e)&&!/^\s*$/gm.test(e)){"#"===e[0]&&(e=e.substring(1));var r=parseInt(e.substring(0,2),16)/255,i=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?Ht.maximumRed=o:Ht.red=0,n>0?Ht.maximumGreen=n:Ht.green=0,i>0?Ht.maximumBlue=i:Ht.blue=0,Ht.alpha=r,s.fromRandom(Ht)):new s(o,n,i,r)}}function Le(e,t,r){var i=De(e,t,r);if(c(i))return Re(i,"random"===De(e,"colorMode",r))}function Ne(e){var t=Ee(e,"TimeStamp",Gt.kmlgx),r=De(t,"when",Gt.kmlgx);if(c(t)&&c(r)&&0!==r.length){var i=y.fromIso8601(r),n=new O;return n.addInterval(new D({start:i,stop:v.MAXIMUM_VALUE})),n}}function ke(e){var t=Ee(e,"TimeSpan",Gt.kmlgx);if(c(t)){var r,i=Ee(t,"begin",Gt.kmlgx),n=c(i)?y.fromIso8601(i.textContent):void 0,o=Ee(t,"end",Gt.kmlgx),a=c(o)?y.fromIso8601(o.textContent):void 0;if(c(n)&&c(a)){if(y.lessThan(a,n)){var s=n;n=a,a=s}r=new O,r.addInterval(new D({start:n,stop:a}))}else c(n)?(r=new O,r.addInterval(new D({start:n,stop:v.MAXIMUM_VALUE}))):c(a)&&(r=new O,r.addInterval(new D({start:v.MINIMUM_VALUE,stop:a})));return r}}function Fe(){var e=new G;return e.width=Lt,e.height=Lt,e.scaleByDistance=new C(Nt,kt,Ft,Bt),e.pixelOffsetScaleByDistance=new C(Nt,kt,Ft,Bt),e}function Be(){var e=new J;return e.outline=!0,e.outlineColor=s.WHITE,e}function Ue(){var e=new Z;return e.translucencyByDistance=new C(3e6,1,5e6,0),e.pixelOffset=new r(17,0),e.horizontalOrigin=N.LEFT,e.font="16px sans-serif",e.style=k.FILL_AND_OUTLINE,e}function Ve(e,t,r,i,n){var o=De(e,"href",Gt.kml);if(c(o)&&0!==o.length){if(0===o.indexOf("root://icons/palette-")){var a=o.charAt(21),s=u(Ie(e,"x",Gt.gx),0),l=u(Ie(e,"y",Gt.gx),0);s=Math.min(s/32,7),l=7-Math.min(l/32,7);o="https://maps.google.com/mapfiles/kml/pal"+a+"/icon"+(8*l+s)+".png"}var d=Me(o,r,i);if(n){var h=De(e,"refreshMode",Gt.kml),p=De(e,"viewRefreshMode",Gt.kml);"onInterval"===h||"onExpire"===h?T("kml-refreshMode-"+h,"KML - Unsupported Icon refreshMode: "+h):"onStop"!==p&&"onRegion"!==p||T("kml-refreshMode-"+p,"KML - Unsupported Icon viewRefreshMode: "+p);var f=u(De(e,"viewBoundScale",Gt.kml),1),m="onStop"===p?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",g=u(De(e,"viewFormat",Gt.kml),m),_=De(e,"httpQuery",Gt.kml);c(g)&&d.setQueryParameters(E(bt(g))),c(_)&&d.setQueryParameters(E(bt(_)));var v=t._ellipsoid;return Ct(d,t._camera,t._canvas,f,t._lastCameraView.bbox,v),d}return d}}function ze(e,n,o,a,s){var l=Ie(n,"scale",Gt.kml),d=Ie(n,"heading",Gt.kml),h=Le(n,"color",Gt.kml),p=Ee(n,"Icon",Gt.kml),f=Ve(p,e,a,s,!1);c(p)&&!c(f)&&(f=!1);var m=Ie(p,"x",Gt.gx),g=Ie(p,"y",Gt.gx),_=Ie(p,"w",Gt.gx),v=Ie(p,"h",Gt.gx),y=Ee(n,"hotSpot",Gt.kml),C=we(y,"x"),S=we(y,"y"),T=Ae(y,"xunits"),w=Ae(y,"yunits"),A=o.billboard;c(A)||(A=Fe(),o.billboard=A),A.image=f,A.scale=l,A.color=h,(c(m)||c(g)||c(_)||c(v))&&(A.imageSubRegion=new t(m,g,_,v)),c(d)&&0!==d&&(A.rotation=b.toRadians(-d),A.alignedAxis=i.UNIT_Z),l=u(l,1);var E,x;c(C)&&("pixels"===T?E=-C*l:"insetPixels"===T?E=(C-Lt)*l:"fraction"===T&&(E=-C*Lt*l),E+=.5*Lt*l),c(S)&&("pixels"===w?x=S*l:"insetPixels"===w?x=(-S+Lt)*l:"fraction"===w&&(x=S*Lt*l),x-=.5*Lt*l),(c(E)||c(x))&&(A.pixelOffset=new r(E,x))}function Ge(e,t,r,i,n){for(var o=0,a=t.childNodes.length;o<a;o++){var l=t.childNodes.item(o);if("IconStyle"===l.localName)ze(e,l,r,i,n);else if("LabelStyle"===l.localName){var d=r.label;c(d)||(d=Ue(),r.label=d),d.scale=u(Ie(l,"scale",Gt.kml),d.scale),d.fillColor=u(Le(l,"color",Gt.kml),d.fillColor),d.text=r.name}else if("LineStyle"===l.localName){var h=r.polyline;c(h)||(h=new $,r.polyline=h),h.width=Ie(l,"width",Gt.kml),h.material=Le(l,"color",Gt.kml),c(Le(l,"outerColor",Gt.gx))&&T("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),c(Ie(l,"outerWidth",Gt.gx))&&T("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),c(Ie(l,"physicalWidth",Gt.gx))&&T("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),c(Oe(l,"labelVisibility",Gt.gx))&&T("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if("PolyStyle"===l.localName){var p=r.polygon;c(p)||(p=Be(),r.polygon=p),p.material=u(Le(l,"color",Gt.kml),p.material),p.fill=u(Oe(l,"fill",Gt.kml),p.fill),p.outline=u(Oe(l,"outline",Gt.kml),p.outline)}else if("BalloonStyle"===l.localName){var f=u(Re(De(l,"bgColor",Gt.kml)),s.WHITE),m=u(Re(De(l,"textColor",Gt.kml)),s.BLACK),g=De(l,"text",Gt.kml);r.addProperty("balloonStyle"),r.balloonStyle={bgColor:f,textColor:m,text:g}}else if("ListStyle"===l.localName){var _=De(l,"listItemType",Gt.kml);"radioFolder"!==_&&"checkOffOnly"!==_||T("kml-listStyle-"+_,"KML - Unsupported ListStyle with listItemType: "+_)}}}function He(e,t,r,i,n){for(var o,a=new Y,s=-1,l=t.childNodes,u=l.length,d=0;d<u;d++){var h=l[d];"Style"!==h.localName&&"StyleMap"!==h.localName||(s=d)}if(-1!==s){var p=l[s];if("Style"===p.localName)Ge(e,p,a,i,n);else for(var f=Pe(p,"Pair",Gt.kml),m=0;m<f.length;m++){var g=f[m],_=De(g,"key",Gt.kml);if("normal"===_){var v=De(g,"styleUrl",Gt.kml);if(c(v))o=r.getById(v),c(o)||(o=r.getById("#"+v)),c(o)&&a.merge(o);else{var y=Ee(g,"Style",Gt.kml);Ge(e,y,a,i,n)}}else T("kml-styleMap-"+_,"KML - Unsupported StyleMap key: "+_)}}var b=De(t,"styleUrl",Gt.kml);if(c(b)){var C=b;if("#"!==b[0]&&-1!==b.indexOf("#")){var S=b.split("#"),w=S[0];C=i.getDerivedResource({url:w}).getUrlComponent()+"#"+S[1]}o=r.getById(C),c(o)||(o=r.getById("#"+C)),c(o)&&a.merge(o)}return a}function We(e,t,r){return t.fetchXML().then(function(i){return je(e,i,r,t,!0)})}function je(e,t,r,i,n,o){var a,s,l,u,d=xe(t,"Style",Gt.kml);if(c(d)){var h=d.length;for(a=0;a<h;a++)u=d[a],s=Ae(u,"id"),c(s)&&(s="#"+s,n&&c(i)&&(s=i.getUrlComponent()+s),c(r.getById(s))||(l=new Y({id:s}),r.add(l),Ge(e,u,l,i,o)))}var p=xe(t,"StyleMap",Gt.kml);if(c(p)){var f=p.length;for(a=0;a<f;a++){var m=p[a];if(s=Ae(m,"id"),c(s))for(var g=Pe(m,"Pair",Gt.kml),_=0;_<g.length;_++){var v=g[_],y=De(v,"key",Gt.kml);if("normal"===y){if(s="#"+s,n&&c(i)&&(s=i.getUrlComponent()+s),!c(r.getById(s))){l=r.getOrCreateEntity(s);var b=De(v,"styleUrl",Gt.kml);if(c(b)){"#"!==b[0]&&(b="#"+b),n&&c(i)&&(b=i.getUrlComponent()+b);var C=r.getById(b);c(C)&&l.merge(C)}else u=Ee(v,"Style",Gt.kml),Ge(e,u,l,i,o)}}else T("kml-styleMap-"+y,"KML - Unsupported StyleMap key: "+y)}}}var S=[],w=t.getElementsByTagName("styleUrl"),A=w.length;for(a=0;a<A;a++){var E=w[a].textContent;if("#"!==E[0]){var x=E.split("#");if(2===x.length){var P=x[0],I=i.getDerivedResource({url:P});S.push(We(e,I,r))}}}return S}function qe(e,t,r){var i=new re(e,t.id,["position"]),n=new ne(t.position);t.polyline=c(r.polyline)?r.polyline.clone():new $,t.polyline.positions=new ee([i,n])}function Ye(e,t){return!c(e)&&!c(t)||"clampToGround"===e?L.CLAMP_TO_GROUND:"relativeToGround"===e?L.RELATIVE_TO_GROUND:"absolute"===e?L.NONE:"clampToSeaFloor"===t?(T("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),L.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(T("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),L.RELATIVE_TO_GROUND):(c(e)?T("kml-altitudeMode-unknown","KML - Unknown <kml:altitudeMode>:"+e+", using <kml:altitudeMode>:CLAMP_TO_GROUND."):T("kml-gx:altitudeMode-unknown","KML - Unknown <gx:altitudeMode>:"+t+", using <kml:altitudeMode>:CLAMP_TO_GROUND."),L.CLAMP_TO_GROUND)}function Xe(e,t,r){return"relativeToSeaFloor"===r||"absolute"===t||"relativeToGround"===t?e:((c(t)&&"clampToGround"!==t||c(r)&&"clampToSeaFloor"!==r)&&T("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+u(t,r)),new ne(e))}function Qe(e,t,r,i){if(c(e)){if("relativeToSeaFloor"===r||"absolute"===t||"relativeToGround"===t)return e;(c(t)&&"clampToGround"!==t||c(r)&&"clampToSeaFloor"!==r)&&T("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+u(t,r));for(var n=e.length,o=0;o<n;o++){var a=e[o];i.scaleToGeodeticSurface(a,a)}return e}}function Ze(e,t,i,n){var o=t.label;c(o)||(o=c(i.label)?i.label.clone():Ue(),t.label=o),o.text=t.name;var a=t.billboard;c(a)||(a=c(i.billboard)?i.billboard.clone():Fe(),t.billboard=a),c(a.image)?a.image.getValue()||(a.image=void 0):a.image=e._pinBuilder.fromColor(s.YELLOW,64);var l=1;c(a.scale)&&(l=a.scale.getValue(),0!==l?o.pixelOffset=new r(16*l+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(n)&&e._clampToGround&&(a.heightReference=n,o.heightReference=n)}function Ke(e,t){var r=e.path;c(r)||(r=new K,r.leadTime=0,e.path=r);var i=t.polyline;c(i)&&(r.material=i.material,r.width=i.width)}function Je(e,t,r,i,n){var o=De(r,"coordinates",Gt.kml),a=De(r,"altitudeMode",Gt.kml),s=De(r,"altitudeMode",Gt.gx),l=Oe(r,"extrude",Gt.kml),u=e._ellipsoid,c=Se(o,u);return i.position=c,Ze(e,i,n,Ye(a,s)),l&&Ce(a,s)&&qe(t,i,n),!0}function $e(e,t,r,i,n){var o=Ee(r,"coordinates",Gt.kml),a=De(r,"altitudeMode",Gt.kml),l=De(r,"altitudeMode",Gt.gx),d=Oe(r,"extrude",Gt.kml),h=Oe(r,"tessellate",Gt.kml),p=Ce(a,l);c(Ie(r,"drawOrder",Gt.gx))&&T("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings");var f=e._ellipsoid,m=Te(o,f),g=n.polyline;if(p&&d){var _=new ae;i.wall=_,_.positions=m;var y=n.polygon;c(y)&&(_.fill=y.fill,_.material=y.material),_.outline=!0,c(g)?(_.outlineColor=c(g.material)?g.material.color:s.WHITE,_.outlineWidth=g.width):c(y)&&(_.outlineColor=c(y.material)?y.material.color:s.WHITE)}else if(e._clampToGround&&!p&&h){var b=new W;i.corridor=b,b.positions=m,c(g)?(b.material=c(g.material)?g.material.color.getValue(v.MINIMUM_VALUE):s.WHITE,b.width=u(g.width,1)):(b.material=s.WHITE,b.width=1)}else g=c(g)?g.clone():new $,i.polyline=g,g.positions=Qe(m,a,l,f),h&&!p||(g.followSurface=!1);return!0}function et(e,t,r,i,n){var o=Ee(r,"outerBoundaryIs",Gt.kml),a=Ee(o,"LinearRing",Gt.kml),l=Ee(a,"coordinates",Gt.kml),u=e._ellipsoid,d=Te(l,u),h=Oe(r,"extrude",Gt.kml),p=De(r,"altitudeMode",Gt.kml),f=De(r,"altitudeMode",Gt.gx),m=Ce(p,f),g=c(n.polygon)?n.polygon.clone():Be(),_=n.polyline;if(c(_)&&(g.outlineColor=c(_.material)?_.material.color:s.WHITE,g.outlineWidth=_.width),i.polygon=g,m?(g.perPositionHeight=!0,g.extrudedHeight=h?0:void 0):e._clampToGround||(g.height=0),c(d)){for(var v=new A(d),y=Pe(r,"innerBoundaryIs",Gt.kml),b=0;b<y.length;b++){a=Pe(y[b],"LinearRing",Gt.kml);for(var C=0;C<a.length;C++)l=Ee(a[C],"coordinates",Gt.kml),d=Te(l,u),c(d)&&v.holes.push(new A(d))}g.hierarchy=v}return!0}function tt(e,t,r,i,n){var o=De(r,"altitudeMode",Gt.kml),a=De(r,"altitudeMode",Gt.gx),s=Pe(r,"coord",Gt.gx),l=Pe(r,"angles",Gt.gx),u=Pe(r,"when",Gt.kml),c=Oe(r,"extrude",Gt.kml),d=Ce(o,a),h=e._ellipsoid;l.length>0&&T("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");for(var p=Math.min(s.length,u.length),f=[],m=[],g=0;g<p;g++){var _=Se(s[g].textContent,h);f.push(_),m.push(y.fromIso8601(u[g].textContent))}var v=new ie;return v.addSamples(m,f),i.position=v,Ze(e,i,n,Ye(o,a)),Ke(i,n),i.availability=new O,u.length>0&&i.availability.addInterval(new D({start:m[0],stop:m[m.length-1]})),d&&c&&qe(t,i,n),!0}function rt(e,t,r,i,n,o,a,s,l){var u=e[0],c=e[e.length-1],d=new ie;d.addSamples(e,t),r.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:Xe(d,a,s)})),i.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 it(e,t,r,i,n){for(var o,a,s,l=Oe(r,"interpolate",Gt.gx),u=Pe(r,"Track",Gt.gx),d=!1,h=new oe,p=new O,f=new H,m=e._ellipsoid,g=0,_=u.length;g<_;g++){var v=u[g],b=Pe(v,"when",Gt.kml),C=Pe(v,"coord",Gt.gx),S=De(v,"altitudeMode",Gt.kml),T=De(v,"altitudeMode",Gt.gx),w=Ce(S,T),A=Oe(v,"extrude",Gt.kml),E=Math.min(C.length,b.length),x=[];o=[];for(var P=0;P<E;P++){var I=Se(C[P].textContent,m);x.push(I),o.push(y.fromIso8601(b[P].textContent))}l&&(c(a)&&rt([a,o[0]],[s,x[0]],f,p,h,!1,"absolute",void 0,!1),a=o[E-1],s=x[x.length-1]),rt(o,x,f,p,h,w&&A,S,T,!0),d=d||w&&A}return i.availability=p,i.position=f,Ze(e,i,n),Ke(i,n),d&&(qe(t,i,n),i.polyline.show=h),!0}function nt(e,t,r,i,n,o){for(var a=r.childNodes,s=!1,l=0,u=a.length;l<u;l++){var d=a.item(l),h=Wt[d.localName];if(c(h)){var p=be(d,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,d,p,n)&&(s=!0)}}return s}function ot(e,t,r,i,n){return T("kml-unsupportedGeometry","KML - Unsupported geometry: "+r.localName),!1}function at(e,t){var r=Ee(e,"ExtendedData",Gt.kml);if(c(r)){c(Ee(r,"SchemaData",Gt.kml))&&T("kml-schemaData","KML - SchemaData is unsupported"),c(Ae(r,"xmlns:prefix"))&&T("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");var i={},n=Pe(r,"Data",Gt.kml);if(c(n))for(var o=n.length,a=0;a<o;a++){var s=n[a],l=Ae(s,"name");c(l)&&(i[l]={displayName:De(s,"displayName",Gt.kml),value:De(s,"value",Gt.kml)})}t.kml.extendedData=i}}function st(e,t,r,i,n){var o,a,l,d=t.kml,h=d.extendedData,p=De(e,"description",Gt.kml),f=u(t.balloonStyle,r.balloonStyle),m=s.WHITE,g=s.BLACK,_=p;c(f)&&(m=u(f.bgColor,s.WHITE),g=u(f.textColor,s.BLACK),_=u(f.text,p));var v;if(c(_)){if(_=_.replace("$[name]",u(t.name,"")),_=_.replace("$[description]",u(p,"")),_=_.replace("$[address]",u(d.address,"")),_=_.replace("$[Snippet]",u(d.snippet,"")),_=_.replace("$[id]",t.id),_=_.replace("$[geDirections]",""),c(h)){var y=_.match(/\$\[.+?\]/g);if(null!==y)for(o=0;o<y.length;o++){var b=y[o],C=b.substr(2,b.length-3),S=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),v=h[C],c(v)&&(v=S?v.displayName:v.value),c(v)&&(_=_.replace(b,u(v,"")))}}}else if(c(h)&&(l=Object.keys(h),l.length>0)){for(_='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<l.length;o++)a=l[o],v=h[a],_+="<tr><th>"+u(v.displayName,a)+"</th><td>"+u(v.value,"")+"</td></tr>";_+="</tbody></table>"}if(c(_)){_=Rt.link(_),jt.innerHTML=_;var T=jt.querySelectorAll("a");for(o=0;o<T.length;o++)T[o].setAttribute("target","_blank");c(i)&&i.keys.length>1&&(ve(jt,"a","href",i),ve(jt,"img","src",i)),ye(jt,"a","href",n),ye(jt,"img","src",n);var w='<div class="cesium-infoBox-description-lighter" style="';w+="overflow:auto;",w+="word-wrap:break-word;",w+="background-color:"+m.toCssColorString()+";",w+="color:"+g.toCssColorString()+";",w+='">',w+=jt.innerHTML+"</div>",jt.innerHTML="",t.description=w}}function lt(e,t,r,i,n,o,a,s,l){function d(e){return!e||e.show&&d(e.parent)}var h=be(r,i,l),p=h.kml,f=He(e,r,n,o,a),m=De(r,"name",Gt.kml);h.name=m,h.parent=t;var g=ke(r);c(g)||(g=Ne(r)),h.availability=g,Pt(h);var _=Oe(r,"visibility",Gt.kml);h.show=d(t)&&u(_,!0);var v=Ee(r,"author",Gt.atom),y=p.author;y.name=De(v,"name",Gt.atom),y.uri=De(v,"uri",Gt.atom),y.email=De(v,"email",Gt.atom);var b=Ee(r,"link",Gt.atom),C=p.link;C.href=Ae(b,"href"),C.hreflang=Ae(b,"hreflang"),C.rel=Ae(b,"rel"),C.type=Ae(b,"type"),C.title=Ae(b,"title"),C.length=Ae(b,"length"),p.address=De(r,"address",Gt.kml),p.phoneNumber=De(r,"phoneNumber",Gt.kml),p.snippet=De(r,"Snippet",Gt.kml),at(r,h),st(r,h,f,a,o);var S=e._ellipsoid;return _t(r,h,S),gt(r,h,S),c(Ee(r,"Region",Gt.kml))&&T("kml-region","KML - Placemark Regions are unsupported"),{entity:h,styleEntity:f}}function ut(e,t,r,i,n,o,a,s,l){for(var u=Object.keys(qt),c=u.length,d=0;d<c;d++)for(var h=u[d],p=qt[h],f=r.childNodes,m=f.length,g=0;g<m;g++){var _=f[g];_.localName!==h||-1===Gt.kml.indexOf(_.namespaceURI)&&-1===Gt.gx.indexOf(_.namespaceURI)||p(e,t,_,i,n,o,a,s,l)}}function ct(e,t,r,i,n,o,a,s,l){ut(e,lt(e,t,r,i,n,o,a,s,l).entity,r,i,n,o,a,s,l)}function dt(e,t,r,i,n,o,a,s,l){for(var u=lt(e,t,r,i,n,o,a,s,l),d=u.entity,h=u.styleEntity,p=!1,f=r.childNodes,m=0,g=f.length;m<g&&!p;m++){var _=f.item(m),v=Wt[_.localName];c(v)&&(v(e,i,_,d,h,d.id),p=!0)}p||(d.merge(h),Ze(e,d,h))}function ht(e,t,r,i,n,o,a,s,l){var u=De(r,"name",Gt.kml),d=Ae(r,"id"),h=new ue(u,d),p=Ee(r,"Playlist",Gt.gx);if(p)for(var f=e._ellipsoid,m=p.childNodes,g=0;g<m.length;g++){var _=m[g];if(_.localName){var v=Yt[_.localName];v?v(h,_,f):console.log("Unknown KML Tour playlist entry type "+_.localName)}}c(e.kmlTours)||(e.kmlTours=[]),e.kmlTours.push(h)}function pt(e,t){T("KML Tour unsupported node "+t.localName)}function ft(e,t){var r=Ie(t,"duration",Gt.gx);e.addPlaylistEntry(new de(r))}function mt(e,t,r){var i=Ie(t,"duration",Gt.gx),n=De(t,"flyToMode",Gt.gx),o={kml:{}};_t(t,o,r),gt(t,o,r);var a=o.kml.lookAt||o.kml.camera,s=new ce(i,n,a);e.addPlaylistEntry(s)}function gt(e,t,r){var n=Ee(e,"Camera",Gt.kml);if(c(n)){var o=u(Ie(n,"longitude",Gt.kml),0),a=u(Ie(n,"latitude",Gt.kml),0),s=u(Ie(n,"altitude",Gt.kml),0),l=u(Ie(n,"heading",Gt.kml),0),d=u(Ie(n,"tilt",Gt.kml),0),h=u(Ie(n,"roll",Gt.kml),0),p=i.fromDegrees(o,a,s,r),f=M.fromDegrees(l,d-90,h);t.kml.camera=new le(p,f)}}function _t(e,t,r){var n=Ee(e,"LookAt",Gt.kml);if(c(n)){var o=u(Ie(n,"longitude",Gt.kml),0),a=u(Ie(n,"latitude",Gt.kml),0),s=u(Ie(n,"altitude",Gt.kml),0),l=Ie(n,"heading",Gt.kml),d=Ie(n,"tilt",Gt.kml),h=u(Ie(n,"range",Gt.kml),0);d=b.toRadians(u(d,0)),l=b.toRadians(u(l,0));var p=new R(l,d-b.PI_OVER_TWO,h),f=i.fromDegrees(o,a,s,r);t.kml.lookAt=new se(f,p)}}function vt(e,t,r,i,n,o,a,s,l){var u,d=lt(e,t,r,i,n,o,a,s,l),h=d.entity,p=!1,f=e._ellipsoid,m=Te(Ee(r,"LatLonQuad",Gt.gx),f);if(c(m))u=Be(),u.hierarchy=new A(m),h.polygon=u,p=!0;else{u=new te,h.rectangle=u;var g=Ee(r,"LatLonBox",Gt.kml);if(c(g)){var _=Ie(g,"west",Gt.kml),v=Ie(g,"south",Gt.kml),y=Ie(g,"east",Gt.kml),C=Ie(g,"north",Gt.kml);c(_)&&(_=b.negativePiToPi(b.toRadians(_))),c(v)&&(v=b.clampToLatitudeRange(b.toRadians(v))),c(y)&&(y=b.negativePiToPi(b.toRadians(y))),c(C)&&(C=b.clampToLatitudeRange(b.toRadians(C))),u.coordinates=new x(_,v,y,C);var S=Ie(g,"rotation",Gt.kml);if(c(S)){var w=b.toRadians(S);u.rotation=w,u.stRotation=w}}}var E=Ee(r,"Icon",Gt.kml),P=Ve(E,e,o,a,!0);if(c(P)){p&&T("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");var I=Ie(E,"x",Gt.gx),D=Ie(E,"y",Gt.gx),O=Ie(E,"w",Gt.gx),M=Ie(E,"h",Gt.gx);(c(I)||c(D)||c(O)||c(M))&&T("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),u.material=P,u.material.color=Le(r,"color",Gt.kml),u.material.transparent=!0}else u.material=Le(r,"color",Gt.kml);var R=De(r,"altitudeMode",Gt.kml);c(R)?"absolute"===R?u.height=Ie(r,"altitude",Gt.kml):"clampToGround"!==R&&T("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+R):(R=De(r,"altitudeMode",Gt.gx),"relativeToSeaFloor"===R?(T("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),u.height=Ie(r,"altitude",Gt.kml)):"clampToSeaFloor"===R?T("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(R)&&T("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+R))}function yt(e,t,r,i,n,o,a,s,l){e._unsupportedNode.raiseEvent(e,t,r,i,n,o,a),T("kml-unsupportedFeature-"+r.nodeName,"KML - Unsupported feature: "+r.nodeName)}function bt(e){if(!c(e)||0===e.length)return"";var t=e[0];return"&"!==t&&"?"!==t||(e=e.substring(1)),e}function Ct(e,t,r,n,o,a){function s(e){return e<-b.PI_OVER_TWO?-b.PI_OVER_TWO:e>b.PI_OVER_TWO?b.PI_OVER_TWO:e}function l(e){return e>b.PI?e-b.TWO_PI:e<-b.PI?e+b.TWO_PI:e}var d=S(e.queryParameters);if(d=d.replace(/%5B/g,"[").replace(/%5D/g,"]"),c(t)&&t._mode!==F.MORPHING){var h,p;if(o=u(o,Qt),c(r)&&(Kt.x=.5*r.clientWidth,Kt.y=.5*r.clientHeight,h=t.pickEllipsoid(Kt,a,Jt)),c(h)?p=a.cartesianToCartographic(h,Zt):(p=x.center(o,Zt),h=a.cartographicToCartesian(p)),c(n)&&!b.equalsEpsilon(n,1,b.EPSILON9)){var f=o.width*n*.5,m=o.height*n*.5;o=new x(l(p.longitude-f),s(p.latitude-m),l(p.longitude+f),s(p.latitude+m))}d=d.replace("[bboxWest]",b.toDegrees(o.west).toString()),d=d.replace("[bboxSouth]",b.toDegrees(o.south).toString()),d=d.replace("[bboxEast]",b.toDegrees(o.east).toString()),d=d.replace("[bboxNorth]",b.toDegrees(o.north).toString());var g=b.toDegrees(p.longitude).toString(),_=b.toDegrees(p.latitude).toString();d=d.replace("[lookatLon]",g),d=d.replace("[lookatLat]",_),d=d.replace("[lookatTilt]",b.toDegrees(t.pitch).toString()),d=d.replace("[lookatHeading]",b.toDegrees(t.heading).toString()),d=d.replace("[lookatRange]",i.distance(t.positionWC,h)),d=d.replace("[lookatTerrainLon]",g),d=d.replace("[lookatTerrainLat]",_),d=d.replace("[lookatTerrainAlt]",p.height.toString()),a.cartesianToCartographic(t.positionWC,Zt),d=d.replace("[cameraLon]",b.toDegrees(Zt.longitude).toString()),d=d.replace("[cameraLat]",b.toDegrees(Zt.latitude).toString()),d=d.replace("[cameraAlt]",b.toDegrees(Zt.height).toString());var v=t.frustum,y=v.aspectRatio,C="",T="";if(c(y)){var w=b.toDegrees(v.fov);y>1?(C=w,T=w/y):(T=w,C=w*y)}d=d.replace("[horizFov]",C.toString()),d=d.replace("[vertFov]",T.toString())}else d=d.replace("[bboxWest]","-180"),d=d.replace("[bboxSouth]","-90"),d=d.replace("[bboxEast]","180"),d=d.replace("[bboxNorth]","90"),d=d.replace("[lookatLon]",""),d=d.replace("[lookatLat]",""),d=d.replace("[lookatRange]",""),d=d.replace("[lookatTilt]",""),d=d.replace("[lookatHeading]",""),d=d.replace("[lookatTerrainLon]",""),d=d.replace("[lookatTerrainLat]",""),d=d.replace("[lookatTerrainAlt]",""),d=d.replace("[cameraLon]",""),d=d.replace("[cameraLat]",""),d=d.replace("[cameraAlt]",""),d=d.replace("[horizFov]",""),d=d.replace("[vertFov]","");c(r)?(d=d.replace("[horizPixels]",r.clientWidth),d=d.replace("[vertPixels]",r.clientHeight)):(d=d.replace("[horizPixels]",""),d=d.replace("[vertPixels]","")),d=d.replace("[terrainEnabled]","1"),d=d.replace("[clientVersion]","1"),d=d.replace("[kmlVersion]","2.2"),d=d.replace("[clientName]","Cesium"),d=d.replace("[language]","English"),e.setQueryParameters(E(d))}function St(e,t,r,i,n,o,a,s,d){var h=lt(e,t,r,i,n,o,a,s,d),p=h.entity,f=Ee(r,"Link",Gt.kml);if(c(f)||(f=Ee(r,"Url",Gt.kml)),c(f)){var m,g,_=De(f,"href",Gt.kml);if(c(_)){var v=_;if(_=Me(_,o,a),/^data:/.test(_.getUrlComponent()))/\.kmz/i.test(o.getUrlComponent())||(v=o.getDerivedResource({url:v}));else{v=_.clone(),m=De(f,"viewRefreshMode",Gt.kml),g=u(De(f,"viewBoundScale",Gt.kml),1);var b="onStop"===m?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=u(De(f,"viewFormat",Gt.kml),b),S=De(f,"httpQuery",Gt.kml);c(C)&&_.setQueryParameters(E(bt(C))),c(S)&&_.setQueryParameters(E(bt(S)));var w=e._ellipsoid;Ct(_,e._camera,e._canvas,g,e._lastCameraView.bbox,w)}var A={sourceUri:v,uriResolver:a,context:p.id},x=new Q,P=Et(e,x,_,A).then(function(t){var r=e._entityCollection,i=x.values;r.suspendEvents();for(var n=0;n<i.length;n++){var o=i[n];c(o.parent)||(o.parent=p,Pt(o)),r.add(o)}r.resumeEvents();var a=De(f,"refreshMode",Gt.kml),s=u(Ie(f,"refreshInterval",Gt.kml),0);if("onInterval"===a&&s>0||"onExpire"===a||"onStop"===m){var d=Ee(t,"NetworkLinkControl",Gt.kml),h=c(d),v=y.now(),b={id:l(),href:_,cookie:{},lastUpdated:v,updating:!1,entity:p,viewBoundScale:g,needsUpdate:!1,cameraUpdateTime:v},C=0;if(h&&(b.cookie=E(u(De(d,"cookie",Gt.kml),"")),C=u(Ie(d,"minRefreshPeriod",Gt.kml),0)),"onInterval"===a)h&&(s=Math.max(C,s)),b.refreshMode=Xt.INTERVAL,b.time=s;else if("onExpire"===a){var S;if(h&&(S=De(d,"expires",Gt.kml)),c(S))try{var w=y.fromIso8601(S),A=y.secondsDifference(w,v);A>0&&A<C&&y.addSeconds(v,C,w),b.refreshMode=Xt.EXPIRE,b.time=w}catch(e){T("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else T("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else e._camera?(b.refreshMode=Xt.STOP,b.time=u(Ie(f,"viewRefreshTime",Gt.kml),0)):T("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires a camera be passed in when creating the KmlDataSource");c(b.refreshMode)&&e._networkLinks.set(b.id,b)}else"onRegion"===m&&T("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion")}).otherwise(function(t){T("An error occured during loading "+_.url),e._error.raiseEvent(e,t)});s.push(P)}}}function Tt(e,t,r,i,n,o,a,s,l){var u=qt[t.localName];c(u)?u(e,r,t,i,n,o,a,s,l):yt(e,r,t,i,n,o,a,s,l)}function wt(e,t,r,i,n,o){t.removeAll();var a=[],s=r.documentElement,l="Document"===s.localName?s:Ee(s,"Document",Gt.kml),u=De(l,"name",Gt.kml);c(u)||(u=_(i.getUrlComponent())),c(e._name)||(e._name=u);var d=new Q(e);return V.all(je(e,r,d,i,!1,n)).then(function(){var s=r.documentElement;if("kml"===s.localName)for(var l=s.childNodes,u=0;u<l.length;u++){var h=l[u];if(c(qt[h.localName])){s=h;break}}return t.suspendEvents(),Tt(e,s,void 0,t,d,i,n,a,o),t.resumeEvents(),V.all(a).then(function(){return r.documentElement})})}function At(e,t,r,i){var n=V.defer();return z.createReader(new z.BlobReader(r),function(r){r.getEntries(function(o){for(var a,s,l=[],u={},d=0;d<o.length;d++){var h=o[d];if(!h.directory){var p=V.defer();l.push(p.promise),/\.kml$/i.test(h.filename)?c(a)&&/\//i.test(h.filename)?_e(h,u,p):(c(a)&&_e(a,u,s),a=h,s=p):_e(h,u,p)}}c(a)&&ge(a,u,s),V.all(l).then(function(){return r.close(),c(u.kml)?(u.keys=Object.keys(u),wt(e,t,u.kml,i,u)):void n.reject(new I("KMZ file does not contain a KML document."))}).then(n.resolve).otherwise(n.reject)})},function(e){n.reject(e)}),n.promise}function Et(e,t,r,i){i=u(i,u.EMPTY_OBJECT);var n=i.sourceUri,o=i.uriResolver,a=i.context,s=i.query;c(i.query)&&h("KmlDataSource.query","The options.query parameter has been deprecated. Specify data or options.sourceUri as a Resource instance and add query parameters there."),c(e._proxy)&&h("KmlDataSource.proxy","The options.proxy parameter has been deprecated. Specify data or options.sourceUri as a Resource instance and set the proxy property there.");var l=r;return"string"==typeof r||r instanceof P?(r=P.createIfNeeded(r,{proxy:e._proxy,queryParameters:s}),l=r.fetchBlob(),n=u(n,r.clone())):n=u(n,P.DEFAULT.clone()),n=P.createIfNeeded(n),c(e._proxy)&&(n.proxy=e._proxy),c(s)&&n.setQueryParameters(s),V(l).then(function(r){return r instanceof Blob?he(r).then(function(i){return i?At(e,t,r,n):pe(r).then(function(r){r=fe(r),r=me(r);var i,s;try{i=Mt.parseFromString(r,"application/xml")}catch(e){s=e.toString()}if(c(s)||i.body||"parsererror"===i.documentElement.tagName){var l=c(s)?s:i.documentElement.firstChild.nodeValue;throw l||(l=i.body.innerText),new I(l)}return wt(e,t,i,n,o,a)})}):wt(e,t,r,n,o,a)}).otherwise(function(t){return e._error.raiseEvent(e,t),console.log(t),V.reject(t)})}function xt(t){t=u(t,{});var r=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 Q(this),this._name=void 0,this._isLoading=!1,this._proxy=t.proxy,this._pinBuilder=new w,this._networkLinks=new e,this._entityCluster=new X,this._canvas=n,this._camera=r,this._lastCameraView={position:c(r)?i.clone(r.positionWC):void 0,direction:c(r)?i.clone(r.directionWC):void 0,up:c(r)?i.clone(r.upWC):void 0,bbox:c(r)?r.computeViewRectangle():x.clone(x.MAX_VALUE)},this._ellipsoid=u(t.ellipsoid,f.WGS84)}function Pt(e){var t=e.parent;if(c(t)){var r=t.availability;if(c(r)){var i=e.availability;c(i)?i.intersect(r):e.availability=r}}}function It(e,t,r,i,n){return function(o){function a(e){C.remove(e);for(var t=e._children,r=t.length,i=0;i<r;++i)a(t[i])}if(i.contains(t.id)){var s=!1,l=Ee(o,"NetworkLinkControl",Gt.kml),d=c(l),h=0;if(d){if(c(Ee(l,"Update",Gt.kml)))return T("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,void i.remove(t.id);t.cookie=E(u(De(l,"cookie",Gt.kml),"")),h=u(Ie(l,"minRefreshPeriod",Gt.kml),0)}var p=y.now(),f=t.refreshMode;if(f===Xt.INTERVAL)c(l)&&(t.time=Math.max(h,t.time));else if(f===Xt.EXPIRE){var m;if(c(l)&&(m=De(l,"expires",Gt.kml)),c(m))try{var g=y.fromIso8601(m),_=y.secondsDifference(g,p);_>0&&_<h&&y.addSeconds(p,h,g),t.time=g}catch(e){T("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else T("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}var b=t.entity,C=e._entityCollection,S=r.values;C.suspendEvents();var w,A=C.values.slice();for(w=0;w<A.length;++w){var x=A[w];x.parent===b&&(x.parent=void 0,a(x))}for(C.resumeEvents(),C.suspendEvents(),w=0;w<S.length;w++){var P=S[w];c(P.parent)||(P.parent=b,Pt(P)),C.add(P)}C.resumeEvents(),s?i.remove(t.id):t.lastUpdated=p;var I=C.computeAvailability(),D=I.start,O=I.stop,M=y.equals(D,v.MINIMUM_VALUE),R=y.equals(O,v.MAXIMUM_VALUE);if(!M||!R){var L=e._clock;L.startTime===D&&L.stopTime===O||(L.startTime=D,L.stopTime=O,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,n.getUrlComponent(!0))}}}function Dt(){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 Ot={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=g(t),Ot[t]}},Mt=new DOMParser,Rt=new B({stripPrefix:!1,twitter:!1,email:!1,replaceFn:function(e,t){if(!t.protocolUrlMatch)return!1}}),Lt=32,Nt=2414016,kt=1,Ft=16093e3,Bt=.1,Ut=[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"],Vt=["http://www.google.com/kml/ext/2.2"],zt=["http://www.w3.org/2005/Atom"],Gt={kml:Ut,gx:Vt,atom:zt,kmlgx:Ut.concat(Vt)},Ht={},Wt={Point:Je,LineString:$e,LinearRing:$e,Polygon:et,Track:tt,MultiTrack:it,MultiGeometry:nt,Model:ot},jt=document.createElement("div"),qt={Document:ut,Folder:ct,Placemark:dt,NetworkLink:St,GroundOverlay:vt,PhotoOverlay:yt,ScreenOverlay:yt,Tour:ht},Yt={FlyTo:mt,Wait:ft,SoundCue:pt,AnimatedUpdate:pt,TourControl:pt},Xt={INTERVAL:0,EXPIRE:1,STOP:2},Qt=new x,Zt=new n,Kt=new r,Jt=new i;xt.load=function(e,t){return t=u(t,u.EMPTY_OBJECT),new xt(t).load(e,t)},d(xt.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}},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}}}),xt.prototype.load=function(e,t){t=u(t,{}),j.setLoading(this,!0);var r=this._name;this._name=void 0,this._clampToGround=u(t.clampToGround,!1);var i=this;return Et(this,this._entityCollection,e,t).then(function(){var e,t=i._entityCollection.computeAvailability(),n=t.start,s=t.stop,l=y.equals(n,v.MINIMUM_VALUE),u=y.equals(s,v.MAXIMUM_VALUE);if(!l||!u){var c;l&&(c=new Date,c.setHours(0,0,0,0),n=y.fromDate(c)),u&&(c=new Date,c.setHours(24,0,0,0),s=y.fromDate(c)),e=new q,e.startTime=n,e.stopTime=s,e.currentTime=y.clone(n),e.clockRange=o.LOOP_STOP,e.clockStep=a.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(y.secondsDifference(s,n)/60,1),31556900))}var d=!1;return e!==i._clock&&(i._clock=e,d=!0),r!==i._name&&(d=!0),d&&i._changed.raiseEvent(i),j.setLoading(i,!1),i}).otherwise(function(e){return j.setLoading(i,!1),i._error.raiseEvent(i,e),console.log(e),V.reject(e)})};var $t=new e;return xt.prototype.update=function(t){function r(e){for(var t=e._children,i=t.length,n=0;n<i;++n){var o=t[n];$t.set(o.id,o),r(o)}}var n=this._networkLinks;if(0===n.length)return!0;var o=y.now(),a=this;$t.removeAll();var s=!1,l=this._lastCameraView,d=this._camera;!c(d)||d.positionWC.equalsEpsilon(l.position,b.EPSILON7)&&d.directionWC.equalsEpsilon(l.direction,b.EPSILON7)&&d.upWC.equalsEpsilon(l.up,b.EPSILON7)||(l.position=i.clone(d.positionWC),l.direction=i.clone(d.directionWC),l.up=i.clone(d.upWC),l.bbox=d.computeViewRectangle(),s=!0);var h=new e,p=!1;return n.values.forEach(function(e){var t=e.entity;if(!$t.contains(t.id)){if(!e.updating){var i=!1;if(e.refreshMode===Xt.INTERVAL?y.secondsDifference(o,e.lastUpdated)>e.time&&(i=!0):e.refreshMode===Xt.EXPIRE?y.greaterThan(o,e.time)&&(i=!0):e.refreshMode===Xt.STOP&&(s&&(e.needsUpdate=!0,e.cameraUpdateTime=o),e.needsUpdate&&y.secondsDifference(o,e.cameraUpdateTime)>=e.time&&(i=!0)),i){r(t),e.updating=!0;var n=new Q,c=e.href.clone();c.setQueryParameters(e.cookie);var d=u(a._ellipsoid,f.WGS84);Ct(c,a._camera,a._canvas,e.viewBoundScale,l.bbox,d),Et(a,n,c,{context:t.id}).then(It(a,e,n,h,c)).otherwise(function(t){var r="NetworkLink "+e.href+" refresh failed: "+t;console.log(r),a._error.raiseEvent(a,r)}),p=!0}}h.set(e.id,e)}}),p&&(this._networkLinks=h,this._changed.raiseEvent(this)),!0},xt});define("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}),define("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,r){"use strict";function i(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,this.pass=e.pass}return i.ALL=r(new i({color:new e(0,0,0,0),depth:1,stencil:0})),i.prototype.execute=function(e,t){e.clear(this,t)},i}),define("Renderer/ComputeCommand",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function r(r){r=e(r,e.EMPTY_OBJECT),this.vertexArray=r.vertexArray,this.fragmentShaderSource=r.fragmentShaderSource,this.shaderProgram=r.shaderProgram,this.uniformMap=r.uniformMap,this.outputTexture=r.outputTexture,this.preExecute=r.preExecute,this.postExecute=r.postExecute,this.persists=e(r.persists,!1),this.pass=t.COMPUTE,this.owner=r.owner}return r.prototype.execute=function(e){e.execute(this)},r}),define("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"}),define("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Check","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){this._context=e}function f(e,t){return new c({context:e,colorTextures:[t],destroyAttachments:!1})}function m(e,t){return h.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function g(t,r){return i(_)&&_.viewport.width===t&&_.viewport.height===r||(_=d.fromCache({viewport:new e(0,0,t,r)})),_}var _,v=new u({primitiveType:a.TRIANGLES}),y=new l({color:new r(0,0,0,0)});return p.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=f(o,t),u=g(r,n),c=e.uniformMap,d=y;d.framebuffer=l,d.renderState=u,d.execute(o);var h=v;h.vertexArray=a,h.renderState=u,h.shaderProgram=s,h.uniformMap=c,h.framebuffer=l,h.execute(o),l.destroy(),e.persists||(s.destroy(),i(e.vertexArray)&&a.destroy()),i(e.postExecute)&&e.postExecute(t)},p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){return n(this)},p}),define("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}),define("Renderer/RenderbufferFormat",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={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===r.RGBA4||e===r.RGB5_A1||e===r.RGB565||e===r.DEPTH_COMPONENT16||e===r.STENCIL_INDEX8||e===r.DEPTH_STENCIL}};return e(r)}),define("Renderer/Renderbuffer",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT);var i=e.context,n=i._gl,o=(a.maximumRenderbufferSize,t(e.format,s.RGBA4)),l=r(e.width)?e.width:n.drawingBufferWidth,u=r(e.height)?e.height:n.drawingBufferHeight;this._gl=n,this._format=o,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,o,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return i(l.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),l.prototype._getRenderbuffer=function(){return this._renderbuffer},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),n(this)},l}),define("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t){var r=new a(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new e},r.viewport=new e,this._context=t,this._fb=void 0,this._passState=r,this._width=0,this._height=0}c.prototype.begin=function(t){var r=this._context,n=r.drawingBufferWidth,a=r.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),i(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:r,colorTextures:[new u({context:r,width:n,height:a})],depthStencilRenderbuffer:new s({context:r,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var d=new t;return c.prototype.end=function(e){for(var n=r(e.width,1),o=r(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),h=Math.floor(.5*o),p=0,f=0,m=0,g=-1,_=0;_<u;++_){if(-c<=p&&p<=c&&-h<=f&&f<=h){var v=4*((h-f)*n+p+c);d.red=t.byteToFloat(s[v]),d.green=t.byteToFloat(s[v+1]),d.blue=t.byteToFloat(s[v+2]),d.alpha=t.byteToFloat(s[v+3]);var y=a.getObjectByPickColor(d);if(i(y))return y}if(p===f||p<0&&-p===f||p>0&&p===1-f){var b=m;m=-g,g=b}p+=m,f+=g}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),define("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,r,i,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function a(e,t){for(var r=t.derivedKeywords,i=r.length,n=0;n<i;++n){var o=r[n]+t.keyword;a(e,e._shaders[o])}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}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(t){var r=t.vertexShaderSource,o=t.fragmentShaderSource,a=t.attributeLocations;"string"==typeof r&&(r=new n({sources:[r]})),"string"==typeof o&&(o=new n({sources:[o]}));var s,l=r.createCombinedVertexShader(this._context),u=o.createCombinedFragmentShader(this._context),c=l+u+JSON.stringify(a);if(e(this._shaders[c]))s=this._shaders[c],delete this._shadersToRelease[c];else{var d=this._context,h=new i({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:r,vertexShaderText:l,fragmentShaderSource:o,fragmentShaderText:u,attributeLocations:a});s={cache:this,shaderProgram:h,keyword:c,derivedKeywords:[],count:0},h._cachedShader=s,this._shaders[c]=s,++this._numberOfShaders}return++s.count,s.shaderProgram},o.prototype.getDerivedShaderProgram=function(t,r){var i=t._cachedShader,n=r+i.keyword,o=this._shaders[n];if(e(o))return o.shaderProgram},o.prototype.createDerivedShaderProgram=function(e,t,r){var o=e._cachedShader,a=t+o.keyword,s=r.vertexShaderSource,l=r.fragmentShaderSource,u=r.attributeLocations;"string"==typeof s&&(s=new n({sources:[s]})),"string"==typeof l&&(l=new n({sources:[l]}));var c=this._context,d=s.createCombinedVertexShader(c),h=l.createCombinedFragmentShader(c),p=new i({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:s,vertexShaderText:d,fragmentShaderSource:l,fragmentShaderText:h,attributeLocations:u}),f={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0};return o.derivedKeywords.push(t),p._cachedShader=f,this._shaders[a]=f,p},o.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];a(this,r),--this._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(t){if(e(t)){var r=t._cachedShader;r&&0==--r.count&&(this._shadersToRelease[r.keyword]=r)}},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 r(this)},o}),define("Renderer/UniformState",["./Sampler","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrthographicFrustum","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_){"use strict";function v(){this.globeDepthTexture=void 0,this._viewport=new t,this._viewportCartesian4=new n,this._viewportDirty=!1,this._viewportOrthographicMatrix=p.clone(p.IDENTITY),this._viewportTransformation=p.clone(p.IDENTITY),this._model=p.clone(p.IDENTITY),this._view=p.clone(p.IDENTITY),this._inverseView=p.clone(p.IDENTITY),this._projection=p.clone(p.IDENTITY),this._infiniteProjection=p.clone(p.IDENTITY),this._entireFrustum=new r,this._currentFrustum=new r,this._frustumPlanes=new n,this._frameState=void 0,this._temeToPseudoFixed=h.clone(p.IDENTITY),this._view3DDirty=!0,this._view3D=new p,this._inverseView3DDirty=!0,this._inverseView3D=new p,this._inverseModelDirty=!0,this._inverseModel=new p,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new h,this._viewRotation=new h,this._inverseViewRotation=new h,this._viewRotation3D=new h,this._inverseViewRotation3D=new h,this._inverseProjectionDirty=!0,this._inverseProjection=new p,this._modelViewDirty=!0,this._modelView=new p,this._modelView3DDirty=!0,this._modelView3D=new p,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new p,this._inverseModelViewDirty=!0,this._inverseModelView=new p,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new p,this._viewProjectionDirty=!0,this._viewProjection=new p,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new p,this._modelViewProjectionDirty=!0,this._modelViewProjection=new p,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new p,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new p,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new p,this._normalDirty=!0,this._normal=new h,this._normal3DDirty=!0,this._normal3D=new h,this._inverseNormalDirty=!0,this._inverseNormal=new h,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new h,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new c,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 r,this._resolutionScale=1,this._orthographicIn3D=!1,this._backgroundColor=new a,this._brdfLut=new e,this._environmentMap=new e,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._imagerySplitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}function y(e,t){p.clone(t,e._view),p.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 b(e,t){p.clone(t,e._inverseView),p.getRotation(t,e._inverseViewRotation)}function C(e,t){p.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function S(e,t){p.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function T(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 w(e,t){l(g.computeIcrfToFixedMatrix(t.time,q))||(q=g.computeTemeToPseudoFixedMatrix(t.time,q));var r=m.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);h.multiplyByVector(q,r,r),i.normalize(r,e._sunDirectionWC),r=h.multiplyByVector(e.viewRotation3D,r,e._sunDirectionEC),i.normalize(r,r),r=m.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),h.multiplyByVector(q,r,r),h.multiplyByVector(e.viewRotation3D,r,r),i.normalize(r,r);var n=t.mapProjection,o=n.ellipsoid,a=o.cartesianToCartographic(e._sunPositionWC,Y);n.project(a,e._sunPositionColumbusView)}function A(e){if(e._viewportDirty){var t=e._viewport;p.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),p.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function E(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode===_.SCENE2D||e._mode===_.MORPHING||e._orthographicIn3D?p.clone(p.ZERO,e._inverseProjection):p.inverse(e._projection,e._inverseProjection))}function x(e){e._modelViewDirty&&(e._modelViewDirty=!1,p.multiplyTransformation(e._view,e._model,e._modelView))}function P(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,p.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function I(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,p.inverse(e.modelView,e._inverseModelView))}function D(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,p.inverse(e.modelView3D,e._inverseModelView3D))}function O(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,p.multiply(e._projection,e._view,e._viewProjection))}function M(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,p.inverse(e.viewProjection,e._inverseViewProjection))}function R(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,p.multiply(e._projection,e.modelView,e._modelViewProjection))}function L(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,r=e._modelViewRelativeToEye;r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=0,r[13]=0,r[14]=0,r[15]=t[15]}}function N(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,p.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function k(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,p.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function F(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,p.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function B(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;p.getRotation(e.inverseModelView,t),h.transpose(t,t)}}function U(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;p.getRotation(e.inverseModelView3D,t),h.transpose(t,t)}}function V(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,p.getRotation(e.inverseModelView,e._inverseNormal))}function z(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,p.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function G(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,p.multiplyByPoint(e.inverseModel,e._cameraPosition,X),c.fromCartesian(X,e._encodedCameraPositionMC))}function H(e,t,r,n,o,a,s,u){var c=Q;c.x=e.y,c.y=e.z,c.z=e.x;var h=Z;h.x=r.y,h.y=r.z,h.z=r.x;var f=K;f.x=n.y,f.y=n.z,f.z=n.x;var m=J;m.x=t.y,m.y=t.z,m.z=t.x,a===_.SCENE2D&&(c.z=.5*o);var v=s.unproject(c,$);v.longitude=d.clamp(v.longitude,-Math.PI,Math.PI),v.latitude=d.clamp(v.latitude,-d.PI_OVER_TWO,d.PI_OVER_TWO);var y=s.ellipsoid,b=y.cartographicToCartesian(v,ee),C=g.eastNorthUpToFixedFrame(b,y,te);return p.multiplyByPointAsVector(C,h,h),p.multiplyByPointAsVector(C,f,f),p.multiplyByPointAsVector(C,m,m),l(u)||(u=new p),u[0]=h.x,u[1]=f.x,u[2]=-m.x,u[3]=0,u[4]=h.y,u[5]=f.y,u[6]=-m.y,u[7]=0,u[8]=h.z,u[9]=f.z,u[10]=-m.z,u[11]=0,u[12]=-i.dot(h,b),u[13]=-i.dot(f,b),u[14]=i.dot(m,b),u[15]=1,u}function W(e){e._view3DDirty&&(e._mode===_.SCENE3D?p.clone(e._view,e._view3D):H(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),p.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function j(e){e._inverseView3DDirty&&(p.inverseTransformation(e.view3D,e._inverseView3D),p.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}u(v.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!t.equals(e,this._viewport)){t.clone(e,this._viewport);var r=this._viewport,i=this._viewportCartesian4;i.x=r.x,i.y=r.y,i.z=r.width,i.w=r.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return A(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return A(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){p.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,p.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,p.getRotation(this.inverseModel,e),h.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return W(this),this._view3D}},viewRotation:{get:function(){return W(this),this._viewRotation}},viewRotation3D:{get:function(){return W(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return j(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return j(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return E(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return x(this),this._modelView}},modelView3D:{get:function(){return P(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return L(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return I(this),this._inverseModelView}},inverseModelView3D:{get:function(){return D(this),this._inverseModelView3D}},viewProjection:{get:function(){return O(this),this._viewProjection}},inverseViewProjection:{get:function(){return M(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return R(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return N(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return k(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return F(this),this._modelViewInfiniteProjection}},normal:{get:function(){return B(this),this._normal}},normal3D:{get:function(){return U(this),this._normal3D}},inverseNormal:{get:function(){return V(this),this._inverseNormal}},inverseNormal3D:{get:function(){return z(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 G(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return G(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},imagerySplitPosition:{get:function(){return this._imagerySplitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}}});var q=new h,Y=new o;v.prototype.updateCamera=function(e){y(this,e.viewMatrix),b(this,e.inverseViewMatrix),T(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==_.SCENE2D&&e.frustum instanceof f},v.prototype.updateFrustum=function(e){C(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&S(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,l(e._offCenterFrustum)&&(e=e._offCenterFrustum),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right},v.prototype.updatePass=function(e){this._pass=e},v.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var t=e.context._canvas;this._resolutionScale=t.width/t.clientWidth;var r=e.camera;this.updateCamera(r),e.mode===_.SCENE2D?(this._frustum2DWidth=r.frustum.right-r.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),w(this,e);var i=e.brdfLutGenerator,n=l(i)?i.colorTexture:void 0;this._brdfLut=n,this._environmentMap=s(e.environmentMap,e.context.defaultCubeMap),this._fogDensity=e.fog.density,this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=g.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._imagerySplitPosition=e.imagerySplitPosition*e.context.drawingBufferWidth;var o,u=r.frustum.fov,c=this._viewport;o=c.height>c.width?2*Math.tan(.5*u)/c.height:2*Math.tan(.5*u)/c.width,this._geometricToleranceOverMeter=o*e.maximumScreenSpaceError,a.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};var X=new i,Q=new i,Z=new i,K=new i,J=new i,$=new o,ee=new i,te=new p;return v}),define("Renderer/Context",["../Core/Check","../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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I){"use strict";function D(e,t){var r="WebGL Error:  ";switch(t){case e.INVALID_ENUM:r+="INVALID_ENUM";break;case e.INVALID_VALUE:r+="INVALID_VALUE";break;case e.INVALID_OPERATION:r+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:r+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:r+="CONTEXT_LOST_WEBGL lost";break;default:r+="Unknown ("+t+")"}return r}function O(e,t,r,i){for(var n=D(e,i)+": "+t.name+"(",o=0;o<r.length;++o)0!==o&&(n+=", "),n+=r[o];return n+=");"}function M(e,t,r){var i=e.getError();if(i!==e.NO_ERROR)throw new f(O(e,t,r,i))}function R(e,t,r){return{get:function(){var i=e[t];return r(e,"get: "+t,i),e[t]},set:function(i){e[t]=i,r(e,"set: "+t,i)}}}function L(e,t){if(!a(t))return e;var r={};for(var i in e){var n=e[i];n instanceof Function?r[i]=function(r){return function(){var i=r.apply(e,arguments);return t(e,r,arguments),i}}(n):Object.defineProperty(r,i,R(e,i,t))}return r}function N(e,t){for(var r=t.length,i=0;i<r;++i){var n=e.getExtension(t[i]);if(n)return n}}function k(e,i){if("undefined"==typeof WebGLRenderingContext)throw new f("The browser does not support WebGL.  Visit http://get.webgl.org.");this._canvas=e,i=t(i,!0),i=o(i,{}),i.allowTextureFilterAnisotropic=o(i.allowTextureFilterAnisotropic,!0);var s=o(i.webgl,{});s.alpha=o(s.alpha,!1),s.stencil=o(s.stencil,!0);var l,u=o(i.requestWebgl2,!1)&&"undefined"!=typeof WebGL2RenderingContext,c=!1,d=i.getWebGLStub;if(a(d))l=d(e,s);else if(u&&(l=e.getContext("webgl2",s)||e.getContext("experimental-webgl2",s)||void 0,a(l)&&(c=!0)),a(l)||(l=e.getContext("webgl",s)||e.getContext("experimental-webgl",s)||void 0),!a(l))throw new f("The browser supports WebGL, but initialization failed.");this._originalGLContext=l,this._gl=l,this._webgl2=c,this._id=n(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new A(this);var h=l;this._stencilBits=h.getParameter(h.STENCIL_BITS),y._maximumCombinedTextureImageUnits=h.getParameter(h.MAX_COMBINED_TEXTURE_IMAGE_UNITS),y._maximumCubeMapSize=h.getParameter(h.MAX_CUBE_MAP_TEXTURE_SIZE),y._maximumFragmentUniformVectors=h.getParameter(h.MAX_FRAGMENT_UNIFORM_VECTORS),y._maximumTextureImageUnits=h.getParameter(h.MAX_TEXTURE_IMAGE_UNITS),y._maximumRenderbufferSize=h.getParameter(h.MAX_RENDERBUFFER_SIZE),y._maximumTextureSize=h.getParameter(h.MAX_TEXTURE_SIZE),y._maximumVaryingVectors=h.getParameter(h.MAX_VARYING_VECTORS),y._maximumVertexAttributes=h.getParameter(h.MAX_VERTEX_ATTRIBS),y._maximumVertexTextureImageUnits=h.getParameter(h.MAX_VERTEX_TEXTURE_IMAGE_UNITS),y._maximumVertexUniformVectors=h.getParameter(h.MAX_VERTEX_UNIFORM_VECTORS);var p=h.getParameter(h.ALIASED_LINE_WIDTH_RANGE);y._minimumAliasedLineWidth=p[0],y._maximumAliasedLineWidth=p[1];var g=h.getParameter(h.ALIASED_POINT_SIZE_RANGE);y._minimumAliasedPointSize=g[0],y._maximumAliasedPointSize=g[1];var _=h.getParameter(h.MAX_VIEWPORT_DIMS);y._maximumViewportWidth=_[0],y._maximumViewportHeight=_[1];var v=h.getShaderPrecisionFormat(h.FRAGMENT_SHADER,h.HIGH_FLOAT);y._highpFloatSupported=0!==v.precision;var b=h.getShaderPrecisionFormat(h.FRAGMENT_SHADER,h.HIGH_INT);y._highpIntSupported=0!==b.rangeMax,this._antialias=h.getContextAttributes().antialias,this._standardDerivatives=!!N(h,["OES_standard_derivatives"]),this._blendMinmax=!!N(h,["EXT_blend_minmax"]),this._elementIndexUint=!!N(h,["OES_element_index_uint"]),this._depthTexture=!!N(h,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=!!N(h,["OES_texture_float"]),this._fragDepth=!!N(h,["EXT_frag_depth"]),this._debugShaders=N(h,["WEBGL_debug_shaders"]),this._colorBufferFloat=this._webgl2&&!!N(h,["EXT_color_buffer_float"]),this._s3tc=!!N(h,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!N(h,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._etc1=!!N(h,["WEBGL_compressed_texture_etc1"]);var C=i.allowTextureFilterAnisotropic?N(h,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=C,
y._maximumTextureFilterAnisotropy=a(C)?h.getParameter(C.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;var T,E,x,I,D,O,M,R,L,k;if(c){var F=this;T=function(){return F._gl.createVertexArray()},E=function(e){F._gl.bindVertexArray(e)},x=function(e){F._gl.deleteVertexArray(e)},I=function(e,t,r,i,n){h.drawElementsInstanced(e,t,r,i,n)},D=function(e,t,r,i){h.drawArraysInstanced(e,t,r,i)},O=function(e,t){h.vertexAttribDivisor(e,t)},M=function(e){h.drawBuffers(e)}}else R=N(h,["OES_vertex_array_object"]),a(R)&&(T=function(){return R.createVertexArrayOES()},E=function(e){R.bindVertexArrayOES(e)},x=function(e){R.deleteVertexArrayOES(e)}),L=N(h,["ANGLE_instanced_arrays"]),a(L)&&(I=function(e,t,r,i,n){L.drawElementsInstancedANGLE(e,t,r,i,n)},D=function(e,t,r,i){L.drawArraysInstancedANGLE(e,t,r,i)},O=function(e,t){L.vertexAttribDivisorANGLE(e,t)}),k=N(h,["WEBGL_draw_buffers"]),a(k)&&(M=function(e){k.drawBuffersWEBGL(e)});this.glCreateVertexArray=T,this.glBindVertexArray=E,this.glDeleteVertexArray=x,this.glDrawElementsInstanced=I,this.glDrawArraysInstanced=D,this.glVertexAttribDivisor=O,this.glDrawBuffers=M,this._vertexArrayObject=!!R,this._instancedArrays=!!L,this._drawBuffers=!!k,y._maximumDrawBuffers=this.drawBuffers?h.getParameter(m.MAX_DRAW_BUFFERS):1,y._maximumColorAttachments=this.drawBuffers?h.getParameter(m.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new r(0,0,0,0),this._clearDepth=1,this._clearStencil=0;var B=new P,U=new S(this),V=w.fromCache();this._defaultPassState=U,this._defaultRenderState=V,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=B,this._currentRenderState=V,this._currentPassState=U,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var z=0;z<y._maximumVertexAttributes;z++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=i,this.cache={},w.apply(h,V,U)}function F(e){}function B(e,t,r,i){var n=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=r,w.partialApply(e._gl,n,t,o,r,i)}function U(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var r=W;if(a(t))t._bind(),F(e),r=t._getActiveColorAttachments();else{var i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(r)}}function V(e,t,r,i){var n=o(r._renderState,e._defaultRenderState);U(e,t),B(e,n,i,!1);var a=r._shaderProgram;a._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,a.maximumTextureUnitIndex)}function z(e,t){var r=t._primitiveType,i=t._vertexArray,n=t._offset,s=t._count,l=t.instanceCount;e._us.model=o(t._modelMatrix,h.IDENTITY),t._shaderProgram._setUniforms(t._uniformMap,e._us,e.validateShaderProgram),i._bind();var u=i.indexBuffer;a(u)?(n*=u.bytesPerIndex,s=o(s,u.numberOfIndices),0===l?e._gl.drawElements(r,s,u.indexDatatype,n):e.glDrawElementsInstanced(r,s,u.indexDatatype,n,l)):(s=o(s,i.numberOfVertices),0===l?e._gl.drawArrays(r,n,s):e.glDrawArraysInstanced(r,n,s,l)),i._unBind()}function G(e,t,r){this._pickObjects=e,this.key=t,this.color=r}var H={};s(k.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}},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||this._webgl2}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._textureFloat||this._colorBufferFloat}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},etc1:{get:function(){return this._etc1}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},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=L(this._originalGLContext,e?M:void 0)}},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 b({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 H}}});var W;"undefined"!=typeof WebGLRenderingContext&&(W=[m.BACK]);var j=new v;k.prototype.clear=function(e,t){e=o(e,j),t=o(t,this._defaultPassState);var i=this._gl,n=0,s=e.color,l=e.depth,u=e.stencil;a(s)&&(r.equals(this._clearColor,s)||(r.clone(s,this._clearColor),i.clearColor(s.red,s.green,s.blue,s.alpha)),n|=i.COLOR_BUFFER_BIT),a(l)&&(l!==this._clearDepth&&(this._clearDepth=l,i.clearDepth(l)),n|=i.DEPTH_BUFFER_BIT),a(u)&&(u!==this._clearStencil&&(this._clearStencil=u,i.clearStencil(u)),n|=i.STENCIL_BUFFER_BIT),B(this,o(e.renderState,this._defaultRenderState),t,!0),U(this,o(e.framebuffer,t.framebuffer)),i.clear(n)},k.prototype.draw=function(e,t){t=o(t,this._defaultPassState),V(this,o(e._framebuffer,t.framebuffer),e,t),z(this,e)},k.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 r=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var i=0;i<r;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},k.prototype.readPixels=function(e){var t=this._gl;e=e||{};var r=Math.max(e.x||0,0),i=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 U(this,a),t.readPixels(r,i,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s};var q={position:0,textureCoordinates:1};return k.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!a(e)){var t=new c({attributes:{position:new d({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new d({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:p.TRIANGLES});e=I.fromGeometry({context:this,geometry:t,attributeLocations:q,bufferUsage:_.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},k.prototype.createViewportQuadCommand=function(e,t){return t=o(t,o.EMPTY_OBJECT),new C({vertexArray:this.getViewportQuadVertexArray(),primitiveType:p.TRIANGLES,renderState:t.renderState,shaderProgram:E.fromCache({context:this,vertexShaderSource:g,fragmentShaderSource:e,attributeLocations:q}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})},k.prototype.createPickFramebuffer=function(){return new T(this)},k.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},s(G.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),G.prototype.destroy=function(){delete this._pickObjects[this.key]},k.prototype.createPickId=function(e){++this._nextPickColor[0];var t=this._nextPickColor[0];if(0===t)throw new f("Out of unique Pick IDs.");return this._pickObjects[t]=e,new G(this._pickObjects,t,r.fromRgba(t))},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];a(r.destroy)&&r.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),l(this)},k}),define("Renderer/loadCubeMap",["../Core/Check","../Core/defined","../Core/DeveloperError","../Core/Resource","../ThirdParty/when","./CubeMap"],function(e,t,r,i,n,o){"use strict";function a(e,t){var r=[i.createIfNeeded(t.positiveX).fetchImage(),i.createIfNeeded(t.negativeX).fetchImage(),i.createIfNeeded(t.positiveY).fetchImage(),i.createIfNeeded(t.negativeY).fetchImage(),i.createIfNeeded(t.positiveZ).fetchImage(),i.createIfNeeded(t.negativeZ).fetchImage()];return n.all(r,function(t){return new o({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})}return a}),define("Scene/DiscardMissingTileImagePolicy",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/getImagePixels","../Core/Resource","../ThirdParty/when"],function(e,t,r,i,n,o){"use strict";function a(r){function a(e){t(e.blob)&&(u._missingImageByteLength=e.blob.size);var n=i(e);if(r.disableCheckIfAllPixelsAreTransparent){for(var o=!0,a=e.width,s=r.pixelsToCheck,l=0,c=s.length;o&&l<c;++l){var d=s[l];n[4*d.x+d.y*a+3]>0&&(o=!1)}o&&(n=void 0)}u._missingImagePixels=n,u._isReady=!0}function s(){u._missingImagePixels=void 0,u._isReady=!0}r=e(r,e.EMPTY_OBJECT),this._pixelsToCheck=r.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var l=n.createIfNeeded(r.missingImageUrl),u=this;o(l.fetchImage(!0),a,s)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){var r=this._pixelsToCheck,n=this._missingImagePixels;if(!t(n))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var o=i(e),a=e.width,s=0,l=r.length;s<l;++s)for(var u=r[s],c=4*u.x+u.y*a,d=0;d<4;++d){var h=c+d;if(o[h]!==n[h])return!1}return!0},a}),define("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 r,i=10;for(var n in t)if(t.hasOwnProperty(n)&&t[n]){var o=n.toLowerCase();i>1&&"name"===o?(i=1,r=n):i>2&&"title"===o?(i=2,r=n):i>3&&/name/i.test(n)?(i=3,r=n):i>4&&/title/i.test(n)&&(i=4,r=n)}e(r)&&(this.name=t[r])},t.prototype.configureDescriptionFromProperties=function(t){function r(t){var i='<table class="cesium-infoBox-defaultTable">';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(i+="object"==typeof o?"<tr><td>"+n+"</td><td>"+r(o)+"</td></tr>":"<tr><td>"+n+"</td><td>"+o+"</td></tr>")}return i+="</table>"}this.description=r(t)},t}),define("Scene/ImageryProvider",["../Core/Check","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/loadCRN","../Core/loadKTX","../Core/Resource"],function(e,t,r,i,n,o,a,s){"use strict";function l(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,n.throwInstantiationError()}r(l.prototype,{ready:{get:n.throwInstantiationError},readyPromise:{get:n.throwInstantiationError},rectangle:{get:n.throwInstantiationError},tileWidth:{get:n.throwInstantiationError},tileHeight:{get:n.throwInstantiationError},maximumLevel:{get:n.throwInstantiationError},minimumLevel:{get:n.throwInstantiationError},tilingScheme:{get:n.throwInstantiationError},tileDiscardPolicy:{get:n.throwInstantiationError},errorEvent:{get:n.throwInstantiationError},credit:{get:n.throwInstantiationError},proxy:{get:n.throwInstantiationError},hasAlphaChannel:{get:n.throwInstantiationError}}),l.prototype.getTileCredits=n.throwInstantiationError,l.prototype.requestImage=n.throwInstantiationError,l.prototype.pickFeatures=n.throwInstantiationError;var u=/\.ktx$/i,c=/\.crn$/i;return l.loadImage=function(e,r,n){t(n)&&i("ImageryProvider.loadImage.request","The request parameter has been deprecated. Set the request property on the Resource parameter.");var l=s.createIfNeeded(r,{request:n});return u.test(l)?a(l):c.test(l)?o(l):t(e.tileDiscardPolicy)?l.fetchImage(!0):l.fetchImage()},l}),define("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/Math","../Core/Rectangle","../Core/Resource","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C){"use strict";function S(r){function a(n){var a=n.tileInfo;if(o(a)){if(S._tileWidth=a.rows,S._tileHeight=a.cols,102100===a.spatialReference.wkid||102113===a.spatialReference.wkid)S._tilingScheme=new _({ellipsoid:r.ellipsoid});else{if(4326!==n.tileInfo.spatialReference.wkid){var s="Tile spatial reference WKID "+n.tileInfo.spatialReference.wkid+" is not supported.";return void(C=m.handleError(C,S,S._errorEvent,s,void 0,void 0,void 0,d))}S._tilingScheme=new c({ellipsoid:r.ellipsoid})}if(S._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 g,u=n.fullExtent,p=l.unproject(new t(Math.max(u.xmin,-S._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(u.ymin,-S._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),f=l.unproject(new t(Math.min(u.xmax,S._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(u.ymax,S._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));S._rectangle=new h(p.longitude,p.latitude,f.longitude,f.latitude)}else{if(4326!==n.fullExtent.spatialReference.wkid){var v="fullExtent.spatialReference WKID "+n.fullExtent.spatialReference.wkid+" is not supported.";return void(C=m.handleError(C,S,S._errorEvent,v,void 0,void 0,void 0,d))}S._rectangle=h.fromDegrees(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax)}}else S._rectangle=S._tilingScheme.rectangle;o(S._tileDiscardPolicy)||(S._tileDiscardPolicy=new y({missingImageUrl:T(S,0,0,S._maximumLevel).url,pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),S._useTiles=!0}else S._useTiles=!1;o(n.copyrightText)&&n.copyrightText.length>0&&(S._credit=new i({text:n.copyrightText})),S._ready=!0,S._readyPromise.resolve(!0),m.handleSuccess(C)}function l(e){var t="An error occurred while accessing "+S._resource.url+".";C=m.handleError(C,S,S._errorEvent,t,void 0,void 0,void 0,d),S._readyPromise.reject(new f(t))}function d(){var e=S._resource.getDerivedResource({queryParameters:{f:"json"}}),t=e.fetchJsonp();v(t,a,l)}r=n(r,{}),o(r.proxy)&&s("ArcGisMapServerImageryProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var b=p.createIfNeeded(r.url,{proxy:r.proxy});b.appendForwardSlash(),o(r.token)&&b.setQueryParameters({token:r.token}),this._resource=b,this._tileDiscardPolicy=r.tileDiscardPolicy,this._tileWidth=n(r.tileWidth,256),this._tileHeight=n(r.tileHeight,256),this._maximumLevel=r.maximumLevel,this._tilingScheme=n(r.tilingScheme,new c({ellipsoid:r.ellipsoid})),this._credit=void 0,this._useTiles=n(r.usePreCachedTilesIfAvailable,!0),this._rectangle=n(r.rectangle,this._tilingScheme.rectangle),this._layers=r.layers,this.enablePickFeatures=n(r.enablePickFeatures,!0),this._errorEvent=new u,this._ready=!1,this._readyPromise=v.defer();var C,S=this;this._useTiles?d():(this._ready=!0,this._readyPromise.resolve(!0))}function T(e,t,r,i,n){var o;if(e._useTiles)o=e._resource.getDerivedResource({url:"tile/"+i+"/"+r+"/"+t,request:n});else{var a=e._tilingScheme.tileXYToNativeRectangle(t,r,i),s=a.west+","+a.south+","+a.east+","+a.north,l={bbox:s,size:e._tileWidth+","+e._tileHeight,format:"png",transparent:!0,f:"image"};e._tilingScheme instanceof c?(l.bboxSR=4326,l.imageSR=4326):(l.bboxSR=3857,l.imageSR=3857),e.layers&&(l.layers="show:"+e.layers),o=e._resource.getDerivedResource({url:"export",request:n,queryParameters:l})}return o}return a(S.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.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,r){},S.prototype.requestImage=function(e,t,r,i){return C.loadImage(this,T(this,e,t,r,i))},S.prototype.pickFeatures=function(e,i,n,a,s){if(this.enablePickFeatures){var l,u,h,p=this._tilingScheme.tileXYToNativeRectangle(e,i,n);if(this._tilingScheme instanceof c)l=d.toDegrees(a),u=d.toDegrees(s),h="4326";else{var f=this._tilingScheme.projection.project(new r(a,s,0));l=f.x,u=f.y,h="3857"}var m="visible";o(this._layers)&&(m+=":"+this._layers);var _={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:l+","+u,mapExtent:p.west+","+p.south+","+p.east+","+p.north,imageDisplay:this._tileWidth+","+this._tileHeight+",96",sr:h,layers:m};return this._resource.getDerivedResource({url:"identify",queryParameters:_}).fetchJson().then(function(e){var i=[],n=e.results;if(!o(n))return i;for(var a=0;a<n.length;++a){var s=n[a],l=new b;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=r.fromDegrees(s.geometry.x,s.geometry.y,s.geometry.z);else if(102100===u||900913===u||3857===u){var c=new g;l.position=c.unproject(new t(s.geometry.x,s.geometry.y,s.geometry.z))}}i.push(l)}return i})}},S}),define("Scene/Cesium3DTileColorBlendMode",["../Core/freezeObject"],function(e){"use strict";return e({HIGHLIGHT:0,REPLACE:1,MIX:2})}),define("Scene/getBinaryAccessor",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4"],function(e,t,r,i,n,o,a){"use strict";function s(e){var t,r=e.componentType;t="string"==typeof r?i.fromName(r):r;var n=l[e.type],o=u[e.type];return{componentsPerAttribute:n,classType:o,createArrayBufferView:function(e,r,o){return i.createArrayBufferView(t,e,r,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:r,MAT2:n,MAT3:o,MAT4:a};return s}),define("Scene/Cesium3DTileBatchTable",["../Core/arrayFill","../Core/Cartesian2","../Core/Cartesian4","../Core/Check","../Core/clone","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/RuntimeError","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","./AttributeType","./BlendingState","./Cesium3DTileColorBlendMode","./CullFace","./getBinaryAccessor","./StencilFunction","./StencilOperation"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M){"use strict";function R(e,i,n,o,a){this.featuresLength=i,this._translucentFeaturesLength=0,this.batchTableJson=n,this.batchTableBinary=o;var s,l;u(n)&&(s=n.HIERARCHY,u(s)&&(delete n.HIERARCHY,s=L(s,o)),l=R.getBinaryProperties(i,n,o)),this._batchTableHierarchy=s,this._batchTableBinaryProperties=l,this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[],this._content=e,this._colorChangedCallback=a;var c,d;if(i>0){var h=Math.min(i,g.maximumTextureSize),p=Math.ceil(i/g.maximumTextureSize),f=1/h,m=.5*f,_=1/p,v=.5*_;c=new t(h,p),d=new r(f,m,_,v)}this._textureDimensions=c,this._textureStep=d}function L(t,r){var i,n,o,c=t.instancesLength,d=t.classes,h=t.classIds,p=t.parentCounts,f=t.parentIds,m=c;u(h.byteOffset)&&(h.componentType=l(h.componentType,s.UNSIGNED_SHORT),h.type=E.SCALAR,o=D(h),h=o.createArrayBufferView(r.buffer,r.byteOffset+h.byteOffset,c));var g;if(u(p))for(u(p.byteOffset)&&(p.componentType=l(p.componentType,s.UNSIGNED_SHORT),p.type=E.SCALAR,o=D(p),p=o.createArrayBufferView(r.buffer,r.byteOffset+p.byteOffset,c)),g=new Uint16Array(c),m=0,i=0;i<c;++i)g[i]=m,m+=p[i];u(f)&&u(f.byteOffset)&&(f.componentType=l(f.componentType,s.UNSIGNED_SHORT),f.type=E.SCALAR,o=D(f),f=o.createArrayBufferView(r.buffer,r.byteOffset+f.byteOffset,m));var _=d.length;for(i=0;i<_;++i){var v=d[i].length,y=d[i].instances,b=R.getBinaryProperties(v,y,r);d[i].instances=a(b,y)}var C=e(new Array(_),0),S=new Uint16Array(c);for(i=0;i<c;++i)n=h[i],S[i]=C[n],++C[n];return{classes:d,classIds:h,classIndexes:S,parentCounts:p,parentIndexes:g,parentIds:f}}function N(e){var t=e._textureDimensions;return t.x*t.y*4}function k(t){if(!u(t._batchValues)){var r=N(t),i=new Uint8Array(r);e(i,255),t._batchValues=i}return t._batchValues}function F(t){if(!u(t._showAlphaProperties)){var r=2*t.featuresLength,i=new Uint8Array(r);e(i,255),t._showAlphaProperties=i}return t._showAlphaProperties}function B(e,t){var r=e.typedArray,i=e.componentCount;return 1===i?r[t]:e.type.unpack(r,t*i)}function U(e,t,r){var i=e.typedArray,n=e.componentCount;1===n?i[t]=r:e.type.pack(r,i,t*n)}function V(e,t,r){var i=e.classIds,n=e.parentCounts,o=e.parentIds,a=e.parentIndexes,s=i.length,l=ce;l.length=Math.max(l.length,s);var c=++he,d=de;for(d.length=0,d.push(t);d.length>0;)if(t=d.pop(),l[t]!==c){l[t]=c;var h=r(e,t);if(u(h))return h;for(var p=n[t],f=a[t],m=0;m<p;++m){var g=o[f+m];g!==t&&d.push(g)}}}function z(e,t,r){for(var i=!0;i;){var n=r(e,t);if(u(n))return n;var o=e.parentIds[t];i=o!==t,t=o}}function G(e,t,r){var i=e.parentCounts,n=e.parentIds;return u(n)?u(i)?V(e,t,r):z(e,t,r):r(e,t)}function H(e,t,r){var i=e._batchTableHierarchy,n=G(i,t,function(e,t){var i=e.classIds[t],n=e.classes[i].instances;if(u(n[r]))return!0});return u(n)}function W(e,t,r){G(e._batchTableHierarchy,t,function(e,t){var i=e.classIds[t],n=e.classes[i].instances;for(var o in n)n.hasOwnProperty(o)&&-1===r.indexOf(o)&&r.push(o)})}function j(e,t,r){return G(e._batchTableHierarchy,t,function(e,t){var i=e.classIds[t],o=e.classes[i],a=e.classIndexes[t],s=o.instances[r];if(u(s))return u(s.typedArray)?B(s,a):n(s[a],!0)})}function q(e,t,r,i){var o=e._batchTableHierarchy,a=G(o,t,function(e,t){var o=e.classIds[t],a=e.classes[o],s=e.classIndexes[t],l=a.instances[r];if(u(l))return u(l.typedArray)?U(l,s,i):l[s]=n(i,!0),!0});return u(a)}function Y(e){return 1===e._textureDimensions.y?"uniform vec4 tile_textureStep; \nvec2 computeSt(float batchId) \n{ \n    float stepX = tile_textureStep.x; \n    float centerX = tile_textureStep.y; \n    return vec2(centerX + (batchId * stepX), 0.5); \n} \n":"uniform vec4 tile_textureStep; \nuniform vec2 tile_textureDimensions; \nvec2 computeSt(float batchId) \n{ \n    float stepX = tile_textureStep.x; \n    float centerX = tile_textureStep.y; \n    float stepY = tile_textureStep.z; \n    float centerY = tile_textureStep.w; \n    float xId = mod(batchId, tile_textureDimensions.x); \n    float yId = floor(batchId / tile_textureDimensions.x); \n    return vec2(centerX + (xId * stepX), 1.0 - (centerY + (yId * stepY))); \n} \n"}function X(e,t){return e=S.replaceMain(e,"tile_main"),t?e+"uniform float tile_colorBlend; \nvoid tile_color(vec4 tile_featureColor) \n{ \n    tile_main(); \n    gl_FragColor.a *= tile_featureColor.a; \n    float highlight = ceil(tile_colorBlend); \n    gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n} \n":e+"void tile_color(vec4 tile_featureColor) \n{ \n    tile_main(); \n} \n"}function Q(e,t,r){if(!u(t))return X(e,r);var i=new RegExp("(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+"+t+";"),n=e.match(i);if(!u(n))return X(e,r);var o=n[0],a=n[2];e=S.replaceMain(e,"tile_main"),e=e.replace(o,"");var s;if("vec3"===a||"vec4"===a){var l="vec3"===a?"vec4("+t+", 1.0)":t,c="vec3"===a?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,c),s="    vec4 source = "+l+"; \n    tile_diffuse = tile_diffuse_final(source, tile_featureColor); \n    tile_main(); \n"}else"sampler2D"===a&&(i=new RegExp("texture2D\\("+t+".*?(\\)\\)|\\))","g"),e=e.replace(i,"tile_diffuse_final($&, tile_diffuse)"),s="    tile_diffuse = tile_featureColor; \n    tile_main(); \n");return e="uniform float tile_colorBlend; \nvec4 tile_diffuse = vec4(1.0); \nbool isWhite(vec3 color) \n{ \n    return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); \n} \nvec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) \n{ \n    vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); \n    vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; \n    return vec4(diffuse.rgb, sourceDiffuse.a); \n} \n"+o+"\n"+e+"\nvoid tile_color(vec4 tile_featureColor) \n{ \n"+s,r&&(e+="    gl_FragColor.a *= tile_featureColor.a; \n    float highlight = ceil(tile_colorBlend); \n    gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n"),e+="} \n"}function Z(e){var t=e._content._tileset,r=t.colorBlendMode,i=t.colorBlendAmount;return r===P.HIGHLIGHT?0:r===P.REPLACE?1:r===P.MIX?p.clamp(i,p.EPSILON4,1):void 0}function K(e,t){e.castShadows=t.castShadows,e.receiveShadows=t.receiveShadows,e.primitiveType=t.primitiveType}function J(e){var t=e._translucentFeaturesLength;return 0===t?pe.ALL_OPAQUE:t===e.featuresLength?pe.ALL_TRANSLUCENT:pe.OPAQUE_AND_TRANSLUCENT}function $(e){var t=_.shallowClone(e),r=t.pass===v.TRANSLUCENT;return t.uniformMap=u(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return r},t}function ee(e){var t=_.shallowClone(e);return t.pass=v.TRANSLUCENT,t.renderState=ie(e.renderState),t}function te(e){var t=_.shallowClone(e),r=n(t.renderState,!0);return r.cull.enabled=!0,r.cull.face=I.FRONT,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r.polygonOffset={enabled:!0,factor:5,units:5},t.renderState=b.fromCache(r),t.castShadows=!1,t.receiveShadows=!1,t}function re(e,t){var r=e;if(e.renderState.depthMask){r=_.shallowClone(e);var i=n(r.renderState,!0);i.stencilTest.enabled=!0,i.stencilTest.mask=240,i.stencilTest.reference=t<<4,i.stencilTest.frontFunction=O.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=M.REPLACE,r.renderState=b.fromCache(i)}return r}function ie(e){var t=n(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=x.ALPHA_BLEND,b.fromCache(t)}function ne(e,t,r){var i=e._textureDimensions;return new T({context:t,pixelFormat:f.RGBA,pixelDatatype:y.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:r},sampler:new C({minificationFilter:A.NEAREST,magnificationFilter:w.NEAREST})})}function oe(e,t){var r=e.featuresLength;if(!u(e._pickTexture)&&r>0){for(var i=e._pickIds,n=N(e),a=new Uint8Array(n),s=e._content,l=0;l<r;++l){var c=t.createPickId(s.getFeature(l));i.push(c);var d=c.color,h=4*l;a[h]=o.floatToByte(d.red),a[h+1]=o.floatToByte(d.green),a[h+2]=o.floatToByte(d.blue),a[h+3]=o.floatToByte(d.alpha)}e._pickTexture=ne(e,t,a),s._tileset._statistics.batchTableByteLength+=e._pickTexture.sizeInBytes}}function ae(e){var t=e._textureDimensions;e._batchTexture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}var se=o.WHITE;c(R.prototype,{memorySizeInBytes:{get:function(){var e=0;return u(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),u(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}}}),R.getBinaryProperties=function(e,t,r){var i;for(var n in t)if(t.hasOwnProperty(n)){var o=t[n],a=o.byteOffset;if(u(a)){var s=o.componentType,l=o.type;if(!u(s))throw new m("componentType is required.");if(!u(l))throw new m("type is required.");if(!u(r))throw new m("Property "+n+" requires a batch table binary.");var c=D(o),d=c.componentsPerAttribute,h=c.classType,p=c.createArrayBufferView(r.buffer,r.byteOffset+a,e);u(i)||(i={}),i[n]={typedArray:p,componentCount:d,type:h}}}return i},R.prototype.setShow=function(e,t){if(!t||u(this._showAlphaProperties)){var r=F(this),i=2*e,n=t?255:0;if(r[i]!==n){r[i]=n;k(this)[4*e+3]=t?r[i+1]:0,this._batchValuesDirty=!0}}},R.prototype.setAllShow=function(e){for(var t=this.featuresLength,r=0;r<t;++r)this.setShow(r,e)},R.prototype.getShow=function(e){if(!u(this._showAlphaProperties))return!0;var t=2*e;return 255===this._showAlphaProperties[t]};var le=new Array(4);R.prototype.setColor=function(e,t){if(!o.equals(t,se)||u(this._batchValues)){var r=t.toBytes(le),i=r[3],n=k(this),a=4*e,s=F(this),l=2*e;if(n[a]!==r[0]||n[a+1]!==r[1]||n[a+2]!==r[2]||s[l+1]!==i){n[a]=r[0],n[a+1]=r[1],n[a+2]=r[2];var c=255!==s[l+1],d=0!==s[l];n[a+3]=d?i:0,s[l+1]=i;var h=255!==i;h&&!c?++this._translucentFeaturesLength:!h&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,u(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}}},R.prototype.setAllColor=function(e){for(var t=this.featuresLength,r=0;r<t;++r)this.setColor(r,e)},R.prototype.getColor=function(e,t){if(!u(this._batchValues))return o.clone(se,t);var r=this._batchValues,i=4*e,n=this._showAlphaProperties,a=2*e;return o.fromBytes(r[i],r[i+1],r[i+2],n[a+1],t)};var ue=new o;R.prototype.applyStyle=function(e,t){if(!u(t))return this.setAllColor(se),void this.setAllShow(!0);for(var r=this._content,i=this.featuresLength,n=0;n<i;++n){var o=r.getFeature(n),a=u(t.color)?t.color.evaluateColor(e,o,ue):se,s=!u(t.show)||t.show.evaluate(e,o);this.setColor(n,a),this.setShow(n,s)}};var ce=[],de=[],he=0;R.prototype.isClass=function(e,t){var r=this._batchTableHierarchy;if(!u(r))return!1;var i=G(r,e,function(e,r){var i=e.classIds[r];if(e.classes[i].name===t)return!0});return u(i)},R.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t},R.prototype.getExactClassName=function(e){var t=this._batchTableHierarchy;if(u(t)){var r=t.classIds[e];return t.classes[r].name}},R.prototype.hasProperty=function(e,t){var r=this.batchTableJson;return u(r)&&u(r[t])||u(this._batchTableHierarchy)&&H(this,e,t)},R.prototype.getPropertyNames=function(e,t){t=u(t)?t:[],t.length=0;var r=this.batchTableJson;for(var i in r)r.hasOwnProperty(i)&&t.push(i);return u(this._batchTableHierarchy)&&W(this,e,t),t},
R.prototype.getProperty=function(e,t){if(u(this.batchTableJson)){if(u(this._batchTableBinaryProperties)){var r=this._batchTableBinaryProperties[t];if(u(r))return B(r,e)}var i=this.batchTableJson[t];if(u(i))return n(i[e],!0);if(u(this._batchTableHierarchy)){var o=j(this,e,t);if(u(o))return o}}},R.prototype.setProperty=function(e,t,r){var i=this.featuresLength;if(u(this._batchTableBinaryProperties)){var o=this._batchTableBinaryProperties[t];if(u(o))return void U(o,e,r)}if(!u(this._batchTableHierarchy)||!q(this,e,t,r)){u(this.batchTableJson)||(this.batchTableJson={});var a=this.batchTableJson[t];u(a)||(this.batchTableJson[t]=new Array(i),a=this.batchTableJson[t]),a[e]=n(r,!0)}},R.prototype.getVertexShaderCallback=function(e,t,r){if(0!==this.featuresLength){var i=this;return function(n){var o,a=Q(n,r,!1);return g.maximumVertexTextureImageUnits>0?(o="",e&&(o+="uniform bool tile_translucentCommand; \n"),o+="uniform sampler2D tile_batchTexture; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n    vec2 st = computeSt("+t+"); \n    vec4 featureProperties = texture2D(tile_batchTexture, st); \n    tile_color(featureProperties); \n    float show = ceil(featureProperties.a); \n    gl_Position *= show; \n",e&&(o+="    bool isStyleTranslucent = (featureProperties.a != 1.0); \n    if (czm_pass == czm_passTranslucent) \n    { \n        if (!isStyleTranslucent && !tile_translucentCommand) \n        { \n            gl_Position *= 0.0; \n        } \n    } \n    else \n    { \n        if (isStyleTranslucent) \n        { \n            gl_Position *= 0.0; \n        } \n    } \n"),o+="    tile_featureColor = featureProperties; \n}"):o="varying vec2 tile_featureSt; \nvoid main() \n{ \n    tile_color(vec4(1.0)); \n    tile_featureSt = computeSt("+t+"); \n}",a+"\n"+Y(i)+o}}},R.prototype.getFragmentShaderCallback=function(e,t){if(0!==this.featuresLength)return function(r){return r=Q(r,t,!0),g.maximumVertexTextureImageUnits>0?r+="varying vec4 tile_featureColor; \nvoid main() \n{ \n    tile_color(tile_featureColor); \n}":(e&&(r+="uniform bool tile_translucentCommand; \n"),r+="uniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n    vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n    if (featureProperties.a == 0.0) { \n        discard; \n    } \n",e&&(r+="    bool isStyleTranslucent = (featureProperties.a != 1.0); \n    if (czm_pass == czm_passTranslucent) \n    { \n        if (!isStyleTranslucent && !tile_translucentCommand) \n        { \n            discard; \n        } \n    } \n    else \n    { \n        if (isStyleTranslucent) \n        { \n            discard; \n        } \n    } \n"),r+="    tile_color(featureProperties); \n} \n"),r}},R.prototype.getClassificationFragmentShaderCallback=function(){if(0!==this.featuresLength)return function(e){return e=S.replaceMain(e,"tile_main"),g.maximumVertexTextureImageUnits>0?e+="varying vec4 tile_featureColor; \nvoid main() \n{ \n    tile_main(); \n    gl_FragColor = tile_featureColor; \n}":e+="uniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n    tile_main(); \n    vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n    if (featureProperties.a == 0.0) { \n        discard; \n    } \n    gl_FragColor = featureProperties; \n} \n",e}},R.prototype.getUniformMapCallback=function(){if(0!==this.featuresLength){var e=this;return function(t){return a(t,{tile_batchTexture:function(){return l(e._batchTexture,e._defaultTexture)},tile_textureDimensions:function(){return e._textureDimensions},tile_textureStep:function(){return e._textureStep},tile_colorBlend:function(){return Z(e)}})}}},R.prototype.getPickVertexShaderCallback=function(e){if(0!==this.featuresLength){var t=this;return function(r){var i,n=S.replaceMain(r,"tile_main");return i=g.maximumVertexTextureImageUnits>0?"uniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n    tile_main(); \n    vec2 st = computeSt("+e+"); \n    vec4 featureProperties = texture2D(tile_batchTexture, st); \n    float show = ceil(featureProperties.a); \n    gl_Position *= show; \n    tile_featureSt = st; \n}":"varying vec2 tile_featureSt; \nvoid main() \n{ \n    tile_main(); \n    tile_featureSt = computeSt("+e+"); \n}",n+"\n"+Y(t)+i}}},R.prototype.getPickFragmentShaderCallback=function(){if(0!==this.featuresLength)return function(e){var t,r=S.replaceMain(e,"tile_main");return t=g.maximumVertexTextureImageUnits>0?"uniform sampler2D tile_pickTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n    tile_main(); \n    if (gl_FragColor.a == 0.0) { \n        discard; \n    } \n    gl_FragColor = texture2D(tile_pickTexture, tile_featureSt); \n}":"uniform sampler2D tile_pickTexture; \nuniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n    vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n    if (featureProperties.a == 0.0) { \n        discard; \n    } \n    tile_main(); \n    if (gl_FragColor.a == 0.0) { \n        discard; \n    } \n    gl_FragColor = texture2D(tile_pickTexture, tile_featureSt); \n}",r+"\n"+t}},R.prototype.getPickVertexShaderCallbackIgnoreShow=function(e){if(0!==this.featuresLength){var t=this;return function(r){var i=S.replaceMain(r,"tile_main"),n="varying vec2 tile_featureSt; \nvoid main() \n{ \n    tile_main(); \n    tile_featureSt = computeSt("+e+"); \n}";return i+"\n"+Y(t)+n}}},R.prototype.getPickFragmentShaderCallbackIgnoreShow=function(){if(0!==this.featuresLength)return function(e){return S.replaceMain(e,"tile_main")+"\nuniform sampler2D tile_pickTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n    tile_main(); \n    gl_FragColor = texture2D(tile_pickTexture, tile_featureSt); \n}"}},R.prototype.getPickUniformMapCallback=function(){if(0!==this.featuresLength){var e=this;return function(t){return a({tile_batchTexture:function(){return l(e._batchTexture,e._defaultTexture)},tile_textureDimensions:function(){return e._textureDimensions},tile_textureStep:function(){return e._textureStep},tile_pickTexture:function(){return e._pickTexture}},t)}}};var pe={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};return R.prototype.addDerivedCommands=function(e,t,r){for(var i=e.commandList,n=i.length,o=this._content._tile,a=o._tileset,s=a._skipLevelOfDetail&&a._hasMixedContent&&e.context.stencilBuffer,l=J(this),c=t;c<n;++c){var d=i[c],h=d.derivedCommands.tileset;u(h)||(h={},d.derivedCommands.tileset=h,h.originalCommand=$(d)),K(h.originalCommand,d),l!==pe.ALL_OPAQUE&&(u(h.translucent)||(h.translucent=ee(h.originalCommand)),K(h.translucent,d)),s&&(d.pass===v.TRANSLUCENT||r||(u(h.zback)||(h.zback=te(h.originalCommand)),a._backfaceCommands.push(h.zback)),u(h.stencil)&&o._selectionDepth===o._lastSelectionDepth||(h.stencil=re(h.originalCommand,o._selectionDepth),o._lastSelectionDepth=o._selectionDepth),K(h.stencil,d));var p=s?h.stencil:h.originalCommand,f=h.translucent;d.pass!==v.TRANSLUCENT?(l===pe.ALL_OPAQUE&&(i[c]=p),l===pe.ALL_TRANSLUCENT&&(i[c]=f),l===pe.OPAQUE_AND_TRANSLUCENT&&(i[c]=p,i.push(f))):i[c]=p}},R.prototype.update=function(e,t){var r=t.context;this._defaultTexture=r.defaultTexture,t.passes.pick&&oe(this,r),this._batchValuesDirty&&(this._batchValuesDirty=!1,u(this._batchTexture)||(this._batchTexture=ne(this,r,this._batchValues),e._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes),ae(this))},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();for(var e=this._pickIds,t=e.length,r=0;r<t;++r)e[r].destroy();return d(this)},R}),define("Scene/Cesium3DTileFeature",["../Core/Color","../Core/defined","../Core/defineProperties"],function(e,t,r){"use strict";function i(e,t){this._content=e,this._batchId=t,this._color=void 0}return r(i.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return t(this._color)||(this._color=new e),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}}}),i.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},i.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},i.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},i.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},i.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},i.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},i.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)},i}),define("Scene/Cesium3DTileFeatureTable",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined"],function(e,t,r){"use strict";function i(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function n(t,i,n,o,a,s){var l=t._cachedTypedArrays,u=l[i];return r(u)||(u=e.createArrayBufferView(n,t.buffer.buffer,t.buffer.byteOffset+s,a*o),l[i]=u),u}function o(t,i,n,o){var a=t._cachedTypedArrays,s=a[i];return r(s)||(s=e.createTypedArray(n,o),a[i]=s),s}return i.prototype.getGlobalProperty=function(i,o,a){var s=this.json[i];if(r(s))return r(s.byteOffset)?(o=t(o,e.UNSIGNED_INT),a=t(a,1),n(this,i,o,a,1,s.byteOffset)):s},i.prototype.getPropertyArray=function(t,i,a){var s=this.json[t];if(r(s))return r(s.byteOffset)?(r(s.componentType)&&(i=e.fromName(s.componentType)),n(this,t,i,a,this.featuresLength,s.byteOffset)):o(this,t,i,s)},i.prototype.getProperty=function(e,t,i,n,o){var a=this.json[e];if(r(a)){var s=this.getPropertyArray(e,t,i);if(1===i)return s[n];for(var l=0;l<i;++l)o[l]=s[i*n+l];return o}},i}),define("Scene/Vector3DTileBatch",[],function(){"use strict";function e(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}return e}),define("ThirdParty/jsep",[],function(){if(function(e){"use strict";var t=function(e,t){var r=new Error(e+" at character "+t);throw r.index=t,r.description=e,r},r={"-":!0,"!":!0,"~":!0,"+":!0},i={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},n=function(e){var t,r=0;for(var i in e)(t=i.length)>r&&e.hasOwnProperty(i)&&(r=t);return r},o=n(r),a=n(i),s={true:!0,false:!1,null:null},l=function(e){return i[e]||0},u=function(e,t,r){return{type:"||"===e||"&&"===e?"LogicalExpression":"BinaryExpression",operator:e,left:t,right:r}},c=function(e){return e>=48&&e<=57},d=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=128&&!i[String.fromCharCode(e)]},h=function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e>=128&&!i[String.fromCharCode(e)]},p=function(e){for(var n,p,f=0,m=e.charAt,g=e.charCodeAt,_=function(t){return m.call(e,t)},v=function(t){return g.call(e,t)},y=e.length,b=function(){for(var e=v(f);32===e||9===e;)e=v(++f)},C=function(){var e,r,i=T();return b(),63!==v(f)?i:(f++,e=C(),e||t("Expected expression",f),b(),58===v(f)?(f++,r=C(),r||t("Expected expression",f),{type:"ConditionalExpression",test:i,consequent:e,alternate:r}):void t("Expected :",f))},S=function(){b();for(var t=e.substr(f,a),r=t.length;r>0;){if(i.hasOwnProperty(t))return f+=r,t;t=t.substr(0,--r)}return!1},T=function(){var e,r,i,n,o,a,s,c;if(a=w(),!(r=S()))return a;for(o={value:r,prec:l(r)},s=w(),s||t("Expected expression after "+r,f),n=[a,o,s];(r=S())&&0!==(i=l(r));){for(o={value:r,prec:i};n.length>2&&i<=n[n.length-2].prec;)s=n.pop(),r=n.pop().value,a=n.pop(),e=u(r,a,s),n.push(e);e=w(),e||t("Expected expression after "+r,f),n.push(o,e)}for(c=n.length-1,e=n[c];c>1;)e=u(n[c-1].value,n[c-2],e),c-=2;return e},w=function(){var t,i,n;if(b(),t=v(f),c(t)||46===t)return A();if(39===t||34===t)return E();if(d(t)||40===t)return I();if(91===t)return O();for(i=e.substr(f,o),n=i.length;n>0;){if(r.hasOwnProperty(i))return f+=n,{type:"UnaryExpression",operator:i,argument:w(),prefix:!0};i=i.substr(0,--n)}return!1},A=function(){for(var e,r,i="";c(v(f));)i+=_(f++);if(46===v(f))for(i+=_(f++);c(v(f));)i+=_(f++);if("e"===(e=_(f))||"E"===e){for(i+=_(f++),e=_(f),"+"!==e&&"-"!==e||(i+=_(f++));c(v(f));)i+=_(f++);c(v(f-1))||t("Expected exponent ("+i+_(f)+")",f)}return r=v(f),d(r)?t("Variable names cannot start with a number ("+i+_(f)+")",f):46===r&&t("Unexpected period",f),{type:"Literal",value:parseFloat(i),raw:i}},E=function(){for(var e,r="",i=_(f++),n=!1;f<y;){if((e=_(f++))===i){n=!0;break}if("\\"===e)switch(e=_(f++)){case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+="\\"+e}else r+=e}return n||t('Unclosed quote after "'+r+'"',f),{type:"Literal",value:r,raw:i+r+i}},x=function(){var r,i=v(f),n=f;for(d(i)?f++:t("Unexpected "+_(f),f);f<y&&(i=v(f),h(i));)f++;return r=e.slice(n,f),s.hasOwnProperty(r)?{type:"Literal",value:s[r],raw:r}:"this"===r?{type:"ThisExpression"}:{type:"Identifier",name:r}},P=function(e){for(var r,i,n=[],o=!1;f<y;){if(b(),(r=v(f))===e){o=!0,f++;break}44===r?f++:(i=C(),i&&"Compound"!==i.type||t("Expected comma",f),n.push(i))}return o||t("Expected "+String.fromCharCode(e),f),n},I=function(){var e,r;for(e=v(f),r=40===e?D():x(),b(),e=v(f);46===e||91===e||40===e;)f++,46===e?(b(),r={type:"MemberExpression",computed:!1,object:r,property:x()}):91===e?(r={type:"MemberExpression",computed:!0,object:r,property:C()},b(),e=v(f),93!==e&&t("Unclosed [",f),f++):40===e&&(r={type:"CallExpression",arguments:P(41),callee:r}),b(),e=v(f);return r},D=function(){f++;var e=C();if(b(),41===v(f))return f++,e;t("Unclosed (",f)},O=function(){return f++,{type:"ArrayExpression",elements:P(93)}},M=[];f<y;)n=v(f),59===n||44===n?f++:(p=C())?M.push(p):f<y&&t('Unexpected "'+_(f)+'"',f);return 1===M.length?M[0]:{type:"Compound",body:M}};if(p.version="0.3.1",p.toString=function(){return"JavaScript Expression Parser (JSEP) v"+p.version},p.addUnaryOp=function(e){return o=Math.max(e.length,o),r[e]=!0,this},p.addBinaryOp=function(e,t){return a=Math.max(e.length,a),i[e]=t,this},p.addLiteral=function(e,t){return s[e]=t,this},p.removeUnaryOp=function(e){return delete r[e],e.length===o&&(o=n(r)),this},p.removeAllUnaryOps=function(){return r={},o=0,this},p.removeBinaryOp=function(e){return delete i[e],e.length===a&&(a=n(i)),this},p.removeAllBinaryOps=function(){return i={},a=0,this},p.removeLiteral=function(e){return delete s[e],this},p.removeAllLiterals=function(){return s={},this},"undefined"==typeof exports){var f=e.jsep;e.jsep=p,p.noConflict=function(){return e.jsep===p&&(e.jsep=f),p}}else"undefined"!=typeof module&&module.exports?exports=module.exports=p:exports.parse=p}(this),"undefined"!=typeof jsep)return jsep.noConflict()}),define("Scene/ExpressionNodeType",["../Core/freezeObject"],function(e){"use strict";return e({VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18})}),define("Scene/Expression",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Check","../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/isArray","../Core/Math","../Core/RuntimeError","../ThirdParty/jsep","./ExpressionNodeType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t){this._expression=e,e=E(e,t),e=I(x(e)),d.addBinaryOp("=~",0),d.addBinaryOp("!~",0);var r;try{r=d(e)}catch(e){throw new c(e)}this._runtimeAst=V(this,r)}function f(e){return e-Math.floor(e)}function m(e){return Math.pow(2,e)}function g(e){return u.logBase(e,2)}function _(i){return function(n,o){if("number"==typeof o)return i(o);if(o instanceof e)return e.fromElements(i(o.x),i(o.y),$.getCartesian2());if(o instanceof t)return t.fromElements(i(o.x),i(o.y),i(o.z),$.getCartesian3());if(o instanceof r)return r.fromElements(i(o.x),i(o.y),i(o.z),i(o.w),$.getCartesian4());throw new c('Function "'+n+'" requires a vector or number argument. Argument is '+o+".")}}function v(i,n){return function(o,a,s){if(n&&"number"==typeof s){if("number"==typeof a)return i(a,s);if(a instanceof e)return e.fromElements(i(a.x,s),i(a.y,s),$.getCartesian2());if(a instanceof t)return t.fromElements(i(a.x,s),i(a.y,s),i(a.z,s),$.getCartesian3());if(a instanceof r)return r.fromElements(i(a.x,s),i(a.y,s),i(a.z,s),i(a.w,s),$.getCartesian4())}if("number"==typeof a&&"number"==typeof s)return i(a,s);if(a instanceof e&&s instanceof e)return e.fromElements(i(a.x,s.x),i(a.y,s.y),$.getCartesian2());if(a instanceof t&&s instanceof t)return t.fromElements(i(a.x,s.x),i(a.y,s.y),i(a.z,s.z),$.getCartesian3());if(a instanceof r&&s instanceof r)return r.fromElements(i(a.x,s.x),i(a.y,s.y),i(a.z,s.z),i(a.w,s.w),$.getCartesian4());throw new c('Function "'+o+'" requires vector or number arguments of matching types. Arguments are '+a+" and "+s+".")}}function y(i,n){return function(o,a,s,l){if(n&&"number"==typeof l){if("number"==typeof a&&"number"==typeof s)return i(a,s,l);if(a instanceof e&&s instanceof e)return e.fromElements(i(a.x,s.x,l),i(a.y,s.y,l),$.getCartesian2());if(a instanceof t&&s instanceof t)return t.fromElements(i(a.x,s.x,l),i(a.y,s.y,l),i(a.z,s.z,l),$.getCartesian3());if(a instanceof r&&s instanceof r)return r.fromElements(i(a.x,s.x,l),i(a.y,s.y,l),i(a.z,s.z,l),i(a.w,s.w,l),$.getCartesian4())}if("number"==typeof a&&"number"==typeof s&&"number"==typeof l)return i(a,s,l);if(a instanceof e&&s instanceof e&&l instanceof e)return e.fromElements(i(a.x,s.x,l.x),i(a.y,s.y,l.y),$.getCartesian2());if(a instanceof t&&s instanceof t&&l instanceof t)return t.fromElements(i(a.x,s.x,l.x),i(a.y,s.y,l.y),i(a.z,s.z,l.z),$.getCartesian3());if(a instanceof r&&s instanceof r&&l instanceof r)return r.fromElements(i(a.x,s.x,l.x),i(a.y,s.y,l.y),i(a.z,s.z,l.z),i(a.w,s.w,l.w),$.getCartesian4());throw new c('Function "'+o+'" requires vector or number arguments of matching types. Arguments are '+a+", "+s+", and "+l+".")}}function b(i,n){if("number"==typeof n)return Math.abs(n);if(n instanceof e)return e.magnitude(n);if(n instanceof t)return t.magnitude(n);if(n instanceof r)return r.magnitude(n);throw new c('Function "'+i+'" requires a vector or number argument. Argument is '+n+".")}function C(i,n){if("number"==typeof n)return 1;if(n instanceof e)return e.normalize(n,$.getCartesian2());if(n instanceof t)return t.normalize(n,$.getCartesian3());if(n instanceof r)return r.normalize(n,$.getCartesian4());throw new c('Function "'+i+'" requires a vector or number argument. Argument is '+n+".")}function S(i,n,o){if("number"==typeof n&&"number"==typeof o)return Math.abs(n-o);if(n instanceof e&&o instanceof e)return e.distance(n,o);if(n instanceof t&&o instanceof t)return t.distance(n,o);if(n instanceof r&&o instanceof r)return r.distance(n,o);throw new c('Function "'+i+'" requires vector or number arguments of matching types. Arguments are '+n+" and "+o+".")}function T(i,n,o){if("number"==typeof n&&"number"==typeof o)return n*o;if(n instanceof e&&o instanceof e)return e.dot(n,o);if(n instanceof t&&o instanceof t)return t.dot(n,o);if(n instanceof r&&o instanceof r)return r.dot(n,o);throw new c('Function "'+i+'" requires vector or number arguments of matching types. Arguments are '+n+" and "+o+".")}function w(e,r,i){if(r instanceof t&&i instanceof t)return t.cross(r,i,$.getCartesian3());throw new c('Function "'+e+'" requires vec3 arguments. Arguments are '+r+" and "+i+".")}function A(e,t,r,i,n){this._type=e,this._value=t,this._left=r,this._right=i,this._test=n,this.evaluate=void 0,z(this)}function E(e,t){if(!o(t))return e;for(var r in t)if(t.hasOwnProperty(r)){var i=new RegExp("\\$\\{"+r+"\\}","g"),n="("+t[r]+")";o(n)&&(e=e.replace(i,n))}return e}function x(e){return e.replace(ie,ne)}function P(e){return e.replace(oe,"\\")}function I(e){for(var t=e,r="",i=t.indexOf("${");i>=0;){var n,o=t.indexOf("'"),a=t.indexOf('"');if(o>=0&&o<i)n=t.indexOf("'",o+1),r+=t.substr(0,n+1),t=t.substr(n+1),i=t.indexOf("${");else if(a>=0&&a<i)n=t.indexOf('"',a+1),r+=t.substr(0,n+1),t=t.substr(n+1),i=t.indexOf("${");else{r+=t.substr(0,i);var s=t.indexOf("}");if(s<0)throw new c("Unmatched {.");r+="czm_"+t.substr(i+2,s-(i+2)),t=t.substr(s+1),i=t.indexOf("${")}}return r+=t}function D(e){var t=typeof e.value;return null===e.value?new A(h.LITERAL_NULL,null):"boolean"===t?new A(h.LITERAL_BOOLEAN,e.value):"number"===t?new A(h.LITERAL_NUMBER,e.value):"string"===t?e.value.indexOf("${")>=0?new A(h.VARIABLE_IN_STRING,e.value):new A(h.LITERAL_STRING,P(e.value)):void 0}function O(e,t){var r,i,n,a,s=t.arguments,l=s.length;if("MemberExpression"===t.callee.type){r=t.callee.property.name;var u=t.callee.object;if("test"===r||"exec"===r){if("regExp"!==u.callee.name)throw new c(r+" is not a function.");return 0===l?"test"===r?new A(h.LITERAL_BOOLEAN,!1):new A(h.LITERAL_NULL,null):(n=V(e,u),a=V(e,s[0]),new A(h.FUNCTION_CALL,r,n,a))}if("toString"===r)return i=V(e,u),new A(h.FUNCTION_CALL,r,i);throw new c('Unexpected function call "'+r+'".')}if("color"===(r=t.callee.name)){if(0===l)return new A(h.LITERAL_COLOR,r);if(i=V(e,s[0]),o(s[1])){var d=V(e,s[1]);return new A(h.LITERAL_COLOR,r,[i,d])}return new A(h.LITERAL_COLOR,r,[i])}if("rgb"===r||"hsl"===r){if(l<3)throw new c(r+" requires three arguments.");return i=[V(e,s[0]),V(e,s[1]),V(e,s[2])],new A(h.LITERAL_COLOR,r,i)}if("rgba"===r||"hsla"===r){if(l<4)throw new c(r+" requires four arguments.");return i=[V(e,s[0]),V(e,s[1]),V(e,s[2]),V(e,s[3])],new A(h.LITERAL_COLOR,r,i)}if("vec2"===r||"vec3"===r||"vec4"===r){i=new Array(l);for(var p=0;p<l;++p)i[p]=V(e,s[p]);return new A(h.LITERAL_VECTOR,r,i)}if("isNaN"===r||"isFinite"===r)return 0===l?"isNaN"===r?new A(h.LITERAL_BOOLEAN,!0):new A(h.LITERAL_BOOLEAN,!1):(i=V(e,s[0]),new A(h.UNARY,r,i));if("isExactClass"===r||"isClass"===r){if(l<1||l>1)throw new c(r+" requires exactly one argument.");return i=V(e,s[0]),new A(h.UNARY,r,i)}if("getExactClassName"===r){if(l>0)throw new c(r+" does not take any argument.");return new A(h.UNARY,r)}if(o(se[r])){if(1!==l)throw new c(r+" requires exactly one argument.");return i=V(e,s[0]),new A(h.UNARY,r,i)}if(o(le[r])){if(2!==l)throw new c(r+" requires exactly two arguments.");return n=V(e,s[0]),a=V(e,s[1]),new A(h.BINARY,r,n,a)}if(o(ue[r])){if(3!==l)throw new c(r+" requires exactly three arguments.");n=V(e,s[0]),a=V(e,s[1]);var f=V(e,s[2]);return new A(h.TERNARY,r,n,a,f)}if("Boolean"===r)return 0===l?new A(h.LITERAL_BOOLEAN,!1):(i=V(e,s[0]),new A(h.UNARY,r,i));if("Number"===r)return 0===l?new A(h.LITERAL_NUMBER,0):(i=V(e,s[0]),new A(h.UNARY,r,i));if("String"===r)return 0===l?new A(h.LITERAL_STRING,""):(i=V(e,s[0]),new A(h.UNARY,r,i));if("regExp"===r)return M(e,t);throw new c('Unexpected function call "'+r+'".')}function M(e,t){var r=t.arguments;if(0===r.length)return new A(h.LITERAL_REGEX,new RegExp);var i,n=V(e,r[0]);if(r.length>1){var o=V(e,r[1]);if(F(n)&&F(o)){try{i=new RegExp(P(String(n._value)),o._value)}catch(e){throw new c(e)}return new A(h.LITERAL_REGEX,i)}return new A(h.REGEX,n,o)}if(F(n)){try{i=new RegExp(P(String(n._value)))}catch(e){throw new c(e)}return new A(h.LITERAL_REGEX,i)}return new A(h.REGEX,n)}function R(e){if(B(e.name)){var t=U(e.name);return"tiles3d_"===t.substr(0,8)?new A(h.BUILTIN_VARIABLE,t):new A(h.VARIABLE,t)}if("NaN"===e.name)return new A(h.LITERAL_NUMBER,NaN);if("Infinity"===e.name)return new A(h.LITERAL_NUMBER,1/0);if("undefined"===e.name)return new A(h.LITERAL_UNDEFINED,void 0);throw new c(e.name+" is not defined.")}function L(e){var t=e.property.name;return"PI"===t?new A(h.LITERAL_NUMBER,Math.PI):"E"===t?new A(h.LITERAL_NUMBER,Math.E):void 0}function N(e){if("POSITIVE_INFINITY"===e.property.name)return new A(h.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function k(e,t){if("Math"===t.object.name)return L(t);if("Number"===t.object.name)return N(t);var r,i=V(e,t.object);return t.computed?(r=V(e,t.property),new A(h.MEMBER,"brackets",i,r)):(r=new A(h.LITERAL_STRING,t.property.name),new A(h.MEMBER,"dot",i,r))}function F(e){return e._type>=h.LITERAL_NULL}function B(e){return"czm_"===e.substr(0,4)}function U(e){return e.substr(4)}function V(e,t){var r,i,n,o;if("Literal"===t.type)r=D(t);else if("CallExpression"===t.type)r=O(e,t);else if("Identifier"===t.type)r=R(t);else if("UnaryExpression"===t.type){i=t.operator;var a=V(e,t.argument);if(!(ee.indexOf(i)>-1))throw new c('Unexpected operator "'+i+'".');r=new A(h.UNARY,i,a)}else if("BinaryExpression"===t.type){if(i=t.operator,n=V(e,t.left),o=V(e,t.right),!(te.indexOf(i)>-1))throw new c('Unexpected operator "'+i+'".');r=new A(h.BINARY,i,n,o)}else if("LogicalExpression"===t.type)i=t.operator,n=V(e,t.left),o=V(e,t.right),te.indexOf(i)>-1&&(r=new A(h.BINARY,i,n,o));else if("ConditionalExpression"===t.type){var s=V(e,t.test);n=V(e,t.consequent),o=V(e,t.alternate),r=new A(h.CONDITIONAL,"?",n,o,s)}else if("MemberExpression"===t.type)r=k(e,t);else{if("ArrayExpression"!==t.type)throw new c("Compound"===t.type?"Provide exactly one expression.":"Cannot parse expression.");for(var l=[],u=0;u<t.elements.length;u++)l[u]=V(e,t.elements[u]);r=new A(h.ARRAY,l)}return r}function z(e){e._type===h.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===h.FUNCTION_CALL?"test"===e._value?e.evaluate=e._evaluateRegExpTest:"exec"===e._value?e.evaluate=e._evaluateRegExpExec:"toString"===e._value&&(e.evaluate=e._evaluateToString):e._type===h.UNARY?"!"===e._value?e.evaluate=e._evaluateNot:"-"===e._value?e.evaluate=e._evaluateNegative:"+"===e._value?e.evaluate=e._evaluatePositive:"isNaN"===e._value?e.evaluate=e._evaluateNaN:"isFinite"===e._value?e.evaluate=e._evaluateIsFinite:"isExactClass"===e._value?e.evaluate=e._evaluateIsExactClass:"isClass"===e._value?e.evaluate=e._evaluateIsClass:"getExactClassName"===e._value?e.evaluate=e._evaluategetExactClassName:"Boolean"===e._value?e.evaluate=e._evaluateBooleanConversion:"Number"===e._value?e.evaluate=e._evaluateNumberConversion:"String"===e._value?e.evaluate=e._evaluateStringConversion:o(se[e._value])&&(e.evaluate=H(e._value)):e._type===h.BINARY?"+"===e._value?e.evaluate=e._evaluatePlus:"-"===e._value?e.evaluate=e._evaluateMinus:"*"===e._value?e.evaluate=e._evaluateTimes:"/"===e._value?e.evaluate=e._evaluateDivide:"%"===e._value?e.evaluate=e._evaluateMod:"==="===e._value?e.evaluate=e._evaluateEqualsStrict:"!=="===e._value?e.evaluate=e._evaluateNotEqualsStrict:"<"===e._value?e.evaluate=e._evaluateLessThan:"<="===e._value?e.evaluate=e._evaluateLessThanOrEquals:">"===e._value?e.evaluate=e._evaluateGreaterThan:">="===e._value?e.evaluate=e._evaluateGreaterThanOrEquals:"&&"===e._value?e.evaluate=e._evaluateAnd:"||"===e._value?e.evaluate=e._evaluateOr:"=~"===e._value?e.evaluate=e._evaluateRegExpMatch:"!~"===e._value?e.evaluate=e._evaluateRegExpNotMatch:o(le[e._value])&&(e.evaluate=W(e._value)):e._type===h.TERNARY?e.evaluate=j(e._value):e._type===h.MEMBER?"brackets"===e._value?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===h.ARRAY?e.evaluate=e._evaluateArray:e._type===h.VARIABLE?e.evaluate=e._evaluateVariable:e._type===h.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===h.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===h.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===h.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===h.REGEX?e.evaluate=e._evaluateRegExp:e._type===h.BUILTIN_VARIABLE?"tiles3d_tileset_time"===e._value&&(e.evaluate=G):e.evaluate=e._evaluateLiteral}function G(e,t){return t.content.tileset.timeSinceLoad}function H(e){var t=se[e];return function(r,i){var n=this._left.evaluate(r,i);return t(e,n)}}function W(e){var t=le[e];return function(r,i){var n=this._left.evaluate(r,i),o=this._right.evaluate(r,i);return t(e,n,o)}}function j(e){var t=ue[e];return function(r,i){var n=this._left.evaluate(r,i),o=this._right.evaluate(r,i),a=this._test.evaluate(r,i);return t(e,n,o,a)}}function q(e){return"feature"===e._value}function Y(e){for(var t=e._left,r=t.length,i=0;i<r;++i)if(t[i]._type!==h.LITERAL_NUMBER)return;var o=t[0]._value,a=t[1]._value,s=t[2]._value,l=4===r?t[3]._value:1;return n.fromHsl(o,a,s,l,ae)}function X(e){for(var t=e._left,r=t.length,i=0;i<r;++i)if(t[i]._type!==h.LITERAL_NUMBER)return;var n=ae;return n.red=t[0]._value/255,n.green=t[1]._value/255,n.blue=t[2]._value/255,n.alpha=4===r?t[3]._value:1,n}function Q(e){return e%1==0?e.toFixed(1):e.toString()}function Z(e){return"vec3("+Q(e.red)+", "+Q(e.green)+", "+Q(e.blue)+")"}function K(e){return"vec4("+Q(e.red)+", "+Q(e.green)+", "+Q(e.blue)+", "+Q(e.alpha)+")"}function J(e,t,r,i){for(var n=e.length,o=new Array(n),a=0;a<n;++a)o[a]=e[a].getShaderExpression(t,r,i);return o}a(p.prototype,{expression:{get:function(){return this._expression}}});var $={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new e],cartesian3Array:[new t],cartesian4Array:[new r],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);var e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new e),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new t),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new r),this.cartesian4Array[this.cartesian4Index++]}};p.prototype.evaluate=function(i,o,a){$.reset();var s=this._runtimeAst.evaluate(i,o);return a instanceof n&&s instanceof r?n.fromCartesian4(s,a):s instanceof e||s instanceof t||s instanceof r?s.clone(a):s},p.prototype.evaluateColor=function(e,t,r){$.reset();var i=this._runtimeAst.evaluate(e,t);return n.fromCartesian4(i,r)},p.prototype.getShaderFunction=function(e,t,r,i){var n=this.getShaderExpression(t,r);return n=i+" "+e+"() \n{ \n    return "+n+"; \n} \n"},p.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};var ee=["!","-","+"],te=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],re=/\${(.*?)}/g,ie=/\\/g,ne="@#%",oe=/@#%/g,ae=new n,se={abs:_(Math.abs),sqrt:_(Math.sqrt),cos:_(Math.cos),sin:_(Math.sin),tan:_(Math.tan),acos:_(Math.acos),asin:_(Math.asin),atan:_(Math.atan),radians:_(u.toRadians),degrees:_(u.toDegrees),sign:_(u.sign),floor:_(Math.floor),ceil:_(Math.ceil),round:_(Math.round),exp:_(Math.exp),exp2:_(m),log:_(Math.log),log2:_(g),fract:_(f),length:b,normalize:C},le={atan2:v(Math.atan2,!1),pow:v(Math.pow,!1),min:v(Math.min,!0),max:v(Math.max,!0),distance:S,dot:T,cross:w},ue={clamp:y(u.clamp,!0),mix:y(u.lerp,!0)};return A.prototype._evaluateLiteral=function(e,t){return this._value},A.prototype._evaluateLiteralColor=function(e,t){var i=ae,a=this._left;if("color"===this._value)o(a)?a.length>1?(n.fromCssColorString(a[0].evaluate(e,t),i),i.alpha=a[1].evaluate(e,t)):n.fromCssColorString(a[0].evaluate(e,t),i):n.fromBytes(255,255,255,255,i);else if("rgb"===this._value)n.fromBytes(a[0].evaluate(e,t),a[1].evaluate(e,t),a[2].evaluate(e,t),255,i);else if("rgba"===this._value){var s=255*a[3].evaluate(e,t);n.fromBytes(a[0].evaluate(e,t),a[1].evaluate(e,t),a[2].evaluate(e,t),s,i)
}else"hsl"===this._value?n.fromHsl(a[0].evaluate(e,t),a[1].evaluate(e,t),a[2].evaluate(e,t),1,i):"hsla"===this._value&&n.fromHsl(a[0].evaluate(e,t),a[1].evaluate(e,t),a[2].evaluate(e,t),a[3].evaluate(e,t),i);return r.fromColor(i,$.getCartesian4())},A.prototype._evaluateLiteralVector=function(i,n){for(var o=$.getArray(),a=this._value,s=this._left,l=s.length,u=0;u<l;++u){var d=s[u].evaluate(i,n);if("number"==typeof d)o.push(d);else if(d instanceof e)o.push(d.x,d.y);else if(d instanceof t)o.push(d.x,d.y,d.z);else{if(!(d instanceof r))throw new c(a+" argument must be a vector or number. Argument is "+d+".");o.push(d.x,d.y,d.z,d.w)}}var h=o.length,p=parseInt(a.charAt(3));if(0===h)throw new c("Invalid "+a+" constructor. No valid arguments.");if(h<p&&h>1)throw new c("Invalid "+a+" constructor. Not enough arguments.");if(h>p&&l>1)throw new c("Invalid "+a+" constructor. Too many arguments.");if(1===h){var f=o[0];o.push(f,f,f)}return"vec2"===a?e.fromArray(o,0,$.getCartesian2()):"vec3"===a?t.fromArray(o,0,$.getCartesian3()):"vec4"===a?r.fromArray(o,0,$.getCartesian4()):void 0},A.prototype._evaluateLiteralString=function(e,t){return this._value},A.prototype._evaluateVariableString=function(e,t){for(var r=this._value,i=re.exec(r);null!==i;){var n=i[0],a=i[1],s=t.getProperty(a);o(s)||(s=""),r=r.replace(n,s),i=re.exec(r)}return r},A.prototype._evaluateVariable=function(e,t){return t.getProperty(this._value)},A.prototype._evaluateMemberDot=function(i,n){if(q(this._left))return n.getProperty(this._right.evaluate(i,n));var a=this._left.evaluate(i,n);if(o(a)){var s=this._right.evaluate(i,n);if(a instanceof e||a instanceof t||a instanceof r){if("r"===s)return a.x;if("g"===s)return a.y;if("b"===s)return a.z;if("a"===s)return a.w}return a[s]}},A.prototype._evaluateMemberBrackets=function(i,n){if(q(this._left))return n.getProperty(this._right.evaluate(i,n));var a=this._left.evaluate(i,n);if(o(a)){var s=this._right.evaluate(i,n);if(a instanceof e||a instanceof t||a instanceof r){if(0===s||"r"===s)return a.x;if(1===s||"g"===s)return a.y;if(2===s||"b"===s)return a.z;if(3===s||"a"===s)return a.w}return a[s]}},A.prototype._evaluateArray=function(e,t){for(var r=[],i=0;i<this._value.length;i++)r[i]=this._value[i].evaluate(e,t);return r},A.prototype._evaluateNot=function(e,t){var r=this._left.evaluate(e,t);if("boolean"!=typeof r)throw new c('Operator "!" requires a boolean argument. Argument is '+r+".");return!r},A.prototype._evaluateNegative=function(i,n){var o=this._left.evaluate(i,n);if(o instanceof e)return e.negate(o,$.getCartesian2());if(o instanceof t)return t.negate(o,$.getCartesian3());if(o instanceof r)return r.negate(o,$.getCartesian4());if("number"==typeof o)return-o;throw new c('Operator "-" requires a vector or number argument. Argument is '+o+".")},A.prototype._evaluatePositive=function(i,n){var o=this._left.evaluate(i,n);if(!(o instanceof e||o instanceof t||o instanceof r||"number"==typeof o))throw new c('Operator "+" requires a vector or number argument. Argument is '+o+".");return o},A.prototype._evaluateLessThan=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if("number"!=typeof r||"number"!=typeof i)throw new c('Operator "<" requires number arguments. Arguments are '+r+" and "+i+".");return r<i},A.prototype._evaluateLessThanOrEquals=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if("number"!=typeof r||"number"!=typeof i)throw new c('Operator "<=" requires number arguments. Arguments are '+r+" and "+i+".");return r<=i},A.prototype._evaluateGreaterThan=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if("number"!=typeof r||"number"!=typeof i)throw new c('Operator ">" requires number arguments. Arguments are '+r+" and "+i+".");return r>i},A.prototype._evaluateGreaterThanOrEquals=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if("number"!=typeof r||"number"!=typeof i)throw new c('Operator ">=" requires number arguments. Arguments are '+r+" and "+i+".");return r>=i},A.prototype._evaluateOr=function(e,t){var r=this._left.evaluate(e,t);if("boolean"!=typeof r)throw new c('Operator "||" requires boolean arguments. First argument is '+r+".");if(r)return!0;var i=this._right.evaluate(e,t);if("boolean"!=typeof i)throw new c('Operator "||" requires boolean arguments. Second argument is '+i+".");return r||i},A.prototype._evaluateAnd=function(e,t){var r=this._left.evaluate(e,t);if("boolean"!=typeof r)throw new c('Operator "&&" requires boolean arguments. First argument is '+r+".");if(!r)return!1;var i=this._right.evaluate(e,t);if("boolean"!=typeof i)throw new c('Operator "&&" requires boolean arguments. Second argument is '+i+".");return r&&i},A.prototype._evaluatePlus=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);if(a instanceof e&&o instanceof e)return e.add(o,a,$.getCartesian2());if(a instanceof t&&o instanceof t)return t.add(o,a,$.getCartesian3());if(a instanceof r&&o instanceof r)return r.add(o,a,$.getCartesian4());if("string"==typeof o||"string"==typeof a)return o+a;if("number"==typeof o&&"number"==typeof a)return o+a;throw new c('Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are '+o+" and "+a+".")},A.prototype._evaluateMinus=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);if(a instanceof e&&o instanceof e)return e.subtract(o,a,$.getCartesian2());if(a instanceof t&&o instanceof t)return t.subtract(o,a,$.getCartesian3());if(a instanceof r&&o instanceof r)return r.subtract(o,a,$.getCartesian4());if("number"==typeof o&&"number"==typeof a)return o-a;throw new c('Operator "-" requires vector or number arguments of matching types. Arguments are '+o+" and "+a+".")},A.prototype._evaluateTimes=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);if(a instanceof e&&o instanceof e)return e.multiplyComponents(o,a,$.getCartesian2());if(a instanceof e&&"number"==typeof o)return e.multiplyByScalar(a,o,$.getCartesian2());if(o instanceof e&&"number"==typeof a)return e.multiplyByScalar(o,a,$.getCartesian2());if(a instanceof t&&o instanceof t)return t.multiplyComponents(o,a,$.getCartesian3());if(a instanceof t&&"number"==typeof o)return t.multiplyByScalar(a,o,$.getCartesian3());if(o instanceof t&&"number"==typeof a)return t.multiplyByScalar(o,a,$.getCartesian3());if(a instanceof r&&o instanceof r)return r.multiplyComponents(o,a,$.getCartesian4());if(a instanceof r&&"number"==typeof o)return r.multiplyByScalar(a,o,$.getCartesian4());if(o instanceof r&&"number"==typeof a)return r.multiplyByScalar(o,a,$.getCartesian4());if("number"==typeof o&&"number"==typeof a)return o*a;throw new c('Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are '+o+" and "+a+".")},A.prototype._evaluateDivide=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);if(a instanceof e&&o instanceof e)return e.divideComponents(o,a,$.getCartesian2());if(o instanceof e&&"number"==typeof a)return e.divideByScalar(o,a,$.getCartesian2());if(a instanceof t&&o instanceof t)return t.divideComponents(o,a,$.getCartesian3());if(o instanceof t&&"number"==typeof a)return t.divideByScalar(o,a,$.getCartesian3());if(a instanceof r&&o instanceof r)return r.divideComponents(o,a,$.getCartesian4());if(o instanceof r&&"number"==typeof a)return r.divideByScalar(o,a,$.getCartesian4());if("number"==typeof o&&"number"==typeof a)return o/a;throw new c('Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are '+o+" and "+a+".")},A.prototype._evaluateMod=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);if(a instanceof e&&o instanceof e)return e.fromElements(o.x%a.x,o.y%a.y,$.getCartesian2());if(a instanceof t&&o instanceof t)return t.fromElements(o.x%a.x,o.y%a.y,o.z%a.z,$.getCartesian3());if(a instanceof r&&o instanceof r)return r.fromElements(o.x%a.x,o.y%a.y,o.z%a.z,o.w%a.w,$.getCartesian4());if("number"==typeof o&&"number"==typeof a)return o%a;throw new c('Operator "%" requires vector or number arguments of matching types. Arguments are '+o+" and "+a+".")},A.prototype._evaluateEqualsStrict=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);return a instanceof e&&o instanceof e||a instanceof t&&o instanceof t||a instanceof r&&o instanceof r?o.equals(a):o===a},A.prototype._evaluateNotEqualsStrict=function(i,n){var o=this._left.evaluate(i,n),a=this._right.evaluate(i,n);return a instanceof e&&o instanceof e||a instanceof t&&o instanceof t||a instanceof r&&o instanceof r?!o.equals(a):o!==a},A.prototype._evaluateConditional=function(e,t){var r=this._test.evaluate(e,t);if("boolean"!=typeof r)throw new c("Conditional argument of conditional expression must be a boolean. Argument is "+r+".");return r?this._left.evaluate(e,t):this._right.evaluate(e,t)},A.prototype._evaluateNaN=function(e,t){return isNaN(this._left.evaluate(e,t))},A.prototype._evaluateIsFinite=function(e,t){return isFinite(this._left.evaluate(e,t))},A.prototype._evaluateIsExactClass=function(e,t){return t.isExactClass(this._left.evaluate(e,t))},A.prototype._evaluateIsClass=function(e,t){return t.isClass(this._left.evaluate(e,t))},A.prototype._evaluategetExactClassName=function(e,t){return t.getExactClassName()},A.prototype._evaluateBooleanConversion=function(e,t){return Boolean(this._left.evaluate(e,t))},A.prototype._evaluateNumberConversion=function(e,t){return Number(this._left.evaluate(e,t))},A.prototype._evaluateStringConversion=function(e,t){return String(this._left.evaluate(e,t))},A.prototype._evaluateRegExp=function(e,t){var r=this._value.evaluate(e,t),i="";o(this._left)&&(i=this._left.evaluate(e,t));var n;try{n=new RegExp(r,i)}catch(e){throw new c(e)}return n},A.prototype._evaluateRegExpTest=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if(!(r instanceof RegExp&&"string"==typeof i))throw new c("RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+r+" and "+i+".");return r.test(i)},A.prototype._evaluateRegExpMatch=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if(r instanceof RegExp&&"string"==typeof i)return r.test(i);if(i instanceof RegExp&&"string"==typeof r)return i.test(r);throw new c('Operator "=~" requires one RegExp argument and one string argument. Arguments are '+r+" and "+i+".")},A.prototype._evaluateRegExpNotMatch=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if(r instanceof RegExp&&"string"==typeof i)return!r.test(i);if(i instanceof RegExp&&"string"==typeof r)return!i.test(r);throw new c('Operator "!~" requires one RegExp argument and one string argument. Arguments are '+r+" and "+i+".")},A.prototype._evaluateRegExpExec=function(e,t){var r=this._left.evaluate(e,t),i=this._right.evaluate(e,t);if(!(r instanceof RegExp&&"string"==typeof i))throw new c("RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+r+" and "+i+".");var n=r.exec(i);return o(n)?n[1]:null},A.prototype._evaluateToString=function(i,n){var o=this._left.evaluate(i,n);if(o instanceof RegExp||o instanceof e||o instanceof t||o instanceof r)return String(o);throw new c('Unexpected function call "'+this._value+'".')},A.prototype.getShaderExpression=function(e,t,r){var i,a,s,u,d=this._type,p=this._value;switch(o(this._left)&&(a=l(this._left)?J(this._left,e,t,this):this._left.getShaderExpression(e,t,this)),o(this._right)&&(s=this._right.getShaderExpression(e,t,this)),o(this._test)&&(u=this._test.getShaderExpression(e,t,this)),l(this._value)&&(p=J(this._value,e,t,this)),d){case h.VARIABLE:return e+p;case h.UNARY:if("Boolean"===p)return"bool("+a+")";if("Number"===p)return"float("+a+")";if("round"===p)return"floor("+a+" + 0.5)";if(o(se[p]))return p+"("+a+")";if("isNaN"===p||"isFinite"===p||"String"===p||"isExactClass"===p||"isClass"===p||"getExactClassName"===p)throw new c('Error generating style shader: "'+p+'" is not supported.');return o(se[p])?p+"("+a+")":p+a;case h.BINARY:return"%"===p?"mod("+a+", "+s+")":"==="===p?"("+a+" == "+s+")":"!=="===p?"("+a+" != "+s+")":"atan2"===p?"atan("+a+", "+s+")":o(le[p])?p+"("+a+", "+s+")":"("+a+" "+p+" "+s+")";case h.TERNARY:if(o(ue[p]))return p+"("+a+", "+s+", "+u+")";break;case h.CONDITIONAL:return"("+u+" ? "+a+" : "+s+")";case h.MEMBER:return"r"===s||"x"===s||"0.0"===s?a+"[0]":"g"===s||"y"===s||"1.0"===s?a+"[1]":"b"===s||"z"===s||"2.0"===s?a+"[2]":"a"===s||"w"===s||"3.0"===s?a+"[3]":a+"[int("+s+")]";case h.FUNCTION_CALL:throw new c('Error generating style shader: "'+p+'" is not supported.');case h.ARRAY:if(4===p.length)return"vec4("+p[0]+", "+p[1]+", "+p[2]+", "+p[3]+")";if(3===p.length)return"vec3("+p[0]+", "+p[1]+", "+p[2]+")";if(2===p.length)return"vec2("+p[0]+", "+p[1]+")";throw new c("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case h.REGEX:throw new c("Error generating style shader: Regular expressions are not supported.");case h.VARIABLE_IN_STRING:throw new c("Error generating style shader: Converting a variable to a string is not supported.");case h.LITERAL_NULL:throw new c("Error generating style shader: null is not supported.");case h.LITERAL_BOOLEAN:return p?"true":"false";case h.LITERAL_NUMBER:return Q(p);case h.LITERAL_STRING:if(o(r)&&r._type===h.MEMBER&&("r"===p||"g"===p||"b"===p||"a"===p||"x"===p||"y"===p||"z"===p||"w"===p))return p;if(i=n.fromCssColorString(p,ae),o(i))return Z(i);throw new c("Error generating style shader: String literals are not supported.");case h.LITERAL_COLOR:var f=a;if("color"===p){if(!o(f))return"vec4(1.0)";if(f.length>1){var m=f[0],g=f[1];return"1.0"!==g&&(t.translucent=!0),"vec4("+m+", "+g+")"}return"vec4("+f[0]+", 1.0)"}if("rgb"===p)return i=X(this),o(i)?K(i):"vec4("+f[0]+" / 255.0, "+f[1]+" / 255.0, "+f[2]+" / 255.0, 1.0)";if("rgba"===p)return"1.0"!==f[3]&&(t.translucent=!0),i=X(this),o(i)?K(i):"vec4("+f[0]+" / 255.0, "+f[1]+" / 255.0, "+f[2]+" / 255.0, "+f[3]+")";if("hsl"===p)return i=Y(this),o(i)?K(i):"vec4(czm_HSLToRGB(vec3("+f[0]+", "+f[1]+", "+f[2]+")), 1.0)";if("hsla"===p)return i=Y(this),o(i)?(1!==i.alpha&&(t.translucent=!0),K(i)):("1.0"!==f[3]&&(t.translucent=!0),"vec4(czm_HSLToRGB(vec3("+f[0]+", "+f[1]+", "+f[2]+")), "+f[3]+")");break;case h.LITERAL_VECTOR:for(var _=a.length,v=p+"(",y=0;y<_;++y)v+=a[y],y<_-1&&(v+=", ");return v+=")";case h.LITERAL_REGEX:throw new c("Error generating style shader: Regular expressions are not supported.");case h.LITERAL_UNDEFINED:throw new c("Error generating style shader: undefined is not supported.");case h.BUILTIN_VARIABLE:if("tiles3d_tileset_time"===p)return"u_tilesetTime"}},p}),define("Scene/Vector3DTilePrimitive",["../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Matrix4","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeVS","./BlendingState","./Cesium3DTileFeature","./ClassificationType","./DepthFunction","./Expression","./StencilFunction","./StencilOperation","./Vector3DTileBatch"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x){"use strict";function P(r){r=i(r,i.EMPTY_OBJECT),this._batchTable=r.batchTable,this._batchIds=r.batchIds,this._positions=r.positions,this._vertexBatchIds=r.vertexBatchIds,this._indices=r.indices,this._indexCounts=r.indexCounts,this._indexOffsets=r.indexOffsets,this._batchedIndices=r.batchedIndices,this._boundingVolume=r.boundingVolume,this._boundingVolumes=r.boundingVolumes,this._center=i(r.center,e.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilDepthPass=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=t.clone(t.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=i(r.classificationType,S.BOTH),this._vertexShaderSource=r._vertexShaderSource,this._fragmentShaderSource=r._fragmentShaderSource,this._attributeLocations=r._attributeLocations,this._pickVertexShaderSource=r._pickVertexShaderSource,this._pickFragmentShaderSource=r._pickFragmentShaderSource,this._uniformMap=r._uniformMap,this._pickUniformMap=r._pickUniformMap,this._modelMatrix=r._modelMatrix,this._boundingSphere=r._boundingSphere,this._batchIdLookUp={};for(var n=this._batchIds.length,o=0;o<n;++o){var a=this._batchIds[o];this._batchIdLookUp[a]=o}}function I(e,t){if(!n(e._va)){var i=c.createVertexBuffer({context:t,typedArray:e._positions,usage:d.STATIC_DRAW}),o=c.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:d.STATIC_DRAW}),a=c.createIndexBuffer({context:t,typedArray:e._indices,usage:d.DYNAMIC_DRAW,indexDatatype:2===e._indices.BYTES_PER_ELEMENT?s.UNSIGNED_SHORT:s.UNSIGNED_INT}),l=[{index:0,vertexBuffer:i,componentDatatype:r.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:o,componentDatatype:r.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new _({context:t,attributes:l,indexBuffer:a}),t.webgl2&&(e._vaSwap=new _({context:t,attributes:l,indexBuffer:c.createIndexBuffer({context:t,sizeInBytes:a.sizeInBytes,usage:d.DYNAMIC_DRAW,indexDatatype:a.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._verticesPromise=void 0}}function D(e,t){if(!n(e._sp)){var r=e._batchTable,o=i(e._attributeLocations,q),a=e._vertexShaderSource;if(n(a))return e._sp=m.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:e._fragmentShaderSource,attributeLocations:o}),e._spStencil=e._sp,void(e._spPick=m.fromCache({context:t,vertexShaderSource:e._pickVertexShaderSource,fragmentShaderSource:e._pickFragmentShaderSource,attributeLocations:o}));var s=r.getVertexShaderCallback(!1,"a_batchId",void 0)(y),l=r.getFragmentShaderCallback()(v,!1,void 0),u=new g({defines:["VECTOR_TILE"],sources:[s]}),c=new g({defines:["VECTOR_TILE"],sources:[l]});e._sp=m.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:c,attributeLocations:o}),u=new g({defines:["VECTOR_TILE"],sources:[y]}),c=new g({defines:["VECTOR_TILE"],sources:[v]}),e._spStencil=m.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:c,attributeLocations:o}),s=r.getPickVertexShaderCallbackIgnoreShow("a_batchId")(y),l=r.getPickFragmentShaderCallbackIgnoreShow()(v);var d=new g({defines:["VECTOR_TILE"],sources:[s]}),h=new g({defines:["VECTOR_TILE"],sources:[l]});e._spPick=m.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:h,attributeLocations:o})}}function O(e){n(e._rsStencilPreloadPass)||(e._rsStencilPreloadPass=f.fromCache(Y),e._rsStencilDepthPass=f.fromCache(X),e._rsColorPass=f.fromCache(Q),e._rsPickPass=f.fromCache(Z))}function M(e,t){if(!n(e._uniformMap)){var r={u_modifiedModelViewProjection:function(){var r=t.uniformState.view,i=t.uniformState.projection;return l.clone(r,K),l.multiplyByPoint(K,e._center,J),l.setTranslation(K,J,K),l.multiply(i,K,K),K},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(r),e._pickUniformMap=e._batchTable.getPickUniformMapCallback()(e._uniformMap)}}function R(e,t,r,i,n,o,a){for(var s=e.constructor.BYTES_PER_ELEMENT,l=o.length,u=0;u<l;++u){var c=o[u],d=a[c],h=i[d],p=n[d],f=new e.constructor(e.buffer,s*h,p);t.set(f,r),i[d]=r,r+=p}return r}function L(e,r){var i=e._indices,n=e._indexOffsets,o=e._indexCounts,a=e._batchIdLookUp,s=new i.constructor(i.length),l=r.pop(),u=[l],c=R(i,s,0,n,o,l.batchIds,a);for(l.offset=0,l.count=c;r.length>0;){var d=r.pop();if(t.equals(d.color,l.color))c=R(i,s,c,n,o,d.batchIds,a),l.batchIds=l.batchIds.concat(d.batchIds),l.count=c-l.offset;else{var h=c;c=R(i,s,c,n,o,d.batchIds,a),d.offset=h,d.count=c-h,u.push(d),l=d}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=u}function N(e,t,r,i,n,o,a){for(var s=e.bytesPerIndex,l=o.length,u=0;u<l;++u){var c=o[u],d=a[c],h=i[d],p=n[d];t.copyFromBuffer(e,h*s,r*s,p*s),i[d]=r,r+=p}return r}function k(e,r){var i=e._indexOffsets,n=e._indexCounts,o=e._batchIdLookUp,a=r.pop(),s=[a],l=e._va.indexBuffer,u=e._vaSwap.indexBuffer,c=N(l,u,0,i,n,a.batchIds,o);for(a.offset=0,a.count=c;r.length>0;){var d=r.pop();if(t.equals(d.color,a.color))c=N(l,u,c,i,n,d.batchIds,o),a.batchIds=a.batchIds.concat(d.batchIds),a.count=c-a.offset;else{var h=c;c=N(l,u,c,i,n,d.batchIds,o),d.offset=h,d.count=c-h,s.push(d),a=d}}var p=e._va;e._va=e._vaSwap,e._vaSwap=p,e._batchedIndices=s}function F(e,t){return t.color.toRgba()-e.color.toRgba()}function B(e,t){if(!e._batchDirty)return!1;for(var r=e._batchedIndices,i=r.length,o=!1,a={},s=0;s<i;++s){var l=r[s].color,u=l.toRgba();if(n(a[u])){o=!0;break}a[u]=!0}return o?o&&!e.forceRebatch&&e._framesSinceLastRebatch<120?void++e._framesSinceLastRebatch:(r.sort(F),t.webgl2?k(e,r):L(e,r),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0):(e._batchDirty=!1,!1)}function U(e,t){var r=B(e,t),o=e._commands,a=e._batchedIndices,s=a.length,u=3*s;if(!n(o)||r||o.length!==u){o.length=u;for(var c=e._va,d=e._sp,p=i(e._modelMatrix,l.IDENTITY),f=e._uniformMap,m=e._boundingVolume,g=0;g<s;++g){var _=a[g].offset,v=a[g].count,y=o[3*g];n(y)||(y=o[3*g]=new h({owner:e})),y.vertexArray=c,y.modelMatrix=p,y.offset=_,y.count=v,y.renderState=e._rsStencilPreloadPass,y.shaderProgram=d,y.uniformMap=f,y.boundingVolume=m,y.cull=!1;var b=o[3*g+1];n(b)||(b=o[3*g+1]=new h({owner:e})),b.vertexArray=c,b.modelMatrix=p,b.offset=_,b.count=v,b.renderState=e._rsStencilDepthPass,b.shaderProgram=d,b.uniformMap=f,b.boundingVolume=m,b.cull=!1;var C=o[3*g+2];n(C)||(C=o[3*g+2]=new h({owner:e})),C.vertexArray=c,C.modelMatrix=p,C.offset=_,C.count=v,C.renderState=e._rsColorPass,C.shaderProgram=d,C.uniformMap=f,C.boundingVolume=m,C.cull=!1}e._commandsDirty=!0}}function V(e,t){if(e.classificationType!==S.TERRAIN&&t.invertClassification&&(!n(e._commandsIgnoreShow)||e._commandsDirty)){for(var r=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,a=r.length,s=i.length=a/3*2,l=0,u=0;u<s;u+=2){var c=i[u]=h.shallowClone(r[l],i[u]);c.shaderProgram=o,c.pass=p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,c=i[u+1]=h.shallowClone(r[l+1],i[u+1]),c.shaderProgram=o,c.pass=p.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,l+=3}e._commandsDirty=!1}}function z(e){if(e._pickCommandsDirty){var t=e._indexOffsets.length,r=e._pickCommands;r.length=3*t;for(var o=e._va,a=e._spStencil,s=e._spPick,u=i(e._modelMatrix,l.IDENTITY),c=e._pickUniformMap,d=0;d<t;++d){var p=e._indexOffsets[d],f=e._indexCounts[d],m=n(e._boundingVolumes)?e._boundingVolumes[d]:e.boundingVolume,g=r[3*d];n(g)||(g=r[3*d]=new h({owner:e})),g.vertexArray=o,g.modelMatrix=u,g.offset=p,g.count=f,g.renderState=e._rsStencilPreloadPass,g.shaderProgram=a,g.uniformMap=c,g.boundingVolume=m;var _=r[3*d+1];n(_)||(_=r[3*d+1]=new h({owner:e})),_.vertexArray=o,_.modelMatrix=u,_.offset=p,_.count=f,_.renderState=e._rsStencilDepthPass,_.shaderProgram=a,_.uniformMap=c,_.boundingVolume=m;var v=r[3*d+2];n(v)||(v=r[3*d+2]=new h({owner:e})),v.vertexArray=o,v.modelMatrix=u,v.offset=p,v.count=f,v.renderState=e._rsPickPass,v.shaderProgram=s,v.uniformMap=c,v.boundingVolume=m}e._pickCommandsDirty=!1}}function G(e,r){e._updatingAllCommands=!0;var i,n=e._batchIds,o=n.length;for(i=0;i<o;++i){var a=n[i],s=r[a];s.show=!0,s.color=t.WHITE}var l=e._batchedIndices;for(o=l.length,i=0;i<o;++i)l[i].color=t.clone(t.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}function H(e,t,r,i){var o,a,s=e.commandList,l=r.length;for(o=0;o<l;++o)a=r[o],a.pass=t,s.push(a);if(e.invertClassification&&n(i))for(l=i.length,o=0;o<l;++o)a=i[o],a.pass=t,s.push(a)}function W(e,t){for(var r=e.commandList,i=t.length,n=0;n<i;n+=3){var o=t[n+2];o.pass=p.OPAQUE,r.push(o)}}function j(e){var t=e.debugWireframe===e._debugWireframe;if(!(t=t&&!(e.debugWireframe&&e._wireframeDirty))){n(e._rsWireframe)||(e._rsWireframe=f.fromCache({}));var r,i;e.debugWireframe?(r=e._rsWireframe,i=u.LINES):(r=e._rsColorPass,i=u.TRIANGLES);for(var o=e._commands,a=o.length,s=0;s<a;s+=3){var l=o[s+2];l.renderState=r,l.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}}o(P.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var q={position:0,a_batchId:1},Y={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:A.ALWAYS,frontOperation:{fail:E.KEEP,zFail:E.DECREMENT_WRAP,zPass:E.DECREMENT_WRAP},backFunction:A.ALWAYS,backOperation:{fail:E.KEEP,zFail:E.INCREMENT_WRAP,zPass:E.INCREMENT_WRAP},reference:0,mask:15},depthTest:{enabled:!1},depthMask:!1},X={colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:A.ALWAYS,frontOperation:{fail:E.KEEP,zFail:E.KEEP,zPass:E.INCREMENT_WRAP},backFunction:A.ALWAYS,backOperation:{fail:E.KEEP,zFail:E.KEEP,zPass:E.DECREMENT_WRAP},reference:0,mask:15},depthTest:{enabled:!0,func:T.LESS_OR_EQUAL},depthMask:!1},Q={stencilTest:{enabled:!0,frontFunction:A.NOT_EQUAL,frontOperation:{fail:E.KEEP,zFail:E.KEEP,zPass:E.DECREMENT_WRAP},backFunction:A.NOT_EQUAL,backOperation:{fail:E.KEEP,zFail:E.KEEP,zPass:E.DECREMENT_WRAP},reference:0,mask:15},depthTest:{enabled:!1},depthMask:!1,blending:b.ALPHA_BLEND},Z={stencilTest:{enabled:!0,frontFunction:A.NOT_EQUAL,frontOperation:{fail:E.KEEP,zFail:E.KEEP,zPass:E.DECREMENT_WRAP},backFunction:A.NOT_EQUAL,backOperation:{fail:E.KEEP,zFail:E.KEEP,zPass:E.DECREMENT_WRAP},reference:0,mask:15},depthTest:{enabled:!1},depthMask:!1},K=new l,J=new e;P.prototype.createFeatures=function(e,t){for(var r=this._batchIds,i=r.length,n=0;n<i;++n){var o=r[n];t[o]=new C(e,o)}},P.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var $=new t,ee=t.WHITE,te=/\$/;return P.prototype.applyStyle=function(e,r,i){if(!n(r))return void G(this,i);var o=r.color,a=o instanceof w&&!te.test(o.expression);this._updatingAllCommands=a;var s,l=this._batchIds,u=l.length;for(s=0;s<u;++s){var c=l[s],d=i[c];d.color=n(r.color)?r.color.evaluateColor(e,d,$):ee,d.show=!n(r.show)||r.show.evaluate(e,d)}if(a){var h=this._batchedIndices;for(u=h.length,s=0;s<u;++s)h[s].color=t.clone(t.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}},P.prototype.updateCommands=function(e,r){if(!this._updatingAllCommands){var i=this._batchIdLookUp,o=i[e];if(n(o)){var a,s=this._indexOffsets,l=this._indexCounts,u=s[o],c=l[o],d=this._batchedIndices,h=d.length;for(a=0;a<h;++a){var p=d[a].offset,f=d[a].count;if(u>=p&&u<p+f)break}d.push(new x({color:t.clone(r),offset:u,count:c,batchIds:[e]}));for(var m=[],g=[],_=d[a].batchIds,v=_.length,y=0;y<v;++y){var b=_[y];if(b!==e){s[i[b]]<u?m.push(b):g.push(b)}}0!==g.length&&d.push(new x({color:t.clone(d[a].color),offset:u+c,count:d[a].offset+d[a].count-(u+c),batchIds:g})),0!==m.length?(d[a].count=u-d[a].offset,d[a].batchIds=m):d.splice(a,1),this._batchDirty=!0}}},P.prototype.update=function(e){var t=e.context;I(this,t),D(this,t),O(this),M(this,t);var r;switch(this.classificationType){case S.TERRAIN:r=p.TERRAIN_CLASSIFICATION;break;case S.CESIUM_3D_TILE:r=p.CESIUM_3D_TILE_CLASSIFICATION;break;default:r=p.CLASSIFICATION}var i=e.passes;i.render&&(U(this,t),V(this,e),j(this),this._debugWireframe?W(e,this._commands):H(e,r,this._commands,this._commandsIgnoreShow)),i.pick&&(z(this),H(e,r,this._pickCommands))},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),a(this)},P}),define("Scene/ClassificationModel",["../Core/arraySlice","../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/IndexDatatype","../Core/Matrix4","../Core/PrimitiveType","../Core/Quaternion","../Core/Resource","../Core/RuntimeError","../Core/Transforms","../Core/WebGLConstants","../ThirdParty/GltfPipeline/ForEach","../ThirdParty/GltfPipeline/getAccessorByteStride","../ThirdParty/GltfPipeline/numberOfComponentsForType","../ThirdParty/GltfPipeline/parseBinaryGltf","../ThirdParty/when","./Axis","./ClassificationType","./ModelLoadResources","./ModelUtility","./SceneMode","./Vector3DTileBatch","./Vector3DTilePrimitive"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R){"use strict";function L(e){e=l(e,l.EMPTY_OBJECT);var r=e.gltf;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),!(r instanceof Uint8Array))throw new y("Only binary glTF is supported as a classifier.");r=A(r);var i=r.nodes,n=r.meshes,o=i[0],a=o.mesh;if(1!==i.length||!u(a))throw new y("Only one node is supported for classification and it must have a mesh.");if(1!==n.length)throw new y("Only one mesh is supported when using b3dm for classification.");var s=n[0].primitives;if(1!==s.length)throw new y("Only one primitive per mesh is supported when using b3dm for classification.");var c=s[0].attributes.POSITION;if(!u(c))throw new y("The mesh must have a position attribute.");var d=s[0].attributes._BATCHID;if(!u(d))throw new y("The mesh must have a batch id attribute.");this._gltf=r;var h=l(e.basePath,"");this._resource=v.createIfNeeded(h),this.show=l(e.show,!0),this.modelMatrix=m.clone(l(e.modelMatrix,m.IDENTITY)),this._modelMatrix=m.clone(this.modelMatrix),this._ready=!1,this._readyPromise=E.defer(),this.debugShowBoundingVolume=l(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=l(e.debugWireframe,!1),this._debugWireframe=!1,this._classificationType=e.classificationType,this._vertexShaderLoaded=e.vertexShaderLoaded,this._classificationShaderLoaded=e.classificationShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._pickVertexShaderLoaded=e.pickVertexShaderLoaded,this._pickFragmentShaderLoaded=e.pickFragmentShaderLoaded,this._pickUniformMapLoaded=e.pickUniformMapLoaded,this._ignoreCommands=l(e.ignoreCommands,!1),this._upAxis=l(e.upAxis,x.Y),this._batchTable=e.batchTable,this._computedModelMatrix=new m,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new t,this._state=ie.NEEDS_LOAD,this._loadResources=void 0,this._mode=void 0,this._dirty=!1,this._nodeMatrix=new m,this._primitive=void 0,this._extensionsUsed=void 0,this._extensionsRequired=void 0,this._quantizedUniforms=void 0,this._buffers={},this._vertexArray=void 0,this._shaderProgram=void 0,this._pickShaderProgram=void 0,this._uniformMap=void 0,this._geometryByteLength=0,this._trianglesLength=0,this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}function N(e){var i=e.gltf,n=i.nodes,o=i.meshes,a=new r(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new r(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),l=n[0],c=l.mesh,d=D.getTransform(l),h=o[c],p=h.primitives[0],f=p.attributes.POSITION,g=D.getAccessorMinMax(i,f),_=r.fromArray(g.min,0,ne),v=r.fromArray(g.max,0,oe);u(a)&&u(s)&&(m.multiplyByPoint(d,_,_),
m.multiplyByPoint(d,v,v),r.minimumByComponent(a,_,a),r.maximumByComponent(s,v,s));var y=t.fromCornerPoints(a,s);return e._upAxis===x.Y?t.transformWithoutScale(y,x.Y_UP_TO_Z_UP,y):e._upAxis===x.X&&t.transformWithoutScale(y,x.X_UP_TO_Z_UP,y),y}function k(e,t,r){return function(){e._state=ie.FAILED,e._readyPromise.reject(new y("Failed to load "+t+": "+r))}}function F(e){var t=e.gltf,r=e._loadResources;S.buffer(t,function(e,t){r.buffers[t]=e.extras._pipeline.source})}function B(e,t){return function(r){var i=e._loadResources,n=new Uint8Array(r);--i.pendingBufferLoads,e.gltf.buffers[t].extras._pipeline.source=n}}function U(e){for(var t=e._loadResources,r=e.gltf.buffers,i=r.length,n=0;n<i;++n){var o=r[n];if(o.extras=l(o.extras,{}),o.extras._pipeline=l(o.extras._pipeline,{}),u(o.extras._pipeline.source))t.buffers[n]=o.extras._pipeline.source;else{var a=e._resource.getDerivedResource({url:o.uri});++t.pendingBufferLoads,a.fetchArrayBuffer().then(B(e,n)).otherwise(k(e,"buffer",a.uri))}}}function V(e){var t=e.gltf.bufferViews,r=e._loadResources.vertexBuffersToCreate;S.bufferView(e.gltf,function(e,t){e.target===C.ARRAY_BUFFER&&r.enqueue(t)});var i=e._loadResources.indexBuffersToCreate,n={};S.accessor(e.gltf,function(e){var r=e.bufferView;t[r].target!==C.ELEMENT_ARRAY_BUFFER||u(n[r])||(n[r]=!0,i.enqueue({id:r,componentType:e.componentType}))})}function z(e,t){var r=t._loadResources,i=t.gltf.bufferViews,n=i[e],o=r.getBuffer(n);t._buffers[e]=o,t._geometryByteLength+=o.byteLength}function G(e,t,r){var i=r._loadResources,n=r.gltf.bufferViews,o=n[e],a={typedArray:i.getBuffer(o),indexDatatype:t};r._buffers[e]=a,r._geometryByteLength+=a.typedArray.byteLength}function H(e){var t=e._loadResources;if(0===t.pendingBufferLoads){for(var r=t.vertexBuffersToCreate,i=t.indexBuffersToCreate;r.length>0;)z(r.dequeue(),e);for(;i.length>0;){var n=i.dequeue();G(n.id,n.componentType,e)}}}function W(e,t){var r=t.gltf.meshes[0].primitives[0],i=D.modifyShaderForQuantizedAttributes(t.gltf,r,e);return t._quantizedUniforms=i.uniforms,i.shader}function j(e,t){return u(t)&&(e=t(e)),e}function q(e){var t=D.getAttributeOrUniformBySemantic(e.gltf,"POSITION"),r=D.getAttributeOrUniformBySemantic(e.gltf,"_BATCHID"),i={};i[t]=0,i[r]=1;var n,o,a=D.getAttributeOrUniformBySemantic(e.gltf,"MODELVIEWPROJECTION");if(u(a))n="uniform mat4 "+a+";\n",o="    vec4 positionInClipCoords = "+a+" * vec4("+t+", 1.0);\n";else{var s=D.getAttributeOrUniformBySemantic(e.gltf,"PROJECTION"),l=D.getAttributeOrUniformBySemantic(e.gltf,"MODELVIEW");u(l)||(l=D.getAttributeOrUniformBySemantic(e.gltf,"CESIUM_RTC_MODELVIEW")),n="uniform mat4 "+l+";\nuniform mat4 "+s+";\n",o="    vec4 positionInClipCoords = "+s+" * "+l+" * vec4("+t+", 1.0);\n"}var c="attribute vec3 "+t+";\nattribute float "+r+";\n"+n+"void main() {\n"+o+"    gl_Position = czm_depthClampFarPlane(positionInClipCoords);\n}\n",d="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvoid main() \n{ \n    gl_FragColor = vec4(1.0); \n    czm_writeDepthClampedToFarPlane();\n}\n";e.extensionsUsed.WEB3D_quantized_attributes&&(c=W(c,e));var h=j(c,e._vertexShaderLoaded),p=j(d,e._classificationShaderLoaded);e._shaderProgram={vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i};var f=j(c,e._pickVertexShaderLoaded),m=j(d,e._pickFragmentShaderLoaded);e._pickShaderProgram={vertexShaderSource:f,fragmentShaderSource:m,attributeLocations:i}}function Y(){return{POSITION:0,_BATCHID:1}}function X(e){if(e._loadResources.finishedBuffersCreation()&&!u(e._vertexArray)){var t=e._buffers,r=e.gltf,i=r.accessors,n=r.meshes,o=n[0].primitives,a=o[0],s=Y(),l={},c=a.attributes;for(var d in c)if(c.hasOwnProperty(d)){var h=s[d];if(u(h)){var p=i[c[d]];l[d]={index:h,vertexBuffer:t[p.bufferView],componentsPerAttribute:w(p.type),componentDatatype:p.componentType,offsetInBytes:p.byteOffset,strideInBytes:T(r,p)}}}var f;u(a.indices)&&(f=t[i[a.indices].bufferView]),e._vertexArray={attributes:l,indexBuffer:f}}}function Q(e,t){if(!u(e._uniformMap)){var r=e.gltf.techniques,i=r[0],n=i.parameters,o=i.uniforms,a={};for(var s in o)if(o.hasOwnProperty(s)&&"extras"!==s){var l=o[s],c=n[l];if(!u(c.semantic)||!u(ae[c.semantic]))continue;a[s]=ae[c.semantic](t.uniformState,e)}e._uniformMap=a}}function Z(e,t){return D.createUniformsForQuantizedAttributes(e.gltf,t,e._quantizedUniforms)}function K(e,t){switch(e.mode){case g.TRIANGLES:return t/3;case g.TRIANGLE_STRIP:case g.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function J(i){var n,l,c=i._batchTable,d=i._uniformMap,h=i._vertexArray,p=i.gltf,g=p.accessors,_=p.meshes,v=_[0].primitives[0],y=g[v.indices],b=v.attributes.POSITION,C=D.getAccessorMinMax(p,b),S=t.fromCornerPoints(r.fromArray(C.min),r.fromArray(C.max));if(u(y))l=y.count,n=y.byteOffset/f.getSizeInBytes(y.componentType);else{l=g[v.attributes.POSITION].count,n=0}if(i._trianglesLength+=K(v,l),u(i._uniformMapLoaded)&&(d=i._uniformMapLoaded(d)),i.extensionsUsed.WEB3D_quantized_attributes){var T=Z(i,v);d=a(d,T)}var w=h.attributes.POSITION,A=w.componentDatatype,E=w.vertexBuffer,x=E.byteOffset,P=E.byteLength/s.getSizeInBytes(A),I=s.createArrayBufferView(A,E.buffer,x,P);w=h.attributes._BATCHID,A=w.componentDatatype,E=w.vertexBuffer,x=E.byteOffset,P=E.byteLength/s.getSizeInBytes(A);var O,L=s.createArrayBufferView(A,E.buffer,x,P),N=h.indexBuffer.typedArray;O=h.indexBuffer.indexDatatype===f.UNSIGNED_SHORT?new Uint16Array(N.buffer,N.byteOffset,N.byteLength/Uint16Array.BYTES_PER_ELEMENT):new Uint32Array(N.buffer,N.byteOffset,N.byteLength/Uint32Array.BYTES_PER_ELEMENT),I=e(I),L=e(L),O=e(O,n,n+l);var k=[],F=[],B=[],U=[],V=L[O[0]];k.push(V),B.push(0);for(var z,G,H,W=O.length,j=1;j<W;++j)(z=L[O[j]])!==V&&(G=B[B.length-1],H=j-G,k.push(z),F.push(H),B.push(j),U.push(new M({offset:G,count:H,batchIds:[V],color:o.WHITE})),V=z);G=B[B.length-1],H=W-G,F.push(H),U.push(new M({offset:G,count:H,batchIds:[V],color:o.WHITE}));var q,Y=i._shaderProgram,X=Y.vertexShaderSource,Q=Y.fragmentShaderSource,J=Y.attributeLocations,$=i._pickShaderProgram,ee=$.vertexShaderSource,te=$.fragmentShaderSource;q=u(i._pickUniformMapLoaded)?i._pickUniformMapLoaded(d):a(d),i._primitive=new R({classificationType:i._classificationType,positions:I,indices:O,indexOffsets:B,indexCounts:F,batchIds:k,vertexBatchIds:L,batchedIndices:U,batchTable:c,boundingVolume:new t,_vertexShaderSource:X,_fragmentShaderSource:Q,_attributeLocations:J,_pickVertexShaderSource:ee,_pickFragmentShaderSource:te,_uniformMap:d,_pickUniformMap:q,_modelMatrix:new m,_boundingSphere:S}),i._buffers=void 0,i._vertexArray=void 0,i._shaderProgram=void 0,i._pickShaderProgram=void 0,i._uniformMap=void 0}function $(e){if(e._loadResources.finished()&&!u(e._primitive)){var t=e.gltf,r=t.nodes,i=r[0];e._nodeMatrix=D.getTransform(i,e._nodeMatrix),J(e)}}function ee(e,t){var r=t.context;D.checkSupportedGlExtensions(e.gltf.glExtensionsUsed,r),H(e),q(e),X(e),Q(e,r),$(e)}function te(e,n,o,a){var s=e._computedModelMatrix;if(e._mode!==O.SCENE3D&&!e._ignoreCommands){var l=m.getColumn(s,3,se);if(i.equals(l,i.UNIT_W)){var c=e.boundingSphere.center,d=b.wgs84To2DModelMatrix(a,c,le);s=m.multiply(d,s,le),u(e._rtcCenter)&&(m.setTranslation(s,i.UNIT_W,s),e._rtcCenter=e._rtcCenter2D)}else s=b.basisTo2D(a,s,le),e._rtcCenter=e._rtcCenter3D}var h=e._primitive;(n||o)&&(m.multiplyTransformation(s,e._nodeMatrix,h._modelMatrix),t.transform(h._boundingSphere,h._modelMatrix,h._boundingVolume),u(e._rtcCenter)&&r.add(e._rtcCenter,h._boundingVolume.center,h._boundingVolume.center))}if(!p.supportsTypedArrays())return{};var re=new r,ie={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};c(L.prototype,{gltf:{get:function(){return this._gltf}},basePath:{get:function(){return this._resource.url}},boundingSphere:{get:function(){var e=this.modelMatrix,t=m.getScale(e,re),i=this._scaledBoundingSphere;return i.center=r.multiplyComponents(this._boundingSphere.center,t,i.center),i.radius=r.maximumComponent(t)*this._initialRadius,u(this._rtcCenter)&&r.add(this._rtcCenter,i.center,i.center),i}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},dirty:{get:function(){return this._dirty}},extensionsUsed:{get:function(){return u(this._extensionsUsed)||(this._extensionsUsed=D.getUsedExtensions(this.gltf)),this._extensionsUsed}},extensionsRequired:{get:function(){return u(this._extensionsRequired)||(this._extensionsRequired=D.getRequiredExtensions(this.gltf)),this._extensionsRequired}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return 0}},classificationType:{get:function(){return this._classificationType}}});var ne=new r,oe=new r,ae={PROJECTION:function(e,t){return D.getGltfSemanticUniforms().PROJECTION(e,t)},MODELVIEW:function(e,t){return D.getGltfSemanticUniforms().MODELVIEW(e,t)},CESIUM_RTC_MODELVIEW:function(e,t){return D.getGltfSemanticUniforms().CESIUM_RTC_MODELVIEW(e,t)},MODELVIEWPROJECTION:function(e,t){return D.getGltfSemanticUniforms().MODELVIEWPROJECTION(e,t)}},se=new i,le=new m;return L.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},L.prototype.update=function(e){if(e.mode!==O.MORPHING){if(this._state===ie.NEEDS_LOAD&&u(this.gltf)&&(this._state=ie.LOADING,this._state!==ie.FAILED)){var t=this.gltf.extensions;if(u(t)&&u(t.CESIUM_RTC)){var i=r.fromArray(t.CESIUM_RTC.center);if(!r.equals(i,r.ZERO)){this._rtcCenter3D=i;var n=e.mapProjection,o=n.ellipsoid,a=o.cartesianToCartographic(this._rtcCenter3D),s=n.project(a);r.fromElements(s.z,s.x,s.y,s),this._rtcCenter2D=s,this._rtcCenterEye=new r,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new I,U(this)}var l=this._loadResources,c=!1;this._state===ie.LOADING&&(0===l.pendingBufferLoads&&(D.checkSupportedExtensions(this.extensionsRequired),F(this),V(this),this._boundingSphere=N(this),this._initialRadius=this._boundingSphere.radius,ee(this,e)),l.finished()&&(this._state=ie.LOADED,c=!0)),u(l)&&this._state===ie.LOADED&&(c||ee(this,e),l.finished()&&(this._loadResources=void 0));var d=this.show;if(d&&this._state===ie.LOADED||c){this._dirty=!1;var h=this.modelMatrix,p=e.mode!==this._mode;this._mode=e.mode;var f=!m.equals(this._modelMatrix,h)||p;if(f||c){m.clone(h,this._modelMatrix);var g=this._computedModelMatrix;m.clone(h,g),this._upAxis===x.Y?m.multiplyTransformation(g,x.Y_UP_TO_Z_UP,g):this._upAxis===x.X&&m.multiplyTransformation(g,x.X_UP_TO_Z_UP,g)}(f||c)&&(te(this,f,c,e.mapProjection),this._dirty=!0)}if(c){var _=this;return void e.afterRender.push(function(){_._ready=!0,_._readyPromise.resolve(_)})}d&&!this._ignoreCommands&&(this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.debugWireframe=this.debugWireframe,this._primitive.update(e))}},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),d(this)},L}),define("Scene/Batched3DModel3DTileContent",["../Core/ClippingPlaneCollection","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/getBaseUri","../Core/getStringFromTypedArray","../Core/RequestType","../Core/RuntimeError","../Renderer/Pass","./Cesium3DTileBatchTable","./Cesium3DTileFeature","./Cesium3DTileFeatureTable","./ClassificationModel","./Model","./ModelUtility"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y){"use strict";function b(e,t,r,i,n){this._tileset=e,this._tile=t,this._resource=r,this._model=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,x(this,i,n)}function C(e){var t=y.getAttributeOrUniformBySemantic(e,"_BATCHID");return i(t)||(t=y.getAttributeOrUniformBySemantic(e,"BATCHID"),i(t)&&b._deprecationWarning("b3dm-legacy-batchid","The glTF in this b3dm uses the semantic `BATCHID`. Application-specific semantics should be prefixed with an underscore: `_BATCHID`.")),t}function S(e){return function(t,r){var n=e._batchTable,o=e._model.gltf,a=!i(e._tileset.classificationType),s=C(o),l=y.getDiffuseAttributeOrUniform(o,r),u=n.getVertexShaderCallback(a,s,l);return i(u)?u(t):t}}function T(e){return function(t){var r=e._batchTable,n=e._model.gltf,o=C(n),a=r.getPickVertexShaderCallback(o);return i(a)?a(t):t}}function w(e){return function(t,r){var n=e._batchTable,o=e._model.gltf,a=!i(e._tileset.classificationType),s=y.getDiffuseAttributeOrUniform(o,r),l=n.getFragmentShaderCallback(a,s);return i(l)?l(t):t}}function A(e){return function(t){var r=e._batchTable,n=r.getClassificationFragmentShaderCallback();return i(n)?n(t):t}}function E(e){return function(t,r){e._model.updateCommands(t,r)}}function x(t,n,o){var a=t._tileset,s=t._tile,l=t._resource,u=r(o,0);o=u;var m=new Uint8Array(n),y=new DataView(n);o+=I;var C=y.getUint32(o,!0);if(1!==C)throw new h("Only Batched 3D Model version 1 is supported.  Version "+C+" is not.");o+=I;var x=y.getUint32(o,!0);o+=I;var P=y.getUint32(o,!0);o+=I;var D=y.getUint32(o,!0);o+=I;var O=y.getUint32(o,!0);o+=I;var M=y.getUint32(o,!0);o+=I;var R;O>=570425344?(o-=2*I,R=P,O=D,M=0,P=0,D=0,b._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Batched3DModel/README.md.")):M>=570425344&&(o-=I,R=O,O=P,M=D,P=0,D=0,b._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Batched3DModel/README.md."));var L;if(0===P)L={BATCH_LENGTH:r(R,0)};else{var N=c(m,o,P);L=JSON.parse(N),o+=P}var k=new Uint8Array(n,o,D);o+=D;var F=new g(L,k);R=F.getGlobalProperty("BATCH_LENGTH"),F.featuresLength=R;var B,U;if(O>0){var V=c(m,o,O);B=JSON.parse(V),o+=O,M>0&&(U=new Uint8Array(n,o,M),U=new Uint8Array(U),o+=M)}var z;i(a.classificationType)&&(z=E(t));var G=new f(t,R,B,U,z);t._batchTable=G;var H=u+x-o;if(0===H)throw new h("glTF byte length must be greater than 0.");var W;o%4==0?W=new Uint8Array(n,o,H):(b._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),W=new Uint8Array(m.subarray(o,o+H)));var j={content:t,primitive:a};if(i(a.classificationType))t._model=new _({gltf:W,cull:!1,basePath:l,requestType:d.TILES3D,modelMatrix:s.computedTransform,upAxis:a._gltfUpAxis,debugWireframe:a.debugWireframe,vertexShaderLoaded:S(t),classificationShaderLoaded:A(t),uniformMapLoaded:G.getUniformMapCallback(),pickVertexShaderLoaded:T(t),pickFragmentShaderLoaded:G.getPickFragmentShaderCallback(),pickUniformMapLoaded:G.getPickUniformMapCallback(),classificationType:a._classificationType,batchTable:G});else{var q;q=i(a.clippingPlanes)?a.clippingPlanes.clone():new e({enabled:!1}),t._model=new v({gltf:W,cull:!1,releaseGltfJson:!0,opaquePass:p.CESIUM_3D_TILE,basePath:l,requestType:d.TILES3D,modelMatrix:s.computedTransform,upAxis:a._gltfUpAxis,shadows:a.shadows,debugWireframe:a.debugWireframe,incrementallyLoadTextures:!1,vertexShaderLoaded:S(t),fragmentShaderLoaded:w(t),uniformMapLoaded:G.getUniformMapCallback(),pickVertexShaderLoaded:T(t),pickFragmentShaderLoaded:G.getPickFragmentShaderCallback(),pickUniformMapLoaded:G.getPickUniformMapCallback(),addBatchIdToGeneratedShaders:R>0,pickObject:j,clippingPlanes:q})}}function P(e){var t=e.featuresLength;if(!i(e._features)&&t>0){for(var r=new Array(t),n=0;n<t;++n)r[n]=new m(e,n);e._features=r}}if(!l.supportsTypedArrays())return{};b._deprecationWarning=o,n(b.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return this._model.trianglesLength}},geometryByteLength:{get:function(){return this._model.geometryByteLength}},texturesByteLength:{get:function(){return this._model.texturesByteLength}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._model.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var I=Uint32Array.BYTES_PER_ELEMENT;return b.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},b.prototype.getFeature=function(e){return P(this),this._features[e]},b.prototype.applyDebugSettings=function(e,r){r=e?r:t.WHITE,0===this.featuresLength?this._model.color=r:this._batchTable.setAllColor(r)},b.prototype.applyStyle=function(e,t){this._batchTable.applyStyle(e,t)},b.prototype.update=function(e,t){var r=t.commandList.length;this._batchTable.update(e,t),this._model.modelMatrix=this._tile.computedTransform,this._model.shadows=this._tileset.shadows,this._model.debugWireframe=this._tileset.debugWireframe;var n=this._tileset.clippingPlanes,o=this._model.clippingPlanes;if(i(n)?(n.clone(o),o.enabled=n.enabled&&this._tile._isClipped):i(o)&&o.enabled&&(o.enabled=!1),this._model.update(t),r<t.commandList.length&&t.passes.render&&!i(e.classificationType)){var a=this._tile._finalResolution;this._batchTable.addDerivedCommands(t,r,a)}},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),a(this)},b}),define("Scene/BingMapsStyle",["../Core/freezeObject"],function(e){"use strict";return e({AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",ROAD:"Road",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"})}),define("Scene/BingMapsImageryProvider",["../Core/BingMapsApi","../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../Core/Resource","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v){"use strict";function y(o){function s(e){if(1!==e.resourceSets.length)return void v();var i=e.resourceSets[0].resources[0];w._tileWidth=i.imageWidth,w._tileHeight=i.imageHeight,w._maximumLevel=i.zoomMax-1,w._imageUrlSubdomains=i.imageUrlSubdomains,w._imageUrlTemplate=i.imageUrl;var o=w._tileProtocol;if(!n(o)){var a=document.location.protocol;o=/^http/.test(a)?a:"http:"}w._imageUrlTemplate=w._imageUrlTemplate.replace(/^http:/,o),n(w._tileDiscardPolicy)||(w._tileDiscardPolicy=new _({missingImageUrl:b(w,0,0,w._maximumLevel).url,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=w._attributionList=i.imageryProviders;s||(s=w._attributionList=[]);for(var l=0,d=s.length;l<d;++l){var h=s[l];h.credit=new r({text:h.attribution});for(var f=h.coverageAreas,m=0,g=h.coverageAreas.length;m<g;++m){var y=f[m],C=y.bbox;y.bbox=new c(u.toRadians(C[1]),u.toRadians(C[0]),u.toRadians(C[3]),u.toRadians(C[2]))}}w._ready=!0,w._readyPromise.resolve(!0),p.handleSuccess(S)}function v(e){var t="An error occurred while accessing "+T.url+".";S=p.handleError(S,w,w._errorEvent,t,void 0,void 0,void 0,C),w._readyPromise.reject(new h(t))}function C(){var e=T.fetchJsonp("jsonp");m(e,s,v)}o=i(o,{}),n(o.proxy)&&a("BingMapsImageryProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there."),this._key=e.getKey(o.key),this._keyErrorCredit=e.getErrorCredit(o.key),this._resource=d.createIfNeeded(o.url,{proxy:o.proxy}),this._tileProtocol=o.tileProtocol,this._mapStyle=i(o.mapStyle,g.AERIAL),this._culture=i(o.culture,""),this._tileDiscardPolicy=o.tileDiscardPolicy,this._proxy=o.proxy,this._credit=new r({text:"Bing Imagery",imageUrl:y._logoData,link:"http://www.bing.com"}),this.defaultGamma=1,this._tilingScheme=new f({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 l,this._ready=!1,this._readyPromise=m.defer();var S,T=this._resource.getDerivedResource({url:"/REST/v1/Imagery/Metadata/"+this._mapStyle,queryParameters:{incl:"ImageryProviders",key:this._key}}),w=this;C()}function b(e,t,r,i,n){var o=e._imageUrlTemplate,a=e._imageUrlSubdomains,s=(t+r+i)%a.length;return e._resource.getDerivedResource({url:o,request:n,templateValues:{quadkey:y.tileXYToQuadKey(t,r,i),subdomain:a[s],culture:e._culture}})}function C(e,t,r){++t;for(var i=[],o=0,a=e.length;o<a;++o){for(var s=e[o],l=s.coverageAreas,u=!1,d=0,h=s.coverageAreas.length;!u&&d<h;++d){var p=l[d];if(t>=p.zoomMin&&t<=p.zoomMax){var f=c.intersection(r,p.bbox,T);n(f)&&(u=!0)}}u&&i.push(s.credit)}return i}o(y.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.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 S=new c;y.prototype.getTileCredits=function(e,t,r){var i=this._tilingScheme.tileXYToRectangle(e,t,r,S),o=C(this._attributionList,r,i);return n(this._keyErrorCredit)&&o.push(this._keyErrorCredit),o},y.prototype.requestImage=function(e,t,r,i){return v.loadImage(this,b(this,e,t,r,i))},y.prototype.pickFeatures=function(e,t,r,i,n){},y._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==",y.tileXYToQuadKey=function(e,t,r){for(var i="",n=r;n>=0;--n){var o=1<<n,a=0;0!=(e&o)&&(a|=1),0!=(t&o)&&(a|=2),i+=a}return i},y.quadKeyToTileXY=function(e){for(var t=0,r=0,i=e.length-1,n=i;n>=0;--n){var o=1<<n,a=+e[i-n];0!=(1&a)&&(t|=o),0!=(2&a)&&(r|=o)}return{x:t,y:r,level:i}};var T=new c;return y}),define("Scene/BoxEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,r,i,n){"use strict";function o(t){t=r(t,a),this._dimensions=e.clone(t)}var a=new e(1,1,1);i(o.prototype,{dimensions:{get:function(){return this._dimensions},set:function(t){e.clone(t,this._dimensions)}}});var s=new e;return o.prototype.emit=function(t){var r=this._dimensions,i=e.multiplyByScalar(r,.5,s),o=n.randomBetween(-i.x,i.x),a=n.randomBetween(-i.y,i.y),l=n.randomBetween(-i.z,i.z);t.position=e.fromElements(o,a,l,t.position),t.velocity=e.normalize(t.position,t.velocity)},o}),define("Shaders/BrdfLutGeneratorFS",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nconst float M_PI = 3.141592653589793;\nfloat vdcRadicalInverse(int i)\n{\nfloat r;\nfloat base = 2.0;\nfloat value = 0.0;\nfloat invBase = 1.0 / base;\nfloat invBi = invBase;\nfor (int x = 0; x < 100; x++)\n{\nif (i <= 0)\n{\nbreak;\n}\nr = mod(float(i), base);\nvalue += r * invBi;\ninvBi *= invBase;\ni = int(float(i) * invBase);\n}\nreturn value;\n}\nvec2 hammersley2D(int i, int N)\n{\nreturn vec2(float(i) / float(N), vdcRadicalInverse(i));\n}\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\n{\nfloat a = roughness * roughness;\nfloat phi = 2.0 * M_PI * xi.x;\nfloat cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\nfloat sinTheta = sqrt(1.0 - cosTheta * cosTheta);\nvec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\nvec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\nvec3 tangentX = normalize(cross(upVector, N));\nvec3 tangentY = cross(N, tangentX);\nreturn tangentX * H.x + tangentY * H.y + N * H.z;\n}\nfloat G1_Smith(float NdotV, float k)\n{\nreturn NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat G_Smith(float roughness, float NdotV, float NdotL)\n{\nfloat k = roughness * roughness / 2.0;\nreturn G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\n}\nvec2 integrateBrdf(float roughness, float NdotV)\n{\nvec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\nfloat A = 0.0;\nfloat B = 0.0;\nconst int NumSamples = 1024;\nfor (int i = 0; i < NumSamples; i++)\n{\nvec2 xi = hammersley2D(i, NumSamples);\nvec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\nvec3 L = 2.0 * dot(V, H) * H - V;\nfloat NdotL = clamp(L.z, 0.0, 1.0);\nfloat NdotH = clamp(H.z, 0.0, 1.0);\nfloat VdotH = clamp(dot(V, H), 0.0, 1.0);\nif (NdotL > 0.0)\n{\nfloat G = G_Smith(roughness, NdotV, NdotL);\nfloat G_Vis = G * VdotH / (NdotH * NdotV);\nfloat Fc = pow(1.0 - VdotH, 5.0);\nA += (1.0 - Fc) * G_Vis;\nB += Fc * G_Vis;\n}\n}\nreturn vec2(A, B) / float(NumSamples);\n}\nvoid main()\n{\ngl_FragColor = vec4(integrateBrdf(1.0 - v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\n}\n"}),define("Scene/BrdfLutGenerator",["../Core/BoundingRectangle","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/BrdfLutGeneratorFS"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(){this._framebuffer=void 0,this._colorTexture=void 0,this._drawCommand=void 0}function m(t,r){var i=t._framebuffer,n=r.createViewportQuadCommand(p,{framebuffer:i,renderState:s.fromCache({viewport:new e(0,0,256,256)})});t._drawCommand=n}function g(e,t){var r=new u({context:t,width:256,height:256,pixelFormat:n.RGBA,pixelDatatype:a.UNSIGNED_BYTE,sampler:new l({wrapS:h.CLAMP_TO_EDGE,wrapT:h.CLAMP_TO_EDGE,minificationFilter:d.NEAREST,magnificationFilter:c.NEAREST})});e._colorTexture=r;var i=new o({context:t,colorTextures:[r],destroyAttachments:!1});e._framebuffer=i}return r(f.prototype,{colorTexture:{get:function(){return this._colorTexture}}}),f.prototype.update=function(e){if(!t(this._colorTexture)){var r=e.context;g(this,r),m(this,r),this._drawCommand.execute(r),this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),i(this)},f}),define("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/PerspectiveFrustum","../Core/PerspectiveOffCenterFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t,r){var i,n,o;if(e instanceof l){var a=Math.tan(.5*e.fovy);return i=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*i/o,r*i/n)}return e instanceof u?(i=e.near,n=e.top,o=e.right,Math.max(t*i/o,r*i/n)):Math.max(t,r)}function h(e,t,r,i){if(n(i)&&r(.5)>i){var o=r(0),a=r(1),l=r(.5),u=l-o,c=l-a;return function(i){var n=r(i);if(i<=.5){var l=(n-o)/u;return s.lerp(e,-s.PI_OVER_TWO,l)}var d=(n-a)/c;return s.lerp(-s.PI_OVER_TWO,t,1-d)}}return function(r){return s.lerp(e,t,r)}}function p(e,r,i,o,a){var l=a,u=Math.max(i,o);if(!n(l)){
var c=e.position,h=r,p=e.up,f=e.right,m=e.frustum,g=t.subtract(c,h,T),_=t.magnitude(t.multiplyByScalar(p,t.dot(g,p),w)),v=t.magnitude(t.multiplyByScalar(f,t.dot(g,f),w));l=Math.min(.2*d(m,_,v),1e9)}if(u<l){var y=-Math.pow(1e6*(l-i),1/8),b=Math.pow(1e6*(l-o),1/8);return function(e){var t=e*(b-y)+y;return-Math.pow(t,8)/1e6+l}}return function(e){return s.lerp(i,o,e)}}function f(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(r,i,n,o,a,l,u){function c(t){var r=t.time/i;d.setView({orientation:{heading:s.lerp(g,o,r),pitch:s.lerp(m,a,r),roll:s.lerp(_,l,r)}}),e.lerp(h,n,r,d.position),d.position.z=v(r)}var d=r.camera,h=t.clone(d.position,A),m=d.pitch,g=f(d.heading,o),_=f(d.roll,l),v=p(d,n,h.z,n.z,u);return c}function g(e,t){e.longitude<t.longitude?e.longitude+=s.TWO_PI:t.longitude+=s.TWO_PI}function _(e,t){var r=e.longitude-t.longitude;r<-s.PI?e.longitude+=s.TWO_PI:r>s.PI&&(t.longitude+=s.TWO_PI)}function v(e,i,o,a,l,u,c,d,m,v){var y=e.camera,b=e.mapProjection,C=b.ellipsoid,S=r.clone(y.positionCartographic,E),T=y.pitch,w=f(y.heading,a),A=f(y.roll,u),P=C.cartesianToCartographic(o,x);S.longitude=s.zeroToTwoPi(S.longitude),P.longitude=s.zeroToTwoPi(P.longitude);var I=!1;if(n(d)){var D=s.zeroToTwoPi(d),O=Math.min(S.longitude,P.longitude),M=Math.max(S.longitude,P.longitude),R=D>=O&&D<=M;if(n(m)){var L=Math.abs(S.longitude-P.longitude),N=s.TWO_PI-L;(R?L:N)<(R?N:L)*m&&!R&&(I=!0)}else R||(I=!0)}I?g(S,P):_(S,P);var k=p(y,o,S.height,P.height,c),F=h(T,l,k,v);return function(){var e=S.longitude,r=P.longitude,n=S.latitude,o=P.latitude;return function(l){var c=l.time/i,d=t.fromRadians(s.lerp(e,r,c),s.lerp(n,o,c),k(c));y.setView({destination:d,orientation:{heading:s.lerp(w,a,c),pitch:F(c),roll:s.lerp(A,u,c)}})}}()}function y(r,i,n,o,a,l,u){function c(t){var r=t.time/i;d.setView({orientation:{heading:s.lerp(m,o,r)}}),e.lerp(h,n,r,d.position);var a=_(r),l=d.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 d=r.camera,h=t.clone(d.position,A),m=f(d.heading,o),g=d.frustum.right-d.frustum.left,_=p(d,n,g,n.z,u);return c}function b(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function C(e,t){function r(){"function"==typeof t&&t(),e.enableInputs=!0}return r}var S={},T=new t,w=new t,A=new t,E=new r,x=new r,P=new r,I=new t;return S.createTween=function(r,o){o=i(o,i.EMPTY_OBJECT);var l=o.destination,u=r.mode;if(u===c.MORPHING)return b();var d=i(o.convert,!0),h=r.mapProjection,p=h.ellipsoid,f=o.maximumHeight,g=o.flyOverLongitude,_=o.flyOverLongitudeWeight,S=o.pitchAdjustHeight,T=o.easingFunction;d&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,P),l=h.project(P,I));var w=r.camera,A=o.endTransform;n(A)&&w._setTransform(A);var E=o.duration;n(E)||(E=Math.ceil(t.distance(w.position,l)/1e6)+2,E=Math.min(E,3));var x=i(o.heading,0),D=i(o.pitch,-s.PI_OVER_TWO),O=i(o.roll,0),M=r.screenSpaceCameraController;M.enableInputs=!1;var R=C(M,o.complete),L=C(M,o.cancel),N=w.frustum,k=r.mode===c.SCENE2D;if(k=k&&e.equalsEpsilon(w.position,l,s.EPSILON6),k=k&&s.equalsEpsilon(Math.max(N.right-N.left,N.top-N.bottom),l.z,s.EPSILON6),k=k||r.mode!==c.SCENE2D&&t.equalsEpsilon(l,w.position,s.EPSILON10),k=k&&s.equalsEpsilon(s.negativePiToPi(x),s.negativePiToPi(w.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(D),s.negativePiToPi(w.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(O),s.negativePiToPi(w.roll),s.EPSILON10))return b(R,L);var F=new Array(4);if(F[c.SCENE2D]=y,F[c.SCENE3D]=v,F[c.COLUMBUS_VIEW]=m,E<=0){return b(function(){F[u](r,1,l,x,D,O,f,g,_,S)({time:1}),"function"==typeof R&&R()},L)}var B=F[u](r,E,l,x,D,O,f,g,_,S);if(!n(T)){var U=w.positionCartographic.height;T=U>(u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z)&&U>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:E,easingFunction:T,startObject:{time:0},stopObject:{time:E},update:B,complete:R,cancel:L}},S}),define("Scene/MapMode2D",["../Core/freezeObject"],function(e){"use strict";return e({ROTATE:0,INFINITE_SCROLL:1})}),define("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/HeadingPitchRoll","../Core/Intersect","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./MapMode2D","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I){"use strict";function D(e){this._scene=e,this._transform=y.clone(y.IDENTITY),this._invTransform=y.clone(y.IDENTITY),this._actualTransform=y.clone(y.IDENTITY),this._actualInvTransform=y.clone(y.IDENTITY),this._transformChanged=!1,this.position=new r,this._position=new r,this._positionWC=new r,this._positionCartographic=new n,this.direction=new r,this._direction=new r,this._directionWC=new r,this.up=new r,this._up=new r,this._upWC=new r,this.right=new r,this._right=new r,this._rightWC=new r,this.frustum=new S,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 h,this._moveEnd=new h,this._changed=new h,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new y,this._invViewMatrix=new y,O(this),this._mode=I.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,Q(this,D.DEFAULT_VIEW_RECTANGLE,this.position,!0);var i=r.magnitude(this.position);i+=i*D.DEFAULT_VIEW_FACTOR,r.normalize(this.position,this.position),r.multiplyByScalar(this.position,i,this.position)}function O(e){y.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),y.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),y.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function M(e){E.basisTo2D(e._projection,e._transform,e._actualTransform)}function R(e){var t=e._projection,n=t.ellipsoid,o=y.getColumn(e._transform,3,me),a=n.cartesianToCartographic(o,he),s=t.project(a,pe),l=ge;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=i.clone(i.UNIT_X,ye),c=i.add(y.getColumn(e._transform,0,fe),o,fe);n.cartesianToCartographic(c,a),t.project(a,s);var d=_e;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,r.subtract(d,l,d),d.x=0;var h=ve;if(r.magnitudeSquared(d)>_.EPSILON10)r.cross(u,d,h);else{var p=i.add(y.getColumn(e._transform,1,fe),o,fe);n.cartesianToCartographic(p,a),t.project(a,s),h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,r.subtract(h,l,h),h.x=0,r.magnitudeSquared(h)<_.EPSILON10&&(i.clone(i.UNIT_Y,d),i.clone(i.UNIT_Z,h))}r.cross(h,u,d),r.normalize(d,d),r.cross(u,d,h),r.normalize(h,h),y.setColumn(e._actualTransform,0,d,e._actualTransform),y.setColumn(e._actualTransform,1,h,e._actualTransform),y.setColumn(e._actualTransform,2,u,e._actualTransform),y.setColumn(e._actualTransform,3,l,e._actualTransform)}function L(e){var t=e._mode,i=!1,n=0;t===I.SCENE2D&&(n=e.frustum.right-e.frustum.left,i=n!==e._positionCartographic.height);var o=e._position,a=!r.equals(o,e.position)||i;a&&(o=r.clone(e.position,e._position));var s=e._direction,l=!r.equals(s,e.direction);l&&(r.normalize(e.direction,e.direction),s=r.clone(e.direction,e._direction));var u=e._up,c=!r.equals(u,e.up);c&&(r.normalize(e.up,e.up),u=r.clone(e.up,e._up));var d=e._right,h=!r.equals(d,e.right);h&&(r.normalize(e.right,e.right),d=r.clone(e.right,e._right));var p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(y.inverseTransformation(e._transform,e._invTransform),e._mode===I.COLUMBUS_VIEW||e._mode===I.SCENE2D?y.equals(y.IDENTITY,e._transform)?y.clone(D.TRANSFORM_2D,e._actualTransform):e._mode===I.COLUMBUS_VIEW?M(e):R(e):y.clone(e._transform,e._actualTransform),y.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var f=e._actualTransform;if(a||p)if(e._positionWC=y.multiplyByPoint(f,o,e._positionWC),t===I.SCENE3D||t===I.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var m=be;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===I.SCENE2D&&(m.z=n),e._projection.unproject(m,e._positionCartographic)}if(l||c||h){var g=r.dot(s,r.cross(u,d,be));if(Math.abs(1-g)>_.EPSILON2){var v=1/r.magnitudeSquared(u),b=r.dot(u,s)*v,C=r.multiplyByScalar(s,b,be);u=r.normalize(r.subtract(u,C,e._up),e._up),r.clone(u,e.up),d=r.cross(s,u,e._right),r.clone(d,e.right)}}(l||p)&&(e._directionWC=y.multiplyByPointAsVector(f,s,e._directionWC),r.normalize(e._directionWC,e._directionWC)),(c||p)&&(e._upWC=y.multiplyByPointAsVector(f,u,e._upWC),r.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=y.multiplyByPointAsVector(f,d,e._rightWC),r.normalize(e._rightWC,e._rightWC)),(a||l||c||h||p)&&O(e)}function N(e,t){var r;return r=_.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(r)}function k(e){return _.PI_OVER_TWO-_.acosClamped(e.z)}function F(e,t,r){var i=0;return _.equalsEpsilon(Math.abs(e.z),1,_.EPSILON3)||(i=Math.atan2(-r.z,t.z),i=_.zeroToTwoPi(i+_.TWO_PI)),i}function B(e,t,i){var n=y.clone(e.transform,Oe),o=E.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Me);e._setTransform(o),r.clone(r.ZERO,e.position),i.heading=i.heading-_.PI_OVER_TWO;var a=T.fromHeadingPitchRoll(i,Re),s=v.fromQuaternion(a,Le);v.getColumn(s,0,e.direction),v.getColumn(s,2,e.up),r.cross(e.direction,e.up,e.right),e._setTransform(n),e._adjustOrthographicFrustum(!0)}function U(e,t,i,n){var o=y.clone(e.transform,Oe);if(e._setTransform(y.IDENTITY),!r.equals(t,e.positionWC)){if(n){var a=e._projection,s=a.ellipsoid.cartesianToCartographic(t,Ne);t=a.project(s,De)}r.clone(t,e.position)}i.heading=i.heading-_.PI_OVER_TWO;var l=T.fromHeadingPitchRoll(i,Re),u=v.fromQuaternion(l,Le);v.getColumn(u,0,e.direction),v.getColumn(u,2,e.up),r.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function V(e,i,n,o){var a=y.clone(e.transform,Oe);if(e._setTransform(y.IDENTITY),!r.equals(i,e.positionWC)){if(o){var s=e._projection,l=s.ellipsoid.cartesianToCartographic(i,Ne);i=s.project(l,De)}t.clone(i,e.position);var u=.5*-i.z,c=-u,d=e.frustum;if(c>u){var h=d.top/d.right;d.right=c,d.left=u,d.top=d.right*h,d.bottom=-d.top}}if(e._scene.mapMode2D===P.ROTATE){n.heading=n.heading-_.PI_OVER_TWO,n.pitch=-_.PI_OVER_TWO,n.roll=0;var p=T.fromHeadingPitchRoll(n,Re),f=v.fromQuaternion(p,Le);v.getColumn(f,2,e.up),r.cross(e.direction,e.up,e.right)}e._setTransform(a)}function z(e,t,i,n){var o=r.clone(i.direction,ke),a=r.clone(i.up,Fe);if(e._scene.mode===I.SCENE3D){var s=e._projection.ellipsoid,l=E.eastNorthUpToFixedFrame(t,s,Ce),u=y.inverseTransformation(l,Se);y.multiplyByPointAsVector(u,o,o),y.multiplyByPointAsVector(u,a,a)}var c=r.cross(o,a,Be);return n.heading=N(o,a),n.pitch=k(o),n.roll=F(o,a,c),n}function G(e,t){var r,i,n=e._scene.mapMode2D===P.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;n?(i=o,r=-i):(i=t.x-2*o,r=t.x+2*o),t.x>o&&(t.x=i),t.x<-o&&(t.x=r),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}function H(e,t){var i=e.position,n=r.normalize(i,Ye);if(a(e.constrainedAxis)){var o=r.equalsEpsilon(n,e.constrainedAxis,_.EPSILON2),s=r.equalsEpsilon(n,r.negate(e.constrainedAxis,Ze),_.EPSILON2);if(o||s)(o&&t<0||s&&t>0)&&e.rotate(e.right,t);else{var l=r.normalize(e.constrainedAxis,Xe),u=r.dot(n,l),c=_.acosClamped(u);t>0&&t>c&&(t=c-_.EPSILON4),u=r.dot(n,r.negate(l,Ze)),c=_.acosClamped(u),t<0&&-t>c&&(t=-c+_.EPSILON4);var d=r.cross(l,n,Qe);e.rotate(d,t)}}else e.rotate(e.right,t)}function W(e,t){a(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function j(e,t){var r,i=e.frustum;if(t*=.5,Math.abs(i.top)+Math.abs(i.bottom)>Math.abs(i.left)+Math.abs(i.right)){var n=i.top-t,o=i.bottom+t,a=e._maxCoord.y;e._scene.mapMode2D===P.ROTATE&&(a*=e.maximumZoomFactor),o>a&&(o=a,n=-a),n<=o&&(n=1,o=-1),r=i.right/i.top,i.top=n,i.bottom=o,i.right=i.top*r,i.left=-i.right}else{var s=i.right-t,l=i.left+t,u=e._maxCoord.x;e._scene.mapMode2D===P.ROTATE&&(u*=e.maximumZoomFactor),s>u&&(s=u,l=-u),s<=l&&(s=1,l=-1),r=i.top/i.right,i.right=s,i.left=l,i.top=i.right*r,i.bottom=-i.top}}function q(e,t){e.move(e.direction,t)}function Y(e,t,i){t=_.clamp(t,-_.PI_OVER_TWO,_.PI_OVER_TWO),e=_.zeroToTwoPi(e)-_.PI_OVER_TWO;var n=T.fromAxisAngle(r.UNIT_Y,-t,$e),o=T.fromAxisAngle(r.UNIT_Z,-e,et),a=T.multiply(o,n,o),s=v.fromQuaternion(a,tt),l=r.clone(r.UNIT_X,Je);return v.multiplyByVector(s,l,l),r.negate(l,l),r.multiplyByScalar(l,i,l),l}function X(e,t,i,n){return Math.abs(r.dot(t,i))/n-r.dot(e,i)}function Q(e,t,i,n){var o=e._projection.ellipsoid,s=n?e:pt,l=t.north,u=t.south,c=t.east,h=t.west;h>c&&(c+=_.TWO_PI);var p,f=.5*(h+c);if(u<-_.PI_OVER_TWO+_.RADIANS_PER_DEGREE&&l>_.PI_OVER_TWO-_.RADIANS_PER_DEGREE)p=0;else{var m=it;m.longitude=f,m.latitude=l,m.height=0;var g=nt;g.longitude=f,g.latitude=u,g.height=0;var v=rt;a(v)&&v.ellipsoid===o||(rt=v=new d(void 0,void 0,o)),v.setEndPoints(m,g),p=v.interpolateUsingFraction(.5,it).latitude}var y=it;y.longitude=f,y.latitude=p,y.height=0;var C=o.cartographicToCartesian(y,dt),S=it;S.longitude=c,S.latitude=l;var T=o.cartographicToCartesian(S,ot);S.longitude=h;var w=o.cartographicToCartesian(S,st);S.longitude=f;var A=o.cartographicToCartesian(S,ut);S.latitude=u;var E=o.cartographicToCartesian(S,ct);S.longitude=c;var x=o.cartographicToCartesian(S,lt);S.longitude=h;var P=o.cartographicToCartesian(S,at);r.subtract(w,C,w),r.subtract(x,C,x),r.subtract(T,C,T),r.subtract(P,C,P),r.subtract(A,C,A),r.subtract(E,C,E);var I=o.geodeticSurfaceNormal(C,s.direction);r.negate(I,I);var D=r.cross(I,r.UNIT_Z,s.right);r.normalize(D,D);var O,M=r.cross(D,I,s.up);if(e.frustum instanceof b){var R,L,N=Math.max(r.distance(T,w),r.distance(x,P)),k=Math.max(r.distance(T,x),r.distance(w,P)),F=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top,B=k*F;N>B?(R=N,L=R/F):(L=k,R=B),O=Math.max(R,L)}else{var U=Math.tan(.5*e.frustum.fovy),V=e.frustum.aspectRatio*U;if(O=Math.max(X(I,M,w,U),X(I,M,x,U),X(I,M,T,U),X(I,M,P,U),X(I,M,A,U),X(I,M,E,U),X(I,D,w,V),X(I,D,x,V),X(I,D,T,V),X(I,D,P,V),X(I,D,A,V),X(I,D,E,V)),u<0&&l>0){var z=it;z.longitude=h,z.latitude=0,z.height=0;var G=o.cartographicToCartesian(z,ht);r.subtract(G,C,G),O=Math.max(O,X(I,M,G,U),X(I,D,G,V)),z.longitude=c,G=o.cartographicToCartesian(z,ht),r.subtract(G,C,G),O=Math.max(O,X(I,M,G,U),X(I,D,G,V))}}return r.add(C,r.multiplyByScalar(I,-O,ht),i)}function Z(e,t,r){var i=e._projection;t.west>t.east&&(t=A.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,s=ft;s.longitude=t.east,s.latitude=t.north;var l=i.project(s,mt);y.multiplyByPoint(n,l,l),y.multiplyByPoint(o,l,l),s.longitude=t.west,s.latitude=t.south;var u=i.project(s,gt);if(y.multiplyByPoint(n,u,u),y.multiplyByPoint(o,u,u),r.x=.5*(l.x-u.x)+u.x,r.y=.5*(l.y-u.y)+u.y,a(e.frustum.fovy)){var c=Math.tan(.5*e.frustum.fovy),d=e.frustum.aspectRatio*c;r.z=.5*Math.max((l.x-u.x)/d,(l.y-u.y)/c)}else{var h=l.x-u.x,p=l.y-u.y;r.z=Math.max(h,p)}return r}function K(e,t,r){var i=e._projection;t.west>t.east&&(t=A.MAX_VALUE);var n=_t;n.longitude=t.east,n.latitude=t.north;var o=i.project(n,vt);n.longitude=t.west,n.latitude=t.south;var a,s,l=i.project(n,yt),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),d=e.frustum.right/e.frustum.top,h=c*d;return u>h?(a=u,s=a/d):(s=c,a=h),c=Math.max(2*a,2*s),r.x=.5*(o.x-l.x)+l.x,r.y=.5*(o.y-l.y)+l.y,n=i.unproject(r,n),n.height=c,r=i.project(n,r)}function J(e,t,r,i){r=o(r,c.WGS84);var n=e.getPickRay(t,bt),a=g.rayEllipsoid(n,r);if(a){var s=a.start>0?a.start:a.stop;return w.getPoint(n,s,i)}}function $(e,t,r,i){var n=e.getPickRay(t,Ct),o=n.origin;o.z=0;var a=r.unproject(o);if(!(a.latitude<-_.PI_OVER_TWO||a.latitude>_.PI_OVER_TWO))return r.ellipsoid.cartographicToCartesian(a,i)}function ee(e,t,i,n){var o=e.getPickRay(t,St),a=-o.origin.x/o.direction.x;w.getPoint(o,a,n);var s=i.unproject(new r(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 i.ellipsoid.cartographicToCartesian(s,n)}function te(e,t,i){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,d=2/a*(a-t.y)-1,h=e.positionWC;r.clone(h,i.origin);var p=r.multiplyByScalar(e.directionWC,u,Tt);r.add(h,p,p);var f=r.multiplyByScalar(e.rightWC,c*u*l,wt),m=r.multiplyByScalar(e.upWC,d*u*s,At),g=r.add(p,f,i.direction);return r.add(g,m,g),r.subtract(g,h,g),r.normalize(g,g),i}function re(e,t,i){var n=e._scene.canvas,o=n.clientWidth,s=n.clientHeight,l=e.frustum;a(l._offCenterFrustum)&&(l=l._offCenterFrustum);var u=2/o*t.x-1;u*=.5*(l.right-l.left);var c=2/s*(s-t.y)-1;c*=.5*(l.top-l.bottom);var d=i.origin;return r.clone(e.position,d),r.multiplyByScalar(e.right,u,Et),r.add(Et,d,d),r.multiplyByScalar(e.up,c,Et),r.add(Et,d,d),r.clone(e.directionWC,i.direction),e._mode===I.COLUMBUS_VIEW&&r.fromElements(i.origin.z,i.origin.x,i.origin.y,i.origin),i}function ie(e,t,i,n,o,a){function s(i){var n=r.lerp(t,l,i.time,new r);e.worldToCameraCoordinatesPoint(n,e.position)}var l=r.clone(t);return i.y>n?l.y-=i.y-n:i.y<-n&&(l.y+=-n-i.y),i.z>o?l.z-=i.z-o:i.z<-o&&(l.z+=-o-i.z),{easingFunction:u.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function ne(e,t){var i=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(r.UNIT_X,Dt),a=-r.dot(o,i)/r.dot(o,n),s=r.add(i,r.multiplyByScalar(n,a,Ot),Ot);e.cameraToWorldCoordinatesPoint(s,s),i=e.cameraToWorldCoordinatesPoint(e.position,Mt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=r.magnitude(r.subtract(i,s,Rt)),d=u*c,h=l*c,p=e._maxCoord.x,f=e._maxCoord.y,m=Math.max(d-p,p),g=Math.max(h-f,f);if(i.z<-m||i.z>m||i.y<-g||i.y>g){var _=s.y<-m||s.y>m,v=s.z<-g||s.z>g;if(_||v)return ie(e,i,s,m,g,t)}}function oe(e,t){var r=e.frustum,i=Math.tan(.5*r.fovy),n=r.aspectRatio*i;return Math.max(t/n,t/i)}function ae(e,t){var r=e.frustum;a(r._offCenterFrustum)&&(r=r._offCenterFrustum);var i,n,o=r.right/r.top,s=t*o;return t>s?(i=t,n=i/o):(n=t,i=s),1.5*Math.max(i,n)}function se(e,t,r){a(r)||(r=p.clone(D.DEFAULT_OFFSET));var i=e._scene.screenSpaceCameraController.minimumZoomDistance,n=e._scene.screenSpaceCameraController.maximumZoomDistance,o=r.range;if(!a(o)||0===o){var s=t.radius;0===s?r.range=kt:e.frustum instanceof b||e._mode===I.SCENE2D?r.range=ae(e,s):r.range=oe(e,s),r.range=_.clamp(r.range,i,n)}return r}function le(e,t){var i,n,o=t.radii,a=e.positionWC,s=r.multiplyComponents(t.oneOverRadii,a,jt),l=r.magnitude(s),u=r.normalize(s,qt);r.equalsEpsilon(u,r.UNIT_Z,_.EPSILON10)?(i=new r(0,1,0),n=new r(0,0,1)):(i=r.normalize(r.cross(r.UNIT_Z,u,Yt),Yt),n=r.normalize(r.cross(u,i,Xt),Xt));var c=Math.sqrt(r.magnitudeSquared(s)-1),d=r.multiplyByScalar(u,1/l,jt),h=c/l,p=r.multiplyByScalar(i,h,qt),f=r.multiplyByScalar(n,h,Yt),m=r.add(d,f,Qt[0]);r.subtract(m,p,m),r.multiplyComponents(o,m,m);var g=r.subtract(d,f,Qt[1]);r.subtract(g,p,g),r.multiplyComponents(o,g,g);var v=r.subtract(d,f,Qt[2]);r.add(v,p,v),r.multiplyComponents(o,v,v);var y=r.add(d,f,Qt[3]);return r.add(y,p,y),r.multiplyComponents(o,y,y),Qt}function ue(e,t,r,i,n,o){Zt.x=e,Zt.y=t;var s=i.pickEllipsoid(Zt,n,Kt);return a(s)?(Jt[r]=n.cartesianToCartographic(s,Jt[r]),1):(Jt[r]=n.cartesianToCartographic(o[r],Jt[r]),0)}D.TRANSFORM_2D=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),D.TRANSFORM_2D_INVERSE=y.inverseTransformation(D.TRANSFORM_2D,new y),D.DEFAULT_VIEW_RECTANGLE=A.fromDegrees(-95,-20,-70,90),D.DEFAULT_VIEW_FACTOR=.5,D.DEFAULT_OFFSET=new p(0,-_.PI_OVER_FOUR,0),D.prototype._updateCameraChanged=function(){var e=this;if(0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode===I.SCENE2D){if(!a(e._changedFrustum))return e._changedPosition=r.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var i,n=e.position,o=e._changedPosition,s=e.frustum,l=e._changedFrustum,u=n.x+s.left,c=n.x+s.right,d=o.x+l.left,h=o.x+l.right,p=n.y+s.bottom,f=n.y+s.top,m=o.y+l.bottom,g=o.y+l.top,v=Math.max(u,d),y=Math.min(c,h),b=Math.max(p,m),C=Math.min(f,g);if(v>=y||b>=f)i=1;else{var S=l;u<d&&c>h&&p<m&&f>g&&(S=s),i=1-(y-v)*(C-b)/((S.right-S.left)*(S.top-S.bottom))}return void(i>t&&(e._changed.raiseEvent(i),e._changedPosition=r.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!a(e._changedDirection))return e._changedPosition=r.clone(e.positionWC,e._changedPosition),void(e._changedDirection=r.clone(e.directionWC,e._changedDirection));var T,w=_.acosClamped(r.dot(e.directionWC,e._changedDirection));T=a(e.frustum.fovy)?w/(.5*e.frustum.fovy):w;var A=r.distance(e.positionWC,e._changedPosition),E=A/e.positionCartographic.height;(T>t||E>t)&&(e._changed.raiseEvent(Math.max(T,E)),e._changedPosition=r.clone(e.positionWC,e._changedPosition),e._changedDirection=r.clone(e.directionWC,e._changedDirection))}};var ce=new y,de=new n;D.prototype._adjustHeightForTerrain=function(){var e=this._scene,t=e.screenSpaceCameraController,i=t.enableCollisionDetection,n=t.minimumCollisionTerrainHeight,o=t.minimumZoomDistance;if(!this._suspendTerrainAdjustment&&i){var s=this._mode,l=e.globe;if(a(l)&&s!==I.SCENE2D&&s!==I.MORPHING){var u,c,d=l.ellipsoid,h=e.mapProjection;y.equals(this.transform,y.IDENTITY)||(u=y.clone(this.transform,ce),c=r.magnitude(this.position),this._setTransform(y.IDENTITY));var p=de;s===I.SCENE3D?d.cartesianToCartographic(this.position,p):h.unproject(this.position,p);var f=!1;if(p.height<n){var m=l.getHeight(p);a(m)&&(m+=o,p.height<m&&(p.height=m,s===I.SCENE3D?d.cartographicToCartesian(p,this.position):h.project(p,this.position),f=!0))}a(u)&&(this._setTransform(u),f&&(r.normalize(this.position,this.position),r.negate(this.position,this.direction),r.multiplyByScalar(this.position,Math.max(c,o),this.position),r.normalize(this.direction,this.direction),r.cross(this.direction,this.up,this.right),r.cross(this.right,this.direction,this.up)))}}};var he=new n,pe=new r,fe=new r,me=new i,ge=new i,_e=new i,ve=new i,ye=new i,be=new r,Ce=new y,Se=new y;s(D.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return L(this),this._invTransform}},viewMatrix:{get:function(){return L(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return L(this),this._invViewMatrix}},positionCartographic:{get:function(){return L(this),this._positionCartographic}},positionWC:{get:function(){return L(this),this._positionWC}},directionWC:{get:function(){return L(this),this._directionWC}},upWC:{get:function(){return L(this),this._upWC}},rightWC:{get:function(){return L(this),this._rightWC}},heading:{get:function(){if(this._mode!==I.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,Ce),r=E.eastNorthUpToFixedFrame(this.positionWC,e,Se);this._setTransform(r);var i=N(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==I.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,Ce),r=E.eastNorthUpToFixedFrame(this.positionWC,e,Se);this._setTransform(r);var i=k(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==I.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,Ce),r=E.eastNorthUpToFixedFrame(this.positionWC,e,Se);this._setTransform(r);var i=F(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),D.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==I.MORPHING,t=this._mode===I.SCENE2D),t){var r=this._max2Dfrustum=this.frustum.clone(),i=r.top/r.right;r.right=2*this._maxCoord.x,r.left=-r.right,r.top=i*r.right,r.bottom=-r.top}this._mode===I.SCENE2D&&G(this,this.position);var n=this._scene.globe,o=!a(n)||n._surface.tileProvider.ready&&0===n._surface._tileLoadQueueHigh.length&&0===n._surface._tileLoadQueueMedium.length&&0===n._surface._tileLoadQueueLow.length&&0===n._surface._debug.tilesWaitingForChildren;this._suspendTerrainAdjustment&&(this._suspendTerrainAdjustment=!o),this._adjustHeightForTerrain()};var Te=new r,we=new r,Ae=new r;D.prototype._setTransform=function(e){var t=r.clone(this.positionWC,Te),i=r.clone(this.upWC,we),n=r.clone(this.directionWC,Ae);y.clone(e,this._transform),this._transformChanged=!0,L(this);var o=this._actualInvTransform;y.multiplyByPoint(o,t,this.position),y.multiplyByPointAsVector(o,n,this.direction),y.multiplyByPointAsVector(o,i,this.up),r.cross(this.direction,this.up,this.right),L(this)};var Ee=new t,xe=new w,Pe=new r,Ie=new r;D.prototype._adjustOrthographicFrustum=function(e){if(this.frustum instanceof b&&(e||!(this._positionCartographic.height<15e4))){if(!y.equals(y.IDENTITY,this.transform))return void(this.frustum.width=r.magnitude(this.position));var t,i,n=this._scene,o=n._globe;if(a(o)){var s=Ee;s.x=n.drawingBufferWidth/2,s.y=n.drawingBufferHeight/2;var l=this.getPickRay(s,xe);if(t=o.pick(l,n,Pe),n.pickPositionSupported&&(i=n.pickPositionWorldCoordinates(s,Ie)),a(t)&&a(i)){var u=a(i)?r.distance(i,this.positionWC):Number.POSITIVE_INFINITY,c=a(t)?r.distance(t,this.positionWC):Number.POSITIVE_INFINITY;this.frustum.width=Math.min(u,c)}else a(i)?this.frustum.width=r.distance(i,this.positionWC):a(t)&&(this.frustum.width=r.distance(t,this.positionWC))}if(!a(o)||!a(t)&&!a(i)){var d=Math.max(this.positionCartographic.height,0);this.frustum.width=d}}};var De=new r,Oe=new y,Me=new y,Re=new T,Le=new v,Ne=new n,ke=new r,Fe=new r,Be=new r,Ue={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},Ve=new f;D.prototype.setView=function(e){e=o(e,o.EMPTY_OBJECT);var t=o(e.orientation,o.EMPTY_OBJECT),i=this._mode;if(i!==I.MORPHING){a(e.endTransform)&&this._setTransform(e.endTransform);var n=o(e.convert,!0),s=o(e.destination,r.clone(this.positionWC,De));a(s)&&a(s.west)&&(s=this.getRectangleCameraCoordinates(s,De),n=!1),a(t.direction)&&(t=z(this,s,t,Ue.orientation)),Ve.heading=o(t.heading,0),Ve.pitch=o(t.pitch,-_.PI_OVER_TWO),Ve.roll=o(t.roll,0),this._suspendTerrainAdjustment=!0,i===I.SCENE3D?B(this,s,Ve):i===I.SCENE2D?V(this,s,Ve,n):U(this,s,Ve,n)}};var ze=new r;D.prototype.flyHome=function(e){var t=this._mode;if(t===I.MORPHING&&this._scene.completeMorph(),t===I.SCENE2D)this.flyTo({destination:D.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:y.IDENTITY});else if(t===I.SCENE3D){var i=this.getRectangleCameraCoordinates(D.DEFAULT_VIEW_RECTANGLE),n=r.magnitude(i);n+=n*D.DEFAULT_VIEW_FACTOR,r.normalize(i,i),r.multiplyByScalar(i,n,i),this.flyTo({destination:i,duration:e,endTransform:y.IDENTITY})}else if(t===I.COLUMBUS_VIEW){var o=this._projection.ellipsoid.maximumRadius,a=new r(0,-1,1);a=r.multiplyByScalar(r.normalize(a,a),5*o,a),this.flyTo({destination:a,duration:e,orientation:{heading:0,pitch:-Math.acos(r.normalize(a,ze).z),roll:0},endTransform:y.IDENTITY,convert:!1})}},D.prototype.worldToCameraCoordinates=function(e,t){return a(t)||(t=new i),L(this),y.multiplyByVector(this._actualInvTransform,e,t)},D.prototype.worldToCameraCoordinatesPoint=function(e,t){return a(t)||(t=new r),L(this),y.multiplyByPoint(this._actualInvTransform,e,t)},D.prototype.worldToCameraCoordinatesVector=function(e,t){return a(t)||(t=new r),L(this),y.multiplyByPointAsVector(this._actualInvTransform,e,t)},D.prototype.cameraToWorldCoordinates=function(e,t){return a(t)||(t=new i),L(this),y.multiplyByVector(this._actualTransform,e,t)},D.prototype.cameraToWorldCoordinatesPoint=function(e,t){return a(t)||(t=new r),L(this),y.multiplyByPoint(this._actualTransform,e,t)},D.prototype.cameraToWorldCoordinatesVector=function(e,t){return a(t)||(t=new r),L(this),y.multiplyByPointAsVector(this._actualTransform,e,t)};var Ge=new r;D.prototype.move=function(e,t){var i=this.position;r.multiplyByScalar(e,t,Ge),r.add(i,Ge,i),this._mode===I.SCENE2D&&G(this,i),this._adjustOrthographicFrustum(!0)},D.prototype.moveForward=function(e){e=o(e,this.defaultMoveAmount),this._mode===I.SCENE2D?j(this,e):this.move(this.direction,e)},D.prototype.moveBackward=function(e){e=o(e,this.defaultMoveAmount),this._mode===I.SCENE2D?j(this,-e):this.move(this.direction,-e)},D.prototype.moveUp=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,e)},D.prototype.moveDown=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,-e)},D.prototype.moveRight=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,e)},D.prototype.moveLeft=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,-e)},D.prototype.lookLeft=function(e){e=o(e,this.defaultLookAmount),this._mode!==I.SCENE2D&&this.look(this.up,-e)},D.prototype.lookRight=function(e){e=o(e,this.defaultLookAmount),this._mode!==I.SCENE2D&&this.look(this.up,e)},D.prototype.lookUp=function(e){e=o(e,this.defaultLookAmount),this._mode!==I.SCENE2D&&this.look(this.right,-e)},D.prototype.lookDown=function(e){e=o(e,this.defaultLookAmount),this._mode!==I.SCENE2D&&this.look(this.right,e)};var He=new T,We=new v;D.prototype.look=function(e,t){var r=o(t,this.defaultLookAmount),i=T.fromAxisAngle(e,-r,He),n=v.fromQuaternion(i,We),a=this.direction,s=this.up,l=this.right;v.multiplyByVector(n,a,a),v.multiplyByVector(n,s,s),v.multiplyByVector(n,l,l)},D.prototype.twistLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,e)},D.prototype.twistRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,-e)};var je=new T,qe=new v;D.prototype.rotate=function(e,t){var i=o(t,this.defaultRotateAmount),n=T.fromAxisAngle(e,-i,je),a=v.fromQuaternion(n,qe);v.multiplyByVector(a,this.position,this.position),v.multiplyByVector(a,this.direction,this.direction),v.multiplyByVector(a,this.up,this.up),r.cross(this.direction,this.up,this.right),r.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},D.prototype.rotateDown=function(e){e=o(e,this.defaultRotateAmount),H(this,e)},D.prototype.rotateUp=function(e){e=o(e,this.defaultRotateAmount),H(this,-e)};var Ye=new r,Xe=new r,Qe=new r,Ze=new r;D.prototype.rotateRight=function(e){e=o(e,this.defaultRotateAmount),W(this,-e)},D.prototype.rotateLeft=function(e){e=o(e,this.defaultRotateAmount),W(this,e)},D.prototype.zoomIn=function(e){e=o(e,this.defaultZoomAmount),this._mode===I.SCENE2D?j(this,e):q(this,e)},D.prototype.zoomOut=function(e){e=o(e,this.defaultZoomAmount),this._mode===I.SCENE2D?j(this,-e):q(this,-e)},D.prototype.getMagnitude=function(){return this._mode===I.SCENE3D?r.magnitude(this.position):this._mode===I.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===I.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var Ke=new y;D.prototype.lookAt=function(e,t){var r=E.eastNorthUpToFixedFrame(e,c.WGS84,Ke);this.lookAtTransform(r,t)};var Je=new r,$e=new T,et=new T,tt=new v;D.prototype.lookAtTransform=function(e,i){if(this._setTransform(e),a(i)){var n;if(n=a(i.heading)?Y(i.heading,i.pitch,i.range):i,this._mode===I.SCENE2D){t.clone(t.ZERO,this.position),r.negate(n,this.up),this.up.z=0,r.magnitudeSquared(this.up)<_.EPSILON10&&r.clone(r.UNIT_Y,this.up),r.normalize(this.up,this.up),this._setTransform(y.IDENTITY),r.negate(r.UNIT_Z,this.direction),r.cross(this.direction,this.up,this.right),r.normalize(this.right,this.right);var o=this.frustum,s=o.top/o.right;return o.right=.5*r.magnitude(n),o.left=-o.right,o.top=s*o.right,o.bottom=-o.top,void this._setTransform(e)}r.clone(n,this.position),r.negate(this.position,this.direction),
r.normalize(this.direction,this.direction),r.cross(this.direction,r.UNIT_Z,this.right),r.magnitudeSquared(this.right)<_.EPSILON10&&r.clone(r.UNIT_X,this.right),r.normalize(this.right,this.right),r.cross(this.right,this.direction,this.up),r.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)}};var rt,it=new n,nt=new n,ot=new r,at=new r,st=new r,lt=new r,ut=new r,ct=new r,dt=new r,ht=new r,pt={direction:new r,right:new r,up:new r},ft=new n,mt=new r,gt=new r,_t=new n,vt=new r,yt=new r;D.prototype.getRectangleCameraCoordinates=function(e,t){var i=this._mode;return a(t)||(t=new r),i===I.SCENE3D?Q(this,e,t):i===I.COLUMBUS_VIEW?Z(this,e,t):i===I.SCENE2D?K(this,e,t):void 0};var bt=new w,Ct=new w,St=new w;D.prototype.pickEllipsoid=function(e,t,i){var n=this._scene.canvas;if(0!==n.clientWidth&&0!==n.clientHeight){if(a(i)||(i=new r),t=o(t,c.WGS84),this._mode===I.SCENE3D)i=J(this,e,t,i);else if(this._mode===I.SCENE2D)i=$(this,e,this._projection,i);else{if(this._mode!==I.COLUMBUS_VIEW)return;i=ee(this,e,this._projection,i)}return i}};var Tt=new r,wt=new r,At=new r,Et=new r;D.prototype.getPickRay=function(e,t){a(t)||(t=new w);var r=this.frustum;return a(r.aspectRatio)&&a(r.fov)&&a(r.near)?te(this,e,t):re(this,e,t)};var xt=new r,Pt=new r;D.prototype.distanceToBoundingSphere=function(e){var t=r.subtract(this.positionWC,e.center,xt),i=r.multiplyByScalar(this.directionWC,r.dot(t,this.directionWC),Pt);return Math.max(0,r.magnitude(i)-e.radius)};var It=new t;D.prototype.getPixelSize=function(e,t,r){var i=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,r,i,It);return Math.max(n.x,n.y)};var Dt=new r,Ot=new r,Mt=new r,Rt=new r;D.prototype.createCorrectPositionTween=function(e){if(this._mode===I.COLUMBUS_VIEW)return ne(this,e)};var Lt=new r,Nt={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};D.prototype.cancelFlight=function(){a(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},D.prototype.flyTo=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.destination;if(this._mode!==I.MORPHING){this.cancelFlight();var r=o(e.orientation,o.EMPTY_OBJECT);if(a(r.direction)&&(r=z(this,t,r,Ue.orientation)),a(e.duration)&&e.duration<=0){var i=Ue;return i.destination=e.destination,i.orientation.heading=r.heading,i.orientation.pitch=r.pitch,i.orientation.roll=r.roll,i.convert=e.convert,i.endTransform=e.endTransform,this.setView(i),void("function"==typeof e.complete&&e.complete())}var n=a(t.west);n&&(t=this.getRectangleCameraCoordinates(t,Lt));var s,l=this;Nt.destination=t,Nt.heading=r.heading,Nt.pitch=r.pitch,Nt.roll=r.roll,Nt.duration=e.duration,Nt.complete=function(){s===l._currentFlight&&(l._currentFlight=void 0),a(e.complete)&&e.complete()},Nt.cancel=e.cancel,Nt.endTransform=e.endTransform,Nt.convert=!n&&e.convert,Nt.maximumHeight=e.maximumHeight,Nt.pitchAdjustHeight=e.pitchAdjustHeight,Nt.flyOverLongitude=e.flyOverLongitude,Nt.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Nt.easingFunction=e.easingFunction;var u=this._scene;s=u.tweens.add(x.createTween(u,Nt)),this._currentFlight=s}};var kt=100;D.prototype.viewBoundingSphere=function(e,t){t=se(this,e,t),this.lookAt(e.center,t)};var Ft=new y,Bt=new r,Ut=new r,Vt=new r,zt=new r,Gt=new i,Ht=new T,Wt=new v;D.prototype.flyToBoundingSphere=function(e,t){t=o(t,o.EMPTY_OBJECT);var i=this._mode===I.SCENE2D||this._mode===I.COLUMBUS_VIEW;this._setTransform(y.IDENTITY);var n,a=se(this,e,t.offset);n=i?r.multiplyByScalar(r.UNIT_Z,a.range,Bt):Y(a.heading,a.pitch,a.range);var s=E.eastNorthUpToFixedFrame(e.center,c.WGS84,Ft);y.multiplyByPoint(s,n,n);var l,u;if(!i){if(l=r.subtract(e.center,n,Ut),r.normalize(l,l),u=y.multiplyByPointAsVector(s,r.UNIT_Z,Vt),1-Math.abs(r.dot(l,u))<_.EPSILON6){var d=T.fromAxisAngle(l,a.heading,Ht),h=v.fromQuaternion(d,Wt);r.fromCartesian4(y.getColumn(s,1,Gt),u),v.multiplyByVector(h,u,u)}var p=r.cross(l,u,zt);r.cross(p,l,u),r.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,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var jt=new r,qt=new r,Yt=new r,Xt=new r,Qt=[new r,new r,new r,new r],Zt=new t,Kt=new r,Jt=[new n,new n,new n,new n];return D.prototype.computeViewRectangle=function(t,i){t=o(t,c.WGS84);var n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),a=new e(r.ZERO,t.maximumRadius);if(n.computeVisibility(a)!==m.OUTSIDE){var s=this._scene.canvas,l=s.clientWidth,u=s.clientHeight,d=0,h=le(this,t);if(d+=ue(0,0,0,this,t,h),d+=ue(0,u,1,this,t,h),d+=ue(l,u,2,this,t,h),(d+=ue(l,0,3,this,t,h))<2)return A.MAX_VALUE;i=A.fromCartographicArray(Jt,i);for(var p=0,f=Jt[3].longitude,g=0;g<4;++g){var v=Jt[g].longitude,y=Math.abs(v-f);y>_.PI?p+=_.TWO_PI-y:p+=y,f=v}return _.equalsEpsilon(Math.abs(p),_.TWO_PI,_.EPSILON9)&&(i.west=-_.PI,i.east=_.PI,Jt[0].latitude>=0?i.north=_.PI_OVER_TWO:i.south=-_.PI_OVER_TWO),i}},D.prototype.switchToPerspectiveFrustum=function(){if(!(this._mode===I.SCENE2D||this.frustum instanceof S)){var e=this._scene;this.frustum=new S,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=_.toRadians(60)}},D.prototype.switchToOrthographicFrustum=function(){if(!(this._mode===I.SCENE2D||this.frustum instanceof b)){var e=this._scene;this.frustum=new b,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.width=r.magnitude(this.position);var t=this.frustum.projectionMatrix;a(t)&&this._adjustOrthographicFrustum(!0)}},D.clone=function(e,t){return a(t)||(t=new D(e._scene)),r.clone(e.position,t.position),r.clone(e.direction,t.direction),r.clone(e.up,t.up),r.clone(e.right,t.right),y.clone(e._transform,t.transform),t._transformChanged=!0,t},D}),define("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";return e({LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4})}),define("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r){var i=e;return t(r)&&(i+="+"+r),i}function d(t,r){e.clone(t.distance.startPosition,r.distance.startPosition),e.clone(t.distance.endPosition,r.distance.endPosition),e.clone(t.angleAndHeight.startPosition,r.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,r.angleAndHeight.endPosition)}function h(r,i,n){var o=c(u.PINCH,i),a=r._update,s=r._isDown,h=r._eventStartPosition,p=r._pressTime,f=r._releaseTime;a[o]=!0,s[o]=!1,h[o]=new e;var m=r._movement[o];t(m)||(m=r._movement[o]={}),m.distance={startPosition:new e,endPosition:new e},m.angleAndHeight={startPosition:new e,endPosition:new e},m.prevAngle=0,r._eventHandler.setInputAction(function(t){r._buttonsDown++,s[o]=!0,p[o]=new Date,e.lerp(t.position1,t.position2,.5,h[o])},l.PINCH_START,i),r._eventHandler.setInputAction(function(){r._buttonsDown=Math.max(r._buttonsDown-1,0),s[o]=!1,f[o]=new Date},l.PINCH_END,i),r._eventHandler.setInputAction(function(t){if(s[o]){a[o]?(d(t,m),a[o]=!1,m.prevAngle=m.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,m.distance.endPosition),e.clone(t.angleAndHeight.endPosition,m.angleAndHeight.endPosition));for(var r=m.angleAndHeight.endPosition.x,i=m.prevAngle,l=2*Math.PI;r>=i+Math.PI;)r-=l;for(;r<i-Math.PI;)r+=l;m.angleAndHeight.endPosition.x=-r*n.clientWidth/12,m.angleAndHeight.startPosition.x=-i*n.clientWidth/12}},l.PINCH_MOVE,i)}function p(r,i){var n=c(u.WHEEL,i),o=r._update;o[n]=!0;var s=r._movement[n];t(s)||(s=r._movement[n]={}),s.startPosition=new e,s.endPosition=new e,r._eventHandler.setInputAction(function(t){var r=15*a.toRadians(t);o[n]?(e.clone(e.ZERO,s.startPosition),s.endPosition.x=0,s.endPosition.y=r,o[n]=!1):s.endPosition.y=s.endPosition.y+r},l.WHEEL,i)}function f(r,i,n){var o=c(n,i),a=r._isDown,s=r._eventStartPosition,d=r._pressTime,h=r._releaseTime;a[o]=!1,s[o]=new e;var p=r._lastMovement[o];t(p)||(p=r._lastMovement[o]={startPosition:new e,endPosition:new e,valid:!1});var f,m;n===u.LEFT_DRAG?(f=l.LEFT_DOWN,m=l.LEFT_UP):n===u.RIGHT_DRAG?(f=l.RIGHT_DOWN,m=l.RIGHT_UP):n===u.MIDDLE_DRAG&&(f=l.MIDDLE_DOWN,m=l.MIDDLE_UP),r._eventHandler.setInputAction(function(t){r._buttonsDown++,p.valid=!1,a[o]=!0,d[o]=new Date,e.clone(t.position,s[o])},f,i),r._eventHandler.setInputAction(function(){r._buttonsDown=Math.max(r._buttonsDown-1,0),a[o]=!1,h[o]=new Date},m,i)}function m(t,r){e.clone(t.startPosition,r.startPosition),e.clone(t.endPosition,r.endPosition)}function g(r,i){var n=r._update,o=r._movement,a=r._lastMovement,s=r._isDown;for(var d in u)if(u.hasOwnProperty(d)){var h=u[d];if(t(h)){var p=c(h,i);n[p]=!0,t(r._lastMovement[p])||(r._lastMovement[p]={startPosition:new e,endPosition:new e,valid:!1}),t(r._movement[p])||(r._movement[p]={startPosition:new e,endPosition:new e})}}r._eventHandler.setInputAction(function(l){for(var d in u)if(u.hasOwnProperty(d)){var h=u[d];if(t(h)){var p=c(h,i);s[p]&&(n[p]?(m(o[p],a[p]),a[p].valid=!0,m(l,o[p]),n[p]=!1):e.clone(l.endPosition,o[p].endPosition))}}e.clone(l.endPosition,r._currentMousePosition)},l.MOUSE_MOVE,i)}function _(r){this._eventHandler=new s(r,!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),h(this,void 0,r),f(this,void 0,u.LEFT_DRAG),f(this,void 0,u.RIGHT_DRAG),f(this,void 0,u.MIDDLE_DRAG),g(this,void 0);for(var i in o)if(o.hasOwnProperty(i)){var n=o[i];t(n)&&(p(this,n),h(this,n,r),f(this,n,u.LEFT_DRAG),f(this,n,u.RIGHT_DRAG),f(this,n,u.MIDDLE_DRAG),g(this,n))}}return r(_.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}}}),_.prototype.isMoving=function(e,t){var r=c(e,t);return!this._update[r]},_.prototype.getMovement=function(e,t){var r=c(e,t);return this._movement[r]},_.prototype.getLastMovement=function(e,t){var r=c(e,t),i=this._lastMovement[r];if(i.valid)return i},_.prototype.isButtonDown=function(e,t){var r=c(e,t);return this._isDown[r]},_.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL)return this._currentMousePosition;var r=c(e,t);return this._eventStartPosition[r]},_.prototype.getButtonPressTime=function(e,t){var r=c(e,t);return this._pressTime[r]},_.prototype.getButtonReleaseTime=function(e,t){var r=c(e,t);return this._releaseTime[r]},_.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),i(this)},_}),define("Scene/Cesium3DTileChildrenVisibility",["../Core/freezeObject"],function(e){"use strict";return e({NONE:0,VISIBLE:1,IN_REQUEST_VOLUME:2,VISIBLE_IN_REQUEST_VOLUME:4,VISIBLE_NOT_IN_REQUEST_VOLUME:8})}),define("Scene/Composite3DTileContent",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/getMagic","../Core/RuntimeError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r,i,n,o){this._tileset=e,this._tile=t,this._resource=r,this._contents=[],this._readyPromise=s.defer(),u(this,i,n,o)}function u(r,i,n,l){n=e(n,0);var u=new Uint8Array(i),d=new DataView(i);n+=c;var h=d.getUint32(n,!0);if(1!==h)throw new a("Only Composite Tile version 1 is supported. Version "+h+" is not.");n+=c,n+=c;var p=d.getUint32(n,!0);n+=c;for(var f=[],m=0;m<p;++m){var g=o(u,n),_=d.getUint32(n+2*c,!0),v=l[g];if(!t(v))throw new a("Unknown tile content type, "+g+", inside Composite tile");var y=v(r._tileset,r._tile,r._resource,i,n);r._contents.push(y),f.push(y.readyPromise),n+=_}s.all(f).then(function(){r._readyPromise.resolve(r)}).otherwise(function(e){r._readyPromise.reject(e)})}if(!n.supportsTypedArrays())return{};r(l.prototype,{featurePropertiesDirty:{get:function(){for(var e=this._contents,t=e.length,r=0;r<t;++r)if(e[r].featurePropertiesDirty)return!0;return!1},set:function(e){for(var t=this._contents,r=t.length,i=0;i<r;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}});var c=Uint32Array.BYTES_PER_ELEMENT;return l.prototype.hasProperty=function(e,t){return!1},l.prototype.getFeature=function(e){},l.prototype.applyDebugSettings=function(e,t){for(var r=this._contents,i=r.length,n=0;n<i;++n)r[n].applyDebugSettings(e,t)},l.prototype.applyStyle=function(e,t){for(var r=this._contents,i=r.length,n=0;n<i;++n)r[n].applyStyle(e,t)},l.prototype.update=function(e,t){for(var r=this._contents,i=r.length,n=0;n<i;++n)r[n].update(e,t)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){for(var e=this._contents,t=e.length,r=0;r<t;++r)e[r].destroy();return i(this)},l}),define("Scene/Vector3DTileGeometry",["../Core/arraySlice","../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Matrix4","../Core/TaskProcessor","../ThirdParty/when","./ClassificationType","./Vector3DTileBatch","./Vector3DTilePrimitive"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,o(this._center)||(o(this._boundingVolume)?this._center=r.clone(this._boundingVolume.center):this._center=r.clone(r.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._readyPromise=c.defer(),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=d.CESIUM_3D_TILE}function m(e){var t=new Float64Array(l.packedLength+r.packedLength),i=0;return r.pack(e._center,t,i),i+=r.packedLength,l.pack(e._modelMatrix,t,i),t}function g(e,r){for(var n=0,o=r[n++],a=r[n++],s=e._boundingVolumes=new Array(a),l=0;l<a;++l)s[l]=t.unpack(r,n),n+=t.packedLength;for(var u=r[n++],c=e._batchedIndices=new Array(u),d=0;d<u;++d){var p=i.unpack(r,n);n+=i.packedLength;for(var f=r[n++],m=r[n++],g=r[n++],_=new Array(g),v=0;v<g;++v)_[v]=r[n++];c[d]=new h({color:p,offset:f,count:m,batchIds:_})}return o}function _(t){if(!o(t._primitive)){if(!o(t._verticesPromise)){var r=t._boxes,i=t._boxBatchIds,a=t._cylinders,s=t._cylinderBatchIds,l=t._ellipsoids,u=t._ellipsoidBatchIds,c=t._spheres,d=t._sphereBatchIds,h=t._batchTableColors,f=t._packedBuffer;if(!o(h)){var _=0;o(t._boxes)&&(r=t._boxes=e(r),i=t._boxBatchIds=e(i),_+=i.length),o(t._cylinders)&&(a=t._cylinders=e(a),s=t._cylinderBatchIds=e(s),_+=s.length),o(t._ellipsoids)&&(l=t._ellipsoids=e(l),u=t._ellipsoidBatchIds=e(u),_+=u.length),o(t._spheres)&&(c=t._sphere=e(c),d=t._sphereBatchIds=e(d),_+=d.length),h=t._batchTableColors=new Uint32Array(_);for(var b=t._batchTable,C=0;C<_;++C){var S=b.getColor(C,y);h[C]=S.toRgba()}f=t._packedBuffer=m(t)}var T=[];o(r)&&T.push(r.buffer,i.buffer),o(a)&&T.push(a.buffer,s.buffer),o(l)&&T.push(l.buffer,u.buffer),o(c)&&T.push(c.buffer,d.buffer),T.push(h.buffer,f.buffer);var w={boxes:o(r)?r.buffer:void 0,boxBatchIds:o(r)?i.buffer:void 0,cylinders:o(a)?a.buffer:void 0,cylinderBatchIds:o(a)?s.buffer:void 0,ellipsoids:o(l)?l.buffer:void 0,ellipsoidBatchIds:o(l)?u.buffer:void 0,spheres:o(c)?c.buffer:void 0,sphereBatchIds:o(c)?d.buffer:void 0,batchTableColors:h.buffer,packedBuffer:f.buffer},A=t._verticesPromise=v.scheduleTask(w,T);if(!o(A))return;A.then(function(e){var r=new Float64Array(e.packedBuffer),i=g(t,r);t._indices=2===i?new Uint16Array(e.indices):new Uint32Array(e.indices),t._indexOffsets=new Uint32Array(e.indexOffsets),t._indexCounts=new Uint32Array(e.indexCounts),t._positions=new Float32Array(e.positions),t._vertexBatchIds=new Uint16Array(e.vertexBatchIds),t._batchIds=new Uint16Array(e.batchIds),t._ready=!0})}t._ready&&!o(t._primitive)&&(t._primitive=new p({batchTable:t._batchTable,positions:t._positions,batchIds:t._batchIds,vertexBatchIds:t._vertexBatchIds,indices:t._indices,indexOffsets:t._indexOffsets,indexCounts:t._indexCounts,batchedIndices:t._batchedIndices,boundingVolume:t._boundingVolume,boundingVolumes:t._boundingVolumes,center:t._center,pickObject:n(t._pickObject,t)}),t._boxes=void 0,t._boxBatchIds=void 0,t._cylinders=void 0,t._cylinderBatchIds=void 0,t._ellipsoids=void 0,t._ellipsoidBatchIds=void 0,t._spheres=void 0,t._sphereBatchIds=void 0,t._center=void 0,t._modelMatrix=void 0,t._batchTable=void 0,t._boundingVolume=void 0,t._boundingVolumes=void 0,t._batchedIndices=void 0,t._indices=void 0,t._indexOffsets=void 0,t._indexCounts=void 0,t._positions=void 0,t._vertexBatchIds=void 0,t._batchIds=void 0,t._batchTableColors=void 0,t._packedBuffer=void 0,t._verticesPromise=void 0,t._readyPromise.resolve())}}a(f.prototype,{trianglesLength:{get:function(){return o(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return o(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise.promise}}}),f.packedBoxLength=l.packedLength+r.packedLength,f.packedCylinderLength=l.packedLength+2,f.packedEllipsoidLength=l.packedLength+r.packedLength,f.packedSphereLength=r.packedLength+1;var v=new u("createVectorTileGeometries"),y=new i;return f.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},f.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},f.prototype.applyStyle=function(e,t,r){this._primitive.applyStyle(e,t,r)},f.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},f.prototype.update=function(e){_(this),this._ready&&(this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e))},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),s(this)},f}),define("Scene/Geometry3DTileContent",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/getMagic","../Core/getStringFromTypedArray","../Core/Math","../Core/Matrix4","../Core/Rectangle","../Core/RuntimeError","../ThirdParty/when","./Cesium3DTileBatchTable","./Vector3DTileGeometry"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(e,t,r,i,n){this._tileset=e,this._tile=t,this._resource=r,this._geometries=void 0,this._contentReadyPromise=void 0,this._readyPromise=f.defer(),this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,b(this,i,n)}function v(e){return function(t,i){r(e._geometries)&&e._geometries.updateCommands(t,i)}}function y(e,i){var n,o,a,s,l,u=t(e.BOXES_LENGTH,0),c=t(e.CYLINDERS_LENGTH,0),d=t(e.ELLIPSOIDS_LENGTH,0),h=t(e.SPHERES_LENGTH,0);if(u>0&&r(e.BOX_BATCH_IDS)){var f=i.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(i.buffer,f,u)}if(c>0&&r(e.CYLINDER_BATCH_IDS)){var m=i.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;o=new Uint16Array(i.buffer,m,c)}if(d>0&&r(e.ELLIPSOID_BATCH_IDS)){var g=i.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;a=new Uint16Array(i.buffer,g,d)}if(h>0&&r(e.SPHERE_BATCH_IDS)){var _=i.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;s=new Uint16Array(i.buffer,_,h)}var v=r(n)||r(o)||r(a)||r(s),y=u>0&&!r(n)||c>0&&!r(o)||d>0&&!r(a)||h>0&&!r(s);if(v&&y)throw new p("If one group of batch ids is defined, then all batch ids must be defined.");if(!(r(n)||r(o)||r(a)||r(s))){var b=0;if(!r(n)&&u>0)for(n=new Uint16Array(u),l=0;l<u;++l)n[l]=b++;if(!r(o)&&c>0)for(o=new Uint16Array(c),l=0;l<c;++l)o[l]=b++;if(!r(a)&&d>0)for(a=new Uint16Array(d),l=0;l<d;++l)a[l]=b++;if(!r(s)&&h>0)for(s=new Uint16Array(h),l=0;l<h;++l)s[l]=b++}return{boxes:n,cylinders:o,ellipsoids:a,spheres:s}}function b(i,n,o){o=t(o,0);var a=new Uint8Array(n),s=new DataView(n);o+=S;var l=s.getUint32(o,!0);if(1!==l)throw new p("Only Geometry tile version 1 is supported.  Version "+l+" is not.");o+=S;var c=s.getUint32(o,!0);if(o+=S,0===c)return void i._readyPromise.resolve(i);var h=s.getUint32(o,!0);if(o+=S,0===h)throw new p("Feature table must have a byte length greater than zero");var f=s.getUint32(o,!0);o+=S;var _=s.getUint32(o,!0);o+=S;var b=s.getUint32(o,!0);o+=S;var C=u(a,o,h),T=JSON.parse(C);o+=h;var w=new Uint8Array(n,o,f);o+=f;var A,E;if(_>0){var x=u(a,o,_);A=JSON.parse(x),o+=_,b>0&&(E=new Uint8Array(n,o,b),E=new Uint8Array(E))}var P=t(T.BOXES_LENGTH,0),I=t(T.CYLINDERS_LENGTH,0),D=t(T.ELLIPSOIDS_LENGTH,0),O=t(T.SPHERES_LENGTH,0),M=P+I+D+O,R=new m(i,M,A,E,v(i));if(i._batchTable=R,0!==M){var L,N=i._tile.computedTransform;r(T.RTC_CENTER)&&(L=e.unpack(T.RTC_CENTER),d.multiplyByPoint(N,L,L));var k=y(T,w);if(P>0||I>0||D>0||O>0){var F,B,U,V;if(P>0){var z=w.byteOffset+T.BOXES.byteOffset;F=new Float32Array(w.buffer,z,g.packedBoxLength*P)}if(I>0){var G=w.byteOffset+T.CYLINDERS.byteOffset;B=new Float32Array(w.buffer,G,g.packedCylinderLength*I)}if(D>0){var H=w.byteOffset+T.ELLIPSOIDS.byteOffset;U=new Float32Array(w.buffer,H,g.packedEllipsoidLength*D)}if(O>0){var W=w.byteOffset+T.SPHERES.byteOffset;V=new Float32Array(w.buffer,W,g.packedSphereLength*O)}i._geometries=new g({boxes:F,boxBatchIds:k.boxes,cylinders:B,cylinderBatchIds:k.cylinders,ellipsoids:U,ellipsoidBatchIds:k.ellipsoids,spheres:V,sphereBatchIds:k.spheres,center:L,modelMatrix:N,batchTable:R,boundingVolume:i._tile._boundingVolume.boundingVolume})}}}function C(e){var t=e.featuresLength;if(!r(e._features)&&t>0){var i=new Array(t);r(e._geometries)&&e._geometries.createFeatures(e,i),e._features=i}}if(!s.supportsTypedArrays())return{};i(_.prototype,{featuresLength:{get:function(){return r(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return r(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return r(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return r(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var S=Uint32Array.BYTES_PER_ELEMENT;return _.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},_.prototype.getFeature=function(e){return C(this),this._features[e]},_.prototype.applyDebugSettings=function(e,t){r(this._geometries)&&this._geometries.applyDebugSettings(e,t)},_.prototype.applyStyle=function(e,t){C(this),r(this._geometries)&&this._geometries.applyStyle(e,t,this._features)},_.prototype.update=function(e,t){if(r(this._batchTable)&&this._batchTable.update(e,t),r(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),!r(this._contentReadyPromise)){var i=this;this._contentReadyPromise=this._geometries.readyPromise.then(function(){i._readyPromise.resolve(i)})}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),n(this)},_}),define("Scene/ModelInstance",["../Core/defineProperties","../Core/Matrix4"],function(e,t){"use strict";function r(e,r,i){this.primitive=e,this._modelMatrix=t.clone(r),this._instanceId=i}return e(r.prototype,{instanceId:{get:function(){return this._instanceId}},model:{get:function(){return this.primitive._model}},modelMatrix:{get:function(){return t.clone(this._modelMatrix)},set:function(e){t.clone(e,this._modelMatrix),this.primitive.expandBoundingSphere(this._modelMatrix),this.primitive._dirty=!0}}}),r}),define("Scene/ModelInstanceCollection",["../Core/BoundingSphere","../Core/Cartesian3","../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/PrimitiveType","../Core/Resource","../Core/RuntimeError","../Core/Transforms","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/ShaderSource","../ThirdParty/when","./Model","./ModelInstance","./ModelUtility","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E){"use strict";function x(e){e=o(e,o.EMPTY_OBJECT),this.show=o(e.show,!0),this._instancingSupported=!1,this._dynamic=o(e.dynamic,!1),this._allowPicking=o(e.allowPicking,!0),this._ready=!1,this._readyPromise=C.defer(),this._state=ie.NEEDS_LOAD,this._dirty=!1,this._cull=o(e.cull,!0),this._opaquePass=o(e.opaquePass,y.OPAQUE),this._instances=P(this,e.instances),this._batchTable=e.batchTable,this._model=void 0,this._vertexBufferTypedArray=void 0,this._vertexBuffer=void 0,this._batchIdBuffer=void 0,this._instancedUniformsByProgram=void 0,this._drawCommands=[],this._pickCommands=[],this._modelCommands=void 0,this._boundingSphere=I(this),this._center=t.clone(this._boundingSphere.center),this._rtcTransform=new d,this._rtcModelView=new d,this._mode=void 0,this.modelMatrix=d.clone(d.IDENTITY),this._modelMatrix=d.clone(this.modelMatrix),this._url=p.createIfNeeded(e.url),this._requestType=e.requestType,this._gltf=e.gltf,this._basePath=p.createIfNeeded(e.basePath),this._asynchronous=e.asynchronous,this._incrementallyLoadTextures=e.incrementallyLoadTextures,this._upAxis=e.upAxis,this.shadows=o(e.shadows,E.ENABLED),this._shadows=this.shadows,this.debugShowBoundingVolume=o(e.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=o(e.debugWireframe,!1),this._debugWireframe=!1}function P(e,t){t=o(t,[]);for(var r=t.length,i=new Array(r),n=0;n<r;++n){var a=t[n],s=a.modelMatrix,l=o(a.batchId,n);i[n]=new T(e,s,l)}return i}function I(r){for(var i=r.length,n=new Array(i),o=0;o<i;++o)n[o]=d.getTranslation(r._instances[o]._modelMatrix,new t);return e.fromPoints(n)}function D(e,t){if(a(e._instancedUniformsByProgram))return e._instancedUniformsByProgram[t];var r={};e._instancedUniformsByProgram=r;var i=["MODEL","MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELINVERSE","MODELVIEWINVERSE","MODELVIEWPROJECTIONINVERSE","MODELINVERSETRANSPOSE","MODELVIEWINVERSETRANSPOSE"],n=["MODELVIEW","CESIUM_RTC_MODELVIEW","MODELVIEWPROJECTION","MODELVIEWINVERSETRANSPOSE"],o=e._model.gltf,s=o.techniques;for(var l in s)if(s.hasOwnProperty(l)){var u=s[l],c=u.parameters,d=u.uniforms,h=u.program;if(!a(r[h])){var p={};r[h]=p;for(var m in d)if(d.hasOwnProperty(m)){var g=d[m],_=c[g],v=_.semantic;if(a(v)&&i.indexOf(v)>-1){if(!(n.indexOf(v)>-1))throw new f('Shader program cannot be optimized for instancing. Parameter "'+_+'" in program "'+t+'" uses unsupported semantic "'+v+'"');p[m]=v}}}}return r[t]}function O(e){return function(t,r){var i=D(e,r),n=a(e._batchTable),o=b.replaceMain(t,"czm_instancing_main"),s="",l="";for(var u in i)if(i.hasOwnProperty(u)){var c,d=i[u];"MODELVIEW"===d||"CESIUM_RTC_MODELVIEW"===d?c="czm_instanced_modelView":"MODELVIEWPROJECTION"===d?(c="czm_instanced_modelViewProjection",s+="mat4 czm_instanced_modelViewProjection;\n",l+="czm_instanced_modelViewProjection = czm_projection * czm_instanced_modelView;\n"):"MODELVIEWINVERSETRANSPOSE"===d&&(c="czm_instanced_modelViewInverseTranspose",s+="mat3 czm_instanced_modelViewInverseTranspose;\n",l+="czm_instanced_modelViewInverseTranspose = mat3(czm_instanced_modelView);\n");var h=new RegExp("uniform.*"+u+".*");o=o.replace(h,""),h=new RegExp(u+"\\b","g"),o=o.replace(h,c)}var p=n?"attribute float a_batchId;\n":"",f="uniform mat4 czm_instanced_modifiedModelView;\nuniform mat4 czm_instanced_nodeTransform;\n"+s+"mat4 czm_instanced_modelView;\nattribute vec4 czm_modelMatrixRow0;\nattribute vec4 czm_modelMatrixRow1;\nattribute vec4 czm_modelMatrixRow2;\n"+p+o+"void main()\n{\n    mat4 czm_instanced_model = mat4(czm_modelMatrixRow0.x, czm_modelMatrixRow1.x, czm_modelMatrixRow2.x, 0.0, czm_modelMatrixRow0.y, czm_modelMatrixRow1.y, czm_modelMatrixRow2.y, 0.0, czm_modelMatrixRow0.z, czm_modelMatrixRow1.z, czm_modelMatrixRow2.z, 0.0, czm_modelMatrixRow0.w, czm_modelMatrixRow1.w, czm_modelMatrixRow2.w, 1.0);\n    czm_instanced_modelView = czm_instanced_modifiedModelView * czm_instanced_model * czm_instanced_nodeTransform;\n"+l+"    czm_instancing_main();\n}";if(ae=f,n){var m=e._model.gltf,g=w.getDiffuseAttributeOrUniform(m,r);f=e._batchTable.getVertexShaderCallback(!0,"a_batchId",g)(f)}return f}}function M(e){return function(t,r){var i=e._batchTable;if(a(i)){var n=e._model.gltf,o=w.getDiffuseAttributeOrUniform(n,r);t=i.getFragmentShaderCallback(!0,o)(t)}return t}}function R(e){return function(t){t=ae;var r=a(e._batchTable),i=e._allowPicking;return r?t=e._batchTable.getPickVertexShaderCallback("a_batchId")(t):i&&(t=b.createPickVertexShaderSource(t)),t}}function L(e){return function(t){var r=a(e._batchTable),i=e._allowPicking;return r?t=e._batchTable.getPickFragmentShaderCallback()(t):i&&(t=b.createPickFragmentShaderSource(t,"varying")),t}}function N(e,t){return function(){return d.multiply(t.uniformState.view,e._rtcTransform,e._rtcModelView)}}function k(e){return function(){return e.computedMatrix}}function F(e,t){return function(i,n,o){i=r(i),i.czm_instanced_modifiedModelView=N(e,t),i.czm_instanced_nodeTransform=k(o);var s=D(e,n);for(var l in s)s.hasOwnProperty(l)&&delete i[l];return a(e._batchTable)&&(i=e._batchTable.getUniformMapCallback()(i)),i}}function B(e){return function(t){return a(e._batchTable)&&(t=e._batchTable.getPickUniformMapCallback()(t)),t}}function U(e){return function(t,r){if(a(e._batchTable)){var i=e._model.gltf,n=w.getDiffuseAttributeOrUniform(i,r);t=e._batchTable.getVertexShaderCallback(!0,"a_batchId",n)(t),t="uniform float a_batchId\n;"+t}return t}}function V(e){return function(t){return a(e._batchTable)&&(t=e._batchTable.getPickVertexShaderCallback("a_batchId")(t),t="uniform float a_batchId\n;"+t),t}}function z(e){return function(t){var r=a(e._batchTable),i=e._allowPicking;return r?t=e._batchTable.getPickFragmentShaderCallback()(t):i&&(t=b.createPickFragmentShaderSource(t,"uniform")),t}}function G(e){
return function(t){return a(e._batchTable)&&(t=e._batchTable.getUniformMapCallback()(t)),t}}function H(e){var t=e._instances,r=e.length,i=e._center,n=e._vertexBufferTypedArray;a(n)||(n=new Float32Array(12*r)),e._dynamic&&(e._vertexBufferTypedArray=n);for(var o=0;o<r;++o){var s=t[o]._modelMatrix,l=d.clone(s,oe);l[12]-=i.x,l[13]-=i.y,l[14]-=i.z;var u=12*o;n[u+0]=l[0],n[u+1]=l[4],n[u+2]=l[8],n[u+3]=l[12],n[u+4]=l[1],n[u+5]=l[5],n[u+6]=l[9],n[u+7]=l[13],n[u+8]=l[2],n[u+9]=l[6],n[u+10]=l[10],n[u+11]=l[14]}return n}function W(e,t){var r,n=e._instances,o=e.length,s=e._dynamic,l=a(e._batchTable),u=e._allowPicking;if(l){var c=new Uint16Array(o);for(r=0;r<o;++r)c[r]=n[r]._instanceId;e._batchIdBuffer=g.createVertexBuffer({context:t,typedArray:c,usage:_.STATIC_DRAW})}if(u&&!l){var d=new Uint8Array(4*o);for(r=0;r<o;++r){var h=e._pickIds[r],p=h.color,f=4*r;d[f]=i.floatToByte(p.red),d[f+1]=i.floatToByte(p.green),d[f+2]=i.floatToByte(p.blue),d[f+3]=i.floatToByte(p.alpha)}e._pickIdBuffer=g.createVertexBuffer({context:t,typedArray:d,usage:_.STATIC_DRAW})}var m=H(e);e._vertexBuffer=g.createVertexBuffer({context:t,typedArray:m,usage:s?_.STREAM_DRAW:_.STATIC_DRAW})}function j(e){var t=H(e);e._vertexBuffer.copyFromArrayView(t)}function q(e,t){for(var r=e._instances,i=r.length,n=new Array(i),o=0;o<i;++o)n[o]=t.createPickId(r[o]);return n}function Y(e,t){var r=e._instancingSupported,i=a(e._batchTable),o=e._allowPicking,s={url:e._url,requestType:e._requestType,gltf:e._gltf,basePath:e._basePath,shadows:e._shadows,cacheKey:void 0,asynchronous:e._asynchronous,allowPicking:o,incrementallyLoadTextures:e._incrementallyLoadTextures,upAxis:e._upAxis,precreatedAttributes:void 0,vertexShaderLoaded:void 0,fragmentShaderLoaded:void 0,uniformMapLoaded:void 0,pickVertexShaderLoaded:void 0,pickFragmentShaderLoaded:void 0,pickUniformMapLoaded:void 0,ignoreCommands:!0,opaquePass:e._opaquePass};if(o&&!i&&(e._pickIds=q(e,t)),r){W(e,t);var l=n.getSizeInBytes(n.FLOAT),u={czm_modelMatrixRow0:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:n.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:12*l,instanceDivisor:1},czm_modelMatrixRow1:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:n.FLOAT,normalize:!1,offsetInBytes:4*l,strideInBytes:12*l,instanceDivisor:1},czm_modelMatrixRow2:{index:0,vertexBuffer:e._vertexBuffer,componentsPerAttribute:4,componentDatatype:n.FLOAT,normalize:!1,offsetInBytes:8*l,strideInBytes:12*l,instanceDivisor:1}};i&&(u.a_batchId={index:0,vertexBuffer:e._batchIdBuffer,componentsPerAttribute:1,componentDatatype:n.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),o&&!i&&(u.pickColor={index:0,vertexBuffer:e._pickIdBuffer,componentsPerAttribute:4,componentDatatype:n.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1}),s.precreatedAttributes=u,s.vertexShaderLoaded=O(e),s.fragmentShaderLoaded=M(e),s.uniformMapLoaded=F(e,t),s.pickVertexShaderLoaded=R(e),s.pickFragmentShaderLoaded=L(e),s.pickUniformMapLoaded=B(e),a(e._url)&&(s.cacheKey=e._url.getUrlComponent()+"#instanced")}else s.vertexShaderLoaded=U(e),s.fragmentShaderLoaded=M(e),s.uniformMapLoaded=G(e,t),s.pickVertexShaderLoaded=V(e),s.pickFragmentShaderLoaded=z(e),s.pickUniformMapLoaded=B(e);a(e._url)?e._model=S.fromGltf(s):e._model=new S(s)}function X(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?h.LINES:h.TRIANGLES,r=e._drawCommands,i=r.length,n=0;n<i;++n)r[n].primitiveType=t}}function Q(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e._drawCommands,r=t.length,i=0;i<r;++i)t[i].debugShowBoundingVolume=e.debugShowBoundingVolume}}function Z(e,t,r){for(var i=t.length,n=e.length,o=e.allowPicking,a=e._boundingSphere,s=e._cull,l=0;l<i;++l){var u=v.shallowClone(t[l]);if(u.instanceCount=n,u.boundingVolume=a,u.cull=s,e._drawCommands.push(u),o){var c=v.shallowClone(r[l]);c.instanceCount=n,c.boundingVolume=a,c.cull=s,e._pickCommands.push(c)}}}function K(e){return function(){return e}}function J(e){return function(){return e}}function $(t,i,n){for(var o=t._instances,s=i.length,l=t.length,u=t.allowPicking,c=a(t._batchTable),h=t._cull,p=0;p<s;++p)for(var f=0;f<l;++f){var m=v.shallowClone(i[p]);if(m.modelMatrix=new d,m.boundingVolume=new e,m.cull=h,m.uniformMap=r(m.uniformMap),c&&(m.uniformMap.a_batchId=K(o[f]._instanceId)),t._drawCommands.push(m),u){var g=v.shallowClone(n[p]);if(g.modelMatrix=new d,g.boundingVolume=new e,g.cull=h,g.uniformMap=r(g.uniformMap),c)g.uniformMap.a_batchId=K(o[f]._instanceId);else if(u){var _=t._pickIds[f];g.uniformMap.czm_pickColor=J(_.color)}t._pickCommands.push(g)}}}function ee(t){for(var r=t._modelCommands,i=r.length,n=t.length,o=t.allowPicking,a=t._rtcTransform,s=t._center,l=0;l<i;++l)for(var u=r[l],c=0;c<n;++c){var h=l*n+c,p=t._drawCommands[h],f=d.clone(t._instances[c]._modelMatrix,oe);f[12]-=s.x,f[13]-=s.y,f[14]-=s.z,f=d.multiply(a,f,oe);var m=u.modelMatrix,g=p.modelMatrix;d.multiply(f,m,g);var _=u.boundingVolume,v=p.boundingVolume;if(e.transform(_,f,v),o){var y=t._pickCommands[h];d.clone(g,y.modelMatrix),e.clone(v,y.boundingVolume)}}}function te(e){for(var t=e._nodeCommands,r=t.length,i=[],n=[],o=0;o<r;++o){var a=t[o];a.show&&(i.push(a.command),n.push(a.pickCommand))}return{draw:i,pick:n}}function re(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=E.castShadows(e.shadows),r=E.receiveShadows(e.shadows),i=e._drawCommands,n=i.length,o=0;o<n;++o){var a=i[o];a.castShadows=t,a.receiveShadows=r}}}var ie={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3};s(x.prototype,{allowPicking:{get:function(){return this._allowPicking}},length:{get:function(){return this._instances.length}},activeAnimations:{get:function(){return this._model.activeAnimations}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}});var ne=new t,oe=new d;x.prototype.expandBoundingSphere=function(t){var r=d.getTranslation(t,ne);e.expand(this._boundingSphere,r,this._boundingSphere)};var ae;return x.prototype.update=function(e){if(e.mode!==A.MORPHING&&this.show&&0!==this.length){var r=e.context;if(this._state===ie.NEEDS_LOAD){this._state=ie.LOADING,this._instancingSupported=r.instancedArrays,Y(this,r);var i=this;this._model.readyPromise.otherwise(function(e){i._state=ie.FAILED,i._readyPromise.reject(e)})}var n=this._instancingSupported,o=this._model;if(o.update(e),o.ready&&this._state===ie.LOADING){this._state=ie.LOADED,this._ready=!0;var a=o.boundingSphere.radius+t.magnitude(o.boundingSphere.center);this._boundingSphere.radius+=a;var s=te(o);return this._modelCommands=s.draw,n?Z(this,s.draw,s.pick):($(this,s.draw,s.pick),ee(this)),void this._readyPromise.resolve(this)}if(this._state===ie.LOADED){var l=e.mode!==this._mode,u=this.modelMatrix,c=!d.equals(this._modelMatrix,u);if(l||c){this._mode=e.mode,d.clone(u,this._modelMatrix);var h=d.multiplyByTranslation(this._modelMatrix,this._center,this._rtcTransform);this._mode!==A.SCENE3D&&(h=m.basisTo2D(e.mapProjection,h,h)),d.getTranslation(h,this._boundingSphere.center)}n&&this._dirty&&(this._dynamic=!0,this._dirty=!1,j(this)),!n&&(o.dirty||this._dirty||l||c)&&ee(this),re(this),X(this),Q(this);for(var p=e.passes,f=e.commandList,g=p.render?this._drawCommands:this._pickCommands,_=g.length,v=0;v<_;++v)f.push(g[v])}}},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._model=this._model&&this._model.destroy();var e=this._pickIds;if(a(e))for(var t=e.length,r=0;r<t;++r)e[r].destroy();return u(this)},x}),define("Scene/Instanced3DModel3DTileContent",["../Core/AttributeCompression","../Core/Cartesian3","../Core/ClippingPlaneCollection","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/getBaseUri","../Core/getStringFromTypedArray","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/RequestType","../Core/RuntimeError","../Core/Transforms","../Core/TranslationRotationScale","../Renderer/Pass","./Cesium3DTileBatchTable","./Cesium3DTileFeature","./Cesium3DTileFeatureTable","./ModelInstanceCollection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E){"use strict";function x(e,t,r,i,n){this._tileset=e,this._tile=t,this._resource=r,this._modelInstanceCollection=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,P(this,i,n)}function P(r,i,s){var l=o(s,0);s=l;var u=new Uint8Array(i),c=new DataView(i);s+=D;var h=c.getUint32(s,!0);if(1!==h)throw new y("Only Instanced 3D Model version 1 is supported. Version "+h+" is not.");s+=D;var p=c.getUint32(s,!0);s+=D;var w=c.getUint32(s,!0);if(0===w)throw new y("featureTableJsonByteLength is zero, the feature table must be defined.");s+=D;var P=c.getUint32(s,!0);s+=D;var I=c.getUint32(s,!0);s+=D;var R=c.getUint32(s,!0);s+=D;var L=c.getUint32(s,!0);if(1!==L&&0!==L)throw new y("Only glTF format 0 (uri) or 1 (embedded) are supported. Format "+L+" is not.");s+=D;var N=f(u,s,w),k=JSON.parse(N);s+=w;var F=new Uint8Array(i,s,P);s+=P;var B=new A(k,F),U=B.getGlobalProperty("INSTANCES_LENGTH");if(B.featuresLength=U,!a(U))throw new y("Feature table global property: INSTANCES_LENGTH must be defined");var V,z;if(I>0){var G=f(u,s,I);V=JSON.parse(G),s+=I,R>0&&(z=new Uint8Array(i,s,R),z=new Uint8Array(z),s+=R)}r._batchTable=new T(r,U,V,z);var H=l+p-s;if(0===H)throw new y("glTF byte length is zero, i3dm must have a glTF to instance.");var W;s%4==0?W=new Uint8Array(i,s,H):(x._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),W=new Uint8Array(u.subarray(s,s+H)));var j={instances:new Array(U),batchTable:r._batchTable,cull:!1,url:void 0,requestType:v.TILES3D,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,upAxis:r._tileset._gltfUpAxis,opaquePass:S.CESIUM_3D_TILE};if(0===L){var q=f(W);q=q.replace(/[\s\0]+$/,""),j.url=r._resource.getDerivedResource({url:q})}else j.gltf=W,j.basePath=r._resource.clone();var Y,X=B.getGlobalProperty("EAST_NORTH_UP"),Q=B.getGlobalProperty("RTC_CENTER",n.FLOAT,3);a(Q)&&(Y=t.unpack(Q));for(var Z=j.instances,K=new t,J=new Array(3),$=new t,ee=new t,te=new t,re=new m,ie=new _,ne=new t,oe=new C,ae=new g,se=0;se<U;se++){var le=B.getProperty("POSITION",n.FLOAT,3,se,O);if(!a(le)){le=J;var ue=B.getProperty("POSITION_QUANTIZED",n.UNSIGNED_SHORT,3,se,O);if(!a(ue))throw new y("Either POSITION or POSITION_QUANTIZED must be defined for each instance.");var ce=B.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",n.FLOAT,3);if(!a(ce))throw new y("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var de=B.getGlobalProperty("QUANTIZED_VOLUME_SCALE",n.FLOAT,3);if(!a(de))throw new y("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var he=0;he<3;he++)le[he]=ue[he]/65535*de[he]+ce[he]}t.unpack(le,0,K),a(Y)&&t.add(K,Y,K),oe.translation=K;var pe=B.getProperty("NORMAL_UP",n.FLOAT,3,se,O),fe=B.getProperty("NORMAL_RIGHT",n.FLOAT,3,se,M),me=!1;if(a(pe)){if(!a(fe))throw new y("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");t.unpack(pe,0,ee),t.unpack(fe,0,$),me=!0}else{var ge=B.getProperty("NORMAL_UP_OCT32P",n.UNSIGNED_SHORT,2,se,O),_e=B.getProperty("NORMAL_RIGHT_OCT32P",n.UNSIGNED_SHORT,2,se,M);if(a(ge)){if(!a(_e))throw new y("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");e.octDecodeInRange(ge[0],ge[1],65535,ee),e.octDecodeInRange(_e[0],_e[1],65535,$),me=!0}else X?(b.eastNorthUpToFixedFrame(K,d.WGS84,ae),g.getRotation(ae,re)):m.clone(m.IDENTITY,re)}me&&(t.cross($,ee,te),t.normalize(te,te),m.setColumn(re,0,$,re),m.setColumn(re,1,ee,re),m.setColumn(re,2,te,re)),_.fromRotationMatrix(re,ie),oe.rotation=ie,ne=t.fromElements(1,1,1,ne);var ve=B.getProperty("SCALE",n.FLOAT,1,se);a(ve)&&t.multiplyByScalar(ne,ve,ne);var ye=B.getProperty("SCALE_NON_UNIFORM",n.FLOAT,3,se,O);a(ye)&&(ne.x*=ye[0],ne.y*=ye[1],ne.z*=ye[2]),oe.scale=ne;var be=B.getProperty("BATCH_ID",n.UNSIGNED_SHORT,1,se);a(be)||(be=se),g.fromTranslationRotationScale(oe,ae);var Ce=ae.clone();Z[se]={modelMatrix:Ce,batchId:be}}r._modelInstanceCollection=new E(j)}function I(e){var t=e.featuresLength;if(!a(e._features)&&t>0){for(var r=new Array(t),i=0;i<t;++i)r[i]=new w(e,i);e._features=r}}if(!h.supportsTypedArrays())return{};x._deprecationWarning=l,s(x.prototype,{featuresLength:{get:function(){return this._batchTable.featuresLength}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){var e=this._modelInstanceCollection._model;return a(e)?e.trianglesLength:0}},geometryByteLength:{get:function(){var e=this._modelInstanceCollection._model;return a(e)?e.geometryByteLength:0}},texturesByteLength:{get:function(){var e=this._modelInstanceCollection._model;return a(e)?e.texturesByteLength:0}},batchTableByteLength:{get:function(){return this._batchTable.memorySizeInBytes}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._modelInstanceCollection.readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var D=Uint32Array.BYTES_PER_ELEMENT,O=new Array(4),M=new Array(4);return x.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},x.prototype.getFeature=function(e){this.featuresLength;return I(this),this._features[e]},x.prototype.applyDebugSettings=function(e,t){t=e?t:i.WHITE,this._batchTable.setAllColor(t)},x.prototype.applyStyle=function(e,t){this._batchTable.applyStyle(e,t)},x.prototype.update=function(e,t){var i=t.commandList.length;this._batchTable.update(e,t),this._modelInstanceCollection.modelMatrix=this._tile.computedTransform,this._modelInstanceCollection.shadows=this._tileset.shadows,this._modelInstanceCollection.debugWireframe=this._tileset.debugWireframe,this._modelInstanceCollection.update(t);var n=this._tileset.clippingPlanes,o=this._modelInstanceCollection._model,s=o.clippingPlanes;a(n)?(a(s)||(o.clippingPlanes=new r,s=o.clippingPlanes),n.clone(s),s.enabled=n.enabled&&this._tile._isClipped):a(s)&&s.enabled&&(s.enabled=!1),i<t.commandList.length&&t.passes.render&&this._batchTable.addDerivedCommands(t,i,!1)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this._modelInstanceCollection=this._modelInstanceCollection&&this._modelInstanceCollection.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),u(this)},x}),define("Scene/PointCloud3DTileContent",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ClippingPlaneCollection","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/getStringFromTypedArray","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/oneTimeWarning","../Core/OrthographicFrustum","../Core/Plane","../Core/PrimitiveType","../Core/RuntimeError","../Core/Transforms","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./BlendingState","./Cesium3DTileBatchTable","./Cesium3DTileFeature","./Cesium3DTileFeatureTable","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F){"use strict";function B(e,t,r,i,o){this._tileset=e,this._tile=t,this._resource=r,this._parsedContent=void 0,this._drawCommand=void 0,this._pickCommand=void 0,this._pickId=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=n.clone(n.WHITE),this._rtcCenter=void 0,this._batchTable=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._isClipped=!1,this._unionClippingRegions=!1,this.backFaceCulling=!1,this._backFaceCulling=!1,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._highlightColor=n.clone(n.WHITE),this._pointSize=1,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._modelMatrix=g.clone(g.IDENTITY),this._mode=void 0,this._readyPromise=O.defer(),this._pointsLength=0,this._geometryByteLength=0,this._features=void 0,this._packedClippingPlanes=[],this._modelViewMatrix=g.clone(g.IDENTITY),this.featurePropertiesDirty=!1,this._attenuation=!1,this._geometricErrorScale=void 0,this._maximumAttenuation=void 0,this._baseResolution=void 0,this._baseResolutionApproximation=void 0,U(this,i,o)}function U(e,r,i){i=s(i,0);var o=new Uint8Array(r),u=new DataView(r);i+=q;var c=u.getUint32(i,!0);if(1!==c)throw new C("Only Point Cloud tile version 1 is supported.  Version "+c+" is not.");i+=q,i+=q;var d=u.getUint32(i,!0);if(0===d)throw new C("Feature table must have a byte length greater than zero");i+=q;var h=u.getUint32(i,!0);i+=q;var m=u.getUint32(i,!0);i+=q;var g=u.getUint32(i,!0);i+=q;var v=p(o,i,d),y=JSON.parse(v);i+=d;var b=new Uint8Array(r,i,h);i+=h;var S,T;if(m>0){var w=p(o,i,m);S=JSON.parse(w),i+=m,g>0&&(T=new Uint8Array(r,i,g),i+=g)}var A=new N(y,b),E=A.getGlobalProperty("POINTS_LENGTH");if(A.featuresLength=E,!l(E))throw new C("Feature table global property: POINTS_LENGTH must be defined");var x,P=!1;if(l(y.POSITION)){x=A.getPropertyArray("POSITION",a.FLOAT,3);var I=A.getGlobalProperty("RTC_CENTER",a.FLOAT,3);l(I)&&(e._rtcCenter=t.unpack(I))}else if(l(y.POSITION_QUANTIZED)){x=A.getPropertyArray("POSITION_QUANTIZED",a.UNSIGNED_SHORT,3),P=!0;var D=A.getGlobalProperty("QUANTIZED_VOLUME_SCALE",a.FLOAT,3);if(!l(D))throw new C("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");e._quantizedVolumeScale=t.unpack(D);var O=A.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",a.FLOAT,3);if(!l(O))throw new C("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e._quantizedVolumeOffset=t.unpack(O)}if(!l(x))throw new C("Either POSITION or POSITION_QUANTIZED must be defined.");var M,L=!1,k=!1;if(l(y.RGBA))M=A.getPropertyArray("RGBA",a.UNSIGNED_BYTE,4),L=!0;else if(l(y.RGB))M=A.getPropertyArray("RGB",a.UNSIGNED_BYTE,3);else if(l(y.RGB565))M=A.getPropertyArray("RGB565",a.UNSIGNED_SHORT,1),k=!0;else if(l(y.CONSTANT_RGBA)){var F=A.getGlobalProperty("CONSTANT_RGBA",a.UNSIGNED_BYTE,4);e._constantColor=n.fromBytes(F[0],F[1],F[2],F[3],e._constantColor)}else e._constantColor=n.clone(n.DARKGRAY,e._constantColor);e._isTranslucent=L;var B,U=!1;l(y.NORMAL)?B=A.getPropertyArray("NORMAL",a.FLOAT,3):l(y.NORMAL_OCT16P)&&(B=A.getPropertyArray("NORMAL_OCT16P",a.UNSIGNED_BYTE,2),U=!0);var V;if(l(y.BATCH_ID)){V=A.getPropertyArray("BATCH_ID",a.UNSIGNED_SHORT,1);var z=A.getGlobalProperty("BATCH_LENGTH");if(!l(z))throw new C("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");l(T)&&(T=new Uint8Array(T)),e._batchTable=new R(e,z,S,T)}var G;if(!l(V)&&l(T)){G=R.getBinaryProperties(E,S,T);for(var H in G)if(G.hasOwnProperty(H)){var W=G[H],j=W.typedArray,Y=a.fromTypedArray(j);Y!==a.INT&&Y!==a.UNSIGNED_INT&&Y!==a.DOUBLE||(_("Cast pnts property to floats",'Point cloud property "'+H+'" will be casted to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.'),W.typedArray=new Float32Array(j))}}e._parsedContent={positions:x,colors:M,normals:B,batchIds:V,styleableProperties:G},e._pointsLength=E,e._isQuantized=P,e._isOctEncoded16P=U,e._isRGB565=k,e._hasColors=l(M),e._hasNormals=l(B),e._hasBatchIds=l(V);var X=e._tile.contentBoundingVolume.boundingSphere.volume();e._baseResolutionApproximation=f.cbrt(X/E)}function V(e,t){var r=t.context,i=e._parsedContent,s=e._pointsLength,u=i.positions,c=i.colors,d=i.normals,h=i.batchIds,p=i.styleableProperties,f=l(p),m=e._isQuantized,_=e._isOctEncoded16P,y=e._isRGB565,C=e._isTranslucent,S=e._hasColors,P=e._hasNormals,I=e._hasBatchIds,O=e._batchTable,R=l(O),L=[],N={};if(e._styleableShaderAttributes=N,f){var F=J;for(var B in p)if(p.hasOwnProperty(B)){var U=p[B],V=U.typedArray,z=U.componentCount,G=a.fromTypedArray(V),H=T.createVertexBuffer({context:r,typedArray:U.typedArray,usage:w.STATIC_DRAW});e._geometryByteLength+=H.sizeInBytes;var W={index:F,vertexBuffer:H,componentsPerAttribute:z,componentDatatype:G,normalize:!1,offsetInBytes:0,strideInBytes:0};L.push(W),N[B]={location:F,componentCount:z},++F}}var j={u_pointSizeAndTilesetTimeAndGeometricErrorAndDepthMultiplier:function(){var i=Y;if(i.x=e._attenuation?e._maximumAttenuation:e._pointSize,i.y=e._tileset.timeSinceLoad,e._attenuation){var n=e.tile.geometricError;0===n&&(n=l(e._baseResolution)?e._baseResolution:e._baseResolutionApproximation);var o,a=t.camera.frustum;o=t.mode===k.SCENE2D||a instanceof v?Number.POSITIVE_INFINITY:r.drawingBufferHeight/t.camera.frustum.sseDenominator,i.z=n*e._geometricErrorScale,i.w=o}return i},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanesLength:function(){return e._packedClippingPlanes.length},u_clippingPlanes:function(){return e._packedClippingPlanes},u_clippingPlanesEdgeStyle:function(){var t=e._tileset.clippingPlanes;if(!l(t))return n.WHITE.withAlpha(0);var r=n.clone(t.edgeColor);return r.alpha=t.edgeWidth,r}};m&&(j=o(j,{u_quantizedVolumeScale:function(){return e._quantizedVolumeScale}}));var q=T.createVertexBuffer({context:r,typedArray:u,usage:w.STATIC_DRAW});e._geometryByteLength+=q.sizeInBytes;var $;S&&($=T.createVertexBuffer({context:r,typedArray:c,usage:w.STATIC_DRAW}),e._geometryByteLength+=$.sizeInBytes);var ee;P&&(ee=T.createVertexBuffer({context:r,typedArray:d,usage:w.STATIC_DRAW}),e._geometryByteLength+=ee.sizeInBytes);var te;I&&(te=T.createVertexBuffer({context:r,typedArray:h,usage:w.STATIC_DRAW}),e._geometryByteLength+=te.sizeInBytes);var re=[];if(m?re.push({index:X,vertexBuffer:q,componentsPerAttribute:3,componentDatatype:a.UNSIGNED_SHORT,normalize:!0,offsetInBytes:0,strideInBytes:0}):re.push({index:X,vertexBuffer:q,componentsPerAttribute:3,componentDatatype:a.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:0}),S)if(y)re.push({index:Q,vertexBuffer:$,componentsPerAttribute:1,componentDatatype:a.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{var ie=C?4:3;re.push({index:Q,vertexBuffer:$,componentsPerAttribute:ie,componentDatatype:a.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}P&&(_?re.push({index:Z,vertexBuffer:ee,componentsPerAttribute:2,componentDatatype:a.UNSIGNED_BYTE,normalize:!1,offsetInBytes:0,strideInBytes:0}):re.push({index:Z,vertexBuffer:ee,componentsPerAttribute:3,componentDatatype:a.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:0})),I&&re.push({index:K,vertexBuffer:te,componentsPerAttribute:1,componentDatatype:a.fromTypedArray(h),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(re=re.concat(L));var ne=new D({context:r,attributes:re}),oe=j;R&&(oe=O.getUniformMapCallback()(j));var ae;R?ae=O.getPickUniformMapCallback()(j):(e._pickId=r.createPickId({primitive:e._tileset,content:e}),ae=o(j,{czm_pickColor:function(){return e._pickId.color}})),e._opaqueRenderState=x.fromCache({depthTest:{enabled:!0}}),e._translucentRenderState=x.fromCache({depthTest:{enabled:!0},depthMask:!1,blending:M.ALPHA_BLEND}),e._drawCommand=new A({boundingVolume:void 0,cull:!1,modelMatrix:new g,primitiveType:b.POINTS,vertexArray:ne,count:s,shaderProgram:void 0,uniformMap:oe,renderState:C?e._translucentRenderState:e._opaqueRenderState,pass:C?E.TRANSLUCENT:E.CESIUM_3D_TILE,owner:e,castShadows:!1,receiveShadows:!1}),e._pickCommand=new A({boundingVolume:void 0,cull:!1,modelMatrix:new g,primitiveType:b.POINTS,vertexArray:ne,count:s,shaderProgram:void 0,uniformMap:ae,renderState:C?e._translucentRenderState:e._opaqueRenderState,pass:C?E.TRANSLUCENT:E.CESIUM_3D_TILE,owner:e})}function z(e,t){for(var r=/czm_tiles3d_style_(\w+)/g,i=r.exec(e);null!==i;){var n=i[1];-1===t.indexOf(n)&&t.push(n),i=r.exec(e)}}function G(e,t){for(var r=e.numberOfAttributes,i=0;i<r;++i){var n=e.getAttribute(i);if(n.index===t)return n}}function H(e){for(var t=$.length,r=0;r<t;++r){var i=$[r],n="czm_tiles3d_style_"+i,o=i.toLowerCase();e=e.replace(new RegExp(n+"(\\W)","g"),o+"$1")}return e.replace("()","(vec3 position, vec3 position_absolute, vec4 color, vec3 normal)")}function W(e,t,r){var n,o,a,s,u,c,d=t.context,h=e._batchTable,p=l(h),f=l(r),m=e._isQuantized,g=e._isOctEncoded16P,_=e._isRGB565,v=e._isTranslucent,y=e._hasColors,b=e._hasNormals,S=e._hasBatchIds,T=e._backFaceCulling,w=e._drawCommand.vertexArray,A=e._tileset.clippingPlanes,E=e._attenuation,x=v;if(p&&(f=!1),f){var D={translucent:!1};s=r.getColorShaderFunction("getColorFromStyle","czm_tiles3d_style_",D),u=r.getShowShaderFunction("getShowFromStyle","czm_tiles3d_style_",D),c=r.getPointSizeShaderFunction("getPointSizeFromStyle","czm_tiles3d_style_",D),l(s)&&D.translucent&&(x=!0)}e._styleTranslucent=x;var O=l(s),M=l(u),R=l(c),L=l(A)&&A.enabled&&e._tile._isClipped&&i.isSupported(),N=[];O&&(z(s,N),s=H(s)),M&&(z(u,N),u=H(u)),R&&(z(c,N),c=H(c));var k=N.indexOf("COLOR")>=0,F=N.indexOf("NORMAL")>=0,B=N.filter(function(e){return-1===$.indexOf(e)});if(F&&!b)throw new C("Style references the NORMAL semantic but the point cloud does not have normals");var U=e._styleableShaderAttributes;for(o in U)if(U.hasOwnProperty(o)){a=U[o];var V=B.indexOf(o)>=0,W=G(w,a.location);W.enabled=V}var j=y&&(!O||k);if(y){G(w,Q).enabled=j}var q={a_position:X};j&&(q.a_color=Q),b&&(q.a_normal=Z),S&&(q.a_batchId=K);var Y="",J=B.length;for(n=0;n<J;++n){if(o=B[n],a=U[o],!l(a))throw new C('Style references a property "'+o+'" that does not exist or is not styleable.');var ee,te=a.componentCount,re="czm_tiles3d_style_"+o;ee=1===te?"float":"vec"+te,Y+="attribute "+ee+" "+re+"; \n",q[re]=a.location}var ie="attribute vec3 a_position; \nvarying vec4 v_color; \nuniform vec4 u_pointSizeAndTilesetTimeAndGeometricErrorAndDepthMultiplier; \nuniform vec4 u_constantColor; \nuniform vec4 u_highlightColor; \n";ie+="float u_pointSize; \nfloat u_tilesetTime; \n",E&&(ie+="float u_geometricError; \nfloat u_depthMultiplier; \n"),ie+=Y,j&&(ie+=v?"attribute vec4 a_color; \n":_?"attribute float a_color; \nconst float SHIFT_RIGHT_11 = 1.0 / 2048.0; \nconst float SHIFT_RIGHT_5 = 1.0 / 32.0; \nconst float SHIFT_LEFT_11 = 2048.0; \nconst float SHIFT_LEFT_5 = 32.0; \nconst float NORMALIZE_6 = 1.0 / 64.0; \nconst float NORMALIZE_5 = 1.0 / 32.0; \n":"attribute vec3 a_color; \n"),b&&(ie+=g?"attribute vec2 a_normal; \n":"attribute vec3 a_normal; \n"),S&&(ie+="attribute float a_batchId; \n"),m&&(ie+="uniform vec3 u_quantizedVolumeScale; \n"),O&&(ie+=s),M&&(ie+=u),R&&(ie+=c),ie+="void main() \n{ \n    u_pointSize = u_pointSizeAndTilesetTimeAndGeometricErrorAndDepthMultiplier.x; \n    u_tilesetTime = u_pointSizeAndTilesetTimeAndGeometricErrorAndDepthMultiplier.y; \n",E&&(ie+="    u_geometricError = u_pointSizeAndTilesetTimeAndGeometricErrorAndDepthMultiplier.z; \n    u_depthMultiplier = u_pointSizeAndTilesetTimeAndGeometricErrorAndDepthMultiplier.w; \n"),ie+=j?v?"    vec4 color = a_color; \n":_?"    float compressed = a_color; \n    float r = floor(compressed * SHIFT_RIGHT_11); \n    compressed -= r * SHIFT_LEFT_11; \n    float g = floor(compressed * SHIFT_RIGHT_5); \n    compressed -= g * SHIFT_LEFT_5; \n    float b = compressed; \n    vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); \n    vec4 color = vec4(rgb, 1.0); \n":"    vec4 color = vec4(a_color, 1.0); \n":"    vec4 color = u_constantColor; \n",ie+=m?"    vec3 position = a_position * u_quantizedVolumeScale; \n":"    vec3 position = a_position; \n",ie+="    vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); \n",ie+=b?g?"    vec3 normal = czm_octDecode(a_normal); \n":"    vec3 normal = a_normal; \n":"    vec3 normal = vec3(1.0); \n",O&&(ie+="    color = getColorFromStyle(position, position_absolute, color, normal); \n"),M&&(ie+="    float show = float(getShowFromStyle(position, position_absolute, color, normal)); \n"),ie+=R?"    gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal); \n":E?"    vec4 positionEC = czm_modelView * vec4(position, 1.0); \n    float depth = -positionEC.z; \n    gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); \n":"    gl_PointSize = u_pointSize; \n",ie+="    color = color * u_highlightColor; \n",b&&(ie+="    normal = czm_normal * normal; \n    float diffuseStrength = czm_getLambertDiffuse(czm_sunDirectionEC, normal); \n    diffuseStrength = max(diffuseStrength, 0.4); \n    color.xyz *= diffuseStrength; \n"),ie+="    v_color = color; \n    gl_Position = czm_modelViewProjection * vec4(position, 1.0); \n",b&&T&&(ie+="    float visible = step(-normal.z, 0.0); \n    gl_Position *= visible; \n    gl_PointSize *= visible; \n"),M&&(ie+="    gl_Position *= show; \n    gl_PointSize *= show; \n"),ie+="} \n";var ne="varying vec4 v_color; \n";if(L&&(ne+="uniform int u_clippingPlanesLength;uniform vec4 u_clippingPlanes[czm_maxClippingPlanes]; \nuniform vec4 u_clippingPlanesEdgeStyle; \n"),ne+="void main() \n{ \n    gl_FragColor = v_color; \n",L){ne+="    float clipDistance = "+(A.unionClippingRegions?"czm_discardIfClippedWithUnion":"czm_discardIfClippedWithIntersect")+"(u_clippingPlanes, u_clippingPlanesLength); \n    vec4 clippingPlanesEdgeColor = vec4(1.0); \n    clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; \n    float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; \n    if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) \n    { \n        gl_FragColor = clippingPlanesEdgeColor; \n    } \n"}ne+="} \n";var oe=ie,ae=ne;p&&(oe=h.getVertexShaderCallback(!1,"a_batchId",void 0)(oe),ae=h.getFragmentShaderCallback(!1,void 0)(ae));var se=ie,le=ne;p?(se=h.getPickVertexShaderCallback("a_batchId")(se),le=h.getPickFragmentShaderCallback()(le)):le=I.createPickFragmentShaderSource(le,"uniform");var ue=e._drawCommand;l(ue.shaderProgram)&&ue.shaderProgram.destroy(),ue.shaderProgram=P.fromCache({context:d,vertexShaderSource:oe,fragmentShaderSource:ae,attributeLocations:q});var ce=e._pickCommand;l(ce.shaderProgram)&&ce.shaderProgram.destroy(),ce.shaderProgram=P.fromCache({context:d,vertexShaderSource:se,fragmentShaderSource:le,attributeLocations:q});try{ue.shaderProgram._bind()}catch(e){throw new C("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function j(e){var t=e.featuresLength;if(!l(e._features)&&t>0){for(var r=new Array(t),i=0;i<t;++i)r[i]=new L(e,i);e._features=r}}if(!h.supportsTypedArrays())return{};u(B.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return this._pointsLength}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return this._geometryByteLength}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var q=Uint32Array.BYTES_PER_ELEMENT,Y=new r,X=0,Q=1,Z=2,K=3,J=4,$=["POSITION","COLOR","NORMAL","POSITION_ABSOLUTE"];B.prototype.hasProperty=function(e,t){return!!l(this._batchTable)&&this._batchTable.hasProperty(e,t)},B.prototype.getFeature=function(e){if(l(this._batchTable)){
this.featuresLength;return j(this),this._features[e]}},B.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:n.WHITE},B.prototype.applyStyle=function(e,t){l(this._batchTable)?this._batchTable.applyStyle(e,t):W(this,e,t)};var ee=new r,te=new g;return B.prototype.update=function(e,t){var i=this._tile.computedTransform,n=!g.equals(this._modelMatrix,i),o=n||this._mode!==t.mode;this._mode=t.mode;var a=t.context,s=this._tileset.clippingPlanes,u=l(s)&&s.enabled&&this._tile._isClipped,c=!1,d=0;u&&(c=s.unionClippingRegions,d=s.length);var h=this._packedClippingPlanes;if(h.length!==d){h.length=d;for(var p=0;p<d;++p)h[p]=new r}l(this._drawCommand)||(V(this,t),W(this,t,e.style),o=!0,this._readyPromise.resolve(this),this._parsedContent=void 0),this._isClipped===u&&this._unionClippingRegions===c||(this._isClipped=u,this._unionClippingRegions=c,W(this,t,e.style));var f=this._tileset.pointCloudShading;if(l(f)){var m=this._attenuation;this._attenuation=f.attenuation,this._geometricErrorScale=f.geometricErrorScale,this._maximumAttenuation=l(f.maximumAttenuation)?f.maximumAttenuation:e.maximumScreenSpaceError,this._baseResolution=f.baseResolution,this._attenuation!==m&&W(this,t,e.style)}if(o){if(g.clone(i,this._modelMatrix),l(this._rtcCenter)?g.multiplyByTranslation(i,this._rtcCenter,this._drawCommand.modelMatrix):l(this._quantizedVolumeOffset)?g.multiplyByTranslation(i,this._quantizedVolumeOffset,this._drawCommand.modelMatrix):g.clone(i,this._drawCommand.modelMatrix),t.mode!==k.SCENE3D){var _=t.mapProjection;i=this._drawCommand.modelMatrix;var v=g.getColumn(i,3,ee);if(r.equals(v,r.UNIT_W)){var y=this._tile.boundingSphere.center,b=S.wgs84To2DModelMatrix(_,y,te);g.multiply(b,i,i)}else S.basisTo2D(_,i,i)}g.clone(this._drawCommand.modelMatrix,this._pickCommand.modelMatrix);var C;C=l(this._tile._contentBoundingVolume)?this._mode===k.SCENE3D?this._tile._contentBoundingVolume.boundingSphere:this._tile._contentBoundingVolume2D.boundingSphere:this._mode===k.SCENE3D?this._tile._boundingVolume.boundingSphere:this._tile._boundingVolume2D.boundingSphere,this._drawCommand.boundingVolume=C,this._pickCommand.boundingVolume=C}u&&(g.multiply(a.uniformState.view3D,i,this._modelViewMatrix),s.transformAndPackPlanes(this._modelViewMatrix,h)),this._drawCommand.castShadows=F.castShadows(e.shadows),this._drawCommand.receiveShadows=F.receiveShadows(e.shadows),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,W(this,t,e.style));var T=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=T?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=T?E.TRANSLUCENT:E.CESIUM_3D_TILE,l(this._batchTable)&&this._batchTable.update(e,t);var w=t.commandList,A=t.passes;A.render&&w.push(this._drawCommand),A.pick&&w.push(this._pickCommand)},B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){var e=this._drawCommand,t=this._pickCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._batchTable=this._batchTable&&this._batchTable.destroy(),c(this)},B}),define("Scene/Tileset3DTileContent",["../Core/defaultValue","../Core/defineProperties","../Core/destroyObject","../Core/getStringFromTypedArray","../Core/RuntimeError","../ThirdParty/when"],function(e,t,r,i,n,o){"use strict";function a(e,t,r,i,n){this._tileset=e,this._tile=t,this._resource=r,this._readyPromise=o.defer(),this.featurePropertiesDirty=!1,s(this,i,n)}function s(t,r,o){o=e(o,0);var a,s=new Uint8Array(r),l=i(s,o);try{a=JSON.parse(l)}catch(e){return void t._readyPromise.reject(new n("Invalid tile content."))}t._tileset.loadTileset(t._resource,a,t._tile),t._readyPromise.resolve(t)}return t(a.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}}}),a.prototype.hasProperty=function(e,t){return!1},a.prototype.getFeature=function(e){},a.prototype.applyDebugSettings=function(e,t){},a.prototype.applyStyle=function(e,t){},a.prototype.update=function(e,t){},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return r(this)},a}),define("Scene/Cesium3DTilePointFeature",["../Core/Cartesian3","../Core/Cartographic","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","./createBillboardPointCallback"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r,i,n){this._content=e,this._billboard=r,this._label=i,this._polyline=n,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,u(this)}function u(e){var t=e._billboard;if(n(e._billboardImage)&&e._billboardImage!==t.image)return void(t.image=e._billboardImage);if(!n(e._billboardImage)){var o=i(e._color,l.defaultColor),a=i(e._pointOutlineColor,l.defaultPointOutlineColor),u=i(e._pointOutlineWidth,l.defaultPointOutlineWidth),c=i(e._pointSize,l.defaultPointSize),d=e._billboardColor,h=e._billboardOutlineColor,p=e._billboardOutlineWidth,f=e._billboardSize;if(!r.equals(o,d)||!r.equals(a,h)||u!==p||c!==f){e._billboardColor=r.clone(o,e._billboardColor),e._billboardOutlineColor=r.clone(a,e._billboardOutlineColor),e._billboardOutlineWidth=u,e._billboardSize=c;var m=o.alpha,g=o.toCssColorString(),_=a.toCssColorString(),v=JSON.stringify([g,c,_,u]);t.setImage(v,s(m,g,_,u,c))}}}var c=new t;return o(l.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=r.clone(e,this._color),u(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,u(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=r.clone(e,this._pointOutlineColor),u(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,u(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){n(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){var t=i(this._heightOffset,0),r=this._content.tileset.ellipsoid,n=r.cartesianToCartographic(this._billboard.position,c);n.height=n.height-t+e;var o=r.cartographicToCartesian(n);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=e}},image:{get:function(){return this._billboardImage},set:function(e){var t=this._billboardImage!==e;this._billboardImage=e,t&&u(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}}}),l.defaultColor=r.WHITE,l.defaultPointOutlineColor=r.BLACK,l.defaultPointOutlineWidth=0,l.defaultPointSize=8,l.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)},l.prototype.getPropertyNames=function(e){return this._content.batchTable.getPropertyNames(this._batchId,e)},l.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)},l.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0},l.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)},l.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)},l.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)},l}),define("Scene/Vector3DTilePoints",["../Core/arraySlice","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DistanceDisplayCondition","../Core/Ellipsoid","../Core/NearFarScalar","../Core/Rectangle","../Core/TaskProcessor","../ThirdParty/when","./BillboardCollection","./Cesium3DTilePointFeature","./HorizontalOrigin","./LabelCollection","./LabelStyle","./PolylineCollection","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y){"use strict";function b(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=void 0,this._labelCollection=void 0,this._polylineCollection=void 0,this._verticesPromise=void 0,this._packedBuffer=void 0,this._ready=!1,this._readyPromise=h.defer(),this._resolvedPromise=!1}function C(e,t){var r=e._rectangle,i=e._minHeight,n=e._maxHeight,o=2+c.packedLength+l.packedLength,a=new Float64Array(o),s=0;return a[s++]=i,a[s++]=n,c.pack(r,a,s),s+=c.packedLength,l.pack(t,a,s),a}function S(t,i){if(!n(t._billboardCollection)){var o;if(!n(t._verticesPromise)){o=t._positions;var a=t._packedBuffer;n(a)||(o=t._positions=e(o),t._batchIds=e(t._batchIds),a=t._packedBuffer=C(t,i));var s=[o.buffer,a.buffer],l={positions:o.buffer,packedBuffer:a.buffer},u=t._verticesPromise=w.scheduleTask(l,s);if(!n(u))return;u.then(function(e){t._positions=new Float64Array(e.positions),t._ready=!0})}if(t._ready&&!n(t._billboardCollection)){o=t._positions;var c=t._batchTable,d=t._batchIds,h=t._billboardCollection=new p({batchTable:c}),f=t._labelCollection=new g({batchTable:c}),m=t._polylineCollection=new v;m._useHighlightColor=!0;for(var _=o.length/3,y=0;y<_;++y){var b=d[y],S=r.unpack(o,3*y,A),T=h.add();T.position=S,T._batchIndex=b;var E=f.add();E.text=" ",E.position=S,E._batchIndex=b;m.add().positions=[r.clone(S),r.clone(S)]}t._positions=void 0,t._packedBuffer=void 0}}}function T(e,r){for(var n=e._batchIds,o=n.length,a=0;a<o;++a){var s=n[a],l=r[s];l.show=!0,l.pointSize=f.defaultPointSize,l.color=f.defaultColor,l.pointOutlineColor=f.defaultPointOutlineColor,l.pointOutlineWidth=f.defaultPointOutlineWidth,l.labelColor=i.WHITE,l.labelOutlineColor=i.WHITE,l.labelOutlineWidth=1,l.font="30px sans-serif",l.labelStyle=_.FILL,l.labelText=void 0,l.backgroundColor=new i(.165,.165,.165,.8),l.backgroundPadding=new t(7,5),l.backgroundEnabled=!1,l.scaleByDistance=void 0,l.translucencyByDistance=void 0,l.distanceDisplayCondition=void 0,l.heightOffset=0,l.anchorLineEnabled=!1,l.anchorLineColor=i.WHITE,l.image=void 0,l.disableDepthTestDistance=0,l.horizontalOrigin=m.CENTER,l.verticalOrigin=y.CENTER,l.labelHorizontalOrigin=m.RIGHT,l.labelVerticalOrigin=y.BASELINE}}o(b.prototype,{pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){return this._billboardCollection.textureAtlas.texture.sizeInBytes+this._labelCollection._textureAtlas.texture.sizeInBytes}},readyPromise:{get:function(){return this._readyPromise.promise}}});var w=new d("createVectorTilePoints"),A=new r;b.prototype.createFeatures=function(e,t){for(var r=this._billboardCollection,i=this._labelCollection,n=this._polylineCollection,o=this._batchIds,a=o.length,s=0;s<a;++s){var l=o[s],u=r.get(s),c=i.get(s),d=n.get(s);t[l]=new f(e,l,u,c,d)}},b.prototype.applyDebugSettings=function(e,t){e?(i.clone(t,this._billboardCollection._highlightColor),i.clone(t,this._labelCollection._highlightColor),i.clone(t,this._polylineCollection._highlightColor)):(i.clone(i.WHITE,this._billboardCollection._highlightColor),i.clone(i.WHITE,this._labelCollection._highlightColor),i.clone(i.WHITE,this._polylineCollection._highlightColor))};var E=new i,x=new i,P=new i,I=new i,D=new i,O=new i,M=new u,R=new u,L=new s;return b.prototype.applyStyle=function(e,t,r){if(!n(t))return void T(this,r);for(var i=this._batchIds,o=i.length,a=0;a<o;++a){var s=i[a],l=r[s];if(n(t.show)&&(l.show=t.show.evaluate(e,l)),n(t.pointSize)&&(l.pointSize=t.pointSize.evaluate(e,l)),n(t.color)&&(l.color=t.color.evaluateColor(e,l,E)),n(t.pointOutlineColor)&&(l.pointOutlineColor=t.pointOutlineColor.evaluateColor(e,l,x)),n(t.pointOutlineWidth)&&(l.pointOutlineWidth=t.pointOutlineWidth.evaluate(e,l)),n(t.labelColor)&&(l.labelColor=t.labelColor.evaluateColor(e,l,P)),n(t.labelOutlineColor)&&(l.labelOutlineColor=t.labelOutlineColor.evaluateColor(e,l,I)),n(t.labelOutlineWidth)&&(l.labelOutlineWidth=t.labelOutlineWidth.evaluate(e,l)),n(t.font)&&(l.font=t.font.evaluate(e,l)),n(t.labelStyle)&&(l.labelStyle=t.labelStyle.evaluate(e,l)),n(t.labelText)?l.labelText=t.labelText.evaluate(e,l):l.labelText=void 0,n(t.backgroundColor)&&(l.backgroundColor=t.backgroundColor.evaluateColor(e,l,D)),n(t.backgroundPadding)&&(l.backgroundPadding=t.backgroundPadding.evaluate(e,l)),n(t.backgroundEnabled)&&(l.backgroundEnabled=t.backgroundEnabled.evaluate(e,l)),n(t.scaleByDistance)){var u=t.scaleByDistance.evaluate(e,l);M.near=u.x,M.nearValue=u.y,M.far=u.z,M.farValue=u.w,l.scaleByDistance=M}else l.scaleByDistance=void 0;if(n(t.translucencyByDistance)){var c=t.translucencyByDistance.evaluate(e,l);R.near=c.x,R.nearValue=c.y,R.far=c.z,R.farValue=c.w,l.translucencyByDistance=R}else l.translucencyByDistance=void 0;if(n(t.distanceDisplayCondition)){var d=t.distanceDisplayCondition.evaluate(e,l);L.near=d.x,L.far=d.y,l.distanceDisplayCondition=L}else l.distanceDisplayCondition=void 0;n(t.heightOffset)&&(l.heightOffset=t.heightOffset.evaluate(e,l)),n(t.anchorLineEnabled)&&(l.anchorLineEnabled=t.anchorLineEnabled.evaluate(e,l)),n(t.anchorLineColor)&&(l.anchorLineColor=t.anchorLineColor.evaluateColor(e,l,O)),n(t.image)?l.image=t.image.evaluate(e,l):l.image=void 0,n(t.disableDepthTestDistance)&&(l.disableDepthTestDistance=t.disableDepthTestDistance.evaluate(e,l)),n(t.horizontalOrigin)&&(l.horizontalOrigin=t.horizontalOrigin.evaluate(e,l)),n(t.verticalOrigin)&&(l.verticalOrigin=t.verticalOrigin.evaluate(e,l)),n(t.labelHorizontalOrigin)&&(l.labelHorizontalOrigin=t.labelHorizontalOrigin.evaluate(e,l)),n(t.labelVerticalOrigin)&&(l.labelVerticalOrigin=t.labelVerticalOrigin.evaluate(e,l))}},b.prototype.update=function(e){S(this,e.mapProjection.ellipsoid),this._ready&&(this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e),this._resolvedPromise||(this._readyPromise.resolve(),this._resolvedPromise=!0))},b.prototype.isDestroyed=function(){return!1},b.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),a(this)},b}),define("Scene/Vector3DTilePolygons",["../Core/arraySlice","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IndexDatatype","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/Rectangle","../Core/TaskProcessor","../ThirdParty/when","./ClassificationType","./Vector3DTileBatch","./Vector3DTilePrimitive"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=i(e.ellipsoid,s.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=i(e.center,t.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._readyPromise=p.defer(),this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=f.CESIUM_3D_TILE}function v(e){var r=new Float64Array(3+t.packedLength+s.packedLength+d.packedLength),i=0;return r[i++]=e._indices.BYTES_PER_ELEMENT,r[i++]=e._minimumHeight,r[i++]=e._maximumHeight,t.pack(e._center,r,i),i+=t.packedLength,s.pack(e._ellipsoid,r,i),i+=s.packedLength,d.pack(e._rectangle,r,i),r}function y(e,t){for(var i=1,n=t[i++],o=e._boundingVolumes=new Array(n),a=0;a<n;++a)o[a]=c.unpack(t,i),i+=c.packedLength;for(var s=t[i++],l=e._batchedIndices=new Array(s),u=0;u<s;++u){var d=r.unpack(t,i);i+=r.packedLength;for(var h=t[i++],p=t[i++],f=t[i++],g=new Array(f),_=0;_<f;++_)g[_]=t[i++];l[u]=new m({color:d,offset:h,count:p,batchIds:g})}}function b(t){if(!n(t._primitive)){if(!n(t._verticesPromise)){var r=t._positions,i=t._counts,o=t._indexCounts,a=t._indices,s=t._transferrableBatchIds,u=t._batchTableColors,c=t._packedBuffer;if(!n(u)){r=t._positions=e(t._positions),i=t._counts=e(t._counts),o=t._indexCounts=e(t._indexCounts),a=t._indices=e(t._indices),t._center=t._ellipsoid.cartographicToCartesian(d.center(t._rectangle)),s=t._transferrableBatchIds=new Uint32Array(t._batchIds),u=t._batchTableColors=new Uint32Array(s.length);for(var h=t._batchTable,f=u.length,m=0;m<f;++m){var _=h.getColor(m,S);u[m]=_.toRgba()}c=t._packedBuffer=v(t)}var b=[r.buffer,i.buffer,o.buffer,a.buffer,s.buffer,u.buffer,c.buffer],T={packedBuffer:c.buffer,positions:r.buffer,counts:i.buffer,indexCounts:o.buffer,indices:a.buffer,batchIds:s.buffer,batchTableColors:u.buffer},w=t._polygonMinimumHeights,A=t._polygonMaximumHeights;n(w)&&n(A)&&(b.push(w.buffer,A.buffer),T.minimumHeights=w,T.maximumHeights=A);var E=t._verticesPromise=C.scheduleTask(T,b);if(!n(E))return;p(E,function(e){t._positions=void 0,t._counts=void 0,t._polygonMinimumHeights=void 0,t._polygonMaximumHeights=void 0;var r=new Float64Array(e.packedBuffer),i=r[0];y(t,r),t._indices=2===l.getSizeInBytes(i)?new Uint16Array(e.indices):new Uint32Array(e.indices),t._indexOffsets=new Uint32Array(e.indexOffsets),t._indexCounts=new Uint32Array(e.indexCounts),t._batchedPositions=new Float32Array(e.positions),t._vertexBatchIds=new Uint16Array(e.batchIds),t._ready=!0})}t._ready&&!n(t._primitive)&&(t._primitive=new g({batchTable:t._batchTable,positions:t._batchedPositions,batchIds:t._batchIds,vertexBatchIds:t._vertexBatchIds,indices:t._indices,indexOffsets:t._indexOffsets,indexCounts:t._indexCounts,batchedIndices:t._batchedIndices,boundingVolume:t._boundingVolume,boundingVolumes:t._boundingVolumes,center:t._center}),t._batchTable=void 0,t._batchIds=void 0,t._positions=void 0,t._counts=void 0,t._indices=void 0,t._indexCounts=void 0,t._indexOffsets=void 0,t._batchTableColors=void 0,t._packedBuffer=void 0,t._batchedPositions=void 0,t._transferrableBatchIds=void 0,t._vertexBatchIds=void 0,t._ellipsoid=void 0,t._minimumHeight=void 0,t._maximumHeight=void 0,t._polygonMinimumHeights=void 0,t._polygonMaximumHeights=void 0,t._center=void 0,t._rectangle=void 0,t._boundingVolume=void 0,t._boundingVolumes=void 0,t._batchedIndices=void 0,t._verticesPromise=void 0,t._readyPromise.resolve())}}o(_.prototype,{trianglesLength:{get:function(){return n(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return n(this._primitive)?this._primitive.geometryByteLength:0}},readyPromise:{get:function(){return this._readyPromise.promise}}});var C=new h("createVectorTilePolygons"),S=new r;return _.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)},_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)},_.prototype.applyStyle=function(e,t,r){this._primitive.applyStyle(e,t,r)},_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)},_.prototype.update=function(e){b(this),this._ready&&(this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e))},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),a(this)},_}),define("Shaders/Vector3DTilePolylinesVS",[],function(){"use strict";return"attribute vec4 currentPosition;\nattribute vec4 previousPosition;\nattribute vec4 nextPosition;\nattribute vec2 expandAndWidth;\nattribute float a_batchId;\nuniform mat4 u_modifiedModelView;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = u_modifiedModelView * currentPosition;\nvec4 prev = u_modifiedModelView * previousPosition;\nvec4 next = u_modifiedModelView * nextPosition;\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),define("Scene/Vector3DTilePolylines",["../Core/arraySlice","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IndexDatatype","../Core/Matrix4","../Core/Rectangle","../Core/TaskProcessor","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/Vector3DTilePolylinesVS","../ThirdParty/when","./BlendingState","./Cesium3DTileFeature"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A){"use strict";function E(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=n(e.ellipsoid,l.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._spPick=void 0,this._rsPick=void 0,this._pickCommand=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=r.clone(r.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._readyPromise=T.defer(),this._verticesPromise=void 0}function x(e){var r=e._rectangle,i=e._minimumHeight,n=e._maximumHeight,o=e._ellipsoid,a=e._center,s=2+d.packedLength+l.packedLength+t.packedLength,u=new Float64Array(s),c=0;return u[c++]=i,u[c++]=n,d.pack(r,u,c),c+=d.packedLength,l.pack(o,u,c),c+=l.packedLength,t.pack(a,u,c),u}function P(t,r){if(!o(t._va)){if(!o(t._verticesPromise)){var n=t._positions,a=t._widths,s=t._counts,l=t._transferrableBatchIds,c=t._packedBuffer;o(c)||(n=t._positions=e(n),a=t._widths=e(a),s=t._counts=e(s),l=t._transferrableBatchIds=e(t._batchIds),c=t._packedBuffer=x(t));var d=[n.buffer,a.buffer,s.buffer,l.buffer,c.buffer],h={positions:n.buffer,widths:a.buffer,counts:s.buffer,batchIds:l.buffer,packedBuffer:c.buffer},m=t._verticesPromise=N.scheduleTask(h,d);if(!o(m))return;T(m,function(e){t._currentPositions=new Float32Array(e.currentPositions),t._previousPositions=new Float32Array(e.previousPositions),t._nextPositions=new Float32Array(e.nextPositions),t._expandAndWidth=new Float32Array(e.expandAndWidth),t._vertexBatchIds=new Uint16Array(e.batchIds);var r=e.indexDatatype;t._indices=r===u.UNSIGNED_SHORT?new Uint16Array(e.indices):new Uint32Array(e.indices),t._ready=!0})}if(t._ready&&!o(t._va)){var g=t._currentPositions,_=t._previousPositions,v=t._nextPositions,y=t._expandAndWidth,C=t._vertexBatchIds,S=t._indices,w=_.byteLength+g.byteLength+v.byteLength;w+=y.byteLength+C.byteLength+S.byteLength,t._trianglesLength=S.length/3,t._geometryByteLength=w;var A=p.createVertexBuffer({context:r,typedArray:_,usage:f.STATIC_DRAW}),E=p.createVertexBuffer({context:r,typedArray:g,usage:f.STATIC_DRAW}),P=p.createVertexBuffer({context:r,typedArray:v,usage:f.STATIC_DRAW}),I=p.createVertexBuffer({context:r,typedArray:y,usage:f.STATIC_DRAW}),D=p.createVertexBuffer({context:r,typedArray:C,usage:f.STATIC_DRAW}),O=p.createIndexBuffer({context:r,typedArray:S,usage:f.STATIC_DRAW,indexDatatype:2===S.BYTES_PER_ELEMENT?u.UNSIGNED_SHORT:u.UNSIGNED_INT}),M=[{index:k.previousPosition,vertexBuffer:A,componentDatatype:i.FLOAT,componentsPerAttribute:3},{index:k.currentPosition,vertexBuffer:E,componentDatatype:i.FLOAT,componentsPerAttribute:3},{index:k.nextPosition,vertexBuffer:P,componentDatatype:i.FLOAT,componentsPerAttribute:3},{index:k.expandAndWidth,vertexBuffer:I,componentDatatype:i.FLOAT,componentsPerAttribute:2},{index:k.a_batchId,vertexBuffer:D,componentDatatype:i.UNSIGNED_SHORT,componentsPerAttribute:1}];t._va=new b({context:r,attributes:M,indexBuffer:O}),t._positions=void 0,t._widths=void 0,t._counts=void 0,t._ellipsoid=void 0,t._minimumHeight=void 0,t._maximumHeight=void 0,t._rectangle=void 0,t._transferrableBatchIds=void 0,t._packedBuffer=void 0,t._currentPositions=void 0,t._previousPositions=void 0,t._nextPositions=void 0,t._expandAndWidth=void 0,t._vertexBatchIds=void 0,t._indices=void 0,t._readyPromise.resolve()}}}function I(e,t){o(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){var r=t.uniformState.view;return c.clone(r,F),c.multiplyByPoint(F,e._center,B),c.setTranslation(F,B,F),F},u_highlightColor:function(){return e._highlightColor}})}function D(e){if(!o(e._rs)){var t={enabled:!0,factor:-5,units:-5};e._rs=_.fromCache({blending:w.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t}),e._rsPick=_.fromCache({depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}}function O(e,t){if(!o(e._sp)){var r=e._batchTable,i=r.getVertexShaderCallback(!1,"a_batchId",void 0)(S),n=r.getFragmentShaderCallback()(U,!1,void 0),a=new y({defines:["VECTOR_TILE"],sources:[C,i]}),s=new y({defines:["VECTOR_TILE"],sources:[n]});e._sp=v.fromCache({context:t,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:k}),i=r.getPickVertexShaderCallback("a_batchId")(S),n=r.getPickFragmentShaderCallback()(U,!1,void 0);var l=new y({defines:["VECTOR_TILE"],sources:[C,i]}),u=new y({defines:["VECTOR_TILE"],sources:[n]});e._spPick=v.fromCache({context:t,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:k})}}function M(e,t){if(!o(e._command)){var r=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new m({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:g.TRANSLUCENT})}t.commandList.push(e._command)}function R(e,t){if(!o(e._pickCommand)){var r=e._batchTable.getPickUniformMapCallback()(e._uniformMap);e._pickCommand=new m({owner:e,vertexArray:e._va,renderState:e._rsPick,shaderProgram:e._spPick,uniformMap:r,boundingVolume:e._boundingVolume,pass:g.TRANSLUCENT})}t.commandList.push(e._pickCommand)}function L(e,t){for(var i=e._batchIds,n=i.length,o=0;o<n;++o){var a=i[o],s=t[a];s.show=!0,s.color=r.WHITE}}a(E.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},readyPromise:{get:function(){return this._readyPromise.promise}}});var N=new h("createVectorTilePolylines"),k={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4},F=new c,B=new t,U="uniform vec4 u_highlightColor; \nvoid main()\n{\n    gl_FragColor = u_highlightColor;\n}\n";E.prototype.createFeatures=function(e,t){for(var r=this._batchIds,i=r.length,n=0;n<i;++n){var o=r[n];t[o]=new A(e,o)}},E.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};var V=new r,z=r.WHITE;return E.prototype.applyStyle=function(e,t,r){if(!o(t))return void L(this,r);for(var i=this._batchIds,n=i.length,a=0;a<n;++a){var s=i[a],l=r[s];l.color=o(t.color)?t.color.evaluateColor(e,l,V):z,l.show=!o(t.show)||t.show.evaluate(e,l)}},E.prototype.update=function(e){var t=e.context;if(P(this,t),I(this,t),O(this,t),D(this),this._ready){var r=e.passes;r.render&&M(this,e),r.pick&&R(this,e)}},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),s(this)},E}),define("Scene/Vector3DTileContent",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/getMagic","../Core/getStringFromTypedArray","../Core/Math","../Core/Matrix4","../Core/Rectangle","../Core/RuntimeError","../ThirdParty/when","./Cesium3DTileBatchTable","./Vector3DTilePoints","./Vector3DTilePolygons","./Vector3DTilePolylines"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v){"use strict";function y(e,t,r,i,n){this._tileset=e,this._tile=t,this._resource=r,this._polygons=void 0,
this._polylines=void 0,this._points=void 0,this._contentReadyPromise=void 0,this._readyPromise=f.defer(),this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,S(this,i,n)}function b(e){return function(t,i){r(e._polygons)&&e._polygons.updateCommands(t,i)}}function C(e,i){var n,o,a,s,l=t(e.POLYGONS_LENGTH,0),u=t(e.POLYLINES_LENGTH,0),c=t(e.POINTS_LENGTH,0);if(l>0&&r(e.POLYGON_BATCH_IDS)){var d=i.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(i.buffer,d,l)}if(u>0&&r(e.POLYLINE_BATCH_IDS)){var h=i.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;o=new Uint16Array(i.buffer,h,u)}if(c>0&&r(e.POINT_BATCH_IDS)){var f=i.byteOffset+e.POINT_BATCH_IDS.byteOffset;a=new Uint16Array(i.buffer,f,c)}var m=r(n)||r(o)||r(a),g=l>0&&!r(n)||u>0&&!r(o)||c>0&&!r(a);if(m&&g)throw new p("If one group of batch ids is defined, then all batch ids must be defined.");if(!r(n)&&!r(o)&&!r(a)){var _=0;if(!r(n)&&l>0)for(n=new Uint16Array(l),s=0;s<l;++s)n[s]=_++;if(!r(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=_++;if(!r(a)&&c>0)for(a=new Uint16Array(c),s=0;s<c;++s)a[s]=_++}return{polygons:n,polylines:o,points:a}}function S(i,n,o){o=t(o,0);var s=new Uint8Array(n),l=new DataView(n);o+=A;var f=l.getUint32(o,!0);if(1!==f)throw new p("Only Vector tile version 1 is supported.  Version "+f+" is not.");o+=A;var y=l.getUint32(o,!0);if(o+=A,0===y)return void i._readyPromise.resolve(i);var S=l.getUint32(o,!0);if(o+=A,0===S)throw new p("Feature table must have a byte length greater than zero");var T=l.getUint32(o,!0);o+=A;var E=l.getUint32(o,!0);o+=A;var x=l.getUint32(o,!0);o+=A;var P=l.getUint32(o,!0);o+=A;var I=l.getUint32(o,!0);o+=A;var D=l.getUint32(o,!0);o+=A;var O=l.getUint32(o,!0);o+=A;var M=u(s,o,S),R=JSON.parse(M);o+=S;var L=new Uint8Array(n,o,T);o+=T;var N,k;if(E>0){var F=u(s,o,E);N=JSON.parse(F),o+=E,x>0&&(k=new Uint8Array(n,o,x),k=new Uint8Array(k),o+=x)}var B=t(R.POLYGONS_LENGTH,0),U=t(R.POLYLINES_LENGTH,0),V=t(R.POINTS_LENGTH,0),z=B+U+V,G=new m(i,z,N,k,b(i));if(i._batchTable=G,0!==z){var H,W,j;if(!r(R.REGION))throw new p("REGION is required in the feature table.");var q=R.REGION;H=h.unpack(q),W=q[4],j=q[5];var Y,X=i._tile.computedTransform;r(R.RTC_CENTER)?(Y=e.unpack(R.RTC_CENTER),d.multiplyByPoint(X,Y,Y)):(Y=h.center(H),Y.height=c.lerp(W,j,.5),Y=a.WGS84.cartographicToCartesian(Y));var Q=C(R,L);if(o+=o%4,B>0){var Z=new Uint32Array(n,o,P/A);o+=P;var K=new Uint16Array(n,o,I/w);o+=I;var J,$,ee=L.byteOffset+R.POLYGON_COUNT.byteOffset,te=new Uint32Array(L.buffer,ee,B),re=L.byteOffset+R.POLYGON_INDEX_COUNT.byteOffset,ie=new Uint32Array(L.buffer,re,B);if(r(R.POLYGON_MINIMUM_HEIGHTS)&&r(R.POLYGON_MAXIMUM_HEIGHTS)){var ne=L.byteOffset+R.POLYGON_MINIMUM_HEIGHTS.byteOffset;J=new Float32Array(L.buffer,ne,B);var oe=L.byteOffset+R.POLYGON_MAXIMUM_HEIGHTS.byteOffset;$=new Float32Array(L.buffer,oe,B)}i._polygons=new _({positions:K,counts:te,indexCounts:ie,indices:Z,minimumHeight:W,maximumHeight:j,polygonMinimumHeights:J,polygonMaximumHeights:$,center:Y,rectangle:H,boundingVolume:i._tile._boundingVolume.boundingVolume,batchTable:G,batchIds:Q.polygons,modelMatrix:X})}if(U>0){var ae=new Uint16Array(n,o,D/w);o+=D;var se,le=L.byteOffset+R.POLYLINE_COUNT.byteOffset,ue=new Uint32Array(L.buffer,le,U);if(r(R.POLYLINE_WIDTHS)){var ce=L.byteOffset+R.POLYLINE_WIDTHS.byteOffset;se=new Uint16Array(L.buffer,ce,U)}else{se=new Uint16Array(U);for(var de=0;de<U;++de)se[de]=2}i._polylines=new v({positions:ae,widths:se,counts:ue,batchIds:Q.polylines,minimumHeight:W,maximumHeight:j,center:Y,rectangle:H,boundingVolume:i._tile._boundingVolume.boundingVolume,batchTable:G})}if(V>0){var he=new Uint16Array(n,o,O/w);i._points=new g({positions:he,batchIds:Q.points,minimumHeight:W,maximumHeight:j,rectangle:H,batchTable:G})}}}function T(e){var t=e.featuresLength;if(!r(e._features)&&t>0){var i=new Array(t);r(e._polygons)&&e._polygons.createFeatures(e,i),r(e._polylines)&&e._polylines.createFeatures(e,i),r(e._points)&&e._points.createFeatures(e,i),e._features=i}}if(!s.supportsTypedArrays())return{};i(y.prototype,{featuresLength:{get:function(){return r(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return r(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){var e=0;return r(this._polygons)&&(e+=this._polygons.trianglesLength),r(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){var e=0;return r(this._polygons)&&(e+=this._polygons.geometryByteLength),r(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return r(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return r(this._batchTable)?this._batchTable.memorySizeInBytes:0}},innerContents:{get:function(){}},readyPromise:{get:function(){return this._readyPromise.promise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){return this._batchTable}}});var w=Uint16Array.BYTES_PER_ELEMENT,A=Uint32Array.BYTES_PER_ELEMENT;return y.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)},y.prototype.getFeature=function(e){return T(this),this._features[e]},y.prototype.applyDebugSettings=function(e,t){r(this._polygons)&&this._polygons.applyDebugSettings(e,t),r(this._polylines)&&this._polylines.applyDebugSettings(e,t),r(this._points)&&this._points.applyDebugSettings(e,t)},y.prototype.applyStyle=function(e,t){T(this),r(this._polygons)&&this._polygons.applyStyle(e,t,this._features),r(this._polylines)&&this._polylines.applyStyle(e,t,this._features),r(this._points)&&this._points.applyStyle(e,t,this._features)},y.prototype.update=function(e,t){if(r(this._batchTable)&&this._batchTable.update(e,t),r(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.update(t)),r(this._polylines)&&this._polylines.update(t),r(this._points)&&this._points.update(t),!r(this._contentReadyPromise)){var i=r(this._points)?this._points.readyPromise:void 0,n=r(this._polygons)?this._polygons.readyPromise:void 0,o=r(this._polylines)?this._polylines.readyPromise:void 0,a=this;this._contentReadyPromise=f.all([i,n,o]).then(function(){a._readyPromise.resolve(a)})}},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),n(this)},y}),define("Scene/Cesium3DTileContentFactory",["./Batched3DModel3DTileContent","./Composite3DTileContent","./Geometry3DTileContent","./Instanced3DModel3DTileContent","./PointCloud3DTileContent","./Tileset3DTileContent","./Vector3DTileContent"],function(e,t,r,i,n,o,a){"use strict";var s={b3dm:function(t,r,i,n,o){return new e(t,r,i,n,o)},pnts:function(e,t,r,i,o){return new n(e,t,r,i,o)},i3dm:function(e,t,r,n,o){return new i(e,t,r,n,o)},cmpt:function(e,r,i,n,o){return new t(e,r,i,n,o,s)},json:function(e,t,r,i,n){return new o(e,t,r,i,n)},geom:function(e,t,i,n,o){return new r(e,t,i,n,o)},vctr:function(e,t,r,i,n){return new a(e,t,r,i,n)}};return s}),define("Scene/Cesium3DTileContentState",["../Core/freezeObject"],function(e){"use strict";return e({UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5})}),define("Scene/Cesium3DTileOptimizationHint",["../Core/freezeObject"],function(e){"use strict";return e({NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0})}),define("Scene/Cesium3DTileRefine",["../Core/freezeObject"],function(e){"use strict";return e({ADD:0,REPLACE:1})}),define("Scene/Empty3DTileContent",["../Core/defineProperties","../Core/destroyObject"],function(e,t){"use strict";function r(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}return e(r.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},readyPromise:{get:function(){}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},batchTable:{get:function(){}}}),r.prototype.hasProperty=function(e,t){return!1},r.prototype.getFeature=function(e){},r.prototype.applyDebugSettings=function(e,t){},r.prototype.applyStyle=function(e,t){},r.prototype.update=function(e,t){},r.prototype.isDestroyed=function(){return!1},r.prototype.destroy=function(){return t(this)},r}),define("Scene/TileBoundingRegion",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defineProperties","../Core/Ellipsoid","../Core/GeometryInstance","../Core/IntersectionTests","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/Plane","../Core/Ray","../Core/Rectangle","../Core/RectangleOutlineGeometry","./PerInstanceColorAppearance","./Primitive","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v){"use strict";function y(r){this.rectangle=f.clone(r.rectangle),this.minimumHeight=o(r.minimumHeight,0),this.maximumHeight=o(r.maximumHeight,0),this.southwestCornerCartesian=new t,this.northeastCornerCartesian=new t,this.westNormal=new t,this.southNormal=new t,this.eastNormal=new t,this.northNormal=new t;var i=o(r.ellipsoid,s.WGS84);b(this,r.rectangle,i),this._orientedBoundingBox=d.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,i),this._boundingSphere=e.fromOrientedBoundingBox(this._orientedBoundingBox)}function b(e,r,i){i.cartographicToCartesian(f.southwest(r),e.southwestCornerCartesian),i.cartographicToCartesian(f.northeast(r),e.northeastCornerCartesian),x.longitude=r.west,x.latitude=.5*(r.south+r.north),x.height=0;var n=i.cartographicToCartesian(x,A),o=t.cross(n,t.UNIT_Z,C);t.normalize(o,e.westNormal),x.longitude=r.east;var a=i.cartographicToCartesian(x,E),s=t.cross(t.UNIT_Z,a,C);t.normalize(s,e.eastNormal);var l,c=t.subtract(n,a,C),d=t.normalize(c,w),p=r.south;if(p>0){x.longitude=.5*(r.west+r.east),x.latitude=p;var m=i.cartographicToCartesian(x,I.origin);t.clone(d,I.direction);var g=h.fromPointNormal(e.southwestCornerCartesian,e.westNormal,P);u.rayPlane(I,g,e.southwestCornerCartesian),l=i.geodeticSurfaceNormal(m,S)}else l=i.geodeticSurfaceNormalCartographic(f.southeast(r),S);var _=t.cross(l,c,T);t.normalize(_,e.southNormal);var v,y=r.north;if(y<0){x.longitude=.5*(r.west+r.east),x.latitude=y;var b=i.cartographicToCartesian(x,I.origin);t.negate(d,I.direction);var D=h.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,P);u.rayPlane(I,D,e.northeastCornerCartesian),v=i.geodeticSurfaceNormal(b,S)}else v=i.geodeticSurfaceNormalCartographic(f.northwest(r),S);var O=t.cross(c,v,T);t.normalize(O,e.northNormal)}a(y.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});var C=new t,S=new t,T=new t,w=new t,A=new t,E=new t,x=new r,P=new h(t.UNIT_X,0),I=new p,D=new t,O=new t,M=new t(0,-1,0),R=new t(0,0,-1),L=new t;return y.prototype.distanceToCamera=function(e){var r=e.camera,i=r.positionWC,n=r.positionCartographic,o=0;if(!f.contains(this.rectangle,n)){var a=this.southwestCornerCartesian,s=this.northeastCornerCartesian,l=this.westNormal,u=this.southNormal,c=this.eastNormal,d=this.northNormal;e.mode!==v.SCENE3D&&(a=e.mapProjection.project(f.southwest(this.rectangle),D),a.z=a.y,a.y=a.x,a.x=0,s=e.mapProjection.project(f.northeast(this.rectangle),O),s.z=s.y,s.y=s.x,s.x=0,l=M,c=t.UNIT_Y,u=R,d=t.UNIT_Z);var h=t.subtract(i,a,L),p=t.dot(h,l),m=t.dot(h,u),g=t.subtract(i,s,L),_=t.dot(g,c),y=t.dot(g,d);p>0?o+=p*p:_>0&&(o+=_*_),m>0?o+=m*m:y>0&&(o+=y*y)}var b;b=e.mode===v.SCENE3D?n.height:i.x;var C=e.mode===v.SCENE3D?this.maximumHeight:0,S=b-C;return S>0&&(o+=S*S),Math.sqrt(o)},y.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},y.prototype.createDebugVolume=function(e){var t=new c.clone(c.IDENTITY),r=new m({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new l({geometry:r,modelMatrix:t,attributes:{color:n.fromColor(e)}});return new _({geometryInstances:i,appearance:new g({translucent:!1,flat:!0}),asynchronous:!1})},y}),define("Scene/TileBoundingSphere",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defineProperties","../Core/GeometryInstance","../Core/Matrix4","../Core/SphereOutlineGeometry","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r){this._boundingSphere=new e(t,r)}return n(c.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}}),c.prototype.distanceToCamera=function(e){var r=this._boundingSphere;return Math.max(0,t.distance(r.center,e.camera.positionWC)-r.radius)},c.prototype.intersectPlane=function(t){return e.intersectPlane(this._boundingSphere,t)},c.prototype.update=function(e,r){t.clone(e,this._boundingSphere.center),this._boundingSphere.radius=r},c.prototype.createDebugVolume=function(e){var t=new s({radius:this.radius}),r=a.fromTranslation(this.center,new a.clone(a.IDENTITY)),n=new o({geometry:t,modelMatrix:r,attributes:{color:i.fromColor(e)}});return new u({geometryInstances:n,appearance:new l({translucent:!1,flat:!0}),asynchronous:!1})},c}),define("Scene/TileOrientedBoundingBox",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian3","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defineProperties","../Core/GeometryInstance","../Core/Matrix3","../Core/Matrix4","../Core/OrientedBoundingBox","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r){this._orientedBoundingBox=new u(t,r),this._boundingSphere=e.fromOrientedBoundingBox(this._orientedBoundingBox)}return o(h.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),h.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))},h.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},h.prototype.update=function(t,i){r.clone(t,this._orientedBoundingBox.center),s.clone(i,this._orientedBoundingBox.halfAxes),e.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)},h.prototype.createDebugVolume=function(e){var i=new t({minimum:new r(-1,-1,-1),maximum:new r(1,1,1)}),o=l.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),s=new a({geometry:i,modelMatrix:o,attributes:{color:n.fromColor(e)}});return new d({geometryInstances:s,appearance:new c({translucent:!1,flat:!0}),asynchronous:!1})},h}),define("Scene/Cesium3DTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/CullingVolume","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/getMagic","../Core/Intersect","../Core/JulianDate","../Core/Matrix3","../Core/Matrix4","../Core/Plane","../Core/Rectangle","../Core/Request","../Core/RequestScheduler","../Core/RequestState","../Core/RequestType","../Core/Resource","../Core/RuntimeError","../ThirdParty/when","./Cesium3DTileChildrenVisibility","./Cesium3DTileContentFactory","./Cesium3DTileContentState","./Cesium3DTileOptimizationHint","./Cesium3DTileRefine","./Empty3DTileContent","./SceneMode","./TileBoundingRegion","./TileBoundingSphere","./TileOrientedBoundingBox"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M){"use strict";function R(e,t,i,n){this._tileset=e,this._header=i;var a=i.content;this.transform=o(i.transform)?p.unpack(i.transform):p.clone(p.IDENTITY);var s=o(n)?n.computedTransform:e.modelMatrix,l=p.multiply(s,this.transform,new p);this.computedTransform=l,this._boundingVolume=this.createBoundingVolume(i.boundingVolume,l),this._boundingVolume2D=void 0;var u;o(a)&&o(a.boundingVolume)&&(u=this.createBoundingVolume(a.boundingVolume,l)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;var c;o(i.viewerRequestVolume)&&(c=this.createBoundingVolume(i.viewerRequestVolume,l)),this._viewerRequestVolume=c,this.geometricError=i.geometricError,o(this.geometricError)||(this.geometricError=o(n)?n.geometricError:e._geometricError,R._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead."));var h;o(i.refine)?("replace"!==i.refine&&"add"!==i.refine||R._deprecationWarning("lowercase-refine",'This tile uses a lowercase refine "'+i.refine+'". Instead use "'+i.refine.toUpperCase()+'".'),h="REPLACE"===i.refine.toUpperCase()?x.REPLACE:x.ADD):h=o(n)?n.refine:x.REPLACE,this.refine=h,this.children=[],this.parent=n;var f,m,g,v,y;if(t=b.createIfNeeded(t),o(a)){var C=a.url;e._brokenUrlWorkaround&&C.length>0&&"/"===C[0]&&(C=a.url=C.substring(1)),m=!1,g=A.UNLOADED,v=t.getDerivedResource({url:C}),y=_.getServerKey(v.getUrlComponent())}else f=new P(e,this),m=!0,g=A.READY;this._content=f,this._contentResource=v,this._contentState=g,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this._expiredContent=void 0,this._serverKey=y,this.hasEmptyContent=m,this.hasRenderableContent=!1,this.hasTilesetContent=!1,this.replacementNode=void 0;var S,w,I=i.expire;o(I)&&(S=I.duration,o(I.date)&&(w=d.fromIso8601(I.date))),this.expireDuration=S,this.expireDate=w,this.selected=!1,this.lastStyleTime=0,this._optimChildrenWithinParent=E.NOT_COMPUTED,this._distanceToCamera=0,this._visibilityPlaneMask=0,this._childrenVisibility=T.VISIBLE,this._lastSelectedFrameNumber=-1,this._screenSpaceError=0,this._screenSpaceErrorComputedFrame=-1,this._finalResolution=!0,this._depth=0,this._centerZDepth=0,this._stackLength=0,this._selectedFrame=-1,this._selectionDepth=0,this._lastSelectionDepth=void 0,this._requestedFrame=void 0,this._lastVisitedFrame=void 0,this._ancestorWithContent=void 0,this._ancestorWithLoadedContent=void 0,this._isClipped=!0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=r.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._commandsLength=0,this._color=void 0,this._colorDirty=!1}function L(e){if(o(e.expireDuration)){var t=d.now(W);d.addSeconds(t,e.expireDuration,t),o(e.expireDate)?d.lessThan(e.expireDate,t)&&d.clone(t,e.expireDate):e.expireDate=d.clone(t)}}function N(e){return function(t){e._contentState=A.FAILED,e._contentReadyPromise.reject(t),e._contentReadyToProcessPromise.reject(t)}}function k(e){return function(){return e._distanceToCamera}}function F(t,r){if(r.mode!==I.SCENE3D&&!o(t._boundingVolume2D)){var i=t._boundingVolume.boundingSphere,n=e.projectTo2D(i,r.mapProjection,j);t._boundingVolume2D=new O(n.center,n.radius)}return r.mode!==I.SCENE3D?t._boundingVolume2D:t._boundingVolume}function B(t,r){if(r.mode!==I.SCENE3D&&!o(t._contentBoundingVolume2D)){var i=t._contentBoundingVolume.boundingSphere,n=e.projectTo2D(i,r.mapProjection,j);t._contentBoundingVolume2D=new O(n.center,n.radius)}return r.mode!==I.SCENE3D?t._contentBoundingVolume2D:t._contentBoundingVolume}function U(e,r,i){var n=t.fromElements(e[0],e[1],e[2],Z),a=h.fromArray(e,3,Q);n=p.multiplyByPoint(r,n,n);var s=p.getRotation(r,Y);return a=h.multiply(s,a,a),o(i)?(i.update(n,a),i):new M(n,a)}function V(e,t){var r=m.unpack(e,0,K);return o(t)?t:new D({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function z(e,r,i){var n=t.fromElements(e[0],e[1],e[2],Z),a=e[3];n=p.multiplyByPoint(r,n,n);var s=p.getScale(r,X);return a*=t.maximumComponent(s),o(i)?(i.update(n,a),i):new O(n,a)}function G(e,t,i){var n=o(e._header.content)&&o(e._header.content.boundingVolume),a=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!n;if(a){if(!o(e._debugBoundingVolume)){var s=e._finalResolution?n?r.WHITE:r.RED:r.YELLOW;e._debugBoundingVolume=e._boundingVolume.createDebugVolume(s)}e._debugBoundingVolume.update(i)}else!a&&o(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&n?(o(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(r.BLUE)),e._debugContentBoundingVolume.update(i)):!t.debugShowContentBoundingVolume&&o(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&o(e._viewerRequestVolume)?(o(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(r.YELLOW)),e._debugViewerRequestVolume.update(i)):!t.debugShowViewerRequestVolume&&o(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());var l=t.debugColorizeTiles&&!e._debugColorizeTiles,u=!t.debugColorizeTiles&&e._debugColorizeTiles;l?(e._debugColorizeTiles=!0,e.color=e._debugColor):u&&(e._debugColorizeTiles=!1,e.color=r.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),u&&t.makeStyleDirty()}function H(e,t,r){var i=e._content,n=e._expiredContent;if(o(n)){if(!e.contentReady)return void n.update(t,r);e._expiredContent.destroy(),e._expiredContent=void 0}i.update(t,r)}R._deprecationWarning=s,a(R.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},contentBoundingVolume:{get:function(){return n(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},color:{get:function(){return o(this._color)||(this._color=new r),r.clone(this._color)},set:function(e){this._color=r.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady||o(this._expiredContent)&&this._contentState!==A.FAILED}},contentReady:{get:function(){return this._contentState===A.READY}},contentUnloaded:{get:function(){return this._contentState===A.UNLOADED}},contentExpired:{get:function(){return this._contentState===A.EXPIRED}},contentReadyToProcessPromise:{get:function(){if(o(this._contentReadyToProcessPromise))return this._contentReadyToProcessPromise.promise}},contentReadyPromise:{get:function(){if(o(this._contentReadyPromise))return this._contentReadyPromise.promise}},commandsLength:{get:function(){return this._commandsLength}}});var W=new d;R.prototype.updateExpiration=function(){if(o(this.expireDate)&&this.contentReady&&!this.hasEmptyContent){var e=d.now(W);d.lessThan(this.expireDate,e)&&(this._contentState=A.EXPIRED,this._expiredContent=this._content)}},R.prototype.requestContent=function(){var e=this,t=this._tileset;if(this.hasEmptyContent)return!1;var r=this._contentResource.clone(),i=this.contentExpired;i&&r.setQueryParameters({expired:this.expireDate.toString()});var n=new g({throttle:!0,throttleByServer:!0,type:y.TILES3D,priorityFunction:k(this),serverKey:this._serverKey});r.request=n;var a=r.fetchArrayBuffer();if(!o(a))return!1;var s=this._contentState;this._contentState=A.LOADING,this._contentReadyToProcessPromise=S.defer(),this._contentReadyPromise=S.defer(),i&&(this.expireDate=void 0);var l=N(this);return a.then(function(r){if(e.isDestroyed())return void l();var i,n=new Uint8Array(r),a=u(n),s=w[a];return t._disableSkipLevelOfDetail=t._disableSkipLevelOfDetail||"vctr"===a||"geom"===a,o(s)?(i=s(t,e,e._contentResource,r,0),e.hasRenderableContent=!0):(i=w.json(t,e,e._contentResource,r,0),e.hasTilesetContent=!0),e._content=i,e._contentState=A.PROCESSING,e._contentReadyToProcessPromise.resolve(i),i.readyPromise.then(function(t){if(e.isDestroyed())return void l();L(e),e.lastStyleTime=0,e._contentState=A.READY,e._contentReadyPromise.resolve(t)})}).otherwise(function(r){if(n.state===v.CANCELLED)return e._contentState=s,--t.statistics.numberOfPendingRequests,void++t.statistics.numberOfAttemptedRequests;l(r)}),!0},R.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=A.UNLOADED,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this.replacementNode=void 0,this.lastStyleTime=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var j=new e;R.prototype.visibility=function(e,t){var r=e.cullingVolume,n=F(this,e),a=this._tileset,s=a.clippingPlanes;if(o(s)&&s.enabled){var l=a._root.computedTransform,u=s.computeIntersectionWithBoundingVolume(n,l);if(this._isClipped=u!==c.INSIDE,u===c.OUTSIDE)return i.MASK_OUTSIDE}return r.computeVisibilityWithPlaneMask(n,t)},R.prototype.contentVisibility=function(e){if(!o(this._contentBoundingVolume))return c.INSIDE;var t=e.cullingVolume,r=B(this,e),i=this._tileset,n=i.clippingPlanes;if(o(n)&&n.enabled){var a=i._root.computedTransform,s=n.computeIntersectionWithBoundingVolume(r,a);if(this._isClipped=s!==c.INSIDE,s===c.OUTSIDE)return c.OUTSIDE}return t.computeVisibility(r)},R.prototype.distanceToTile=function(e){return F(this,e).distanceToCamera(e)};var q=new t;R.prototype.distanceToTileCenter=function(e){var r=F(this,e),i=r.boundingVolume,n=t.subtract(i.center,e.camera.positionWC,q),o=t.magnitude(n);return t.divideByScalar(n,o,n),o*t.dot(e.camera.directionWC,n)},R.prototype.insideViewerRequestVolume=function(e){var t=this._viewerRequestVolume;return!o(t)||0===t.distanceToCamera(e)};var Y=new h,X=new t,Q=new h,Z=new t,K=new m;R.prototype.createBoundingVolume=function(e,t,r){if(!o(e))throw new C("boundingVolume must be defined");if(o(e.box))return U(e.box,t,r);if(o(e.region))return V(e.region,r);if(o(e.sphere))return z(e.sphere,t,r);throw new C("boundingVolume must contain a sphere, region, or box")};var J=new p;R.prototype.updateTransform=function(e){e=n(e,p.IDENTITY);var t=p.multiply(e,this.transform,J);if(!p.equals(t,this.computedTransform)){p.clone(t,this.computedTransform);var r=this._header,i=this._header.content;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,t,this._boundingVolume),o(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(i.boundingVolume,t,this._contentBoundingVolume)),o(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,t,this._viewerRequestVolume)),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}},R.prototype.update=function(e,t){var r=t.commandList.length;G(this,e,t),H(this,e,t),this._commandsLength=t.commandList.length-r};var $=[];return R.prototype.process=function(e,t){var r=t.commandList;t.commandList=$,this._content.update(e,t),$.length=0,t.commandList=r},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),l(this)},R}),define("Scene/Cesium3DTileContent",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(e,t,r,i,n){this.featurePropertiesDirty=!1}return e(r.prototype,{featuresLength:{get:function(){t.throwInstantiationError()}},pointsLength:{get:function(){t.throwInstantiationError()}},trianglesLength:{get:function(){t.throwInstantiationError()}},geometryByteLength:{get:function(){t.throwInstantiationError()}},texturesByteLength:{get:function(){t.throwInstantiationError()}},batchTableByteLength:{get:function(){t.throwInstantiationError()}},innerContents:{get:function(){t.throwInstantiationError()}},readyPromise:{get:function(){t.throwInstantiationError()}},tileset:{get:function(){t.throwInstantiationError()}},tile:{get:function(){t.throwInstantiationError()}},url:{get:function(){t.throwInstantiationError()}},batchTable:{get:function(){t.throwInstantiationError()}}}),r.prototype.hasProperty=function(e,r){t.throwInstantiationError()},r.prototype.getFeature=function(e){t.throwInstantiationError()},r.prototype.applyDebugSettings=function(e,r){t.throwInstantiationError()},r.prototype.applyStyle=function(e,r){t.throwInstantiationError()},r.prototype.update=function(e,r){t.throwInstantiationError()},r.prototype.isDestroyed=function(){t.throwInstantiationError()},r.prototype.destroy=function(){t.throwInstantiationError()},r}),define("Scene/Cesium3DTileOptimizations",["../Core/Cartesian3","../Core/Check","./Cesium3DTileOptimizationHint","./TileBoundingRegion","./TileOrientedBoundingBox"],function(e,t,r,i,n){"use strict";var o={},a=new e;return o.checkChildrenWithinParent=function(t){var o=t.children,s=o.length,l=t._boundingVolume;if(l instanceof n||l instanceof i){var u=l._orientedBoundingBox;t._optimChildrenWithinParent=r.USE_OPTIMIZATION;for(var c=0;c<s;++c){var d=o[c],h=d._boundingVolume;if(!(h instanceof n||h instanceof i)){t._optimChildrenWithinParent=r.SKIP_OPTIMIZATION;break}var p=h._orientedBoundingBox,f=e.subtract(p.center,u.center,a),m=e.magnitude(f);e.divideByScalar(f,m,f);if(Math.abs(u.halfAxes[0]*f.x)+Math.abs(u.halfAxes[1]*f.y)+Math.abs(u.halfAxes[2]*f.z)+Math.abs(u.halfAxes[3]*f.x)+Math.abs(u.halfAxes[4]*f.y)+Math.abs(u.halfAxes[5]*f.z)+Math.abs(u.halfAxes[6]*f.x)+Math.abs(u.halfAxes[7]*f.y)+Math.abs(u.halfAxes[8]*f.z)<=Math.abs(p.halfAxes[0]*f.x)+Math.abs(p.halfAxes[1]*f.y)+Math.abs(p.halfAxes[2]*f.z)+Math.abs(p.halfAxes[3]*f.x)+Math.abs(p.halfAxes[4]*f.y)+Math.abs(p.halfAxes[5]*f.z)+Math.abs(p.halfAxes[6]*f.x)+Math.abs(p.halfAxes[7]*f.y)+Math.abs(p.halfAxes[8]*f.z)+m){t._optimChildrenWithinParent=r.SKIP_OPTIMIZATION;break}}}return t._optimChildrenWithinParent===r.USE_OPTIMIZATION},o}),define("Scene/Cesium3DTilesetStatistics",["../Core/defined"],function(e){"use strict";function t(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}function r(t,i,n,o){var a=i.innerContents,s=i.pointsLength,l=i.trianglesLength,u=i.featuresLength,c=i.geometryByteLength,d=i.texturesByteLength,h=i.batchTableByteLength;if(o?(t.numberOfFeaturesLoaded+=n?-u:u,t.numberOfPointsLoaded+=n?-s:s,t.geometryByteLength+=n?-c:c,t.texturesByteLength+=n?-d:d,t.batchTableByteLength+=n?-h:h):(t.numberOfFeaturesSelected+=n?-u:u,t.numberOfPointsSelected+=n?-s:s,t.numberOfTrianglesSelected+=n?-l:l),e(a))for(var p=a.length,f=0;f<p;++f)r(t,a[f],n,o)}return t.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,
this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0},t.prototype.incrementSelectionCounts=function(e){r(this,e,!1,!1)},t.prototype.incrementLoadCounts=function(e){r(this,e,!1,!0)},t.prototype.decrementLoadCounts=function(e){r(this,e,!0,!0)},t.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength},t}),define("Scene/Cesium3DTilesetTraversal",["../Core/CullingVolume","../Core/defined","../Core/freezeObject","../Core/Intersect","../Core/ManagedArray","../Core/Math","../Core/OrthographicFrustum","./Cesium3DTileChildrenVisibility","./Cesium3DTileRefine","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r,i){if(!t.debugFreezeFrame){var n=t._maximumScreenSpaceError;t._desiredTiles.length=0,t._selectedTiles.length=0,t._requestedTiles.length=0,t._selectedTilesToStyle.length=0,t._hasMixedContent=!1;var o=t._replacementList;o.splice(o.tail,t._replacementSentinel);var a=t._root;if(a.updateTransform(t._modelMatrix),a.insideViewerRequestVolume(r)&&(a._distanceToCamera=a.distanceToTile(r),!(P(t,t._geometricError,a,r)<=n)&&(a._visibilityPlaneMask=a.visibility(r,e.MASK_INDETERMINATE),a._visibilityPlaneMask!==e.MASK_OUTSIDE))){if(E(t,a,r,!0),t._skipLevelOfDetail)t.immediatelyLoadDesiredLevelOfDetail?t._skipTraversal.execute(t,a,r,i):(t._baseTraversal.leaves=t._skipTraversal.queue1,t._baseTraversal.execute(t,a,t.baseScreenSpaceError,r,i),t._skipTraversal.execute(t,void 0,r,i));else{t._baseTraversal.execute(t,a,n,r,i);for(var s=t._baseTraversal.leaves,l=s.length,u=0;u<l;++u)t._desiredTiles.push(s.get(u))}d(t,r,i),h(t,a,r),t._desiredTiles.trim()}}}function d(e,r,i){for(var n=e._desiredTiles,o=n.length,a=0;a<o;++a){var s=n.get(a);if(L(s))s.selected=!0,s._selectedFrame=r.frameNumber;else{var u=s._ancestorWithLoadedContent;if(s.hasRenderableContent&&s.contentAvailable&&(u=s),t(u))u.selected=!0,u._selectedFrame=r.frameNumber;else for(B.push(s);B.length>0;)for(var c=B.pop(),d=c.children,h=d.length,p=0;p<h;++p){var f=d[p];T(e,f,i),f.contentAvailable&&(f.selected=!0,f._finalResolution=!0,f._selectedFrame=r.frameNumber),f._depth-s._depth<2&&(f.contentAvailable&&f.refine!==l.ADD||B.push(f))}}}}function h(e,r,i){var n,o=U,a=V;for(o.push(r);o.length>0||a.length>0;){if(a.length>0){var s=a[a.length-1];if(s._stackLength===o.length){a.pop(),s===n&&(s._finalResolution=!0),p(e,s,i);continue}}var u=o.pop();if(t(u)&&C(u,i)){var c=u.selected&&u._selectedFrame===i.frameNumber&&u.hasRenderableContent,d=u.children,h=d.length;if(d.sort(f),c)if(u.refine===l.ADD)u._finalResolution=!0,p(e,u,i);else{if(u._selectionDepth=a.length,u._selectionDepth>0&&(e._hasMixedContent=!0),n=u,0===h){u._finalResolution=!0,p(e,u,i);continue}a.push(u),u._stackLength=o.length}for(var m=0;m<h;++m){var g=d[m];o.push(g)}}}}function p(t,r,n){if(r.contentAvailable&&(r._visibilityPlaneMask===e.MASK_INSIDE||r.contentVisibility(n)!==i.OUTSIDE)){t._selectedTiles.push(r);var o=r.content;o.featurePropertiesDirty?(o.featurePropertiesDirty=!1,r.lastStyleTime=0,t._selectedTilesToStyle.push(r)):r._lastSelectedFrameNumber===n.frameNumber-1&&0!==r.lastStyleTime||t._selectedTilesToStyle.push(r),r._lastSelectedFrameNumber=n.frameNumber}}function f(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}function m(){this.tileset=void 0,this.frameState=void 0,this.outOfCore=void 0,this.stack=new n,this.leaves=new n,this.baseScreenSpaceError=void 0,this.internalDFS=new _}function g(e,r,i,n){if(L(r)&&e._desiredTiles.push(r),r.hasTilesetContent&&r.contentExpired)return!1;if(r._screenSpaceError<=i&&!r.hasTilesetContent)return b(r,n),!1;var o=b(r,n),a=r.refine===l.ADD,u=r.refine===l.REPLACE&&0!=(o&s.VISIBLE_IN_REQUEST_VOLUME);return a||u||r.hasTilesetContent||!t(r._ancestorWithContent)}function _(){this.tileset=void 0,this.frameState=void 0,this.outOfCore=void 0,this.baseScreenSpaceError=void 0,this.stack=new n,this.allLoaded=void 0}function v(e){this.tileset=void 0,this.frameState=void 0,this.outOfCore=void 0,this.queue1=new n,this.queue2=new n,this.internalDFS=new y(e.selectionHeuristic),this.maxChildrenLength=0,this.scratchQueue=new n}function y(e){this.selectionHeuristic=e,this.tileset=void 0,this.frameState=void 0,this.outOfCore=void 0,this.root=void 0,this.queue=void 0,this.stack=new n}function b(e,t){if(C(e,t))return e._childrenVisibility;var r=e.children;return D(r,e.computedTransform),I(r,t),x(e,t)}function C(e,t){return e._lastVisitedFrame===t.frameNumber}function S(e,r,i,n){++e._statistics.visited,r.selected=!1,r._finalResolution=!1,w(r,i),T(e,r,n),r.updateExpiration(),r._ancestorWithContent=void 0,r._ancestorWithLoadedContent=void 0;var o=r.parent;if(t(o)){var a=o.refine===l.REPLACE;r._ancestorWithContent=a&&o.hasRenderableContent?o:o._ancestorWithContent,r._ancestorWithLoadedContent=a&&o.hasRenderableContent&&o.contentAvailable?o:o._ancestorWithLoadedContent}}function T(e,r,i){if(i){var n=r.replacementNode;t(n)&&e._replacementList.splice(e._replacementSentinel,n)}}function w(e,t){e._screenSpaceErrorComputedFrame!==t.frameNumber&&(e._screenSpaceErrorComputedFrame=t.frameNumber,e._screenSpaceError=P(e._tileset,e.geometricError,e,t))}function A(e,r,i){return!t(r.parent)||r.parent.refine!==l.ADD||M(e,r,i)}function E(e,t,r,i){(t.contentUnloaded||t.contentExpired)&&t._requestedFrame!==r.frameNumber&&(i&&!A(e,t,r)||(t._requestedFrame=r.frameNumber,e._requestedTiles.push(t)))}function x(t,r){for(var i=s.NONE,n=t.children,o=n.length,a=t._visibilityPlaneMask,l=0;l<o;++l){var u=n[l],c=u.visibility(r,a);O(c)&&(i|=s.VISIBLE),u.insideViewerRequestVolume(r)?(i|=s.IN_REQUEST_VOLUME,O(c)&&(i|=s.VISIBLE_IN_REQUEST_VOLUME)):(O(c)&&(i|=s.VISIBLE_NOT_IN_REQUEST_VOLUME),c=e.MASK_OUTSIDE),u._visibilityPlaneMask=c}return t._childrenVisibility=i,i}function P(e,r,i,n){if(0===r)return 0;var s,l=n.camera,c=l.frustum,d=n.context,h=d.drawingBufferHeight;if(n.mode===u.SCENE2D||c instanceof a){t(c._offCenterFrustum)&&(c=c._offCenterFrustum);var p=d.drawingBufferWidth;s=r/(Math.max(c.top-c.bottom,c.right-c.left)/Math.max(p,h))}else{var f=Math.max(i._distanceToCamera,o.EPSILON7);if(s=r*h/(f*l.frustum.sseDenominator),e.dynamicScreenSpaceError){var m=e._dynamicScreenSpaceErrorComputedDensity,g=e.dynamicScreenSpaceErrorFactor;s-=o.fog(f,m)*g}}return s}function I(e,t){for(var r=e.length,i=0;i<r;++i){var n=e[i];n._distanceToCamera=n.distanceToTile(t),n._centerZDepth=n.distanceToTileCenter(t)}}function D(e,t){for(var r=e.length,i=0;i<r;++i){e[i].updateTransform(t)}}function O(t){return t!==e.MASK_OUTSIDE}function M(e,r,i){var n=e._maximumScreenSpaceError,o=r.parent;if(!t(o))return O(r._visibilityPlaneMask);var a=o.refine===l.ADD&&o._screenSpaceError>n;return O(r._visibilityPlaneMask)&&(!a||P(e,o.geometricError,r,i)>n)}function R(e){return e.refine===l.ADD||0===e.children.length||e._childrenVisibility&0!==s.VISIBLE}function L(e){return e.refine===l.ADD&&e.hasRenderableContent}function N(e,r){var i=r.stack;!t(e)||t(r.shouldVisit)&&!r.shouldVisit(e)||i.push(e);for(var n=0;i.length>0;){n=Math.max(n,i.length);var o=i.pop();r.visitStart(o);for(var a=r.getChildren(o),s=!t(a.get),l=a.length,u=0;u<l;++u){var c=s?a[u]:a.get(u);t(r.shouldVisit)&&!r.shouldVisit(c)||i.push(c)}0===l&&t(r.leafHandler)&&r.leafHandler(o),r.visitEnd(o)}i.trim(n)}function k(e,r){var i=r.queue1,n=r.queue2;!t(e)||t(r.shouldVisit)&&!r.shouldVisit(e)||i.push(e);for(var o=0;i.length>0;){var a=i.length;o=Math.max(o,a);for(var s=0;s<a;++s){var l=i.get(s);r.visitStart(l);for(var u=r.getChildren(l),c=!t(u.get),d=u.length,h=0;h<d;++h){var p=c?u[h]:u.get(h);t(r.shouldVisit)&&!r.shouldVisit(p)||n.push(p)}0===d&&t(r.leafHandler)&&r.leafHandler(l),r.visitEnd(l)}i.length=0;var f=i;i=n,n=f,r.queue1=i,r.queue2=n}i.length=0,n.length=0,i.trim(o),n.trim(o)}var F={},B=[],U=[],V=[],z=r([]);return m.prototype.execute=function(e,t,r,i,n){this.tileset=e,this.frameState=i,this.outOfCore=n,this.leaves.length=0,this.baseScreenSpaceError=Math.max(r,this.tileset._maximumScreenSpaceError),this.internalDFS.tileset=this.tileset,this.internalDFS.frameState=this.frameState,this.internalDFS.outOfCore=this.outOfCore,this.internalDFS.baseScreenSpaceError=this.baseScreenSpaceError,N(t,this)},m.prototype.visitStart=function(e){C(e,this.frameState)||S(this.tileset,e,this.frameState,this.outOfCore)},m.prototype.visitEnd=function(e){e._lastVisitedFrame=this.frameState.frameNumber},m.prototype.getChildren=function(e){var t=this.tileset,r=this.outOfCore,i=this.frameState;if(!g(t,e,this.baseScreenSpaceError,i))return z;for(var n=e.children,o=n.length,a=!0,s=e.refine===l.REPLACE&&e.hasRenderableContent,u=0;u<o;++u){var c=n[u];E(t,c,i,!0),T(t,c,r),s&&(a=c.hasEmptyContent?a&&this.internalDFS.execute(c):a&&c.contentAvailable)}return a?n:z},m.prototype.shouldVisit=function(e){return O(e._visibilityPlaneMask)},m.prototype.leafHandler=function(e){if(this.tileset._skipLevelOfDetail||!L(e)){if(e.refine===l.REPLACE&&!R(e))return void++this.tileset._statistics.numberOfTilesCulledWithChildrenUnion;this.leaves.push(e)}},_.prototype.execute=function(e){return this.allLoaded=!0,N(e,this),this.allLoaded},_.prototype.visitStart=function(e){C(e,this.frameState)||S(this.tileset,e,this.frameState,this.outOfCore)},_.prototype.visitEnd=m.prototype.visitEnd,_.prototype.shouldVisit=function(e){return!e.hasRenderableContent&&O(e._visibilityPlaneMask)},_.prototype.getChildren=function(e){var t=this.tileset,r=this.frameState,i=this.outOfCore;if(!g(t,e,this.baseScreenSpaceError,r))return z;for(var n=e.children,o=n.length,a=0;a<o;++a){var s=n[a];E(t,s,r,!0),T(t,s,i),e.contentAvailable||(this.allLoaded=!1)}return n},_.prototype.updateAndCheckChildren=m.prototype.updateAndCheckChildren,v.prototype.execute=function(e,t,r,i){this.tileset=e,this.frameState=r,this.outOfCore=i,this.internalDFS.frameState=r,this.internalDFS.outOfCore=i,this.maxChildrenLength=0,k(t,this),this.queue1.length=0,this.queue2.length=0,this.scratchQueue.length=0,this.scratchQueue.trim(this.maxChildrenLength)},v.prototype.visitStart=function(e){C(e,this.frameState)||S(this.tileset,e,this.frameState,this.outOfCore)},v.prototype.visitEnd=m.prototype.visitEnd,v.prototype.getChildren=function(e){return this.scratchQueue.length=0,this.internalDFS.execute(e,this.scratchQueue),this.maxChildrenLength=Math.max(this.maxChildrenLength,this.scratchQueue.length),this.scratchQueue},v.prototype.leafHandler=function(e){L(e)||C(e,this.frameState)||this.tileset._desiredTiles.push(e)},y.prototype.execute=function(e,t){this.tileset=e._tileset,this.root=e,this.queue=t,N(e,this)},y.prototype.visitStart=function(e){C(e,this.frameState)||S(this.tileset,e,this.frameState,this.outOfCore)},y.prototype.visitEnd=m.prototype.visitEnd,y.prototype.getChildren=function(e){var r=this.tileset,i=r._maximumScreenSpaceError;if(e.hasTilesetContent&&e.contentExpired)return z;if(!e.hasTilesetContent){if(e.refine===l.ADD&&(E(r,e,this.frameState,!0),L(e)&&r._desiredTiles.push(e)),e._screenSpaceError<=i)return b(e,this.frameState),z;if(!e.hasEmptyContent&&e.contentUnloaded&&t(e._ancestorWithLoadedContent)&&this.selectionHeuristic(r,e._ancestorWithLoadedContent,e))return b(e,this.frameState),z}var n=b(e,this.frameState),o=e.refine===l.ADD&&e._screenSpaceError>i,a=e.refine===l.REPLACE&&0!=(n&s.VISIBLE_IN_REQUEST_VOLUME);if(n&s.VISIBLE_NOT_IN_REQUEST_VOLUME&&e.refine===l.REPLACE&&this.tileset._desiredTiles.push(e),o||a||e.hasTilesetContent){for(var u=e.children,c=u.length,d=0;d<c;++d)T(r,u[d],this.outOfCore);return u}return z},y.prototype.shouldVisit=function(e){return M(this.tileset,e,this.frameState)},y.prototype.leafHandler=function(e){if(e!==this.root){if(e.refine===l.REPLACE&&!R(e))return void++this.tileset._statistics.numberOfTilesCulledWithChildrenUnion;if(!e.hasEmptyContent)if(this.tileset.loadSiblings)for(var t=e.parent,r=t.children,i=r.length,n=0;n<i;++n)E(this.tileset,r[n],this.frameState,!1),T(this.tileset,r[n],this.outOfCore);else E(this.tileset,e,this.frameState,!0),T(this.tileset,e,this.outOfCore);this.queue.push(e)}else L(e)||this.tileset._desiredTiles.push(e)},F.selectTiles=c,F.BaseTraversal=m,F.SkipTraversal=v,F}),define("Scene/Cesium3DTileStyleEngine",["../Core/defined","../Core/defineProperties"],function(e,t){"use strict";function r(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}return t(r.prototype,{style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}}}),r.prototype.makeDirty=function(){this._styleDirty=!0},r.prototype.applyStyle=function(t,r){if(t.ready&&(!e(this._style)||this._style.ready)){var i=this._styleDirty;r.passes.render&&(this._styleDirty=!1),i&&++this._lastStyleTime;for(var n=this._lastStyleTime,o=t._statistics,a=i?t._selectedTiles:t._selectedTilesToStyle,s=a.length,l=0;l<s;++l){var u=a[l];if(u.selected&&u.lastStyleTime!==n){var c=u.content;u.lastStyleTime=n,c.applyStyle(r,this._style),o.numberOfFeaturesStyled+=c.featuresLength,++o.numberOfTilesStyled}}}},r}),define("Shaders/PostProcessFilters/PointCloudEyeDomeLighting",[],function(){"use strict";return"#extension GL_EXT_frag_depth : enable\nuniform sampler2D u_pointCloud_colorTexture;\nuniform sampler2D u_pointCloud_ecAndLogDepthTexture;\nuniform vec3 u_distancesAndEdlStrength;\nvarying vec2 v_textureCoordinates;\nvec2 neighborContribution(float log2Depth, vec2 padding)\n{\nvec2 depthAndLog2Depth = texture2D(u_pointCloud_ecAndLogDepthTexture, v_textureCoordinates + padding).zw;\nif (depthAndLog2Depth.x == 0.0)\n{\nreturn vec2(0.0);\n}\nelse\n{\nreturn vec2(max(0.0, log2Depth - depthAndLog2Depth.y), 1.0);\n}\n}\nvoid main()\n{\nvec4 ecAlphaDepth = texture2D(u_pointCloud_ecAndLogDepthTexture, v_textureCoordinates);\nif (length(ecAlphaDepth.xyz) < czm_epsilon7)\n{\ndiscard;\n}\nelse\n{\nvec4 color = texture2D(u_pointCloud_colorTexture, v_textureCoordinates);\nfloat distX = u_distancesAndEdlStrength.x;\nfloat distY = u_distancesAndEdlStrength.y;\nvec2 responseAndCount = vec2(0.0);\nresponseAndCount += neighborContribution(ecAlphaDepth.a, vec2(0, distY));\nresponseAndCount += neighborContribution(ecAlphaDepth.a, vec2(distX, 0));\nresponseAndCount += neighborContribution(ecAlphaDepth.a, vec2(0, -distY));\nresponseAndCount += neighborContribution(ecAlphaDepth.a, vec2(-distX, 0));\nfloat response = responseAndCount.x / responseAndCount.y;\nfloat shade = exp(-response * 300.0 * u_distancesAndEdlStrength.z);\ncolor.rgb *= shade;\ngl_FragColor = vec4(color);\ngl_FragDepthEXT = czm_eyeToWindowCoordinates(vec4(ecAlphaDepth.xyz, 1.0)).z;\n}\n}\n"}),define("Scene/PointCloudEyeDomeLighting",["../Core/Cartesian3","../Core/clone","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defined","../Core/destroyObject","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderSource","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Scene/BlendEquation","../Scene/BlendFunction","../Scene/BlendingState","../Scene/StencilFunction","../Scene/StencilOperation","../Shaders/PostProcessFilters/PointCloudEyeDomeLighting"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M){"use strict";function R(){this._framebuffer=void 0,this._colorTexture=void 0,this._ecAndLogDepthTexture=void 0,this._depthTexture=void 0,this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}function L(){return new y({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:w.NEAREST,magnificationFilter:T.NEAREST})}function N(e){var t=e._framebuffer;o(t)&&(e._colorTexture.destroy(),e._ecAndLogDepthTexture.destroy(),e._depthTexture.destroy(),t.destroy(),e._framebuffer=void 0,e._colorTexture=void 0,e._ecAndLogDepthTexture=void 0,e._depthTexture=void 0,e._drawCommand=void 0,e._clearCommand=void 0)}function k(e,t){var r=t.drawingBufferWidth,i=t.drawingBufferHeight,n=new S({context:t,width:r,height:i,pixelFormat:c.RGBA,pixelDatatype:s.isFirefox()?_.FLOAT:_.UNSIGNED_BYTE,sampler:L()}),o=new S({context:t,width:r,height:i,pixelFormat:c.RGBA,pixelDatatype:_.FLOAT,sampler:L()}),a=new S({context:t,width:r,height:i,pixelFormat:c.DEPTH_COMPONENT,pixelDatatype:_.UNSIGNED_INT,sampler:L()});e._framebuffer=new m({context:t,colorTextures:[n,o],depthTexture:a,destroyAttachments:!1}),e._colorTexture=n,e._ecAndLogDepthTexture=o,e._depthTexture=a}function F(e,t){var i=M,n={u_pointCloud_colorTexture:function(){return e._colorTexture},u_pointCloud_ecAndLogDepthTexture:function(){return e._ecAndLogDepthTexture},u_distancesAndEdlStrength:function(){return z.x=e._radius/t.drawingBufferWidth,z.y=e._radius/t.drawingBufferHeight,z.z=e._strength,z}},o=v.fromCache({blending:I.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0}});e._drawCommand=t.createViewportQuadCommand(i,{uniformMap:n,renderState:o,pass:g.CESIUM_3D_TILE,owner:e}),e._clearCommand=new p({framebuffer:e._framebuffer,color:new r(0,0,0,0),depth:1,renderState:v.fromCache(),pass:g.CESIUM_3D_TILE,owner:e})}function B(e,t){var r=t.drawingBufferWidth,i=t.drawingBufferHeight,n=e._colorTexture,a=!1,s=o(n)&&(n.width!==r||n.height!==i);return o(n)&&!s||(N(e),k(e,t),F(e,t),a=!0),a}function U(e){return e.floatingPointTexture&&e.drawBuffers&&e.fragmentDepth}function V(e,t){var r=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!o(r)){var i=t._attributeLocations,n=t.vertexShaderSource.clone(),a=t.fragmentShaderSource.clone();n.sources=n.sources.map(function(e){return e=b.replaceMain(e,"czm_point_cloud_post_process_main")}),a.sources=a.sources.map(function(e){return e=b.replaceMain(e,"czm_point_cloud_post_process_main"),e=e.replace(/gl_FragColor/g,"gl_FragData[0]")}),n.sources.push("varying vec3 v_positionEC; \nvoid main() \n{ \n    czm_point_cloud_post_process_main(); \n    v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}"),a.sources.unshift("#extension GL_EXT_draw_buffers : enable \n"),a.sources.push("varying vec3 v_positionEC; \nvoid main() \n{ \n    czm_point_cloud_post_process_main(); \n    gl_FragData[1] = vec4(v_positionEC, log2(-v_positionEC.z)); \n}"),r=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:i})}return r}var z=new e;return R.isSupported=U,R.prototype.update=function(e,t,r){var i=e.passes,n=i.pick&&!i.render;if(U(e.context)&&!n){this._strength=r.pointCloudShading.eyeDomeLightingStrength,this._radius=r.pointCloudShading.eyeDomeLightingRadius;var a,s=B(this,e.context),l=e.commandList,u=l.length;for(a=t;a<u;++a){var c=l[a];if(c.primitiveType===d.POINTS&&c.pass!==g.TRANSLUCENT){var h=c.derivedCommands.pointCloudProcessor;(!o(h)||c.dirty||s||h.framebuffer!==this._framebuffer)&&(h=f.shallowClone(c),c.derivedCommands.pointCloudProcessor=h,h.framebuffer=this._framebuffer,h.shaderProgram=V(e.context,c.shaderProgram),h.castShadows=!1,h.receiveShadows=!1),l[a]=h}}var p=this._clearCommand,m=this._drawCommand;l.push(m),l.push(p)}},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return N(this),a(this)},R}),define("Scene/PointCloudShading",["../Core/defaultValue","./PointCloudEyeDomeLighting"],function(e,t){"use strict";function r(t){var r=e(t,{});this.attenuation=e(r.attenuation,!1),this.geometricErrorScale=e(r.geometricErrorScale,1),this.maximumAttenuation=r.maximumAttenuation,this.baseResolution=r.baseResolution,this.eyeDomeLighting=e(r.eyeDomeLighting,!0),this.eyeDomeLightingStrength=e(r.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=e(r.eyeDomeLightingRadius,1)}return r.isSupported=function(e){return t.isSupported(e.context)},r}),define("Scene/Cesium3DTileset",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/destroyObject","../Core/DeveloperError","../Core/DoublyLinkedList","../Core/Ellipsoid","../Core/Event","../Core/getBaseUri","../Core/getExtensionFromUri","../Core/getMagic","../Core/isDataUri","../Core/JulianDate","../Core/ManagedArray","../Core/Math","../Core/Matrix4","../Core/Resource","../Core/RuntimeError","../Renderer/ClearCommand","../Renderer/Pass","../ThirdParty/when","./Axis","./Cesium3DTile","./Cesium3DTileColorBlendMode","./Cesium3DTileOptimizations","./Cesium3DTilesetStatistics","./Cesium3DTilesetTraversal","./Cesium3DTileStyleEngine","./ClassificationType","./LabelCollection","./PointCloudShading","./PointCloudEyeDomeLighting","./SceneMode","./ShadowMode","./TileBoundingRegion","./TileBoundingSphere","./TileOrientedBoundingBox"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U,V,z){"use strict";function G(e){e=n(e,n.EMPTY_OBJECT),this._url=void 0,this._tilesetUrl=void 0,this._basePath=void 0,this._root=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._gltfUpAxis=void 0,this._processingQueue=[],this._selectedTiles=[],this._requestedTiles=[],this._desiredTiles=new v,this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0;var t=new c;this._replacementList=t,this._replacementSentinel=t.add(),this._trimTiles=!1,this._cullWithChildrenBounds=n(e.cullWithChildrenBounds,!0),this._hasMixedContent=!1,this._baseTraversal=new O.BaseTraversal,this._skipTraversal=new O.SkipTraversal({selectionHeuristic:q}),this._backfaceCommands=new v,this._maximumScreenSpaceError=n(e.maximumScreenSpaceError,16),this._maximumMemoryUsage=n(e.maximumMemoryUsage,512),this._styleEngine=new M,this._modelMatrix=o(e.modelMatrix)?b.clone(e.modelMatrix):b.clone(b.IDENTITY),this._statistics=new D,this._statisticsLastColor=new D,this._statisticsLastPick=new D,this._tilesLoaded=!1,this._tileDebugLabels=void 0,this._readyPromise=A.defer(),this._classificationType=e.classificationType,this._ellipsoid=n(e.ellipsoid,d.WGS84),this.dynamicScreenSpaceError=n(e.dynamicScreenSpaceError,!1),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorFactor=4,this.dynamicScreenSpaceErrorHeightFalloff=.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=n(e.shadows,B.ENABLED),this.show=n(e.show,!0),this.colorBlendMode=P.HIGHLIGHT,this.colorBlendAmount=.5,this.pointCloudShading=new N(e.pointCloudShading),this._pointCloudEyeDomeLighting=new k,this.loadProgress=new h,this.allTilesLoaded=new h,this.tileLoad=new h,this.tileUnload=new h,this.tileFailed=new h,this.tileVisible=new h,this.skipLevelOfDetail=n(e.skipLevelOfDetail,!0),this._skipLevelOfDetail=this.skipLevelOfDetail,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=n(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=n(e.skipScreenSpaceErrorFactor,16),this.skipLevels=n(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=n(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=n(e.loadSiblings,!1),this.clippingPlanes=e.clippingPlanes,this.debugFreezeFrame=n(e.debugFreezeFrame,!1),this.debugColorizeTiles=n(e.debugColorizeTiles,!1),this.debugWireframe=n(e.debugWireframe,!1),this.debugShowBoundingVolume=n(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=n(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=n(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=n(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=n(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=n(e.debugShowMemoryUsage,!1),this.debugShowUrl=n(e.debugShowUrl,!1),this._brokenUrlWorkaround=!1,this._credits=void 0;var r,i=this;A(e.url).then(function(e){var t,n=C.createIfNeeded(e);return i._credits=n.credits,r=n,"json"===n.extension?t=n.getBaseUri(!0):n.isDataUri?t="":(n.appendForwardSlash(),r=n.getDerivedResource({url:"tileset.json"}),t=n.url),i._url=n.url,i._tilesetUrl=r.url,i._basePath=t,G.loadJson(r)}).then(function(e){return H(i,r,e)}).then(function(e){i._brokenUrlWorkaround&&s("Cesium3DTileset.leadingSlash","Having a leading slash in a tile URL that is actually relative to the tileset.json is deprecated."),i._root=i.loadTileset(r,e);var t=o(e.asset.gltfUpAxis)?E.fromName(e.asset.gltfUpAxis):E.Y;i._asset=e.asset,i._properties=e.properties,i._geometricError=e.geometricError,i._gltfUpAxis=t,i._readyPromise.resolve(i)}).otherwise(function(e){i._readyPromise.reject(e)})}function H(e,t,r){var i=W(r.root);return o(i)&&0!==i.length?t.getDerivedResource({url:i}).fetchArrayBuffer().then(function(t){var i=new Uint8Array(t),n=m(i);return e._brokenUrlWorkaround="b3dm"!==n,r}).otherwise(function(){return e._brokenUrlWorkaround=!0,r}):r}function W(e){var t=e.content;if(o(t)&&o(t.url))return se.test(t.url)?t.url:"";var r=e.children;if(o(r))for(var i=r.length,n=0;n<i;++n){var a=W(r[n]);if(o(a))return a}}function j(e,i){var n,o,a,s,l,u=i.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof U)n=t.normalize(u.positionWC,le),o=u.directionWC,a=u.positionCartographic.height,s=d.minimumHeight,l=d.maximumHeight;else{var h=b.inverseTransformation(c.computedTransform,ce),p=i.mapProjection.ellipsoid,f=d.boundingVolume,m=b.multiplyByPoint(h,f.center,de);if(t.magnitude(m)>p.minimumRadius){var g=r.fromCartesian(m,p,ue);n=t.normalize(u.positionWC,le),o=u.directionWC,a=u.positionCartographic.height,s=0,l=2*g.height}else{var _=b.multiplyByPoint(h,u.positionWC,he);if(n=t.UNIT_Z,o=b.multiplyByPointAsVector(h,u.directionWC,pe),o=t.normalize(o,o),a=_.z,d instanceof z){var v=c._header.boundingVolume.box[11];s=m.z-v,l=m.z+v}else if(d instanceof V){var C=f.radius;s=m.z-C,l=m.z+C}}}var S=e.dynamicScreenSpaceErrorHeightFalloff,T=s+(l-s)*S,w=l,A=y.clamp((a-T)/(w-T),0,1),E=Math.abs(t.dot(o,n)),x=1-E;x*=1-A;var P=e.dynamicScreenSpaceErrorDensity;P*=x,e._dynamicScreenSpaceErrorComputedDensity=P}function q(e,t,r){var i=e._skipLevelOfDetail?e.skipLevels:0,n=e._skipLevelOfDetail?e.skipScreenSpaceErrorFactor:1;return t!==r&&!r.hasEmptyContent&&!e.immediatelyLoadDesiredLevelOfDetail&&r._screenSpaceError<t._screenSpaceError/n&&r._depth>t._depth+i}function Y(e,t){if(!t.hasEmptyContent){var r=e._statistics,i=t.contentExpired;if(!t.requestContent())return void++r.numberOfAttemptedRequests;i&&(t.hasRenderableContent?(r.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady):t.hasTilesetContent&&ie(e,t)),++r.numberOfPendingRequests;var n=Z(e,t);t.contentReadyToProcessPromise.then(Q(e,t)),t.contentReadyPromise.then(function(){n(),e.tileLoad.raiseEvent(t)}).otherwise(function(r){n();var i=t._contentResource.url,a=o(r.message)?r.message:r.toString();e.tileFailed.numberOfListeners>0?e.tileFailed.raiseEvent({url:i,message:a}):(console.log("A 3D tile failed to load: "+i),console.log("Error: "+a))})}}function X(e,t){if(t)for(var r=e._requestedTiles,i=r.length,n=0;n<i;++n)Y(e,r[n])}function Q(e,t){return function(){e._processingQueue.push(t),--e._statistics.numberOfPendingRequests,++e._statistics.numberOfTilesProcessing}}function Z(e,t){return function(){var r=e._processingQueue.indexOf(t);if(-1===r)return void--e._statistics.numberOfPendingRequests;e._processingQueue.splice(r,1),--e._statistics.numberOfTilesProcessing,t.hasRenderableContent&&(e._statistics.incrementLoadCounts(t.content),++e._statistics.numberOfTilesWithContentReady,o(t.replacementNode)||(t.replacementNode=e._replacementList.add(t)))}}function K(e,t){for(var r=e._processingQueue,i=r.length,n=i-1;n>=0;--n)r[n].process(e,t)}function J(e){var t=e/1048576;return t<1?t.toLocaleString(void 0,me):Math.round(t).toLocaleString()}function $(e){var r=e._boundingVolume.boundingVolume,i=r.halfAxes,n=r.radius,a=t.clone(r.center,fe);if(o(i))a.x+=.75*(i[0]+i[3]+i[6]),a.y+=.75*(i[1]+i[4]+i[7]),a.z+=.75*(i[2]+i[5]+i[8]);else if(o(n)){var s=t.normalize(r.center,fe);s=t.multiplyByScalar(s,.75*n,fe),a=t.add(s,r.center,fe)}return a}function ee(e,t,r){var i="",n=0;if(t.debugShowGeometricError&&(i+="\nGeometric error: "+e.geometricError,n++),t.debugShowRenderingStatistics){i+="\nCommands: "+e.commandsLength,n++;e.content.pointsLength>0&&(i+="\nPoints: "+e.content.pointsLength,n++);e.content.trianglesLength>0&&(i+="\nTriangles: "+e.content.trianglesLength,n++),i+="\nFeatures: "+e.content.featuresLength,n++}t.debugShowMemoryUsage&&(i+="\nTexture Memory: "+J(e.content.texturesByteLength),i+="\nGeometry Memory: "+J(e.content.geometryByteLength),n+=2),t.debugShowUrl&&(i+="\nUrl: "+e._header.content.url,n++);var o={text:i.substring(1),position:r,font:19-n+"px sans-serif",showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function te(t,r){var i=t._selectedTiles,n=i.length;if(t._tileDebugLabels.removeAll(),t.debugPickedTileLabelOnly){if(o(t.debugPickedTile)){var a=o(t.debugPickPosition)?t.debugPickPosition:$(t.debugPickedTile),s=ee(t.debugPickedTile,t,a);s.pixelOffset=new e(15,-15)}}else for(var l=0;l<n;++l){var u=i[l];ee(u,t,$(u))}t._tileDebugLabels.update(r)}function re(e,t){e._styleEngine.applyStyle(e,t);var r,i=e._statistics,n=t.commandList,a=n.length,s=e._selectedTiles,l=s.length,u=e.tileVisible,c=e._skipLevelOfDetail&&e._hasMixedContent&&t.context.stencilBuffer&&l>0;e._backfaceCommands.length=0,c&&n.push(ge);var d=n.length;for(r=0;r<l;++r){var h=s[r];h.selected&&(u.raiseEvent(h),h.update(e,t),i.incrementSelectionCounts(h.content),++i.selected)}var p=n.length,f=p-d;if(e._backfaceCommands.trim(),c){var m=e._backfaceCommands.values,g=m.length;for(n.length+=g,r=f-1;r>=0;--r)n[d+g+r]=n[d+r];for(r=0;r<g;++r)n[d+r]=m[r]}i.numberOfCommands=n.length-a,e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&f>0&&e._pointCloudEyeDomeLighting.update(t,a,e),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(o(e._tileDebugLabels)||(e._tileDebugLabels=new L),te(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy()}function ie(e,t){var r=t,i=e._statistics,n=_e;for(n.push(t);n.length>0;){t=n.pop();for(var o=t.children,a=o.length,s=0;s<a;++s)n.push(o[s]);t!==r&&(ne(e,t),t.destroy(),--i.numberOfTilesTotal)}r.children=[]}function ne(e,t){var r=t.replacementNode;if(o(r)){var i=e._statistics,n=e._replacementList;e.tileUnload.raiseEvent(t),n.remove(r),i.decrementLoadCounts(t.content),--i.numberOfTilesWithContentReady}}function oe(e){var t=e._trimTiles;e._trimTiles=!1;for(var r=e._replacementList,i=e.totalMemoryUsageInBytes,n=1024*e._maximumMemoryUsage*1024,o=e._replacementSentinel,a=r.head;a!==o&&(i>n||t);){var s=a.item;a=a.next,ne(e,s),s.unloadContent(),i=e.totalMemoryUsageInBytes}}function ae(e,t){var r=e._statistics,i=e._statisticsLastColor,n=r.numberOfPendingRequests,o=r.numberOfTilesProcessing,a=i.numberOfPendingRequests,s=i.numberOfTilesProcessing,l=n!==a||o!==s;l&&t.afterRender.push(function(){
e.loadProgress.raiseEvent(n,o)}),e._tilesLoaded=0===r.numberOfPendingRequests&&0===r.numberOfTilesProcessing&&0===r.numberOfAttemptedRequests,l&&e._tilesLoaded&&t.afterRender.push(function(){e.allTilesLoaded.raiseEvent()})}var se=/^\/.+\.b3dm$/;a(G.prototype,{asset:{get:function(){return this._asset}},properties:{get:function(){return this._properties}},ready:{get:function(){return o(this._root)}},readyPromise:{get:function(){return this._readyPromise.promise}},tilesLoaded:{get:function(){return this._tilesLoaded}},url:{get:function(){return this._url}},basePath:{get:function(){return s("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset.json that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(e){this._maximumMemoryUsage=e}},boundingSphere:{get:function(){return this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=b.clone(e,this._modelMatrix),o(this._root)&&this._root.updateTransform(this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){var e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}}}),G.loadJson=function(e){return C.createIfNeeded(e).fetchJson()},G.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()},G.prototype.loadTileset=function(e,t,r){var i=t.asset;if(!o(i))throw new S("Tileset must have an asset property.");if("0.0"!==i.version&&"1.0"!==i.version)throw new S("The tileset must be 3D Tiles version 0.0 or 1.0.  See https://github.com/AnalyticalGraphicsInc/3d-tiles#spec-status");var a=this._statistics;if(!o(e.queryParameters.v)){var s={v:n(i.tilesetVersion,"0.0")};this._basePath+="?v="+s.v,e.setQueryParameters(s)}var l=new x(this,e,t.root,r);o(r)&&(r.children.push(l),l._depth=r._depth+1),++a.numberOfTilesTotal;var u=[];for(u.push({header:t.root,tile3D:l});u.length>0;){var c=u.pop(),d=c.tile3D,h=c.header.children;if(o(h))for(var p=h.length,f=0;f<p;++f){var m=h[f],g=new x(this,e,m,d);d.children.push(g),g._depth=d._depth+1,++a.numberOfTilesTotal,u.push({header:m,tile3D:g})}this._cullWithChildrenBounds&&I.checkChildrenWithinParent(d)}return l};var le=new t,ue=new r,ce=new b,de=new t,he=new t,pe=new t,fe=new t,me={maximumFractionDigits:3},ge=new T({stencil:0,pass:w.CESIUM_3D_TILE}),_e=[];return G.prototype.trimLoadedTiles=function(){this._trimTiles=!0},G.prototype.update=function(e){if(e.mode!==F.MORPHING&&this.show&&this.ready){o(this._loadTimestamp)||(this._loadTimestamp=_.clone(e.time)),this._timeSinceLoad=Math.max(1e3*_.secondsDifference(e.time,this._loadTimestamp),0),this._skipLevelOfDetail=this.skipLevelOfDetail&&!o(this._classificationType)&&!this._disableSkipLevelOfDetail;var t=e.passes,r=t.pick&&!t.render,i=!r,n=this._statistics;n.clear(),i&&K(this,e),this.dynamicScreenSpaceError&&j(this,e),O.selectTiles(this,e,i),X(this,i),re(this,e),i&&oe(this),ae(this,e);var a=r?this._statisticsLastPick:this._statisticsLastColor;if(D.clone(n,a),0!==n.selected){var s=this._credits;if(o(s))for(var l=s.length,u=0;u<l;u++)e.creditDisplay.addCredit(s[u])}}},G.prototype.isDestroyed=function(){return!1},G.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),o(this._root)){var e=_e;for(e.push(this._root);e.length>0;){var t=e.pop();t.destroy();for(var r=t.children,i=r.length,n=0;n<i;++n)e.push(r[n])}}return this._root=void 0,l(this)},G}),define("Scene/ConditionsExpression",["../Core/clone","../Core/defined","../Core/defineProperties","./Expression"],function(e,t,r,i){"use strict";function n(t,r){this._conditionsExpression=e(t,!0),this._conditions=t.conditions,this._runtimeConditions=void 0,a(this,r)}function o(e,t){this.condition=e,this.expression=t}function a(e,r){var n=[],a=e._conditions;if(t(a)){for(var s=a.length,l=0;l<s;++l){var u=a[l],c=String(u[0]),d=String(u[1]);n.push(new o(new i(c,r),new i(d,r)))}e._runtimeConditions=n}}return r(n.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}}),n.prototype.evaluate=function(e,r,i){var n=this._runtimeConditions;if(t(n))for(var o=n.length,a=0;a<o;++a){var s=n[a];if(s.condition.evaluate(e,r))return s.expression.evaluate(e,r,i)}},n.prototype.evaluateColor=function(e,r,i){var n=this._runtimeConditions;if(t(n))for(var o=n.length,a=0;a<o;++a){var s=n[a];if(s.condition.evaluate(e,r))return s.expression.evaluateColor(e,r,i)}},n.prototype.getShaderFunction=function(e,r,i,n){var o=this._runtimeConditions;if(t(o)&&0!==o.length){for(var a="",s=o.length,l=0;l<s;++l){var u=o[l],c=u.condition.getShaderExpression(r,i),d=u.expression.getShaderExpression(r,i);a+="    "+(0===l?"if":"else if")+" ("+c+") \n    { \n        return "+d+"; \n    } \n"}return a=n+" "+e+"() \n{ \n"+a+"    return "+n+"(1.0); \n} \n"}},n}),define("Scene/Cesium3DTileStyle",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Resource","../ThirdParty/when","./ConditionsExpression","./Expression"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){this._style=void 0,this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1;var t;if("string"==typeof e||e instanceof o){t=o.createIfNeeded(e).fetchJson(e)}else t=a.resolve(e);var r=this;this._readyPromise=t.then(function(e){return c(r,e),r})}function c(i,n){i._style=e(n,!0),n=t(n,t.EMPTY_OBJECT),i.show=n.show,i.color=n.color,i.pointSize=n.pointSize,i.pointOutlineColor=n.pointOutlineColor,i.pointOutlineWidth=n.pointOutlineWidth,i.labelColor=n.labelColor,i.labelOutlineColor=n.labelOutlineColor,i.labelOutlineWidth=n.labelOutlineWidth,i.labelStyle=n.labelStyle,i.font=n.font,i.labelText=n.labelText,i.backgroundColor=n.backgroundColor,i.backgroundPadding=n.backgroundPadding,i.backgroundEnabled=n.backgroundEnabled,i.scaleByDistance=n.scaleByDistance,i.translucencyByDistance=n.translucencyByDistance,i.distanceDisplayCondition=n.distanceDisplayCondition,i.heightOffset=n.heightOffset,i.anchorLineEnabled=n.anchorLineEnabled,i.anchorLineColor=n.anchorLineColor,i.image=n.image,i.disableDepthTestDistance=n.disableDepthTestDistance,i.horizontalOrigin=n.horizontalOrigin,i.verticalOrigin=n.verticalOrigin,i.labelHorizontalOrigin=n.labelHorizontalOrigin,i.labelVerticalOrigin=n.labelVerticalOrigin;var o={};if(r(n.meta)){var a=n.defines,s=t(n.meta,t.EMPTY_OBJECT);for(var u in s)s.hasOwnProperty(u)&&(o[u]=new l(s[u],a))}i._meta=o,i._ready=!0}function d(e,i){var n=t(e._style,t.EMPTY_OBJECT).defines;if(r(i))return"boolean"==typeof i||"number"==typeof i?new l(String(i)):"string"==typeof i?new l(i,n):r(i.conditions)?new s(i,n):i}return i(u.prototype,{style:{get:function(){return this._style}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},show:{get:function(){return this._show},set:function(e){this._show=d(this,e),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=d(this,e),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=d(this,e),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=d(this,e)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=d(this,e)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=d(this,e)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=d(this,e)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=d(this,e)}},font:{get:function(){return this._font},set:function(e){this._font=d(this,e)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=d(this,e)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=d(this,e)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=d(this,e)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=d(this,e)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=d(this,e)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=d(this,e)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=d(this,e)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=d(this,e)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=d(this,e)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=d(this,e)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=d(this,e)}},image:{get:function(){return this._image},set:function(e){this._image=d(this,e)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=d(this,e)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=d(this,e)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=d(this,e)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=d(this,e)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=d(this,e)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}}),u.prototype.getColorShaderFunction=function(e,t,i){return this._colorShaderFunctionReady?(i.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,this._colorShaderFunction=r(this.color)?this.color.getShaderFunction(e,t,i,"vec4"):void 0,this._colorShaderTranslucent=i.translucent,this._colorShaderFunction)},u.prototype.getShowShaderFunction=function(e,t,i){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,this._showShaderFunction=r(this.show)?this.show.getShaderFunction(e,t,i,"bool"):void 0,this._showShaderFunction)},u.prototype.getPointSizeShaderFunction=function(e,t,i){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,this._pointSizeShaderFunction=r(this.pointSize)?this.pointSize.getShaderFunction(e,t,i,"float"):void 0,this._pointSizeShaderFunction)},u}),define("Scene/CircleEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,r,i,n){"use strict";function o(e){e=r(e,1),this._radius=r(e,1)}return i(o.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),o.prototype.emit=function(t){var r=n.randomBetween(0,n.TWO_PI),i=n.randomBetween(0,this._radius),o=i*Math.cos(r),a=i*Math.sin(r);t.position=e.fromElements(o,a,0,t.position),t.velocity=e.clone(e.UNIT_Z,t.velocity)},o}),define("Scene/ConeEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,r,i,n){"use strict";function o(e){this._angle=r(e,a)}var a=n.toRadians(30);return i(o.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}}),o.prototype.emit=function(t){var r=Math.tan(this._angle),i=n.randomBetween(0,n.TWO_PI),o=n.randomBetween(0,r),a=o*Math.cos(i),s=o*Math.sin(i);t.velocity=e.fromElements(a,s,1,t.velocity),e.normalize(t.velocity,t.velocity),t.position=e.clone(e.ZERO,t.position)},o}),define("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/clone","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/isArray","../Core/Math","../Core/Rectangle","../Core/Resource","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y){"use strict";function b(e){this._errorEvent=new d,this._resource=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesResource=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._tags=void 0,this._pickFeaturesTags=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}function C(e,t,r,i,n){ie=!1,oe=!1;var o=e._resource,a=o.getUrlComponent(!0),l=e._tags,u={},c=a.match(ee);return s(c)&&c.forEach(function(n){var o=n.substring(1,n.length-1);s(l[o])&&(u[o]=l[o](e,t,r,i))}),o.getDerivedResource({request:n,templateValues:u})}function S(e,t,r,i,n,o,a){ie=!1,oe=!1,se=!1,ue=!1;var l=e._pickFeaturesResource,u=l.getUrlComponent(!0),c=e._pickFeaturesTags,d={},h=u.match(ee);return s(h)&&h.forEach(function(l){var u=l.substring(1,l.length-1);s(c[u])&&(d[u]=c[u](e,t,r,i,n,o,a))}),l.getDerivedResource({templateValues:d})}function T(e,t,r){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){var i=e.urlSchemeZeroPadding[t];if("string"==typeof i){var n=i.length;n>1&&(r=r.length>=n?r:new Array(n-r.toString().length+1).join("0")+r)}}return r}function w(e,t,r,i){return T(e,"{x}",t)}function A(e,t,r,i){return T(e,"{reverseX}",e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1)}function E(e,t,r,i){return T(e,"{y}",r)}function x(e,t,r,i){return T(e,"{reverseY}",e.tilingScheme.getNumberOfYTilesAtLevel(i)-r-1)}function P(e,t,r,i){var n=e.maximumLevel;return T(e,"{reverseZ}",s(n)&&i<n?n-i-1:i)}function I(e,t,r,i){return T(e,"{z}",i)}function D(e,t,r,i){var n=(t+r+i)%e._subdomains.length;return e._subdomains[n]}function O(e,t,r,i){ie||(e.tilingScheme.tileXYToRectangle(t,r,i,ne),ne.west=f.toDegrees(ne.west),ne.south=f.toDegrees(ne.south),ne.east=f.toDegrees(ne.east),ne.north=f.toDegrees(ne.north),ie=!0)}function M(e,t,r,i){return O(e,t,r,i),ne.west}function R(e,t,r,i){return O(e,t,r,i),ne.south}function L(e,t,r,i){return O(e,t,r,i),ne.east}function N(e,t,r,i){return O(e,t,r,i),ne.north}function k(e,t,r,i){oe||(e.tilingScheme.tileXYToNativeRectangle(t,r,i,ae),oe=!0)}function F(e,t,r,i){return k(e,t,r,i),ae.west}function B(e,t,r,i){return k(e,t,r,i),ae.south}function U(e,t,r,i){return k(e,t,r,i),ae.east}function V(e,t,r,i){return k(e,t,r,i),ae.north}function z(e,t,r,i){return e.tileWidth}function G(e,t,r,i){return e.tileHeight}function H(e,t,r,i,n,o,a){return Y(e,t,r,i,n,o),le.x}function W(e,t,r,i,n,o,a){return Y(e,t,r,i,n,o),le.y}function j(e,t,r,i,n,o,a){return Y(e,t,r,i,n,o),e.tileWidth-le.x-1}function q(e,t,r,i,n,o,a){return Y(e,t,r,i,n,o),e.tileHeight-le.y-1}function Y(e,t,r,i,n,o,a){if(!se){J(e,t,r,i,n,o);var s=de,l=e.tilingScheme.tileXYToNativeRectangle(t,r,i,ce);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 X(e,t,r,i,n,o,a){return f.toDegrees(n)}function Q(e,t,r,i,n,o,a){return f.toDegrees(o)}function Z(e,t,r,i,n,o,a){return J(e,t,r,i,n,o),de.x}function K(e,t,r,i,n,o,a){return J(e,t,r,i,n,o),de.y}function J(e,t,r,i,n,o,a){if(!ue){if(e.tilingScheme instanceof h)de.x=f.toDegrees(n),de.y=f.toDegrees(o);else{var s=he;s.longitude=n,s.latitude=o,e.tilingScheme.projection.project(s,de)}ue=!0}}function $(e,t,r,i,n,o,a){return a}var ee=/{[^}]+}/g,te={x:w,y:E,z:I,s:D,reverseX:A,reverseY:x,reverseZ:P,westDegrees:M,southDegrees:R,eastDegrees:L,northDegrees:N,westProjected:F,southProjected:B,eastProjected:U,northProjected:V,width:z,height:G},re=n(te,{i:H,j:W,reverseI:j,reverseJ:q,longitudeDegrees:X,latitudeDegrees:Q,longitudeProjected:Z,latitudeProjected:K,format:$});l(b.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.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 s(this._resource)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),b.prototype.reinitialize=function(e){var t=this;t._readyPromise=v(e).then(function(r){s(e.proxy)&&u("UrlTemplateImageryProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var i=r.customTags,l=n(te,i),c=n(re,i),d=g.createIfNeeded(r.url,{proxy:r.proxy}),h=g.createIfNeeded(r.pickFeaturesUrl,{proxy:r.proxy});t.enablePickFeatures=a(r.enablePickFeatures,t.enablePickFeatures),t._urlSchemeZeroPadding=a(r.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._tileDiscardPolicy=r.tileDiscardPolicy,t._getFeatureInfoFormats=r.getFeatureInfoFormats,t._subdomains=r.subdomains,p(t._subdomains)?t._subdomains=t._subdomains.slice():s(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=a(r.tileWidth,256),t._tileHeight=a(r.tileHeight,256),t._minimumLevel=a(r.minimumLevel,0),t._maximumLevel=r.maximumLevel,t._tilingScheme=a(r.tilingScheme,new _({ellipsoid:r.ellipsoid})),t._rectangle=a(r.rectangle,t._tilingScheme.rectangle),t._rectangle=m.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=a(r.hasAlphaChannel,!0);var f=r.credit;return"string"==typeof f&&(f=new o({text:f})),t._credit=f,t._resource=d,t._tags=l,t._pickFeaturesResource=h,t._pickFeaturesTags=c,!0})},b.prototype.getTileCredits=function(e,t,r){},b.prototype.requestImage=function(e,t,r,i){return y.loadImage(this,C(this,e,t,r,i))},b.prototype.pickFeatures=function(e,t,r,i,n){function o(e,t){return e.callback(t)}function a(){if(l>=u._getFeatureInfoFormats.length)return v([]);var s=u._getFeatureInfoFormats[l],c=S(u,e,t,r,i,n,s.format);return++l,"json"===s.type?c.fetchJson().then(s.callback).otherwise(a):"xml"===s.type?c.fetchXML().then(s.callback).otherwise(a):"text"===s.type||"html"===s.type?c.fetchText().then(s.callback).otherwise(a):c.fetch({responseType:s.format}).then(o.bind(void 0,s)).otherwise(a)}if(this.enablePickFeatures&&s(this._pickFeaturesResource)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return a()}};var ie=!1,ne=new m,oe=!1,ae=new m,se=!1,le=new e,ue=!1,ce=new m,de=new t,he=new r;return b}),define("Scene/createOpenStreetMapImageryProvider",["../Core/appendForwardSlash","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/deprecationWarning","../Core/DeveloperError","../Core/Rectangle","../Core/Resource","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(o){o=r(o,{});var c=r(o.url,"https://a.tile.openstreetmap.org/");c=e(c),c+="{z}/{x}/{y}."+r(o.fileExtension,"png"),i(o.proxy)&&n("createOpenStreetMapImageryProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var h=s.createIfNeeded(c,{proxy:o.proxy}),p=new l({ellipsoid:o.ellipsoid}),f=r(o.minimumLevel,0),m=o.maximumLevel,g=r(o.rectangle,p.rectangle),_=p.positionToTileXY(a.southwest(g),f),v=p.positionToTileXY(a.northeast(g),f),y=(Math.abs(v.x-_.x),Math.abs(v.y-_.y),r(o.credit,d));return"string"==typeof y&&(y=new t({text:y})),new u({url:h,credit:y,tilingScheme:p,tileWidth:256,tileHeight:256,minimumLevel:f,maximumLevel:m,rectangle:g})}var d=new t({text:"MapQuest, Open Street Map and contributors, CC-BY-SA"});return c}),define("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(i){i=t(i,t.EMPTY_OBJECT);var u=[],c=i.geometry;r(c.attributes)&&r(c.primitiveType)||(c=c.constructor.createGeometry(c));var d=c.attributes,h=a.clone(t(i.modelMatrix,a.IDENTITY)),p=t(i.length,1e4);if(r(d.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:h})),r(d.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",p),attributes:{color:new e(0,1,0,1)},modelMatrix:h})),r(d.bitangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"bitangent",p),attributes:{color:new e(0,0,1,1)},modelMatrix:h})),u.length>0)return new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})})}return u}),define("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/deprecationWarning","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/Rectangle","../Core/Resource","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(o){function f(n){for(var l,h,p,f=/tileformat/i,m=/tileset/i,S=/tilesets/i,T=/boundingbox/i,w=[],A=n.childNodes[0].childNodes,E=0;E<A.length;E++)if(f.test(A.item(E).nodeName))l=A.item(E);else if(S.test(A.item(E).nodeName)){p=A.item(E);for(var x=A.item(E).childNodes,P=0;P<x.length;P++)m.test(x.item(P).nodeName)&&w.push(x.item(P))}else T.test(A.item(E).nodeName)&&(h=A.item(E));var I;if(!i(p)||!i(h))return I="Unable to find expected tilesets or bbox attributes in "+y.url+".",_=c.handleError(_,C,C.errorEvent,I,void 0,void 0,void 0,g),void(_.retry||b.reject(new u(I)));var D=r(o.fileExtension,l.getAttribute("extension")),O=r(o.tileWidth,parseInt(l.getAttribute("width"),10)),M=r(o.tileHeight,parseInt(l.getAttribute("height"),10)),R=r(o.minimumLevel,parseInt(w[0].getAttribute("order"),10)),L=r(o.maximumLevel,parseInt(w[w.length-1].getAttribute("order"),10)),N=p.getAttribute("profile"),k=o.tilingScheme;if(!i(k))if("geodetic"===N||"global-geodetic"===N)k=new a({ellipsoid:o.ellipsoid});else{if("mercator"!==N&&"global-mercator"!==N)return I=y.url+"specifies an unsupported profile attribute, "+N+".",_=c.handleError(_,C,C.errorEvent,I,void 0,void 0,void 0,g),void(_.retry||b.reject(new u(I)));k=new d({ellipsoid:o.ellipsoid})}var F=s.clone(o.rectangle);if(!i(F)){var B,U,V,z;r(o.flipXY,!1)?(V=new e(parseFloat(h.getAttribute("miny")),parseFloat(h.getAttribute("minx"))),z=new e(parseFloat(h.getAttribute("maxy")),parseFloat(h.getAttribute("maxx")))):(V=new e(parseFloat(h.getAttribute("minx")),parseFloat(h.getAttribute("miny"))),z=new e(parseFloat(h.getAttribute("maxx")),parseFloat(h.getAttribute("maxy"))));var G="geodetic"===N||"mercator"===N;if(k instanceof a||G)B=t.fromDegrees(V.x,V.y),U=t.fromDegrees(z.x,z.y);else{var H=k.projection;B=H.unproject(V),U=H.unproject(z)}F=new s(B.longitude,B.latitude,U.longitude,U.latitude)}F.west<k.rectangle.west&&(F.west=k.rectangle.west),F.east>k.rectangle.east&&(F.east=k.rectangle.east),F.south<k.rectangle.south&&(F.south=k.rectangle.south),F.north>k.rectangle.north&&(F.north=k.rectangle.north);var W=k.positionToTileXY(s.southwest(F),R),j=k.positionToTileXY(s.northeast(F),R);(Math.abs(j.x-W.x)+1)*(Math.abs(j.y-W.y)+1)>4&&(R=0);var q=v.getDerivedResource({url:"{z}/{x}/{reverseY}."+D});b.resolve({url:q,tilingScheme:k,rectangle:F,tileWidth:O,tileHeight:M,minimumLevel:R,maximumLevel:L,tileDiscardPolicy:o.tileDiscardPolicy,credit:o.credit})}function m(e){var t=r(o.fileExtension,"png"),n=r(o.tileWidth,256),a=r(o.tileHeight,256),s=r(o.minimumLevel,0),l=o.maximumLevel,u=i(o.tilingScheme)?o.tilingScheme:new d({ellipsoid:o.ellipsoid}),c=r(o.rectangle,u.rectangle),h=v.getDerivedResource({url:"{z}/{x}/{reverseY}."+t});b.resolve({url:h,tilingScheme:u,rectangle:c,tileWidth:n,tileHeight:a,minimumLevel:s,maximumLevel:l,tileDiscardPolicy:o.tileDiscardPolicy,credit:o.credit})}function g(){y.fetchXML().then(f).otherwise(m)}o=r(o,{}),i(o.proxy)&&n("createTileMapServiceImageryProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var _,v,y,b=h.defer(),C=new p(b.promise);return h(o.url).then(function(e){v=l.createIfNeeded(e,{proxy:o.proxy}),v.appendForwardSlash(),y=v.getDerivedResource({url:"tilemapresource.xml"}),g()}).otherwise(function(e){b.reject(e)}),C}return f}),define("Scene/CreditDisplay",["../Core/Check","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject"],function(e,t,r,i,n){"use strict";function o(e,r){for(var i=e.length,n=0;n<i;n++){var o=e[n];if(t.equals(o,r))return!0}return!1}function a(e,t){var r,n,o,a=e._displayedCredits.textCredits,s=e._textContainer;for(r=0;r<t.length;r++)if(o=t[r],i(o))if(-1===(n=a.indexOf(o))){var l=o.element;if(s.hasChildNodes()){var u=document.createElement("span");u.textContent=e._delimiter,u.className="cesium-credit-delimiter",s.appendChild(u)}s.appendChild(l)}else a.splice(n,1)}function s(e,t){var r,n,o,a=e._displayedCredits.imageCredits,s=e._imageContainer;for(r=0;r<t.length;r++)o=t[r],i(o)&&(n=a.indexOf(o),-1===n?s.appendChild(o.element):a.splice(n,1))}function l(e,t){var r,n,o,a=e._displayedCredits.lightboxCredits,s=e._creditList;for(r=0;r<t.length;r++)if(o=t[r],i(o))if(-1===(n=a.indexOf(o))){var l=document.createElement("li"),u=o.element;l.appendChild(u),s.appendChild(l)}else a.splice(n,1)}function u(e){var t=e.element,r=e.showOnScreen?t.parentNode:t.parentNode.parentNode;if(e.hasImage()||!e.showOnScreen)return void(e.showOnScreen?r.removeChild(t):r.removeChild(t.parentNode));var i=t.previousSibling;null===i&&(i=t.nextSibling),null!==i&&r.removeChild(i),r.removeChild(t)}function c(e){var t,r,n=e._displayedCredits.textCredits;for(t=0;t<n.length;t++)r=n[t],i(r)&&u(r);var o=e._displayedCredits.imageCredits;for(t=0;t<o.length;t++)r=o[t],i(r)&&u(r)}function d(e){var t,r,n=e._displayedCredits.lightboxCredits;for(t=0;t<n.length;t++)r=n[t],i(r)&&u(r)}function h(e){var t=e._lightboxCredits,r=e.viewport.clientWidth,i=e.viewport.clientHeight;r!==e._lastViewportWidth&&(r<g?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=Math.floor(.5*(i-t.clientHeight))+"px"),e._lastViewportWidth=r),r>=g&&i!==e._lastViewportHeight&&(t.style.marginTop=Math.floor(.5*(i-t.clientHeight))+"px",e._lastViewportHeight=i)}function p(e,t){var r=e+" {";for(var i in t)t.hasOwnProperty(i)&&(r+=i+": "+t[i]+"; ");return r+=" }\n"}function f(){var e=document.head,t=document.createElement("style"),r="";r+=p(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),r+=p(".cesium-credit-lightbox",{"background-color":"#303336",color:v,position:"relative","min-height":_+"px",margin:"auto"}),r+=p(".cesium-credit-lightbox > ul > li > span > a, .cesium-credit-lightbox > ul > li > span > a:visited",{color:v}),r+=p(".cesium-credit-lightbox > ul > li > span > a:hover",{color:y}),r+=p(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),r+=p(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),r+=p(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),r+=p(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:v}),r+=p(".cesium-credit-lightbox-close:hover",{color:y}),r+=p(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),r+=p(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),r+=p(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:v}),r+=p(".cesium-credit-expand-link:hover",{color:y}),r+=p(".cesium-credit-text",{color:v}),t.innerHTML=r,e.insertBefore(t,e.firstChild)}function m(e,t,i){function n(e){s.contains(e.target)||o.hideLightbox()}var o=this;i=r(i,document.body);var a=document.createElement("div");a.className="cesium-credit-lightbox-overlay",i.appendChild(a);var s=document.createElement("div");s.className="cesium-credit-lightbox",a.appendChild(s),a.addEventListener("click",n,!1);var l=document.createElement("div");l.className="cesium-credit-lightbox-title",l.textContent="Data provided by:",s.appendChild(l);var u=document.createElement("a");u.onclick=this.hideLightbox.bind(this),u.innerHTML="&times;",u.className="cesium-credit-lightbox-close",s.appendChild(u);var c=document.createElement("ul");s.appendChild(c);var d=document.createElement("span");d.className="cesium-credit-imageContainer",e.appendChild(d);var h=document.createElement("span");h.className="cesium-credit-textContainer",e.appendChild(h);var p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),f(),this._delimiter=r(t," • "),this._textContainer=h,this._imageContainer=d,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=s,this._creditList=c,this._lightbox=a,this._hideLightbox=n,this._expandLink=p,this._expanded=!1,this._defaultImageCredits=[],this._defaultTextCredits=[],this._displayedCredits={imageCredits:[],textCredits:[],lightboxCredits:[]},this._currentFrameCredits={imageCredits:[],textCredits:[],lightboxCredits:[]},this.viewport=i,this.container=e}var g=576,_=100,v="#ffffff",y="#48b",b=new t({text:"CesiumJS",
imageUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAeCAYAAAD5AOomAAAQWUlEQVR42u1beXxOxxpudrEktkbUkriI4lZpq5JbW6pJuFG0qrFeexVRak3TBm3RUgS1hFhrCdKgQWKLrUGQBiVBJMgiq0Qiuyxzn/fzTu74ZPnS9nfrj4zf8/ty5sw7M+c8824zx0svVa3oAfqAAWAIGAHGCoy43oDb6TGqywta9JgsIq4GUAswB+oDDRXU5/ragCm3N6gm+MUkVJ+1kAg1AyyA5oAN8BrQCXiTfzsArwLWgCVQF6jJBOtXk/tikWrMGkiEtgTeAOyBfsAQS0vL8YMHD/aws7ObiuthwAeAA/A20AZozAvCRNHe6vI3k2rCprUp8DoR1qVLF1c/P7+A5OTkhyUlJaKwuETkPSkRBUUlgkpmZmbW2bNnQyZOnLgA7Z2BzkALNtM1qsl9MTSVSLUCugADAwMDTxKZVI7cfCw8DiWK6fselMLtlwSxJyxDPM4vFsXFxSWRkZFRkBsOdAdaAw2qyf37ij77RDMm1a5evXojY2NjH5BW7ruaIab4xotPd8cJV/xO0cKkPXGae97n0kR6TpHIzs7O7d279xdsvoncemwJqn3u/1lbDTnqfYXN6JCUlJS03CfFwt0/4TkiK8IEEBydWiBIy21tbaejr24cWJlpBVT6ShpVFvS10iddZP6MbFkyqpw2Kor6K5P9M33onG1Iv0omsz3Q//79+7HpuUViDsys697KyZy89ynk9Wc/x4u7DwvE48ePs2mRcARtqUTLRjxmDa6rpYWanDqZKHmyzJ+lTFlyUrZGGbIm3GdF49VQcnMjZUwTJW83Ua4NtayQmlEYKW1NlOc11RrLoAxLpqdYUSmnPlOlbk1qa21OZ7ovX758E/lTz1MpOmvp5gvp4qeL6c8sAjLNOQXF4sKFC6Hotw+nSrR46rAfb8hkN+WxVTTlyPplNuNmDArGGgFNgGZloClbHQtua8bj1eW+GnObZspY2nL1WKaOkreraKDk7jXLsEJGXG+u1b4Bz/0VZayyUkO5f2DCc5DvyZL/1inb0ONVU5+1dSBMcHrIvRwNMbqQ6u6fKGSZ4POszFaQDZNc0q9fvzkcjFkzKf/gfJjSo3c40OrBoL+7cvvXeUFYM17l1MuOTbxEV8a/uE8pZ8Ww4bouPJ62bFlyzXmebRg2jLY8jxa8WGopxEiX9jLff1Vp357zfluefyeOPxpp9WHAGl2fn/k1do+Ef/K86lYWs+hzJ7SSbXv06OFGAfAMRLtlBUjkPyfuidMyw3Fi37UM8TMCLFVj6W9qW1BYIg4ePBjEWkukdCTyZsyYMcvX13f7iRMnDv36669B0OxTBKRNx4OCggIPHDiwa+XKld+j7Xv84v/l4+Oz6PLlywHnzp07Su0gdyw4OPgYXQNHzp8/f+TixYuHw8LCDuDeGiaLXqLj6tWrlyLC9ztz5gy1PwEcV3AU89i3detWT2NjYyeWedvLy2va77//7hcREeHfsWPH91HX6/r16/7h4eH+6H+ZVtQvN3ToujXm9wPJYS6+FhYWzggmh4eGhh6hsTHnE/j7eN++fQczWY1Yc6WrIVJb0SLEu9iJ93I0JCTkKMY+PHLkSGe2MLV5TL3ytgxr88pwuHLlyvXY9CcaH6mSR5HwwRuPRWZekTgXnfPcfW0QqfMDk0Qc+nqCnDc+Pj6FNzJoE+PfeDEXhQ6FtD0rKyu9Tp06LpAbBN9/S+hYEJmnck79EazQA5myVTKeyM/Pp7jgI2AAXv4JeW/AgAGzUTdKXj969CiOF04T1jhj/qXrzrgfQ+0KUdq1azdt6tSpntrjxcTEUGroyBrdkLmoy3x0HT9+vIe2zIoVK9y5fT0eU688/2rOJqY/bTRcjsl5hqRPYF5P38nSdJrwMErzezMpX1NfHrELjiQ9fbl56SIjO5leViH6nwwMnjZt2gL5EmWh/Lf4f+U5BtauXbsJshPu3LkTLQl/+PBhVmpqagZ+HxHS0tLSCShpGRkZqXhp12i8RYsWrVP7wr1ctM9E2wy0lch88uRJoWwTFRV1A7JjoVnBss7BwWEJ6ubIa/SRgOt32VybKduvZILtMbd4JraoZcuWC8eMGbNN+7noWTt06DCVXUIL9rtNOdj8uABFW+bbb7/9js34y4o5fo5YI14h7QwNDV1yc3MLAsIfP0PS9kvpmg6Db+wXn6/pKrwOztBcn7mTXWbEPHlPvMguKBFFxYXiq819hZu3k6Y9xpgFjN+xY8cBOcmkpKQ0rh8HDCUieHNjHExgmGwHQomkKbdu3bpP10VFRcU2NjZ7UbcKWATMB74C3IBpSn8jTp48eVb2k5iYSNq4BVjJcl8zFrq5ue3Py8vLB/Kg4USa6+nTp0OkLNwUmfYFckGiTRJZH1YKc3Zp5mye+yQnJydQOyyYImtr65XDhw/3lX2B7BJlgaSxhXiL+6K99z4wwadkG/RRLP/28PBYxpaiES+mcokllW4PczcUz1Twy++ZpSTRrhJtUCSnx4gvNzkL9419xBfevUVIxEHNIEuDUp4j90ZCHjSqUHj+/AnaOmnkmFgyIa6Y8Hk5SScnp6VMwLs82Tc5wOkJv9Tfz89v3f79+73xMPTyJyrEloCI8+PGjTs0adIkX1dXVx+Yuu2ff/75tlmzZm1A+xUDBw6kHHo4/GqQHA8Lt9DT0/OSu7v70SlTpuwdMmTIFhC2tlmzZivQ9geAtOFLgLRoGhbFJSnbrVu3DahbrEXs+4pZrMm/FGj1xaJNlMRaWVmtGTZs2D7ZV3R0dA6sWJG8Riayhd1GNzbNo0nTpWWbP3/+dYXY5fyOLCsjti5Hbh/hwfODbmeVkkS5rCgpFgt2DNaQKjHTy16kZsRpBpp1IKE0uNoSkqapO3llp2YBUFuPLf01Jgf9007UFAQCv8lJmpubf4Y6J478rNgMWfHL6cRBE+1e9SXTKInVpdy7d+8KmbOhQ4d+rasMLRjML5xMLlkSBFShCrEbiXxJLDQymQ8/2rN/lKkJXQ+AdUiSxDZv3nydSuzNmzczQWaEvIZbeESuhhf5mLt375Y+Z0BAQDQW7Dl5PXfu3KW6EGvIfoEisL6Ya+p1aBz5z/N3czQdbQ5w12ieSizhu13DEPHmajYiKDXyPJmiaX8t6pSYs8FB04bM8ObAL2ijIg/9zyCtU4lFBDqJA6p2nE/KPLMVmyRbToGcq0osAq0rrFEu8Eve5IfJhOsiCxN8FXJzjx07FqYQ6426JZJYaGQKu463eO4W/EvXLiqx0Ni1MMV+ig9PR5ut0PosWbd582bKHL50cXHZIOMMGqtJkybrQWZpEDdv3rwfdCHWgCM5yo3s/f39j9G8H2Y/tRKXbgUItw2Oz5EqSfMJWvT0dCefA5PsVPHNTx+VtpkFzb4Ve0ncuHHjLq/I0UhJSv1W27Zt57F/6cpp0Gv8awfz6Lxq1ar5P/7448KxY8eSH/5UNcUffPBBQKdOnTZ37tx5la2t7VI7O7vv33nnnYUwrR6Ojo7TEIm6sFkjckfxwvIAaMyvTE1NPRC4LEFQtAH9+yOVSFYiXvLFC48ePXpF1nXv3n09mWqF2Ie4/oTHeIM19Q2+/iQhISFVIXb1iBEj9irWhCL2pXPmzPlF9aOoW4+gL13W7d69+ywtMASApe1glhez2yqXWJnH1uDVRv5tpMY0PE4Qu4IWlkmoNlb6TRKRcaHiQoS/+Ir9sMTCnYM1q27NmjW+tIqJxMOHDwfISe7bty8YdZ8pZ7r9aZOEruE7F2lFqZ+pwRNI8WG/SGTNZuKm8gIawlrusGDBgi+wsEJ+Q8Fq38W+fg7LkHv4hoKwUaNGlWoFLEwuEatqrL29PQVq86TW5+Tk5LP8aDK9PN4AvnaXPhKBbSEW6bLRo0fvkH3FxsYmcaA3m6JzWR8ZGVlKKmUoHAhORFywSysqfqui4Enbz1JE5nz16tXwrNx0nUh9Gkw5QTPfFbPX93pWo6Hpp6740EqkVOc/lNzTZgM0cKVq9qAdmSlPS5IEHjaN8h7Z5iAKpUt48LsyTYCGPcBc7+L3DvLi2xEREYSbt2/fDkdwci0sLOwwRZfbt29frmhFIdpEgehIkqFfRN9RQAzmkSvbQdvIzLqdOnWqNN+GFaAoeircVYr68rHoohG138KYN+mXji1Rny1NKeKWXDMzM/cJEyZskHIPUMiX0ntp06aNm5riSYsA0+zLpn6Ql5fXRnl/8eLFX7NVsygv3VHNcU3ev+xC23800NlrvqUBUFVBckv3jNZMBNHnSvajr/OEHLDaM3X1lSCjoFGjRmRKhyGoiKziBgWZRWf0kSeqUGbOnOlJmod44Iys+/DDD8kiuMAULlMXXWUFUfkhIhB9LpZ1WBwxHBDSexmIBXFTlcHCeMQuqidh586dK+S91atXu3EkXp83KPQrOt0xZq2loMVh2bJlmmT6+OVt0MT3qkiqk1jsM0LkFWQL0iI2rx2UjXfyo73gPzZCu64iyIhHYJMMJU2RoJ0ikBiOiNBn0KBBY/gB7UNDQ3/B/QTcT1SRmpqaQEA/D3A/HtoXGxcXd07uy3bt2nUQSPKHJkbLthIsnwifGY/5/oZ0gnxwb5ojTPG6jIyMGCySBCz4gTJKnz59+szg4OBAjBEFkuIg+wxQojHXszD983hx9Zw8efI4EBZHgFYHsjnV7JdjfkMw50R+hnikauM4QKJspb23t/dkuAeaR9ySJUuG8Lusw9ZWr7KvEU15N4P2Lt9HZKjZdTkeuk3MRcpSVmT8DKEbe2vaePlPFyX4B8IoHfiYH6AJJ+/m7PRtuL47r9revJfch/92YDK78Hxas0xHDrTeU2R6c8rkWIZcK/5mqx1vondnWUeWUdGL++7EL9SG5Tooc2ihFbH3VPpzVOZgz4ugI6durVjLpNV6lRd5Y/5tx3Puxv3Kzf5G3KaFcpjQvCqfHKmH7Y15An3hqDeRWaZo1+fkIjFjXQ9NKiNNNJFJvpR87JLdI8X95HCNj6CjOtrJ4uituXLUZKwk8pbKCUpr5fSkNZNhxe6hIbeXR3bNFBlttOKX0Izb1mfZhtyXFcu20kFOfmZrwQteHtXJI8AmvKfbUulPLiRrTtvk8WFdPhyw4P4b8DupxZrXgOfXTHnmOvyu5P6x/NxX7nIZVuXA3Yg7asyrxoG+RER4HoMorzj/SY64ijw18OIm4Xd2uTh4fq04f+OASEy7pyGUvrqYPXv2CvYfb/JEzbUOlA342lR5MDNFo+UZam1+MBPlgNuU69X25mXI1lIO6qVsTUXWrAK5GloH49qH3Ophf21l/mZlzL2G1gG9aTkfEJgoHwDU1LpvqIxZ0eG8TuTKM8VWbCKcoYGj1q1btwehegJtPVIuSVEmnd8iQDhtbW3tamxs/CGbs7a8OOooDr68z1QMlQdUH0b7kxX1sxbDSmBQzqcoBpXIGJQjo/1ZSmVzqaivyvozqOB96f+Z78b0lLPFumwabFgDe3K+NpDz0kH8rXEvNrttWUvr6/DRuJ6O+CMyf0a2Ku+pqn390Xt/6QduBopPNFe2zFrJaI2dfmv2XZbsz2op5qL6v3m8oF8vqv9/R/oB+Q1RPf41U3yT0R+x/9Xlryn/BY268qsf3smdAAAAAElFTkSuQmCC",link:"https://cesiumjs.org/",showOnScreen:!0});return m.prototype.addCredit=function(e){var t=this._currentFrameCredits.imageCredits;"Cesium ion"===e.text?i(t[b.id])?t[b.id]=e:t[e.id]=e:e.showOnScreen?e.hasImage()?t[e.id]=e:this._currentFrameCredits.textCredits[e.id]=e:this._currentFrameCredits.lightboxCredits[e.id]=e},m.prototype.addDefaultCredit=function(e){if(e.hasImage()){var t=this._defaultImageCredits;o(t,e)||t.push(e)}else{var r=this._defaultTextCredits;o(r,e)||r.push(e)}},m.prototype.removeDefaultCredit=function(e){var t;e.hasImage()?-1!==(t=this._defaultImageCredits.indexOf(e))&&this._defaultImageCredits.splice(t,1):-1!==(t=this._defaultTextCredits.indexOf(e))&&this._defaultTextCredits.splice(t,1)},m.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0},m.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1},m.prototype.update=function(){var e=[];this._expanded&&i(this._creditsToUpdate)&&(h(this),l(this,this._creditsToUpdate),e=this._creditsToUpdate.slice()),d(this),this._displayedCredits.lightboxCredits=e},m.prototype.beginFrame=function(){this._currentFrameCredits.imageCredits.length=0,this._currentFrameCredits.textCredits.length=0,this._currentFrameCredits.lightboxCredits.length=0;var e=m.cesiumCredit;i(e)&&(this._currentFrameCredits.imageCredits[e.id]=e)},m.prototype.endFrame=function(){s(this,this._defaultImageCredits),a(this,this._defaultTextCredits),s(this,this._currentFrameCredits.imageCredits),a(this,this._currentFrameCredits.textCredits);var e=this._defaultTextCredits.concat(this._currentFrameCredits.textCredits),t=this._defaultImageCredits.concat(this._currentFrameCredits.imageCredits),r=this._currentFrameCredits.lightboxCredits.length>0;this._expandLink.style.display=r?"inline":"none",c(this),this._displayedCredits.textCredits=e,this._displayedCredits.imageCredits=t,this._creditsToUpdate=this._currentFrameCredits.lightboxCredits.slice()},m.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._textContainer),this.container.removeChild(this._imageContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),n(this)},m.prototype.isDestroyed=function(){return!1},m.cesiumCredit=b,m}),define("Scene/DebugAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./Appearance"],function(e,t,r,i,n){"use strict";function o(r){r=e(r,e.EMPTY_OBJECT);var i=r.attributeName,o=r.perInstanceAttribute;t(o)||(o=!1);var a,s=e(r.glslDatatype,"vec3"),l="v_"+i;if("normal"===i||"tangent"===i||"bitangent"===i)a="vec4 getColor() { return vec4(("+l+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===i&&(s="vec2"),s){case"float":a="vec4 getColor() { return vec4(vec3("+l+"), 1.0); }\n";break;case"vec2":a="vec4 getColor() { return vec4("+l+", 0.0, 1.0); }\n";break;case"vec3":a="vec4 getColor() { return vec4("+l+", 1.0); }\n";break;case"vec4":a="vec4 getColor() { return "+l+"; }\n"}var u="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(o?"":"attribute "+s+" "+i+";\n")+"varying "+s+" "+l+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(o?l+" = czm_batchTable_"+i+"(batchId);\n":l+" = "+i+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",c="varying "+s+" "+l+";\n"+a+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=e(r.translucent,!1),this._vertexShaderSource=e(r.vertexShaderSource,u),this._fragmentShaderSource=e(r.fragmentShaderSource,c),this._renderState=n.getDefaultRenderState(!1,!1,r.renderState),this._closed=e(r.closed,!1),this._attributeName=i,this._glslDatatype=s}return r(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}),define("Scene/DebugCameraPrimitive",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/FrustumGeometry","../Core/FrustumOutlineGeometry","../Core/GeometryInstance","../Core/Matrix3","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/PerspectiveOffCenterFrustum","../Core/Quaternion","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_){"use strict";function v(e){e=i(e,i.EMPTY_OBJECT),this._camera=e.camera,this._color=i(e.color,t.CYAN),this._updateOnChange=i(e.updateOnChange,!0),this.show=i(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var y=new e,b=new c,C=new m,S=new p,T=new f,w=new d,A=new h,E=new t,x=[1,1e5];return v.prototype.update=function(i){if(this.show){var n,o,a=this._planesPrimitives,h=this._outlinePrimitives;if(this._updateOnChange){for(o=a.length,n=0;n<o;++n)h[n]=h[n]&&h[n].destroy(),a[n]=a[n]&&a[n].destroy();a.length=0,h.length=0}if(0===a.length){var v,P=this._camera,I=P.frustum;v=I instanceof p?S:I instanceof f?T:I instanceof d?w:A,v=I.clone(v);var D=i.frustumSplits,O=D.length-1;O<=0&&(D=x,D[0]=this._camera.frustum.near,D[1]=this._camera.frustum.far,O=1);var M=P.positionWC,R=P.directionWC,L=P.upWC,N=P.rightWC;N=e.negate(N,y);var k=b;c.setColumn(k,0,N,k),c.setColumn(k,1,L,k),c.setColumn(k,2,R,k);var F=m.fromRotationMatrix(k,C);for(a.length=h.length=O,n=0;n<O;++n)v.near=D[n],v.far=D[n+1],a[n]=new _({geometryInstances:new u({geometry:new s({origin:M,orientation:F,frustum:v,_drawNearPlane:0===n}),attributes:{color:r.fromColor(t.fromAlpha(this._color,.1,E))},id:this.id,pickPrimitive:this}),appearance:new g({translucent:!0,flat:!0}),asynchronous:!1}),h[n]=new _({geometryInstances:new u({geometry:new l({origin:M,orientation:F,frustum:v,_drawNearPlane:0===n}),attributes:{color:r.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new g({translucent:!1,flat:!0}),asynchronous:!1})}for(o=a.length,n=0;n<o;++n)h[n].update(i),a[n].update(i)}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){for(var e=this._planesPrimitives.length,t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return o(this)},v}),define("Scene/DebugModelMatrixPrimitive",["../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/GeometryInstance","../Core/Matrix4","../Core/PolylineGeometry","./PolylineColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT),this.length=r(e.length,1e7),this._length=void 0,this.width=r(e.width,2),this._width=void 0,this.show=r(e.show,!0),this.modelMatrix=a.clone(r(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(r){if(this.show){if(!i(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,i(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}),d=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,d],appearance:new l,asynchronous:!1})}this._primitive.update(r)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},c}),define("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"}),define("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"}),define("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","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0}function v(e,r){var i=e.radii,n=r.camera.positionWC,o=t.multiplyComponents(e.oneOverRadii,n,b),a=t.magnitude(o),s=t.normalize(o,C),l=t.normalize(t.cross(t.UNIT_Z,o,S),S),u=t.normalize(t.cross(s,l,T),T),c=Math.sqrt(t.magnitudeSquared(o)-1),d=t.multiplyByScalar(s,1/a,b),h=c/a,p=t.multiplyByScalar(l,h,C),f=t.multiplyByScalar(u,h,S),m=t.add(d,f,T);t.subtract(m,p,m),t.multiplyComponents(i,m,m),t.pack(m,y,0);var g=t.subtract(d,f,T);t.subtract(g,p,g),t.multiplyComponents(i,g,g),t.pack(g,y,3);var _=t.add(d,f,T);t.add(_,p,_),t.multiplyComponents(i,_,_),t.pack(_,y,6);var v=t.subtract(d,f,T);return t.add(v,p,v),t.multiplyComponents(i,v,v),t.pack(v,y,9),y}var y=n.supportsTypedArrays()?new Float32Array(12):[],b=new t,C=new t,S=new t,T=new t;return _.prototype.update=function(n){if(this._mode=n.mode,n.mode===g.SCENE3D){var _=n.context,y=n.mapProjection.ellipsoid;i(this._command)||(this._rs=d.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._sp=h.fromCache({context:_,vertexShaderSource:m,fragmentShaderSource:f,attributeLocations:{position:0}}),this._command=new u({renderState:this._rs,shaderProgram:this._sp,boundingVolume:new e(t.ZERO,y.maximumRadius),pass:c.OPAQUE,owner:this}));var b=v(y,n);if(i(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(b);else{var C=new o({attributes:{position:new a({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:b})},indices:[0,1,2,2,1,3],primitiveType:s.TRIANGLES});this._va=p.fromGeometry({context:_,geometry:C,attributeLocations:{position:0},bufferUsage:l.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}},_.prototype.execute=function(e,t){this._mode===g.SCENE3D&&this._command.execute(e,t)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()},_}),define("Scene/DeviceOrientationCameraController",["../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/Matrix3","../Core/Quaternion"],function(e,t,r,i,n,o){"use strict";function a(t){function r(t){var r=t.alpha;if(!e(r))return n._alpha=void 0,n._beta=void 0,void(n._gamma=void 0);n._alpha=i.toRadians(r),n._beta=i.toRadians(t.beta),n._gamma=i.toRadians(t.gamma)}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",r,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",r,!1)}}function s(e,t,r,i){var a=e.direction,s=e.right,d=e.up,h=o.fromAxisAngle(a,r,u),p=o.fromAxisAngle(s,i,l),f=o.multiply(p,h,p),m=o.fromAxisAngle(d,t,u);o.multiply(m,f,f);var g=n.fromQuaternion(f,c);n.multiplyByVector(g,s,s),n.multiplyByVector(g,d,d),n.multiplyByVector(g,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,r=this._lastBeta-this._beta,i=this._lastGamma-this._gamma;s(this._scene.camera,-t,r,i),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}),define("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"}),define("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"}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S){"use strict";function T(t){t=n(t,n.EMPTY_OBJECT),this.center=r.clone(n(t.center,r.ZERO)),this._center=new r,this.radii=r.clone(t.radii),this._radii=new r,this._oneOverEllipsoidRadiiSquared=new r,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,C.fromType(C.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 d({owner:n(t._owner,this)}),this._pickCommand=new d({owner:n(t._owner,this)});var i=this;this._uniforms={u_radii:function(){return i.radii},u_oneOverEllipsoidRadiiSquared:function(){return i._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return i._pickId.color}}}function w(e){var i=e.cache.ellipsoidPrimitive_vertexArray;if(o(i))return i;var n=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2),vertexFormat:u.POSITION_ONLY}));return i=g.fromGeometry({context:e,geometry:n,attributeLocations:A,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=i,i}var A={position:0};return T.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:b.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?y.ALPHA_BLEND:void 0})),o(this._va)||(this._va=w(n));var u=!1,c=this.radii;if(!r.equals(this._radii,c)){r.clone(c,this._radii);var d=this._oneOverEllipsoidRadiiSquared;d.x=1/(c.x*c.x),d.y=1/(c.y*c.y),d.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&r.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),r.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(r.clone(r.ZERO,this._boundingSphere.center),this._boundingSphere.radius=r.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var g=this._material!==this.material;this._material=this.material,this._material.update(n);var C=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var T,E=this._colorCommand;(g||C||s)&&(T=new m({sources:[this.material.shaderSource,_]}),this.onlySunLighting&&T.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&T.defines.push("WRITE_DEPTH"),this._sp=f.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:v,fragmentShaderSource:T,attributeLocations:A}),E.vertexArray=this._va,E.renderState=this._rs,E.shaderProgram=this._sp,E.uniformMap=i(this._uniforms,this.material._uniforms),E.executeInClosestFrustum=a);var x=t.commandList,P=t.passes;if(P.render&&(E.boundingVolume=this._boundingSphere,E.debugShowBoundingVolume=this.debugShowBoundingVolume,E.modelMatrix=this._computedModelMatrix,E.pass=a?h.TRANSLUCENT:h.OPAQUE,x.push(E)),P.pick){var I=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})),(g||C||!o(this._pickSP))&&(T=new m({sources:[this.material.shaderSource,_],pickColorQualifier:"uniform"}),this.onlySunLighting&&T.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&T.defines.push("WRITE_DEPTH"),this._pickSP=f.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:v,fragmentShaderSource:T,attributeLocations:A}),I.vertexArray=this._va,I.renderState=this._rs,I.shaderProgram=this._pickSP,I.uniformMap=i(i(this._uniforms,this._pickUniforms),this.material._uniforms),I.executeInClosestFrustum=a),I.boundingVolume=this._boundingSphere,I.modelMatrix=this._computedModelMatrix,I.pass=a?h.TRANSLUCENT:h.OPAQUE,x.push(I)}}},T.prototype.isDestroyed=function(){return!1},T.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)},T}),define("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"}),define("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"}),define("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s){"use strict";function l(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),l=e(r.aboveGround,!1);this.material=t(r.material)?r.material:s.fromType(s.ColorType),this.translucent=e(r.translucent,!0),this._vertexShaderSource=e(r.vertexShaderSource,o),this._fragmentShaderSource=e(r.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(i,!l,r.renderState),this._closed=!1,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,l),this._aboveGround=l}return r(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=i.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),define("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,r,i){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.1}function o(e){var t=a,r=t.length;if(e<t[0])return h=0;if(e>t[r-1])return h=r-2;if(e>=t[h]){if(h+1<r&&e<t[h+1])return h;if(h+2<r&&e<t[h+2])return++h}else if(h-1>=0&&e>=t[h-1])return--h;var i;for(i=0;i<r-2&&!(e>=t[i]&&e<t[i+1]);++i);return h=i}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],d=0;d<s.length;++d)s[d]=(s[d]-c)/(u-c);var h=0,p=new e;return n.prototype.update=function(n){if(n.fog.enabled=this.enabled){var l=n.camera,d=l.positionCartographic;if(!t(d)||d.height>8e5||n.mode!==i.SCENE3D)return void(n.fog.enabled=!1);var h=d.height,f=o(h),m=r.clamp((h-a[f])/(a[f+1]-a[f]),0,1),g=r.lerp(s[f],s[f+1],m),_=1e6*this.density;g=g*(_-_/u*c)*1e-6;var v=e.normalize(l.positionWC,p);g*=1-Math.abs(e.dot(l.directionWC,v)),n.fog.density=g,n.fog.sse=this.screenSpaceErrorFactor,n.fog.minimumBrightness=this.minimumBrightness}},n}),
define("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,r,i,n,o,a,s){"use strict";function l(r){function i(){c(n)}this._scene=r.scene,this.samplingWindow=e(r.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(r.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(r.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(r.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(r.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._preUpdateRemoveListener=this._scene.preUpdate.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,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,i,!1)})}function u(e,t){if(!(e._pauseCount>0)){var r=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=r+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(r>=e._quietPeriodEndTime){e._frameTimes.push(r);var i=r-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();var n=(r-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/n;var o=1e3/(r>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},r(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(){1===++this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preUpdateRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),i(this)},l}),define("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,r,i){this.context=t,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.jobScheduler=i,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.passes={render:!1,pick:!1,depth:!1},this.creditDisplay=r,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.shadowHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.imagerySplitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0}return t}),define("Scene/FrustumCommands",["../Core/defaultValue","../Renderer/Pass"],function(e,t){"use strict";function r(r,i){this.near=e(r,0),this.far=e(i,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 r}),define("Shaders/PostProcessFilters/FXAA",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nuniform sampler2D u_texture;\nuniform vec2 u_fxaaQualityRcpFrame;\nconst float fxaaQualitySubpix = 0.5;\nconst float fxaaQualityEdgeThreshold = 0.125;\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\nvoid main()\n{\nvec4 color = FxaaPixelShader(\nv_textureCoordinates,\nu_texture,\nu_fxaaQualityRcpFrame,\nfxaaQualitySubpix,\nfxaaQualityEdgeThreshold,\nfxaaQualityEdgeThresholdMin);\nfloat alpha = texture2D(u_texture, v_textureCoordinates).a;\ngl_FragColor = vec4(color.rgb, alpha);\n}\n"}),define("ThirdParty/Shaders/FXAA3_11",[],function(){"use strict";return"#if (FXAA_QUALITY_PRESET == 10)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 3.0\n#define FXAA_QUALITY_P2 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 11)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 3.0\n#define FXAA_QUALITY_P3 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 12)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 4.0\n#define FXAA_QUALITY_P4 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 13)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 4.0\n#define FXAA_QUALITY_P5 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 14)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 4.0\n#define FXAA_QUALITY_P6 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 15)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 20)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 2.0\n#define FXAA_QUALITY_P2 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 21)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 22)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 23)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 24)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 3.0\n#define FXAA_QUALITY_P6 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 25)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 26)\n#define FXAA_QUALITY_PS 9\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 4.0\n#define FXAA_QUALITY_P8 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 27)\n#define FXAA_QUALITY_PS 10\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 4.0\n#define FXAA_QUALITY_P9 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 28)\n#define FXAA_QUALITY_PS 11\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 4.0\n#define FXAA_QUALITY_P10 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 29)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 39)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.0\n#define FXAA_QUALITY_P2 1.0\n#define FXAA_QUALITY_P3 1.0\n#define FXAA_QUALITY_P4 1.0\n#define FXAA_QUALITY_P5 1.5\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#define FxaaBool bool\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 vec2\n#define FxaaTex sampler2D\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTexTop(t, p) texture2D(t, p)\n#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\nFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\nFxaaFloat4 FxaaPixelShader(\nFxaaFloat2 pos,\nFxaaTex tex,\nFxaaFloat2 fxaaQualityRcpFrame,\nFxaaFloat fxaaQualitySubpix,\nFxaaFloat fxaaQualityEdgeThreshold,\nFxaaFloat fxaaQualityEdgeThresholdMin\n) {\nFxaaFloat2 posM;\nposM.x = pos.x;\nposM.y = pos.y;\nFxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n#define lumaM rgbyM.y\nFxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat maxSM = max(lumaS, lumaM);\nFxaaFloat minSM = min(lumaS, lumaM);\nFxaaFloat maxESM = max(lumaE, maxSM);\nFxaaFloat minESM = min(lumaE, minSM);\nFxaaFloat maxWN = max(lumaN, lumaW);\nFxaaFloat minWN = min(lumaN, lumaW);\nFxaaFloat rangeMax = max(maxWN, maxESM);\nFxaaFloat rangeMin = min(minWN, minESM);\nFxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\nFxaaFloat range = rangeMax - rangeMin;\nFxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\nFxaaBool earlyExit = range < rangeMaxClamped;\nif(earlyExit)\nreturn rgbyM;\nFxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNS = lumaN + lumaS;\nFxaaFloat lumaWE = lumaW + lumaE;\nFxaaFloat subpixRcpRange = 1.0/range;\nFxaaFloat subpixNSWE = lumaNS + lumaWE;\nFxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\nFxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\nFxaaFloat lumaNESE = lumaNE + lumaSE;\nFxaaFloat lumaNWNE = lumaNW + lumaNE;\nFxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\nFxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\nFxaaFloat lumaNWSW = lumaNW + lumaSW;\nFxaaFloat lumaSWSE = lumaSW + lumaSE;\nFxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\nFxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\nFxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\nFxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\nFxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\nFxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\nFxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\nFxaaFloat lengthSign = fxaaQualityRcpFrame.x;\nFxaaBool horzSpan = edgeHorz >= edgeVert;\nFxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\nif(!horzSpan) lumaN = lumaW;\nif(!horzSpan) lumaS = lumaE;\nif(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\nFxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\nFxaaFloat gradientN = lumaN - lumaM;\nFxaaFloat gradientS = lumaS - lumaM;\nFxaaFloat lumaNN = lumaN + lumaM;\nFxaaFloat lumaSS = lumaS + lumaM;\nFxaaBool pairN = abs(gradientN) >= abs(gradientS);\nFxaaFloat gradient = max(abs(gradientN), abs(gradientS));\nif(pairN) lengthSign = -lengthSign;\nFxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\nFxaaFloat2 posB;\nposB.x = posM.x;\nposB.y = posM.y;\nFxaaFloat2 offNP;\noffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\noffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\nif(!horzSpan) posB.x += lengthSign * 0.5;\nif( horzSpan) posB.y += lengthSign * 0.5;\nFxaaFloat2 posN;\nposN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\nposN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\nFxaaFloat2 posP;\nposP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\nposP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\nFxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\nFxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\nFxaaFloat subpixE = subpixC * subpixC;\nFxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\nif(!pairN) lumaNN = lumaSS;\nFxaaFloat gradientScaled = gradient * 1.0/4.0;\nFxaaFloat lumaMM = lumaM - lumaNN * 0.5;\nFxaaFloat subpixF = subpixD * subpixE;\nFxaaBool lumaMLTZero = lumaMM < 0.0;\nlumaEndN -= lumaNN * 0.5;\nlumaEndP -= lumaNN * 0.5;\nFxaaBool doneN = abs(lumaEndN) >= gradientScaled;\nFxaaBool doneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\nFxaaBool doneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n#if (FXAA_QUALITY_PS > 3)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n#if (FXAA_QUALITY_PS > 4)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n#if (FXAA_QUALITY_PS > 5)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n#if (FXAA_QUALITY_PS > 6)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n#if (FXAA_QUALITY_PS > 7)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n#if (FXAA_QUALITY_PS > 8)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n#if (FXAA_QUALITY_PS > 9)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n#if (FXAA_QUALITY_PS > 10)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n#if (FXAA_QUALITY_PS > 11)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n#if (FXAA_QUALITY_PS > 12)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\nFxaaFloat dstN = posM.x - posN.x;\nFxaaFloat dstP = posP.x - posM.x;\nif(!horzSpan) dstN = posM.y - posN.y;\nif(!horzSpan) dstP = posP.y - posM.y;\nFxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\nFxaaFloat spanLength = (dstP + dstN);\nFxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\nFxaaFloat spanLengthRcp = 1.0/spanLength;\nFxaaBool directionN = dstN < dstP;\nFxaaFloat dst = min(dstN, dstP);\nFxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\nFxaaFloat subpixG = subpixF * subpixF;\nFxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\nFxaaFloat subpixH = subpixG * fxaaQualitySubpix;\nFxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\nFxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\nif(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\nif( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\nreturn FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n}\n"}),define("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/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/PostProcessFilters/FXAA","../ThirdParty/Shaders/FXAA3_11"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v){"use strict";function y(){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,this._useScissorTest=!1,this._scissorRectangle=void 0;var t=new a({color:new r(0,0,0,0),depth:1,owner:this});this._clearCommand=t,this._qualityPreset=39}function b(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,i(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return y.prototype.update=function(r,n){var a=r.drawingBufferWidth,y=r.drawingBufferHeight,b=this._texture,C=!i(b)||b.width!==a||b.height!==y;if(C&&(this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),this._texture=new p({context:r,width:a,height:y,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE,sampler:new h({wrapS:g.CLAMP_TO_EDGE,wrapT:g.CLAMP_TO_EDGE,minificationFilter:m.LINEAR,magnificationFilter:f.LINEAR})}),r.depthTexture?this._depthStencilTexture=new p({context:r,width:a,height:y,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}):this._depthStencilRenderbuffer=new u({context:r,width:a,height:y,format:c.DEPTH_STENCIL})),i(this._fbo)&&!C||(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:r,colorTextures:[this._texture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})),!i(this._command)){var S="#define FXAA_QUALITY_PRESET "+this._qualityPreset+"\n"+v+"\n"+_;this._command=r.createViewportQuadCommand(S,{owner:this})}this._viewport.width=a,this._viewport.height=y;var T=!e.equals(this._viewport,n.viewport),w=T!==this._useScissorTest;if(this._useScissorTest=T,e.equals(this._scissorRectangle,n.viewport)||(this._scissorRectangle=e.clone(n.viewport,this._scissorRectangle),w=!0),i(this._rs)&&e.equals(this._rs.viewport,this._viewport)&&!w||(this._rs=d.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),this._command.renderState=this._rs,C){var A=this,E=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return A._texture},u_fxaaQualityRcpFrame:function(){return E}}}},y.prototype.execute=function(e,t){this._command.execute(e,t)},y.prototype.clear=function(e,t,i){var n=t.framebuffer;t.framebuffer=this._fbo,r.clone(i,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},y.prototype.getColorFramebuffer=function(){return this._fbo},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return b(this),n(this)},y}),define("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,r,i,n){"use strict";function o(e,r,i){this.type=e,t(r)||("json"===e?r="application/json":"xml"===e?r="text/xml":"html"===e?r="text/html":"text"===e&&(r="text/plain")),this.format=r,t(i)||("json"===e?i=a:"xml"===e?i=s:"html"===e?i=m:"text"===e&&(i=m)),this.callback=i}function a(r){for(var i=[],o=r.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)}i.push(l)}return i}function s(e){var t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===g)return l(e);if("FeatureInfoResponse"===t.localName&&t.namespaceURI===_)return u(e);if("FeatureCollection"===t.localName&&t.namespaceURI===v)return c(e);if("ServiceExceptionReport"===t.localName)throw new i((new XMLSerializer).serializeToString(t));return"msGMLOutput"===t.localName?d(e):f(e)}function l(e){for(var t=[],r=e.documentElement,i=r.getElementsByTagNameNS(g,"Feature"),o=0;o<i.length;++o){for(var a=i[o],s={},l=a.getElementsByTagNameNS(g,"Val"),u=0;u<l.length;++u){var c=l[u];if(c.hasAttribute("ref")){var d=c.getAttribute("ref"),h=c.textContent.trim();s[d]=h}}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,r=e.documentElement,i=[],n=r.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}i.push(p(a,t))}else for(var c=r.getElementsByTagNameNS("*","FeatureInfo"),d=0;d<c.length;++d){var h=c[d];t={};for(var f=h.childNodes,m=0;m<f.length;++m){var g=f[m];g.nodeType===Node.ELEMENT_NODE&&(t[g.localName]=g.textContent)}i.push(p(h,t))}return i}function c(e){for(var t=[],r=e.documentElement,i=r.getElementsByTagNameNS(y,"featureMember"),n=0;n<i.length;++n){var o=i[n],a={};h(o,a),t.push(p(o,a))}return t}function d(e){for(var r,n=[],o=e.documentElement.childNodes,a=0;a<o.length;a++)if(o[a].nodeType===Node.ELEMENT_NODE){r=o[a];break}if(!t(r))throw new i("Unable to find first child of the feature info xml document");for(var s=r.childNodes,l=0;l<s.length;++l){var u=s[l];if(u.nodeType===Node.ELEMENT_NODE){var c={};h(u,c),n.push(p(u,c))}}return n}function h(e,t){for(var r=!0,i=0;i<e.childNodes.length;++i){var n=e.childNodes[i];n.nodeType===Node.ELEMENT_NODE&&(r=!1),"Point"!==n.localName&&"LineString"!==n.localName&&"Polygon"!==n.localName&&"boundedBy"!==n.localName&&(n.hasChildNodes()&&h(n,t)&&(t[n.localName]=n.textContent))}return r}function p(e,t){var r=new n;return r.data=e,r.properties=t,r.configureNameFromProperties(t),r.configureDescriptionFromProperties(t),r}function f(e){var t=(new XMLSerializer).serializeToString(e),r=document.createElement("div"),i=document.createElement("pre");i.textContent=t,r.appendChild(i);var o=new n;return o.data=e,o.description=r.innerHTML,[o]}function m(e){if(!b.test(e)&&!C.test(e)){var t,r=S.exec(e);r&&r.length>1&&(t=r[1]);var i=new n;return i.name=t,i.description=e,i.data=e,[i]}}var g="http://www.mapinfo.com/mxp",_="http://www.esri.com/wms",v="http://www.opengis.net/wfs",y="http://www.opengis.net/gml",b=/<body>\s*<\/body>/im,C=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,S=/<title>([\s\S]*)<\/title>/im;return o}),define("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_SPLIT\nuniform float u_dayTextureSplit[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\n#ifdef ENABLE_CLIPPING_PLANES\nuniform int u_clippingPlanesLength;\nuniform vec4 u_clippingPlanes[czm_maxClippingPlanes];\nuniform vec4 u_clippingPlanesEdgeStyle;\n#endif\n#if defined(FOG) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nuniform float u_minimumBrightness;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_height;\nvarying float v_slope;\n#endif\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D textureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split)\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(textureToSample, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_SPLIT\nfloat splitPosition = czm_imagerySplitPosition;\nif (split < 0.0 && gl_FragCoord.x > splitPosition) {\nalpha = 0.0;\n}\nelse if (split > 0.0 && gl_FragCoord.x < splitPosition) {\nalpha = 0.0;\n}\n#endif\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{\n#ifdef ENABLE_CLIPPING_PLANES\n#ifdef UNION_CLIPPING_REGIONS\nfloat clipDistance = czm_discardIfClippedWithUnion(u_clippingPlanes, u_clippingPlanesLength);\n#else\nfloat clipDistance = czm_discardIfClippedWithIntersect(u_clippingPlanes, u_clippingPlanesLength);\n#endif\n#endif\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 APPLY_MATERIAL\nczm_materialInput materialInput;\nmaterialInput.st = v_textureCoordinates.st;\nmaterialInput.normalEC = normalize(v_normalEC);\nmaterialInput.slope = v_slope;\nmaterialInput.height = v_height;\nczm_material material = czm_getMaterial(materialInput);\ncolor.xyz = mix(color.xyz, material.diffuse, material.alpha);\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 ENABLE_CLIPPING_PLANES\nvec4 clippingPlanesEdgeColor = vec4(1.0);\nclippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;\nfloat clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;\nif (clipDistance < clippingPlanesEdgeWidth)\n{\nfinalColor = clippingPlanesEdgeColor;\n}\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);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)\nfloat darken = clamp(dot(normalize(czm_viewerPositionWC), normalize(czm_sunPositionWC)), u_minimumBrightness, 1.0);\nfogColor *= darken;\n#endif\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"}),define("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 APPLY_MATERIAL\nvarying float v_slope;\nvarying float v_height;\n#endif\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(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\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) || defined(APPLY_MATERIAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nvec3 normalMC = czm_octDecode(encodedNormal);\nv_normalMC = normalMC;\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#ifdef APPLY_MATERIAL\nvec3 finalNormal = normalMC;\nvec3 ellipsoidNormal = normalize(position3DWC.xyz);\nv_slope = abs(dot(ellipsoidNormal, finalNormal));\nv_height = height;\n#endif\n}\n"}),define("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"}),define("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,r,i,n){"use strict";function o(e,t,r,i){this.numberOfDayTextures=e,this.flags=t,this.material=r,this.shaderProgram=i}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[],this.material=void 0}function s(e){var t;switch(e){case n.SCENE3D:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }";break;case n.SCENE2D:case n.COLUMBUS_VIEW:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }";break;case n.MORPHING:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"}return t}function l(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}return a.prototype.getShaderProgram=function(t,n,a,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T){var w=0,A="",E=n.pickTerrain.mesh.encoding;E.quantization===r.BITS12&&(w=1,A="QUANTIZATION_BITS12");var x=t.mode,P=x|u<<2|c<<3|d<<4|h<<5|p<<6|f<<7|g<<8|_<<9|v<<10|y<<11|b<<12|C<<13|w<<14|m<<15|S<<16,I=n.surfaceShader;if(e(I)&&I.numberOfDayTextures===a&&I.flags===P&&I.material===this.material)return I.shaderProgram;var D=this._shadersByTexturesFlags[a];if(e(D)||(D=this._shadersByTexturesFlags[a]=[]),I=D[P],!e(I)||I.material!==this.material){var O=this.baseVertexShaderSource.clone(),M=this.baseFragmentShaderSource.clone();O.defines.push(A),M.defines.push("TEXTURE_UNITS "+a),u&&M.defines.push("APPLY_BRIGHTNESS"),c&&M.defines.push("APPLY_CONTRAST"),d&&M.defines.push("APPLY_HUE"),h&&M.defines.push("APPLY_SATURATION"),p&&M.defines.push("APPLY_GAMMA"),f&&M.defines.push("APPLY_ALPHA"),g&&(M.defines.push("SHOW_REFLECTIVE_OCEAN"),O.defines.push("SHOW_REFLECTIVE_OCEAN")),_&&M.defines.push("SHOW_OCEAN_WAVES"),v&&(y?(O.defines.push("ENABLE_VERTEX_LIGHTING"),M.defines.push("ENABLE_VERTEX_LIGHTING")):(O.defines.push("ENABLE_DAYNIGHT_SHADING"),M.defines.push("ENABLE_DAYNIGHT_SHADING"))),O.defines.push("INCLUDE_WEB_MERCATOR_Y"),M.defines.push("INCLUDE_WEB_MERCATOR_Y"),C&&(O.defines.push("FOG"),M.defines.push("FOG")),m&&M.defines.push("APPLY_SPLIT"),S&&(M.defines.push("ENABLE_CLIPPING_PLANES"),T&&M.defines.push("UNION_CLIPPING_REGIONS"));for(var R="    vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n    {\n        vec4 color = initialColor;\n",L=0;L<a;++L)R+="    color = sampleAndBlend(\n        color,\n        u_dayTextures["+L+"],\n        u_dayTextureUseWebMercatorT["+L+"] ? textureCoordinates.xz : textureCoordinates.xy,\n        u_dayTextureTexCoordsRectangle["+L+"],\n        u_dayTextureTranslationAndScale["+L+"],\n        "+(f?"u_dayTextureAlpha["+L+"]":"1.0")+",\n        "+(u?"u_dayTextureBrightness["+L+"]":"0.0")+",\n        "+(c?"u_dayTextureContrast["+L+"]":"0.0")+",\n        "+(d?"u_dayTextureHue["+L+"]":"0.0")+",\n        "+(h?"u_dayTextureSaturation["+L+"]":"0.0")+",\n        "+(p?"u_dayTextureOneOverGamma["+L+"]":"0.0")+",\n        "+(m?"u_dayTextureSplit["+L+"]":"0.0")+"\n    );\n";R+="        return color;\n    }",M.sources.push(R),O.sources.push(s(x)),O.sources.push(l(b));var N=i.fromCache({context:t.context,vertexShaderSource:O,fragmentShaderSource:M,attributeLocations:E.getAttributeLocations()});I=D[P]=new o(a,P,this.material,N)}return n.surfaceShader=I,I.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding;c.quantization===r.BITS12&&(a=1,u="QUANTIZATION_BITS12");var d=t.mode,h=d|o<<2|a<<3,p=this._pickShaderPrograms[h];if(!e(p)){var f=this.baseVertexShaderSource.clone();f.defines.push(u),f.sources.push(s(d)),f.sources.push(l(o));p=this._pickShaderPrograms[h]=i.fromCache({context:t.context,vertexShaderSource:f,fragmentShaderSource:"void main()\n{\n    gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n",attributeLocations:c.getAttributeLocations()})}return p},a.prototype.destroy=function(){var r,i,n=this._shadersByTexturesFlags;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];if(!e(a))continue;for(r in a)a.hasOwnProperty(r)&&(i=a[r],e(i)&&i.shaderProgram.destroy())}var s=this._pickShaderPrograms;for(r in s)s.hasOwnProperty(r)&&(i=s[r],i.destroy());return t(this)},a}),define("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";return e({UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7})}),define("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";return e({START:0,LOADING:1,DONE:2,FAILED:3})}),define("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";return e({FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6})}),define("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/Request","../Core/RequestState","../Core/RequestType","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){this.state=f.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e,this.request=void 0}function g(e,t,i,n,o,c){function d(t){e.data=t,e.state=f.RECEIVED,e.request=void 0}function h(){if(e.request.state===s.CANCELLED)return e.data=void 0,e.state=f.UNLOADED,void(e.request=void 0);e.state=f.FAILED,e.request=void 0;var r="Failed to obtain terrain tile X: "+i+" Y: "+n+" Level: "+o+".";t._requestError=u.handleError(t._requestError,t,t.errorEvent,r,i,n,o,m)}function m(){var s=new a({throttle:!0,throttleByServer:!0,type:l.TERRAIN,priorityFunction:c});e.request=s,e.data=t.requestTileGeometry(i,n,o,s),r(e.data)?(e.state=f.RECEIVING,p(e.data,d,h)):(e.state=f.UNLOADED,e.request=void 0)}m()}function _(e,t,i,n,o,a){var s=i.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);r(u)&&(e.state=f.TRANSFORMING,p(u,function(t){e.mesh=t,e.state=f.TRANSFORMED},function(){e.state=f.FAILED}))}function v(e,t,i,o,a,s){var l=e.mesh.vertices,u=c.createVertexBuffer({context:t,typedArray:l,usage:d.STATIC_DRAW}),p=e.mesh.encoding.getAttributes(u),m=e.mesh.indices.indexBuffers||{},g=m[t.id];if(!r(g)||g.isDestroyed()){var _=e.mesh.indices,v=2===_.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;g=c.createIndexBuffer({context:t,typedArray:_,usage:d.STATIC_DRAW,indexDatatype:v}),g.vertexArrayDestroyable=!1,g.referenceCount=1,m[t.id]=g,e.mesh.indices.indexBuffers=m}else++g.referenceCount;e.vertexArray=new h({context:t,attributes:p,indexBuffer:g}),e.state=f.READY}return m.prototype.freeResources=function(){if(this.state=f.UNLOADED,this.data=void 0,this.mesh=void 0,r(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&r(e.referenceCount)&&0===--e.referenceCount&&e.destroy()}},m.prototype.publishToTile=function(r){var i=r.data,n=this.mesh;t.clone(n.center,i.center),i.minimumHeight=n.minimumHeight,i.maximumHeight=n.maximumHeight,i.boundingSphere3D=e.clone(n.boundingSphere3D,i.boundingSphere3D),i.orientedBoundingBox=o.clone(n.orientedBoundingBox,i.orientedBoundingBox),i.tileBoundingRegion.minimumHeight=n.minimumHeight,i.tileBoundingRegion.maximumHeight=n.maximumHeight,r.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,i.occludeePointInScaledSpace)},m.prototype.processLoadStateMachine=function(e,t,r,i,n,o){this.state===f.UNLOADED&&g(this,t,r,i,n,o),this.state===f.RECEIVED&&_(this,e,t,r,i,n),this.state===f.TRANSFORMED&&v(this,e.context,t,r,i,n)},m.prototype.processUpsampleStateMachine=function(e,t,i,n,o){if(this.state===f.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,c=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,c,i,n,o),!r(this.data))return;this.state=f.RECEIVING;var d=this;p(this.data,function(e){d.data=e,d.state=f.RECEIVED},function(){d.state=f.FAILED})}this.state===f.RECEIVED&&_(this,e,t,i,n,o),this.state===f.TRANSFORMED&&v(this,e.context,t,i,n,o)},m}),define("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","./TileBoundingRegion","./TileTerrain"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y){"use strict";function b(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new r(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.tileBoundingRegion=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,this.isClipped=!0}function C(e,r,i,o,a,s){if(e.decodePosition(o,a,s),n(r)&&r!==g.SCENE3D){var l=i.ellipsoid,u=l.cartesianToCartographic(s);i.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function S(e){var t,r;return n(e.parent)&&n(e.parent.data)&&(t=e.parent.data.minimumHeight,r=e.parent.data.maximumHeight),new v({rectangle:e.rectangle,ellipsoid:e.tilingScheme.ellipsoid,minimumHeight:t,maximumHeight:r})}function T(e,t){return function(){return e.tileBoundingRegion.distanceToCamera(t)}}function w(e,t,r){var i=e.data,o=E(e);n(o)&&(i.upsampledTerrain=new y(o)),O(e,t)&&(i.loadedTerrain=new y);for(var a=0,s=r.length;a<s;++a){var l=r.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function A(e,t,r,o){var a=e.data,s=a.loadedTerrain,l=a.upsampledTerrain,u=!1;n(s)&&(s.processLoadStateMachine(t,r,e.x,e.y,e.level,e._priorityFunction),s.state>=_.RECEIVED&&(a.terrainData!==s.data&&(a.terrainData=s.data,R(t.context,a),I(e)),u=!0),s.state===_.READY?(s.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=s.vertexArray,s.vertexArray=void 0,a.pickTerrain=i(a.loadedTerrain,a.upsampledTerrain),a.loadedTerrain=void 0,a.upsampledTerrain=void 0):s.state===_.FAILED&&(a.loadedTerrain=void 0)),!u&&n(l)&&(l.processUpsampleStateMachine(t,r,e.x,e.y,e.level),l.state>=_.RECEIVED&&a.terrainData!==l.data&&(a.terrainData=l.data,r.hasWaterMask&&L(e),x(e)),l.state===_.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===_.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 x(e){P(e,e._southwestChild),P(e,e._southeastChild),P(e,e._northwestChild),P(e,e._northeastChild)}function P(e,t){if(n(t)&&t.state!==m.START){var r=t.data;if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())return;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new y({data:e.data.terrainData,x:e.x,y:e.y,level:e.level}),t.state=m.LOADING}}function I(e){var t=e.data;D(e,t,e.southwestChild),D(e,t,e.southeastChild),D(e,t,e.northwestChild),D(e,t,e.northeastChild)}function D(e,t,r){if(r.state!==m.START){var i=r.data;if(n(i.terrainData)&&!i.terrainData.wasCreatedByUpsampling())return;n(i.upsampledTerrain)&&i.upsampledTerrain.freeResources(),i.upsampledTerrain=new y({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,r.x,r.y)&&(n(i.loadedTerrain)||(i.loadedTerrain=new y)),r.state=m.LOADING}}function O(e,t){var r=t.getTileDataAvailable(e.x,e.y,e.level);if(n(r))return r;var i=e.parent;return!n(i)||!(!n(i.data)||!n(i.data.terrainData))&&i.data.terrainData.isChildAvailable(i.x,i.y,e.x,e.y)}function M(e){var t=e.cache.tile_waterMaskData;if(!n(t)){var r=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});r.referenceCount=1;t={allWaterTexture:r,sampler:new u({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,
minificationFilter:h.LINEAR,magnificationFilter:d.LINEAR}),destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function R(e,t){var i=t.waterMaskTexture;n(i)&&(--i.referenceCount,0===i.referenceCount&&i.destroy(),t.waterMaskTexture=void 0);var o=t.terrainData.waterMask;if(n(o)){var a,u=M(e),d=o.length;if(1===d){if(0===o[0])return;a=u.allWaterTexture}else{var h=Math.sqrt(d);a=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{width:h,height:h,arrayBufferView:o},sampler:u.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,r.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function L(e){for(var t=e.data,r=e.parent;n(r)&&!n(r.data.terrainData)||r.data.terrainData.wasCreatedByUpsampling();)r=r.parent;if(n(r)&&n(r.data.waterMaskTexture)){t.waterMaskTexture=r.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var i=r.rectangle,o=e.rectangle,a=o.width,s=o.height,l=a/i.width,u=s/i.height;t.waterMaskTranslationAndScale.x=l*(o.west-i.west)/a,t.waterMaskTranslationAndScale.y=u*(o.south-i.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}o(b.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=n(e)&&(e.state===_.RECEIVING||e.state===_.TRANSFORMING),r=this.upsampledTerrain,i=n(r)&&(r.state===_.RECEIVING||r.state===_.TRANSFORMING),o=!t&&!i,a=this.imagery,s=0,l=a.length;o&&s<l;++s){var u=a[s];o=!n(u.loadingImagery)||u.loadingImagery.state!==f.TRANSITIONING}return o}}});var N=new t,k=new t,F=new t,B=new t;return b.prototype.pick=function(e,r,i,o,s){var l=this.pickTerrain;if(n(l)){var u=l.mesh;if(n(u))for(var c=u.vertices,d=u.indices,h=u.encoding,p=d.length,f=0;f<p;f+=3){var m=d[f],g=d[f+1],_=d[f+2],v=C(h,r,i,c,m,N),y=C(h,r,i,c,g,k),b=C(h,r,i,c,_,F),S=a.rayTriangle(e,v,y,b,o,B);if(n(S))return t.clone(S,s)}}},b.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,r=this.imagery;for(e=0,t=r.length;e<t;++e)r[e].freeResources();this.imagery.length=0,this.freeVertexArray()},b.prototype.freeVertexArray=function(){var e;n(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&0===--e.referenceCount&&e.destroy()),n(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&0===--e.referenceCount&&e.destroy())},b.processStateMachine=function(e,t,r,i,o){var a=e.data;n(a)||(a=e.data=new b,a.tileBoundingRegion=S(e)),n(e._priorityFunction)||(e._priorityFunction=T(a,t)),e.state===m.START&&(w(e,r,i),e.state=m.LOADING),e.state===m.LOADING&&A(e,t,r,o);var s,l,u=n(a.vertexArray),c=!n(a.loadedTerrain)&&!n(a.upsampledTerrain),d=n(a.terrainData)&&a.terrainData.wasCreatedByUpsampling(),h=a.imagery;for(s=0,l=h.length;s<l;++s){var p=h[s];if(n(p.loadingImagery)){if(p.loadingImagery.state===f.PLACEHOLDER){var g=p.loadingImagery.imageryLayer;if(g.imageryProvider.ready){p.freeResources(),h.splice(s,1),g._createTileImagerySkeletons(e,r,s),--s,l=h.length;continue}d=!1}var _=p.processStateMachine(e,t);c=c&&_,u=u&&(_||n(p.readyImagery)),d=d&&n(p.loadingImagery)&&(p.loadingImagery.state===f.FAILED||p.loadingImagery.state===f.INVALID)}else d=!1}if(e.upsampledFromParent=d,s===l&&(u&&(e.renderable=!0),c)){var v=e._loadedCallbacks,y={};for(var C in v)v.hasOwnProperty(C)&&(v[C](e)||(y[C]=v[C]));e._loadedCallbacks=y,e.state=m.DONE,e._priorityFunction=void 0}},b}),define("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"}),define("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"}),define("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,r){"use strict";function i(t,i,n,o,a){if(this.imageryLayer=t,this.x=i,this.y=n,this.level=o,this.request=void 0,0!==o){var s=i/2|0,l=n/2|0,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=r.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){a=t.imageryProvider.tilingScheme.tileXYToRectangle(i,n,o)}this.rectangle=a}return i.createPlaceholder=function(e){var t=new i(e,0,0,0);return t.addReference(),t.state=r.PLACEHOLDER,t},i.prototype.addReference=function(){++this.referenceCount},i.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},i.prototype.processStateMachine=function(e,t,i){this.state===r.UNLOADED&&(this.state=r.TRANSITIONING,this.imageryLayer._requestImagery(this,i)),this.state===r.RECEIVED&&(this.state=r.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var n=this.state===r.READY&&t&&!this.texture;(this.state===r.TEXTURE_LOADED||n)&&(this.state=r.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},i}),define("Scene/ImagerySplitDirection",["../Core/freezeObject"],function(e){"use strict";return e({LEFT:-1,NONE:0,RIGHT:1})}),define("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function r(e,t,r){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=r}return r.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},r.prototype.processStateMachine=function(r,i){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(i,!this.useWebMercatorT,r._priorityFunction),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this),!0;for(var a,s=n.parent;e(s)&&(s.state!==t.READY||!this.useWebMercatorT&&!e(s.texture));)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(r,this))),(n.state===t.FAILED||n.state===t.INVALID)&&(!e(a)||(a.processStateMachine(i,!this.useWebMercatorT,r._priorityFunction),!1))},r}),define("Scene/ImageryLayer",["../Core/Cartesian2","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/Rectangle","../Core/Request","../Core/RequestState","../Core/RequestType","../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","./ImagerySplitDirection","./ImageryState","./TileImagery"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U){"use strict";function V(e,t){this._imageryProvider=e,t=r(t,{}),this.alpha=r(t.alpha,r(e.defaultAlpha,1)),this.brightness=r(t.brightness,r(e.defaultBrightness,V.DEFAULT_BRIGHTNESS)),this.contrast=r(t.contrast,r(e.defaultContrast,V.DEFAULT_CONTRAST)),this.hue=r(t.hue,r(e.defaultHue,V.DEFAULT_HUE)),this.saturation=r(t.saturation,r(e.defaultSaturation,V.DEFAULT_SATURATION)),this.gamma=r(t.gamma,r(e.defaultGamma,V.DEFAULT_GAMMA)),this.splitDirection=r(t.splitDirection,r(e.defaultSplit,V.DEFAULT_SPLIT)),this.minificationFilter=r(t.minificationFilter,r(e.defaultMinificationFilter,V.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=r(t.magnificationFilter,r(e.defaultMagnificationFilter,V.DEFAULT_MAGNIFICATION_FILTER)),this.show=r(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=r(t.rectangle,h.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new U(k.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[]}function z(e,t,r){return e+":"+t+":"+r}function G(e,t,n,o){var a=e.minificationFilter,s=e.magnificationFilter;if(a===D.LINEAR&&s===I.LINEAR&&!d.isCompressedFormat(o.pixelFormat)&&c.isPowerOfTwo(o.width)&&c.isPowerOfTwo(o.height)){a=D.LINEAR_MIPMAP_LINEAR;var l=T.maximumTextureFilterAnisotropy,u=Math.min(l,r(e._maximumAnisotropy,l)),h=z(a,s,u),p=t.cache.imageryLayerMipmapSamplers;i(p)||(p={},t.cache.imageryLayerMipmapSamplers=p);var f=p[h];i(f)||(f=p[h]=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:a,magnificationFilter:s,maximumAnisotropy:u})),o.generateMipmap(w.NICEST),o.sampler=f}else{var m=z(a,s,0),g=t.cache.imageryLayerNonMipmapSamplers;i(g)||(g={},t.cache.imageryLayerNonMipmapSamplers=g);var _=g[m];i(_)||(_=g[m]=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:a,magnificationFilter:s})),o.sampler=_}n.state=B.READY}function H(e,t,r){return JSON.stringify([e,t,r])}function W(e,t,r,n){var o=t.cache.imageryLayer_reproject;if(!i(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){i(this.framebuffer)&&this.framebuffer.destroy(),i(this.vertexArray)&&this.vertexArray.destroy(),i(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),s=0,l=0;l<64;++l){var d=l/63;a[s++]=0,a[s++]=d,a[s++]=1,a[s++]=d}var h={position:0,webMercatorT:1},p=g.getRegularGridIndices(2,64),f=b.createIndexBuffer({context:t,typedArray:p,usage:C.STATIC_DRAW,indexDatatype:u.UNSIGNED_SHORT});o.vertexArray=new M({context:t,attributes:[{index:h.position,vertexBuffer:b.createVertexBuffer({context:t,typedArray:a,usage:C.STATIC_DRAW}),componentsPerAttribute:2},{index:h.webMercatorT,vertexBuffer:b.createVertexBuffer({context:t,sizeInBytes:512,usage:C.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:f});var m=new x({sources:[L]});o.shaderProgram=E.fromCache({context:t,vertexShaderSource:m,fragmentShaderSource:R,attributeLocations:h}),o.sampler=new A({wrapS:O.CLAMP_TO_EDGE,wrapT:O.CLAMP_TO_EDGE,minificationFilter:D.LINEAR,magnificationFilter:I.LINEAR})}r.sampler=o.sampler;var _=r.width,v=r.height;Z.textureDimensions.x=_,Z.textureDimensions.y=v,Z.texture=r;var y=Math.sin(n.south),S=.5*Math.log((1+y)/(1-y));y=Math.sin(n.north);var T=.5*Math.log((1+y)/(1-y)),N=1/(T-S),k=new P({context:t,width:_,height:v,pixelFormat:r.pixelFormat,pixelDatatype:r.pixelDatatype,preMultiplyAlpha:r.preMultiplyAlpha});c.isPowerOfTwo(_)&&c.isPowerOfTwo(v)&&k.generateMipmap(w.NICEST);for(var F=n.south,B=n.north,U=K,V=0,z=0;z<64;++z){var G=z/63,H=c.lerp(F,B,G);y=Math.sin(H);var W=.5*Math.log((1+y)/(1-y)),j=(W-S)*N;U[V++]=j,U[V++]=j}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(U),e.shaderProgram=o.shaderProgram,e.outputTexture=k,e.uniformMap=Z,e.vertexArray=o.vertexArray}function j(e,t,r){var i=e._imageryProvider,n=i.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof l?1:Math.cos(r),s=n.rectangle,u=o.maximumRadius*s.width*a/(i.tileWidth*n.getNumberOfXTilesAtLevel(0)),c=u/t,d=Math.log(c)/Math.log(2);return 0|Math.round(d)}n(V.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),V.DEFAULT_BRIGHTNESS=1,V.DEFAULT_CONTRAST=1,V.DEFAULT_HUE=0,V.DEFAULT_SATURATION=1,V.DEFAULT_GAMMA=1,V.DEFAULT_SPLIT=F.NONE,V.DEFAULT_MINIFICATION_FILTER=D.LINEAR,V.DEFAULT_MAGNIFICATION_FILTER=I.LINEAR,V.prototype.isBaseLayer=function(){return this._isBaseLayer},V.prototype.isDestroyed=function(){return!1},V.prototype.destroy=function(){return o(this)};var q=new h,Y=new h,X=new h,Q=new h;V.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return h.intersection(e.rectangle,t)})},V.prototype._createTileImagerySkeletons=function(e,r,n){var o=e.data;if(i(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(i(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var a=this._imageryProvider;if(i(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 y&&e.rectangle.north<v.MaximumLatitude&&e.rectangle.south>-v.MaximumLatitude,l=h.intersection(a.rectangle,this._rectangle,q),u=h.intersection(e.rectangle,l,Y);if(!i(u)){if(!this.isBaseLayer())return!1;var c=l,d=e.rectangle;u=Y,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 f=1*r.getLevelMaximumGeometricError(e.level),m=j(this,f,p);m=Math.max(0,m);var g=a.maximumLevel;if(m>g&&(m=g),i(a.minimumLevel)){var _=a.minimumLevel;m<_&&(m=_)}var b=a.tilingScheme,C=b.positionToTileXY(h.northwest(u),m),S=b.positionToTileXY(h.southeast(u),m),T=e.rectangle.width/512,w=e.rectangle.height/512,A=b.tileXYToRectangle(C.x,C.y,m);Math.abs(A.south-e.rectangle.north)<w&&C.y<S.y&&++C.y,Math.abs(A.east-e.rectangle.west)<T&&C.x<S.x&&++C.x;var E=b.tileXYToRectangle(S.x,S.y,m);Math.abs(E.north-e.rectangle.south)<w&&S.y>C.y&&--S.y,Math.abs(E.west-e.rectangle.east)<T&&S.x>C.x&&--S.x;var x,P=h.clone(e.rectangle,Q),I=b.tileXYToRectangle(C.x,C.y,m),D=h.intersection(I,l,X);s?(b.rectangleToNativeRectangle(P,P),b.rectangleToNativeRectangle(I,I),b.rectangleToNativeRectangle(D,D),b.rectangleToNativeRectangle(l,l),x=b.tileXYToNativeRectangle.bind(b),T=P.width/512,w=P.height/512):x=b.tileXYToRectangle.bind(b);var O,M,R=0,L=1;!this.isBaseLayer()&&Math.abs(D.west-P.west)>=T&&(R=Math.min(1,(D.west-P.west)/P.width)),!this.isBaseLayer()&&Math.abs(D.north-P.north)>=w&&(L=Math.max(0,(D.north-P.south)/P.height));for(var N=L,k=C.x;k<=S.x;k++)if(O=R,I=x(k,C.y,m),D=h.simpleIntersection(I,l,X),i(D)){R=Math.min(1,(D.east-P.west)/P.width),k===S.x&&(this.isBaseLayer()||Math.abs(D.east-P.east)<T)&&(R=1),L=N;for(var F=C.y;F<=S.y;F++)if(M=L,I=x(k,F,m),D=h.simpleIntersection(I,l,X),i(D)){L=Math.max(0,(D.south-P.south)/P.height),F===S.y&&(this.isBaseLayer()||Math.abs(D.south-P.south)<w)&&(L=0);var B=new t(O,L,R,M),V=this.getImageryFromCache(k,F,m);o.imagery.splice(n,0,new U(V,B,s)),++n}}return!0},V.prototype._calculateTextureTranslationAndScale=function(e,r){var i=r.readyImagery.rectangle,n=e.rectangle;if(r.useWebMercatorT){var o=r.readyImagery.imageryLayer.imageryProvider.tilingScheme;i=o.rectangleToNativeRectangle(i,q),n=o.rectangleToNativeRectangle(n,Q)}var a=n.width,s=n.height,l=a/i.width,u=s/i.height;return new t(l*(n.west-i.west)/a,u*(n.south-i.south)/s,l,u)},V.prototype._requestImagery=function(e,t){function r(t){if(!i(t))return n();e.image=t,e.state=B.RECEIVED,e.request=void 0,_.handleSuccess(s._requestImageError)}function n(t){if(e.request.state===f.CANCELLED)return e.state=B.UNLOADED,void(e.request=void 0);e.state=B.FAILED,e.request=void 0;var r="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";s._requestImageError=_.handleError(s._requestImageError,a,a.errorEvent,r,e.x,e.y,e.level,o,t)}function o(){var o=new p({throttle:!0,throttleByServer:!0,type:m.IMAGERY,priorityFunction:t});e.request=o,e.state=B.TRANSITIONING;var s=a.requestImage(e.x,e.y,e.level,o);if(!i(s))return e.state=B.UNLOADED,void(e.request=void 0);i(a.getTileCredits)&&(e.credits=a.getTileCredits(e.x,e.y,e.level)),N(s,r,n)}var a=this._imageryProvider,s=this;o()},V.prototype._createTexture=function(e,t){var r=this._imageryProvider,n=t.image;if(i(r.tileDiscardPolicy)){var o=r.tileDiscardPolicy;if(i(o)){if(!o.isReady())return void(t.state=B.RECEIVED);if(o.shouldDiscardImage(n))return void(t.state=B.INVALID)}}var a,s=new A({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter});a=new P(i(n.internalFormat)?{context:e,pixelFormat:n.internalFormat,width:n.width,height:n.height,source:{arrayBufferView:n.bufferView},sampler:s}:{context:e,source:n,pixelFormat:r.hasAlphaChannel?d.RGBA:d.RGB,sampler:s}),r.tilingScheme instanceof y?t.textureWebMercator=a:t.texture=a,t.image=void 0,t.state=B.TEXTURE_LOADED},V.prototype._reprojectTexture=function(e,t,i){var n=t.textureWebMercator||t.texture,o=t.rectangle,a=e.context;if((i=r(i,!0))&&!(this._imageryProvider.tilingScheme instanceof l)&&o.width/n.width>1e-5){var s=this;t.addReference();var u=new S({persists:!0,owner:this,preExecute:function(e){W(e,a,n,t.rectangle)},postExecute:function(e){t.texture=e,G(s,a,t,e),t.releaseReference()}});this._reprojectComputeCommands.push(u)}else i&&(t.texture=n),G(this,a,t,n)},V.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,r=t.length,i=0;i<r;++i)e.commandList.push(t[i]);t.length=0},V.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},V.prototype.getImageryFromCache=function(e,t,r,n){var o=H(e,t,r),a=this._imageryCache[o];return i(a)||(a=new k(this,e,t,r,n),this._imageryCache[o]=a),a.addReference(),a},V.prototype.removeImageryFromCache=function(e){var t=H(e.x,e.y,e.level);delete this._imageryCache[t]};var Z={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new e,texture:void 0},K=s.supportsTypedArrays()?new Float32Array(128):void 0;return V}),define("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ClippingPlaneCollection","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/combine","../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/OrthographicFrustum","../Core/Plane","../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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j){"use strict";function q(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.shadows=j.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 f,this._imageryLayers.layerAdded.addEventListener(q.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(q.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(q.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(q.prototype._onLayerShownOrHidden,this),this._tileLoadedEvent=new f,this._imageryLayersUpdatedEvent=new f,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 a(0,0,.5,1),this.clippingPlanes=void 0}function Y(e,t){var r=e.loadingImagery;c(r)||(r=e.readyImagery);var i=t.loadingImagery;return c(i)||(i=t.readyImagery),r.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function X(e){var t=e.indexBuffer;e.destroy(),!t.isDestroyed()&&c(t.referenceCount)&&0===--t.referenceCount&&t.destroy()}function Q(e,t){var r=t.creditDisplay;e._terrainProvider.ready&&c(e._terrainProvider.credit)&&r.addCredit(e._terrainProvider.credit);for(var i=e._imageryLayers,n=0,o=i.length;n<o;++n){var a=i.get(n).imageryProvider;a.ready&&c(a.credit)&&r.addCredit(a.credit)}}function Z(e,t,r){return function(i){var n,o,a,s=-1,l=i.data.imagery,d=l.length;for(a=0;a<d;++a)if(n=l[a],o=u(n.readyImagery,n.loadingImagery),o.imageryLayer===t){s=a;break}if(-1!==s){var h=s+e;if(n=l[h],o=c(n)?u(n.readyImagery,n.loadingImagery):void 0,!c(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,r,h);for(a=s;a<h;++a)l[a].freeResources();l.splice(s,e)}return!0}}function K(e){return{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,r=b.multiplyByPoint(t,this.properties.rtc,se);return b.setTranslation(t,r,ie),ie},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,r=e.context.uniformState.projection,i=b.multiplyByPoint(t,this.properties.rtc,se);return b.setTranslation(t,i,ne),b.multiply(r,ne,ne),ne},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},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_clippingPlanesLength:function(){return this.properties.clippingPlanes.length},u_clippingPlanes:function(){return this.properties.clippingPlanes},u_clippingPlanesEdgeStyle:function(){var e=this.properties.clippingPlanesEdgeColor;return e.alpha=this.properties.clippingPlanesEdgeWidth,e},u_minimumBrightness:function(){return e.fog.minimumBrightness},properties:{initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new r(65e5,9e6),center3D:void 0,rtc:new i,modifiedModelView:new b,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayIntensity:0,southAndNorthLatitude:new r,southMercatorYAndOneOverHeight:new r,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new r,scaleAndBias:new b,clippingPlanes:[],clippingPlanesEdgeColor:a.clone(a.WHITE),clippingPlanesEdgeWidth:0}}}function J(e,t,r){var i=r.data;c(i.wireframeVertexArray)||c(i.terrainData)&&c(i.terrainData._mesh)&&(i.wireframeVertexArray=$(e,i.vertexArray,i.terrainData._mesh))}function $(e,t,r){var i={indices:r.indices,primitiveType:w.TRIANGLES};g.toWireframe(i);var n=i.indices,o=D.createIndexBuffer({context:e,typedArray:n,usage:O.STATIC_DRAW,indexDatatype:_.UNSIGNED_SHORT});return new k({context:e,attributes:t._attributes,indexBuffer:o})}function ee(t,r,s){var u=r.data,d=s.creditDisplay,h=u.terrainData;if(c(h)&&c(h.credits))for(var p=h.credits,f=0,m=p.length;f<m;++f)d.addCredit(p[f]);var g=M.maximumTextureImageUnits,_=u.waterMaskTexture,v=t.hasWaterMask&&c(_),S=t.oceanNormalMap,T=v&&c(S),E=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,P=s.fog.enabled,D=j.castShadows(t.shadows),O=j.receiveShadows(t.shadows);v&&--g,T&&--g;var N=u.center,k=u.pickTerrain.mesh.encoding,F=oe,B=0,U=0,V=0,z=0,H=!1;if(s.mode!==W.SCENE3D){var q=s.mapProjection,Y=q.project(A.southwest(r.rectangle),le),X=q.project(A.northeast(r.rectangle),ue);if(F.x=Y.x,F.y=Y.y,F.z=X.x,F.w=X.y,s.mode!==W.MORPHING&&(N=ae,N.x=0,N.y=.5*(F.z+F.x),N.z=.5*(F.w+F.y),F.x-=N.y,F.y-=N.z,F.z-=N.y,F.w-=N.z),s.mode===W.SCENE2D&&k.quantization===x.BITS12){var Q=1/(Math.pow(2,12)-1)*.5,Z=(F.z-F.x)*Q,$=(F.w-F.y)*Q;F.x-=Z,F.y-=$,F.z+=Z,F.w+=$}q instanceof I&&(B=r.rectangle.south,U=r.rectangle.north,V=I.geodeticLatitudeToMercatorAngle(B),z=1/(I.geodeticLatitudeToMercatorAngle(U)-V),H=!0)}var ee=u.imagery,te=0,re=ee.length,ie=t._renderState,ne=t._blendRenderState,se=ie,fe=t._firstPassInitialColor,me=s.context;c(t._debug.boundingSphereTile)||he();do{var ge,_e,ve=0;t._drawCommands.length<=t._usedDrawCommands?(ge=new R,ge.owner=r,ge.cull=!1,ge.boundingVolume=new e,ge.orientedBoundingBox=void 0,_e=K(s),t._drawCommands.push(ge),t._uniformMaps.push(_e)):(ge=t._drawCommands[t._usedDrawCommands],_e=t._uniformMaps[t._usedDrawCommands]),ge.owner=r,++t._usedDrawCommands,r===t._debug.boundingSphereTile&&(c(u.orientedBoundingBox)?ce(u.orientedBoundingBox,a.RED).update(s):c(u.boundingSphere3D)&&de(u.boundingSphere3D,a.RED).update(s));var ye=_e.properties;n.clone(fe,ye.initialColor),ye.oceanNormalMap=S,ye.lightingFadeDistance.x=t.lightingFadeOutDistance,ye.lightingFadeDistance.y=t.lightingFadeInDistance,ye.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,ye.center3D=u.center,i.clone(N,ye.rtc),n.clone(F,ye.tileRectangle),ye.southAndNorthLatitude.x=B,ye.southAndNorthLatitude.y=U,ye.southMercatorYAndOneOverHeight.x=V,ye.southMercatorYAndOneOverHeight.y=z;for(var be=P&&y.fog(r._distance,s.fog.density)>y.EPSILON3,Ce=!1,Se=!1,Te=!1,we=!1,Ae=!1,Ee=!1,xe=!1;ve<g&&te<re;){var Pe=ee[te],Ie=Pe.readyImagery;if(++te,c(Ie)&&0!==Ie.imageryLayer.alpha){var De=Pe.useWebMercatorT?Ie.textureWebMercator:Ie.texture,Oe=Ie.imageryLayer;if(c(Pe.textureTranslationAndScale)||(Pe.textureTranslationAndScale=Oe._calculateTextureTranslationAndScale(r,Pe)),ye.dayTextures[ve]=De,ye.dayTextureTranslationAndScale[ve]=Pe.textureTranslationAndScale,ye.dayTextureTexCoordsRectangle[ve]=Pe.textureCoordinateRectangle,ye.dayTextureUseWebMercatorT[ve]=Pe.useWebMercatorT,ye.dayTextureAlpha[ve]=Oe.alpha,Ee=Ee||1!==ye.dayTextureAlpha[ve],ye.dayTextureBrightness[ve]=Oe.brightness,Ce=Ce||ye.dayTextureBrightness[ve]!==G.DEFAULT_BRIGHTNESS,ye.dayTextureContrast[ve]=Oe.contrast,Se=Se||ye.dayTextureContrast[ve]!==G.DEFAULT_CONTRAST,ye.dayTextureHue[ve]=Oe.hue,Te=Te||ye.dayTextureHue[ve]!==G.DEFAULT_HUE,ye.dayTextureSaturation[ve]=Oe.saturation,we=we||ye.dayTextureSaturation[ve]!==G.DEFAULT_SATURATION,ye.dayTextureOneOverGamma[ve]=1/Oe.gamma,Ae=Ae||ye.dayTextureOneOverGamma[ve]!==1/G.DEFAULT_GAMMA,ye.dayTextureSplit[ve]=Oe.splitDirection,xe=xe||0!==ye.dayTextureSplit[ve],c(Ie.credits))for(var Me=Ie.credits,Re=0,Le=Me.length;Re<Le;++Re)d.addCredit(Me[Re]);++ve}}ye.dayTextures.length=ve,ye.waterMask=_,n.clone(u.waterMaskTranslationAndScale,ye.waterMaskTranslationAndScale),ye.minMaxHeight.x=k.minimumHeight,ye.minMaxHeight.y=k.maximumHeight,b.clone(k.matrix,ye.scaleAndBias);var Ne=t.clippingPlanes,ke=0;c(Ne)&&r.isClipped&&(ke=Ne.length);var Fe=ye.clippingPlanes,Be=Fe.length;if(Be!==ke){Fe.length=ke;for(var Ue=Be;Ue<ke;++Ue)Fe[Ue]=new n}c(Ne)&&Ne.enabled&&r.isClipped&&(Ne.transformAndPackPlanes(me.uniformState.view,Fe),ye.clippingPlanesEdgeColor=a.clone(Ne.edgeColor,ye.clippingPlanesEdgeColor),ye.clippingPlanesEdgeWidth=Ne.edgeWidth);var Ve=c(Ne)&&Ne.enabled&&ye.clippingPlanes.length>0&&o.isSupported(),ze=!!Ve&&Ne.unionClippingRegions;c(t.uniformMap)&&(_e=l(_e,t.uniformMap)),ge.shaderProgram=t._surfaceShaderSet.getShaderProgram(s,u,ve,Ce,Se,Te,we,Ae,Ee,xe,v,T,t.enableLighting,E,H,be,Ve,ze),ge.castShadows=D,ge.receiveShadows=O,ge.renderState=se,ge.primitiveType=w.TRIANGLES,ge.vertexArray=u.vertexArray,ge.uniformMap=_e,ge.pass=L.GLOBE,t._debug.wireframe&&(J(me,t,r),c(u.wireframeVertexArray)&&(ge.vertexArray=u.wireframeVertexArray,ge.primitiveType=w.LINES));var Ge=ge.boundingVolume,He=ge.orientedBoundingBox;s.mode!==W.SCENE3D?(e.fromRectangleWithHeights2D(r.rectangle,s.mapProjection,u.minimumHeight,u.maximumHeight,Ge),i.fromElements(Ge.center.z,Ge.center.x,Ge.center.y,Ge.center),s.mode===W.MORPHING&&(Ge=e.union(u.boundingSphere3D,Ge,Ge))):(ge.boundingVolume=e.clone(u.boundingSphere3D,Ge),ge.orientedBoundingBox=C.clone(u.orientedBoundingBox,He)),s.commandList.push(ge),se=ne,fe=pe}while(te<re)}function te(e,t,r){var i;e._pickCommands.length<=e._usedPickCommands?(i=new R,i.cull=!1,e._pickCommands.push(i)):i=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=r.projection instanceof I;i.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(r,n,o),i.renderState=e._pickRenderState,i.owner=t.owner,i.primitiveType=t.primitiveType,i.vertexArray=t.vertexArray,i.uniformMap=t.uniformMap,i.boundingVolume=t.boundingVolume,i.orientedBoundingBox=t.orientedBoundingBox,i.pass=t.pass,r.commandList.push(i)}d(q.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}},tileLoadedEvent:{get:function(){return this._tileLoadedEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,c(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),q.prototype.update=function(e){this._imageryLayers._update()},q.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(Y)})),Q(this,e);for(var t=this._vertexArraysToDestroy,r=t.length,i=0;i<r;++i)X(t[i]);t.length=0},q.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,r=0,i=t.length;r<i;++r){var n=t[r];c(n)&&(n.length=0)}this._usedDrawCommands=0},q.prototype.endUpdate=function(e){c(this._renderState)||(this._renderState=N.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:B.LESS}}),this._blendRenderState=N.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:B.LESS_OR_EQUAL},blending:F.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,r=0,i=t.length;r<i;++r){var n=t[r];if(c(n))for(var o=0,a=n.length;o<a;++o)ee(this,n[o],e)}},q.prototype.updateForPick=function(e){c(this._pickRenderState)||(this._pickRenderState=N.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,r=0,i=this._usedDrawCommands;r<i;++r)te(this,t[r],e)},q.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},q.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},q.prototype.loadTile=function(e,t){z.processStateMachine(t,e,this._terrainProvider,this._imageryLayers,this._vertexArraysToDestroy);var r=this._tileLoadedEvent;t._loadedCallbacks.tileLoadedEvent=function(e){return r.raiseEvent(),!0}};var re=new e;q.prototype.computeTileVisibility=function(t,r,n){var o=this.computeDistanceToTile(t,r);if(t._distance=o,r.fog.enabled&&y.fog(o,r.fog.density)>=1)return P.NONE;var a=t.data,s=r.cullingVolume,l=u(a.orientedBoundingBox,a.boundingSphere3D);r.mode!==W.SCENE3D&&(l=re,e.fromRectangleWithHeights2D(t.rectangle,r.mapProjection,a.minimumHeight,a.maximumHeight,l),i.fromElements(l.center.z,l.center.x,l.center.y,l.center),r.mode===W.MORPHING&&(l=e.union(a.boundingSphere3D,l,l)));var d=this.clippingPlanes;if(c(d)&&d.enabled){var h=d.computeIntersectionWithBoundingVolume(l);if(t.isClipped=h!==v.INSIDE,h===v.OUTSIDE)return P.NONE}var p=s.computeVisibility(l);if(p===v.OUTSIDE)return P.NONE;var f=r.mode===W.SCENE3D&&r.camera.frustum instanceof S;if(r.mode===W.SCENE3D&&!f&&c(n)){var m=a.occludeePointInScaledSpace;return c(m)?n.ellipsoid.isScaledSpacePointVisible(m)?p:P.NONE:p}return p};var ie=new b,ne=new b,oe=new n,ae=new i,se=new i,le=new i,ue=new i;q.prototype.showTileThisFrame=function(e,t){for(var r=0,i=e.data.imagery,n=0,o=i.length;n<o;++n){var a=i[n];c(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++r}var s=this._tilesToRenderByTextureCount[r];c(s)||(s=[],this._tilesToRenderByTextureCount[r]=s),s.push(e);var l=this._debug;++l.tilesRendered,l.texturesRendered+=r},q.prototype.computeDistanceToTile=function(e,t){return e.data.tileBoundingRegion.distanceToCamera(t)},q.prototype.isDestroyed=function(){return!1},q.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),h(this)},q.prototype._onLayerAdded=function(e,t){if(e.show){var r=this._terrainProvider,i=this,n=e.imageryProvider,o=this._imageryLayersUpdatedEvent;n._reload=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(t){if(!c(t._loadedCallbacks[e._layerIndex])){var i,n=t.data.imagery,o=n.length,a=-1,s=0;for(i=0;i<o;++i){var l=n[i];if(u(l.readyImagery,l.loadingImagery).imageryLayer===e)-1===a&&(a=i),++s;else if(-1!==a)break}if(-1!==a){var d=a+s;e._createTileImagerySkeletons(t,r,d)&&(t._loadedCallbacks[e._layerIndex]=Z(s,e,r),t.state=H.LOADING)}}})},this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,r)&&(t.state=H.LOADING)}),this._layerOrderChanged=!0,o.raiseEvent()}},q.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var r=t.data.imagery,i=-1,n=0,o=0,a=r.length;o<a;++o){var s=r[o],l=s.loadingImagery;if(c(l)||(l=s.readyImagery),l.imageryLayer===e)-1===i&&(i=o),s.freeResources(),++n;else if(-1!==i)break}-1!==i&&r.splice(i,n)}),c(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()},q.prototype._onLayerMoved=function(e,t,r){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()},q.prototype._onLayerShownOrHidden=function(e,t,r){r?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var ce,de,he;!function(){function e(e){return new V({geometryInstances:e,appearance:new U({translucent:!1,flat:!0}),asynchronous:!1})}var r,n,o=new m({geometry:t.fromDimensions({dimensions:new i(2,2,2)})}),a=new m({geometry:new E({radius:1})}),l=new b;ce=function(t,i){return t===r?n:(he(),r=t,l=b.fromRotationTranslation(t.halfAxes,t.center,l),o.modelMatrix=l,o.attributes.color=s.fromColor(i),n=e(o))},de=function(t,i){return t===r?n:(he(),r=t,l=b.fromTranslation(t.center,l),l=b.multiplyByUniformScale(l,t.radius,l),a.modelMatrix=l,a.attributes.color=s.fromColor(i),n=e(a))},he=function(){c(n)&&(n.destroy(),n=void 0,r=void 0)}}();var pe=new n(0,0,0,0);return q}),define("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,r,i,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 d(e,t){return e.indexOf(t)}function h(e,t,r){var i=e._layers;if(t=a.clamp(t,0,i.length-1),r=a.clamp(r,0,i.length-1),t!==r){var n=i[t];i[t]=i[r],i[r]=n,e._update(),e.layerMoved.raiseEvent(n,r,t)}}r(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,r){t(r)?this._layers.splice(r,0,e):(r=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,r)},c.prototype.addImageryProvider=function(e,t){var r=new u(e);return this.add(r,t),r},c.prototype.remove=function(t,r){r=e(r,!0);var i=this._layers.indexOf(t);return-1!==i&&(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(t,i),r&&t.destroy(),!0)},c.prototype.removeAll=function(t){t=e(t,!0);for(var r=this._layers,i=0,n=r.length;i<n;i++){var o=r[i];this.layerRemoved.raiseEvent(o,i),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return-1!==this.indexOf(e)},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=d(this._layers,e);h(this,t,t+1)},c.prototype.lower=function(e){var t=d(this._layers,e);h(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=d(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=d(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,r){var i=r.globe.pick(e,r);if(t(i)){for(var n,o=r.globe.ellipsoid.cartesianToCartographic(i),u=r.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var d=u[c];s.contains(d.rectangle,o)&&(n=d)}if(t(n)){for(var h=n.data.imagery,f=[],m=[],g=h.length-1;g>=0;--g){var _=h[g],v=_.readyImagery;if(t(v)){var y=v.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(v.rectangle,o)){var b=p;if(b.west=a.lerp(n.rectangle.west,n.rectangle.east,_.textureCoordinateRectangle.x-1/1024),b.east=a.lerp(n.rectangle.west,n.rectangle.east,_.textureCoordinateRectangle.z+1/1024),b.south=a.lerp(n.rectangle.south,n.rectangle.north,_.textureCoordinateRectangle.y-1/1024),b.north=a.lerp(n.rectangle.south,n.rectangle.north,_.textureCoordinateRectangle.w+1/1024),s.contains(b,o)){var C=y.pickFeatures(v.x,v.y,v.level,o.longitude,o.latitude);t(C)&&(f.push(C),m.push(v.imageryLayer))}}}}if(0!==f.length)return l.all(f,function(e){for(var r=[],i=0;i<e.length;++i){var n=e[i],a=m[i];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),r.push(l)}}return r})}}},c.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,r=0,i=t.length;r<i;++r)t[r].queueReprojectionCommands(e)},c.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,r=e.length;t<r;++t)e[t].cancelReprojections()},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),i(this)},c.prototype._update=function(){var e,r,i,n,o=!0,a=this._layers;for(i=0,n=a.length;i<n;++i)r=a[i],r._layerIndex=i,r.show?(r._isBaseLayer=o,o=!1):r._isBaseLayer=!1,r.show!==r._show&&(t(r._show)&&(t(e)||(e=[]),e.push(r)),r._show=r.show);if(t(e))for(i=0,n=e.length;i<n;++i)r=e[i],this.layerShownOrHidden.raiseEvent(r,r._layerIndex,r.show)},c}),define("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,r){"use strict";function i(t){this._ellipsoid=new r(t.ellipsoid,e.ZERO)}return t(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),i}),define("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,r,i,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._priorityFunction=void 0,this._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this._loadedCallbacks={},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),r=e.getNumberOfYTilesAtLevel(0),i=new Array(t*r),n=0,a=0;a<r;++a)for(var s=0;s<t;++s)i[n++]=new o({tilingScheme:e,x:s,y:a,level:0});return i},o.prototype._updateCustomData=function(t,r,n){var o,a,s,l=this.customData;if(e(r)&&e(n)){for(l=l.filter(function(e){return-1===n.indexOf(e)}),this._customData=l,s=this._rectangle,o=0;o<r.length;++o)a=r[o],i.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],i.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}),define("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 r(e,t){var r=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:r.replacementNext=i,t===e.tail?e.tail=r:i.replacementPrevious=r,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 i=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(i);){n=i!==this._lastBeforeStartOfFrame;var o=i.replacementPrevious;i.eligibleForUnloading&&(i.freeResources(),r(this,i)),i=o}},t.prototype.markTileRendered=function(t){var i=this.head;return i===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(i)?((e(t.replacementPrevious)||e(t.replacementNext))&&r(this,t),t.replacementPrevious=void 0,t.replacementNext=i,i.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),define("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/OrthographicFrustum","../Core/Ray","../Core/Rectangle","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,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,i=t.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new _,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=r(e.maximumScreenSpaceError,2),this.tileCacheSize=r(e.tileCacheSize,100),this._occluders=new p({ellipsoid:i}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function y(e){var t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,b(e);var r=e._levelZeroTiles;if(i(r))for(var n=0;n<r.length;++n){for(var o=r[n],a=o.customData,s=a.length,l=0;l<s;++l){var u=a[l];u.level=0,e._addHeightCallbacks.push(u)}r[n].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}function b(e){var t=e._debug;t.maxDepth=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}function C(e,t){var r=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;(r!==e._lastTileLoadQueueLength||e._tilesInvalidated)&&(t.afterRender.push(a.prototype.raiseEvent.bind(e._tileLoadProgressEvent,r)),e._lastTileLoadQueueLength=r);var i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(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))}function S(e,t){var r=d.center(e.rectangle,F),i=r.longitude-k.longitude,n=r.latitude-k.latitude;r=d.center(t.rectangle,F);var o=r.longitude-k.longitude,a=r.latitude-k.latitude;return i*i+n*n-(o*o+a*a)}function T(e,t){var r=e._debug;if(!r.suspendLodUpdate){e._tilesToRender.length=0;var n=e._tileProvider;if(!i(e._levelZeroTiles)){if(!n.ready)return;var o=n.tilingScheme;e._levelZeroTiles=f.createLevelZeroTiles(o)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var a,s=e._levelZeroTiles,l=s.length>1?e._occluders:void 0;k=t.camera.positionCartographic,s.sort(S);var u,c,d=e._addHeightCallbacks,p=e._removeHeightCallbacks,m=t.frameNumber;if(d.length>0||p.length>0){for(u=0,c=s.length;u<c;++u)a=s[u],a._updateCustomData(m,d,p);d.length=0,p.length=0}for(u=0,c=s.length;u<c;++u)a=s[u],e._tileReplacementQueue.markTileRendered(a),a.renderable?n.computeTileVisibility(a,t,l)!==h.NONE?w(e,t,a):(a.needsLoading&&e._tileLoadQueueLow.push(a),++r.tilesCulled):(a.needsLoading&&e._tileLoadQueueHigh.push(a),++r.tilesWaitingForChildren)}}function w(e,t,r){var i=e._debug;if(++i.tilesVisited,e._tileReplacementQueue.markTileRendered(r),r._updateCustomData(t.frameNumber),r.level>i.maxDepth&&(i.maxDepth=r.level),I(e,t,r)<e.maximumScreenSpaceError)return r.needsLoading&&e._tileLoadQueueMedium.push(r),void O(e,r);var n=r.southwestChild,o=r.southeastChild,a=r.northwestChild,s=r.northeastChild,l=n.renderable&&o.renderable&&a.renderable&&s.renderable,u=n.upsampledFromParent&&o.upsampledFromParent&&a.upsampledFromParent&&s.upsampledFromParent;l?u?(O(e,r),A(e,t.camera.positionCartographic,n,o,a,s),r.needsLoading&&e._tileLoadQueueMedium.push(r)):(x(e,n,o,a,s,t),r.needsLoading&&e._tileLoadQueueLow.push(r)):(A(e,t.camera.positionCartographic,n,o,a,s),O(e,r),r.needsLoading&&e._tileLoadQueueLow.push(r))}function A(e,t,r,i,n,o){t.longitude<r.east?t.latitude<r.north?(E(e,r),E(e,i),E(e,n),E(e,o)):(E(e,n),E(e,r),E(e,o),E(e,i)):t.latitude<r.north?(E(e,i),E(e,r),E(e,o),E(e,n)):(E(e,o),E(e,n),E(e,i),E(e,r))}function E(e,t){e._tileReplacementQueue.markTileRendered(t),t.needsLoading&&(t.renderable?e._tileLoadQueueLow.push(t):e._tileLoadQueueHigh.push(t))}function x(e,t,r,i,n,o){var a=o.camera.positionCartographic,s=e._tileProvider,l=e._occluders;a.longitude<t.rectangle.east?a.latitude<t.rectangle.north?(P(e,t,s,o,l),P(e,r,s,o,l),P(e,i,s,o,l),P(e,n,s,o,l)):(P(e,i,s,o,l),P(e,t,s,o,l),P(e,n,s,o,l),P(e,r,s,o,l)):a.latitude<t.rectangle.north?(P(e,r,s,o,l),P(e,t,s,o,l),P(e,n,s,o,l),P(e,i,s,o,l)):(P(e,n,s,o,l),P(e,i,s,o,l),P(e,r,s,o,l),P(e,t,s,o,l))}function P(e,t,r,i,n){r.computeTileVisibility(t,i,n)!==h.NONE?w(e,i,t):(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),t.needsLoading&&e._tileLoadQueueLow.push(t))}function I(e,t,r){if(t.mode===g.SCENE2D||t.camera.frustum instanceof u)return D(e,t,r);var i=e._tileProvider.getLevelMaximumGeometricError(r.level),n=r._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=i*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function D(e,t,r){var n=t.camera,o=n.frustum;i(o._offCenterFrustum)&&(o=o._offCenterFrustum);var a=t.context,s=a.drawingBufferWidth,u=a.drawingBufferHeight,c=e._tileProvider.getLevelMaximumGeometricError(r.level),d=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(s,u),h=c/d;return t.fog.enabled&&t.mode!==g.SCENE2D&&(h-=l.fog(r._distance,t.fog.density)*t.fog.sse),h}function O(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function M(e,t){var r=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,n=e._tileLoadQueueLow;if(0!==r.length||0!==i.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var o=s()+e._loadQueueTimeSlice,a=e._tileProvider;R(e,t,a,o,r),R(e,t,a,o,i),R(e,t,a,o,n)}}function R(e,t,r,i,n){for(var o=0,a=n.length;o<a&&s()<i;++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),r.loadTile(t,l)}}function L(n,o){for(var a=n._tileToUpdateHeights,l=n._tileProvider.terrainProvider,u=s(),c=n._updateHeightsTimeSlice,h=u+c,p=o.mode,f=o.mapProjection,m=f.ellipsoid;a.length>0;){var _,v=a[0],y=v.customData,b=y.length,C=!1;for(_=n._lastTileIndex;_<b;++_){var S=y[_];if(v.level>S.level){if(i(S.positionOnEllipsoidSurface)||(S.positionOnEllipsoidSurface=e.fromRadians(S.positionCartographic.longitude,S.positionCartographic.latitude,0,m)),p===g.SCENE3D){var T=m.geodeticSurfaceNormal(S.positionOnEllipsoidSurface,B.direction),w=m.getSurfaceNormalIntersectionWithZAxis(S.positionOnEllipsoidSurface,11500,B.origin);if(!i(w)){var A=Math.min(r(v.data.minimumHeight,0),-11500),E=e.multiplyByScalar(T,Math.abs(A)+1,V);e.subtract(S.positionOnEllipsoidSurface,E,B.origin)}}else t.clone(S.positionCartographic,U),U.height=-11500,f.project(U,V),e.fromElements(V.z,V.x,V.y,V),e.clone(V,B.origin),e.clone(e.UNIT_X,B.direction);var x=v.data.pick(B,p,f,!1,V);i(x)&&S.callback(x),S.level=v.level}else if(v.level===S.level){for(var P,I=v.children,D=I.length,O=0;O<D&&(P=I[O],!d.contains(P.rectangle,S.positionCartographic));++O);var M=l.getTileDataAvailable(P.x,P.y,P.level),R=v.parent;(i(M)&&!M||i(R)&&i(R.data)&&i(R.data.terrainData)&&!R.data.terrainData.isChildAvailable(R.x,R.y,P.x,P.y))&&S.removeFunc()}if(s()>=h){C=!0;break}}if(C){n._lastTileIndex=_;break}n._lastTileIndex=0,a.shift()}}function N(e,t){for(var r=e._tileProvider,i=e._tilesToRender,n=e._tileToUpdateHeights,o=0,a=i.length;o<a;++o){var s=i[o];r.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(){this._tilesInvalidated=!0},v.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;i(t);)t.state!==m.START&&e(t),t=t.replacementNext},v.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,r=0,i=t.length;r<i;++r)e(t[r])},v.prototype.updateHeight=function(e,t){var r=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){for(var e=r._addHeightCallbacks,t=e.length,n=0;n<t;++n)if(e[n]===i){e.splice(n,1);break}r._removeHeightCallbacks.push(i)},r._addHeightCallbacks.push(i),i.removeFunc},v.prototype.update=function(e){i(this._tileProvider.update)&&this._tileProvider.update(e)},v.prototype.beginFrame=function(e){e.passes.render&&(this._tileProvider.initialize(e),this._debug.suspendLodUpdate||(b(this),this._tileReplacementQueue.markStartOfRenderFrame()))},v.prototype.render=function(e){var t=e.passes,r=this._tileProvider;t.render&&(r.beginUpdate(e),T(this,e),N(this,e),r.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&r.updateForPick(e)},v.prototype.endFrame=function(e){e.passes.render&&e.mode!==g.MORPHING&&(this._tilesInvalidated&&y(this),M(this,e),L(this,e),C(this,e),this._tilesInvalidated=!1)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var k,F=new t,B=new c,U=new t,V=new e;return v}),define("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/Ray","../Core/Rectangle","../Core/Resource","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./Material","./QuadtreePrimitive","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P){"use strict";function I(e){e=n(e,u.WGS84);var r=new c({ellipsoid:e}),i=new w;this._ellipsoid=e,this._imageryLayerCollection=i,this._surfaceShaderSet=new S,this._material=void 0,this._surface=new E({tileProvider:new T({terrainProvider:r,imageryLayers:i,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=r,this._terrainProviderChanged=new d,D(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new m({url:t("Assets/Textures/waterNormalsSmall.jpg")}),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 D(e){var t=[],r=o(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),i=[];!o(e._material)||r&&!e._terrainProvider.requestVertexNormals?e._surface._tileProvider.uniformMap=void 0:(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.uniformMap=e._material._uniforms),i.push(v),e._surfaceShaderSet.baseVertexShaderSource=new g({sources:[b,y],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new g({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function O(t){return function(r,i){return e.distanceSquaredTo(r.pickBoundingSphere,t)-e.distanceSquaredTo(i.pickBoundingSphere,t)}}function M(e,t){return f.contains(e.rectangle,t)?e:void 0}a(I.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tileLoadedEvent:{get:function(){return this._surface.tileProvider.tileLoadedEvent}},tilesLoaded:{get:function(){return!o(this._surface)||this._surface.tileProvider.ready&&0===this._surface._tileLoadQueueHigh.length&&0===this._surface._tileLoadQueueMedium.length&&0===this._surface._tileLoadQueueLow.length}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),o(this._material)&&D(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,D(this))}}});var R=[],L={start:0,stop:0};I.prototype.pick=function(t,i,n){var a=i.mode,s=i.mapProjection,l=R;l.length=0;var u,c,d=this._surface._tilesToRender,p=d.length;for(c=0;c<p;++c){u=d[c];var f=u.data;if(o(f)){var m=f.pickBoundingSphere;a!==x.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,f.minimumHeight,f.maximumHeight,m),r.fromElements(m.center.z,m.center.x,m.center.y,m.center)):e.clone(f.boundingSphere3D,m);var g=h.raySphere(t,m,L);o(g)&&l.push(f)}}l.sort(O(t.origin));var _;for(p=l.length,c=0;c<p&&(_=l[c].pick(t,i.mode,i.mapProjection,!0,n),!o(_));++c);return _};var N=new r,k=new r,F=new i,B=new p;return I.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var i,a,s=t.length;for(a=0;a<s&&(i=t[a],!f.contains(i.rectangle,e));++a);if(o(i)&&f.contains(i.rectangle,e)){for(;i.renderable;)i=M(i.southwestChild,e)||M(i.southeastChild,e)||M(i.northwestChild,e)||i.northeastChild;for(;o(i)&&(!o(i.data)||!o(i.data.pickTerrain));)i=i.parent;if(o(i)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=r.fromRadians(e.longitude,e.latitude,0,l,N),c=B,d=l.geodeticSurfaceNormal(u,c.direction),h=l.getSurfaceNormalIntersectionWithZAxis(u,11500,c.origin);if(!o(h)){var p=Math.min(n(i.data.minimumHeight,0),-11500),m=r.multiplyByScalar(d,Math.abs(p)+1,k);r.subtract(u,m,c.origin)}var g=i.data.pick(c,void 0,void 0,!1,k);if(o(g))return l.cartesianToCartographic(g,F).height}}}},I.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)},I.prototype.beginFrame=function(e){var t=this._surface,r=t.tileProvider,i=this.terrainProvider,n=this.showWaterEffect&&i.ready&&i.hasWaterMask;if(n&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;var a=this._oceanNormalMapResource,s=a.url;if(o(s)){var l=this;C(a.fetchImage(),function(t){s===l._oceanNormalMapResource.url&&(l._oceanNormalMap=l._oceanNormalMap&&l._oceanNormalMap.destroy(),l._oceanNormalMap=new _({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var u=e.passes,c=e.mode;u.render&&(c===x.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,r.terrainProvider=this.terrainProvider,r.lightingFadeOutDistance=this.lightingFadeOutDistance,r.lightingFadeInDistance=this.lightingFadeInDistance,r.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,r.hasWaterMask=n,r.oceanNormalMap=this._oceanNormalMap,r.enableLighting=this.enableLighting,r.shadows=this.shadows,t.beginFrame(e))},I.prototype.render=function(e){if(this.show){o(this._material)&&this._material.update(e.context);var t=this._surface,r=e.passes;r.render&&t.render(e),r.pick&&t.render(e)}},I.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},I.prototype.isDestroyed=function(){return!1},I.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)},I}),define("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"}),define("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,r,i,n,o,a,s,l,u,c){"use strict";function d(){
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._useScissorTest=!1,this._scissorRectangle=void 0,this._debugGlobeDepthViewportCommand=void 0}function h(e,t,i){if(!r(e._debugGlobeDepthViewportCommand)){e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand("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",{uniformMap:{u_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,i)}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 f(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function m(e,t,r,i){e._colorTexture=new u({context:t,width:r,height:i,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE}),e._depthStencilTexture=new u({context:t,width:r,height:i,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}),e._globeDepthTexture=new u({context:t,width:r,height:i,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE})}function g(e,t){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 _(e,t,i,n){var o=e._colorTexture,a=!r(o)||o.width!==i||o.height!==n;r(e.framebuffer)&&!a||(p(e),f(e),m(e,t,i,n),g(e,t))}function v(i,n,a,s,u){i._viewport.width=a,i._viewport.height=s;var d=!e.equals(i._viewport,u.viewport),h=d!==i._useScissorTest;if(i._useScissorTest=d,e.equals(i._scissorRectangle,u.viewport)||(i._scissorRectangle=e.clone(u.viewport,i._scissorRectangle),h=!0),r(i._rs)&&e.equals(i._viewport,i._rs.viewport)&&!h||(i._rs=l.fromCache({viewport:i._viewport,scissorTest:{enabled:i._useScissorTest,rectangle:i._scissorRectangle}})),!r(i._copyDepthCommand)){i._copyDepthCommand=n.createViewportQuadCommand("uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n",{uniformMap:{u_texture:function(){return i._depthStencilTexture}},owner:i})}i._copyDepthCommand.framebuffer=i._copyDepthFramebuffer,r(i._copyColorCommand)||(i._copyColorCommand=n.createViewportQuadCommand(c,{uniformMap:{u_texture:function(){return i._colorTexture}},owner:i})),i._copyDepthCommand.renderState=i._rs,i._copyColorCommand.renderState=i._rs,r(i._clearColorCommand)||(i._clearColorCommand=new o({color:new t(0,0,0,0),stencil:0,owner:i})),i._clearColorCommand.framebuffer=i.framebuffer}return d.prototype.executeDebugGlobeDepth=function(e,t){h(this,e,t)},d.prototype.update=function(e,t){var r=e.drawingBufferWidth,i=e.drawingBufferHeight;_(this,e,r,i),v(this,e,r,i,t),e.uniformState.globeDepthTexture=void 0},d.prototype.executeCopyDepth=function(e,t){r(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},d.prototype.executeCopyColor=function(e,t){r(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},d.prototype.clear=function(e,i,n){var o=this._clearColorCommand;r(o)&&(t.clone(n,o.color),o.execute(e,i))},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){p(this),f(this),r(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),r(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return r(e)&&(e.shaderProgram=e.shaderProgram.destroy()),i(this)},d}),define("Scene/GoogleEarthEnterpriseImageryProvider",["../Core/Credit","../Core/decodeGoogleEarthEnterpriseData","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/GoogleEarthEnterpriseMetadata","../Core/loadImageFromTypedArray","../Core/Math","../Core/Rectangle","../Core/Request","../Core/Resource","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/protobuf-minimal","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v){"use strict";function y(){this._image=new Image}function b(t){t=r(t,r.EMPTY_OBJECT),i(t.proxy)&&o("GoogleEarthEnterpriseImageryProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var n;if(i(t.metadata))n=t.metadata;else{var a=f.createIfNeeded(t.url,{proxy:t.proxy});n=new u(a)}this._metadata=n,this._tileDiscardPolicy=t.tileDiscardPolicy,this._tilingScheme=new l({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new h(-d.PI,-d.PI,d.PI,d.PI),ellipsoid:t.ellipsoid});var c=t.credit;"string"==typeof c&&(c=new e({text:c})),this._credit=c,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,i(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new y),this._errorEvent=new s,this._ready=!1;var p,_=this;this._readyPromise=n.readyPromise.then(function(e){if(!n.imageryPresent){var t=new m("The server "+n.url+" doesn't have imagery");return p=g.handleError(p,_,_._errorEvent,t.message,void 0,void 0,void 0,t),v.reject(t)}return g.handleSuccess(p),_._ready=e,e}).otherwise(function(e){return p=g.handleError(p,_,_._errorEvent,e.message,void 0,void 0,void 0,e),v.reject(e)})}function C(e,t,r,n,o,a){var s=u.tileXYToQuadKey(r,n,o),l=t.imageryVersion;return l=i(l)&&l>0?l:1,e._metadata.resource.getDerivedResource({url:"flatfile?f1-0"+s+"-i."+l.toString(),request:a})}function S(e){var t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";var r="PNG";return e[1]===r.charCodeAt(0)&&e[2]===r.charCodeAt(1)&&e[3]===r.charCodeAt(2)?"image/png":void 0}function T(e){for(var t=_.Reader.create(e),r=t.len,n={};t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.imageType=t.uint32();break;case 2:n.imageData=t.bytes();break;case 3:n.alphaType=t.uint32();break;case 4:n.imageAlpha=t.bytes();break;case 5:var a=n.copyrightIds;if(i(a)||(a=n.copyrightIds=[]),2==(7&o))for(var s=t.uint32()+t.pos;t.pos<s;)a.push(t.uint32());else a.push(t.uint32());break;default:t.skipType(7&o)}}var l=n.imageType;if(i(l))switch(l){case 0:n.imageType="image/jpeg";break;case 4:n.imageType="image/png";break;default:throw new m("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}var u=n.alphaType;return i(u)&&0!==u&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete n.alphaType,delete n.imageAlpha),n}return y.prototype.isReady=function(){return!0},y.prototype.shouldDiscardImage=function(e){return e===this._image},n(b.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.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._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}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}}),b.prototype.getTileCredits=function(e,t,r){var n=this._metadata,o=n.getTileInformation(e,t,r);if(i(o)){var a=n.providers[o.imageryProvider];if(i(a))return[a]}},b.prototype.requestImage=function(e,r,n,o){var a=this._tileDiscardPolicy._image,s=this._metadata,l=u.tileXYToQuadKey(e,r,n),d=s.getTileInformation(e,r,n);if(!i(d)){if(s.isValid(l)){var h=new p({throttle:o.throttle,throttleByServer:o.throttleByServer,type:o.type,priorityFunction:o.priorityFunction});return void s.populateSubtree(e,r,n,h)}return a}if(!d.hasImagery())return a;var f=C(this,d,e,r,n,o).fetchArrayBuffer();return i(f)?f.then(function(e){t(s.key,e);var r,n=new Uint8Array(e),o=s.protoImagery;if(i(o)&&o||(r=S(n)),!i(r)&&(!i(o)||o)){var l=T(n);r=l.imageType,n=l.imageData}return i(r)&&i(n)?c(n,r):a}):void 0},b.prototype.pickFeatures=function(e,t,r,i,n){},b}),define("Scene/GoogleEarthEnterpriseMapsProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/Rectangle","../Core/Resource","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(i){function o(e){var t;try{t=JSON.parse(e)}catch(r){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===S._channel){n=t.layers[o];break}var a;if(!r(n))throw a="Could not find layer with channel (id) of "+S._channel+".",b=d.handleError(b,S,S._errorEvent,a,void 0,void 0,void 0,g),new c(a);if(!r(n.version))throw a="Could not find a version in channel (id) "+S._channel+".",b=d.handleError(b,S,S._errorEvent,a,void 0,void 0,void 0,g),new c(a);if(S._version=n.version,r(t.projection)&&"flat"===t.projection)S._tilingScheme=new s({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:i.ellipsoid});else{if(r(t.projection)&&"mercator"!==t.projection)throw a="Unsupported projection "+t.projection+".",b=d.handleError(b,S,S._errorEvent,a,void 0,void 0,void 0,g),new c(a);S._tilingScheme=new h({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:i.ellipsoid})}S._ready=!0,S._readyPromise.resolve(!0),d.handleSuccess(b)}function f(e){var t="An error occurred while accessing "+C.url+".";b=d.handleError(b,S,S._errorEvent,t,void 0,void 0,void 0,g),S._readyPromise.reject(new c(t))}function g(){var e=C.fetchText();p(e,o,f)}i=t(i,{}),r(i.proxy)&&n("GoogleEarthEnterpriseMapsProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var _=i.url,v=t(i.path,"/default_map"),y=u.createIfNeeded(_,{proxy:i.proxy}).getDerivedResource({url:"/"===v[0]?v.substring(1):v});y.appendForwardSlash(),this._resource=y,this._url=_,this._path=v,this._tileDiscardPolicy=i.tileDiscardPolicy,this._channel=i.channel,this._requestType="ImageryMaps",this._credit=new e({text:"Google Imagery",imageUrl:m._logoData,link:"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=i.maximumLevel,this._errorEvent=new a,this._ready=!1,this._readyPromise=p.defer();var b,C=y.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),S=this;g()}return i(m.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.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,r){},m.prototype.requestImage=function(e,t,r,i){var n=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:r+1}});return f.loadImage(this,n)},m.prototype.pickFeatures=function(e,t,r,i,n){},m._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAnCAYAAACmP2LfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAHdElNRQfcDB4TJDr1mp5kAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMDD0cqEAAB1zSURBVHhe7ZwHeFTFFsf/u+l9N70npOxuSAKEFFIhCSH0qhEQUHkgKCgWUFGBB6IoCAoo0ntooaRvEkIIBBBpoYSa3nvvfd+5u4sQUigPfMX8v2/Y3Tkzs3fv/d0z58zcgF69Ql1SY+MM1wQJem44ZeiJk8beEOqPwG6uC7ZqyElb9eo/JZEIkH2nRQkBIlNMauuPCS3uGN/kjkmNDghoskBAgzrZ2NLmf1+JwIKQpYsoxdmIV9+N07onCegzBPM9bOdmYKnazF6g/1N6UySPqSJzvCaaiLHtP8G/Phq+FRfgU5ogKWUXMLT6Mvzqr2BE40mMadqO8c3zMabBC6PqDDC8SlY60t9HByCLVTKu+ERmHr5TWI9wjVxEaOZivWo1pil8D1tZeWnLXv1l8iZ3PF2kjymiWRgvCoJv5U243IyAXcQq8A9Mg9W+4bDe6wv+kVGwCZkL+4Sf4ZR+BZ5VGQR3EkbWn8Hopm3wq54Lz2JD6ah/P21XGopQ9Qoc16jGSqVyTJWbQbUsibFXf42mihTwZpsvAtp3k0dOhFOSEH1+ngaDefrgjFCgFkxY8fCisCBvKgODzxRh9qslBFGfYmDGLbiV5mBwRRo8KtPhVBgPu8teMP7u73chD6kMRYRGBY5xqrFKqQwz5SdTbS/Qf5mmUYw8rf01CjHC4VP7AHZxO6E3qy9ZZCQNnio2rE/4o9/tkxiQUYp+KRXgx8XC5FsXcLz/hkCrDUU4pxLHuDVYpdwL9F+qqSJZKlPwenskfOoI5tN7YPCJGVme7wKYr5EBXzgYfW+mwTI0Gjrznaj2WW+I/y8dVPdDGLcKRzXrsEqlHO8oTKHaXqAZWe9hQXCi63NhHWYI3ilfWIW/YLjqL2JRiOFBJRz+LffhcPs09D+0J8vzn3zXdBnYnp8Mi6NboTWzH9X8fVc+DhDQodxqAroe36lU9AJNWr4cEAjNwI8OAC9cT1rbUfzwGeCfKiL7dGnNc+q1NiO80b4BY1oT4V6WDcsdc6j2xbyq4wMWrA9rQmeWFn36ey/jBaoPQ4hmLYI0G/AtAf22fC/QDols8ITrIYi/Bl6knbS2o3gRbxHQxQQ0k0S/gCa2v4OJovPwacqAQ1ICjL40klr+UrWoQbFBETo18jCpZsOoFODkvuCNJYoHW3QKXFEM7ETRcKfiQe8d6NVIFImXvg4skhY40mxnQYVRIIeA1qrHEc1GrFSpxFtP99AiFbDbNKDZpAzzGkVYVcvBuBJQEo/9/6C+dyjPitwLwak74D8V6Bfw0P5VShjXFoTR7TfhUZkL29M/wfATJan1lauWC3aDOgyaVDCuTgbf1bFkfmtkye1ogsK2asivLYfCglIoD8qCknI2NHuG4QSVGMgQyMbt0fioRYh9VYcRU7QX55uDcaHtFOJEsThMtmWtQgxsDodsWaC0c3ea3MzGBJEqxrfbYmzr6xjfPAeTmt5HQPO7eK1xDibUz8eY+k8xtHYJPCtXwvHOu7AXMrMTsF/TH8HajTis1YwVqpWY0TXQDKy1OpBr5EJA52Fukxx+bmKxtjWx2DuaWawNlZD5qhzyo9KhpHAbKpJO/6t65UCPbPHA2PYrGNacgkElabCJJDev/MpDhUKKnuq44LRoYEK1IiswkS1zYCfk5y+F0qjvoTwqBOof34dGeAnUL1ZCLboEnJ9zoe0QD/Nuj00UBVXRabzVLETM3S0ICfwA8yc7Y6C3ANYbZsA7aQ1W1xzEfZEQ6dT2BkG9pP4ouo7jGE1u42JS20QMrzkCr4xwuN4+AM+cYII3EaNar2J86zmMrP8DHulCON4NhU3YWuhOYy6SZENpH9cfx7WacFC7BSvUqjBDsRPQIiugURvazeqYVaqAw6dYrJ9WQy7gayj4nYDy3HtQOVQGpYRqKEWXQf2HdGha/AFdae9Xr4czz0ubISRA75ECbSut7agegO75OLxpahze8j5GtifBpzEDLiV30Dd2mNT6StWiCbVmLt5rUkBQCEt2zWzIMSA8HgrIBkLD+Sp0jhHISYXQ/KMYukfvQ3fQxq68XCTBHId/tMTg7LV1CFs4BszJ6hBarBgHlcRv8H7tbuSKQpFPYGe0BmND+nZ0npECaPKf0r4UIxsuoF/IMpitsAVnrA4s15uh3x8fwLXkLobUZGJIXTqcUzbDaJE5FAVq0t4S7dEcjqMEc6B2K5arVWN6Z6AbdOmm5mJelQKOHWSxF44Cy4CqxW0s6RwchCovFRohdGNfLgX3WiZ0N4aD++y7jfwYJUrAPCle/ZjKV+BFTSegrGAZIm3QjXhBytTWB3zhByzryMUU986jz16wD+96ijCNUIAgmkc3tS6G7GERjCbgR82B4OTbEESqIiCIcqsIYzoGGyrBEMSmgh8xBoIIAR2fAHZhj8Z9DOhl9FHeKkSDvn809fuc+iyCddRYaiOZBTvIt1YJfs0b4N+WDO+GHPLQN2Ab7S61vjJV60C9SRPvNSqzTpxlyQfS1dGUmjppK7gW16B/LhN6abnQu5cDwzO3YNhhqqK4WJY887sEdGzWFpxfOxmDpKZOOvgWFB8sx9L6nShvP4FyUQjKGg5gScpGKEqbUE7RxiGYv6QQ4zIG/r4D2m88sjEy/EIW/a6+TQ4gHe5VhXCvy4JL7gLYnesI2i6t4Tii04r92u1YKt767gB0ozrkGzmY26zEOh7Hkt+kAKhLTX9qOVVdg9aoNOjcToR+wUVKLYKgN0Zq7l7884wn9CKgr4AfWw/B6SwqKQRKOdXVghe9CpbherASSjtIpGpxRIHFjwygNreoXy0lb+lU7lHJBP9kPcGXQnBNghUB/Lh44fbUp5JA+5Hs71LbPPLCVRDEJZDNGIJgeQI6mG6KegKzldq1U7tGKjQmHR8vwl86kgRoAQN0xBw6ztn0nQ/ocxEdQ7L4d/BjG6g+m8aZTL/xsXPuW82Fb8t+DG1Ox5D6XAwqvQ67OA+p9ZWoUQPsei78mjSwNU9GLmEzVGZJTd3qFPTn3YZhXgYMMjNhlHsDxms/hNWfoUdrNPgEc2h7BG5d/Bo7Blt0BuNxXf4MVmXrkdRyEHWiY6hr2oc7mevRX2wc18gioEeI1+N9a+/CNnImVAZ0mhEoNOPAJT8MHjUF8KTiWhqHgbfMpVaJdhLQh3XasU9bJAZ6ekeg6zQwgEKuLSWysmd3QGmatLqD8qDNug3dCX/AIPk4jGr2wDB/JXTmkan70IvmZTY/rB9BdZlKLkG0lG0d5klAObKsw1+jzyFiWPnRawiaDrMYwTyMwMwh220WP2IWFVfqN4CKO8E3n0C6R/ZUej9Y2kUiMdDRFTRePH3nA3q/m7xpAEtAXl0QrkTwscnmS/3eptdzNEYevZLnZ5booqk8tuYs9tAny+n1LL1mghezlcULH0VtHamOZhvhIvoNOXQsd2EZIbluYnlWaMO75TCFG9kYXJ8H14o76H/10Z3yClSrCm6jGtbWK7LC7kIlYRfUmY2XHnUa+mbXYRSfCuNCptyE6b1jMBD/EPKwchQPLxGdxOWWI8iKXYBPqLozgI8pfA5YBWvxbfMeNLUfRmPTLjRnr8YKsdGvRQ5j2zZTSSRQ78H+7GhxfScFAINypsG9ukDspZ0LKKE+O0pqlGi71ggcIqD3dga6RhFKjSqYT+VEFkvu/E9Q+HNWKaE2VVDgVkPFqwAaay5CN3En9M59BM2vfKDs7AvljjPGE5LlharQdL+LoCmhOHU0rIUyD+NgVTOa+q2iVQiIcAKpHtbhXuJOjPqeVCRYThNE6VTvKNs3hM3cHGIxntxKyCbP7Erj1lHZJbVIJAG6iiCroZCAPGukvOyASJbvCgoaAoKoAQ1kHcGC7nmZDkmhBR2PfSQLtkcl4zCSAE2eO6qExYuYxrE4KqdvelBiM4+ncYQy1IY8d0wbhUSLJAZGbsUceNYdwJCGPAyuy4NbZToG3JoO1Qk9AvHvqF4ejo0KCKlisyl04Jw+AE1ma71HRUJP+QqM1t2HcVEyTEoSYVYQCuN3HenCt4XDhGA+KorAnYZ9KIj5ELOl3XpU/k/wrt+OmraDaG7cjpacbxFvYAAZDG5Vw/DWCxjRdp+ATsWAS6+D69H1+XDNsoVb1T06b0VwzCmBIOYdqUWibTojcFBH1CXQctBtUcA6Oh/RmVC4sBmKA5j6erC1qqE4sRpqG25A43QIOHuXgvOmP5R4ZH6m5UY2L9SSLjZ5sKjjsI/o8olH8ngjCZoSgmw9DMIl3t42Up0g+pq89/sEjLK47knZhSkSuDepJP4JOyNJyEFAR8VQKMOR1nbWM69yxNJYwh+VLE90ffPyxLE3EwL9Jq0huWQqwL1iA7zq8+FVl0+epgBO6T+gb2TH+OglqgastxtZrNNlkLt8E5oJx6HZdab7mFZBk3UZRjMewCT7HkzLfodZxREYr5sBjiIBPYiAPt8ehvSGPSg5vwjzpd16VNkmmDTswp22QDTXbkJrxhJkzHGDFoUQmvBpvo2hrZl0TnLhlLIYfUO7nt7dSg3hURcP1/JiDEgphuXBqVKLRFsfA3oJAf3mI6Cr2OjTwGYdqWGzzmZD6WoYVCfehdqsZKjuuwS1oB1Q+5piHac3oaxBzZ9vLZ4nHEeesoXg6niDPSYWP9yUgD5PHu48eKE64krHcErchHIEuRysTpAXjObQWIYEHiV4EQYEojp5aEoyY+IIpOQugKYYOnIdJXrdJ63PtWwXMQM6m6SVT4gfZkbHV0XHsVtaQ3K8yoJr0YfwoHDDq5ZiQSqDik/B4Q9taYtn18gyNia1qGJsmTrGlUjK2FJ1jCjRwOASDnkxDvN95ZD/og5yl0qgfCMJ2leDoeksHaFHXYOJVyrMkm/DrPwMzGr2wmjnLGipthyHL0W7t9pDkduwF2U3lmGFtvbTdyirt0OreT+iWwPRUrUBbSkLkT/fCUZwKVYikBMwpDlPXNzLwuAQ2rWX8KzUh2dDDJyLSmB7/S5Mf3WRWiR6CPSezkCXQs6qBnLCKsheyoXqnTCoL9oOFd9/Qtl9KJT6UJMX3/zhCz8iuCjhiviSYtMx3ZTJBN8lCE7eIRgF0p6krRRaRBDskTTGySBKws5SuUjJHYUiMQdpzCUE0Q3y5MnSDhJJQg5JUvjSgO5hHZofaioGmvc40IycMgbRtJktjgOZ5Ma9irzSg46xYHcaVEZevkgBHqUWGFK+FENKQ+BdGAq/wiMYWbwHI6h4FwTDOes0BMKFMHxPNg9qn1dANakYanfuQSs5FJoTpaP1qBswsSGgb9+EeUU0Af0LDH4dBhXlmv3wajuOpPYQFDcEojxtNQ6sn9ZzUsiofjfUWg/iYOt+tJatRtvN95DqZgxNuKTKwLV4Jdyqc8Wz1uCGTLjmDIVDQqewQ8anwpJi6GsYkF4Ey2O/QvsfXKlJIgboAwT07s5AZ0G1TylUIsuhdKMI6vcuQ3PVAqg+9UZ8JvGEywiuNoIwD4IzaV2X+HSa1otgE3+NwJImVkycG0kx8snfyUZJW+QFApeSu+hN9BpIn6n+ZBp9bqDv+C8Fum+8IpzzJNOmR3UhTaGFcC07iAHXmamuZw28C/S/aIt+CcthF7+ToN0EQdhqOFzcBu/Sm/ApvAGX3DzYXIiF9jtWTJf74L6ZC83UfGg8SId2xnloSZKxp+gWjC0J6KSrMK8KhmnlSugtInpkCzaBV78Hl5oPoaLpECrLt+Bi4jfgS7t1q+YDUGsPwj5KDFsLlqD97JuIpmpZmP+TftM1ezjlxsOllM4H3eReDWHwKrOBW84jqMeK5OBTv4Bu6HxxgqU1s/N3MkAHSoH+ioCe+gjoJHB0s8ENLID6/UJo3E+GVlwoNEwY278tXhR50RhmeexzgmM8JXjdF36MHwEoiXn70Csv6gxBm8PiRc6gJFD1HDzFpq1cP0omo5QJZAfqQzH0f6uHZjQgeR4cC/IJZCnUtSkYVPAWBiX2/CdU/S7Ql+9TgtFCTaiP0qAEXA2yRsqwuzECziWZcM4tgv2DSljF7ID+l+JNh9+hY38HuvcYmLOhk5EEnVPfQOmpW+33YGaXhj53E2BWuxvGebOh5cPUX/sWSgXrsa9mB2qaDqCK4C7I2IA3jn8u7tat2g6D034MIbWb0fZgHlr2DscXUhNNuYdkYRPrg/7JiXDMLYBrZS6GNEZgVJM/JjWY4I16G4xr/BCDq2nKjjoAvY+Zpwo7eXBskQK9Swr0lEdAn4a2wk3o/DMNWmn54KYUQIuZsebGQuXFQ42H4kfNk4QckSOkNZ1lGkGAUoInOKkAm2jJsVtH+om9Nj9ytZxNcNdhljXByo+JJXj/i4G2u2xM02YInPJLxFB7VudTPH0ZHkWu0hbPpwHpfnAszoFDVgVsb1fDMmoL9L8S7wTFQE/1AvR33oB+QSp0czKgl34B2iO9uwJCKib5SGaZjbqLPlkhMG1YDr1gQyioSs24vQTDitagsnIL6loCUVu9C2EJK9FjYtsWBNP2Q7hb9A155zdwY5mTeGexo0w32hEcy2F7JQaOqZfgk38KY6rDMKFBiGHNt+iGPgCNYd0/s/sbAb2fgN5JQC9Wq8bkR0AzioOOx3Xo30mGbnY+tNMKoJOQCm03qfnFxRf6E1yUFAqZJcyuZRWuQmB+TWHJcgJfkjPxImcSSIUsXviMx/O9DvqfALrPDjb6nhuBAWkZ5JFKKTYuIqhz4FUdAo9CGwzO7Ra2LjUg0w9OxdlwyKxAXzHQm8lDi4HeAT1WMPSHnYXR7aswKE6Gfl4K9PdfgZ6+uG8XSmMbKyXD/LsEmFduglH2NHA7rA3Hvg+Ve1/gYO4KNFRvQUPLQVRU7MG4yn1dJ4eiULAo3JhW9xsa77+Hml8GY8FQ425uAM5wRRivNoPlTjs4XhoH35oLGFZ/S/wglyDkbWmrrsUAvY+A3kHlSwJ6ihKzCvLnuQyElmIs9LdfhmHxA+jn5kI3jcrRFOjxU6DTbTx9DybsOBh0f034EeYEVyaFD0IYhnQ9y1pTIsiPvU5AnKYkUBL78yKmQhDLgDRPSWtPp/HFkFtHqFCfRBr73wX67qsD+qFsEubCnqKBAZllcCkkT12RjSHVMfApH0bJXfcH+aQGZg6FU1EWeeoK2NwgoMM3Q++zP/fq/Smf2g392ZEwzk2Acfl9GBHURmuSYPyn132oHBizH8B8wjX0SadQI2cWtOZZQbHTdEgRn8XN93EiczFayn5GU3Mg7lJMPab5SEeoCWZZ0TF4Ne/A/ZSPUbXdDz9Qdddrrk/KtcwR7jX34VXDzGCFGFT0GzyLu922x069kdiv145tOu34jlOHBWoz4arUAZQt0LYOhmFcHJ2H6zAsYnZDc2FwKhv60+m9UQrLUJ4hSYQAVhpM1O6jj30EDD33Q6frZyoY8cMVaWZZR560kuB5V9H6iVUas+Py5L1/IHsT2ZldR4nEkMdkUd8Y8tYd43mLIMhYhenDWvgjQSQiGFOkiEv0rEAzK2u8yG10M2WwBWFdb6q9NKDNd6rCOuYD9L2VI/57QMfcEniU5cCnJgG+lR9haAnz4MzT5ZjmA4e8HBqnGtYXamF+nK7bpx0uwHxoqGyE3sKD5HHjYVJ1C6Z5qTD5Ph2G1hnQEV/0LBhxU2E+4yYsbgTCJGsuNBfYQrnjA0CPxDo2CRYJ0xGesgD1ZWvQ3LQbKeSJ54uC0UcUDVVRGExFR/FB2y7cSf4C+Zv9sXSUeQ9P2z2pQdnmBHQsPKqKqFCyWJsM75o1GMw8O/iEhFZs/KK9CD9wRfhCTYTP1dqwnBOHrQYz8IuuH5ZxxI/MLQZH5kfoeu6D4cVQGNecgXHFbRgXZsD4Xg5MjqfDeE0KTBbRDLXsLiwOR8HkxCJoOs+Eavdr08ZBBGdYP7rYzAZILsH3LYUYtgSsAXlYRwLqW0r8Ksl2id4/Onaz47IE+kayUfwddYhsgwkqXRrLgOpHEuyhVF9B7ytoTAL//qNjeFagGfGEi5nvYPEifqOx/ek4p1J/8aKBWC8N6Icy2+oL6zOhECTmw46SuoHZpXBn/pK7/DK8K1bCp3Q0vAv7wqfIBD55OuS9teFVYASPfAFccseThw+E4Ho5LOMqYB6ZCeOdK6H1bleJH2sOOPZradqlC3otDqY5F2GafQmmCZdgFnMBZteEML2yCnprh0CZWVp66gbDuD5Q2uSLUacm43jSB0gq+h55JeuRX7wRqUUbkJL8DS4GTcPqCdZgduZ6XiZjgvcp9fIY3aAH/yY+3KvcMDBjLSXQBXDML4VbaQG8a9PgUxcOzyIneKY/Or6FHDO8q7INY+RiMFJaJijE4i2VeEylej/FDs99TAPH8Dvofv8bDK/vhVHxMRhX0W+vOgXTijiY5UXANGkNnYeRUGN2VrsPNx6XVaQNgRNM03sBgUjeOKJJ/Cr+LNzFsg61YB5/elyKtic0qM031CaZAG0gqJnVEuYBIoI49gy9D6DXrQR3GoU2j3YE+WE2FI9TGBG1FLywnhNbPt1Y/OhY+o5iGqsGNmdLaVxfqZUB+g0Iztwi2AOkNZ3FCzOm30bHeHK9tKYHKfPZMFhlAtM9c2EpjALv93zY3qlE/8xyOOUVUTiSBrfy83CvDIdbRZC4uJSGwzHzd0qgkmEVfRnGW/dC79vPobtkFLRmm0HDpVt43MnrzoOm/dfQeeOf0P3wB+guJogXrIDuhHfAsdOFbKdQ5GkaYQbNNYNht2c8/AOnYNKB6Ri//Q14zRwIuohdPC76pCbWKGFCkx9GNC7B0NZD8CiJh8Odi7A59zud7EuwvU4hVUYZBhUXwqsqA56V0RiUM1Dam36UoiyFuprQhc6fRZuKKhV5+rcLKD2hrPQ+NPsvgNb0j6C9eCG0v/kU2l9/BK0ZM8EdRJQ833noG8Qib6lDkA0lYD6i8GIJlffZ/IhhbJtQjW4TP164EiWWztTnH9T+a4L/MxpjAn02hWWYDAQnefSZzm7Io7zDOpiSzGh3grwPwd3zDccPZdH4phBEkXcWBrD4wlE07qObw5pmBUGsK43T/YPfgmAFWEe5U2EeCXhGcV5nQ3u2KrTf6w+jdTNhtud7mB/ZC4vg43QAwbAMDYLF0e3os+8HGP80D7oLx0F9dD+oj9AGZ4Y85K0Yj/Vs3kQiFgeybFPIySiDzdwAz9O3JzHjPNtYk8gjv948FOOatlGodR0Dk07Bau9n0F8wFBp+luBO1CXeuDD51Q3830PRP7UIzgUlcC0vhHPRSdic6eI53ecT3W0sKyjI2EFRxhzyz3sOO8voBkEUTclYhAyshCwr642PR79diwlbBOEs8vLMFjgbbuelhpeoz5rEDxsNNl/+9ON5RWJOLsXCysQdh5IhWWbzhUmoel6v/l/RxGpZTKgbh3EtEZQMp5AX2ASd2f3AVu7695ky/7nOuc2U/BZSCFIGp+I82F/rfprsVa/+Mk0sZ2F0tTvGNZ+gRO8B7C/HQ92beWine+/IDWDBbJUmbBN/hUNOGRyyStH34vfQeP3ZV4R61atXIu9Kefg1rIB/XRJciwso9nymLXmxbP+wxcCsVAxIKwfv1AZoDH96jN6rXr1SuVeowKsuFINrs+BSXATbc59JLU/XwCwdDMw7B/vUEpgHfQYZ7v9HCNar/2E55ynDpSwYrhXF4uKUeQiY0/Oy3kM555nCITcJgmvp0F30Yo8L9KpXL1X9E2XhkPoVBuYWwbmolKDOhmv+WHiXyGNkgbTRE1pOublXkRycCz+AfUoRzPdsgKJN1w/19KpXf7n6xlnCPikE/SkWdswrozDkNoZUfIWhFTYYWaPy4a6NkgSR2XAZXSOLIWUWcCv7FP1T7sH8wFZwp7ycxz971auXIm4AG+b77MFLEKLv7ULJMy0FefCsPAOv0t0YUrIMg0s+gVfxYrgVbIJLUSzsrl2F2ZZl4L7J/Pdp/956ca969UrEna0O41/HwSJ4F3in42Fz5Trsbt5Bv3u30e9uImyvnoV15GGY/LIA6kOZP1966pZ8r3r1n5eqhwZ0F/aB4ToHGK9zh/FPHjD60RE6H1tDaaA2cdy7mvFfI+BffksPNrEksu0AAAAASUVORK5CYII=",m}),define("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=r(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 i(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=this._canvasSize,r=0;r<=this._cells;++r){var i=r/this._cells,n=1+i*(t-1);e.moveTo(n,0),e.lineTo(n,t),e.moveTo(0,n),e.lineTo(t,n)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=this._canvasSize,r=e.getContext("2d"),i=this._backgroundColor.toCssColorString();r.fillStyle=i,r.fillRect(0,0,t,t);var n=this._glowColor.toCssColorString();r.strokeStyle=n,r.lineWidth=this._glowWidth,r.strokeRect(0,0,t,t),this._drawGrid(r),r.lineWidth=.5*this._glowWidth,r.strokeRect(0,0,t,t),this._drawGrid(r);var o=this._color.toCssColorString();return r.strokeStyle=o,r.lineWidth=2,r.strokeRect(0,0,t,t),r.lineWidth=1,this._drawGrid(r),e},s.prototype.getTileCredits=function(e,t,r){},s.prototype.requestImage=function(e,t,r,i){return this._canvas},s.prototype.pickFeatures=function(e,t,r,i,n){},s}),define("Scene/InvertClassification",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/PostProcessFilters/PassThrough","./BlendingState","./StencilFunction","./StencilOperation"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v){"use strict";function y(){this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._texture=void 0,this._classifiedTexture=void 0,this._depthStencilTexture=void 0,this._fbo=void 0,this._fboClassified=void 0,this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new o({color:new e(0,0,0,0),owner:this}),this._clearCommand=new o({color:new e(0,0,0,0),depth:1,stencil:0});var t=this;this._uniformMap={u_texture:function(){return t._texture},u_depth:function(){return t._depthStencilTexture},u_classified:function(){return t._classifiedTexture}}}r(y.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}}),y.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var b={depthMask:!1,stencilTest:{enabled:!0,frontFunction:_.EQUAL,frontOperation:{fail:v.KEEP,zFail:v.KEEP,zPass:v.KEEP},backFunction:_.NEVER,reference:0,mask:15},blending:g.ALPHA_BLEND},C={depthMask:!1,stencilTest:{enabled:!0,frontFunction:_.NOT_EQUAL,frontOperation:{fail:v.KEEP,zFail:v.KEEP,zPass:v.KEEP},backFunction:_.NEVER,reference:0,mask:15},blending:g.ALPHA_BLEND},S={depthMask:!0,depthTest:{enabled:!0},blending:g.ALPHA_BLEND};return y.prototype.update=function(e){var r=this._texture,i=!t(r)||this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;var o=e.drawingBufferWidth,g=e.drawingBufferHeight,_=!t(r)||r.width!==o||r.height!==g;if((_||i)&&(this._texture=this._texture&&this._texture.destroy(),this._classifiedTexture=this._classifiedTexture&&this._classifiedTexture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._texture=new d({context:e,width:o,height:g,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE,sampler:new u({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.LINEAR,magnificationFilter:h.LINEAR})}),t(this._previousFramebuffer)||(this._classifiedTexture=new d({context:e,width:o,height:g,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE,sampler:new u({wrapS:f.CLAMP_TO_EDGE,wrapT:f.CLAMP_TO_EDGE,minificationFilter:p.LINEAR,magnificationFilter:h.LINEAR})}),this._depthStencilTexture=new d({context:e,width:o,height:g,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}))),!t(this._fbo)||_||i){this._fbo=this._fbo&&this._fbo.destroy(),this._fboClassified=this._fboClassified&&this._fboClassified.destroy();var v,y;t(this._previousFramebuffer)?(v=this._previousFramebuffer.depthStencilTexture,y=this._previousFramebuffer.depthStencilRenderbuffer):v=this._depthStencilTexture,this._fbo=new a({context:e,colorTextures:[this._texture],depthStencilTexture:v,depthStencilRenderbuffer:y,destroyAttachments:!1}),t(this._previousFramebuffer)||(this._fboClassified=new a({context:e,colorTextures:[this._classifiedTexture],depthStencilTexture:v,destroyAttachments:!1}))}if(t(this._rsUnclassified)||(this._rsUnclassified=l.fromCache(b),this._rsClassified=l.fromCache(C),this._rsDefault=l.fromCache(S)),!t(this._unclassifiedCommand)||i){t(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());var T=t(this._previousFramebuffer)?"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    vec4 color = texture2D(u_texture, v_textureCoordinates);\n    if (color.a == 0.0)\n    {\n        discard;\n    }\n#ifdef UNCLASSIFIED\n    gl_FragColor = color * czm_invertClassificationColor;\n#else\n    gl_FragColor = color;\n#endif\n}\n":"#extension GL_EXT_frag_depth : enable\nuniform sampler2D u_texture;\nuniform sampler2D u_depth;\nuniform sampler2D u_classified;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    vec4 color = texture2D(u_texture, v_textureCoordinates);\n    if (color.a == 0.0)\n    {\n        discard;\n    }\n    bool isClassified = all(equal(texture2D(u_classified, v_textureCoordinates), vec4(0.0)));\n#ifdef UNCLASSIFIED\n    vec4 highlightColor = czm_invertClassificationColor;\n    if (isClassified)\n    {\n        discard;\n    }\n#else\n    vec4 highlightColor = vec4(1.0);\n    if (!isClassified)\n    {\n        discard;\n    }\n#endif\n    gl_FragColor = color * highlightColor;\n    gl_FragDepthEXT = texture2D(u_depth, v_textureCoordinates).r;\n}\n",w=new c({defines:["UNCLASSIFIED"],sources:[T]}),A=new c({sources:[T]});this._unclassifiedCommand=e.createViewportQuadCommand(w,{renderState:t(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(A,{renderState:t(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),t(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),t(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(m,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}},y.prototype.clear=function(e,r){var i=r.framebuffer;t(this._previousFramebuffer)?(r.framebuffer=this._fbo,this._clearColorCommand.execute(e,r)):(r.framebuffer=this._fbo,this._clearCommand.execute(e,r),r.framebuffer=this._fboClassified,this._clearCommand.execute(e,r)),r.framebuffer=i},y.prototype.executeClassified=function(e,r){
if(!t(this._previousFramebuffer)){var i=r.framebuffer;r.framebuffer=this._fboClassified,this._translucentCommand.execute(e,r),r.framebuffer=i}this._classifiedCommand.execute(e,r)},y.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),t(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),i(this)},y}),define("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/MapboxApi","../Core/Resource","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(i){i=t(i,t.EMPTY_OBJECT);var o=i.mapId;r(i.proxy)&&n("MapboxImageryProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var u=i.url;r(u)||(u="https://api.mapbox.com/v4/"),this._url=u;var p=s.createIfNeeded(u,{proxy:i.proxy}),f=a.getAccessToken(i.accessToken);this._mapId=o,this._accessToken=f,this._accessTokenErrorCredit=a.getErrorCredit(i.accessToken);var m=t(i.format,"png");/\./.test(m)||(m="."+m),this._format=m;var g=p.getUrlComponent();if(c.test(g)||(g+="/"),g+=o+"/{z}/{x}/{y}"+this._format,p.url=g,p.setQueryParameters({access_token:f}),r(i.credit)){var _=i.credit;"string"==typeof _&&(_=new e({text:_})),d=_,h.length=0}this._resource=p,this._imageryProvider=new l({url:p,credit:d,ellipsoid:i.ellipsoid,minimumLevel:i.minimumLevel,maximumLevel:i.maximumLevel,rectangle:i.rectangle})}var c=/\/$/,d=new e({text:"© Mapbox © OpenStreetMap",link:"https://www.mapbox.com/about/maps/"}),h=[new e({text:"Improve this map",link:"https://www.mapbox.com/map-feedback/"})];return i(u.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}}}),u.prototype.getTileCredits=function(e,t,i){var n=h.slice();return r(this._accessTokenErrorCredit)&&n.push(this._accessTokenErrorCredit),n},u.prototype.requestImage=function(e,t,r,i){return this._imageryProvider.requestImage(e,t,r,i)},u.prototype.pickFeatures=function(e,t,r,i,n){return this._imageryProvider.pickFeatures(e,t,r,i,n)},u}),define("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/Rectangle","../Core/Resource","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(i){function o(e){b._image=e,b._tileWidth=e.width,b._tileHeight=e.height,b._ready=!0,b._readyPromise.resolve(!0),d.handleSuccess(b._errorEvent)}function p(e){var t="Failed to load image "+m.url+".";y=d.handleError(y,b,b._errorEvent,t,0,0,0,f,e),b._readyPromise.reject(new c(t))}function f(){h(m.fetchImage(),o,p)}i=t(i,{}),r(i.proxy)&&n("SingleTileImageryProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var m=u.createIfNeeded(i.url,{proxy:i.proxy}),g=t(i.rectangle,l.MAX_VALUE),_=new s({rectangle:g,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:i.ellipsoid});this._tilingScheme=_,this._resource=m,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new a,this._ready=!1,this._readyPromise=h.defer();var v=i.credit;"string"==typeof v&&(v=new e({text:v})),this._credit=v;var y,b=this;f()}return i(p.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.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}}}),p.prototype.getTileCredits=function(e,t,r){},p.prototype.requestImage=function(e,t,r,i){return this._image},p.prototype.pickFeatures=function(e,t,r,i,n){},p}),define("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/Resource","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=t(e,t.EMPTY_OBJECT),r(e.proxy)&&n("WebMapServiceImageryProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var i=c.createIfNeeded(e.url,{proxy:e.proxy}),o=i.clone();i.setQueryParameters(m.DefaultParameters,!0),o.setQueryParameters(m.GetFeatureInfoDefaultParameters,!0),r(e.parameters)&&i.setQueryParameters(g(e.parameters)),r(e.getFeatureInfoParameters)&&o.setQueryParameters(g(e.getFeatureInfoParameters));var a={};a.layers=e.layers,a.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",a.width="{width}",a.height="{height}",parseFloat(i.queryParameters.version)>=1.3?a.crs=e.tilingScheme instanceof d?"EPSG:3857":"CRS:84":a.srs=e.tilingScheme instanceof d?"EPSG:3857":"EPSG:4326",i.setQueryParameters(a,!0),o.setQueryParameters(a,!0);var l={query_layers:e.layers,x:"{i}",y:"{j}",info_format:"{format}"};o.setQueryParameters(l,!0),this._resource=i,this._pickFeaturesResource=o,this._layers=e.layers,this._tileProvider=new f({url:i,pickFeaturesUrl:o,tilingScheme:t(e.tilingScheme,new s({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:t(e.getFeatureInfoFormats,m.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function g(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r.toLowerCase()]=e[r]);return t}return i(m.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.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}}}),m.prototype.getTileCredits=function(e,t,r){return this._tileProvider.getTileCredits(e,t,r)},m.prototype.requestImage=function(e,t,r,i){return this._tileProvider.requestImage(e,t,r,i)},m.prototype.pickFeatures=function(e,t,r,i,n){return this._tileProvider.pickFeatures(e,t,r,i,n)},m.DefaultParameters=a({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),m.GetFeatureInfoDefaultParameters=a({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),m.DefaultGetFeatureInfoFormats=a([a(new p("json","application/json")),a(new p("xml","text/xml")),a(new p("text","text/html"))]),m}),define("Scene/TimeDynamicImagery",["../Core/Check","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/JulianDate","../Core/Request","../Core/RequestType"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];var r=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,r.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(r)}function u(e,t,r){return e+"-"+t+"-"+r}function c(e){var t=e.split("-");if(3===t.length)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function d(e){var t=e._times;if(r(t)){var i=e._clock,n=i.currentTime,a=i.canAnimate&&i.shouldAnimate,s=i.multiplier;if(a||0===s){var l,u=t.indexOf(n);if(-1!==u){var c=t.get(u);return s>0?(l=o.secondsDifference(c.stop,n),++u):(l=o.secondsDifference(c.start,n),--u),l/=s,u>=0&&l<=5?t.get(u):void 0}}}}function h(e,t,i){var n=e._times.indexOf(i.start),o=e._tileCache,l=o[n];r(l)||(l=o[n]={});var u=t.key;if(r(l[u]))return!0;var d=c(u),h=new a({throttle:!0,throttleByServer:!0,type:s.IMAGERY,priorityFunction:t.priorityFunction}),p=e._requestImageFunction(d.x,d.y,d.level,h,i);return!!r(p)&&(l[u]={promise:p,request:h},!0)}return i(l.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}}),l.prototype.getFromCache=function(e,t,i,n){var o,a=u(e,t,i),s=this._tileCache[this._currentIntervalIndex];if(r(s)&&r(s[a])){var l=s[a];o=l.promise.otherwise(function(e){throw n.state=l.request.state,e}),delete s[a]}return o},l.prototype.checkApproachingInterval=function(e,t,i,n){var o=u(e,t,i),a=this._tilesRequestedForInterval,s=d(this),l={key:o,priorityFunction:n.priorityFunction};r(s)&&h(this,l,s)||a.push(l),a.length>=512&&a.splice(0,256)},l.prototype._clockOnTick=function(e){var t=e.currentTime,i=this._times,n=i.indexOf(t),o=this._currentIntervalIndex;if(n!==o){var a=this._tileCache[o];for(var s in a)a.hasOwnProperty(s)&&a[s].request.cancel();return delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=n,void this._reloadFunction()}var l=d(this);if(r(l))for(var u=this._tilesRequestedForInterval,c=!0;c&&0!==u.length;){var p=u.pop();(c=h(this,p,l))||u.push(p)}},l}),define("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/deprecationWarning","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/isArray","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/Resource","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider","./TimeDynamicImagery"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v){"use strict";function y(e){e=r(e,r.EMPTY_OBJECT),i(e.proxy)&&o("WebMapTileServiceImageryProvider.proxy","The options.proxy parameter has been deprecated. Specify options.url as a Resource instance and set the proxy property there.");var n=p.createIfNeeded(e.url,{proxy:e.proxy}),a=e.style,l=e.tileMatrixSetID;if(n.url.indexOf("{")>=0){var c={style:a,Style:a,TileMatrixSet:l};n.setTemplateValues(c),this._useKvp=!1}else n.setQueryParameters(C),this._useKvp=!0;this._resource=n,this._layer=e.layer,this._style=a,this._tileMatrixSetID=l,this._tileMatrixLabels=e.tileMatrixLabels,this._format=r(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new f({ellipsoid:e.ellipsoid}),this._tileWidth=r(e.tileWidth,256),this._tileHeight=r(e.tileHeight,256),this._minimumLevel=r(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=r(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;var d=this;this._reload=void 0,i(e.times)&&(this._timeDynamicImagery=new v({clock:e.clock,times:e.times,requestImageFunction:function(e,t,r,i,n){return b(d,e,t,r,i,n)},reloadFunction:function(){i(d._reload)&&d._reload()}})),this._readyPromise=g.resolve(!0);var m=this._tilingScheme.positionToTileXY(h.southwest(this._rectangle),this._minimumLevel),_=this._tilingScheme.positionToTileXY(h.northeast(this._rectangle),this._minimumLevel);Math.abs(_.x-m.x),Math.abs(_.y-m.y);this._errorEvent=new s;var y=e.credit;this._credit="string"==typeof y?new t({text:y}):y,this._subdomains=e.subdomains,u(this._subdomains)?this._subdomains=this._subdomains.slice():i(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function b(t,r,n,o,a,s){var l,u=t._tileMatrixLabels,c=i(u)?u[o]:o.toString(),d=t._subdomains,h=t._dimensions,p=i(s)?s.data:void 0;if(t._useKvp){var f={};f.tilematrix=c,f.layer=t._layer,f.style=t._style,f.tilerow=n,f.tilecol=r,f.tilematrixset=t._tileMatrixSetID,f.format=t._format,i(h)&&(f=e(f,h)),i(p)&&(f=e(f,p)),l=t._resource.getDerivedResource({queryParameters:f,request:a})}else{var m={TileMatrix:c,TileRow:n.toString(),TileCol:r.toString(),s:d[(r+n+o)%d.length]};l=t._resource.getDerivedResource({request:a}),l.setTemplateValues(m),i(h)&&l.setTemplateValues(h),i(p)&&l.setTemplateValues(p)}return _.loadImage(t,l)}var C=l({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(y.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.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}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,i(this._reload)&&this._reload())}}}),y.prototype.getTileCredits=function(e,t,r){},y.prototype.requestImage=function(e,t,r,n){var o,a,s=this._timeDynamicImagery;return i(s)&&(a=s.currentInterval,o=s.getFromCache(e,t,r,n)),i(o)||(o=b(this,e,t,r,n,a)),i(o)&&i(s)&&s.checkApproachingInterval(e,t,r,n),o},y.prototype.pickFeatures=function(e,t,r,i,n){},y}),define("Scene/IonImageryProvider",["../Core/Check","../Core/clone","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/loadJson","../Core/Resource","../Core/RuntimeError","../ThirdParty/when","./ArcGisMapServerImageryProvider","./BingMapsImageryProvider","./Cesium3DTileset","../Core/IonResource","./createTileMapServiceImageryProvider","./GoogleEarthEnterpriseMapsProvider","./MapboxImageryProvider","./SingleTileImageryProvider","./UrlTemplateImageryProvider","./WebMapServiceImageryProvider","./WebMapTileServiceImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S){"use strict";function T(e){return function(t){return new e(t)}}function w(e){e=i(e,i.EMPTY_OBJECT);var t=m._createEndpointResource(e.assetId,e);this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new s;var o=this;this._readyPromise=t.fetchJson().then(function(i){if("IMAGERY"!==i.type)return d.reject(new c("Cesium ion asset "+e.assetId+" is not an imagery asset."));var a,s=i.externalType;if(n(s)){var l=A[s];if(!n(l))return d.reject(new c("Unrecognized Cesium ion imagery type: "+s));a=l(i.options)}else a=g({url:new m(i,t)});return o._tileCredits=i.attributions.map(function(e){return new r({text:e.text,link:e.url,imageUrl:e.image,showOnScreen:n(e.collapsible)&&!e.collapsible})}),a}).then(function(e){return e.errorEvent.addEventListener(function(e){e.provider=o,o._errorEvent.raiseEvent(e)}),o._imageryProvider=e,e.readyPromise.then(function(){return o._ready=!0,!0})})}var A={ARCGIS_MAPSERVER:T(h),BING:T(p),GOOGLE_EARTH:T(_),MAPBOX:T(v),SINGLE_TILE:T(y),TMS:g,URL_TEMPLATE:T(b),WMS:T(C),WMTS:T(S)};return o(w.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._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._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),w.prototype.getTileCredits=function(e,t,r){var i=this._imageryProvider.getTileCredits(e,t,r);return n(i)?this._tileCredits.concat(i):this._tileCredits},w.prototype.requestImage=function(e,t,r,i){return this._imageryProvider.requestImage(e,t,r,i)},w.prototype.pickFeatures=function(e,t,r,i,n){return this._imageryProvider.pickFeatures(e,t,r,i,n)},w}),define("Scene/JobScheduler",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/getTimestamp","./JobType"],function(e,t,r,i,n){"use strict";function o(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function a(t){var r=new Array(n.NUMBER_OF_JOB_TYPES);r[n.TEXTURE]=new o(e(t)?t[n.TEXTURE]:10),r[n.PROGRAM]=new o(e(t)?t[n.PROGRAM]:10),r[n.BUFFER]=new o(e(t)?t[n.BUFFER]:30);var i,a=r.length,s=0;for(i=0;i<a;++i)s+=r[i].total;var l=new Array(a);for(i=0;i<a;++i)l[i]=!1;this._totalBudget=s,this._totalUsedThisFrame=0,this._budgets=r,this._executedThisFrame=l}return t(o.prototype,{total:{get:function(){return this._total}}}),a.getTimestamp=i,t(a.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),a.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},a.prototype.resetBudgets=function(){for(var e=this._budgets,t=e.length,r=0;r<t;++r){var i=e[r];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0},a.prototype.execute=function(e,t){var r=this._budgets,i=r[t],n=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&n)return i.starvedThisFrame=!0,!1;var o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){var s,l=r.length;for(s=0;s<l&&(o=r[s],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total)||o.starvedLastFrame);++s);if(s===l&&n)return!1;n&&(i.starvedThisFrame=!0)}var u=a.getTimestamp();e.execute();var c=a.getTimestamp()-u;return this._totalUsedThisFrame+=c,o?o.stolenFromMeThisFrame+=c:i.usedThisFrame+=c,this._executedThisFrame[t]=!0,!0},a}),define("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,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t){t=r(t,r.EMPTY_OBJECT);var n=t.textureUrl;i(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=r(t.show,!0),this.textureUrl=n,this._ellipsoid=r(t.ellipsoid,a.MOON),this.onlySunLighting=r(t.onlySunLighting,!0),this._ellipsoidPrimitive=new h({radii:this.ellipsoid.radii,material:p.fromType(p.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var m=new l,g=new l,_=new t,v=[];return f.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var r=e.time;i(d.computeIcrfToFixedMatrix(r,m))||d.computeTemeToPseudoFixedMatrix(r,m);var n=this._axes.evaluate(r,g);l.transpose(n,n),l.multiply(m,n,n);var o=c.computeMoonPositionInEarthInertialFrame(r,_);l.multiplyByVector(m,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}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},f}),define("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e}),define("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"}),define("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;\nif (opaque != czm_backgroundColor)\n{\ngl_FragColor.a = 1.0;\n}\n}\n"}),define("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/ShaderSource","../Renderer/Texture","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(r){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var i=r.floatingPointTexture&&r.depthTexture;this._translucentMRTSupport=r.drawBuffers&&i,this._translucentMultipassSupport=!this._translucentMRTSupport&&i,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._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new e,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0}function v(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function y(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 b(e){v(e),y(e)}function C(e,t,r,i){v(e);var o=new Float32Array(r*i*4);e._accumulationTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:r,height:i}}),e._revealageTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:r,height:i}})}function S(e,t){y(e);var r=o.FRAMEBUFFER_COMPLETE,i=!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===r&&e._adjustTranslucentFBO.status===r||(y(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===r,a=e._alphaFBO.status===r,s=e._adjustTranslucentFBO.status===r,u=e._adjustAlphaFBO.status===r;n&&a&&s&&u||(b(e),e._translucentMultipassSupport=!1,i=!1)}return i}function T(e,t,i,n){var o=i[n.id];if(!r(o)){var a=c.getState(n);a.depthMask=!1,a.blending=t,o=c.fromCache(a),i[n.id]=o}return o}function w(e,t,r){return T(t,R,e._translucentRenderStateCache,r)}function A(e,t,r){return T(t,L,e._translucentRenderStateCache,r)}function E(e,t,r){return T(t,N,e._alphaRenderStateCache,r)}function x(e,t,i,n){var o=e.shaderCache.getDerivedShaderProgram(t,i);if(!r(o)){var a=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.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")}),s.sources.splice(0,0,(-1!==n.indexOf("gl_FragData")?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),s.sources.push("void main()\n{\n    czm_translucent_main();\n    if (czm_discard)\n    {\n        discard;\n    }\n"+n+"}\n"),o=e.shaderCache.createDerivedShaderProgram(t,i,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}return o}function P(e,t){return x(e,t,"translucentMRT",k)}function I(e,t){return x(e,t,"translucentMultipass",F)}function D(e,t){return x(e,t,"alphaMultipass",B)}function O(e,t,i,n,o,a){var s,l,u,c=t.context,d=n.framebuffer,h=o.length,p=t.frameState.shadowHints.shadowsEnabled;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(c,n),n.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(c,n);var f=e._opaqueFBO;for(n.framebuffer=e._translucentFBO,u=0;u<h;++u)s=o[u],l=p&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,i(l,t,c,n,f);for(r(a)&&(s=a.unclassifiedCommand,l=p&&s.receiveShadows?s.derivedCommands.oit.shadows.translucentCommand:s.derivedCommands.oit.translucentCommand,i(l,t,c,n,f)),n.framebuffer=e._alphaFBO,u=0;u<h;++u)s=o[u],l=p&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,i(l,t,c,n,f);r(a)&&(s=a.unclassifiedCommand,l=p&&s.receiveShadows?s.derivedCommands.oit.shadows.alphaCommand:s.derivedCommands.oit.alphaCommand,i(l,t,c,n,f)),n.framebuffer=d}function M(e,t,i,n,o,a){var s=t.context,l=n.framebuffer,u=o.length,c=t.frameState.shadowHints.shadowsEnabled;n.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(s,n);var d=e._opaqueFBO;n.framebuffer=e._translucentFBO;for(var h,p,f=0;f<u;++f)h=o[f],p=c&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,i(p,t,s,n,d);r(a)&&(h=a.unclassifiedCommand,p=c&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand,i(p,t,s,n,d)),n.framebuffer=l}_.prototype.update=function(t,i,n){if(this.isSupported()){this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.depthStencilTexture;var o=this._opaqueTexture.width,a=this._opaqueTexture.height,s=this._accumulationTexture,l=!r(s)||s.width!==o||s.height!==a;if(l&&C(this,t,o,a),r(this._translucentFBO)&&!l||S(this,t)){var u,h,m=this;r(this._compositeCommand)||(u=new d({sources:[f]}),this._translucentMRTSupport&&u.defines.push("MRT"),h={u_opaque:function(){return m._opaqueTexture},u_accumulation:function(){return m._accumulationTexture},u_revealage:function(){return m._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})),r(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(u=new d({defines:["MRT"],sources:[p]}),h={u_bgColor:function(){return m._translucentMRTClearCommand.color},u_depthTexture:function(){return m._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})):this._translucentMultipassSupport&&(u=new d({sources:[p]}),h={u_bgColor:function(){return m._translucentMultipassClearCommand.color},u_depthTexture:function(){return m._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{
uniformMap:h,owner:this}),h={u_bgColor:function(){return m._alphaClearCommand.color},u_depthTexture:function(){return m._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}))),this._viewport.width=o,this._viewport.height=a;var g=!e.equals(this._viewport,i.viewport),_=g!==this._useScissorTest;this._useScissorTest=g,e.equals(this._scissorRectangle,i.viewport)||(this._scissorRectangle=e.clone(i.viewport,this._scissorRectangle),_=!0),r(this._rs)&&e.equals(this._viewport,this._rs.viewport)&&!_||(this._rs=c.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),r(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),r(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var R={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.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:m.ADD,equationAlpha:m.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ONE,functionDestinationAlpha:g.ONE},N={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:g.ZERO,functionDestinationRgb:g.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},k="    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",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_FragColor = vec4(Ci, ai) * wzi;\n",B="    float ai = czm_gl_FragColor.a;\n    gl_FragColor = vec4(ai);\n";return _.prototype.createDerivedCommands=function(e,t,i){if(r(i)||(i={}),this._translucentMRTSupport){var n,o;r(i.translucentCommand)&&(n=i.translucentCommand.shaderProgram,o=i.translucentCommand.renderState),i.translucentCommand=s.shallowClone(e,i.translucentCommand),r(n)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=n,i.translucentCommand.renderState=o):(i.translucentCommand.shaderProgram=P(t,e.shaderProgram),i.translucentCommand.renderState=w(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)}else{var a,l,u,c;r(i.translucentCommand)&&(a=i.translucentCommand.shaderProgram,l=i.translucentCommand.renderState,u=i.alphaCommand.shaderProgram,c=i.alphaCommand.renderState),i.translucentCommand=s.shallowClone(e,i.translucentCommand),i.alphaCommand=s.shallowClone(e,i.alphaCommand),r(a)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=a,i.translucentCommand.renderState=l,i.alphaCommand.shaderProgram=u,i.alphaCommand.renderState=c):(i.translucentCommand.shaderProgram=I(t,e.shaderProgram),i.translucentCommand.renderState=A(this,t,e.renderState),i.alphaCommand.shaderProgram=D(t,e.shaderProgram),i.alphaCommand.renderState=E(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)}return i},_.prototype.executeCommands=function(e,t,r,i,n){if(this._translucentMRTSupport)return void M(this,e,t,r,i,n);O(this,e,t,r,i,n)},_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},_.prototype.clear=function(e,r,i){var n=r.framebuffer;r.framebuffer=this._opaqueFBO,t.clone(i,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,r),r.framebuffer=this._translucentFBO,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,r),this._translucentMultipassSupport&&(r.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,r)),r.framebuffer=n},_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return b(this),r(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),r(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),r(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),i(this)},_}),define("Scene/Particle",["../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties"],function(e,t,r,i,n,o){"use strict";function a(n){n=i(n,i.EMPTY_OBJECT),this.mass=i(n.mass,1),this.position=t.clone(i(n.position,t.ZERO)),this.velocity=t.clone(i(n.velocity,t.ZERO)),this.life=i(n.life,Number.MAX_VALUE),this.image=n.image,this.startColor=r.clone(i(n.startColor,r.WHITE)),this.endColor=r.clone(i(n.endColor,r.WHITE)),this.startScale=i(n.startScale,1),this.endScale=i(n.endScale,1),this.size=e.clone(i(n.size,s)),this._age=0,this._normalizedAge=0,this._billboard=void 0}var s=new e(1,1);o(a.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var l=new t;return a.prototype.update=function(e,r){if(t.multiplyByScalar(this.velocity,e,l),t.add(this.position,l,this.position),n(r))for(var i=r.length,o=0;o<i;++o){var a=r[o];"function"==typeof a&&a(this,e)}return this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life},a}),define("Scene/ParticleBurst",["../Core/defaultValue","../Core/defineProperties"],function(e,t){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.time=e(t.time,0),this.minimum=e(t.minimum,0),this.maximum=e(t.maximum,50),this._complete=!1}return t(r.prototype,{complete:{get:function(){return this._complete}}}),r}),define("Scene/ParticleEmitter",["../Core/DeveloperError"],function(e){"use strict";function t(e){}return t.prototype.emit=function(t){e.throwInstantiationError()},t}),define("Scene/ParticleSystem",["../Core/Cartesian2","../Core/Cartesian3","../Core/Check","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Event","../Core/JulianDate","../Core/Math","../Core/Matrix4","./BillboardCollection","./CircleEmitter","./Particle"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=n(e,n.EMPTY_OBJECT),this.show=n(e.show,!0),this.forces=e.forces,this.loop=n(e.loop,!0),this.image=n(e.image,void 0);var t=e.emitter;o(t)||(t=new p(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=d.clone(n(e.modelMatrix,d.IDENTITY)),this._emitterModelMatrix=d.clone(n(e.emitterModelMatrix,d.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new d,this._startColor=i.clone(n(e.startColor,i.WHITE)),this._endColor=i.clone(n(e.endColor,i.WHITE)),this._startScale=n(e.startScale,1),this._endScale=n(e.endScale,1),this._rate=n(e.rate,5),this._minimumSpeed=n(e.speed,n(e.minimumSpeed,1)),this._maximumSpeed=n(e.speed,n(e.maximumSpeed,1)),this._minimumLife=n(e.life,n(e.minimumLife,5)),this._maximumLife=n(e.life,n(e.maximumLife,5)),this._minimumMass=n(e.mass,n(e.minimumMass,1)),this._maximumMass=n(e.mass,n(e.maximumMass,1)),this._minimumWidth=n(e.width,n(e.minimumWidth,1)),this._maximumWidth=n(e.width,n(e.maximumWidth,1)),this._minimumHeight=n(e.height,n(e.minimumHeight,1)),this._maximumHeight=n(e.height,n(e.maximumHeight,1)),this._lifeTime=n(e.lifeTime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new l,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}function g(e){var t=e._rate,r=e._maximumLife,i=0,n=e._bursts;if(o(n))for(var a=n.length,s=0;s<a;++s)i+=n[s].maximum;for(var l=e._billboardCollection,u=e.image,c=Math.ceil(t*r+i),d=e._particles,h=e._particlePool,p=Math.max(c-d.length-h.length,0),m=0;m<p;++m){var g=new f;g._billboard=l.add({image:u}),h.push(g)}e._particleEstimate=c}function _(e){var t=e._particlePool.pop();return o(t)||(t=new f),t}function v(e,t){e._particlePool.push(t)}function y(e){for(var t=e._particles,r=e._particlePool,i=e._billboardCollection,n=t.length,o=r.length,a=e._particleEstimate,s=o-Math.max(a-n-o,0),l=s;l<o;++l){var u=r[l];i.remove(u._billboard)}r.length=s}function b(e){o(e._billboard)&&(e._billboard.show=!1)}function C(e,t){var r=t._billboard;o(r)||(r=t._billboard=e._billboardCollection.add({image:t.image})),r.width=t.size.x,r.height=t.size.y,r.position=t.position,r.show=!0;var n=c.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),a=c.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),s=c.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),l=c.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);r.color=new i(n,a,s,l);var u=c.lerp(t.startScale,t.endScale,t.normalizedAge);r.scale=u}function S(r,n){n.startColor=i.clone(r._startColor,n.startColor),n.endColor=i.clone(r._endColor,n.endColor),n.startScale=r._startScale,n.endScale=r._endScale,n.image=r.image,n.life=c.randomBetween(r._minimumLife,r._maximumLife),n.mass=c.randomBetween(r._minimumMass,r._maximumMass);var o=c.randomBetween(r._minimumWidth,r._maximumWidth),a=c.randomBetween(r._minimumHeight,r._maximumHeight);n.size=e.fromElements(o,a,n.size),n._normalizedAge=0,n._age=0;var s=c.randomBetween(r._minimumSpeed,r._maximumSpeed);t.multiplyByScalar(n.velocity,s,n.velocity),r._particles.push(n)}function T(e,t){if(e._isComplete)return 0;t=c.mod(t,e._lifeTime);var r=t*e._rate,i=Math.floor(r);if(e._carryOver+=r-i,e._carryOver>1&&(i++,e._carryOver-=1),o(e.bursts))for(var n=e.bursts.length,a=0;a<n;a++){var s=e.bursts[a],l=e._currentTime;o(s)&&!s._complete&&l>s.time&&(i+=c.randomBetween(s.minimum,s.maximum),s._complete=!0)}return i}a(m.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!d.equals(this._modelMatrix,e),d.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!d.equals(this._emitterModelMatrix,e),d.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){i.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){i.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},rate:{get:function(){return this._rate},set:function(e){this._rate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumLife:{get:function(){return this._minimumLife},set:function(e){this._minimumLife=e}},maximumLife:{get:function(){return this._maximumLife},set:function(e){this._maximumLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumWidth:{get:function(){return this._minimumWidth},set:function(e){this._minimumWidth=e}},maximumWidth:{get:function(){return this._maximumWidth},set:function(e){this._maximumWidth=e}},minimumHeight:{get:function(){return this._minimumHeight},set:function(e){this._minimumHeight=e}},maximumHeight:{get:function(){return this._maximumHeight},set:function(e){this._maximumHeight=e}},lifeTime:{get:function(){return this._lifeTime},set:function(e){this._lifeTime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});var w=new t;return m.prototype.update=function(e){if(this.show){o(this._billboardCollection)||(this._billboardCollection=new h),this._updateParticlePool&&(g(this),this._updateParticlePool=!1);var r=0;this._previousTime&&(r=u.secondsDifference(e.time,this._previousTime)),r<0&&(r=0);var i,n,a=this._particles,s=this._emitter,l=this.forces,p=a.length;for(i=0;i<p;++i)n=a[i],n.update(r,l)?C(this,n):(b(n),v(this,n),a[i]=a[p-1],--i,--p);a.length=p;var f=T(this,r);if(f>0&&o(s)){this._matrixDirty&&(this._combinedMatrix=d.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);var m=this._combinedMatrix;for(i=0;i<f;i++)n=_(this),this._emitter.emit(n),t.add(n.position,n.velocity,w),d.multiplyByPoint(m,w,w),n.position=d.multiplyByPoint(m,n.position,n.position),t.subtract(w,n.position,n.velocity),t.normalize(n.velocity,n.velocity),S(this,n),C(this,n)}if(this._billboardCollection.update(e),this._previousTime=u.clone(e.time,this._previousTime),this._currentTime+=r,this._lifeTime!==Number.MAX_VALUE&&this._currentTime>this._lifeTime)if(this.loop){if(this._currentTime=c.mod(this._currentTime,this._lifeTime),this.bursts){var A=this.bursts.length;for(i=0;i<A;i++)this.bursts[i]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120==0&&y(this)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),s(this)},m}),define("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){e=document.getElementById(e)}return e}return t}),define("Scene/PerformanceDisplay",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,r,i,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var r=a(t.container);this._container=r;var i=document.createElement("div");i.className="cesium-performanceDisplay";var n=document.createElement("div");n.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),n.appendChild(this._fpsText);var s=document.createElement("div");s.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),s.appendChild(this._msText),i.appendChild(s),i.appendChild(n),this._container.appendChild(i),this._lastFpsSampleTime=o(),this._lastMsSampleTime=o(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;var l=document.createElement("div");l.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),l.appendChild(this._throttledText),i.appendChild(l)}return r(s.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(this._throttledText.nodeValue=e?"(throttled)":"",this._throttled=e)}}}),s.prototype.update=function(t){var r=o(),i=e(t,!0);this._fpsFrameCount++;var n=r-this._lastFpsSampleTime;if(n>1e3){var a="N/A";i&&(a=1e3*this._fpsFrameCount/n|0),this._fpsText.nodeValue=a+" FPS",this._lastFpsSampleTime=r,this._fpsFrameCount=0}this._msFrameCount++;var s=r-this._lastMsSampleTime;if(s>200){var l="N/A";i&&(l=(s/this._msFrameCount).toFixed(2)),this._msText.nodeValue=l+" MS",this._lastMsSampleTime=r,this._msFrameCount=0}},s.prototype.destroy=function(){return i(this)},s}),define("Scene/PickDepth",["../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture"],function(e,t,r,i,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,r,i){if(!e(t._debugPickDepthViewportCommand)){t._debugPickDepthViewportCommand=r.createViewportQuadCommand("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",{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(r,i)}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 d(e,t,i,o){e._depthTexture=new a({context:t,width:i,height:o,pixelFormat:r.RGBA,pixelDatatype:n.UNSIGNED_BYTE})}function h(e,t,r,n){u(e),c(e),d(e,t,r,n),e.framebuffer=new i({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function p(t,r,i){var n=i.width,o=i.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;e(t.framebuffer)&&!s||h(t,r,n,o)}function f(t,r,i){if(!e(t._copyDepthCommand)){t._copyDepthCommand=r.createViewportQuadCommand("uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n    gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n",{renderState:o.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=i,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),f(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}),define("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i,n,o){"use strict";function a(r){r=t(r,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(r.show,!0),this.destroyPrimitives=t(r.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return i(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{};return(t._composites=t._composites||{})[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(-1!==t)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,r=0;r<t;++r)e[r].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(r(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(r(e)){var t=s(this,e),i=this._primitives;if(t!==i.length-1){var n=i[t];i[t]=i[t+1],i[t+1]=n}}},a.prototype.raiseToTop=function(e){if(r(e)){var t=s(this,e),i=this._primitives;t!==i.length-1&&(i.splice(t,1),i.push(e))}},a.prototype.lower=function(e){if(r(e)){var t=s(this,e),i=this._primitives;if(0!==t){var n=i[t];i[t]=i[t-1],i[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(r(e)){var t=s(this,e),i=this._primitives;0!==t&&(i.splice(t,1),i.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,r=0;r<t.length;++r)t[r].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a}),define("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return r.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(r.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),r.prototype.update=t.throwInstantiationError,r.prototype.beginUpdate=t.throwInstantiationError,r.prototype.endUpdate=t.throwInstantiationError,r.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,r.prototype.loadTile=t.throwInstantiationError,r.prototype.computeTileVisibility=t.throwInstantiationError,r.prototype.showTileThisFrame=t.throwInstantiationError,r.prototype.computeDistanceToTile=t.throwInstantiationError,r.prototype.isDestroyed=t.throwInstantiationError,r.prototype.destroy=t.throwInstantiationError,r}),define("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/defined","../Core/destroyObject","../Core/EasingFunction","../Core/Math","../Core/Matrix4","../Core/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/Ray","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Transforms","./Camera","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function _(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}function v(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new h(e._scene.canvas,!1);var r=function(){e._morphCancelled=!0,t(e)};e._completeMorph=r,e._morphHandler.setInputAction(r,p.LEFT_DOWN),e._morphHandler.setInputAction(r,p.MIDDLE_DOWN),e._morphHandler.setInputAction(r,p.RIGHT_DOWN),e._morphHandler.setInputAction(r,p.WHEEL)}}function y(e){for(var t=e._currentTweens,r=0;r<t.length;++r)t[r].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function b(e,t){var r=e._scene,i=r.camera,n=q,o=n.position,a=n.direction,l=n.up,u=r.mapProjection.unproject(i.position,X);t.cartographicToCartesian(u,o);var c=t.scaleToGeodeticSurface(o,Q),d=f.eastNorthUpToFixedFrame(c,t,Z);return s.multiplyByPointAsVector(d,i.direction,a),s.multiplyByPointAsVector(d,i.up,l),n}function C(t,r,i,n){function a(t){T(c,p,t.time,u.position),T(d,f,t.time,u.direction),T(h,g,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}r*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,K),d=e.clone(u.direction,J),h=e.clone(u.up,$),p=s.multiplyByPoint(m.TRANSFORM_2D_INVERSE,i.position,ee),f=s.multiplyByPointAsVector(m.TRANSFORM_2D_INVERSE,i.direction,te),g=s.multiplyByPointAsVector(m.TRANSFORM_2D_INVERSE,i.up,re),_=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){D(t,l,0,1,r,n)}});t._currentTweens.push(_)}function S(t,r,i){function n(t){T(p,_,t.time,u.position),T(f,y,t.time,u.direction),T(m,S,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right);var r=u.frustum;r.right=a.lerp(w,A,t.time),r.left=-r.right,r.top=r.right*(l.drawingBufferHeight/l.drawingBufferWidth),r.bottom=-r.top,u.position.z=2*l.mapProjection.ellipsoid.maximumRadius}r/=3;var s,l=t._scene,u=l.camera;r>0?(s=q,e.fromDegrees(0,0,5*i.maximumRadius,i,s.position),e.negate(s.position,s.direction),e.normalize(s.direction,s.direction),e.clone(e.UNIT_Z,s.up)):(u.position.z=u.frustum.right-u.frustum.left,s=b(t,i));var c;t._morphToOrthographic?(c=ie,c.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,c.width=u.frustum.right-u.frustum.left):(c=Y,c.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,c.fov=a.toRadians(60)),s.frustum=c;var d=O(s);v(t,d);var h,p=e.clone(u.position,ne),f=e.clone(u.direction,oe),m=e.clone(u.up,ae),_=e.fromElements(0,0,5*i.maximumRadius,se),y=e.negate(e.UNIT_Z,le),S=e.clone(e.UNIT_Y,ue),w=u.frustum.right,A=.5*_.z;if(h=t._morphToOrthographic?function(){C(t,r,s,d)}:function(){x(t,r,s,function(){C(t,r,s,d)})},r>0){var E=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){l._mode=g.MORPHING,h()}});t._currentTweens.push(E)}else h()}function T(t,r,i,n){return e.lerp(t,r,i,n)}function w(e,t,r,i,n){function s(e){c.frustum.fov=a.lerp(d,h,e.time);var t=p/Math.tan(.5*c.frustum.fov);i(c,t)}var u=e._scene,c=u.camera;if(!(c.frustum instanceof l)){var d=c.frustum.fov,h=.5*a.RADIANS_PER_DEGREE,p=r.position.z*Math.tan(.5*d);c.frustum.far=p/Math.tan(.5*h)+1e7;var f=u.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){c.frustum=r.frustum.clone(),n(e)}});e._currentTweens.push(f)}}function A(t,r){function n(t){T(c,g,t.time,u.position),T(d,p,t.time,u.direction),T(h,f,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right),u._adjustOrthographicFrustum(!0)}function a(e,t){e.position.z=t}r*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,ce),d=e.clone(u.direction,de),h=e.clone(u.up,he),p=e.negate(e.UNIT_Z,fe),f=e.clone(e.UNIT_Y,me),g=pe;if(r>0)e.clone(e.ZERO,pe),g.z=5*l.mapProjection.ellipsoid.maximumRadius;else{e.clone(c,pe);var _=_e;s.multiplyByPoint(m.TRANSFORM_2D,c,_.origin),s.multiplyByPointAsVector(m.TRANSFORM_2D,d,_.direction);var y=l.globe;if(i(y)){var b=y.pick(_,l,ve);i(b)&&(s.multiplyByPoint(m.TRANSFORM_2D_INVERSE,b,g),g.z+=e.distance(c,g))}}var C=ge;C.right=.5*g.z,C.left=-C.right,C.top=C.right*(l.drawingBufferHeight/l.drawingBufferWidth),C.bottom=-C.top;var S=ye;S.position=g,S.direction=p,S.up=f,S.frustum=C;var A=M(S);v(t,A);var E=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){w(t,r,S,a,A)}});t._currentTweens.push(E)}function E(t,r,n){function o(e,t){e.position.x=t}function a(){w(t,r,c,o,T)}r*=.5;var l=t._scene,u=l.camera,c=Ce;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,be),l.mapProjection.project(be,c.position),e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);var d=we;e.clone(c.position2D,d.origin);var h=e.clone(u.directionWC,d.direction),p=n.scaleToGeodeticSurface(u.positionWC,Ee),g=f.eastNorthUpToFixedFrame(p,n,Ae);s.inverseTransformation(g,g),s.multiplyByPointAsVector(g,h,h),s.multiplyByPointAsVector(m.TRANSFORM_2D,h,h);var _=l.globe;if(i(_)){var y=_.pick(d,l,Te);if(i(y)){var b=e.distance(c.position2D,y);y.x+=b,e.clone(y,c.position2D)}}}s.multiplyByPoint(m.TRANSFORM_2D,c.position,c.position2D),s.multiplyByPointAsVector(m.TRANSFORM_2D,c.direction,c.direction2D),s.multiplyByPointAsVector(m.TRANSFORM_2D,c.up,c.up2D);var C=c.frustum;C.right=.5*c.position.z,C.left=-C.right,C.top=C.right*(l.drawingBufferHeight/l.drawingBufferWidth),C.bottom=-C.top;var S=Se;s.multiplyByPoint(m.TRANSFORM_2D_INVERSE,c.position2D,S.position),e.clone(c.direction,S.direction),e.clone(c.up,S.up),S.frustum=C;var T=M(S);v(t,T),I(t,r,c,a)}function x(e,t,r,i){function n(e){l.frustum.fov=a.lerp(d,c,e.time),l.position.z=h/Math.tan(.5*l.frustum.fov)}var s=e._scene,l=s.camera,u=l.frustum.right-l.frustum.left;l.frustum=r.frustum.clone();var c=l.frustum.fov,d=.5*a.RADIANS_PER_DEGREE,h=u*Math.tan(.5*c);l.frustum.far=h/Math.tan(.5*d)+1e7,l.frustum.fov=d;var p=s.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){i(e)}});e._currentTweens.push(p)}function P(t,r,i,n){function a(){function a(t){T(h,u,t.time,l.position),T(p,c,t.time,l.direction),T(f,d,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right)}l.frustum=i.frustum.clone();var h=e.clone(l.position,ne),p=e.clone(l.direction,oe),f=e.clone(l.up,ae);h.z=u.z;var m=s.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){n(t)}});t._currentTweens.push(m)}r*=.5;var s=t._scene,l=s.camera,u=e.clone(i.position,se),c=e.clone(i.direction,le),d=e.clone(i.up,ue);s._mode=g.MORPHING,t._morphToOrthographic?a():x(t,0,i,a)}function I(t,r,i,n){function a(t){T(u,h,t.time,l.position),T(c,p,t.time,l.direction),T(d,f,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right),l._adjustOrthographicFrustum(!0)}var s=t._scene,l=s.camera,u=e.clone(l.position,ne),c=e.clone(l.direction,oe),d=e.clone(l.up,ae),h=e.clone(i.position2D,se),p=e.clone(i.direction2D,le),f=e.clone(i.up2D,ue),m=s.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){D(t,s,1,0,r,n)}});t._currentTweens.push(m)}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 O(t){return function(r){var n=r._scene;if(n._mode=g.SCENE3D,n.morphTime=g.getMorphTime(g.SCENE3D),y(r),r._previousMode!==g.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),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,g.SCENE3D,a)}}function M(t){return function(r){var n=r._scene;n._mode=g.SCENE2D,n.morphTime=g.getMorphTime(g.SCENE2D),y(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,g.SCENE2D,a)}}function R(t){return function(r){var n=r._scene;if(n._mode=g.COLUMBUS_VIEW,n.morphTime=g.getMorphTime(g.COLUMBUS_VIEW),y(r),r._previousModeMode!==g.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,g.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._morphToOrthographic=r.camera.frustum instanceof l,this._previousMode!==g.SCENE2D&&this._previousMode!==g.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,g.SCENE2D,!0),r._mode=g.MORPHING,r.camera._setTransform(s.IDENTITY),this._previousMode===g.COLUMBUS_VIEW?A(this,e):E(this,e,t),0===e&&i(this._completeMorph)&&this._completeMorph())};var L=new e,N=new e,k=new e,F=new e,B=new e,U=new e,V=new e,z=new t,G=new s,H=new c,W=new l,j={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!==g.COLUMBUS_VIEW&&this._previousMode!==g.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,g.COLUMBUS_VIEW,!0),n.camera._setTransform(s.IDENTITY);var o=L,l=N,u=k;if(t>0)o.x=0,o.y=-1,o.z=1,o=e.multiplyByScalar(e.normalize(o,o),5*r.maximumRadius,o),e.negate(e.normalize(o,l),l),e.cross(e.UNIT_X,l,u);else{
var c=n.camera;if(this._previousMode===g.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 d=r.scaleToGeodeticSurface(o,V),h=f.eastNorthUpToFixedFrame(d,r,G);s.inverseTransformation(h,h),n.mapProjection.project(r.cartesianToCartographic(o,z),o),s.multiplyByPointAsVector(h,l,l),s.multiplyByPointAsVector(h,u,u)}}var p;this._morphToOrthographic?(p=W,p.width=n.camera.frustum.right-n.camera.frustum.left,p.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(p=H,p.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,p.fov=a.toRadians(60));var _=j;_.position=o,_.direction=l,_.up=u,_.frustum=p;var y=R(_);v(this,y),this._previousMode===g.SCENE2D?P(this,t,_,y):(_.position2D=s.multiplyByPoint(m.TRANSFORM_2D,o,F),_.direction2D=s.multiplyByPointAsVector(m.TRANSFORM_2D,l,B),_.up2D=s.multiplyByPointAsVector(m.TRANSFORM_2D,u,U),n._mode=g.MORPHING,I(this,t,_,y)),0===t&&i(this._completeMorph)&&this._completeMorph()}};var q={position:new e,direction:new e,up:new e,frustum:void 0},Y=new c;_.prototype.morphTo3D=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==g.SCENE3D&&this._previousMode!==g.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,g.SCENE3D,!0),n._mode=g.MORPHING,n.camera._setTransform(s.IDENTITY),this._previousMode===g.SCENE2D)S(this,t,r);else{var o;t>0?(o=q,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=b(this,r);var u,c=n.camera;c.frustum instanceof l?u=c.frustum.clone():(u=Y,u.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,u.fov=a.toRadians(60)),o.frustum=u;var d=O(o);v(this,d),C(this,t,o,d)}0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return y(this),n(this)};var X=new t,Q=new e,Z=new s,K=new e,J=new e,$=new e,ee=new e,te=new e,re=new e,ie=new l,ne=new e,oe=new e,ae=new e,se=new e,le=new e,ue=new e,ce=new e,de=new e,he=new e,pe=new e,fe=new e,me=new e,ge=new u,_e=new d,ve=new e,ye={position:void 0,direction:void 0,up:void 0,frustum:void 0},be=new t,Ce={position:new e,direction:new e,up:new e,position2D:new e,direction2D:new e,up2D:new e,frustum:new u},Se={position:new e,direction:new e,up:new e,frustum:void 0},Te=new e,we=new d,Ae=new s,Ee=new e;return _}),define("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t,r,i,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=r,this._startObject=e(i),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 i(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)},i(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(i){if(i=t(i,t.EMPTY_OBJECT),0===i.duration)return r(i.complete)&&i.complete(),new u(this);var n=i.duration/s.SECONDS_PER_MILLISECOND,a=t(i.delay,0),c=a/s.SECONDS_PER_MILLISECOND,d=t(i.easingFunction,o.LINEAR_NONE),h=i.startObject,p=new l.Tween(h);p.to(e(i.stopObject),n),p.delay(c),p.easing(d),r(i.update)&&p.onUpdate(function(){i.update(h)}),p.onComplete(t(i.complete,null)),p.repeat(t(i._repeat,0));var f=new u(this,p,i.startObject,i.stopObject,i.duration,a,d,i.update,i.complete,i.cancel);return this._tweens.push(f),f},c.prototype.addProperty=function(e){function r(e){i[n]=e.value}e=t(e,t.EMPTY_OBJECT);var i=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:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function i(e){for(var t=o.length,r=0;r<t;++r)n.uniforms[o[r]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&r(n.uniforms[a])&&r(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:i,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.material,i=r.uniforms;return this.addProperty({object:i,property:"offset",startValue:i.offset,stopValue:i.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(!r(e))return!1;var t=this._tweens.indexOf(e);return-1!==t&&(e.tweenjs.stop(),r(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 i=e[t];i.tweenjs.stop(),r(i.cancel)&&i.cancel()}e.length=0},c.prototype.contains=function(e){return r(e)&&-1!==this._tweens.indexOf(e)},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,i=0;for(e=r(e)?e/s.SECONDS_PER_MILLISECOND:a();i<t.length;){var n=t[i],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?i++:(o.stop(),t.splice(i,1))}},c}),define("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/HeadingPitchRoll","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/OrthographicFrustum","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./MapMode2D","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E){"use strict";function x(r){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=S.LEFT_DRAG,this.zoomEventTypes=[S.RIGHT_DRAG,S.WHEEL,S.PINCH],this.rotateEventTypes=S.LEFT_DRAG,this.tiltEventTypes=[S.MIDDLE_DRAG,S.PINCH,{eventType:S.LEFT_DRAG,modifier:h.CTRL},{eventType:S.RIGHT_DRAG,modifier:h.CTRL}],this.lookEventTypes={eventType:S.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=r,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new C(r.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new E,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=r.mapProjection;this._maxCoord=n.project(new i(Math.PI,p.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 P(e,t){if(e<0)return 0;var r=25*(1-t);return Math.exp(-r*e)}function I(t){return e.equalsEpsilon(t.startPosition,t.endPosition,p.EPSILON14)}function D(t,r,i,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(r,i),d=t.getButtonReleaseTime(r,i),h=c&&d&&(d.getTime()-c.getTime())/1e3,p=new Date,f=d&&(p.getTime()-d.getTime())/1e3;if(c&&d&&h<te){var m=P(f,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,m,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var g=t.getLastMovement(r,i);if(!o(g)||I(g))return;u.motion.x=.5*(g.endPosition.x-g.startPosition.x),u.motion.y=.5*(g.endPosition.y-g.startPosition.y),u.startPosition=e.clone(g.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,m,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(r,i)){a(s,t.getStartMousePosition(r,i),u)}}else u.active=!1}function O(e,t,r,i,n,a){if(o(r)){var s=e._aggregator;d(r)||(re[0]=r,r=re);for(var l=r.length,u=0;u<l;++u){var c=r[u],h=o(c.eventType)?c.eventType:c,p=c.modifier,f=s.isMoving(h,p)&&s.getMovement(h,p),m=s.getStartMousePosition(h,p);e.enableInputs&&t&&(f?i(e,m,f):n<1&&D(s,h,p,n,i,e,a))}}}function M(r,i,n,a,s,l){var u=1;o(l)&&(u=p.clamp(Math.abs(l),.25,1));var c=r.minimumZoomDistance*u,d=r.maximumZoomDistance,h=s-c,f=a*h;f=p.clamp(f,r._minimumZoomRate,r._maximumZoomRate);var m=n.endPosition.y-n.startPosition.y,_=m/r._scene.canvas.clientHeight;_=Math.min(_,r.maximumMovementRatio);var v=f*_;if(!(v>0&&Math.abs(s-c)<1||v<0&&Math.abs(s-d)<1)){s-v<c?v=s-c-1:s-v>d&&(v=s-d);var y=r._scene,b=y.camera,C=y.mode,S=Ee.orientation;if(S.heading=b.heading,S.pitch=b.pitch,S.roll=b.roll,b.frustum instanceof g)return void(Math.abs(v)>0&&(b.zoomIn(v),b._adjustOrthographicFrustum()));var T,E=e.equals(i,r._zoomMouseStart),x=r._zoomingOnVector,P=r._rotatingZoom;if(E||(r._zoomMouseStart=e.clone(i,r._zoomMouseStart),o(r._globe)&&(T=C!==w.SCENE2D?B(r,i,ne):b.getPickRay(i,ie).origin),o(T)?(r._useZoomWorldPosition=!0,r._zoomWorldPosition=t.clone(T,r._zoomWorldPosition)):r._useZoomWorldPosition=!1,x=r._zoomingOnVector=!1,P=r._rotatingZoom=!1),!r._useZoomWorldPosition)return void b.zoomIn(v);var I=C===w.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(P=!0),!E||P){if(C===w.SCENE2D){var D=r._zoomWorldPosition,O=b.position;if(!t.equals(D,O)&&b.positionCartographic.height<2*r._maxCoord.x){var M=b.position.x,R=t.subtract(D,O,ae);t.normalize(R,R);var L=t.distance(D,O)*v/(.5*b.getMagnitude());b.move(R,.5*L),(b.position.x<0&&M>0||b.position.x>0&&M<0)&&(T=b.getPickRay(i,ie).origin,r._zoomWorldPosition=t.clone(T,r._zoomWorldPosition))}}else if(C===w.SCENE3D){var N=t.normalize(b.position,he);if(b.positionCartographic.height<3e3&&Math.abs(t.dot(b.direction,N))<.6)I=!0;else{var k=y.canvas,F=se;F.x=k.clientWidth/2,F.y=k.clientHeight/2;var U=B(r,F,le);if(o(U)&&b.positionCartographic.height<1e6){var V=fe;t.clone(b.position,V);var z=r._zoomWorldPosition,G=pe;if(G=t.normalize(z,G),t.dot(G,N)<0)return;var H=Se,W=_e;t.clone(b.direction,W),t.add(V,t.multiplyByScalar(W,1e3,Te),H);var j=ve,q=ye;t.subtract(z,V,j),t.normalize(j,q);var Y=t.dot(N,q);if(Y>=0)return void(r._zoomMouseStart.x=-1);var X=Math.acos(-Y),Q=t.magnitude(V),Z=t.magnitude(z),K=Q-v,J=t.magnitude(j),$=Math.asin(p.clamp(J/Z*Math.sin(X),-1,1)),ee=Math.asin(p.clamp(K/Z*Math.sin(X),-1,1)),te=$-ee+X,re=me;t.normalize(V,re);var xe=ge;xe=t.cross(q,re,xe),xe=t.normalize(xe,xe),t.normalize(t.cross(re,xe,Te),W),t.multiplyByScalar(t.normalize(H,Te),t.magnitude(H)-v,H),t.normalize(V,V),t.multiplyByScalar(V,K,V);var Pe=be;t.multiplyByScalar(t.add(t.multiplyByScalar(re,Math.cos(te)-1,we),t.multiplyByScalar(W,Math.sin(te),Ae),Te),K,Pe),t.add(V,Pe,V),t.normalize(H,re),t.normalize(t.cross(re,xe,Te),W);var Ie=Ce;return t.multiplyByScalar(t.add(t.multiplyByScalar(re,Math.cos(te)-1,we),t.multiplyByScalar(W,Math.sin(te),Ae),Te),t.magnitude(H),Ie),t.add(H,Ie,H),t.clone(V,b.position),t.normalize(t.subtract(H,V,Te),b.direction),t.clone(b.direction,b.direction),t.cross(b.direction,b.up,b.right),t.cross(b.right,b.direction,b.up),void b.setView(Ee)}if(o(U)){var De=t.normalize(U,ue),Oe=t.normalize(r._zoomWorldPosition,ce),Me=t.dot(Oe,De);if(Me>0&&Me<1){var Re=p.acosClamped(Me),Le=t.cross(Oe,De,de),Ne=Math.abs(Re)>p.toRadians(20)?.75*b.positionCartographic.height:b.positionCartographic.height-v,ke=v/Ne;b.rotate(Le,Re*ke)}}else I=!0}}r._rotatingZoom=!I}if(!E&&I||x){var Fe,Be=A.wgs84ToWindowCoordinates(y,r._zoomWorldPosition,oe);Fe=C!==w.COLUMBUS_VIEW&&e.equals(i,r._zoomMouseStart)&&o(Be)?b.getPickRay(Be,ie):b.getPickRay(i,ie);var Ue=Fe.direction;C===w.COLUMBUS_VIEW&&t.fromElements(Ue.y,Ue.z,Ue.x,Ue),b.move(Ue,v),r._zoomingOnVector=!0}else b.zoomIn(v);b.setView(Ee)}}function R(e,r,i){var n=e._scene,o=n.camera,a=o.getPickRay(i.startPosition,xe).origin,s=o.getPickRay(i.endPosition,Pe).origin,l=t.subtract(a,s,Ie),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function L(e,t,r){o(r.distance)&&(r=r.distance);var i=e._scene,n=i.camera;M(e,t,r,e._zoomFactor,n.getMagnitude())}function N(t,r,i){if(o(i.angleAndHeight))return void k(t,r,i.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=De;c.x=2/l*i.startPosition.x-1,c.y=2/u*(u-i.startPosition.y)-1,c=e.normalize(c,c);var d=Oe;d.x=2/l*i.endPosition.x-1,d.y=2/u*(u-i.endPosition.y)-1,d=e.normalize(d,d);var h=p.acosClamped(c.x);c.y<0&&(h=p.TWO_PI-h);var f=p.acosClamped(d.x);d.y<0&&(f=p.TWO_PI-f);var m=f-h;a.twistRight(m)}function k(e,t,r){var i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(r.endPosition.x-r.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=i*s*Math.PI*4;o.twistRight(l)}function F(e){var t=e._scene.mapMode2D===T.ROTATE;m.equals(m.IDENTITY,e._scene.camera.transform)?(O(e,e.enableTranslate,e.translateEventTypes,R,e.inertiaTranslate,"_lastInertiaTranslateMovement"),O(e,e.enableZoom,e.zoomEventTypes,L,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&O(e,e.enableRotate,e.tiltEventTypes,N,e.inertiaSpin,"_lastInertiaTiltMovement")):(O(e,e.enableZoom,e.zoomEventTypes,L,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&O(e,e.enableRotate,e.translateEventTypes,N,e.inertiaSpin,"_lastInertiaSpinMovement"))}function B(e,r,i){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPositionWorldCoordinates(r,Re));var u=s.getPickRay(r,Me),c=a.pick(u,n,Le);return(o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY)<(o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY)?t.clone(l,i):t.clone(c,i)}}function U(r,i,n){if(t.equals(i,r._translateMousePosition)||(r._looking=!1),t.equals(i,r._strafeMousePosition)||(r._strafing=!1),r._looking)return void $(r,i,n);if(r._strafing)return void j(r,i,n);var a,s=r._scene,l=s.camera,u=e.clone(n.startPosition,Ge),d=e.clone(n.endPosition,He),h=l.getPickRay(u,Ne),f=t.clone(t.ZERO,Ve),m=t.UNIT_X;if(l.position.z<r._minimumPickingTerrainHeight&&(a=B(r,u,Fe),o(a)&&(f.x=a.x)),f.x>l.position.z&&o(a))return t.clone(a,r._strafeStartPosition),r._strafing=!0,j(r,i,n),void(r._strafeMousePosition=e.clone(i,r._strafeMousePosition));var g=_.fromPointNormal(f,m,ze);h=l.getPickRay(u,Ne);var v=c.rayPlane(h,g,Fe),y=l.getPickRay(d,ke),b=c.rayPlane(y,g,Be);if(!o(v)||!o(b))return r._looking=!0,$(r,i,n),void e.clone(i,r._translateMousePosition);var C=t.subtract(v,b,Ue),S=C.x;C.x=C.y,C.y=C.z,C.z=S;var T=t.magnitude(C);T>p.EPSILON6&&(t.normalize(C,C),l.move(C,T))}function V(t,r,i){if(o(i.angleAndHeight)&&(i=i.angleAndHeight),e.equals(r,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void $(t,r,i);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,z(t,r,i)):G(t,r,i)}function z(r,i,n){var a=r._scene,s=a.camera,u=a.canvas,c=We;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var d,h=s.getPickRay(c,je),f=t.UNIT_X,g=h.origin,_=h.direction,v=t.dot(f,_);if(Math.abs(v)>p.EPSILON6&&(d=-t.dot(f,g)/v),!o(d)||d<=0)return r._looking=!0,$(r,i,n),void e.clone(i,r._tiltCenterMousePosition);var y=t.multiplyByScalar(_,d,qe);t.add(g,y,y);var C=a.mapProjection,S=C.ellipsoid;t.fromElements(y.y,y.z,y.x,y);var T=C.unproject(y,$e);S.cartographicToCartesian(T,y);var w=b.eastNorthUpToFixedFrame(y,S,Xe),A=r._globe,E=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var x=m.clone(s.transform,et);s._setTransform(w),Y(r,i,n,t.UNIT_Z),s._setTransform(x),r._globe=A,r._ellipsoid=E;var P=E.maximumRadius;r._rotateFactor=1/P,r._rotateRateRangeAdjustment=P}function G(r,i,n){var a,s,u=r._scene,d=u.camera,h=t.UNIT_X;if(e.equals(i,r._tiltCenterMousePosition))a=t.clone(r._tiltCenter,qe);else{if(d.position.z<r._minimumPickingTerrainHeight&&(a=B(r,i,qe)),!o(a)){s=d.getPickRay(i,je);var g,y=s.origin,C=s.direction,S=t.dot(h,C);if(Math.abs(S)>p.EPSILON6&&(g=-t.dot(h,y)/S),!o(g)||g<=0)return r._looking=!0,$(r,i,n),void e.clone(i,r._tiltCenterMousePosition);a=t.multiplyByScalar(C,g,qe),t.add(y,a,a)}e.clone(i,r._tiltCenterMousePosition),t.clone(a,r._tiltCenter)}var T=u.canvas,w=We;w.x=T.clientWidth/2,w.y=r._tiltCenterMousePosition.y,s=d.getPickRay(w,je);var A=t.clone(t.ZERO,Ze);A.x=a.x;var E=_.fromPointNormal(A,h,Ke),x=c.rayPlane(s,E,Ye),P=d._projection,I=P.ellipsoid;t.fromElements(a.y,a.z,a.x,a);var D=P.unproject(a,$e);I.cartographicToCartesian(D,a);var O,M=b.eastNorthUpToFixedFrame(a,I,Xe);o(x)?(t.fromElements(x.y,x.z,x.x,x),D=P.unproject(x,$e),I.cartographicToCartesian(D,x),O=b.eastNorthUpToFixedFrame(x,I,Qe)):O=M;var R=r._globe,L=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var N=t.UNIT_Z,k=m.clone(d.transform,et);d._setTransform(M);var F=t.cross(t.UNIT_Z,t.normalize(d.position,Je),Je),U=t.dot(d.right,F);if(Y(r,i,n,N,!1,!0),d._setTransform(O),U<0){n.startPosition.y>n.endPosition.y&&(N=void 0);var V=d.constrainedAxis;d.constrainedAxis=void 0,Y(r,i,n,N,!0,!1),d.constrainedAxis=V}else Y(r,i,n,N,!0,!1);if(o(d.constrainedAxis)){var z=t.cross(d.direction,d.constrainedAxis,it);t.equalsEpsilon(z,t.ZERO,p.EPSILON6)||(t.dot(z,d.right)<0&&t.negate(z,z),t.cross(z,d.direction,d.up),t.cross(d.direction,d.up,d.right),t.normalize(d.up,d.up),t.normalize(d.right,d.right))}d._setTransform(k),r._globe=R,r._ellipsoid=L;var G=L.maximumRadius;r._rotateFactor=1/G,r._rotateRateRangeAdjustment=G;var H=t.clone(d.positionWC,Je);if(d._adjustHeightForTerrain(),!t.equals(d.positionWC,H)){d._setTransform(O),d.worldToCameraCoordinatesPoint(H,H);var W=t.magnitudeSquared(H);t.magnitudeSquared(d.position)>W&&(t.normalize(d.position,d.position),t.multiplyByScalar(d.position,Math.sqrt(W),d.position));var j=t.angleBetween(H,d.position),q=t.cross(H,d.position,H);t.normalize(q,q);var X=v.fromAxisAngle(q,j,tt),Q=f.fromQuaternion(X,rt);f.multiplyByVector(Q,d.direction,d.direction),f.multiplyByVector(Q,d.up,d.up),t.cross(d.direction,d.up,d.right),t.cross(d.right,d.direction,d.up),d._setTransform(k)}}function H(e,r,i){o(i.distance)&&(i=i.distance);var n=e._scene,a=n.camera,s=n.canvas,l=nt;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,ot);a.position.z<e._minimumPickingTerrainHeight&&(u=B(e,l,at));var d;if(o(u))d=t.distance(c.origin,u);else{var h=t.UNIT_X,p=c.origin,f=c.direction;d=-t.dot(h,p)/t.dot(h,f)}M(e,r,i,e._zoomFactor,d)}function W(e){var t=e._scene,r=t.camera;if(m.equals(m.IDENTITY,r.transform)){var i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),O(e,e.enableTilt,e.tiltEventTypes,V,e.inertiaSpin,"_lastInertiaTiltMovement"),O(e,e.enableTranslate,e.translateEventTypes,U,e.inertiaTranslate,"_lastInertiaTranslateMovement"),O(e,e.enableZoom,e.zoomEventTypes,H,e.inertiaZoom,"_lastInertiaZoomMovement"),O(e,e.enableLook,e.lookEventTypes,$),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||i.contains(e._tween))){var n=r.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=i.add(n))}i.update()}else O(e,e.enableRotate,e.rotateEventTypes,Y,e.inertiaSpin,"_lastInertiaSpinMovement"),O(e,e.enableZoom,e.zoomEventTypes,Q,e.inertiaZoom,"_lastInertiaZoomMovement")}function j(e,r,i){var n=e._scene,a=n.camera,s=B(e,i.startPosition,dt);if(o(s)){var l=i.endPosition,u=a.getPickRay(l,st),d=t.clone(a.direction,ct);n.mode===w.COLUMBUS_VIEW&&t.fromElements(d.z,d.x,d.y,d);var h=_.fromPointNormal(s,d,lt),p=c.rayPlane(u,h,ut);o(p)&&(d=t.subtract(s,p,d),n.mode===w.COLUMBUS_VIEW&&t.fromElements(d.y,d.z,d.x,d),t.add(a.position,d,a.position))}}function q(r,i,n){var a=r._scene,s=a.camera;if(!m.equals(s.transform,m.IDENTITY))return void Y(r,i,n);var u,c,d,h,p=r._ellipsoid.geodeticSurfaceNormal(s.position,gt),f=r._ellipsoid.cartesianToCartographic(s.positionWC,pt).height,g=r._globe,_=!1;if(o(g)&&f<r._minimumPickingTerrainHeight&&(h=B(r,n.startPosition,dt),o(h))){var v=s.getPickRay(n.startPosition,Me),y=r._ellipsoid.geodeticSurfaceNormal(h);_=Math.abs(t.dot(v.direction,y))<.05,_&&!r._looking&&(r._rotating=!1,r._strafing=!0)}if(e.equals(i,r._rotateMousePosition))return void(r._looking?$(r,i,n,p):r._rotating?Y(r,i,n):r._strafing?(t.clone(h,r._strafeStartPosition),j(r,i,n)):(u=t.magnitude(r._rotateStartPosition),c=ft,c.x=c.y=c.z=u,d=l.fromCartesian3(c,mt),X(r,i,n,d)));r._looking=!1,r._rotating=!1,r._strafing=!1,o(g)&&f<r._minimumPickingTerrainHeight?o(h)?t.magnitude(s.position)<t.magnitude(h)?(t.clone(h,r._strafeStartPosition),r._strafing=!0,j(r,i,n)):(u=t.magnitude(h),c=ft,c.x=c.y=c.z=u,d=l.fromCartesian3(c,mt),X(r,i,n,d),t.clone(h,r._rotateStartPosition)):(r._looking=!0,$(r,i,n,p)):o(s.pickEllipsoid(n.startPosition,r._ellipsoid,ht))?(X(r,i,n,r._ellipsoid),t.clone(ht,r._rotateStartPosition)):f>r._minimumTrackBallHeight?(r._rotating=!0,Y(r,i,n)):(r._looking=!0,$(r,i,n,p)),e.clone(i,r._rotateMousePosition)}function Y(e,r,i,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,d=u.canvas,h=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var p=t.magnitude(c.position),f=e._rotateFactor*(p-e._rotateRateRangeAdjustment);f>e._maximumRotateRate&&(f=e._maximumRotateRate),f<e._minimumRotateRate&&(f=e._minimumRotateRate);var m=(i.startPosition.x-i.endPosition.x)/d.clientWidth,g=(i.startPosition.y-i.endPosition.y)/d.clientHeight;m=Math.min(m,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);var _=f*m*Math.PI*2,v=f*g*Math.PI;s||c.rotateRight(_),l||c.rotateUp(v),c.constrainedAxis=h}function X(r,i,n,a){var s=r._scene,l=s.camera,u=e.clone(n.startPosition,Tt),c=e.clone(n.endPosition,wt),d=l.pickEllipsoid(u,a,_t),h=l.pickEllipsoid(c,a,vt);if(!o(d)||!o(h))return r._rotating=!0,void Y(r,i,n);if(d=l.worldToCameraCoordinates(d,d),h=l.worldToCameraCoordinates(h,h),o(l.constrainedAxis)){var f=l.constrainedAxis,m=t.mostOrthogonalAxis(f,yt);t.cross(m,f,m),t.normalize(m,m);var g=t.cross(f,m,bt),_=t.magnitude(d),v=t.dot(f,d),y=Math.acos(v/_),b=t.multiplyByScalar(f,v,Ct);t.subtract(d,b,b),t.normalize(b,b);var C=t.magnitude(h),S=t.dot(f,h),T=Math.acos(S/C),w=t.multiplyByScalar(f,S,St);t.subtract(h,w,w),t.normalize(w,w);var A=Math.acos(t.dot(b,m));t.dot(b,g)<0&&(A=p.TWO_PI-A);var E=Math.acos(t.dot(w,m));t.dot(w,g)<0&&(E=p.TWO_PI-E);var x,P=A-E;x=t.equalsEpsilon(f,l.position,p.EPSILON2)?l.right:t.cross(f,l.position,yt);var I,D=t.cross(f,x,yt),O=t.dot(D,t.subtract(d,f,bt)),M=t.dot(D,t.subtract(h,f,bt));I=O>0&&M>0?T-y:O>0&&M<=0?t.dot(l.position,f)>0?-y-T:y+T:y-T,l.rotateRight(P),l.rotateUp(I)}else{t.normalize(d,d),t.normalize(h,h);var R=t.dot(d,h),L=t.cross(d,h,yt);if(R<1&&!t.equalsEpsilon(L,t.ZERO,p.EPSILON14)){var N=Math.acos(R);l.rotate(L,N)}}}function Q(e,r,i){o(i.distance)&&(i=i.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=nt;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,d=s.getPickRay(u,ot),h=n.cartesianToCartographic(s.position,Et).height;h<e._minimumPickingTerrainHeight&&(c=B(e,u,at));var p;p=o(c)?t.distance(d.origin,c):h;var f=t.normalize(s.position,At);M(e,r,i,e._zoomFactor,p,t.dot(f,s.direction))}function Z(t,r,i){var n=t._scene,a=n.camera;if(m.equals(a.transform,m.IDENTITY)){if(o(i.angleAndHeight)&&(i=i.angleAndHeight),e.equals(r,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){return void $(t,r,i,t._ellipsoid.geodeticSurfaceNormal(a.position,Ft))}var s=t._ellipsoid,l=s.cartesianToCartographic(a.position,kt);t._tiltOnEllipsoid||l.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,K(t,r,i)):J(t,r,i)}}function K(r,i,n){var a=r._ellipsoid,s=r._scene,u=s.camera,d=.25*r.minimumZoomDistance,h=a.cartesianToCartographic(u.positionWC,Bt).height;if(!(h-d-1<p.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var f=s.canvas,g=xt;g.x=f.clientWidth/2,g.y=f.clientHeight/2;var _,v=u.getPickRay(g,Pt),C=c.rayEllipsoid(v,a);if(o(C))_=y.getPoint(v,C.start,It);else{if(!(h>r._minimumTrackBallHeight)){r._looking=!0;return $(r,i,n,r._ellipsoid.geodeticSurfaceNormal(u.position,Ft)),void e.clone(i,r._tiltCenterMousePosition)}var S=c.grazingAltitudeLocation(v,a);if(!o(S))return;var T=a.cartesianToCartographic(S,kt);T.height=0,_=a.cartographicToCartesian(T,It)}var w=b.eastNorthUpToFixedFrame(_,a,Ot),A=r._globe,E=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var x=m.clone(u.transform,Rt);u._setTransform(w),Y(r,i,n,t.UNIT_Z),u._setTransform(x),r._globe=A,r._ellipsoid=E;var P=E.maximumRadius;r._rotateFactor=1/P,r._rotateRateRangeAdjustment=P}}function J(r,i,n){var a,s,u,d=r._ellipsoid,h=r._scene,g=h.camera;if(e.equals(i,r._tiltCenterMousePosition))a=t.clone(r._tiltCenter,It);else{if(a=B(r,i,It),!o(a)){if(s=g.getPickRay(i,Pt),u=c.rayEllipsoid(s,d),!o(u)){if(d.cartesianToCartographic(g.position,kt).height<=r._minimumTrackBallHeight){r._looking=!0;$(r,i,n,r._ellipsoid.geodeticSurfaceNormal(g.position,Ft)),e.clone(i,r._tiltCenterMousePosition)}return}a=y.getPoint(s,u.start,It)}e.clone(i,r._tiltCenterMousePosition),t.clone(a,r._tiltCenter)}var _=h.canvas,C=xt;C.x=_.clientWidth/2,C.y=r._tiltCenterMousePosition.y,s=g.getPickRay(C,Pt);var S=t.magnitude(a),T=t.fromElements(S,S,S,ft),w=l.fromCartesian3(T,mt);if(u=c.rayEllipsoid(s,w),o(u)){var A=t.magnitude(s.origin)>S?u.start:u.stop,E=y.getPoint(s,A,Dt),x=b.eastNorthUpToFixedFrame(a,d,Ot),P=b.eastNorthUpToFixedFrame(E,w,Mt),I=r._globe,D=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var O=t.UNIT_Z,M=m.clone(g.transform,Rt);g._setTransform(x);var R=t.cross(E,g.positionWC,it),L=t.dot(g.rightWC,R);if(Y(r,i,n,O,!1,!0),g._setTransform(P),L<0){n.startPosition.y>n.endPosition.y&&(O=void 0);var N=g.constrainedAxis;g.constrainedAxis=void 0,Y(r,i,n,O,!0,!1),g.constrainedAxis=N}else Y(r,i,n,O,!0,!1);if(o(g.constrainedAxis)){var k=t.cross(g.direction,g.constrainedAxis,it);t.equalsEpsilon(k,t.ZERO,p.EPSILON6)||(t.dot(k,g.right)<0&&t.negate(k,k),t.cross(k,g.direction,g.up),t.cross(g.direction,g.up,g.right),t.normalize(g.up,g.up),t.normalize(g.right,g.right))}g._setTransform(M),r._globe=I,r._ellipsoid=D;var F=D.maximumRadius;r._rotateFactor=1/F,r._rotateRateRangeAdjustment=F;var U=t.clone(g.positionWC,it);if(g._adjustHeightForTerrain(),!t.equals(g.positionWC,U)){g._setTransform(P),g.worldToCameraCoordinatesPoint(U,U);var V=t.magnitudeSquared(U);t.magnitudeSquared(g.position)>V&&(t.normalize(g.position,g.position),t.multiplyByScalar(g.position,Math.sqrt(V),g.position));var z=t.angleBetween(U,g.position),G=t.cross(U,g.position,U);t.normalize(G,G);var H=v.fromAxisAngle(G,z,Lt),W=f.fromQuaternion(H,Nt);f.multiplyByVector(W,g.direction,g.direction),f.multiplyByVector(W,g.up,g.up),t.cross(g.direction,g.up,g.right),t.cross(g.right,g.direction,g.up),g._setTransform(M)}}}function $(e,r,i,a){var s=e._scene,l=s.camera,u=Ut;u.x=i.startPosition.x,u.y=0;var c=Vt;c.x=i.endPosition.x,c.y=0;var d,h,f=l.getPickRay(u,zt),m=l.getPickRay(c,Gt),_=0;l.frustum instanceof g?(d=f.origin,h=m.origin,t.add(l.direction,d,d),t.add(l.direction,h,h),t.subtract(d,l.position,d),t.subtract(h,l.position,h),t.normalize(d,d),t.normalize(h,h)):(d=f.direction,h=m.direction);var v=t.dot(d,h);v<1&&(_=Math.acos(v)),_=i.startPosition.x>i.endPosition.x?-_:_;var y=e._horizontalRotationAxis;if(o(a)?l.look(a,-_):o(y)?l.look(y,-_):l.lookLeft(_),u.x=0,u.y=i.startPosition.y,c.x=0,c.y=i.endPosition.y,f=l.getPickRay(u,zt),m=l.getPickRay(c,Gt),_=0,l.frustum instanceof g?(d=f.origin,h=m.origin,t.add(l.direction,d,d),t.add(l.direction,h,h),t.subtract(d,l.position,d),t.subtract(h,l.position,h),t.normalize(d,d),t.normalize(h,h)):(d=f.direction,h=m.direction),v=t.dot(d,h),v<1&&(_=Math.acos(v)),_=i.startPosition.y>i.endPosition.y?-_:_,a=n(a,y),o(a)){var b=l.direction,C=t.negate(a,Ht),S=t.equalsEpsilon(b,a,p.EPSILON2),T=t.equalsEpsilon(b,C,p.EPSILON2);if(S||T)(S&&_<0||T&&_>0)&&l.look(l.right,-_);else{v=t.dot(b,a);var w=p.acosClamped(v);_>0&&_>w&&(_=w-p.EPSILON4),v=t.dot(b,C),w=p.acosClamped(v),_<0&&-_>w&&(_=-w+p.EPSILON4);var A=t.cross(a,b,Wt);l.look(A,_)}}else l.lookUp(_)}function ee(e){O(e,e.enableRotate,e.rotateEventTypes,q,e.inertiaSpin,"_lastInertiaSpinMovement"),O(e,e.enableZoom,e.zoomEventTypes,Q,e.inertiaZoom,"_lastInertiaZoomMovement"),O(e,e.enableTilt,e.tiltEventTypes,Z,e.inertiaSpin,"_lastInertiaTiltMovement"),O(e,e.enableLook,e.lookEventTypes,$)}var te=.4,re=[],ie=new y,ne=new t,oe=new e,ae=new t,se=new e,le=new t,ue=new t,ce=new t,de=new t,he=new t,pe=new t,fe=new t,me=new t,ge=new t,_e=new t,ve=new t,ye=new t,be=new t,Ce=new t,Se=new t,Te=new t,we=new t,Ae=new t,Ee={orientation:new u},xe=new y,Pe=new y,Ie=new t,De=new e,Oe=new e,Me=new y,Re=new t,Le=new t,Ne=new y,ke=new y,Fe=new t,Be=new t,Ue=new t,Ve=new t,ze=new _(t.UNIT_X,0),Ge=new e,He=new e,We=new e,je=new y,qe=new t,Ye=new t,Xe=new m,Qe=new m,Ze=new t,Ke=new _(t.UNIT_X,0),Je=new t,$e=new i,et=new m,tt=new v,rt=new f,it=new t,nt=new e,ot=new y,at=new t,st=new y,lt=new _(t.UNIT_X,0),ut=new t,ct=new t,dt=new t,ht=new t,pt=new i,ft=new t,mt=new l,gt=new t,_t=r.clone(r.UNIT_W),vt=r.clone(r.UNIT_W),yt=new t,bt=new t,Ct=new t,St=new t,Tt=new e,wt=new e,At=new t,Et=new i,xt=new e,Pt=new y,It=new t,Dt=new t,Ot=new m,Mt=new m,Rt=new m,Lt=new v,Nt=new f,kt=new i,Ft=new t,Bt=new i,Ut=new e,Vt=new e,zt=new y,Gt=new y,Ht=new t,Wt=new t;return x.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 r=this._scene,i=r.mode
;i===w.SCENE2D?F(this):i===w.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,W(this)):i===w.SCENE3D&&(this._horizontalRotationAxis=void 0,ee(this)),this._aggregator.reset()},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},x}),define("Scene/ShadowMapShader",["../Core/defined","../Renderer/ShaderSource"],function(e,t){"use strict";function r(){}return r.getShadowCastShaderKeyword=function(e,t,r,i){return"castShadow "+e+" "+t+" "+r+" "+i},r.createShadowCastVertexShader=function(r,i,n){var o=r.defines.slice(0),a=r.sources.slice(0);n&&o.push("GENERATE_POSITION");var s=t.findPositionVarying(r),l=e(s);if(i&&!l){for(var u=a.length,c=0;c<u;++c)a[c]=t.replaceMain(a[c],"czm_shadow_cast_main");a.push("varying vec3 v_positionEC; \nvoid main() \n{ \n    czm_shadow_cast_main(); \n    v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}return new t({defines:o,sources:a})},r.createShadowCastFragmentShader=function(r,i,n,o){var a=r.defines.slice(0),s=r.sources.slice(0),l=t.findPositionVarying(r),u=e(l);u||(l="v_positionEC");for(var c=s.length,d=0;d<c;++d)s[d]=t.replaceMain(s[d],"czm_shadow_cast_main");var h="";return i&&(u||(h+="varying vec3 v_positionEC; \n"),h+="uniform vec4 shadowMap_lightPositionEC; \n"),h+=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",h+=i?"    float distance = length("+l+"); \n    if (distance >= shadowMap_lightPositionEC.w) \n    { \n        discard; \n    } \n    distance /= shadowMap_lightPositionEC.w; // radius \n    gl_FragColor = czm_packDepth(distance); \n":n?"    gl_FragColor = vec4(1.0); \n":"    gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",h+="} \n",s.push(h),new t({defines:a,sources:s})},r.getShadowReceiveShaderKeyword=function(e,t,r,i){return"receiveShadow "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(e._numberOfCascades>1)+e.debugCascadeColors+e.softShadows+t+r+i},r.createShadowReceiveVertexShader=function(e,r,i){var n=e.defines.slice(0),o=e.sources.slice(0);return r&&(i?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new t({defines:n,sources:o})},r.createShadowReceiveFragmentShader=function(r,i,n,o,a){for(var s=t.findNormalVarying(r),l=!o&&e(s)||o&&a,u=t.findPositionVarying(r),c=e(u),d=i._usesDepthTexture,h=i._polygonOffsetSupported,p=i._isPointLight,f=i._isSpotLight,m=i._numberOfCascades>1,g=i.debugCascadeColors,_=i.softShadows,v=p?i._pointBias:o?i._terrainBias:i._primitiveBias,y=r.defines.slice(0),b=r.sources.slice(0),C=b.length,S=0;S<C;++S)b[S]=t.replaceMain(b[S],"czm_shadow_receive_main");p?y.push("USE_CUBE_MAP_SHADOW"):d&&y.push("USE_SHADOW_DEPTH_TEXTURE"),_&&!p&&y.push("USE_SOFT_SHADOWS"),m&&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 T="";return T+=p?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",T+="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",T+="void main() \n{ \n    czm_shadow_receive_main(); \n    vec4 positionEC = getPositionEC(); \n    vec3 normalEC = getNormalEC(); \n    float depth = -positionEC.z; \n",T+="    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?T+="    shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":h||(T+="    shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),T+=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":f?"    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":m?"    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"+(g?"    // 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",T+="    gl_FragColor.rgb *= visibility; \n} \n",b.push(T),new t({defines:y,sources:b})},r}),define("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/CullingVolume","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeometryInstance","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../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/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./Camera","./CullFace","./DebugCameraPrimitive","./PerInstanceColorAppearance","./Primitive","./ShadowMapShader"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q){"use strict";function Z(e){e=h(e,h.EMPTY_OBJECT);var r=e.context;this._enabled=h(e.enabled,!0),this._softShadows=h(e.softShadows,!1),this._normalOffset=h(e.normalOffset,!0),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()&&!r.depthTexture)&&(a=!1),this._polygonOffsetSupported=a,this._terrainBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,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 i,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new S:p(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 K(r);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=r.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,$(this),this._clearCommand=new P({depth:1,color:new l}),this._clearPassState=new L(r),this._size=h(e.size,2048),this.size=this._size}function K(e){this.camera=new fe,this.passState=new L(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function J(e,t){return B.fromCache({cull:{enabled:!0,face:j.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 $(e){var t=!e._usesDepthTexture;e._primitiveRenderState=J(t,e._primitiveBias),e._terrainRenderState=J(t,e._terrainBias),e._pointRenderState=J(t,e._pointBias)}function ee(e){for(var t=e._passes.length,r=0;r<t;++r){var i=e._passes[r],n=i.framebuffer;p(n)&&!n.isDestroyed()&&n.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function te(){return new U({wrapS:H.CLAMP_TO_EDGE,wrapT:H.CLAMP_TO_EDGE,minificationFilter:G.NEAREST,magnificationFilter:z.NEAREST})}function re(e,t){for(var r=new k({context:t,width:e._textureSize.x,height:e._textureSize.y,format:F.DEPTH_COMPONENT16}),i=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:N.UNSIGNED_BYTE,sampler:te()}),n=new M({context:t,depthRenderbuffer:r,colorTextures:[i],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=i,e._depthAttachment=r,e._colorAttachment=i}function ie(e,t){for(var r=new V({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.DEPTH_STENCIL,pixelDatatype:N.UNSIGNED_INT_24_8,sampler:te()}),i=new M({context:t,depthStencilTexture:r,destroyAttachments:!1}),n=e._passes.length,o=0;o<n;++o){var a=e._passes[o];a.framebuffer=i,a.passState.framebuffer=i}e._shadowMapTexture=r,e._depthAttachment=r}function ne(e,t){for(var r=new k({context:t,width:e._textureSize.x,height:e._textureSize.y,format:F.DEPTH_COMPONENT16}),i=new D({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:N.UNSIGNED_BYTE,sampler:te()}),n=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ],o=0;o<6;++o){var a=new M({context:t,depthRenderbuffer:r,colorTextures:[n[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=i,e._depthAttachment=r,e._colorAttachment=i}function oe(e,t){e._isPointLight?ne(e,t):e._usesDepthTexture?ie(e,t):re(e,t)}function ae(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==x.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,$(e),ee(e),oe(e,t))}function se(e,t){p(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(ee(e),oe(e,t),ae(e,t),le(e,t))}function le(e,t,r){r=h(r,0),(e._isPointLight||0===r)&&(e._clearCommand.framebuffer=e._passes[r].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ue(t,r){t._size=r;var i=t._passes,n=i.length,o=t._textureSize;if(t._isPointLight){r=I.maximumCubeMapSize>=r?r:I.maximumCubeMapSize,o.x=r,o.y=r;var a=new e(0,0,r,r);i[0].passState.viewport=a,i[1].passState.viewport=a,i[2].passState.viewport=a,i[3].passState.viewport=a,i[4].passState.viewport=a,i[5].passState.viewport=a}else 1===n?(r=I.maximumTextureSize>=r?r:I.maximumTextureSize,o.x=r,o.y=r,i[0].passState.viewport=new e(0,0,r,r)):4===n&&(r=I.maximumTextureSize>=2*r?r:I.maximumTextureSize/2,o.x=2*r,o.y=2*r,i[0].passState.viewport=new e(0,0,r,r),i[1].passState.viewport=new e(r,0,r,r),i[2].passState.viewport=new e(0,r,r,r),i[3].passState.viewport=new e(r,r,r,r));t._clearPassState.viewport=new e(0,0,o.x,o.y);for(var s=0;s<n;++s){var l=i[s],u=l.passState.viewport,c=u.x/o.x,d=u.y/o.y,h=u.width/o.x,p=u.height/o.y;l.textureOffsets=new C(h,0,0,c,0,p,0,d,0,0,1,0,0,0,0,1)}}function ce(e,t){var r;r=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 i=t.createViewportQuadCommand(r,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=R.OVERLAY,i}function de(t,r){var i=r.context,n=r.context.drawingBufferWidth,o=r.context.drawingBufferHeight,a=.3*Math.min(n,o),s=Se;s.x=n-a,s.y=0,s.width=a,s.height=a;var l=t._debugShadowViewCommand;p(l)||(l=ce(t,i),t._debugShadowViewCommand=l),p(l.renderState)&&e.equals(l.renderState.viewport,s)||(l.renderState=B.fromCache({viewport:e.clone(s)})),r.commandList.push(t._debugShadowViewCommand)}function he(e,t){var i=new v({geometry:new r({minimum:new n(-.5,-.5,-.5),maximum:new n(.5,.5,.5)}),attributes:{color:u.fromColor(t)}}),o=new v({geometry:new E({radius:.5}),attributes:{color:u.fromColor(t)}});return new X({geometryInstances:[i,o],appearance:new Y({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}function pe(e,t){de(e,t);var r=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(r&&(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){r&&(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 i=0;i<e._numberOfCascades;++i)r&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new q({camera:e._passes[i].camera,color:xe[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!p(e._debugLightFrustum)||e._needsUpdate){var o=e._shadowMapCamera.positionWC,a=A.IDENTITY,s=2*e._pointLightRadius,u=n.fromElements(s,s,s,Pe),c=C.fromTranslationQuaternionRotationScale(o,a,u,we);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=he(c,l.YELLOW)}e._debugLightFrustum.update(t)}else p(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 me(e,t){var r,i=e._shadowMapCamera,a=e._sceneCamera,s=a.frustum.near,l=a.frustum.far,u=e._numberOfCascades,c=l-s,d=l/s,h=.9,p=!1;t.shadowHints.closestObjectSize<200&&(p=!0,h=.9);var f=Me,m=De;for(m[0]=s,m[u]=l,r=0;r<u;++r){var g=(r+1)/u,_=s*Math.pow(d,g),v=s+c*g,y=b.lerp(v,_,h);m[r+1]=y,f[r]=y-m[r]}if(p){for(r=0;r<u;++r)f[r]=Math.min(f[r],e._maximumCascadeDistances[r]);var S=m[0];for(r=0;r<u-1;++r)S+=f[r],m[r+1]=S}o.unpack(m,0,e._cascadeSplits[0]),o.unpack(m,1,e._cascadeSplits[1]),o.unpack(f,0,e._cascadeDistances);var T=i.frustum,w=T.left,A=T.right,E=T.bottom,x=T.top,P=T.near,I=T.far,D=i.positionWC,O=i.directionWC,M=i.upWC,R=a.frustum.clone(Oe),L=i.getViewProjection();for(r=0;r<u;++r){R.near=m[r],R.far=m[r+1];for(var N=C.multiply(R.projectionMatrix,a.viewMatrix,we),k=C.inverse(N,we),F=C.multiply(L,k,we),B=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Re),U=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Le),V=0;V<8;++V){var z=o.clone(Te[V],Ae[V]);C.multiplyByVector(F,z,z),n.divideByScalar(z,z.w,z),n.minimumByComponent(z,B,B),n.maximumByComponent(z,U,U)}B.x=Math.max(B.x,0),B.y=Math.max(B.y,0),B.z=0,U.x=Math.min(U.x,1),U.y=Math.min(U.y,1),U.z=Math.min(U.z,1);var G=e._passes[r],H=G.camera;H.clone(i);var W=H.frustum;W.left=w+B.x*(A-w),W.right=w+U.x*(A-w),W.bottom=E+B.y*(x-E),W.top=E+U.y*(x-E),W.near=P+B.z*(I-P),W.far=P+U.z*(I-P),G.cullingVolume=H.frustum.computeCullingVolume(D,O,M);var j=e._cascadeMatrices[r];C.multiply(H.getViewProjection(),a.inverseViewMatrix,j),C.multiply(G.textureOffsets,j,j)}}function ge(e,t){var r=e._shadowMapCamera,i=e._sceneCamera,a=C.multiply(i.frustum.projectionMatrix,i.viewMatrix,we),s=C.inverse(a,we),l=r.directionWC,u=i.directionWC,c=n.cross(l,u,ke);u=n.cross(c,l,Fe),n.normalize(u,u),n.normalize(c,c);for(var d=n.fromElements(0,0,0,Be),h=C.computeView(d,l,u,c,Ne),p=C.multiply(h,s,we),f=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Re),m=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Le),g=0;g<8;++g){var _=o.clone(Te[g],Ae[g]);C.multiplyByVector(p,_,_),n.divideByScalar(_,_.w,_),n.minimumByComponent(_,f,f),n.maximumByComponent(_,m,m)}m.z+=1e3,f.z-=10;var v=Be;v.x=-.5*(f.x+m.x),v.y=-.5*(f.y+m.y),v.z=-m.z;var y=C.fromTranslation(v,we);h=C.multiply(y,h,h);var b=.5*(m.x-f.x),S=.5*(m.y-f.y),T=m.z-f.z,w=r.frustum;w.left=-b,w.right=b,w.bottom=-S,w.top=S,w.near=.01,w.far=T,C.clone(h,r.viewMatrix),C.inverse(h,r.inverseViewMatrix),C.getTranslation(r.inverseViewMatrix,r.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),n.clone(l,r.directionWC),n.clone(u,r.upWC),n.clone(c,r.rightWC)}function _e(e,t){var r=new T;r.fov=b.PI_OVER_TWO,r.near=1,r.far=e._pointLightRadius,r.aspectRatio=1;for(var i=0;i<6;++i){var n=e._passes[i].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=Ue[i],n.upWC=Ve[i],n.rightWC=ze[i],C.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),C.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=r}}function ve(e,r){var i=e._sceneCamera,o=e._shadowMapCamera,a=We;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var s=r.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,Ge),l=n.negate(o.directionWC,He),u=n.dot(s,l),c=b.clamp(u/.1,0,1);if(e._darkness=b.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=r.cullingVolume.computeVisibility(a)===y.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere);else{var d=o.frustum.far/2,h=n.add(o.positionWC,n.multiplyByScalar(o.directionWC,d,je),je);a.center=h,a.radius=d,e._outOfView=r.cullingVolume.computeVisibility(a)===y.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere)}}function ye(e,t){var r=t.camera,i=e._lightCamera,o=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?n.clone(i.directionWC,a.directionWC):e._isPointLight?n.clone(i.positionWC,a.positionWC):a.clone(i);var s=e._lightDirectionEC;C.multiplyByPointAsVector(r.viewMatrix,a.directionWC,s),n.normalize(s,s),n.negate(s,s),C.multiplyByPoint(r.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=r.frustum.near,u=e.maximumDistance),e._sceneCamera=W.clone(r,o),r.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=l,e._sceneCamera.frustum.far=u,e._distance=u-l,ve(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}function be(e,t,r){var i=e._isPointLight?e._pointBias:r?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=qe;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,o.fromElements(t.x,t.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return o.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new o,combinedUniforms2:new o};return c(t,n,!1)}function Ce(e,t,r,i,n,o){var a,l,u;if(p(o)&&(a=o.shaderProgram,l=o.renderState,u=o.uniformMap),o=O.shallowClone(r,o),o.castShadows=!0,o.receiveShadows=!1,!p(a)||n!==r.shaderProgram.id||t){var c=r.shaderProgram,d=r.pass===R.GLOBE,h=r.pass!==R.TRANSLUCENT,f=e._isPointLight,m=e._usesDepthTexture,g=Q.getShadowCastShaderKeyword(f,d,m,h);if(a=i.shaderCache.getDerivedShaderProgram(c,g),!p(a)){var _=c.vertexShaderSource,v=c.fragmentShaderSource,y=Q.createShadowCastVertexShader(_,f,d),b=Q.createShadowCastFragmentShader(v,f,m,h);a=i.shaderCache.createDerivedShaderProgram(c,g,{vertexShaderSource:y,fragmentShaderSource:b,attributeLocations:c._attributeLocations})}l=e._primitiveRenderState,f?l=e._pointRenderState:d&&(l=e._terrainRenderState);r.renderState.cull.enabled||(l=s(l,!1),l.cull=s(l.cull,!1),l.cull.enabled=!1,l=B.fromCache(l)),u=be(e,r.uniformMap,d)}return o.shaderProgram=a,o.renderState=l,o.uniformMap=u,o}Z.MAXIMUM_DISTANCE=2e4,Z.prototype.debugCreateRenderStates=function(){$(this)},f(Z.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=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){ue(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 Se=new e,Te=new Array(8);Te[0]=new o(-1,-1,-1,1),Te[1]=new o(1,-1,-1,1),Te[2]=new o(1,1,-1,1),Te[3]=new o(-1,1,-1,1),Te[4]=new o(-1,-1,1,1),Te[5]=new o(1,-1,1,1),Te[6]=new o(1,1,1,1),Te[7]=new o(-1,1,1,1);for(var we=new C,Ae=new Array(8),Ee=0;Ee<8;++Ee)Ae[Ee]=new o;var xe=[l.RED,l.GREEN,l.BLUE,l.MAGENTA],Pe=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 Ie=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(Ie,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var De=new Array(5),Oe=new T,Me=new Array(4),Re=new n,Le=new n,Ne=new C,ke=new n,Fe=new n,Be=new n,Ue=[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)],Ve=[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)],ze=[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)],Ge=new n,He=new n,We=new t,je=We.center;Z.prototype.update=function(e){if(ye(this,e),this._needsUpdate)if(se(this,e.context),this._isPointLight&&_e(this,e),this._cascadesEnabled&&(ge(this,e),this._numberOfCascades>1&&me(this,e)),this._isPointLight)this._shadowMapCullingVolume=d.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,r=t.positionWC,i=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(r,i,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&&pe(this,e)},Z.prototype.updatePass=function(e,t){le(this,e,t)};var qe=new i;return Z.createDerivedCommands=function(e,t,r,i,n,o){p(o)||(o={});var a=t.length>0,s=r.shaderProgram,l=s.vertexShaderSource,u=s.fragmentShaderSource,c=r.pass===R.GLOBE,d=!1;if(c&&(d=r.owner.data.pickTerrain.mesh.encoding.hasVertexNormals),r.castShadows){var h=o.castCommands;p(h)||(h=o.castCommands=[]);var f=o.castShaderProgramId,m=e.length;h.length=m;for(var g=0;g<m;++g)h[g]=Ce(e[g],i,r,n,f,h[g]);o.castShaderProgramId=r.shaderProgram.id}if(r.receiveShadows&&a){var _,v;p(o.receiveCommand)&&(_=o.receiveCommand.shaderProgram,v=o.receiveCommand.uniformMap),o.receiveCommand=O.shallowClone(r,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;var y=o.receiveShaderCastShadows!==r.castShadows,b=o.receiveShaderProgramId!==r.shaderProgram.id;if(!p(_)||b||i||y){var C=Q.getShadowReceiveShaderKeyword(t[0],r.castShadows,c,d);if(_=n.shaderCache.getDerivedShaderProgram(s,C),!p(_)){var S=Q.createShadowReceiveVertexShader(l,c,d),T=Q.createShadowReceiveFragmentShader(u,t[0],r.castShadows,c,d);_=n.shaderCache.createDerivedShaderProgram(s,C,{vertexShaderSource:S,fragmentShaderSource:T,attributeLocations:s._attributeLocations})}v=be(t[0],r.uniformMap,c)}o.receiveCommand.shaderProgram=_,o.receiveCommand.uniformMap=v,o.receiveShaderProgramId=r.shaderProgram.id,o.receiveShaderCastShadows=r.castShadows}return o},Z.prototype.isDestroyed=function(){return!1},Z.prototype.destroy=function(){ee(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)},Z}),define("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"}),define("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"}),define("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"}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S){"use strict";function T(){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}T.prototype.clear=function(e,t){var r=this._clearFBO1Command;i.clone(n(t,i.BLACK),r.color),r.execute(e),r=this._clearFBO2Command,i.clone(n(t,i.BLACK),r.color),r.execute(e)},T.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 w=new e,A=new e,E=new r,x=new t,P=new t,I=new l;return T.prototype.update=function(e){var r=e.context,n=e.viewport,a=r.drawingBufferWidth,p=r.drawingBufferHeight,T=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new d({color:new i}),this._clearFBO2Command=new d({color:new i});var D={};this._downSampleCommand=r.createViewportQuadCommand(S,{uniformMap:D,owner:this}),D={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=r.createViewportQuadCommand(b,{uniformMap:D,owner:this});D={delta:function(){return 1},sigma:function(){return 2},direction:function(){return 0}},this._blurXCommand=r.createViewportQuadCommand(C,{uniformMap:D,owner:this}),D={delta:function(){return 1},sigma:function(){return 2},direction:function(){return 1}},this._blurYCommand=r.createViewportQuadCommand(C,{uniformMap:D,owner:this}),D={u_center:function(){return T._uCenter},u_radius:function(){return T._uRadius}},this._blendCommand=r.createViewportQuadCommand(y,{uniformMap:D,owner:this}),D={},this._fullScreenCommand=r.createViewportQuadCommand(S,{uniformMap:D,owner:this})}var O=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),M=Math.pow(2,Math.ceil(Math.log(p)/Math.log(2))-2),R=Math.max(1,O,M),L=A;L.width=R,L.height=R;var N=this._fbo,k=o(N)&&N.getColorTexture(0)||void 0;if(!o(k)||k.width!==a||k.height!==p){N=N&&N.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/R;var F=[new v({context:r,width:a,height:p})];N=r.depthTexture?this._fbo=new h({context:r,colorTextures:F,depthTexture:new v({context:r,width:a,height:p,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:f.UNSIGNED_SHORT})}):this._fbo=new h({context:r,colorTextures:F,depthRenderbuffer:new m({context:r,format:g.DEPTH_COMPONENT16})}),this._downSampleFBO1=new h({context:r,colorTextures:[new v({context:r,width:R,height:R})]}),this._downSampleFBO2=new h({context:r,colorTextures:[new v({context:r,width:R,height:R})]}),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 B=_.fromCache({viewport:L});this._downSampleCommand.uniformMap.u_texture=function(){return N.getColorTexture(0)},this._downSampleCommand.renderState=B,this._brightPassCommand.uniformMap.u_texture=function(){return T._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=B,this._blurXCommand.uniformMap.u_texture=function(){return T._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return T._blurStep},this._blurXCommand.renderState=B,this._blurYCommand.uniformMap.u_texture=function(){return T._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return T._blurStep},this._blurYCommand.renderState=B;var U=w;U.width=a,U.height=p;var V=_.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return N.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return T._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=V,this._fullScreenCommand.uniformMap.u_texture=function(){return N.getColorTexture(0)},this._fullScreenCommand.renderState=V}var z=r.uniformState,G=z.sunPositionWC,H=z.view,W=z.viewProjection,j=z.projection,q=l.computeViewportTransformation(n,0,1,I),Y=l.multiplyByPoint(H,G,E),X=c.pointToGLWindowCoordinates(W,q,G,x);Y.x+=s.SOLAR_RADIUS;var Q=c.pointToGLWindowCoordinates(j,q,Y,Y),Z=30*t.magnitude(t.subtract(Q,X,Q))*2,K=P;K.x=Z,K.y=Z;var J=this._upSamplePassState.scissorTest.rectangle;return J.x=Math.max(X.x-.5*K.x,0),J.y=Math.max(X.y-.5*K.y,0),J.width=Math.min(K.x,a),J.height=Math.min(K.y,p),this._uCenter=t.clone(X,this._uCenter),this._uRadius=.15*Math.max(K.x,K.y),q=l.computeViewportTransformation(L,0,1,I),X=c.pointToGLWindowCoordinates(W,q,G,x),K.x*=O/a,K.y*=M/p,J=this._downSamplePassState.scissorTest.rectangle,J.x=Math.max(X.x-.5*K.x,0),J.y=Math.max(X.y-.5*K.y,0),J.width=Math.min(K.x,a),J.height=Math.min(K.y,p),this._downSamplePassState.context=r,this._upSamplePassState.context=r,this._fbo},T.prototype.isDestroyed=function(){return!1},T.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)},T}),define("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/CullingVolume","../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/OrthographicFrustum","../Core/OrthographicOffCenterFrustum","../Core/PerspectiveFrustum","../Core/PerspectiveOffCenterFrustum","../Core/PixelFormat","../Core/RequestScheduler","../Core/ShowGeometryInstanceAttribute","../Core/TaskProcessor","../Core/Transforms","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","./BrdfLutGenerator","./Camera","./CreditDisplay","./DebugCameraPrimitive","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./InvertClassification","./JobScheduler","./MapMode2D","./OIT","./PerformanceDisplay","./PerInstanceColorAppearance","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./ShadowMap","./SunPostProcess","./TweenCollection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,_e,ve,ye,be,Ce,Se,Te){"use strict";function we(t){t=d(t,d.EMPTY_OBJECT);var r=t.canvas,i=t.contextOptions,n=t.creditContainer,o=t.creditViewport,a=h(n),l=new V(r,i);a||(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",r.parentNode.appendChild(n)),h(o)||(o=r.parentNode),this._id=u(),this._jobScheduler=new ue,this._frameState=new ne(l,new $(n," • ",o),this._jobScheduler),this._frameState.scene3DOnly=d(t.scene3DOnly,!1),this._removeCreditContainer=!a,this._creditContainer=n;var c=new j(l);c.viewport=new e,c.viewport.x=0,c.viewport.y=0,c.viewport.width=l.drawingBufferWidth,c.viewport.height=l.drawingBufferHeight,this._passState=c,this._canvas=r,this._context=l,this._computeEngine=new U(l),this._globe=void 0,this._primitives=new ge,this._groundPrimitives=new ge,this._tweens=new Te,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=d(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var p;l.depthTexture&&(p=new se);var f;this._useOIT&&h(p)&&(f=new de(l)),this._globeDepth=p,this._depthPlane=new te,this._oit=f,this._fxaa=new ae,this._clearColorCommand=new B({color:new s,stencil:0,owner:this}),this._depthClearCommand=new B({depth:1,owner:this}),this._stencilClearCommand=new B({stencil:0}),this._pickDepths=[],this._debugGlobeDepths=[],this._pickDepthPassState=void 0,this._pickDepthFramebuffer=void 0,this._pickDepthFramebufferWidth=void 0,this._pickDepthFramebufferHeight=void 0,this._depthOnlyRenderStateCache={},this._transitioner=new ye(this),this._preUpdate=new _,this._postUpdate=new _,this._renderError=new _,this._preRender=new _,this._postRender=new _,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this._pickPositionCache={},this._pickPositionCacheDirty=!1,this._minimumDisableDepthTestDistance=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=_e.SCENE3D,this._mapProjection=h(t.mapProjection)?t.mapProjection:new v,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.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.fxaa=!0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new ie,this._sunCamera=new J(this),this.shadowMap=new Ce({context:l,lightCamera:this._sunCamera,enabled:d(t.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=s.clone(s.WHITE),this._actualInvertClassificationColor=s.clone(this._invertClassificationColor),this._invertClassification=new le,this.focalLength=void 0,this.eyeSeparation=void 0,this._brdfLutGenerator=new K,this._terrainExaggeration=d(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var m=new J(this);this._camera=m,this._cameraClone=J.clone(m),this._screenSpaceCameraController=new be(this),this._mapMode2D=d(t.mapMode2D,ce.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,useInvertClassification:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=d(t.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=d(t.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._removeRequestListenerCallback=L.requestCompletedEvent.addEventListener(_t(this)),this._removeTaskProcessorListenerCallback=k.taskCompletedEvent.addEventListener(_t(this)),this._removeGlobeCallbacks=[];var g=m.frustum.near,y=m.frustum.far,b=Math.ceil(Math.log(y/g)/Math.log(this.farToNearRatio));Me(g,y,this.farToNearRatio,b,this._frustumCommandsList,!1,void 0),Oe(this,0,w.now()),this.initializeFrame()}function Ae(e,t){for(var r=0;r<e._removeGlobeCallbacks.length;++r)e._removeGlobeCallbacks[r]();e._removeGlobeCallbacks.length=0;var i=[];h(t)&&(i.push(t.imageryLayersUpdatedEvent.addEventListener(_t(e))),i.push(t.terrainProviderChanged.addEventListener(_t(e)))),e._removeGlobeCallbacks=i}function Ee(e,t){var r=Math.max(Math.abs(e.x),Math.abs(t.x)),i=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(r,i),n)}function xe(e,t,r){var i=1/Math.max(1,Ee(e.position,t.position));return n.multiplyByScalar(e.position,i,bt),n.multiplyByScalar(t.position,i,Ct),n.equalsEpsilon(bt,Ct,r)&&n.equalsEpsilon(e.direction,t.direction,r)&&n.equalsEpsilon(e.up,t.up,r)&&n.equalsEpsilon(e.right,t.right,r)&&E.equalsEpsilon(e.transform,t.transform,r)}function Pe(e,t){var r=e.frameState,i=e._context,n=r.shadowHints.shadowsEnabled,o=r.shadowHints.shadowMaps,a=r.shadowHints.lightShadowMaps,s=n&&a.length>0,l=!1,u=r.shadowHints.lastDirtyTime;t.lastDirtyTime!==u&&(t.lastDirtyTime=u,t.dirty=!0,l=!0);var c=t.derivedCommands;if(t.dirty&&h(c)){t.dirty=!1,n&&(t.receiveShadows||t.castShadows)&&(c.shadows=Ce.createDerivedCommands(o,a,t,l,i,c.shadows));var d=e._oit;t.pass===W.TRANSLUCENT&&h(d)&&d.isSupported()&&(s&&t.receiveShadows?(c.oit=h(c.oit)?c.oit:{},c.oit.shadows=d.createDerivedCommands(t.derivedCommands.shadows.receiveCommand,i,c.oit.shadows)):c.oit=d.createDerivedCommands(t,i,c.oit)),c.depth=mt(e,t,i,c.depth)}}function Ie(e){var t=e.globe;if(e._mode===_e.SCENE3D&&h(t)){var r=t.ellipsoid;return St.radius=r.minimumRadius,yt=P.fromBoundingSphere(St,e._camera.positionWC,yt)}}function De(e){e.render=!1,e.pick=!1,e.depth=!1}function Oe(e,t,r){var i=e._camera,n=e._frameState;n.commandList.length=0,n.shadowMaps.length=0,n.brdfLutGenerator=e._brdfLutGenerator,n.environmentMap=e.skyBox&&e.skyBox._cubeMap,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=w.clone(r,n.time),n.camera=i,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),n.occluder=Ie(e),n.terrainExaggeration=e._terrainExaggeration,n.minimumDisableDepthTestDistance=e._minimumDisableDepthTestDistance,n.invertClassification=e.invertClassification,e._actualInvertClassificationColor=s.clone(e.invertClassificationColor,e._actualInvertClassificationColor),le.isTranslucencySupported(e._context)||(e._actualInvertClassificationColor.alpha=1),n.invertClassificationColor=e._actualInvertClassificationColor,h(e.globe)?n.maximumScreenSpaceError=e.globe.maximumScreenSpaceError:n.maximumScreenSpaceError=2,De(n.passes)}function Me(e,t,r,i,n,o,a){n.length=i;for(var s=0;s<i;++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(r,s)*e),u=Math.min(t,r*l));var c=n[s];h(c)?(c.near=l,c.far=u):c=n[s]=new oe(l,u)}}function Re(e,t,r){e.debugShowFrustums&&(t.debugOverlappingFrustums=0),e.frameState.passes.pick||Pe(e,t);for(var i=e._frustumCommandsList,n=i.length,o=0;o<n;++o){var a=i[o],s=a.near,l=a.far;if(!(r.start>l)){if(r.stop<s)break;var u=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 Le(e,t,r){return h(e)&&(!h(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==S.OUTSIDE&&(!h(r)||!e.boundingVolume.isOccluded(r)))}function Ne(e){var t=e._frameState,r=t.camera,i=r.directionWC,n=r.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=W.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 f=Number.MAX_VALUE,m=-Number.MAX_VALUE,g=!1,_=t.shadowHints.shadowsEnabled,v=Number.MAX_VALUE,y=-Number.MAX_VALUE,b=Number.MAX_VALUE,C=t.mode===_e.SCENE3D?t.occluder:void 0,S=t.cullingVolume,T=Tt.planes,w=0;w<5;++w)T[w]=S.planes[w];S=Tt;for(var E=s.length,x=0;x<E;++x){var P=s[x],I=P.pass;if(I===W.COMPUTE)o.push(P);else if(I===W.OVERLAY)a.push(P);else{var D=P.boundingVolume;if(h(D)){if(!Le(P,S,C))continue;if(wt=D.computePlaneDistances(n,i,wt),f=Math.min(f,wt.start),m=Math.max(m,wt.stop),_&&P.receiveShadows&&wt.start<Ce.MAXIMUM_DISTANCE&&!(I===W.GLOBE&&wt.start<-100&&wt.stop>100)){var O=wt.stop-wt.start;I!==W.GLOBE&&wt.start<100&&(b=Math.min(b,O)),v=Math.min(v,wt.start),y=Math.max(y,wt.stop)}}else wt.start=r.frustum.near,wt.stop=r.frustum.far,g=!(P instanceof B);Re(e,P,wt)}}g?(f=r.frustum.near,m=r.frustum.far):(f=Math.min(Math.max(f,r.frustum.near),r.frustum.far),m=Math.max(Math.min(m,r.frustum.far),f),_&&(v=Math.min(Math.max(v,r.frustum.near),r.frustum.far),y=Math.max(Math.min(y,r.frustum.far),v))),_&&(t.shadowHints.nearPlane=v,t.shadowHints.farPlane=y,t.shadowHints.closestObjectSize=b);var M,R=e.mode===_e.SCENE2D,L=e.farToNearRatio;R?(m=Math.min(m,r.position.z+e.nearToFarDistance2D),f=Math.min(f,m),M=Math.ceil(Math.max(1,m-f)/e.nearToFarDistance2D)):M=Math.ceil(Math.log(m/f)/Math.log(L)),f!==Number.MAX_VALUE&&(M!==u||0!==l.length&&(f<l[0].near||m>l[u-1].far&&!A.equalsEpsilon(m,l[u-1].far,A.EPSILON8)))&&(Me(f,m,L,M,l,R,e.nearToFarDistance2D),Ne(e));var N=t.frustumSplits;N.length=M+1;for(var k=0;k<M;++k)N[k]=l[k].near,k===M-1&&(N[k+1]=l[k].far)}function ke(e){var t={},r=e.vertexAttributes;for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i].index);return t}function Fe(e,t,r){var i=t.context,n=d(r,e.shaderProgram),o=n.fragmentShaderSource.clone(),a=[];o.sources=o.sources.map(function(e){e=Q.replaceMain(e,"czm_Debug_main");for(var t,r=/gl_FragData\[(\d+)\]/g;null!==(t=r.exec(e));)-1===a.indexOf(t[1])&&a.push(t[1]);return e});var l,u=a.length,c="void main() \n{ \n    czm_Debug_main(); \n";if(t.debugShowCommands){h(e._debugColor)||(e._debugColor=s.fromRandom());var p=e._debugColor;if(u>0)for(l=0;l<u;++l)c+="    gl_FragData["+a[l]+"].rgb *= vec3("+p.red+", "+p.green+", "+p.blue+"); \n";else c+="    gl_FragColor.rgb *= vec3("+p.red+", "+p.green+", "+p.blue+"); \n"}if(t.debugShowFrustums){var f=1&e.debugOverlappingFrustums?"1.0":"0.0",m=2&e.debugOverlappingFrustums?"1.0":"0.0",g=4&e.debugOverlappingFrustums?"1.0":"0.0";if(u>0)for(l=0;l<u;++l)c+="    gl_FragData["+a[l]+"].rgb *= vec3("+f+", "+m+", "+g+"); \n";else c+="    gl_FragColor.rgb *= vec3("+f+", "+m+", "+g+"); \n"}c+="}",o.sources.push(c);var _=ke(n);return X.fromCache({context:i,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:_})}function Be(e,t,r){var i=G.shallowClone(e);i.shaderProgram=Fe(e,t),i.execute(t.context,r),i.shaderProgram.destroy()}function Ue(e,t,i,o,a){if(!h(t.debugCommandFilter)||t.debugCommandFilter(e)){if(e instanceof B)return void e.execute(i,o);var s=t.frameState.shadowHints.shadowsEnabled,u=s&&t.frameState.shadowHints.lightShadowMaps.length>0;if(t.debugShowCommands||t.debugShowFrustums?Be(e,t,o):u&&e.receiveShadows&&h(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(i,o):t.frameState.passes.depth&&h(e.derivedCommands.depth)?e.derivedCommands.depth.depthOnlyCommand.execute(i,o):e.execute(i,o),e.debugShowBoundingVolume&&h(e.boundingVolume)){var c=t._frameState,d=e.boundingVolume;h(t._debugVolume)&&t._debugVolume.destroy();var p,f=n.clone(d.center);if(c.mode!==_e.SCENE3D){f=E.multiplyByPoint(At,f,f);var m=c.mapProjection,_=m.unproject(f);f=m.ellipsoid.cartographicToCartesian(_)}if(h(d.radius)){var v=d.radius;p=b.toWireframe(g.createGeometry(new g({radii:new n(v,v,v),vertexFormat:pe.FLAT_VERTEX_FORMAT}))),t._debugVolume=new me({geometryInstances:new y({geometry:p,modelMatrix:E.fromTranslation(f),attributes:{color:new l(1,0,0,1)}}),appearance:new pe({flat:!0,translucent:!1}),asynchronous:!1})}else{var C=d.halfAxes;p=b.toWireframe(r.createGeometry(r.fromDimensions({dimensions:new n(2,2,2),vertexFormat:pe.FLAT_VERTEX_FORMAT}))),t._debugVolume=new me({geometryInstances:new y({geometry:p,modelMatrix:E.fromRotationTranslation(C,f,new E),attributes:{color:new l(1,0,0,1)}}),appearance:new pe({flat:!0,translucent:!1}),asynchronous:!1})}var S=c.commandList,T=c.commandList=[];t._debugVolume.update(c);var w;h(a)&&(w=o.framebuffer,o.framebuffer=a),T[0].execute(i,o),h(w)&&(o.framebuffer=w),c.commandList=S}}}function Ve(e,t,r){return t.boundingVolume.distanceSquaredTo(r)-e.boundingVolume.distanceSquaredTo(r)}function ze(e,t,r,i,n){var o=e.context;x(i,Ve,e._camera.positionWC),h(n)&&t(n.unclassifiedCommand,e,o,r);for(var a=i.length,s=0;s<a;++s)t(i[s],e,o,r)}function Ge(e,t){var r=e._debugGlobeDepths[t];return!h(r)&&e.context.depthTexture&&(r=new se,e._debugGlobeDepths[t]=r),r}function He(e,t){var r=e._pickDepths[t];return h(r)||(r=new fe,e._pickDepths[t]=r),r}function We(e,t){var r=e._camera,i=e.context,n=i.uniformState;n.updateCamera(r);var o;o=h(r.frustum.fov)?r.frustum.clone(Et):h(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(xt):h(r.frustum.width)?r.frustum.clone(Pt):r.frustum.clone(It),o.near=r.frustum.near,o.far=r.frustum.far,n.updateFrustum(o),n.updatePass(W.ENVIRONMENT);var a=e._useWebVR&&e.mode!==_e.SCENE2D,s=e._frameState.passes,l=s.pick,u=s.depth,c=e._environmentState;if(!l){var d=c.skyBoxCommand;if(h(d)&&Ue(d,e,i,t),c.isSkyAtmosphereVisible&&Ue(c.skyAtmosphereCommand,e,i,t),c.isSunVisible&&(c.sunDrawCommand.execute(i,t),e.sunBloom&&!a)){var p;p=c.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:c.useFXAA?e._fxaa.getColorFramebuffer():c.originalFramebuffer,e._sunPostProcess.execute(i,p),t.framebuffer=p}c.isMoonVisible&&c.moonCommand.execute(i,t)}var f;c.useOIT?(h(e._executeOITFunction)||(e._executeOITFunction=function(e,t,r,i,n){e._oit.executeCommands(e,t,r,i,n)}),f=e._executeOITFunction):f=ze;for(var m,g=c.clearGlobeDepth,_=c.useDepthPlane,v=e._depthClearCommand,y=e._depthPlane,b=r.position.z,C=e._frustumCommandsList,S=C.length,T=0;T<S;++T){var w=S-T-1,A=C[w];e.mode===_e.SCENE2D?(r.position.z=b-A.near+1,o.far=Math.max(1,A.far-A.near),o.near=1,n.update(e.frameState),n.updateFrustum(o)):(o.near=0!==w?A.near*vt:A.near,o.far=A.far,n.updateFrustum(o));var E,x=e.debugShowGlobeDepth?Ge(e,w):e._globeDepth;e.debugShowGlobeDepth&&h(x)&&c.useGlobeDepthFramebuffer&&(x.update(i,t),x.clear(i,t,e._clearColorCommand.color),E=t.framebuffer,t.framebuffer=x.framebuffer),v.execute(i,t),e._stencilClearCommand.execute(i,t),n.updatePass(W.GLOBE);var P=A.commands[W.GLOBE],I=A.indices[W.GLOBE];for(m=0;m<I;++m)Ue(P[m],e,i,t);for(h(x)&&c.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(x.update(i,t),x.executeCopyDepth(i,t)),e.debugShowGlobeDepth&&h(x)&&c.useGlobeDepthFramebuffer&&(t.framebuffer=E),n.updatePass(W.TERRAIN_CLASSIFICATION),P=A.commands[W.TERRAIN_CLASSIFICATION],I=A.indices[W.TERRAIN_CLASSIFICATION],m=0;m<I;++m)Ue(P[m],e,i,t);for(n.updatePass(W.CLASSIFICATION),P=A.commands[W.CLASSIFICATION],I=A.indices[W.CLASSIFICATION],m=0;m<I;++m)Ue(P[m],e,i,t);if(g&&v.execute(i,t),!c.useInvertClassification||l){for(n.updatePass(W.CESIUM_3D_TILE),P=A.commands[W.CESIUM_3D_TILE],I=A.indices[W.CESIUM_3D_TILE],m=0;m<I;++m)Ue(P[m],e,i,t);for(n.updatePass(W.CESIUM_3D_TILE_CLASSIFICATION),P=A.commands[W.CESIUM_3D_TILE_CLASSIFICATION],I=A.indices[W.CESIUM_3D_TILE_CLASSIFICATION],m=0;m<I;++m)Ue(P[m],e,i,t);for(n.updatePass(W.CLASSIFICATION),P=A.commands[W.CLASSIFICATION],I=A.indices[W.CLASSIFICATION],m=0;m<I;++m)Ue(P[m],e,i,t)}else{e._invertClassification.clear(i,t);var D=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo,n.updatePass(W.CESIUM_3D_TILE),P=A.commands[W.CESIUM_3D_TILE],I=A.indices[W.CESIUM_3D_TILE],m=0;m<I;++m)Ue(P[m],e,i,t);for(n.updatePass(W.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),P=A.commands[W.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],I=A.indices[W.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],m=0;m<I;++m)Ue(P[m],e,i,t);for(t.framebuffer=D,e._invertClassification.executeClassified(i,t),1===e.frameState.invertClassificationColor.alpha&&e._invertClassification.executeUnclassified(i,t),I>0&&i.stencilBuffer&&e._stencilClearCommand.execute(i,t),n.updatePass(W.CESIUM_3D_TILE_CLASSIFICATION),P=A.commands[W.CESIUM_3D_TILE_CLASSIFICATION],I=A.indices[W.CESIUM_3D_TILE_CLASSIFICATION],m=0;m<I;++m)Ue(P[m],e,i,t);for(n.updatePass(W.CLASSIFICATION),P=A.commands[W.CLASSIFICATION],I=A.indices[W.CLASSIFICATION],m=0;m<I;++m)Ue(P[m],e,i,t)}for(I>0&&i.stencilBuffer&&e._stencilClearCommand.execute(i,t),g&&_&&y.execute(i,t),n.updatePass(W.OPAQUE),P=A.commands[W.OPAQUE],I=A.indices[W.OPAQUE],m=0;m<I;++m)Ue(P[m],e,i,t);0!==w&&e.mode!==_e.SCENE2D&&(o.near=A.near,n.updateFrustum(o));var O;if(!l&&c.useInvertClassification&&e.frameState.invertClassificationColor.alpha<1&&(O=e._invertClassification),n.updatePass(W.TRANSLUCENT),P=A.commands[W.TRANSLUCENT],P.length=A.indices[W.TRANSLUCENT],f(e,Ue,t,P,O),h(x)&&(c.useGlobeDepthFramebuffer||u)&&e.useDepthPicking){var M=u?t.framebuffer.depthStencilTexture:x.framebuffer.depthStencilTexture,R=He(e,w);R.update(i,M),R.executeCopyDepth(i,t)}}}function je(e){e.context.uniformState.updatePass(W.COMPUTE);var t=e._environmentState.sunComputeCommand;h(t)&&t.execute(e._computeEngine);for(var r=e._computeCommandList,i=r.length,n=0;n<i;++n)r[n].execute(e._computeEngine)}function qe(e,t){e.context.uniformState.updatePass(W.OVERLAY);for(var r=e.context,i=e._overlayCommandList,n=i.length,o=0;o<n;++o)i[o].execute(r,t)}function Ye(e,t,r){for(var i=r.shadowMapCullingVolume,n=r.isPointLight,o=r.passes,a=o.length,s=t.length,l=0;l<s;++l){var u=t[l];if(Pe(e,u),u.castShadows&&(u.pass===W.GLOBE||u.pass===W.CESIUM_3D_TILE||u.pass===W.OPAQUE||u.pass===W.TRANSLUCENT)&&Le(u,i))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 d=!1,h=a-1;h>=0;--h){var p=o[h].cullingVolume;if(Le(u,p))o[h].commandList.push(u),d=!0;else if(d)break}}}function Xe(e){var t=e.frameState,r=t.shadowHints.shadowMaps,i=r.length;if(t.shadowHints.shadowsEnabled)for(var n=e.context,o=n.uniformState,a=0;a<i;++a){var s=r[a];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;var d=e.frameState.commandList;for(Ye(e,d,s),l=0;l<c;++l){var h=s.passes[l];o.updateCamera(h.camera),s.updatePass(n,l);for(var p=h.commandList.length,f=0;f<p;++f){var m=h.commandList[f];o.updatePass(m.pass),Ue(m.derivedCommands.shadows.castCommands[a],e,n,h.passState)}}}}}function Qe(e,t,r){var i=e._context,o=t.viewport;o.x=0,o.y=0,o.width=i.drawingBufferWidth,o.height=i.drawingBufferHeight;var a=e._frameState,s=a.camera,l=a.mode,u=a.passes.depth;if(e._useWebVR&&l!==_e.SCENE2D){rt(e,t,r),u||tt(e),Ne(e),u||(je(e),Xe(e)),o.x=0,o.y=0,o.width=.5*i.drawingBufferWidth,o.height=i.drawingBufferHeight;var c=J.clone(s,e._cameraVR),h=s.frustum.near,p=h*d(e.focalLength,5),f=d(e.eyeSeparation,p/30),m=n.multiplyByScalar(c.right,.5*f,Dt);s.frustum.aspectRatio=o.width/o.height;var g=.5*f*h/p;n.add(c.position,m,s.position),s.frustum.xOffset=g,We(e,t),o.x=t.viewport.width,n.subtract(c.position,m,s.position),s.frustum.xOffset=-g,We(e,t),J.clone(c,s)}else l!==_e.SCENE2D||e._mapMode2D===ce.ROTATE?Ke(!0,e,t,r):(rt(e,t,r),Ze(e,t))}function Ze(t,r){var i=t.context,o=t.frameState,a=t.camera,s=r.viewport,l=e.clone(s,Bt);r.viewport=l;var u=Ot,c=Mt;t.mapProjection.project(u,c);var d=n.clone(a.position,Rt),h=E.clone(a.transform,Nt),p=a.frustum.clone();a._setTransform(E.IDENTITY);var f=E.computeViewportTransformation(l,0,1,Lt),m=a.frustum.projectionMatrix,g=a.positionWC.y,_=n.fromElements(A.sign(g)*c.x-g,0,-a.positionWC.x,kt),v=F.pointToGLWindowCoordinates(m,f,_,Ft);v.x=Math.floor(v.x);var y=l.x,b=l.width;if(0===g||v.x<=y||v.x>=y+b)Ke(!0,t,r);else if(Math.abs(y+.5*b-v.x)<1)l.width=v.x-l.x,a.position.x*=A.sign(a.position.x),a.frustum.right=0,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),Ke(!0,t,r),l.x=v.x,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=0,
o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),Ke(!1,t,r);else if(v.x>y+.5*b){l.width=v.x-y;var C=a.frustum.right;a.frustum.right=c.x-g,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),Ke(!0,t,r),l.x=v.x,l.width=y+b-v.x,a.position.x=-a.position.x,a.frustum.left=-a.frustum.right,a.frustum.right=C-2*a.frustum.right,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),Ke(!1,t,r)}else{l.x=v.x,l.width=y+b-v.x;var S=a.frustum.left;a.frustum.left=-c.x-g,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),Ke(!0,t,r),l.x=y,l.width=v.x-y,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=S-2*a.frustum.left,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),Ke(!1,t,r)}a._setTransform(h),n.clone(d,a.position),a.frustum=p.clone(),r.viewport=s}function Ke(e,t,r,i){var n=t.frameState.passes.depth;e||n||(t.frameState.commandList.length=0),n||tt(t),Ne(t),e&&(h(i)&&rt(t,r,i),n||(je(t),Xe(t))),We(t,r)}function Je(e,t){var r=e._frameState,i=e._environmentState,n=r.passes.render,o=e.skyAtmosphere,a=e.globe;if(!n||e._mode!==_e.SCENE2D&&r.camera.frustum instanceof I)i.skyAtmosphereCommand=void 0,i.skyBoxCommand=void 0,i.sunDrawCommand=void 0,i.sunComputeCommand=void 0,i.moonCommand=void 0;else{h(o)&&h(a)&&(o.setDynamicAtmosphereColor(a.enableLighting),i.isReadyForAtmosphere=i.isReadyForAtmosphere||a._surface._tilesToRender.length>0),i.skyAtmosphereCommand=h(o)?o.update(r):void 0,i.skyBoxCommand=h(e.skyBox)?e.skyBox.update(r):void 0;var s=h(e.sun)?e.sun.update(r,t):void 0;i.sunDrawCommand=h(s)?s.drawCommand:void 0,i.sunComputeCommand=h(s)?s.computeCommand:void 0,i.moonCommand=h(e.moon)?e.moon.update(r):void 0}var l=i.clearGlobeDepth=h(a)&&(!a.depthTestAgainstTerrain||e.mode===_e.SCENE2D);(i.useDepthPlane=l&&e.mode===_e.SCENE3D)&&e._depthPlane.update(r);for(var u=r.mode===_e.SCENE3D?r.occluder:void 0,c=r.cullingVolume,d=Tt.planes,p=0;p<5;++p)d[p]=c.planes[p];c=Tt,i.isSkyAtmosphereVisible=h(i.skyAtmosphereCommand)&&i.isReadyForAtmosphere,i.isSunVisible=Le(i.sunDrawCommand,c,u),i.isMoonVisible=Le(i.moonCommand,c,u)}function $e(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new ee({camera:e.camera,updateOnChange:!1}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),h(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function et(e){var t=e._frameState,r=t.shadowMaps,i=r.length,n=i>0&&!t.passes.pick&&e.mode===_e.SCENE3D;if(n!==t.shadowHints.shadowsEnabled&&(++t.shadowHints.lastDirtyTime,t.shadowHints.shadowsEnabled=n),n){for(var o=0;o<i;++o)if(r[o]!==t.shadowHints.shadowMaps[o]){++t.shadowHints.lastDirtyTime;break}t.shadowHints.shadowMaps.length=0,t.shadowHints.lightShadowMaps.length=0;for(var a=0;a<i;++a){var s=r[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 tt(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),$e(e),et(e),e._globe&&e._globe.render(t)}function rt(e,t,r){var i=e._context,n=e._environmentState,o=e._frameState.passes,a=o.pick,l=e._useWebVR&&e.mode!==_e.SCENE2D;n.originalFramebuffer=t.framebuffer,h(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!l?e._sunPostProcess=new Se: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 u=e._clearColorCommand;s.clone(r,u.color),u.execute(i,t);var c=n.useGlobeDepthFramebuffer=!a&&h(e._globeDepth);c&&(e._globeDepth.update(i,t),e._globeDepth.clear(i,t,r));var d=n.useOIT=!a&&h(e._oit)&&e._oit.isSupported();d&&(e._oit.update(i,t,e._globeDepth.framebuffer),e._oit.clear(i,t,r),n.useOIT=e._oit.isSupported());var p=n.useFXAA=!a&&e.fxaa;if(p&&(e._fxaa.update(i,t),e._fxaa.clear(i,t,r)),n.isSunVisible&&e.sunBloom&&!l?t.framebuffer=e._sunPostProcess.update(t):c?t.framebuffer=e._globeDepth.framebuffer:p&&(t.framebuffer=e._fxaa.getColorFramebuffer()),h(t.framebuffer)&&u.execute(i,t),n.useInvertClassification=!a&&h(t.framebuffer)&&e.invertClassification){var f;if(1===e.frameState.invertClassificationColor.alpha&&(n.useGlobeDepthFramebuffer?f=e._globeDepth.framebuffer:n.useFXAA&&(f=e._fxaa.getColorFramebuffer())),e._invertClassification.previousFramebuffer=f,e._invertClassification.update(i),e._invertClassification.clear(i,t),e.frameState.invertClassificationColor.alpha<1&&d){var m=e._invertClassification.unclassifiedCommand,g=m.derivedCommands;g.oit=e._oit.createDerivedCommands(m,i,g.oit)}}}function it(e,t){var r=e._context,i=e._environmentState,n=i.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){Ge(e,e.debugShowDepthFrustum-1).executeDebugGlobeDepth(r,t)}if(e.debugShowPickDepth&&n){He(e,e.debugShowDepthFrustum-1).executeDebugPickDepth(r,t)}var o=i.useOIT,a=i.useFXAA;o&&(t.framebuffer=a?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(r,t)),a&&(!o&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(r,t)),t.framebuffer=i.originalFramebuffer,e._fxaa.execute(r,t)),o||a||!n||(t.framebuffer=i.originalFramebuffer,e._globeDepth.executeCopyColor(r,t))}function nt(e){for(var t=e._frameState.afterRender,r=0,i=t.length;r<i;++r)t[r](),e.requestRender();t.length=0}function ot(e){var t=e._camera;return xe(t,e._cameraClone,A.EPSILON15)?(e._cameraStartFired&&C()-e._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),e._cameraStartFired=!1),!1):(e._cameraStartFired||(t.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=C(),J.clone(t,e._cameraClone),!0)}function at(e,t){if(e.debugShowFramesPerSecond){if(!h(e._performanceDisplay)){var r=document.createElement("div");r.className="cesium-performanceDisplay-defaultContainer";e._canvas.parentNode.appendChild(r);var i=new he({container:r});e._performanceDisplay=i,e._performanceContainer=r}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else h(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function st(e){var t=e._frameState;h(e.globe)&&e.globe.update(t),t.creditDisplay.update()}function lt(e,t){e._pickPositionCacheDirty=!0;var r=e.context,i=r.uniformState,o=e._frameState;Oe(e,A.incrementWrap(o.frameNumber,15e6,1),t),o.passes.render=!0;var a=d(e.backgroundColor,s.BLACK);o.backgroundColor=a,o.creditDisplay.beginFrame(),e.fog.update(o),i.update(o);var l=e.shadowMap;h(l)&&l.enabled&&(n.negate(i.sunDirectionWC,e._sunCamera.direction),o.shadowMaps.push(l)),e._computeCommandList.length=0,e._overlayCommandList.length=0;var u=e._passState;u.framebuffer=void 0,u.blendingEnabled=void 0,u.scissorTest=void 0,h(e.globe)&&e.globe.beginFrame(o),Je(e,u),Qe(e,u,a),it(e,u),qe(e,u),h(e.globe)&&(e.globe.endFrame(o),e.globe.tilesLoaded||(e._renderRequested=!0)),o.creditDisplay.endFrame(),r.endFrame()}function ut(e,t,r){try{r(e,t)}catch(t){if(e._renderError.raiseEvent(e,t),e.rethrowRenderErrors)throw t}}function ct(e,t,r,i){var o=e._camera,a=o.frustum;h(a._offCenterFrustum)&&(a=a._offCenterFrustum);var 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=E.clone(o.transform,Ht);o._setTransform(E.IDENTITY);var d=n.clone(o.position,Vt);n.multiplyByScalar(o.right,l,zt),n.add(zt,d,d),n.multiplyByScalar(o.up,u,zt),n.add(zt,d,d),o._setTransform(c),e.mode===_e.SCENE2D&&n.fromElements(d.z,d.x,d.y,d);var p=a.getPixelDimensions(s.width,s.height,1,Gt),f=Ut;return f.right=.5*p.x,f.left=-f.right,f.top=.5*p.y,f.bottom=-f.top,f.near=a.near,f.far=a.far,f.computeCullingVolume(d,o.directionWC,o.upWC)}function dt(e,t,r,i){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,d=2*(u.height-t.y-u.y)/u.height-1,h=c*a*l,p=d*a*s,f=o.getPixelDimensions(u.width,u.height,1,Gt),m=f.x*r*.5,g=f.y*i*.5,_=Wt;return _.top=p+g,_.bottom=p-g,_.right=h+m,_.left=h-m,_.near=a,_.far=o.far,_.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function ht(e,t,r,i){var n=e.camera.frustum;return n instanceof I||n instanceof D?ct(e,t,r,i):dt(e,t,r,i)}function pt(e,t){var r=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!h(r)){for(var i=t._attributeLocations,n=t.fragmentShaderSource,o=!1,a=n.sources,s=a.length,l=0;l<s;++l)if(Zt.test(a[l])||Kt.test(a[l])){o=!0;break}o||(n=new Q({sources:["void main() { gl_FragColor = vec4(1.0); }"]})),r=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:i})}return r}function ft(e,t){var r=e._depthOnlyRenderStateCache,i=r[t.id];if(!h(i)){var n=Y.getState(t);n.depthMask=!0,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=Y.fromCache(n),r[t.id]=i}return i}function mt(e,t,r,i){h(i)||(i={});var n,o;return h(i.depthOnlyCommand)&&(n=i.depthOnlyCommand.shaderProgram,o=i.depthOnlyCommand.renderState),i.depthOnlyCommand=G.shallowClone(t,i.depthOnlyCommand),h(n)&&i.shaderProgramId===t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=n,i.depthOnlyCommand.renderState=o):(i.depthOnlyCommand.shaderProgram=pt(r,t.shaderProgram),i.depthOnlyCommand.renderState=ft(e,t.renderState),i.shaderProgramId=t.shaderProgram.id),i}function gt(t,r){var i=t._context,n=t._frameState;De(n.passes),n.passes.pick=!0,n.passes.depth=!0,n.cullingVolume=ht(t,r,1,1);var o=t._pickDepthPassState;h(o)||(o=t._pickDepthPassState=new j(i),o.scissorTest={enabled:!0,rectangle:new e},o.viewport=new e);var a=i.drawingBufferWidth,s=i.drawingBufferHeight,l=t._pickDepthFramebuffer,u=t._pickDepthFramebufferWidth,c=t._pickDepthFramebufferHeight;h(l)&&u===a&&c===s||(t._pickDepthFramebuffer=t._pickDepthFramebuffer&&t._pickDepthFramebuffer.destroy(),l=t._pickDepthFramebuffer=new H({context:i,depthStencilTexture:new Z({context:i,width:a,height:s,pixelFormat:R.DEPTH_STENCIL,pixelDatatype:q.UNSIGNED_INT_24_8})}),t._pickDepthFramebufferWidth=a,t._pickDepthFramebufferHeight=s),o.framebuffer=l,o.viewport.width=a,o.viewport.height=s,o.scissorTest.rectangle.x=r.x,o.scissorTest.rectangle.y=s-r.y,o.scissorTest.rectangle.width=1,o.scissorTest.rectangle.height=1,Je(t,o),Qe(t,o,Xt),it(t,o),i.endFrame()}var _t=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}},vt=.9999;p(we.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 z.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return z.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,Ae(this,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(){if(h(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(h(this.globe))return this.globe.terrainProvider},set:function(e){h(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(h(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},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===_e.SCENE2D?this.morphTo2D(0):e===_e.SCENE3D?this.morphTo3D(0):e===_e.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 J(this),h(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new re(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}},imagerySplitPosition:{get:function(){return this._frameState.imagerySplitPosition},set:function(e){this._frameState.imagerySplitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}}}),we.prototype.getCompressedTextureFormatSupported=function(e){var t=this.context;return("WEBGL_compressed_texture_s3tc"===e||"s3tc"===e)&&t.s3tc||("WEBGL_compressed_texture_pvrtc"===e||"pvrtc"===e)&&t.pvrtc||("WEBGL_compressed_texture_etc1"===e||"etc1"===e)&&t.etc1};var yt,bt=new n,Ct=new n,St=new t,Tt=new c,wt=new T,At=new E(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);At=E.inverseTransformation(At,At);var Et=new O,xt=new M,Pt=new I,It=new D,Dt=new n,Ot=new a(Math.PI,A.PI_OVER_TWO),Mt=new n,Rt=new n,Lt=new E,Nt=new E,kt=new n,Ft=new n,Bt=new e;we.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()},we.prototype.render=function(e){h(e)||(e=w.now()),this._jobScheduler.resetBudgets(),this._preUpdate.raiseEvent(this,e),ut(this,e,st),this._postUpdate.raiseEvent(this,e);var t=ot(this),r=!this.requestRenderMode||this._renderRequested||t||this.mode===_e.MORPHING;if(!r&&h(this.maximumRenderTimeChange)&&h(this._lastRenderTime)){var i=Math.abs(w.secondsDifference(this._lastRenderTime,e));r=r||i>this.maximumRenderTimeChange}r&&(this._lastRenderTime=w.clone(e,this._lastRenderTime),this._renderRequested=!1,this._preRender.raiseEvent(this,e),ut(this,e,lt),L.update()),at(this,r),nt(this),r&&this._postRender.raiseEvent(this,e)},we.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)},we.prototype.requestRender=function(){this._renderRequested=!0},we.prototype.clampLineWidth=function(e){return Math.max(z.minimumAliasedLineWidth,Math.min(e,z.maximumAliasedLineWidth))};var Ut=new D,Vt=new n,zt=new n,Gt=new i,Ht=new E,Wt=new M,jt=3,qt=3,Yt=new e(0,0,jt,qt),Xt=new s(0,0,0,0),Qt=new i;we.prototype.pick=function(e,t,r){jt=d(t,3),qt=d(r,jt);var i=this._context,n=i.uniformState,o=this._frameState,a=ve.transformWindowToDrawingBuffer(this,e,Qt);h(this._pickFramebuffer)||(this._pickFramebuffer=i.createPickFramebuffer()),this._jobScheduler.disableThisFrame(),Oe(this,o.frameNumber,o.time),o.cullingVolume=ht(this,a,jt,qt),o.invertClassification=!1,o.passes.pick=!0,n.update(o),Yt.x=a.x-.5*(jt-1),Yt.y=this.drawingBufferHeight-a.y-.5*(qt-1),Yt.width=jt,Yt.height=qt;var s=this._pickFramebuffer.begin(Yt);Je(this,s),Qe(this,s,Xt),it(this,s);var l=this._pickFramebuffer.end(Yt);return i.endFrame(),nt(this),l};var Zt=/\bgl_FragDepthEXT\b/,Kt=/\bdiscard\b/,Jt=new o,$t=new o(1,1/255,1/65025,1/16581375);we.prototype.pickPositionWorldCoordinates=function(e,t){if(this.useDepthPicking){var r=e.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(r))return n.clone(this._pickPositionCache[r],t);var i=this._context,a=i.uniformState,s=ve.transformWindowToDrawingBuffer(this,e,Qt);this.pickTranslucentDepth&&gt(this,s),s.y=this.drawingBufferHeight-s.y;var l,u=this._camera;l=h(u.frustum.fov)?u.frustum.clone(Et):h(u.frustum.infiniteProjectionMatrix)?u.frustum.clone(xt):h(u.frustum.width)?u.frustum.clone(Pt):u.frustum.clone(It);for(var c=this.numberOfFrustums,d=0;d<c;++d){var p=He(this,d),f=i.readPixels({x:s.x,y:s.y,width:1,height:1,framebuffer:p.framebuffer}),m=o.unpack(f,0,Jt);o.divideByScalar(m,255,m);var g=o.dot(m,$t);if(g>0&&g<1){var _,v=this._frustumCommandsList[d];return this.mode===_e.SCENE2D?(_=u.position.z,u.position.z=_-v.near+1,l.far=Math.max(1,v.far-v.near),l.near=1,a.update(this.frameState),a.updateFrustum(l)):(l.near=v.near*(0!==d?vt:1),l.far=v.far,a.updateFrustum(l)),t=ve.drawingBufferToWgs84Coordinates(this,s,g,t),this.mode===_e.SCENE2D&&(u.position.z=_,a.update(this.frameState)),this._pickPositionCache[r]=n.clone(t),t}}this._pickPositionCache[r]=void 0}};var er=new a;return we.prototype.pickPosition=function(e,t){if(t=this.pickPositionWorldCoordinates(e,t),h(t)&&this.mode!==_e.SCENE3D){n.fromElements(t.y,t.z,t.x,t);var r=this.mapProjection,i=r.ellipsoid,o=r.unproject(t,er);i.cartographicToCartesian(o,t)}return t},we.prototype.drillPick=function(e,t){var r,i,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)&&(i=l.getGeometryInstanceAttributes(s.id),h(i)&&h(i.show)&&(u=!0,i.show=N.toValue(!1,i.show),a.push(i))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(r=0;r<o.length;++r)o[r].show=!0;for(r=0;r<a.length;++r)i=a[r],i.show=N.toValue(!0,i.show);return n},we.prototype.cartesianToCanvasCoordinates=function(e,t){return ve.wgs84ToWindowCoordinates(this,e,t)},we.prototype.completeMorph=function(){this._transitioner.completeMorph()},we.prototype.morphTo2D=function(e){var t,r=this.globe;t=h(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=d(e,2),this._transitioner.morphTo2D(e,t)},we.prototype.morphToColumbusView=function(e){var t,r=this.globe;t=h(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=d(e,2),this._transitioner.morphToColumbusView(e,t)},we.prototype.morphTo3D=function(e){var t,r=this.globe;t=h(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=d(e,2),this._transitioner.morphTo3D(e,t)},we.prototype.isDestroyed=function(){return!1},we.prototype.destroy=function(){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._pickDepthFramebuffer=this._pickDepthFramebuffer&&this._pickDepthFramebuffer.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(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),h(this._globeDepth)&&this._globeDepth.destroy(),this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),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)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(var e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,f(this)},we}),define("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nuniform vec4 u_cameraAndRadiiAndDynamicAtmosphereColor;\nconst float g = -0.95;\nconst float g2 = g * g;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\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 = czm_RGBToHSB(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 = czm_HSBToRGB(hsb);\nl = min(l, czm_luminance(rgb));\n#endif\nfloat atmosphereAlpha = clamp((u_cameraAndRadiiAndDynamicAtmosphereColor.y - u_cameraAndRadiiAndDynamicAtmosphereColor.x) / (u_cameraAndRadiiAndDynamicAtmosphereColor.y - u_cameraAndRadiiAndDynamicAtmosphereColor.z), 0.0, 1.0);\nfloat nightAlpha = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? clamp(dot(normalize(czm_viewerPositionWC), normalize(czm_sunPositionWC)), 0.0, 1.0) : 1.0;\natmosphereAlpha *= pow(nightAlpha, 0.5);\ngl_FragColor = vec4(rgb, mix(rgb.b, 1.0, atmosphereAlpha) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),define("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"}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C){"use strict";function S(i){i=r(i,a.WGS84),this.show=!0,this._ellipsoid=i,this._command=new h({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(i.radii,1.025,new e)),n.z=i.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 T(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){var r=t.mode;if((r===C.SCENE3D||r===C.MORPHING)&&t.passes.render){var n=this._command;if(!i(n.vertexArray)){var o=t.context,a=s.createGeometry(new s({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:c.POSITION_ONLY}));n.vertexArray=g.fromGeometry({context:o,geometry:a,attributeLocations:l.createAttributeLocations(a),bufferUsage:d.STATIC_DRAW}),n.renderState=p.fromCache({cull:{enabled:!0,face:b.FRONT},blending:y.ALPHA_BLEND});var u=new m({defines:["SKY_FROM_SPACE"],sources:[v]});this._spSkyFromSpace=f.fromCache({context:o,vertexShaderSource:u,fragmentShaderSource:_}),u=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphere=f.fromCache({context:o,vertexShaderSource:u,fragmentShaderSource:_})}var h=T(this);if(h&&(!i(this._spSkyFromSpaceColorCorrect)||!i(this._spSkyFromAtmosphereColorCorrect))){var S=t.context,w=new m({defines:["SKY_FROM_SPACE"],sources:[v]}),A=new m({defines:["COLOR_CORRECT"],sources:[_]});this._spSkyFromSpaceColorCorrect=f.fromCache({context:S,vertexShaderSource:w,fragmentShaderSource:A}),w=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphereColorCorrect=f.fromCache({context:S,vertexShaderSource:w,fragmentShaderSource:A})}var E=t.camera.positionWC,x=e.magnitude(E);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=x,x>this._cameraAndRadiiAndDynamicAtmosphereColor.y?n.shaderProgram=h?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:n.shaderProgram=h?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,n}}},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}),define("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"}),define("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"}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y){"use strict";function b(e){this.sources=e.sources,this._sources=void 0,this.show=r(e.show,!0),this._command=new d({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return b.prototype.update=function(r){var n=this;if(this.show&&(r.mode===y.SCENE3D||r.mode===y.MORPHING)&&r.passes.render){var o=r.context;if(this._sources!==this.sources){this._sources=this.sources;var s=this.sources;"string"==typeof s.positiveX?h(o,this._sources).then(function(e){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:o,source:s}))}var d=this._command;if(!i(d.vertexArray)){d.uniformMap={u_cubeMap:function(){return n._cubeMap}};var b=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),C=a.createAttributeLocations(b);d.vertexArray=m.fromGeometry({context:o,geometry:b,attributeLocations:C,
bufferUsage:u.STATIC_DRAW}),d.shaderProgram=f.fromCache({context:o,vertexShaderSource:_,fragmentShaderSource:g,attributeLocations:C}),d.renderState=p.fromCache({blending:v.ALPHA_BLEND})}if(i(this._cubeMap))return d}},b.prototype.isDestroyed=function(){return!1},b.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)},b}),define("Scene/SphereEmitter",["../Core/Cartesian3","../Core/Check","../Core/defaultValue","../Core/defineProperties","../Core/Math"],function(e,t,r,i,n){"use strict";function o(e){e=r(e,1),this._radius=r(e,1)}return i(o.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),o.prototype.emit=function(t){var r=n.randomBetween(0,n.TWO_PI),i=n.randomBetween(0,n.PI),o=n.randomBetween(0,this._radius),a=o*Math.cos(r)*Math.sin(i),s=o*Math.sin(r)*Math.sin(i),l=o*Math.cos(i);t.position=e.fromElements(a,s,l,t.position),t.velocity=e.normalize(t.position,t.velocity)},o}),define("Scene/StyleExpression",["../Core/DeveloperError"],function(e){"use strict";function t(){}return t.prototype.evaluate=function(t,r,i){e.throwInstantiationError()},t.prototype.evaluateColor=function(t,r,i){e.throwInstantiationError()},t.prototype.getShaderFunction=function(t,r,i,n){e.throwInstantiationError()},t}),define("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"}),define("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"}),define("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"}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E){"use strict";function x(){this.show=!0,this._drawCommand=new g({primitiveType:h.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(x.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,I=new t,D=new i,O=new i;return x.prototype.update=function(i,a){if(this.show){var s=i.mode;if(s!==A.SCENE2D&&s!==A.MORPHING&&i.passes.render){var h=i.context,g=a.viewport.width,x=a.viewport.height;if(!o(this._texture)||g!==this._drawingBufferWidth||x!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=g,this._drawingBufferHeight=x,this._glowFactorDirty=!1;var M=Math.max(g,x);M=Math.pow(2,Math.ceil(Math.log(M)/Math.log(2))-2),M=Math.max(1,M),this._texture=new y({context:h,width:M,height:M,pixelFormat:d.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var R=this,L={u_glowLengthTS:function(){return R._glowLengthTS},u_radiusTS:function(){return R._radiusTS}};this._commands.computeCommand=new m({fragmentShaderSource:S,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){R._commands.computeCommand=void 0}})}var N=this._drawCommand;if(!o(N.vertexArray)){var k={direction:0},F=new Uint8Array(8);F[0]=0,F[1]=0,F[2]=255,F[3]=0,F[4]=255,F[5]=255,F[6]=0,F[7]=255;var B=p.createVertexBuffer({context:h,typedArray:F,usage:f.STATIC_DRAW}),U=[{index:k.direction,vertexBuffer:B,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}],V=p.createIndexBuffer({context:h,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:f.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});N.vertexArray=new b({context:h,attributes:U,indexBuffer:V}),N.shaderProgram=v.fromCache({context:h,vertexShaderSource:T,fragmentShaderSource:C,attributeLocations:k}),N.renderState=_.fromCache({blending:w.ALPHA_BLEND}),N.uniformMap=this._uniformMap}var z=h.uniformState.sunPositionWC,G=h.uniformState.sunPositionColumbusView,H=this._boundingVolume,W=this._boundingVolume2D;r.clone(z,H.center),W.center.x=G.z,W.center.y=G.x,W.center.z=G.y,H.radius=u.SOLAR_RADIUS+u.SOLAR_RADIUS*this._glowLengthTS,W.radius=H.radius,s===A.SCENE3D?e.clone(H,N.boundingVolume):s===A.COLUMBUS_VIEW&&e.clone(W,N.boundingVolume);var j=E.computeActualWgs84Position(i,z,O),q=r.magnitude(r.subtract(j,i.camera.position,O)),Y=h.uniformState.projection,X=D;X.x=0,X.y=0,X.z=-q,X.w=1;var Q=c.multiplyByVector(Y,X,O),Z=E.clipToGLWindowCoordinates(a.viewport,Q,P);X.x=u.SOLAR_RADIUS;var K=c.multiplyByVector(Y,X,O),J=E.clipToGLWindowCoordinates(a.viewport,K,I);return this._size=Math.ceil(t.magnitude(t.subtract(J,Z,O))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},x.prototype.isDestroyed=function(){return!1},x.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)},x}),define("Scene/TileBoundingVolume",["../Core/DeveloperError"],function(e){"use strict";function t(){}return t.prototype.boundingVolume=void 0,t.prototype.boundingSphere=void 0,t.prototype.distanceToCamera=function(t){e.throwInstantiationError()},t.prototype.intersectPlane=function(t){e.throwInstantiationError()},t.prototype.createDebugVolume=function(t){e.throwInstantiationError()},t}),define("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,r,i,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT),this._tilingScheme=r(i.tilingScheme)?i.tilingScheme:new o({ellipsoid:i.ellipsoid}),this._color=t(i.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(i.tileWidth,256),this._tileHeight=t(i.tileHeight,256),this._readyPromise=a.resolve(!0)}return i(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,r){},s.prototype.requestImage=function(e,t,r,i){var n=document.createElement("canvas");n.width=256,n.height=256;var o=n.getContext("2d"),a=this._color.toCssColorString();o.strokeStyle=a,o.lineWidth=2,o.strokeRect(1,1,255,255);var s="L"+r+"X"+e+"Y"+t;return o.font="bold 25px Arial",o.textAlign="center",o.fillStyle="black",o.fillText(s,127,127),o.fillStyle=a,o.fillText(s,124,124),n},s.prototype.pickFeatures=function(e,t,r,i,n){},s}),define("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}),define("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";return e({START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3})}),define("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"}),define("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,r,i,n,o,a,s,l,u,c){"use strict";function d(i,n){this.show=!0,r(i)||(i=new e),this.rectangle=e.clone(i),r(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 d.prototype.update=function(t){if(this.show){var i=this._rs;r(i)&&e.equals(i.viewport,this.rectangle)||(this._rs=a.fromCache({blending:u.ALPHA_BLEND,viewport:this.rectangle}));if(t.passes.render){var n=t.context;if(this._material!==this.material||!r(this._overlayCommand)){this._material=this.material,r(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var c=new s({sources:[this._material.shaderSource,l]});this._overlayCommand=n.createViewportQuadCommand(c,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=o.OVERLAY}this._material.update(n),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return r(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),i(this)},d}),define("ThirdParty/crunch",[],function(){function globalEval(e){eval.call(null,e)}function assert(e,t){e||abort("Assertion failed: "+t)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,t,r,i){switch(r=r||"i8","*"===r.charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":HEAP8[e>>0]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+r)}}function getValue(e,t,r){switch(t=t||"i8","*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+t)}return null}function allocate(e,t,r,i){var n,o;"number"==typeof e?(n=!0,o=e):(n=!1,o=e.length);var a,s="string"==typeof t?t:null;if(a=r==ALLOC_NONE?i:["function"==typeof _malloc?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===r?ALLOC_STATIC:r](Math.max(o,s?1:t.length)),n){var l,i=a;for(assert(0==(3&a)),l=a+(-4&o);i<l;i+=4)HEAP32[i>>2]=0;for(l=a+o;i<l;)HEAP8[i++>>0]=0;return a}if("i8"===s)return e.subarray||e.slice?HEAPU8.set(e,a):HEAPU8.set(new Uint8Array(e),a),a;for(var u,c,d,h=0;h<o;){var p=e[h];"function"==typeof p&&(p=Runtime.getFunctionIndex(p)),u=s||t[h],0!==u?("i64"==u&&(u="i32"),setValue(a+h,p,u),d!==u&&(c=Runtime.getNativeTypeSize(u),d=u),h+=c):h++}return a}function getMemory(e){return staticSealed?runtimeInitialized?_malloc(e):Runtime.dynamicAlloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,t){if(0===t||!e)return"";for(var r,i=0,n=0;;){if(r=HEAPU8[e+n>>0],i|=r,0==r&&!t)break;if(n++,t&&n==t)break}t||(t=n);var o="";if(i<128){for(var a;t>0;)a=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(t,1024))),o=o?o+a:a,e+=1024,t-=1024;return o}return Module.UTF8ToString(e)}function AsciiToString(e){for(var t="";;){var r=HEAP8[e++>>0];if(!r)return t;t+=String.fromCharCode(r)}}function stringToAscii(e,t){return writeAsciiToMemory(e,t,!1)}function UTF8ArrayToString(e,t){for(var r=t;e[r];)++r;if(r-t>16&&e.subarray&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,r));for(var i,n,o,a,s,l,u="";;){if(!(i=e[t++]))return u;if(128&i)if(n=63&e[t++],192!=(224&i))if(o=63&e[t++],224==(240&i)?i=(15&i)<<12|n<<6|o:(a=63&e[t++],240==(248&i)?i=(7&i)<<18|n<<12|o<<6|a:(s=63&e[t++],248==(252&i)?i=(3&i)<<24|n<<18|o<<12|a<<6|s:(l=63&e[t++],i=(1&i)<<30|n<<24|o<<18|a<<12|s<<6|l))),i<65536)u+=String.fromCharCode(i);else{var c=i-65536;u+=String.fromCharCode(55296|c>>10,56320|1023&c)}else u+=String.fromCharCode((31&i)<<6|n);else u+=String.fromCharCode(i)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,t,r,i){if(!(i>0))return 0;for(var n=r,o=r+i-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else if(s<=2097151){if(r+3>=o)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}else if(s<=67108863){if(r+4>=o)break;t[r++]=248|s>>24,t[r++]=128|s>>18&63,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+5>=o)break;t[r++]=252|s>>30,t[r++]=128|s>>24&63,t[r++]=128|s>>18&63,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-n}function stringToUTF8(e,t,r){return stringToUTF8Array(e,HEAPU8,t,r)}function lengthBytesUTF8(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++r)),i<=127?++t:t+=i<=2047?2:i<=65535?3:i<=2097151?4:i<=67108863?5:6}return t}function demangle(e){var t=Module.___cxa_demangle||Module.__cxa_demangle;if(t){try{var r=e.substr(1),i=lengthBytesUTF8(r)+1,n=_malloc(i);stringToUTF8(r,n,i);var o=_malloc(4),a=t(n,0,0,o);if(0===getValue(o,"i32")&&a)return Pointer_stringify(a)}catch(e){}finally{n&&_free(n),o&&_free(o),a&&_free(a)}return e}return Runtime.warnOnce("warning: build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling"),e}function demangleAll(e){var t=/__Z[\w\d_]+/g;return e.replace(t,function(e){var t=demangle(e);return e===t?e:e+" ["+t+"]"})}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){var e=jsStackTrace();return Module.extraStackTrace&&(e+="\n"+Module.extraStackTrace()),demangleAll(e)}function alignUp(e,t){return e%t>0&&(e+=t-e%t),e}function updateGlobalBuffer(e){Module.buffer=buffer=e}function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with  -s TOTAL_MEMORY=X  with X higher than the current value "+TOTAL_MEMORY+", (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 ")}function enlargeMemory(){var e=Module.usingWasm?WASM_PAGE_SIZE:ASMJS_PAGE_SIZE,t=2147483648-e;if(HEAP32[DYNAMICTOP_PTR>>2]>t)return!1;var r=TOTAL_MEMORY;for(TOTAL_MEMORY=Math.max(TOTAL_MEMORY,MIN_TOTAL_MEMORY);TOTAL_MEMORY<HEAP32[DYNAMICTOP_PTR>>2];)TOTAL_MEMORY=TOTAL_MEMORY<=536870912?alignUp(2*TOTAL_MEMORY,e):Math.min(alignUp((3*TOTAL_MEMORY+2147483648)/4,e),t);var i=Module.reallocBuffer(TOTAL_MEMORY);return i&&i.byteLength==TOTAL_MEMORY?(updateGlobalBuffer(i),updateGlobalBufferViews(),!0):(TOTAL_MEMORY=r,!1)}function getTotalMemory(){return TOTAL_MEMORY}function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?Module.dynCall_v(r):Module.dynCall_vi(r,t.arg):r(void 0===t.arg?null:t.arg)}else t()}}function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,t,r){var i=r>0?r:lengthBytesUTF8(e)+1,n=new Array(i),o=stringToUTF8Array(e,n,0,n.length);return t&&(n.length=o),n}function intArrayToString(e){for(var t=[],r=0;r<e.length;r++){var i=e[r];i>255&&(i&=255),t.push(String.fromCharCode(i))}return t.join("")}function writeStringToMemory(e,t,r){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var i,n;r&&(n=t+lengthBytesUTF8(e),i=HEAP8[n]),stringToUTF8(e,t,1/0),r&&(HEAP8[n]=i)}function writeArrayToMemory(e,t){HEAP8.set(e,t)}function writeAsciiToMemory(e,t,r){for(var i=0;i<e.length;++i)HEAP8[t++>>0]=e.charCodeAt(i);r||(HEAP8[t>>0]=0)}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function _abort(){Module.abort()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}function ___cxa_begin_catch(e){var t=EXCEPTIONS.infos[e];return t&&!t.caught&&(t.caught=!0,__ZSt18uncaught_exceptionv.uncaught_exception--),t&&(t.rethrown=!1),EXCEPTIONS.caught.push(e),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(e)),e}function _pthread_once(e,t){_pthread_once.seen||(_pthread_once.seen={}),e in _pthread_once.seen||(Module.dynCall_v(t),_pthread_once.seen[e]=1)}function _emscripten_memcpy_big(e,t,r){return HEAPU8.set(HEAPU8.subarray(t,t+r),e),e}function ___syscall6(e,t){SYSCALLS.varargs=t;try{var r=SYSCALLS.getStreamFromFD();return FS.close(r),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _pthread_getspecific(e){return PTHREAD_SPECIFIC[e]||0}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}function _pthread_key_create(e,t){return 0==e?ERRNO_CODES.EINVAL:(HEAP32[e>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function ___resumeException(e){throw EXCEPTIONS.last||(EXCEPTIONS.last=e),e+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function ___cxa_find_matching_catch(){var e=EXCEPTIONS.last;if(!e)return 0|(Runtime.setTempRet0(0),0);var t=EXCEPTIONS.infos[e],r=t.type;if(!r)return 0|(Runtime.setTempRet0(0),e);var i=Array.prototype.slice.call(arguments);Module.___cxa_is_pointer_type(r);___cxa_find_matching_catch.buffer||(___cxa_find_matching_catch.buffer=_malloc(4)),HEAP32[___cxa_find_matching_catch.buffer>>2]=e,e=___cxa_find_matching_catch.buffer;for(var n=0;n<i.length;n++)if(i[n]&&Module.___cxa_can_catch(i[n],r,e))return e=HEAP32[e>>2],t.adjusted=e,0|(Runtime.setTempRet0(i[n]),e);return e=HEAP32[e>>2],0|(Runtime.setTempRet0(r),e)}function ___gxx_personality_v0(){}function _pthread_setspecific(e,t){return e in PTHREAD_SPECIFIC?(PTHREAD_SPECIFIC[e]=t,0):ERRNO_CODES.EINVAL}function ___syscall140(e,t){SYSCALLS.varargs=t;try{var r=SYSCALLS.getStreamFromFD(),i=(SYSCALLS.get(),SYSCALLS.get()),n=SYSCALLS.get(),o=SYSCALLS.get(),a=i;return FS.llseek(r,a,o),HEAP32[n>>2]=r.position,r.getdents&&0===a&&0===o&&(r.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,t){SYSCALLS.varargs=t;try{var r=SYSCALLS.get(),i=SYSCALLS.get(),n=SYSCALLS.get(),o=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(e,t){var r=___syscall146.buffers[e];assert(r),0===t||10===t?((1===e?Module.print:Module.printErr)(UTF8ArrayToString(r,0)),r.length=0):r.push(t)});for(var a=0;a<n;a++){for(var s=HEAP32[i+8*a>>2],l=HEAP32[i+(8*a+4)>>2],u=0;u<l;u++)___syscall146.printChar(r,HEAPU8[s+u]);o+=l}return o}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,t){SYSCALLS.varargs=t;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function invoke_iiii(e,t,r,i){try{return Module.dynCall_iiii(e,t,r,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiiii(e,t,r,i,n,o){try{Module.dynCall_viiiii(e,t,r,i,n,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_vi(e,t){try{Module.dynCall_vi(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_ii(e,t){try{return Module.dynCall_ii(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viii(e,t,r,i){try{Module.dynCall_viii(e,t,r,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiiiii(e,t,r,i,n,o,a){try{Module.dynCall_viiiiii(e,t,r,i,n,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function invoke_viiii(e,t,r,i,n){try{Module.dynCall_viiii(e,t,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Module.setThrew(1,0)}}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function t(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),t()},1)):t()))}function exit(e,t){t&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE&&process.exit(e),Module.quit(e,new ExitStatus(e)))}function abort(e){Module.onAbort&&Module.onAbort(e),void 0!==e?(Module.print(e),Module.printErr(e),e=JSON.stringify(e)):e="",ABORT=!0,EXITSTATUS=1;var t="abort("+e+") at "+stackTrace()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";throw abortDecorators&&abortDecorators.forEach(function(r){t=r(t,e)}),t}var Module;Module||(Module=(void 0!==Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1;if(Module.ENVIRONMENT)if("WEB"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if("WORKER"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if("NODE"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if("SHELL"!==Module.ENVIRONMENT)throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn);var nodeFS,nodePath;Module.read=function(e,t){nodeFS||(nodeFS=require("fs")),nodePath||(nodePath=require("path")),e=nodePath.normalize(e);var r=nodeFS.readFileSync(e);return t?r:r.toString()},Module.readBinary=function(e){var t=Module.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var t=read(e,"binary");return assert("object"==typeof t),t},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),"function"==typeof quit&&(Module.quit=function(e,t){quit(e)});else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Module.readAsync=function(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.quit||(Module.quit=function(e,t){throw t}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(e){return tempRet0=e,e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8==0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},getAlignSize:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},dynCall:function(e,t,r){return r&&r.length?Module["dynCall_"+e].apply(null,[t].concat(r)):Module["dynCall_"+e].call(null,t)},functionPointers:[],addFunction:function(e){for(var t=0;t<Runtime.functionPointers.length;t++)if(!Runtime.functionPointers[t])return Runtime.functionPointers[t]=e,2*(1+t);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,t){assert(t),Runtime.funcWrappers[t]||(Runtime.funcWrappers[t]={});var r=Runtime.funcWrappers[t];return r[e]||(1===t.length?r[e]=function(){return Runtime.dynCall(t,e)}:2===t.length?r[e]=function(r){return Runtime.dynCall(t,e,[r])
}:r[e]=function(){return Runtime.dynCall(t,e,Array.prototype.slice.call(arguments))}),r[e]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var t=STACKTOP;return STACKTOP=STACKTOP+e|0,STACKTOP=STACKTOP+15&-16,t},staticAlloc:function(e){var t=STATICTOP;return STATICTOP=STATICTOP+e|0,STATICTOP=STATICTOP+15&-16,t},dynamicAlloc:function(e){var t=HEAP32[DYNAMICTOP_PTR>>2],r=-16&(t+e+15|0);if(HEAP32[DYNAMICTOP_PTR>>2]=r,r>=TOTAL_MEMORY){if(!enlargeMemory())return HEAP32[DYNAMICTOP_PTR>>2]=t,0}return t},alignMemory:function(e,t){return e=Math.ceil(e/(t||16))*(t||16)},makeBigInt:function(e,t,r){return r?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0,cwrap,ccall;!function(){function parseJSFunc(e){var t=e.toString().match(sourceRegex).slice(1);return{arguments:t[0],body:t[1],returnValue:t[2]}}function ensureJSsource(){if(!JSsource){JSsource={};for(var e in JSfuncs)JSfuncs.hasOwnProperty(e)&&(JSsource[e]=parseJSFunc(JSfuncs[e]))}}var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var t=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,t),t},stringToC:function(e){var t=0;if(null!==e&&void 0!==e&&0!==e){var r=1+(e.length<<2);t=Runtime.stackAlloc(r),stringToUTF8(e,t,r)}return t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,t,r,i,n){var o=getCFunc(e),a=[],s=0;if(i)for(var l=0;l<i.length;l++){var u=toC[r[l]];u?(0===s&&(s=Runtime.stackSave()),a[l]=u(i[l])):a[l]=i[l]}var c=o.apply(null,a);if("string"===t&&(c=Pointer_stringify(c)),0!==s){if(n&&n.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(s)});Runtime.stackRestore(s)}return c};var sourceRegex=/^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,JSsource=null;cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,t){return"$"+t}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"=("+convertCode.returnValue+");"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;Module.stackTrace=stackTrace;var WASM_PAGE_SIZE=65536,ASMJS_PAGE_SIZE=16777216,MIN_TOTAL_MEMORY=16777216,HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1,Module.reallocBuffer||(Module.reallocBuffer=function(e){var t;try{if(ArrayBuffer.transfer)t=ArrayBuffer.transfer(buffer,e);else{var r=HEAP8;t=new ArrayBuffer(e);new Int8Array(t).set(r)}}catch(e){return!1}return!!_emscripten_replace_memory(t)&&t});var byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(e){byteLength=function(e){return e.byteLength}}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216;if(TOTAL_MEMORY<TOTAL_STACK&&Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),buffer=Module.buffer?Module.buffer:new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews(),HEAP32[0]=1668509029,HEAP16[1]=25459,115!==HEAPU8[2]||99!==HEAPU8[3])throw"Runtime error: expected the system to be little-endian!";Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){var r=e>>>16,i=65535&e,n=t>>>16,o=65535&t;return i*o+(r*o+i*n<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[];STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+6192,__ATINIT__.push(),allocate([228,2,0,0,81,16,0,0,12,3,0,0,177,16,0,0,32,0,0,0,0,0,0,0,12,3,0,0,94,16,0,0,48,0,0,0,0,0,0,0,228,2,0,0,127,16,0,0,12,3,0,0,140,16,0,0,16,0,0,0,0,0,0,0,12,3,0,0,183,17,0,0,32,0,0,0,0,0,0,0,12,3,0,0,147,17,0,0,72,0,0,0,0,0,0,0,108,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,32,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,1,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,40,20,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,16,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,56,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,5,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,105,110,99,92,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,83,116,57,101,120,99,101,112,116,105,111,110,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;STATICTOP+=16;var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(e){if(!e||EXCEPTIONS.infos[e])return e;for(var t in EXCEPTIONS.infos){if(EXCEPTIONS.infos[t].adjusted===e)return t}return e},addRef:function(e){if(e){EXCEPTIONS.infos[e].refcount++}},decRef:function(e){if(e){var t=EXCEPTIONS.infos[e];assert(t.refcount>0),t.refcount--,0!==t.refcount||t.rethrown||(t.destructor&&Module.dynCall_vi(t.destructor,e),delete EXCEPTIONS.infos[e],___cxa_free_exception(e))}},clearRef:function(e){if(e){EXCEPTIONS.infos[e].refcount=0}}},SYSCALLS={varargs:0,get:function(e){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},get64:function(){var e=SYSCALLS.get(),t=SYSCALLS.get();return assert(e>=0?0===t:-1===t),e},getZero:function(){assert(0===SYSCALLS.get())}},cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_STATIC),PTHREAD_SPECIFIC={},PTHREAD_SPECIFIC_NEXT_KEY=1,ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};__ATEXIT__.push(function(){var e=Module._fflush;e&&e(0);var t=___syscall146.printChar;if(t){var r=___syscall146.buffers;r[1].length&&t(1,10),r[2].length&&t(2,10)}}),DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0,Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:byteLength},Module.asmLibraryArg={abort:abort,assert:assert,enlargeMemory:enlargeMemory,getTotalMemory:getTotalMemory,abortOnCannotGrowMemory:abortOnCannotGrowMemory,invoke_iiii:invoke_iiii,invoke_viiiii:invoke_viiiii,invoke_vi:invoke_vi,invoke_ii:invoke_ii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viiiiii:invoke_viiiiii,invoke_viiii:invoke_viiii,_pthread_getspecific:_pthread_getspecific,___syscall54:___syscall54,_pthread_setspecific:_pthread_setspecific,___gxx_personality_v0:___gxx_personality_v0,___syscall6:___syscall6,___setErrNo:___setErrNo,_abort:_abort,___cxa_begin_catch:___cxa_begin_catch,_pthread_once:_pthread_once,_emscripten_memcpy_big:_emscripten_memcpy_big,_pthread_key_create:_pthread_key_create,___syscall140:___syscall140,___resumeException:___resumeException,___cxa_find_matching_catch:___cxa_find_matching_catch,___syscall146:___syscall146,__ZSt18uncaught_exceptionv:__ZSt18uncaught_exceptionv,DYNAMICTOP_PTR:DYNAMICTOP_PTR,tempDoublePtr:tempDoublePtr,ABORT:ABORT,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,cttz_i8:cttz_i8};var asm=function(e,t,r){"almost asm";function i(e){return!(16777215&rr(e)||rr(e)<=16777215||rr(e)>2147483648)&&(zt=new Vt(e),Ht=new Gt(e),jt=new Wt(e),Yt=new qt(e),Qt=new Xt(e),Kt=new Zt(e),$t=new Jt(e),tr=new er(e),r=e,!0)}function n(e){e|=0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,C=0;C=or,or=or+16|0,h=C;do{if(e>>>0<245){if(u=e>>>0<11?16:e+11&-8,e=u>>>3,d=0|jt[1144],3&(r=d>>>e)|0)return t=(1&r^1)+e|0,e=4616+(t<<1<<2)|0,r=e+8|0,i=0|jt[r>>2],n=i+8|0,o=0|jt[n>>2],(0|e)==(0|o)?jt[1144]=d&~(1<<t):(jt[o+12>>2]=e,jt[r>>2]=o),b=t<<3,jt[i+4>>2]=3|b,b=i+b+4|0,jt[b>>2]=1|jt[b>>2],b=n,or=C,0|b;if(c=0|jt[1146],u>>>0>c>>>0){if(0|r)return t=2<<e,t=r<<e&(t|0-t),t=(t&0-t)-1|0,a=t>>>12&16,t>>>=a,r=t>>>5&8,t>>>=r,n=t>>>2&4,t>>>=n,e=t>>>1&2,t>>>=e,i=t>>>1&1,i=(r|a|n|e|i)+(t>>>i)|0,t=4616+(i<<1<<2)|0,e=t+8|0,n=0|jt[e>>2],a=n+8|0,r=0|jt[a>>2],(0|t)==(0|r)?(e=d&~(1<<i),jt[1144]=e):(jt[r+12>>2]=t,jt[e>>2]=r,e=d),o=(i<<3)-u|0,jt[n+4>>2]=3|u,i=n+u|0,jt[i+4>>2]=1|o,jt[i+o>>2]=o,0|c&&(n=0|jt[1149],t=c>>>3,r=4616+(t<<1<<2)|0,t=1<<t,e&t?(e=r+8|0,t=0|jt[e>>2]):(jt[1144]=e|t,t=r,e=r+8|0),jt[e>>2]=n,jt[t+12>>2]=n,jt[n+8>>2]=t,jt[n+12>>2]=r),jt[1146]=o,jt[1149]=i,b=a,or=C,0|b;if(s=0|jt[1145]){if(r=(s&0-s)-1|0,a=r>>>12&16,r>>>=a,o=r>>>5&8,r>>>=o,l=r>>>2&4,r>>>=l,i=r>>>1&2,r>>>=i,e=r>>>1&1,e=0|jt[4880+((o|a|l|i|e)+(r>>>e)<<2)>>2],r=(-8&jt[e+4>>2])-u|0,i=0|jt[e+16+((0==(0|jt[e+16>>2])&1)<<2)>>2]){do{a=(-8&jt[i+4>>2])-u|0,l=a>>>0<r>>>0,r=l?a:r,e=l?i:e,i=0|jt[i+16+((0==(0|jt[i+16>>2])&1)<<2)>>2]}while(0!=(0|i));l=e,o=r}else l=e,o=r;if(a=l+u|0,l>>>0<a>>>0){n=0|jt[l+24>>2],t=0|jt[l+12>>2];do{if((0|t)==(0|l)){if(e=l+20|0,!((t=0|jt[e>>2])||(e=l+16|0,t=0|jt[e>>2]))){r=0;break}for(;;)if(r=t+20|0,0|(i=0|jt[r>>2]))t=i,e=r;else{if(r=t+16|0,!(i=0|jt[r>>2]))break;t=i,e=r}jt[e>>2]=0,r=t}else r=0|jt[l+8>>2],jt[r+12>>2]=t,jt[t+8>>2]=r,r=t}while(0);do{if(0|n){if(t=0|jt[l+28>>2],e=4880+(t<<2)|0,(0|l)==(0|jt[e>>2])){if(jt[e>>2]=r,!r){jt[1145]=s&~(1<<t);break}}else if(jt[n+16+(((0|jt[n+16>>2])!=(0|l)&1)<<2)>>2]=r,!r)break;jt[r+24>>2]=n,t=0|jt[l+16>>2],0|t&&(jt[r+16>>2]=t,jt[t+24>>2]=r),t=0|jt[l+20>>2],0|t&&(jt[r+20>>2]=t,jt[t+24>>2]=r)}}while(0);return o>>>0<16?(b=o+u|0,jt[l+4>>2]=3|b,b=l+b+4|0,jt[b>>2]=1|jt[b>>2]):(jt[l+4>>2]=3|u,jt[a+4>>2]=1|o,jt[a+o>>2]=o,0|c&&(i=0|jt[1149],t=c>>>3,r=4616+(t<<1<<2)|0,t=1<<t,d&t?(e=r+8|0,t=0|jt[e>>2]):(jt[1144]=d|t,t=r,e=r+8|0),jt[e>>2]=i,jt[t+12>>2]=i,jt[i+8>>2]=t,jt[i+12>>2]=r),jt[1146]=o,jt[1149]=a),b=l+8|0,or=C,0|b}d=u}else d=u}else d=u}else if(e>>>0<=4294967231)if(e=e+11|0,u=-8&e,l=0|jt[1145]){i=0-u|0,e>>>=8,e?u>>>0>16777215?s=31:(d=(e+1048320|0)>>>16&8,y=e<<d,c=(y+520192|0)>>>16&4,y<<=c,s=(y+245760|0)>>>16&2,s=14-(c|d|s)+(y<<s>>>15)|0,s=u>>>(s+7|0)&1|s<<1):s=0,r=0|jt[4880+(s<<2)>>2];e:do{if(r)for(e=0,a=u<<(31==(0|s)?0:25-(s>>>1)|0),o=0;;){if((n=(-8&jt[r+4>>2])-u|0)>>>0<i>>>0){if(!n){e=r,i=0,n=r,y=61;break e}e=r,i=n}if(n=0|jt[r+20>>2],r=0|jt[r+16+(a>>>31<<2)>>2],o=0==(0|n)|(0|n)==(0|r)?o:n,n=0==(0|r)){r=o,y=57;break}a<<=1&(1^n)}else r=0,e=0,y=57}while(0);if(57==(0|y)){if(0==(0|r)&0==(0|e)){if(e=2<<s,!(e=l&(e|0-e))){d=u;break}d=(e&0-e)-1|0,a=d>>>12&16,d>>>=a,o=d>>>5&8,d>>>=o,s=d>>>2&4,d>>>=s,c=d>>>1&2,d>>>=c,r=d>>>1&1,e=0,r=0|jt[4880+((o|a|s|c|r)+(d>>>r)<<2)>>2]}r?(n=r,y=61):(s=e,a=i)}if(61==(0|y))for(;;){if(y=0,r=(-8&jt[n+4>>2])-u|0,d=r>>>0<i>>>0,r=d?r:i,e=d?n:e,!(n=0|jt[n+16+((0==(0|jt[n+16>>2])&1)<<2)>>2])){s=e,a=r;break}i=r,y=61}if(0!=(0|s)?a>>>0<((0|jt[1146])-u|0)>>>0:0){if(o=s+u|0,s>>>0>=o>>>0)return b=0,or=C,0|b;n=0|jt[s+24>>2],t=0|jt[s+12>>2];do{if((0|t)==(0|s)){if(e=s+20|0,!((t=0|jt[e>>2])||(e=s+16|0,t=0|jt[e>>2]))){t=0;break}for(;;)if(r=t+20|0,0|(i=0|jt[r>>2]))t=i,e=r;else{if(r=t+16|0,!(i=0|jt[r>>2]))break;t=i,e=r}jt[e>>2]=0}else b=0|jt[s+8>>2],jt[b+12>>2]=t,jt[t+8>>2]=b}while(0);do{if(n){if(e=0|jt[s+28>>2],r=4880+(e<<2)|0,(0|s)==(0|jt[r>>2])){if(jt[r>>2]=t,!t){i=l&~(1<<e),jt[1145]=i;break}}else if(jt[n+16+(((0|jt[n+16>>2])!=(0|s)&1)<<2)>>2]=t,!t){i=l;break}jt[t+24>>2]=n,e=0|jt[s+16>>2],0|e&&(jt[t+16>>2]=e,jt[e+24>>2]=t),e=0|jt[s+20>>2],e?(jt[t+20>>2]=e,jt[e+24>>2]=t,i=l):i=l}else i=l}while(0);do{if(a>>>0>=16){if(jt[s+4>>2]=3|u,jt[o+4>>2]=1|a,jt[o+a>>2]=a,t=a>>>3,a>>>0<256){r=4616+(t<<1<<2)|0,e=0|jt[1144],t=1<<t,e&t?(e=r+8|0,t=0|jt[e>>2]):(jt[1144]=e|t,t=r,e=r+8|0),jt[e>>2]=o,jt[t+12>>2]=o,jt[o+8>>2]=t,jt[o+12>>2]=r;break}if(t=a>>>8,t?a>>>0>16777215?t=31:(y=(t+1048320|0)>>>16&8,b=t<<y,v=(b+520192|0)>>>16&4,b<<=v,t=(b+245760|0)>>>16&2,t=14-(v|y|t)+(b<<t>>>15)|0,t=a>>>(t+7|0)&1|t<<1):t=0,r=4880+(t<<2)|0,jt[o+28>>2]=t,e=o+16|0,jt[e+4>>2]=0,jt[e>>2]=0,e=1<<t,!(i&e)){jt[1145]=i|e,jt[r>>2]=o,jt[o+24>>2]=r,jt[o+12>>2]=o,jt[o+8>>2]=o;break}for(e=a<<(31==(0|t)?0:25-(t>>>1)|0),r=0|jt[r>>2];;){if((-8&jt[r+4>>2]|0)==(0|a)){y=97;break}if(i=r+16+(e>>>31<<2)|0,!(t=0|jt[i>>2])){y=96;break}e<<=1,r=t}if(96==(0|y)){jt[i>>2]=o,jt[o+24>>2]=r,jt[o+12>>2]=o,jt[o+8>>2]=o;break}if(97==(0|y)){y=r+8|0,b=0|jt[y>>2],jt[b+12>>2]=o,jt[y>>2]=o,jt[o+8>>2]=b,jt[o+12>>2]=r,jt[o+24>>2]=0;break}}else b=a+u|0,jt[s+4>>2]=3|b,b=s+b+4|0,jt[b>>2]=1|jt[b>>2]}while(0);return b=s+8|0,or=C,0|b}d=u}else d=u;else d=-1}while(0);if((r=0|jt[1146])>>>0>=d>>>0)return t=r-d|0,e=0|jt[1149],t>>>0>15?(b=e+d|0,jt[1149]=b,jt[1146]=t,jt[b+4>>2]=1|t,jt[b+t>>2]=t,jt[e+4>>2]=3|d):(jt[1146]=0,jt[1149]=0,jt[e+4>>2]=3|r,b=e+r+4|0,jt[b>>2]=1|jt[b>>2]),b=e+8|0,or=C,0|b;if((a=0|jt[1147])>>>0>d>>>0)return v=a-d|0,jt[1147]=v,b=0|jt[1150],y=b+d|0,jt[1150]=y,jt[y+4>>2]=1|v,jt[b+4>>2]=3|d,b=b+8|0,or=C,0|b;if(0|jt[1262]?e=0|jt[1264]:(jt[1264]=4096,jt[1263]=4096,jt[1265]=-1,jt[1266]=-1,jt[1267]=0,jt[1255]=0,e=-16&h^1431655768,jt[h>>2]=e,jt[1262]=e,e=4096),s=d+48|0,l=d+47|0,o=e+l|0,n=0-e|0,(u=o&n)>>>0<=d>>>0)return b=0,or=C,0|b;if(e=0|jt[1254],0|e?(c=0|jt[1252],(h=c+u|0)>>>0<=c>>>0|h>>>0>e>>>0):0)return b=0,or=C,0|b;e:do{if(4&jt[1255])t=0,y=133;else{r=0|jt[1150];t:do{if(r){for(i=5024;;){if(e=0|jt[i>>2],e>>>0<=r>>>0?(m=i+4|0,(e+(0|jt[m>>2])|0)>>>0>r>>>0):0)break;if(!(e=0|jt[i+8>>2])){y=118;break t}i=e}
if((t=o-a&n)>>>0<2147483647)if((0|(e=0|be(0|t)))==((0|jt[i>>2])+(0|jt[m>>2])|0)){if(-1!=(0|e)){a=t,o=e,y=135;break e}}else i=e,y=126;else t=0}else y=118}while(0);do{if(118==(0|y))if(r=0|be(0),-1!=(0|r)?(t=r,p=0|jt[1263],f=p+-1|0,t=(0==(f&t|0)?0:(f+t&0-p)-t|0)+u|0,p=0|jt[1252],f=t+p|0,t>>>0>d>>>0&t>>>0<2147483647):0){if(m=0|jt[1254],0|m?f>>>0<=p>>>0|f>>>0>m>>>0:0){t=0;break}if((0|(e=0|be(0|t)))==(0|r)){a=t,o=r,y=135;break e}i=e,y=126}else t=0}while(0);do{if(126==(0|y)){if(r=0-t|0,!(s>>>0>t>>>0&t>>>0<2147483647&-1!=(0|i))){if(-1==(0|i)){t=0;break}a=t,o=i,y=135;break e}if(e=0|jt[1264],(e=l-t+e&0-e)>>>0>=2147483647){a=t,o=i,y=135;break e}if(-1==(0|be(0|e))){be(0|r),t=0;break}a=e+t|0,o=i,y=135;break e}}while(0);jt[1255]=4|jt[1255],y=133}}while(0);if(!(133==(0|y)?u>>>0<2147483647:0)||(v=0|be(0|u),m=0|be(0),g=m-v|0,_=g>>>0>(d+40|0)>>>0,-1==(0|v)|1^_|v>>>0<m>>>0&-1!=(0|v)&-1!=(0|m)^1)||(a=_?g:t,o=v,y=135),135==(0|y)){t=(0|jt[1252])+a|0,jt[1252]=t,t>>>0>(0|jt[1253])>>>0&&(jt[1253]=t),l=0|jt[1150];do{if(l){for(t=5024;;){if(e=0|jt[t>>2],r=t+4|0,i=0|jt[r>>2],(0|o)==(e+i|0)){y=145;break}if(!(n=0|jt[t+8>>2]))break;t=n}if((145==(0|y)?0==(8&jt[t+12>>2]|0):0)?l>>>0<o>>>0&l>>>0>=e>>>0:0){jt[r>>2]=i+a,b=l+8|0,b=0==(7&b|0)?0:0-b&7,y=l+b|0,b=(0|jt[1147])+(a-b)|0,jt[1150]=y,jt[1147]=b,jt[y+4>>2]=1|b,jt[y+b+4>>2]=40,jt[1151]=jt[1266];break}for(o>>>0<(0|jt[1148])>>>0&&(jt[1148]=o),r=o+a|0,t=5024;;){if((0|jt[t>>2])==(0|r)){y=153;break}if(!(e=0|jt[t+8>>2]))break;t=e}if(153==(0|y)?0==(8&jt[t+12>>2]|0):0){jt[t>>2]=o,c=t+4|0,jt[c>>2]=(0|jt[c>>2])+a,c=o+8|0,c=o+(0==(7&c|0)?0:0-c&7)|0,t=r+8|0,t=r+(0==(7&t|0)?0:0-t&7)|0,u=c+d|0,s=t-c-d|0,jt[c+4>>2]=3|d;do{if((0|t)!=(0|l)){if((0|t)==(0|jt[1149])){b=(0|jt[1146])+s|0,jt[1146]=b,jt[1149]=u,jt[u+4>>2]=1|b,jt[u+b>>2]=b;break}if(1==(3&(e=0|jt[t+4>>2])|0)){a=-8&e,i=e>>>3;e:do{if(e>>>0<256){if(e=0|jt[t+8>>2],(0|(r=0|jt[t+12>>2]))==(0|e)){jt[1144]=jt[1144]&~(1<<i);break}jt[e+12>>2]=r,jt[r+8>>2]=e;break}o=0|jt[t+24>>2],e=0|jt[t+12>>2];do{if((0|e)==(0|t)){if(i=t+16|0,r=i+4|0,!(e=0|jt[r>>2])){if(!(e=0|jt[i>>2])){e=0;break}r=i}for(;;)if(i=e+20|0,0|(n=0|jt[i>>2]))e=n,r=i;else{if(i=e+16|0,!(n=0|jt[i>>2]))break;e=n,r=i}jt[r>>2]=0}else b=0|jt[t+8>>2],jt[b+12>>2]=e,jt[e+8>>2]=b}while(0);if(!o)break;r=0|jt[t+28>>2],i=4880+(r<<2)|0;do{if((0|t)==(0|jt[i>>2])){if(jt[i>>2]=e,0|e)break;jt[1145]=jt[1145]&~(1<<r);break e}if(jt[o+16+(((0|jt[o+16>>2])!=(0|t)&1)<<2)>>2]=e,!e)break e}while(0);if(jt[e+24>>2]=o,r=t+16|0,i=0|jt[r>>2],0|i&&(jt[e+16>>2]=i,jt[i+24>>2]=e),!(r=0|jt[r+4>>2]))break;jt[e+20>>2]=r,jt[r+24>>2]=e}while(0);t=t+a|0,n=a+s|0}else n=s;if(t=t+4|0,jt[t>>2]=-2&jt[t>>2],jt[u+4>>2]=1|n,jt[u+n>>2]=n,t=n>>>3,n>>>0<256){r=4616+(t<<1<<2)|0,e=0|jt[1144],t=1<<t,e&t?(e=r+8|0,t=0|jt[e>>2]):(jt[1144]=e|t,t=r,e=r+8|0),jt[e>>2]=u,jt[t+12>>2]=u,jt[u+8>>2]=t,jt[u+12>>2]=r;break}t=n>>>8;do{if(t){if(n>>>0>16777215){t=31;break}y=(t+1048320|0)>>>16&8,b=t<<y,v=(b+520192|0)>>>16&4,b<<=v,t=(b+245760|0)>>>16&2,t=14-(v|y|t)+(b<<t>>>15)|0,t=n>>>(t+7|0)&1|t<<1}else t=0}while(0);if(i=4880+(t<<2)|0,jt[u+28>>2]=t,e=u+16|0,jt[e+4>>2]=0,jt[e>>2]=0,e=0|jt[1145],r=1<<t,!(e&r)){jt[1145]=e|r,jt[i>>2]=u,jt[u+24>>2]=i,jt[u+12>>2]=u,jt[u+8>>2]=u;break}for(e=n<<(31==(0|t)?0:25-(t>>>1)|0),r=0|jt[i>>2];;){if((-8&jt[r+4>>2]|0)==(0|n)){y=194;break}if(i=r+16+(e>>>31<<2)|0,!(t=0|jt[i>>2])){y=193;break}e<<=1,r=t}if(193==(0|y)){jt[i>>2]=u,jt[u+24>>2]=r,jt[u+12>>2]=u,jt[u+8>>2]=u;break}if(194==(0|y)){y=r+8|0,b=0|jt[y>>2],jt[b+12>>2]=u,jt[y>>2]=u,jt[u+8>>2]=b,jt[u+12>>2]=r,jt[u+24>>2]=0;break}}else b=(0|jt[1147])+s|0,jt[1147]=b,jt[1150]=u,jt[u+4>>2]=1|b}while(0);return b=c+8|0,or=C,0|b}for(t=5024;;){if(e=0|jt[t>>2],e>>>0<=l>>>0?(b=e+(0|jt[t+4>>2])|0)>>>0>l>>>0:0)break;t=0|jt[t+8>>2]}n=b+-47|0,e=n+8|0,e=n+(0==(7&e|0)?0:0-e&7)|0,n=l+16|0,e=e>>>0<n>>>0?l:e,t=e+8|0,r=o+8|0,r=0==(7&r|0)?0:0-r&7,y=o+r|0,r=a+-40-r|0,jt[1150]=y,jt[1147]=r,jt[y+4>>2]=1|r,jt[y+r+4>>2]=40,jt[1151]=jt[1266],r=e+4|0,jt[r>>2]=27,jt[t>>2]=jt[1256],jt[t+4>>2]=jt[1257],jt[t+8>>2]=jt[1258],jt[t+12>>2]=jt[1259],jt[1256]=o,jt[1257]=a,jt[1259]=0,jt[1258]=t,t=e+24|0;do{y=t,t=t+4|0,jt[t>>2]=7}while((y+8|0)>>>0<b>>>0);if((0|e)!=(0|l)){if(o=e-l|0,jt[r>>2]=-2&jt[r>>2],jt[l+4>>2]=1|o,jt[e>>2]=o,t=o>>>3,o>>>0<256){r=4616+(t<<1<<2)|0,e=0|jt[1144],t=1<<t,e&t?(e=r+8|0,t=0|jt[e>>2]):(jt[1144]=e|t,t=r,e=r+8|0),jt[e>>2]=l,jt[t+12>>2]=l,jt[l+8>>2]=t,jt[l+12>>2]=r;break}if(t=o>>>8,t?o>>>0>16777215?r=31:(y=(t+1048320|0)>>>16&8,b=t<<y,v=(b+520192|0)>>>16&4,b<<=v,r=(b+245760|0)>>>16&2,r=14-(v|y|r)+(b<<r>>>15)|0,r=o>>>(r+7|0)&1|r<<1):r=0,i=4880+(r<<2)|0,jt[l+28>>2]=r,jt[l+20>>2]=0,jt[n>>2]=0,t=0|jt[1145],e=1<<r,!(t&e)){jt[1145]=t|e,jt[i>>2]=l,jt[l+24>>2]=i,jt[l+12>>2]=l,jt[l+8>>2]=l;break}for(e=o<<(31==(0|r)?0:25-(r>>>1)|0),r=0|jt[i>>2];;){if((-8&jt[r+4>>2]|0)==(0|o)){y=216;break}if(i=r+16+(e>>>31<<2)|0,!(t=0|jt[i>>2])){y=215;break}e<<=1,r=t}if(215==(0|y)){jt[i>>2]=l,jt[l+24>>2]=r,jt[l+12>>2]=l,jt[l+8>>2]=l;break}if(216==(0|y)){y=r+8|0,b=0|jt[y>>2],jt[b+12>>2]=l,jt[y>>2]=l,jt[l+8>>2]=b,jt[l+12>>2]=r,jt[l+24>>2]=0;break}}}else{b=0|jt[1148],0==(0|b)|o>>>0<b>>>0&&(jt[1148]=o),jt[1256]=o,jt[1257]=a,jt[1259]=0,jt[1153]=jt[1262],jt[1152]=-1,t=0;do{b=4616+(t<<1<<2)|0,jt[b+12>>2]=b,jt[b+8>>2]=b,t=t+1|0}while(32!=(0|t));b=o+8|0,b=0==(7&b|0)?0:0-b&7,y=o+b|0,b=a+-40-b|0,jt[1150]=y,jt[1147]=b,jt[y+4>>2]=1|b,jt[y+b+4>>2]=40,jt[1151]=jt[1266]}}while(0);if((t=0|jt[1147])>>>0>d>>>0)return v=t-d|0,jt[1147]=v,b=0|jt[1150],y=b+d|0,jt[1150]=y,jt[y+4>>2]=1|v,jt[b+4>>2]=3|d,b=b+8|0,or=C,0|b}return b=0|At(),jt[b>>2]=12,b=0,or=C,0|b}function o(e,t,r,i,n,o){e|=0,t=+t,r|=0,i|=0,n|=0,o|=0;var a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,C=0,S=0,T=0,w=0,A=0,E=0,x=0,P=0;P=or,or=or+560|0,l=P+8|0,g=P,x=P+524|0,E=x,u=P+512|0,jt[g>>2]=0,A=u+12|0,Ze(t),(0|cr)<0?(t=-t,T=1,S=2087):(T=0!=(2049&n|0)&1,S=0==(2048&n|0)?0==(1&n|0)?2088:2093:2090),Ze(t),w=2146435072&cr;do{if(w>>>0<2146435072|2146435072==(0|w)&!1){if(p=2*+Tt(t,g),a=0!=p,a&&(jt[g>>2]=(0|jt[g>>2])-1),97==(0|(v=32|o))){f=32&o,h=0==(0|f)?S:S+9|0,d=2|T,a=12-i|0;do{if(!(i>>>0>11|0==(0|a))){t=8;do{a=a+-1|0,t*=16}while(0!=(0|a));if(45==(0|zt[h>>0])){t=-(t+(-p-t));break}t=p+t-t;break}t=p}while(0);s=0|jt[g>>2],a=(0|s)<0?0-s|0:s,a=0|ue(a,((0|a)<0)<<31>>31,A),(0|a)==(0|A)&&(a=u+11|0,zt[a>>0]=48),zt[a+-1>>0]=43+(s>>31&2),c=a+-2|0,zt[c>>0]=o+15,u=(0|i)<1,l=0==(8&n|0),a=x;do{w=~~t,s=a+1|0,zt[a>>0]=Yt[2122+w>>0]|f,t=16*(t-+(0|w)),1!=(s-E|0)||l&u&0==t?a=s:(zt[s>>0]=46,a=a+2|0)}while(0!=t);w=a-E|0,E=A-c|0,A=0!=(0|i)&(w+-2|0)<(0|i)?i+2|0:w,a=E+d+A|0,fe(e,32,r,a,n),it(e,h,d),fe(e,48,r,a,65536^n),it(e,x,w),fe(e,48,A-w|0,0,0),it(e,c,E),fe(e,32,r,a,8192^n);break}s=(0|i)<0?6:i,a?(a=(0|jt[g>>2])-28|0,jt[g>>2]=a,t=268435456*p):(t=p,a=0|jt[g>>2]),w=(0|a)<0?l:l+288|0,l=w;do{b=~~t>>>0,jt[l>>2]=b,l=l+4|0,t=1e9*(t-+(b>>>0))}while(0!=t);if((0|a)>0)for(u=w,d=l;;){if(c=(0|a)<29?a:29,(a=d+-4|0)>>>0>=u>>>0){l=0;do{y=0|He(0|jt[a>>2],0,0|c),y=0|Ke(0|y,0|cr,0|l,0),b=cr,_=0|Oe(0|y,0|b,1e9,0),jt[a>>2]=_,l=0|ct(0|y,0|b,1e9,0),a=a+-4|0}while(a>>>0>=u>>>0);l&&(u=u+-4|0,jt[u>>2]=l)}for(l=d;;){if(l>>>0<=u>>>0)break;if(a=l+-4|0,0|jt[a>>2])break;l=a}if(a=(0|jt[g>>2])-c|0,jt[g>>2]=a,!((0|a)>0))break;d=l}else u=w;if((0|a)<0){i=1+((s+25|0)/9|0)|0,m=102==(0|v);do{if(f=0-a|0,f=(0|f)<9?f:9,u>>>0<l>>>0){c=(1<<f)-1|0,d=1e9>>>f,h=0,a=u;do{b=0|jt[a>>2],jt[a>>2]=(b>>>f)+h,h=0|dr(b&c,d),a=a+4|0}while(a>>>0<l>>>0);a=0==(0|jt[u>>2])?u+4|0:u,h?(jt[l>>2]=h,u=a,a=l+4|0):(u=a,a=l)}else u=0==(0|jt[u>>2])?u+4|0:u,a=l;l=m?w:u,l=(a-l>>2|0)>(0|i)?l+(i<<2)|0:a,a=(0|jt[g>>2])+f|0,jt[g>>2]=a}while((0|a)<0);a=u,i=l}else a=u,i=l;if(b=w,a>>>0<i>>>0){if(l=9*(b-a>>2)|0,(c=0|jt[a>>2])>>>0>=10){u=10;do{u=10*u|0,l=l+1|0}while(c>>>0>=u>>>0)}}else l=0;if(m=103==(0|v),_=0!=(0|s),(0|(u=s-(102!=(0|v)?l:0)+((_&m)<<31>>31)|0))<((9*(i-b>>2)|0)-9|0)){if(u=u+9216|0,f=w+4+(((0|u)/9|0)-1024<<2)|0,(0|(u=1+((0|u)%9|0)|0))<9){c=10;do{c=10*c|0,u=u+1|0}while(9!=(0|u))}else c=10;if(d=0|jt[f>>2],h=(d>>>0)%(c>>>0)|0,(u=(f+4|0)==(0|i))&0==(0|h))u=f;else if(p=0==(1&((d>>>0)/(c>>>0)|0)|0)?9007199254740992:9007199254740994,y=(0|c)/2|0,t=h>>>0<y>>>0?.5:u&(0|h)==(0|y)?1:1.5,T&&(y=45==(0|zt[S>>0]),t=y?-t:t,p=y?-p:p),u=d-h|0,jt[f>>2]=u,p+t!=p){if(y=u+c|0,jt[f>>2]=y,y>>>0>999999999)for(l=f;;){if(u=l+-4|0,jt[l>>2]=0,u>>>0<a>>>0&&(a=a+-4|0,jt[a>>2]=0),y=1+(0|jt[u>>2])|0,jt[u>>2]=y,!(y>>>0>999999999))break;l=u}else u=f;if(l=9*(b-a>>2)|0,(d=0|jt[a>>2])>>>0>=10){c=10;do{c=10*c|0,l=l+1|0}while(d>>>0>=c>>>0)}}else u=f;u=u+4|0,u=i>>>0>u>>>0?u:i,y=a}else u=i,y=a;for(v=u;;){if(v>>>0<=y>>>0){g=0;break}if(a=v+-4|0,0|jt[a>>2]){g=1;break}v=a}i=0-l|0;do{if(m){if(a=(1&(1^_))+s|0,(0|a)>(0|l)&(0|l)>-5?(c=o+-1|0,s=a+-1-l|0):(c=o+-2|0,s=a+-1|0),!(a=8&n)){if(g?0!=(0|(C=0|jt[v+-4>>2])):0)if((C>>>0)%10|0)u=0;else{u=0,a=10;do{a=10*a|0,u=u+1|0}while(!(0|(C>>>0)%(a>>>0)))}else u=9;if(a=(9*(v-b>>2)|0)-9|0,102==(32|c)){f=a-u|0,f=(0|f)>0?f:0,s=(0|s)<(0|f)?s:f,f=0;break}f=a+l-u|0,f=(0|f)>0?f:0,s=(0|s)<(0|f)?s:f,f=0;break}f=a}else c=o,f=8&n}while(0);if(m=s|f,d=0!=(0|m)&1,h=102==(32|c))_=0,a=(0|l)>0?l:0;else{if(a=(0|l)<0?i:l,a=0|ue(a,((0|a)<0)<<31>>31,A),((u=A)-a|0)<2)do{a=a+-1|0,zt[a>>0]=48}while((u-a|0)<2);zt[a+-1>>0]=43+(l>>31&2),a=a+-2|0,zt[a>>0]=c,_=a,a=u-a|0}if(a=T+1+s+d+a|0,fe(e,32,r,a,n),it(e,S,T),fe(e,48,r,a,65536^n),h){c=y>>>0>w>>>0?w:y,f=x+9|0,d=f,h=x+8|0,u=c;do{if(l=0|ue(0|jt[u>>2],0,f),(0|u)==(0|c))(0|l)==(0|f)&&(zt[h>>0]=48,l=h);else if(l>>>0>x>>>0){ee(0|x,48,l-E|0);do{l=l+-1|0}while(l>>>0>x>>>0)}it(e,l,d-l|0),u=u+4|0}while(u>>>0<=w>>>0);if(0|m&&it(e,2138,1),u>>>0<v>>>0&(0|s)>0)for(;;){if((l=0|ue(0|jt[u>>2],0,f))>>>0>x>>>0){ee(0|x,48,l-E|0);do{l=l+-1|0}while(l>>>0>x>>>0)}if(it(e,l,(0|s)<9?s:9),u=u+4|0,l=s+-9|0,!(u>>>0<v>>>0&(0|s)>9)){s=l;break}s=l}fe(e,48,s+9|0,9,0)}else{if(m=g?v:y+4|0,(0|s)>-1){g=x+9|0,f=0==(0|f),i=g,d=0-E|0,h=x+8|0,c=y;do{l=0|ue(0|jt[c>>2],0,g),(0|l)==(0|g)&&(zt[h>>0]=48,l=h);do{if((0|c)==(0|y)){if(u=l+1|0,it(e,l,1),f&(0|s)<1){l=u;break}it(e,2138,1),l=u}else{if(l>>>0<=x>>>0)break;ee(0|x,48,l+d|0);do{l=l+-1|0}while(l>>>0>x>>>0)}}while(0);E=i-l|0,it(e,l,(0|s)>(0|E)?E:s),s=s-E|0,c=c+4|0}while(c>>>0<m>>>0&(0|s)>-1)}fe(e,48,s+18|0,18,0),it(e,_,A-_|0)}fe(e,32,r,a,8192^n)}else x=0!=(32&o|0),a=T+3|0,fe(e,32,r,a,-65537&n),it(e,S,T),it(e,t!=t|!1?x?2114:2118:x?2106:2110,3),fe(e,32,r,a,8192^n)}while(0);return or=P,0|((0|a)<(0|r)?r:a)}function a(e,t,r,i,n){e|=0,t|=0,r|=0,i|=0,n|=0;var a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,C=0,S=0,w=0,A=0,E=0,x=0,P=0,I=0;I=or,or=or+64|0,A=I+16|0,E=I,S=I+24|0,x=I+8|0,P=I+20|0,jt[A>>2]=t,y=0!=(0|e),b=S+40|0,C=b,S=S+39|0,w=x+4|0,s=0,a=0,d=0;e:for(;;){do{if((0|a)>-1){if((0|s)>(2147483647-a|0)){a=0|At(),jt[a>>2]=75,a=-1;break}a=s+a|0;break}}while(0);if(!((s=0|zt[t>>0])<<24>>24)){v=87;break}l=t;t:for(;;){switch(s<<24>>24){case 37:s=l,v=9;break t;case 0:s=l;break t}_=l+1|0,jt[A>>2]=_,s=0|zt[_>>0],l=_}t:do{if(9==(0|v))for(;;){if(v=0,37!=(0|zt[l+1>>0]))break t;if(s=s+1|0,l=l+2|0,jt[A>>2]=l,37!=(0|zt[l>>0]))break;v=9}}while(0);if(s=s-t|0,y&&it(e,t,s),0|s)t=l;else{u=l+1|0,s=(0|zt[u>>0])-48|0,s>>>0<10?(_=36==(0|zt[l+2>>0]),g=_?s:-1,d=_?1:d,u=_?l+3|0:u):g=-1,jt[A>>2]=u,s=0|zt[u>>0],l=(s<<24>>24)-32|0;t:do{if(l>>>0<32)for(c=0,h=s;;){if(!(75913&(s=1<<l))){s=h;break t}if(c|=s,u=u+1|0,jt[A>>2]=u,s=0|zt[u>>0],(l=(s<<24>>24)-32|0)>>>0>=32)break;h=s}else c=0}while(0);if(s<<24>>24==42){if(l=u+1|0,s=(0|zt[l>>0])-48|0,s>>>0<10?36==(0|zt[u+2>>0]):0)jt[n+(s<<2)>>2]=10,s=0|jt[i+((0|zt[l>>0])-48<<3)>>2],d=1,u=u+3|0;else{if(0|d){a=-1;break}y?(d=3+(0|jt[r>>2])&-4,s=0|jt[d>>2],jt[r>>2]=d+4,d=0,u=l):(s=0,d=0,u=l)}jt[A>>2]=u,_=(0|s)<0,s=_?0-s|0:s,c=_?8192|c:c}else{if((0|(s=0|we(A)))<0){a=-1;break}u=0|jt[A>>2]}do{if(46==(0|zt[u>>0])){if(42!=(0|zt[u+1>>0])){jt[A>>2]=u+1,l=0|we(A),u=0|jt[A>>2];break}if(h=u+2|0,l=(0|zt[h>>0])-48|0,l>>>0<10?36==(0|zt[u+3>>0]):0){jt[n+(l<<2)>>2]=10,l=0|jt[i+((0|zt[h>>0])-48<<3)>>2],u=u+4|0,jt[A>>2]=u;break}if(0|d){a=-1;break e}y?(_=3+(0|jt[r>>2])&-4,l=0|jt[_>>2],jt[r>>2]=_+4):l=0,jt[A>>2]=h,u=h}else l=-1}while(0);for(m=0;;){if(((0|zt[u>>0])-65|0)>>>0>57){a=-1;break e}if(_=u+1|0,jt[A>>2]=_,h=0|zt[(0|zt[u>>0])-65+(1606+(58*m|0))>>0],!(((p=255&h)+-1|0)>>>0<8))break;m=p,u=_}if(!(h<<24>>24)){a=-1;break}f=(0|g)>-1;do{if(h<<24>>24==19){if(f){a=-1;break e}v=49}else{if(f){jt[n+(g<<2)>>2]=p,f=i+(g<<3)|0,g=0|jt[f+4>>2],v=E,jt[v>>2]=jt[f>>2],jt[v+4>>2]=g,v=49;break}if(!y){a=0;break e}T(E,p,r)}}while(0);if(49!=(0|v)||(v=0,y)){u=0|zt[u>>0],u=0!=(0|m)&3==(15&u|0)?-33&u:u,f=-65537&c,g=0==(8192&c|0)?c:f;t:do{switch(0|u){case 110:switch((255&m)<<24>>24){case 0:case 1:jt[jt[E>>2]>>2]=a,s=0,t=_;continue e;case 2:s=0|jt[E>>2],jt[s>>2]=a,jt[s+4>>2]=((0|a)<0)<<31>>31,s=0,t=_;continue e;case 3:Ht[jt[E>>2]>>1]=a,s=0,t=_;continue e;case 4:zt[jt[E>>2]>>0]=a,s=0,t=_;continue e;case 6:jt[jt[E>>2]>>2]=a,s=0,t=_;continue e;case 7:s=0|jt[E>>2],jt[s>>2]=a,jt[s+4>>2]=((0|a)<0)<<31>>31,s=0,t=_;continue e;default:s=0,t=_;continue e}case 112:u=120,l=l>>>0>8?l:8,t=8|g,v=61;break;case 88:case 120:t=g,v=61;break;case 111:u=E,t=0|jt[u>>2],u=0|jt[u+4>>2],p=0|Ie(t,u,b),f=C-p|0,c=0,h=2070,l=0==(8&g|0)|(0|l)>(0|f)?l:f+1|0,f=g,v=67;break;case 105:case 100:if(u=E,t=0|jt[u>>2],(0|(u=0|jt[u+4>>2]))<0){t=0|Ye(0,0,0|t,0|u),u=cr,c=E,jt[c>>2]=t,jt[c+4>>2]=u,c=1,h=2070,v=66;break t}c=0!=(2049&g|0)&1,h=0==(2048&g|0)?0==(1&g|0)?2070:2072:2071,v=66;break t;case 117:u=E,c=0,h=2070,t=0|jt[u>>2],u=0|jt[u+4>>2],v=66;break;case 99:zt[S>>0]=jt[E>>2],t=S,c=0,h=2070,p=b,u=1,l=f;break;case 109:u=0|At(),u=0|at(0|jt[u>>2]),v=71;break;case 115:u=0|jt[E>>2],u=0|u?u:2080,v=71;break;case 67:jt[x>>2]=jt[E>>2],jt[w>>2]=0,jt[E>>2]=x,p=-1,u=x,v=75;break;case 83:t=0|jt[E>>2],l?(p=l,u=t,v=75):(fe(e,32,s,0,g),t=0,v=84);break;case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:s=0|o(e,+tr[E>>3],s,l,g,u),t=_;continue e;default:c=0,h=2070,p=b,u=l,l=g}}while(0);t:do{if(61==(0|v))g=E,m=0|jt[g>>2],g=0|jt[g+4>>2],p=0|Ae(m,g,b,32&u),h=0==(8&t|0)|0==(0|m)&0==(0|g),c=h?0:2,h=h?2070:2070+(u>>4)|0,f=t,t=m,u=g,v=67;else if(66==(0|v))p=0|ue(t,u,b),f=g,v=67;else if(71==(0|v))v=0,g=0|z(u,0,l),m=0==(0|g),t=u,c=0,h=2070,p=m?u+l|0:g,u=m?l:g-u|0,l=f;else if(75==(0|v)){for(v=0,h=u,t=0,l=0;;){if(!(c=0|jt[h>>2]))break;if((0|(l=0|st(P,c)))<0|l>>>0>(p-t|0)>>>0)break;if(t=l+t|0,!(p>>>0>t>>>0))break;h=h+4|0}if((0|l)<0){a=-1;break e}if(fe(e,32,s,t,g),t)for(c=0;;){if(!(l=0|jt[u>>2])){v=84;break t}if(l=0|st(P,l),(0|(c=l+c|0))>(0|t)){v=84;break t}if(it(e,P,l),c>>>0>=t>>>0){v=84;break}u=u+4|0}else t=0,v=84}}while(0);if(67==(0|v))v=0,u=0!=(0|t)|0!=(0|u),g=0!=(0|l)|u,u=C-p+(1&(1^u))|0,t=g?p:b,p=b,u=g?(0|l)>(0|u)?l:u:l,l=(0|l)>-1?-65537&f:f;else if(84==(0|v)){v=0,fe(e,32,s,t,8192^g),s=(0|s)>(0|t)?s:t,t=_;continue}m=p-t|0,f=(0|u)<(0|m)?m:u,g=f+c|0,s=(0|s)<(0|g)?g:s,fe(e,32,s,g,l),it(e,h,c),fe(e,48,s,g,65536^l),fe(e,48,f,m,0),it(e,t,m),fe(e,32,s,g,8192^l),t=_}else s=0,t=_}}e:do{if(87==(0|v)&&!e)if(d){for(a=1;;){if(!(t=0|jt[n+(a<<2)>>2]))break;if(T(i+(a<<3)|0,t,r),(0|(a=a+1|0))>=10){a=1;break e}}for(;;){if(0|jt[n+(a<<2)>>2]){a=-1;break e}if((0|(a=a+1|0))>=10){a=1;break}}}else a=0}while(0);return or=I,0|a}function s(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,S=0,T=0,w=0,E=0,x=0,P=0;if(P=or,or=or+704|0,T=P+144|0,S=P+128|0,b=P+112|0,y=P+96|0,v=P+80|0,_=P+64|0,g=P+48|0,w=P+32|0,c=P+16|0,s=P,h=P+184|0,x=P+160|0,!(p=0|W(e,14)))return Z(t),x=1,or=P,0|x;if(f=t+4|0,m=t+8|0,(0|(r=0|jt[m>>2]))!=(0|p)){if(r>>>0<=p>>>0){do{if((0|jt[t+12>>2])>>>0<p>>>0){if(0|A(f,p,(r+1|0)==(0|p),1,0)){r=0|jt[m>>2];break}return zt[t+16>>0]=1,x=0,or=P,0|x}}while(0);ee((0|jt[f>>2])+r|0,0,p-r|0)}jt[m>>2]=p}if(ee(0|jt[f>>2],0,0|p),d=e+20|0,(0|(r=0|jt[d>>2]))<5){o=e+4|0,a=e+8|0,n=e+16|0;do{i=0|jt[o>>2],(0|i)==(0|jt[a>>2])?i=0:(jt[o>>2]=i+1,i=0|Yt[i>>0]),r=r+8|0,jt[d>>2]=r,(0|r)>=33&&(jt[s>>2]=866,jt[s+4>>2]=3208,jt[s+8>>2]=1366,Ve(h,812,s),he(h),r=0|jt[d>>2]),i=i<<32-r|jt[n>>2],jt[n>>2]=i}while((0|r)<5)}else i=e+16|0,n=i,i=0|jt[i>>2];if(u=i>>>27,jt[n>>2]=i<<5,jt[d>>2]=r+-5,(u+-1|0)>>>0>20)return x=0,or=P,0|x;jt[x+20>>2]=0,jt[x>>2]=0,jt[x+4>>2]=0,jt[x+8>>2]=0,jt[x+12>>2]=0,zt[x+16>>0]=0,r=x+4|0,i=x+8|0;e:do{if(0|A(r,21,0,1,0)){o=0|jt[i>>2],l=0|jt[r>>2],ee(l+o|0,0,21-o|0),jt[i>>2]=21,o=e+4|0,a=e+8|0,s=e+16|0,n=0;do{if((0|(r=0|jt[d>>2]))<3)do{i=0|jt[o>>2],(0|i)==(0|jt[a>>2])?i=0:(jt[o>>2]=i+1,i=0|Yt[i>>0]),r=r+8|0,jt[d>>2]=r,(0|r)>=33&&(jt[c>>2]=866,jt[c+4>>2]=3208,jt[c+8>>2]=1366,Ve(h,812,c),he(h),r=0|jt[d>>2]),i=i<<32-r|jt[s>>2],jt[s>>2]=i}while((0|r)<3);else i=0|jt[s>>2];jt[s>>2]=i<<3,jt[d>>2]=r+-3,zt[l+(0|Yt[1327+n>>0])>>0]=i>>>29,n=n+1|0}while((0|n)!=(0|u));if(0|k(x)){s=e+4|0,l=e+8|0,u=e+16|0,r=0;t:do{a=p-r|0,n=0|C(e,x);r:do{if(n>>>0<17)(0|jt[m>>2])>>>0<=r>>>0&&(jt[w>>2]=866,jt[w+4>>2]=910,jt[w+8>>2]=1497,Ve(h,812,w),he(h)),zt[(0|jt[f>>2])+r>>0]=n,r=r+1|0;else switch(0|n){case 17:if((0|(i=0|jt[d>>2]))<3)do{n=0|jt[s>>2],(0|n)==(0|jt[l>>2])?n=0:(jt[s>>2]=n+1,n=0|Yt[n>>0]),i=i+8|0,jt[d>>2]=i,(0|i)>=33&&(jt[g>>2]=866,jt[g+4>>2]=3208,jt[g+8>>2]=1366,Ve(h,812,g),he(h),i=0|jt[d>>2]),n=n<<32-i|jt[u>>2],jt[u>>2]=n}while((0|i)<3);else n=0|jt[u>>2];if(jt[u>>2]=n<<3,jt[d>>2]=i+-3,n=3+(n>>>29)|0,i=n>>>0>a>>>0){r=0;break e}r=(i?0:n)+r|0;break r;case 18:if((0|(i=0|jt[d>>2]))<7)do{n=0|jt[s>>2],(0|n)==(0|jt[l>>2])?n=0:(jt[s>>2]=n+1,n=0|Yt[n>>0]),i=i+8|0,jt[d>>2]=i,(0|i)>=33&&(jt[_>>2]=866,jt[_+4>>2]=3208,jt[_+8>>2]=1366,Ve(h,812,_),he(h),i=0|jt[d>>2]),n=n<<32-i|jt[u>>2],jt[u>>2]=n}while((0|i)<7);else n=0|jt[u>>2];if(jt[u>>2]=n<<7,jt[d>>2]=i+-7,n=11+(n>>>25)|0,i=n>>>0>a>>>0){r=0;break e}r=(i?0:n)+r|0;break r;default:if((n+-19|0)>>>0>=2){E=81;break t}if(i=0|jt[d>>2],19==(0|n)){if((0|i)<2)for(n=i;;){if(i=0|jt[s>>2],(0|i)==(0|jt[l>>2])?o=0:(jt[s>>2]=i+1,o=0|Yt[i>>0]),i=n+8|0,jt[d>>2]=i,(0|i)>=33&&(jt[v>>2]=866,jt[v+4>>2]=3208,jt[v+8>>2]=1366,Ve(h,812,v),he(h),i=0|jt[d>>2]),n=o<<32-i|jt[u>>2],jt[u>>2]=n,!((0|i)<2))break;n=i}else n=0|jt[u>>2];jt[u>>2]=n<<2,n>>>=30,o=3,i=i+-2|0}else{if((0|i)<6)do{n=0|jt[s>>2],(0|n)==(0|jt[l>>2])?n=0:(jt[s>>2]=n+1,n=0|Yt[n>>0]),i=i+8|0,jt[d>>2]=i,(0|i)>=33&&(jt[y>>2]=866,jt[y+4>>2]=3208,jt[y+8>>2]=1366,Ve(h,812,y),he(h),i=0|jt[d>>2]),n=n<<32-i|jt[u>>2],jt[u>>2]=n}while((0|i)<6);else n=0|jt[u>>2];jt[u>>2]=n<<6,n>>>=26,o=7,i=i+-6|0}if(jt[d>>2]=i,n=n+o|0,0==(0|r)|n>>>0>a>>>0){r=0;break e}if(i=r+-1|0,(0|jt[m>>2])>>>0<=i>>>0&&(jt[b>>2]=866,jt[b+4>>2]=910,jt[b+8>>2]=1497,Ve(h,812,b),he(h)),!((o=0|zt[(0|jt[f>>2])+i>>0])<<24>>24)){r=0;break e}if(i=n+r|0,r>>>0>=i>>>0)break r;do{(0|jt[m>>2])>>>0<=r>>>0&&(jt[S>>2]=866,jt[S+4>>2]=910,jt[S+8>>2]=1497,Ve(h,812,S),he(h)),zt[(0|jt[f>>2])+r>>0]=o,r=r+1|0}while((0|r)!=(0|i));r=i}}while(0)}while(p>>>0>r>>>0);if(81==(0|E)){jt[T>>2]=866,jt[T+4>>2]=3149,jt[T+8>>2]=1348,Ve(h,812,T),he(h),r=0;break}r=(0|p)==(0|r)?0|k(t):0}else r=0}else zt[x+16>>0]=1,r=0}while(0);return X(x),x=r,or=P,0|x}function l(e,t,r,i){e|=0,t|=0,r|=0,i|=0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,C=0,S=0,T=0,w=0,A=0,E=0,x=0,P=0,I=0,D=0,O=0;if(O=or,or=or+880|0,I=O+144|0,P=O+128|0,x=O+112|0,E=O+96|0,S=O+80|0,_=O+64|0,m=O+48|0,g=O+32|0,d=O+16|0,c=O,w=O+360|0,A=O+296|0,D=O+224|0,f=O+156|0,0==(0|t)|i>>>0>11)return D=0,or=O,0|D;jt[e>>2]=t,n=D,o=n+68|0;do{jt[n>>2]=0,n=n+4|0}while((0|n)<(0|o));n=0;do{T=0|zt[r+n>>0],o=D+((255&T)<<2)|0,T<<24>>24&&(jt[o>>2]=1+(0|jt[o>>2])),n=n+1|0}while((0|n)!=(0|t));for(o=0,a=0,s=0,l=-1,u=1;;){if(n=0|jt[D+(u<<2)>>2],n?(h=u+-1|0,jt[A+(h<<2)>>2]=o,o=n+o|0,T=16-u|0,jt[e+28+(h<<2)>>2]=1+(o+-1<<T|(1<<T)-1),jt[e+96+(h<<2)>>2]=a,jt[f+(u<<2)>>2]=a,h=n+a|0,s=s>>>0>u>>>0?s:u,l=l>>>0<u>>>0?l:u):(jt[e+28+(u+-1<<2)>>2]=0,h=a),17==(0|(u=u+1|0)))break;o<<=1,a=h}jt[e+4>>2]=h,o=e+172|0;do{if(h>>>0>(0|jt[o>>2])>>>0){n=h+-1|0,n&h?(n|=n>>>16,n|=n>>>8,n|=n>>>4,n|=n>>>2,n=1+(n>>>1|n)|0,n=n>>>0>t>>>0?t:n):n=h,jt[o>>2]=n,a=e+176|0,n=0|jt[a>>2];do{if(0|n){if(T=0|jt[n+-4>>2],n=n+-8|0,(0!=(0|T)?(0|T)==(0|~jt[n>>2]):0)||(jt[c>>2]=866,jt[c+4>>2]=651,jt[c+8>>2]=1579,Ve(w,812,c),he(w)),7&n){jt[d>>2]=866,jt[d+4>>2]=2506,jt[d+8>>2]=1232,Ve(w,812,d),he(w);break}oe(n,0,0,1,0);break}}while(0);if(n=0|jt[o>>2],n=0|n?n:1,o=0|Q(8+(n<<1)|0,0)){jt[o+4>>2]=n,jt[o>>2]=~n,jt[a>>2]=o+8,p=24;break}jt[a>>2]=0,i=0;break}p=24}while(0);e:do{if(24==(0|p)){T=e+24|0,zt[T>>0]=l,zt[e+25>>0]=s,a=e+176|0,o=0;do{C=0|zt[r+o>>0],n=255&C,C<<24>>24&&(0|jt[D+(n<<2)>>2]||(jt[g>>2]=866,jt[g+4>>2]=2276,jt[g+8>>2]=977,Ve(w,812,g),he(w)),C=f+(n<<2)|0,n=0|jt[C>>2],jt[C>>2]=n+1,n>>>0>=h>>>0&&(jt[m>>2]=866,jt[m+4>>2]=2280,jt[m+8>>2]=990,Ve(w,812,m),he(w)),Ht[(0|jt[a>>2])+(n<<1)>>1]=o),o=o+1|0}while((0|o)!=(0|t));if(b=(0|Yt[T>>0])>>>0<i>>>0?i:0,C=e+8|0,jt[C>>2]=b,y=0!=(0|b)){v=1<<b,n=e+164|0;do{if(v>>>0>(0|jt[n>>2])>>>0){jt[n>>2]=v,a=e+168|0,n=0|jt[a>>2];do{if(0|n){if(g=0|jt[n+-4>>2],n=n+-8|0,(0!=(0|g)?(0|g)==(0|~jt[n>>2]):0)||(jt[_>>2]=866,jt[_+4>>2]=651,jt[_+8>>2]=1579,Ve(w,812,_),he(w)),7&n){jt[S>>2]=866,jt[S+4>>2]=2506,jt[S+8>>2]=1232,Ve(w,812,S),he(w);break}oe(n,0,0,1,0);break}}while(0);if(n=v<<2,o=0|Q(n+8|0,0)){S=o+8|0,jt[o+4>>2]=v,jt[o>>2]=~v,jt[a>>2]=S,o=S;break}jt[a>>2]=0,i=0;break e}o=e+168|0,n=v<<2,a=o,o=0|jt[o>>2]}while(0);ee(0|o,-1,0|n),m=e+176|0,f=1;do{if(0|jt[D+(f<<2)>>2]&&(g=b-f|0,_=1<<g,n=f+-1|0,o=0|jt[A+(n<<2)>>2],n>>>0>=16&&(jt[E>>2]=866,jt[E+4>>2]=1960,jt[E+8>>2]=1453,Ve(w,812,E),he(w)),t=0|jt[e+28+(n<<2)>>2],t=0==(0|t)?-1:(t+-1|0)>>>(16-f|0),o>>>0<=t>>>0)){h=(0|jt[e+96+(n<<2)>>2])-o|0,p=f<<16;do{n=0|Qt[(0|jt[m>>2])+(h+o<<1)>>1],(0|Yt[r+n>>0])!=(0|f)&&(jt[x>>2]=866,jt[x+4>>2]=2322,jt[x+8>>2]=1019,Ve(w,812,x),he(w)),d=o<<g,u=n|p,l=0;do{c=l+d|0,c>>>0>=v>>>0&&(jt[P>>2]=866,jt[P+4>>2]=2328,jt[P+8>>2]=1053,Ve(w,812,P),he(w)),n=0|jt[a>>2],-1!=(0|jt[n+(c<<2)>>2])&&(jt[I>>2]=866,jt[I+4>>2]=2330,jt[I+8>>2]=1076,Ve(w,812,I),he(w),n=0|jt[a>>2]),jt[n+(c<<2)>>2]=u,l=l+1|0}while(l>>>0<_>>>0);o=o+1|0}while(o>>>0<=t>>>0)}f=f+1|0}while(b>>>0>=f>>>0)}n=e+96|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A>>2]),n=e+100|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+4>>2]),n=e+104|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+8>>2]),n=e+108|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+12>>2]),n=e+112|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+16>>2]),n=e+116|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+20>>2]),n=e+120|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+24>>2]),n=e+124|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+28>>2]),n=e+128|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+32>>2]),n=e+132|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+36>>2]),n=e+136|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+40>>2]),n=e+140|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+44>>2]),n=e+144|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+48>>2]),n=e+148|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+52>>2]),n=e+152|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+56>>2]),n=e+156|0,jt[n>>2]=(0|jt[n>>2])-(0|jt[A+60>>2]),n=e+16|0,jt[n>>2]=0,o=e+20|0,jt[o>>2]=Yt[T>>0];t:do{if(y){do{if(!i)break t;I=i,i=i+-1|0}while(!(0|jt[D+(I<<2)>>2]));if(jt[n>>2]=jt[e+28+(i<<2)>>2],i=b+1|0,jt[o>>2]=i,i>>>0<=s>>>0){for(;;){if(0|jt[D+(i<<2)>>2])break;if((i=i+1|0)>>>0>s>>>0)break t}jt[o>>2]=i}}}while(0);jt[e+92>>2]=-1,jt[e+160>>2]=1048575,jt[e+12>>2]=32-(0|jt[C>>2]),i=1}}while(0);return D=i,or=O,0|D}function u(e,t,r,i,n,o,a,s){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0,a|=0,s|=0;var l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,S=0,T=0,w=0,A=0,E=0,x=0,P=0,I=0,D=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0;if(re=or,or=or+656|0,ee=re+112|0,J=re+96|0,K=re+80|0,Z=re+64|0,Q=re+48|0,te=re+32|0,$=re+16|0,X=re,q=re+144|0,Y=re+128|0,k=e+240|0,F=0|jt[k>>2],B=e+256|0,U=0|jt[B>>2],j=0|zt[17+(0|jt[e+88>>2])>>0],V=255&j,z=i>>>2,!(j<<24>>24))return or=re,1;G=0==(0|s),H=a+-1|0,W=H<<4,j=s+-1|0,D=0!=(1&o|0),O=i<<1,M=e+92|0,R=e+116|0,L=e+140|0,N=e+236|0,I=0!=(1&n|0),P=e+188|0,w=e+252|0,A=z+1|0,E=z+2|0,x=z+3|0,T=0,o=0,r=0,n=1;do{if(!G)for(b=0|jt[t+(T<<2)>>2],S=0;;){if(v=1&S,u=0==(0|v),_=(v<<5^32)-16|0,v=(v<<1^2)-1|0,g=u?a:-1,l=u?0:H,e=(0|S)==(0|j),y=D&e,(0|l)!=(0|g))for(m=D&e^1,f=u?b:b+W|0;;){1==(0|n)&&(n=512|C(M,R)),p=7&n,n>>>=3,u=0|Yt[1539+p>>0],e=0;do{c=(0|C(M,L))+r|0,d=c-F|0,h=d>>31,r=h&c|d&~h,(0|jt[k>>2])>>>0<=r>>>0&&(jt[X>>2]=866,jt[X+4>>2]=910,jt[X+8>>2]=1497,Ve(q,812,X),he(q)),jt[Y+(e<<2)>>2]=jt[(0|jt[N>>2])+(r<<2)>>2],e=e+1|0}while(e>>>0<u>>>0);if(h=I&(0|l)==(0|H),y|h){d=0;do{e=f+(0|dr(d,i))|0,c=0==(0|d)|m,u=d<<1,ne=(0|C(M,P))+o|0,ie=ne-U|0,o=ie>>31,o=o&ne|ie&~o;do{if(h){if(!c){ie=(0|C(M,P))+o|0,ne=ie-U|0,o=ne>>31,o=o&ie|ne&~o;break}jt[e>>2]=jt[Y+((0|Yt[1547+(p<<2)+u>>0])<<2)>>2],(0|jt[B>>2])>>>0<=o>>>0&&(jt[J>>2]=866,jt[J+4>>2]=910,jt[J+8>>2]=1497,Ve(q,812,J),he(q)),jt[e+4>>2]=jt[(0|jt[w>>2])+(o<<2)>>2],ie=(0|C(M,P))+o|0,ne=ie-U|0,o=ne>>31,o=o&ie|ne&~o}else c&&(jt[e>>2]=jt[Y+((0|Yt[1547+(p<<2)+u>>0])<<2)>>2],(0|jt[B>>2])>>>0<=o>>>0&&(jt[K>>2]=866,jt[K+4>>2]=910,jt[K+8>>2]=1497,Ve(q,812,K),he(q)),jt[e+4>>2]=jt[(0|jt[w>>2])+(o<<2)>>2]),e=e+8|0,ie=(0|C(M,P))+o|0,ne=ie-U|0,o=ne>>31,o=o&ie|ne&~o,c&&(jt[e>>2]=jt[Y+((0|Yt[1547+(p<<2)+(1|u)>>0])<<2)>>2],(0|jt[B>>2])>>>0<=o>>>0&&(jt[ee>>2]=866,jt[ee+4>>2]=910,jt[ee+8>>2]=1497,Ve(q,812,ee),he(q)),jt[e+4>>2]=jt[(0|jt[w>>2])+(o<<2)>>2])}while(0);d=d+1|0}while(2!=(0|d))}else jt[f>>2]=jt[Y+((0|Yt[1547+(p<<2)>>0])<<2)>>2],ie=(0|C(M,P))+o|0,ne=ie-U|0,o=ne>>31,o=o&ie|ne&~o,(0|jt[B>>2])>>>0<=o>>>0&&(jt[$>>2]=866,jt[$+4>>2]=910,jt[$+8>>2]=1497,Ve(q,812,$),he(q)),jt[f+4>>2]=jt[(0|jt[w>>2])+(o<<2)>>2],jt[f+8>>2]=jt[Y+((0|Yt[1547+(p<<2)+1>>0])<<2)>>2],ie=(0|C(M,P))+o|0,ne=ie-U|0,o=ne>>31,o=o&ie|ne&~o,(0|jt[B>>2])>>>0<=o>>>0&&(jt[te>>2]=866,jt[te+4>>2]=910,jt[te+8>>2]=1497,Ve(q,812,te),he(q)),jt[f+12>>2]=jt[(0|jt[w>>2])+(o<<2)>>2],jt[f+(z<<2)>>2]=jt[Y+((0|Yt[1547+(p<<2)+2>>0])<<2)>>2],ie=(0|C(M,P))+o|0,ne=ie-U|0,o=ne>>31,o=o&ie|ne&~o,(0|jt[B>>2])>>>0<=o>>>0&&(jt[Q>>2]=866,jt[Q+4>>2]=910,jt[Q+8>>2]=1497,Ve(q,812,Q),he(q)),jt[f+(A<<2)>>2]=jt[(0|jt[w>>2])+(o<<2)>>2],jt[f+(E<<2)>>2]=jt[Y+((0|Yt[1547+(p<<2)+3>>0])<<2)>>2],ie=(0|C(M,P))+o|0,ne=ie-U|0,o=ne>>31,o=o&ie|ne&~o,(0|jt[B>>2])>>>0<=o>>>0&&(jt[Z>>2]=866,jt[Z+4>>2]=910,jt[Z+8>>2]=1497,Ve(q,812,Z),he(q)),jt[f+(x<<2)>>2]=jt[(0|jt[w>>2])+(o<<2)>>2];if((0|(l=v+l|0))==(0|g))break;f=f+_|0}if((0|(S=S+1|0))==(0|s))break;b=b+O|0}T=T+1|0}while((0|T)!=(0|V));return or=re,1}function c(e,t,r,i,n,o,a,s){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0,a|=0,s|=0;var l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,S=0,T=0,w=0,A=0,E=0,x=0,P=0,I=0,D=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;if(ae=or,or=or+640|0,ie=ae+80|0,re=ae+64|0,te=ae+48|0,oe=ae+32|0,ne=ae+16|0,ee=ae,J=ae+128|0,$=ae+112|0,F=ae+96|0,B=e+272|0,U=0|jt[B>>2],K=0|jt[e+88>>2],V=(0|Yt[K+63>>0])<<8|0|Yt[K+64>>0],K=0|zt[K+17>>0],z=255&K,!(K<<24>>24))return or=ae,1;G=0==(0|s),H=a+-1|0,W=H<<5,j=s+-1|0,q=i<<1,Y=e+92|0,X=e+116|0,Q=e+164|0,Z=e+268|0,K=e+212|0,k=0==(1&n|0),N=0==(1&o|0),L=e+288|0,R=e+284|0,M=0,e=0,o=0,n=0,r=0,l=1;do{if(!G)for(D=0|jt[t+(M<<2)>>2],O=0;;){if(I=1&O,c=0==(0|I),P=(I<<6^64)-32|0,I=(I<<1^2)-1|0,E=c?a:-1,(0|(u=c?0:H))!=(0|E))for(x=N|(0|O)!=(0|j),A=c?D:D+W|0;;){1==(0|l)&&(l=512|C(Y,X)),w=7&l,l>>>=3,d=0|Yt[1539+w>>0],c=0;do{b=(0|C(Y,Q))+r|0,S=b-U|0,T=S>>31,r=T&b|S&~T,(0|jt[B>>2])>>>0<=r>>>0&&(jt[ee>>2]=866,jt[ee+4>>2]=910,jt[ee+8>>2]=1497,Ve(J,812,ee),he(J)),jt[$+(c<<2)>>2]=Qt[(0|jt[Z>>2])+(r<<1)>>1],c=c+1|0}while(c>>>0<d>>>0);c=0;do{b=(0|C(Y,Q))+o|0,S=b-U|0,T=S>>31,o=T&b|S&~T,(0|jt[B>>2])>>>0<=o>>>0&&(jt[ne>>2]=866,jt[ne+4>>2]=910,jt[ne+8>>2]=1497,Ve(J,812,ne),he(J)),jt[F+(c<<2)>>2]=Qt[(0|jt[Z>>2])+(o<<1)>>1],c=c+1|0}while(c>>>0<d>>>0);for(T=k|(0|u)!=(0|H),b=0,S=A;;){if(_=x|0==(0|b),v=b<<1,T)for(m=0,g=S;;){if(y=(0|C(Y,K))+n|0,f=y-V|0,n=f>>31,n=n&y|f&~n,f=(0|C(Y,K))+e|0,y=f-V|0,e=y>>31,e=e&f|y&~e,_&&(f=0|Yt[m+v+(1547+(w<<2))>>0],d=3*n|0,c=0|jt[L>>2],c>>>0<=d>>>0&&(jt[oe>>2]=866,jt[oe+4>>2]=910,jt[oe+8>>2]=1497,Ve(J,812,oe),he(J),c=0|jt[L>>2]),h=0|jt[R>>2],d=h+(d<<1)|0,p=3*e|0,c>>>0>p>>>0?c=h:(jt[te>>2]=866,jt[te+4>>2]=910,jt[te+8>>2]=1497,Ve(J,812,te),he(J),c=0|jt[R>>2]),y=c+(p<<1)|0,jt[g>>2]=(0|Qt[d>>1])<<16|jt[$+(f<<2)>>2],jt[g+4>>2]=(0|Qt[d+4>>1])<<16|0|Qt[d+2>>1],jt[g+8>>2]=(0|Qt[y>>1])<<16|jt[F+(f<<2)>>2],jt[g+12>>2]=(0|Qt[y+4>>1])<<16|0|Qt[y+2>>1]),2==(0|(m=m+1|0)))break;g=g+16|0}else for(y=1^_,_=1547+(w<<2)+v|0,m=0,g=S;;){if(v=(0|C(Y,K))+n|0,f=v-V|0,n=f>>31,n=n&v|f&~n,f=(0|C(Y,K))+e|0,v=f-V|0,e=v>>31,e=e&f|v&~e,0!=(0|m)|y||(f=0|Yt[_>>0],d=3*n|0,c=0|jt[L>>2],c>>>0<=d>>>0&&(jt[re>>2]=866,jt[re+4>>2]=910,jt[re+8>>2]=1497,Ve(J,812,re),he(J),c=0|jt[L>>2]),h=0|jt[R>>2],d=h+(d<<1)|0,p=3*e|0,c>>>0>p>>>0?c=h:(jt[ie>>2]=866,jt[ie+4>>2]=910,jt[ie+8>>2]=1497,Ve(J,812,ie),he(J),c=0|jt[R>>2]),v=c+(p<<1)|0,jt[g>>2]=(0|Qt[d>>1])<<16|jt[$+(f<<2)>>2],jt[g+4>>2]=(0|Qt[d+4>>1])<<16|0|Qt[d+2>>1],jt[g+8>>2]=(0|Qt[v>>1])<<16|jt[F+(f<<2)>>2],jt[g+12>>2]=(0|Qt[v+4>>1])<<16|0|Qt[v+2>>1]),2==(0|(m=m+1|0)))break;g=g+16|0}if(2==(0|(b=b+1|0)))break;S=S+i|0}if((0|(u=I+u|0))==(0|E))break;A=A+P|0}if((0|(O=O+1|0))==(0|s))break;D=D+q|0}M=M+1|0}while((0|M)!=(0|z));return or=ae,1}function d(e){e|=0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0;if(e){r=e+-8|0,n=0|jt[1148],e=0|jt[e+-4>>2],t=-8&e,l=r+t|0;do{if(1&e)s=r,a=r;else{if(i=0|jt[r>>2],!(3&e))return;if(a=r+(0-i)|0,o=i+t|0,a>>>0<n>>>0)return;if((0|a)==(0|jt[1149])){if(e=l+4|0,3!=(3&(t=0|jt[e>>2])|0)){s=a,t=o;break}return jt[1146]=o,jt[e>>2]=-2&t,jt[a+4>>2]=1|o,void(jt[a+o>>2]=o)}if(r=i>>>3,i>>>0<256){if(e=0|jt[a+8>>2],(0|(t=0|jt[a+12>>2]))==(0|e)){jt[1144]=jt[1144]&~(1<<r),s=a,t=o;break}jt[e+12>>2]=t,jt[t+8>>2]=e,s=a,t=o;break}n=0|jt[a+24>>2],e=0|jt[a+12>>2];do{if((0|e)==(0|a)){if(r=a+16|0,t=r+4|0,!(e=0|jt[t>>2])){if(!(e=0|jt[r>>2])){e=0;break}t=r}for(;;)if(r=e+20|0,0|(i=0|jt[r>>2]))e=i,t=r;else{if(r=e+16|0,!(i=0|jt[r>>2]))break;e=i,t=r}jt[t>>2]=0}else s=0|jt[a+8>>2],jt[s+12>>2]=e,jt[e+8>>2]=s}while(0);if(n){if(t=0|jt[a+28>>2],r=4880+(t<<2)|0,(0|a)==(0|jt[r>>2])){if(jt[r>>2]=e,!e){jt[1145]=jt[1145]&~(1<<t),s=a,t=o;break}}else if(jt[n+16+(((0|jt[n+16>>2])!=(0|a)&1)<<2)>>2]=e,!e){s=a,t=o;break}jt[e+24>>2]=n,t=a+16|0,r=0|jt[t>>2],0|r&&(jt[e+16>>2]=r,jt[r+24>>2]=e),t=0|jt[t+4>>2],t?(jt[e+20>>2]=t,jt[t+24>>2]=e,s=a,t=o):(s=a,t=o)}else s=a,t=o}}while(0);if(!(a>>>0>=l>>>0)&&(e=l+4|0,1&(i=0|jt[e>>2]))){if(2&i)jt[e>>2]=-2&i,jt[s+4>>2]=1|t,jt[a+t>>2]=t,n=t;else{if(e=0|jt[1149],(0|l)==(0|jt[1150])){if(l=(0|jt[1147])+t|0,jt[1147]=l,jt[1150]=s,jt[s+4>>2]=1|l,(0|s)!=(0|e))return;return jt[1149]=0,void(jt[1146]=0)}if((0|l)==(0|e))return l=(0|jt[1146])+t|0,jt[1146]=l,jt[1149]=a,jt[s+4>>2]=1|l,void(jt[a+l>>2]=l);n=(-8&i)+t|0,r=i>>>3;do{if(i>>>0<256){if(t=0|jt[l+8>>2],(0|(e=0|jt[l+12>>2]))==(0|t)){jt[1144]=jt[1144]&~(1<<r);break}jt[t+12>>2]=e,jt[e+8>>2]=t;break}o=0|jt[l+24>>2],e=0|jt[l+12>>2];do{if((0|e)==(0|l)){if(r=l+16|0,t=r+4|0,!(e=0|jt[t>>2])){if(!(e=0|jt[r>>2])){r=0;break}t=r}for(;;)if(r=e+20|0,0|(i=0|jt[r>>2]))e=i,t=r;else{if(r=e+16|0,!(i=0|jt[r>>2]))break;e=i,t=r}jt[t>>2]=0,r=e}else r=0|jt[l+8>>2],jt[r+12>>2]=e,jt[e+8>>2]=r,r=e}while(0);if(0|o){if(e=0|jt[l+28>>2],t=4880+(e<<2)|0,(0|l)==(0|jt[t>>2])){if(jt[t>>2]=r,!r){jt[1145]=jt[1145]&~(1<<e);break}}else if(jt[o+16+(((0|jt[o+16>>2])!=(0|l)&1)<<2)>>2]=r,!r)break;jt[r+24>>2]=o,e=l+16|0,t=0|jt[e>>2],0|t&&(jt[r+16>>2]=t,jt[t+24>>2]=r),e=0|jt[e+4>>2],0|e&&(jt[r+20>>2]=e,jt[e+24>>2]=r)}}while(0);if(jt[s+4>>2]=1|n,jt[a+n>>2]=n,(0|s)==(0|jt[1149]))return void(jt[1146]=n)}if(e=n>>>3,n>>>0<256)return r=4616+(e<<1<<2)|0,t=0|jt[1144],e=1<<e,t&e?(t=r+8|0,e=0|jt[t>>2]):(jt[1144]=t|e,e=r,t=r+8|0),jt[t>>2]=s,jt[e+12>>2]=s,jt[s+8>>2]=e,void(jt[s+12>>2]=r);e=n>>>8,e?n>>>0>16777215?e=31:(a=(e+1048320|0)>>>16&8,l=e<<a,o=(l+520192|0)>>>16&4,l<<=o,e=(l+245760|0)>>>16&2,e=14-(o|a|e)+(l<<e>>>15)|0,e=n>>>(e+7|0)&1|e<<1):e=0,i=4880+(e<<2)|0,jt[s+28>>2]=e,jt[s+20>>2]=0,jt[s+16>>2]=0,t=0|jt[1145],r=1<<e;do{if(t&r){for(t=n<<(31==(0|e)?0:25-(e>>>1)|0),r=0|jt[i>>2];;){if((-8&jt[r+4>>2]|0)==(0|n)){e=73;break}if(i=r+16+(t>>>31<<2)|0,!(e=0|jt[i>>2])){e=72;break}t<<=1,r=e}if(72==(0|e)){jt[i>>2]=s,jt[s+24>>2]=r,jt[s+12>>2]=s,jt[s+8>>2]=s;break}if(73==(0|e)){a=r+8|0,l=0|jt[a>>2],jt[l+12>>2]=s,jt[a>>2]=s,jt[s+8>>2]=l,jt[s+12>>2]=r,jt[s+24>>2]=0;break}}else jt[1145]=t|r,jt[i>>2]=s,jt[s+24>>2]=i,jt[s+12>>2]=s,jt[s+8>>2]=s}while(0);if(l=(0|jt[1152])-1|0,jt[1152]=l,!l){for(e=5032;;){if(!(e=0|jt[e>>2]))break;e=e+8|0}jt[1152]=-1}}}}function h(e,t,r,i,n,o,a,s){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0,a|=0,s|=0
;var l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,S=0,T=0,w=0,A=0,E=0,x=0,P=0,I=0,D=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,le=0,ue=0,ce=0,de=0;if(de=or,or=or+640|0,le=de+80|0,se=de+64|0,ae=de+48|0,ce=de+32|0,ue=de+16|0,oe=de,ie=de+128|0,ne=de+112|0,N=de+96|0,k=e+240|0,F=0|jt[k>>2],B=e+256|0,U=0|jt[B>>2],V=e+272|0,z=0|jt[V>>2],re=0|jt[e+88>>2],G=(0|Yt[re+63>>0])<<8|0|Yt[re+64>>0],re=0|zt[re+17>>0],H=255&re,!(re<<24>>24))return or=de,1;W=0==(0|s),j=a+-1|0,q=j<<5,Y=s+-1|0,X=i<<1,Q=e+92|0,Z=e+116|0,K=e+164|0,J=e+268|0,$=e+140|0,ee=e+236|0,te=e+212|0,re=e+188|0,L=0==(1&n|0),R=0==(1&o|0),O=e+288|0,M=e+284|0,D=e+252|0,I=0,e=0,o=0,n=0,r=0,l=1;do{if(!W)for(x=0|jt[t+(I<<2)>>2],P=0;;){if(E=1&P,c=0==(0|E),A=(E<<6^64)-32|0,E=(E<<1^2)-1|0,T=c?a:-1,(0|(u=c?0:j))!=(0|T))for(w=R|(0|P)!=(0|Y),S=c?x:x+q|0;;){1==(0|l)&&(l=512|C(Q,Z)),b=7&l,l>>>=3,d=0|Yt[1539+b>>0],c=0;do{_=(0|C(Q,K))+o|0,v=_-z|0,y=v>>31,o=y&_|v&~y,(0|jt[V>>2])>>>0<=o>>>0&&(jt[oe>>2]=866,jt[oe+4>>2]=910,jt[oe+8>>2]=1497,Ve(ie,812,oe),he(ie)),jt[N+(c<<2)>>2]=Qt[(0|jt[J>>2])+(o<<1)>>1],c=c+1|0}while(c>>>0<d>>>0);c=0;do{_=(0|C(Q,$))+r|0,v=_-F|0,y=v>>31,r=y&_|v&~y,(0|jt[k>>2])>>>0<=r>>>0&&(jt[ue>>2]=866,jt[ue+4>>2]=910,jt[ue+8>>2]=1497,Ve(ie,812,ue),he(ie)),jt[ne+(c<<2)>>2]=jt[(0|jt[ee>>2])+(r<<2)>>2],c=c+1|0}while(c>>>0<d>>>0);for(y=L|(0|u)!=(0|j),_=0,v=S;;){if(f=w|0==(0|_),m=_<<1,y)for(h=0,p=v;;){if(g=(0|C(Q,te))+e|0,d=g-G|0,e=d>>31,e=e&g|d&~e,d=(0|C(Q,re))+n|0,g=d-U|0,n=g>>31,n=n&d|g&~n,f&&(c=0|Yt[h+m+(1547+(b<<2))>>0],d=3*e|0,(0|jt[O>>2])>>>0<=d>>>0&&(jt[ce>>2]=866,jt[ce+4>>2]=910,jt[ce+8>>2]=1497,Ve(ie,812,ce),he(ie)),g=(0|jt[M>>2])+(d<<1)|0,jt[p>>2]=(0|Qt[g>>1])<<16|jt[N+(c<<2)>>2],jt[p+4>>2]=(0|Qt[g+4>>1])<<16|0|Qt[g+2>>1],jt[p+8>>2]=jt[ne+(c<<2)>>2],(0|jt[B>>2])>>>0<=n>>>0&&(jt[ae>>2]=866,jt[ae+4>>2]=910,jt[ae+8>>2]=1497,Ve(ie,812,ae),he(ie)),jt[p+12>>2]=jt[(0|jt[D>>2])+(n<<2)>>2]),2==(0|(h=h+1|0)))break;p=p+16|0}else for(g=1^f,f=1547+(b<<2)+m|0,h=0,p=v;;){if(m=(0|C(Q,te))+e|0,d=m-G|0,e=d>>31,e=e&m|d&~e,d=(0|C(Q,re))+n|0,m=d-U|0,n=m>>31,n=n&d|m&~n,0!=(0|h)|g||(c=0|Yt[f>>0],d=3*e|0,(0|jt[O>>2])>>>0<=d>>>0&&(jt[se>>2]=866,jt[se+4>>2]=910,jt[se+8>>2]=1497,Ve(ie,812,se),he(ie)),m=(0|jt[M>>2])+(d<<1)|0,jt[p>>2]=(0|Qt[m>>1])<<16|jt[N+(c<<2)>>2],jt[p+4>>2]=(0|Qt[m+4>>1])<<16|0|Qt[m+2>>1],jt[p+8>>2]=jt[ne+(c<<2)>>2],(0|jt[B>>2])>>>0<=n>>>0&&(jt[le>>2]=866,jt[le+4>>2]=910,jt[le+8>>2]=1497,Ve(ie,812,le),he(ie)),jt[p+12>>2]=jt[(0|jt[D>>2])+(n<<2)>>2]),2==(0|(h=h+1|0)))break;p=p+16|0}if(2==(0|(_=_+1|0)))break;v=v+i|0}if((0|(u=E+u|0))==(0|T))break;S=S+A|0}if((0|(P=P+1|0))==(0|s))break;x=x+X|0}I=I+1|0}while((0|I)!=(0|H));return or=de,1}function p(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=e+t|0,r=0|jt[e+4>>2];do{if(1&r)s=e,r=t;else{if(i=0|jt[e>>2],!(3&r))return;if(o=e+(0-i)|0,a=i+t|0,(0|o)==(0|jt[1149])){if(e=l+4|0,3!=(3&(r=0|jt[e>>2])|0)){s=o,r=a;break}return jt[1146]=a,jt[e>>2]=-2&r,jt[o+4>>2]=1|a,void(jt[o+a>>2]=a)}if(t=i>>>3,i>>>0<256){if(e=0|jt[o+8>>2],(0|(r=0|jt[o+12>>2]))==(0|e)){jt[1144]=jt[1144]&~(1<<t),s=o,r=a;break}jt[e+12>>2]=r,jt[r+8>>2]=e,s=o,r=a;break}n=0|jt[o+24>>2],e=0|jt[o+12>>2];do{if((0|e)==(0|o)){if(t=o+16|0,r=t+4|0,!(e=0|jt[r>>2])){if(!(e=0|jt[t>>2])){e=0;break}r=t}for(;;)if(t=e+20|0,0|(i=0|jt[t>>2]))e=i,r=t;else{if(t=e+16|0,!(i=0|jt[t>>2]))break;e=i,r=t}jt[r>>2]=0}else s=0|jt[o+8>>2],jt[s+12>>2]=e,jt[e+8>>2]=s}while(0);if(n){if(r=0|jt[o+28>>2],t=4880+(r<<2)|0,(0|o)==(0|jt[t>>2])){if(jt[t>>2]=e,!e){jt[1145]=jt[1145]&~(1<<r),s=o,r=a;break}}else if(jt[n+16+(((0|jt[n+16>>2])!=(0|o)&1)<<2)>>2]=e,!e){s=o,r=a;break}jt[e+24>>2]=n,r=o+16|0,t=0|jt[r>>2],0|t&&(jt[e+16>>2]=t,jt[t+24>>2]=e),r=0|jt[r+4>>2],r?(jt[e+20>>2]=r,jt[r+24>>2]=e,s=o,r=a):(s=o,r=a)}else s=o,r=a}}while(0);if(e=l+4|0,2&(i=0|jt[e>>2]))jt[e>>2]=-2&i,jt[s+4>>2]=1|r,jt[s+r>>2]=r;else{if(e=0|jt[1149],(0|l)==(0|jt[1150])){if(l=(0|jt[1147])+r|0,jt[1147]=l,jt[1150]=s,jt[s+4>>2]=1|l,(0|s)!=(0|e))return;return jt[1149]=0,void(jt[1146]=0)}if((0|l)==(0|e))return l=(0|jt[1146])+r|0,jt[1146]=l,jt[1149]=s,jt[s+4>>2]=1|l,void(jt[s+l>>2]=l);o=(-8&i)+r|0,t=i>>>3;do{if(i>>>0<256){if(r=0|jt[l+8>>2],(0|(e=0|jt[l+12>>2]))==(0|r)){jt[1144]=jt[1144]&~(1<<t);break}jt[r+12>>2]=e,jt[e+8>>2]=r;break}n=0|jt[l+24>>2],e=0|jt[l+12>>2];do{if((0|e)==(0|l)){if(t=l+16|0,r=t+4|0,!(e=0|jt[r>>2])){if(!(e=0|jt[t>>2])){t=0;break}r=t}for(;;)if(t=e+20|0,0|(i=0|jt[t>>2]))e=i,r=t;else{if(t=e+16|0,!(i=0|jt[t>>2]))break;e=i,r=t}jt[r>>2]=0,t=e}else t=0|jt[l+8>>2],jt[t+12>>2]=e,jt[e+8>>2]=t,t=e}while(0);if(0|n){if(e=0|jt[l+28>>2],r=4880+(e<<2)|0,(0|l)==(0|jt[r>>2])){if(jt[r>>2]=t,!t){jt[1145]=jt[1145]&~(1<<e);break}}else if(jt[n+16+(((0|jt[n+16>>2])!=(0|l)&1)<<2)>>2]=t,!t)break;jt[t+24>>2]=n,e=l+16|0,r=0|jt[e>>2],0|r&&(jt[t+16>>2]=r,jt[r+24>>2]=t),e=0|jt[e+4>>2],0|e&&(jt[t+20>>2]=e,jt[e+24>>2]=t)}}while(0);if(jt[s+4>>2]=1|o,jt[s+o>>2]=o,(0|s)==(0|jt[1149]))return void(jt[1146]=o);r=o}if(e=r>>>3,r>>>0<256)return t=4616+(e<<1<<2)|0,r=0|jt[1144],e=1<<e,r&e?(r=t+8|0,e=0|jt[r>>2]):(jt[1144]=r|e,e=t,r=t+8|0),jt[r>>2]=s,jt[e+12>>2]=s,jt[s+8>>2]=e,void(jt[s+12>>2]=t);if(e=r>>>8,e?r>>>0>16777215?e=31:(a=(e+1048320|0)>>>16&8,l=e<<a,o=(l+520192|0)>>>16&4,l<<=o,e=(l+245760|0)>>>16&2,e=14-(o|a|e)+(l<<e>>>15)|0,e=r>>>(e+7|0)&1|e<<1):e=0,n=4880+(e<<2)|0,jt[s+28>>2]=e,jt[s+20>>2]=0,jt[s+16>>2]=0,t=0|jt[1145],i=1<<e,!(t&i))return jt[1145]=t|i,jt[n>>2]=s,jt[s+24>>2]=n,jt[s+12>>2]=s,void(jt[s+8>>2]=s);for(t=r<<(31==(0|e)?0:25-(e>>>1)|0),i=0|jt[n>>2];;){if((-8&jt[i+4>>2]|0)==(0|r)){e=69;break}if(n=i+16+(t>>>31<<2)|0,!(e=0|jt[n>>2])){e=68;break}t<<=1,i=e}return 68==(0|e)?(jt[n>>2]=s,jt[s+24>>2]=i,jt[s+12>>2]=s,void(jt[s+8>>2]=s)):69==(0|e)?(a=i+8|0,l=0|jt[a>>2],jt[l+12>>2]=s,jt[a>>2]=s,jt[s+8>>2]=l,jt[s+12>>2]=i,void(jt[s+24>>2]=0)):void 0}function f(e){e|=0;var t=0,r=0,i=0,n=0,o=0,a=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,S=0,T=0,w=0,E=0,x=0,P=0,I=0,D=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0;if(G=or,or=or+2416|0,a=G,o=G+1904|0,z=G+1880|0,B=G+980|0,U=G+80|0,V=G+16|0,r=0|jt[e+88>>2],k=(0|Yt[r+63>>0])<<8|0|Yt[r+64>>0],F=e+92|0,t=(0|jt[e+4>>2])+((0|Yt[r+58>>0])<<8|(0|Yt[r+57>>0])<<16|0|Yt[r+59>>0])|0,!(r=(0|Yt[r+61>>0])<<8|(0|Yt[r+60>>0])<<16|0|Yt[r+62>>0]))return z=0,or=G,0|z;if(jt[F>>2]=t,jt[e+96>>2]=t,jt[e+104>>2]=r,jt[e+100>>2]=t+r,jt[e+108>>2]=0,jt[e+112>>2]=0,jt[z+20>>2]=0,jt[z>>2]=0,jt[z+4>>2]=0,jt[z+8>>2]=0,jt[z+12>>2]=0,zt[z+16>>0]=0,0|s(F,z)){for(t=0,r=-7,i=-7;;){if(jt[B+(t<<2)>>2]=i,jt[U+(t<<2)>>2]=r,n=(0|i)>6,225==(0|(t=t+1|0)))break;r=(1&n)+r|0,i=n?-7:i+1|0}t=V,r=t+64|0;do{jt[t>>2]=0,t=t+4|0}while((0|t)<(0|r));n=e+284|0,r=3*k|0,i=e+288|0,t=0|jt[i>>2];e:do{if((0|t)==(0|r))l=13;else{if(t>>>0<=r>>>0){do{if((0|jt[e+292>>2])>>>0<r>>>0){if(0|A(n,r,(t+1|0)==(0|r),2,0)){t=0|jt[i>>2];break}zt[e+296>>0]=1,t=0;break e}}while(0);ee((0|jt[n>>2])+(t<<1)|0,0,r-t<<1|0)}jt[i>>2]=r,l=13}}while(0);do{if(13==(0|l)){if(!k){jt[a>>2]=866,jt[a+4>>2]=910,jt[a+8>>2]=1497,Ve(o,812,a),he(o),t=1;break}for(y=V+4|0,b=V+8|0,S=V+12|0,T=V+16|0,w=V+20|0,E=V+24|0,x=V+28|0,P=V+32|0,I=V+36|0,D=V+40|0,O=V+44|0,M=V+48|0,R=V+52|0,L=V+56|0,N=V+60|0,v=0,t=0|jt[n>>2],r=0|jt[V>>2],i=0|jt[y>>2],n=0|jt[b>>2],e=0|jt[S>>2],o=0|jt[T>>2],a=0|jt[w>>2],l=0|jt[E>>2],u=0|jt[x>>2],c=0|jt[P>>2],d=0|jt[I>>2],h=0|jt[D>>2],p=0|jt[O>>2],f=0,m=0,g=0,_=0;;){if(W=0|C(F,z),r=r+(0|jt[B+(W<<2)>>2])&7,i=i+(0|jt[U+(W<<2)>>2])&7,W=0|C(F,z),n=n+(0|jt[B+(W<<2)>>2])&7,e=e+(0|jt[U+(W<<2)>>2])&7,W=0|C(F,z),o=o+(0|jt[B+(W<<2)>>2])&7,a=a+(0|jt[U+(W<<2)>>2])&7,W=0|C(F,z),l=l+(0|jt[B+(W<<2)>>2])&7,u=u+(0|jt[U+(W<<2)>>2])&7,W=0|C(F,z),c=c+(0|jt[B+(W<<2)>>2])&7,d=d+(0|jt[U+(W<<2)>>2])&7,W=0|C(F,z),h=h+(0|jt[B+(W<<2)>>2])&7,p=p+(0|jt[U+(W<<2)>>2])&7,W=0|C(F,z),f=f+(0|jt[B+(W<<2)>>2])&7,m=m+(0|jt[U+(W<<2)>>2])&7,W=0|C(F,z),g=g+(0|jt[B+(W<<2)>>2])&7,_=_+(0|jt[U+(W<<2)>>2])&7,W=0|Yt[1445+a>>0],Ht[t>>1]=(0|Yt[1445+i>>0])<<3|0|Yt[1445+r>>0]|(0|Yt[1445+n>>0])<<6|(0|Yt[1445+e>>0])<<9|(0|Yt[1445+o>>0])<<12|W<<15,H=0|Yt[1445+h>>0],Ht[t+2>>1]=(0|Yt[1445+l>>0])<<2|W>>>1|(0|Yt[1445+u>>0])<<5|(0|Yt[1445+c>>0])<<8|(0|Yt[1445+d>>0])<<11|H<<14,Ht[t+4>>1]=(0|Yt[1445+p>>0])<<1|H>>>2|(0|Yt[1445+f>>0])<<4|(0|Yt[1445+m>>0])<<7|(0|Yt[1445+g>>0])<<10|(0|Yt[1445+_>>0])<<13,(v=v+1|0)>>>0>=k>>>0)break;t=t+6|0}jt[V>>2]=r,jt[y>>2]=i,jt[b>>2]=n,jt[S>>2]=e,jt[T>>2]=o,jt[w>>2]=a,jt[E>>2]=l,jt[x>>2]=u,jt[P>>2]=c,jt[I>>2]=d,jt[D>>2]=h,jt[O>>2]=p,jt[M>>2]=f,jt[R>>2]=m,jt[L>>2]=g,jt[N>>2]=_,t=1}}while(0)}else t=0;return X(z),W=t,or=G,0|W}function m(e){e|=0;var t=0,r=0,i=0,n=0,o=0,a=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,S=0,T=0,w=0,E=0,x=0,P=0,I=0,D=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,V=0,z=0,G=0;if(P=or,or=or+1008|0,a=P,o=P+496|0,x=P+472|0,T=P+276|0,w=P+80|0,E=P+16|0,r=0|jt[e+88>>2],b=(0|Yt[r+47>>0])<<8|0|Yt[r+48>>0],S=e+92|0,t=(0|jt[e+4>>2])+((0|Yt[r+42>>0])<<8|(0|Yt[r+41>>0])<<16|0|Yt[r+43>>0])|0,!(r=(0|Yt[r+45>>0])<<8|(0|Yt[r+44>>0])<<16|0|Yt[r+46>>0]))return x=0,or=P,0|x;if(jt[S>>2]=t,jt[e+96>>2]=t,jt[e+104>>2]=r,jt[e+100>>2]=t+r,jt[e+108>>2]=0,jt[e+112>>2]=0,jt[x+20>>2]=0,jt[x>>2]=0,jt[x+4>>2]=0,jt[x+8>>2]=0,jt[x+12>>2]=0,zt[x+16>>0]=0,0|s(S,x)){for(t=0,r=-3,i=-3;;){if(jt[T+(t<<2)>>2]=i,jt[w+(t<<2)>>2]=r,n=(0|i)>2,49==(0|(t=t+1|0)))break;r=(1&n)+r|0,i=n?-3:i+1|0}t=E,r=t+64|0;do{jt[t>>2]=0,t=t+4|0}while((0|t)<(0|r));i=e+252|0,r=e+256|0,t=0|jt[r>>2];e:do{if((0|t)==(0|b))l=13;else{if(t>>>0<=b>>>0){do{if((0|jt[e+260>>2])>>>0<b>>>0){if(0|A(i,b,(t+1|0)==(0|b),4,0)){t=0|jt[r>>2];break}zt[e+264>>0]=1,t=0;break e}}while(0);ee((0|jt[i>>2])+(t<<2)|0,0,b-t<<2|0)}jt[r>>2]=b,l=13}}while(0);do{if(13==(0|l)){if(!b){jt[a>>2]=866,jt[a+4>>2]=910,jt[a+8>>2]=1497,Ve(o,812,a),he(o),t=1;break}for(e=E+4|0,o=E+8|0,a=E+12|0,l=E+16|0,u=E+20|0,c=E+24|0,d=E+28|0,h=E+32|0,p=E+36|0,f=E+40|0,m=E+44|0,g=E+48|0,_=E+52|0,v=E+56|0,y=E+60|0,n=0,t=0|jt[i>>2],r=0|jt[e>>2],i=0|jt[E>>2];;){if(z=0|C(S,x),i=i+(0|jt[T+(z<<2)>>2])&3,r=r+(0|jt[w+(z<<2)>>2])&3,z=0|C(S,x),G=(0|jt[o>>2])+(0|jt[T+(z<<2)>>2])&3,jt[o>>2]=G,z=(0|jt[a>>2])+(0|jt[w+(z<<2)>>2])&3,jt[a>>2]=z,U=0|C(S,x),V=(0|jt[l>>2])+(0|jt[T+(U<<2)>>2])&3,jt[l>>2]=V,U=(0|jt[u>>2])+(0|jt[w+(U<<2)>>2])&3,jt[u>>2]=U,F=0|C(S,x),B=(0|jt[c>>2])+(0|jt[T+(F<<2)>>2])&3,jt[c>>2]=B,F=(0|jt[d>>2])+(0|jt[w+(F<<2)>>2])&3,jt[d>>2]=F,N=0|C(S,x),k=(0|jt[h>>2])+(0|jt[T+(N<<2)>>2])&3,jt[h>>2]=k,N=(0|jt[p>>2])+(0|jt[w+(N<<2)>>2])&3,jt[p>>2]=N,R=0|C(S,x),L=(0|jt[f>>2])+(0|jt[T+(R<<2)>>2])&3,jt[f>>2]=L,R=(0|jt[m>>2])+(0|jt[w+(R<<2)>>2])&3,jt[m>>2]=R,O=0|C(S,x),M=(0|jt[g>>2])+(0|jt[T+(O<<2)>>2])&3,jt[g>>2]=M,O=(0|jt[_>>2])+(0|jt[w+(O<<2)>>2])&3,jt[_>>2]=O,I=0|C(S,x),D=(0|jt[v>>2])+(0|jt[T+(I<<2)>>2])&3,jt[v>>2]=D,I=(0|jt[y>>2])+(0|jt[w+(I<<2)>>2])&3,jt[y>>2]=I,jt[t>>2]=(0|Yt[1441+r>>0])<<2|0|Yt[1441+i>>0]|(0|Yt[1441+G>>0])<<4|(0|Yt[1441+z>>0])<<6|(0|Yt[1441+V>>0])<<8|(0|Yt[1441+U>>0])<<10|(0|Yt[1441+B>>0])<<12|(0|Yt[1441+F>>0])<<14|(0|Yt[1441+k>>0])<<16|(0|Yt[1441+N>>0])<<18|(0|Yt[1441+L>>0])<<20|(0|Yt[1441+R>>0])<<22|(0|Yt[1441+M>>0])<<24|(0|Yt[1441+O>>0])<<26|(0|Yt[1441+D>>0])<<28|(0|Yt[1441+I>>0])<<30,(n=n+1|0)>>>0>=b>>>0)break;t=t+4|0}jt[E>>2]=i,jt[e>>2]=r,t=1}}while(0)}else t=0;return X(x),G=t,or=P,0|G}function g(e,t,r,i,n,o,a,s){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0,a|=0,s|=0;var l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,b=0,S=0,T=0,w=0,A=0,E=0,x=0,P=0,I=0,D=0,O=0,M=0,R=0,L=0,N=0,k=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0;if(Z=or,or=or+592|0,Y=Z+48|0,Q=Z+32|0,X=Z+16|0,q=Z,W=Z+80|0,j=Z+64|0,D=e+272|0,O=0|jt[D>>2],H=0|jt[e+88>>2],M=(0|Yt[H+63>>0])<<8|0|Yt[H+64>>0],H=0|zt[H+17>>0],R=255&H,!(H<<24>>24))return or=Z,1;L=0==(0|s),N=a+-1|0,k=N<<4,F=s+-1|0,B=i<<1,U=e+92|0,V=e+116|0,z=e+164|0,G=e+268|0,H=e+212|0,I=0==(1&n|0),P=0==(1&o|0),x=e+288|0,E=e+284|0,A=0,n=0,r=0,o=1;do{if(!L)for(T=0|jt[t+(A<<2)>>2],w=0;;){if(S=1&w,l=0==(0|S),b=(S<<5^32)-16|0,S=(S<<1^2)-1|0,v=l?a:-1,(0|(e=l?0:N))!=(0|v))for(y=P|(0|w)!=(0|F),_=l?T:T+k|0;;){1==(0|o)&&(o=512|C(U,V)),g=7&o,o>>>=3,u=0|Yt[1539+g>>0],l=0;do{p=(0|C(U,z))+r|0,f=p-O|0,m=f>>31,r=m&p|f&~m,(0|jt[D>>2])>>>0<=r>>>0&&(jt[q>>2]=866,jt[q+4>>2]=910,jt[q+8>>2]=1497,Ve(W,812,q),he(W)),jt[j+(l<<2)>>2]=Qt[(0|jt[G>>2])+(r<<1)>>1],l=l+1|0}while(l>>>0<u>>>0);for(m=I|(0|e)!=(0|N),p=0,f=_;;){if(h=y|0==(0|p),u=p<<1,l=(0|C(U,H))+n|0,c=l-M|0,d=c>>31,d=d&l|c&~d,m?(h&&(n=0|Yt[1547+(g<<2)+u>>0],l=3*d|0,(0|jt[x>>2])>>>0<=l>>>0&&(jt[X>>2]=866,jt[X+4>>2]=910,jt[X+8>>2]=1497,Ve(W,812,X),he(W)),c=(0|jt[E>>2])+(l<<1)|0,jt[f>>2]=(0|Qt[c>>1])<<16|jt[j+(n<<2)>>2],jt[f+4>>2]=(0|Qt[c+4>>1])<<16|0|Qt[c+2>>1]),c=f+8|0,l=(0|C(U,H))+d|0,d=l-M|0,n=d>>31,n=n&l|d&~n,h&&(l=0|Yt[1547+(g<<2)+(1|u)>>0],u=3*n|0,(0|jt[x>>2])>>>0<=u>>>0&&(jt[Y>>2]=866,jt[Y+4>>2]=910,jt[Y+8>>2]=1497,Ve(W,812,Y),he(W)),h=(0|jt[E>>2])+(u<<1)|0,jt[c>>2]=(0|Qt[h>>1])<<16|jt[j+(l<<2)>>2],jt[f+12>>2]=(0|Qt[h+4>>1])<<16|0|Qt[h+2>>1])):(h&&(n=0|Yt[1547+(g<<2)+u>>0],l=3*d|0,(0|jt[x>>2])>>>0<=l>>>0&&(jt[Q>>2]=866,jt[Q+4>>2]=910,jt[Q+8>>2]=1497,Ve(W,812,Q),he(W)),h=(0|jt[E>>2])+(l<<1)|0,jt[f>>2]=(0|Qt[h>>1])<<16|jt[j+(n<<2)>>2],jt[f+4>>2]=(0|Qt[h+4>>1])<<16|0|Qt[h+2>>1]),d=(0|C(U,H))+d|0,h=d-M|0,n=h>>31,n=n&d|h&~n),2==(0|(p=p+1|0)))break;f=f+i|0}if((0|(e=S+e|0))==(0|v))break;_=_+b|0}if((0|(w=w+1|0))==(0|s))break;T=T+B|0}A=A+1|0}while((0|A)!=(0|R));return or=Z,1}function _(e,t,r,i,n){e|=0,t|=0,r|=0,i|=0,n|=0;var o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0;if(c=e,l=t,u=l,a=r,h=i,s=h,!u)return o=0!=(0|n),s?o?(jt[n>>2]=0|e,jt[n+4>>2]=0&t,h=0,n=0,0|(cr=h,n)):(h=0,n=0,0|(cr=h,n)):(o&&(jt[n>>2]=(c>>>0)%(a>>>0),jt[n+4>>2]=0),h=0,n=(c>>>0)/(a>>>0)>>>0,0|(cr=h,n));o=0==(0|s);do{if(a){if(!o){if((o=(0|hr(0|s))-(0|hr(0|u))|0)>>>0<=31){d=o+1|0,s=31-o|0,t=o-31>>31,a=d,e=c>>>(d>>>0)&t|u<<s,t&=u>>>(d>>>0),o=0,s=c<<s;break}return n?(jt[n>>2]=0|e,jt[n+4>>2]=l|0&t,h=0,n=0,0|(cr=h,n)):(h=0,n=0,0|(cr=h,n))}if((o=a-1|0)&a|0){s=33+(0|hr(0|a))-(0|hr(0|u))|0,f=64-s|0,d=32-s|0,l=d>>31,p=s-32|0,t=p>>31,a=s,e=d-1>>31&u>>>(p>>>0)|(u<<d|c>>>(s>>>0))&t,t&=u>>>(s>>>0),o=c<<f&l,s=(u<<f|c>>>(p>>>0))&l|c<<d&s-33>>31;break}return 0|n&&(jt[n>>2]=o&c,jt[n+4>>2]=0),1==(0|a)?(p=l|0&t,f=0|e,0|(cr=p,f)):(f=0|xe(0|a),p=u>>>(f>>>0)|0,f=u<<32-f|c>>>(f>>>0)|0,0|(cr=p,f))}if(o)return 0|n&&(jt[n>>2]=(u>>>0)%(a>>>0),jt[n+4>>2]=0),p=0,f=(u>>>0)/(a>>>0)>>>0,0|(cr=p,f);if(!c)return 0|n&&(jt[n>>2]=0,jt[n+4>>2]=(u>>>0)%(s>>>0)),p=0,f=(u>>>0)/(s>>>0)>>>0,0|(cr=p,f);if(!((o=s-1|0)&s))return 0|n&&(jt[n>>2]=0|e,jt[n+4>>2]=o&u|0&t),p=0,f=u>>>((0|xe(0|s))>>>0),0|(cr=p,f);if((o=(0|hr(0|s))-(0|hr(0|u))|0)>>>0<=30){t=o+1|0,s=31-o|0,a=t,e=u<<s|c>>>(t>>>0),t=u>>>(t>>>0),o=0,s=c<<s;break}return n?(jt[n>>2]=0|e,jt[n+4>>2]=l|0&t,p=0,f=0,0|(cr=p,f)):(p=0,f=0,0|(cr=p,f))}while(0);if(a){d=0|r,c=h|0&i,u=0|Ke(0|d,0|c,-1,-1),r=cr,l=s,s=0;do{i=l,l=o>>>31|l<<1,o=s|o<<1,i=e<<1|i>>>31|0,h=e>>>31|t<<1|0,Ye(0|u,0|r,0|i,0|h),f=cr,p=f>>31|((0|f)<0?-1:0)<<1,s=1&p,e=0|Ye(0|i,0|h,p&d|0,(((0|f)<0?-1:0)>>31|((0|f)<0?-1:0)<<1)&c|0),t=cr,a=a-1|0}while(0!=(0|a));u=l,l=0}else u=s,l=0,s=0;return a=0,0|n&&(jt[n>>2]=e,jt[n+4>>2]=t),p=(0|o)>>>31|(u|a)<<1|0&(a<<1|o>>>31)|l,f=-2&(o<<1|0)|s,0|(cr=p,f)}function v(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0;if(d=e+4|0,c=0|jt[d>>2],r=-8&c,s=e+r|0,!(3&c))return t>>>0<256?0|(e=0):(r>>>0>=(t+4|0)>>>0?(r-t|0)>>>0<=jt[1264]<<1>>>0:0)?0|e:0|(e=0);if(r>>>0>=t>>>0)return(r=r-t|0)>>>0<=15?0|e:(u=e+t|0,jt[d>>2]=1&c|t|2,jt[u+4>>2]=3|r,d=u+r+4|0,jt[d>>2]=1|jt[d>>2],p(u,r),0|e);if((0|s)==(0|jt[1150]))return u=(0|jt[1147])+r|0,r=u-t|0,i=e+t|0,u>>>0<=t>>>0?0|(e=0):(jt[d>>2]=1&c|t|2,jt[i+4>>2]=1|r,jt[1150]=i,jt[1147]=r,0|e);if((0|s)==(0|jt[1149]))return(n=(0|jt[1146])+r|0)>>>0<t>>>0?0|(e=0):(r=n-t|0,i=1&c,r>>>0>15?(c=e+t|0,u=c+r|0,jt[d>>2]=i|t|2,jt[c+4>>2]=1|r,jt[u>>2]=r,i=u+4|0,jt[i>>2]=-2&jt[i>>2],i=c):(jt[d>>2]=i|n|2,i=e+n+4|0,jt[i>>2]=1|jt[i>>2],i=0,r=0),jt[1146]=r,jt[1149]=i,0|e);if(2&(i=0|jt[s+4>>2])|0)return 0|(e=0);if((l=(-8&i)+r|0)>>>0<t>>>0)return 0|(e=0);u=l-t|0,n=i>>>3;do{if(i>>>0<256){if(i=0|jt[s+8>>2],(0|(r=0|jt[s+12>>2]))==(0|i)){jt[1144]=jt[1144]&~(1<<n);break}jt[i+12>>2]=r,jt[r+8>>2]=i;break}a=0|jt[s+24>>2],r=0|jt[s+12>>2];do{if((0|r)==(0|s)){if(n=s+16|0,i=n+4|0,r=0|jt[i>>2])o=i;else{if(!(r=0|jt[n>>2])){n=0;break}o=n}for(;;)if(n=r+20|0,0|(i=0|jt[n>>2]))r=i,o=n;else{if(i=r+16|0,!(n=0|jt[i>>2]))break;r=n,o=i}jt[o>>2]=0,n=r}else n=0|jt[s+8>>2],jt[n+12>>2]=r,jt[r+8>>2]=n,n=r}while(0);if(0|a){if(r=0|jt[s+28>>2],i=4880+(r<<2)|0,(0|s)==(0|jt[i>>2])){if(jt[i>>2]=n,!n){jt[1145]=jt[1145]&~(1<<r);break}}else if(jt[a+16+(((0|jt[a+16>>2])!=(0|s)&1)<<2)>>2]=n,!n)break;jt[n+24>>2]=a,r=s+16|0,i=0|jt[r>>2],0|i&&(jt[n+16>>2]=i,jt[i+24>>2]=n),r=0|jt[r+4>>2],0|r&&(jt[n+20>>2]=r,jt[r+24>>2]=n)}}while(0);return r=1&c,u>>>0<16?(jt[d>>2]=l|r|2,d=e+l+4|0,jt[d>>2]=1|jt[d>>2],0|e):(c=e+t|0,jt[d>>2]=r|t|2,jt[c+4>>2]=3|u,d=c+u+4|0,jt[d>>2]=1|jt[d>>2],p(c,u),0|e)}function y(e,t,r,i,n,o){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0;var a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0;switch(f=or,or=or+592|0,p=f+56|0,l=f+40|0,d=f+72|0,c=f,h=f+68|0,jt[c>>2]=40,U(e,t,c),a=(0|jt[c+4>>2])>>>n,s=(0|jt[c+8>>2])>>>n,c=c+32|0,i=0|jt[c+4>>2],0|jt[c>>2]){case 0:i?u=14:c=8;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:u=i?14:13;break;case 9:case 10:i?u=14:c=8;break;default:u=14}13==(0|u)?c=16:14==(0|u)&&(jt[l>>2]=866,jt[l+4>>2]=2672,jt[l+8>>2]=1251,Ve(d,812,l),he(d),c=0),jt[h>>2]=r,u=0|E(e,t),t=o+n|0;do{if(t>>>0>n>>>0){if(!u){for(i=r;;){if(i=i+(0|dr(0|dr((a+3|0)>>>2,c),(s+3|0)>>>2))|0,(0|(n=n+1|0))==(0|t))break;s>>>=1,a>>>=1}jt[h>>2]=i;break}for(e=s,i=r;;){if(s=0|dr((a+3|0)>>>2,c),l=0|dr(s,(e+3|0)>>>2),(n>>>0>15|l>>>0<8?0:519686845==(0|jt[u>>2]))&&(G(u,h,l,s,n),i=0|jt[h>>2]),i=i+l|0,jt[h>>2]=i,(0|(n=n+1|0))==(0|t))break;e>>>=1,a>>>=1}}}while(0);return u?519686845!=(0|jt[u>>2])?void(or=f):(S(u),7&u?(jt[p>>2]=866,jt[p+4>>2]=2506,jt[p+8>>2]=1232,Ve(d,812,p),he(d),void(or=f)):(oe(u,0,0,1,0),void(or=f))):void(or=f)}function b(e){e|=0;var t=0,r=0,i=0,n=0,o=0,a=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0;if(f=or,or=or+576|0,a=f,n=f+64|0,p=f+16|0,i=e+88|0,t=0|jt[i>>2],h=(0|Yt[t+39>>0])<<8|0|Yt[t+40>>0],c=e+236|0,o=e+240|0,(0|(r=0|jt[o>>2]))!=(0|h)){if(r>>>0<=h>>>0){do{if((0|jt[e+244>>2])>>>0<h>>>0){if(0|A(c,h,(r+1|0)==(0|h),4,0)){t=0|jt[o>>2];break}return zt[e+248>>0]=1,p=0,or=f,0|p}t=r}while(0);ee((0|jt[c>>2])+(t<<2)|0,0,h-t<<2|0),t=0|jt[i>>2]}jt[o>>2]=h}if(d=e+92|0,r=(0|jt[e+4>>2])+((0|Yt[t+34>>0])<<8|(0|Yt[t+33>>0])<<16|0|Yt[t+35>>0])|0,!(t=(0|Yt[t+37>>0])<<8|(0|Yt[t+36>>0])<<16|0|Yt[t+38>>0]))return p=0,or=f,0|p;if(jt[d>>2]=r,jt[e+96>>2]=r,jt[e+104>>2]=t,jt[e+100>>2]=r+t,jt[e+108>>2]=0,jt[e+112>>2]=0,l=p+20|0,jt[p>>2]=0,jt[p+4>>2]=0,jt[p+8>>2]=0,jt[p+12>>2]=0,zt[p+16>>0]=0,u=p+24|0,jt[p+44>>2]=0,jt[l>>2]=0,jt[l+4>>2]=0,jt[l+8>>2]=0,jt[l+12>>2]=0,jt[l+16>>2]=0,zt[l+20>>0]=0,0|s(d,p)?0|s(d,u):0)if(0|jt[o>>2]||(jt[a>>2]=866,jt[a+4>>2]=910,jt[a+8>>2]=1497,Ve(n,812,a),he(n)),h)for(a=0,l=0,r=0|jt[c>>2],i=0,e=0,t=0,n=0,o=0;;){if(a=(0|C(d,p))+a&31,o=(0|C(d,u))+o&63,n=(0|C(d,p))+n&31,t=(0|C(d,p))+t|0,e=(0|C(d,u))+e&63,i=(0|C(d,p))+i&31,jt[r>>2]=o<<5|a<<11|n|t<<27|e<<21|i<<16,(l=l+1|0)>>>0>=h>>>0){t=1;break}r=r+4|0,t&=31}else t=1;else t=0;return X(p+24|0),X(p),p=t,or=f,0|p}function C(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0;m=or,or=or+576|0,u=m+48|0,d=m+32|0,c=m+16|0,l=m,p=m+64|0,h=0|jt[t+20>>2],f=e+20|0,s=0|jt[f>>2],(0|s)<24?(a=e+4|0,r=0|jt[a>>2],n=0|jt[e+8>>2],i=r>>>0<n>>>0,(0|s)<16?(i?(o=(0|Yt[r>>0])<<8,r=r+1|0):o=0,r>>>0<n>>>0?(n=0|Yt[r>>0],r=r+1|0):n=0,jt[a>>2]=r,jt[f>>2]=s+16,i=16,r=n|o):(i?(jt[a>>2]=r+1,r=0|Yt[r>>0]):r=0,jt[f>>2]=s+8,i=24),a=e+16|0,n=jt[a>>2]|r<<i-s,jt[a>>2]=n):(n=e+16|0,a=n,n=0|jt[n>>2]),o=1+(n>>>16)|0;do{if(!(o>>>0<=(0|jt[h+16>>2])>>>0)){for(i=0|jt[h+20>>2];;){if(r=i+-1|0,!(o>>>0>(0|jt[h+28+(r<<2)>>2])>>>0))break;i=i+1|0}if((r=(n>>>(32-i|0))+(0|jt[h+96+(r<<2)>>2])|0)>>>0<(0|jt[t>>2])>>>0){r=0|Qt[(0|jt[h+176>>2])+(r<<1)>>1];break}return jt[u>>2]=866,jt[u+4>>2]=3275,jt[u+8>>2]=1348,Ve(p,812,u),he(p),f=0,or=m,0|f}i=0|jt[(0|jt[h+168>>2])+(n>>>(32-(0|jt[h+8>>2])|0)<<2)>>2],-1==(0|i)&&(jt[l>>2]=866,jt[l+4>>2]=3253,jt[l+8>>2]=1393,Ve(p,812,l),he(p)),r=65535&i,i>>>=16,(0|jt[t+8>>2])>>>0<=r>>>0&&(jt[c>>2]=866,jt[c+4>>2]=909,jt[c+8>>2]=1497,Ve(p,812,c),he(p)),(0|Yt[(0|jt[t+4>>2])+r>>0])!=(0|i)&&(jt[d>>2]=866,jt[d+4>>2]=3257,jt[d+8>>2]=1410,Ve(p,812,d),he(p))}while(0);return jt[a>>2]=jt[a>>2]<<i,jt[f>>2]=(0|jt[f>>2])-i,f=r,or=m,0|f}function S(e){e|=0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0;if(l=or,or=or+576|0,s=l+48|0,o=l+32|0,n=l+16|0,i=l,a=l+64|0,jt[e>>2]=0,t=e+284|0,r=0|jt[t>>2],0|r&&(7&r?(jt[i>>2]=866,jt[i+4>>2]=2506,jt[i+8>>2]=1232,Ve(a,812,i),he(a)):oe(r,0,0,1,0),jt[t>>2]=0,jt[e+288>>2]=0,jt[e+292>>2]=0),zt[e+296>>0]=0,t=e+268|0,r=0|jt[t>>2],0|r&&(7&r?(jt[n>>2]=866,jt[n+4>>2]=2506,jt[n+8>>2]=1232,Ve(a,812,n),he(a)):oe(r,0,0,1,0),jt[t>>2]=0,jt[e+272>>2]=0,jt[e+276>>2]=0),zt[e+280>>0]=0,t=e+252|0,r=0|jt[t>>2],0|r&&(7&r?(jt[o>>2]=866,jt[o+4>>2]=2506,jt[o+8>>2]=1232,Ve(a,812,o),he(a)):oe(r,0,0,1,0),jt[t>>2]=0,jt[e+256>>2]=0,jt[e+260>>2]=0),zt[e+264>>0]=0,t=e+236|0,!(r=0|jt[t>>2]))return s=e+248|0,zt[s>>0]=0,s=e+212|0,X(s),s=e+188|0,X(s),s=e+164|0,X(s),s=e+140|0,X(s),s=e+116|0,X(s),void(or=l);7&r?(jt[s>>2]=866,jt[s+4>>2]=2506,jt[s+8>>2]=1232,Ve(a,812,s),he(a)):oe(r,0,0,1,0),jt[t>>2]=0,jt[e+240>>2]=0,jt[e+244>>2]=0,s=e+248|0,zt[s>>0]=0,s=e+212|0,X(s),s=e+188|0,X(s),s=e+164|0,X(s),s=e+140|0,X(s),s=e+116|0,X(s),or=l}function T(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0;e:do{if(t>>>0<=20)switch(0|t){case 9:i=3+(0|jt[r>>2])&-4,t=0|jt[i>>2],jt[r>>2]=i+4,jt[e>>2]=t;break e;case 10:i=3+(0|jt[r>>2])&-4,t=0|jt[i>>2],jt[r>>2]=i+4,i=e,jt[i>>2]=t,jt[i+4>>2]=((0|t)<0)<<31>>31;break e;case 11:i=3+(0|jt[r>>2])&-4,t=0|jt[i>>2],jt[r>>2]=i+4,i=e,jt[i>>2]=t,jt[i+4>>2]=0;break e;case 12:i=7+(0|jt[r>>2])&-8,t=i,n=0|jt[t>>2],t=0|jt[t+4>>2],jt[r>>2]=i+8,i=e,jt[i>>2]=n,jt[i+4>>2]=t;break e;case 13:n=3+(0|jt[r>>2])&-4,i=0|jt[n>>2],jt[r>>2]=n+4,i=(65535&i)<<16>>16,n=e,jt[n>>2]=i,jt[n+4>>2]=((0|i)<0)<<31>>31;break e;case 14:n=3+(0|jt[r>>2])&-4,i=0|jt[n>>2],jt[r>>2]=n+4,n=e,jt[n>>2]=65535&i,jt[n+4>>2]=0;break e;case 15:n=3+(0|jt[r>>2])&-4,i=0|jt[n>>2],jt[r>>2]=n+4,i=(255&i)<<24>>24,n=e,jt[n>>2]=i,jt[n+4>>2]=((0|i)<0)<<31>>31;break e;case 16:n=3+(0|jt[r>>2])&-4,i=0|jt[n>>2],jt[r>>2]=n+4,n=e,jt[n>>2]=255&i,jt[n+4>>2]=0;break e;case 17:case 18:n=7+(0|jt[r>>2])&-8,o=+tr[n>>3],jt[r>>2]=n+8,tr[e>>3]=o;break e;default:break e}}while(0)}function w(e){e|=0;var t=0,r=0,i=0,n=0,o=0,a=0,l=0,u=0,c=0;if(c=or,or=or+560|0,n=c,i=c+40|0,u=c+16|0,r=0|jt[e+88>>2],a=(0|Yt[r+55>>0])<<8|0|Yt[r+56>>0],l=e+92|0,t=(0|jt[e+4>>2])+((0|Yt[r+50>>0])<<8|(0|Yt[r+49>>0])<<16|0|Yt[r+51>>0])|0,!(r=(0|Yt[r+53>>0])<<8|(0|Yt[r+52>>0])<<16|0|Yt[r+54>>0]))return u=0,or=c,0|u;jt[l>>2]=t,jt[e+96>>2]=t,jt[e+104>>2]=r,jt[e+100>>2]=t+r,jt[e+108>>2]=0,jt[e+112>>2]=0,jt[u+20>>2]=0,jt[u>>2]=0,jt[u+4>>2]=0,jt[u+8>>2]=0,jt[u+12>>2]=0,zt[u+16>>0]=0;e:do{if(0|s(l,u)){if(o=e+268|0,r=e+272|0,(0|(t=0|jt[r>>2]))!=(0|a)){if(t>>>0<=a>>>0){do{if((0|jt[e+276>>2])>>>0<a>>>0){if(0|A(o,a,(t+1|0)==(0|a),2,0)){t=0|jt[r>>2];break}zt[e+280>>0]=1,t=0;break e}}while(0);ee((0|jt[o>>2])+(t<<1)|0,0,a-t<<1|0)}jt[r>>2]=a}if(!a){jt[n>>2]=866,jt[n+4>>2]=910,jt[n+8>>2]=1497,Ve(i,812,n),he(i),t=1;break}for(r=0,e=0,i=0,t=0|jt[o>>2];;){if(o=0|C(l,u),i=o+i&255,e=(0|C(l,u))+e&255,Ht[t>>1]=e<<8|i,(r=r+1|0)>>>0>=a>>>0){t=1;break}t=t+2|0}}else t=0}while(0);return X(u),u=t,or=c,0|u}function A(e,t,r,i,n){e|=0,t|=0,r|=0,i|=0,n|=0;var o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0;if(f=or,or=or+576|0,d=f+48|0,l=f+32|0,a=f+16|0,o=f,c=f+64|0,h=f+60|0,u=e+4|0,p=e+8|0,(0|jt[u>>2])>>>0>(0|jt[p>>2])>>>0&&(jt[o>>2]=866,jt[o+4>>2]=2123,jt[o+8>>2]=845,Ve(c,812,o),he(c)),(2147418112/(i>>>0)|0)>>>0<=t>>>0&&(jt[a>>2]=866,jt[a+4>>2]=2124,jt[a+8>>2]=885,Ve(c,812,a),he(c)),(o=0|jt[p>>2])>>>0>=t>>>0)return p=1,or=f,0|p;if((r?0!=((s=t+-1|0)&t|0):0)?(t=s>>>16|s,t|=t>>>8,t|=t>>>4,t|=t>>>2,t=1+(t>>>1|t)|0,t?r=9:(t=0,r=10)):r=9,9==(0|r)&&t>>>0<=o>>>0&&(r=10),10==(0|r)&&(jt[l>>2]=866,jt[l+4>>2]=2133,jt[l+8>>2]=933,Ve(c,812,l),he(c)),s=0|dr(t,i),n)if(a=0|Q(s,h)){Mr[0&n](a,0|jt[e>>2],0|jt[u>>2]),o=0|jt[e>>2];do{if(0|o){if(7&o){jt[d>>2]=866,jt[d+4>>2]=2506,jt[d+8>>2]=1232,Ve(c,812,d),he(c);break}oe(o,0,0,1,0);break}}while(0);jt[e>>2]=a,r=20}else t=0;else o=0|J(0|jt[e>>2],s,h,1),o?(jt[e>>2]=o,r=20):t=0;return 20==(0|r)&&(o=0|jt[h>>2],o>>>0>s>>>0&&(t=(o>>>0)/(i>>>0)|0),jt[p>>2]=t,t=1),p=t,or=f,0|p}function E(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0;if(h=or,or=or+528|0,c=h,s=h+16|0,0==(0|e)|t>>>0<62)return p=0,or=h,0|p;if(!(l=0|Q(300,0)))return p=0,or=h,0|p;jt[l>>2]=519686845,jt[l+4>>2]=0,jt[l+8>>2]=0,u=l+88|0,r=l+136|0,i=l+160|0,n=l+184|0,o=l+208|0,a=l+232|0,d=l+252|0,jt[d>>2]=0,jt[d+4>>2]=0,jt[d+8>>2]=0,zt[d+12>>0]=0,d=l+268|0,jt[d>>2]=0,jt[d+4>>2]=0,jt[d+8>>2]=0,zt[d+12>>0]=0,d=l+284|0,jt[d>>2]=0,jt[d+4>>2]=0,jt[d+8>>2]=0,zt[d+12>>0]=0,d=u,p=d+44|0;do{jt[d>>2]=0,d=d+4|0}while((0|d)<(0|p));return zt[u+44>>0]=0,jt[r>>2]=0,jt[r+4>>2]=0,jt[r+8>>2]=0,jt[r+12>>2]=0,jt[r+16>>2]=0,zt[r+20>>0]=0,jt[i>>2]=0,jt[i+4>>2]=0,jt[i+8>>2]=0,jt[i+12>>2]=0,jt[i+16>>2]=0,zt[i+20>>0]=0,jt[n>>2]=0,jt[n+4>>2]=0,jt[n+8>>2]=0,jt[n+12>>2]=0,jt[n+16>>2]=0,zt[n+20>>0]=0,jt[o>>2]=0,jt[o+4>>2]=0,jt[o+8>>2]=0,jt[o+12>>2]=0,jt[o+16>>2]=0,zt[o+20>>0]=0,jt[a>>2]=0,jt[a+4>>2]=0,jt[a+8>>2]=0,jt[a+12>>2]=0,zt[a+16>>0]=0,0|H(l,e,t)?(p=l,or=h,0|p):(S(l),7&l?(jt[c>>2]=866,jt[c+4>>2]=2506,jt[c+8>>2]=1232,Ve(s,812,c),he(s),p=0,or=h,0|p):(oe(l,0,0,1,0),p=0,or=h,0|p))}function x(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0,a=0,s=0,l=0;switch(s=or,or=or+576|0,o=s+40|0,n=s+56|0,l=s,jt[l>>2]=40,U(e,t,l),i=(3+((0|jt[l+4>>2])>>>r)|0)>>>2,t=(3+((0|jt[l+8>>2])>>>r)|0)>>>2,r=l+32|0,e=0|jt[r+4>>2],0|jt[r>>2]){case 0:e?a=14:e=8;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:a=e?14:13;break;case 9:case 10:e?a=14:e=8;break;default:a=14}return 13==(0|a)?e=16:14==(0|a)&&(jt[o>>2]=866,jt[o+4>>2]=2672,jt[o+8>>2]=1251,Ve(n,812,o),he(n),e=0),l=0|dr(0|dr(t,i),e),or=s,0|l}function P(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0;switch(n=or,or=or+576|0,i=n+40|0,r=n+56|0,o=n,jt[o>>2]=40,U(e,t,o),t=o+32|0,e=0|jt[t+4>>2],0|jt[t>>2]){case 0:if(!e)return o=8,or=n,0|o;e=14;break;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:e=e?14:13;break;case 9:case 10:if(!e)return o=8,or=n,0|o;e=14;break;default:e=14}return 13==(0|e)?(o=16,or=n,0|o):14==(0|e)?(jt[i>>2]=866,jt[i+4>>2]=2672,jt[i+8>>2]=1251,Ve(r,812,i),he(r),o=0,or=n,0|o):0}function I(e,t,r,i,n,o,a){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0,a|=0;var s=0,l=0,d=0,p=0;if(p=0|jt[e+88>>2],l=(Yt[p+12>>0]<<8|Yt[p+13>>0])>>>a,d=(Yt[p+14>>0]<<8|Yt[p+15>>0])>>>a,l=((l>>>0>1?l:1)+3|0)>>>2,d=((d>>>0>1?d:1)+3|0)>>>2,p=p+18|0,a=0|zt[p>>0],a=0|dr(l,a<<24>>24==0|a<<24>>24==9?8:16),o){if(!(0==(3&o|0)&a>>>0<=o>>>0))return 0|(n=0);a=o}if((0|dr(a,d))>>>0>n>>>0)return 0|(n=0);if(o=(l+1|0)>>>1,s=(d+1|0)>>>1,!r)return 0|(n=0);switch(jt[e+92>>2]=t,jt[e+96>>2]=t,jt[e+104>>2]=r,jt[e+100>>2]=t+r,jt[e+108>>2]=0,jt[e+112>>2]=0,0|zt[p>>0]){case 0:if(!(0|u(e,i,n,a,l,d,o,s)))return 0|(n=0);break;case 4:case 6:case 5:case 3:case 2:if(!(0|h(e,i,n,a,l,d,o,s)))return 0|(n=0);break;case 9:if(!(0|g(e,i,n,a,l,d,o,s)))return 0|(n=0);break;case 8:case 7:if(!(0|c(e,i,n,a,l,d,o,s)))return 0|(n=0);break;default:return 0|(n=0)}return 0|(n=1)}function D(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0;if((0|r)>=8192)return 0|wr(0|e,0|t,0|r);if(o=0|e,n=e+r|0,(3&e)==(3&t)){for(;3&e;){if(!r)return 0|o;zt[e>>0]=0|zt[t>>0],e=e+1|0,t=t+1|0,r=r-1|0}for(r=-4&n|0,i=r-64|0;(0|e)<=(0|i);)jt[e>>2]=jt[t>>2],jt[e+4>>2]=jt[t+4>>2],jt[e+8>>2]=jt[t+8>>2],jt[e+12>>2]=jt[t+12>>2],jt[e+16>>2]=jt[t+16>>2],jt[e+20>>2]=jt[t+20>>2],jt[e+24>>2]=jt[t+24>>2],jt[e+28>>2]=jt[t+28>>2],jt[e+32>>2]=jt[t+32>>2],jt[e+36>>2]=jt[t+36>>2],jt[e+40>>2]=jt[t+40>>2],jt[e+44>>2]=jt[t+44>>2],jt[e+48>>2]=jt[t+48>>2],jt[e+52>>2]=jt[t+52>>2],jt[e+56>>2]=jt[t+56>>2],jt[e+60>>2]=jt[t+60>>2],e=e+64|0,t=t+64|0;for(;(0|e)<(0|r);)jt[e>>2]=jt[t>>2],e=e+4|0,t=t+4|0}else for(r=n-4|0;(0|e)<(0|r);)zt[e>>0]=0|zt[t>>0],zt[e+1>>0]=0|zt[t+1>>0],zt[e+2>>0]=0|zt[t+2>>0],zt[e+3>>0]=0|zt[t+3>>0],e=e+4|0,t=t+4|0;for(;(0|e)<(0|n);)zt[e>>0]=0|zt[t>>0],e=e+1|0,t=t+1|0;return 0|o}function O(e){e|=0;var t=0,r=0,i=0,n=0;if(n=e+92|0,i=e+88|0,r=0|jt[i>>2],t=(0|jt[e+4>>2])+((0|Yt[r+68>>0])<<8|(0|Yt[r+67>>0])<<16|0|Yt[r+69>>0])|0,!(r=(0|Yt[r+65>>0])<<8|0|Yt[r+66>>0]))return 0|(n=0);if(jt[n>>2]=t,jt[e+96>>2]=t,jt[e+104>>2]=r,jt[e+100>>2]=t+r,jt[e+108>>2]=0,jt[e+112>>2]=0,!(0|s(n,e+116|0)))return 0|(n=0);t=0|jt[i>>2];do{if((0|Yt[t+39>>0])<<8|0|Yt[t+40>>0]){if(!(0|s(n,e+140|0)))return 0|(n=0);if(0|s(n,e+188|0)){t=0|jt[i>>2];break}return 0|(n=0)}if(!((0|Yt[t+55>>0])<<8|0|Yt[t+56>>0]))return 0|(n=0)}while(0);if((0|Yt[t+55>>0])<<8|0|Yt[t+56>>0]|0){if(!(0|s(n,e+164|0)))return 0|(n=0);if(!(0|s(n,e+212|0)))return 0|(n=0)}return 0|(n=1)}function M(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0;d=or,or=or+48|0,u=d+16|0,o=d,n=d+32|0,s=e+28|0,i=0|jt[s>>2],jt[n>>2]=i,l=e+20|0,i=(0|jt[l>>2])-i|0,jt[n+4>>2]=i,jt[n+8>>2]=t,jt[n+12>>2]=r,i=i+r|0,a=e+60|0,jt[o>>2]=jt[a>>2],jt[o+4>>2]=n,jt[o+8>>2]=2,o=0|$e(0|xr(146,0|o));e:do{if((0|i)!=(0|o)){for(t=2;;){if((0|o)<0)break;if(i=i-o|0,p=0|jt[n+4>>2],h=o>>>0>p>>>0,n=h?n+8|0:n,t=(h<<31>>31)+t|0,p=o-(h?p:0)|0,jt[n>>2]=(0|jt[n>>2])+p,h=n+4|0,jt[h>>2]=(0|jt[h>>2])-p,jt[u>>2]=jt[a>>2],jt[u+4>>2]=n,jt[u+8>>2]=t,o=0|$e(0|xr(146,0|u)),(0|i)==(0|o)){c=3;break e}}jt[e+16>>2]=0,jt[s>>2]=0,jt[l>>2]=0,jt[e>>2]=32|jt[e>>2],r=2==(0|t)?0:r-(0|jt[n+4>>2])|0}else c=3}while(0);return 3==(0|c)&&(p=0|jt[e+44>>2],jt[e+16>>2]=p+(0|jt[e+48>>2]),jt[s>>2]=p,jt[l>>2]=p),or=d,0|r}function R(e,t,r,i,n){e|=0,t|=0,r|=0,i|=0,n|=0;var o=0,a=0,s=0,l=0;do{if(0|lt(e,0|jt[t+8>>2],n))Pe(0,t,r,i);else{if(o=e+8|0,!(0|lt(e,0|jt[t>>2],n))){s=0|jt[o>>2],Ir[3&jt[24+(0|jt[s>>2])>>2]](s,t,r,i,n);break}if(e=t+32|0,(0|jt[t+16>>2])!=(0|r)?(a=t+20|0,(0|jt[a>>2])!=(0|r)):0){if(jt[e>>2]=i,i=t+44|0,4==(0|jt[i>>2]))break;e=t+52|0,zt[e>>0]=0,l=t+53|0,zt[l>>0]=0,o=0|jt[o>>2],Lr[3&jt[20+(0|jt[o>>2])>>2]](o,t,r,r,1,n),0|zt[l>>0]?0|zt[e>>0]?e=3:(e=3,s=11):(e=4,s=11),11==(0|s)&&(jt[a>>2]=r,l=t+40|0,jt[l>>2]=1+(0|jt[l>>2]),(1==(0|jt[t+36>>2])?2==(0|jt[t+24>>2]):0)&&(zt[t+54>>0]=1)),jt[i>>2]=e;break}1==(0|i)&&(jt[e>>2]=1)}}while(0)}function L(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0,s=0,l=0,u=0,c=0,d=0,h=0,p=0,f=0,m=0,g=0;g=or,or=or+224|0,d=g+120|0,h=g+80|0,f=g,m=g+136|0,i=h,n=i+40|0;do{jt[i>>2]=0,i=i+4|0}while((0|i)<(0|n));return jt[d>>2]=jt[r>>2],(0|a(0,t,d,f,h))<0?r=-1:(p=(0|jt[e+76>>2])>-1?0|Nt(e):0,r=0|jt[e>>2],c=32&r,(0|zt[e+74>>0])<1&&(jt[e>>2]=-33&r),i=e+48|0,0|jt[i>>2]?r=0|a(e,t,d,f,h):(n=e+44|0,o=0|jt[n>>2],jt[n>>2]=m,s=e+28|0,jt[s>>2]=m,l=e+20|0,jt[l>>2]=m,jt[i>>2]=80,u=e+16|0,jt[u>>2]=m+80,r=0|a(e,t,d,f,h),o&&(Pr[7&jt[e+36>>2]](e,0,0),r=0==(0|jt[l>>2])?-1:r,jt[n>>2]=o,jt[i>>2]=0,jt[u>>2]=0,jt[s>>2]=0,jt[l>>2]=0)),i=0|jt[e>>2],jt[e>>2]=i|c,0|p&&Lt(e),r=0==(32&i|0)?r:-1),or=g,0|r}function N(e,t,r,i){e|=0,t|=0,r|=0,i|=0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0;h=or,or=or+64|0,c=h,u=0|jt[e>>2],d=e+(0|jt[u+-8>>2])|0,u=0|jt[u+-4>>2],jt[c>>2]=r,jt[c+4>>2]=e,jt[c+8>>2]=t,jt[c+12>>2]=i,e=c+16|0,t=c+20|0,i=c+24|0,n=c+28|0,o=c+32|0,a=c+40|0,s=e,l=s+36|0;do{jt[s>>2]=0,s=s+4|0}while((0|s)<(0|l));Ht[e+36>>1]=0,zt[e+38>>0]=0;e:do{if(0|lt(u,r,0))jt[c+48>>2]=1,Lr[3&jt[20+(0|jt[u>>2])>>2]](u,c,d,d,1,0),e=1==(0|jt[i>>2])?d:0;else{switch(Ir[3&jt[24+(0|jt[u>>2])>>2]](u,c,d,1,0),0|jt[c+36>>2]){case 0:e=1==(0|jt[a>>2])&1==(0|jt[n>>2])&1==(0|jt[o>>2])?0|jt[t>>2]:0;break e;case 1:break;default:e=0;break e}if(1!=(0|jt[i>>2])?!(0==(0|jt[a>>2])&1==(0|jt[n>>2])&1==(0|jt[o>>2])):0){e=0;break}e=0|jt[e>>2]}}while(0);return or=h,0|e}function k(e){e|=0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0;if(u=or,or=or+544|0,a=u+16|0,t=u,n=u+32|0,o=e+8|0,r=0|jt[o>>2],(r+-1|0)>>>0>=8192&&(jt[t>>2]=866,jt[t+4>>2]=3006,jt[t+8>>2]=1257,Ve(n,812,t),he(n)),jt[e>>2]=r,i=e+20|0,t=0|jt[i>>2],t?s=r:(t=0|Q(180,0),t?(s=t+164|0,jt[s>>2]=0,jt[s+4>>2]=0,jt[s+8>>2]=0,jt[s+12>>2]=0):t=0,jt[i>>2]=t,s=0|jt[e>>2]),0|jt[o>>2]?a=s:(jt[a>>2]=866,jt[a+4>>2]=910,jt[a+8>>2]=1497,Ve(n,812,a),he(n),a=0|jt[e>>2]),n=0|jt[e+4>>2],!(a>>>0>16))return e=0,e=0|l(t,s,n,e),or=u,0|e;for(r=a,i=0;;){if(o=i+1|0,!(r>>>0>3))break;r>>>=1,i=o}
return e=i+2+(32!=(0|o)&1<<o>>>0<a>>>0&1)|0,e=255&(e>>>0<11?e:11),e=0|l(t,s,n,e),or=u,0|e}function F(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0;h=1794895138+(0|jt[e>>2])|0,o=0|ut(0|jt[e+8>>2],h),i=0|ut(0|jt[e+12>>2],h),n=0|ut(0|jt[e+16>>2],h);e:do{if((o>>>0<t>>>2>>>0?(d=t-(o<<2)|0,i>>>0<d>>>0&n>>>0<d>>>0):0)?0==(3&(n|i)|0):0){for(d=i>>>2,c=n>>>2,u=0;;){if(s=o>>>1,l=u+s|0,a=l<<1,n=a+d|0,i=0|ut(0|jt[e+(n<<2)>>2],h),!((n=0|ut(0|jt[e+(n+1<<2)>>2],h))>>>0<t>>>0&i>>>0<(t-n|0)>>>0)){i=0;break e}if(0|zt[e+(n+i)>>0]){i=0;break e}if(!(i=0|ve(r,e+n|0)))break;if(i=(0|i)<0,1==(0|o)){i=0;break e}u=i?u:l,o=i?s:o-s|0}i=a+c|0,n=0|ut(0|jt[e+(i<<2)>>2],h),i=0|ut(0|jt[e+(i+1<<2)>>2],h),i=i>>>0<t>>>0&n>>>0<(t-i|0)>>>0&&0==(0|zt[e+(i+n)>>0])?e+i|0:0}else i=0}while(0);return 0|i}function B(e){e|=0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0;s=or,or=or+576|0,o=s+48|0,a=s+32|0,i=s+16|0,r=s,n=s+64|0,t=0|jt[e+168>>2];do{if(0|t){if(l=0|jt[t+-4>>2],t=t+-8|0,(0!=(0|l)?(0|l)==(0|~jt[t>>2]):0)||(jt[r>>2]=866,jt[r+4>>2]=651,jt[r+8>>2]=1579,Ve(n,812,r),he(n)),7&t){jt[i>>2]=866,jt[i+4>>2]=2506,jt[i+8>>2]=1232,Ve(n,812,i),he(n);break}oe(t,0,0,1,0);break}}while(0);return(t=0|jt[e+176>>2])?(l=0|jt[t+-4>>2],t=t+-8|0,(0!=(0|l)?(0|l)==(0|~jt[t>>2]):0)||(jt[a>>2]=866,jt[a+4>>2]=651,jt[a+8>>2]=1579,Ve(n,812,a),he(n)),7&t?(jt[o>>2]=866,jt[o+4>>2]=2506,jt[o+8>>2]=1232,Ve(n,812,o),he(n),void(or=s)):(oe(t,0,0,1,0),void(or=s))):void(or=s)}function U(e,t,r){e|=0,t|=0,r|=0;var i=0;return 0!=(0|e)&t>>>0>73&0!=(0|r)?40!=(0|jt[r>>2])?0|(r=0):18552!=((0|Yt[e>>0])<<8|0|Yt[e+1>>0]|0)?0|(r=0):((0|Yt[e+2>>0])<<8|0|Yt[e+3>>0])>>>0<74?0|(r=0):((0|Yt[e+7>>0])<<16|(0|Yt[e+6>>0])<<24|(0|Yt[e+8>>0])<<8|0|Yt[e+9>>0])>>>0>t>>>0?0|(r=0):(jt[r+4>>2]=(0|Yt[e+12>>0])<<8|0|Yt[e+13>>0],jt[r+8>>2]=(0|Yt[e+14>>0])<<8|0|Yt[e+15>>0],jt[r+12>>2]=Yt[e+16>>0],jt[r+16>>2]=Yt[e+17>>0],t=e+18|0,i=r+32|0,jt[i>>2]=Yt[t>>0],jt[i+4>>2]=0,t=0|zt[t>>0],jt[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16,jt[r+24>>2]=(0|Yt[e+26>>0])<<16|(0|Yt[e+25>>0])<<24|(0|Yt[e+27>>0])<<8|0|Yt[e+28>>0],jt[r+28>>2]=(0|Yt[e+30>>0])<<16|(0|Yt[e+29>>0])<<24|(0|Yt[e+31>>0])<<8|0|Yt[e+32>>0],0|(r=1)):0|(r=0)}function V(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0;if(u=or,or=or+544|0,s=u+16|0,r=u,a=u+32|0,t>>>0>=33&&(jt[r>>2]=866,jt[r+4>>2]=3199,jt[r+8>>2]=1350,Ve(a,812,r),he(a)),l=e+20|0,(0|(r=0|jt[l>>2]))>=(0|t))return n=e+16|0,o=n,n=0|jt[n>>2],a=r,s=32-t|0,s=n>>>s,n<<=t,jt[o>>2]=n,t=a-t|0,jt[l>>2]=t,or=u,0|s;n=e+4|0,o=e+8|0,i=e+16|0;do{e=0|jt[n>>2],(0|e)==(0|jt[o>>2])?e=0:(jt[n>>2]=e+1,e=0|Yt[e>>0]),r=r+8|0,jt[l>>2]=r,(0|r)>=33&&(jt[s>>2]=866,jt[s+4>>2]=3208,jt[s+8>>2]=1366,Ve(a,812,s),he(a),r=0|jt[l>>2]),e=e<<32-r|jt[i>>2],jt[i>>2]=e}while((0|r)<(0|t));return s=32-t|0,s=e>>>s,a=e<<t,jt[i>>2]=a,t=r-t|0,jt[l>>2]=t,or=u,0|s}function z(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0,a=0;o=255&t,i=0!=(0|r);e:do{if(i&0!=(3&e|0))for(n=255&t;;){if((0|zt[e>>0])==n<<24>>24){a=6;break e}if(e=e+1|0,r=r+-1|0,!((i=0!=(0|r))&0!=(3&e|0))){a=5;break}}else a=5}while(0);5==(0|a)&&(i?a=6:r=0);e:do{if(6==(0|a)&&(n=255&t,(0|zt[e>>0])!=n<<24>>24)){i=0|dr(o,16843009);t:do{if(r>>>0>3)for(;;){if((-2139062144&(o=jt[e>>2]^i)^-2139062144)&o+-16843009|0)break;if(e=e+4|0,(r=r+-4|0)>>>0<=3){a=11;break t}}else a=11}while(0);if(11==(0|a)&&!r){r=0;break}for(;;){if((0|zt[e>>0])==n<<24>>24)break e;if(e=e+1|0,!(r=r+-1|0)){r=0;break}}}}while(0);return 0|(0|r?e:0)}function G(e,t,r,i,n){e|=0,t|=0,r|=0,i|=0,n|=0;var o=0,a=0,s=0,l=0,u=0,c=0;return c=or,or=or+528|0,u=c,l=c+16|0,a=0|jt[e+88>>2],s=(0|Yt[a+70+(n<<2)+1>>0])<<16|(0|Yt[a+70+(n<<2)>>0])<<24|(0|Yt[a+70+(n<<2)+2>>0])<<8|0|Yt[a+70+(n<<2)+3>>0],o=n+1|0,(o=o>>>0<(0|Yt[a+16>>0])>>>0?(0|Yt[a+70+(o<<2)+1>>0])<<16|(0|Yt[a+70+(o<<2)>>0])<<24|(0|Yt[a+70+(o<<2)+2>>0])<<8|0|Yt[a+70+(o<<2)+3>>0]:0|jt[e+8>>2])>>>0>s>>>0?(l=e+4|0,l=0|jt[l>>2],l=l+s|0,u=o-s|0,u=0|I(e,l,u,t,r,i,n),or=c,0|u):(jt[u>>2]=866,jt[u+4>>2]=3694,jt[u+8>>2]=1508,Ve(l,812,u),he(l),l=e+4|0,l=0|jt[l>>2],l=l+s|0,u=o-s|0,u=0|I(e,l,u,t,r,i,n),or=c,0|u)}function H(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0;if(((0==(0|t)|r>>>0<74?0:18552==((0|Yt[t>>0])<<8|0|Yt[t+1>>0]|0))?((0|Yt[t+2>>0])<<8|0|Yt[t+3>>0])>>>0>=74:0)?((0|Yt[t+7>>0])<<16|(0|Yt[t+6>>0])<<24|(0|Yt[t+8>>0])<<8|0|Yt[t+9>>0])>>>0<=r>>>0:0){if(i=e+88|0,jt[i>>2]=t,jt[e+4>>2]=t,jt[e+8>>2]=r,!(0|O(e)))return 0|(n=0);if(t=0|jt[i>>2],(0|Yt[t+39>>0])<<8|0|Yt[t+40>>0]?(0|b(e)?0|m(e):0)&&(t=0|jt[i>>2],n=11):n=11,11==(0|n)){if(!((0|Yt[t+55>>0])<<8|0|Yt[t+56>>0]))return 0|(n=1);if(0|w(e)?0|f(e):0)return 0|(n=1)}return 0|(n=0)}return jt[e+88>>2]=0,0|(n=0)}function W(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0;if(u=or,or=or+528|0,a=u,o=u+16|0,!t)return l=0,or=u,0|l;if(t>>>0<=16)return l=0|V(e,t),or=u,0|l;if(s=0|V(e,t+-16|0),l=e+20|0,(0|(t=0|jt[l>>2]))<16){i=e+4|0,n=e+8|0,r=e+16|0;do{e=0|jt[i>>2],(0|e)==(0|jt[n>>2])?e=0:(jt[i>>2]=e+1,e=0|Yt[e>>0]),t=t+8|0,jt[l>>2]=t,(0|t)>=33&&(jt[a>>2]=866,jt[a+4>>2]=3208,jt[a+8>>2]=1366,Ve(o,812,a),he(o),t=0|jt[l>>2]),e=e<<32-t|jt[r>>2],jt[r>>2]=e}while((0|t)<16)}else e=e+16|0,r=e,e=0|jt[e>>2];return jt[r>>2]=e<<16,jt[l>>2]=t+-16,l=e>>>16|s<<16,or=u,0|l}function j(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0,a=0,s=0;i=r+16|0,n=0|jt[i>>2],n?o=5:0|_e(r)?i=0:(n=0|jt[i>>2],o=5);e:do{if(5==(0|o)){if(s=r+20|0,a=0|jt[s>>2],i=a,(n-a|0)>>>0<t>>>0){i=0|Pr[7&jt[r+36>>2]](r,e,t);break}t:do{if((0|zt[r+75>>0])>-1){for(a=t;;){if(!a){o=0,n=e;break t}if(n=a+-1|0,10==(0|zt[e+n>>0]))break;a=n}if((i=0|Pr[7&jt[r+36>>2]](r,e,a))>>>0<a>>>0)break e;o=a,n=e+a|0,t=t-a|0,i=0|jt[s>>2]}else o=0,n=e}while(0);D(0|i,0|n,0|t),jt[s>>2]=(0|jt[s>>2])+t,i=o+t|0}}while(0);return 0|i}function q(e,t,r){e|=0,t|=0,r|=0;do{if(e){if(t>>>0<128){zt[e>>0]=t,e=1;break}if(r=188+(0|xt())|0,!(0|jt[jt[r>>2]>>2])){if(57216==(-128&t|0)){zt[e>>0]=t,e=1;break}e=0|At(),jt[e>>2]=84,e=-1;break}if(t>>>0<2048){zt[e>>0]=t>>>6|192,zt[e+1>>0]=63&t|128,e=2;break}if(t>>>0<55296|57344==(-8192&t|0)){zt[e>>0]=t>>>12|224,zt[e+1>>0]=t>>>6&63|128,zt[e+2>>0]=63&t|128,e=3;break}if((t+-65536|0)>>>0<1048576){zt[e>>0]=t>>>18|240,zt[e+1>>0]=t>>>12&63|128,zt[e+2>>0]=t>>>6&63|128,zt[e+3>>0]=63&t|128,e=4;break}e=0|At(),jt[e>>2]=84,e=-1;break}e=1}while(0);return 0|e}function Y(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=or,or=or+48|0,a=n+32|0,r=n+24|0,s=n+16|0,o=n,n=n+36|0,e=0|ke(),(0|e?0|(i=0|jt[e>>2]):0)&&(e=i+48|0,t=0|jt[e>>2],e=0|jt[e+4>>2],1126902528==(-256&t|0)&1129074247==(0|e)||(jt[r>>2]=4168,je(4118,r)),e=1126902529==(0|t)&1129074247==(0|e)?0|jt[i+44>>2]:i+80|0,jt[n>>2]=e,i=0|jt[i>>2],e=0|jt[i+4>>2],0|Pr[7&jt[16+(0|jt[2])>>2]](8,i,n)?(s=0|jt[n>>2],s=0|Or[1&jt[8+(0|jt[s>>2])>>2]](s),jt[o>>2]=4168,jt[o+4>>2]=e,jt[o+8>>2]=s,je(4032,o)):(jt[s>>2]=4168,jt[s+4>>2]=e,je(4077,s))),je(4156,a)}function X(e){e|=0;var t=0,r=0,i=0,n=0,o=0;o=or,or=or+544|0,n=o+16|0,r=o,i=o+32|0,t=0|jt[e+20>>2];do{if(0|t){if(B(t),7&t){jt[r>>2]=866,jt[r+4>>2]=2506,jt[r+8>>2]=1232,Ve(i,812,r),he(i);break}oe(t,0,0,1,0);break}}while(0);if(t=e+4|0,!(r=0|jt[t>>2]))return n=e+16|0,zt[n>>0]=0,void(or=o);7&r?(jt[n>>2]=866,jt[n+4>>2]=2506,jt[n+8>>2]=1232,Ve(i,812,n),he(i)):oe(r,0,0,1,0),jt[t>>2]=0,jt[e+8>>2]=0,jt[e+12>>2]=0,n=e+16|0,zt[n>>0]=0,or=o}function Q(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;return l=or,or=or+560|0,s=l+32|0,a=l+16|0,r=l,o=l+48|0,n=l+44|0,i=e+3&-4,(i=0|i?i:4)>>>0>2147418112?(jt[r>>2]=866,jt[r+4>>2]=2506,jt[r+8>>2]=1103,Ve(o,812,r),he(o),s=0,or=l,0|s):(jt[n>>2]=i,e=0|oe(0,i,n,1,0),r=0|jt[n>>2],0|t&&(jt[t>>2]=r),0==(0|e)|r>>>0<i>>>0?(jt[a>>2]=866,jt[a+4>>2]=2506,jt[a+8>>2]=1129,Ve(o,812,a),he(o),e=0):7&e&&(jt[s>>2]=866,jt[s+4>>2]=2533,jt[s+8>>2]=1156,Ve(o,812,s),he(o)),s=e,or=l,0|s)}function Z(e){e|=0;var t=0,r=0,i=0,n=0,o=0,a=0;if(a=or,or=or+544|0,o=a+16|0,i=a,n=a+32|0,jt[e>>2]=0,t=e+4|0,r=0|jt[t>>2],0|r&&(7&r?(jt[i>>2]=866,jt[i+4>>2]=2506,jt[i+8>>2]=1232,Ve(n,812,i),he(n)):oe(r,0,0,1,0),jt[t>>2]=0,jt[e+8>>2]=0,jt[e+12>>2]=0),zt[e+16>>0]=0,e=e+20|0,!(t=0|jt[e>>2]))return void(or=a);B(t),7&t?(jt[o>>2]=866,jt[o+4>>2]=2506,jt[o+8>>2]=1232,Ve(n,812,o),he(n)):oe(t,0,0,1,0),jt[e>>2]=0,or=a}function K(e,t,r,i){e|=0,t|=0,r|=0,i|=0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0;c=or,or=or+128|0,n=c+124|0,u=c,o=u,a=604,s=o+124|0;do{jt[o>>2]=jt[a>>2],o=o+4|0,a=a+4|0}while((0|o)<(0|s));return(t+-1|0)>>>0>2147483646?t?(t=0|At(),jt[t>>2]=75,t=-1):(e=n,t=1,l=4):l=4,4==(0|l)&&(l=-2-e|0,l=t>>>0>l>>>0?l:t,jt[u+48>>2]=l,n=u+20|0,jt[n>>2]=e,jt[u+44>>2]=e,t=e+l|0,e=u+16|0,jt[e>>2]=t,jt[u+28>>2]=t,t=0|L(u,r,i),l&&(u=0|jt[n>>2],zt[u+(((0|u)==(0|jt[e>>2]))<<31>>31)>>0]=0)),or=c,0|t}function J(e,t,r,i){e|=0,t|=0,r|=0,i|=0;var n=0,o=0,a=0,s=0,l=0,u=0;return u=or,or=or+560|0,l=u+32|0,o=u+16|0,n=u,a=u+48|0,s=u+44|0,7&e|0?(jt[n>>2]=866,jt[n+4>>2]=2506,jt[n+8>>2]=1210,Ve(a,812,n),he(a),l=0,or=u,0|l):t>>>0>2147418112?(jt[o>>2]=866,jt[o+4>>2]=2506,jt[o+8>>2]=1103,Ve(a,812,o),he(a),l=0,or=u,0|l):(jt[s>>2]=t,e=0|oe(e,t,s,i,0),0|r&&(jt[r>>2]=jt[s>>2]),7&e|0&&(jt[l>>2]=866,jt[l+4>>2]=2558,jt[l+8>>2]=1156,Ve(a,812,l),he(a)),l=e,or=u,0|l)}function $(e,t,r,i,n){e|=0,t|=0,r|=0,i|=0,n|=0;var o=0;do{if(0|lt(e,0|jt[t+8>>2],n))Pe(0,t,r,i);else if(0|lt(e,0|jt[t>>2],n)){if(e=t+32|0,(0|jt[t+16>>2])!=(0|r)?(o=t+20|0,(0|jt[o>>2])!=(0|r)):0){jt[e>>2]=i,jt[o>>2]=r,i=t+40|0,jt[i>>2]=1+(0|jt[i>>2]),(1==(0|jt[t+36>>2])?2==(0|jt[t+24>>2]):0)&&(zt[t+54>>0]=1),jt[t+44>>2]=4;break}1==(0|i)&&(jt[e>>2]=1)}}while(0)}function ee(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0,a=0;if(o=e+r|0,t&=255,(0|r)>=67){for(;3&e;)zt[e>>0]=t,e=e+1|0;for(i=-4&o|0,n=i-64|0,a=t|t<<8|t<<16|t<<24;(0|e)<=(0|n);)jt[e>>2]=a,jt[e+4>>2]=a,jt[e+8>>2]=a,jt[e+12>>2]=a,jt[e+16>>2]=a,jt[e+20>>2]=a,jt[e+24>>2]=a,jt[e+28>>2]=a,jt[e+32>>2]=a,jt[e+36>>2]=a,jt[e+40>>2]=a,jt[e+44>>2]=a,jt[e+48>>2]=a,jt[e+52>>2]=a,jt[e+56>>2]=a,jt[e+60>>2]=a,e=e+64|0;for(;(0|e)<(0|i);)jt[e>>2]=a,e=e+4|0}for(;(0|e)<(0|o);)zt[e>>0]=t,e=e+1|0;return o-r|0}function te(e,t,r,i,n){e|=0,t|=0,r|=0,i|=0,n|=0;var o=0,a=0,s=0,l=0;zt[t+53>>0]=1;do{if((0|jt[t+4>>2])==(0|i)){if(zt[t+52>>0]=1,i=t+16|0,o=0|jt[i>>2],s=t+54|0,l=t+48|0,a=t+24|0,e=t+36|0,!o){if(jt[i>>2]=r,jt[a>>2]=n,jt[e>>2]=1,!(1==(0|jt[l>>2])&1==(0|n)))break;zt[s>>0]=1;break}if((0|o)!=(0|r)){jt[e>>2]=1+(0|jt[e>>2]),zt[s>>0]=1;break}e=0|jt[a>>2],2==(0|e)&&(jt[a>>2]=n,e=n),1==(0|jt[l>>2])&1==(0|e)&&(zt[s>>0]=1)}}while(0)}function re(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0,a=0;if(a=or,or=or+64|0,n=a,0|lt(e,t,0))t=1;else if(0!=(0|t)?0!=(0|(o=0|N(t,32,16,0))):0){t=n+4|0,i=t+52|0;do{jt[t>>2]=0,t=t+4|0}while((0|t)<(0|i));jt[n>>2]=o,jt[n+8>>2]=e,jt[n+12>>2]=-1,jt[n+48>>2]=1,Nr[3&jt[28+(0|jt[o>>2])>>2]](o,n,0|jt[r>>2],1),1==(0|jt[n+24>>2])?(jt[r>>2]=jt[n+16>>2],t=1):t=0}else t=0;return or=a,0|t}function ie(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=or,or=or+16|0,a=l,s=255&t,zt[a>>0]=s,i=e+16|0,n=0|jt[i>>2],n?o=4:0|_e(e)?r=-1:(n=0|jt[i>>2],o=4);do{if(4==(0|o)){if(o=e+20|0,i=0|jt[o>>2],i>>>0<n>>>0?(0|(r=255&t))!=(0|zt[e+75>>0]):0){jt[o>>2]=i+1,zt[i>>0]=s;break}r=1==(0|Pr[7&jt[e+36>>2]](e,a,1))?0|Yt[a>>0]:-1}}while(0);return or=l,0|r}function ne(e,t){e|=0,t|=0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;s=255&e,r=255&e,((0|jt[t+76>>2])>=0?0!=(0|Nt(t)):0)?(((0|r)!=(0|zt[t+75>>0])?(o=t+20|0,(a=0|jt[o>>2])>>>0<(0|jt[t+16>>2])>>>0):0)?(jt[o>>2]=a+1,zt[a>>0]=s):r=0|ie(t,e),Lt(t)):l=3;do{if(3==(0|l)){if((0|r)!=(0|zt[t+75>>0])?(i=t+20|0,(n=0|jt[i>>2])>>>0<(0|jt[t+16>>2])>>>0):0){jt[i>>2]=n+1,zt[n>>0]=s;break}r=0|ie(t,e)}}while(0);return 0|r}function oe(e,t,r,i,o){e|=0,t|=0,r|=0,i|=0,o|=0;do{if(e){if(!t){if(d(e),!r){t=0;break}jt[r>>2]=0,t=0;break}i?(t=0|ce(e,t),e=0==(0|t)?e:t):t=0,r&&(o=0|Ue(e),jt[r>>2]=o)}else t=0|n(t),r&&(e=t?0|Ue(t):0,jt[r>>2]=e)}while(0);return 0|t}function ae(e){e|=0;var t=0,r=0,i=0;i=e;e:do{if(3&i)for(t=i;;){if(!(0|zt[e>>0])){e=t;break e}if(e=e+1|0,!(3&(t=e))){r=4;break}}else r=4}while(0);if(4==(0|r)){for(;;){if((-2139062144&(t=0|jt[e>>2])^-2139062144)&t+-16843009)break;e=e+4|0}if((255&t)<<24>>24)do{e=e+1|0}while(0!=(0|zt[e>>0]))}return e-i|0}function se(e,t){e=+e,t|=0;var r=0,i=0,n=0;switch(tr[nr>>3]=e,r=0|jt[nr>>2],i=0|jt[nr+4>>2],2047&(n=0|We(0|r,0|i,52))){case 0:0!=e?(e=+se(0x10000000000000000*e,t),r=(0|jt[t>>2])-64|0):r=0,jt[t>>2]=r;break;case 2047:break;default:jt[t>>2]=(2047&n)-1022,jt[nr>>2]=r,jt[nr+4>>2]=-2146435073&i|1071644672,e=+tr[nr>>3]}return+e}function le(e,t){e|=0,t|=0;var r=0,i=0;for(i=0;;){if((0|Yt[2140+i>>0])==(0|e)){e=2;break}if(87==(0|(r=i+1|0))){r=2228,i=87,e=5;break}i=r}if(2==(0|e)&&(i?(r=2228,e=5):r=2228),5==(0|e))for(;;){do{e=r,r=r+1|0}while(0!=(0|zt[e>>0]));if(!(i=i+-1|0))break;e=5}return 0|bt(r,0|jt[t+20>>2])}function ue(e,t,r){e|=0,t|=0,r|=0;var i=0;if(t>>>0>0|0==(0|t)&e>>>0>4294967295){for(;;){if(i=0|Oe(0|e,0|t,10,0),r=r+-1|0,zt[r>>0]=255&i|48,i=e,e=0|ct(0|e,0|t,10,0),!(t>>>0>9|9==(0|t)&i>>>0>4294967295))break;t=cr}t=e}else t=e;if(t)for(;;){if(r=r+-1|0,zt[r>>0]=48|(t>>>0)%10,t>>>0<10)break;t=(t>>>0)/10|0}return 0|r}function ce(e,t){e|=0,t|=0;var r=0,i=0;return e?t>>>0>4294967231?(t=0|At(),jt[t>>2]=12,0|(t=0)):0|(r=0|v(e+-8|0,t>>>0<11?16:t+11&-8))?0|(t=r+8|0):(r=0|n(t))?(i=0|jt[e+-4>>2],i=(-8&i)-(0==(3&i|0)?8:4)|0,D(0|r,0|e,0|(i>>>0<t>>>0?i:t)),d(e),0|(t=r)):0|(t=0):0|(t=0|n(t))}function de(e,t,r,i){e|=0,t|=0,r|=0,i|=0;var n=0,o=0,a=0;e=t+16|0,n=0|jt[e>>2],o=t+36|0,a=t+24|0;do{if(n){if((0|n)!=(0|r)){jt[o>>2]=1+(0|jt[o>>2]),jt[a>>2]=2,zt[t+54>>0]=1;break}2==(0|jt[a>>2])&&(jt[a>>2]=i)}else jt[e>>2]=r,jt[a>>2]=i,jt[o>>2]=1}while(0)}function he(e){e|=0;var t=0,r=0,i=0,n=0;i=0|jt[119],n=(0|jt[i+76>>2])>-1?0|Nt(i):0;do{if((0|rt(e,i))<0)e=1;else{if(10!=(0|zt[i+75>>0])?(t=i+20|0,(r=0|jt[t>>2])>>>0<(0|jt[i+16>>2])>>>0):0){jt[t>>2]=r+1,zt[r>>0]=10,e=0;break}e=(0|ie(i,10))<0}}while(0);return 0|n&&Lt(i),e<<31>>31|0}function pe(e,t,r,i,n,o){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0,0|lt(e,0|jt[t+8>>2],o)?te(0,t,r,i,n):(e=0|jt[e+8>>2],Lr[3&jt[20+(0|jt[e>>2])>>2]](e,t,r,i,n,o))}function fe(e,t,r,i,n){e|=0,t|=0,r|=0,i|=0,n|=0;var o=0,a=0;if(a=or,or=or+256|0,o=a,(0|r)>(0|i)&0==(73728&n|0)){if(n=r-i|0,ee(0|o,0|t,0|(n>>>0<256?n:256)),n>>>0>255){t=r-i|0;do{it(e,o,256),n=n+-256|0}while(n>>>0>255);n=255&t}it(e,o,n)}or=a}function me(e,t,r,i){e|=0,t|=0,r|=0,i|=0,0|lt(e,0|jt[t+8>>2],0)?de(0,t,r,i):(e=0|jt[e+8>>2],Nr[3&jt[28+(0|jt[e>>2])>>2]](e,t,r,i))}function ge(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0,o=0;return n=or,or=or+32|0,o=n,i=n+20|0,jt[o>>2]=jt[e+60>>2],jt[o+4>>2]=0,jt[o+8>>2]=t,jt[o+12>>2]=i,jt[o+16>>2]=r,(0|$e(0|Er(140,0|o)))<0?(jt[i>>2]=-1,e=-1):e=0|jt[i>>2],or=n,0|e}function _e(e){e|=0;var t=0,r=0;return t=e+74|0,r=0|zt[t>>0],zt[t>>0]=r+255|r,t=0|jt[e>>2],8&t?(jt[e>>2]=32|t,e=-1):(jt[e+8>>2]=0,jt[e+4>>2]=0,r=0|jt[e+44>>2],jt[e+28>>2]=r,jt[e+20>>2]=r,jt[e+16>>2]=r+(0|jt[e+48>>2]),e=0),0|e}function ve(e,t){e|=0,t|=0;var r=0,i=0;if(r=0|zt[e>>0],i=0|zt[t>>0],r<<24>>24==0?1:r<<24>>24!=i<<24>>24)e=i;else{do{e=e+1|0,t=t+1|0,r=0|zt[e>>0],i=0|zt[t>>0]}while(!(r<<24>>24==0?1:r<<24>>24!=i<<24>>24));e=i}return(255&r)-(255&e)|0}function ye(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0;return n=or,or=or+32|0,i=n,jt[e+36>>2]=1,(0==(64&jt[e>>2]|0)?(jt[i>>2]=jt[e+60>>2],jt[i+4>>2]=21523,jt[i+8>>2]=n+16,0|vr(54,0|i)):0)&&(zt[e+75>>0]=-1),i=0|M(e,t,r),or=n,0|i}function be(e){e|=0;var t=0,r=0;return r=e+15&-16|0,t=0|jt[ir>>2],e=t+r|0,(0|r)>0&(0|e)<(0|t)|(0|e)<0?(gr(),Cr(12),-1):(jt[ir>>2]=e,((0|e)>(0|mr())?0==(0|fr()):0)?(jt[ir>>2]=t,Cr(12),-1):0|t)}function Ce(e,t,r,i){e|=0,t|=0,r|=0,i|=0;var n=0,o=0;return n=0|dr(r,t),r=0==(0|t)?0:r,(0|jt[i+76>>2])>-1?(o=0==(0|Nt(i)),e=0|j(e,n,i),o||Lt(i)):e=0|j(e,n,i),(0|e)!=(0|n)&&(r=(e>>>0)/(t>>>0)|0),0|r}function Se(e,t,r,i,n,o){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0,0|lt(e,0|jt[t+8>>2],o)&&te(0,t,r,i,n)}function Te(e,t,r,i){e|=0,t|=0,r|=0,i|=0,0|lt(e,0|jt[t+8>>2],0)&&de(0,t,r,i)}function we(e){e|=0;var t=0,r=0,i=0;if(r=0|jt[e>>2],(i=(0|zt[r>>0])-48|0)>>>0<10){t=0;do{t=i+(10*t|0)|0,r=r+1|0,jt[e>>2]=r,i=(0|zt[r>>0])-48|0}while(i>>>0<10)}else t=0;return 0|t}function Ae(e,t,r,i){if(e|=0,t|=0,r|=0,i|=0,!(0==(0|e)&0==(0|t)))do{r=r+-1|0,zt[r>>0]=0|Yt[2122+(15&e)>>0]|i,e=0|We(0|e,0|t,4),t=cr}while(!(0==(0|e)&0==(0|t)));return 0|r}function Ee(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0;return n=or,or=or+16|0,i=n,jt[i>>2]=jt[r>>2],e=0|Pr[7&jt[16+(0|jt[e>>2])>>2]](e,t,i),e&&(jt[r>>2]=jt[i>>2]),or=n,1&e|0}function xe(e){e|=0;var t=0;return(0|(t=0|zt[sr+(255&e)>>0]))<8?0|t:(0|(t=0|zt[sr+(e>>8&255)>>0]))<8?t+8|0:(t=0|zt[sr+(e>>16&255)>>0],(0|t)<8?t+16|0:24+(0|zt[sr+(e>>>24)>>0])|0)}function Pe(e,t,r,i){e|=0,t|=0,r|=0,i|=0;var n=0;((0|jt[t+4>>2])==(0|r)?(n=t+28|0,1!=(0|jt[n>>2])):0)&&(jt[n>>2]=i)}function Ie(e,t,r){if(e|=0,t|=0,r|=0,!(0==(0|e)&0==(0|t)))do{r=r+-1|0,zt[r>>0]=7&e|48,e=0|We(0|e,0|t,3),t=cr}while(!(0==(0|e)&0==(0|t)));return 0|r}function De(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0;return i=e+20|0,n=0|jt[i>>2],e=(0|jt[e+16>>2])-n|0,e=e>>>0>r>>>0?r:e,D(0|n,0|t,0|e),jt[i>>2]=(0|jt[i>>2])+e,0|r}function Oe(e,t,r,i){e|=0,t|=0,r|=0,i|=0;var n=0,o=0;return o=or,or=or+16|0,n=0|o,_(e,t,r,i,n),or=o,0|(cr=0|jt[n+4>>2],0|jt[n>>2])}function Me(e,t){e|=0,t|=0;var r=0,i=0;return i=or,or=or+48|0,r=i,jt[r>>2]=40,U(e,t,r),or=i,0|jt[r+32>>2]}function Re(e,t){e|=0,t|=0;var r=0,i=0;return i=or,or=or+48|0,r=i,jt[r>>2]=40,U(e,t,r),or=i,0|jt[r+12>>2]}function Le(e,t){e|=0,t|=0;var r=0,i=0;return i=or,or=or+48|0,r=i,jt[r>>2]=40,U(e,t,r),or=i,0|jt[r+8>>2]}function Ne(e,t){e|=0,t|=0;var r=0,i=0;return i=or,or=or+48|0,r=i,jt[r>>2]=40,U(e,t,r),or=i,0|jt[r+4>>2]}function ke(){var e=0,t=0;return e=or,or=or+16|0,0|Tr(5136,2)?(je(4307,e),0):(t=0|_r(0|jt[1285]),or=e,0|t)}function Fe(e){e|=0;var t=0,r=0;return t=or,or=or+16|0,r=t,e=0|Ot(0|jt[e+60>>2]),jt[r>>2]=e,e=0|$e(0|br(6,0|r)),or=t,0|e}function Be(e){e|=0;var t=0;if(t=or,or=or+16|0,d(e),!(0|yr(0|jt[1285],0)))return void(or=t);je(4406,t)}function Ue(e){e|=0;var t=0;return e?(t=0|jt[e+-4>>2],e=3&t,0|(1==(0|e)?0:(-8&t)-(0==(0|e)?8:4)|0)):0}function Ve(e,t,r){e|=0,t|=0,r|=0;var i=0,n=0;return i=or,or=or+16|0,n=i,jt[n>>2]=r,r=0|ft(e,t,n),or=i,0|r}function ze(e,t,r,i,n,o,a){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0,a|=0,Lr[3&e](0|t,0|r,0|i,0|n,0|o,0|a)}function Ge(){var e=0;if(e=or,or=or+16|0,!(0|Ar(5140,6)))return void(or=e);je(4356,e)}function He(e,t,r){return e|=0,t|=0,(0|(r|=0))<32?(cr=t<<r|(e&(1<<r)-1<<32-r)>>>32-r,e<<r):(cr=e<<r-32,0)}function We(e,t,r){return e|=0,t|=0,(0|(r|=0))<32?(cr=t>>>r,e>>>r|(t&(1<<r)-1)<<32-r):(cr=0,t>>>r-32|0)}function je(e,t){e|=0,t|=0;var r=0;r=or,or=or+16|0,jt[r>>2]=t,t=0|jt[26],L(t,e,r),ne(10,t),Sr()}function qe(){}function Ye(e,t,r,i){return e|=0,t|=0,r|=0,i|=0,i=t-i-(r>>>0>e>>>0|0)>>>0,0|(cr=i,e-r>>>0|0)}function Xe(e,t){return e|=0,t|=0,t=t?0|F(0|jt[t>>2],0|jt[t+4>>2],e):0,0|(0|t?t:e)}function Qe(e,t,r,i,n,o){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0,Ir[3&e](0|t,0|r,0|i,0|n,0|o)}function Ze(e){e=+e;var t=0;return tr[nr>>3]=e,t=0|jt[nr>>2],cr=0|jt[nr+4>>2],0|t}function Ke(e,t,r,i){return e|=0,t|=0,r|=0,i|=0,r=e+r>>>0,0|(cr=t+i+(r>>>0<e>>>0|0)>>>0,0|r)}function Je(e,t,r,i,n){e|=0,t|=0,r|=0,i|=0,n|=0,Nr[3&e](0|t,0|r,0|i,0|n)}function $e(e){e|=0;var t=0;return e>>>0>4294963200&&(t=0|At(),jt[t>>2]=0-e,e=-1),0|e}function et(e){return e|=0,1&(e=e?0!=(0|N(e,32,88,0)):0)|0}function tt(e,t,r,i){return e|=0,t|=0,r|=0,i|=0,0|Pr[7&e](0|t,0|r,0|i)}function rt(e,t){e|=0,t|=0;var r=0;return r=0|ae(e),((0|Ce(e,1,r,t))!=(0|r))<<31>>31|0}function it(e,t,r){e|=0,t|=0,r|=0,32&jt[e>>2]||j(t,r,e)}function nt(e,t,r,i){e|=0,t|=0,r|=0,i|=0,Mr[0&e](0|t,0|r,0|i)}function ot(e){e|=0;var t=0;return t=or,or=or+e|0,or=or+15&-16,0|t}function at(e){e|=0;var t=0;return t=188+(0|xt())|0,0|le(e,0|jt[t>>2])}function st(e,t){return e|=0,t|=0,0|(e=e?0|q(e,t,0):0)}function lt(e,t,r){return e|=0,t|=0,r|=0,(0|e)==(0|t)|0}function ut(e,t){e|=0,t|=0;var r=0;return r=0|dt(0|e),0|(0==(0|t)?e:r)}function ct(e,t,r,i){return e|=0,t|=0,r|=0,i|=0,0|_(e,t,r,i,0)}function dt(e){return(255&(e|=0))<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>>24|0}function ht(e,t,r,i,n,o){e|=0,t|=0,r|=0,i|=0,n|=0,o|=0,pr(6)}function pt(e,t){e|=0,t|=0,lr||(lr=e,ur=t)}function ft(e,t,r){return e|=0,t|=0,r|=0,0|K(e,2147483647,t,r)}function mt(e,t,r,i,n){e|=0,t|=0,r|=0,i|=0,n|=0,pr(1)}function gt(e){e|=0,Lt(e),It(e)}function _t(e,t){return e|=0,t|=0,0|Or[1&e](0|t)}function vt(e,t){e|=0,t|=0,or=e,ar=t}function yt(e,t,r,i){e|=0,t|=0,r|=0,i|=0,pr(7)}function bt(e,t){return e|=0,t|=0,0|Xe(e,t)}function Ct(e,t){e|=0,t|=0,Dr[7&e](0|t)}function St(e,t,r){return e|=0,t|=0,r|=0,pr(0),0}function Tt(e,t){return e=+e,t|=0,+ +se(e,t)}function wt(e,t,r){e|=0,t|=0,r|=0,pr(4)}function At(){return 64+(0|xt())|0}function Et(e){e|=0,Rr[3&e]()}function xt(){return 232}function Pt(e){e|=0,or=e}function It(e){e|=0,d(e)}function Dt(e){e|=0,cr=e}function Ot(e){return 0|(e|=0)}function Mt(){return 5072}function Rt(e){return e|=0,pr(3),0}function Lt(e){e|=0}function Nt(e){return e|=0,0}function kt(){return 0|cr}function Ft(){return 0|or}function Bt(e){e|=0,pr(2)}function Ut(){pr(5)}var Vt=e.Int8Array,zt=new Vt(r),Gt=e.Int16Array,Ht=new Gt(r),Wt=e.Int32Array,jt=new Wt(r),qt=e.Uint8Array,Yt=new qt(r),Xt=e.Uint16Array,Qt=new Xt(r),Zt=e.Uint32Array,Kt=new Zt(r),Jt=e.Float32Array,$t=new Jt(r),er=e.Float64Array,tr=new er(r),rr=e.byteLength,ir=0|t.DYNAMICTOP_PTR,nr=0|t.tempDoublePtr,or=(t.ABORT,0|t.STACKTOP),ar=0|t.STACK_MAX,sr=0|t.cttz_i8,lr=0,ur=0,cr=(e.NaN,e.Infinity,0),dr=(e.Math.floor,e.Math.abs,e.Math.sqrt,e.Math.pow,e.Math.cos,e.Math.sin,e.Math.tan,e.Math.acos,e.Math.asin,e.Math.atan,e.Math.atan2,e.Math.exp,e.Math.log,e.Math.ceil,e.Math.imul),hr=(e.Math.min,e.Math.max,e.Math.clz32),pr=t.abort,fr=(t.assert,t.enlargeMemory),mr=t.getTotalMemory,gr=t.abortOnCannotGrowMemory,_r=(t.invoke_iiii,t.invoke_viiiii,t.invoke_vi,t.invoke_ii,t.invoke_viii,t.invoke_v,t.invoke_viiiiii,t.invoke_viiii,t._pthread_getspecific),vr=t.___syscall54,yr=t._pthread_setspecific,br=(t.___gxx_personality_v0,t.___syscall6),Cr=t.___setErrNo,Sr=t._abort,Tr=(t.___cxa_begin_catch,t._pthread_once),wr=t._emscripten_memcpy_big,Ar=t._pthread_key_create,Er=t.___syscall140,xr=(t.___resumeException,t.___cxa_find_matching_catch,t.___syscall146),Pr=(t.__ZSt18uncaught_exceptionv,[St,M,ge,ye,De,re,St,St]),Ir=[mt,$,R,mt],Dr=[Bt,Lt,gt,Lt,Lt,gt,Be,Bt],Or=[Rt,Fe],Mr=[wt],Rr=[Ut,Y,Ge,Ut],Lr=[ht,Se,pe,ht],Nr=[yt,Te,me,yt];return{stackSave:Ft,_i64Subtract:Ye,_crn_get_bytes_per_block:P,setThrew:pt,dynCall_viii:nt,_bitshift64Lshr:We,_bitshift64Shl:He,dynCall_viiii:Je,setTempRet0:Dt,_crn_decompress:y,_memset:ee,_sbrk:be,_memcpy:D,stackAlloc:ot,_crn_get_height:Le,dynCall_vi:Ct,getTempRet0:kt,_crn_get_levels:Re,_crn_get_uncompressed_size:x,_i64Add:Ke,dynCall_iiii:tt,_emscripten_get_global_libc:Mt,dynCall_ii:_t,___udivdi3:ct,_llvm_bswap_i32:dt,dynCall_viiiii:Qe,___cxa_can_catch:Ee,_free:d,runPostSets:qe,dynCall_viiiiii:ze,establishStackSpace:vt,___uremdi3:Oe,___cxa_is_pointer_type:et,stackRestore:Pt,_malloc:n,_emscripten_replace_memory:i,dynCall_v:Et,_crn_get_width:Ne,_crn_get_dxt_format:Me}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),stackSave=Module.stackSave=asm.stackSave,getTempRet0=Module.getTempRet0=asm.getTempRet0,_memset=Module._memset=asm._memset,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,setTempRet0=Module.setTempRet0=asm.setTempRet0,_crn_decompress=Module._crn_decompress=asm._crn_decompress,_crn_get_bytes_per_block=Module._crn_get_bytes_per_block=asm._crn_get_bytes_per_block,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,_crn_get_height=Module._crn_get_height=asm._crn_get_height,_i64Subtract=Module._i64Subtract=asm._i64Subtract,_crn_get_levels=Module._crn_get_levels=asm._crn_get_levels,_crn_get_uncompressed_size=Module._crn_get_uncompressed_size=asm._crn_get_uncompressed_size,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,___udivdi3=Module.___udivdi3=asm.___udivdi3,_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,___cxa_can_catch=Module.___cxa_can_catch=asm.___cxa_can_catch,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,___uremdi3=Module.___uremdi3=asm.___uremdi3,___cxa_is_pointer_type=Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory,_crn_get_width=Module._crn_get_width=asm._crn_get_width,_crn_get_dxt_format=Module._crn_get_dxt_format=asm._crn_get_dxt_format,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){function t(){for(var e=0;e<3;e++)i.push(0)}e=e||[],ensureInitRuntime();var r=e.length+1,i=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];t();for(var n=0;n<r-1;n+=1)i.push(allocate(intArrayFromString(e[n]),"i8",ALLOC_NORMAL)),t();i.push(0),i=allocate(i,"i32",ALLOC_NORMAL);try{exit(Module._main(r,i,0),!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);var o=e;e&&"object"==typeof e&&e.stack&&(o=[e,e.stack]),Module.printErr("exception thrown: "+o),Module.quit(1,e)}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];if(Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),Module.noExitRuntime=!0,run(),Module}),define("ThirdParty/GltfPipeline/findAccessorMinMax",["./getAccessorByteStride","./numberOfComponentsForType","../../Core/arrayFill","../../Core/ComponentDatatype","../../Core/defined"],function(e,t,r,i,n){"use strict";function o(o,a){var s=o.bufferViews,l=o.buffers,u=a.bufferView,c=t(a.type),d=r(new Array(c),Number.POSITIVE_INFINITY),h=r(new Array(c),Number.NEGATIVE_INFINITY);if(n(u)&&n(s)&&s.hasOwnProperty(u)){var p=s[u],f=p.buffer;if(n(f)&&n(l)&&l.hasOwnProperty(f))for(var m=l[f],g=m.extras._pipeline.source,_=a.count,v=e(o,a),y=a.byteOffset+p.byteOffset,b=a.componentType,C=0;C<_;C++){for(var S=i.createArrayBufferView(b,g.buffer,y+g.byteOffset,c),T=0;T<c;T++){var w=S[T];d[T]=Math.min(d[T],w),h[T]=Math.max(h[T],w)}y+=v}}return{min:d,max:h}}return o}),define("ThirdParty/GltfPipeline/getJointCountForMaterials",["./ForEach","../../Core/defined"],function(e,t){"use strict";function r(r){var i=r.meshes,n={},o={};return e.node(r,function(e){t(e.skin)&&(t(o[e.skin])||(o[e.skin]=[]),o[e.skin].push(e))}),e.skin(r,function(r,a){for(var s=r.joints.length,l=function(e){n[e.material]=s},u=o[a],c=u.length,d=0;d<c;d++){var h=u[d],p=h.mesh;if(t(p)){var f=i[p];e.meshPrimitive(f,l)}}}),n}return r}),define("ThirdParty/GltfPipeline/removePipelineExtras",["../../Core/defined"],function(e){"use strict";function t(r){if(e(r)&&"object"==typeof r){e(r.extras)&&e(r.extras._pipeline)&&(delete r.extras._pipeline,0===Object.keys(r.extras).length&&delete r.extras);for(var i in r)r.hasOwnProperty(i)&&t(r[i])}return r}return t}),function(){!function(e){var t=this||(0,eval)("this"),r=t.document,i=t.navigator,n=t.jQuery,o=t.JSON;!function(e){"function"==typeof define&&define.amd?define("ThirdParty/knockout-3.4.2",["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:t.ko={})}(function(a,s){function l(e,t){return(null===e||typeof e in g)&&e===t}function u(t,r){var i;return function(){i||(i=m.a.setTimeout(function(){i=e,t()},r))}}function c(e,t){var r;return function(){clearTimeout(r),r=m.a.setTimeout(e,t)}}function d(e,t){t&&t!==_?"beforeChange"===t?this.Ob(e):this.Ja(e,t):this.Pb(e)}function h(e,t){null!==t&&t.k&&t.k()}function p(e,t){var r=this.Mc,i=r[S];i.T||(this.ob&&this.Oa[t]?(r.Sb(t,e,this.Oa[t]),this.Oa[t]=null,--this.ob):i.s[t]||r.Sb(t,e,i.t?{$:e}:r.yc(e)),e.Ha&&e.Hc())}function f(e,t,r,i){m.d[e]={init:function(e,n,o,a,s){var l,u;return m.m(function(){var o=n(),a=m.a.c(o),a=!r!=!a,c=!u;(c||t||a!==l)&&(c&&m.xa.Ca()&&(u=m.a.wa(m.f.childNodes(e),!0)),a?(c||m.f.fa(e,m.a.wa(u)),m.hb(i?i(s,o):s,e)):m.f.za(e),l=a)},null,{i:e}),{controlsDescendantBindings:!0}}},m.h.va[e]=!1,m.f.aa[e]=!0}var m=void 0!==a?a:{};m.b=function(e,t){for(var r=e.split("."),i=m,n=0;n<r.length-1;n++)i=i[r[n]];i[r[r.length-1]]=t},m.H=function(e,t,r){e[t]=r},m.version="3.4.2",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1},m.a=function(){function a(e,t){for(var r in e)e.hasOwnProperty(r)&&t(r,e[r])}function s(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function l(e,t){return e.__proto__=t,e}function u(e,t,r,i){var n=e[t].match(_)||[];m.a.r(r.match(_),function(e){m.a.ra(n,e,i)}),e[t]=n.join(" ")}var c={__proto__:[]}instanceof Array,d="function"==typeof Symbol,h={},p={};h[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],h.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),a(h,function(e,t){if(t.length)for(var r=0,i=t.length;r<i;r++)p[t[r]]=e});var f={propertychange:!0},g=r&&function(){for(var t=3,i=r.createElement("div"),n=i.getElementsByTagName("i");i.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",n[0];);return 4<t?t:e}(),_=/\S+/g;return{gc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],r:function(e,t){for(var r=0,i=e.length;r<i;r++)t(e[r],r)},o:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},Vb:function(e,t,r){for(var i=0,n=e.length;i<n;i++)if(t.call(r,e[i],i))return e[i];return null},Na:function(e,t){var r=m.a.o(e,t);0<r?e.splice(r,1):0===r&&e.shift()},Wb:function(e){e=e||[];for(var t=[],r=0,i=e.length;r<i;r++)0>m.a.o(t,e[r])&&t.push(e[r]);return t},ib:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;i<n;i++)r.push(t(e[i],i));return r},Ma:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;i<n;i++)t(e[i],i)&&r.push(e[i]);return r},ta:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var r=0,i=t.length;r<i;r++)e.push(t[r]);return e},ra:function(e,t,r){var i=m.a.o(m.a.Bb(e),t);0>i?r&&e.push(t):r||e.splice(i,1)},la:c,extend:s,$a:l,ab:c?l:s,D:a,Ea:function(e,t){if(!e)return e;var r,i={};for(r in e)e.hasOwnProperty(r)&&(i[r]=t(e[r],r,e));return i},rb:function(e){for(;e.firstChild;)m.removeNode(e.firstChild)},nc:function(e){e=m.a.W(e);for(var t=(e[0]&&e[0].ownerDocument||r).createElement("div"),i=0,n=e.length;i<n;i++)t.appendChild(m.ba(e[i]));return t},wa:function(e,t){for(var r=0,i=e.length,n=[];r<i;r++){var o=e[r].cloneNode(!0);n.push(t?m.ba(o):o)}return n},fa:function(e,t){if(m.a.rb(e),t)for(var r=0,i=t.length;r<i;r++)e.appendChild(t[r])},uc:function(e,t){var r=e.nodeType?[e]:e;if(0<r.length){for(var i=r[0],n=i.parentNode,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],i);for(o=0,a=r.length;o<a;o++)m.removeNode(r[o])}},Ba: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 r=e[0],i=e[e.length-1];for(e.length=0;r!==i;)e.push(r),r=r.nextSibling;e.push(i)}}return e},wc:function(e,t){7>g?e.setAttribute("selected",t):e.selected=t},
cb:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},sd:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},Rc: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},qb:function(e){return m.a.Rc(e,e.ownerDocument.documentElement)},Tb:function(e){return!!m.a.Vb(e,m.a.qb)},A:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Zb:function(e){return m.onError?function(){try{return e.apply(this,arguments)}catch(e){throw m.onError&&m.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(m.a.Zb(e),t)},dc:function(e){setTimeout(function(){throw m.onError&&m.onError(e),e},0)},q:function(e,t,r){var i=m.a.Zb(r);if(r=g&&f[t],m.options.useOnlyNativeEvents||r||!n)if(r||"function"!=typeof e.addEventListener){if(void 0===e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var o=function(t){i.call(e,t)},a="on"+t;e.attachEvent(a,o),m.a.G.qa(e,function(){e.detachEvent(a,o)})}else e.addEventListener(t,i,!1);else n(e).bind(t,i)},Fa:function(e,i){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var o;if("input"===m.a.A(e)&&e.type&&"click"==i.toLowerCase()?(o=e.type,o="checkbox"==o||"radio"==o):o=!1,m.options.useOnlyNativeEvents||!n||o)if("function"==typeof r.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");o=r.createEvent(p[i]||"HTMLEvents"),o.initEvent(i,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(o)}else if(o&&e.click)e.click();else{if(void 0===e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+i)}else n(e).trigger(i)},c:function(e){return m.I(e)?e():e},Bb:function(e){return m.I(e)?e.p():e},fb:function(e,t,r){var i;t&&("object"==typeof e.classList?(i=e.classList[r?"add":"remove"],m.a.r(t.match(_),function(t){i.call(e.classList,t)})):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,r):u(e,"className",t,r))},bb:function(t,r){var i=m.a.c(r);null!==i&&i!==e||(i="");var n=m.f.firstChild(t);!n||3!=n.nodeType||m.f.nextSibling(n)?m.f.fa(t,[t.ownerDocument.createTextNode(i)]):n.data=i,m.a.Wc(t)},vc:function(e,t){if(e.name=t,7>=g)try{e.mergeAttributes(r.createElement("<input name='"+e.name+"'/>"),!1)}catch(e){}},Wc:function(e){9<=g&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Sc:function(e){if(g){var t=e.style.width;e.style.width=0,e.style.width=t}},nd:function(e,t){e=m.a.c(e),t=m.a.c(t);for(var r=[],i=e;i<=t;i++)r.push(i);return r},W:function(e){for(var t=[],r=0,i=e.length;r<i;r++)t.push(e[r]);return t},bc:function(e){return d?Symbol(e):e},xd:6===g,yd:7===g,C:g,ic:function(e,t){for(var r=m.a.W(e.getElementsByTagName("input")).concat(m.a.W(e.getElementsByTagName("textarea"))),i="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=r.length-1;0<=o;o--)i(r[o])&&n.push(r[o]);return n},kd:function(e){return"string"==typeof e&&(e=m.a.cb(e))?o&&o.parse?o.parse(e):new Function("return "+e)():null},Gb:function(e,t,r){if(!o||!o.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 o.stringify(m.a.c(e),t,r)},ld:function(e,t,i){i=i||{};var n=i.params||{},o=i.includeFields||this.gc,s=e;if("object"==typeof e&&"form"===m.a.A(e))for(var s=e.action,l=o.length-1;0<=l;l--)for(var u=m.a.ic(e,o[l]),c=u.length-1;0<=c;c--)n[u[c].name]=u[c].value;t=m.a.c(t);var d=r.createElement("form");d.style.display="none",d.action=s,d.method="post";for(var h in t)e=r.createElement("input"),e.type="hidden",e.name=h,e.value=m.a.Gb(m.a.c(t[h])),d.appendChild(e);a(n,function(e,t){var i=r.createElement("input");i.type="hidden",i.name=e,i.value=t,d.appendChild(i)}),r.body.appendChild(d),i.submitter?i.submitter(d):d.submit(),setTimeout(function(){d.parentNode.removeChild(d)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.r),m.b("utils.arrayFirst",m.a.Vb),m.b("utils.arrayFilter",m.a.Ma),m.b("utils.arrayGetDistinctValues",m.a.Wb),m.b("utils.arrayIndexOf",m.a.o),m.b("utils.arrayMap",m.a.ib),m.b("utils.arrayPushAll",m.a.ta),m.b("utils.arrayRemoveItem",m.a.Na),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.gc),m.b("utils.getFormFields",m.a.ic),m.b("utils.peekObservable",m.a.Bb),m.b("utils.postJson",m.a.ld),m.b("utils.parseJson",m.a.kd),m.b("utils.registerEventHandler",m.a.q),m.b("utils.stringifyJson",m.a.Gb),m.b("utils.range",m.a.nd),m.b("utils.toggleDomNodeCssClass",m.a.fb),m.b("utils.triggerEvent",m.a.Fa),m.b("utils.unwrapObservable",m.a.c),m.b("utils.objectForEach",m.a.D),m.b("utils.addOrRemoveItem",m.a.ra),m.b("utils.setTextContent",m.a.bb),m.b("unwrap",m.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 r=Array.prototype.slice.call(arguments,1);return function(){var i=r.slice(0);return i.push.apply(i,arguments),t.apply(e,i)}}),m.a.e=new function(){function t(t,o){var a=t[i];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[i]="ko"+r++,n[a]={}}return n[a]}var r=0,i="__ko__"+(new Date).getTime(),n={};return{get:function(r,i){var n=t(r,!1);return n===e?e:n[i]},set:function(r,i,n){n===e&&t(r,!1)===e||(t(r,!0)[i]=n)},clear:function(e){var t=e[i];return!!t&&(delete n[t],e[i]=null,!0)},J:function(){return r+++i}}},m.b("utils.domData",m.a.e),m.b("utils.domData.clear",m.a.e.clear),m.a.G=new function(){function t(t,r){var n=m.a.e.get(t,i);return n===e&&r&&(n=[],m.a.e.set(t,i,n)),n}function r(e){var i=t(e,!1);if(i)for(var i=i.slice(0),n=0;n<i.length;n++)i[n](e);if(m.a.e.clear(e),m.a.G.cleanExternalData(e),a[e.nodeType])for(i=e.firstChild;e=i;)i=e.nextSibling,8===e.nodeType&&r(e)}var i=m.a.e.J(),o={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{qa:function(e,r){if("function"!=typeof r)throw Error("Callback must be a function");t(e,!0).push(r)},tc:function(r,n){var o=t(r,!1);o&&(m.a.Na(o,n),0==o.length&&m.a.e.set(r,i,e))},ba:function(e){if(o[e.nodeType]&&(r(e),a[e.nodeType])){var t=[];m.a.ta(t,e.getElementsByTagName("*"));for(var i=0,n=t.length;i<n;i++)r(t[i])}return e},removeNode:function(e){m.ba(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){n&&"function"==typeof n.cleanData&&n.cleanData([e])}}},m.ba=m.a.G.ba,m.removeNode=m.a.G.removeNode,m.b("cleanNode",m.ba),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.G),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.G.qa),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.G.tc),function(){var i=[0,"",""],o=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:o,tbody:o,tfoot:o,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},u=8>=m.a.C;m.a.na=function(e,o){var a;if(n){if(n.parseHTML)a=n.parseHTML(e,o)||[];else if((a=n.clean([e],o))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=o)||(a=r);var c,s=a.parentWindow||a.defaultView||t,d=m.a.cb(e).toLowerCase(),h=a.createElement("div");for(c=(d=d.match(/^<([a-z]+)[ >]/))&&l[d[1]]||i,d=c[0],c="ignored<div>"+c[1]+e+c[2]+"</div>","function"==typeof s.innerShiv?h.appendChild(s.innerShiv(c)):(u&&a.appendChild(h),h.innerHTML=c,u&&h.parentNode.removeChild(h));d--;)h=h.lastChild;a=m.a.W(h.lastChild.childNodes)}return a},m.a.Eb=function(t,r){if(m.a.rb(t),null!==(r=m.a.c(r))&&r!==e)if("string"!=typeof r&&(r=r.toString()),n)n(t).html(r);else for(var i=m.a.na(r,t.ownerDocument),o=0;o<i.length;o++)t.appendChild(i[o])}}(),m.b("utils.parseHtmlFragment",m.a.na),m.b("utils.setHtml",m.a.Eb),m.N=function(){function t(e,r){if(e)if(8==e.nodeType){var i=m.N.pc(e.nodeValue);null!=i&&r.push({Qc:e,hd:i})}else if(1==e.nodeType)for(var i=0,n=e.childNodes,o=n.length;i<o;i++)t(n[i],r)}var r={};return{yb: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 r[t]=e,"\x3c!--[ko_memo:"+t+"]--\x3e"},Bc:function(t,i){var n=r[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,i||[]),!0}finally{delete r[t]}},Cc:function(e,r){var i=[];t(e,i);for(var n=0,o=i.length;n<o;n++){var a=i[n].Qc,s=[a];r&&m.a.ta(s,r),m.N.Bc(i[n].hd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},pc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),m.b("memoization",m.N),m.b("memoization.memoize",m.N.yb),m.b("memoization.unmemoize",m.N.Bc),m.b("memoization.parseMemoText",m.N.pc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.N.Cc),m.Z=function(){function e(){if(o)for(var e,t=o,r=0;s<o;)if(e=n[s++]){if(s>t){if(5e3<=++r){s=o,m.a.dc(Error("'Too much recursion' after processing "+r+" task groups."));break}t=o}try{e()}catch(e){m.a.dc(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)},Za:function(e){return o||m.Z.scheduler(i),n[o++]=e,a++},cancel:function(e){(e-=a-o)>=s&&e<o&&(n[e]=null)},resetForTesting:function(){var e=o-s;return s=o=n.length=0,e},rd:e}}(),m.b("tasks",m.Z),m.b("tasks.schedule",m.Z.Za),m.b("tasks.runEarly",m.Z.rd),m.Aa={throttle:function(e,t){e.throttleEvaluation=t;var r=null;return m.B({read:e,write:function(i){clearTimeout(r),r=m.a.setTimeout(function(){e(i)},t)}})},rateLimit:function(e,t){var r,i,n;"number"==typeof t?r=t:(r=t.timeout,i=t.method),e.gb=!1,n="notifyWhenChangesStop"==i?c:u,e.Wa(function(e){return n(e,r)})},deferred:function(t,r){if(!0!==r)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.gb||(t.gb=!0,t.Wa(function(r){var i,n=!1;return function(){if(!n){m.Z.cancel(i),i=m.Z.Za(r);try{n=!0,t.notifySubscribers(e,"dirty")}finally{n=!1}}}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var g={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Aa),m.zc=function(e,t,r){this.$=e,this.jb=t,this.Pc=r,this.T=!1,m.H(this,"dispose",this.k)},m.zc.prototype.k=function(){this.T=!0,this.Pc()},m.K=function(){m.a.ab(this,v),v.ub(this)};var _="change",v={ub:function(e){e.F={change:[]},e.Qb=1},Y:function(e,t,r){var i=this;r=r||_;var n=new m.zc(i,t?e.bind(t):e,function(){m.a.Na(i.F[r],n),i.Ka&&i.Ka(r)});return i.ua&&i.ua(r),i.F[r]||(i.F[r]=[]),i.F[r].push(n),n},notifySubscribers:function(e,t){if(t=t||_,t===_&&this.Kb(),this.Ra(t)){var r=t===_&&this.Fc||this.F[t].slice(0);try{m.l.Xb();for(var i,n=0;i=r[n];++n)i.T||i.jb(e)}finally{m.l.end()}}},Pa:function(){return this.Qb},Zc:function(e){return this.Pa()!==e},Kb:function(){++this.Qb},Wa:function(e){var t,r,i,n,o=this,a=m.I(o);o.Ja||(o.Ja=o.notifySubscribers,o.notifySubscribers=d);var s=e(function(){o.Ha=!1,a&&n===o&&(n=o.Mb?o.Mb():o());var e=r||o.Ua(i,n);r=t=!1,e&&o.Ja(i=n)});o.Pb=function(e){o.Fc=o.F[_].slice(0),o.Ha=t=!0,n=e,s()},o.Ob=function(e){t||(i=e,o.Ja(e,"beforeChange"))},o.Hc=function(){o.Ua(i,o.p(!0))&&(r=!0)}},Ra:function(e){return this.F[e]&&this.F[e].length},Xc:function(e){if(e)return this.F[e]&&this.F[e].length||0;var t=0;return m.a.D(this.F,function(e,r){"dirty"!==e&&(t+=r.length)}),t},Ua:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&m.a.D(e,function(e,r){var i=m.Aa[e];"function"==typeof i&&(t=i(t,r)||t)}),t}};m.H(v,"subscribe",v.Y),m.H(v,"extend",v.extend),m.H(v,"getSubscriptionsCount",v.Xc),m.a.la&&m.a.$a(v,Function.prototype),m.K.fn=v,m.lc=function(e){return null!=e&&"function"==typeof e.Y&&"function"==typeof e.notifySubscribers},m.b("subscribable",m.K),m.b("isSubscribable",m.lc),m.xa=m.l=function(){function e(e){i.push(r),r=e}function t(){r=i.pop()}var r,i=[],n=0;return{Xb:e,end:t,sc:function(e){if(r){if(!m.lc(e))throw Error("Only subscribable things can act as dependencies");r.jb.call(r.Lc,e,e.Gc||(e.Gc=++n))}},w:function(r,i,n){try{return e(),r.apply(i,n||[])}finally{t()}},Ca:function(){if(r)return r.m.Ca()},Va:function(){if(r)return r.Va}}}(),m.b("computedContext",m.xa),m.b("computedContext.getDependenciesCount",m.xa.Ca),m.b("computedContext.isInitial",m.xa.Va),m.b("ignoreDependencies",m.wd=m.l.w);var y=m.a.bc("_latestValue");m.O=function(e){function t(){return 0<arguments.length?(t.Ua(t[y],arguments[0])&&(t.ia(),t[y]=arguments[0],t.ha()),this):(m.l.sc(t),t[y])}return t[y]=e,m.a.la||m.a.extend(t,m.K.fn),m.K.fn.ub(t),m.a.ab(t,b),m.options.deferUpdates&&m.Aa.deferred(t,!0),t};var b={equalityComparer:l,p:function(){return this[y]},ha:function(){this.notifySubscribers(this[y])},ia:function(){this.notifySubscribers(this[y],"beforeChange")}};m.a.la&&m.a.$a(b,m.K.fn);var C=m.O.md="__ko_proto__";b[C]=m.O,m.Qa=function(t,r){return null!==t&&t!==e&&t[C]!==e&&(t[C]===r||m.Qa(t[C],r))},m.I=function(e){return m.Qa(e,m.O)},m.Da=function(e){return!!("function"==typeof e&&e[C]===m.O||"function"==typeof e&&e[C]===m.B&&e.$c)},m.b("observable",m.O),m.b("isObservable",m.I),m.b("isWriteableObservable",m.Da),m.b("isWritableObservable",m.Da),m.b("observable.fn",b),m.H(b,"peek",b.p),m.H(b,"valueHasMutated",b.ha),m.H(b,"valueWillMutate",b.ia),m.ma=function(e){if("object"!=typeof(e=e||[])||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=m.O(e),m.a.ab(e,m.ma.fn),e.extend({trackArrayChanges:!0})},m.ma.fn={remove:function(e){for(var t=this.p(),r=[],i="function"!=typeof e||m.I(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];i(o)&&(0===r.length&&this.ia(),r.push(o),t.splice(n,1),n--)}return r.length&&this.ha(),r},removeAll:function(t){if(t===e){var r=this.p(),i=r.slice(0);return this.ia(),r.splice(0,r.length),this.ha(),i}return t?this.remove(function(e){return 0<=m.a.o(t,e)}):[]},destroy:function(e){var t=this.p(),r="function"!=typeof e||m.I(e)?function(t){return t===e}:e;this.ia();for(var i=t.length-1;0<=i;i--)r(t[i])&&(t[i]._destroy=!0);this.ha()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=m.a.o(t,e)}):[]},indexOf:function(e){var t=this();return m.a.o(t,e)},replace:function(e,t){var r=this.indexOf(e);0<=r&&(this.ia(),this.p()[r]=t,this.ha())}},m.a.la&&m.a.$a(m.ma.fn,m.O.fn),m.a.r("pop push reverse shift sort splice unshift".split(" "),function(e){m.ma.fn[e]=function(){var t=this.p();this.ia(),this.Yb(t,e,arguments);var r=t[e].apply(t,arguments);return this.ha(),r===t?this:r}}),m.a.r(["slice"],function(e){m.ma.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),m.b("observableArray",m.ma),m.Aa.trackArrayChanges=function(t,r){function i(){if(!a){a=!0,o=t.notifySubscribers,t.notifySubscribers=function(e,t){return t&&t!==_||++l,o.apply(this,arguments)};var e=[].concat(t.p()||[]);s=null,n=t.Y(function(r){if(r=[].concat(r||[]),t.Ra("arrayChange")){var i;(!s||1<l)&&(s=m.a.lb(e,r,t.kb)),i=s}e=r,s=null,l=0,i&&i.length&&t.notifySubscribers(i,"arrayChange")})}}if(t.kb={},r&&"object"==typeof r&&m.a.extend(t.kb,r),t.kb.sparse=!0,!t.Yb){var n,o,a=!1,s=null,l=0,u=t.ua,c=t.Ka;t.ua=function(e){u&&u.call(t,e),"arrayChange"===e&&i()},t.Ka=function(r){c&&c.call(t,r),"arrayChange"!==r||t.Ra("arrayChange")||(o&&(t.notifySubscribers=o,o=e),n.k(),a=!1)},t.Yb=function(e,t,r){function i(e,t,r){return n[n.length]={status:e,value:t,index:r}}if(a&&!l){var n=[],o=e.length,u=r.length,c=0;switch(t){case"push":c=o;case"unshift":for(t=0;t<u;t++)i("added",r[t],c+t);break;case"pop":c=o-1;case"shift":o&&i("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>r[0]?o+r[0]:r[0]),o);for(var o=1===u?o:Math.min(t+(r[1]||0),o),u=t+u-2,c=Math.max(o,u),d=[],h=[],p=2;t<c;++t,++p)t<o&&h.push(i("deleted",e[t],t)),t<u&&d.push(i("added",r[p],t));m.a.hc(h,d);break;default:return}s=n}}}};var S=m.a.bc("_state");m.m=m.B=function(t,r,i){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.sb,arguments),this}return m.l.sc(n),(a.V||a.t&&n.Sa())&&n.U(),a.M}if("object"==typeof t?i=t:(i=i||{},t&&(i.read=t)),"function"!=typeof i.read)throw Error("Pass a function that returns the value of the ko.computed");var o=i.write,a={M:e,da:!0,V:!0,Ta:!1,Hb:!1,T:!1,Ya:!1,t:!1,od:i.read,sb:r||i.owner,i:i.disposeWhenNodeIsRemoved||i.i||null,ya:i.disposeWhen||i.ya,pb:null,s:{},L:0,fc:null};return n[S]=a,n.$c="function"==typeof o,m.a.la||m.a.extend(n,m.K.fn),m.K.fn.ub(n),m.a.ab(n,T),i.pure?(a.Ya=!0,a.t=!0,m.a.extend(n,w)):i.deferEvaluation&&m.a.extend(n,A),m.options.deferUpdates&&m.Aa.deferred(n,!0),a.i&&(a.Hb=!0,a.i.nodeType||(a.i=null)),a.t||i.deferEvaluation||n.U(),a.i&&n.ca()&&m.a.G.qa(a.i,a.pb=function(){n.k()}),n};var T={equalityComparer:l,Ca:function(){return this[S].L},Sb:function(e,t,r){if(this[S].Ya&&t===this)throw Error("A 'pure' computed must not be called recursively");this[S].s[e]=r,r.Ia=this[S].L++,r.pa=t.Pa()},Sa:function(){var e,t,r=this[S].s;for(e in r)if(r.hasOwnProperty(e)&&(t=r[e],this.oa&&t.$.Ha||t.$.Zc(t.pa)))return!0},gd:function(){this.oa&&!this[S].Ta&&this.oa(!1)},ca:function(){var e=this[S];return e.V||0<e.L},qd:function(){this.Ha?this[S].V&&(this[S].da=!0):this.ec()},yc:function(e){if(e.gb&&!this[S].i){var t=e.Y(this.gd,this,"dirty"),r=e.Y(this.qd,this);return{$:e,k:function(){t.k(),r.k()}}}return e.Y(this.ec,this)},ec:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[S].fc),this[S].fc=m.a.setTimeout(function(){e.U(!0)},t)):e.oa?e.oa(!0):e.U(!0)},U:function(e){var t=this[S],r=t.ya,i=!1;if(!t.Ta&&!t.T){if(t.i&&!m.a.qb(t.i)||r&&r()){if(!t.Hb)return void this.k()}else t.Hb=!1;t.Ta=!0;try{i=this.Vc(e)}finally{t.Ta=!1}return t.L||this.k(),i}},Vc:function(t){var r=this[S],i=!1,n=r.Ya?e:!r.L,o={Mc:this,Oa:r.s,ob:r.L};return m.l.Xb({Lc:o,jb:p,m:this,Va:n}),r.s={},r.L=0,o=this.Uc(r,o),this.Ua(r.M,o)&&(r.t||this.notifySubscribers(r.M,"beforeChange"),r.M=o,r.t?this.Kb():t&&this.notifySubscribers(r.M),i=!0),n&&this.notifySubscribers(r.M,"awake"),i},Uc:function(e,t){try{var r=e.od;return e.sb?r.call(e.sb):r()}finally{m.l.end(),t.ob&&!e.t&&m.a.D(t.Oa,h),e.da=e.V=!1}},p:function(e){var t=this[S];return(t.V&&(e||!t.L)||t.t&&this.Sa())&&this.U(),t.M},Wa:function(e){m.K.fn.Wa.call(this,e),this.Mb=function(){return this[S].da?this.U():this[S].V=!1,this[S].M},this.oa=function(e){this.Ob(this[S].M),this[S].V=!0,e&&(this[S].da=!0),this.Pb(this)}},k:function(){var e=this[S];!e.t&&e.s&&m.a.D(e.s,function(e,t){t.k&&t.k()}),e.i&&e.pb&&m.a.G.tc(e.i,e.pb),e.s=null,e.L=0,e.T=!0,e.da=!1,e.V=!1,e.t=!1,e.i=null}},w={ua:function(e){var t=this,r=t[S];if(!r.T&&r.t&&"change"==e){if(r.t=!1,r.da||t.Sa())r.s=null,r.L=0,t.U()&&t.Kb();else{var i=[];m.a.D(r.s,function(e,t){i[t.Ia]=e}),m.a.r(i,function(e,i){var n=r.s[e],o=t.yc(n.$);o.Ia=i,o.pa=n.pa,r.s[e]=o})}r.T||t.notifySubscribers(r.M,"awake")}},Ka:function(t){var r=this[S];r.T||"change"!=t||this.Ra("change")||(m.a.D(r.s,function(e,t){t.k&&(r.s[e]={$:t.$,Ia:t.Ia,pa:t.pa},t.k())}),r.t=!0,this.notifySubscribers(e,"asleep"))},Pa:function(){var e=this[S];return e.t&&(e.da||this.Sa())&&this.U(),m.K.fn.Pa.call(this)}},A={ua:function(e){"change"!=e&&"beforeChange"!=e||this.p()}};m.a.la&&m.a.$a(T,m.K.fn);var E=m.O.md;m.m[E]=m.O,T[E]=m.m,m.bd=function(e){return m.Qa(e,m.m)},m.cd=function(e){return m.Qa(e,m.m)&&e[S]&&e[S].Ya},m.b("computed",m.m),m.b("dependentObservable",m.m),m.b("isComputed",m.bd),m.b("isPureComputed",m.cd),m.b("computed.fn",T),m.H(T,"peek",T.p),m.H(T,"dispose",T.k),m.H(T,"isActive",T.ca),m.H(T,"getDependenciesCount",T.Ca),m.rc=function(e,t){return"function"==typeof e?m.m(e,t,{pure:!0}):(e=m.a.extend({},e),e.pure=!0,m.m(e,t))},m.b("pureComputed",m.rc),function(){function t(n,o,a){if(a=a||new i,"object"!=typeof(n=o(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),r(n,function(r){var i=o(n[r]);switch(typeof i){case"boolean":case"number":case"string":case"function":s[r]=i;break;case"object":case"undefined":var l=a.get(i);s[r]=l!==e?l:t(i,o,a)}}),s}function r(e,t){if(e instanceof Array){for(var r=0;r<e.length;r++)t(r);"function"==typeof e.toJSON&&t("toJSON")}else for(r in e)t(r)}function i(){this.keys=[],this.Lb=[]}m.Ac=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;m.I(e)&&10>t;t++)e=e();return e})},m.toJSON=function(e,t,r){return e=m.Ac(e),m.a.Gb(e,t,r)},i.prototype={save:function(e,t){var r=m.a.o(this.keys,e);0<=r?this.Lb[r]=t:(this.keys.push(e),this.Lb.push(t))},get:function(t){return t=m.a.o(this.keys,t),0<=t?this.Lb[t]:e}}}(),m.b("toJS",m.Ac),m.b("toJSON",m.toJSON),function(){m.j={u:function(t){switch(m.a.A(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?m.a.e.get(t,m.d.options.zb):7>=m.a.C?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?m.j.u(t.options[t.selectedIndex]):e;default:return t.value}},ja:function(t,r,i){switch(m.a.A(t)){case"option":switch(typeof r){case"string":m.a.e.set(t,m.d.options.zb,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=r;break;default:m.a.e.set(t,m.d.options.zb,r),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof r?r:""}break;case"select":""!==r&&null!==r||(r=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if((n=m.j.u(t.options[a]))==r||""==n&&r===e){o=a;break}(i||0<=o||r===e&&1<t.size)&&(t.selectedIndex=o);break;default:null!==r&&r!==e||(r=""),t.value=r}}}}(),m.b("selectExtensions",m.j),m.b("selectExtensions.readValue",m.j.u),m.b("selectExtensions.writeValue",m.j.ja),m.h=function(){function e(e){e=m.a.cb(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,r=[],a=e.match(i),s=[],l=0;if(a){a.push(",");for(var u,c=0;u=a[c];++c){var d=u.charCodeAt(0);if(44===d){if(0>=l){r.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===d){if(!l&&!t&&1===s.length){t=s.pop();continue}}else 47===d&&c&&1<u.length?(d=a[c-1].match(n))&&!o[d[0]]&&(e=e.substr(e.indexOf(u)+1),a=e.match(i),a.push(","),c=-1,u="/"):40===d||123===d||91===d?++l:41===d||125===d||93===d?--l:t||s.length||34!==d&&39!==d||(u=u.slice(1,-1));s.push(u)}}return r}var t=["true","false","null","undefined"],r=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,i=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{va:[],ga:a,Ab:e,Xa:function(i,n){function o(e,i){var n;if(!c){var d=m.getBindingHandler(e);if(d&&d.preprocess&&!(i=d.preprocess(i,e,o)))return;(d=a[e])&&(n=i,0<=m.a.o(t,n)?n=!1:(d=n.match(r),n=null!==d&&(d[1]?"Object("+d[1]+")"+d[2]:n)),d=n),d&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(i="function(){return "+i+" }"),s.push("'"+e+"':"+i)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,d="string"==typeof i?e(i):i;return m.a.r(d,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},fd:function(e,t){for(var r=0;r<e.length;r++)if(e[r].key==t)return!0;return!1},Ga:function(e,t,r,i,n){e&&m.I(e)?!m.Da(e)||n&&e.p()===i||e(i):(e=t.get("_ko_property_writers"))&&e[r]&&e[r](i)}}}(),m.b("expressionRewriting",m.h),m.b("expressionRewriting.bindingRewriteValidators",m.h.va),m.b("expressionRewriting.parseObjectLiteral",m.h.Ab),m.b("expressionRewriting.preProcessBindings",m.h.Xa),m.b("expressionRewriting._twoWayBindings",m.h.ga),m.b("jsonExpressionRewriting",m.h),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.h.Xa),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(r,i){for(var n=r,o=1,a=[];n=n.nextSibling;){if(t(n)&&0===--o)return a;a.push(n),e(n)&&o++}if(!i)throw Error("Cannot find closing comment tag to match: "+r.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&&"\x3c!--test--\x3e"===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};m.f={aa:{},childNodes:function(t){return e(t)?i(t):t.childNodes},za:function(t){if(e(t)){t=m.f.childNodes(t);for(var r=0,i=t.length;r<i;r++)m.removeNode(t[r])}else m.a.rb(t)},fa:function(t,r){if(e(t)){m.f.za(t);for(var i=t.nextSibling,n=0,o=r.length;n<o;n++)i.parentNode.insertBefore(r[n],i)}else m.a.fa(t,r)},qc:function(t,r){e(t)?t.parentNode.insertBefore(r,t.nextSibling):t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)},kc:function(t,r,i){i?e(t)?t.parentNode.insertBefore(r,i.nextSibling):i.nextSibling?t.insertBefore(r,i.nextSibling):t.appendChild(r):m.f.qc(t,r)},firstChild:function(r){return e(r)?!r.nextSibling||t(r.nextSibling)?null:r.nextSibling:r.firstChild},nextSibling:function(r){return e(r)&&(r=n(r)),r.nextSibling&&t(r.nextSibling)?null:r.nextSibling},Yc:e,vd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},oc:function(r){if(l[m.a.A(r)]){var i=r.firstChild;if(i)do{if(1===i.nodeType){var o;o=i.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=i.nextSibling,s=0;s<o.length;s++)a?r.insertBefore(o[s],a):r.appendChild(o[s])}}while(i=i.nextSibling)}}}}(),m.b("virtualElements",m.f),m.b("virtualElements.allowedBindings",m.f.aa),m.b("virtualElements.emptyNode",m.f.za),m.b("virtualElements.insertAfter",m.f.kc),m.b("virtualElements.prepend",m.f.qc),m.b("virtualElements.setDomNodeChildren",m.f.fa),function(){m.S=function(){this.Kc={}},m.a.extend(m.S.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||m.g.getComponentNameForNode(e);case 8:return m.f.Yc(e);default:return!1}},getBindings:function(e,t){var r=this.getBindingsString(e,t),r=r?this.parseBindingsString(r,t,e):null;return m.g.Rb(r,e,t,!1)},getBindingAccessors:function(e,t){var r=this.getBindingsString(e,t),r=r?this.parseBindingsString(r,t,e,{valueAccessors:!0}):null;return m.g.Rb(r,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return m.f.vd(e);default:return null}},parseBindingsString:function(e,t,r,i){try{var n,o=this.Kc,a=e+(i&&i.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+m.h.Xa(e,i)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,r)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),m.S.instance=new m.S}(),m.b("bindingProvider",m.S),function(){function r(e){return function(){return e}}function i(e){return e()}function o(e){return m.a.Ea(m.l.w(e),function(t,r){return function(){return e()[r]}})}function a(e,t,i){return"function"==typeof e?o(e.bind(null,t,i)):m.a.Ea(e,r)}function s(e,t){return o(this.getBindings.bind(this,e,t))}function l(e,t,r){var i,n=m.f.firstChild(t),o=m.S.instance,a=o.preprocessNode;if(a){for(;i=n;)n=m.f.nextSibling(i),a.call(o,i);n=m.f.firstChild(t)}for(;i=n;)n=m.f.nextSibling(i),u(e,i,r)}function u(e,t,r){var i=!0,n=1===t.nodeType;n&&m.f.oc(t),(n&&r||m.S.instance.nodeHasBindings(t))&&(i=d(t,null,e,r).shouldBindDescendants),i&&!p[m.a.A(t)]&&l(e,t,!n)}function c(e){var t=[],r={},i=[];return m.a.D(e,function n(o){if(!r[o]){var a=m.getBindingHandler(o);a&&(a.after&&(i.push(o),m.a.r(a.after,function(t){if(e[t]){if(-1!==m.a.o(i,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+i.join(", "));n(t)}}),i.length--),t.push({key:o,jc:a})),r[o]=!0}}),t}function d(t,r,n,o){var a=m.a.e.get(t,f);if(!r){if(a)throw Error("You cannot apply bindings multiple times to the same element.");m.a.e.set(t,f,!0)}!a&&o&&m.xc(t,n);var l;if(r&&"function"!=typeof r)l=r;else{var u=m.S.instance,d=u.getBindingAccessors||s,h=m.B(function(){return(l=r?r(n,t):d.call(u,t,n))&&n.Q&&n.Q(),l},null,{i:t});l&&h.ca()||(h=null)}var p;if(l){var g=h?function(e){return function(){return i(h()[e])}}:function(e){return l[e]},_=function(){return m.a.Ea(h?h():l,i)};_.get=function(e){return l[e]&&i(g(e))},_.has=function(e){return e in l},o=c(l),m.a.r(o,function(r){var i=r.jc.init,o=r.jc.update,a=r.key;if(8===t.nodeType&&!m.f.aa[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof i&&m.l.w(function(){var r=i(t,g(a),_,n.$data,n);if(r&&r.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&&m.B(function(){o(t,g(a),_,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 h(e){return e&&e instanceof m.R?e:new m.R(e)}m.d={};var p={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(e){return m.d[e]},m.R=function(t,r,i,n,o){function a(){var e=d?t():t,o=m.a.c(e);return r?(r.Q&&r.Q(),m.a.extend(c,r),c.Q=u):(c.$parents=[],c.$root=o,c.ko=m),c.$rawData=e,c.$data=o,i&&(c[i]=o),n&&n(c,r,o),c.$data}function s(){return l&&!m.a.Tb(l)}var l,u,c=this,d="function"==typeof t&&!m.I(t);o&&o.exportDependencies?a():(u=m.B(a,null,{ya:s,i:!0}),u.ca()&&(c.Q=u,u.equalityComparer=null,l=[],u.Dc=function(t){l.push(t),m.a.G.qa(t,function(t){m.a.Na(l,t),l.length||(u.k(),c.Q=u=e)})}))},m.R.prototype.createChildContext=function(e,t,r,i){return new m.R(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),r&&r(e)},i)},m.R.prototype.extend=function(e){return new m.R(this.Q||this.$data,this,null,function(t,r){t.$rawData=r.$rawData,m.a.extend(t,"function"==typeof e?e():e)})},m.R.prototype.ac=function(e,t){return this.createChildContext(e,t,null,{exportDependencies:!0})};var f=m.a.e.J(),g=m.a.e.J();m.xc=function(e,t){if(2!=arguments.length)return m.a.e.get(e,g);m.a.e.set(e,g,t),t.Q&&t.Q.Dc(e)},m.La=function(e,t,r){return 1===e.nodeType&&m.f.oc(e),d(e,t,h(r),!0)},m.Ic=function(e,t,r){return r=h(r),m.La(e,a(t,r,e),r)},m.hb=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(h(e),t,!0)},m.Ub=function(e,r){if(!n&&t.jQuery&&(n=t.jQuery),r&&1!==r.nodeType&&8!==r.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");r=r||t.document.body,u(h(e),r,!0)},m.nb=function(t){switch(t.nodeType){case 1:case 8:var r=m.xc(t);if(r)return r;if(t.parentNode)return m.nb(t.parentNode)}return e},m.Oc=function(t){return(t=m.nb(t))?t.$data:e},m.b("bindingHandlers",m.d),m.b("applyBindings",m.Ub),m.b("applyBindingsToDescendants",m.hb),m.b("applyBindingAccessorsToNode",m.La),m.b("applyBindingsToNode",m.Ic),m.b("contextFor",m.nb),m.b("dataFor",m.Oc)}(),function(e){function t(t,i){var a,s=n.hasOwnProperty(t)?n[t]:e
;s?s.Y(i):(s=n[t]=new m.K,s.Y(i),r(t,function(e,r){var i=!(!r||!r.synchronous);o[t]={definition:e,dd:i},delete n[t],a||i?s.notifySubscribers(e):m.Z.Za(function(){s.notifySubscribers(e)})}),a=!0)}function r(e,t){i("getConfig",[e],function(r){r?i("loadComponent",[e,r],function(e){t(e,r)}):t(null,null)})}function i(t,r,n,o){o||(o=m.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,r.concat(function(e){l?n(null):null!==e?n(e):i(t,r,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else i(t,r,n,o)}else n(null)}var n={},o={};m.g={get:function(r,i){var n=o.hasOwnProperty(r)?o[r]:e;n?n.dd?m.l.w(function(){i(n.definition)}):m.Z.Za(function(){i(n.definition)}):t(r,i)},$b:function(e){delete o[e]},Nb:i},m.g.loaders=[],m.b("components",m.g),m.b("components.get",m.g.get),m.b("components.clearCachedDefinition",m.g.$b)}(),function(){function e(e,t,r,i){function n(){0==--s&&i(o)}var o={},s=2,l=r.template;r=r.viewModel,l?a(t,l,function(t){m.g.Nb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),r?a(t,r,function(t){m.g.Nb("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(m.a.A(e)){case"script":return m.a.na(e.text);case"textarea":return m.a.na(e.value);case"template":if(o(e.content))return m.a.wa(e.content.childNodes)}return m.a.wa(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,r,i){"string"==typeof r.require?s||t.require?(s||t.require)([r.require],i):e("Uses require, but no AMD loader is present"):i(r)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};m.g.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(m.g.wb(e))throw Error("Component "+e+" is already registered");u[e]=t},m.g.wb=function(e){return u.hasOwnProperty(e)},m.g.ud=function(e){delete u[e],m.g.$b(e)},m.g.cc={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,r,i){var n=l(t);a(n,r,function(r){e(t,n,r,i)})},loadTemplate:function(e,i,a){if(e=l(e),"string"==typeof i)a(m.a.na(i));else if(i instanceof Array)a(i);else if(o(i))a(m.a.W(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";m.b("components.register",m.g.register),m.b("components.isRegistered",m.g.wb),m.b("components.unregister",m.g.ud),m.b("components.defaultLoader",m.g.cc),m.g.loaders.push(m.g.cc),m.g.Ec=u}(),function(){function e(e,r){var i=e.getAttribute("params");if(i){var i=t.parseBindingsString(i,r,e,{valueAccessors:!0,bindingParams:!0}),i=m.a.Ea(i,function(t){return m.m(t,null,{i:e})}),n=m.a.Ea(i,function(t){var r=t.p();return t.ca()?m.m({read:function(){return m.a.c(t())},write:m.Da(r)&&function(e){t()(e)},i:e}):r});return n.hasOwnProperty("$raw")||(n.$raw=i),n}return{$raw:{}}}m.g.getComponentNameForNode=function(e){var t=m.a.A(e);if(m.g.wb(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=m.a.C&&e.tagName===t))return t},m.g.Rb=function(t,r,i,n){if(1===r.nodeType){var o=m.g.getComponentNameForNode(r);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(r,i)};t.component=n?function(){return a}:a}}return t};var t=new m.S;9>m.a.C&&(m.g.register=function(e){return function(t){return r.createElement(t),e.apply(this,arguments)}}(m.g.register),r.createDocumentFragment=function(e){return function(){var t,r=e(),i=m.g.Ec;for(t in i)i.hasOwnProperty(t)&&r.createElement(t);return r}}(r.createDocumentFragment))}(),function(e){function t(e,t,r){if(!(t=t.template))throw Error("Component '"+e+"' has no template");e=m.a.wa(t),m.f.fa(r,e)}function r(e,t,r,i){var n=e.createViewModel;return n?n.call(e,i,{element:t,templateNodes:r}):i}var i=0;m.d.component={init:function(e,n,o,a,s){function l(){var e=u&&u.dispose;"function"==typeof e&&e.call(u),c=u=null}var u,c,d=m.a.W(m.f.childNodes(e));return m.a.G.qa(e,l),m.m(function(){var o,a,h=m.a.c(n());if("string"==typeof h?o=h:(o=m.a.c(h.name),a=m.a.c(h.params)),!o)throw Error("No component name specified");var p=c=++i;m.g.get(o,function(i){if(c===p){if(l(),!i)throw Error("Unknown component '"+o+"'");t(o,i,e);var n=r(i,e,d,a);i=s.createChildContext(n,void 0,function(e){e.$component=n,e.$componentTemplateNodes=d}),u=n,m.hb(i,e)}})},null,{i:e}),{controlsDescendantBindings:!0}}},m.f.aa.component=!0}();var x={class:"className",for:"htmlFor"};m.d.attr={update:function(t,r){var i=m.a.c(r())||{};m.a.D(i,function(r,i){i=m.a.c(i);var n=!1===i||null===i||i===e;n&&t.removeAttribute(r),8>=m.a.C&&r in x?(r=x[r],n?t.removeAttribute(r):t[r]=i):n||t.setAttribute(r,i.toString()),"name"===r&&m.a.vc(t,n?"":i.toString())})}},function(){m.d.checked={after:["value","attr"],init:function(t,r,i){function n(){var e=t.checked,n=p?a():e;if(!m.xa.Va()&&(!l||e)){var o=m.l.w(r);if(c){var s=d?o.p():o;h!==n?(e&&(m.a.ra(s,n,!0),m.a.ra(s,h,!1)),h=n):m.a.ra(s,n,e),d&&m.Da(o)&&o(s)}else m.h.Ga(o,i,"checked",n,!0)}}function o(){var e=m.a.c(r());t.checked=c?0<=m.a.o(e,a()):s?e:a()===e}var a=m.rc(function(){return i.has("checkedValue")?m.a.c(i.get("checkedValue")):i.has("value")?m.a.c(i.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=r(),c=s&&m.a.c(u)instanceof Array,d=!(c&&u.push&&u.splice),h=c?a():e,p=l||c;l&&!t.name&&m.d.uniqueName.init(t,function(){return!0}),m.m(n,null,{i:t}),m.a.q(t,"click",n),m.m(o,null,{i:t}),u=e}}},m.h.ga.checked=!0,m.d.checkedValue={update:function(e,t){e.value=m.a.c(t())}}}(),m.d.css={update:function(e,t){var r=m.a.c(t());null!==r&&"object"==typeof r?m.a.D(r,function(t,r){r=m.a.c(r),m.a.fb(e,t,r)}):(r=m.a.cb(String(r||"")),m.a.fb(e,e.__ko__cssValue,!1),e.__ko__cssValue=r,m.a.fb(e,r,!0))}},m.d.enable={update:function(e,t){var r=m.a.c(t());r&&e.disabled?e.removeAttribute("disabled"):r||e.disabled||(e.disabled=!0)}},m.d.disable={update:function(e,t){m.d.enable.update(e,function(){return!m.a.c(t())})}},m.d.event={init:function(e,t,r,i,n){var o=t()||{};m.a.D(o,function(o){"string"==typeof o&&m.a.q(e,o,function(e){var a,s=t()[o];if(s){try{var l=m.a.W(arguments);i=n.$data,l.unshift(i),a=s.apply(i,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===r.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},m.d.foreach={mc:function(e){return function(){var t=e(),r=m.a.Bb(t);return r&&"number"!=typeof r.length?(m.a.c(t),{foreach:r.data,as:r.as,includeDestroyed:r.includeDestroyed,afterAdd:r.afterAdd,beforeRemove:r.beforeRemove,afterRender:r.afterRender,beforeMove:r.beforeMove,afterMove:r.afterMove,templateEngine:m.X.vb}):{foreach:t,templateEngine:m.X.vb}}},init:function(e,t){return m.d.template.init(e,m.d.foreach.mc(t))},update:function(e,t,r,i,n){return m.d.template.update(e,m.d.foreach.mc(t),r,i,n)}},m.h.va.foreach=!1,m.f.aa.foreach=!0,m.d.hasfocus={init:function(e,t,r){function i(i){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(e){o=n.body}i=o===e}n=t(),m.h.Ga(n,r,"hasfocus",i,!0),e.__ko_hasfocusLastValue=i,e.__ko_hasfocusUpdating=!1}var n=i.bind(null,!0),o=i.bind(null,!1);m.a.q(e,"focus",n),m.a.q(e,"focusin",n),m.a.q(e,"blur",o),m.a.q(e,"focusout",o)},update:function(e,t){var r=!!m.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===r||(r?e.focus():e.blur(),!r&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),m.l.w(m.a.Fa,null,[e,r?"focusin":"focusout"]))}},m.h.ga.hasfocus=!0,m.d.hasFocus=m.d.hasfocus,m.h.ga.hasFocus=!0,m.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){m.a.Eb(e,t())}},f("if"),f("ifnot",!1,!0),f("with",!0,!1,function(e,t){return e.ac(t)});var P={};m.d.options={init:function(e){if("select"!==m.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,r,i){function n(){return m.a.Ma(t.options,function(e){return e.selected})}function o(e,t,r){var i=typeof t;return"function"==i?t(e):"string"==i?e[t]:r}function a(e,r){if(f&&c)m.j.ja(t,m.a.c(i.get("value")),!0);else if(p.length){var n=0<=m.a.o(p,m.j.u(r[0]));m.a.wc(r[0],n),f&&!n&&m.l.w(m.a.Fa,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=m.a.c(r()),c=i.get("valueAllowUnset")&&i.has("value"),d=i.get("optionsIncludeDestroyed");r={};var h,p=[];c||(s?p=m.a.ib(n(),m.j.u):0<=t.selectedIndex&&p.push(m.j.u(t.options[t.selectedIndex]))),u&&(void 0===u.length&&(u=[u]),h=m.a.Ma(u,function(t){return d||t===e||null===t||!m.a.c(t._destroy)}),i.has("optionsCaption")&&null!==(u=m.a.c(i.get("optionsCaption")))&&u!==e&&h.unshift(P));var f=!1;r.beforeRemove=function(e){t.removeChild(e)},u=a,i.has("optionsAfterRender")&&"function"==typeof i.get("optionsAfterRender")&&(u=function(t,r){a(0,r),m.l.w(i.get("optionsAfterRender"),null,[r[0],t!==P?t:e])}),m.a.Db(t,h,function(r,n,a){return a.length&&(p=!c&&a[0].selected?[m.j.u(a[0])]:[],f=!0),n=t.ownerDocument.createElement("option"),r===P?(m.a.bb(n,i.get("optionsCaption")),m.j.ja(n,e)):(a=o(r,i.get("optionsValue"),r),m.j.ja(n,m.a.c(a)),r=o(r,i.get("optionsText"),a),m.a.bb(n,r)),[n]},r,u),m.l.w(function(){c?m.j.ja(t,m.a.c(i.get("value")),!0):(s?p.length&&n().length<p.length:p.length&&0<=t.selectedIndex?m.j.u(t.options[t.selectedIndex])!==p[0]:p.length||0<=t.selectedIndex)&&m.a.Fa(t,"change")}),m.a.Sc(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},m.d.options.zb=m.a.e.J(),m.d.selectedOptions={after:["options","foreach"],init:function(e,t,r){m.a.q(e,"change",function(){var i=t(),n=[];m.a.r(e.getElementsByTagName("option"),function(e){e.selected&&n.push(m.j.u(e))}),m.h.Ga(i,r,"selectedOptions",n)})},update:function(e,t){if("select"!=m.a.A(e))throw Error("values binding applies only to SELECT elements");var r=m.a.c(t()),i=e.scrollTop;r&&"number"==typeof r.length&&m.a.r(e.getElementsByTagName("option"),function(e){var t=0<=m.a.o(r,m.j.u(e));e.selected!=t&&m.a.wc(e,t)}),e.scrollTop=i}},m.h.ga.selectedOptions=!0,m.d.style={update:function(t,r){var i=m.a.c(r()||{});m.a.D(i,function(r,i){i=m.a.c(i),null!==i&&i!==e&&!1!==i||(i=""),t.style[r]=i})}},m.d.submit={init:function(e,t,r,i,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");m.a.q(e,"submit",function(r){var i,o=t();try{i=o.call(n.$data,e)}finally{!0!==i&&(r.preventDefault?r.preventDefault():r.returnValue=!1)}})}},m.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){m.a.bb(e,t())}},m.f.aa.text=!0,function(){if(t&&t.navigator)var r=function(e){if(e)return parseFloat(e[1])},i=t.opera&&t.opera.version&&parseInt(t.opera.version()),n=t.navigator.userAgent,o=r(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=r(n.match(/Firefox\/([^ ]*)/));if(10>m.a.C)var s=m.a.e.J(),l=m.a.e.J(),u=function(e){var t=this.activeElement;(t=t&&m.a.e.get(t,l))&&t(e)},c=function(e,t){var r=e.ownerDocument;m.a.e.get(r,s)||(m.a.e.set(r,s,!0),m.a.q(r,"selectionchange",u)),m.a.e.set(e,l,t)};m.d.textInput={init:function(t,r,n){function s(e,r){m.a.q(t,e,r)}function l(){var i=m.a.c(r());null!==i&&i!==e||(i=""),p!==e&&i===p?m.a.setTimeout(l,4):t.value!==i&&(f=i,t.value=i)}function u(){h||(p=t.value,h=m.a.setTimeout(d,4))}function d(){clearTimeout(h),p=h=e;var i=t.value;f!==i&&(f=i,m.h.Ga(r(),n,"textInput",i))}var h,p,f=t.value,g=9==m.a.C?u:d;10>m.a.C?(s("propertychange",function(e){"value"===e.propertyName&&g(e)}),8==m.a.C&&(s("keyup",d),s("keydown",d)),8<=m.a.C&&(c(t,g),s("dragend",u))):(s("input",d),5>o&&"textarea"===m.a.A(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>i?s("keydown",u):4>a&&(s("DOMAutoComplete",d),s("dragdrop",d),s("drop",d))),s("change",d),m.m(l,null,{i:t})}},m.h.ga.textInput=!0,m.d.textinput={preprocess:function(e,t,r){r("textInput",e)}}}(),m.d.uniqueName={init:function(e,t){if(t()){var r="ko_unique_"+ ++m.d.uniqueName.Nc;m.a.vc(e,r)}}},m.d.uniqueName.Nc=0,m.d.value={after:["options","foreach"],init:function(e,t,r){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var i=["change"],n=r.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),m.a.ta(i,n),i=m.a.Wb(i));var s=function(){a=null,o=!1;var i=t(),n=m.j.u(e);m.h.Ga(i,r,"value",n)};!m.a.C||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=m.a.o(i,"propertychange")||(m.a.q(e,"propertychange",function(){o=!0}),m.a.q(e,"focus",function(){o=!1}),m.a.q(e,"blur",function(){o&&s()})),m.a.r(i,function(t){var r=s;m.a.sd(t,"after")&&(r=function(){a=m.j.u(e),m.a.setTimeout(s,0)},t=t.substring(5)),m.a.q(e,t,r)});var l=function(){var i=m.a.c(t()),n=m.j.u(e);if(null!==a&&i===a)m.a.setTimeout(l,0);else if(i!==n)if("select"===m.a.A(e)){var o=r.get("valueAllowUnset"),n=function(){m.j.ja(e,i,o)};n(),o||i===m.j.u(e)?m.a.setTimeout(n,0):m.l.w(m.a.Fa,null,[e,"change"])}else m.j.ja(e,i)};m.m(l,null,{i:e})}else m.La(e,{checkedValue:t})},update:function(){}},m.h.ga.value=!0,m.d.visible={update:function(e,t){var r=m.a.c(t()),i="none"!=e.style.display;r&&!i?e.style.display="":!r&&i&&(e.style.display="none")}},function(e){m.d[e]={init:function(t,r,i,n,o){return m.d.event.init.call(this,t,function(){var t={};return t[e]=r(),t},i,n,o)}}}("click"),m.P=function(){},m.P.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.P.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.P.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 m.v.n(i)}if(1==e.nodeType||8==e.nodeType)return new m.v.sa(e);throw Error("Unknown template type: "+e)},m.P.prototype.renderTemplate=function(e,t,r,i){return e=this.makeTemplateSource(e,i),this.renderTemplateSource(e,t,r,i)},m.P.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},m.P.prototype.rewriteTemplate=function(e,t,r){e=this.makeTemplateSource(e,r),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},m.b("templateEngine",m.P),m.Ib=function(){function e(e,t,r,i){e=m.h.Ab(e);for(var n=m.h.va,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 r="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.h.Xa(e,{valueAccessors:!0})+" } })()},'"+r.toLowerCase()+"')",i.createJavaScriptEvaluatorBlock(r)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,r=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Tc:function(e,t,r){t.isTemplateRewritten(e,r)||t.rewriteTemplate(e,function(e){return m.Ib.jd(e,t)},r)},jd:function(i,n){return i.replace(t,function(t,r,i,o,a){return e(a,r,i,n)}).replace(r,function(t,r){return e(r,"\x3c!-- ko --\x3e","#comment",n)})},Jc:function(e,t){return m.N.yb(function(r,i){var n=r.nextSibling;n&&n.nodeName.toLowerCase()===t&&m.La(n,e,i)})}}}(),m.b("__tr_ambtns",m.Ib.Jc),function(){m.v={},m.v.n=function(e){if(this.n=e){var t=m.a.A(e);this.eb="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},m.v.n.prototype.text=function(){var e=1===this.eb?"text":2===this.eb?"value":"innerHTML";if(0==arguments.length)return this.n[e];var t=arguments[0];"innerHTML"===e?m.a.Eb(this.n,t):this.n[e]=t};var t=m.a.e.J()+"_";m.v.n.prototype.data=function(e){if(1===arguments.length)return m.a.e.get(this.n,t+e);m.a.e.set(this.n,t+e,arguments[1])};var r=m.a.e.J();m.v.n.prototype.nodes=function(){var t=this.n;if(0==arguments.length)return(m.a.e.get(t,r)||{}).mb||(3===this.eb?t.content:4===this.eb?t:e);m.a.e.set(t,r,{mb:arguments[0]})},m.v.sa=function(e){this.n=e},m.v.sa.prototype=new m.v.n,m.v.sa.prototype.text=function(){if(0==arguments.length){var t=m.a.e.get(this.n,r)||{};return t.Jb===e&&t.mb&&(t.Jb=t.mb.innerHTML),t.Jb}m.a.e.set(this.n,r,{Jb:arguments[0]})},m.b("templateSources",m.v),m.b("templateSources.domElement",m.v.n),m.b("templateSources.anonymousTemplate",m.v.sa)}(),function(){function t(e,t,r){var i;for(t=m.f.nextSibling(t);e&&(i=e)!==t;)e=m.f.nextSibling(i),r(i,e)}function r(e,r){if(e.length){var i=e[0],n=e[e.length-1],o=i.parentNode,a=m.S.instance,s=a.preprocessNode;if(s){if(t(i,n,function(e,t){var r=e.previousSibling,o=s.call(a,e);o&&(e===i&&(i=o[0]||t),e===n&&(n=o[o.length-1]||r))}),e.length=0,!i)return;i===n?e.push(i):(e.push(i,n),m.a.Ba(e,o))}t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||m.Ub(r,e)}),t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||m.N.Cc(e,[r])}),m.a.Ba(e,o)}}function i(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&i(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(m.Ib.Tc(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":m.f.fa(e,n),l=!0;break;case"replaceNode":m.a.uc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(r(n,o),s.afterRender&&m.l.w(s.afterRender,null,[n,o.$data])),n}function o(e,t,r){return m.I(e)?e():"function"==typeof e?e(t,r):e}var a;m.Fb=function(t){if(t!=e&&!(t instanceof m.P))throw Error("templateEngine must inherit from ko.templateEngine");a=t},m.Cb=function(t,r,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=i(l);return m.B(function(){var e=r&&r instanceof m.R?r:new m.R(r,null,null,null,{exportDependencies:!0}),a=o(t,e.$data,e),e=n(l,u,a,e,s);"replaceNode"==u&&(l=e,c=i(l))},null,{ya:function(){return!c||!m.a.qb(c)},i:c&&"replaceNode"==u?c.parentNode:c})}return m.N.yb(function(e){m.Cb(t,r,s,e,"replaceNode")})},m.pd=function(t,i,a,s,l){function u(e,t){r(t,d),a.afterRender&&a.afterRender(t,e),d=null}function c(e,r){return d=l.createChildContext(e,a.as,function(e){e.$index=r}),n(null,"ignoreTargetNode",o(t,e,d),d,a)}var d;return m.B(function(){var t=m.a.c(i)||[];void 0===t.length&&(t=[t]),t=m.a.Ma(t,function(t){return a.includeDestroyed||t===e||null===t||!m.a.c(t._destroy)}),m.l.w(m.a.Db,null,[s,t,c,a,u])},null,{i:s})};var s=m.a.e.J();m.d.template={init:function(e,t){var r=m.a.c(t());if("string"==typeof r||r.name)m.f.za(e);else{if("nodes"in r){if(r=r.nodes||[],m.I(r))throw Error('The "nodes" option must be a plain, non-observable array.')}else r=m.f.childNodes(e);r=m.a.nc(r),new m.v.sa(e).nodes(r)}return{controlsDescendantBindings:!0}},update:function(t,r,i,n,o){var a=r();r=m.a.c(a),i=!0,n=null,"string"==typeof r?r={}:(a=r.name,"if"in r&&(i=m.a.c(r.if)),i&&"ifnot"in r&&(i=!m.a.c(r.ifnot))),"foreach"in r?n=m.pd(a||t,i&&r.foreach||[],r,t,o):i?(o="data"in r?o.ac(r.data,r.as):o,n=m.Cb(a||t,o,r,t)):m.f.za(t),o=n,(r=m.a.e.get(t,s))&&"function"==typeof r.k&&r.k(),m.a.e.set(t,s,o&&o.ca()?o:e)}},m.h.va.template=function(e){return e=m.h.Ab(e),1==e.length&&e[0].unknown||m.h.fd(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.f.aa.template=!0}(),m.b("setTemplateEngine",m.Fb),m.b("renderTemplate",m.Cb),m.a.hc=function(e,t,r){if(e.length&&t.length){var i,n,o,a,s;for(i=n=0;(!r||i<r)&&(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),i=o=0;break}i+=o}}},m.a.lb=function(){function e(e,t,r,i,n){var o,a,s,l,u,c=Math.min,d=Math.max,h=[],p=e.length,f=t.length,g=f-p||1,_=p+f+1;for(o=0;o<=p;o++)for(l=s,h.push(s=[]),u=c(f,o+g),a=d(0,o-1);a<=u;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||_,s[a-1]||_)+1:a+1:o+1;for(c=[],d=[],g=[],o=p,a=f;o||a;)f=h[o][a]-1,a&&f===h[o][a-1]?d.push(c[c.length]={status:r,value:t[--a],index:a}):o&&f===h[o-1][a]?g.push(c[c.length]={status:i,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return m.a.hc(g,d,!n.dontLimitMoves&&10*p),c.reverse()}return function(t,r,i){return i="boolean"==typeof i?{dontLimitMoves:i}:i||{},t=t||[],r=r||[],t.length<r.length?e(t,r,"added","deleted",i):e(r,t,"deleted","added",i)}}(),m.b("utils.compareArrays",m.a.lb),function(){function t(t,r,i,n,o){var a=[],s=m.B(function(){var e=r(i,o,m.a.Ba(a,t))||[];0<a.length&&(m.a.uc(a,e),n&&m.l.w(n,null,[i,e,o])),a.length=0,m.a.ta(a,e)},null,{i:t,ya:function(){return!m.a.Tb(a)}});return{ea:a,B:s.ca()?s:e}}var r=m.a.e.J(),i=m.a.e.J();m.a.Db=function(n,o,a,s,l){function u(e,t){C=h[t],v!==t&&(w[e]=C),C.tb(v++),m.a.Ba(C.ea,n),g.push(C),b.push(C)}function c(e,t){if(e)for(var r=0,i=t.length;r<i;r++)t[r]&&m.a.r(t[r].ea,function(i){e(i,r,t[r].ka)})}o=o||[],s=s||{};var d=m.a.e.get(n,r)===e,h=m.a.e.get(n,r)||[],p=m.a.ib(h,function(e){return e.ka}),f=m.a.lb(p,o,s.dontLimitMoves),g=[],_=0,v=0,y=[],b=[];o=[];for(var C,S,T,w=[],p=[],A=0;S=f[A];A++)switch(T=S.moved,S.status){case"deleted":T===e&&(C=h[_],C.B&&(C.B.k(),C.B=e),m.a.Ba(C.ea,n).length&&(s.beforeRemove&&(g.push(C),b.push(C),C.ka===i?C=null:o[A]=C),C&&y.push.apply(y,C.ea))),_++;break;case"retained":u(A,_++);break;case"added":T!==e?u(A,T):(C={ka:S.value,tb:m.O(v++)},g.push(C),b.push(C),d||(p[A]=C))}m.a.e.set(n,r,g),c(s.beforeMove,w),m.a.r(y,s.beforeRemove?m.ba:m.removeNode);for(var E,A=0,d=m.f.firstChild(n);C=b[A];A++){for(C.ea||m.a.extend(C,t(n,a,C.ka,l,C.tb)),_=0;f=C.ea[_];d=f.nextSibling,E=f,_++)f!==d&&m.f.kc(n,f,E);!C.ad&&l&&(l(C.ka,C.ea,C.tb),C.ad=!0)}for(c(s.beforeRemove,o),A=0;A<o.length;++A)o[A]&&(o[A].ka=i);c(s.afterMove,w),c(s.afterAdd,p)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.Db),m.X=function(){this.allowTemplateRewriting=!1},m.X.prototype=new m.P,m.X.prototype.renderTemplateSource=function(e,t,r,i){return(t=(9>m.a.C?0:e.nodes)?e.nodes():null)?m.a.W(t.cloneNode(!0).childNodes):(e=e.text(),m.a.na(e,i))},m.X.vb=new m.X,m.Fb(m.X.vb),m.b("nativeTemplateEngine",m.X),function(){m.xb=function(){var e=this.ed=function(){if(!n||!n.tmpl)return 0;try{if(0<=n.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,o,a){if(a=a||r,o=o||{},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=n.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[i.$data],i=n.extend({koBindingContext:i},o.templateOptions),i=n.tmpl(s,t,i),i.appendTo(a.createElement("div")),n.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&&(n.tmpl.tag.ko_code={open:"__.push($1 || '');"},n.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.xb.prototype=new m.P;var e=new m.xb;0<e.ed&&m.Fb(e),m.b("jqueryTmplTemplateEngine",m.xb)}()})}()}(),define("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,r){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 r=r||Object.getOwnPropertyNames(e),r.forEach(function(t){if(t!==d&&t!==h&&!(t in o)){var r=e[t],a=r instanceof Array,s=n.isObservable(r)?r:a?n.observableArray(r):n.observable(r);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&i(n,s)}}),e}function t(e,t){var r=e[d];return!r&&t&&(r={},Object.defineProperty(e,d,{value:r})),r}function r(t,r,i){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof i)o.read=i;else{if("value"in i)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof i.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=i.get,o.write=i.set}return t[r]=n.computed(o),e.call(n,t,[r]),t}function i(e,t){var r=null;e.computed(function(){r&&(r.dispose(),r=null);var i=t();i instanceof Array&&(r=n(e,t,i))})}function n(e,t,r){return o(e,r).subscribe(t)}function o(e,t){var r=t[h];if(!r){r=new e.subscribable,Object.defineProperty(t,h,{value:r});var i={};a(t,r,i),s(e,t,r,i)}return r}function a(e,t,r){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var n=e[i];e[i]=function(){var e=n.apply(this,arguments);return!0!==r.pause&&t.notifySubscribers(this),e}})}function s(e,t,r,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return r.notifySubscribers(t),o}})})}function l(e,r){if(!e)return null;var i=t(e,!1);return i&&i[r]||null}function u(e,t){var r=l(e,t);r&&r.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=r}var d="__knockoutObservables",h="__knockoutSubscribable";return{attachToKo:c}}),define("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg";return{register:function(t){t.bindingHandlers.cesiumSvgPath={init:function(r,i){var n=document.createElementNS(e,"svg:svg");n.setAttribute("class","cesium-svgPath-svg");var o=document.createElementNS(e,"path");return n.appendChild(o),t.virtualElements.setDomNodeChildren(r,[n]),t.computed({read:function(){var e=t.unwrap(i());o.setAttribute("d",t.unwrap(e.path));var r=t.unwrap(e.width),a=t.unwrap(e.height);n.setAttribute("width",r),n.setAttribute("height",a),n.setAttribute("viewBox","0 0 "+r+" "+a),e.css&&n.setAttribute("class","cesium-svgPath-svg "+t.unwrap(e.css))},disposeWhenNodeIsRemoved:r}),{controlsDescendantBindings:!0}}},t.virtualElements.allowedBindings.cesiumSvgPath=!0}}}),define("ThirdParty/knockout",["./knockout-3.4.2","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,r){"use strict";return t.attachToKo(e),r.register(e),e}),function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("ThirdParty/NoSleep",[],t):"object"==typeof exports?exports.NoSleep=t():e.NoSleep=t()}(this,function(){return function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),o=r(1),a="undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,s=function(){function e(){i(this,e),a?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("playsinline",""),this.noSleepVideo.setAttribute("src",o),this.noSleepVideo.addEventListener("timeupdate",function(e){this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())}.bind(this)))}return n(e,[{key:"enable",value:function(){a?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location.href="/",window.setTimeout(window.stop,0)},15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){a?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),e}();e.exports=s},function(e,t,r){"use strict"
;e.exports="data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}])}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("ThirdParty/pako_inflate",[],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.pako=e()}}(function(){return function e(t,r,i){function n(a,s){if(!r[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){var r=t[a][1][e];return n(r||e)},c,c.exports,e,t,r,i)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)n(i[a]);return n}({1:[function(e,t,r){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+i),n);for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){var t,r,i,n,o,a;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(a=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,n),n+=o.length;return a}},o={arraySet:function(e,t,r,i,n){for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,n)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(i)},{}],2:[function(e,t,r){"use strict";function i(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&o))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",i=0;i<t;i++)r+=String.fromCharCode(e[i]);return r}var n=e("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var s=new n.Buf8(256),l=0;l<256;l++)s[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;s[254]=s[254]=1,r.string2buf=function(e){var t,r,i,o,a,s=e.length,l=0;for(o=0;o<s;o++)r=e.charCodeAt(o),55296==(64512&r)&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(l),a=0,o=0;a<l;o++)r=e.charCodeAt(o),55296==(64512&r)&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},r.buf2binstring=function(e){return i(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,o,a,l=t||e.length,u=new Array(2*l);for(n=0,r=0;r<l;)if((o=e[r++])<128)u[n++]=o;else if((a=s[o])>4)u[n++]=65533,r+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&r<l;)o=o<<6|63&e[r++],a--;a>1?u[n++]=65533:o<65536?u[n++]=o:(o-=65536,u[n++]=55296|o>>10&1023,u[n++]=56320|1023&o)}return i(u,n)},r.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+s[e[r]]>t?r:t}},{"./common":1}],3:[function(e,t,r){"use strict";function i(e,t,r,i){for(var n=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){a=r>2e3?2e3:r,r-=a;do{n=n+t[i++]|0,o=o+n|0}while(--a);n%=65521,o%=65521}return n|o<<16|0}t.exports=i},{}],4:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,r){"use strict";function i(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=i},{}],6:[function(e,t,r){"use strict";function i(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}t.exports=i},{}],7:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E;r=e.state,i=e.next_in,A=e.input,n=i+(e.avail_in-5),o=e.next_out,E=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,d=r.wnext,h=r.window,p=r.hold,f=r.bits,m=r.lencode,g=r.distcode,_=(1<<r.lenbits)-1,v=(1<<r.distbits)-1;e:do{f<15&&(p+=A[i++]<<f,f+=8,p+=A[i++]<<f,f+=8),y=m[p&_];t:for(;;){if(b=y>>>24,p>>>=b,f-=b,0===(b=y>>>16&255))E[o++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=m[(65535&y)+(p&(1<<b)-1)];continue t}if(32&b){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}C=65535&y,b&=15,b&&(f<b&&(p+=A[i++]<<f,f+=8),C+=p&(1<<b)-1,p>>>=b,f-=b),f<15&&(p+=A[i++]<<f,f+=8,p+=A[i++]<<f,f+=8),y=g[p&v];r:for(;;){if(b=y>>>24,p>>>=b,f-=b,!(16&(b=y>>>16&255))){if(0==(64&b)){y=g[(65535&y)+(p&(1<<b)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(S=65535&y,b&=15,f<b&&(p+=A[i++]<<f,(f+=8)<b&&(p+=A[i++]<<f,f+=8)),(S+=p&(1<<b)-1)>l){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=b,f-=b,b=o-a,S>b){if((b=S-b)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(T=0,w=h,0===d){if(T+=u-b,b<C){C-=b;do{E[o++]=h[T++]}while(--b);T=o-S,w=E}}else if(d<b){if(T+=u+d-b,(b-=d)<C){C-=b;do{E[o++]=h[T++]}while(--b);if(T=0,d<C){b=d,C-=b;do{E[o++]=h[T++]}while(--b);T=o-S,w=E}}}else if(T+=d-b,b<C){C-=b;do{E[o++]=h[T++]}while(--b);T=o-S,w=E}for(;C>2;)E[o++]=w[T++],E[o++]=w[T++],E[o++]=w[T++],C-=3;C&&(E[o++]=w[T++],C>1&&(E[o++]=w[T++]))}else{T=o-S;do{E[o++]=E[T++],E[o++]=E[T++],E[o++]=E[T++],C-=3}while(C>2);C&&(E[o++]=E[T++],C>1&&(E[o++]=E[T++]))}break}}break}}while(i<n&&o<s);C=f>>3,i-=C,f-=C<<3,p&=(1<<f)-1,e.next_in=i,e.next_out=o,e.avail_in=i<n?n-i+5:5-(i-n),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=p,r.bits=f}},{}],8:[function(e,t,r){"use strict";function i(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function n(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new v.Buf16(320),this.work=new v.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=F,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new v.Buf32(me),t.distcode=t.distdyn=new v.Buf32(ge),t.sane=1,t.back=-1,I):M}function a(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,o(e)):M}function s(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?M:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,a(e))):M}function l(e,t){var r,i;return e?(i=new n,e.state=i,i.window=null,r=s(e,t),r!==I&&(e.state=null),r):M}function u(e){return l(e,_e)}function c(e){if(ve){var t;for(g=new v.Buf32(512),_=new v.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(S(w,e.lens,0,288,g,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;S(A,e.lens,0,32,_,0,e.work,{bits:5}),ve=!1}e.lencode=g,e.lenbits=9,e.distcode=_,e.distbits=5}function d(e,t,r,i){var n,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new v.Buf8(o.wsize)),i>=o.wsize?(v.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),v.arraySet(o.window,t,r-i,n,o.wnext),i-=n,i?(v.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}function h(e,t){var r,n,o,a,s,l,u,h,p,f,m,g,_,me,ge,_e,ve,ye,be,Ce,Se,Te,we,Ae,Ee=0,xe=new v.Buf8(4),Pe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return M;r=e.state,r.mode===X&&(r.mode=Q),s=e.next_out,o=e.output,u=e.avail_out,a=e.next_in,n=e.input,l=e.avail_in,h=r.hold,p=r.bits,f=l,m=u,Te=I;e:for(;;)switch(r.mode){case F:if(0===r.wrap){r.mode=Q;break}for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(2&r.wrap&&35615===h){r.check=0,xe[0]=255&h,xe[1]=h>>>8&255,r.check=b(r.check,xe,2,0),h=0,p=0,r.mode=B;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",r.mode=he;break}if((15&h)!==k){e.msg="unknown compression method",r.mode=he;break}if(h>>>=4,p-=4,Se=8+(15&h),0===r.wbits)r.wbits=Se;else if(Se>r.wbits){e.msg="invalid window size",r.mode=he;break}r.dmax=1<<Se,e.adler=r.check=1,r.mode=512&h?q:X,h=0,p=0;break;case B:for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(r.flags=h,(255&r.flags)!==k){e.msg="unknown compression method",r.mode=he;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=he;break}r.head&&(r.head.text=h>>8&1),512&r.flags&&(xe[0]=255&h,xe[1]=h>>>8&255,r.check=b(r.check,xe,2,0)),h=0,p=0,r.mode=U;case U:for(;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.head&&(r.head.time=h),512&r.flags&&(xe[0]=255&h,xe[1]=h>>>8&255,xe[2]=h>>>16&255,xe[3]=h>>>24&255,r.check=b(r.check,xe,4,0)),h=0,p=0,r.mode=V;case V:for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.head&&(r.head.xflags=255&h,r.head.os=h>>8),512&r.flags&&(xe[0]=255&h,xe[1]=h>>>8&255,r.check=b(r.check,xe,2,0)),h=0,p=0,r.mode=z;case z:if(1024&r.flags){for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.length=h,r.head&&(r.head.extra_len=h),512&r.flags&&(xe[0]=255&h,xe[1]=h>>>8&255,r.check=b(r.check,xe,2,0)),h=0,p=0}else r.head&&(r.head.extra=null);r.mode=G;case G:if(1024&r.flags&&(g=r.length,g>l&&(g=l),g&&(r.head&&(Se=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),v.arraySet(r.head.extra,n,a,g,Se)),512&r.flags&&(r.check=b(r.check,n,g,a)),l-=g,a+=g,r.length-=g),r.length))break e;r.length=0,r.mode=H;case H:if(2048&r.flags){if(0===l)break e;g=0;do{Se=n[a+g++],r.head&&Se&&r.length<65536&&(r.head.name+=String.fromCharCode(Se))}while(Se&&g<l);if(512&r.flags&&(r.check=b(r.check,n,g,a)),l-=g,a+=g,Se)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=W;case W:if(4096&r.flags){if(0===l)break e;g=0;do{Se=n[a+g++],r.head&&Se&&r.length<65536&&(r.head.comment+=String.fromCharCode(Se))}while(Se&&g<l);if(512&r.flags&&(r.check=b(r.check,n,g,a)),l-=g,a+=g,Se)break e}else r.head&&(r.head.comment=null);r.mode=j;case j:if(512&r.flags){for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(h!==(65535&r.check)){e.msg="header crc mismatch",r.mode=he;break}h=0,p=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=X;break;case q:for(;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}e.adler=r.check=i(h),h=0,p=0,r.mode=Y;case Y:if(0===r.havedict)return e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=h,r.bits=p,O;e.adler=r.check=1,r.mode=X;case X:if(t===x||t===P)break e;case Q:if(r.last){h>>>=7&p,p-=7&p,r.mode=ue;break}for(;p<3;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}switch(r.last=1&h,h>>>=1,p-=1,3&h){case 0:r.mode=Z;break;case 1:if(c(r),r.mode=re,t===P){h>>>=2,p-=2;break e}break;case 2:r.mode=$;break;case 3:e.msg="invalid block type",r.mode=he}h>>>=2,p-=2;break;case Z:for(h>>>=7&p,p-=7&p;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if((65535&h)!=(h>>>16^65535)){e.msg="invalid stored block lengths",r.mode=he;break}if(r.length=65535&h,h=0,p=0,r.mode=K,t===P)break e;case K:r.mode=J;case J:if(g=r.length){if(g>l&&(g=l),g>u&&(g=u),0===g)break e;v.arraySet(o,n,a,g,s),l-=g,a+=g,u-=g,s+=g,r.length-=g;break}r.mode=X;break;case $:for(;p<14;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(r.nlen=257+(31&h),h>>>=5,p-=5,r.ndist=1+(31&h),h>>>=5,p-=5,r.ncode=4+(15&h),h>>>=4,p-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=he;break}r.have=0,r.mode=ee;case ee:for(;r.have<r.ncode;){for(;p<3;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.lens[Pe[r.have++]]=7&h,h>>>=3,p-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,we={bits:r.lenbits},Te=S(T,r.lens,0,19,r.lencode,0,r.work,we),r.lenbits=we.bits,Te){e.msg="invalid code lengths set",r.mode=he;break}r.have=0,r.mode=te;case te:for(;r.have<r.nlen+r.ndist;){for(;Ee=r.lencode[h&(1<<r.lenbits)-1],ge=Ee>>>24,_e=Ee>>>16&255,ve=65535&Ee,!(ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(ve<16)h>>>=ge,p-=ge,r.lens[r.have++]=ve;else{if(16===ve){for(Ae=ge+2;p<Ae;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(h>>>=ge,p-=ge,0===r.have){e.msg="invalid bit length repeat",r.mode=he;break}Se=r.lens[r.have-1],g=3+(3&h),h>>>=2,p-=2}else if(17===ve){for(Ae=ge+3;p<Ae;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ge,p-=ge,Se=0,g=3+(7&h),h>>>=3,p-=3}else{for(Ae=ge+7;p<Ae;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ge,p-=ge,Se=0,g=11+(127&h),h>>>=7,p-=7}if(r.have+g>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=he;break}for(;g--;)r.lens[r.have++]=Se}}if(r.mode===he)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=he;break}if(r.lenbits=9,we={bits:r.lenbits},Te=S(w,r.lens,0,r.nlen,r.lencode,0,r.work,we),r.lenbits=we.bits,Te){e.msg="invalid literal/lengths set",r.mode=he;break}if(r.distbits=6,r.distcode=r.distdyn,we={bits:r.distbits},Te=S(A,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,we),r.distbits=we.bits,Te){e.msg="invalid distances set",r.mode=he;break}if(r.mode=re,t===P)break e;case re:r.mode=ie;case ie:if(l>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=h,r.bits=p,C(e,m),s=e.next_out,o=e.output,u=e.avail_out,a=e.next_in,n=e.input,l=e.avail_in,h=r.hold,p=r.bits,r.mode===X&&(r.back=-1);break}for(r.back=0;Ee=r.lencode[h&(1<<r.lenbits)-1],ge=Ee>>>24,_e=Ee>>>16&255,ve=65535&Ee,!(ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(_e&&0==(240&_e)){for(ye=ge,be=_e,Ce=ve;Ee=r.lencode[Ce+((h&(1<<ye+be)-1)>>ye)],ge=Ee>>>24,_e=Ee>>>16&255,ve=65535&Ee,!(ye+ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ye,p-=ye,r.back+=ye}if(h>>>=ge,p-=ge,r.back+=ge,r.length=ve,0===_e){r.mode=le;break}if(32&_e){r.back=-1,r.mode=X;break}if(64&_e){e.msg="invalid literal/length code",r.mode=he;break}r.extra=15&_e,r.mode=ne;case ne:if(r.extra){for(Ae=r.extra;p<Ae;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.length+=h&(1<<r.extra)-1,h>>>=r.extra,p-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=oe;case oe:for(;Ee=r.distcode[h&(1<<r.distbits)-1],ge=Ee>>>24,_e=Ee>>>16&255,ve=65535&Ee,!(ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(0==(240&_e)){for(ye=ge,be=_e,Ce=ve;Ee=r.distcode[Ce+((h&(1<<ye+be)-1)>>ye)],ge=Ee>>>24,_e=Ee>>>16&255,ve=65535&Ee,!(ye+ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ye,p-=ye,r.back+=ye}if(h>>>=ge,p-=ge,r.back+=ge,64&_e){e.msg="invalid distance code",r.mode=he;break}r.offset=ve,r.extra=15&_e,r.mode=ae;case ae:if(r.extra){for(Ae=r.extra;p<Ae;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.offset+=h&(1<<r.extra)-1,h>>>=r.extra,p-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=he;break}r.mode=se;case se:if(0===u)break e;if(g=m-u,r.offset>g){if((g=r.offset-g)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=he;break}g>r.wnext?(g-=r.wnext,_=r.wsize-g):_=r.wnext-g,g>r.length&&(g=r.length),me=r.window}else me=o,_=s-r.offset,g=r.length;g>u&&(g=u),u-=g,r.length-=g;do{o[s++]=me[_++]}while(--g);0===r.length&&(r.mode=ie);break;case le:if(0===u)break e;o[s++]=r.length,u--,r.mode=ie;break;case ue:if(r.wrap){for(;p<32;){if(0===l)break e;l--,h|=n[a++]<<p,p+=8}if(m-=u,e.total_out+=m,r.total+=m,m&&(e.adler=r.check=r.flags?b(r.check,o,m,s-m):y(r.check,o,m,s-m)),m=u,(r.flags?h:i(h))!==r.check){e.msg="incorrect data check",r.mode=he;break}h=0,p=0}r.mode=ce;case ce:if(r.wrap&&r.flags){for(;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(h!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=he;break}h=0,p=0}r.mode=de;case de:Te=D;break e;case he:Te=R;break e;case pe:return L;case fe:default:return M}return e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=h,r.bits=p,(r.wsize||m!==e.avail_out&&r.mode<he&&(r.mode<ue||t!==E))&&d(e,e.output,e.next_out,m-e.avail_out)?(r.mode=pe,L):(f-=e.avail_in,m-=e.avail_out,e.total_in+=f,e.total_out+=m,r.total+=m,r.wrap&&m&&(e.adler=r.check=r.flags?b(r.check,o,m,e.next_out-m):y(r.check,o,m,e.next_out-m)),e.data_type=r.bits+(r.last?64:0)+(r.mode===X?128:0)+(r.mode===re||r.mode===K?256:0),(0===f&&0===m||t===E)&&Te===I&&(Te=N),Te)}function p(e){if(!e||!e.state)return M;var t=e.state;return t.window&&(t.window=null),e.state=null,I}function f(e,t){var r;return e&&e.state?(r=e.state,0==(2&r.wrap)?M:(r.head=t,t.done=!1,I)):M}function m(e,t){var r,i,n=t.length;return e&&e.state?(r=e.state,0!==r.wrap&&r.mode!==Y?M:r.mode===Y&&(i=1,(i=y(i,t,n,0))!==r.check)?R:d(e,t,n,n)?(r.mode=pe,L):(r.havedict=1,I)):M}var g,_,v=e("../utils/common"),y=e("./adler32"),b=e("./crc32"),C=e("./inffast"),S=e("./inftrees"),T=0,w=1,A=2,E=4,x=5,P=6,I=0,D=1,O=2,M=-2,R=-3,L=-4,N=-5,k=8,F=1,B=2,U=3,V=4,z=5,G=6,H=7,W=8,j=9,q=10,Y=11,X=12,Q=13,Z=14,K=15,J=16,$=17,ee=18,te=19,re=20,ie=21,ne=22,oe=23,ae=24,se=25,le=26,ue=27,ce=28,de=29,he=30,pe=31,fe=32,me=852,ge=592,_e=15,ve=!0;r.inflateReset=a,r.inflateReset2=s,r.inflateResetKeep=o,r.inflateInit=u,r.inflateInit2=l,r.inflate=h,r.inflateEnd=p,r.inflateGetHeader=f,r.inflateSetDictionary=m,r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,r){"use strict";var i=e("../utils/common"),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,l,u,c,d,h){var p,f,m,g,_,v,y,b,C,S=h.bits,T=0,w=0,A=0,E=0,x=0,P=0,I=0,D=0,O=0,M=0,R=null,L=0,N=new i.Buf16(16),k=new i.Buf16(16),F=null,B=0;for(T=0;T<=15;T++)N[T]=0;for(w=0;w<l;w++)N[t[r+w]]++;for(x=S,E=15;E>=1&&0===N[E];E--);if(x>E&&(x=E),0===E)return u[c++]=20971520,u[c++]=20971520,h.bits=1,0;for(A=1;A<E&&0===N[A];A++);for(x<A&&(x=A),D=1,T=1;T<=15;T++)if(D<<=1,(D-=N[T])<0)return-1;if(D>0&&(0===e||1!==E))return-1;for(k[1]=0,T=1;T<15;T++)k[T+1]=k[T]+N[T];for(w=0;w<l;w++)0!==t[r+w]&&(d[k[t[r+w]]++]=w);if(0===e?(R=F=d,v=19):1===e?(R=n,L-=257,F=o,B-=257,v=256):(R=a,F=s,v=-1),M=0,w=0,T=A,_=c,P=x,I=0,m=-1,O=1<<x,g=O-1,1===e&&O>852||2===e&&O>592)return 1;for(;;){y=T-I,d[w]<v?(b=0,C=d[w]):d[w]>v?(b=F[B+d[w]],C=R[L+d[w]]):(b=96,C=0),p=1<<T-I,f=1<<P,A=f;do{f-=p,u[_+(M>>I)+f]=y<<24|b<<16|C|0}while(0!==f);for(p=1<<T-1;M&p;)p>>=1;if(0!==p?(M&=p-1,M+=p):M=0,w++,0==--N[T]){if(T===E)break;T=t[r+d[w]]}if(T>x&&(M&g)!==m){for(0===I&&(I=x),_+=A,P=T-I,D=1<<P;P+I<E&&!((D-=N[P+I])<=0);)P++,D<<=1;if(O+=1<<P,1===e&&O>852||2===e&&O>592)return 1;m=M&g,u[m]=x<<24|P<<16|_-c|0}}return 0!==M&&(u[_+M]=T-I<<24|64<<16|0),h.bits=x,0}},{"../utils/common":1}],10:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,r){"use strict";function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}t.exports=i},{}],"/lib/inflate.js":[function(e,t,r){"use strict";function i(e){if(!(this instanceof i))return new i(e);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==u.Z_OK)throw new Error(c[r]);this.header=new h,a.inflateGetHeader(this.strm,this.header)}function n(e,t){var r=new i(t);if(r.push(e,!0),r.err)throw r.msg||c[r.err];return r.result}function o(e,t){return t=t||{},t.raw=!0,n(e,t)}var a=e("./zlib/inflate"),s=e("./utils/common"),l=e("./utils/strings"),u=e("./zlib/constants"),c=e("./zlib/messages"),d=e("./zlib/zstream"),h=e("./zlib/gzheader"),p=Object.prototype.toString;i.prototype.push=function(e,t){var r,i,n,o,c,d,h=this.strm,f=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;i=t===~~t?t:!0===t?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof e?h.input=l.binstring2buf(e):"[object ArrayBuffer]"===p.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new s.Buf8(f),h.next_out=0,h.avail_out=f),r=a.inflate(h,u.Z_NO_FLUSH),r===u.Z_NEED_DICT&&m&&(d="string"==typeof m?l.string2buf(m):"[object ArrayBuffer]"===p.call(m)?new Uint8Array(m):m,r=a.inflateSetDictionary(this.strm,d)),r===u.Z_BUF_ERROR&&!0===g&&(r=u.Z_OK,g=!1),r!==u.Z_STREAM_END&&r!==u.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==u.Z_STREAM_END&&(0!==h.avail_in||i!==u.Z_FINISH&&i!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(n=l.utf8border(h.output,h.next_out),o=h.next_out-n,c=l.buf2string(h.output,n),h.next_out=o,h.avail_out=f-o,o&&s.arraySet(h.output,h.output,n,o,0),this.onData(c)):this.onData(s.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==u.Z_STREAM_END);return r===u.Z_STREAM_END&&(i=u.Z_FINISH),i===u.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u.Z_OK):i!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),h.avail_out=0,!0)},i.prototype.onData=function(e){this.chunks.push(e)},i.prototype.onEnd=function(e){e===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=i,r.inflate=n,r.inflateRaw=o,r.ungzip=n},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}),define("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,r,i,n,o){return i.call(n,t[r]),e.getObservable(t,r).subscribe(i,n,o)}return t}),define("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,r,i,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 r in e)if(e.hasOwnProperty(r)&&"tagName"!==r)if("children"===r){var i,n=e.children.length;for(i=0;i<n;++i)t.appendChild(l(e.children[i]))}else 0===r.indexOf("xlink:")?t.setAttributeNS(y,r.substring(6),e[r]):"textContent"===r?t.textContent=e[r]:t.setAttribute(r,e[r]);return t}function u(e,t,r){var i=document.createElementNS(v,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(v,"tspan");return n.textContent=r,i.appendChild(n),i}function c(e,t,r){e.setAttribute("transform","translate(100,100) rotate("+r+")"),t.setAttribute("transform","rotate("+r+")")}function d(e,t){var r=t.alpha,i=1-r;return P.red=e.red*i+t.red*r,P.green=e.green*i+t.green*r,P.blue=e.blue*i+t.blue*r,P.toCssColorString()}function h(e,t,r){return l({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":r},{tagName:"title",textContent:""}]})}function p(e,t,r){return l({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":r},{tagName:"title",textContent:""}]})}function f(e,t){var r=e._viewModel,i=r.shuttleRingDragging;if(!i||_===e)if("mousedown"===t.type||i&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||i&&"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),!i&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),d=n-a-u.left,h=o-s-u.top,p=180*Math.atan2(h,d)/Math.PI+90;p>180&&(p-=360);var f=r.shuttleRingAngle;i||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(_=e,r.shuttleRingDragging=!0,r.shuttleRingAngle=p):p<f?r.slower():p>f&&r.faster(),t.preventDefault()}else e===_&&(_=void 0),r.shuttleRingDragging=!1}function m(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var r=this;this._clickFunction=function(){var e=r._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 g(e,t){function r(e){f(A,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 i=document.createElement("style");i.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(i,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 d=document.createElementNS(v,"g");this._topG=d,this._realtimeSVG=new m(p(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new m(h(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new m(h(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new m(h(84,99,"#animation_pathPause"),t.pauseViewModel);var g=document.createElementNS(v,"g");g.appendChild(this._realtimeSVG.svgElement),g.appendChild(this._playReverseSVG.svgElement),g.appendChild(this._playForwardSVG.svgElement),g.appendChild(this._pauseSVG.svgElement);var _=l({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=_;var b=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=b,this._shuttleRingPointer=l({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var C=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var S=l({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:61});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var T=l({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:61}),w=document.createElementNS(v,"g");w.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),d.appendChild(w),d.appendChild(C),d.appendChild(g),w.appendChild(_),w.appendChild(b),w.appendChild(this._shuttleRingPointer),C.appendChild(this._knobOuter),C.appendChild(S),C.appendChild(this._knobDate),C.appendChild(this._knobTime),C.appendChild(this._knobStatus),C.appendChild(T),s.appendChild(d),e.appendChild(s);var A=this;this._mouseCallback=r,_.addEventListener("mousedown",r,!0),_.addEventListener("touchstart",r,!0),b.addEventListener("mousedown",r,!0),b.addEventListener("touchstart",r,!0),document.addEventListener("mousemove",r,!0),document.addEventListener("touchmove",r,!0),document.addEventListener("mouseup",r,!0),document.addEventListener("touchend",r,!0),document.addEventListener("touchcancel",r,!0),this._shuttleRingPointer.addEventListener("mousedown",r,!0),this._shuttleRingPointer.addEventListener("touchstart",r,!0),this._knobOuter.addEventListener("mousedown",r,!0),this._knobOuter.addEventListener("touchstart",r,!0);var E,x=this._knobTime.childNodes[0],P=this._knobDate.childNodes[0],I=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){E!==e&&(E=e,E?A._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):A._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(A._shuttleRingPointer,A._knobOuter,e)}),a(t,"dateLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"timeLabel",function(e){x.textContent!==e&&(x.textContent=e)}),a(t,"multiplierLabel",function(e){I.textContent!==e&&(I.textContent=e)})],this.applyThemeChanges(),this.resize()}var _,v="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",b=e.fromCssColorString("rgba(247,250,255,0.384)"),C=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),T=e.fromCssColorString("rgba(255,255,255,0.086)"),w=e.fromCssColorString("rgba(255,255,255,0.267)"),A=e.fromCssColorString("rgba(255,255,255,0)"),E=e.fromCssColorString("rgba(66,67,68,0.3)"),x=e.fromCssColorString("rgba(0,0,0,0.5)"),P=new e;return m.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,r=e.length;t<r;t++)e[t].dispose();i(this)},m.prototype.isDestroyed=function(){return!1},m.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")}},m.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")))},m.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},r(g.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){t(this._observer)&&(this._observer.disconnect(),this._observer=void 0);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 r=this._subscriptions,n=0,o=r.length;n<o;n++)r[n].dispose();return i(this)},g.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var r=this._svgNode,i=e,n=t;0===e&&0===t?(i=200,n=132):0===e?(n=t,i=t/132*200):0===t&&(i=e,n=e/200*132);var o=i/200,a=n/132;r.style.cssText="width: "+i+"px; height: "+n+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",r.setAttribute("width",i),r.setAttribute("height",n),r.setAttribute("viewBox","0 0 "+i+" "+n),this._topG.setAttribute("transform","scale("+o+","+a+")"),this._centerX=Math.max(1,100*o),this._centerY=Math.max(1,100*a),this._lastHeight=e,this._lastWidth=t}},g.prototype.applyThemeChanges=function(){if(!document.body.contains(this._container)){if(t(this._observer))return;var e=this;return e._observer=new MutationObserver(function(){document.body.contains(e._container)&&(e._observer.disconnect(),e._observer=void 0,e.applyThemeChanges())}),void e._observer.observe(document,{childList:!0,subtree:!0})}var r=s(this._themeNormal),i=s(this._themeHover),n=s(this._themeSelect),o=s(this._themeDisabled),a=s(this._themeKnob),u=s(this._themePointer),c=s(this._themeSwoosh),h=s(this._themeSwooshHover),p=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(r,b)},{tagName:"stop",offset:"12%","stop-color":d(r,C)},{tagName:"stop",offset:"46%","stop-color":d(r,S)},{tagName:"stop",offset:"81%","stop-color":d(r,T)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(i,b)},{tagName:"stop",offset:"12%","stop-color":d(i,C)},{tagName:"stop",offset:"46%","stop-color":d(i,S)},{tagName:"stop",offset:"81%","stop-color":d(i,T)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(n,b)},{tagName:"stop",offset:"12%","stop-color":d(n,C)},{tagName:"stop",offset:"46%","stop-color":d(n,S)},{tagName:"stop",offset:"81%","stop-color":d(n,T)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(o,w)},{tagName:"stop",offset:"75%","stop-color":d(o,A)}]},{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":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_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":h.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":h.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":h.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":u.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":u.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":d(u,x)},{tagName:"stop",offset:"100%","stop-color":d(u,x)}]},{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":d(a,b)},{tagName:"stop",offset:"60%","stop-color":d(a,E)},{tagName:"stop",offset:"85%","stop-color":d(a,C)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":d(a,E)},{tagName:"stop",offset:"60%","stop-color":d(a,b)},{tagName:"stop",offset:"85%","stop-color":d(a,T)}]},{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(p,this._defsElement):this._svgNode.appendChild(p),this._defsElement=p},g}),define("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,r,i,n,o){"use strict";function a(t,i){function a(){var e,r={args:arguments,cancel:!1};return s.raiseEvent(r),r.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}i=e(i,!0);var s=new n,l=new n;return a.canExecute=i,o.track(a,["canExecute"]),r(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),define("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,r,i,n){"use strict";function o(t,r){this._command=t,r=e(r,e.EMPTY_OBJECT),this.toggled=e(r.toggled,!1),this.tooltip=e(r.tooltip,""),n.track(this,["toggled","tooltip"])}return r(o.prototype,{command:{get:function(){return this._command}}}),o}),define("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,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t){return e-t}function h(t,r){var i=e(r,t,d);return i<0?~i:i}function p(e,t){if(Math.abs(e)<=_)return e/_;var r,i,n=_,o=v;return e>0?(r=Math.log(t[t.length-1]),i=(r-0)/(o-n),Math.exp(0+i*(e-n))):(r=Math.log(-t[0]),i=(r-0)/(o-n),-Math.exp(0+i*(Math.abs(e)-n)))}function f(e,t,i){if(i.clockStep===r.SYSTEM_CLOCK)return _;if(Math.abs(e)<=1)return e*_;var n=t[t.length-1];e>n?e=n:e<-n&&(e=-n);var o,a,s=_,l=v;return e>0?(o=Math.log(n),a=(o-0)/(l-s),(Math.log(e)-0)/a+s):(o=Math.log(-t[0]),a=(o-0)/(l-s),-((Math.log(Math.abs(e))-0)/a+s))}function m(e){var i=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=m.defaultDateFormatter,this._timeFormatter=m.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(m.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return i._timeFormatter(i._clockViewModel.currentTime,i)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return i._dateFormatter(i._clockViewModel.currentTime,i)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=i._clockViewModel;if(e.clockStep===r.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 f(e.multiplier,i._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,v),-v);var t=i._allShuttleRingTicks,n=i._clockViewModel;if(n.clockStep=r.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(i.snapToTicks)o=t[h(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>_?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=i._clockViewModel,r=e.clockRange;if(i.shuttleRingDragging||r===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(r===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=i._clockViewModel;if(e.clockRange===t.UNBOUNDED)return!0;var r=e.systemTime;return a.greaterThanOrEquals(r,e.startTime)&&a.lessThanOrEquals(r,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return i._clockViewModel.shouldAnimate&&(i._canAnimate||i.shuttleRingDragging)});var n=u(function(){var e=i._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:i._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!i._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=i._clockViewModel,t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return i._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=i._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return i._isAnimating&&e.multiplier>0&&e.clockStep!==r.SYSTEM_CLOCK}),tooltip:"Play Forward"});var d=u(function(){i._clockViewModel.clockStep=r.SYSTEM_CLOCK},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(d,{toggled:s.computed(function(){return e.clockStep===r.SYSTEM_CLOCK}),tooltip:s.computed(function(){return i._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=i._clockViewModel,t=i._allShuttleRingTicks,r=e.multiplier,n=h(r,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=i._clockViewModel,t=i._allShuttleRingTicks,r=e.multiplier,n=h(r,t)+1;n<t.length&&(e.multiplier=t[n])})}var g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],_=15,v=105;return m.defaultDateFormatter=function(e,t){var r=a.toGregorianDate(e);return g[r.month-1]+" "+r.day+" "+r.year},m.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],m.defaultTimeFormatter=function(e,t){var r=a.toGregorianDate(e),i=Math.round(r.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",r.hour,r.minute,r.second,i):l("%02d:%02d:%02d UTC",r.hour,r.minute,r.second)},m.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},m.prototype.setShuttleRingTicks=function(e){var t,r,i,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,r=e.length;t<r;++t)i=e[t],n.hasOwnProperty(i)||(n[i]=!0,o.push(i));o.sort(d);var a=[];for(r=o.length,t=r-1;t>=0;--t)0!==(i=o[t])&&a.push(-i);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(m.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}}}),m._maxShuttleRingAngle=v,m._realtimeShuttleRingAngle=_,m}),define("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s){"use strict";function l(r){r=e(r,e.EMPTY_OBJECT);var i=r.globe,l=e(r.imageryProviderViewModels,[]),u=e(r.terrainProviderViewModels,[]);this._globe=i,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,r=this.selectedTerrain,i=t(e)?e.name:void 0,n=t(r)?r.name:void 0;return t(i)&&t(n)?i+"\n"+n:t(i)?i:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;if(t(e))return e.iconUrl}),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 r,i=this._currentImageryProviders,n=i.length,a=this._globe.imageryLayers,s=!1;for(r=0;r<n;r++)for(var l=a.length,u=0;u<l;u++){var d=a.get(u);if(d.imageryProvider===i[r]){a.remove(d),s=!0;break}}if(t(e)){var h=e.creationCommand();if(o(h)){var p=h.length;for(r=p-1;r>=0;r--)a.addImageryProvider(h[r],0);this._currentImageryProviders=h.slice(0)}else if(this._currentImageryProviders=[h],s)a.addImageryProvider(h,0);else{var f=a.get(0);t(f)&&a.remove(f),a.addImageryProvider(h,0)}}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var d=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(e){if(d()===e)return void(this.dropDownVisible=!1);var r;t(e)&&(r=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(r instanceof n),this._globe.terrainProvider=r,d(e),this.dropDownVisible=!1}});var h=this;this._toggleDropDown=s(function(){h.dropDownVisible=!h.dropDownVisible}),this.selectedImagery=e(r.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(r.selectedTerrainProviderViewModel,u[0])}return r(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),define("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e=a(e);var r=new s(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.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 d=document.createElement("div");d.className="cesium-baseLayerPicker-choices",d.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(d);var h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),d.appendChild(h);var p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);var f=document.createElement("div");f.className="cesium-baseLayerPicker-itemLabel",f.setAttribute("data-bind","text: name"),h.appendChild(f);var m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",u.appendChild(m);var g=document.createElement("div");g.className="cesium-baseLayerPicker-choices",g.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(g);var _=document.createElement("div");_.className="cesium-baseLayerPicker-item",_.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),g.appendChild(_);var v=document.createElement("img");v.className="cesium-baseLayerPicker-itemIcon",v.setAttribute("data-bind","attr: { src: iconUrl }"),v.setAttribute("draggable","false"),_.appendChild(v);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),_.appendChild(y),o.applyBindings(r,i),o.applyBindings(r,u),this._viewModel=r,this._container=e,this._element=i,this._dropPanel=u,this._closeDropDown=function(e){i.contains(e.target)||u.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))}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),r(this)},l}),define("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n){"use strict";function o(t){var r=t.creationFunction;e(r.canExecute)||(r=n(r)),this._creationCommand=r,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,i.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),
define("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/IonImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(){var u=[];return u.push(new l({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 r({url:"https://dev.virtualearth.net",mapStyle:i.AERIAL})}})),u.push(new l({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 r({url:"https://dev.virtualearth.net",mapStyle:i.AERIAL_WITH_LABELS})}})),u.push(new l({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 r({url:"https://dev.virtualearth.net",mapStyle:i.ROAD})}})),u.push(new l({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new s({mapId:"mapbox.satellite"})}})),u.push(new l({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new s({mapId:"mapbox.streets"})}})),u.push(new l({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 s({mapId:"mapbox.streets-basic"})}})),u.push(new l({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})}})),u.push(new l({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})}})),u.push(new l({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})}})),u.push(new l({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/"})}})),u.push(new l({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."})}})),u.push(new l({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."})}})),u.push(new l({name:"Sentinel-2",iconUrl:e("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",creationFunction:function(){return new a({assetId:3954})}})),u.push(new l({name:"Blue Marble",iconUrl:e("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",creationFunction:function(){return new a({assetId:3845})}})),u.push(new l({name:"Earth at night",iconUrl:e("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",creationFunction:function(){return new a({assetId:3812})}})),u.push(new l({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")})}})),u}return u}),define("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/createWorldTerrain","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,r,i){"use strict";function n(){var n=[];return n.push(new i({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new r}})),n.push(new i({name:"Cesium World Terrain",iconUrl:e("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",creationFunction:function(){return t({requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),define("Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel",["../../Core/Check","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/Cesium3DTileColorBlendMode","../../Scene/Cesium3DTileFeature","../../Scene/Cesium3DTileset","../../Scene/Cesium3DTileStyle","../../Scene/PerformanceDisplay","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){return function(t){var i=e._scene.pick(t.position);r(i)&&i.primitive instanceof u&&(e.tileset=i.primitive),e.pickActive=!1}}function f(e,t){t?e._eventHandler.setInputAction(function(t){var i=e._scene.pick(t.endPosition);r(i)&&i.primitive instanceof u&&(e.tileset=i.primitive)},a.MOUSE_MOVE):(e._eventHandler.removeInputAction(a.MOUSE_MOVE),e.picking=e.picking)}function m(e){var t=e/1048576;return t<1?t.toLocaleString(void 0,y):Math.round(t).toLocaleString()}function g(e,t){if(!r(e))return"";var i=e.statistics,n='<ul class="cesium-cesiumInspector-statistics">';return n+="<li><strong>Visited: </strong>"+i.visited.toLocaleString()+"</li><li><strong>Selected: </strong>"+e._selectedTiles.length.toLocaleString()+"</li><li><strong>Commands: </strong>"+i.numberOfCommands.toLocaleString()+"</li>",n+="</ul>",t||(n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Requests: </strong>"+i.numberOfPendingRequests.toLocaleString()+"</li><li><strong>Attempted: </strong>"+i.numberOfAttemptedRequests.toLocaleString()+"</li><li><strong>Processing: </strong>"+i.numberOfTilesProcessing.toLocaleString()+"</li><li><strong>Content Ready: </strong>"+i.numberOfTilesWithContentReady.toLocaleString()+"</li><li><strong>Total: </strong>"+i.numberOfTilesTotal.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Features Selected: </strong>"+i.numberOfFeaturesSelected.toLocaleString()+"</li><li><strong>Features Loaded: </strong>"+i.numberOfFeaturesLoaded.toLocaleString()+"</li><li><strong>Points Selected: </strong>"+i.numberOfPointsSelected.toLocaleString()+"</li><li><strong>Points Loaded: </strong>"+i.numberOfPointsLoaded.toLocaleString()+"</li><li><strong>Triangles Selected: </strong>"+i.numberOfTrianglesSelected.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Tiles styled: </strong>"+i.numberOfTilesStyled.toLocaleString()+"</li><li><strong>Features styled: </strong>"+i.numberOfFeaturesStyled.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Children Union Culled: </strong>"+i.numberOfTilesCulledWithChildrenUnion.toLocaleString()+"</li>",n+="</ul>",n+='<ul class="cesium-cesiumInspector-statistics">',n+="<li><strong>Geometry Memory (MB): </strong>"+m(i.geometryByteLength)+"</li><li><strong>Texture Memory (MB): </strong>"+m(i.texturesByteLength)+"</li><li><strong>Batch Table Memory (MB): </strong>"+m(i.batchTableByteLength)+"</li>",n+="</ul>"),n}function _(e,t){var i=this,n=e.canvas;this._eventHandler=new o(n),this._scene=e,this._performanceContainer=t,this._canvas=n,this._performanceDisplay=new d({container:t}),this._statisticsText="",this._pickStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this._tileset=void 0,this._feature=void 0,this._tile=void 0,h.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_editorError","showPickStatistics","showStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile"]),this._properties=h.observable({}),this.properties=[],h.defineProperty(this,"properties",function(){var e=[],t=i._properties();for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e});var u=h.observable();h.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return u()},set:function(e){u(e),r(i._tileset)&&(i._tileset.dynamicScreenSpaceError=e)}}),this.dynamicScreenSpaceError=!1;var c=h.observable();h.defineProperty(this,"colorBlendMode",{get:function(){return c()},set:function(e){c(e),r(i._tileset)&&(i._tileset.colorBlendMode=e,i._scene.requestRender())}}),this.colorBlendMode=s.HIGHLIGHT;var m=h.observable();h.defineProperty(this,"picking",{get:function(){return m()},set:function(t){m(t),t?i._eventHandler.setInputAction(function(t){var n=e.pick(t.endPosition);if(n instanceof l?(i.feature=n,i.tile=n.content.tile):r(n)&&r(n.content)?(i.feature=void 0,i.tile=n.content.tile):(i.feature=void 0,i.tile=void 0),r(i._tileset)){if(S&&r(n)&&r(n.content)){var o;e.pickPositionSupported&&(o=e.pickPosition(t.endPosition),r(o)&&(i._tileset.debugPickPosition=o)),i._tileset.debugPickedTile=n.content.tile}else i._tileset.debugPickedTile=void 0;i._scene.requestRender()}},a.MOUSE_MOVE):(i.feature=void 0,i.tile=void 0,i._eventHandler.removeInputAction(a.MOUSE_MOVE))}}),this.picking=!0;var g=h.observable();h.defineProperty(this,"colorize",{get:function(){return g()},set:function(e){g(e),r(i._tileset)&&(i._tileset.debugColorizeTiles=e,i._scene.requestRender())}}),this.colorize=!1;var _=h.observable();h.defineProperty(this,"wireframe",{get:function(){return _()},set:function(e){_(e),r(i._tileset)&&(i._tileset.debugWireframe=e,i._scene.requestRender())}}),this.wireframe=!1;var v=h.observable();h.defineProperty(this,"showBoundingVolumes",{get:function(){return v()},set:function(e){v(e),r(i._tileset)&&(i._tileset.debugShowBoundingVolume=e,i._scene.requestRender())}}),this.showBoundingVolumes=!1;var y=h.observable();h.defineProperty(this,"showContentBoundingVolumes",{get:function(){return y()},set:function(e){y(e),r(i._tileset)&&(i._tileset.debugShowContentBoundingVolume=e,i._scene.requestRender())}}),this.showContentBoundingVolumes=!1;var b=h.observable();h.defineProperty(this,"showRequestVolumes",{get:function(){return b()},set:function(e){b(e),r(i._tileset)&&(i._tileset.debugShowViewerRequestVolume=e,i._scene.requestRender())}}),this.showRequestVolumes=!1;var C=h.observable();h.defineProperty(this,"freezeFrame",{get:function(){return C()},set:function(e){C(e),r(i._tileset)&&(i._tileset.debugFreezeFrame=e,i._scene.debugShowFrustumPlanes=e,i._scene.requestRender())}}),this.freezeFrame=!1;var S=h.observable();h.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return S()},set:function(e){S(e),r(i._tileset)&&(i._tileset.debugPickedTileLabelOnly=e,i._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;var T=h.observable();h.defineProperty(this,"showGeometricError",{get:function(){return T()},set:function(e){T(e),r(i._tileset)&&(i._tileset.debugShowGeometricError=e,i._scene.requestRender())}}),this.showGeometricError=!1;var w=h.observable();h.defineProperty(this,"showRenderingStatistics",{get:function(){return w()},set:function(e){w(e),r(i._tileset)&&(i._tileset.debugShowRenderingStatistics=e,i._scene.requestRender())}}),this.showRenderingStatistics=!1;var A=h.observable();h.defineProperty(this,"showMemoryUsage",{get:function(){return A()},set:function(e){A(e),r(i._tileset)&&(i._tileset.debugShowMemoryUsage=e,i._scene.requestRender())}}),this.showMemoryUsage=!1;var E=h.observable();h.defineProperty(this,"showUrl",{get:function(){return E()},set:function(e){E(e),r(i._tileset)&&(i._tileset.debugShowUrl=e,i._scene.requestRender())}}),this.showUrl=!1;var x=h.observable();h.defineProperty(this,"maximumScreenSpaceError",{get:function(){return x()},set:function(e){e=Number(e),isNaN(e)||(x(e),r(i._tileset)&&(i._tileset.maximumScreenSpaceError=e))}}),this.maximumScreenSpaceError=16;var P=h.observable();h.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return P()},set:function(e){e=Number(e),isNaN(e)||(P(e),r(i._tileset)&&(i._tileset.dynamicScreenSpaceErrorDensity=e))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,h.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(P(),1/6)},set:function(e){P(Math.pow(e,6))}});var I=h.observable();h.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return I()},set:function(e){e=Number(e),isNaN(e)||(I(e),r(i._tileset)&&(i._tileset.dynamicScreenSpaceErrorFactor=e))}}),this.dynamicScreenSpaceErrorFactor=4;var D=p(this),O=h.observable();h.defineProperty(this,"pickActive",{get:function(){return O()},set:function(e){O(e),e?i._eventHandler.setInputAction(D,a.LEFT_CLICK):i._eventHandler.removeInputAction(a.LEFT_CLICK)}});var M=h.observable();h.defineProperty(this,"pointCloudShading",{get:function(){return M()},set:function(e){M(e),r(i._tileset)&&(i._tileset.pointCloudShading.attenuation=e)}}),this.pointCloudShading=!1;var R=h.observable();h.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(e){e=Number(e),isNaN(e)||(R(e),r(i._tileset)&&(i._tileset.pointCloudShading.geometricErrorScale=e))}}),this.geometricErrorScale=1;var L=h.observable();h.defineProperty(this,"maximumAttenuation",{get:function(){return L()},set:function(e){e=Number(e),isNaN(e)||(L(e),r(i._tileset)&&(i._tileset.pointCloudShading.maximumAttenuation=0===e?void 0:e))}}),this.maximumAttenuation=0;var N=h.observable();h.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(e){e=Number(e),isNaN(e)||(N(e),r(i._tileset)&&(i._tileset.pointCloudShading.baseResolution=0===e?void 0:e))}}),this.baseResolution=0;var k=h.observable();h.defineProperty(this,"eyeDomeLighting",{get:function(){return k()},set:function(e){k(e),r(i._tileset)&&(i._tileset.pointCloudShading.eyeDomeLighting=e)}}),this.eyeDomeLighting=!1;var F=h.observable();h.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return F()},set:function(e){e=Number(e),isNaN(e)||(F(e),r(i._tileset)&&(i._tileset.pointCloudShading.eyeDomeLightingStrength=e))}}),this.eyeDomeLightingStrength=1;var B=h.observable();h.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return B()},set:function(e){e=Number(e),isNaN(e)||(B(e),r(i._tileset)&&(i._tileset.pointCloudShading.eyeDomeLightingRadius=e))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;var U=h.observable();h.defineProperty(this,"skipLevelOfDetail",{get:function(){return U()},set:function(e){U(e),r(i._tileset)&&(i._tileset.skipLevelOfDetail=e)}}),this.skipLevelOfDetail=!0;var V=h.observable();h.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return V()},set:function(e){e=Number(e),isNaN(e)||(V(e),r(i._tileset)&&(i._tileset.skipScreenSpaceErrorFactor=e))}}),this.skipScreenSpaceErrorFactor=16;var z=h.observable();h.defineProperty(this,"baseScreenSpaceError",{get:function(){return z()},set:function(e){e=Number(e),isNaN(e)||(z(e),r(i._tileset)&&(i._tileset.baseScreenSpaceError=e))}}),this.baseScreenSpaceError=1024;var G=h.observable();h.defineProperty(this,"skipLevels",{get:function(){return G()},set:function(e){e=Number(e),isNaN(e)||(G(e),r(i._tileset)&&(i._tileset.skipLevels=e))}}),this.skipLevels=1;var H=h.observable();h.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return H()},set:function(e){H(e),r(i._tileset)&&(i._tileset.immediatelyLoadDesiredLevelOfDetail=e)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;var W=h.observable();h.defineProperty(this,"loadSiblings",{get:function(){W()},set:function(e){W(e),r(i._tileset)&&(i._tileset.loadSiblings=e)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){i._update()}),r(this._tileset)||f(this,!0)}function v(e){if(e.featuresLength>0)return!0;var t=e.innerContents;if(r(t)){for(var i=t.length,n=0;n<i;++n)if(!v(t[n]))return!1;return!0}return!1}var y={maximumFractionDigits:3},b=[{text:"Highlight",value:s.HIGHLIGHT},{text:"Replace",value:s.REPLACE},{text:"Mix",value:s.MIX}],C=new t(1,1,0,.4),S=new t,T=new t;return i(_.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},colorBlendModes:{get:function(){return b}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,r(e)){var t=this;e.readyPromise.then(function(e){t.isDestroyed()||t._properties(e.properties)});for(var i=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=i.length,o=0;o<n;++o){var a=i[o];this[a]=this[a]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings;var s=e.pointCloudShading;this.pointCloudShading=s.attenuation,this.geometricErrorScale=s.geometricErrorScale,this.maximumAttenuation=s.maximumAttenuation?s.maximumAttenuation:0,this.baseResolution=s.baseResolution?s.baseResolution:0,this.eyeDomeLighting=s.eyeDomeLighting,this.eyeDomeLightingStrength=s.eyeDomeLightingStrength,this.eyeDomeLightingRadius=s.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=g(e,!1),this._pickStatisticsText=g(e,!0),f(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature!==e){var i=this._feature;if(r(i)&&!i.content.isDestroyed()){var n=this._scene.frameState;!this.colorize&&r(this._style)?i.color=r(this._style.color)?this._style.color.evaluateColor(n,i,S):t.WHITE:i.color=T,this._scene.requestRender()}r(e)&&(t.clone(e.color,T),e.color=C,this._scene.requestRender()),this._feature=e}}},tile:{get:function(){return this._tile},set:function(e){if(this._tile!==e){var i=this._tile;!r(i)||i.isDestroyed()||v(i.content)||(i.color=T,this._scene.requestRender()),r(e)&&!v(e.content)&&(t.clone(e.color,T),e.color=C,this._scene.requestRender()),this._tile=e}}}}),_.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive},_.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible},_.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible},_.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible},_.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible},_.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible},_.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible},_.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible},_.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible},_.prototype.trimTilesCache=function(){r(this._tileset)&&this._tileset.trimLoadedTiles()},_.prototype.compileStyle=function(){var e=this._tileset;if(r(e)&&this.styleString!==JSON.stringify(e.style)){this._editorError="";try{0===this.styleString.length&&(this.styleString="{}"),this._style=new c(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(e){this._editorError=e.toString()}this.feature=this._feature,this.tile=this._tile}},_.prototype.styleEditorKeyPress=function(e,t){if(9===t.keyCode){t.preventDefault();var r,i=t.target,n=i.selectionStart,o=i.selectionEnd,a=o,s=i.value.slice(n,o),l=s.split("\n"),u=l.length;if(t.shiftKey)for(r=0;r<u;++r)" "===l[r][0]&&(" "===l[r][1]?(l[r]=l[r].substr(2),a-=2):(l[r]=l[r].substr(1),a-=1));else for(r=0;r<u;++r)l[r]="  "+l[r],a+=2;var c=l.join("\n");i.value=i.value.slice(0,n)+c+i.value.slice(o),i.selectionStart=n!==o?n:a,i.selectionEnd=a}else!t.ctrlKey||10!==t.keyCode&&13!==t.keyCode||this.compileStyle();return!0},_.prototype._update=function(){var e=this._tileset;if(this.performance&&this._performanceDisplay.update(),r(e)){if(e.isDestroyed())return this.tile=void 0,this.feature=void 0,void(this.tileset=void 0);var t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null,"  ")))}this.showStatistics&&(this._statisticsText=g(e,!1),this._pickStatisticsText=g(e,!0))},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();var e=this;return this._definedProperties.forEach(function(t){h.getObservable(e,t).dispose()}),n(this)},_.getStatistics=g,_});define("Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector",["../../Core/Check","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../ThirdParty/knockout","../getElement","./Cesium3DTilesInspectorViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,r){e.defined("container",t),e.typeOf.object("scene",r),t=a(t);var i=document.createElement("div"),n=document.createElement("div");n.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : performance, "cesium-cesiumInspector-hide" : !performance}');var l=new s(r,n);this._viewModel=l,this._container=t,this._element=i;var p=document.createElement("div");p.textContent="3D Tiles Inspector",p.className="cesium-cesiumInspector-button",p.setAttribute("data-bind","click: toggleInspector"),i.appendChild(p),i.className="cesium-cesiumInspector cesium-3DTilesInspector",i.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),t.appendChild(i);var f=document.createElement("div"),m=document.createElement("div"),g=document.createElement("div"),_=document.createElement("div"),v=document.createElement("div"),y=document.createElement("div"),b=document.createElement("div"),C=document.createElement("div");C.className="field-group";var S=document.createElement("label");S.className="field-label",S.appendChild(document.createTextNode("Properties: "));var T=document.createElement("div");T.setAttribute("data-bind","text: properties"),C.appendChild(S),C.appendChild(T),f.appendChild(C),f.appendChild(h("togglePickTileset","Pick Tileset","pickActive")),f.appendChild(h("trimTilesCache","Trim Tiles Cache")),f.appendChild(c("picking","Enable Picking")),m.appendChild(c("colorize","Colorize")),m.appendChild(c("wireframe","Wireframe")),m.appendChild(c("showBoundingVolumes","Bounding Volumes")),m.appendChild(c("showContentBoundingVolumes","Content Volumes")),m.appendChild(c("showRequestVolumes","Request Volumes")),m.appendChild(c("pointCloudShading","Point Cloud Shading"));var w=document.createElement("div");w.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : pointCloudShading, "cesium-cesiumInspector-hide" : !pointCloudShading}'),w.appendChild(d("geometricErrorScale",0,2,.01,"Geometric Error Scale")),w.appendChild(d("maximumAttenuation",0,32,1,"Maximum Attenuation")),w.appendChild(d("baseResolution",0,1,.01,"Base Resolution")),w.appendChild(c("eyeDomeLighting","Eye Dome Lighting (EDL)")),m.appendChild(w);var A=document.createElement("div");A.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : eyeDomeLighting, "cesium-cesiumInspector-hide" : !eyeDomeLighting}'),A.appendChild(d("eyeDomeLightingStrength",0,2,.1,"EDL Strength")),A.appendChild(d("eyeDomeLightingRadius",0,4,.1,"EDL Radius")),w.appendChild(A),g.appendChild(c("freezeFrame","Freeze Frame")),g.appendChild(c("dynamicScreenSpaceError","Dynamic Screen Space Error"));var E=document.createElement("div");E.appendChild(d("maximumScreenSpaceError",0,128,1,"Maximum Screen Space Error")),g.appendChild(E);var x=document.createElement("div");x.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : dynamicScreenSpaceError, "cesium-cesiumInspector-hide" : !dynamicScreenSpaceError}'),x.appendChild(d("dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"Screen Space Error Density","dynamicScreenSpaceErrorDensity")),x.appendChild(d("dynamicScreenSpaceErrorFactor",1,10,.1,"Screen Space Error Factor")),g.appendChild(x),_.appendChild(c("performance","Performance")),_.appendChild(n),_.appendChild(c("showStatistics","Statistics"));var P=document.createElement("div");P.className="cesium-3dTilesInspector-statistics",P.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),_.appendChild(P),_.appendChild(c("showPickStatistics","Pick Statistics"));var I=document.createElement("div");I.className="cesium-3dTilesInspector-statistics",I.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),_.appendChild(I),y.appendChild(document.createTextNode("Color Blend Mode: "));var D=document.createElement("select");D.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),y.appendChild(D);var O=document.createElement("textarea");O.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),y.className="cesium-cesiumInspector-styleEditor",y.appendChild(O);var M=h("compileStyle","Compile (Ctrl+Enter)");y.appendChild(M);var R=document.createElement("div");R.className="cesium-cesiumInspector-error",R.setAttribute("data-bind","text: editorError"),y.appendChild(R),v.appendChild(c("showOnlyPickedTileDebugLabel","Show Picked Only")),v.appendChild(c("showGeometricError","Geometric Error")),v.appendChild(c("showRenderingStatistics","Rendering Statistics")),v.appendChild(c("showMemoryUsage","Memory Usage (MB)")),v.appendChild(c("showUrl","Url")),b.appendChild(c("skipLevelOfDetail","Skip Tile LODs"));var L=document.createElement("div");L.appendChild(d("skipScreenSpaceErrorFactor",1,50,1,"Skip SSE Factor")),b.appendChild(L);var N=document.createElement("div");N.appendChild(d("baseScreenSpaceError",0,4096,1,"SSE before skipping LOD")),b.appendChild(N);var k=document.createElement("div");k.appendChild(d("skipLevels",0,10,1,"Min. levels to skip")),b.appendChild(k),b.appendChild(c("immediatelyLoadDesiredLevelOfDetail","Load only tiles that meet the max. SSE.")),b.appendChild(c("loadSiblings","Load siblings of visible tiles."));var F=u("Tileset","tilesetVisible","toggleTileset",f),B=u("Display","displayVisible","toggleDisplay",m),U=u("Update","updateVisible","toggleUpdate",g),V=u("Logging","loggingVisible","toggleLogging",_),z=u("Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels",v),G=u("Style","styleVisible","toggleStyle",y),H=u("Optimization","optimizationVisible","toggleOptimization",b);i.appendChild(F),i.appendChild(B),i.appendChild(U),i.appendChild(V),i.appendChild(z),i.appendChild(G),i.appendChild(H),o.applyBindings(l,i)}function u(e,t,r,i){var n=document.createElement("span");n.className="cesium-cesiumInspector-toggleSwitch",n.setAttribute("data-bind","text: "+t+' ? "-" : "+", click: '+r);var o=document.createElement("div");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(n),o.appendChild(document.createTextNode(e));var a=document.createElement("div");a.className="cesium-cesiumInspector-section",
a.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : '+t+', "cesium-cesiumInspector-hide" : !'+t+"}"),a.appendChild(i);var s=document.createElement("div");return s.className="cesium-cesiumInspector-dropDown",s.appendChild(o),s.appendChild(a),s}function c(e,t){var r=document.createElement("input");r.type="checkbox",r.setAttribute("data-bind","checked: "+e);var i=document.createElement("div");return i.appendChild(r),i.appendChild(document.createTextNode(t)),i}function d(e,r,i,n,o,a){a=t(a,e);var s=document.createElement("input");s.setAttribute("data-bind","value: "+a),s.type="number";var l=document.createElement("input");l.type="range",l.min=r,l.max=i,l.step=n,l.setAttribute("data-bind",'valueUpdate: "input", value: '+e);var u=document.createElement("div");u.appendChild(l);var c=document.createElement("div");return c.className="cesium-cesiumInspector-slider",c.appendChild(document.createTextNode(o)),c.appendChild(s),c.appendChild(u),c}function h(e,t,i){var n=document.createElement("button");n.type="button",n.textContent=t,n.className="cesium-cesiumInspector-pickButton";var o="click: "+e;return r(i)&&(o+=', css: {"cesium-cesiumInspector-pickButtonHighlight" : '+i+"}"),n.setAttribute("data-bind",o),n}return i(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 o.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),n(this)},l}),define("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,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t){var r;if(e(t)){r="Command Statistics";var i=t.commandsInFrustums;for(var n in i)if(i.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 ")}r+="<br>&nbsp;&nbsp;&nbsp;&nbsp;"+i[n]+" in frustum "+o}r+="<br>Total: "+t.totalCommands}return r}function p(e,t,r){var i=Math.min(r,t);return i=Math.max(i,e)}function f(t,r){function i(t){var r=f._scene.pick({x:t.position.x,y:t.position.y});e(r)&&(f.primitive=e(r.collection)?r.collection:r.primitive),f._scene.requestRender(),f.pickPrimitiveActive=!1}function h(t){var r,i=_.ellipsoid,o=f._scene.camera.pickEllipsoid({x:t.position.x,y:t.position.y},i);if(e(o))for(var a=i.cartesianToCartographic(o),s=_._surface.tileProvider._tilesToRenderByTextureCount,l=0;!r&&l<s.length;++l){var u=s[l];if(e(u))for(var c=0;!r&&c<u.length;++c){var d=u[c];n.contains(d.rectangle,a)&&(r=d)}}f.tile=r,f.pickTileActive=!1}var f=this,m=t.canvas,g=new o(m);this._eventHandler=g,this._scene=t,this._canvas=m,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=r;var _=this._scene.globe;_.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!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.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",this.generalSwitchText=c.pureComputed(function(){return f.generalVisible?"-":"+"}),this.primitivesSwitchText=c.pureComputed(function(){return f.primitivesVisible?"-":"+"}),this.terrainSwitchText=c.pureComputed(function(){return f.terrainVisible?"-":"+"}),c.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","globeDepth","pickDepth","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=d(function(){f.dropDownVisible=!f.dropDownVisible}),this._toggleGeneral=d(function(){f.generalVisible=!f.generalVisible}),this._togglePrimitives=d(function(){f.primitivesVisible=!f.primitivesVisible}),this._toggleTerrain=d(function(){f.terrainVisible=!f.terrainVisible}),this._frustumsSubscription=c.getObservable(this,"frustums").subscribe(function(e){f._scene.debugShowFrustums=e,f._scene.requestRender()}),this._frustumPlanesSubscription=c.getObservable(this,"frustumPlanes").subscribe(function(e){f._scene.debugShowFrustumPlanes=e,f._scene.requestRender()}),this._performanceSubscription=c.getObservable(this,"performance").subscribe(function(e){e?f._performanceDisplay=new l({container:f._performanceContainer}):f._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=d(function(){return f._primitive.debugShowBoundingVolume=f.primitiveBoundingSphere,f._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=c.getObservable(this,"primitiveBoundingSphere").subscribe(function(){f._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=d(function(){if(f.primitiveReferenceFrame){var t=f._primitive.modelMatrix;f._modelMatrixPrimitive=new s({modelMatrix:t}),f._scene.primitives.add(f._modelMatrixPrimitive)}else e(f._modelMatrixPrimitive)&&(f._scene.primitives.remove(f._modelMatrixPrimitive),f._modelMatrixPrimitive=void 0);return f._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=c.getObservable(this,"primitiveReferenceFrame").subscribe(function(){f._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=d(function(){return f.filterPrimitive?f._scene.debugCommandFilter=function(t){return!(!e(f._modelMatrixPrimitive)||t.owner!==f._modelMatrixPrimitive._primitive)||!!e(f._primitive)&&(t.owner===f._primitive||t.owner===f._primitive._billboardCollection||t.owner.primitive===f._primitive)}:f._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=c.getObservable(this,"filterPrimitive").subscribe(function(){f._doFilterPrimitive(),f._scene.requestRender()}),this._wireframeSubscription=c.getObservable(this,"wireframe").subscribe(function(e){_._surface.tileProvider._debug.wireframe=e,f._scene.requestRender()}),this._globeDepthSubscription=c.getObservable(this,"globeDepth").subscribe(function(e){f._scene.debugShowGlobeDepth=e,f._scene.requestRender()}),this._pickDepthSubscription=c.getObservable(this,"pickDepth").subscribe(function(e){f._scene.debugShowPickDepth=e,f._scene.requestRender()}),this._depthFrustumSubscription=c.getObservable(this,"depthFrustum").subscribe(function(e){f._scene.debugShowDepthFrustum=e,f._scene.requestRender()}),this._incrementDepthFrustum=d(function(){var e=f.depthFrustum+1;return f.depthFrustum=p(1,f._numberOfFrustums,e),f._scene.requestRender(),!0}),this._decrementDepthFrustum=d(function(){var e=f.depthFrustum-1;return f.depthFrustum=p(1,f._numberOfFrustums,e),f._scene.requestRender(),!0}),this._suspendUpdatesSubscription=c.getObservable(this,"suspendUpdates").subscribe(function(e){_._surface._debug.suspendLodUpdate=e,e||(f.filterTile=!1)});var v;this._showTileCoordinates=d(function(){return f.tileCoordinates&&!e(v)?v=t.imageryLayers.addImageryProvider(new u({tilingScheme:t.terrainProvider.tilingScheme})):!f.tileCoordinates&&e(v)&&(t.imageryLayers.remove(v),v=void 0),!0}),this._tileCoordinatesSubscription=c.getObservable(this,"tileCoordinates").subscribe(function(){f._showTileCoordinates(),f._scene.requestRender()}),this._tileBoundingSphereSubscription=c.getObservable(this,"tileBoundingSphere").subscribe(function(){f._showTileBoundingSphere(),f._scene.requestRender()}),this._showTileBoundingSphere=d(function(){return f.tileBoundingSphere?_._surface.tileProvider._debug.boundingSphereTile=f._tile:_._surface.tileProvider._debug.boundingSphereTile=void 0,f._scene.requestRender(),!0}),this._doFilterTile=d(function(){return f.filterTile?(f.suspendUpdates=!0,_._surface._tilesToRender=[],e(f._tile)&&f._tile.renderable&&_._surface._tilesToRender.push(f._tile)):f.suspendUpdates=!1,!0}),this._filterTileSubscription=c.getObservable(this,"filterTile").subscribe(function(){f.doFilterTile(),f._scene.requestRender()}),this._pickPrimitive=d(function(){f.pickPrimitiveActive=!f.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=c.getObservable(this,"pickPrimitiveActive").subscribe(function(e){e?g.setInputAction(i,a.LEFT_CLICK):g.removeInputAction(a.LEFT_CLICK)}),this._pickTile=d(function(){f.pickTileActive=!f.pickTileActive}),this._pickTileActiveSubscription=c.getObservable(this,"pickTileActive").subscribe(function(e){e?g.setInputAction(h,a.LEFT_CLICK):g.removeInputAction(a.LEFT_CLICK)}),this._removePostRenderEvent=t.postRender.addEventListener(function(){f._update()})}return t(f.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},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 d(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return d(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return d(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return d(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return d(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(t){var r=this._primitive;t!==r&&(this.hasPickedPrimitive=!0,e(r)&&(r.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())}},tile:{get:function(){return this._tile},set:function(t){if(e(t)){this.hasPickedTile=!0;if(t!==this._tile){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;var r=t.data;e(r)?this.tileText+="<br>Min: "+r.minimumHeight+" Max: "+r.maximumHeight:this.tileText+="<br>(Tile is not loaded)"}this._tile=t,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}}),f.prototype._update=function(){this.frustums&&(this.frustumStatisticText=h(this._scene.debugFrustumStatistics));var e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=p(1,e,this.depthFrustum),this.depthFrustumText=this.depthFrustum+" of "+e,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText="Cached shaders: "+this._scene.context.shaderCache.numberOfShaders},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._globeDepthSubscription.dispose(),this._pickDepthSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),r(this)},f}),define("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){e=o(e);var r=document.createElement("div"),i=new a(t,r);this._viewModel=i,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 d=document.createElement("span");d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),c.appendChild(d),c.appendChild(document.createTextNode("General")),u.appendChild(c);var h=document.createElement("div");h.className="cesium-cesiumInspector-section",h.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),u.appendChild(h);var p=document.createElement("div");h.appendChild(p);var f=document.createElement("div");f.className="cesium-cesiumInspector-frustumStatistics",f.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" :  !frustums}, html: frustumStatisticText');var m=document.createElement("input");m.type="checkbox",m.setAttribute("data-bind","checked: frustums"),p.appendChild(m),p.appendChild(document.createTextNode("Show Frustums")),p.appendChild(f);var g=document.createElement("div");h.appendChild(g);var _=document.createElement("input");_.type="checkbox",_.setAttribute("data-bind","checked: frustumPlanes"),g.appendChild(_),g.appendChild(document.createTextNode("Show Frustum Planes"));var v=document.createElement("div");h.appendChild(v);var y=document.createElement("input");y.type="checkbox",y.setAttribute("data-bind","checked: performance"),v.appendChild(y),v.appendChild(document.createTextNode("Performance Display")),r.className="cesium-cesiumInspector-performanceDisplay",h.appendChild(r);var b=document.createElement("div");b.className="cesium-cesiumInspector-shaderCache",b.setAttribute("data-bind","html: shaderCacheText"),h.appendChild(b);var C=document.createElement("div");h.appendChild(C);var S=document.createElement("input");S.type="checkbox",S.setAttribute("data-bind","checked: globeDepth"),C.appendChild(S),C.appendChild(document.createTextNode("Show globe depth"));var T=document.createElement("div");C.appendChild(T);var w=document.createElement("div");h.appendChild(w);var A=document.createElement("input");A.type="checkbox",A.setAttribute("data-bind","checked: pickDepth"),w.appendChild(A),w.appendChild(document.createTextNode("Show pick depth"));var E=document.createElement("div");h.appendChild(E);var x=document.createElement("span");x.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),E.appendChild(x);var P=document.createElement("span");P.setAttribute("data-bind","text: depthFrustumText"),E.appendChild(P);var I=document.createElement("input");I.type="button",I.value="-",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: decrementDepthFrustum"),E.appendChild(I);var D=document.createElement("input");D.type="button",D.value="+",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: incrementDepthFrustum"),E.appendChild(D);var O=document.createElement("div");O.className="cesium-cesiumInspector-sectionHeader",d=document.createElement("span"),d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),O.appendChild(d),O.appendChild(document.createTextNode("Primitives")),u.appendChild(O);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 R=document.createElement("div");R.className="cesium-cesiumInspector-pickSection",M.appendChild(R);var L=document.createElement("input");L.type="button",L.value="Pick a primitive",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var N=document.createElement("div");N.className="cesium-cesiumInspector-center",N.appendChild(L),R.appendChild(N);var k=document.createElement("div");R.appendChild(k);var F=document.createElement("input");F.type="checkbox",F.setAttribute("data-bind","checked: primitiveBoundingSphere, enable: hasPickedPrimitive"),k.appendChild(F),k.appendChild(document.createTextNode("Show bounding sphere"));var B=document.createElement("div");R.appendChild(B);var U=document.createElement("input");U.type="checkbox",U.setAttribute("data-bind","checked: primitiveReferenceFrame, enable: hasPickedPrimitive"),B.appendChild(U),B.appendChild(document.createTextNode("Show reference frame"));var V=document.createElement("div");this._primitiveOnly=V,R.appendChild(V);var z=document.createElement("input");z.type="checkbox",z.setAttribute("data-bind","checked: filterPrimitive, enable: hasPickedPrimitive"),V.appendChild(z),V.appendChild(document.createTextNode("Show only selected"));var G=document.createElement("div");G.className="cesium-cesiumInspector-sectionHeader",d=document.createElement("span"),d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),G.appendChild(d),G.appendChild(document.createTextNode("Terrain")),u.appendChild(G);var H=document.createElement("div");H.className="cesium-cesiumInspector-section",H.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" :  !terrainVisible}'),u.appendChild(H);var W=document.createElement("div");W.className="cesium-cesiumInspector-pickSection",H.appendChild(W);var j=document.createElement("input");j.type="button",j.value="Pick a tile",j.className="cesium-cesiumInspector-pickButton",j.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),N=document.createElement("div"),N.appendChild(j),N.className="cesium-cesiumInspector-center",W.appendChild(N);var q=document.createElement("div");W.appendChild(q);var Y=document.createElement("input");Y.type="button",Y.value="Parent",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectParent");var X=document.createElement("input");X.type="button",X.value="NW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectNW");var Q=document.createElement("input");Q.type="button",Q.value="NE",Q.className="cesium-cesiumInspector-pickButton",Q.setAttribute("data-bind","click: selectNE");var Z=document.createElement("input");Z.type="button",Z.value="SW",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectSW");var K=document.createElement("input");K.type="button",K.value="SE",K.className="cesium-cesiumInspector-pickButton",K.setAttribute("data-bind","click: selectSE");var J=document.createElement("div");J.className="cesium-cesiumInspector-tileText",q.className="cesium-cesiumInspector-frustumStatistics",q.appendChild(J),q.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" :  !hasPickedTile}'),J.setAttribute("data-bind","html: tileText");var $=document.createElement("div");$.className="cesium-cesiumInspector-relativeText",$.textContent="Select relative:",q.appendChild($);var ee=document.createElement("table"),te=document.createElement("tr"),re=document.createElement("tr"),ie=document.createElement("td");ie.appendChild(Y);var ne=document.createElement("td");ne.appendChild(X);var oe=document.createElement("td");oe.appendChild(Q),te.appendChild(ie),te.appendChild(ne),te.appendChild(oe);var ae=document.createElement("td"),se=document.createElement("td");se.appendChild(Z);var le=document.createElement("td");le.appendChild(K),re.appendChild(ae),re.appendChild(se),re.appendChild(le),ee.appendChild(te),ee.appendChild(re),q.appendChild(ee);var ue=document.createElement("div");W.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show bounding volume"));var de=document.createElement("div");W.appendChild(de);var he=document.createElement("input");he.type="checkbox",he.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile"),de.appendChild(he),de.appendChild(document.createTextNode("Show only selected"));var pe=document.createElement("div");H.appendChild(pe);var fe=document.createElement("input");fe.type="checkbox",fe.setAttribute("data-bind","checked: wireframe"),pe.appendChild(fe),pe.appendChild(document.createTextNode("Wireframe"));var me=document.createElement("div");H.appendChild(me);var ge=document.createElement("input");ge.type="checkbox",ge.setAttribute("data-bind","checked: suspendUpdates"),me.appendChild(ge),me.appendChild(document.createTextNode("Suspend LOD update"));var _e=document.createElement("div");H.appendChild(_e);var ve=document.createElement("input");ve.type="checkbox",ve.setAttribute("data-bind","checked: tileCoordinates"),_e.appendChild(ve),_e.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(i,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(),r(this)},s}),define("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,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T){"use strict";function w(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function A(e){function t(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=i-r;s>a&&(e.resize(),e.render(),r=i-s%a),h(t)}else e.resize(),e.render(),h(t)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){e.showErrorPanel("An error occurred while rendering.  Rendering has stopped.",void 0,t)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var r=0;h(t)}function E(e){var t=e._canvas,r=t.clientWidth,i=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=r,e._canvasHeight=i,r*=o,i*=o,t.width=r,t.height=i,e._canRender=0!==r&&0!==i}function x(e){var t=e._canvas,r=t.width,i=t.height;if(0!==r&&0!==i){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=r/i:(n.top=n.right*(i/r),n.bottom=-n.top)}}function P(e,i){e=T(e),i=n(i,{});var a=document.createElement("div");a.className="cesium-widget",e.appendChild(a);var s=document.createElement("canvas"),l=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=l,l&&(s.style.imageRendering=c.imageRenderingValue()),s.oncontextmenu=function(){return!1},s.onselectstart=function(){return!1},a.appendChild(s);var d=document.createElement("div");d.className="cesium-widget-credits";var h=o(i.creditContainer)?T(i.creditContainer):a;h.appendChild(d);var A=o(i.creditViewport)?T(i.creditViewport):a,P=n(i.showRenderLoopErrors,!0);this._element=a,this._container=e,this._canvas=s,this._canvasWidth=0,this._canvasHeight=0,this._creditViewport=A,this._creditContainer=h,this._innerCreditContainer=d,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=P,this._resolutionScale=1,this._forceResize=!1,this._clock=o(i.clock)?i.clock:new r,E(this);try{var I=new _({canvas:s,contextOptions:i.contextOptions,creditContainer:d,creditViewport:A,mapProjection:i.mapProjection,orderIndependentTranslucency:i.orderIndependentTranslucency,scene3DOnly:n(i.scene3DOnly,!1),terrainExaggeration:i.terrainExaggeration,shadows:i.shadows,mapMode2D:i.mapMode2D,requestRenderMode:i.requestRenderMode,maximumRenderTimeChange:i.maximumRenderTimeChange});this._scene=I,I.camera.constrainedAxis=t.UNIT_Z,x(this);var D=n(I.mapProjection.ellipsoid,u.WGS84),O=i.globe;o(O)||(O=new m(D)),!1!==O&&(I.globe=O,I.globe.shadows=n(i.terrainShadows,y.RECEIVE_ONLY));var M=i.skyBox;o(M)||(M=new C({sources:{positiveX:w("px"),negativeX:w("mx"),positiveY:w("py"),negativeY:w("my"),positiveZ:w("pz"),negativeZ:w("mz")}})),!1!==M&&(I.skyBox=M,I.sun=new S,I.moon=new g);var R=i.skyAtmosphere;o(R)||(R=new b(D)),!1!==R&&(I.skyAtmosphere=R);var L=!1!==i.globe&&i.imageryProvider;o(L)||(L=new f({url:"https://dev.virtualearth.net"})),!1!==L&&I.imageryLayers.addImageryProvider(L),o(i.terrainProvider)&&!1!==i.globe&&(I.terrainProvider=i.terrainProvider),this._screenSpaceEventHandler=new p(s,!1),o(i.sceneMode)&&(i.sceneMode===v.SCENE2D&&this._scene.morphTo2D(0),i.sceneMode===v.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(i.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=i.targetFrameRate;var N=this;I.renderError.addEventListener(function(e,t){if(N._useDefaultRenderLoop=!1,N._renderLoopRunning=!1,N._showRenderLoopErrors){N.showErrorPanel("An error occurred while rendering.  Rendering has stopped.",void 0,t)}})}catch(e){if(P){this.showErrorPanel("Error constructing CesiumWidget.",'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:',e)}throw e}}return a(P.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},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&&A(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}}}),P.prototype.showErrorPanel=function(e,t,r){function i(){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),i(),o(window.addEventListener)&&window.addEventListener("resize",i,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var h="(no error details available)";o(r)&&(h=d(r));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(h)),u.appendChild(p);var f=document.createElement("div");f.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(f);var m=document.createElement("button");m.setAttribute("type","button"),m.className="cesium-button",m.appendChild(document.createTextNode("OK")),m.onclick=function(){o(i)&&o(window.removeEventListener)&&window.removeEventListener("resize",i,!1),n.removeChild(a)},f.appendChild(m),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+h)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),s(this)},P.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,r=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==r)&&(this._forceResize=!1,E(this),x(this),this._scene.requestRender())},P.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},P}),define("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";function s(r){t(r)||(r=new e),this._clock=r,this._eventHelper=new n,this._eventHelper.add(r.onTick,this.synchronize,this),this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,this.startTime=a.observable(r.startTime),this.startTime.equalityComparer=o.equals,this.startTime.subscribe(function(e){r.startTime=e,this.synchronize()},this),this.stopTime=a.observable(r.stopTime),this.stopTime.equalityComparer=o.equals,this.stopTime.subscribe(function(e){r.stopTime=e,this.synchronize()},this),this.currentTime=a.observable(r.currentTime),
this.currentTime.equalityComparer=o.equals,this.currentTime.subscribe(function(e){r.currentTime=e,this.synchronize()},this),this.multiplier=a.observable(r.multiplier),this.multiplier.subscribe(function(e){r.multiplier=e,this.synchronize()},this),this.clockStep=a.observable(r.clockStep),this.clockStep.subscribe(function(e){r.clockStep=e,this.synchronize()},this),this.clockRange=a.observable(r.clockRange),this.clockRange.subscribe(function(e){r.clockRange=e,this.synchronize()},this),this.canAnimate=a.observable(r.canAnimate),this.canAnimate.subscribe(function(e){r.canAnimate=e,this.synchronize()},this),this.shouldAnimate=a.observable(r.shouldAnimate),this.shouldAnimate.subscribe(function(e){r.shouldAnimate=e,this.synchronize()},this),a.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}return r(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(),i(this)},s}),define("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}),define("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){var r=this,i=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return i()}}),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?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(r._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){i(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),r(this)},l}),define("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){e=o(e);var r=new a(t);r._exitFullScreenPath=u,r._enterFullScreenPath=l;var i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),n.applyBindings(r,i),this._container=e,this._viewModel=r,this._element=i}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),r(this)},s}),define("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsGeocoderService","../../Core/CartographicGeocoderService","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/Matrix4","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand","../getElement"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(n){i(n.geocoderServices)?this._geocoderServices=n.geocoderServices:this._geocoderServices=[new t,new e({scene:n.scene})],this._viewContainer=n.container,this._scene=n.scene,this._flightDuration=n.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new a,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._updateCamera=m,this._adjustSuggestionsScroll=v,this._updateSearchSuggestions=S,this._handleArrowDown=f,this._handleArrowUp=p;var o=this;this._suggestionsVisible=l.pureComputed(function(){var e=l.getObservable(o,"_suggestions"),t=e().length>0,r=l.getObservable(o,"_showSuggestions")();return t&&r}),this._searchCommand=c(function(){if(o._focusTextbox=!1,i(o._selectedSuggestion))return o.activateSuggestion(o._selectedSuggestion),!1;o.hideSuggestions(),o.isSearchInProgress?y(o):_(o,o._geocoderServices)}),this.deselectSuggestion=function(){o._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){var r="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,i="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(r||i)&&t.preventDefault(),!0},this.handleKeyUp=function(e,t){var r="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,i="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode,n="Enter"===t.key||13===t.keyCode;return i?p(o):r?f(o):n&&o._searchCommand(),!0},this.activateSuggestion=function(e){o.hideSuggestions(),o._searchText=e.displayName;var t=e.destination;C(o),m(o,t)},this.hideSuggestions=function(){o._showSuggestions=!1,o._selectedSuggestion=void 0},this.showSuggestions=function(){o._showSuggestions=!0},this.handleMouseover=function(e,t){e!==o._selectedSuggestion&&(o._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=r(n.autocomplete,!0),this._focusTextbox=!1,l.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);var s=l.getObservable(this,"_searchText");s.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=s.subscribe(function(){S(o)}),this.isSearchInProgress=void 0,l.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,l.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,l.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function p(e){if(0!==e._suggestions.length){var t,r=e._suggestions.indexOf(e._selectedSuggestion);if(-1===r||0===r)return void(e._selectedSuggestion=void 0);t=r-1,e._selectedSuggestion=e._suggestions[t],v(e,t)}}function f(e){if(0!==e._suggestions.length){var t=e._suggestions.length,r=e._suggestions.indexOf(e._selectedSuggestion),i=(r+1)%t;e._selectedSuggestion=e._suggestions[i],v(e,i)}}function m(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:s.IDENTITY})}function g(e,t,r){return e.then(function(e){return i(e)&&"fulfilled"===e.state&&e.value.length>0?e:t.geocode(r).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}})})}function _(e,t){var r=e._searchText;if(b(r))return void e.showSuggestions();e._isSearchInProgress=!0;for(var n=u.resolve(),o=0;o<t.length;o++)n=g(n,t[o],r);e._geocodePromise=n,n.then(function(t){if(!n.cancel){e._isSearchInProgress=!1;var o=t.value;if("fulfilled"===t.state&&i(o)&&o.length>0)return e._searchText=o[0].displayName,void m(e,o[0].destination);e._searchText=r+" (not found)"}})}function v(e,t){var r=d(e._viewContainer),i=r.getElementsByClassName("search-results")[0],n=r.getElementsByTagName("li"),o=n[t];if(0===t)return void(i.scrollTop=0);var a=o.offsetTop;a+o.clientHeight>i.clientHeight?i.scrollTop=a+o.clientHeight:a<i.scrollTop&&(i.scrollTop=a)}function y(e){e._isSearchInProgress=!1,i(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function b(e){return/^\s*$/.test(e)}function C(e){l.getObservable(e,"_suggestions").removeAll()}function S(e){if(e.autoComplete){var t=e._searchText;if(C(e),!b(t)){var r=u.resolve([]);e._geocoderServices.forEach(function(e){r=r.then(function(r){return r.length>=5?r:e.geocode(t).then(function(e){return r=r.concat(e)})})}),r.then(function(t){for(var r=e._suggestions,i=0;i<t.length;i++)r.push(t[i])})}}}return n(h.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}}),h.prototype.destroy=function(){this._suggestionSubscription.dispose()},h}),define("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=a(e.container),r=new s(e);r._startSearchPath=u,r._stopSearchPath=c;var i=document.createElement("form");i.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",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){l.select()},0)},l.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(l),this._textBox=l;var d=document.createElement("span");d.className="cesium-geocoder-searchButton",d.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(d),t.appendChild(i);var h=document.createElement("div");h.className="search-results",h.setAttribute("data-bind","visible: _suggestionsVisible");var p=document.createElement("ul");p.setAttribute("data-bind","foreach: _suggestions");var f=document.createElement("li");p.appendChild(f),f.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),h.appendChild(p),t.appendChild(h),o.applyBindings(r,i),o.applyBindings(r,h),this._container=t,this._searchSuggestionsContainer=h,this._viewModel=r,this._form=i,this._onInputBegin=function(e){t.contains(e.target)||(r._focusTextbox=!1,r.hideSuggestions())},this._onInputEnd=function(e){t.contains(e.target)&&(r._focusTextbox=!0,r.showSuggestions())},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}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},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)),this._viewModel.destroy(),o.cleanNode(this._form),o.cleanNode(this._searchSuggestionsContainer),this._container.removeChild(this._form),this._container.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),r(this)},l}),define("Widgets/HomeButton/HomeButtonViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n){"use strict";function o(e,t){this._scene=e,this._duration=t;var r=this;this._command=n(function(){r._scene.camera.flyHome(r._duration)}),this.tooltip="View Home",i.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}),define("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){e=o(e);var i=new a(t,r);i._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(i,s),this._container=e,this._viewModel=i,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),r(this)},s}),define("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,r,i){"use strict";function n(){this._cameraClicked=new r,this._closeClicked=new r,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",i.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,i.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),i.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}),define("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Check","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t){t=s(t);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),t.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 d=document.createElement("button");d.type="button",d.className="cesium-infoBox-close",d.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),d.innerHTML="&times;",n.appendChild(d);var h=document.createElement("iframe");h.className="cesium-infoBox-iframe",h.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),h.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),h.setAttribute("allowfullscreen",!0),n.appendChild(h);var p=new u;a.applyBindings(p,n),this._container=t,this._element=n,this._frame=h,this._viewModel=p,this._descriptionSubscription=void 0;var f=this;h.addEventListener("load",function(){var t=h.contentDocument,o=t.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=t.createElement("div");a.className="cesium-infoBox-description",t.head.appendChild(o),t.body.appendChild(a),f._descriptionSubscription=l(p,"description",function(e){h.style.height="5px",a.innerHTML=e;var t=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=r.fromCssColorString(l);i(u)&&0!==u.alpha&&(t=s["background-color"])}}n.style["background-color"]=t;var c=a.getBoundingClientRect().height;h.style.height=c+"px"})}),h.setAttribute("src","about:blank")}return n(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(),o(this)},c}),define("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,r){"use strict";function i(){this.showInstructions=!1;var e=this;this._command=r(function(){e.showInstructions=!e.showInstructions}),this._showClick=r(function(){e._touch=!1}),this._showTouch=r(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(i.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),i}),define("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(r){var i=l(r.container),n=new u,o=t(r.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",i.appendChild(c);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",d.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(d);var h=document.createElement("div");h.className="cesium-navigation-help",h.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(h);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 f=document.createElement("img");f.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",p.appendChild(f),p.appendChild(document.createTextNode("Mouse"));var m=document.createElement("button");m.type="button",m.className="cesium-navigation-button cesium-navigation-button-right",m.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var g=document.createElement("img");g.src=e("Widgets/Images/NavigationHelp/Touch.svg"),g.className="cesium-navigation-button-icon",g.style.width="25px",g.style.height="25px",m.appendChild(g),m.appendChild(document.createTextNode("Touch")),h.appendChild(p),h.appendChild(m);var _=document.createElement("div");_.className="cesium-click-navigation-help cesium-navigation-help-instructions",_.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),_.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>',h.appendChild(_);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>',h.appendChild(v),s.applyBindings(n,c),this._container=i,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 i(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}),define("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,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 r=this;this._dismissMessage=s(function(){r.showingLowFrameRateMessage=!1,r.lowFrameRateMessageDismissed=!0});var i=o.fromScene(t.scene);this._unsubscribeLowFrameRate=i.lowFrameRate.addEventListener(function(){r.lowFrameRateMessageDismissed||(r.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=i.nominalFrameRate.addEventListener(function(){r.showingLowFrameRateMessage=!1})}return r(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),i(this)},l}),define("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e){var t=o(e.container),r=new a(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.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"),i.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(l),t.appendChild(i),n.applyBindings(r,i),this._container=t,this._viewModel=r,this._element=i}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),r(this)},s}),define("Widgets/ProjectionPicker/ProjectionPickerViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/OrthographicFrustum","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t){this._scene=t,
this._orthographic=t.camera.frustum instanceof o,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=t.mode,s.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);var r=this;s.defineProperty(this,"selectedTooltip",function(){return r._orthographic?r.tooltipOrthographic:r.tooltipPerspective}),this._toggleDropDown=l(function(){r.sceneMode===a.SCENE2D||r._flightInProgress||(r.dropDownVisible=!r.dropDownVisible)}),this._eventHelper=new n,this._eventHelper.add(t.morphComplete,function(e,t,i,n){r.sceneMode=i,r._orthographic=i===a.SCENE2D||r._scene.camera.frustum instanceof o}),this._eventHelper.add(t.preRender,function(){r._flightInProgress=e(t.camera._currentFlight)}),this._switchToPerspective=l(function(){r.sceneMode!==a.SCENE2D&&(r._scene.camera.switchToPerspectiveFrustum(),r._orthographic=!1,r.dropDownVisible=!1)}),this._switchToOrthographic=l(function(){r.sceneMode!==a.SCENE2D&&(r._scene.camera.switchToOrthographicFrustum(),r._orthographic=!0,r.dropDownVisible=!1)}),this._sceneMode=a}return t(u.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},u}),define("Widgets/ProjectionPicker/ProjectionPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./ProjectionPickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e=a(e);var r=new s(t);r._perspectivePath=u,r._orthographicPath=c;var i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);var l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button",l.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic,       "cesium-projectionPicker-buttonOrthographic": _orthographic,       "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress,        "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),l.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --\x3e\x3c!-- /ko --\x3e',i.appendChild(l);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",d.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic),       "cesium-projectionPicker-none" : !_orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(d);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",h.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic),       "cesium-projectionPicker-none" : _orthographic,       "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(h),o.applyBindings(r,i),this._viewModel=r,this._container=e,this._wrapper=i,this._closeDropDown=function(e){i.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 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",c="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 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),r(this)},l}),define("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t,r){this._scene=t;var i=this,n=function(e,t,r,n){i.sceneMode=r,i.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(r,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=i.sceneMode;return e===a.SCENE2D?i.tooltip2D:e===a.SCENE3D?i.tooltip3D:i.tooltipColumbusView}),this._toggleDropDown=l(function(){i.dropDownVisible=!i.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(i._duration)}),this._morphTo3D=l(function(){t.morphTo3D(i._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(i._duration)}),this._sceneMode=a}return r(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(),i(this)},u}),define("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){e=a(e);var i=new s(t,r);i._globePath=u,i._flatMapPath=c,i._columbusViewPath=d;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button",h.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'),h.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --\x3e\x3c!-- /ko --\x3e',l.appendChild(h);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 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.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(f);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.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(m),o.applyBindings(i,l),this._viewModel=i,this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.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))}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",d="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),r(this)},l}),define("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,i,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=i,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&&r(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,r){return a.wgs84ToWindowCoordinates(e,t,r)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&r(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(r(e)){var t=this._container,i=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),i+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})},i(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),define("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){e=o(e),this._container=e;var r=document.createElement("div");r.className="cesium-selection-wrapper",r.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(r),this._element=r;var i="http://www.w3.org/2000/svg",s=document.createElementNS(i,"svg:svg");s.setAttribute("width",160),s.setAttribute("height",160),s.setAttribute("viewBox","0 0 160 160");var l=document.createElementNS(i,"g");l.setAttribute("transform","translate(80,80)"),s.appendChild(l);var u=document.createElementNS(i,"path");u.setAttribute("data-bind","attr: { transform: _transform }"),u.setAttribute("d","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.appendChild(u),r.appendChild(s);var c=new a(t,this._element,this._container);this._viewModel=c,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),r(this)},s}),define("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function r(t,r,i){this._color=t,this._height=r,this._base=e(i,0)}return r.prototype.getHeight=function(){return this._height},r.prototype.getBase=function(){return this._base},r.prototype.getStartTime=function(){return this._start},r.prototype.getStopTime=function(){return this._stop},r.prototype.setRange=function(e,t){this._start=e,this._stop=t},r.prototype.render=function(e){var r="";if(this._start&&this._stop&&this._color){var i=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(i)),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&&(r='<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 r},r}),define("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,r){"use strict";function i(t,r,i,n){this.interval=t,this.height=r,this.color=i||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return i.prototype.render=function(e,i){var n=this.interval.start,o=this.interval.stop,a=i.startJulian,s=r.addSeconds(i.startJulian,i.duration,new r);if(r.lessThan(n,a)&&r.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,i.y,i.timeBarWidth,this.height);else if(r.lessThanOrEquals(n,s)&&r.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<i.timeBarWidth;++l){var d=r.addSeconds(i.startJulian,l/i.timeBarWidth*i.duration,new r);!t(u)&&r.greaterThanOrEquals(d,n)?u=l:!t(c)&&r.greaterThanOrEquals(d,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,i.y,i.timeBarWidth,this.height),t(u)&&(t(c)||(c=i.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,i.y,Math.max(c-u,1),this.height))}},i}),define("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var r=document.createElement("div");r.className="cesium-timeline-main",e.appendChild(r),this._topDiv=r,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=d(this),this._onMouseMove=h(this),this._onMouseWheel=p(this),this._onTouchStart=f(this),this._onTouchMove=g(this),this._onTouchEnd=m(this);var i=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),i.addEventListener("mousedown",this._onMouseDown,!1),i.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),i.addEventListener("mousewheel",this._onMouseWheel,!1),i.addEventListener("touchstart",this._onTouchStart,!1),i.addEventListener("touchmove",this._onTouchMove,!1),i.addEventListener("touchend",this._onTouchEnd,!1),i.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 d(e){return function(t){e._mouseMode=v.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function h(e){return function(t){var r;if(e._mouseMode===v.scrub){t.preventDefault();var i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===v.slide){if(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r){var o=r*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&&(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r&&e.zoomFrom(Math.pow(1.01,r)))}}function p(e){return function(t){var r=t.wheelDeltaY||t.wheelDelta||-t.detail;_=Math.max(Math.min(Math.abs(r),_),1),r/=_,e.zoomFrom(Math.pow(1.05,-r))}}function f(e){return function(t){var r,i,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=v.touchOnly,1===o?(r=n.secondsDifference(e._scrubJulian,e._startJulian),i=Math.round(r*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-i)<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 m(e){return function(t){var r=t.touches.length,i=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!==r?e._touchMode=r>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function g(e){return function(r){var i,o,a,s,l,u,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=v.touchOnly,e._touchMode===y.scrub?(r.preventDefault(),1===r.changedTouches.length&&(o=r.changedTouches[0].clientX-d)>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth)):e._touchMode===y.slideZoom&&(a=r.touches.length,2===a?(s=.5*(r.touches[0].clientX+r.touches[1].clientX)-d,l=Math.abs(r.touches[0].clientX-r.touches[1].clientX)):1===a&&(s=r.touches[0].clientX-d,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)):(i=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,i*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 _=1e12,v={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},b=[.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],C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,r){this._topDiv.addEventListener(e,t,r)},l.prototype.removeEventListener=function(e,t,r){this._topDiv.removeEventListener(e,t,r)},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),r(this)},l.prototype.addHighlightRange=function(e,t,r){var i=new a(e,t,r)
;return this._highlightRanges.push(i),this.resize(),i},l.prototype.addTrack=function(e,t,r,i){var n=new s(e,t,r,i);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,r){if(this._startJulian=t,this._endJulian=r,this._timeBarSecondsSpan=n.secondsDifference(r,t),this._clock&&this._clock.clockRange!==e.UNBOUNDED){var i=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,i),s=n.secondsDifference(i,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=i,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 r=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,r*e-r,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),r=t.millisecond,i=" UTC";if(r>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(r).toString();i.length<3;)i="0"+i;i="."+i}return C[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+i},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(y/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function r(e){return(e-y)/p}function i(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 d="",h=0,p=this._timeBarSecondsSpan;p<.01?(p=.01,this._timeBarSecondsSpan=.01,this._endJulian=n.addSeconds(this._startJulian,.01,new n)):p>31536e6&&(p=31536e6,this._timeBarSecondsSpan=31536e6,this._endJulian=n.addSeconds(this._startJulian,31536e6,new n));var f=this._timeBarEle.clientWidth;f<10&&(f=10);var m,g=this._startJulian,_=Math.min(p/f*1e-5,.4),v=n.toGregorianDate(g);m=p>31536e4?n.fromDate(new Date(Date.UTC(100*Math.floor(v.year/100),0))):p>31536e3?n.fromDate(new Date(Date.UTC(10*Math.floor(v.year/10),0))):p>86400?n.fromDate(new Date(Date.UTC(v.year,0))):n.fromDate(new Date(Date.UTC(v.year,v.month,v.day)));var y=n.secondsDifference(this._startJulian,n.addSeconds(m,_,new n)),C=y+p;this._epochJulian=m,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-.01,new n));var S=this._rulerEle.offsetWidth+20;S<30&&(S=180);var T=h;h-=1e-10;var w={startTime:y,startJulian:g,epochJulian:m,duration:p,timeBarWidth:f,getAlpha:r};this._highlightRanges.forEach(function(e){d+=e.render(w)});var A=0,E=0,x=0,P=S/f;P>1&&(P=1),P*=this._timeBarSecondsSpan;var I,D=-1,O=-1,M=b.length;for(I=0;I<M;++I){var R=b[I];if(++D,A=R,R>P&&R>h)break;O<0&&f*(R/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(O=D)}if(D>0){for(;D>0;)if(--D,Math.abs(i(A,b[D]))<1e-5){b[D]>=h&&(E=b[D]);break}if(O>=0)for(;O<D;){if(Math.abs(i(E,b[O]))<1e-5&&b[O]>=h){x=b[O];break}++O}}(h=T)>1e-10&&x<1e-5&&Math.abs(h-A)>1e-10&&(x=h,h<=A+1e-10&&(E=0));var L,N=-999999;if(f*(x/this._timeBarSecondsSpan)>=3)for(o=e(x);o<=C;o=t(o,x))d+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(f*r(o)).toString()+'px;"></span>';if(f*(E/this._timeBarSecondsSpan)>=3)for(o=e(E);o<=C;o=t(o,E))d+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(f*r(o)).toString()+'px;"></span>';if(f*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,C+=A,o=e(A);for(var k=n.computeTaiMinusUtc(m);o<=C;){var F=n.addSeconds(g,o-y,new n);if(A>2.1){var B=n.computeTaiMinusUtc(F);Math.abs(B-k)>.1&&(o+=B-k,F=n.addSeconds(g,o-y,new n))}var U=Math.round(f*r(o)),V=this.makeLabel(F);this._rulerEle.innerHTML=V,L=this._rulerEle.offsetWidth,L<10&&(L=S);var z=U-(L/2-1);z>N?(N=z+L+5,d+='<span class="cesium-timeline-ticMain" style="left: '+U.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+z.toString()+'px;">'+V+"</span>"):d+='<span class="cesium-timeline-ticSub" style="left: '+U.toString()+'px;"></span>',o=t(o,A)}}else this._mainTicSpan=-1;d+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0 0;"></span>',a.innerHTML=d,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),w.y=0,this._trackList.forEach(function(e){e.render(c._context,w),w.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var r=n.secondsDifference(this._scrubJulian,this._startJulian),i=Math.round(r*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==i&&(this._lastXPos=i,e.style.left=i-8+"px",this._needleEle.style.left=i+"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 r=e-8;this._scrubElement.style.left=r.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var i=document.createEvent("Event");i.initEvent("settime",!0,!0),i.clientX=e,i.timeSeconds=t,i.timeJulian=this._scrubJulian,i.clock=this._clock,this._topDiv.dispatchEvent(i)},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 r=1;this._trackList.forEach(function(e){r+=e.height}),this._trackListEle.style.height=r.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=r,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t}},l}),define("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Fullscreen","../../Core/OrthographicFrustum","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(e){var r=!1,i=window.screen;return t(i)&&(t(i.lockOrientation)?r=i.lockOrientation(e):t(i.mozLockOrientation)?r=i.mozLockOrientation(e):t(i.msLockOrientation)?r=i.msLockOrientation(e):t(i.orientation&&i.orientation.lock)&&(r=i.orientation.lock(e))),r}function p(){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 f(e,t,r,i){i()||(r()?(t.useWebVR=!1,e._locked&&(p(),e._locked=!1),e._noSleep.disable(),a.exitFullscreen(),r(!1)):(a.fullscreen||a.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=h("landscape")),t.useWebVR=!0,r(!0)))}function m(t,r){var i=this,n=l.observable(a.enabled),h=l.observable(!1);this.isVRMode=void 0,l.defineProperty(this,"isVRMode",{get:function(){return h()}}),this.isVREnabled=void 0,l.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&a.enabled)}}),this.tooltip=void 0,l.defineProperty(this,"tooltip",function(){return n()?h()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});var m=l.observable(!1);this._isOrthographic=void 0,l.defineProperty(this,"_isOrthographic",{get:function(){return m()}}),this._eventHelper=new o,this._eventHelper.add(t.preRender,function(){m(t.camera.frustum instanceof s)}),this._locked=!1,this._noSleep=new u,this._command=c(function(){f(i,t,h,m)},l.getObservable(this,"isVREnabled")),this._vrElement=e(d(r),document.body),this._callback=function(){!a.fullscreen&&h()&&(t.useWebVR=!1,i._locked&&(p(),i._locked=!1),i._noSleep.disable(),h(!1))},document.addEventListener(a.changeEventName,this._callback)}return r(m.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(a.changeEventName,this._callback),i(this)},m}),define("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){e=o(e);var i=new a(t,r);i._exitVRPath=u,i._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(s),n.applyBindings(i,s),this._container=e,this._viewModel=i,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),r(this)},s}),define("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/Check","../../Core/Clock","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Event","../../Core/EventHelper","../../Core/HeadingPitchRange","../../Core/isArray","../../Core/Matrix4","../../Core/Rectangle","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/Cesium3DTileset","../../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","../ProjectionPicker/ProjectionPicker","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q){"use strict";function Y(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function X(e,t){var r=e.scene.pick(t.position);if(o(r)){var i=n(r.id,r.primitive.id);if(i instanceof b)return i}if(o(e.scene.globe))return Z(e,t.position)}function Q(e,t,r){if(o(r)){var i=r.clock;o(i)&&(i.getValue(t),o(e)&&(e.updateFromClock(),e.zoomTo(i.startTime,i.stopTime)))}}function Z(e,t){var r=e.scene,i=r.camera.getPickRay(t),n=r.imageryLayers.pickImageryLayerFeatures(i,r);if(o(n)){var a=new b({id:"Loading...",description:"Loading feature information..."});return x(n,function(t){if(e.selectedEntity===a){if(!o(t)||0===t.length)return void(e.selectedEntity=K());var r=t[0],i=new b({id:r.name,description:r.description});if(o(r.position)){var n=e.scene.globe.ellipsoid.cartographicToCartesian(r.position,ae);i.position=new _(n)}e.selectedEntity=i}},function(){e.selectedEntity===a&&(e.selectedEntity=K())}),a}}function K(){return new b({id:"None",description:"No features found."})}function J(e,t){var r=e._geocoder,i=e._homeButton,n=e._sceneModePicker,a=e._projectionPicker,s=e._baseLayerPicker,l=e._animation,u=e._timeline,c=e._fullscreenButton,d=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(o(r)&&(r.container.style.visibility=p),o(i)&&(i.container.style.visibility=p),o(n)&&(n.container.style.visibility=p),o(a)&&(a.container.style.visibility=p),o(s)&&(s.container.style.visibility=p),o(l)&&(l.container.style.visibility=p),o(u)&&(u.container.style.visibility=p),o(c)&&c.viewModel.isFullscreenEnabled&&(c.container.style.visibility=p),o(d)&&(d.container.style.visibility=p),o(h)&&(h.container.style.visibility=p),e._container){var f=t||!o(c)?0:c.container.clientWidth;e._vrButton.container.style.right=f+"px",e.forceResize()}}function $(e,t){function r(e){var t=X(l,e);o(t)&&(S.getValueOrUndefined(t.position,l.clock.currentTime)?l.trackedEntity=t:l.zoomTo(t))}function a(e){l.selectedEntity=X(l,e)}e=F(e),t=n(t,n.EMPTY_OBJECT);var s=!(o(t.globe)&&!1===t.globe||o(t.baseLayerPicker)&&!1===t.baseLayerPicker),l=this,d=document.createElement("div");d.className="cesium-viewer",e.appendChild(d);var p=document.createElement("div");p.className="cesium-viewer-cesiumWidgetContainer",d.appendChild(p);var f=document.createElement("div");f.className="cesium-viewer-bottom",d.appendChild(f);var g,_,b=n(t.scene3DOnly,!1),C=!1;o(t.clockViewModel)?(_=t.clockViewModel,g=_.clock):(g=new i,_=new L(g),C=!0),o(t.shouldAnimate)&&(g.shouldAnimate=t.shouldAnimate);var T=new R(p,{imageryProvider:!s&&!o(t.imageryProvider)&&void 0,clock:g,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:o(t.creditContainer)?t.creditContainer:f,creditViewport:t.creditViewport,scene3DOnly:b,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange}),w=t.dataSources,A=!1;o(w)||(w=new v,A=!0);var x=T.scene,Q=new y({scene:x,dataSourceCollection:w}),Z=new c;Z.add(g.onTick,$.prototype._onTick,this),Z.add(x.morphStart,$.prototype._clearTrackedObject,this);var K;if(!o(t.selectionIndicator)||!1!==t.selectionIndicator){var ee=document.createElement("div");ee.className="cesium-viewer-selectionIndicatorContainer",d.appendChild(ee),K=new H(ee,x)}var te;if(!o(t.infoBox)||!1!==t.infoBox){var re=document.createElement("div");re.className="cesium-viewer-infoBoxContainer",d.appendChild(re),te=new U(re);var ie=te.viewModel;Z.add(ie.cameraClicked,$.prototype._onInfoBoxCameraClicked,this),Z.add(ie.closeClicked,$.prototype._onInfoBoxClockClicked,this)}var ne=document.createElement("div");ne.className="cesium-viewer-toolbar",d.appendChild(ne);var oe;if(!o(t.geocoder)||!1!==t.geocoder){var ae=document.createElement("div");ae.className="cesium-viewer-geocoderContainer",ne.appendChild(ae),oe=new k({container:ae,geocoderServices:o(t.geocoder)?h(t.geocoder)?t.geocoder:[t.geocoder]:void 0,scene:x}),Z.add(oe.viewModel.search.beforeExecute,$.prototype._clearObjects,this)}var se;o(t.homeButton)&&!1===t.homeButton||(se=new B(ne,x),o(oe)&&Z.add(se.viewModel.command.afterExecute,function(){var e=oe.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),Z.add(se.viewModel.command.beforeExecute,$.prototype._clearTrackedObject,this));var le;b||o(t.sceneModePicker)&&!1===t.sceneModePicker||(le=new G(ne,x));var ue;t.projectionPicker&&(ue=new z(ne,x));var ce,de;if(s){var he=n(t.imageryProviderViewModels,O()),pe=n(t.terrainProviderViewModels,M());ce=new D(ne,{globe:x.globe,imageryProviderViewModels:he,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:pe,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});de=ne.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}o(t.imageryProvider)&&!1!==t.imageryProvider&&(s&&(ce.viewModel.selectedImagery=void 0),x.imageryLayers.removeAll(),x.imageryLayers.addImageryProvider(t.imageryProvider)),o(t.terrainProvider)&&(s&&(ce.viewModel.selectedTerrain=void 0),x.terrainProvider=t.terrainProvider);var fe;if(!o(t.navigationHelpButton)||!1!==t.navigationHelpButton){var me=!0;try{if(o(window.localStorage)){var ge=window.localStorage.getItem("cesium-hasSeenNavHelp");o(ge)&&Boolean(ge)?me=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}fe=new V({container:ne,instructionsInitiallyVisible:n(t.navigationInstructionsInitiallyVisible,me)})}var _e;if(!o(t.animation)||!1!==t.animation){var ve=document.createElement("div");ve.className="cesium-viewer-animationContainer",d.appendChild(ve),_e=new P(ve,new I(_))}var ye;if(!o(t.timeline)||!1!==t.timeline){var be=document.createElement("div");be.className="cesium-viewer-timelineContainer",d.appendChild(be),ye=new j(be,g),ye.addEventListener("settime",Y,!1),ye.zoomTo(g.startTime,g.stopTime)}var Ce,Se,Te;o(t.fullscreenButton)&&!1===t.fullscreenButton||(Te=document.createElement("div"),Te.className="cesium-viewer-fullscreenContainer",d.appendChild(Te),Ce=new N(Te,t.fullscreenElement),Se=W(Ce.viewModel,"isFullscreenEnabled",function(e){Te.style.display=e?"block":"none",o(ye)&&(ye.container.style.right=Te.clientWidth+"px",ye.resize())}));var we,Ae,Ee;if(t.vrButton){var xe=document.createElement("div");xe.className="cesium-viewer-vrContainer",d.appendChild(xe),we=new q(xe,x,t.fullScreenElement),Ae=W(we.viewModel,"isVREnabled",function(e){xe.style.display=e?"block":"none",o(Ce)&&(xe.style.right=Te.clientWidth+"px"),o(ye)&&(ye.container.style.right=xe.clientWidth+"px",ye.resize())}),Ee=W(we.viewModel,"isVRMode",function(e){J(l,e)})}this._baseLayerPickerDropDown=de,this._fullscreenSubscription=Se,this._vrSubscription=Ae,this._vrModeSubscription=Ee,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=n(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=f,this._element=d,this._cesiumWidget=T,this._selectionIndicator=K,this._infoBox=te,this._dataSourceCollection=w,this._destroyDataSourceCollection=A,this._dataSourceDisplay=Q,this._clockViewModel=_,this._destroyClockViewModel=C,this._toolbar=ne,this._homeButton=se,this._sceneModePicker=le,this._projectionPicker=ue,this._baseLayerPicker=ce,this._navigationHelpButton=fe,this._animation=_e,this._timeline=ye,this._fullscreenButton=Ce,this._vrButton=we,this._geocoder=oe,this._eventHelper=Z,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=o(te)||o(K),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,this._selectedEntityChanged=new u,this._trackedEntityChanged=new u,E.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),Z.add(w.dataSourceAdded,$.prototype._onDataSourceAdded,this),Z.add(w.dataSourceRemoved,$.prototype._onDataSourceRemoved,this),Z.add(x.postUpdate,$.prototype.resize,this),Z.add(x.postRender,$.prototype._postRender,this);for(var Pe=w.length,Ie=0;Ie<Pe;Ie++)this._dataSourceAdded(w,w.get(Ie));this._dataSourceAdded(void 0,Q.defaultDataSource),Z.add(w.dataSourceAdded,$.prototype._dataSourceAdded,this),Z.add(w.dataSourceRemoved,$.prototype._dataSourceRemoved,this),T.screenSpaceEventHandler.setInputAction(a,m.LEFT_CLICK),T.screenSpaceEventHandler.setInputAction(r,m.LEFT_DOUBLE_CLICK)}function ee(e,t,r,i){re(e);var a=x.defer();return e._zoomPromise=a,e._zoomIsFlight=i,e._zoomOptions=r,x(t,function(t){if(e._zoomPromise===a){if(t instanceof w)return void t.getViewableRectangle().then(function(t){e._zoomPromise===a&&(e._zoomTarget=t)});if(t instanceof T)return void(e._zoomTarget=t);if(t.isLoading&&o(t.loadingEvent))var r=t.loadingEvent.addEventListener(function(){r(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else{if(h(t))return void(e._zoomTarget=t.slice(0));t=n(t.values,t),o(t.entities)&&(t=t.entities.values),h(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}}}),e.scene.requestRender(),a.promise}function te(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function re(e){var t=e._zoomPromise;o(t)&&(te(e),t.resolve(!1))}function ie(t){var r=t._zoomTarget;if(o(r)&&t.scene.mode!==A.MORPHING){var i,a=t.scene,s=a.camera,l=t._zoomPromise,u=n(t._zoomOptions,{});if(r instanceof T)return r.readyPromise.then(function(){var e=r.boundingSphere;o(u.offset)||(u.offset=new d(0,-.5,e.radius)),i={offset:u.offset,duration:u.duration,maximumHeight:u.maximumHeight,complete:function(){l.resolve(!0)},cancel:function(){l.resolve(!1)}},t._zoomIsFlight?s.flyToBoundingSphere(r.boundingSphere,i):(s.viewBoundingSphere(e,u.offset),s.lookAtTransform(p.IDENTITY),l.resolve(!0)),te(t)});if(r instanceof f)return i={destination:r,duration:u.duration,maximumHeight:u.maximumHeight,complete:function(){l.resolve(!0)},cancel:function(){l.resolve(!1)}},t._zoomIsFlight?s.flyTo(i):(s.setView(i),l.resolve(!0)),void te(t);for(var c=r,h=[],m=0,_=c.length;m<_;m++){var v=t._dataSourceDisplay.getBoundingSphere(c[m],!1,oe);if(v===g.PENDING)return;v!==g.FAILED&&h.push(e.clone(oe))}if(0===h.length)return void re(t);t.trackedEntity=void 0;var y=e.fromBoundingSpheres(h);t._zoomIsFlight?(te(t),s.flyToBoundingSphere(y,{duration:u.duration,maximumHeight:u.maximumHeight,complete:function(){l.resolve(!0)},cancel:function(){l.resolve(!1)},offset:u.offset})):(s.viewBoundingSphere(y,t._zoomOptions.offset),s.lookAtTransform(p.IDENTITY),te(t),l.resolve(!0))}}function ne(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,r=e.clock.currentTime,i=S.getValueOrUndefined(t.position,r);if(o(i)){var n=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,oe);if(a!==g.PENDING){var s=n.mode;s!==A.COLUMBUS_VIEW&&s!==A.SCENE2D||(n.screenSpaceCameraController.enableTranslate=!1),s!==A.COLUMBUS_VIEW&&s!==A.SCENE3D||(n.screenSpaceCameraController.enableTilt=!1);var l=a!==g.FAILED?oe:void 0;e._entityView=new C(t,n,n.mapProjection.ellipsoid),e._entityView.update(r,l),e._needTrackedEntityUpdate=!1}}}}var oe=new e,ae=new t;return a($.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}},projectionPicker:{get:function(){return this._projectionPicker}},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._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},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,re(this);var t=this.scene,r=t.mode;o(e)&&o(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,r!==A.COLUMBUS_VIEW&&r!==A.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),r!==A.COLUMBUS_VIEW&&r!==A.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(p.IDENTITY)),this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=o(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;o(e)?o(t)&&t.animateAppear():o(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,Q(this._timeline,this.clock,e))}}}),$.prototype.extend=function(e,t){e(this,t)},$.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,r=t.clientWidth,i=t.clientHeight,n=o(this._animation),a=o(this._timeline);if(this._forceResize||r!==this._lastWidth||i!==this._lastHeight){e.resize(),this._forceResize=!1;var s=i-125,l=this._baseLayerPickerDropDown;if(o(l)&&(l.style.maxHeight=s+"px"),o(this._geocoder)){this._geocoder.searchSuggestionsContainer.style.maxHeight=s+"px"}o(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var u,c=this._timeline,d=0,h=0,p=0;if(n&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var f=this._lastWidth;u=this._animation.container,r>900?(d=169,f<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):r>=600?(d=136,(f<600||f>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(d=106,(f>600||0===f)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=d+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var m=this._fullscreenButton,g=this._vrButton,_=c.container,v=_.style;p=_.clientHeight+3,v.left=d+"px";var y=0;o(m)&&(y+=m.container.clientWidth),o(g)&&(y+=g.container.clientWidth),v.right=y+"px",c.resize()}this._bottomContainer.style.left=h+"px",this._bottomContainer.style.bottom=p+"px",this._lastWidth=r,this._lastHeight=i}},$.prototype.forceResize=function(){this._lastWidth=0,this.resize()},$.prototype.render=function(){this._cesiumWidget.render()},$.prototype.isDestroyed=function(){return!1},$.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(m.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(m.LEFT_DOUBLE_CLICK);var t=this.dataSources,r=t.length;for(e=0;e<r;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(),o(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),o(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),o(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),o(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),o(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),o(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),o(this._timeline)&&(this._timeline.removeEventListener("settime",Y,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),o(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),
this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),o(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),o(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),o(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),s(this)},$.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener($.prototype._onEntityCollectionChanged,this)},$.prototype._dataSourceRemoved=function(e,t){var r=t.entities;r.collectionChanged.removeEventListener($.prototype._onEntityCollectionChanged,this),o(this.trackedEntity)&&r.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),o(this.selectedEntity)&&r.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},$.prototype._onTick=function(e){var r=e.currentTime,i=this._dataSourceDisplay.update(r);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=i);var a=this._entityView;if(o(a)){var s=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(s,!1,oe)===g.DONE&&a.update(r,oe)}var l,u=!1,c=this.selectedEntity,d=o(c)&&this._enableInfoOrSelection;if(d&&c.isShowing&&c.isAvailable(r)){this._dataSourceDisplay.getBoundingSphere(c,!0,oe)!==g.FAILED?l=oe.center:o(c.position)&&(l=c.position.getValue(r,l)),u=o(l)}var h=o(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;o(h)&&(h.position=t.clone(l,h.position),h.showSelection=d&&u,h.update());var p=o(this._infoBox)?this._infoBox.viewModel:void 0;o(p)&&(p.showInfo=d,p.enableCamera=u,p.isCameraTracking=this.trackedEntity===this.selectedEntity,d?(p.titleText=n(c.name,c.id),p.description=S.getValueOrDefault(c.description,r,"")):(p.titleText="",p.description=""))},$.prototype._onEntityCollectionChanged=function(e,t,r){for(var i=r.length,n=0;n<i;n++){var o=r[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},$.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,r=t.position;o(r)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},$.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},$.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},$.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},$.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Q(this.timeline,this.clock,e)},$.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var r=t.entities.id,i=this._eventHelper.add(t.changedEvent,$.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[r]=i},$.prototype._onDataSourceRemoved=function(e,t){var r=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,r){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},$.prototype.zoomTo=function(e,t){return ee(this,e,{offset:t},!1)},$.prototype.flyTo=function(e,t){return ee(this,e,t,!0)},$.prototype._postRender=function(){ie(this),ne(this)},$}),define("Widgets/Viewer/viewerCesium3DTilesInspectorMixin",["../../Core/Check","../../Core/defineProperties","../Cesium3DTilesInspector/Cesium3DTilesInspector"],function(e,t,r){"use strict";function i(e){var i=document.createElement("div");i.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(i);var n=new r(i,e.scene);t(e,{cesium3DTilesInspector:{get:function(){return n}}})}return i}),define("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,r,i){"use strict";function n(e){var r=document.createElement("div");r.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(r);var n=new i(r,e.scene);t(e,{cesiumInspector:{get:function(){return n}}})}return n}),define("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,r,i,n,o,a,s,l,u){"use strict";function c(t,i){function a(e){d(e),g&&(t.entities.removeAll(),t.dataSources.removeAll());for(var r=e.dataTransfer.files,i=r.length,n=0;n<i;n++){var o=r[n],a=new FileReader;a.onload=f(t,o,y,v),a.onerror=m(t,o),a.readAsText(o)}}i=e(i,e.EMPTY_OBJECT);var s=!0,l=e(i.flyToOnDrop,!0),c=new n,g=e(i.clearOnDrop,!0),_=e(i.dropTarget,t.container),v=e(i.clampToGround,!0),y=i.proxy;_=u(_),r(t,{dropTarget:{get:function(){return _},set:function(e){h(_,a),_=e,p(_,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?p(_,a):h(_,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return g},set:function(e){g=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(_,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function d(e){e.stopPropagation(),e.preventDefault()}function h(e,r){var i=e;t(i)&&(i.removeEventListener("drop",r,!1),i.removeEventListener("dragenter",d,!1),i.removeEventListener("dragover",d,!1),i.removeEventListener("dragexit",d,!1))}function p(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",d,!1),e.addEventListener("dragover",d,!1),e.addEventListener("dragexit",d,!1)}function f(e,r,i,n){var o=e.scene;return function(u){var c=r.name;try{var d;if(/\.czml$/i.test(c))d=a.load(JSON.parse(u.target.result),{sourceUri:c});else if(/\.geojson$/i.test(c)||/\.json$/i.test(c)||/\.topojson$/i.test(c))d=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);d=l.load(r,{sourceUri:c,proxy:i,camera:o.camera,canvas:o.canvas,clampToGround:n})}t(d)&&e.dataSources.add(d).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 m(e,t){return function(r){e.dropError.raiseEvent(e,t.name,r.target.error)}}return c}),define("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,r,i,n){"use strict";function o(t,i){i=e(i,e.EMPTY_OBJECT);var o=new n({scene:t.scene,container:t.bottomContainer,lowFrameRateMessage:i.lowFrameRateMessage});r(t,{performanceWatchdog:{get:function(){return o}}})}return o}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function i(i){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=i(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: "+r(e)+"\n  with responseMessage: "+JSON.stringify(a),n(a)}}}return i}),
define("Cesium",["./Core/appendForwardSlash","./Core/arrayFill","./Core/arrayRemoveDuplicates","./Core/arraySlice","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BingMapsGeocoderService","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CartographicGeocoderService","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/Check","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/ClippingPlaneCollection","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CompressedTextureBuffer","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/createWorldTerrain","./Core/Credit","./Core/CubicRealPolynomial","./Core/CullingVolume","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/decodeGoogleEarthEnterpriseData","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/DistanceDisplayCondition","./Core/DistanceDisplayConditionGeometryInstanceAttribute","./Core/DoublyLinkedList","./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/FrustumGeometry","./Core/FrustumOutlineGeometry","./Core/Fullscreen","./Core/GeocoderService","./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/GoogleEarthEnterpriseMetadata","./Core/GoogleEarthEnterpriseTerrainData","./Core/GoogleEarthEnterpriseTerrainProvider","./Core/GoogleEarthEnterpriseTileInformation","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeadingPitchRoll","./Core/Heap","./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/Ion","./Core/IonResource","./Core/isArray","./Core/isBitSet","./Core/isBlobUri","./Core/isCrossOriginUrl","./Core/isDataUri","./Core/isLeapYear","./Core/Iso8601","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadCRN","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadKTX","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/ManagedArray","./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/OrthographicFrustum","./Core/OrthographicOffCenterFrustum","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PerspectiveFrustum","./Core/PerspectiveOffCenterFrustum","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PlaneGeometry","./Core/PlaneOutlineGeometry","./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/Request","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RequestScheduler","./Core/RequestState","./Core/RequestType","./Core/Resource","./Core/RuntimeError","./Core/sampleTerrain","./Core/sampleTerrainMostDetailed","./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/TileAvailability","./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/WeightSpline","./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/DynamicGeometryBatch","./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/KmlCamera","./DataSources/KmlDataSource","./DataSources/KmlLookAt","./DataSources/KmlTour","./DataSources/KmlTourFlyTo","./DataSources/KmlTourWait","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PlaneGeometryUpdater","./DataSources/PlaneGraphics","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineDashMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVisualizer","./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/freezeRenderState","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/modernizeShader","./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/AttributeType","./Scene/Axis","./Scene/Batched3DModel3DTileContent","./Scene/BatchTable","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/BlendOption","./Scene/BoxEmitter","./Scene/BrdfLutGenerator","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/Cesium3DTile","./Scene/Cesium3DTileBatchTable","./Scene/Cesium3DTileChildrenVisibility","./Scene/Cesium3DTileColorBlendMode","./Scene/Cesium3DTileContent","./Scene/Cesium3DTileContentFactory","./Scene/Cesium3DTileContentState","./Scene/Cesium3DTileFeature","./Scene/Cesium3DTileFeatureTable","./Scene/Cesium3DTileOptimizationHint","./Scene/Cesium3DTileOptimizations","./Scene/Cesium3DTilePointFeature","./Scene/Cesium3DTileRefine","./Scene/Cesium3DTileset","./Scene/Cesium3DTilesetStatistics","./Scene/Cesium3DTilesetTraversal","./Scene/Cesium3DTileStyle","./Scene/Cesium3DTileStyleEngine","./Scene/CircleEmitter","./Scene/ClassificationModel","./Scene/ClassificationPrimitive","./Scene/ClassificationType","./Scene/ColorBlendMode","./Scene/Composite3DTileContent","./Scene/ConditionsExpression","./Scene/ConeEmitter","./Scene/createBillboardPointCallback","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/DebugAppearance","./Scene/DebugCameraPrimitive","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Empty3DTileContent","./Scene/Expression","./Scene/ExpressionNodeType","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/Geometry3DTileContent","./Scene/getBinaryAccessor","./Scene/GetFeatureInfoFormat","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthEnterpriseImageryProvider","./Scene/GoogleEarthEnterpriseMapsProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImagerySplitDirection","./Scene/ImageryState","./Scene/Instanced3DModel3DTileContent","./Scene/InvertClassification","./Scene/IonImageryProvider","./Scene/JobScheduler","./Scene/JobType","./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/ModelInstance","./Scene/ModelInstanceCollection","./Scene/ModelLoadResources","./Scene/ModelMaterial","./Scene/ModelMesh","./Scene/ModelNode","./Scene/ModelUtility","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/Particle","./Scene/ParticleBurst","./Scene/ParticleEmitter","./Scene/ParticleSystem","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PickDepth","./Scene/PointCloud3DTileContent","./Scene/PointCloudEyeDomeLighting","./Scene/PointCloudShading","./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/SphereEmitter","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/StyleExpression","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingRegion","./Scene/TileBoundingSphere","./Scene/TileBoundingVolume","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileOrientedBoundingBox","./Scene/TileReplacementQueue","./Scene/Tileset3DTileContent","./Scene/TileState","./Scene/TileTerrain","./Scene/TimeDynamicImagery","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/Vector3DTileBatch","./Scene/Vector3DTileContent","./Scene/Vector3DTileGeometry","./Scene/Vector3DTilePoints","./Scene/Vector3DTilePolygons","./Scene/Vector3DTilePolylines","./Scene/Vector3DTilePrimitive","./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/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/BrdfLutGeneratorFS","./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/maxClippingPlanes","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/passCesium3DTile","./Shaders/Builtin/Constants/passCesium3DTileClassification","./Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow","./Shaders/Builtin/Constants/passClassification","./Shaders/Builtin/Constants/passCompute","./Shaders/Builtin/Constants/passEnvironment","./Shaders/Builtin/Constants/passGlobe","./Shaders/Builtin/Constants/passOpaque","./Shaders/Builtin/Constants/passOverlay","./Shaders/Builtin/Constants/passTerrainClassification","./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/depthClampFarPlane","./Shaders/Builtin/Functions/discardIfClippedWithIntersect","./Shaders/Builtin/Functions/discardIfClippedWithUnion","./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/HSBToRGB","./Shaders/Builtin/Functions/HSLToRGB","./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/RGBToHSB","./Shaders/Builtin/Functions/RGBToHSL","./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/writeDepthClampedToFarPlane","./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/ElevationContourMaterial","./Shaders/Materials/ElevationRampMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineDashMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/SlopeRampMaterial","./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/PostProcessFilters/PointCloudEyeDomeLighting","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/Vector3DTilePolylinesVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/crunch","./ThirdParty/earcut-2.1.1","./ThirdParty/GltfPipeline/addDefaults","./ThirdParty/GltfPipeline/addExtensionsRequired","./ThirdParty/GltfPipeline/addExtensionsUsed","./ThirdParty/GltfPipeline/addPipelineExtras","./ThirdParty/GltfPipeline/addToArray","./ThirdParty/GltfPipeline/byteLengthForComponentType","./ThirdParty/GltfPipeline/findAccessorMinMax","./ThirdParty/GltfPipeline/ForEach","./ThirdParty/GltfPipeline/getAccessorByteStride","./ThirdParty/GltfPipeline/getJointCountForMaterials","./ThirdParty/GltfPipeline/glslTypeToWebGLConstant","./ThirdParty/GltfPipeline/numberOfComponentsForType","./ThirdParty/GltfPipeline/parseBinaryGltf","./ThirdParty/GltfPipeline/processModelMaterialsCommon","./ThirdParty/GltfPipeline/processPbrMetallicRoughness","./ThirdParty/GltfPipeline/removeExtensionsRequired","./ThirdParty/GltfPipeline/removeExtensionsUsed","./ThirdParty/GltfPipeline/removePipelineExtras","./ThirdParty/GltfPipeline/techniqueParameterForSemantic","./ThirdParty/GltfPipeline/updateVersion","./ThirdParty/GltfPipeline/webGLConstantToGlslType","./ThirdParty/google-earth-dbroot-parser","./ThirdParty/jsep","./ThirdParty/kdbush","./ThirdParty/knockout-3.4.2","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/pako_inflate","./ThirdParty/protobuf-minimal","./ThirdParty/Shaders/FXAA3_11","./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/Cesium3DTilesInspector/Cesium3DTilesInspector","./Widgets/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel","./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/ProjectionPicker/ProjectionPicker","./Widgets/ProjectionPicker/ProjectionPickerViewModel","./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/viewerCesium3DTilesInspectorMixin","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,_,v,y,b,C,S,T,w,A,E,x,P,I,D,O,M,R,L,N,k,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,_e,ve,ye,be,Ce,Se,Te,we,Ae,Ee,xe,Pe,Ie,De,Oe,Me,Re,Le,Ne,ke,Fe,Be,Ue,Ve,ze,Ge,He,We,je,qe,Ye,Xe,Qe,Ze,Ke,Je,$e,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,dt,ht,pt,ft,mt,gt,_t,vt,yt,bt,Ct,St,Tt,wt,At,Et,xt,Pt,It,Dt,Ot,Mt,Rt,Lt,Nt,kt,Ft,Bt,Ut,Vt,zt,Gt,Ht,Wt,jt,qt,Yt,Xt,Qt,Zt,Kt,Jt,$t,er,tr,rr,ir,nr,or,ar,sr,lr,ur,cr,dr,hr,pr,fr,mr,gr,_r,vr,yr,br,Cr,Sr,Tr,wr,Ar,Er,xr,Pr,Ir,Dr,Or,Mr,Rr,Lr,Nr,kr,Fr,Br,Ur,Vr,zr,Gr,Hr,Wr,jr,qr,Yr,Xr,Qr,Zr,Kr,Jr,$r,ei,ti,ri,ii,ni,oi,ai,si,li,ui,ci,di,hi,pi,fi,mi,gi,_i,vi,yi,bi,Ci,Si,Ti,wi,Ai,Ei,xi,Pi,Ii,Di,Oi,Mi,Ri,Li,Ni,ki,Fi,Bi,Ui,Vi,zi,Gi,Hi,Wi,ji,qi,Yi,Xi,Qi,Zi,Ki,Ji,$i,en,tn,rn,nn,on,an,sn,ln,un,cn,dn,hn,pn,fn,mn,gn,_n,vn,yn,bn,Cn,Sn,Tn,wn,An,En,xn,Pn,In,Dn,On,Mn,Rn,Ln,Nn,kn,Fn,Bn,Un,Vn,zn,Gn,Hn,Wn,jn,qn,Yn,Xn,Qn,Zn,Kn,Jn,$n,eo,to,ro,io,no,oo,ao,so,lo,uo,co,ho,po,fo,mo,go,_o,vo,yo,bo,Co,So,To,wo,Ao,Eo,xo,Po,Io,Do,Oo,Mo,Ro,Lo,No,ko,Fo,Bo,Uo,Vo,zo,Go,Ho,Wo,jo,qo,Yo,Xo,Qo,Zo,Ko,Jo,$o,ea,ta,ra,ia,na,oa,aa,sa,la,ua,ca,da,ha,pa,fa,ma,ga,_a,va,ya,ba,Ca,Sa,Ta,wa,Aa,Ea,xa,Pa,Ia,Da,Oa,Ma,Ra,La,Na,ka,Fa,Ba,Ua,Va,za,Ga,Ha,Wa,ja,qa,Ya,Xa,Qa,Za,Ka,Ja,$a,es,ts,rs,is,ns,os,as,ss,ls,us,cs,ds,hs,ps,fs,ms,gs,_s,vs,ys,bs,Cs,Ss,Ts,ws,As,Es,xs,Ps,Is,Ds,Os,Ms,Rs,Ls,Ns,ks,Fs,Bs,Us,Vs,zs,Gs,Hs,Ws,js,qs,Ys,Xs,Qs,Zs,Ks,Js,$s,el,tl,rl,il,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ml,gl,_l,vl,yl,bl,Cl,Sl,Tl,wl,Al,El,xl,Pl,Il,Dl,Ol,Ml,Rl,Ll,Nl,kl,Fl,Bl,Ul,Vl,zl,Gl,Hl,Wl,jl,ql,Yl,Xl,Ql,Zl,Kl,Jl,$l,eu,tu,ru,iu,nu,ou,au,su,lu,uu,cu,du,hu,pu,fu,mu,gu,_u,vu,yu,bu,Cu,Su,Tu,wu,Au,Eu,xu,Pu,Iu,Du,Ou,Mu,Ru,Lu,Nu,ku,Fu,Bu,Uu,Vu,zu,Gu,Hu,Wu,ju,qu,Yu,Xu,Qu,Zu,Ku,Ju,$u,ec,tc,rc,ic,nc,oc,ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,gc,_c,vc,yc,bc,Cc,Sc,Tc,wc,Ac,Ec,xc,Pc,Ic,Dc,Oc,Mc,Rc,Lc,Nc,kc,Fc,Bc,Uc,Vc,zc,Gc,Hc,Wc,jc,qc,Yc,Xc,Qc,Zc,Kc,Jc,$c,ed,td,rd,id,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,gd,_d,vd,yd,bd,Cd,Sd,Td,wd,Ad,Ed,xd,Pd,Id,Dd,Od,Md,Rd,Ld,Nd,kd,Fd,Bd,Ud,Vd,zd,Gd,Hd,Wd,jd,qd,Yd,Xd,Qd,Zd,Kd,Jd,$d,eh,th,rh,ih,nh,oh,ah,sh,lh,uh,ch,dh,hh,ph,fh,mh,gh,_h,vh,yh,bh,Ch,Sh,Th,wh,Ah,Eh,xh,Ph,Ih,Dh,Oh,Mh,Rh,Lh,Nh,kh,Fh,Bh,Uh,Vh,zh,Gh,Hh,Wh,jh,qh,Yh,Xh,Qh,Zh,Kh,Jh,$h,ep,tp,rp,ip,np,op,ap,sp,lp,up,cp,dp,hp,pp,fp,mp,gp,_p,vp,yp,bp,Cp,Sp,Tp,wp,Ap,Ep,xp,Pp,Ip,Dp,Op,Mp,Rp,Lp,Np,kp,Fp,Bp,Up,Vp,zp,Gp,Hp,Wp,jp,qp,Yp,Xp,Qp,Zp,Kp,Jp,$p,ef,tf,rf,nf,of,af,sf,lf,uf,cf,df,hf,pf,ff,mf,gf,_f,vf,yf,bf,Cf,Sf,Tf,wf,Af,Ef){"use strict";var xf={VERSION:"1.43",_shaders:{}};return xf.appendForwardSlash=e,xf.arrayFill=t,xf.arrayRemoveDuplicates=r,xf.arraySlice=i,xf.AssociativeArray=n,xf.AttributeCompression=o,xf.AxisAlignedBoundingBox=a,xf.barycentricCoordinates=s,xf.binarySearch=l,xf.BingMapsApi=u,xf.BingMapsGeocoderService=c,xf.BoundingRectangle=d,xf.BoundingSphere=h,xf.BoxGeometry=p,xf.BoxOutlineGeometry=f,xf.buildModuleUrl=m,xf.cancelAnimationFrame=g,xf.Cartesian2=_,xf.Cartesian3=v,xf.Cartesian4=y,xf.Cartographic=b,xf.CartographicGeocoderService=C,xf.CatmullRomSpline=S,xf.CesiumTerrainProvider=T,xf.Check=w,xf.CircleGeometry=A,xf.CircleOutlineGeometry=E,xf.ClippingPlaneCollection=x,xf.Clock=P,xf.ClockRange=I,xf.ClockStep=D,xf.clone=O,xf.Color=M,xf.ColorGeometryInstanceAttribute=R,xf.combine=L,xf.ComponentDatatype=N,xf.CompressedTextureBuffer=k,xf.CornerType=F,xf.CorridorGeometry=B,xf.CorridorGeometryLibrary=U,xf.CorridorOutlineGeometry=V,xf.createGuid=z,xf.createWorldTerrain=G,xf.Credit=H,xf.CubicRealPolynomial=W,xf.CullingVolume=j,xf.CylinderGeometry=q,xf.CylinderGeometryLibrary=Y,xf.CylinderOutlineGeometry=X,xf.decodeGoogleEarthEnterpriseData=Q,xf.DefaultProxy=Z,xf.defaultValue=K,xf.defined=J,xf.defineProperties=$,xf.deprecationWarning=ee,xf.destroyObject=te,xf.DeveloperError=re,xf.DistanceDisplayCondition=ie,xf.DistanceDisplayConditionGeometryInstanceAttribute=ne,xf.DoublyLinkedList=oe,xf.EarthOrientationParameters=ae,xf.EarthOrientationParametersSample=se,xf.EasingFunction=le,xf.EllipseGeometry=ue,xf.EllipseGeometryLibrary=ce,xf.EllipseOutlineGeometry=de,xf.Ellipsoid=he,xf.EllipsoidalOccluder=pe,xf.EllipsoidGeodesic=fe,xf.EllipsoidGeometry=me,xf.EllipsoidOutlineGeometry=ge,xf.EllipsoidTangentPlane=_e,xf.EllipsoidTerrainProvider=ve,xf.EncodedCartesian3=ye,xf.Event=be,xf.EventHelper=Ce,xf.ExtrapolationType=Se,xf.FeatureDetection=Te,xf.formatError=we,xf.freezeObject=Ae,xf.FrustumGeometry=Ee,xf.FrustumOutlineGeometry=xe,xf.Fullscreen=Pe,xf.GeocoderService=Ie,xf.GeographicProjection=De,xf.GeographicTilingScheme=Oe,xf.Geometry=Me,xf.GeometryAttribute=Re,xf.GeometryAttributes=Le,xf.GeometryInstance=Ne,xf.GeometryInstanceAttribute=ke,xf.GeometryPipeline=Fe,xf.GeometryType=Be,xf.getAbsoluteUri=Ue,xf.getBaseUri=Ve,xf.getExtensionFromUri=ze,xf.getFilenameFromUri=Ge,xf.getImagePixels=He,xf.getMagic=We,xf.getStringFromTypedArray=je,xf.getTimestamp=qe,xf.GoogleEarthEnterpriseMetadata=Ye,xf.GoogleEarthEnterpriseTerrainData=Xe,xf.GoogleEarthEnterpriseTerrainProvider=Qe,
xf.GoogleEarthEnterpriseTileInformation=Ze,xf.GregorianDate=Ke,xf.HeadingPitchRange=Je,xf.HeadingPitchRoll=$e,xf.Heap=et,xf.HeightmapTerrainData=tt,xf.HeightmapTessellator=rt,xf.HermitePolynomialApproximation=it,xf.HermiteSpline=nt,xf.Iau2000Orientation=ot,xf.Iau2006XysData=at,xf.Iau2006XysSample=st,xf.IauOrientationAxes=lt,xf.IauOrientationParameters=ut,xf.IndexDatatype=ct,xf.InterpolationAlgorithm=dt,xf.Intersect=ht,xf.Intersections2D=pt,xf.IntersectionTests=ft,xf.Interval=mt,xf.Ion=gt,xf.IonResource=_t,xf.isArray=vt,xf.isBitSet=yt,xf.isBlobUri=bt,xf.isCrossOriginUrl=Ct,xf.isDataUri=St,xf.isLeapYear=Tt,xf.Iso8601=wt,xf.JulianDate=At,xf.KeyboardEventModifier=Et,xf.LagrangePolynomialApproximation=xt,xf.LeapSecond=Pt,xf.LinearApproximation=It,xf.LinearSpline=Dt,xf.loadArrayBuffer=Ot,xf.loadBlob=Mt,xf.loadCRN=Rt,xf.loadImage=Lt,xf.loadImageFromTypedArray=Nt,xf.loadImageViaBlob=kt,xf.loadJson=Ft,xf.loadJsonp=Bt,xf.loadKTX=Ut,xf.loadText=Vt,xf.loadWithXhr=zt,xf.loadXML=Gt,xf.ManagedArray=Ht,xf.MapboxApi=Wt,xf.MapProjection=jt,xf.Math=qt,xf.Matrix2=Yt,xf.Matrix3=Xt,xf.Matrix4=Qt,xf.mergeSort=Zt,xf.NearFarScalar=Kt,xf.objectToQuery=Jt,xf.Occluder=$t,xf.oneTimeWarning=er,xf.OrientedBoundingBox=tr,xf.OrthographicFrustum=rr,xf.OrthographicOffCenterFrustum=ir,xf.Packable=nr,xf.PackableForInterpolation=or,xf.parseResponseHeaders=ar,xf.PerspectiveFrustum=sr,xf.PerspectiveOffCenterFrustum=lr,xf.PinBuilder=ur,xf.PixelFormat=cr,xf.Plane=dr,xf.PlaneGeometry=hr,xf.PlaneOutlineGeometry=pr,xf.pointInsideTriangle=fr,xf.PolygonGeometry=mr,xf.PolygonGeometryLibrary=gr,xf.PolygonHierarchy=_r,xf.PolygonOutlineGeometry=vr,xf.PolygonPipeline=yr,xf.PolylineGeometry=br,xf.PolylinePipeline=Cr,xf.PolylineVolumeGeometry=Sr,xf.PolylineVolumeGeometryLibrary=Tr,xf.PolylineVolumeOutlineGeometry=wr,xf.PrimitiveType=Ar,xf.QuadraticRealPolynomial=Er,xf.QuantizedMeshTerrainData=xr,xf.QuarticRealPolynomial=Pr,xf.Quaternion=Ir,xf.QuaternionSpline=Dr,xf.queryToObject=Or,xf.Queue=Mr,xf.Ray=Rr,xf.Rectangle=Lr,xf.RectangleGeometry=Nr,xf.RectangleGeometryLibrary=kr,xf.RectangleOutlineGeometry=Fr,xf.ReferenceFrame=Br,xf.Request=Ur,xf.requestAnimationFrame=Vr,xf.RequestErrorEvent=zr,xf.RequestScheduler=Gr,xf.RequestState=Hr,xf.RequestType=Wr,xf.Resource=jr,xf.RuntimeError=qr,xf.sampleTerrain=Yr,xf.sampleTerrainMostDetailed=Xr,xf.scaleToGeodeticSurface=Qr,xf.ScreenSpaceEventHandler=Zr,xf.ScreenSpaceEventType=Kr,xf.ShowGeometryInstanceAttribute=Jr,xf.Simon1994PlanetaryPositions=$r,xf.SimplePolylineGeometry=ei,xf.SphereGeometry=ti,xf.SphereOutlineGeometry=ri,xf.Spherical=ii,xf.Spline=ni,xf.subdivideArray=oi,xf.TaskProcessor=ai,xf.TerrainData=si,xf.TerrainEncoding=li,xf.TerrainMesh=ui,xf.TerrainProvider=ci,xf.TerrainQuantization=di,xf.TileAvailability=hi,xf.TileProviderError=pi,xf.TilingScheme=fi,xf.TimeConstants=mi,xf.TimeInterval=gi,xf.TimeIntervalCollection=_i,xf.TimeStandard=vi,xf.Tipsify=yi,xf.Transforms=bi,xf.TranslationRotationScale=Ci,xf.TridiagonalSystemSolver=Si,xf.TrustedServers=Ti,xf.VertexFormat=wi,xf.VideoSynchronizer=Ai,xf.Visibility=Ei,xf.VRTheWorldTerrainProvider=xi,xf.WallGeometry=Pi,xf.WallGeometryLibrary=Ii,xf.WallOutlineGeometry=Di,xf.WebGLConstants=Oi,xf.WebMercatorProjection=Mi,xf.WebMercatorTilingScheme=Ri,xf.WeightSpline=Li,xf.WindingOrder=Ni,xf.wrapFunction=ki,xf.writeTextToCanvas=Fi,xf.BillboardGraphics=Bi,xf.BillboardVisualizer=Ui,xf.BoundingSphereState=Vi,xf.BoxGeometryUpdater=zi,xf.BoxGraphics=Gi,xf.CallbackProperty=Hi,xf.CheckerboardMaterialProperty=Wi,xf.ColorMaterialProperty=ji,xf.CompositeEntityCollection=qi,xf.CompositeMaterialProperty=Yi,xf.CompositePositionProperty=Xi,xf.CompositeProperty=Qi,xf.ConstantPositionProperty=Zi,xf.ConstantProperty=Ki,xf.CorridorGeometryUpdater=Ji,xf.CorridorGraphics=$i,xf.createMaterialPropertyDescriptor=en,xf.createPropertyDescriptor=tn,xf.createRawPropertyDescriptor=rn,xf.CustomDataSource=nn,xf.CylinderGeometryUpdater=on,xf.CylinderGraphics=an,xf.CzmlDataSource=sn,xf.DataSource=ln,xf.DataSourceClock=un,xf.DataSourceCollection=cn,xf.DataSourceDisplay=dn,xf.DynamicGeometryBatch=hn,xf.DynamicGeometryUpdater=pn,xf.EllipseGeometryUpdater=fn,xf.EllipseGraphics=mn,xf.EllipsoidGeometryUpdater=gn,xf.EllipsoidGraphics=_n,xf.Entity=vn,xf.EntityCluster=yn,xf.EntityCollection=bn,xf.EntityView=Cn,xf.GeoJsonDataSource=Sn,xf.GeometryUpdater=Tn,xf.GeometryVisualizer=wn,xf.GridMaterialProperty=An,xf.ImageMaterialProperty=En,xf.KmlCamera=xn,xf.KmlDataSource=Pn,xf.KmlLookAt=In,xf.KmlTour=Dn,xf.KmlTourFlyTo=On,xf.KmlTourWait=Mn,xf.LabelGraphics=Rn,xf.LabelVisualizer=Ln,xf.MaterialProperty=Nn,xf.ModelGraphics=kn,xf.ModelVisualizer=Fn,xf.NodeTransformationProperty=Bn,xf.PathGraphics=Un,xf.PathVisualizer=Vn,xf.PlaneGeometryUpdater=zn,xf.PlaneGraphics=Gn,xf.PointGraphics=Hn,xf.PointVisualizer=Wn,xf.PolygonGeometryUpdater=jn,xf.PolygonGraphics=qn,xf.PolylineArrowMaterialProperty=Yn,xf.PolylineDashMaterialProperty=Xn,xf.PolylineGeometryUpdater=Qn,xf.PolylineGlowMaterialProperty=Zn,xf.PolylineGraphics=Kn,xf.PolylineOutlineMaterialProperty=Jn,xf.PolylineVisualizer=$n,xf.PolylineVolumeGeometryUpdater=eo,xf.PolylineVolumeGraphics=to,xf.PositionProperty=ro,xf.PositionPropertyArray=io,xf.Property=no,xf.PropertyArray=oo,xf.PropertyBag=ao,xf.RectangleGeometryUpdater=so,xf.RectangleGraphics=lo,xf.ReferenceProperty=uo,xf.Rotation=co,xf.SampledPositionProperty=ho,xf.SampledProperty=po,xf.ScaledPositionProperty=fo,xf.StaticGeometryColorBatch=mo,xf.StaticGeometryPerMaterialBatch=go,xf.StaticGroundGeometryColorBatch=_o,xf.StaticOutlineGeometryBatch=vo,xf.StripeMaterialProperty=yo,xf.StripeOrientation=bo,xf.TimeIntervalCollectionPositionProperty=Co,xf.TimeIntervalCollectionProperty=So,xf.VelocityOrientationProperty=To,xf.VelocityVectorProperty=wo,xf.Visualizer=Ao,xf.WallGeometryUpdater=Eo,xf.WallGraphics=xo,xf.AutomaticUniforms=Po,xf.Buffer=Io,xf.BufferUsage=Do,xf.ClearCommand=Oo,xf.ComputeCommand=Mo,xf.ComputeEngine=Ro,xf.Context=Lo,xf.ContextLimits=No,xf.createUniform=ko,xf.createUniformArray=Fo,xf.CubeMap=Bo,xf.CubeMapFace=Uo,xf.DrawCommand=Vo,xf.Framebuffer=zo,xf.freezeRenderState=Go,xf.loadCubeMap=Ho,xf.MipmapHint=Wo,xf.modernizeShader=jo,xf.Pass=qo,xf.PassState=Yo,xf.PickFramebuffer=Xo,xf.PixelDatatype=Qo,xf.Renderbuffer=Zo,xf.RenderbufferFormat=Ko,xf.RenderState=Jo,xf.Sampler=$o,xf.ShaderCache=ea,xf.ShaderProgram=ta,xf.ShaderSource=ra,xf.Texture=ia,xf.TextureMagnificationFilter=na,xf.TextureMinificationFilter=oa,xf.TextureWrap=aa,xf.UniformState=sa,xf.VertexArray=la,xf.VertexArrayFacade=ua,xf.Appearance=ca,xf.ArcGisMapServerImageryProvider=da,xf.AttributeType=ha,xf.Axis=pa,xf.Batched3DModel3DTileContent=fa,xf.BatchTable=ma,xf.Billboard=ga,xf.BillboardCollection=_a,xf.BingMapsImageryProvider=va,xf.BingMapsStyle=ya,xf.BlendEquation=ba,xf.BlendFunction=Ca,xf.BlendingState=Sa,xf.BlendOption=Ta,xf.BoxEmitter=wa,xf.BrdfLutGenerator=Aa,xf.Camera=Ea,xf.CameraEventAggregator=xa,xf.CameraEventType=Pa,xf.CameraFlightPath=Ia,xf.Cesium3DTile=Da,xf.Cesium3DTileBatchTable=Oa,xf.Cesium3DTileChildrenVisibility=Ma,xf.Cesium3DTileColorBlendMode=Ra,xf.Cesium3DTileContent=La,xf.Cesium3DTileContentFactory=Na,xf.Cesium3DTileContentState=ka,xf.Cesium3DTileFeature=Fa,xf.Cesium3DTileFeatureTable=Ba,xf.Cesium3DTileOptimizationHint=Ua,xf.Cesium3DTileOptimizations=Va,xf.Cesium3DTilePointFeature=za,xf.Cesium3DTileRefine=Ga,xf.Cesium3DTileset=Ha,xf.Cesium3DTilesetStatistics=Wa,xf.Cesium3DTilesetTraversal=ja,xf.Cesium3DTileStyle=qa,xf.Cesium3DTileStyleEngine=Ya,xf.CircleEmitter=Xa,xf.ClassificationModel=Qa,xf.ClassificationPrimitive=Za,xf.ClassificationType=Ka,xf.ColorBlendMode=Ja,xf.Composite3DTileContent=$a,xf.ConditionsExpression=es,xf.ConeEmitter=ts,xf.createBillboardPointCallback=rs,xf.createOpenStreetMapImageryProvider=is,xf.createTangentSpaceDebugPrimitive=ns,xf.createTileMapServiceImageryProvider=os,xf.CreditDisplay=as,xf.CullFace=ss,xf.DebugAppearance=ls,xf.DebugCameraPrimitive=us,xf.DebugModelMatrixPrimitive=cs,xf.DepthFunction=ds,xf.DepthPlane=hs,xf.DeviceOrientationCameraController=ps,xf.DiscardMissingTileImagePolicy=fs,xf.EllipsoidPrimitive=ms,xf.EllipsoidSurfaceAppearance=gs,xf.Empty3DTileContent=_s,xf.Expression=vs,xf.ExpressionNodeType=ys,xf.Fog=bs,xf.FrameRateMonitor=Cs,xf.FrameState=Ss,xf.FrustumCommands=Ts,xf.FXAA=ws,xf.Geometry3DTileContent=As,xf.getBinaryAccessor=Es,xf.GetFeatureInfoFormat=xs,xf.Globe=Ps,xf.GlobeDepth=Is,xf.GlobeSurfaceShaderSet=Ds,xf.GlobeSurfaceTile=Os,xf.GlobeSurfaceTileProvider=Ms,xf.GoogleEarthEnterpriseImageryProvider=Rs,xf.GoogleEarthEnterpriseMapsProvider=Ls,xf.GridImageryProvider=Ns,xf.GroundPrimitive=ks,xf.HeightReference=Fs,xf.HorizontalOrigin=Bs,xf.Imagery=Us,xf.ImageryLayer=Vs,xf.ImageryLayerCollection=zs,xf.ImageryLayerFeatureInfo=Gs,xf.ImageryProvider=Hs,xf.ImagerySplitDirection=Ws,xf.ImageryState=js,xf.Instanced3DModel3DTileContent=qs,xf.InvertClassification=Ys,xf.IonImageryProvider=Xs,xf.JobScheduler=Qs,xf.JobType=Zs,xf.Label=Ks,xf.LabelCollection=Js,xf.LabelStyle=$s,xf.MapboxImageryProvider=el,xf.MapMode2D=tl,xf.Material=rl,xf.MaterialAppearance=il,xf.Model=nl,xf.ModelAnimation=ol,xf.ModelAnimationCache=al,xf.ModelAnimationCollection=sl,xf.ModelAnimationLoop=ll,xf.ModelAnimationState=ul,xf.ModelInstance=cl,xf.ModelInstanceCollection=dl,xf.ModelLoadResources=hl,xf.ModelMaterial=pl,xf.ModelMesh=fl,xf.ModelNode=ml,xf.ModelUtility=gl,xf.Moon=_l,xf.NeverTileDiscardPolicy=vl,xf.OIT=yl,xf.Particle=bl,xf.ParticleBurst=Cl,xf.ParticleEmitter=Sl,xf.ParticleSystem=Tl,xf.PerformanceDisplay=wl,xf.PerInstanceColorAppearance=Al,xf.PickDepth=El,xf.PointCloud3DTileContent=xl,xf.PointCloudEyeDomeLighting=Pl,xf.PointCloudShading=Il,xf.PointPrimitive=Dl,xf.PointPrimitiveCollection=Ol,xf.Polyline=Ml,xf.PolylineCollection=Rl,xf.PolylineColorAppearance=Ll,xf.PolylineMaterialAppearance=Nl,xf.Primitive=kl,xf.PrimitiveCollection=Fl,xf.PrimitivePipeline=Bl,xf.PrimitiveState=Ul,xf.QuadtreeOccluders=Vl,xf.QuadtreePrimitive=zl,xf.QuadtreeTile=Gl,xf.QuadtreeTileLoadState=Hl,xf.QuadtreeTileProvider=Wl,xf.Scene=jl,xf.SceneMode=ql,xf.SceneTransforms=Yl,xf.SceneTransitioner=Xl,xf.ScreenSpaceCameraController=Ql,xf.ShadowMap=Zl,xf.ShadowMapShader=Kl,xf.ShadowMode=Jl,xf.SingleTileImageryProvider=$l,xf.SkyAtmosphere=eu,xf.SkyBox=tu,xf.SphereEmitter=ru,xf.StencilFunction=iu,xf.StencilOperation=nu,xf.StyleExpression=ou,xf.Sun=au,xf.SunPostProcess=su,xf.TerrainState=lu,xf.TextureAtlas=uu,xf.TileBoundingRegion=cu,xf.TileBoundingSphere=du,xf.TileBoundingVolume=hu,xf.TileCoordinatesImageryProvider=pu,xf.TileDiscardPolicy=fu,xf.TileImagery=mu,xf.TileOrientedBoundingBox=gu,xf.TileReplacementQueue=_u,xf.Tileset3DTileContent=vu,xf.TileState=yu,xf.TileTerrain=bu,xf.TimeDynamicImagery=Cu,xf.TweenCollection=Su,xf.UrlTemplateImageryProvider=Tu,xf.Vector3DTileBatch=wu,xf.Vector3DTileContent=Au,xf.Vector3DTileGeometry=Eu,xf.Vector3DTilePoints=xu,xf.Vector3DTilePolygons=Pu,xf.Vector3DTilePolylines=Iu,xf.Vector3DTilePrimitive=Du,xf.VerticalOrigin=Ou,xf.ViewportQuad=Mu,xf.WebMapServiceImageryProvider=Ru,xf.WebMapTileServiceImageryProvider=Lu,xf._shaders.AdjustTranslucentFS=Nu,xf._shaders.AllMaterialAppearanceFS=ku,xf._shaders.AllMaterialAppearanceVS=Fu,xf._shaders.BasicMaterialAppearanceFS=Bu,xf._shaders.BasicMaterialAppearanceVS=Uu,xf._shaders.EllipsoidSurfaceAppearanceFS=Vu,xf._shaders.EllipsoidSurfaceAppearanceVS=zu,xf._shaders.PerInstanceColorAppearanceFS=Gu,xf._shaders.PerInstanceColorAppearanceVS=Hu,xf._shaders.PerInstanceFlatColorAppearanceFS=Wu,xf._shaders.PerInstanceFlatColorAppearanceVS=ju,xf._shaders.PolylineColorAppearanceVS=qu,xf._shaders.PolylineMaterialAppearanceVS=Yu,xf._shaders.TexturedMaterialAppearanceFS=Xu,xf._shaders.TexturedMaterialAppearanceVS=Qu,xf._shaders.BillboardCollectionFS=Zu,xf._shaders.BillboardCollectionVS=Ku,xf._shaders.BrdfLutGeneratorFS=Ju,xf._shaders.degreesPerRadian=$u,xf._shaders.depthRange=ec,xf._shaders.epsilon1=tc,xf._shaders.epsilon2=rc,xf._shaders.epsilon3=ic,xf._shaders.epsilon4=nc,xf._shaders.epsilon5=oc,xf._shaders.epsilon6=ac,xf._shaders.epsilon7=sc,xf._shaders.infinity=lc,xf._shaders.maxClippingPlanes=uc,xf._shaders.oneOverPi=cc,xf._shaders.oneOverTwoPi=dc,xf._shaders.passCesium3DTile=hc,xf._shaders.passCesium3DTileClassification=pc,xf._shaders.passCesium3DTileClassificationIgnoreShow=fc,xf._shaders.passClassification=mc,xf._shaders.passCompute=gc,xf._shaders.passEnvironment=_c,xf._shaders.passGlobe=vc,xf._shaders.passOpaque=yc,xf._shaders.passOverlay=bc,xf._shaders.passTerrainClassification=Cc,xf._shaders.passTranslucent=Sc,xf._shaders.pi=Tc,xf._shaders.piOverFour=wc,xf._shaders.piOverSix=Ac,xf._shaders.piOverThree=Ec,xf._shaders.piOverTwo=xc,xf._shaders.radiansPerDegree=Pc,xf._shaders.sceneMode2D=Ic,xf._shaders.sceneMode3D=Dc,xf._shaders.sceneModeColumbusView=Oc,xf._shaders.sceneModeMorphing=Mc,xf._shaders.solarRadius=Rc,xf._shaders.threePiOver2=Lc,xf._shaders.twoPi=Nc,xf._shaders.webMercatorMaxLatitude=kc,xf._shaders.CzmBuiltins=Fc,xf._shaders.alphaWeight=Bc,xf._shaders.antialias=Uc,xf._shaders.cascadeColor=Vc,xf._shaders.cascadeDistance=zc,xf._shaders.cascadeMatrix=Gc,xf._shaders.cascadeWeights=Hc,xf._shaders.columbusViewMorph=Wc,xf._shaders.computePosition=jc,xf._shaders.cosineAndSine=qc,xf._shaders.decompressTextureCoordinates=Yc,xf._shaders.depthClampFarPlane=Xc,xf._shaders.discardIfClippedWithIntersect=Qc,xf._shaders.discardIfClippedWithUnion=Zc,xf._shaders.eastNorthUpToEyeCoordinates=Kc,xf._shaders.ellipsoidContainsPoint=Jc,xf._shaders.ellipsoidNew=$c,xf._shaders.ellipsoidWgs84TextureCoordinates=ed,xf._shaders.equalsEpsilon=td,xf._shaders.eyeOffset=rd,xf._shaders.eyeToWindowCoordinates=id,xf._shaders.fog=nd,xf._shaders.geodeticSurfaceNormal=od,xf._shaders.getDefaultMaterial=ad,xf._shaders.getLambertDiffuse=sd,xf._shaders.getSpecular=ld,xf._shaders.getWaterNoise=ud,xf._shaders.getWgs84EllipsoidEC=cd,xf._shaders.HSBToRGB=dd,xf._shaders.HSLToRGB=hd,xf._shaders.hue=pd,xf._shaders.isEmpty=fd,xf._shaders.isFull=md,xf._shaders.latitudeToWebMercatorFraction=gd,xf._shaders.luminance=_d,xf._shaders.metersPerPixel=vd,xf._shaders.modelToWindowCoordinates=yd,xf._shaders.multiplyWithColorBalance=bd,xf._shaders.nearFarScalar=Cd,xf._shaders.octDecode=Sd,xf._shaders.packDepth=Td,xf._shaders.phong=wd,xf._shaders.pointAlongRay=Ad,xf._shaders.rayEllipsoidIntersectionInterval=Ed,xf._shaders.RGBToHSB=xd,xf._shaders.RGBToHSL=Pd,xf._shaders.RGBToXYZ=Id,xf._shaders.saturation=Dd,xf._shaders.shadowDepthCompare=Od,xf._shaders.shadowVisibility=Md,xf._shaders.signNotZero=Rd,xf._shaders.tangentToEyeSpaceMatrix=Ld,xf._shaders.translateRelativeToEye=Nd,xf._shaders.translucentPhong=kd,xf._shaders.transpose=Fd,xf._shaders.unpackDepth=Bd,xf._shaders.windowToEyeCoordinates=Ud,xf._shaders.writeDepthClampedToFarPlane=Vd,xf._shaders.XYZToRGB=zd,xf._shaders.depthRangeStruct=Gd,xf._shaders.ellipsoid=Hd,xf._shaders.material=Wd,xf._shaders.materialInput=jd,xf._shaders.ray=qd,xf._shaders.raySegment=Yd,xf._shaders.shadowParameters=Xd,xf._shaders.CompositeOITFS=Qd,xf._shaders.DepthPlaneFS=Zd,xf._shaders.DepthPlaneVS=Kd,xf._shaders.EllipsoidFS=Jd,xf._shaders.EllipsoidVS=$d,xf._shaders.GlobeFS=eh,xf._shaders.GlobeVS=th,xf._shaders.GroundAtmosphere=rh,xf._shaders.BumpMapMaterial=ih,xf._shaders.CheckerboardMaterial=nh,xf._shaders.DotMaterial=oh,xf._shaders.ElevationContourMaterial=ah,xf._shaders.ElevationRampMaterial=sh,xf._shaders.FadeMaterial=lh,xf._shaders.GridMaterial=uh,xf._shaders.NormalMapMaterial=ch,xf._shaders.PolylineArrowMaterial=dh,xf._shaders.PolylineDashMaterial=hh,xf._shaders.PolylineGlowMaterial=ph,xf._shaders.PolylineOutlineMaterial=fh,xf._shaders.RimLightingMaterial=mh,xf._shaders.SlopeRampMaterial=gh,xf._shaders.StripeMaterial=_h,xf._shaders.Water=vh,xf._shaders.PointPrimitiveCollectionFS=yh,xf._shaders.PointPrimitiveCollectionVS=bh,xf._shaders.PolylineCommon=Ch,xf._shaders.PolylineFS=Sh,xf._shaders.PolylineVS=Th,xf._shaders.AdditiveBlend=wh,xf._shaders.BrightPass=Ah,xf._shaders.FXAA=Eh,xf._shaders.GaussianBlur1D=xh,xf._shaders.PassThrough=Ph,xf._shaders.PointCloudEyeDomeLighting=Ih,xf._shaders.ReprojectWebMercatorFS=Dh,xf._shaders.ReprojectWebMercatorVS=Oh,xf._shaders.ShadowVolumeFS=Mh,xf._shaders.ShadowVolumeVS=Rh,xf._shaders.SkyAtmosphereFS=Lh,xf._shaders.SkyAtmosphereVS=Nh,xf._shaders.SkyBoxFS=kh,xf._shaders.SkyBoxVS=Fh,xf._shaders.SunFS=Bh,xf._shaders.SunTextureFS=Uh,xf._shaders.SunVS=Vh,xf._shaders.Vector3DTilePolylinesVS=zh,xf._shaders.ViewportQuadFS=Gh,xf._shaders.ViewportQuadVS=Hh,xf.Autolinker=Wh,xf.crunch=jh,xf["earcut-2.1.1"]=qh,xf.addDefaults=Yh,xf.addExtensionsRequired=Xh,xf.addExtensionsUsed=Qh,xf.addPipelineExtras=Zh,xf.addToArray=Kh,xf.byteLengthForComponentType=Jh,xf.findAccessorMinMax=$h,xf.ForEach=ep,xf.getAccessorByteStride=tp,xf.getJointCountForMaterials=rp,xf.glslTypeToWebGLConstant=ip,xf.numberOfComponentsForType=np,xf.parseBinaryGltf=op,xf.processModelMaterialsCommon=ap,xf.processPbrMetallicRoughness=sp,xf.removeExtensionsRequired=lp,xf.removeExtensionsUsed=up,xf.removePipelineExtras=cp,xf.techniqueParameterForSemantic=dp,xf.updateVersion=hp,xf.webGLConstantToGlslType=pp,xf["google-earth-dbroot-parser"]=fp,xf.jsep=mp,xf.kdbush=gp,xf["knockout-3.4.2"]=_p,xf["knockout-es5"]=vp,xf.knockout=yp,xf.measureText=bp,xf["mersenne-twister"]=Cp,xf.NoSleep=Sp,xf.pako_inflate=Tp,xf["protobuf-minimal"]=wp,xf.FXAA3_11=Ap,xf.sprintf=Ep,xf.topojson=xp,xf.Tween=Pp,xf.Uri=Ip,xf.when=Dp,xf.zip=Op,xf.Animation=Mp,xf.AnimationViewModel=Rp,xf.BaseLayerPicker=Lp,xf.BaseLayerPickerViewModel=Np,xf.createDefaultImageryProviderViewModels=kp,xf.createDefaultTerrainProviderViewModels=Fp,xf.ProviderViewModel=Bp,xf.Cesium3DTilesInspector=Up,xf.Cesium3DTilesInspectorViewModel=Vp,xf.CesiumInspector=zp,xf.CesiumInspectorViewModel=Gp,xf.CesiumWidget=Hp,xf.ClockViewModel=Wp,xf.Command=jp,xf.createCommand=qp,xf.FullscreenButton=Yp,xf.FullscreenButtonViewModel=Xp,xf.Geocoder=Qp,xf.GeocoderViewModel=Zp,xf.getElement=Kp,xf.HomeButton=Jp,xf.HomeButtonViewModel=$p,xf.InfoBox=ef,xf.InfoBoxViewModel=tf,xf.NavigationHelpButton=rf,xf.NavigationHelpButtonViewModel=nf,xf.PerformanceWatchdog=of,xf.PerformanceWatchdogViewModel=af,xf.ProjectionPicker=sf,xf.ProjectionPickerViewModel=lf,xf.SceneModePicker=uf,xf.SceneModePickerViewModel=cf,xf.SelectionIndicator=df,xf.SelectionIndicatorViewModel=hf,xf.subscribeAndEvaluate=pf,xf.SvgPathBindingHandler=ff,xf.Timeline=mf,xf.TimelineHighlightRange=gf,xf.TimelineTrack=_f,xf.ToggleButtonViewModel=vf,xf.Viewer=yf,xf.viewerCesium3DTilesInspectorMixin=bf,xf.viewerCesiumInspectorMixin=Cf,xf.viewerDragDropMixin=Sf,xf.viewerPerformanceWatchdogMixin=Tf,xf.VRButton=wf,xf.VRButtonViewModel=Af,xf.createTaskProcessorWorker=Ef,xf}),require(["Cesium"],function(e){"use strict";("undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Cesium=e},void 0,!0)}();