/** * 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 * 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;c0&&(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=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>>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>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r>>1^t[1&e];for(;r>>1^t[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>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?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 er?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;s1&&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;a0&&(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>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;u0?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(yi.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=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=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=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;n0?n+=s.TWO_PI:a0&&(a+=s.TWO_PI),n=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;n0?n+=s.TWO_PI:a0&&(a+=s.TWO_PI),nn||s.equalsEpsilon(r,n,s.EPSILON14))&&(r=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;a0){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>>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;l2;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(;o0){for(s.sort(n),e=0;ee&&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=0;--t)this.heapify(t)},n.prototype.insert=function(e){var t=this._array,i=this._comparator,n=this._maximumLength,a=this._length++;for(an&&(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]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(ee;){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;e0&&(w[e-r]=t):++r;w.length-=r;var n=T.internalArray,o=T.length;for(e=0;e0;)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;t0}}}),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=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;ur.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.widtho+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;nu.x&&e.clone(n,u),xc.y&&e.clone(n,c),Pd.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;iz&&(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 Fh.x&&e.clone(s,h),DE.y&&e.clone(s,E),Ox.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;lW&&(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 Vc.x&&e.clone(n,c),Pd.y&&e.clone(n,d),Ih.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;aG&&(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=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=i[r]){if(r+1=0&&e>=i[r-1])return r-1;var o;if(e>i[r])for(o=r;o=i[o]&&e=0&&!(e>=i[o]&&ei&&(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=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;c2&&(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<=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;ds&&s/a0?[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)=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]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=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]0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s0?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)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)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,fa){s=p*p-a,l=-p+Math.sqrt(s);var m=l/n,g=i/l;return m=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;jW&&(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)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-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;bt.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=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=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;n0?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)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=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=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=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=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=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=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;l0;--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<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<=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=ie,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;n0&&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=-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=-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<=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;it.east&&r.push(new o(t.east,n.south,n.east,n.north)),n.southt.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=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;f0&&(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;r65536&&(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;k1;--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=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];sn&&(n=l),++s,l=i[s]}for(var u=[],c=0;co&&(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(;n0)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(;cu&&(u=d),++c,d=o[c];if(-1===u)return 0;++u}var p,f=[];for(p=0;ps&&(v.timeStamp=_,++_),++c}g=function(e,t,r,n,o,a,s){for(var l,u=-1,c=-1,d=0;dc||-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=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;o0){for(var t=e.length-1,r=6*(t-1),i=g.createTypedArray(t,r),n=e[0],o=0,a=1;aI&&(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;i3&&(r[3]=0,r[4]=2,r[5]=3);for(var i=6,n=3;no?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;a3)for(var I=P.positions,D=P.indices,O=D.length,M=0;M0)){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+3n&&(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=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;m0&&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;t0){for(h=0;h0||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;J1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=i,r=2*n,o=0;o1,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;m0){var E=Math.min(C,v);A=Math.round(v/E);var x=Math.min(A*C,v);for(T=0;T1;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;i0&&(a=u.OUTSIDE);for(var s=0;ss.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;n0){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=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;_0)for(var C=f?2:1,S=0;S=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;re80*n){c=h=e[0],d=p=e[1];for(var _=n;_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=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.xo.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=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.x&&i.x>=c&&g(or.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;t0||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=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;o0&&(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;n0?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;h0;){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;dCe;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;s0;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;s0){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;S0)for(S=0;S=f&&(m=(m+8)%24,u=m);d1?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;w1?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[i1;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;ax.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(aE-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;fL-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<>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;i1&&"="===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>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;s1)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>>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;i191&&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>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-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;r127;)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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>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>>0),e.imageryType){if(!Array.isArray(e.imageryType))throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: array expected");t.imageryType=[];for(var r=0;r>>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>>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>>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>>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>>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>>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;dmF8J´Ýð.ÝuڌDt"úa"\f3"So¯9D\vŒ9Ù9L¹¿«\\ŒP_Ÿ"uxéq‘h;Áěð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<=0;--n){var o=1<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;l1){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=-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=-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<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;i10&&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;o0){for(l=0;l1){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=d||t(m,g,r)<=0)?(e[f]=m,++l):u=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,i0&&(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*i0?(o=Math.sqrt(o)+this._horizonDistance,s-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;fn.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"+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;++y0&&255===v[y];);var T=y/b|0;for(y=0;y=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.width0&&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;u0;){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;c0?new Array(n):void 0,s=0;s0?new Array(u):void 0;for(s=0;sC?(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.longitude1||v>1))for(var C=0;C0;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=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;yO.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)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;iP;++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;l0?new Array(u):void 0;for(l=0;l0&&(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=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;o0&&(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-10&&t.isStartIncluded&&a[o-1].isStartIncluded&&a[o-1].start.equals(t.start)?--o:o0&&((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})));o0||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(nh?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=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;A0)for(c=new Array(l),s=0;s0)for(d=new Array(l),s=0;s0)for(c=new Array(l),s=0;s0)for(d=new Array(l),s=0;s=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-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;i0&&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=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=0;S--)c.splice(w,0,"#endif //"+A[S])}var x=!1;for(d=0;d=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;i0;){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=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;o0&&(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;n0&&(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;r0){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;r0&&(t.glVertexAttribDivisor(i,0),n[i]=0)}}function C(e,t){for(var r=e._attributes,n=r.length,o=0;o=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=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;i1){var s=e[0].modelMatrix;for(n=1;n=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;da&&(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;i0&&(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;d0&&(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;h0){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;n1?"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;n0){var _=new Float64Array(p);for(g=[_.buffer],o=0;o0?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;i0?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;g0){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;o1&&(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;os?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-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=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=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=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;m0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes0){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;n0?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;a0){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= 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;a0){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;bl){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;u0&&(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;c0){this._vaf=V(n,i,this._buffersUsage,this._instanced,this._batchTable),g=this._vaf.writers;for(var I=0;I0){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;N1.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]/,n=[],o="",a=w.LTR,s="",l=e.length,u=0;u";case">":return"<"}}function T(e){for(var t=e.split("\n"),r="",i=0;iu+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,i0,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;o0&&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;i0?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;r0&&(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;c0){this._vaf=D(p,o,this._buffersUsage),r=this._vaf.writers;for(var P=0;P0){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;ee1.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=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);fp;)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=x)for(T(J.position,X,Y,i),I.push(J),V=0;V=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;V0?(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;r0&&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=t;i--)e[i]=e[s--]}for(i=0;i=0||r(_)&&s.compare(g,_)>=0));){for(f[y++]=g,v+=1,l=0;l0&&(m.length=b,u(n,p,m),f.length=y,u(i,h,f))}else{for(l=0;ll)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;TS&&(w=S,(T=w-b)0){n=new Array(i);for(var s=0;sd&&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;sg),!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. 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-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=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;o0)for(o=0;o=0;n--){var a=t[n];if(a.invalidated){t.splice(n,1);for(var s=a.updaters.values,l=s.length,u=0;u0){for(i(m)&&(i(this.oldPrimitive)?g.remove(m):this.oldPrimitive=m),h=0;h0){for(i(g)&&(i(this.oldPrimitive)?_.remove(g):this.oldPrimitive=g),h=0;h=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;s0){for(r(m)&&(r(this.oldPrimitive)?g.remove(m):this.oldPrimitive=m),u=0;u0){for(i(g)&&(i(this.oldPrimitive)?_.remove(g):this.oldPrimitive=g),d=0;d0)for(d=!0,t=0;t0)for(d=!0,t=0;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-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-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;i0){var l=o[0];if("object"==typeof l)for(var u=s.length,c=0;c0){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;l0;){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;a0)for(r.mesh=o.meshes[s[0]],i=1;i0&&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=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;C0)){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;z0,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;o0&&(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=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= "+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=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;x2?"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;h0;){p=l.pop();var f=p._transformToRoot,m=p.mesh;if(c(m))for(var g=o[m],_=g.primitives,v=_.length,y=0;y0&&(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;r0&&(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;n0;){var a=o.pop(),s=t[a];c(s)&&(i[a]=a);for(var l=s.children,u=l.length,d=0;d0;){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;A0;){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;T0;){o=i.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;u0&&i<1){var n=e._nodeCommands,o=n.length;if(!c(n[0].translucentCommand))for(var a=0;a0&&e.silhouetteColor.alpha>0&&c(e._normalAttributeName)}function Yt(e){for(var t=e._nodeCommands,r=t.length,i=0;i0&&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 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=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;iG||F.center.y-F.radiusG||F.center.y-F.radiusG||F.center.y-F.radius-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;s0){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;G0&&(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;k0){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;n1){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;i2){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;x0,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;O0||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;B2&&(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;a0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,d=0;d0))continue;p[0]=f}else p=h._segments.lengths;var m=p.length;if(m>0){for(var _=0,v=0;vg.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;n0){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.lengthc&&(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;b0||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;E0&&!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&&f0){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-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;o0?(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-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-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-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;nE*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;h0}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>>1;e[n]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(o0&&(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?""+i+""+I(o)+"":""+i+""+o+"")}return r.length>0&&(r=''+r+"
"),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;i2?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;at&&(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",this.getInnerHtml(),""].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:/( | |<|<|>|>|"|"|')/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>>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;a2?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,p127?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>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>>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("",n);-1!==n&&n0?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:clampToSeaFloor is currently not supported, using :clampToGround."),L.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(T("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),L.RELATIVE_TO_GROUND):(c(e)?T("kml-altitudeMode-unknown","KML - Unknown :"+e+", using :CLAMP_TO_GROUND."):T("kml-gx:altitudeMode-unknown","KML - Unknown :"+t+", using :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;o0&&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;g0&&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;P0)){for(_='',o=0;o";_+="
"+u(v.displayName,a)+""+u(v.value,"")+"
"}if(c(_)){_=Rt.link(_),jt.innerHTML=_;var T=jt.querySelectorAll("a");for(o=0;o1&&(ve(jt,"a","href",i),ve(jt,"img","src",i)),ye(jt,"a","href",n),ye(jt,"img","src",n);var w='
",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;db.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;n0||"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&&A0&&_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;_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;nc.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=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;i0&&(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;s1&&"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='';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(i+="object"==typeof o?"":"")}return i+="
"+n+""+r(o)+"
"+n+""+o+"
"}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;a0){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;i0;)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;m0){for(var i=e._pickIds,n=N(e),a=new Uint8Array(n),s=e._content,l=0;l0?(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":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=0;){var n,o=t.indexOf("'"),a=t.indexOf('"');if(o>=0&&o=0&&a=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;p1)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"===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=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;u1)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" 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;o0;){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;u0;){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=p&&u0;)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=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=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<=0;--n){var o=1< 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(ue+Math.PI?e+=s.TWO_PI:ts.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;uh&&pg&&(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_.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(;r0||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;m0&&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;l0)for(o=new Uint16Array(c),l=0;l0)for(a=new Uint16Array(d),l=0;l0)for(s=new Uint16Array(h),l=0;l0){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-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;o0){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;se0){for(var r=new Array(t),i=0;i0){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=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 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;i0}},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;a0&&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;s0)for(o=new Uint16Array(u),s=0;s0)for(a=new Uint16Array(c),s=0;s0){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;de0){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;c0;)for(var c=B.pop(),d=c.children,h=d.length,p=0;p0||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;mn;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;u0;){var a=i.length;o=Math.max(o,a);for(var s=0;si,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;dp.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._screenSpaceErrort._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=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;l0;e._backfaceCommands.length=0,c&&n.push(ge);var d=n.length;for(r=0;r=0;--r)n[d+g+r]=n[d+r];for(r=0;r0&&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;sn||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;f0;){var t=e.pop();t.destroy();for(var r=t.children,i=r.length,n=0;n1&&(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)&&i0?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;Ek.rectangle.east&&(F.east=k.rectangle.east),F.southk.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=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="×",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= 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(et[r-1])return h=r-2;if(e>=t[h]){if(h+1=0&&e>=t[h-1])return--h;var i;for(i=0;i=t[i]&&e8e5||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]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= 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;a0)for(var o=0;o1&&(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=/\s*<\/body>/im,C=//im,S=/([\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&>(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>    "+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: "     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="×",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="×",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)}();