vendor: 4,514 bytes, lines 1-86
1/** 2 * @license almond 0.3.0 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved. 3 * Available via the MIT or new BSD license. 4 * see: http://github.com/jrburke/almond for details 5 */ 6 7/* 8 * Copyright 2003-2006, 2009, 2017, United States Government, as represented by the Administrator of the 9 * National Aeronautics and Space Administration. All rights reserved. 10 * 11 * The NASAWorldWind/WebWorldWind platform is licensed under the Apache License, Version 2.0 (the "License"); 12 * you may not use this file except in compliance with the License. 13 * You may obtain a copy of the License at 14 * 15 * http://www.apache.org/licenses/LICENSE-2.0 16 * 17 * Unless required by applicable law or agreed to in writing, software 18 * distributed under the License is distributed on an "AS IS" BASIS, 19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 * See the License for the specific language governing permissions and 21 * limitations under the License. 22 */ 23 24/* 25 * @license 26 * Copyright 2000, Silicon Graphics, Inc. All Rights Reserved. 27 * Copyright 2014, Google Inc. All Rights Reserved. 28 * 29 * Permission is hereby granted, free of charge, to any person obtaining a copy 30 * of this software and associated documentation files (the "Software"), to 31 * deal in the Software without restriction, including without limitation the 32 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 33 * sell copies of the Software, and to permit persons to whom the Software is 34 * furnished to do so, subject to the following conditions: 35 * 36 * The above copyright notice including the dates of first publication and 37 * either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/ 38 * shall be included in all copies or substantial portions of the Software. 39 * 40 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 41 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 42 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 43 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 44 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 45 * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 46 * 47 * Original Code. The Original Code is: OpenGL Sample Implementation, 48 * Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, 49 * Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. 50 * Copyright in any portions created by third parties is as indicated 51 * elsewhere herein. All Rights Reserved. 52 */ 53 54/*! 55 * @overview es6-promise - a tiny implementation of Promises/A+. 56 * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) 57 * @license Licensed under MIT license 58 * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE 59 * @version 3.0.2 60 */ 61 62/*! 63 * The buffer module from node.js, for the browser. 64 * 65 * @author Feross Aboukhadijeh <[email protected]> <http://feross.org> 66 * @license MIT 67 */ 68 69/* 70 * Copyright 2003-2006, 2009, 2017, United States Government, as represented by the Administrator of the 71 * National Aeronautics and Space Administration. All rights reserved. 72 * 73 * The NASAWorldWind/WebWorldWind platform is licensed under the Apache License, Version 2.0 (the "License"); 74 * you may not use this file except in compliance with the License. 75 * You may obtain a copy of the License at 76 * 77 * http://www.apache.org/licenses/LICENSE-2.0 78 * 79 * Unless required by applicable law or agreed to in writing, software 80 * distributed under the License is distributed on an "AS IS" BASIS, 81 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 82 * See the License for the specific language governing permissions and 83 * limitations under the License. 84 */ 85 86!function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define([],e):t.WorldWind=e()}(this,function(){var t,e,i;!function(r){function n(t,e){return _.call(t,e)}function o(t,e){var i,r,n,o,s,a,l,h,u,c,d,f=e&&e.split("/"),p=E.map,g=p&&p["*"]||{};if(t&&"."===t.charAt(0))if(e){for(f=f.slice(0,f.length-1),t=t.split("/"),s=t.length-1,E.nodeIdCompat&&S.test(t[s])&&(t[s]=t[s].replace(S,"")),t=f.concat(t),u=0;u<t.length;u+=1)if("."===(d=t[u]))t.splice(u,1),u-=1;else if(".."===d){if(1===u&&(".."===t[2]||".."===t[0]))break;u>0&&(t.splice(u-1,2),u-=2)}t=t.join("/")}
86else 0===t.indexOf("./")&&(t=t.substring(2));if((f||g)&&p){for(i=t.split("/"),u=i.length;u>0;u-=1){if(r=i.slice(0,u).join("/"),f)for(c=f.length;c>0;c-=1)if((n=p[f.slice(0,c).join("/")])&&(n=n[r])){o=n,a=u;break}if(o)break;!l&&g&&g[r]&&(l=g[r],h=u)}!o&&l&&(o=l,a=h),o&&(i.splice(0,a,o),t=i.join("/"))}return t}function s(t,e){return function(){var i=b.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),f.apply(r,i.concat([t,e]))}}function a(t){return function(e){return o(e,t)}}function l(t){return function(e){m[t]=e}}function h(t){if(n(y,t)){var e=y[t];delete y[t],v[t]=!0,d.apply(r,e)}if(!n(m,t)&&!n(v,t))throw new Error("No "+t);return m[t]}function u(t){var e,i=t?t.indexOf("!"):-1;return i>-1&&(e=t.substring(0,i),t=t.substring(i+1,t.length)),[e,t]}function c(t){return function(){return E&&E.config&&E.config[t]||{}}}var d,f,p,g,m={},y={},E={},v={},_=Object.prototype.hasOwnProperty,b=[].slice,S=/\.js$/;p=function(t,e){var i,r=u(t),n=r[0];return t=r[1],n&&(n=o(n,e),i=h(n)),n?t=i&&i.normalize?i.normalize(t,a(e)):o(t,e):(t=o(t,e),r=u(t),n=r[0],t=r[1],n&&(i=h(n))),{f:n?n+"!"+t:t,n:t,pr:n,p:i}},g={require:function(t){return s(t)},exports:function(t){var e=m[t];return void 0!==e?e:m[t]={}},module:function(t){return{id:t,uri:"",exports:m[t],config:c(t)}}},d=function(t,e,i,o){var a,u,c,d,f,E,_=[],b=typeof i;if(o=o||t,"undefined"===b||"function"===b){for(e=!e.length&&i.length?["require","exports","module"]:e,f=0;f<e.length;f+=1)if(d=p(e[f],o),"require"===(u=d.f))_[f]=g.require(t);else if("exports"===u)_[f]=g.exports(t),E=!0;else if("module"===u)a=_[f]=g.module(t);else if(n(m,u)||n(y,u)||n(v,u))_[f]=h(u);else{if(!d.p)throw new Error(t+" missing "+u);d.p.load(d.n,s(o,!0),l(u),{}),_[f]=m[u]}c=i?i.apply(m[t],_):void 0,t&&(a&&a.exports!==r&&a.exports!==m[t]?m[t]=a.exports:c===r&&E||(m[t]=c))}else t&&(m[t]=i)},t=e=f=function(t,e,i,n,o){if("string"==typeof t)return g[t]?g[t](e):h(p(t,e).f);if(!t.splice){if(E=t,E.deps&&f(E.deps,E.callback),!e)return;e.splice?(t=e,e=i,i=null):t=r}return e=e||function(){},"function"==typeof i&&(i=n,n=o),n?d(r,t,e,i):setTimeout(function(){d(r,t,e,i)},4),f},f.config=function(t){return f(t)},t._defined=m,i=function(t,e,i){e.splice||(i=e,e=[]),n(m,t)||n(y,t)||(y[t]=[t,e,i])},i.amd={jQuery:!0}}(),i("../tools/almond",function(){}),i("formats/aaigrid/AAIGridConstants",[],function(){"use strict";return{N_COLS:"ncols",N_ROWS:"nrows",X_LL_CORNER:"xllcorner",Y_LL_CORNER:"yllcorner",CELL_SIZE:"cellsize",NO_DATA_VALUE:"NODATA_value"}}),i("formats/aaigrid/AAIGridMetadata",[],function(){"use strict";var t=function(){this._ncols=null,this._nrows=null,this._xllcorner=null,this._yllcorner=null,this._cellsize=null,this._NODATA_value=void 0};return Object.defineProperties(t.prototype,{ncols:{get:function(){return this._ncols},set:function(t){this._ncols=t}},nrows:{get:function(){return this._nrows},set:function(t){this._nrows=t}},xllcorner:{get:function(){return this._xllcorner},set:function(t){this._xllcorner=t}},yllcorner:{get:function(){return this._yllcorner},set:function(t){this._yllcorner=t}},cellsize:{get:function(){return this._cellsize},set:function(t){this._cellsize=t}},NODATA_value:{get:function(){return this._NODATA_value},set:function(t){this._NODATA_value=t}}}),t}),i("error/AbstractError",[],function(){"use strict";var t=function(t,e){this.name=t,this.message=e};return t.prototype.toString=function(){var t=this.name+": "+this.message;return this.stack&&(t+="\n"+this.stack.toString()),t},t}),i("error/ArgumentError",["../error/AbstractError"],function(t){"use strict";var e=function(e){t.call(this,"ArgumentError",e);var i;try{throw new Error}catch(t){i=t.stack}this.stack=i};return e.prototype=Object.create(t.prototype),e}),i("util/Logger",[],function(){"use strict";var t={LEVEL_NONE:0,LEVEL_SEVERE:1,LEVEL_WARNING:2,LEVEL_INFO:3,setLoggingLevel:function(t){e=t},getLoggingLevel:function(){return e},log:function(i,r){r&&i>0&&i<=e&&(i===t.LEVEL_SEVERE?console.error(r):i===t.LEVEL_WARNING?console.warn(r):i===t.LEVEL_INFO?console.info(r):console.log(r))},makeMessage:function(t,e,i){return t+"."+e+": "+(this.messageTable[i]?this.messageTable[i]:i)}
86,logMessage:function(t,e,i,r){var n=this.makeMessage(e,i,r);return this.log(t,n),n},messageTable:{abstractInvocation:"The function called is abstract and must be overridden in a subclass.",indexOutOfRange:"The specified index is out of range.",invalidColumn:"The specified column is out of range.",invalidHeight:"The specified height is zero or negative.",invalidWidth:"The specified width is zero or negative.",invalidRow:"The specified row is out of range.",invalidSize:"The specified size is zero or negative.",missingAltitudeMode:"The specified altitude mode is null or undefined.",missingArrayBuffer:"The specified array buffer is null or undefined",missingAttributeName:"The specified DBase attribute file name is null or undefined.",missingArray:"The specified array is null, undefined or of insufficient length.",missingBoundaries:"The specified boundaries array is null or undefined.",missingBuffer:"The specified buffer descriptor is null or undefined.",missingColor:"The specified color is null or undefined.",missingConfig:"The specified config is null or undefined.",missingDc:"The specified draw context is null or undefined.",missingDomElement:"The specified DOM element is null or undefined.",missingEntry:"The specified entry is null or undefined.",missingFont:"The specified font is null or undefined.",missingFrustum:"The specified frustum is null or undefined.",missingFunction:"The specified function is null or undefined.",missingGlContext:"The specified WebGL rendering context is null or undefined.",missingGlobe:"The specified globe is null or undefined.",missingId:"The specified id is null or undefined.",missingImage:"The specified image is null or undefined.",missingImageFormat:"The specified image format is null or undefined.",missingIndices:"The specified indices array is null or undefined.",missingKey:"The specified key is null or undefined.",missingLevel:"The specified level is null or undefined.",missingLine:"The specified line is null or undefined.",missingList:"The specified list is null or undefined.",missingListener:"The specified listener is null or undefined",missingLocation:"The specified location is null or undefined.",missingMatrix:"The specified matrix is null or undefined.",missingOffset:"The specified offset is null or undefined.",missingPath:"The specified path is null or undefined.",missingPlacename:"The specified place name is null or undefined.",missingPlane:"The specified plane is null or undefined.",missingPoint:"The specified point is null or undefined.",missingPoints:"The specified points array is null or undefined.",missingPosition:"The specified position is null or undefined.",missingPositions:"The specified positions array is null or undefined.",missingProgram:"The specified program is null or undefined.",missingProjection:"The specified projection is null or undefined.",missingRectangle:"The specified rectangle is null or undefined.",missingRenderable:"The specified renderable is null or undefined.",missingResolution:"The specified resolution is null, undefined, or zero.",missingResource:"The specified resource is null or undefined.",missingResult:"The specified result variable is null or undefined.",missingResults:"The specified results array is null or undefined.",missingSector:"The specified sector is null or undefined.",missingShapeType:"The specified shape type is null or undefined.",missingSize:"The specified size is null or undefined.",missingText:"The specified text is null or undefined.",missingTexture:"The specified texture is null or undefined.",missingTile:"The specified tile is null or undefined.",missingType:"The specified type is null or undefined.",missingUrl:"The specified URL is null or undefined",missingVector:"The specified vector is null or undefined.",missingVertex:"The specified vertex is null or undefined.",missingViewport:"The specified viewport is null or undefined.",missingWebCoverageService:"The specified WebCoverageService is null or undefined.",missingWorldWindow:"The specified WorldWindow is null or undefined.",notYetImplemented:"This function is not yet implemented",unsupportedVersion:"The specified version is not supported.",webglNotSupported:"The browser does not support WebGL, or WebGL is disabled."}},e=1;return t}),i("formats/aaigrid/AAIGridReader",["./AAIGridConstants","./AAIGridMetadata","../../error/ArgumentError","../../util/Logger"],function(t,e,
86i,r){"use strict";var n=function(t){if(!t)throw new i(r.logMessage(r.LEVEL_SEVERE,"AAIGridReader","constructor","missingDataSource"));if("string"!=typeof t&&!(t instanceof ArrayBuffer))throw new i(r.logMessage(r.LEVEL_SEVERE,"AAIGridReader","constructor","invalidDataSource"));this._values=null,this._metadata=new e;var n=this.decodeData(t);this.parse(n)};return Object.defineProperties(n.prototype,{metadata:{get:function(){return this._metadata}}}),n.prototype.getImageData=function(){return this._values},n.prototype.decodeData=function(t){if("string"!=typeof t&&!(t instanceof ArrayBuffer))throw new i(r.logMessage(r.LEVEL_SEVERE,"AAIGridReader","decodeData","invalidDataSource"));if("string"==typeof t)return t;if("function"==typeof window.TextDecoder){return new TextDecoder("utf-8").decode(t)}for(var e="",n=new Uint8Array(t),o=65535,s=0,a=n.length;s<a;s+=o)s+o>a&&(o=a-s),e+=String.fromCharCode.apply(null,n.subarray(s,s+o));return e},n.prototype.parse=function(e){if("string"!=typeof e)throw new i(r.logMessage(r.LEVEL_SEVERE,"AAIGridReader","parse","invali
86dDataString"));for(var n=e.replace(/\r?\n|\r/g,"\n").split("\n"),o=[],s=!0,a=0,l=n.length;a<l;a++){var h=n[a];if(h){var u=h.trim().split(" ").map(function(t){return t.trim()}).filter(function(t){return""!==t});if(u[0]===t.N_COLS)this.metadata.ncols=+u[1];else if(u[0]===t.N_ROWS)this.metadata.nrows=+u[1];else if(u[0]===t.X_LL_CORNER)this.metadata.xllcorner=+u[1];else if(u[0]===t.Y_LL_CORNER)this.metadata.yllcorner=+u[1];else if(u[0]===t.CELL_SIZE)this.metadata.cellsize=+u[1];else if(u[0]===t.NO_DATA_VALUE)this.metadata.NODATA_value=+u[1];else if(isFinite(+u[0])){var c=u.map(function(t){var e=+t;return Math.floor(e)!==e&&(s=!1),e});o=o.concat(c)}}}this._values=s?new Int16Array(o):new Float32Array(o)},n.retrieveFromUrl=function(t,e){if(!t)throw new i(r.logMessage(r.LEVEL_SEVERE,"AAIGridReader","retrieveFromUrl","missingUrl"));if(!e)throw new i(r.logMessage(r.LEVEL_SEVERE,"AAIGridReader","retrieveFromUrl","The specified callback is null or undefined."));var o=new XMLHttpRequest;o.onload=function(){this.status>=200&&this.status<300?e(new n(this.response),o):(r.log(r.LEVEL_WARNING,"AAIGrid retrieval failed ("+o.statusText+"): "+t),e(null,o))},o.onerror=function(){r.log(r.LEVEL_WARNING,"AAIGrid retrieval failed: "+t),e(null,o)},o.ontimeout=function(){r.log(r.LEVEL_WARNING,"AAIGrid retrieval timed out: "+t),e(null,o)},o.open("GET",t,!0),o.responseType="arraybuffer",o.send(null)},n}),i("geom/Angle",[],function(){"use strict";return{DEGREES_TO_RADIANS:Math.PI/180,RADIANS_TO_DEGREES:180/Math.PI,TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,normalizedDegrees:function(t){var e=t%360;return e>180?e-360:e<-180?360+e:e},normalizedDegreesLatitude:function(t){var e=t%180;return e>90?180-e:e<-90?-180-e:e},normalizedDegreesLongitude:function(t){var e=t%360;return e>180?e-360:e<-180?360+e:e},normalizedRadians:function(t){var e=t%this.TWO_PI;return e>Math.PI?e-this.TWO_PI:e<-Math.PI?this.TWO_PI+e:e},normalizedRadiansLatitude:function(t){var e=t%Math.PI;return e>this.HALF_PI?Math.PI-e:e<-this.HALF_PI?-Math.PI-e:e},normalizedRadiansLongitude:function(t){var e=t%this.TWO_PI;return e>Math.PI?e-this.TWO_PI:e<-Math.PI?this.TWO_PI+e:e},isValidLatitude:function(t){return t>=-90&&t<=90},isValidLongitude:function(t){return t>=-180&&t<=180},toString:function(t){return t.toString()+"°"},toDecimalDegreesString:function(t){return t.toString()+"°"},toDMSString:function(t){var e,i,r,n,o;return e=t<0?-1:1,i=e*t,r=Math.floor(i),i=60*(i-r),n=Math.floor(i),i=60*(i-n),o=Math.round(i),60==o&&(n++,o=0),60==n&&(r++,n=0),(-1==e?"-":"")+r+"° "+n+"â "+o+"â"},toDMString:function(t){var e,i,r,n,o,s;return e=t<0?-1:1,i=e*t,r=Math.floor(i),i=60*(i-r),n=Math.floor(i),i=60*(i-n),o=Math.round(i),60==o&&(n++,o=0),60==n&&(r++,n=0),s=0==o?n:n+o/60,(-1==e?"-":"")+r+"° "+s+"â"}}}),i("util/Color",["../util/Logger"],function(t){"use strict";var e=function(t,e,i,r){this.red=t,this.green=e,this.blue=i,this.alpha=r};return e.WHITE=new e(1,1,1,1),e.BLACK=new e(0,0,0,1),e.RED=new e(1,0,0,1),e.GREEN=new e(0,1,0,1),e.BLUE=new e(0,0,1,1),e.CYAN=new e(0,1,1,1),e.YELLOW=new e(1,1,0,1),e.MAGENTA=new e(1,0,1,1),e.LIGHT_GRAY=new e(.75,.75,.75,1),e.MEDIUM_GRAY=new e(.5,.5,.5,1),e.DARK_GRAY=new e(.25,.25,.25,1),e.TRANSPARENT=new e(0,0,0,0),e.prototype.set=function(t,e,i,r){return this.red=t,this.green=e,this.blue=i,this.alpha=r,this},e.prototype.copy=function(e){if(!e)throw new ArgumentError(t.logMessage(t.LEVEL_SEVERE,"Color","copy","missingColor"));return this.red=e.red,this.green=e.green,this.blue=e.blue,this.alpha=e.alpha,this},e.prototype.clone=function(){return new e(this.red,this.green,this.blue,this.alpha)},e.prototype.premultipliedComponents=function(t){var e=this.alpha;return t[0]=this.red*e,t[1]=this.green*e,t[2]=this.blue*e,t[3]=e,t},e.colorFromByteArray=function(t){return new e(t[0]/255,t[1]/255,t[2]/255,t[3]/255)},e.colorFromBytes=function(t,i,r,n){return new e(t/255,i/255,r/255,n/255)},e.colorFromHex=function(t){var i=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16),o=parseInt(t.substring(6,8),16);return e.colorFromBytes(i,r,n,o)},e.colorFromKmlHex=function(t){var i=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),n=parseInt(t.substring(4,6),16),o=parseInt(t.substring(6,8),16);return e.colorFromBytes(o,n,r,i)},e.prototype.nextColor=function(){var t=Math.round(255*this.red),e=Math.round(255*this.green),i=Math.round(255*this.blue);return t<255?this.red=(t+1)/255:e<255?(this.red=0,this.green=(e+1)/255):i<255?(this.red=0,this.green=0,this.blue=(i+1)/255):(this.red=1/255,this.green=0,this.blue=0),this},e.prototype.equals=function(t){var e=Math.round(255*this.red),i=Math.round(255*this.green),r=Math.round(255*this.blue),n=Math.round(255*this.alpha),o=Math.round(255*t.red),s=Math.round(255*t.green),a=Math.round(255*t.blue),l=Math.round(255*t.alpha);return e===o&&i===s&&r===a&&n===l},e.prototype.equalsBytes=function(t){var e=Math.round(255*this.red),i=Math.round(255*this.green),r=Math.round(255*this.blue),n=Math.round(255*this.alpha);return e===t[0]&&i===t[1]&&r===t[2]&&n===t[3]},e.prototype.toByteString=function(){return"("+Math.round(255*this.red)+","+Math.round(255*this.green)+","+Math.round(255*this.blue)+","+Math.round(255*this.alpha)+")"},e.prototype.toHexString=function(t){var e=Math.ceil(255*this.red).toString(16),i=Math.ceil(255*this.green).toString(16),r=M
86ath.ceil(255*this.blue).toString(16),n=Math.ceil(255*this.alpha).toString(16),o="#";return o+=e.length<2?"0"+e:e,o+=i.length<2?"0"+i:i,o+=r.length<2?"0"+r:r,t&&(o+=n.length<2?"0"+n:n),o},e.prototype.toCssColorString=function(){return"rgba("+Math.round(255*this.red)+", "+Math.round(255*this.green)+", "+Math.round(255*this.blue)+", "+this.alpha+")"},e}),i("util/Font",["../error/ArgumentError","../util/Color","../util/Logger"],function(t,e,i){"use strict";var r=function(e,r,n,o,s,a){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"Font","constructor","missingSize"));if(e<=0)throw new t(i.logMessage(i.LEVEL_SEVERE,"Font","constructor","invalidSize"));this._size=e,this.style=r||"normal",this.variant=n||"normal",this.weight=o||"normal",this.family=s||"sans-serif",this.horizontalAlignment=a||"center"};return Object.defineProperties(r.prototype,{size:{get:function(){return this._size},set:function(t){this._fontString=null,this._size=t}},style:{get:function(){return this._style},set:function(t){this._fontString=null,this._style=t}},variant:{get:function(){return this._variant},set:function(t){this._fontString=null,this._variant=t}},weight:{get:function(){return this._weight},set:function(t){this._fontString=null,this._weight=t}},family:{get:function(){return this._family},set:function(t){this._fontString=null,this._family=t}},horizontalAlignment:{get:function(){return this._horizontalAlignment},set:function(t){this._toString=null,this._horizontalAlignment=t}},fontString:{get:function(){return this._fontString||(this._fontString=this._style+" "+this.variant+" "+this._weight+" "+this._size.toString()+"px "+this._family),this._fontString}}}),r.prototype.toString=function(){return this._toString&&this._fontString||(this._toString=this.fontString+" "+this.horizontalAlignment),this._toString},r}),i("util/Insets",["../error/ArgumentError","../util/Logger"],function(t,e){"use strict";var i=function(i,r,n,o){if(4!==arguments.length)throw new t(e.logMessage(e.LEVEL_SEVERE,"Insets","constructor","invalidArgumentCount"));this._top=i,this._left=r,this._bottom=n,this._right=o};return i.prototype.set=function(t,e,i,r){this._top=t,this._left=e,this._bottom=i,this._right=r},i.prototype.clone=function(){return new i(this._top,this._left,this._bottom,this._right)},i.prototype.toString=function(){return this._top+" "+this._left+" "+this._bottom+" "+this._right},Object.defineProperties(i.prototype,{top:{get:function(){return this._top},set:function(t){this._top=t}},left:{get:function(){return this._left},set:function(t){this._left=t}},bottom:{get:function(){return this._bottom},set:function(t){this._bottom=t}},right:{get:function(){return this._right},set:function(t){this._right=t}}}),i}),i("geom/Vec3",["../util/Logger","../error/ArgumentError"],function(t,e){"use strict";var i=function(t,e,i){this[0]=t,this[1]=e,this[2]=i};return i.prototype=new Float64Array(3),i.ZERO=new i(0,0,0),i.average=function(i,r){if(!i||i.length<1)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","average","missingArray"));if(!r)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","average","missingResult"));var n,o=i.length;r[0]=0,r[1]=0,r[2]=0;for(var s=0,a=i.length;s<a;s++)n=i[s],r[0]+=n[0]/o,r[1]+=n[1]/o,r[2]+=n[2]/o;return r},i.averageOfBuffer=function(i,r){if(!i||i.length<1)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","averageBuffer","missingArray"));if(!r)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","averageBuffer","missingResult"));var n=i.length/3;r[0]=0,r[1]=0,r[2]=0;for(var o=0;o<n;o++)r[0]+=i[3*o]/n,r[1]+=i[3*o+1]/n,r[2]+=i[3*o+2]/n;return r},i.areColinear=function(r,n,o){if(!r||!n||!o)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","areColinear","missingVector"));var s=new i(r[0]-n[0],r[1]-n[1],r[2]-n[2]).normalize(),a=new i(o[0]-n[0],o[1]-n[1],o[2]-n[2]).normalize();return Math.abs(s.dot(a))>.999},i.computeTriangleNormal=function(r,n,o){if(!r||!n||!o)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","areColinear","missingVector"));var s=(n[1]-r[1])*(o[2]-r[2])-(n[2]-r[2])*(o[1]-r[1]),a=(n[2]-r[2])*(o[0]-r[0])-(n[0]-r[0])*(o[2]-r[2]),l=(n[0]-r[0])*(o[1]-r[1])-(n[1]-r[1])*(o[0]-r[0]),h=s*s+a*a+l*l;return 0===h?new i(s,a,l):(h=Math.sqrt(h),new i(s/h,a/h,l/h))},i.findThreeIndependentVertices=function(t,e){var r=e&&e>0?e:3;if(!t||t.length<3*r)return null;for(var n=new i(t[0],t[1],t[2]),o=null,s=null,a=r;a<t.length&&(o=new i(t[a],t[a+1],t[a+2]),o[0]===n[0]&&o[1]===n[1]&&o[2]===n[2]);a+=r)o=null;if(!o)return null;for(a+=r;a<t.length&&(s=new i(t[a],t[a+1],t[a+2]),s[0]===n[0]&&s[1]===n[1]&&s[2]===n[2]||s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]||i.areColinear(n,o,s));a+=r)s=null;return s?[n,o,s]:null},i.computeBufferNormal=function(t,e){var r=i.findThreeIndependentVertices(t,e);return r?i.computeTriangleNormal(r[0],r[1],r[2]):null}
86,i.prototype.set=function(t,e,i){return this[0]=t,this[1]=e,this[2]=i,this},i.prototype.copy=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","copy","missingVector"));return this[0]=i[0],this[1]=i[1],this[2]=i[2],this},i.prototype.equals=function(t){return this[0]===t[0]&&this[1]===t[1]&&this[2]===t[2]},i.prototype.add=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","add","missingVector"));return this[0]+=i[0],this[1]+=i[1],this[2]+=i[2],this},i.prototype.subtract=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","subtract","missingVector"));return this[0]-=i[0],this[1]-=i[1],this[2]-=i[2],this},i.prototype.multiply=function(t){return this[0]*=t,this[1]*=t,this[2]*=t,this},i.prototype.divide=function(t){return this[0]/=t,this[1]/=t,this[2]/=t,this},i.prototype.multiplyByMatrix=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","multiplyByMatrix","missingMatrix"));var r=i[0]*this[0]+i[1]*this[1]+i[2]*this[2]+i[3],n=i[4]*this[0]+i[5]*this[1]+i[6]*this[2]+i[7],o=i[8]*this[0]+i[9]*this[1]+i[10]*this[2]+i[11],s=i[12]*this[0]+i[13]*this[1]+i[14]*this[2]+i[15];return this[0]=r/s,this[1]=n/s,this[2]=o/s,this},i.prototype.mix=function(i,r){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","mix","missingVector"));var n=1-r,o=r;return this[0]=this[0]*n+i[0]*o,this[1]=this[1]*n+i[1]*o,this[2]=this[2]*n+i[2]*o,this},i.prototype.negate=function(){return this[0]=-this[0],this[1]=-this[1],this[2]=-this[2],this},i.prototype.dot=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","dot","missingVector"));return this[0]*i[0]+this[1]*i[1]+this[2]*i[2]},i.prototype.cross=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","cross","missingVector"));var r=this[1]*i[2]-this[2]*i[1],n=this[2]*i[0]-this[0]*i[2],o=this[0]*i[1]-this[1]*i[0];return this[0]=r,this[1]=n,this[2]=o,this},i.prototype.magnitudeSquared=function(){return this.dot(this)},i.prototype.magnitude=function(){return Math.sqrt(this.magnitudeSquared())},i.prototype.normalize=function(){var t=this.magnitude(),e=1/t;return this[0]*=e,this[1]*=e,this[2]*=e,this},i.prototype.distanceToSquared=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","distanceToSquared","missingVector"));var r=this[0]-i[0],n=this[1]-i[1],o=this[2]-i[2];return r*r+n*n+o*o},i.prototype.distanceTo=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec3","distanceTo","missingVector"));return Math.sqrt(this.distanceToSquared(i))},i.prototype.swap=function(t){var e=this[0];return this[0]=t[0],t[0]=e,e=this[1],this[1]=t[1],t[1]=e,e=this[2],this[2]=t[2],t[2]=e,this},i.prototype.toString=function(){return"("+this[0]+", "+this[1]+", "+this[2]+")"},i}),i("geom/Vec2",["../util/Logger","../error/ArgumentError","../geom/Vec3"],function(t,e,i){"use strict";var r=function(t,e){this[0]=t,this[1]=e};return r.prototype=new Float64Array(2),r.prototype.set=function(t,e){return this[0]=t,this[1]=e,this},r.prototype.copy=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec2","copy","missingVector"));return this[0]=i[0],this[1]=i[1],this},r.prototype.equals=function(t){return this[0]===t[0]&&this[1]===t[1]},r.average=function(i,r){if(!i||i.length<1)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec2","average","missingArray"));if(!r)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec2","average","missingResult"));var n,o=i.length;r[0]=0,r[1]=0;for(var s=0,a=i.length;s<a;s++)n=i[s],r[0]+=n[0]/o,r[1]+=n[1]/o;return r},r.prototype.add=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec2","add","missingVector"));return this[0]+=i[0],this[1]+=i[1],this},r.prototype.subtract=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec2","subtract","missingVector"));return this[0]-=i[0],this[1]-=i[1],this},r.prototype.multiply=function(t){return this[0]*=t,this[1]*=t,this},r.prototype.divide=function(t){return this[0]/=t,this[1]/=t,this},r.prototype.mix=function(i,r){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec2","mix","missingVector"));var n=1-r,o=r;return this[0]=this[0]*n+i[0]*o,this[1]=this[1]*n+i[1]*o,this},r.prototype.negate=function(){return this[0]=-this[0],this[1]=-this[1],this},r.prototype.dot=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec2","dot","missingVector"));return this[0]*i[0]+this[1]*i[1]},r.prototype.magnitudeSquared=function(){return this.dot(this)},r.prototype.magnitude=function(){return Math.sqrt(this.magnitudeSquared())},r.prototype.normalize=function(){var t=this.magnitude(),e=1/t;return this[0]*=e,this[1]*=e,this},r.prototype.distanceToSquared=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec2","distanceToSquared","missingVector"));var r=this[0]-i[0],n=this[1]-i[1];return r*r+n*n},r.prototype.distanceTo=function(i){if(!i)throw new e(t.logMessage(t.LEVEL_SEVERE,"Vec2","distanceTo","missingVector"));return Math.sqrt(this.distanceToSquared(i))},r.prototype.toVec3=function(){return new i(this[0],this[1],0)},r.prototype.swap=function(t){var e=this[0];return this[0]=t[0],t[0]=e,e=this[1],this[1]=t[1],t[1]=e,this},r.prototype.toString=function(){return"("+this[0]+", "+this[1]+")"},r}),i("util/Offset",["../geom/Vec2"],function(t){"use strict";
86var e=function(t,e,i,r){this.x=e,this.y=r,this.xUnits=t,this.yUnits=i};return e.prototype.clone=function(){return new e(this.xUnits,this.x,this.yUnits,this.y)},e.prototype.offsetForSize=function(e,i){var r,n;return r=this.xUnits===WorldWind.OFFSET_FRACTION?e*this.x:this.xUnits===WorldWind.OFFSET_INSET_PIXELS?e-this.x:this.x,n=this.yUnits===WorldWind.OFFSET_FRACTION?i*this.y:this.yUnits===WorldWind.OFFSET_INSET_PIXELS?i-this.y:this.y,new t(r,n)},e.prototype.toString=function(){return this.xUnits+" "+this.x+" "+this.yUnits+" "+this.y},e}),i("shapes/TextAttributes",["../util/Color","../util/Font","../util/Offset"],function(t,e,i){"use strict";var r=function(r){this._color=r?r._color.clone():t.WHITE.clone(),this._font=r?r._font:new e(14),this._offset=r?r._offset:new i(WorldWind.OFFSET_FRACTION,.5,WorldWind.OFFSET_FRACTION,0),this._scale=r?r._scale:1,this._depthTest=!!r&&r._depthTest,this._enableOutline=!r||r._enableOutline,this._outlineWidth=r?r._outlineWidth:4,this._outlineColor=r?r._outlineColor:new t(0,0,0,.5),this.stateKeyInvalid=!0};return r.prototype.computeStateKey=function(){return"c "+this._color.toHexString(!0)+" f "+this._font.toString()+" o "+this._offset.toString()+" s "+this._scale+" dt "+this._depthTest+" eo "+this._enableOutline+" ow "+this._outlineWidth+" oc "+this._outlineColor.toHexString(!0)},Object.defineProperties(r.prototype,{stateKey:{get:function(){return this.stateKeyInvalid&&(this._stateKey=this.computeStateKey(),this.stateKeyInvalid=!1),this._stateKey}},color:{get:function(){return this._color},set:function(t){this._color=t,this.stateKeyInvalid=!0}},font:{get:function(){return this._font},set:function(t){this._font=t,this.stateKeyInvalid=!0}},offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.stateKeyInvalid=!0}},scale:{get:function(){return this._scale},set:function(t){this._scale=t,this.stateKeyInvalid=!0}},depthTest:{get:function(){return this._depthTest},set:function(t){this._depthTest=t,this.stateKeyInvalid=!0}},enableOutline:{get:function(){return this._enableOutline},set:function(t){this._enableOutline=t,this.stateKeyInvalid=!0}},outlineWidth:{get:function(){return this._outlineWidth},set:function(t){this._outlineWidth=t,this.stateKeyInvalid=!0}},outlineColor:{get:function(){return this._outlineColor},set:function(t){this._outlineColor=t,this.stateKeyInvalid=!0}}}),r}),i("shapes/AnnotationAttributes",["../util/Color","../util/Font","../util/Insets","../shapes/TextAttributes"],function(t,e,i,r){"use strict";var n=function(e){this._cornerRadius=e?e._cornerRadius:0,this._insets=e?e._insets:new i(0,0,0,0),this._backgroundColor=e?e._backgroundColor.clone():t.WHITE.clone(),this._leaderGapWidth=e?e._leaderGapWidth:40,this._leaderGapHeight=e?e._leaderGapHeight:30,this._opacity=e?e._opacity:1,this._scale=e?e._scale:1,this._drawLeader=!e||e._drawLeader,this._width=e?e._width:200,this._height=e?e._height:100,this._textAttributes=e?e._textAttributes:this.createDefaultTextAttributes(),this.stateKeyInvalid=!0};return n.prototype.computeStateKey=function(){return"wi "+this._width+" he "+this._height+" cr "+this._cornerRadius+" in "+this._insets.toString()+" bg "+this.backgroundColor.toHexString(!0)+" dl "+this.drawLeader+" lgw "+this.leaderGapWidth+" lgh "+this.leaderGapHeight+" op "+this.opacity+" ta "+this._textAttributes.stateKey+" sc "+this.scale},n.prototype.createDefaultTextAttributes=function(){var t=new r(null);return t.enableOutline=!1,t},Object.defineProperties(n.prototype,{width:{get:function(){return this._width},set:function(t){this._width=t,this.stateKeyInvalid=!0}},height:{get:function(){return this._height},set:function(t){this._height=t,this.stateKeyInvalid=!0}},cornerRadius:{get:function(){return this._cornerRadius},set:function(t){this._cornerRadius=t,this.stateKeyInvalid=!0}},insets:{get:function(){return this._insets},set:function(t){this._insets=t,this.stateKeyInvalid=!0}},backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this.stateKeyInvalid=!0}},textAttributes:{get:function(){return this._textAttributes},set:function(t){this._textAttributes=t,this.stateKeyInvalid=!0}},drawLeader:{get:function(){return this._drawLeader},set:function(t){this._drawLeader=t,this.stateKeyInvalid=!0}},leaderGapWidth:{get:function(){return this._leaderGapWidth}
86,set:function(t){this._leaderGapWidth=t,this.stateKeyInvalid=!0}},leaderGapHeight:{get:function(){return this._leaderGapHeight},set:function(t){this._leaderGapHeight=t,this.stateKeyInvalid=!0}},opacity:{get:function(){return this._opacity},set:function(t){this._opacity=t,this.stateKeyInvalid=!0}},scale:{get:function(){return this._scale},set:function(t){this._scale=t,this.stateKeyInvalid=!0}},stateKey:{get:function(){return this.stateKeyInvalid&&(this._stateKey=this.computeStateKey(),this.stateKeyInvalid=!1),this._stateKey}}}),n}),i("shaders/GpuShader",["../error/ArgumentError","../util/Logger"],function(t,e){"use strict";var i=function(i,r,n){if(r!==i.VERTEX_SHADER&&r!==i.FRAGMENT_SHADER)throw new t(e.logMessage(e.LEVEL_SEVERE,"GpuShader","constructor","The specified shader type is unrecognized."));if(!n)throw new t(e.logMessage(e.LEVEL_SEVERE,"GpuShader","constructor","The specified shader source is null or undefined."));var o=i.createShader(r);if(!o)throw new t(e.logMessage(e.LEVEL_SEVERE,"GpuShader","constructor","Unable to create shader of type "+(r==i.VERTEX_SHADER?"VERTEX_SHADER.":"FRAGMENT_SHADER.")));if(!this.compile(i,o,r,n)){var s=i.getShaderInfoLog(o);throw i.deleteShader(o),new t(e.logMessage(e.LEVEL_SEVERE,"GpuShader","constructor","Unable to compile shader: "+s))}this.shaderId=o};return i.prototype.compile=function(t,e,i,r){return t.shaderSource(e,r),t.compileShader(e),t.getShaderParameter(e,t.COMPILE_STATUS)},i.prototype.dispose=function(t){this.shaderId&&(t.deleteShader(this.shaderId),delete this.shaderId)},i}),i("shaders/GpuProgram",["../error/ArgumentError","../util/Color","../shaders/GpuShader","../util/Logger"],function(t,e,i,r){"use strict";var n=function(e,n,o,s){if(!n||!o)throw new t(r.logMessage(r.LEVEL_SEVERE,"GpuProgram","constructor","The specified shader source is null or undefined."));var a,l,h;try{l=new i(e,e.VERTEX_SHADER,n),h=new i(e,e.FRAGMENT_SHADER,o)}catch(t){throw l&&l.dispose(e),h&&h.dispose(e),t}if(!(a=e.createProgram()))throw new t(r.logMessage(r.LEVEL_SEVERE,"GpuProgram","constructor","Unable to create shader program."));if(e.attachShader(a,l.shaderId),e.attachShader(a,h.shaderId), 87s)for(var u=0,c=s.length;u<c;u++)e.bindAttribLocation(a,u,s[u]);if(!this.link(e,a)){var d=e.getProgramInfoLog(a);throw e.detachShader(a,l.shaderId),e.detachShader(a,h.shaderId),e.deleteProgram(a),l.dispose(e),h.dispose(e),new t(r.logMessage(r.LEVEL_SEVERE,"GpuProgram","constructor","Unable to link shader program: "+d))}this.programId=a,this.attributeLocations={},this.uniformLocations={},this.vertexShader=l,this.fragmentShader=h,this.size=n.length+o.length,this.scratchArray=new Float32Array(16)};return n.prototype.dispose=function(t){this.programId&&(this.vertexShader&&t.detachShader(this.programId,this.vertexShader.shaderId),this.fragmentShader&&t.detachShader(this.programId,this.fragmentShader.shaderId),t.deleteProgram(this.programId),delete this.programId),this.vertexShader&&(this.vertexShader.dispose(t),delete this.vertexShader),this.fragmentShader&&(this.fragmentShader.dispose(t),delete this.fragmentShader),this.attributeLocations={},this.uniformLocations={}},n.prototype.attributeLocation=function(e,i){if(!i||0==i.length)throw new t(r.logMessage(r.LEVEL_SEVERE,"GpuProgram","attributeLocation","The specified attribute name is null, undefined or empty."));var n=this.attributeLocations[i];return n||(n=e.getAttribLocation(this.programId,i),this.attributeLocations[i]=n),n},n.prototype.uniformLocation=function(e,i){if(!i||0==i.length)throw new t(r.logMessage(r.LEVEL_SEVERE,"GpuProgram","uniformLocation","The specified uniform name is null, undefined or empty."));var n=this.uniformLocations[i];return n||(n=e.getUniformLocation(this.programId,i),this.uniformLocations[i]=n),n},n.prototype.link=function(t,e){return t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS)},n.prototype.loadUniformMatrix=function(e,i,n){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"GpuProgram","loadUniformMatrix","missingMatrix"));var o=i.columnMajorComponents(this.scratchArray);e.uniformMatrix4fv(n,!1,o)},n.prototype.loadUniformColor=function(e,i,n){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"GpuProgram","loadUniformColor","missingColor"));var o=i.premultipliedComponents(this.scratchArray);e.uniform4f(n,o[0],o[1],o[2],o[3])}
87,n.prototype.loadUniformColorComponents=function(t,e,i,r,n,o){t.uniform4f(o,e*n,i*n,r*n,n)},n}),i("shaders/BasicTextureProgram",["../error/ArgumentError","../util/Color","../shaders/GpuProgram","../util/Logger"],function(t,e,i,r){"use strict";var n=function(t){var e=["vertexPoint","normalVector","vertexTexCoord"];i.call(this,t,"attribute vec4 vertexPoint;\nattribute vec4 vertexTexCoord;\nattribute vec4 normalVector;\nuniform mat4 mvpMatrix;\nuniform mat4 mvInverseMatrix;\nuniform mat4 texCoordMatrix;\nuniform bool applyLighting;\nvarying vec2 texCoord;\nvarying vec4 normal;\nvoid main() {gl_Position = mvpMatrix * vertexPoint;\ntexCoord = (texCoordMatrix * vertexTexCoord).st;\nif (applyLighting) {normal = mvInverseMatrix * normalVector;}\n}","precision mediump float;\nuniform float opacity;\nuniform vec4 color;\nuniform bool enableTexture;\nuniform bool modulateColor;\nuniform sampler2D textureSampler;\nuniform bool applyLighting;\nvarying vec2 texCoord;\nvarying vec4 normal;\nvoid main() {\nvec4 textureColor = texture2D(textureSampler, texCoord);\nfloat ambient = 0.15; vec4 lightDirection = vec4(0, 0, 1, 0);\nif (enableTexture && !modulateColor)\n gl_FragColor = textureColor * color * opacity;\nelse if (enableTexture && modulateColor)\n gl_FragColor = color * floor(textureColor.a + 0.5);\nelse\n gl_FragColor = color * opacity;\nif (gl_FragColor.a == 0.0) {discard;}\nif (applyLighting) {\n vec4 n = normal * (gl_FrontFacing ? 1.0 : -1.0);\n gl_FragColor.rgb *= clamp(ambient + dot(lightDirection, n), 0.0, 1.0);\n}\n}",e),this.vertexPointLocation=this.attributeLocation(t,"vertexPoint"),this.normalVectorLocation=this.attributeLocation(t,"normalVector"),this.vertexTexCoordLocation=this.attributeLocation(t,"vertexTexCoord"),this.mvpMatrixLocation=this.uniformLocation(t,"mvpMatrix"),this.mvInverseMatrixLocation=this.uniformLocation(t,"mvInverseMatrix"),this.colorLocation=this.uniformLocation(t,"color"),this.textureEnabledLocation=this.uniformLocation(t,"enableTexture"),this.modulateColorLocation=this.uniformLocation(t,"modulateColor"),this.textureUnitLocation=this.uniformLocation(t,"textureSampler"),this.textureMatrixLocation=this.uniformLocation(t,"texCoordMatrix"),this.opacityLocation=this.uniformLocation(t,"opacity"),this.applyLightingLocation=this.uniformLocation(t,"applyLighting")};return n.key="WorldWindGpuBasicTextureProgram",n.prototype=Object.create(i.prototype),n.prototype.loadModelviewInverse=function(e,i){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"BasicTextureProgram","loadModelviewInverse","missingMatrix"));this.loadUniformMatrix(e,i,this.mvInverseMatrixLocation)},n.prototype.loadModelviewProjection=function(e,i){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"BasicTextureProgram","loadModelviewProjection","missingMatrix"));this.loadUniformMatrix(e,i,this.mvpMatrixLocation)},n.prototype.loadColor=function(e,i){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"BasicTextureProgram","loadColor","missingColor"));this.loadUniformColor(e,i,this.colorLocation)},n.prototype.loadTextureEnabled=function(t,e){t.uniform1i(this.textureEnabledLocation,e?1:0)},n.prototype.loadModulateColor=function(t,e){t.uniform1i(this.modulateColorLocation,e?1:0)},n.prototype.loadTextureUnit=function(t,e){t.uniform1i(this.textureUnitLocation,e-t.TEXTURE0)},n.prototype.loadTextureMatrix=function(t,e){this.loadUniformMatrix(t,e,this.textureMatrixLocation)},n.prototype.loadOpacity=function(t,e){t.uniform1f(this.opacityLocation,e)},n.prototype.loadApplyLighting=function(t,e){t.uniform1i(this.applyLightingLocation,e)},n}),i("geom/Line",["../error/ArgumentError","../util/Logger","../geom/Vec3"],function(t,e,i){"use strict";var r=function(i,r){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"Line","constructor","Origin is null or undefined."));if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"Line","constructor","Direction is null or undefined."));this.origin=i,this.direction=r};return r.fromSegment=function(n,o){if(!n||!o)throw new t(e.logMessage(e.LEVEL_SEVERE,"Line","fromSegment","missingPoint"));var s=new i(n[0],n[1],n[2]),a=new i(o[0]-n[0],o[1]-n[1],o[2]-n[2]);return new r(s,a)},r.prototype.pointAt=function(i,r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"Line","pointAt","missingResult."));return r[0]=this.origin[0]+this.direction[0]*i,r[1]=this.origin[1]+this.direction[1]*i,r[2]=this.origin[2]+this.direction[2]*i,r},r.prototype.equals=function(t){return!!t&&(this.origin.equals(t.origin)&&this.direction.equals(t.direction))},r.prototype.clone=function(){var t=new r(new i(0,0,0),new i(0,0,0));return t.copy(this),t},r.prototype.copy=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"Line","copy","missingLine"));return this.origin.copy(i.origin),this.direction.copy(i.direction),this},r}),i("geom/Plane",["../error/ArgumentError","../geom/Line","../util/Logger","../geom/Vec3"],function(t,e,
87i,r){"use strict";var n=function(t,e,i,n){this.normal=new r(t,e,i),this.distance=n};return n.fromPoints=function(e,o,s){if(!e||!o||!s)throw new t(i.logMessage(i.LEVEL_SEVERE,"Plane","fromPoints","missingVector"));var a=new r(o[0],o[1],o[2]);a.subtract(e);var l=new r(s[0],s[1],s[2]);l.subtract(e),a.cross(l),a.normalize();var h=-a.dot(e);return new n(a[0],a[1],a[2],h)},n.prototype.dot=function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"Plane","dot","missingVector"));return this.normal.dot(e)+this.distance},n.prototype.distanceToPoint=function(t){return this.dot(t)},n.prototype.transformByMatrix=function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"Plane","transformByMatrix","missingMatrix"));var r=e[0]*this.normal[0]+e[1]*this.normal[1]+e[2]*this.normal[2]+e[3]*this.distance,n=e[4]*this.normal[0]+e[5]*this.normal[1]+e[6]*this.normal[2]+e[7]*this.distance,o=e[8]*this.normal[0]+e[9]*this.normal[1]+e[10]*this.normal[2]+e[11]*this.distance,s=e[12]*this.normal[0]+e[13]*this.normal[1]+e[14]*this.normal[2]+e[15]*this.distance;return this.normal[0]=r,this.normal[1]=n,this.normal[2]=o,this.distance=s,this},n.prototype.normalize=function(){var t=this.normal.magnitude();return 0===t?this:(this.normal.divide(t),this.distance/=t,this)},n.prototype.intersectsSegment=function(t,e){return this.dot(t)*this.dot(e)<=0},n.prototype.intersectsSegmentAt=function(t,e,i){var r=this.dot(t),n=this.dot(e);if(0===r&&0===n)return i[0]=t[0],i[1]=t[1],i[2]=t[2],!0;if(r===n)return!1;var o=-r/(n-r),s=1-o;return i[0]=o*t[0]+s*e[0],i[1]=o*t[1]+s*e[1],i[2]=o*t[2]+s*e[2],r*n<=0},n.prototype.onSameSide=function(e,r){if(!e||!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"Plane","onSameSide","missingPoint"));var n=this.distanceToPoint(e),o=this.distanceToPoint(r);return n<0&&o<0?-1:n>0&&o>0?1:0},n.prototype.clip=function(n,o){if(!n||!o)throw new t(i.logMessage(i.LEVEL_SEVERE,"Plane","clip","missingPoint"));if(n.equals(o))return null;var s,a,l,h=e.fromSegment(n,o),u=this.normal.dot(h.direction);return 0===u?(s=this.dot(h.origin),0===s?[n,o]:null):(a=-this.dot(h.origin)/u)<0||a>1?null:(l=h.pointAt(a,new r(0,0,0)),u>0?[l,o]:[n,l])},n}),i("geom/Rectangle",["../util/Logger"],function(t){"use strict";var e=function(t,e,i,r){this.x=t,this.y=e,this.width=i,this.height=r};return e.prototype.set=function(t,e,i,r){this.x=t,this.y=e,this.width=i,this.height=r},e.prototype.getMinX=function(){return this.x},e.prototype.getMinY=function(){return this.y},e.prototype.getMaxX=function(){return this.x+this.width},e.prototype.getMaxY=function(){return this.y+this.height},e.prototype.containsPoint=function(t){return t[0]>=this.x&&t[0]<=this.x+this.width&&t[1]>=this.y&&t[1]<=this.y+this.height},e.prototype.intersects=function(t){return!(t.x+t.width<this.x)&&(!(t.x>this.x+this.width)&&(!(t.y+t.height<this.y)&&!(t.y>this.y+this.height)))},e.prototype.intersectsRectangles=function(t){if(t)for(var e=0;e<t.length;e++)if(this.intersects(t[e]))return!0;return!1},e.prototype.toString=function(){return this.x+", "+this.y+", "+this.width+", "+this.height},e}),i("util/WWMath",["../geom/Angle","../error/ArgumentError","../geom/Line","../util/Logger","../geom/Rectangle","../geom/Vec3"],function(t,e,i,r,n,o){"use strict";var s={clamp:function(t,e,i){return t<e?e:t>i?i:t},interpolate:function(t,e,i){return(1-t)*e+t*i},cbrt:function(t){return"function"==typeof Math.cbrt?Math.cbrt(t):Math.pow(t,1/3)},computeEllipsoidalGlobeIntersection:function(t,i,n,o){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeEllipsoidalGlobeIntersection","missingLine"));if(!o)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeEllipsoidalGlobeIntersection","missingResult"));var s,a=t.direction[0],l=t.direction[1],h=t.direction[2],u=t.origin[0],c=t.origin[1],d=t.origin[2],f=i/n,p=f*f,g=i*i,m=a*a+p*l*l+h*h,y=2*(u*a+p*c*l+d*h),E=u*u+p*c*c+d*d-g,v=y*y-4*m*E;return!(v<0)&&(s=(-y-Math.sqrt(v))/(2*m),o[0]=u+a*s,o[1]=c+l*s,o[2]=d+h*s,!0)},computeTriangleIntersection:function(t,i,n,o,s){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeTriangleIntersection","missingLine"));if(!i||!n||!o)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeTriangleIntersection","missingVertex"));if(!s)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeTriangleIntersection","missingResult"));var a=t.direction[0],l=t.direction[1],h=t.direction[2],u=t.origin[0],c=t.origin[1],d=t.origin[2],f=n[0]-i[0],p=n[1]-i[1],g=n[2]-i[2],m=o[0]-i[0],y=o[1]-i[1],E=o[2]-i[2],v=l*E-h*y,_=h*m-a*E,b=a*y-l*m,S=f*v+p*_+g*b;if(S>-1e-5&&S<1e-5)return!1;var w=1/S,L=u-i[0],T=c-i[1],x=d-i[2],R=w*(L*v+T*_+x*b);if(R<-1e-5||R>1+1e-5)return!1;var M=T*g-x*p,C=x*f-L*g,A=L*p-T*f,P=w*(a*M+l*C+h*A);if(P<-1e-5||R+P>1+1e-5)return!1;var N=w*(m*M+y*C+E*A);return!(N<0)&&(s[0]=u+a*N,s[1]=c+l*N,s[2]=d+h*N,!0)},computeIndexedTrianglesIntersection:function(t,i,n,a){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeIndexedTrianglesIntersection","missingLine"));if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeIndexedTrianglesIntersection","missingPoints"));if(!n)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeIndexedTrianglesIntersection","missingIndices"));if(!a)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeIndexedTrianglesIntersection","missingResults"));for(var l=new o(0,0,0),h=new o(0,0,0),u=new o(0,0,0),c=new o(0,0,0),d=0,f=n.length;d<f;d+=3){var p=3*n[d],g=3*n[d+1],m=3*n[d+2];l[0]=i[p],l[1]=i[p+1],l[2]=i[p+2],h[0]=i[g],h[1]=i[g+1],h[2]=i[g+2],u[0]=i[m],u[1]=i[m+1],u[2]=i[m+2],s.computeTriangleIntersection(t,l,h,u,c)&&(a.push(c),c=new o(0,0,0))}return a.length>0},computeTriStripIntersections:function(t,i,n,s){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeTriStripIntersections","missingLine"));if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeTriStripIntersections","missingPoints"));if(!n)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeTriStripIntersections","missingIndices"));if(!s)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","computeTriStripIntersections","missingResults"));var a,l,h,u,c,d,f,p,g,m,y,E,v,_,b,S,w,L,T,x,R,M,C,A,P,N,O,I,D,k,V=t.direction[0],F=t.direction[1],G=t.direction[2],W=t.origin[0],B=t.origin[1],U=t.origin[2];k=3*n[0],u=i[k++],c=i[k++],d=i[k],k=3*n[1],f=i[k++],p=i[k++],g=i[k];for(var K=2,j=n.length;K<j;K++)a=u,l=c,h=d,u=f,c=p,d=g,k=3*n[K],f=i[k++],p=i[k++],g=i[k],m=u-a,y=c-l,E=d-h,v=f-a,_=p-l,b=g-h,S=F*b-G*_,w=G*v-V*b,L=V*_-F*v,(I=m*S+y*w+E*L)>-1e-5&&I<1e-5||(D=1/I,T=W-a,x=B-l,R=U-h,(P=D*(T*S+x*w+R*L))<-1e-5||P>1+1e-5||(M=x*E-R*y,C=R*m-T*E,A=T*y-x*m,(N=D*(V*M+F*C+G*A))<-1e-5||P+N>1+1e-5||(O=D*(v*M+_*C+b*A))>=0&&s.push(new o(W+V*O,B+F*O,U+G*O))))},fabs:function(t){return t>=0?t:-t},fmod:function(t,e){return 0===e?0:t-Math.floor(t/e)*e},fract:function(t){return t-Math.floor(t)},mod:function(t,e){return(t%e+e)%e},max:function(t,e){return t>e?t:e}
87,localCoordinateAxesAtPoint:function(t,i,n,o,s){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","localCoordinateAxesAtPoint","missingVector"));if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","localCoordinateAxesAtPoint","missingGlobe"));if(!n||!o||!s)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","localCoordinateAxesAtPoint","missingResult"));var a=t[0],l=t[1],h=t[2];i.surfaceNormalAtPoint(a,l,h,s),i.northTangentAtPoint(a,l,h,o),n.set(o[0],o[1],o[2]),n.cross(s),n.normalize(),o.set(s[0],s[1],s[2]),o.cross(n),o.normalize()},horizonDistanceForGlobeRadius:function(t,i){if(t<0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","horizontalDistanceForGlobeRadius","The specified globe radius is negative."));return t>0&&i>0?Math.sqrt(i*(2*t+i)):0},perspectiveNearDistanceForFarDistance:function(t,i,n){if(t<0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectiveNearDistanceForFarDistance","The specified distance is negative."));if(i<0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectiveNearDistanceForFarDistance","The specified resolution is negative."));if(n<1)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectiveNearDistanceForFarDistance","The specified depth bits is negative."));var o=(1<<n)-1;return t/(o/(1-i/t)-o+1)},perspectiveNearDistance:function(t,i,n){if(t<=0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectiveNearDistance","invalidWidth"));if(i<=0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectiveNearDistance","invalidHeight"));if(n<0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectiveNearDistance","The specified distance is negative."));var o=i/t;return 2*n/Math.sqrt(o*o+5)},perspectiveFrustumRectangle:function(t,i,o){if(t<=0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectiveFrustumRectangle","invalidWidth"));if(i<=0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectiveFrustumRectangle","invalidHeight"));if(o<0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectiveFrustumRectangle","The specified distance is negative."));var s=o,a=o*i/t;return new n(-s/2,-a/2,s,a)},perspectivePixelSize:function(t,i,n){if(t<=0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectivePixelSize","invalidWidth"));if(i<=0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectivePixelSize","invalidHeight"));if(n<0)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","perspectivePixelSize","The specified distance is negative."));return s.perspectiveFrustumRectangle(t,i,n).height/i},boundingRectForUnitQuad:function(t){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"WWMath","boundingRectForUnitQuad","missingMatrix"));var i=t,o=i[3],s=i[7],a=i[0]+i[3],l=i[4]+i[7],h=i[1]+i[3],u=i[5]+i[7],c=i[0]+i[1]+i[3],d=i[4]+i[5]+i[7],f=Math.min(Math.min(o,a),Math.min(h,c)),p=Math.max(Math.max(o,a),Math.max(h,c)),g=Math.min(Math.min(s,l),Math.min(u,d)),m=Math.max(Math.max(s,l),Math.max(u,d));return new n(f,g,p-f,m-g)},isPowerOfTwo:function(t){return 0!=t&&0==(t&t-1)},signum:function(t){return t>0?1:t<0?-1:0},gudermannianInverse:function(e){return Math.log(Math.tan(Math.PI/4+e*t.DEGREES_TO_RADIANS/2))/Math.PI},epsg3857ToEpsg4326:function(e,i){var r=6378100,n=Math.PI/2-2*Math.atan(Math.exp(-i/r)),o=e/r;return[s.clamp(n*t.RADIANS_TO_DEGREES,-90,90),s.clamp(o*t.RADIANS_TO_DEGREES,-180,180)]},powerOfTwoFloor:function(t){var e=Math.floor(Math.log(t)/Math.log(2));return Math.pow(2,e)},normalizeAngle360:function(t){var e=t%360;return e>=0?e:e<0?360+e:360-e}};return s}),i("geom/Location",["../geom/Angle","../error/ArgumentError","../util/Logger","../geom/Plane","../geom/Vec3","../util/WWMath"],function(t,e,i,r,n,o){"use strict";var s=function(t,e){this.latitude=t,this.longitude=e};return s.ZERO=new s(0,0),s.fromRadians=function(e,i){return new s(e*t.RADIANS_TO_DEGREES,i*t.RADIANS_TO_DEGREES)},s.prototype.copy=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","copy","missingLocation"));return this.latitude=t.latitude,this.longitude=t.longitude,this},s.prototype.set=function(t,e){return this.latitude=t,this.longitude=e,this},s.prototype.equals=function(t){return t&&t.latitude===this.latitude&&t.longitude===this.longitude}
87,s.interpolateAlongPath=function(t,r,n,o,s){if(!n||!o)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","interpolateAlongPath","missingLocation"));if(!s)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","interpolateAlongPath","missingResult"));return t===WorldWind.GREAT_CIRCLE?this.interpolateGreatCircle(r,n,o,s):t&&t===WorldWind.RHUMB_LINE?this.interpolateRhumb(r,n,o,s):this.interpolateLinear(r,n,o,s)},s.interpolateGreatCircle=function(t,r,n,s){if(!r||!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","interpolateGreatCircle","missingLocation"));if(!s)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","interpolateGreatCircle","missingResult"));if(r.equals(n))return s.latitude=r.latitude,s.longitude=r.longitude,s;var a=o.clamp(t,0,1),l=this.greatCircleAzimuth(r,n),h=this.greatCircleDistance(r,n);return this.greatCircleLocation(r,l,a*h,s)},s.greatCircleAzimuth=function(r,n){if(!r||!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","greatCircleAzimuth","missingLocation"));var o,s,a,l=r.latitude*t.DEGREES_TO_RADIANS,h=n.latitude*t.DEGREES_TO_RADIANS,u=r.longitude*t.DEGREES_TO_RADIANS,c=n.longitude*t.DEGREES_TO_RADIANS;return l==h&&u==c?0:u==c?l>h?180:0:(s=Math.cos(h)*Math.sin(c-u),o=Math.cos(l)*Math.sin(h)-Math.sin(l)*Math.cos(h)*Math.cos(c-u),a=Math.atan2(s,o),isNaN(a)?0:a*t.RADIANS_TO_DEGREES)},s.greatCircleDistance=function(r,n){if(!r||!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","greatCircleDistance","missingLocation"));var o,s,a,l,h=r.latitude*t.DEGREES_TO_RADIANS,u=n.latitude*t.DEGREES_TO_RADIANS,c=r.longitude*t.DEGREES_TO_RADIANS,d=n.longitude*t.DEGREES_TO_RADIANS;return h==u&&c==d?0:(o=Math.sin((u-h)/2),s=Math.sin((d-c)/2),a=o*o+Math.cos(h)*Math.cos(u)*s*s,l=2*Math.asin(Math.sqrt(a)),isNaN(l)?0:l)},s.greatCircleLocation=function(r,n,o,s){if(!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","greatCircleLocation","missingLocation"));if(!s)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","greatCircleLocation","missingResult"));if(0==o)return s.latitude=r.latitude,s.longitude=r.longitude,s;var a,l,h=r.latitude*t.DEGREES_TO_RADIANS,u=r.longitude*t.DEGREES_TO_RADIANS,c=n*t.DEGREES_TO_RADIANS;return a=Math.asin(Math.sin(h)*Math.cos(o)+Math.cos(h)*Math.sin(o)*Math.cos(c)),l=u+Math.atan2(Math.sin(o)*Math.sin(c),Math.cos(h)*Math.cos(o)-Math.sin(h)*Math.sin(o)*Math.cos(c)),isNaN(a)||isNaN(l)?(s.latitude=r.latitude,s.longitude=r.longitude):(s.latitude=t.normalizedDegreesLatitude(a*t.RADIANS_TO_DEGREES),s.longitude=t.normalizedDegreesLongitude(l*t.RADIANS_TO_DEGREES)),s},s.interpolateRhumb=function(t,r,n,s){if(!r||!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","interpolateRhumb","missingLocation"));if(!s)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","interpolateRhumb","missingResult"));if(r.equals(n))return s.latitude=r.latitude,s.longitude=r.longitude,s;var a=o.clamp(t,0,1),l=this.rhumbAzimuth(r,n),h=this.rhumbDistance(r,n);return this.rhumbLocation(r,l,a*h,s)},s.rhumbAzimuth=function(r,n){if(!r||!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","rhumbAzimuth","missingLocation"));var s,a,l,h=r.latitude*t.DEGREES_TO_RADIANS,u=n.latitude*t.DEGREES_TO_RADIANS,c=r.longitude*t.DEGREES_TO_RADIANS,d=n.longitude*t.DEGREES_TO_RADIANS;return h==u&&c==d?0:(s=d-c,a=Math.log(Math.tan(u/2+Math.PI/4)/Math.tan(h/2+Math.PI/4)),o.fabs(s)>Math.PI&&(s=s>0?-(2*Math.PI-s):2*Math.PI+s),l=Math.atan2(s,a),isNaN(l)?0:l*t.RADIANS_TO_DEGREES)},s.rhumbDistance=function(r,n){if(!r||!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","rhumbDistance","missingLocation"));var s,a,l,h,u,c=r.latitude*t.DEGREES_TO_RADIANS,d=n.latitude*t.DEGREES_TO_RADIANS,f=r.longitude*t.DEGREES_TO_RADIANS,p=n.longitude*t.DEGREES_TO_RADIANS;return c==d&&f==p?0:(s=d-c,a=p-f,l=Math.log(Math.tan(d/2+Math.PI/4)/Math.tan(c/2+Math.PI/4)),h=s/l,(isNaN(l)||isNaN(h))&&(h=Math.cos(c)),o.fabs(a)>Math.PI&&(a=a>0?-(2*Math.PI-a):2*Math.PI+a),u=Math.sqrt(s*s+h*h*a*a),isNaN(u)?0:u)},s.rhumbLocation=function(r,n,s,a){if(!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","rhumbLocation","missingLocation"));if(!a)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","rhumbLocation","missingResult"));if(0==s)return a.latitude=r.latitude,a.longitude=r.longitude,a;var l,h,u=r.latitude*t.DEGREES_TO_RADIANS,c=r.longitude*t.DEGREES_TO_RADIANS,d=n*t.DEGREES_TO_RADIANS,f=u+s*Math.cos(d),p=Math.log(Math.tan(f/2+Math.PI/4)/Math.tan(u/2+Math.PI/4)),g=(f-u)/p;return(isNaN(p)||isNaN(g)||!isFinite(g))&&(g=Math.cos(u)),l=s*Math.sin(d)/g,o.fabs(f)>Math.PI/2&&(f=f>0?Math.PI-f:-Math.PI-f),h=o.fmod(c+l+Math.PI,2*Math.PI)-Math.PI,isNaN(f)||isNaN(h)?(a.latitude=r.latitude,a.longitude=r.longitude):(a.latitude=t.normalizedDegreesLatitude(f*t.RADIANS_TO_DEGREES),a.longitude=t.normalizedDegreesLongitude(h*t.RADIANS_TO_DEGREES)),a},s.interpolateLinear=function(t,r,n,s){if(!r||!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","interpolateLinear","missingLocation"));if(!s)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","interpolateLinear","missingResult"));if(r.equals(n))return s.latitude=r.latitude,s.longitude=r.longitude,s;var a=o.clamp(t,0,1),l=this.linearAzimuth(r,n),h=this.linearDistance(r,n);return this.linearLocation(r,l,a*h,s)},s.linearAzimuth=function(r,n){if(!r||!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","linearAzimuth","missingLocation"));var s,a,l,h=r.latitude*t.DEGREES_TO_RADIANS,u=n.latitude*t.DEGREES_TO_RADIANS,c=r.longitude*t.DEGREES_TO_RADIANS,d=n.longitude*t.DEGREES_TO_RADIANS;return h==u&&c==d?0:(s=d-c,a=u-h,o.fabs(s)>Math.PI&&(s=s>0?-(2*Math.PI-s):2*Math.PI+s),l=Math.atan2(s,a),isNaN(l)?0:l*t.RADIANS_TO_DEGREES)},s.linearDistance=function(r,n){if(!r||!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","linearDistance","missingLocation"));var s,a,l,h=r.latitude*t.DEGREES_TO_RADIANS,u=n.latitude*t.DEGREES_TO_RADIANS,c=r.longitude*t.DEGREES_TO_RADIANS,d=n.longitude*t.DEGREES_TO_RADIANS;return h==u&&c==d?0:(s=u-h,a=d-c,o.fabs(a)>Math.PI&&(a=a>0?-(2*Math.PI-a):2*Math.PI+a),l=Math.sqrt(s*s+a*a),isNaN(l)?0:l)},s.linearLocation=function(r,n,s,a){if(!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","linearLocation","missingLocation"));if(!a)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","linearLocation","missingResult"));if(0==s)return a.latitude=r.latitude,a.longitude=r.longitude,a;var l,h=r.latitude*t.DEGREES_TO_RADIANS,u=r.longitude*t.DEGREES_TO_RADIANS,c=n*t.DEGREES_TO_RADIANS,d=h+s*Math.cos(c);return o.fabs(d)>Math.PI/2&&(d=d>0?Math.PI-d:-Math.PI-d),l=o.fmod(u+s*Math.sin(c)+Math.PI,2*Math.PI)-Math.PI,isNaN(d)||isNaN(l)?(a.latitude=r.latitude,a.longitude=r.longitude):(a.latitude=t.normalizedDegreesLatitude(d*t.RADIANS_TO_DEGREES),a.longitude=t.normalizedDegreesLongitude(l*t.RADIANS_TO_DEGREES)),a},s.locationsCrossDateLine=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","locationsCrossDateline","missingLocation"));for(var r=null,n=0,s=t.length;n<s;n+=1){var a=t[n];if(null!=r&&o.signum(r.longitude)!=o.signum(a.longitude)){var l=Math.abs(r.longitude-a.longitude);if(l>180&&l<360)return!0}r=a}return!1},s.greatCircleArcExtremeLocations=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","greatCircleArcExtremeLocations","missingLocation"));for(var r=null,n=null,o=null,a=0,l=t.length;a<l;a+=1){var h=t[a];if(null!=o){var u=s.greatCircleArcExtremeForTwoLocations(o,h);if(null==u)continue;(null==r||r.latitude>u[0].latitude)&&(r=u[0]),(null==n||n.latitude<u[1].latitude)&&(n=u[1])}o=h}return[r,n]},s.greatCircleArcExtremeForTwoLocations=function(t,r){if(!t||!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","greatCircleArcExtremeForTwoLocations","missingLocation"));var n,a,l,h=null,u=null,c=90,d=-90,f=[t,r];for(n=0,a=f.length;n<a;n+=1)l=f[n],c>=l.latitude&&(c=l.latitude,h=l),d<=l.latitude&&(d=l.latitude,u=l);var p=s.greatCircleAzimuth(t,r),g=s.greatCircleDistance(t,r),m=s.greatCircleExtremeLocationsUsingAzimuth(t,p);for(n=0,a=m.length;n<a;n+=1){l=m[n];var y=s.greatCircleAzimuth(t,l),E=s.greatCircleDistance(t,l);o.signum(y)==o.signum(p)&&E>=0&&E<=g&&(c>=l.latitude&&(c=l.latitude,h=l),d<=l.latitude&&(d=l.latitude,u=l))}return[h,u]},s.greatCircleExtremeLocationsUsingAzimuth=function(r,n){if(!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Location","greatCircleArcExtremeLocationsUsingAzimuth","missingLocation"));var o=r.latitude,a=n*t.DEGREES_TO_RADIANS,l=-Math.tan(o)/Math.cos(a),h=Math.atan(l),u=h+Math.PI/2,c=h-Math.PI/2;return[s.greatCircleLocation(r,n,u,new s(0,0)),s.greatCircleLocation(r,n,c,new s(0,0))]}
87,s.intersectionWithMeridian=function(t,e,i,o){var s=o.computePointFromLocation(t.latitude,t.longitude,new n(0,0,0)),a=o.computePointFromLocation(e.latitude,e.longitude,new n(0,0,0)),l=o.computePointFromLocation(90,i,new n(0,0,0)),h=o.computePointFromLocation(0,i,new n(0,0,0)),u=r.fromPoints(l,h,n.ZERO),c=new n(0,0,0);if(!u.intersectsSegmentAt(s,a,c))return null;var d=new WorldWind.Position(0,0,0);return o.computePositionFromPoint(c[0],c[1],c[2],d),d.latitude},s.meridianIntersection=function(t,e,i){var r=t.longitude<0?t.longitude+360:t.longitude,n=e.longitude<0?e.longitude+360:e.longitude;if(r===n)return null;var o=i<0?i+360:i,s=(e.latitude-t.latitude)/(n-r);return t.latitude+s*(o-r)},s.poles={NONE:0,NORTH:1,SOUTH:2},s}),i("geom/Position",["../geom/Angle","../error/ArgumentError","../geom/Location","../util/Logger","../util/WWMath"],function(t,e,i,r,n){"use strict";var o=function(t,e,i){this.latitude=t,this.longitude=e,this.altitude=i};return o.ZERO=new o(0,0,0),o.fromRadians=function(e,i,r){return new o(e*t.RADIANS_TO_DEGREES,i*t.RADIANS_TO_DEGREES,r)},o.prototype.copy=function(t){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"Position","copy","missingPosition"));return this.latitude=t.latitude,this.longitude=t.longitude,this.altitude=t.altitude,this},o.prototype.equals=function(t){return t&&t.latitude===this.latitude&&t.longitude===this.longitude&&t.altitude===this.altitude},o.interpolateGreatCircle=function(t,o,s,a){if(!o||!s)throw new e(r.logMessage(r.LEVEL_SEVERE,"Position","interpolateGreatCircle","missingPosition"));if(!a)throw new e(r.logMessage(r.LEVEL_SEVERE,"Position","interpolateGreatCircle","missingResult"));var l=n.clamp(t,0,1);return a.altitude=n.interpolate(l,o.altitude,s.altitude),i.interpolateGreatCircle(l,o,s,a),a},o.interpolateRhumb=function(t,o,s,a){if(!o||!s)throw new e(r.logMessage(r.LEVEL_SEVERE,"Position","interpolateRhumb","missingPosition"));if(!a)throw new e(r.logMessage(r.LEVEL_SEVERE,"Position","interpolateRhumb","missingResult"));var l=n.clamp(t,0,1);return a.altitude=n.interpolate(l,o.altitude,s.altitude),i.interpolateRhumb(l,o,s,a),a},o.interpolateLinear=function(t,o,s,a){if(!o||!s)throw new e(r.logMessage(r.LEVEL_SEVERE,"Position","interpolateLinear","missingPosition"));if(!a)throw new e(r.logMessage(r.LEVEL_SEVERE,"Position","interpolateLinear","missingResult"));var l=n.clamp(t,0,1);return a.altitude=n.interpolate(l,o.altitude,s.altitude),i.interpolateLinear(l,o,s,a),a},o.prototype.toString=function(){return"("+this.latitude.toString()+"°, "+this.longitude.toString()+"°, "+this.altitude.toString()+")"},o}),i("render/Texture",["../error/ArgumentError","../util/Logger","../util/WWMath"],function(t,e,i){"use strict";var r=function(r,n,o){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"Texture","constructor","missingGlContext"));if(!n)throw new t(e.logMessage(e.LEVEL_SEVERE,"Texture","constructor","missingImage"));o||(o=r.CLAMP_TO_EDGE);var s=r.createTexture(),a=i.isPowerOfTwo(n.width)&&i.isPowerOfTwo(n.height);this.originalImageWidth=n.width,this.originalImageHeight=n.height,o!==r.REPEAT||a||(n=this.resizeImage(n),a=!0),this.imageWidth=n.width,this.imageHeight=n.height,this.size=n.width*n.height*4,r.bindTexture(r.TEXTURE_2D,s),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,a?r.LINEAR_MIPMAP_LINEAR:r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,o),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,o),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),a&&r.generateMipmap(r.TEXTURE_2D),this.textureId=s,this.creationTime=new Date,this.texParameters={},this.anisotropicFilterExt=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic")};return r.prototype.setTexParameter=function(t,e){this.texParameters[t]=e},r.prototype.getTexParameter=function(t){return this.texParameters[t]},r.prototype.clearTexParameters=function(){this.texParameters={}},r.prototype.dispose=function(t){t.deleteTexture(this.textureId),delete this.textureId},r.prototype.bind=function(t){var e=t.currentGlContext;return e.bindTexture(e.TEXTURE_2D,this.textureId),this.applyTexParameters(t),t.frameStatistics.incrementTextureLoadCount(1),!0},r.prototype.applyTexParameters=function(t){var e=t.currentGlContext,i=this.texParameters[e.TEXTURE_MAG_FILTER]||e.LINEAR;e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i),i===e.LINEAR&&this.anisotropicFilterExt&&e.texParameteri(e.TEXTURE_2D,this.anisotropicFilterExt.TEXTURE_MAX_ANISOTROPY_EXT,4)},r.prototype.resizeImage=function(t){var e=document.createElement("canvas");return e.width=i.powerOfTwoFloor(t.width),e.height=i.powerOfTwoFloor(t.height),e.getContext("2d").drawImage(t,0,0,e.width,e.height),e},r}),i("geom/Matrix",["../geom/Angle","../error/ArgumentError","../util/Logger","../geom/Plane","../geom/Position","../geom/Rectangle","../render/Texture","../geom/Vec3","../util/WWMath"],function(t,e,
87i,r,n,o,s,a,l){"use strict";var h=function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g){this[0]=t,this[1]=e,this[2]=i,this[3]=r,this[4]=n,this[5]=o,this[6]=s,this[7]=a,this[8]=l,this[9]=h,this[10]=u,this[11]=c,this[12]=d,this[13]=f,this[14]=p,this[15]=g};return h.prototype=new Float64Array(16),h.fromIdentity=function(){return new h(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},h.principalAxesFromPoints=function(t,r,n,o){if(!t||t.length<1)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","principalAxesFromPoints","missingPoints")) 88;if(!r||!n||!o)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","principalAxesFromPoints","An axis argument is null or undefined."));var s=h.fromIdentity();s.setToCovarianceOfPoints(t),s.eigensystemFromSymmetricMatrix(r,n,o),r.normalize(),n.normalize(),o.normalize()},h.prototype.set=function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g){return this[0]=t,this[1]=e,this[2]=i,this[3]=r,this[4]=n,this[5]=o,this[6]=s,this[7]=a,this[8]=l,this[9]=h,this[10]=u,this[11]=c,this[12]=d,this[13]=f,this[14]=p,this[15]=g,this},h.prototype.setToIdentity=function(){this[0]=1,this[1]=0,this[2]=0,this[3]=0,this[4]=0,this[5]=1,this[6]=0,this[7]=0,this[8]=0,this[9]=0,this[10]=1,this[11]=0,this[12]=0,this[13]=0,this[14]=0,this[15]=1},h.prototype.copy=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","copy","missingMatrix"));this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15]},h.prototype.clone=function(){var t=h.fromIdentity();return t.copy(this),t},h.prototype.equals=function(t){return t&&this[0]==t[0]&&this[1]==t[1]&&this[2]==t[2]&&this[3]==t[3]&&this[4]==t[4]&&this[5]==t[5]&&this[6]==t[6]&&this[7]==t[7]&&this[8]==t[8]&&this[9]==t[9]&&this[10]==t[10]&&this[11]==t[11]&&this[12]==t[12]&&this[13]==t[13]&&this[14]==t[14]&&this[15]==t[15]},h.prototype.columnMajorComponents=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","columnMajorComponents","missingResult"));return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t},h.prototype.setToTranslation=function(t,e,i){return this[0]=1,this[1]=0,this[2]=0,this[3]=t,this[4]=0,this[5]=1,this[6]=0,this[7]=e,this[8]=0,this[9]=0,this[10]=1,this[11]=i,this[12]=0,this[13]=0,this[14]=0,this[15]=1,this},h.prototype.setTranslation=function(t,e,i){return this[3]=t,this[7]=e,this[11]=i,this},h.prototype.setToScale=function(t,e,i){return this[0]=t,this[1]=0,this[2]=0,this[3]=0,this[4]=0,this[5]=e,this[6]=0,this[7]=0,this[8]=0,this[9]=0,this[10]=i,this[11]=0,this[12]=0,this[13]=0,this[14]=0,this[15]=1,this},h.prototype.setScale=function(t,e,i){return this[0]=t,this[5]=e,this[10]=i,this},h.prototype.setToTransposeOfMatrix=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","setToTransposeOfMatrix","missingMatrix"));return this[0]=t[0],this[1]=t[4],this[2]=t[8],this[3]=t[12],this[4]=t[1],this[5]=t[5],this[6]=t[9],this[7]=t[13],this[8]=t[2],this[9]=t[6],this[10]=t[10],this[11]=t[14],this[12]=t[3],this[13]=t[7],this[14]=t[11],this[15]=t[15],this},h.prototype.setToMultiply=function(t,r){if(!t||!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","setToMultiply","missingMatrix"));var n=t,o=r;return this[0]=n[0]*o[0]+n[1]*o[4]+n[2]*o[8]+n[3]*o[12],this[1]=n[0]*o[1]+n[1]*o[5]+n[2]*o[9]+n[3]*o[13],this[2]=n[0]*o[2]+n[1]*o[6]+n[2]*o[10]+n[3]*o[14],this[3]=n[0]*o[3]+n[1]*o[7]+n[2]*o[11]+n[3]*o[15],this[4]=n[4]*o[0]+n[5]*o[4]+n[6]*o[8]+n[7]*o[12],this[5]=n[4]*o[1]+n[5]*o[5]+n[6]*o[9]+n[7]*o[13],this[6]=n[4]*o[2]+n[5]*o[6]+n[6]*o[10]+n[7]*o[14],this[7]=n[4]*o[3]+n[5]*o[7]+n[6]*o[11]+n[7]*o[15],this[8]=n[8]*o[0]+n[9]*o[4]+n[10]*o[8]+n[11]*o[12],this[9]=n[8]*o[1]+n[9]*o[5]+n[10]*o[9]+n[11]*o[13],this[10]=n[8]*o[2]+n[9]*o[6]+n[10]*o[10]+n[11]*o[14],this[11]=n[8]*o[3]+n[9]*o[7]+n[10]*o[11]+n[11]*o[15],this[12]=n[12]*o[0]+n[13]*o[4]+n[14]*o[8]+n[15]*o[12],this[13]=n[12]*o[1]+n[13]*o[5]+n[14]*o[9]+n[15]*o[13],this[14]=n[12]*o[2]+n[13]*o[6]+n[14]*o[10]+n[15]*o[14],this[15]=n[12]*o[3]+n[13]*o[7]+n[14]*o[11]+n[15]*o[15],this},h.prototype.setToCovarianceOfPoints=function(t){if(!t||t.length<1)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","setToCovarianceOfPoints","missingArray"));var r,n,o,s,l=0,h=0,u=0,c=0,d=0,f=0,p=0,g=new a(0,0,0);r=a.averageOfBuffer(t,new a(0,0,0));for(var m=0,y=t.length/3;m<y;m++)g[0]=t[3*m],g[1]=t[3*m+1],g[2]=t[3*m+2],n=g[0]-r[0],o=g[1]-r[1],s=g[2]-r[2],++l,h+=n*n,u+=o*o,c+=s*s,d+=n*o,f+=n*s,p+=o*s;return this[0]=h/l,this[1]=d/l,this[2]=f/l,this[3]=0,this[4]=d/l,this[5]=u/l,this[6]=p/l,this[7]=0,this[8]=f/l,this[9]=p/l,this[10]=c/l,this[11]=0,this[12]=0,this[13]=0,this[14]=0,this[15]=0,this}
88,h.prototype.multiplyByTranslation=function(t,e,i){return this.multiply(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this},h.prototype.multiplyByRotation=function(e,i,r,n){var o=Math.cos(n*t.DEGREES_TO_RADIANS),s=Math.sin(n*t.DEGREES_TO_RADIANS);return this.multiply(o+(1-o)*e*e,(1-o)*e*i-s*r,(1-o)*e*r+s*i,0,(1-o)*e*i+s*r,o+(1-o)*i*i,(1-o)*i*r-s*e,0,(1-o)*e*r-s*i,(1-o)*i*r+s*e,o+(1-o)*r*r,0,0,0,0,1),this},h.prototype.multiplyByScale=function(t,e,i){return this.multiply(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this},h.prototype.setToUnitYFlip=function(){return this[0]=1,this[1]=0,this[2]=0,this[3]=0,this[4]=0,this[5]=-1,this[6]=0,this[7]=1,this[8]=0,this[9]=0,this[10]=1,this[11]=0,this[12]=0,this[13]=0,this[14]=0,this[15]=1,this},h.prototype.multiplyByLocalCoordinateTransform=function(t,r){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","multiplyByLocalCoordinateTransform","Origin vector is null or undefined"));if(!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","multiplyByLocalCoordinateTransform","missingGlobe"));var n=new a(0,0,0),o=new a(0,0,0),s=new a(0,0,0);return l.localCoordinateAxesAtPoint(t,r,n,o,s),this.multiply(n[0],o[0],s[0],t[0],n[1],o[1],s[1],t[1],n[2],o[2],s[2],t[2],0,0,0,1),this},h.prototype.multiplyByTextureTransform=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","multiplyByTextureTransform","missingTexture"));var r=t.originalImageWidth/t.imageWidth,n=t.originalImageHeight/t.imageHeight;return this.multiply(r,0,0,0,0,-n,0,n,0,0,1,0,0,0,0,1),this},h.prototype.extractTranslation=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","extractTranslation","missingResult"));return t[0]=this[3],t[1]=this[7],t[2]=this[11],t},h.prototype.extractRotationAngles=function(r){if(!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","extractRotationAngles","missingResult"));var n=Math.atan2(this[6],this[10]),o=Math.atan2(-this[2],Math.sqrt(this[0]*this[0]+this[1]*this[1])),s=Math.cos(n),a=Math.sin(n),l=Math.atan2(a*this[8]-s*this[4],s*this[5]-a*this[9]);return r[0]=n*t.RADIANS_TO_DEGREES,r[1]=o*t.RADIANS_TO_DEGREES,r[2]=l*t.RADIANS_TO_DEGREES,r},h.prototype.multiplyByFirstPersonModelview=function(r,n,o,s,h){if(!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","multiplyByFirstPersonModelview","missingPosition"));if(!h)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","multiplyByFirstPersonModelview","missingGlobe"));var u,c,d,f,p,g,m,y,E,v,_,b,S,w,L=new a(0,0,0),T=new a(0,0,0),x=new a(0,0,0),R=new a(0,0,0);return u=Math.cos(s*t.DEGREES_TO_RADIANS),c=Math.sin(s*t.DEGREES_TO_RADIANS),this.multiply(u,c,0,0,-c,u,0,0,0,0,1,0,0,0,0,1),u=Math.cos(o*t.DEGREES_TO_RADIANS),c=Math.sin(o*t.DEGREES_TO_RADIANS),this.multiply(1,0,0,0,0,u,c,0,0,-c,u,0,0,0,0,1),u=Math.cos(n*t.DEGREES_TO_RADIANS),c=Math.sin(n*t.DEGREES_TO_RADIANS),this.multiply(u,-c,0,0,c,u,0,0,0,0,1,0,0,0,0,1),h.computePointFromPosition(r.latitude,r.longitude,r.altitude,L),d=L[0],f=L[1],p=L[2],l.localCoordinateAxesAtPoint(L,h,T,x,R),g=T[0],m=T[1],y=T[2],E=x[0],v=x[1],_=x[2],b=R[0],S=R[1],w=R[2],this.multiply(g,m,y,-g*d-m*f-y*p,E,v,_,-E*d-v*f-_*p,b,S,w,-b*d-S*f-w*p,0,0,0,1),this},h.prototype.multiplyByLookAtModelview=function(t,r,n,o,s,a){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","multiplyByLookAtModelview","missingPosition"));if(r<0)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","multiplyByLookAtModelview","Range is less than zero"));if(!a)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","multiplyByLookAtModelview","missingGlobe"));return this.multiplyByTranslation(0,0,-r),this.multiplyByFirstPersonModelview(t,n,o,s,a),this},h.prototype.setToPerspectiveProjection=function(t,r,n,o){if(t<=0)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","setToPerspectiveProjection","invalidWidth"));if(r<=0)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","setToPerspectiveProjection","invalidHeight"));if(n===o)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","setToPerspectiveProjection","Near and far distance are the same."));if(n<=0||o<=0)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","setToPerspectiveProjection","Near or far distance is less than or equal to zero."));var s=l.perspectiveFrustumRectangle(t,r,n),a=s.getMinX(),h=s.getMaxX(),u=s.getMinY(),c=s.getMaxY();return this[0]=2*n/(h-a),this[1]=0,this[2]=(h+a)/(h-a),this[3]=0,this[4]=0,this[5
88]=2*n/(c-u),this[6]=(c+u)/(c-u),this[7]=0,this[8]=0,this[9]=0,this[10]=-(o+n)/(o-n),this[11]=-2*n*o/(o-n),this[12]=0,this[13]=0,this[14]=-1,this[15]=0,this},h.prototype.setToScreenProjection=function(t,r){if(t<=0)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","setToScreenProjection","invalidWidth"));if(r<=0)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","setToScreenProjection","invalidHeight"));return this[0]=2/t,this[1]=0,this[2]=0,this[3]=-1,this[4]=0,this[5]=2/r,this[6]=0,this[7]=-1,this[8]=0,this[9]=0,this[10]=2,this[11]=-1,this[12]=0,this[13]=0,this[14]=0,this[15]=1,this},h.prototype.extractEyePoint=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","extractEyePoint","missingResult"));return t[0]=-this[0]*this[3]-this[4]*this[7]-this[8]*this[11],t[1]=-this[1]*this[3]-this[5]*this[7]-this[9]*this[11],t[2]=-this[2]*this[3]-this[6]*this[7]-this[10]*this[11],t},h.prototype.extractForwardVector=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","extractForwardVector","missingResult"));return t[0]=-this[8],t[1]=-this[9],t[2]=-this[10],t},h.prototype.extractViewingParameters=function(r,o,s,a){if(!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","extractViewingParameters","The specified origin is null or undefined."));if(!s)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","extractViewingParameters","missingGlobe"));if(!a)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","extractViewingParameters","missingResult"));var l,u,c,d,f,p,g,m,y,E=new n(0,0,0),v=h.fromIdentity();return s.computePositionFromPoint(r[0],r[1],r[2],E),v.copy(this),v.multiplyByLocalCoordinateTransform(r,s),l=-v[11],u=v[10],c=Math.sqrt(v[2]*v[2]+v[6]*v[6]),d=Math.atan2(c,u)*t.RADIANS_TO_DEGREES,f=Math.cos(o*t.DEGREES_TO_RADIANS),p=Math.sin(o*t.DEGREES_TO_RADIANS),g=f*v[0]-p*v[4],m=p*v[5]-f*v[1],y=Math.atan2(m,g)*t.RADIANS_TO_DEGREES,a.origin=E,a.range=l,a.heading=y,a.tilt=d,a.roll=o,a},h.prototype.offsetProjectionDepth=function(t){return this[10]*=1+t,this},h.prototype.multiplyMatrix=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","multiplyMatrix","missingMatrix"));var r,n,o,s,a=this,l=t;return r=a[0],n=a[1],o=a[2],s=a[3],a[0]=r*l[0]+n*l[4]+o*l[8]+s*l[12],a[1]=r*l[1]+n*l[5]+o*l[9]+s*l[13],a[2]=r*l[2]+n*l[6]+o*l[10]+s*l[14],a[3]=r*l[3]+n*l[7]+o*l[11]+s*l[15],r=a[4],n=a[5],o=a[6],s=a[7],a[4]=r*l[0]+n*l[4]+o*l[8]+s*l[12],a[5]=r*l[1]+n*l[5]+o*l[9]+s*l[13],a[6]=r*l[2]+n*l[6]+o*l[10]+s*l[14],a[7]=r*l[3]+n*l[7]+o*l[11]+s*l[15],r=a[8],n=a[9],o=a[10],s=a[11],a[8]=r*l[0]+n*l[4]+o*l[8]+s*l[12],a[9]=r*l[1]+n*l[5]+o*l[9]+s*l[13],a[10]=r*l[2]+n*l[6]+o*l[10]+s*l[14],a[11]=r*l[3]+n*l[7]+o*l[11]+s*l[15],r=a[12],n=a[13],o=a[14],s=a[15],a[12]=r*l[0]+n*l[4]+o*l[8]+s*l[12],a[13]=r*l[1]+n*l[5]+o*l[9]+s*l[13],a[14]=r*l[2]+n*l[6]+o*l[10]+s*l[14],a[15]=r*l[3]+n*l[7]+o*l[11]+s*l[15],this},h.prototype.multiply=function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g){var m,y,E,v,_=this;return m=_[0],y=_[1],E=_[2],v=_[3],_[0]=m*t+y*n+E*l+v*d,_[1]=m*e+y*o+E*h+v*f,_[2]=m*i+y*s+E*u+v*p,_[3]=m*r+y*a+E*c+v*g,m=_[4],y=_[5],E=_[6],v=_[7],_[4]=m*t+y*n+E*l+v*d,_[5]=m*e+y*o+E*h+v*f,_[6]=m*i+y*s+E*u+v*p,_[7]=m*r+y*a+E*c+v*g,m=_[8],y=_[9],E=_[10],v=_[11],_[8]=m*t+y*n+E*l+v*d,_[9]=m*e+y*o+E*h+v*f,_[10]=m*i+y*s+E*u+v*p,_[11]=m*r+y*a+E*c+v*g,m=_[12],y=_[13],E=_[14],v=_[15],_[12]=m*t+y*n+E*l+v*d,_[13]=m*e+y*o+E*h+v*f,_[14]=m*i+y*s+E*u+v*p,_[15]=m*r+y*a+E*c+v*g,this},h.prototype.invertMatrix=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","invertMatrix","missingMatrix"));var r=[[],[],[],[]];r[0][0]=t[0],r[0][1]=t[1],r[0][2]=t[2],r[0][3]=t[3],r[1][0]=t[4],r[1][1]=t[5],r[1][2]=t[6],r[1][3]=t[7],r[2][0]=t[8],r[2][1]=t[9],r[2][2]=t[10],r[2][3]=t[11],r[3][0]=t[12],r[3][1]=t[13],r[3][2]=t[14],r[3][3]=t[15];var n,o,s=[],a=h.ludcmp(r,s);for(n=0;n<4;n+=1)a*=r[n][n];if(Math.abs(a)<1e-8)return null;var l=[[],[],[],[]],u=[];for(o=0;o<4;o+=1){for(n=0;n<4;n+=1)u[n]=0;for(u[o]=1,h.lubksb(r,s,u),n=0;n<4;n+=1)l[n][o]=u[n]}return this[0]=l[0][0],this[1]=l[0][1],this[2]=l[0][2],this[3]=l[0][3],this[4]=l[1][0],this[5]=l[1][1],this[6]=l[1][2],this[7]=l[1][3],this[8]=l[2][0],this[9]=l[2][1],this[10]=l[2][2],this[11]=l[2][3],this[12]=l[3][0],this[13]=l[3][1],this[14]=l[3][2],this[15]=l[3][3],this}
88,h.lubksb=function(t,e,i){var r,n,o,s=-1;for(r=0;r<4;r+=1){var a=e[r];if(o=i[a],i[a]=i[r],-1!=s)for(n=s;n<=r-1;n+=1)o-=t[r][n]*i[n];else 0!=o&&(s=r);i[r]=o}for(r=3;r>=0;r-=1){for(o=i[r],n=r+1;n<4;n+=1)o-=t[r][n]*i[n];i[r]=o/t[r][r]}},h.ludcmp=function(t,e){var i,r,n,o,s,a,l,h,u=[],c=1;for(r=0;r<4;r+=1){for(s=0,n=0;n<4;n+=1)(i=Math.abs(t[r][n]))>s&&(s=i);if(0==s)return 0;u[r]=1/s}for(n=0;n<4;n+=1){for(r=0;r<n;r+=1){for(a=t[r][n],o=0;o<r;o+=1)a-=t[r][o]*t[o][n];t[r][n]=a}for(s=0,l=-1,r=n;r<4;r+=1){for(a=t[r][n],o=0;o<n;o++)a-=t[r][o]*t[o][n];t[r][n]=a,(h=u[r]*Math.abs(a))>=s&&(s=h,l=r)}if(n!=l){for(o=0;o<4;o+=1)h=t[l][o],t[l][o]=t[n][o],t[n][o]=h;c=-c,u[l]=u[n]}if(e[n]=l,0==t[n][n]&&(t[n][n]=1e-20),3!=n)for(h=1/t[n][n],r=n+1;r<4;r+=1)t[r][n]*=h}return c},h.prototype.invertOrthonormalMatrix=function(t){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","invertOrthonormalMatrix","missingMatrix"));var r=t;return this[0]=r[0],this[1]=r[4],this[2]=r[8],this[3]=0-r[0]*r[3]-r[4]*r[7]-r[8]*r[11],this[4]=r[1],this[5]=r[5],this[6]=r[9],this[7]=0-r[1]*r[3]-r[5]*r[7]-r[9]*r[11],this[8]=r[2],this[9]=r[6],this[10]=r[10],this[11]=0-r[2]*r[3]-r[6]*r[7]-r[10]*r[11],this[12]=0,this[13]=0,this[14]=0,this[15]=1,this},h.prototype.eigensystemFromSymmetricMatrix=function(t,r,n){if(!t||!r||!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","eigensystemFromSymmetricMatrix","missingResult"));if(this[1]!=this[4]||this[2]!=this[8]||this[6]!=this[9])throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","eigensystemFromSymmetricMatrix","Matrix is not symmetric"));for(var o,s,a,h,u,c,d,f,p,g,m,y=this[0],E=this[1],v=this[2],_=this[5],b=this[6],S=this[10],w=[[1,0,0],[0,1,0],[0,0,1]],L=0;L<32&&!(l.fabs(E)<1e-10&&l.fabs(v)<1e-10&&l.fabs(b)<1e-10);L++){if(0!=E)for(o=.5*(_-y)/E,s=o*o,a=s+1,h=a!=s?(o<0?-1:1)*(Math.sqrt(a)-l.fabs(o)):.5/o,u=1/Math.sqrt(h*h+1),c=u*h,y-=h*E,_+=h*E,E=0,d=u*v-c*b,b=c*v+u*b,v=d,f=0;f<3;f++)d=u*w[f][0]-c*w[f][1],w[f][1]=c*w[f][0]+u*w[f][1],w[f][0]=d;if(0!=v)for(o=.5*(S-y)/v,s=o*o,a=s+1,h=a!=s?(o<0?-1:1)*(Math.sqrt(a)-l.fabs(o)):.5/o,u=1/Math.sqrt(h*h+1),c=u*h,y-=h*v,S+=h*v,v=0,d=u*E-c*b,b=c*E+u*b,E=d,f=0;f<3;f++)d=u*w[f][0]-c*w[f][2],w[f][2]=c*w[f][0]+u*w[f][2],w[f][0]=d;if(0!=b)for(o=.5*(S-_)/b,s=o*o,a=s+1,h=a!=s?(o<0?-1:1)*(Math.sqrt(a)-l.fabs(o)):.5/o,u=1/Math.sqrt(h*h+1),c=u*h,_-=h*b,S+=h*b,b=0,d=u*E-c*v,v=c*E+u*v,E=d,f=0;f<3;f++)d=u*w[f][1]-c*w[f][2],w[f][2]=c*w[f][1]+u*w[f][2],w[f][1]=d}p=0,g=1,m=2,y<_&&(d=y,y=_,_=d,d=p,p=g,g=d),_<S&&(d=_,_=S,S=d,d=g,g=m,m=d),y<_&&(d=y,y=_,_=d,d=p,p=g,g=d),t[0]=w[0][p],t[1]=w[1][p],t[2]=w[2][p],r[0]=w[0][g],r[1]=w[1][g],r[2]=w[2][g],n[0]=w[0][m],n[1]=w[1][m],n[2]=w[2][m],t.normalize(),r.normalize(),n.normalize(),t.multiply(y),r.multiply(_),n.multiply(S)},h.prototype.upper3By3=function(){var t=h.fromIdentity();return t[0]=this[0],t[1]=this[1],t[2]=this[2],t[4]=this[4],t[5]=this[5],t[6]=this[6],t[8]=this[8],t[9]=this[9],t[10]=this[10],t},h.prototype.unProject=function(t,r,n){if(!t)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","unProject","missingPoint"));if(!r)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","unProject","missingViewport"));if(!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"Matrix","unProject","missingResult"));var o=t[0],s=t[1],a=t[2];if(o=(o-r.x)/r.width,s=(s-r.y)/r.height,o=2*o-1,s=2*s-1,(a=2*a-1)<-1||a>1)return!1;var l=this[0]*o+this[1]*s+this[2]*a+this[3],h=this[4]*o+this[5]*s+this[6]*a+this[7],u=this[8]*o+this[9]*s+this[10]*a+this[11],c=this[12]*o+this[13]*s+this[14]*a+this[15];return 0!==c&&(n[0]=l/c,n[1]=h/c,n[2]=u/c,!0)},h}),i("pick/PickedObject",[],function(){"use strict";return function(t,e,i,r,n){this.color=t,this.userObject=e,this.position=i,this.parentLayer=r,this.isTerrain=n,this.isOnTop=!1}}),i("error/UnsupportedOperationError",["../error/AbstractError"],function(t){"use strict";var e=function(e){t.call(this,"UnsupportedOperationError",e);var i;try{throw new Error}catch(t){i=t.stack}this.stack=i};return e.prototype=Object.create(t.prototype),e}),i("render/Renderable",["../util/Logger","../error/UnsupportedOperationError"],function(t,e){"use strict";var i=function(){this.displayName="Renderable",this.enabled=!0,this.pickDelegate=null,this.userProperties={}};return i.prototype.render=function(i){throw new e(t.logMessage(t.LEVEL_SEVERE,"Renderable","render","abstractInvocation"))},i}),i("shapes/Annotation",["../shapes/AnnotationAttributes","../error/ArgumentError","../shaders/BasicTextureProgram","../util/Color","../util/Font","../util/Insets","../util/Logger","../geom/Matrix","../util/Offset","../pick/PickedObject","../render/Renderable","../shapes/TextAttributes","../geom/Vec2","../geom/Vec3","../util/WWMath"],function(t,e,
88i,r,n,o,s,a,l,h,u,c,d,f,p){"use strict";var g=function(i,r){if(!i)throw new e(s.logMessage(s.LEVEL_SEVERE,"Annotation","constructor","missingPosition"));u.call(this),this.position=i,this.attributes=r||new t(null),this.altitudeMode=WorldWind.ABSOLUTE,this.layer=null,this.lastStateKey=null,this.calloutTransform=a.fromIdentity(),this.calloutOffset=new WorldWind.Offset(WorldWind.OFFSET_FRACTION,.5,WorldWind.OFFSET_FRACTION,0),this.label="",this.labelTexture=null,this.labelTransform=a.fromIdentity(),this.placePoint=new f(0,0,0),this.depthOffset=-2.05,this.calloutPoints=null};return g.matrix=a.fromIdentity(),g.screenPoint=new f(0,0,0),g.scratchPoint=new f(0,0,0),g.prototype=Object.create(u.prototype),Object.defineProperties(g.prototype,{text:{get:function(){return this.label},set:function(t){this.label=t,this.lastStateKey=null}}}),g.prototype.renderOrdered=function(t){if(this.drawOrderedAnnotation(t),t.pickingMode){var e=new h(this.pickColor.clone(),this,this.position,this.layer,!1);t.pickPoint&&this.labelBounds.containsPoint(t.convertPointToViewport(t.pickPoint,g.scratchPoint))&&(e.labelPicked=!0),t.resolvePick(e)}},g.prototype.clone=function(){var t=new g(this.position);return t.copy(this),t.pickDelegate=this.pickDelegate?this.pickDelegate:this,t},g.prototype.copy=function(t){return this.position=t.position,this.enabled=t.enabled,this.attributes=t.attributes,this.label=t.label,this.altitudeMode=t.altitudeMode,this.pickDelegate=t.pickDelegate,this.depthOffset=t.depthOffset,this},g.prototype.render=function(t){if(this.enabled&&t.accumulateOrderedRenderables&&(!t.globe.projectionLimits||t.globe.projectionLimits.containsLocation(this.position.latitude,this.position.longitude))){var e;if(this.lastFrameTime!==t.timestamp)e=this.makeOrderedRenderable(t);else{e=this.clone().makeOrderedRenderable(t)}e&&(e.layer=t.currentLayer,this.lastFrameTime=t.timestamp,t.addOrderedRenderable(e))}},g.prototype.drawOrderedAnnotation=function(t){this.beginDrawing(t);try{this.doDrawOrderedAnnotation(t)}finally{this.endDrawing(t)}},g.prototype.makeOrderedRenderable=function(t){var e,i,r,n,o,s,a,l,h;if(this.label=t.textRenderer.wrap(this.label,this.attributes.width,this.attributes.height),t.surfacePointForMode(this.position.latitude,this.position.longitude,this.position.altitude,this.altitudeMode,this.placePoint),this.eyeDistance=t.eyePoint.distanceTo(this.placePoint),!t.projectWithDepth(this.placePoint,this.depthOffset,g.screenPoint))return null;this.labelTexture=t.createTextTexture(this.label,this.attributes.textAttributes),e=this.labelTexture.imageWidth,i=this.labelTexture.imageHeight,r=this.attributes.scale,n=this.attributes.insets.left,o=this.attributes.insets.right,s=this.attributes.insets.top,a=this.attributes.insets.bottom,h=this.attributes.leaderGapHeight,l=this.calloutOffset.offsetForSize((e+n+o)*r,(i+s+a)*r),this.calloutTransform.setTranslation(g.screenPoint[0]-l[0],g.screenPoint[1]+h,g.screenPoint[2]),this.labelTransform.setTranslation(g.screenPoint[0]-l[0]+n*r,g.screenPoint[1]+h+a*r,g.screenPoint[2]),this.labelTransform.setScale(e*r,i*r,1),this.labelBounds=p.boundingRectForUnitQuad(this.labelTransform);var u=(e+n+o)*r,c=(i+s+a)*r,d=u/2,f=-h;return this.attributes.drawLeader||(f=0),this.attributes.stateKey!==this.lastStateKey&&(this.calloutPoints=this.createCallout(u,c,d,f,this.attributes.leaderGapWidth,this.attributes.cornerRadius)),this},g.prototype.beginDrawing=function(t){var e,r=t.currentGlContext;t.findAndBindProgram(i),e=t.currentProgram,r.enableVertexAttribArray(e.vertexPointLocation),r.enableVertexAttribArray(e.vertexTexCoordLocation),e.loadModulateColor(r,t.pickingMode)},g.prototype.endDrawing=function(t){var e=t.currentGlContext,i=t.currentProgram;e.disableVertexAttribArray(i.vertexPointLocation),e.disableVertexAttribArray(i.vertexTexCoordLocation),t.bindProgram(null)},g.prototype.drawCorner=function(t,e,i,r,n,o,s,a){if(i<1)return a;for(var l=(n-r)/(o-1),h=1;h<o-1;h++){var u=r+l*h,c=t+Math.cos(u)*i,d=e+Math.sin(u)*i;s[a++]=c,s[a++]=d}return a},g.prototype.createCallout=function(t,e,i,r,n,o){var s=2*(12+(o<1?0:56)),a=new Float32Array(s),l=0;return a[l++]=t/2+n/2,a[l++]=0,a[l++]=t-o,a[l++]=0,l=this.drawCorner(t-o,o,o,-Math.PI/2,0,16,a,l),a[l++]=t,a[l++]=o,a[l++]=t,a[l++]=e-o,l=this.drawCorner(t-o,e-o,o,0,Math.PI/2,16,a,l),a[l++]=t-o,a[l++]=e,a[l++]=o,a[l++]=e,l=this.drawCorner(o,e-o,o,Math.PI/2,Math.PI,16,a,l),a[l++]=0,a[l++]=e-o,a[l++]=0,a[l++]=o,l=this.drawCorner(o,o,o,Math.PI,1.5*Math.PI,16,a,l),a[l++]=o,a[l++]=0,a[l++]=t/2-n/2,a[l++]=0,a[l++]=i,a[l++]=r,a[l++]=t/2+n/2,a[l]=0,a},g.prototype.doDrawOrderedAnnotation=function(t){var e,i=t.currentGlContext,n=t.currentProgram,o=!1;t.pickingMode&&(this.pickColor=t.uniquePickColor()),n.loadOpacity(i,t.pickingMode?1:this.attributes.opacity*this.layer.opacity);var s=this.attributes.stateKey!==this.lastStateKey;this.calloutCacheKey&&!s||(this.calloutCacheKey=t.gpuResourceCache.generateCacheKey());var a=t.gpuResourceCache.resourceForKey(this.calloutCacheKey);a||(a=i.createBuffer(),t.gpuResourceCache.putResource(this.calloutCacheKey,a,4*this.calloutPoints.length),o=!0),s&&this.calloutCacheKey&&t.gpuResourceCache.removeResource(this.calloutCacheKey),this.lastStateKey=this.attributes.stateKey,g.matrix.copy(t.screenProjection),g.matrix.multiplyMatrix(this.calloutTransform),n.loadModelviewProjection(i,g.matrix),i.bindBuffer(i.ARRAY_BUFFER,a),o&&(i.bufferData(i.ARRAY_BUFFER,this.calloutPoints,i.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1)),n.loadColor
88(i,t.pickingMode?this.pickColor:this.attributes.backgroundColor),n.loadTextureEnabled(i,!1),i.vertexAttribPointer(n.vertexPointLocation,2,i.FLOAT,!1,0,0),i.vertexAttribPointer(n.vertexTexCoordLocation,2,i.FLOAT,!1,0,0),i.drawArrays(i.TRIANGLE_FAN,0,this.calloutPoints.length/2),g.matrix.copy(t.screenProjection),g.matrix.multiplyMatrix(this.labelTransform),n.loadModelviewProjection(i,g.matrix),g.matrix.setToIdentity(),g.matrix.multiplyByTextureTransform(this.labelTexture),n.loadTextureMatrix(i,g.matrix),n.loadColor(i,t.pickingMode?this.pickColor:r.WHITE),e=this.labelTexture.bind(t),n.loadTextureEnabled(i,e),i.bindBuffer(i.ARRAY_BUFFER,t.unitQuadBuffer3()),i.vertexAttribPointer(n.vertexPointLocation,3,i.FLOAT,!1,0,0),i.bindBuffer(i.ARRAY_BUFFER,t.unitQuadBuffer()),i.vertexAttribPointer(n.vertexTexCoordLocation,2,i.FLOAT,!1,0,0),i.drawArrays(i.TRIANGLE_STRIP,0,4)},g}),i("util/measure/MeasurerUtils",["../../geom/Location","../../geom/Position"],function(t,e){"use strict";return{subdividePositions:function(i,r,n,o,s){var a,l=[],h=new t(0,0),u=new t(0,0),c=r[0];this.addPosition(i,l,c,n);for(var d=1;d<r.length;d++){var f=r[d],p=t.greatCircleDistance(c,f);h=t.interpolateAlongPath(o,.5,c,f,h);var g=p*i.radiusAt(h.latitude,h.longitude);if(g>s)for(var m=null,y=null,E=Math.ceil(g/s),v=1;v<E;v++){var _=v/E;o===WorldWind.LINEAR?u=t.interpolateLinear(_,c,f,u):o===WorldWind.RHUMB_LINE?(null==m&&(m=t.rhumbAzimuth(c,f),y=t.rhumbDistance(c,f)),u=t.rhumbLocation(c,m,_*y,u)):(null==m&&(m=t.greatCircleAzimuth(c,f),y=t.greatCircleDistance(c,f)),u=t.greatCircleLocation(c,m,_*y,u)),a=n?i.elevationAtLocation(u.latitude,u.longitude):c.altitude*(1-_)+f.altitude*_,l.push(new e(u.latitude,u.longitude,a))}this.addPosition(i,l,f,n),c=f}return l},addPosition:function(t,i,r,n){var o=r.altitude;return n&&(o=t.elevationAtLocation(r.latitude,r.longitude)),i.push(new e(r.latitude,r.longitude,o)),i},isLocationInside:function(t,e){for(var i=!1,r=e[0],n=1,o=e.length;n<o;n++){var s=e[n];(s.latitude<=t.latitude&&t.latitude<r.latitude||r.latitude<=t.latitude&&t.latitude<s.latitude)&&t.longitude<(r.longitude-s.longitude)*(t.latitude-s.latitude)/(r.latitude-s.latitude)+s.longitude&&(i=!i),r=s}return i},angleBetweenVectors:function(t,e){var i=t.dot(e),r=t.magnitude()*e.magnitude();return 0!==r&&1!==r&&(i/=r),i<-1?i=-1:i>1&&(i=1),Math.acos(i)}}}),i("geom/Sector",["../geom/Angle","../error/ArgumentError","../geom/Location","../util/Logger","../geom/Vec3","../util/WWMath"],function(t,e,i,r,n,o){"use strict";var s=function(t,e,i,r){this.minLatitude=t,this.maxLatitude=e,this.minLongitude=i,this.maxLongitude=r};return s.ZERO=new s(0,0,0,0),s.FULL_SPHERE=new s(-90,90,-180,180),s.prototype.copy=function(t){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"Sector","copy","missingSector"));return this.minLatitude=t.minLatitude,this.maxLatitude=t.maxLatitude,this.minLongitude=t.minLongitude,this.maxLongitude=t.maxLongitude,this},s.prototype.isEmpty=function(){return this.minLatitude===this.maxLatitude&&this.minLongitude===this.maxLongitude},s.prototype.deltaLatitude=function(){return this.maxLatitude-this.minLatitude},s.prototype.deltaLongitude=function(){return this.maxLongitude-this.minLongitude},s.prototype.centroidLatitude=function(){return.5*(this.minLatitude+this.maxLatitude)},s.prototype.centroidLongitude=function(){return.5*(this.minLongitude+this.maxLongitude)},s.prototype.centroid=function(t){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"Sector","centroid","missingResult"));return t.latitude=this.centroidLatitude(),t.longitude=this.centroidLongitude(),t},s.prototype.minLatitudeRadians=function(){return this.minLatitude*t.DEGREES_TO_RADIANS},s.prototype.maxLatitudeRadians=function(){return this.maxLatitude*t.DEGREES_TO_RADIANS},s.prototype.minLongitudeRadians=function(){return this.minLongitude*t.DEGREES_TO_RADIANS},s.prototype.maxLongitudeRadians=function(){return this.maxLongitude*t.DEGREES_TO_RADIANS},s.prototype.setToBoundingSector=function(t){if(!t||t.length<2)throw new e(r.logMessage(r.LEVEL_SEVERE,"Sector","setToBoundingSector","missingArray"));for(var i=90,n=-90,o=180,s=-180,a=0,l=t.length;a<l;a+=1){var h=t[a];h&&(i=Math.min(i,h.latitude),n=Math.max(n,h.latitude),o=Math.min(o,h.longitude),s=Math.max(s,h.longitude))}return this.minLatitude=i,this.maxLatitude=n,this.minLongitude=o,this.maxLongitude=s,this},s.splitBoundingSectors=function(t){if(!t||t.length<2)throw new e(r.logMessage(r.LEVEL_SEVERE,"Sector","splitBoundingSectors","missingArray"));for(var i=90,n=180,a=-90,l=-180,h=null,u=0,c=t.length;u<c;u+=1){var d=t[u],f=d.latitude;f<i&&(i=f),f>a&&(a=f);var p=d.longitude;if(p>=0&&p<n&&(n=p),p<=0&&p>l&&(l=p),null!=h){var g=h.longitude;o.signum(p)!=o.signum(g)&&Math.abs(p-g)<180&&(l=0,n=0)}h=d}return i===a&&n===l?null:[new s(i,a,n,180),new s(i,a,-180,l)]},s.prototype.intersects=function(t){return t&&this.minLongitude<=t.maxLongitude&&this.maxLongitude>=t.minLongitude&&this.minLatitude<=t.maxLatitude&&this.maxLatitude>=t.minLatitude},s.prototype.overlaps=function(t){return t&&this.minLongitude<t.maxLongitude&&this.maxLongitude>t.minLongitude&&this.minLatitude<t.maxLatitude&&this.maxLatitude>t.minLatitude},s.prototype.contains=function(t){return t&&this.minLatitude<=t.minLatitude&&this.maxLatitude>=t.maxLatitude&&this.minLongitude<=t.minLongitude&&this.maxLongitude>=t.maxLongitude},s.prototype.containsLocation=function(t,e){return this.minLatitude<=t&&this.maxLatitude>=t&&this.minLongitude<=e&&this.maxLongitude>=e},s.prototype.intersection=function(t){if(!t instanceof s)throw new e(r.logMessage(r.LEVEL_SEVERE,"Sector","
88intersection","missingSector"));return this.minLatitude<t.minLatitude&&(this.minLatitude=t.minLatitude),this.maxLatitude>t.maxLatitude&&(this.maxLatitude=t.maxLatitude),this.minLongitude<t.minLongitude&&(this.minLongitude=t.minLongitude),this.maxLongitude>t.maxLongitude&&(this.maxLongitude=t.maxLongitude),this.maxLatitude<this.minLatitude&&(this.maxLatitude=this.minLatitude),this.maxLongitude<this.minLongitude&&(this.maxLongitude=this.minLongitude),this},s.prototype.getCorners=function(){var t=[];return t.push(new i(this.minLatitude,this.minLongitude)),t.push(new i(this.minLatitude,this.maxLongitude)),t.push(new i(this.maxLatitude,this.maxLongitude)),t.push(new i(this.maxLatitude,this.minLongitude)),t},s.prototype.computeBoundingPoints=function(t,o){if(null===t)throw new e(r.logMessage(r.LEVEL_SEVERE,"Sector","computeBoundingBox","missingGlobe"));var s=t.minAndMaxElevationsForSector(this),a=s[0]*o,l=s[1]*o;a===l&&(l=a+10);for(var h=[],u=this.getCorners(),c=0;c<u.length;c++)h.push(t.computePointFromPosition(u[c].latitude,u[c].longitude,a,new n(0,0,0))),h.push(t.computePointFromPosition(u[c].latitude,u[c].longitude,l,new n(0,0,0)));var d=this.centroid(new i(0,0));if(h.push(t.computePointFromPosition(d.latitude,d.longitude,l,new n(0,0,0))),this.minLatitude<0&&this.maxLatitude>0?(h.push(t.computePointFromPosition(this.minLatitude,d.longitude,l,new n(0,0,0))),h.push(t.computePointFromPosition(this.maxLatitude,d.longitude,l,new n(0,0,0))),h.push(t.computePointFromPosition(0,this.minLongitude,l,new n(0,0,0))),h.push(t.computePointFromPosition(0,this.maxLongitude,l,new n(0,0,0)))):this.minLatitude<0?h.push(t.computePointFromPosition(this.maxLatitude,d.longitude,l,new n(0,0,0))):h.push(t.computePointFromPosition(this.minLatitude,d.longitude,l,new n(0,0,0))),this.deltaLongitude()>=360){var f=this.minLatitude;h.push(t.computePointFromPosition(f,0,l,new n(0,0,0))),h.push(t.computePointFromPosition(f,90,l,new n(0,0,0))),h.push(t.computePointFromPosition(f,-90,l,new n(0,0,0))),h.push(t.computePointFromPosition(f,180,l,new n(0,0,0)));var p=this.maxLatitude;h.push(t.computePointFromPosition(p,0,l,new n(0,0,0))),h.push(t.computePointFromPosition(p,90,l,new n(0,0,0))),h.push(t.computePointFromPosition(p,-90,l,new n(0,0,0))),h.push(t.computePointFromPosition(p,180,l,new n(0,0,0)))}else if(this.deltaLongitude()>180){var g=d.longitude,m=d.latitude,y=(this.minLongitude+g)/2;h.push(t.computePointFromPosition(m,y,l,new n(0,0,0))),y=(g+this.maxLongitude)/2,h.push(t.computePointFromPosition(m,y,l,new n(0,0,0))),h.push(t.computePointFromPosition(m,this.minLongitude,l,new n(0,0,0))),h.push(t.computePointFromPosition(m,this.maxLongitude,l,new n(0,0,0)))}return h},s.prototype.union=function(t){if(!t instanceof s)throw new e(r.logMessage(r.LEVEL_SEVERE,"Sector","union","missingSector"));return this.minLatitude>t.minLatitude&&(this.minLatitude=t.minLatitude),this.maxLatitude<t.maxLatitude&&(this.maxLatitude=t.maxLatitude),this.minLongitude>t.minLongitude&&(this.minLongitude=t.minLongitude),this.maxLongitude<t.maxLongitude&&(this.maxLongitude=t.maxLongitude),this},s});var r={};return r.DEBUG=!1,r.assert=function(t,e){if(r.DEBUG&&!t)throw new Error("Assertion failed"+(e?": "+e:""))},r.GLU_TESS_MAX_COORD=1e150,r.TRUE_PROJECT=!1,r.TESS_MAX_CACHE=100,r.GLU_TESS_DEFAULT_TOLERANCE=0,r.windingRule={GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131, 89GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},r.primitiveType={GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},r.errorType={GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},r.gluEnum={GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111,GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901},r.PQHandle,r.PQKey,r.geom={}
vendor: 22,463 bytes, line 89
89,r.geom.vertEq=function(t,e){return t.s===e.s&&t.t===e.t},r.geom.vertLeq=function(t,e){return t.s<e.s||t.s===e.s&&t.t<=e.t},r.geom.edgeEval=function(t,e,i){var r=e.s-t.s,n=i.s-e.s;return r+n>0?r<n?e.t-t.t+(t.t-i.t)*(r/(r+n)):e.t-i.t+(i.t-t.t)*(n/(r+n)):0},r.geom.edgeSign=function(t,e,i){var r=e.s-t.s,n=i.s-e.s;return r+n>0?(e.t-i.t)*r+(e.t-t.t)*n:0},r.geom.transLeq=function(t,e){return t.t<e.t||t.t===e.t&&t.s<=e.s},r.geom.transEval=function(t,e,i){var r=e.t-t.t,n=i.t-e.t;return r+n>0?r<n?e.s-t.s+(t.s-i.s)*(r/(r+n)):e.s-i.s+(i.s-t.s)*(n/(r+n)):0},r.geom.transSign=function(t,e,i){var r=e.t-t.t,n=i.t-e.t;return r+n>0?(e.s-i.s)*r+(e.s-t.s)*n:0},r.geom.edgeGoesLeft=function(t){return r.geom.vertLeq(t.dst(),t.org)},r.geom.edgeGoesRight=function(t){return r.geom.vertLeq(t.org,t.dst())},r.geom.vertL1dist=function(t,e){return Math.abs(t.s-e.s)+Math.abs(t.t-e.t)},r.geom.vertCCW=function(t,e,i){return t.s*(e.t-i.t)+e.s*(i.t-t.t)+i.s*(t.t-e.t)>=0},r.geom.interpolate_=function(t,e,i,r){return t=t<0?0:t,i=i<0?0:i,t<=i?0===i?(e+r)/2:e+t/(t+i)*(r-e):r+i/(t+i)*(e-r)},r.geom.edgeIntersect=function(t,e,i,n,o){var s,a,l;r.geom.vertLeq(t,e)||(l=t,t=e,e=l),r.geom.vertLeq(i,n)||(l=i,i=n,n=l),r.geom.vertLeq(t,i)||(l=t,t=i,i=l,l=e,e=n,n=l),r.geom.vertLeq(i,e)?r.geom.vertLeq(e,n)?(s=r.geom.edgeEval(t,i,e),a=r.geom.edgeEval(i,e,n),s+a<0&&(s=-s,a=-a),o.s=r.geom.interpolate_(s,i.s,a,e.s)):(s=r.geom.edgeSign(t,i,e),a=-r.geom.edgeSign(t,n,e),s+a<0&&(s=-s,a=-a),o.s=r.geom.interpolate_(s,i.s,a,n.s)):o.s=(i.s+e.s)/2,r.geom.transLeq(t,e)||(l=t,t=e,e=l),r.geom.transLeq(i,n)||(l=i,i=n,n=l),r.geom.transLeq(t,i)||(l=t,t=i,i=l,l=e,e=n,n=l),r.geom.transLeq(i,e)?r.geom.transLeq(e,n)?(s=r.geom.transEval(t,i,e),a=r.geom.transEval(i,e,n),s+a<0&&(s=-s,a=-a),o.t=r.geom.interpolate_(s,i.t,a,e.t)):(s=r.geom.transSign(t,i,e),a=-r.geom.transSign(t,n,e),s+a<0&&(s=-s,a=-a),o.t=r.geom.interpolate_(s,i.t,a,n.t)):o.t=(i.t+e.t)/2},r.mesh={},r.mesh.makeEdge=function(t){var e=r.mesh.makeEdgePair_(t.eHead);return r.mesh.makeVertex_(e,t.vHead),r.mesh.makeVertex_(e.sym,t.vHead),r.mesh.makeFace_(e,t.fHead),e},r.mesh.meshSplice=function(t,e){var i=!1,n=!1;t!==e&&(e.org!==t.org&&(n=!0,r.mesh.killVertex_(e.org,t.org)),e.lFace!==t.lFace&&(i=!0,r.mesh.killFace_(e.lFace,t.lFace)),r.mesh.splice_(e,t),n||(r.mesh.makeVertex_(e,t.org),t.org.anEdge=t),i||(r.mesh.makeFace_(e,t.lFace),t.lFace.anEdge=t))},r.mesh.deleteEdge=function(t){var e=t.sym,i=!1;t.lFace!==t.rFace()&&(i=!0,r.mesh.killFace_(t.lFace,t.rFace())),t.oNext===t?r.mesh.killVertex_(t.org,null):(t.rFace().anEdge=t.oPrev(),t.org.anEdge=t.oNext,r.mesh.splice_(t,t.oPrev()),i||r.mesh.makeFace_(t,t.lFace)),e.oNext===e?(r.mesh.killVertex_(e.org,null),r.mesh.killFace_(e.lFace,null)):(t.lFace.anEdge=e.oPrev(),e.org.anEdge=e.oNext,r.mesh.splice_(e,e.oPrev())),r.mesh.killEdge_(t)},r.mesh.addEdgeVertex=function(t){var e=r.mesh.makeEdgePair_(t),i=e.sym;return r.mesh.splice_(e,t.lNext),e.org=t.dst(),r.mesh.makeVertex_(i,e.org),e.lFace=i.lFace=t.lFace,e},r.mesh.splitEdge=function(t){var e=r.mesh.addEdgeVertex(t),i=e.sym;return r.mesh.splice_(t.sym,t.sym.oPrev()),r.mesh.splice_(t.sym,i),t.sym.org=i.org,i.dst().anEdge=i.sym,i.sym.lFace=t.rFace(),i.winding=t.winding,i.sym.winding=t.sym.winding,i},r.mesh.connect=function(t,e){var i=!1,n=r.mesh.makeEdgePair_(t),o=n.sym;return e.lFace!==t.lFace&&(i=!0,r.mesh.killFace_(e.lFace,t.lFace)),r.mesh.splice_(n,t.lNext),r.mesh.splice_(o,e),n.org=t.dst(),o.org=e.org,n.lFace=o.lFace=t.lFace,t.lFace.anEdge=o,i||r.mesh.makeFace_(n,t.lFace),n},r.mesh.zapFace=function(t){var e,i=t.anEdge,n=i.lNext;do{if(e=n,n=e.lNext,e.lFace=null,null===e.rFace()){e.oNext===e?r.mesh.killVertex_(e.org,null):(e.org.anEdge=e.oNext,r.mesh.splice_(e,e.oPrev()));var o=e.sym;o.oNext===o?r.mesh.killVertex_(o.org,null):(o.org.anEdge=o.oNext,r.mesh.splice_(o,o.oPrev())),r.mesh.killEdge_(e)}}while(e!==i);var s=t.prev,a=t.next;a.prev=s,s.next=a},r.mesh.meshUnion=function(t,e){var i=t.fHead,r=t.vHead,n=t.eHead,o=e.fHead,s=e.vHead,a=e.eHead;return o.next!==o&&(i.prev.next=o.next,o.next.prev=i.prev,o.prev.next=i,i.prev=o.prev),s.next!==s&&(r.prev.next=s.next,s.next.prev=r.prev,s.prev.next=r,r.prev=s.prev),a.next!==a&&(n.sym.next.sym.next=a.next,a.next.sym.next=n.sym.next,a.sym.next.sym.next=n,n.sym.next=a.sym.next),t},r.mesh.deleteMesh=function(t){},r.mesh.makeEdgePair_=function(t){var e=new r.GluHalfEdge,i=new r.GluHalfEdge,n=t.sym.next;return i.next=n,n.sym.next=e,e.next=t,t.sym.next=i,e.sym=i,e.oNext=e,e.lNext=i,i.sym=e,i.oNext=i,i.lNext=e,e},r.mesh.splice_=function(t,e){var i=t.oNext,r=e.oNext;i.sym.lNext=e,r.sym.lNext=t,t.oNext=r,e.oNext=i},r.mesh.makeVertex_=function(t,e){var i=e.prev,n=new r.GluVertex(e,i);i.next=n,e.prev=n,n.anEdge=t;var o=t;do{o.org=n,o=o.oNext}while(o!==t)},r.mesh.makeFace_=function(t,e){var i=e.prev,n=new r.GluFace(e,i);i.next=n,e.prev=n,n.anEdge=t,n.inside=e.inside;var o=t;do{o.lFace=n,o=o.lNext}while(o!==t)},r.mesh.killEdge_=function(t){var e=t.next,i=t.sym.next;e.sym.next=i,i.sym.next=e},r.mesh.killVertex_=function(t,e){var i=t.anEdge,r=i;do{r.org=e,r=r.oNext}while(r!==i);var n=t.prev,o=t.next;o.prev=n,n.next=o},r.mesh.killFace_=function(t,e){var i=t.anEdge,r=i;do{r.lFace=e,r=r.lNext}while(r!==i);var n=t.prev,o=t.next;o.prev=n,n.next=o},r.normal={},r.normal.S_UNIT_X_=1,r.normal.S_UNIT_Y_=0,r.normal.projectPolygon=function(t){var e=!1,i=[t.normal[0],t.normal[1],t.normal[2]];0===i[0]&&0===i[1]&&0===i[2]&&(r.normal.computeNormal_(t,i),e=!0);var n=t.sUnit,o=t.tUnit,s=r.normal.longAxis_(i);if(r.TRUE_PROJECT){r.normal.normalize_(i),n[s]=0,n[(s+1)%3]=r.normal.S_UNIT_X_,n[(s+2)%3]=r.normal.S_UNIT_Y_;var a=r.normal.dot_(n,i);n[0]-=a*i[0],n[1]-=a*i[1],n[2]-=a*i[2],r.normal.normalize_(n),o[0]=i[1]*n[2]-i[2]*n[1],o[1]=i[2]*n[0]-i[0]*n[2],o[2]=i[0]*n[1]-i[1]*n[0],r.normal.normalize_(o)}else n[s]=0,n[(s+1)%3]=r.normal.S_UNIT_X_,n[(s+2)%3]=r.normal.S_UNIT_Y_,o[s]=0,o[(s+1)%3]=i[s]>0?-r.normal.S_UNIT_Y_:r.normal.S_UNIT_Y_,o[(s+2)%3]=i[s]>0?r.normal.S_UNIT_X_:-r.normal.S_UNIT_X_;for(var l=t.mesh.vHead,h=l.next;h!==l;h=h.next)h.s=r.normal.dot_(h.coords,n),h.t=r.normal.dot_(h.coords,o);e&&r.normal.checkOrientation_(t)},r.normal.dot_=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},r.normal.normalize_=function(t){var e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2];e=Math.sqrt(e),t[0]/=e,t[1]/=e,t[2]/=e},r.normal.longAxis_=function(t){var e=0;return Math.abs(t[1])>Math.abs(t[0])&&(e=1),Math.abs(t[2])>Math.abs(t[e])&&(e=2),e},r.normal.computeNormal_=function(t,e){var i,n=[-2*r.GLU_TESS_MAX_COORD,-2*r.GLU_TESS_MAX_COORD,-2*r.GLU_TESS_MAX_COORD],o=[2*r.GLU_TESS_MAX_COORD,2*r.GLU_TESS_MAX_COORD,2*r.GLU_TESS_MAX_COORD],s=[],a=[],l=t.mesh.vHead;for(i=l.next;i!==l;i=i.next)for(var h=0;h<3;++h){var u=i.coords[h];u<o[h]&&(o[h]=u,a[h]=i),u>n[h]&&(n[h]=u,s[h]=i)}var c=0;if(n[1]-o[1]>n[0]-o[0]&&(c=1),n[2]-o[2]>n[c]-o[c]&&(c=2),o[c]>=n[c])return e[0]=0,e[1]=0,void(e[2]=1);var d=0,f=a[c],p=s[c],g=[0,0,0],m=[f.coords[0]-p.coords[0],f.coords[1]-p.coords[1],f.coords[2]-p.coords[2]],y=[0,0,0];for(i=l.next;i!==l;i=i.next){y[0]=i.coords[0]-p.coords[0],y[1]=i.coords[1]-p.coords[1],y[2]=i.coords[2]-p.coords[2],g[0]=m[1]*y[2]-m[2]*y[1],g[1]=m[2]*y[0]-m[0]*y[2],g[2]=m[0]*y[1]-m[1]*y[0];var E=g[0]*g[0]+g[1]*g[1]+g[2]*g[2];E>d&&(d=E,e[0]=g[0],e[1]=g[1],e[2]=g[2])}d<=0&&(e[0]=e[1]=e[2]=0,e[r.normal.longAxis_(m)]=1)},r.normal.checkOrientation_=function(t){for(var e=0,i=t.mesh.fHead,r=i.next;r!==i;r=r.next){var n=r.anEdge;if(!(n.winding<=0))do{e+=(n.org.s-n.dst().s)*(n.org.t+n.dst().t),n=n.lNext}while(n!==r.anEdge)}if(e<0){for(var o=t.mesh.vHead,s=o.next;s!==o;s=s.next)s.t=-s.t;t.tUnit[0]=-t.tUnit[0],t.tUnit[1]=-t.tUnit[1],t.tUnit[2]=-t.tUnit[2]}},r.render={},r.render.renderMesh=function(t,e,i){for(var n=!1,o=-1,s=e.fHead.prev;s!==e.fHead;s=s.prev)if(s.inside){n||(t.callBeginOrBeginData(r.primitiveType.GL_TRIANGLES),n=!0);var a=s.anEdge;do{if(i){var l=a.rFace().inside?0:1;o!==l&&(o=l,t.callEdgeFlagOrEdgeFlagData(!!o))}t.callVertexOrVertexData(a.org.data),a=a.lNext}while(a!==s.anEdge)}n&&t.callEndOrEndData()},r.render.renderBoundary=function(t,e){for(var i=e.fHead.next;i!==e.fHead;i=i.next)if(i.inside){t.callBeginOrBeginData(r.primitiveType.GL_LINE_LOOP);var n=i.anEdge;do{t.callVertexOrVertexData(n.org.data),n=n.lNext}while(n!==i.anEdge);t.callEndOrEndData()}},r.sweep={},r.sweep.SENTINEL_COORD_=4*r.GLU_TESS_MAX_COORD,r.sweep.TOLERANCE_NONZERO_=!1,r.sweep.computeInterior=function(t){t.fatalError=!1,r.sweep.removeDegenerateEdges_(t),r.sweep.initPriorityQ_(t),r.sweep.initEdgeDict_(t);for(var e;null!==(e=t.pq.extractMin());){for(;;){var i=t.pq.minimum();if(null===i||!r.geom.vertEq(i,e))break;i=t.pq.extractMin(),r.sweep.spliceMergeVertices_(t,e.anEdge,i.anEdge)}r.sweep.sweepEvent_(t,e)}var n=t.dict.getMin().getKey();t.event=n.eUp.org,r.sweep.doneEdgeDict_(t),r.sweep.donePriorityQ_(t),r.sweep.removeDegenerateFaces_(t.mesh),t.mesh.checkMesh()},r.sweep.addWinding_=function(t,e){t.winding+=e.winding,t.sym.winding+=e.sym.winding},r.sweep.edgeLeq_=function(t,e,i){var n=t.event,o=e.eUp,s=i.eUp;return o.dst()===n?s.dst()===n?r.geom.vertLeq(o.org,s.org)?r.geom.edgeSign(s.dst(),o.org,s.org)<=0:r.geom.edgeSign(o.dst(),s.org,o.org)>=0:r.geom.edgeSign(s.dst(),n,s.org)<=0:s.dst()===n?r.geom.edgeSign(o.dst(),n,o.org)>=0:r.geom.edgeEval(o.dst(),n,o.org)>=r.geom.edgeEval(s.dst(),n,s.org)},r.sweep.deleteRegion_=function(t,e){e.fixUpperEdge,e.eUp.activeRegion=null,t.dict.deleteNode(e.nodeUp),e.nodeUp=null},r.sweep.fixUpperEdge_=function(t,e){r.mesh.deleteEdge(t.eUp),t.fixUpperEdge=!1,t.eUp=e,e.activeRegion=t},r.sweep.topLeftRegion_=function(t){var e=t.eUp.org;do{t=t.regionAbove()}while(t.eUp.org===e);if(t.fixUpperEdge){var i=r.mesh.connect(t.regionBelow().eUp.sym,t.eUp.lNext);r.sweep.fixUpperEdge_(t,i),t=t.regionAbove()}return t},r.sweep.topRightRegion_=function(t){var e=t.eUp.dst();do{t=t.regionAbove()}while(t.eUp.dst()===e);return t},r.sweep.addRegionBelow_=function(t,e,i){var n=new r.ActiveRegion;return n.eUp=i,n.nodeUp=t.dict.insertBefore(e.nodeUp,n),i.activeRegion=n,n},r.sweep.isWindingInside_=function(t,e){switch(t.windingRule){case r.windingRule.GLU_TESS_WINDING_ODD:return 0!=(1&e);case r.windingRule.GLU_TESS_WINDING_NONZERO:return 0!==e;case r.windingRule.GLU_TESS_WINDING_POSITIVE:return e>0;case r.windingRule.GLU_TESS_WINDING_NEGATIVE:return e<0;case r.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:return e>=2||e<=-2}return!1},r.sweep.computeWinding_=function(t,e){e.windingNumber=e.regionAbove().windingNumber+e.eUp.winding,e.inside=r.sweep.isWindingInside_(t,e.windingNumber)},r.sweep.finishRegion_=function(t,e){var i=e.eUp,n=i.lFace;n.inside=e.inside,n.anEdge=i,r.sweep.deleteRegion_(t,e)},r.sweep.finishLeftRegions_=function(t,e,i){for(var n=e,o=e.eUp;n!==i;){n.fixUpperEdge=!1;var s=n.regionBelow(),a=s.eUp;if(a.org!==o.org){if(!s.fixUpperEdge){r.sweep.finishRegion_(t,n);break}a=r.mesh.connect(o.lPrev(),a.sym),r.sweep.fixUpperEdge_(s,a)}o.oNext!==a&&(r.mesh.meshSplice(a.oPrev(),a),r.mesh.meshSplice(o,a)),r.sweep.finishRegion_(t,n),o=s.eUp,n=s}return o},r.sweep.addRightEdges_=function(t,e,i,n,o,s){var a=!0,l=i;do{r.sweep.addRegionBelow_(t,e,l.sym),l=l.oNext}while(l!==n);null===o&&(o=e.regionBelow().eUp.rPrev());for(var h,u=e,c=o;h=u.regionBelow(),l=h.eUp.sym,l.org===c.org;)l.oNext!==c&&(r.mesh.meshSplice(l.oPrev(),l),r.mesh.meshSplice(c.oPrev(),l)),h.windingNumber=u.windingNumber-l.winding,h.inside=r.sweep.isWindingInside_(t,h.windingNumber),u.dirty=!0,!a&&r.sweep.checkForRightSplice_(t,u)&&(r.sweep.addWinding_(l,c),r.sweep.deleteRegion_(t,u),r.mesh.deleteEdge(c)),a=!1,u=h,c=l;u.dirty=!0,s&&r.sweep.walkDirtyRegions_(t,u)},r.sweep.callCombine_=function(t,e,i,n,o){var s=[e.coords[0],e.coords[1],e.coords[2]];e.data=null,e.data=t.callCombineOrCombineData(s,i,n),null===e.data&&(o?t.fatalError||(t.callErrorOrErrorData(r.errorType.GLU_TESS_NEED_COMBINE_CALLBACK),t.fatalError=!0):e.data=i[0])},r.sweep.spliceMergeVertices_=function(t,e,i){var n=[null,null,null,null],o=[.5,.5,0,0];n[0]=e.org.data,n[1]=i.org.data,r.sweep.callCombine_(t,e.org,n,o,!1),r.mesh.meshSplice(e,i)},r.sweep.vertexWeights_=function(t,e,i,n,o){var s=r.geom.vertL1dist(e,t),a=r.geom.vertL1dist(i,t),l=o,h=o+1;n[l]=.5*a/(s+a),n[h]=.5*s/(s+a),t.coords[0]+=n[l]*e.coords[0]+n[h]*i.coords[0],t.coords[1]+=n[l]*e.coords[1]+n[h]*i.coords[1],t.coords[2]+=n[l]*e.coords[2]+n[h]*i.coords[2]},r.sweep.getIntersectData_=function(t,e,i,n,o,s){var a=[0,0,0,0],l=[i.data,n.data,o.data,s.data];e.coords[0]=e.coords[1]=e.coords[2]=0,r.sweep.vertexWeights_(e,i,n,a,0),r.sweep.vertexWeights_(e,o,s,a,2),r.sweep.callCombine_(t,e,l,a,!0)},r.sweep.checkForRightSplice_=function(t,e){var i=e.regionBelow(),n=e.eUp,o=i.eUp;if(r.geom.vertLeq(n.org,o.org)){if(r.geom.edgeSign(o.dst(),n.org,o.org)>0)return!1;r.geom.vertEq(n.org,o.org)?n.org!==o.org&&(t.pq.remove(n.org.pqHandle),r.sweep.spliceMergeVertices_(t,o.oPrev(),n)):(r.mesh.splitEdge(o.sym),r.mesh.meshSplice(n,o.oPrev()),e.dirty=i.dirty=!0)}else{if(r.geom.edgeSign(n.dst(),o.org,n.org)<0)return!1;e.regionAbove().dirty=e.dirty=!0,r.mesh.splitEdge(n.sym),r.mesh.meshSplice(o.oPrev(),n)}return!0},r.sweep.checkForLeftSplice_=function(t,e){var i,n=e.regionBelow(),o=e.eUp,s=n.eUp;if(r.geom.vertLeq(o.dst(),s.dst())){if(r.geom.edgeSign(o.dst(),s.dst(),o.org)<0)return!1;e.regionAbove().dirty=e.dirty=!0,i=r.mesh.splitEdge(o),r.mesh.meshSplice(s.sym,i),i.lFace.inside=e.inside}else{if(r.geom.edgeSign(s.dst(),o.dst(),s.org)>0)return!1;e.dirty=n.dirty=!0,i=r.mesh.splitEdge(s),r.mesh.meshSplice(o.lNext,s.sym),i.rFace().inside=e.inside}return!0},r.sweep.checkForIntersect_=function(t,e){var i=e.regionBelow(),n=e.eUp,o=i.eUp,s=n.org,a=o.org,l=n.dst(),h=o.dst(),u=new r.GluVertex;if(s===a)return!1;if(Math.min(s.t,l.t)>Math.max(a.t,h.t))return!1;if(r.geom.vertLeq(s,a)){if(r.geom.edgeSign(h,s,a)>0)return!1}else if(r.geom.edgeSign(l,a,s)<0)return!1;r.geom.edgeIntersect(l,s,h,a,u),r.geom.vertLeq(u,t.event)&&(u.s=t.event.s,u.t=t.event.t);var c=r.geom.vertLeq(s,a)?s:a;if(r.geom.vertLeq(c,u)&&(u.s=c.s,u.t=c.t),r.geom.vertEq(u,s)||r.geom.vertEq(u,a))return r.sweep.checkForRightSplice_(t,e),!1;if(!r.geom.vertEq(l,t.event)&&r.geom.edgeSign(l,t.event,u)>=0||!r.geom.vertEq(h,t.event)&&r.geom.edgeSign(h,t.event,u)<=0){if(h===t.event)return r.mesh.splitEdge(n.sym),r.mesh.meshSplice(o.sym,n),e=r.sweep.topLeftRegion_(e),n=e.regionBelow().eUp,r.sweep.finishLeftRegions_(t,e.regionBelow(),i),r.sweep.addRightEdges_(t,e,n.oPrev(),n,n,!0),!0;if(l===t.event){r.mesh.splitEdge(o.sym),r.mesh.meshSplice(n.lNext,o.oPrev()),i=e,e=r.sweep.topRightRegion_(e);var d=e.regionBelow().eUp.rPrev();return i.eUp=o.oPrev(),o=r.sweep.finishLeftRegions_(t,i,null),r.sweep.addRightEdges_(t,e,o.oNext,n.rPrev(),d,!0),!0}return r.geom.edgeSign(l,t.event,u)>=0&&(e.regionAbove().dirty=e.dirty=!0,r.mesh.splitEdge(n.sym),n.org.s=t.event.s,n.org.t=t.event.t),r.geom.edgeSign(h,t.event,u)<=0&&(e.dirty=i.dirty=!0,r.mesh.splitEdge(o.sym),o.org.s=t.event.s,o.org.t=t.event.t),!1}return r.mesh.splitEdge(n.sym),r.mesh.splitEdge(o.sym),r.mesh.meshSplice(o.oPrev(),n),n.org.s=u.s,n.org.t=u.t,n.org.pqHandle=t.pq.insert(n.org),r.sweep.getIntersectData_(t,n.org,s,l,a,h),e.regionAbove().dirty=e.dirty=i.dirty=!0,!1},r.sweep.walkDirtyRegions_=function(t,e){for(var i=e.regionBelow();;){for(;i.dirty;)e=i,i=i.regionBelow();if(!e.dirty&&(i=e,null===(e=e.regionAbove())||!e.dirty))return;e.dirty=!1;var n=e.eUp,o=i.eUp;if(n.dst()!==o.dst()&&r.sweep.checkForLeftSplice_(t,e)&&(i.fixUpperEdge?(r.sweep.deleteRegion_(t,i),r.mesh.deleteEdge(o),i=e.regionBelow(),o=i.eUp):e.fixUpperEdge&&(r.sweep.deleteRegion_(t,e),r.mesh.deleteEdge(n),e=i.regionAbove(),n=e.eUp)),n.org!==o.org)if(n.dst()===o.dst()||e.fixUpperEdge||i.fixUpperEdge||n.dst()!==t.event&&o.dst()!==t.event)r.sweep.checkForRightSplice_(t,e);else if(r.sweep.checkForIntersect_(t,e))return;n.org===o.org&&n.dst()===o.dst()&&(r.sweep.addWinding_(o,n),r.sweep.deleteRegion_(t,e),r.mesh.deleteEdge(n),e=i.regionAbove())}},r.sweep.connectRightVertex_=function(t,e,i){var n=i.oNext,o=e.regionBelow(),s=e.eUp,a=o.eUp,l=!1;if(s.dst()!==a.dst()&&r.sweep.checkForIntersect_(t,e),r.geom.vertEq(s.org,t.event)&&(r.mesh.meshSplice(n.oPrev(),s),e=r.sweep.topLeftRegion_(e),n=e.regionBelow().eUp,r.sweep.finishLeftRegions_(t,e.regionBelow(),o),l=!0),r.geom.vertEq(a.org,t.event)&&(r.mesh.meshSplice(i,a.oPrev()),i=r.sweep.finishLeftRegions_(t,o,null),l=!0),l)return void r.sweep.addRightEdges_(t,e,i.oNext,n,n,!0);var h;h=r.geom.vertLeq(a.org,s.org)?a.oPrev():s,h=r.mesh.connect(i.lPrev(),h),r.sweep.addRightEdges_(t,e,h,h.oNext,h.oNext,!1),h.sym.activeRegion.fixUpperEdge=!0,r.sweep.walkDirtyRegions_(t,e)},r.sweep.connectLeftDegenerate_=function(t,e,i){var n=e.eUp;if(r.geom.vertEq(n.org,i))return void(r.sweep.TOLERANCE_NONZERO_&&r.sweep.spliceMergeVertices_(t,n,i.anEdge));if(!r.geom.vertEq(n.dst(),i))return r.mesh.splitEdge(n.sym),e.fixUpperEdge&&(r.mesh.deleteEdge(n.oNext),e.fixUpperEdge=!1),r.mesh.meshSplice(i.anEdge,n),void r.sweep.sweepEvent_(t,i);if(r.sweep.TOLERANCE_NONZERO_){e=r.sweep.topRightRegion_(e);var o=e.regionBelow(),s=o.eUp.sym,a=s.oNext,l=a;o.fixUpperEdge&&(r.sweep.deleteRegion_(t,o),r.mesh.deleteEdge(s),s=a.oPrev()),r.mesh.meshSplice(i.anEdge,s),r.geom.edgeGoesLeft(a)||(a=null),r.sweep.addRightEdges_(t,e,s.oNext,l,a,!0)}},r.sweep.connectLeftVertex_=function(t,e){var i=new r.ActiveRegion;i.eUp=e.anEdge.sym;var n=t.dict.search(i).getKey(),o=n.regionBelow(),s=n.eUp,a=o.eUp;if(0===r.geom.edgeSign(s.dst(),e,s.org))return void r.sweep.connectLeftDegenerate_(t,n,e);var l,h=r.geom.vertLeq(a.dst(),s.dst())?n:o;if(n.inside||h.fixUpperEdge){if(h===n)l=r.mesh.connect(e.anEdge.sym,s.lNext);else{l=r.mesh.connect(a.dNext(),e.anEdge).sym}h.fixUpperEdge?r.sweep.fixUpperEdge_(h,l):r.sweep.computeWinding_(t,r.sweep.addRegionBelow_(t,n,l)),r.sweep.sweepEvent_(t,e)}else r.sweep.addRightEdges_(t,n,e.anEdge,e.anEdge,null,!0)},r.sweep.sweepEvent_=function(t,e){t.event=e;for(var i=e.anEdge;null===i.activeRegion;)if((i=i.oNext)===e.anEdge)return void r.sweep.connectLeftVertex_(t,e);var n=r.sweep.topLeftRegion_(i.activeRegion),o=n.regionBelow(),s=o.eUp,a=r.sweep.finishLeftRegions_(t,o,null);a.oNext===s?r.sweep.connectRightVertex_(t,n,a):r.sweep.addRightEdges_(t,n,a.oNext,s,s,!0)},r.sweep.addSentinel_=function(t,e){var i=new r.ActiveRegion,n=r.mesh.makeEdge(t.mesh);n.org.s=r.sweep.SENTINEL_COORD_,n.org.t=e,n.dst().s=-r.sweep.SENTINEL_COORD_,n.dst().t=e,t.event=n.dst(),i.eUp=n,i.windingNumber=0,i.inside=!1,i.fixUpperEdge=!1,i.sentinel=!0,i.dirty=!1,i.nodeUp=t.dict.insert(i)},r.sweep.initEdgeDict_=function(t){t.dict=new r.Dict(t,r.sweep.edgeLeq_),r.sweep.addSentinel_(t,-r.sweep.SENTINEL_COORD_),r.sweep.addSentinel_(t,r.sweep.SENTINEL_COORD_)},r.sweep.doneEdgeDict_=function(t){for(var e;null!==(e=t.dict.getMin().getKey());)e.sentinel,r.sweep.deleteRegion_(t,e);t.dict=null},r.sweep.removeDegenerateEdges_=function(t){for(var e,i=t.mesh.eHead,n=i.next;n!==i;n=e){e=n.next;var o=n.lNext;r.geom.vertEq(n.org,n.dst())&&n.lNext.lNext!==n&&(r.sweep.spliceMergeVertices_(t,o,n),r.mesh.deleteEdge(n),n=o,o=n.lNext),o.lNext===n&&(o!==n&&(o!==e&&o!==e.sym||(e=e.next),r.mesh.deleteEdge(o)),n!==e&&n!==e.sym||(e=e.next),r.mesh.deleteEdge(n))}},r.sweep.initPriorityQ_=function(t){var e=new r.PriorityQ(r.geom.vertLeq);t.pq=e;var i,n=t.mesh.vHead;for(i=n.next;i!==n;i=i.next)i.pqHandle=e.insert(i);e.init()},r.sweep.donePriorityQ_=function(t){t.pq.deleteQ(),t.pq=null},r.sweep.removeDegenerateFaces_=function(t){for(var e,i=t.fHead.next;i!==t.fHead;i=e){e=i.next;var n=i.anEdge;n.lNext.lNext===n&&(r.sweep.addWinding_(n.oNext,n),r.mesh.deleteEdge(n))}},r.tessmono={},r.tessmono.tessellateMonoRegion_=function(t){for(var e=t.anEdge;r.geom.vertLeq(e.dst(),e.org);e=e.lPrev());for(;r.geom.vertLeq(e.org,e.dst());e=e.lNext);for(var i,n=e.lPrev();e.lNext!==n;)if(r.geom.vertLeq(e.dst(),n.org)){for(;n.lNext!==e&&(r.geom.edgeGoesLeft(n.lNext)||r.geom.edgeSign(n.org,n.dst(),n.lNext.dst())<=0);)i=r.mesh.connect(n.lNext,n),n=i.sym;n=n.lPrev()}else{for(;n.lNext!==e&&(r.geom.edgeGoesRight(e.lPrev())||r.geom.edgeSign(e.dst(),e.org,e.lPrev().org)>=0);)i=r.mesh.connect(e,e.lPrev()),e=i.sym;e=e.lNext}for(;n.lNext.lNext!==e;)i=r.mesh.connect(n.lNext,n),n=i.sym},r.tessmono.tessellateInterior=function(t){for(var e,i=t.fHead.next;i!==t.fHead;i=e)e=i.next,i.inside&&r.tessmono.tessellateMonoRegion_(i)},r.tessmono.discardExterior=function(t){for(var e,i=t.fHead.next;i!==t.fHead;i=e)e=i.next,i.inside||r.mesh.zapFace(i)},r.tessmono.setWindingNumber=function(t,e,i){for(var n,o=t.eHead.next;o!==t.eHead;o=n)n=o.next,o.rFace().inside!==o.lFace.inside?o.winding=o.lFace.inside?e:-e:i?r.mesh.deleteEdge(o):o.winding=0},r.Dict=function(t,e){this.head_=new r.DictNode,this.frame_=t,this.leq_=e},r.Dict.prototype.deleteDict_=function(){},r.Dict.prototype.insertBefore=function(t,e){do{t=t.prev}while(null!==t.key&&!this.leq_(this.frame_,t.key,e));var i=new r.DictNode(e,t.next,t);return t.next.prev=i,t.next=i,i},r.Dict.prototype.insert=function(t){return this.insertBefore(this.head_,t)},r.Dict.prototype.deleteNode=function(t){t.next.prev=t.prev,t.prev.next=t.next},r.Dict.prototype.search=function(t){var e=this.head_;do{e=e.next}while(null!==e.key&&!this.leq_(this.frame_,t,e.key));return e},r.Dict.prototype.getMin=function(){return this.head_.next},r.Dict.prototype.getMax=function(){return this.head_.prev},r.DictNode=function(t,e,i){this.key=t||null,this.next=e||this,this.prev=i||this},r.DictNode.prototype.getKey=function(){return this.key},r.DictNode.prototype.getSuccessor=function(){return this.next},r.DictNode.prototype.getPredecessor=function(){return this.prev},r.CachedVertex=function(){this.coords=[0,0,0],this.data=null},r.GluTesselator=function(){this.state=r.GluTesselator.tessState_.T_DORMANT,this.lastEdge_=null,this.mesh=null,this.callError_=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.relTolerance=r.GLU_TESS_DEFAULT_TOLERANCE,this.windingRule=r.windingRule.GLU_TESS_WINDING_ODD,this.fatalError=!1,this.dict=null,this.pq=null,this.event=null,this.callCombine_=null,this.boundaryOnly=!1,this.callBegin_=null,this.callEdgeFlag_=null,this.callVertex_=null,this.callEnd_=null,this.callMesh_=null,this.callBeginData_=null,this.callEdgeFlagData_=null,this.callVertexData_=null,this.callEndData_=null,this.callErrorData_=null,this.callCombineData_=null,this.polygonData_=null,this.emptyCache=!1,this.cacheCount=0,this.cache=new Array(r.TESS_MAX_CACHE);for(var t=0;t<r.TESS_MAX_CACHE;t++)this.cache[t]=new r.CachedVertex},r.GluTesselator.tessState_={T_DORMANT:0,T_IN_POLYGON:1,T_IN_CONTOU
89R:2},r.GluTesselator.prototype.gluDeleteTess=function(){this.requireState_(r.GluTesselator.tessState_.T_DORMANT)},r.GluTesselator.prototype.gluTessProperty=function(t,e){switch(t){case r.gluEnum.GLU_TESS_TOLERANCE:if(e<0||e>1)break;return void(this.relTolerance=e);case r.gluEnum.GLU_TESS_WINDING_RULE:var i=e;switch(i){case r.windingRule.GLU_TESS_WINDING_ODD:case r.windingRule.GLU_TESS_WINDING_NONZERO:case r.windingRule.GLU_TESS_WINDING_POSITIVE:case r.windingRule.GLU_TESS_WINDING_NEGATIVE:case r.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:return void(this.windingRule=i)}break;case r.gluEnum.GLU_TESS_BOUNDARY_ONLY:return void(this.boundaryOnly=!!e);default:return void this.callErrorOrErrorData(r.gluEnum.GLU_INVALID_ENUM)}this.callErrorOrErrorData(r.gluEnum.GLU_INVALID_VALUE)},r.GluTesselator.prototype.gluGetTessProperty=function(t){switch(t){case r.gluEnum.GLU_TESS_TOLERANCE:return this.relTolerance;case r.gluEnum.GLU_TESS_WINDING_RULE:return this.windingRule;case r.gluEnum.GLU_TESS_BOUNDARY_ONLY:return this.boundaryOnly;default:this.callErrorOrErrorData(r.gluEnum.GLU_INVALID_ENUM)}return!1},r.GluTesselator.prototype.gluTessNormal=function(t,e,i){this.normal[0]=t,this.normal[1]=e,this.normal[2]=i},r.GluTesselator.prototype.gluTessCallback=function(t,e){var i=e||null;switch(t){case r.gluEnum.GLU_TESS_BEGIN:return void(this.callBegin_=i);case r.gluEnum.GLU_TESS_BEGIN_DATA:return void(this.callBeginData_=i);case r.gluEnum.GLU_TESS_EDGE_FLAG:return void(this.callEdgeFlag_=i);case r.gluEnum.GLU_TESS_EDGE_FLAG_DATA:return void(this.callEdgeFlagData_=i);case r.gluEnum.GLU_TESS_VERTEX:return void(this.callVertex_=i);case r.gluEnum.GLU_TESS_VERTEX_DATA:return void(this.callVertexData_=i);case r.gluEnum.GLU_TESS_END:return void(this.callEnd_=i);case r.gluEnum.GLU_TESS_END_DATA:return void(this.callEndData_=i);case r.gluEnum.GLU_TESS_ERROR:return void(this.callError_=i);case r.gluEnum.GLU_TESS_ERROR_DATA:return void(this.callErrorData_=i);case r.gluEnum.GLU_TESS_COMBINE:return void(this.callCombine_=i);case r.gluEnum.GLU_TESS_COMBINE_DATA:return void(this.callCombineData_=i);case r.gluEnum.GLU_TESS_MESH:return void(this.callMesh_=i);default:return void this.callErrorOrErrorData(r.gluEnum.GLU_INVALID_ENUM)}},r.GluTesselator.prototype.gluTessVertex=function(t,e){var i=!1,n=[0,0,0];this.requireState_(r.GluTesselator.tessState_.T_IN_CONTOUR),this.emptyCache&&(this.emptyCache_(),this.lastEdge_=null);for(var o=0;o<3;++o){var s=t[o];s<-r.GLU_TESS_MAX_COORD&&(s=-r.GLU_TESS_MAX_COORD,i=!0),s>r.GLU_TESS_MAX_COORD&&(s=r.GLU_TESS_MAX_COORD,i=!0),n[o]=s}if(i&&this.callErrorOrErrorData(r.errorType.GLU_TESS_COORD_TOO_LARGE),null===this.mesh){if(this.cacheCount<r.TESS_MAX_CACHE)return void this.cacheVertex_(n,e);this.emptyCache_()}this.addVertex_(n,e)},r.GluTesselator.prototype.gluTessBeginPolygon=function(t){this.requireState_(r.GluTesselator.tessState_.T_DORMANT),this.state=r.GluTesselator.tessState_.T_IN_POLYGON,this.cacheCount=0,this.emptyCache=!1,this.mesh=null,this.polygonData_=t},r.GluTesselator.prototype.gluTessBeginContour=function(){this.requireState_(r.GluTesselator.tessState_.T_IN_POLYGON),this.state=r.GluTesselator.tessState_.T_IN_CONTOUR,this.lastEdge_=null,this.cacheCount>0&&(this.emptyCache=!0)},r.GluTesselator.prototype.gluTessEndContour=function(){this.requireState_(r.GluTesselator.tessState_.T_IN_CONTOUR),this.state=r.GluTesselator.tessState_.T_IN_POLYGON},r.GluTesselator.prototype.gluTessEndPolygon=function(){if(this.requireState_(r.GluTesselator.tessState_.T_IN_POLYGON),this.state=r.GluTesselator.tessState_.T_DORMANT,null===this.mesh&&this.emptyCache_(),r.normal.projectPolygon(this),r.sweep.computeInterior(this),!this.fatalError){var t=this.mesh;if(this.boundaryOnly?r.tessmono.setWindingNumber(t,1,!0):r.tessmono.tessellateInterior(t),this.mesh.checkMesh(),this.callBegin_||this.callEnd_||this.callVertex_||this.callEdgeFlag_||this.callBeginData_||this.callEndData_||this.callVertexData_||this.callEdgeFlagData_)if(this.boundaryOnly)r.render.renderBoundary(this,this.mesh);else{var e=!(!this.callEdgeFlag_&&!this.callEdgeFlagData_);r.render.renderMesh(this,this.mesh,e)}if(this.callMesh_)return r.tessmono.discardExterior(this.mesh),this.callMesh_(this.mesh),this.mesh=null,void(this.polygonData_=null)}r.mesh.deleteMesh(this.mesh),this.polygonData_=null,this.mesh=null},r.GluTesselator.prototype.makeDormant_=function(){this.mesh&&r.mesh.deleteMesh(this.mesh),this.state=r.GluTesselator.tessState_.T_DORMANT,this.lastEdge_=null,this.mesh=null},r.GluTesselator.prototype.requireState_=function(t){this.state!==t&&this.gotoState_(t)},r.GluTesselator.prototype.gotoState_=function(t){for(;this.state!==t;)if(this.state<t)switch(this.state){case r.GluTesselator.tessState_.T_DORMANT:this.callErrorOrErrorData(r.errorType.GLU_TESS_MISSING_BEGIN_POLYGON),this.gluTessBeginPolygon(null);break;case r.GluTesselator.tessState_.T_IN_POLYGON:this.callErrorOrErrorData(r.errorType.GLU_TESS_MISSING_BEGIN_CONTOU
89R),this.gluTessBeginContour()}else switch(this.state){case r.GluTesselator.tessState_.T_IN_CONTOUR:this.callErrorOrErrorData(r.errorType.GLU_TESS_MISSING_END_CONTOUR),this.gluTessEndContour();break;case r.GluTesselator.tessState_.T_IN_POLYGON:this.callErrorOrErrorData(r.errorType.GLU_TESS_MISSING_END_POLYGON),this.makeDormant_()}},r.GluTesselator.prototype.addVertex_=function(t,e){var i=this.lastEdge_;null===i?(i=r.mesh.makeEdge(this.mesh),r.mesh.meshSplice(i,i.sym)):(r.mesh.splitEdge(i),i=i.lNext),i.org.data=e,i.org.coords[0]=t[0],i.org.coords[1]=t[1],i.org.coords[2]=t[2],i.winding=1,i.sym.winding=-1,this.lastEdge_=i},r.GluTesselator.prototype.cacheVertex_=function(t,e){var i=this.cache[this.cacheCount];i.data=e,i.coords[0]=t[0],i.coords[1]=t[1],i.coords[2]=t[2],++this.cacheCount},r.GluTesselator.prototype.emptyCache_=function(){this.mesh=new r.GluMesh;for(var t=0;t<this.cacheCount;t++){var e=this.cache[t];this.addVertex_(e.coords,e.data)}this.cacheCount=0,this.emptyCache=!1},r.GluTesselator.prototype.callBeginOrBeginData=function(t){this.callBeginData_?this.callBeginData_(t,this.polygonData_):this.callBegin_&&this.callBegin_(t)},r.GluTesselator.prototype.callVertexOrVertexData=function(t){this.callVertexData_?this.callVertexData_(t,this.polygonData_):this.callVertex_&&this.callVertex_(t)},r.GluTesselator.prototype.callEdgeFlagOrEdgeFlagData=function(t){this.callEdgeFlagData_?this.callEdgeFlagData_(t,this.polygonData_):this.callEdgeFlag_&&this.callEdgeFlag_(t)},r.GluTesselator.prototype.callEndOrEndData=function(){this.callEndData_?this.callEndData_(this.polygonData_):this.callEnd_&&this.callEnd_()},r.GluTesselator.prototype.callCombineOrCombineData=function(t,e,i){var r;return this.callCombineData_?r=this.callCombineData_(t,e,i,this.polygonData_):this.callCombine_&&(r=this.callCombine_(t,e,i)),void 0===r&&(r=null),r},r.GluTesselator.prototype.callErrorOrErrorData=function(t){this.callErrorData_?this.callErrorData_(t,this.polygonData_):this.callError_&&this.callError_(t)},r.GluFace=function(t,e){this.next=t||this,this.prev=e||this,this.anEdge=null,this.data=null,this.inside=!1},r.GluHalfEdge=function(t){this.next=t||this,this.sym=null,this.oNext=null,this.lNext=null,this.org=null,this.lFace=null,this.activeRegion=null,this.winding=0},r.GluHalfEdge.prototype.rFace=function(){return this.sym.lFace},r.GluHalfEdge.prototype.dst=function(){return this.sym.org},r.GluHalfEdge.prototype.oPrev=function(){return this.sym.lNext},r.GluHalfEdge.prototype.lPrev=function(){return this.oNext.sym},r.GluHalfEdge.prototype.dPrev=function(){return this.lNext.sym},r.GluHalfEdge.prototype.rPrev=function(){return this.sym.oNext},r.GluHalfEdge.prototype.dNext=function(){return this.rPrev().sym},r.GluHalfEdge.prototype.rNext=function(){return this.oPrev().sym},r.GluMesh=function(){this.vHead=new r.GluVertex,this.fHead=new r.GluFace,this.eHead=new r.GluHalfEdge,this.eHeadSym=new r.GluHalfEdge,this.eHead.sym=this.eHeadSym,this.eHeadSym.sym=this.eHead},r.GluMesh.prototype.checkMesh=function(){if(r.DEBUG){var t,e,i=this.fHead,n=this.vHead,o=this.eHead,s=i;for(s=i;(e=s.next)!==i;s=e){t=e.anEdge;do{t=t.lNext}while(t!==e.anEdge)}var a,l=n;for(l=n;(a=l.next)!==n;l=a){t=a.anEdge;do{t=t.oNext}while(t!==a.anEdge)}var h=o;for(h=o;(t=h.next)!==o;h=t);}},r.GluVertex=function(t,e){this.next=t||this,this.prev=e||this,this.anEdge=null,this.data=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=null},r.PQHandleElem=function(){this.key=null,this.node=0},r.PQHandleElem.realloc=function(t,e){var i=new Array(e),n=0;if(null!==t)for(;n<t.length;n++)i[n]=t[n];for(;n<e;n++)i[n]=new r.PQHandleElem;return i},r.PQNode=function(){ 90this.handle=0},r.PQNode.realloc=function(t,e){var i=new Array(e),n=0;if(null!==t)for(;n<t.length;n++)i[n]=t[n];for(;n<e;n++)i[n]=new r.PQNode;return i},r.PriorityQ=function(t){this.keys_=r.PriorityQ.prototype.PQKeyRealloc_(null,r.PriorityQ.INIT_SIZE_),this.order_=null,this.size_=0,this.max_=r.PriorityQ.INIT_SIZE_,this.initialized_=!1,this.leq_=t,this.heap_=new r.PriorityQHeap(this.leq_)},r.PriorityQ.INIT_SIZE_=32,r.PriorityQ.prototype.deleteQ=function(){this.heap_.deleteHeap(),this.heap_=null,this.order_=null,this.keys_=null},r.PriorityQ.prototype.init=function(){this.order_=[];for(var t=0;t<this.size_;t++)this.order_[t]=t;var e=function(t,e){return function(i,r){return e(t[i],t[r])?1:-1}}(this.keys_,this.leq_);if(this.order_.sort(e),this.max_=this.size_,this.initialized_=!0,this.heap_.init(),r.DEBUG){var i=0+this.size_-1;for(t=0;t<i;++t);}}
90,r.PriorityQ.prototype.insert=function(t){if(this.initialized_)return this.heap_.insert(t);var e=this.size_;return++this.size_>=this.max_&&(this.max_*=2,this.keys_=r.PriorityQ.prototype.PQKeyRealloc_(this.keys_,this.max_)),this.keys_[e]=t,-(e+1)},r.PriorityQ.prototype.PQKeyRealloc_=function(t,e){var i=new Array(e),r=0;if(null!==t)for(;r<t.length;r++)i[r]=t[r];for(;r<e;r++)i[r]=null;return i},r.PriorityQ.prototype.keyLessThan_=function(t,e){var i=this.keys_[t],r=this.keys_[e];return!this.leq_(r,i)},r.PriorityQ.prototype.keyGreaterThan_=function(t,e){var i=this.keys_[t],r=this.keys_[e];return!this.leq_(i,r)},r.PriorityQ.prototype.extractMin=function(){if(0===this.size_)return this.heap_.extractMin();var t=this.keys_[this.order_[this.size_-1]];if(!this.heap_.isEmpty()){var e=this.heap_.minimum();if(this.leq_(e,t))return this.heap_.extractMin()}do{--this.size_}while(this.size_>0&&null===this.keys_[this.order_[this.size_-1]]);return t},r.PriorityQ.prototype.minimum=function(){if(0===this.size_)return this.heap_.minimum();var t=this.keys_[this.order_[this.size_-1]];if(!this.heap_.isEmpty()){var e=this.heap_.minimum();if(this.leq_(e,t))return e}return t},r.PriorityQ.prototype.isEmpty_=function(){return 0===this.size_&&this.heap_.isEmpty()},r.PriorityQ.prototype.remove=function(t){if(t>=0)return void this.heap_.remove(t);for(t=-(t+1),this.keys_[t]=null;this.size_>0&&null===this.keys_[this.order_[this.size_-1]];)--this.size_},r.PriorityQHeap=function(t){this.nodes_=r.PQNode.realloc(null,r.PriorityQHeap.INIT_SIZE_+1),this.handles_=r.PQHandleElem.realloc(null,r.PriorityQHeap.INIT_SIZE_+1),this.size_=0,this.max_=r.PriorityQHeap.INIT_SIZE_,this.freeList_=0,this.initialized_=!1,this.leq_=t,this.nodes_[1].handle=1},r.PriorityQHeap.INIT_SIZE_=32,r.PriorityQHeap.prototype.deleteHeap=function(){this.handles_=null,this.nodes_=null},r.PriorityQHeap.prototype.init=function(){for(var t=this.size_;t>=1;--t)this.floatDown_(t);this.initialized_=!0},r.PriorityQHeap.prototype.insert=function(t){var e=++this.size_;2*e>this.max_&&(this.max_*=2,this.nodes_=r.PQNode.realloc(this.nodes_,this.max_+1),this.handles_=r.PQHandleElem.realloc(this.handles_,this.max_+1));var i;return 0===this.freeList_?i=e:(i=this.freeList_,this.freeList_=this.handles_[i].node),this.nodes_[e].handle=i,this.handles_[i].node=e,this.handles_[i].key=t,this.initialized_&&this.floatUp_(e),i},r.PriorityQHeap.prototype.isEmpty=function(){return 0===this.size_},r.PriorityQHeap.prototype.minimum=function(){return this.handles_[this.nodes_[1].handle].key},r.PriorityQHeap.prototype.extractMin=function(){var t=this.nodes_,e=this.handles_,i=t[1].handle,r=e[i].key;return this.size_>0&&(t[1].handle=t[this.size_].handle,e[t[1].handle].node=1,e[i].key=null,e[i].node=this.freeList_,this.freeList_=i,--this.size_>0&&this.floatDown_(1)),r},r.PriorityQHeap.prototype.remove=function(t){var e=this.nodes_,i=this.handles_,r=i[t].node;e[r].handle=e[this.size_].handle,i[e[r].handle].node=r,r<=--this.size_&&(r<=1||this.leq_(i[e[r>>1].handle].key,i[e[r].handle].key)?this.floatDown_(r):this.floatUp_(r)),i[t].key=null,i[t].node=this.freeList_,this.freeList_=t},r.PriorityQHeap.prototype.floatDown_=function(t){for(var e=this.nodes_,i=this.handles_,r=e[t].handle;;){var n=t<<1;n<this.size_&&this.leq_(i[e[n+1].handle].key,i[e[n].handle].key)&&++n;var o=e[n].handle;if(n>this.size_||this.leq_(i[r].key,i[o].key)){e[t].handle=r,i[r].node=t;break}e[t].handle=o,i[o].node=t,t=n}},r.PriorityQHeap.prototype.floatUp_=function(t){for(var e=this.nodes_,i=this.handles_,r=e[t].handle;;){var n=t>>1,o=e[n].handle;if(0===n||this.leq_(i[o].key,i[r].key)){e[t].handle=r,i[r].node=t;break}e[t].handle=o,i[o].node=t,t=n}},r.ActiveRegion=function(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1},r.ActiveRegion.prototype.regionBelow=function(){return this.nodeUp.getPredecessor().getKey()},r.ActiveRegion.prototype.regionAbove=function(){return this.nodeUp.getSuccessor().getKey()},"undefined"!=typeof module&&(module.exports=r),i("util/libtess",function(){}),i("util/measure/AreaMeasurer",["../../geom/Angle","../../error/ArgumentError","../../geom/Location","../Logger","./MeasurerUtils","../../geom/Sector","../../geom/Vec3","../libtess"],function(t,e,
90i,n,o,s,a,l){"use strict";var h=function(t){if(!t)throw new e(n.logMessage(n.LEVEL_SEVERE,"AreaMeasurer","constructor","missingWorldWindow"));this.wwd=t,this.DEFAULT_AREA_SAMPLING_STEPS=32,this._areaTerrainSamplingSteps=this.DEFAULT_AREA_SAMPLING_STEPS,this._maxSegmentLength=1e5,this.subdividedPositions=null,this.vecZ=new a(0,0,1),this.scratchLocation=new i(0,0)};return Object.defineProperties(h.prototype,{areaTerrainSamplingSteps:{get:function(){return this._areaTerrainSamplingSteps},set:function(t){this._areaTerrainSamplingSteps=t}},maxSegmentLength:{get:function(){return this._maxSegmentLength},set:function(t){this._maxSegmentLength=t}}}),h.prototype.getArea=function(t,e,i){var r=this.wwd.globe;return e?this.computeSurfaceAreaSampling(r,t,i):this.computeProjectedAreaGeometry(r,t,i)},h.prototype.computeSurfaceAreaSampling=function(e,i,r){var n=new s(0,0,0,0);n.setToBoundingSector(i),this.subdividedPositions=o.subdividePositions(e,i,!0,r,this._maxSegmentLength);for(var l=Math.max(this.DEFAULT_AREA_SAMPLING_STEPS,this._areaTerrainSamplingSteps),h=n.deltaLatitude()*t.DEGREES_TO_RADIANS,u=n.deltaLongitude()*t.DEGREES_TO_RADIANS,c=Math.max(h/l,u/l),d=Math.round(h/c),f=Math.round(u/c*Math.cos(n.centroidLatitude()*t.DEGREES_TO_RADIANS)),p=h/d,g=u/f,m=0,y=0;y<d;y++)for(var E=n.minLatitude*t.DEGREES_TO_RADIANS+p*y,v=e.radiusAt((E+p/2)*t.RADIANS_TO_DEGREES,n.centroidLongitude()),_=g*v*Math.cos(E+p/2),b=p*v,S=_*b,w=0;w<f;w++){var L=n.minLongitude*t.DEGREES_TO_RADIANS+g*w,T=E*t.RADIANS_TO_DEGREES,x=(E+p)*t.RADIANS_TO_DEGREES,R=L*t.RADIANS_TO_DEGREES,M=(L+g)*t.RADIANS_TO_DEGREES,C=new s(T,x,R,M),A=o.isLocationInside(C.centroid(this.scratchLocation),this.subdividedPositions);if(A){var P=e.elevationAtLocation(T,R),N=e.elevationAtLocation(T,M),O=e.elevationAtLocation(x,R),I=new a(_,0,N-P),D=new a(0,b,O-P);I.normalize(),D.normalize();var k=I.cross(D).normalize(),V=Math.tan(o.angleBetweenVectors(this.vecZ,k)),F=Math.sqrt(1+V*V);m+=S*F}}return m},h.prototype.computeProjectedAreaGeometry=function(e,i,r){this.subdividedPositions=o.subdividePositions(e,i,!1,r,this._maxSegmentLength);var n=this.subdividedPositions.length,s=this.subdividedPositions[0],a=this.subdividedPositions[n-1];s.equals(a)&&n--;for(var l=[],h=0,u=0;u<n;u++){var c=this.subdividedPositions[u];l[h++]=c.longitude*t.DEGREES_TO_RADIANS,l[h++]=c.latitude*t.DEGREES_TO_RADIANS,l[h++]=0}var d=this.tessellatePolygon(n,l),f=0,p=d.length/9;for(u=0;u<p;u++){h=9*u;var g=[d[h+0],d[h+1],d[h+2],d[h+3],d[h+4],d[h+5],d[h+6],d[h+7],d[h+8]];f+=this.computeTriangleProjectedArea(e,g)}return f},h.prototype.computeTriangleProjectedArea=function(e,i){var r=i[0],n=i[1],o=i[3],s=i[4],a=i[6],l=i[7],h=Math.abs(r*(s-l)+o*(l-n)+a*(n-s));h/=2;var u=(r+o+a)/3,c=(n+s+l)/3,d=e.radiusAt(c*t.RADIANS_TO_DEGREES,u*t.RADIANS_TO_DEGREES);return h*=Math.cos(c)*d*d},h.prototype.tessellatePolygon=function(t,e){var i,o=new r.GluTesselator,s=[];o.gluTessCallback(r.gluEnum.GLU_TESS_BEGIN,function(t){t!==r.primitiveType.GL_TRIANGLES&&n.logMessage(n.LEVEL_WARNING,"AreaMeasurer","tessellatePolygon","Tessellation error, primitive is not TRIANGLES.")}),o.gluTessCallback(r.gluEnum.GLU_TESS_VERTEX_DATA,function(t,e){e.push(t[0]),e.push(t[1]),e.push(t[2])}),o.gluTessCallback(r.gluEnum.GLU_TESS_EDGE_FLAG,function(){}),o.gluTessCallback(r.gluEnum.GLU_TESS_ERROR,function(t){n.logMessage(n.LEVEL_WARNING,"AreaMeasurer","tessellatePolygon","Tessellation error "+t+".")}),o.gluTessBeginPolygon(s),o.gluTessBeginContour();for(var a=0;a<t;a++)i=e.slice(3*a,3*a+3),o.gluTessVertex(i,i);return o.gluTessEndContour(),o.gluTessEndPolygon(),s},h}),i("util/AbsentResourceList",[],function(){"use strict";var t=function(t,e){this.maxTrys=t,this.minCheckInterval=e,this.tryAgainInterval=6e4,this.possiblyAbsent={}};return t.prototype.isResourceAbsent=function(t){var e=this.possiblyAbsent[t];if(!e)return!1;if(e.permanent)return!0;var i=Date.now()-e.timeOfLastMark;return i>this.tryAgainInterval?(delete this.possiblyAbsent[t],!1):i<this.minCheckInterval||e.numTrys>this.maxTrys},t.prototype.markResourceAbsent=function(t){var e=this.possiblyAbsent[t];e||(e={timeOfLastMark:Date.now(),numTrys:0},this.possiblyAbsent[t]=e),e.numTrys=e.numTrys+1,e.timeOfLastMark=Date.now()},t.prototype.markResourceAbsentPermanently=function(t){var e=this.possiblyAbsent[t];e||(e={timeOfLastMark:Date.now(),numTrys:0},this.possiblyAbsent[t]=e),e.numTrys=e.numTrys+1,e.timeOfLastMark=Date.now(),e.permanent=!0},t.prototype.unmarkResourceAbsent=function(t){this.possiblyAbsent[t]&&delete this.possiblyAbsent[t]},t}),i("globe/ElevationCoverage",["../error/ArgumentError","../util/Logger","../geom/Sector"],function(t,e,
90i){"use strict";var r=function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"ElevationCoverage","constructor","missingResolution"));this.timestamp=Date.now(),this.displayName="Coverage",this._enabled=!0,this.resolution=r,this.coverageSector=i.FULL_SPHERE};return Object.defineProperties(r.prototype,{enabled:{get:function(){return this._enabled},set:function(t){this._enabled=t,this.timestamp=Date.now()}}}),r.prototype.minAndMaxElevationsForSector=function(i,r){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"ElevationCoverage","minAndMaxElevationsForSector","missingSector"));if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"ElevationCoverage","minAndMaxElevationsForSector","missingResult"));return r[0]>0&&(r[0]=0),r[1]<0&&(r[1]=0),!0},r.prototype.elevationAtLocation=function(t,e){return 0},r.prototype.elevationsForGrid=function(i,r,n,o){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"ElevationCoverage","elevationsForGrid","missingSector"));if(r<=0||n<=0)throw new t(e.logMessage(e.LEVEL_SEVERE,"ElevationCoverage","elevationsForGrid","numLat or numLon is less than 1"));if(!o||o.length<r*n)throw new t(e.logMessage(e.LEVEL_SEVERE,"ElevationCoverage","elevationsForGrid","missingArray"));for(var s=0,a=o.length;s<a;s++)o[s]=0;return!0},r}),i("globe/ElevationImage",["../error/ArgumentError","../util/Logger","../util/WWMath"],function(t,e,i){"use strict";var r=function(i,r,n){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"ElevationImage","constructor","missingSector"));this.sector=i,this.imageWidth=r,this.imageHeight=n,this.size=this.imageWidth*this.imageHeight,this.hasData=!0,this.hasMissingData=!1};return r.NO_DATA=0,r.isNoData=function(t,e,i,n){var o=r.NO_DATA;return t===o&&e===o&&i===o&&n===o},r.prototype.pixel=function(t,e){return t<0||t>=this.imageWidth?0:e<0||e>=this.imageHeight?0:(e=this.imageHeight-e-1,this.imageData[t+e*this.imageWidth])},r.prototype.elevationAtLocation=function(t,e){var n=this.sector.maxLatitude,o=this.sector.minLongitude,s=this.sector.deltaLatitude(),a=this.sector.deltaLongitude(),l=(this.imageWidth-1)*(e-o)/a,h=(this.imageHeight-1)*(n-t)/s,u=Math.floor(i.clamp(l,0,this.imageWidth-1)),c=Math.floor(i.clamp(u+1,0,this.imageWidth-1)),d=Math.floor(i.clamp(h,0,this.imageHeight-1)),f=Math.floor(i.clamp(d+1,0,this.imageHeight-1)),p=this.imageData,g=p[u+d*this.imageWidth],m=p[c+d*this.imageWidth],y=p[u+f*this.imageWidth],E=p[c+f*this.imageWidth],v=l-u,_=h-d;return r.isNoData(g,m,y,E)?NaN:(1-v)*(1-_)*g+v*(1-_)*m+(1-v)*_*y+v*_*E},r.prototype.elevationsForGrid=function(n,o,s,a){if(!n)throw new t(e.logMessage(e.LEVEL_SEVERE,"ElevationImage","elevationsForGrid","missingSector"));if(o<1||s<1)throw new t(e.logMessage(e.LEVEL_SEVERE,"ElevationImage","elevationsForGrid","The specified number of sample points is less than 1."));if(!a)throw new t(e.logMessage(e.LEVEL_SEVERE,"ElevationImage","elevationsForGrid","missingResult"));var l,h,u,c,d=this.sector.minLatitude,f=this.sector.maxLatitude,p=this.sector.minLongitude,g=this.sector.maxLongitude,m=f-d,y=g-p,E=n.minLatitude,v=n.maxLatitude,_=n.minLongitude,b=n.maxLongitude,S=(v-E)/(o>1?o-1:1),w=(b-_)/(s>1?s-1:1),L=0,T=this.imageData;for(c=0,l=E;c<o;c+=1,l+=S)if(c===o-1&&(l=v),l>=d&&l<=f){var x=(this.imageHeight-1)*(f-l)/m,R=Math.floor(i.clamp(x,0,this.imageHeight-1)),M=Math.floor(i.clamp(R+1,0,this.imageHeight-1)),C=x-R;for(u=0,h=_;u<s;u+=1,h+=w){if(u===s-1&&(h=b),h>=p&&h<=g&&isNaN(a[L])){var A=(this.imageWidth-1)*(h-p)/y,P=Math.floor(i.clamp(A,0,this.imageWidth-1)),N=Math.floor(i.clamp(P+1,0,this.imageWidth-1)),O=A-P,I=T[P+R*this.imageWidth],D=T[N+R*this.imageWidth],k=T[P+M*this.imageWidth],V=T[N+M*this.imageWidth];r.isNoData(I,D,k,V)?a[L]=NaN:a[L]=(1-O)*(1-C)*I+O*(1-C)*D+(1-O)*C*k+O*C*V}L++}}else L+=s},r.prototype.minAndMaxElevationsForSector=function(t){if(!this.hasData)return null;var e=[];if(t)if(t.contains(this.sector))e[0]>this.minElevation&&(e[0]=this.minElevation),e[1]<this.maxElevation&&(e[1]=this.maxElevation);else{var r=this.sector.maxLatitude,n=this.sector.minLongitude,o=this.sector.deltaLatitude(),s=this.sector.deltaLongitude(),a=t.minLatitude,l=t.maxLatitude,h=t.minLongitude,u=t.maxLongitude,c=Math.floor((this.imageHeight-1)*(r-l)/o),d=Math.ceil((this.imageHeight-1)*(r-a)/o),f=Math.floor((this.imageWidth-1)*(h-n)/s),p=Math.ceil((this.imageWidth-1)*(u-n)/s);c=i.clamp(c,0,this.imageHeight-1),d=i.clamp(d,0,this.imageHeight-1),f=i.clamp(f,0,this.imageWidth-1),p=i.clamp(p,0,this.imageWidth-1);for(var g=this.imageData,m=Number.MAX_VALUE,y=-m,E=c;E<=d;E++)for(var v=f;v<=p;v++){var _=g[Math.floor(v+E*this.imageWidth)];m>_&&(m=_),y<_&&(y=_)}e[0]>m&&(e[0]=m),e[1]<y&&(e[1]=y)}else e[0]=this.minElevation,e[1]=this.maxElevation;return e},r.prototype.findMinAndMaxElevation=function(){if(this.hasData=!1,this.hasMissingData=!1,this.imageData&&this.imageData.length>0){this.minElevation=Number.MAX_VALUE,this.maxElevation=-Number.MAX_VALUE;for(var t=this.imageData,e=this.imageWidth*this.imageHeight,i=0;i<e;i++){var n=t[i];n!==r.NO_DATA?(this.hasData=!0,this.minElevation>n&&(this.minElevation=n),this.maxElevation<n&&(this.maxElevation=n)):this.hasMissingData=!0}}this.hasData||(this.minElevation=0,this.maxElevation=0)},r}),i("formats/geotiff/GeoTiffConstants",[],function(){"use strict";return{Tag:{MODEL_PIXEL_SCALE:33550,MODEL_TRANSFORMATION:34264,MODEL_TIEPOINT:33922,GEO_KEY_DIRECTORY:34735,GEO_DOUBLE_PARAMS:34736,GEO_ASCII_PARAMS:34737,GDAL_NODATA:42113,GDAL_METADATA:42112},Key:{GTModelTypeGeoKey:1024,GTRasterTypeGeoKey:1025,GTCitationGeoKey:1026,GeographicTypeGeoKey:2048,GeogCitationGeoKey:2049,GeogGeodeticDatumGeoKey:2050,GeogPrimeMeridianGeoKey:2051,GeogLinearUnitsGeoKey:2052,GeogLinearUnitSizeGeoKey:2053,GeogAngularUnitsGeoKey:2054,GeogAngularUnitSizeGeoKey:2055,GeogEllipsoidGeoKey:2056,GeogSemiMajorAxisGeoKey:2057,GeogSemiMinorAxisGeoKey:2058,GeogInvFlatteningGeoKey:2059,GeogAzimuthUnitsGeoKey:2060,GeogPrimeMeridianLongGeoKey:2061,GeogTOWGS84GeoKey:2062,ProjectedCSTypeGeoKey:3072,PCSCitationGeoKey:3073,ProjectionGeoKey:3074,ProjCoordTransGeoKey:3075,ProjLinearUnitsGeoKey:3076,ProjLinearUnitSizeGeoKey:3077,ProjStdParallel1GeoKey:3078,ProjStdParallel2GeoKey:3079,ProjNatOriginLongGeoKey:3080,ProjNatOriginLatGeoKey:3081,ProjFalseEastingGeoKey:3082,ProjFalseNorthingGeoKey:3083,ProjFalseOriginLongGeoKey:3084,ProjFalseOriginLatGeoKey:3085,ProjFalseOriginEastingGeoKey:3086,ProjFalseOriginNorthingGeoKey:3087,ProjCenterLongGeoKey:3088,ProjCenterLatGeoKey:3089,ProjCenterEastingGeoKey:3090,ProjCenterNorthingGeoKey:3091,ProjScaleAtNatOriginGeoKey:3092,ProjScaleAtCenterGeoKey:3093,ProjAzimuthAngleGeoKey:3094,ProjStraightVertPoleLongGeoKey:3095,VerticalCSTypeGeoKey:4096,VerticalCitationGeoKey:4097,VerticalDatumGeoKey:4098,VerticalUnitsGeoKey:4099}}}),i("formats/geotiff/GeoTiffKeyEntry",["../../error/AbstractError","../../error/ArgumentError","./GeoTiffConstants","../../util/Logger"],function(t,e,
90i,r){"use strict";var n=function(t,i,n,o){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"GeoTiffKeyEntry","constructor","missingKeyId"));if(null===i||void 0===i)throw new e(r.logMessage(r.LEVEL_SEVERE,"GeoTiffKeyEntry","constructor","missingTiffTagLocation"));if(!n)throw new e(r.logMessage(r.LEVEL_SEVERE,"GeoTiffKeyEntry","constructor","missingCount"));if(null===o||void 0===o)throw new e(r.logMessage(r.LEVEL_SEVERE,"GeoTiffKeyEntry","constructor","missingValueOffset"));this._keyId=t,this._tiffTagLocation=i,this._count=n,this._valueOffset=o};return Object.defineProperties(n.prototype,{keyId:{get:function(){return this._keyId}},tiffTagLocation:{get:function(){return this._tiffTagLocation}},count:{get:function(){return this._count}},valueOffset:{get:function(){return this._valueOffset}}}),n.prototype.getGeoKeyValue=function(t,e){var r;if(0===this.tiffTagLocation)r=this.valueOffset;else if(this.tiffTagLocation===i.Tag.GEO_ASCII_PARAMS){var n="";if(e){for(var o=this.valueOffset;o<this.count-1;o++)n+=e[o];"|"!=e[this.count-1]&&(n+=e[this.count-1]),r=n}}else this.tiffTagLocation===i.Tag.GEO_DOUBLE_PARAMS&&t&&(r=t[this.valueOffset]);return r},n}),i("formats/geotiff/GeoTiffMetadata",[],function(){"use strict";var t=function(){this._bitsPerSample=null,this._colorMap=null,this._compression=null,this._extraSamples=null,this._imageLength=null,this._imageWidth=null,this._maxSampleValue=null,this._minSampleValue=null,this._orientation=0,this._photometricInterpretation=null,this._planarConfiguration=null,this._resolutionUnit=null,this._rowsPerStrip=null,this._samplesPerPixel=null,this._sampleFormat=null,this._software=null,this._stripByteCounts=null,this._stripOffsets=null,this._tileByteCounts=null,this._tileOffsets=null,this._tileLength=null,this._tileWidth=null,this._xResolution=null,this._yResolution=null,this._geoAsciiParams=null,this._geoDoubleParams=null,this._geoKeyDirectory=null,this._modelPixelScale=null,this._modelTiepoint=null,this._modelTransformation=null,this._noData=null,this._bbox=null,this._gtModelTypeGeoKey=null,this._gtRasterTypeGeoKey=null,this._gtCitationGeoKey=null,this._geographicTypeGeoKey=null,this._geogCitationGeoKey=null,this._geogAngularUnitsGeoKey=null,this._geogAngularUnitSizeGeoKey=null,this._geogSemiMajorAxisGeoKey=null,this._geogInvFlatteningGeoKey=null,this._projectedCSType=null,this._projLinearUnits=null};return Object.defineProperties(t.prototype,{bitsPerSample:{get:function(){return this._bitsPerSample},set:function(t){this._bitsPerSample=t}},colorMap:{get:function(){return this._colorMap},set:function(t){this._colorMap=t}},compression:{get:function(){return this._compression},set:function(t){this._compression=t}},extraSamples:{get:function(){return this._extraSamples},set:function(t){this._extraSamples=t}},imageLength:{get:function(){return this._imageLength},set:function(t){this._imageLength=t}},imageWidth:{get:function(){return this._imageWidth},set:function(t){this._imageWidth=t}},maxSampleValue:{get:function(){return this._maxSampleValue},set:function(t){this._maxSampleValue=t}},minSampleValue:{get:function(){return this._minSampleValue},set:function(t){this._minSampleValue=t}},orientation:{get:function(){return this._orientation},set:function(t){this._orientation=t}},photometricInterpretation:{get:function(){return this._photometricInterpretation},set:function(t){this._photometricInterpretation=t}},planarConfiguration:{get:function(){return this._planarConfiguration},set:function(t){this._planarConfiguration=t}},resolutionUnit:{get:function(){return this._resolutionUnit},set:function(t){this._resolutionUnit=t}},rowsPerStrip:{get:function(){return this._rowsPerStrip},set:function(t){this._rowsPerStrip=t}},samplesPerPixel:{get:function(){return this._samplesPerPixel},set:function(t){this._samplesPerPixel=t}},sampleFormat:{get:function(){return this._sampleFormat},set:function(t){this._sampleFormat=t}},software:{get:function(){return this._software},set:function(t){this._software=t}},stripByteCounts:{get:function(){return this._stripByteCounts},set:function(t){this._stripByteCounts=t}},stripOffsets:{get:function(){return this._stripOffsets},set:function(t){this._stripOffsets=t}},tileByteCounts:{get:function(){return this._tileByteCounts},set:function(t){this._tileByteCounts=t}}
90,tileOffsets:{get:function(){return this._tileOffsets},set:function(t){this._tileOffsets=t}},tileLength:{get:function(){return this._tileLength},set:function(t){this._tileLength=t}},tileWidth:{get:function(){return this._tileWidth},set:function(t){this._tileWidth=t}},geoAsciiParams:{get:function(){return this._geoAsciiParams},set:function(t){this._geoAsciiParams=t}},geoDoubleParams:{get:function(){return this._geoDoubleParams},set:function(t){this._geoDoubleParams=t}},geoKeyDirectory:{get:function(){return this._geoKeyDirectory},set:function(t){this._geoKeyDirectory=t}},modelPixelScale:{get:function(){return this._modelPixelScale},set:function(t){this._modelPixelScale=t}},modelTiepoint:{get:function(){return this._modelTiepoint},set:function(t){this._modelTiepoint=t}},modelTransformation:{get:function(){return this._modelTransformation},set:function(t){this._modelTransformation=t}},noData:{get:function(){return this._noData},set:function(t){this._noData=t}},bbox:{get:function(){return this._bbox},set:function(t){this._bbox=t}},gtModelTypeGeoKey:{get:function(){return this._gtModelTypeGeoKey},set:function(t){this._gtModelTypeGeoKey=t}},gtRasterTypeGeoKey:{get:function(){return this._gtRasterTypeGeoKey},set:function(t){this._gtRasterTypeGeoKey=t}},gtCitationGeoKey:{get:function(){return this._gtCitationGeoKey},set:function(t){this._gtCitationGeoKey=t}},geographicTypeGeoKey:{get:function(){return this._geographicTypeGeoKey},set:function(t){this._geographicTypeGeoKey=t}},geogCitationGeoKey:{get:function(){return this._geogCitationGeoKey},set:function(t){this._geogCitationGeoKey=t}},geogAngularUnitsGeoKey:{get:function(){return this._geogAngularUnitsGeoKey},set:function(t){this._geogAngularUnitsGeoKey=t}},geogAngularUnitSizeGeoKey:{get:function(){return this._geogAngularUnitSizeGeoKey},set:function(t){this._geogAngularUnitSizeGeoKey=t}},geogSemiMajorAxisGeoKey:{get:function(){return this._geogSemiMajorAxisGeoKey},set:function(t){this._geogSemiMajorAxisGeoKey=t}},geogInvFlatteningGeoKey:{get:function(){return this._geogInvFlatteningGeoKey},set:function(t){this._geogInvFlatteningGeoKey=t}},projectedCSType:{get:function(){return this._projectedCSType},set:function(t){this._projectedCSType=t}},projLinearUnits:{get:function(){return this._projLinearUnits},set:function(t){this._projLinearUnits=t}},xResolution:{get:function(){return this._xResolution},set:function(t){this._xResolution=t}},yResolution:{get:function(){return this._yResolution},set:function(t){this._yResolution=t}}}),t}),i("formats/geotiff/TiffConstants",[],function(){"use strict";return{Tag:{NEW_SUBFILE_TYPE:254,SUBFILE_TYPE:255,IMAGE_WIDTH:256,IMAGE_LENGTH:257,BITS_PER_SAMPLE:258,COMPRESSION:259,PHOTOMETRIC_INTERPRETATION:262,THRESHHOLDING:263,CELL_WIDTH:264,CELL_LENGTH:265,FILL_ORDER:266,DOCUMENT_NAME:269,IMAGE_DESCRIPTION:270,MAKE:271,MODEL:272,STRIP_OFFSETS:273,ORIENTATION:274,SAMPLES_PER_PIXEL:277,ROWS_PER_STRIP:278,STRIP_BYTE_COUNTS:279,MIN_SAMPLE_VALUE:280,MAX_SAMPLE_VALUE:281,X_RESOLUTION:282,Y_RESOLUTION:283,PLANAR_CONFIGURATION:284,PAGE_NAME:285,X_POSITION:286,Y_POSITION:287,FREE_OFFSETS:288,FREE_BYTE_COUNTS:289,GRAY_RESPONSE_UNIT:290,GRAY_RESPONSE_CURVE:291,T4_OPTIONS:292,T6_PTIONS:293,RESOLUTION_UNIT:296,PAGE_NUMBER:297,TRANSFER_FUNCTION:301,SOFTWARE:305,DATE_TIME:306,ARTIST:315,HOST_COMPUTER:316,PREDICTOR:317,WHITE_POINT:318,PRIMARY_CHROMATICITIES:319,COLOR_MAP:320,HALFTONE_HINTS:321,TILE_WIDTH:322,TILE_LENGTH:323,TILE_OFFSETS:324,TILE_BYTE_COUNTS:325,INK_SET:332,INK_NAMES:333,NUMBER_OF_INKS:334,DOT_RANGE:336,TARGET_PRINTER:337,EXTRA_SAMPLES:338,SAMPLE_FORMAT:339,S_MIN_SAMPLE_VALUE:340,S_MAX_SAMPLE_VALUE:341,TRANSFER_RANGE:342,JPEG_PROC:512,JPEG_INTERCHANGE_FORMAT:513,JPEG_INTERCHANGE_FORMAT_LENGTH:514,JPEG_RESTART_INTERVAL:515,JPEG_LOSSLESS_PREDICTORS:517,JPEG_POINT_TRANSFORMS:518,JPEG_Q_TABLES:519,JPEG_DC_TABLES:520,JPEG_AC_TABLES:521,Y_Cb_Cr_COEFFICIENTS:529,Y_Cb_Cr_SUB_SAMPLING:530,Y_Cb_Cr_POSITIONING:531,REFERENCE_BLACK_WHITE:532,COPYRIGHT:33432},Compression:{UNCOMPRESSED:1,CCITT_1D:2,GROUP_3_FAX:3,GROUP_4_FAX:4,LZW:5,JPEG:6,PACK_BITS:32773},Orientation:{Row0_IS_TOP__Col0_IS_LHS:1,Row0_IS_TOP__Col0_IS_RHS:2,Row0_IS_BOTTOM__Col0_IS_RHS:3,Row0_IS_BOTTOM__Col0_IS_LHS:4,Row0_IS_LHS__Col0_IS_TOP:5,Row0_IS_RHS__Col0_IS_TOP:6,Row0_IS_RHS__Col0_IS_BOTTOM:7,Row0_IS_LHS__Col0_IS_BOTTOM:8},PhotometricInterpretation:{WHITE_IS_ZERO:0,BLACK_IS_ZERO:1,RGB:2,RGB_PALETTE:3,TRANSPARENCY_MASK:4,CMYK:5,Y_Cb_Cr:6,CIE_LAB:7},PlanarConfiguration:{CHUNKY:1,PLANAR:2},ResolutionUnit:{NONE:1,INCH:2,CENTIMETER:3},SampleFormat:{UNSIGNED:1,SIGNED:2,IEEE_FLOAT:3,UNDEFINED:4,DEFAULT:1},Type:{BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,SBYTE:6,UNDEFINED:7,SSHORT:8,SLONG:9,SRATIONAL:10,FLOAT:11,DOUBLE:12}}}),i("formats/geotiff/GeoTiffUtil",["../../error/ArgumentError","../../util/Logger","./TiffConstants"],function(t,e,
90i){"use strict";return{getBytes:function(i,r,n,o,s){if(n<=0)throw new t(e.logMessage(e.LEVEL_SEVERE,"GeoTiffReader","getBytes","noBytesRequested"));if(n<=1)return s?i.getInt8(r,o):i.getUint8(r,o);if(n<=2)return s?i.getInt16(r,o):i.getUint16(r,o);if(n<=3)return s?i.getInt32(r,o)>>>8:i.getUint32(r,o)>>>8;if(n<=4)return s?i.getInt32(r,o):i.getUint32(r,o);if(n<=8)return i.getFloat64(r,o);throw new t(e.logMessage(e.LEVEL_SEVERE,"GeoTiffReader","getBytes","tooManyBytesRequested"))},getSampleBytes:function(t,r,n,o,s){var a;switch(o){case i.SampleFormat.UNSIGNED:a=this.getBytes(t,r,n,s,!1);break;case i.SampleFormat.SIGNED:a=this.getBytes(t,r,n,s,!0);break;case i.SampleFormat.IEEE_FLOAT:3==n?a=t.getFloat32(r,s)>>>8:4==n?a=t.getFloat32(r,s):8==n?a=t.getFloat64(r,s):e.log(e.LEVEL_WARNING,"Do not attempt to parse the data not handled: "+n);break;case i.SampleFormat.UNDEFINED:default:a=this.getBytes(t,r,n,s,!1)}return a},getRGBAFillValue:function(t,e,i,r){return void 0===r&&(r=1),"rgba("+t+", "+e+", "+i+", "+r+")"},clampColorSample:function(t,e){var i=Math.pow(2,8-e);return Math.floor(t*i+(i-1))}}}),i("util/proj4-src",[],function(){"use strict";function t(t,e){if(t[e])return t[e];for(var i,r=Object.keys(t),n=e.toLowerCase().replace(Ge,""),o=-1;++o<r.length;)if(i=r[o],i.toLowerCase().replace(Ge,"")===n)return t[i]}function e(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=Be}function i(t){return new e(t).output()}function r(t,e,i){Array.isArray(e)&&(i.unshift(e),e=null);var r=e?{}:t,o=i.reduce(function(t,e){return n(e,t),t},r);e&&(t[e]=o)}function n(t,e){if(!Array.isArray(t))return void(e[t]=!0);var i=t.shift();if("PARAMETER"===i&&(i=t.shift()),1===t.length)return Array.isArray(t[0])?(e[i]={},void n(t[0],e[i])):void(e[i]=t[0]);if(!t.length)return void(e[i]=!0);if("TOWGS84"===i)return void(e[i]=t);Array.isArray(i)||(e[i]={});var o;switch(i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[i]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&n(t[2],e[i]));case"SPHEROID":case"ELLIPSOID":return e[i]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&n(t[3],e[i]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void r(e,i,t);default:for(o=-1;++o<t.length;)if(!Array.isArray(t[o]))return n(t,e[i]);return r(e,i,t)}}function o(t,e){var i=e[0],r=e[1];!(i in t)&&r in t&&(t[i]=t[r],3===e.length&&(t[i]=e[2](t[i])))}function s(t){return t*Ye}function a(t){function e(e){return e*(t.to_meter||1)}"GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var i=t.GEOGCS;"GEOGCS"===t.type&&(i=t),i&&(i.DATUM?t.datumCode=i.DATUM.name.toLowerCase():t.datumCode=i.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"===t.datumCode&&("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),i.DATUM&&i.DATUM.SPHEROID&&(t.ellps=i.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=i.DATUM.SPHEROID.a,t.rf=parseFloat(i.DATUM.SPHEROID.rf,10)),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36")),t.b&&!isFinite(t.b)&&(t.b
90=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",s],["longitude_of_center","Longitude_Of_Center"],["longc","longitude_of_center",s],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",s],["lat0","latitude_of_origin",s],["lat0","standard_parallel_1",s],["lat1","standard_parallel_1",s],["lat2","standard_parallel_2",s],["alpha","azimuth",s],["srsCode","name"]].forEach(function(e){return o(t,e)}),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=s(t.lat1>0?90:-90),t.lat_ts=t.lat1)}function l(t){var e=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?l[t]=We(arguments[1]):l[t]=He(arguments[1]):l[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?l.apply(e,t):l(t)});if("string"==typeof t){if(t in l)return l[t]}else"EPSG"in t?l["EPSG:"+t.EPSG]=t:"ESRI"in t?l["ESRI:"+t.ESRI]=t:"IAU2000"in t?l["IAU2000:"+t.IAU2000]=t:console.log(t);return}}function h(t){return"string"==typeof t}function u(t){return t in l}function c(t){return Xe.some(function(e){return t.indexOf(e)>-1})}function d(t){return"+"===t[0]}function f(t){return h(t)?u(t)?l[t]:c(t)?He(t):d(t)?We(t):void 0:t}function p(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Ze(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function g(t){var e=t.x,i=t.y 91;if(i*Ie>90&&i*Ie<-90&&e*Ie>180&&e*Ie<-180)return null;var r,n;if(Math.abs(Math.abs(i)-Me)<=Ne)return null;if(this.sphere)r=this.x0+this.a*this.k0*$e(e-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(De+.5*i));else{var o=Math.sin(i),s=ti(this.e,i,o);r=this.x0+this.a*this.k0*$e(e-this.long0),n=this.y0-this.a*this.k0*Math.log(s)}return t.x=r,t.y=n,t}function m(t){var e,i,r=t.x-this.x0,n=t.y-this.y0;if(this.sphere)i=Me-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var o=Math.exp(-n/(this.a*this.k0));if(-9999===(i=ei(this.e,o)))return null}return e=$e(this.long0+r/(this.a*this.k0)),t.x=e,t.y=i,t}function y(){}function E(t){return t}function v(t,e){var i=li.length;return t.names?(li[i]=t,t.names.forEach(function(t){ai[t.toLowerCase()]=i}),this):(console.log(e),!0)}function _(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==ai[e]&&li[ai[e]]?li[ai[e]]:void 0}function b(){si.forEach(v)}function S(t,e,i,r){var n=t*t,o=e*e,s=(n-o)/n,a=0;return r?(t*=1-s*(Ce+s*(Ae+s*Pe)),n=t*t,s=0):a=Math.sqrt(s),{es:s,e:a,ep2:(n-o)/o}}function w(e,i,r,n,o){if(!e){var s=t(ui,n);s||(s=ci),e=s.a,i=s.b,r=s.rf}return r&&!i&&(i=(1-1/r)*e),(0===r||Math.abs(e-i)<Ne)&&(o=!0,i=e),{a:e,b:i,rf:r,sphere:o}}function L(t,e,i,r,n,o){var s={};return s.datum_type=void 0===t||"none"===t?xe:Te,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=we),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=Le,s.datum_params[3]*=Re,s.datum_params[4]*=Re,s.datum_params[5]*=Re,s.datum_params[6]=s.datum_params[6]/1e6+1))),s.a=i,s.b=r,s.es=n,s.ep2=o,s}function T(e,i){if(!(this instanceof T))return new T(e);i=i||function(t){if(t)throw t};var r=f(e);if("object"!=typeof r)return void i(e);var n=T.projections.get(r.projName);if(!n)return void i(e);if(r.datumCode&&"none"!==r.datumCode){var o=t(di,r.datumCode);o&&(r.datum_params=o.towgs84?o.towgs84.split(","):null,r.ellps=o.ellipse,r.datumName=o.datumName?o.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84";var s=w(r.a,r.b,r.rf,r.ellps,r.sphere),a=S(s.a,s.b,s.rf,r.R_A),l=r.datum||L(r.datumCode,r.datum_params,s.a,s.b,a.es,a.ep2);Je(this,r),Je(this,n),this.a=s.a,this.b=s.b,this.rf=s.rf,this.sphere=s.sphere,this.es=a.es,this.e=a.e,this.ep2=a.ep2,this.datum=l,this.init(),i(null,this)}function x(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===we?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==Le||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))}function R(t,e,i){var r,n,o,s,a=t.x,l=t.y,h=t.z?t.z:0;if(l<-Me&&l>-1.001*Me)l=-Me;else if(l>Me&&l<1.001*Me)l=Me;else if(l<-Me||l>Me)return null;return a>Math.PI&&(a-=2*Math.PI),n=Math.sin(l),s=Math.cos(l),o=n*n,r=i/Math.sqrt(1-e*o),{x:(r+h)*s*Math.cos(a),y:(r+h)*s*Math.sin(a),z:(r*(1-e)+h)*n}}function M(t,e,i,r){var n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_=t.x,b=t.y,S=t.z?t.z:0;if(n=Math.sqrt(_*_+b*b),o=Math.sqrt(_*_+b*b+S*S),n/i<1e-12){if(y=0,o/i<1e-12)return E=Me,v=-r,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(b,_);s=S/o,a=n/o,l=1/Math.sqrt(1-e*(2-e)*a*a),c=a*(1-e)*l,d=s*l,m=0;do{m++,u=i/Math.sqrt(1-e*d*d),v=n*c+S*d-u*(1-e*d*d),h=e*u/(u+v),l=1/Math.sqrt(1-h*(2-h)*a*a),f=a*(1-h)*l,p=s*l,g=p*c-f*d,c=f,d=
91p}while(g*g>1e-24&&m<30);return E=Math.atan(p/Math.abs(f)),{x:y,y:E,z:v}}function C(t,e,i){if(e===we)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(e===Le){var r=i[0],n=i[1],o=i[2],s=i[3],a=i[4],l=i[5],h=i[6];return{x:h*(t.x-l*t.y+a*t.z)+r,y:h*(l*t.x+t.y-s*t.z)+n,z:h*(-a*t.x+s*t.y+t.z)+o}}}function A(t,e,i){if(e===we)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(e===Le){var r=i[0],n=i[1],o=i[2],s=i[3],a=i[4],l=i[5],h=i[6],u=(t.x-r)/h,c=(t.y-n)/h,d=(t.z-o)/h;return{x:u+l*c-a*d,y:-l*u+c+s*d,z:a*u-s*c+d}}}function P(t){return t===we||t===Le}function N(t,e){return(t.datum.datum_type===we||t.datum.datum_type===Le)&&"WGS84"!==e.datumCode||(e.datum.datum_type===we||e.datum.datum_type===Le)&&"WGS84"!==t.datumCode}function O(t,e,i){var r;return Array.isArray(i)&&(i=gi(i)),t.datum&&e.datum&&N(t,e)&&(r=new T("WGS84"),i=O(t,r,i),t=r),"enu"!==t.axis&&(i=pi(t,!1,i)),"longlat"===t.projName?i={x:i.x*Oe,y:i.y*Oe}:(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter}),i=t.inverse(i)),t.from_greenwich&&(i.x+=t.from_greenwich),i=fi(t.datum,e.datum,i),e.from_greenwich&&(i={x:i.x-e.from_greenwich,y:i.y}),"longlat"===e.projName?i={x:i.x*Ie,y:i.y*Ie}:(i=e.forward(i),e.to_meter&&(i={x:i.x/e.to_meter,y:i.y/e.to_meter})),"enu"!==e.axis?pi(e,!0,i):i}function I(t,e,i){var r;return Array.isArray(i)?(r=O(t,e,i),3===i.length?[r.x,r.y,r.z]:[r.x,r.y]):O(t,e,i)}function D(t){return t instanceof T?t:t.oProj?t.oProj:T(t)}function k(t,e,i){t=D(t);var r,n=!1;return void 0===e?(e=t,t=mi,n=!0):(void 0!==e.x||Array.isArray(e))&&(i=e,e=t,t=mi,n=!0),e=D(e),i?I(t,e,i):(r={forward:function(i){return I(t,e,i)},inverse:function(i){return I(e,t,i)}},n&&(r.oProj=e),r)}function V(t,e){return e=e||5,z(U({lat:t[1],lon:t[0]}),e)}function F(t){var e=K(X(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function G(t){var e=K(X(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function W(t){return t*(Math.PI/180)}function B(t){return t/Math.PI*180}function U(t){var e,i,r,n,o,s,a,l,h,u=t.lat,c=t.lon,d=6378137,f=W(u),p=W(c);h=Math.floor((c+180)/6)+1,180===c&&(h=60),u>=56&&u<64&&c>=3&&c<12&&(h=32),u>=72&&u<84&&(c>=0&&c<9?h=31:c>=9&&c<21?h=33:c>=21&&c<33?h=35:c>=33&&c<42&&(h=37)),e=6*(h-1)-180+3,l=W(e),i=.006739496752268451,r=d/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),n=Math.tan(f)*Math.tan(f),o=i*Math.cos(f)*Math.cos(f),s=Math.cos(f)*(p-l),a=d*(.9983242984503243*f-.002514607064228144*Math.sin(2*f)+2639046602129982e-21*Math.sin(4*f)-3.418046101696858e-9*Math.sin(6*f));var g=.9996*r*(s+(1-n+o)*s*s*s/6+(5-18*n+n*n+72*o-58*i)*s*s*s*s*s/120)+5e5,m=.9996*(a+r*Math.tan(f)*(s*s/2+(5-n+9*o+4*o*o)*s*s*s*s/24+(61-58*n+n*n+600*o-330*i)*s*s*s*s*s*s/720));return u<0&&(m+=1e7),{northing:Math.round(m),easting:Math.round(g),zoneNumber:h,zoneLetter:j(u)}}function K(t){var e=t.northing,i=t.easting,r=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var o,s,a,l,h,u,c,d,f,p,g=6378137,m=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=i-5e5,E=e;r<"N"&&(E-=1e7),d=6*(n-1)-180+3,o=.006739496752268451,c=E/.9996,f=c/6367449.145945056,p=f+(3*m/2-27*m*m*m/32)*Math.sin(2*f)+(21*m*m/16-55*m*m*m*m/32)*Math.sin(4*f)+151*m*m*m/96*Math.sin(6*f),s=g/Math.sqrt(1-.00669438*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),l=o*Math.cos(p)*Math.cos(p),h=.99330562*g/Math.pow(1-.00669438*Math.sin(p)*Math.sin(p),1.5),u=y/(.9996*s);var v=p-s*Math.tan(p)/h*(u*u/2-(5+3*a+10*l-4*l*l-9*o)*u*u*u*u/24+(61+90*a+298*l+45*a*a-252*o-3*l*l)*u*u*u*u*u*u/720);v=B(v);var _=(u-(1+2*a+l)*u*u*u/6+(5-2*l+28*a-3*l*l+8*o+24*a*a)*u*u*u*u*u/120)/Math.cos(p);_=d+B(_);var b;if(t.accuracy){var S=K({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});b={top:S.lat,right:S.lon,bottom:v,left:_}}else b={lat:v,lon:_};return b}function j(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function z(t,e){var i="00000"+t.easting,r="00000"+t.northing;return t.zoneNumber+t.zoneLetter+q(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,e)+r.substr(r.length-5,e)}function q(t,e,i){var r=Y(i);return H(Math.floor(t/1e5),Math.floor(e/1e5)%20,r)}function Y(t){var e=t%yi;return 0===e&&(e=yi),e}
vendor: 5,758 bytes, line 91
91function H(t,e,i){var r=i-1,n=Ei.charCodeAt(r),o=vi.charCodeAt(r),s=n+t-1,a=o+e,l=!1;return s>Li&&(s=s-Li+_i-1,l=!0),(s===bi||n<bi&&s>bi||(s>bi||n<bi)&&l)&&s++,(s===Si||n<Si&&s>Si||(s>Si||n<Si)&&l)&&++s===bi&&s++,s>Li&&(s=s-Li+_i-1),a>wi?(a=a-wi+_i-1,l=!0):l=!1,(a===bi||o<bi&&a>bi||(a>bi||o<bi)&&l)&&a++,(a===Si||o<Si&&a>Si||(a>Si||o<Si)&&l)&&++a===bi&&a++,a>wi&&(a=a-wi+_i-1),String.fromCharCode(s)+String.fromCharCode(a)}function X(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,i=t.length,r=null,n="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;n+=e,o++}var s=parseInt(n,10);if(0===o||o+3>i)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(o++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;r=t.substring(o,o+=2);for(var l=Y(s),h=J(r.charAt(0),l),u=Z(r.charAt(1),l);u<Q(a);)u+=2e6;var c=i-o;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var d,f,p,g,m,y=c/2,E=0,v=0;return y>0&&(d=1e5/Math.pow(10,y),f=t.substring(o,o+y),E=parseFloat(f)*d,p=t.substring(o+y),v=parseFloat(p)*d),g=E+h,m=v+u,{easting:g,northing:m,zoneLetter:a,zoneNumber:s,accuracy:d}}function J(t,e){for(var i=Ei.charCodeAt(e-1),r=1e5,n=!1;i!==t.charCodeAt(0);){if(i++,i===bi&&i++,i===Si&&i++,i>Li){if(n)throw"Bad character: "+t;i=_i,n=!0}r+=1e5}return r}function Z(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=vi.charCodeAt(e-1),r=0,n=!1;i!==t.charCodeAt(0);){if(i++,i===bi&&i++,i===Si&&i++,i>wi){if(n)throw"Bad character: "+t;i=_i,n=!0}r+=1e5}return r}function Q(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function $(t,e,i){if(!(this instanceof $))return new $(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var r=t.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}function tt(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Ri(this.es),this.ml0=Mi(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function et(t){var e,i,r,n=t.x,o=t.y,s=$e(n-this.long0),a=Math.sin(o),l=Math.cos(o);if(this.es){var h=l*s,u=Math.pow(h,2),c=this.ep2*Math.pow(l,2),d=Math.pow(c,2),f=Math.abs(l)>Ne?Math.tan(o):0,p=Math.pow(f,2),g=Math.pow(p,2);e=1-this.es*Math.pow(a,2),h/=Math.sqrt(e);var m=Mi(o,a,l,this.en);i=this.a*(this.k0*h*(1+u/6*(1-p+c+u/20*(5-18*p+g+14*c-58*p*c+u/42*(61+179*g-g*p-479*p)))))+this.x0,r=this.a*(this.k0*(m-this.ml0+a*s*h/2*(1+u/12*(5-p+9*c+4*d+u/30*(61+g-58*p+270*c-330*p*c+u/56*(1385+543*g-g*p-3111*p))))))+this.y0}else{var y=l*Math.sin(s);if(Math.abs(Math.abs(y)-1)<Ne)return 93;if(i=.5*this.a*this.k0*Math.log((1+y)/(1-y))+this.x0,r=l*Math.cos(s)/Math.sqrt(1-Math.pow(y,2)),(y=Math.abs(r))>=1){if(y-1>Ne)return 93;r=0}else r=Math.acos(r);o<0&&(r=-r),r=this.a*this.k0*(r-this.lat0)+this.y0}return t.x=i,t.y=r,t}function it(t){var e,i,r,n,o=(t.x-this.x0)*(1/this.a),s=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+s/this.k0,i=Ci(e,this.es,this.en),Math.abs(i)<Me){var a=Math.sin(i),l=Math.cos(i),h=Math.abs(l)>Ne?Math.tan(i):0,u=this.ep2*Math.pow(l,2),c=Math.pow(u,2),d=Math.pow(h,2),f=Math.pow(d,2);e=1-this.es*Math.pow(a,2);var p=o*Math.sqrt(e)/this.k0,g=Math.pow(p,2);e*=h,r=i-e*g/(1-this.es)*.5*(1-g/12*(5+3*d-9*u*d+u-4*c-g/30*(61+90*d-252*u*d+45*f+46*u-g/56*(1385+3633*d+4095*f+1574*f*d)))),n=$e(this.long0+p*(1-g/6*(1+2*d+u-g/20*(5+28*d+24*f+8*u*d+6*u-g/42*(61+662*d+1320*f+720*f*d))))/l)}else r=Me*Qe(s),n=0;else{var m=Math.exp(o/this.k0),y=.5*(m-1/m),E=this.lat0+s/this.k0,v=Math.cos(E);e=Math.sqrt((1-Math.pow(v,2))/(1+Math.pow(y,2))),r=Math.asin(e),s<0&&(r=-r),n=0===y&&0===v?0:$e(Math.atan2(y,v)+this.long0)}return t.x=n,t.y=r,t}function rt(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),i*=e,this.cgb[1]=i*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),i*=e,this.cgb[2]=i*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),i*=e,this.cgb[3]=i*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(e*(-24832/14175)-2.4)),i*=e,this.cgb[4]=i*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),i*=e,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(.25+i*(1/64+i/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5
91/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),i*=e,this.utg[2]=i*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),i*=e,this.utg[3]=i*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),i*=e,this.utg[4]=i*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),i*=e,this.utg[5]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var r=ki(this.cbg,this.lat0);this.Zb=-this.Qn*(r+Vi(this.gtu,2*r))}function nt(t){var e=$e(t.x-this.long0),i=t.y;i=ki(this.cbg,i);var r=Math.sin(i),n=Math.cos(i),o=Math.sin(e),s=Math.cos(e);i=Math.atan2(r,s*n),e=Math.atan2(o*n,Oi(r,n*s)),e=Di(Math.tan(e));var a=Gi(this.gtu,2*i,2*e);i+=a[0],e+=a[1];var l,h;return Math.abs(e)<=2.623395162778?(l=this.a*(this.Qn*e)+this.x0,h=this.a*(this.Qn*i+this.Zb)+this.y0):(l=1/0,h=1/0),t.x=l,t.y=h,t}function ot(t){var e=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);i=(i-this.Zb)/this.Qn,e/=this.Qn;var r,n;if(Math.abs(e)<=2.623395162778){var o=Gi(this.utg,2*i,2*e);i+=o[0],e+=o[1],e=Math.atan(Ni(e));var s=Math.sin(i),a=Math.cos(i),l=Math.sin(e),h=Math.cos(e);i=Math.atan2(s*h,Oi(l,h*a)),e=Math.atan2(l,h*a),r=$e(e+this.long0),n=ki(this.cgb,i)}else r=1/0,n=1/0;return t.x=r,t.y=n,t}function st(){var t=Ui(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Oe,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Bi.init.apply(this),this.forward=Bi.forward,this.inverse=Bi.inverse}function at(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+De)/(Math.pow(Math.tan(.5*this.lat0+De),this.C)*zi(this.e*t,this.ratexp))}function lt(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+De),this.C)*zi(this.e*Math.sin(i),this.ratexp))-Me,t.x=this.C*e,t}function ht(t){for(var e=t.x/this.C,i=t.y,r=Math.pow(Math.tan(.5*i+De)/this.K,1/this.C),n=qi;n>0&&(i=2*Math.atan(r*zi(this.e*Math.sin(t.y),-.5*this.e))-Me,!(Math.abs(i-t.y)<1e-14));--n)t.y=i;return n?(t.x=e,t.y=i,t):null}function ut(){Hi.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function ct(t){var e,i,r,n;return t.x=$e(t.x-this.long0),Hi.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),r=Math.cos(t.x),n=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*r),t.x=n*i*Math.sin(t.x),t.y=n*(this.cosc0*e-this.sinc0*i*r),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function dt(t){var e,i,r,n,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=Math.sqrt(t.x*t.x+t.y*t.y)){var s=2*Math.atan2(o,this.R2);e=Math.sin(s),i=Math.cos(s),n=Math.asin(i*this.sinc0+t.y*e*this.cosc0/o),r=Math.atan2(t.x*e,o*this.cosc0*i-t.y*this.sinc0*e)}else n=this.phic0,r=0;return t.x=r,t.y=n,Hi.inverse.apply(this,[t]),t.x=$e(t.x+this.long0),t}function ft(t,e,i){return e*=i,Math.tan(.5*(Me+t))*Math.pow((1-e)/(1+e),.5*i)}function pt(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Ne&&(this.k0=.5*(1+Qe(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Ne&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Ne&&(this.k0=.5*this.cons*Ze(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/ti(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ze(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Me,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function gt(t){var e,i,r,n,o,s,a=t.x,l=t.y,h=Math.sin(l),u=Math.cos(l),c=$e(a-this.long0);return Math.abs(Math.abs(a-this.long0)-Math.PI)<=Ne&&Math.abs(l+this.lat0)<=Ne?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*h+this.coslat0*u*Math.cos(c)),t.x=this.a*e*u*Math.sin(c)+this.x0,t.y=this.a*e*(this.coslat0*h-this.sinlat0*u*Math.cos(c))+this.y0,t):(i=2*Math.atan(this.ssfn_(l,h,this.e))-Me,n=Math.cos(i),r=Math.sin(i),Math.abs(this.coslat0)<=Ne?(o=ti(this.e,l*this.con,this.con*h),s=2*this.a*this.k0*o/this.cons,t.x=this.x0+s*Math.sin(a-this.long0),t.y=this.y0-this.con*s*Math.cos(a-this.long0),t):(Math.abs(this.sinlat0)<Ne?(e=2*this.a*this.k0/(1+n*Math.cos(c)),t.y=e*r):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*r+this.cosX0*n*Math.cos(c))),t.y=e*(this.cosX0*r-this.sinX0*n*Math.cos(c))+this.y0),t.x=e*n*Math.sin(c)+this.x0,t))}function mt(t){t.x-=this.x0,t.y-=this.y0;var e,i,r,n,o,s=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var a=2*Math.atan(s/(.5*this.a*this.k0));return e=this.long0,(i=this.lat0,s<=Ne)?(t.x=e,t.y=i,t):(i=Math.asin(Math.cos(a)*this.sinlat0+t.y*Math.sin(a)*this.coslat0/s),e=$e(Math.abs(this.coslat0)<Ne?this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y):this.long0+Math.atan2(t.x*Math.sin(a),s*this.coslat0*Math.cos(a)-t.y*this.sinlat0*Math.sin(a))),t.x=e,t.y=i,t)}if(Math.abs(this.coslat0)<=Ne){if(s<=Ne)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,r=s*this.cons/(2*this.a*this.k0),i=this.con*ei(this.e,r),e=this.con*$e(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else n=2*Math.atan(s*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,s<=Ne?o=this.X0:(o=Math.asin(Math.cos(n)*this.sinX0+t.y*Math.sin(n)*this.cosX0/s),e=$e(this.long0+Math.atan2(t.x*Math.sin(n),s*this.cosX0*Math.cos(n)-t.y*this.sinX0*Math.sin(n)))),i=-1*ei(this.e,Math.tan(.5*(Me+o)));return t.x=e,t.y=i,t}function yt(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,r=this.rf,n=1/r,o=2*n-Math.pow(n,2),s=this.e=Math.sqrt(o);this.R=this.k0*i*Math.sqrt(1-o)/(1-o*Math.pow(e,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+t/2)),h=Math.log((1+s*e)/(1-s*e));this.K=a-this.alpha*l+this.alpha*s/2*h}function Et(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),r=-this.alpha*(e+i)+this.K,n=2*(Math.atan(Math.exp(r))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),s=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(n)+Math.cos(this.b0)*Math.cos(o))),a=Math.asin(Math.cos(this.b0)*Math.sin(n)-Math.sin(this.b0)*Math.cos(n)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,t.x=this.R*s+this.x0,t}function vt(t){for(var e=t.x-this.x0,i=t.y-this.y0,r=e/this.R,n=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(n)+Math.sin(this.b0)*Math.cos(n)*Math.cos(r)),s=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(n))),a=this.lambda0+s/this.alpha,l=0,h=o,u=-1e3,c=0;Math.abs(h-u)>1e-7;){if(++c>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),u=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=a,t.y=h,t}function _t(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),i=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-i*i);var r=ti(this.e,this.lat0,t),n=this.bl/e*Math.sqrt((1-this.es)/(1-i*i));n*n<1&&(n=1);var o,s;if(isNaN(this.longc)){var a=ti(this.e,this.lat1,Math.sin(this.lat1)),l=ti(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(n+Math.sqrt(n*n-1))*Math.pow(r,this.bl):this.el=(n-Math.sqrt(n*n-1))*Math.pow(r,this.bl);var h=Math.pow(a,this.bl),u=Math.pow(l,this.bl);o=this.el/h,s=.5*(o-1/o);var c=(this.el*this.el-u*h)/(this.el*this.el+u*h),d=(u-h)/(u+h),f=$e(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(c*Math.tan(.5*this.bl*f)/d)/this.bl,this.long0=$e(this.long0);var p=$e(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*p)/s),this.alpha=Math.asin(n*Math.sin(this.gamma0))}else o=this.lat0>=0?n+Math.sqrt(n*n-1):n-Math.sqrt(n*n-1),this.el=o*Math.pow(r,this.bl),s=.5*(o-1/o),this.gamma0=Math.asin(Math.sin(this.alpha)/n),this.long0=this.longc-Math.asin(s*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(n*n-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(n*n-1),Math.cos(this.alpha))}function bt(t){var e,i,r,n=t.x,o=t.y,s=$e(n-this.long0);if(Math.abs(Math.abs(o)-Me)<=Ne)r=o>0?-1:1,i=this.al/this.bl*Math.log(Math.tan(De+r*this.gamma0*.5)),e=-1*r*Me*this.al/this.bl;else{var a=ti(this.e,o,Math.sin(o)),l=this.el/Math.pow(a,this.bl),h=.5*(l-1/l),u=.5*(l+1/l),c=Math.sin(this.bl*s),d=(h*Math.sin(this.gamma0)-c*Math.cos(this.gamma0))/u;i=Math.abs(Math.abs(d)-1)<=Ne?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-d)/(1+d))/this.bl,e=Math.abs(Math.cos(this.bl*s))<=Ne?this.al*this.bl*s:this.al*Math.atan2(h*Math.cos(this.gamma0)+c*Math.sin(this.gamma0),Math.cos(this.bl*s))/this.bl}
91return this.no_rot?(t.x=this.x0+e,t.y=this.y0+i):(e-=this.uc,t.x=this.x0+i*Math.cos(this.alpha)+e*Math.sin(this.alpha),t.y=this.y0+e*Math.cos(this.alpha)-i*Math.sin(this.alpha)),t}function St(t){var e,i;this.no_rot?(i=t.y-this.y0,e=t.x-this.x0):(i=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),e+=this.uc);var r=Math.exp(-1*this.bl*i/this.al),n=.5*(r-1/r),o=.5*(r+1/r),s=Math.sin(this.bl*e/this.al),a=(s*Math.cos(this.gamma0)+n*Math.sin(this.gamma0))/o,l=Math.pow(this.el/Math.sqrt((1+a)/(1-a)),1/this.bl);return Math.abs(a-1)<Ne?(t.x=this.long0,t.y=Me):Math.abs(a+1)<Ne?(t.x=this.long0,t.y=-1*Me):(t.y=ei(this.e,l),t.x=$e(this.long0-Math.atan2(n*Math.cos(this.gamma0)-s*Math.sin(this.gamma0),Math.cos(this.bl*e/this.al))/this.bl)),t}function wt(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Ne)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),r=Ze(this.e,e,i),n=ti(this.e,this.lat1,e),o=Math.sin(this.lat2),s=Math.cos(this.lat2),a=Ze(this.e,o,s),l=ti(this.e,this.lat2,o),h=ti(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Ne?this.ns=Math.log(r/a)/Math.log(n/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=r/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function Lt(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=Ne&&(i=Qe(i)*(Me-2*Ne));var r,n,o=Math.abs(Math.abs(i)-Me);if(o>Ne)r=ti(this.e,i,Math.sin(i)),n=this.a*this.f0*Math.pow(r,this.ns);else{if((o=i*this.ns)<=0)return null;n=0}var s=this.ns*$e(e-this.long0);return t.x=this.k0*(n*Math.sin(s))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(s))+this.y0,t}function Tt(t){var e,i,r,n,o,s=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+a*a),i=1):(e=-Math.sqrt(s*s+a*a),i=-1);var l=0;if(0!==e&&(l=Math.atan2(i*s,i*a)),0!==e||this.ns>0){if(i=1/this.ns,r=Math.pow(e/(this.a*this.f0),i),-9999===(n=ei(this.e,r)))return null}else n=-Me;return o=$e(l/this.ns+this.long0),t.x=o,t.y=n,t}function xt(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function Rt(t){var e,i,r,n,o,s,a,l=t.x,h=t.y,u=$e(l-this.long0);return e=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/e)-this.s45),r=-u*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),o=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(n)),s=this.n*o,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=a*Math.cos(s)/1,t.x=a*Math.sin(s)/1,this.czech||(t.y*=-1,t.x*=-1),t}function Mt(t){var e,i,r,n,o,s,a,l,h=t.x;t.x=t.y,t.y=h,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),o=Math.atan2(t.y,t.x),n=o/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(e)),t.x=this.long0-i/this.alfa,a=e,l=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(l=1),a=t.y,u+=1}while(0===l&&u<15);return u>=15?null:t}function Ct(){this.sphere||(this.e0=lr(this.es),this.e1=hr(this.es),this.e2=ur(this.es),this.e3=cr(this.es),this.ml0=this.a*ar(this.e0,this.e1,this.e2,this.e3,this.lat0))}function At(t){var e,i,r=t.x,n=t.y;if(r=$e(r-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(n)*Math.sin(r)),i=this.a*(Math.atan2(Math.tan(n),Math.cos(r))-this.lat0);else{var o=Math.sin(n),s=Math.cos(n),a=dr(this.a,this.e,o),l=Math.tan(n)*Math.tan(n),h=r*Math.cos(n),u=h*h,c=this.es*s*s/(1-this.es),d=this.a*ar(this.e0,this.e1,this.e2,this.e3,n);e=a*h*(1-u*l*(1/6-(8-l+8*c)*u/120)),i=d-this.ml0+a*o/s*u*(.5+(5-l+6*c)*u/24)}return t.x=e+this.x0,t.y=i+this.y0,t}function Pt(t){t.x-=this.x0,t.y-=this.y0;var e,i,r=t.x/this.a,n=t.y/this.a;if(this.sphere){var o=n+this.lat0;e=Math.asin(Math.sin(o)*Math.cos(r)),i=Math.atan2(Math.tan(r),Math.cos(o))}else{var s=this.ml0/this.a+n,a=pr(s,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-Me)<=Ne)return t.x=this.long0,t.y=Me,n<0&&(t.y*=-1),t;var l=dr(this.a,this.e,Math.sin(a)),h=l*l*l/this.a/this.a*(1-this.es),u=Math.pow(Math.tan(a),2),c=r*this.a/l,d=c*c;e=a-l*Math.tan(a)/h*c*c*(.5-(1+3*u)*c*c/24),i=c*(1-d*(u/3+(1+3*u)*u*d/15))/Math.cos(a)}return t.x=$e(i+this.long0),t.y=fr(e),t}function Nt(){var t=Math.abs(this.lat0);if(Math.abs(t-Me)<Ne?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<Ne?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var e;switch(this.qp=yr(this.e,1),this.mmf=.5/(1-this.es),this.apa=Dt(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf
vendor: 8,202 bytes, lines 91-92
91=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=yr(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function Ot(t){var e,i,r,n,o,s,a,l,h,u,c=t.x,d=t.y;if(c=$e(c-this.long0),this.sphere){if(o=Math.sin(d),u=Math.cos(d),r=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+u*r:1+this.sinph0*o+this.cosph0*u*r)<=Ne)return null;i=Math.sqrt(2/i),e=i*u*Math.sin(c),i*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*u*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(d+this.phi0)<Ne)return null;i=De-.5*d,i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)),e=i*Math.sin(c),i*=r}}else{switch(a=0,l=0,h=0,r=Math.cos(c),n=Math.sin(c),o=Math.sin(d),s=yr(this.e,o),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(a=s/this.qp,l=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:h=1+this.sinb1*a+this.cosb1*l*r;break;case this.EQUIT:h=1+l*r;break;case this.N_POLE:h=Me+d,s=this.qp-s;break;case this.S_POLE:h=d-Me,s=this.qp+s}if(Math.abs(h)<Ne)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),i=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*a-this.sinb1*l*r):(h=Math.sqrt(2/(1+l*r)))*a*this.ymf,e=this.xmf*h*l*n;break;case this.N_POLE:case this.S_POLE:s>=0?(e=(h=Math.sqrt(s))*n,i=r*(this.mode===this.S_POLE?h:-h)):e=i=0}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t}function It(t){t.x-=this.x0,t.y-=this.y0;var e,i,r,n,o,s,a,l=t.x/this.a,h=t.y/this.a;if(this.sphere){var u,c=0,d=0;if(u=Math.sqrt(l*l+h*h),(i=.5*u)>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(d=Math.sin(i),c=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(u)<=Ne?0:Math.asin(h*d/u),l*=d,h=c*u;break;case this.OBLIQ:i=Math.abs(u)<=Ne?this.phi0:Math.asin(c*this.sinph0+h*d*this.cosph0/u),l*=d*this.cosph0,h=(c-Math.sin(i)*this.sinph0)*u;break;case this.N_POLE:h=-h,i=Me-i;break;case this.S_POLE:i-=Me}e=0!==h||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,h):0}else{if(a=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,h*=this.dd,(s=Math.sqrt(l*l+h*h))<Ne)return t.x=0,t.y=this.phi0,t;n=2*Math.asin(.5*s/this.rq),r=Math.cos(n),l*=n=Math.sin(n),this.mode===this.OBLIQ?(a=r*this.sinb1+h*n*this.cosb1/s,o=this.qp*a,h=s*this.cosb1*r-h*this.sinb1*n):(a=h*n/s,o=this.qp*a,h=s*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),!(o=l*l+h*h))return t.x=0,t.y=this.phi0,t;a=1-o/this.qp,this.mode===this.S_POLE&&(a=-a)} 92e=Math.atan2(l,h),i=kt(Math.asin(a),this.apa)}return t.x=$e(this.long0+e),t.y=i,t}function Dt(t){var e,i=[];return i[0]=t*Er,e=t*t,i[0]+=e*vr,i[1]=e*br,e*=t,i[0]+=e*_r,i[1]+=e*Sr,i[2]=e*wr,i}function kt(t,e){var i=t+t;return t+e[0]*Math.sin(i)+e[1]*Math.sin(i+i)+e[2]*Math.sin(i+i+i)}function Vt(){Math.abs(this.lat1+this.lat2)<Ne||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Ze(this.e3,this.sin_po,this.cos_po),this.qs1=yr(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Ze(this.e3,this.sin_po,this.cos_po),this.qs2=yr(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=yr(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>Ne?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Ft(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var r=yr(this.e3,this.sin_phi,this.cos_phi),n=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,o=this.ns0*$e(e-this.long0),s=n*Math.sin(o)+this.x0,a=this.rh-n*Math.cos(o)+this.y0;return t.x=s,t.y=a,t}function Gt(t){var e,i,r,n,o,s;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),n=0,0!==e&&(n=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,this.sphere?s=Math.asin((this.c-r*r)/(2*this.ns0)):(i=(this.c-r*r)/this.ns0,s=this.phi1z(this.e3,i)),o=$e(n/this.ns0+this.long0),t.x=o,t.y=s,t}function Wt(t,e){var i,r,n,o,s,a=xr(.5*e);if(t<Ne)return a;for(var l=t*t,h=1;h<=25;h++)if(i=Math.sin(a),r=Math.cos(a),n=t*i,o=1-n*n,s=.5*o*o/r*(e/(1-l)-i/o+.5/t*Math.log((1-n)/(1+n))),a+=s,Math.abs(s)<=1e-7)return a;return null}function Bt(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function Ut(t){var e,i,r,n,o,s,a,l,h=t.x,u=t.y;return r=$e(h-this.long0),e=Math.sin(u),i=Math.cos(u),n=Math.cos(r),s=this.sin_p14*e+this.cos_p14*i*n,o=1,s>0||Math.abs(s)<=Ne?(a=this.x0+this.a*o*i*Math.sin(r)/s,l=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*i*n)/s):(a=this.x0+this.infinity_dist*i*Math.sin(r),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*n)),t.x=a,t.y=l,t}function Kt(t){var e,i,r,n,o,s;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),i=Math.sin(n),r=Math.cos(n),s=xr(r*this.sin_p14+t.y*i*this.cos_p14/e),o=Math.atan2(t.x*i,e*this.cos_p14*r-t.y*this.sin_p14*i),o=$e(this.long0+o)):(s=this.phic0,o=0),t.x=o,t.y=s,t}function jt(){this.sphere||(this.k0=Ze(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function zt(t){var e,i,r=t.x,n=t.y,o=$e(r-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var s=yr(this.e,Math.sin(n));e=this.x0+this.a*this.k0*o,i=this.y0+this.a*s*.5/this.k0}return t.x=e,t.y=i,t}function qt(t){t.x-=this.x0,t.y-=this.y0;var e,i;return this.sphere?(e=$e(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=Pr(this.e,2*t.y*this.k0/this.a),e=$e(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=i,t}function Yt(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function Ht(t){var e=t.x,i=t.y,r=$e(e-this.long0),n=fr(i-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*n,t}function Xt(t){var e=t.x,i=t.y;return t.x=$e(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=fr(this.lat0+(i-this.y0)/this.a),t}function Jt(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=lr(this.es),this.e1=hr(this.es),this.e2=ur(this.es),this.e3=cr(this.es),this.ml0=this.a*ar(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Zt(t){var e,i,r,n=t.x,o=t.y,s=$e(n-this.long0);if(r=s*Math.sin(o),this.sphere)Math.abs(o)<=Ne?(e=this.a*s,i=-1*this.a*this.lat0):(e=this.a*Math.sin(r)/Math.tan(o),i=this.a*(fr(o-this.lat0)+(1-Math.cos(r))/Math.tan(o)));else if(Math.abs(o)<=Ne)e=this.a*s,i=-1*this.ml0;else{var a=dr(this.a,this.e,Math.sin(o))/Math.tan(o);e=a*Math.sin(r),i=this.a*ar(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+a*(1-Math.cos(r))}return t.x=e+this.x0,t.y=i+this.y0,t}function Qt(t){var e,i,r,n,o,s,a,l,h;if(r=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=Ne)e=$e(r/this.a+this.long0),i=0;else{s=this.lat0+n/this.a,a=r*r/this.a/this.a+s*s,l=s;var u;for(o=kr;o;--o)if(u=Math.tan(l),h=-1*(s*(l*u+1)-l-.5*(l*l+a)*u)/((l-s)/u-1),l+=h,Math.abs(h)<=Ne){i=l;break}e=$e(this.long0+Math.asin(r*Math.tan(l)/this.a)/Math.sin(i))}else if(Math.abs(n+this.ml0)<=Ne)i=0,e=$e(this.long0+r/this.a);else{s=(this.ml0+n)/this.a,a=r*r/this.a/this.a+s*s,l=s;var c,d,f,p,g;for(o=kr;o;--o)if(g=this.e*Math.sin(l),c=Math.sqrt(1-g*g)*Math.tan(l),d=this.a*ar(this.e0,this.e1,this.e2,this.e3,l),f=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),p=d/this.a,h=(s*(c*p+1)-p-.5*c*(p*p+a))
vendor: 6,188 bytes, line 92
92/(this.es*Math.sin(2*l)*(p*p+a-2*s*p)/(4*c)+(s-p)*(c*f-2/Math.sin(2*l))-f),l-=h,Math.abs(h)<=Ne){i=l;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=$e(this.long0+Math.asin(r*c/this.a)/Math.sin(i))}return t.x=e,t.y=i,t}function $t(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function te(t){var e,i=t.x,r=t.y,n=r-this.lat0,o=i-this.long0,s=n/Re*1e-5,a=o,l=1,h=0;for(e=1;e<=10;e++)l*=s,h+=this.A[e]*l;var u,c,d=h,f=a,p=1,g=0,m=0,y=0;for(e=1;e<=6;e++)u=p*d-g*f,c=g*d+p*f,p=u,g=c,m=m+this.B_re[e]*p-this.B_im[e]*g,y=y+this.B_im[e]*p+this.B_re[e]*g;return t.x=y*this.a+this.x0,t.y=m*this.a+this.y0,t}function ee(t){var e,i,r,n=t.x,o=t.y,s=n-this.x0,a=o-this.y0,l=a/this.a,h=s/this.a,u=1,c=0,d=0,f=0;for(e=1;e<=6;e++)i=u*l-c*h,r=c*l+u*h,u=i,c=r,d=d+this.C_re[e]*u-this.C_im[e]*c,f=f+this.C_im[e]*u+this.C_re[e]*c;for(var p=0;p<this.iterations;p++){var g,m,y=d,E=f,v=l,_=h;for(e=2;e<=6;e++)g=y*d-E*f,m=E*d+y*f,y=g,E=m,v+=(e-1)*(this.B_re[e]*y-this.B_im[e]*E),_+=(e-1)*(this.B_im[e]*y+this.B_re[e]*E);y=1,E=0;var b=this.B_re[1],S=this.B_im[1];for(e=2;e<=6;e++)g=y*d-E*f,m=E*d+y*f,y=g,E=m,b+=e*(this.B_re[e]*y-this.B_im[e]*E),S+=e*(this.B_im[e]*y+this.B_re[e]*E);var w=b*b+S*S;d=(v*b+_*S)/w,f=(_*b-v*S)/w}var L=d,T=f,x=1,R=0;for(e=1;e<=9;e++)x*=L,R+=this.D[e]*x;var M=this.lat0+R*Re*1e5,C=this.long0+T;return t.x=C,t.y=M,t}function ie(){}function re(t){var e=t.x,i=t.y,r=$e(e-this.long0),n=this.x0+this.a*r,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=n,t.y=o,t}function ne(t){t.x-=this.x0,t.y-=this.y0;var e=$e(this.long0+t.x/this.a),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=i,t}function oe(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Ri(this.es)}function se(t){var e,i,r=t.x,n=t.y;if(r=$e(r-this.long0),this.sphere){if(this.m)for(var o=this.n*Math.sin(n),s=Kr;s;--s){var a=(this.m*n+Math.sin(n)-o)/(this.m+Math.cos(n));if(n-=a,Math.abs(a)<Ne)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;e=this.a*this.C_x*r*(this.m+Math.cos(n)),i=this.a*this.C_y*n}else{var l=Math.sin(n),h=Math.cos(n);i=this.a*Mi(n,l,h,this.en),e=this.a*r*h/Math.sqrt(1-this.es*l*l)}return t.x=e,t.y=i,t}function ae(t){var e,i,r,n;return t.x-=this.x0,r=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,r/=this.C_x*(this.m+Math.cos(e)),this.m?e=xr((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=xr(Math.sin(e)/this.n)),r=$e(r+this.long0),e=fr(e)):(e=Ci(t.y/this.a,this.es,this.en),n=Math.abs(e),n<Me?(n=Math.sin(e),i=this.long0+t.x*Math.sqrt(1-this.es*n*n)/(this.a*Math.cos(e)),r=$e(i)):n-Ne<Me&&(r=this.long0)),t.x=r,t.y=e,t}function le(){}function he(t){for(var e=t.x,i=t.y,r=$e(e-this.long0),n=i,o=Math.PI*Math.sin(i),s=0;!0;s++){var a=-(n+Math.sin(n)-o)/(1+Math.cos(n));if(n+=a,Math.abs(a)<Ne)break}n/=2,Math.PI/2-Math.abs(i)<Ne&&(r=0);var l=.900316316158*this.a*r*Math.cos(n)+this.x0,h=1.4142135623731*this.a*Math.sin(n)+this.y0;return t.x=l,t.y=h,t}function ue(t){var e,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),e=Math.asin(i);var r=$e(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var n=Math.asin(i);return t.x=r,t.y=n,t}function ce(){Math.abs(this.lat1+this.lat2)<Ne||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=lr(this.es),this.e1=hr(this.es),this.e2=ur(this.es),this.e3=cr(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Ze(this.e,this.sinphi,this.cosphi),this.ml1=ar(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Ne?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Ze(this.e,this.sinphi,this.cosphi),this.ml2=ar(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=ar(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function de(t){var e,i=t.x,r=t.y;if(this.sphere)e=this.a*(this.g-r);else{var n=ar(this.e0,this.e1,this.e2,this.e3,r);e=this.a*(this.g-n)}var o=this.ns*$e(i-this.long0),s=this.x0+e*Math.sin(o),a=this.y0+this.rh-e*Math.cos(o);return t.x=s,t.y=a,t}function fe(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,i,r,n;this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;if(0!==i&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere)return n=$e(this.long0+o/this.ns),r=fr(this.g-i/this.a),t.x=n,t.y=r,t;var s=this.g-i/this.a;return r=pr(s,this.e0,this.e1,this.e2,this.e3),n=$e(this.long0+o/this.ns),t.x=n,t.y=r,t}function pe(){this.R=this.a}function ge(t){var e,i,r=t.x,n=t.y,o=$e(r-this.long0);Math.abs(n)<=Ne&&(e=this.x0+this.R*o,i=this.y0);var s=xr(2*Math.abs(n/Math.PI));(Math.abs(o)<=Ne||Math.abs(Math.abs(n)-Me)<=Ne)&&(e=this.x0,i=n>=0?this.y0+Math.PI*this.R*Math.tan(.5*s):this.y0+Math.PI*this.R*-Math.tan(.5*s));var a=.5*Math.abs(Math.PI/o-o/Math.PI),l=a*a,h=Math.sin(s),u=Math.cos(s),c=u/(h+u-1),d=c*c,f=c*(2/h-1),p=f*f,g=Math.PI*this.R*(a*(c-p)+Math.sqrt(l*(c-p)*(c-p)-(p+l)*(d-p)))/(
92p+l);o<0&&(g=-g),e=this.x0+g;var m=l+c;return g=Math.PI*this.R*(f*m-a*Math.sqrt((p+l)*(l+1)-m*m))/(p+l),i=n>=0?this.y0+g:this.y0-g,t.x=e,t.y=i,t}function me(t){var e,i,r,n,o,s,a,l,h,u,c,d,f;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,r=t.x/c,n=t.y/c,o=r*r+n*n,s=-Math.abs(n)*(1+o),a=s-2*n*n+r*r,l=-2*s+1+2*n*n+o*o,f=n*n/l+(2*a*a*a/l/l/l-9*s*a/l/l)/27,h=(s-a*a/3/l)/l,u=2*Math.sqrt(-h/3),c=3*f/h/u,Math.abs(c)>1&&(c=c>=0?1:-1),d=Math.acos(c)/3,i=t.y>=0?(-u*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI:-(-u*Math.cos(d+Math.PI/3)-a/3/l)*Math.PI,e=Math.abs(r)<Ne?this.long0:$e(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(r*r-n*n)+o*o))/2/r),t.x=e,t.y=i,t}function ye(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function Ee(t){var e,i,r,n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_,b,S,w,L=t.x,T=t.y,x=Math.sin(t.y),R=Math.cos(t.y),M=$e(L-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=Ne?(t.x=this.x0+this.a*(Me-T)*Math.sin(M),t.y=this.y0-this.a*(Me-T)*Math.cos(M),t):Math.abs(this.sin_p12+1)<=Ne?(t.x=this.x0+this.a*(Me+T)*Math.sin(M),t.y=this.y0+this.a*(Me+T)*Math.cos(M),t):(E=this.sin_p12*x+this.cos_p12*R*Math.cos(M),m=Math.acos(E),y=m/Math.sin(m),t.x=this.x0+this.a*y*R*Math.sin(M),t.y=this.y0+this.a*y*(this.cos_p12*x-this.sin_p12*R*Math.cos(M)),t):(e=lr(this.es),i=hr(this.es),r=ur(this.es),n=cr(this.es),Math.abs(this.sin_p12-1)<=Ne?(o=this.a*ar(e,i,r,n,Me),s=this.a*ar(e,i,r,n,T),t.x=this.x0+(o-s)*Math.sin(M),t.y=this.y0-(o-s)*Math.cos(M),t):Math.abs(this.sin_p12+1)<=Ne?(o=this.a*ar(e,i,r,n,Me),s=this.a*ar(e,i,r,n,T),t.x=this.x0+(o+s)*Math.sin(M),t.y=this.y0+(o+s)*Math.cos(M),t):(a=x/R,l=dr(this.a,this.e,this.sin_p12),h=dr(this.a,this.e,x),u=Math.atan((1-this.es)*a+this.es*l*this.sin_p12/(h*R)),c=Math.atan2(Math.sin(M),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(M)),v=0===c?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(c)-Math.PI)<=Ne?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(M)*Math.cos(u)/Math.sin(c)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),f=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es),p=d*f,g=f*f,_=v*v,b=_*v,S=b*v,w=S*v,m=l*v*(1-_*g*(1-g)/6+b/8*p*(1-2*g)+S/120*(g*(4-7*g)-3*d*d*(1-7*g))-w/48*p),t.x=this.x0+m*Math.sin(c),t.y=this.y0+m*Math.cos(c),t))}function ve(t){t.x-=this.x0,t.y-=this.y0;var e,i,r,n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_,b,S,w;if(this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*Me*this.a)return;return i=e/this.a,r=Math.sin(i),n=Math.cos(i),o=this.long0,Math.abs(e)<=Ne?s=this.lat0:(s=xr(n*this.sin_p12+t.y*r*this.cos_p12/e),a=Math.abs(this.lat0)-Me,o=$e(Math.abs(a)<=Ne?this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y):this.long0+Math.atan2(t.x*r,e*this.cos_p12*n-t.y*this.sin_p12*r))),t.x=o,t.y=s,t}return l=lr(this.es),h=hr(this.es),u=ur(this.es),c=cr(this.es),Math.abs(this.sin_p12-1)<=Ne?(d=this.a*ar(l,h,u,c,Me),e=Math.sqrt(t.x*t.x+t.y*t.y),f=d-e,s=pr(f/this.a,l,h,u,c),o=$e(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=s,t):Math.abs(this.sin_p12+1)<=Ne?(d=this.a*ar(l,h,u,c,Me),e=Math.sqrt(t.x*t.x+t.y*t.y),f=e-d,s=pr(f/this.a,l,h,u,c),o=$e(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=s,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),m=Math.atan2(t.x,t.y),p=dr(this.a,this.e,this.sin_p12),y=Math.cos(m),E=this.e*this.cos_p12*y,v=-E*E/(1-this.es),_=3*this.es*(1-v)*this.sin_p12*this.cos_p12*y/(1-this.es),b=e/p,S=b-v*(1+v)*Math.pow(b,3)/6-_*(1+3*v)*Math.pow(b,4)/24,w=1-v*S*S/2-b*S*S*S/6,g=Math.asin(this.sin_p12*Math.cos(S)+this.cos_p12*Math.sin(S)*y),o=$e(this.long0+Math.asin(Math.sin(m)*Math.sin(S)/Math.cos(g))),s=Math.atan((1-this.es*w*this.sin_p12/Math.sin(g))*Math.tan(g)/(1-this.es)),t.x=o,t.y=s,t)}function _e(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function be(t){var e,i,r,n,o,s,a,l,h=t.x,u=t.y;return r=$e(h-this.long0),e=Math.sin(u),i=Math.cos(u),n=Math.cos(r),s=this.sin_p14*e+this.cos_p14*i*n,o=1,(s>0||Math.abs(s)<=Ne)&&(a=this.a*o*i*Math.sin(r),l=this.y0+this.a*o*(this.cos_p14*e-this.sin_p14*i*n)),t.x=a,t.y=l,t}function Se(t){var e,i,r,n,o,s,a;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),i=xr(e/this.a),r=Math.sin(i),n=Math.cos(i),s=this.long0,Math.abs(e)<=Ne?(a=this.lat0,t.x=s,t.y=a,t):(a=xr(n*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.abs(this.lat0)-Me,Math.abs(o)<=Ne?(s=$e(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)),t.x=s,t.y=a,t):(s=$e(this.long0+Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r)),t.x=s,t.y=a,t))}var we=1,Le=2,Te=4,xe=5,Re=484813681109536e-20,Me=Math.PI/2,Ce=.16666666666666666,Ae=.04722222222222222,Pe=.022156084656084655,Ne=void 0===Number.EPSILON?1e-10:Number.EPSILON,Oe=.017453292519943295,Ie=57.29577951308232,De=Math.PI/4,ke=2*Math.PI,Ve={};Ve.greenwich=0,Ve.lisbon=-9.131906111111,Ve.paris=2.337229166667,Ve.bogota=-74.080916666667,Ve.madrid=-3.687938888889,Ve.rome=12.452333333333,Ve.bern=7.439583333333,Ve.jakarta=106.807719444444,Ve.ferro=-17.666666666667,Ve.brussels=4.367975,Ve.stockholm=18.058277777778,Ve.athens=23.7163375,Ve.oslo=10.722916666667;var Fe={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},Ge=/[\s_\-\/\(\)]/g,We=function(e){var i,r,n,o={},s=e.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var i=e.split("=");return i.push(!0),t[i[0].toLowerCase()]=i[1],t},{}),a={proj:"projName",datum:"datumCode",rf:function(t){o.rf=parseFloat(t)},lat_0:function(t){o.lat0=t*Oe},lat_1:function(t){o.lat1=t*Oe},lat_2:function(t){o.lat2=t*Oe},lat_ts:function(t){o.lat_ts=t*Oe},lon_0:function(t){o.long0=t*Oe},lon_1:function(t){o.long1=t*Oe},lon_2:function(t){o.long2=t*Oe},alpha:function(t){o.alpha=parseFloat(t)*Oe},lonc:function(t){o.longc=t*Oe},x_0:function(t){o.x0=parseFloat(t)},y_0:function(t){o.y0=parseFloat(t)},k_0:function(t){o.k0=parseFloat(t)},k:function(t){o.k0=parseFloat(t)},a:function(t){o.a=parseFloat(t)},b:function(t){o.b=parseFloat(t)},r_a:function(){o.R_A=!0},zone:function(t){o.zone=parseInt(t,10)},south:function(){o.utmSouth=!0},towgs84:function(t){o.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){o.to_meter=parseFloat(t)},units:function(e){o.units=e;var i=t(Fe,e);i&&(o.to_meter=i.to_meter)},from_greenwich:function(t){o.from_greenwich=t*Oe},pm:function(e){var i=t(Ve,e);o.from_greenwich=(i||parseFloat(e))*Oe},nadgrids:function(t){"@null"===t?o.datumCode="none":o.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(o.axis=t)}};for(i in s)r=s[i],i in a?(n=a[i],"function"==typeof n?n(r):o[n]=r):o[i]=r;return"string"==typeof o.datumCode&&"WGS84"!==o.datumCode&&(o.datumCode=o.datumCode.toLowerCase()),o},Be=1,Ue=/\s/,Ke=/[A-Za-z]/,je=/[A-Za-z84]/,ze=/[,\]]/,qe=/[\d\.E\-\+]/;e.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;Ue.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case Be:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},e.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(ze.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},e.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=Be)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=Be,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},e.prototype.number=function(t){if(qe.test(t))return void(this.word+=t);if(ze.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)},e.prototype.quoted=function(t){if('"'===t)return void(this.state=5);this.word+=t},e.prototype.keyword=function(t){if(je.test(t))return void(this.word+=t);if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=Be)}if(ze.test(t))return void this.afterItem(t);throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place)},e.prototype.neutral=function(t){if(Ke.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(qe.test(t))return this.word=t,void(this.state=3);if(ze.test(t))return void this.afterItem(t);throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place)},e.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var Ye=.017453292519943295,He=function(t){var e=i(t),r=e.shift(),o=e.shift();e.unshift(["name",o]),e.unshift(["type",r]);var s={};return n(e,s),a(s),s};!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(l);
92var Xe=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],Je=function(t,e){t=t||{};var i,r;if(!e)return t;for(r in e)void 0!==(i=e[r])&&(t[r]=i);return t},Ze=function(t,e,i){var r=t*e;return i/Math.sqrt(1-r*r)},Qe=function(t){return t<0?-1:1},$e=function(t){return Math.abs(t)<=3.14159265359?t:t-Qe(t)*ke},ti=function(t,e,i){var r=t*i,n=.5*t;return r=Math.pow((1-r)/(1+r),n),Math.tan(.5*(Me-e))/r},ei=function(t,e){for(var i,r,n=.5*t,o=Me-2*Math.atan(e),s=0;s<=15;s++)if(i=t*Math.sin(o),r=Me-2*Math.atan(e*Math.pow((1-i)/(1+i),n))-o,o+=r,Math.abs(r)<=1e-10)return o;return-9999},ii=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],ri={init:p,forward:g,inverse:m,names:ii},ni=["longlat","identity"],oi={init:y,forward:E,inverse:E,names:ni},si=[ri,oi],ai={},li=[],hi={start:b,add:v,get:_},ui={};ui.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},ui.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},ui.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},ui.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},ui.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},ui.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},ui.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},ui.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},ui.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},ui.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},ui.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},ui.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},ui.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},ui.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},ui.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},ui.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},ui.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},ui.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},ui.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},ui.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},ui.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},ui.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},ui.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},ui.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},ui.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},ui.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},ui.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},ui.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},ui.hough={a:6378270,rf:297,ellipseName:"Hough"},ui.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},ui.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},ui.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},ui.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},ui.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},ui.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},ui.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},ui.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},ui.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},ui.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},ui.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},ui.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var ci=ui.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};ui.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var di={};di.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},di.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},di.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},di.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},di.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},di.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},di.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},di.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},di.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},di.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},di.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},di.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},di.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},di.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},di.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},di.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},T.projections=hi,T.projections.start();
92var fi=function(t,e,i){return x(t,e)?i:t.datum_type===xe||e.datum_type===xe?i:t.es!==e.es||t.a!==e.a||P(t.datum_type)||P(e.datum_type)?(i=R(i,t.es,t.a),P(t.datum_type)&&(i=C(i,t.datum_type,t.datum_params)),P(e.datum_type)&&(i=A(i,e.datum_type,e.datum_params)),M(i,e.es,e.a,e.b)):i},pi=function(t,e,i){var r,n,o,s=i.x,a=i.y,l=i.z||0,h={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==i.z)switch(0===o?(r=s,n="x"):1===o?(r=a,n="y"):(r=l,n="z"),t.axis[o]){case"e":h[n]=r;break;case"w":h[n]=-r;break;case"n":h[n]=r;break;case"s":h[n]=-r;break;case"u":void 0!==i[n]&&(h.z=r);break;case"d":void 0!==i[n]&&(h.z=-r);break;default:return null}return h},gi=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e},mi=T("WGS84"),yi=6,Ei="AJSAJS",vi="AFAFAF",_i=65,bi=73,Si=79,wi=86,Li=90,Ti={forward:V,inverse:F,toPoint:G};$.fromMGRS=function(t){return new $(G(t))},$.prototype.toMGRS=function(t){return V([this.x,this.y],t)};var xi=.01068115234375,Ri=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*xi))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*xi)));var i=t*t;return e[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),i*=t,e[3]=i*(.3645833333333333-.005696614583333333*t),e[4]=i*t*.3076171875,e},Mi=function(t,e,i,r){return i*=e,e*=e,r[0]*t-i*(r[1]+e*(r[2]+e*(r[3]+e*r[4])))},Ci=function(t,e,i){for(var r=1/(1-e),n=t,o=20;o;--o){var s=Math.sin(n),a=1-e*s*s;if(a=(Mi(n,s,Math.cos(n),i)-t)*(a*Math.sqrt(a))*r,n-=a,Math.abs(a)<Ne)return n}return n},Ai=["Transverse_Mercator","Transverse Mercator","tmerc"],Pi={init:tt,forward:et,inverse:it,names:Ai},Ni=function(t){var e=Math.exp(t);return e=(e-1/e)/2},Oi=function(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),r=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(r,2))},Ii=function(t){var e=1+t,i=e-1;return 0===i?t:t*Math.log(e)/i},Di=function(t){var e=Math.abs(t);return e=Ii(e*(1+e/(Oi(1,e)+1))),t<0?-e:e},ki=function(t,e){for(var i,r=2*Math.cos(2*e),n=t.length-1,o=t[n],s=0;--n>=0;)i=r*o-s+t[n],s=o,o=i;return e+i*Math.sin(2*e)},Vi=function(t,e){for(var i,r=2*Math.cos(e),n=t.length-1,o=t[n],s=0;--n>=0;)i=r*o-s+t[n],s=o,o=i;return Math.sin(e)*i},Fi=function(t){var e=Math.exp(t);return e=(e+1/e)/2},Gi=function(t,e,i){for(var r,n,o=Math.sin(e),s=Math.cos(e),a=Ni(i),l=Fi(i),h=2*s*l,u=-2*o*a,c=t.length-1,d=t[c],f=0,p=0,g=0;--c>=0;)r=p,n=f,p=d,f=g,d=h*p-r-u*f+t[c],g=u*p-n+h*f;return h=o*l,u=s*a,[h*d-u*g,h*g+u*d]},Wi=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"],Bi={init:rt,forward:nt,inverse:ot,names:Wi},Ui=function(t,e){if(void 0===t){if((t=Math.floor(30*($e(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t},Ki=["Universal Transverse Mercator System","utm"],ji={init:st,names:Ki,dependsOn:"etmerc"},zi=function(t,e){return Math.pow((1-t)/(1+t),e)},qi=20,Yi=["gauss"],Hi={init:at,forward:lt,inverse:ht,names:Yi},Xi=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"],Ji={init:ut,forward:ct,inverse:dt,names:Xi},Zi=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],Qi={init:pt,forward:gt,inverse:mt,names:Zi,ssfn_:ft},$i=["somerc"],tr={init:yt,forward:Et,inverse:vt,names:$i},er=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"],ir={init:_t,forward:bt,inverse:St,names:er},rr=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"],nr={init:wt,forward:Lt,inverse:Tt,names:rr},or=["Krovak","krovak"],sr={init:xt,forward:Rt,inverse:Mt,names:or},ar=function(t,e,i,r,n){return t*n-e*Math.sin(2*n)+i*Math.sin(4*n)-r*Math.sin(6*n)},lr=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},hr=function(t){return.375*t*(1+.25*t*(1+.46875*t))},ur=function(t){return.05859375*t*t*(1+.75*t)},cr=function(t){return t*t*t*(35/3072)},dr=function(t,e,i){var r=e*i;return t/Math.sqrt(1-r*r)},fr=function(t){return Math.abs(t)<Me?t:t-Qe(t)*Math.PI},pr=function(t,e,i,r,n){var o,s;o=t/e;for(var a=0;a<15;a++)if(s=(t-(e*o-i*Math.sin(2*o)+r*Math.sin(4*o)-n*Math.sin(6*o)))/(e-2*i*Math.cos(2*o)+4*r*Math.cos(4*o)-6*n*Math.cos(6*o)),o+=s,Math.abs(s)<=1e-10)return o;return NaN},gr=["Cassini","Cassini_Soldner","cass"],mr={init:Ct,forward:At,inverse:Pt,names:gr},yr=function(t,e){var i;return t>1e-7?(i=t*e,(1-t*t)*(e/(1-i*i)-.5/t*Math.log((1-i)/(1+i)))):2*e},Er=.3333333333333333,vr=.17222222222222222,_r=.10257936507936508,br=.06388888888888888,Sr=.0664021164021164,wr=.016415012942191543,Lr=["Lambert Azimuthal Equal Area","
92Lambert_Azimuthal_Equal_Area","laea"],Tr={init:Nt,forward:Ot,inverse:It,names:Lr,S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},xr=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)},Rr=["Albers_Conic_Equal_Area","Albers","aea"],Mr={init:Vt,forward:Ft,inverse:Gt,names:Rr,phi1z:Wt},Cr=["gnom"],Ar={init:Bt,forward:Ut,inverse:Kt,names:Cr},Pr=function(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*Me:Me;for(var r,n,o,s,a=Math.asin(.5*e),l=0;l<30;l++)if(n=Math.sin(a),o=Math.cos(a),s=t*n,r=Math.pow(1-s*s,2)/(2*o)*(e/(1-t*t)-n/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),a+=r,Math.abs(r)<=1e-10)return a;return NaN},Nr=["cea"],Or={init:jt,forward:zt,inverse:qt,names:Nr},Ir=["Equirectangular","Equidistant_Cylindrical","eqc"],Dr={init:Yt,forward:Ht,inverse:Xt,names:Ir},kr=20,Vr=["Polyconic","poly"],Fr={init:Jt,forward:Zt,inverse:Qt,names:Vr 93},Gr=["New_Zealand_Map_Grid","nzmg"],Wr={init:$t,forward:te,inverse:ee,names:Gr},Br=["Miller_Cylindrical","mill"],Ur={init:ie,forward:re,inverse:ne,names:Br},Kr=20,jr=["Sinusoidal","sinu"],zr={init:oe,forward:se,inverse:ae,names:jr},qr=["Mollweide","moll"],Yr={init:le,forward:he,inverse:ue,names:qr},Hr=["Equidistant_Conic","eqdc"],Xr={init:ce,forward:de,inverse:fe,names:Hr},Jr=["Van_der_Grinten_I","VanDerGrinten","vandg"],Zr={init:pe,forward:ge,inverse:me,names:Jr},Qr=["Azimuthal_Equidistant","aeqd"],$r={init:ye,forward:Ee,inverse:ve,names:Qr},tn=["ortho"],en={init:_e,forward:be,inverse:Se,names:tn};return k.defaultDatum="WGS84",k.Proj=T,k.WGS84=new k.Proj("WGS84"),k.Point=$,k.toPoint=gi,k.defs=l,k.transform=O,k.mgrs=Ti,k.version="2.4.3",function(t){t.Proj.projections.add(Pi),t.Proj.projections.add(Bi),t.Proj.projections.add(ji),t.Proj.projections.add(Ji),t.Proj.projections.add(Qi),t.Proj.projections.add(tr),t.Proj.projections.add(ir),t.Proj.projections.add(nr),t.Proj.projections.add(sr),t.Proj.projections.add(mr),t.Proj.projections.add(Tr),t.Proj.projections.add(Mr),t.Proj.projections.add(Ar),t.Proj.projections.add(Or),t.Proj.projections.add(Dr),t.Proj.projections.add(Fr),t.Proj.projections.add(Wr),t.Proj.projections.add(Ur),t.Proj.projections.add(zr),t.Proj.projections.add(Yr),t.Proj.projections.add(Xr),t.Proj.projections.add(Zr),t.Proj.projections.add($r),t.Proj.projections.add(en)}(k),k}),i("formats/geotiff/TiffIFDEntry",["../../error/AbstractError","../../error/ArgumentError","./GeoTiffUtil","../../util/Logger","./TiffConstants"],function(t,e,i,r,n){"use strict";var o=function(t,i,n,o,s,a){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"TiffIFDEntry","constructor","missingTag"));if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"TiffIFDEntry","constructor","missingType"));if(!n)throw new e(r.logMessage(r.LEVEL_SEVERE,"TiffIFDEntry","constructor","missingCount"));if(null===o||void 0===o)throw new e(r.logMessage(r.LEVEL_SEVERE,"TiffIFDEntry","constructor","missingValueOffset"));if(!s)throw new e(r.logMessage(r.LEVEL_SEVERE,"TiffIFDEntry","constructor","missingGeoTiffData"));if(null===a||void 0===a)throw new e(r.logMessage(r.LEVEL_SEVERE,"TiffIFDEntry","constructor","missingIsLittleEndian"));this._tag=t,this._type=i,this._count=n,this._valueOffset=o,this._geoTiffData=s,this._isLittleEndian=a};return Object.defineProperties(o.prototype,{tag:{get:function(){return this._tag}},type:{get:function(){return this._type}},count:{get:function(){return this._count}},valueOffset:{get:function(){return this._valueOffset}},geoTiffData:{get:function(){return this._geoTiffData}},isLittleEndian:{get:function(){return this._isLittleEndian}}}),o.prototype.getIFDTypeLength=function(){switch(this.type){case n.Type.BYTE:case n.Type.ASCII:case n.Type.SBYTE:case n.Type.UNDEFINED:return 1;case n.Type.SHORT:case n.Type.SSHORT:return 2;case n.Type.LONG:case n.Type.SLONG:case n.Type.FLOAT:return 4;case n.Type.RATIONAL:case n.Type.SRATIONAL:case n.Type.DOUBLE:return 8;default:return-1}},o.prototype.getIFDEntryValue=function(){var e=[],o=null,s=this.getIFDTypeLength();if(s*this.count<=4)o=!1===this.isLittleEndian?this.valueOffset>>>8*(4-s):this.valueOffset,e.push(o);else for(var a=0;a<this.count;a++){var l=s*a;if(s>
93=8)if(this.type===n.Type.RATIONAL||this.type===n.Type.SRATIONAL)e.push(i.getBytes(this.geoTiffData,this.valueOffset+l,4,this.isLittleEndian)),e.push(i.getBytes(this.geoTiffData,this.valueOffset+l+4,4,this.isLittleEndian));else{if(this.type!==n.Type.DOUBLE)throw new t(r.logMessage(r.LEVEL_SEVERE,"TiffIFDEntry","parse","invalidTypeOfIFD"));e.push(i.getBytes(this.geoTiffData,this.valueOffset+l,8,this.isLittleEndian))}else e.push(i.getBytes(this.geoTiffData,this.valueOffset+l,s,this.isLittleEndian))}return this.type===n.Type.ASCII?(e.forEach(function(t,e,i){0===t?i.splice(e,1):i[e]=String.fromCharCode(t)}),e.join("")):e},o}),i("util/WWUtil",["../error/ArgumentError","../geom/Line","../util/Logger","../geom/Rectangle","../geom/Vec3"],function(t,e,i,r,n){"use strict";var o={latLonRegex:/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/,suffixForMimeType:function(t){return"image/png"===t?"png":"image/jpeg"===t?"jpg":"application/bil16"===t?"bil":"application/bil32"===t?"bil":null},currentUrlSansFilePart:function(){for(var t=window.location.protocol,e=window.location.host,i=window.location.pathname,r=i.split("/"),n="",o=0,s=r.length;o<s-1;o++)r[o].length>0&&(n=n+"/"+r[o]);return t+"//"+e+n},worldwindlibLocation:function(){for(var t=document.getElementsByTagName("script"),e=0;e<t.length;e++){var i=t[e].src.indexOf("/worldwind.");if(i>=0)return t[e].src.substring(0,i)+"/"}return null},urlPath:function(t){if(!t)return"";for(var e=t.split("/"),i="",r=0,n=e.length;r<n;r++){var o=e[r];o&&0!==o.length&&-1==o.indexOf(":")&&"."!==o&&".."!==o&&"null"!==o&&"undefined"!==o&&(0!==i.length&&(i+="/"),i+=o)}return i},fillArray:function(t,e){if(t)for(var i=0,r=t.length;i<r;i++)t[i]=e},multiplyArray:function(t,e){if(t)for(var i=0,r=t.length;i<r;i++)t[i]*=e},jsonpCounter:0,jsonp:function(t,e,i){var r="gov_nasa_worldwind_jsonp_"+o.jsonpCounter++;window[r]=function(t){delete window[r],i(t)};var n=t+(-1===t.indexOf("?")?"?":"&");n+=e+"="+r;var s=document.createElement("script");s.async=!0,s.src=n;var a=document.getElementsByTagName("head")[0],l=function(){s.onload=void 0,s.onerror=void 0,a.removeChild(s)};s.onload=l,s.onerror=l,a.appendChild(s)},arrayEquals:function(t,e){return t.length==e.length&&t.every(function(t,i){return t===e[i]||t.equals&&t.equals(e[i])})},transformToBoolean:function(t){return 0!=t&&"0"!=t&&"false"!=t&&Boolean(t)},clone:function(t){var e,i={},r=Object.keys(t);for(e=0;e<r.length;e++)i[r[e]]=t[r[e]];return i},guid:function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}
93return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},date:function(t){return new Date(t)},startsWith:function(t,e,i){return i=i||0,t.substr(i,e.length)===e},endsWith:function(t,e,i){("number"!=typeof i||!isFinite(i)||Math.floor(i)!==i||i>t.length)&&(i=t.length),i-=e.length;var r=t.lastIndexOf(e,i);return-1!==r&&r===i}};return o}),i("formats/geotiff/GeoTiffReader",["../../error/AbstractError","../../error/ArgumentError","./GeoTiffConstants","./GeoTiffKeyEntry","./GeoTiffMetadata","./GeoTiffUtil","../../geom/Location","../../geom/Sector","../../util/Logger","../../util/proj4-src","./TiffConstants","./TiffIFDEntry","../../util/WWUtil"],function(t,e,i,r,n,o,s,a,l,h,u,c,d){"use strict";var f=function(t){if(!t)throw new e(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","constructor","missingArrayBuffer"));this._isLittleEndian=!1,this._imageFileDirectories=[],this._geoTiffData=new DataView(t),this._metadata=new n,this.parse()};return Object.defineProperties(f.prototype,{isLittleEndian:{get:function(){return this._isLittleEndian}},imageFileDirectories:{get:function(){return this._imageFileDirectories}},geoTiffData:{get:function(){return this._geoTiffData}},metadata:{get:function(){return this._metadata}}}),f.retrieveFromUrl=function(t,i){if(!t)throw new e(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","retrieveFromUrl","missingUrl"));if(!i)throw new e(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","retrieveFromUrl","The specified callback is null or undefined."));var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status){var e=r.response;e&&i(new f(e),r)}else l.log(l.LEVEL_WARNING,"GeoTiff retrieval failed ("+r.statusText+"): "+t),i(null,r)}.bind(this),r.onerror=function(){l.log(l.LEVEL_WARNING,"GeoTiff retrieval failed: "+t),i(null,r)},r.ontimeout=function(){l.log(l.LEVEL_WARNING,"GeoTiff retrieval timed out: "+t),i(null,r)},r.send(null)},f.prototype.parse=function(){if(!this._imageFileDirectories.length){if(this.getEndianness(),!this.isTiffFileType())throw new t(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","parse","invali
93dTiffFileType"));var e=o.getBytes(this.geoTiffData,4,4,this.isLittleEndian);this.parseImageFileDirectory(e),this.getMetadataFromImageFileDirectory(),this.parseGeoKeys(),this.setBBox()}},f.prototype.getEndianness=function(){var e=o.getBytes(this.geoTiffData,0,2,this.isLittleEndian);if(18761===e)this._isLittleEndian=!0;else{if(19789!==e)throw new t(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","getEndianness","invalidByteOrderValue"));this._isLittleEndian=!1}},f.prototype.getImage=function(){return this.createImage()},f.prototype.getImageData=function(){return this.createTypedElevationArray()},f.prototype.isTiffFileType=function(){return 42===o.getBytes(this.geoTiffData,2,2,this.isLittleEndian)},f.prototype.isGeoTiff=function(){return!!this.getIFDByTag(i.Tag.GEO_KEY_DIRECTORY)},f.prototype.createImage=function(){var t=this.metadata.bitsPerSample,e=this.metadata.samplesPerPixel,i=this.metadata.photometricInterpretation,r=this.metadata.imageLength,n=this.metadata.imageWidth;if(this.metadata.colorMap)var o=this.metadata.colorMap,s=Math.pow(2,t[0]);var a=document.createElement("canvas");a.width=n,a.height=r;var l=a.getContext("2d");if(this.metadata.stripOffsets){var h=this.parseStrips(!1);if(this.metadata.rowsPerStrip)var u=this.metadata.rowsPerStrip;else var u=r;for(var c=h.length,d=0,f=r%u,p=0===f?u:f,g=0;g<c;g++){g+1===c&&p;for(var m=h[g].length,y=d*g,E=0,v=0;v<m;E++)for(var _=0;_<n;_++,v++){var b=h[g][v];l.fillStyle=this.getFillStyle(b,i,t,e,o,s),l.fillRect(_,y+E,1,1)}d=u}}else if(this.metadata.tileOffsets)for(var S=this.parseTiles(!1),w=this.metadata.tileWidth,L=this.metadata.tileLength,T=Math.ceil(n/w),E=0;E<r;E++)for(var _=0;_<n;_++){var x=Math.floor(_/w),R=Math.floor(E/L),M=R*T+x,C=_%w,A=E%L,P=A*w+C,b=S[M][P];l.fillStyle=this.getFillStyle(b,i,t,e,o,s),l.fillRect(_,E,1,1)}return this._geoTiffData=null,a},f.prototype.getFillStyle=function(t,e,i,r,n,s){var a=0,h=0,c=0,d=1;switch(this.metadata.noData&&t[0]==this.metadata.noData&&(d=0),e){case u.PhotometricInterpretation.WHITE_IS_ZERO:var f=Math.pow(2,i)-1;t[0]=f-t[0];case u.PhotometricInterpretation.BLACK_IS_ZERO:a=h=c=o.clampColorSample(t[0],i[0]);break;case u.PhotometricInterpretation.RGB:if(a=o.clampColorSample(t[0],i[0]),h=o.clampColorSample(t[1],i[1]),c=o.clampColorSample(t[2],i[2]),4===r&&2===this.metadata.extraSamples[0]){var p=Math.pow(2,i[3]);d=t[3]/p}break;case u.PhotometricInterpretation.RGB_PALETTE:if(n){var g=t[0];a=o.clampColorSample(n[g],16),h=o.clampColorSample(n[s+g],16),c=o.clampColorSample(n[2*s+g],16)}break;case u.PhotometricInterpretation.TRANSPARENCY_MASK:l.log(l.LEVEL_WARNING,"Photometric interpretation not yet implemented: TRANSPARENCY_MASK");break;case u.PhotometricInterpretation.CMYK:l.log(l.LEVEL_WARNING,"Photometric interpretation not yet implemented: CMYK");break;case u.PhotometricInterpretation.Y_Cb_Cr:l.log(l.LEVEL_WARNING,"Photometric interpretation not yet implemented: Y_Cb_Cr");break;case u.PhotometricInterpretation.CIE_LAB:l.log(l.LEVEL_WARNING,"Photometric interpretation not yet implemented: CIE_LAB");break;default:l.log("Unknown photometric interpretation: "+e)}return o.getRGBAFillValue(a,h,c,d)},f.prototype.createTypedElevationArray=function(){var t,e=[],i=this.metadata.bitsPerSample[0];if(this.metadata.stripOffsets)for(var r=this.parseStrips(!0),n=0;n<r.length;n++)e=e.concat(r[n]);else if(this.metadata.tileOffsets)for(var o=this.parseTiles(!0),s=this.metadata.imageWidth,a=this.metadata.imageLength,l=this.metadata.tileWidth,h=this.metadata.tileLength,c=Math.ceil(s/l),d=0;d<a;d++)for(var f=0;f<s;f++){var p=Math.floor(f/l),g=Math.floor(d/h),m=g*c+p,y=f%l,E=d%h,v=E*l+y,_=o[m][v];e.push(_)}if(this.metadata.sampleFormat)var b=this.metadata.sampleFormat[0];else var b=u.SampleFormat.UNSIGNED;switch(i){case 8:t=b===u.SampleFormat.SIGNED?new Int8Array(e):new Uint8Array(e);break;case 16:t=b===u.SampleFormat.SIGNED?new Int16Array(e):new Uint16Array(e);break;case 32:t=b===u.SampleFormat.SIGNED?new Int32Array(e):b===u.SampleFormat.IEEE_FLOAT?new Float32Array(e):new Uint32Array(e);break;case 64:t=new Float64Array(e)}return t},f.prototype.parseStrips=function(t){var e=this.metadata.samplesPerPixel,i=this.metadata.bitsPerSample,r=this.metadata.stripOffsets,n=this.metadata.stripByteCounts,o=this.metadata.compression;if(this.metadata.sampleFormat)var s=this.metadata.sampleFormat;else var s=u.SampleFormat.UNSIGNED;for(var a=e*i[0],l=a/8,h=[],c=0;c<r.length;c++){var d=r[c],f=n[c];h[c]=this.parseBlock(t,o,l,f,d,i,s)}return h}
93,f.prototype.parseBlock=function(t,e,i,r,n,s,a){var h=[];switch(e){case u.Compression.UNCOMPRESSED:for(var c=0,d=i;c<r;c+=d){for(var f=0,p=[];f<s.length;f++){var g=s[f]/8,m=f*g;p.push(o.getSampleBytes(this.geoTiffData,n+c+m,g,a[f],this.isLittleEndian))}t?h.push(p[0]):h.push(p)}break;case u.Compression.CCITT_1D:l.log(l.LEVEL_WARNING,"Compression type not yet implemented: CCITT_1D");break;case u.Compression.GROUP_3_FAX:l.log(l.LEVEL_WARNING,"Compression type not yet implemented: GROUP_3_FAX");break;case u.Compression.GROUP_4_FAX:l.log(l.LEVEL_WARNING,"Compression type not yet implemented: GROUP_4_FAX");break;case u.Compression.LZW:l.log(l.LEVEL_WARNING,"Compression type not yet implemented: LZW");break;case u.Compression.JPEG:l.log(l.LEVEL_WARNING,"Compression type not yet implemented: JPEG");break;case u.Compression.PACK_BITS:if(this.metadata.tileOffsets)var y=this.metadata.tileWidth,E=this.metadata.tileWidth,v=new ArrayBuffer(y*E*i);else var _=this.metadata.rowsPerStrip,b=this.metadata.imageWidth,v=new ArrayBuffer(_*b*i);for(var S=new DataView(v),w=!0,p=[],L=0,T=0,x=0,c=0;c<r;c+=1)if(w){L=1,T=1,w=!1;var R=this.geoTiffData.getInt8(n+c,this.isLittleEndian);R>=0&&R<=127?L=R+1:R>=-127&&R<=-1?T=1-R:w=!0}else{for(var M=o.getBytes(this.geoTiffData,n+c,1,this.isLittleEndian),C=0;C<T;C++)S.setInt8(x,M),x++;L--,0===L&&(w=!0)}for(var c=0,d=i;c<v.byteLength;c+=d){for(var f=0,p=[];f<s.length;f++){var g=s[f]/8,m=f*g;p.push(o.getSampleBytes(S,c+m,g,a[f],this.isLittleEndian))}t?h.push(p[0]):h.push(p)}}return h},f.prototype.parseTiles=function(t){var e=this.metadata.samplesPerPixel,i=this.metadata.bitsPerSample,r=this.metadata.compression;if(this.metadata.sampleFormat)var n=this.metadata.sampleFormat;else{var n=new Array(e);d.fillArray(n,u.SampleFormat.UNSIGNED)}for(var o=e*i[0],s=o/8,a=this.metadata.tileWidth,l=this.metadata.tileLength,h=this.metadata.tileOffsets,c=this.metadata.tileByteCounts,f=this.metadata.imageLength,p=this.metadata.imageWidth,g=Math.ceil(p/a),m=Math.ceil(f/l),y=[],E=0;E<m;E++)for(var v=0;v<g;v++){var _=g*E+v,b=h[_],S=c[_];y[_]=this.parseBlock(t,r,s,S,b,i,n)}return y},f.prototype.geoTiffImageToPCS=function(t,i){if(null===t||void 0===t)throw new e(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","geoTiffImageToPCS","missingXValue"));if(null===i||void 0===i)throw new e(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","geoTiffImageToPCS","missingYValue"));var r=[t,i],n=this.metadata.modelTiepoint,o=this.metadata.modelPixelScale,a=this.metadata.modelTransformation,u=n?n.length:0,c=o?o.length:0,d=a?a.length:0;if(u>6&&0===c);else if(16===d){var f=t,p=i;t=f*a[0]+p*a[1]+a[3],i=f*a[4]+p*a[5]+a[7],r=[t,i]}else c<3||u<6?r=[t,i]:(t=(t-n[0])*o[0]+n[3],i=(i-n[1])*(-1*o[1])+n[4],r=[t,i]);return h.defs([["EPSG:26771","+proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=152400.3048006096 +y_0=0 +ellps=clrk66 +datum=NAD27 +to_meter=0.3048006096012192 +no_defs "],["EPSG:32633","+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs"]]),this.metadata.projectedCSType&&(r=h("EPSG:"+this.metadata.projectedCSType,"EPSG:4326",r)),new s(r[1],r[0])},f.prototype.setBBox=function(){var t=this.geoTiffImageToPCS(0,0),e=this.geoTiffImageToPCS(this.metadata.imageWidth,0),i=this.geoTiffImageToPCS(0,this.metadata.imageLength);this.geoTiffImageToPCS(this.metadata.imageWidth,this.metadata.imageLength);this.metadata.bbox=new a(i.latitude,t.latitude,t.longitude,e.longitude)},f.prototype.getMetadataFromImageFileDirectory=function(){for(var t=0;t<this.imageFileDirectories[0].length;t++)switch(this.imageFileDirectories[0][t].tag){case u.Tag.BITS_PER_SAMPLE:this.metadata.bitsPerSample=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.COLOR_MAP:this.metadata.colorMap=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.COMPRESSION:this.metadata.compression=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.EXTRA_SAMPLES:this.metadata.extraSamples=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.IMAGE_LENGTH:this.metadata.imageLength=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.IMAGE_WIDTH:this.metadata.imageWidth=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.MAX_SAMPLE_VALUE:this.metadata.maxSampleValue=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.MIN_SAMPLE_VALUE:this.metadata.minSampleValue=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.ORIENTATION:this.metadata.orientation=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.PHOTOMETRIC_INTERPRETATION:this.metadata.photometricInterpretation=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.PLANAR_CONFIGURATION:this.metadata.planarConfiguration=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.ROWS_PER_STRIP:this.metadata.rowsPerStrip=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.RESOLUTION_UNIT:this.metadata.resolutionUnit=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.SAMPLES_PER_PIXEL:this.metadata.samplesPerPixel=this.imageFileDirectories[0][t].getIFDEntryValue()[0];break;case u.Tag.SAMPLE_FORMAT:this.metadata.sampleFormat=this.imageFileDirectories[0][t].getIFDEntryValue();break;
93case u.Tag.SOFTWARE:this.metadata.software=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.STRIP_BYTE_COUNTS:this.metadata.stripByteCounts=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.STRIP_OFFSETS:this.metadata.stripOffsets=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.TILE_BYTE_COUNTS:this.metadata.tileByteCounts=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.TILE_OFFSETS:this.metadata.tileOffsets=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.TILE_LENGTH:this.metadata.tileLength=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.TILE_WIDTH:this.metadata.tileWidth=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.X_RESOLUTION:this.metadata.xResolution=this.imageFileDirectories[0][t].getIFDEntryValue();break;case u.Tag.Y_RESOLUTION:this.metadata.tileWidth=this.imageFileDirectories[0][t].getIFDEntryValue();break;case i.Tag.GEO_ASCII_PARAMS:this.metadata.geoAsciiParams=this.imageFileDirectories[0][t].getIFDEntryValue();break;case i.Tag.GEO_DOUBLE_PARAMS:this.metadata.geoDubleParams=this.imageFileDirectories[0][t].getIFDEntryValue();break;case i.Tag.GEO_KEY_DIRECTORY:this.metadata.geoKeyDirectory=this.imageFileDirectories[0][t].getIFDEntryValue();break;case i.Tag.MODEL_PIXEL_SCALE:this.metadata.modelPixelScale=this.imageFileDirectories[0][t].getIFDEntryValue();break;case i.Tag.MODEL_TIEPOINT:this.metadata.modelTiepoint=this.imageFileDirectories[0][t].getIFDEntryValue();break;case i.Tag.GDAL_NODATA:this.metadata.noData=this.imageFileDirectories[0][t].getIFDEntryValue();break;default:l.log(l.LEVEL_WARNING,"Ignored GeoTiff tag: "+this.imageFileDirectories[0][t].tag)}},f.prototype.parseGeoKeys=function(){if(!this.isGeoTiff())throw new t(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","parse","invali
93dGeoTiffFile"));var e=this.metadata.geoKeyDirectory;if(!e)throw new t(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","parseGeoKeys","missingGeoKeyDirectoryTag"));for(var n=(e[0],e[1],e[2],e[3]),o=0;o<n;o++){var s=e[4+4*o],a=e[5+4*o],h=e[6+4*o],u=e[7+4*o];switch(s){case i.Key.GTModelTypeGeoKey:this.metadata.gtModelTypeGeoKey=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;case i.Key.GTRasterTypeGeoKey:this.metadata.gtRasterTypeGeoKey=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;case i.Key.GTCitationGeoKey:this.metadata.gtCitationGeoKey=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;case i.Key.GeographicTypeGeoKey:this.metadata.geographicTypeGeoKey=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;case i.Key.GeogCitationGeoKey:this.metadata.geogCitationGeoKey=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;case i.Key.GeogAngularUnitsGeoKey:this.metadata.geogAngularUnitsGeoKey=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;case i.Key.GeogAngularUnitSizeGeoKey:this.metadata.geogAngularUnitSizeGeoKey=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;case i.Key.GeogSemiMajorAxisGeoKey:this.metadata.geogSemiMajorAxisGeoKey=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;case i.Key.GeogInvFlatteningGeoKey:this.metadata.geogInvFlatteningGeoKey=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;case i.Key.ProjectedCSTypeGeoKey:this.metadata.projectedCSType=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;case i.Key.ProjLinearUnitsGeoKey:this.metadata.projLinearUnits=new r(s,a,h,u).getGeoKeyValue(this.metadata.geoDoubleParams,this.metadata.geoAsciiParams);break;default:l.log(l.LEVEL_WARNING,"Ignored GeoTiff key: "+s)}}},f.prototype.parseImageFileDirectory=function(t){if(!t)throw new e(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","parseImageFileDirectory","missingOffset"));for(var i=o.getBytes(this.geoTiffData,t,2,this.isLittleEndian),r=[],n=t+2,s=0;s<i;n+=12,s++){var a=o.getBytes(this.geoTiffData,n,2,this.isLittleEndian),h=o.getBytes(this.geoTiffData,n+2,2,this.isLittleEndian),u=o.getBytes(this.geoTiffData,n+4,4,this.isLittleEndian),d=o.getBytes(this.geoTiffData,n+8,4,this.isLittleEndian);r.push(new c(a,h,u,d,this.geoTiffData,this.isLittleEndian))}this._imageFileDirectories.push(r);var f=o.getBytes(this.geoTiffData,n,4,this.isLittleEndian);0!==f&&this.parseImageFileDirectory(f)},f.prototype.getIFDByTag=function(t){if(!t)throw new e(l.logMessage(l.LEVEL_SEVERE,"GeoTiffReader","getIFDByTag","missingTag"));for(var i=0;i<this.imageFileDirectories[0].length;i++)if(this.imageFileDirectories[0][i].tag===t)return this.imageFileDirectories[0][i];return null},f}),i("util/Level",["../geom/Angle","../error/ArgumentError","../geom/Location","../util/Logger"],function(t,e,i,r){"use strict";var n=function(i,n,o){if(!n)throw new e(r.logMessage(r.LEVEL_SEVERE,"Level","constructor","The specified tile delta is null or undefined"));if(!o)throw new e(r.logMessage(r.LEVEL_SEVERE,"Level","constructor","The specified parent level set is null or undefined"));this.levelNumber=i,this.tileDelta=n,this.parent=o,this.texelSize=n.latitude*t.DEGREES_TO_RADIANS/o.tileHeight,this.tileWidth=o.tileWidth,this.tileHeight=o.tileHeight,this.sector=o.sector};return n.prototype.isFirstLevel=function(){return this.parent.firstLevel()==this},n.prototype.isLastLevel=function(){return this.parent.lastLevel()==this},n.prototype.previousLevel=function(){return this.parent.level(this.levelNumber-1)},n.prototype.nextLevel=function(){return this.parent.level(this.levelNumber+1)},n.prototype.compare=function(t){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"Level","compare","The specified level is null or undefined"));return this.levelNumber<t.levelNumber?-1:this.levelNumber>t.levelNumber?1:0},n}),i("util/LevelSet",["../error/ArgumentError","../util/Level","../geom/Location","../util/Logger"],function(t,e,
93i,r){"use strict";var n=function(n,o,s,a,l){if(!n)throw new t(r.logMessage(r.LEVEL_SEVERE,"LevelSet","constructor","missingSector"));if(!o)throw new t(r.logMessage(r.LEVEL_SEVERE,"LevelSet","constructor","The specified level zero delta is null or undefined"));if(o.latitude<=0||o.longitude<=0)throw new t(r.logMessage(r.LEVEL_SEVERE,"LevelSet","constructor","The specified level zero delta is less than or equal to zero."));if(s<1)throw new t(r.logMessage(r.LEVEL_SEVERE,"LevelSet","constructor","The specified number of levels is less than one."));if(a<1||l<1)throw new t(r.logMessage(r.LEVEL_SEVERE,"LevelSet","constructor","The specified tile width or tile height is less than one."));this.sector=n,this.levelZeroDelta=o,this.numLevels=s,this.tileWidth=a,this.tileHeight=l,this.levels=[];for(var h=0;h<s;h+=1){var u=Math.pow(2,h),c=o.latitude/u,d=o.longitude/u,f=new i(c,d),p=new e(h,f,this);this.levels[h]=p}};return n.numLevelsForResolution=function(e,i){if(!e||!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"LevelSet","numLevelsForResolution","missingResolution"));var n=Math.log(e/i)/Math.log(2);return n<0&&(n=0),n+1},n.prototype.level=function(t){return t<0||t>=this.levels.length?null:this.levels[t]},n.prototype.levelForTexelSize=function(t){var e=this.lastLevel();if(e.texelSize>=t)return e;for(var i=0,r=this.levels.length;i<r;i+=1){var n=this.levels[i];if(n.texelSize<=t)return n}return e},n.prototype.firstLevel=function(){return this.levels[0]},n.prototype.lastLevel=function(){return this.levels[this.levels.length-1]},n}),i("cache/MemoryCache",["../error/ArgumentError","../util/Logger"],function(t,e){"use strict";var i=function(i,r){if(!i||i<1)throw new t(e.logMessage(e.LEVEL_SEVERE,"MemoryCache","constructor","The specified capacity is undefined, zero or negative"));if(!r||r>=i||r<0)throw new t(e.logMessage(e.LEVEL_SEVERE,"MemoryCache","constructor","The specified low-water value is undefined, greater than or equal to the capacity, or less than 1"));this._capacity=i,this._lowWater=r,this.usedCapacity=0,this.freeCapacity=i,this.entries={},this.listeners=[]};return Object.defineProperties(i.prototype,{capacity:{get:function(){return this._capacity},set:function(i){if(!i||i<1)throw new t(e.logMessage(e.LEVEL_SEVERE,"MemoryCache","capacity","Specified cache capacity is undefined, 0 or negative."));var r=this._capacity;this._capacity=i,this._capacity<=this.lowWater&&(this._lowWater=.85*this._capacity),this._capacity<r&&this.makeSpace(0)}},lowWater:{get:function(){return this._lowWater},set:function(i){if(!i||i>=this._capacity||i<0)throw new t(e.logMessage(e.LEVEL_SEVERE,"MemoryCache","lowWater","Specified cache low-water value is undefined, negative or not less than the current capacity."));this._lowWater=i}}}),i.prototype.entryForKey=function(t){if(!t)return null;var e=this.entries[t];return e?(e.lastUsed=Date.now(),e.entry):null},i.prototype.putEntry=function(i,r,n){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"MemoryCache","putEntry","missingKey."));if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"MemoryCache","putEntry","missingEntry."));if(n<1)throw new t(e.logMessage(e.LEVEL_SEVERE,"MemoryCache","putEntry","The specified entry size is less than 1."));var o,s=this.entries[i];s&&this.removeEntry(i),this.usedCapacity+n>this._capacity&&this.makeSpace(n),this.usedCapacity+=n,this.freeCapacity=this._capacity-this.usedCapacity,o={key:i,entry:r,size:n,lastUsed:Date.now(),agingFactor:1},this.entries[i]=o},i.prototype.clear=function(t){if(t)for(var e in this.entries)this.entries.hasOwnProperty(e)&&this.removeCacheEntry(e);this.entries={},this.freeCapacity=this._capacity,this.usedCapacity=0},i.prototype.removeEntry=function(t){if(t){var e=this.entries[t];e&&this.removeCacheEntry(e)}},i.prototype.setEntryAgingFactor=function(t,e){if(t){var i=this.entries[t];
93i&&(i.agingFactor=e)}},i.prototype.removeCacheEntry=function(t){delete this.entries[t.key],this.usedCapacity-=t.size,this.freeCapacity=this._capacity-this.usedCapacity;for(var e=0,i=this.listeners.length;e<i;e++)try{this.listeners[e].entryRemoved(t.key,t.entry)}catch(i){this.listeners[e].removalError(i,t.key,t.entry)}},i.prototype.containsKey=function(t){return t&&this.entries[t]},i.prototype.addCacheListener=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"MemoryCache","addCacheListener","missingListener"));if("function"!=typeof i.entryRemoved||"function"!=typeof i.removalError)throw new t(e.logMessage(e.LEVEL_SEVERE,"MemoryCache","addCacheListener","The specified listener does not implement the required functions."));this.listeners.push(i)},i.prototype.removeCacheListener=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"MemoryCache","removeCacheListener","missingListener"));var r=this.listeners.indexOf(i);r>-1&&this.listeners.splice(r,1)},i.prototype.makeSpace=function(t){var e=[],i=Date.now();for(var r in this.entries)this.entries.hasOwnProperty(r)&&e.push(this.entries[r]);e.sort(function(t,e){var r=(i-t.lastUsed)*t.agingFactor;return(i-e.lastUsed)*e.agingFactor-r});for(var n=0,o=e.length;n<o&&(this.usedCapacity>this._lowWater||this.freeCapacity<t);n++)this.removeCacheEntry(e[n])},i}),i("shaders/BasicProgram",["../error/ArgumentError","../util/Color","../shaders/GpuProgram","../util/Logger"],function(t,e,i,r){"use strict";var n=function(t){i.call(this,t,"attribute vec4 vertexPoint;\nuniform mat4 mvpMatrix;\nvoid main() {gl_Position = mvpMatrix * vertexPoint;}","precision mediump float;\nuniform vec4 color;\nvoid main() {gl_FragColor = color;}"),this.vertexPointLocation=this.attributeLocation(t,"vertexPoint"),this.mvpMatrixLocation=this.uniformLocation(t,"mvpMatrix"),this.colorLocation=this.uniformLocation(t,"color")};return n.key="WorldWindGpuBasicProgram",n.prototype=Object.create(i.prototype),n.prototype.loadModelviewProjection=function(e,i){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"BasicProgram","loadModelviewProjection","missingMatrix"));this.loadUniformMatrix(e,i,this.mvpMatrixLocation)},n.prototype.loadColor=function(e,i){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"BasicProgram","loadColor","missingColor"));this.loadUniformColor(e,i,this.colorLocation)},n.prototype.loadColorComponents=function(t,e,i,r,n){this.loadUniformColorComponents(t,e,i,r,n,this.colorLocation)},n}),i("geom/Frustum",["../error/ArgumentError","../geom/Matrix","../geom/Plane","../util/Logger"],function(t,e,i,r){"use strict";var n=function(e,i,n,o,s,a){if(!(e&&i&&n&&o&&s&&a))throw new t(r.logMessage(r.LEVEL_SEVERE,"Frustum","constructor","missingPlane"));this._left=e,this._right=i,this._bottom=n,this._top=o,this._near=s,this._far=a,this._planes=[this._left,this._right,this._top,this._bottom,this._near,this._far]};return Object.defineProperties(n.prototype,{left:{get:function(){return this._left}},right:{get:function(){return this._right}},bottom:{get:function(){return this._bottom}},top:{get:function(){return this._top}},near:{get:function(){return this._near}},far:{get:function(){return this._far}}}),n.prototype.transformByMatrix=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"Frustum","transformByMatrix","missingMatrix"));return this._left.transformByMatrix(e),this._right.transformByMatrix(e),this._bottom.transformByMatrix(e),this._top.transformByMatrix(e),this._near.transformByMatrix(e),this._far.transformByMatrix(e),this},n.prototype.normalize=function(){return this._left.normalize(),this._right.normalize(),this._bottom.normalize(),this._top.normalize(),this._near.normalize(),this._far.normalize(),this},n.unitFrustum=function(){return new n(new i(1,0,0,1),new i(-1,0,0,1),new i(0,1,1,1),new i(0,-1,0,1),new i(0,0,-1,1),new i(0,0,1,1))},n.fromProjectionMatrix=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"Frustum","fromProjectionMatrix","missingMatrix"));var o,s,a,l,h,u,c,d,f,p,g;return o=e[12]+e[0],s=e[13]+e[1],a=e[14]+e[2],l=e[15]+e[3],h=Math.sqrt(o*o+s*s+a*a),u=new i(o/h,s/h,a/h,l/h),o=e[12]-e[0],s=e[13]-e[1],a=e[14]-e[2],l=e[15]-e[3],h=Math.sqrt(o*o+s*s+a*a),c=new i(o/h,s/h,a/h,l/h),o=e[12]+e[4],s=e[13]+e[5],a=e[14]+e[6],l=e[15]+e[7],h=Math.sqrt(o*o+s*s+a*a),f=new i(o/h,s/h,a/h,l/h),o=e[12]-e[4],s=e[13]-e[5],a=e[14]-e[6],l=e[15]-e[7],h=Math.sqrt(o*o+s*s+a*a), 94d=new i(o/h,s/h,a/h,l/h),o=e[12]+e[8],s=e[13]+e[9],a=e[14]+e[10],l=e[15]+e[11],h=Math.sqrt(o*o+s*s+a*a),p=new i(o/h,s/h,a/h,l/h),o=e[12]-e[8],s=e[13]-e[9],a=e[14]-e[10],l=e[15]-e[11],h=Math.sqrt(o*o+s*s+a*a),g=new i(o/h,s/h,a/h,l/h),new n(u,c,f,d,p,g)},n.prototype.containsPoint=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"Frustum","containsPoint","missingPoint"));return!(this._far.dot(e)<=0)&&(!(this._left.dot(e)<=0)&&(!(this._right.dot(e)<=0)&&(!(this._top.dot(e)<=0)&&(!(this._bottom.dot(e)<=0)&&!(this._near.dot(e)<=0)))))},n.prototype.intersectsSegment=function(e,i){if(!e||!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"Frustum","containsPoint","missingPoint"));if(this.containsPoint(e)||this.containsPoint(i))return!0;
94if(e.equals(i))return!1;for(var n=0,o=this._planes.length;n<o;n++){if(this._planes[n].onSameSide(e,i)<0)return!1;if(null!=this._planes[n].clip(e,i))return!0}return!1},n}),i("error/NotYetImplementedError",["../error/AbstractError"],function(t){"use strict";var e=function(e){t.call(this,"NotYetImplementedError",e);var i;try{throw new Error}catch(t){i=t.stack}this.stack=i};return e.prototype=Object.create(t.prototype),e}),i("geom/BoundingBox",["../error/ArgumentError","../shaders/BasicProgram","../geom/Frustum","../util/Logger","../geom/Matrix","../error/NotYetImplementedError","../geom/Plane","../geom/Sector","../geom/Vec3","../util/WWMath","../util/WWUtil"],function(t,e,i,r,n,o,s,a,l,h,u){"use strict";var c=function(){this.center=new l(0,0,0),this.bottomCenter=new l(-.5,0,0),this.topCenter=new l(.5,0,0),this.r=new l(1,0,0),this.s=new l(0,1,0),this.t=new l(0,0,1),this.radius=Math.sqrt(3),this.tmp1=new l(0,0,0),this.tmp2=new l(0,0,0),this.tmp3=new l(0,0,0),this.scratchElevations=new Float64Array(9),this.scratchPoints=new Float64Array(3*this.scratchElevations.length)};return c.scratchMatrix=n.fromIdentity(),c.prototype.getCorners=function(){var t=new l(this.s[0],this.s[1],this.s[2]),e=new l(this.t[0],this.t[1],this.t[2]),i=new l(this.s[0],this.s[1],this.s[2]),r=new l(this.s[0],this.s[1],this.s[2]);t.add(this.t).multiply(-.5),e.subtract(this.s).multiply(.5),i.add(this.t).multiply(.5),r.subtract(this.t).multiply(.5);for(var n=[],o=0;o<4;o++)n.push(new l(this.bottomCenter[0],this.bottomCenter[1],this.bottomCenter[2]));for(o=0;o<4;o++)n.push(new l(this.topCenter[0],this.topCenter[1],this.topCenter[2]));return n[0].add(t),n[1].add(e),n[2].add(i),n[3].add(r),n[4].add(t),n[5].add(e),n[6].add(i),n[7].add(r),n},c.prototype.setToPoints=function(e){if(!e||e.length<3)throw new t(r.logMessage(r.LEVEL_SEVERE,"BoundingBox","setToPoints","missingArray"));var i,o,s,a,h,u,c,d,f,p,g,m,y,E,v,_=+Number.MAX_VALUE,b=-Number.MAX_VALUE,S=+Number.MAX_VALUE,w=-Number.MAX_VALUE,L=+Number.MAX_VALUE,T=-Number.MAX_VALUE,x=this.r,R=this.s,M=this.t,C=new l(0,0,0);n.principalAxesFromPoints(e,x,R,M);for(var A=0,P=e.length/3;A<P;A++)C[0]=e[3*A],C[1]=e[3*A+1],C[2]=e[3*A+2],i=C.dot(x),_>i&&(_=i),b<i&&(b=i),o=C.dot(R),S>o&&(S=o),w<o&&(w=o),s=C.dot(M),L>s&&(L=s),T<s&&(T=s);return b===_&&(b=_+1),w===S&&(w=S+1),T===L&&(T=L+1),a=b-_,h=w-S,u=T-L,c=b+_,d=w+S,f=T+L,p=.5*x[0]*a,g=.5*x[1]*a,m=.5*x[2]*a,y=.5*(x[0]*c+R[0]*d+M[0]*f),E=.5*(x[1]*c+R[1]*d+M[1]*f),v=.5*(x[2]*c+R[2]*d+M[2]*f),this.center[0]=y,this.center[1]=E,this.center[2]=v,this.topCenter[0]=y+p,this.topCenter[1]=E+g,this.topCenter[2]=v+m,this.bottomCenter[0]=y-p,this.bottomCenter[1]=E-g,this.bottomCenter[2]=v-m,x.multiply(a),R.multiply(h),M.multiply(u),this.radius=.5*Math.sqrt(a*a+h*h+u*u),this},c.prototype.setToVec3Points=function(e){if(!e||0===e.length)throw new t(r.logMessage(r.LEVEL_SEVERE,"BoundingBox","setToVec3Points","missingArray"));for(var i=new Float32Array(3*e.length),n=0;n<e.length;n++)for(var o=e[n],s=0;s<3;s++)i[3*n+s]=o[s];return this.setToPoints(i)},c.prototype.setToSector=function(e,i,n,o){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"BoundingBox","setToSector","missingSector"));if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"BoundingBox","setToSector","missingGlobe"));var s=this.scratchElevations,a=this.scratchPoints;u.fillArray(s,o),s[0]=s[2]=s[6]=s[8]=n,i.computePointsForGrid(e,3,3,s,l.ZERO,a);this.tmp1.set(a[12],a[13],a[14]),h.localCoordinateAxesAtPoint(this.tmp1,i,this.r,this.s,this.t);for(var c=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],d=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],f=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],p=0,g=a.length;p<g;p+=3)this.tmp1.set(a[p],a[p+1],a[p+2]),this.adjustExtremes(this.r,c,this.s,d,this.t,f,this.tmp1);e.deltaLongitude()>180&&(i.computePointFromPosition(e.centroidLatitude(),e.centroidLongitude()+90,o,this.tmp1),i.computePointFromPosition(e.centroidLatitude(),e.centroidLongitude()-90,o,this.tmp2),this.adjustExtremes(this.r,c,this.s,d,this.t,f,this.tmp1),this.adjustExtremes(this.r,c,this.s,d,this.t,f,this.tmp2)),c[1]-c[0]<d[1]-d[0]&&this.swapAxes(this.r,c,this.s,d),d[1]-d[0]<f[1]-f[0]&&this.swapAxes(this.s,d,this.t,f),c[1]-c[0]<d[1]-d[0]&&this.swapAxes(this.r,c,this.s,d);var m=c[1]-c[0],y=d[1]-d[0],E=f[1]-f[0],v=c[1]+c[0],_=d[1]+d[0],b=f[1]+f[0],S=.5*(this.r[0]*v+this.s[0]*_+this.t[0]*b),w=.5*(this.r[1]*v+this.s[1]*_+this.t[1]*b),L=.5*(this.r[2]*v+this.s[2]*_+this.t[2]*b),T=.5*this.r[0]*m,x=.5*this.r[1]*m,R=.5*this.r[2]*m;return this.center.set(S,w,L),this.topCenter.set(S+T,w+x,L+R),this.bottomCenter.set(S-T,w-x,L-R),this.r.multiply(m),this.s.multiply(y),this.t.multiply(E),this.radius=.5*Math.sqrt(m*m+y*y+E*E),this},c.prototype.translate=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"BoundingBox","translate","missingVector"));return this.bottomCenter.add(e),this.topCenter.add(e),this.center.add(e),this},c.prototype.distanceTo=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"BoundingBox","distanceTo","missingPoint"));var i=this.center.distanceTo(e)-this.radius;return i>=0?i:-i},c.prototype.effectiveRadius=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"BoundingBox","effectiveRadius","missingPlane"));var i=e.normal;return.5*(h.fabs(this.r.dot(i))+h.fabs(this.s.dot(i))+h.fabs(this.t.dot
94(i)))},c.prototype.intersectsFrustum=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"BoundingBox","intersectsFrustum","missingFrustum"));return this.tmp1.copy(this.bottomCenter),this.tmp2.copy(this.topCenter),!(this.intersectionPoint(e.near)<0)&&(!(this.intersectionPoint(e.far)<0)&&(!(this.intersectionPoint(e.left)<0)&&(!(this.intersectionPoint(e.right)<0)&&(!(this.intersectionPoint(e.top)<0)&&!(this.intersectionPoint(e.bottom)<0)))))},c.prototype.intersectionPoint=function(t){var e=t.normal,i=.5*(Math.abs(this.s.dot(e))+Math.abs(this.t.dot(e)));return this.intersectsAt(t,i,this.tmp1,this.tmp2)},c.prototype.intersectsAt=function(t,e,i,r){var n=t.dot(i),o=n<=-e,s=t.dot(r),a=s<=-e;if(o&&a)return-1;if(o==a)return 0;this.tmp3.copy(i),this.tmp3.subtract(r);var l=(e+n)/t.normal.dot(this.tmp3);return this.tmp3.copy(r),this.tmp3.subtract(i),this.tmp3.multiply(l),this.tmp3.add(i),o?i.copy(this.tmp3):r.copy(this.tmp3),l},c.prototype.adjustExtremes=function(t,e,i,r,n,o,s){var a=s.dot(t);e[0]>a&&(e[0]=a),e[1]<a&&(e[1]=a);var l=s.dot(i);r[0]>l&&(r[0]=l),r[1]<l&&(r[1]=l);var h=s.dot(n);o[0]>h&&(o[0]=h),o[1]<h&&(o[1]=h)},c.prototype.swapAxes=function(t,e,i,r){t.swap(i);var n=e[0];e[0]=r[0],r[0]=n,n=e[1],e[1]=r[1],r[1]=n},c.prototype.render=function(t){var i=t.currentGlContext,r=c.scratchMatrix,n=t.findAndBindProgram(e);try{r.copy(t.modelviewProjection),r.multiply(this.r[0],this.s[0],this.t[0],this.center[0],this.r[1],this.s[1],this.t[1],this.center[1],this.r[2],this.s[2],this.t[2],this.center[2],0,0,0,1),r.multiplyByTranslation(-.5,-.5,-.5),n.loadModelviewProjection(i,r),i.disable(i.CULL_FACE),i.bindBuffer(i.ARRAY_BUFFER,t.unitCubeBuffer()),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,t.unitCubeElements()),i.enableVertexAttribArray(n.vertexPointLocation),i.vertexAttribPointer(n.vertexPointLocation,3,i.FLOAT,!1,0,0),n.loadColorComponents(i,0,1,0,.6),i.drawElements(i.LINES,24,i.UNSIGNED_SHORT,72),n.loadColorComponents(i,1,1,1,.3),i.drawElements(i.TRIANGLES,36,i.UNSIGNED_SHORT,0)}finally{i.enable(i.CULL_FACE),i.bindBuffer(i.ARRAY_BUFFER,null),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,null)}},c}),i("util/Tile",["../error/ArgumentError","../geom/BoundingBox","../util/Logger","../geom/Sector","../geom/Vec3","../util/WWUtil"],function(t,e,i,r,n,o){"use strict";var s=function(e,r,n,o){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","constructor","missingSector"));if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","constructor","The specified level is null or undefined."));if(n<0||o<0)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","constructor","The specified row or column is less than zero."));this.sector=e,this.level=r,this.row=n,this.column=o,this.tileWidth=r.tileWidth,this.tileHeight=r.tileHeight,this.texelSize=r.texelSize,this.tileKey=s.
94computeTileKey(r.levelNumber,n,o),this.extent=null,this.referencePoint=null,this.opacity=1,this.samplePoints=null,this.sampleElevations=null,this.updateTimestamp=null,this.updateVerticalExaggeration=null,this.updateGlobeStateKey=null};return s.prototype.isEqual=function(t){return!!t&&(!!t.tileKey&&this.tileKey==t.tileKey)},s.prototype.size=function(){return 828},s.prototype.distanceTo=function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","distanceTo","missingVector"));for(var r,n,o,s=e[0],a=e[1],l=e[2],h=this.samplePoints,u=Number.POSITIVE_INFINITY,c=0,d=h.length;c<d;c+=3)r=s-h[c],n=a-h[c+1],o=l-h[c+2],u=Math.min(u,r*r+n*n+o*o);return Math.sqrt(u)},s.prototype.subdivide=function(e,n){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","subdivide","The specified level is null or undefined."));if(!n)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","subdivide","The specified tile factory is null or undefined."));var o,s,a,l=this.sector.minLatitude,h=this.sector.maxLatitude,u=this.sector.centroidLatitude(),c=this.sector.minLongitude,d=this.sector.maxLongitude,f=this.sector.centroidLongitude(),p=[];return o=2*this.row,s=2*this.column,a=new r(l,u,c,f),p.push(n.createTile(a,e,o,s)),o=2*this.row,s=2*this.column+1,a=new r(l,u,f,d),p.push(n.createTile(a,e,o,s)),o=2*this.row+1,s=2*this.column,a=new r(u,h,c,f),p.push(n.createTile(a,e,o,s)),o=2*this.row+1,s=2*this.column+1,a=new r(u,h,f,d),p.push(n.createTile(a,e,o,s)),p},s.prototype.subdivideToCache=function(e,r,n){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","subdivideToCache","The specified level is null or undefined."));if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","subdivideToCache","The specified tile factory is null or undefined."));var o=n?n.entryForKey(this.tileKey):null;return o||(o=this.subdivide(e,r))&&n&&n.putEntry(this.tileKey,o,4*o[0].size()),o},s.prototype.mustSubdivide=function(t,e){var i=t.globe.equatorialRadius*this.texelSize,r=this.distanceTo(t.eyePoint),n=t.pixelSizeAtDistance(r);return i>Math.max(e*n,.5)},s.prototype.update=function(t){var e=t.globe.elevationTimestamp(),i=t.verticalExaggeration,r=t.globeStateKey;this.updateTimestamp==e&&this.updateVerticalExaggeration==i&&this.updateGlobeStateKey==r||(this.doUpdate(t),t.frameStatistics.incrementTileUpdateCount(1),this.updateTimestamp=e,this.updateVerticalExaggeration=i,this.updateGlobeStateKey=r)},s.prototype.doUpdate=function(t){var i=t.globe,r=t.verticalExaggeration,s=i.minAndMaxElevationsForSector(this.sector),a=s[0]*r,l=s[1]*r;a===l&&(a=l+10),this.extent||(this.extent=new e),this.extent.setToSector(this.sector,i,a,l),this.samplePoints||(this.sampleElevations=new Float64Array(9),this.samplePoints=new Float64Array(3*this.sampleElevations.length)),o.fillArray(this.sampleElevations,.5*(a+l)),i.computePointsForGrid(this.sector,3,3,this.sampleElevations,n.ZERO,this.samplePoints),this.referencePoint||(this.referencePoint=new n(0,0,0)),i.computePointFromPosition(this.sector.centroidLatitude(),this.sector.centroidLongitude(),0,this.referencePoint)},s.computeTileKey=function(t,e,i){return t+"."+e+"."+i},s.computeRow=function(t,e){var i=Math.floor((e+90)/t);return 90==e&&(i-=1),i},s.computeColumn=function(t,e){var i=Math.floor((e+180)/t);return 180==e&&(i-=1),i},s.computeLastRow=function(t,e){var i=Math.ceil((e+90)/t-1);return e+90<t&&(i=0),i},s.computeLastColumn=function(t,e){var i=Math.ceil((e+180)/t-1);return e+180<t&&(i=0),i},s.computeSector=function(e,n,o){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","computeSector","missingLevel"));if(n<0||o<0)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","computeSector","The specified row or column is less than zero."));var s=e.tileDelta.latitude,a=e.tileDelta.longitude,l=n*s-90,h=o*a-180;return new r(l,l+s,h,h+a)},s.createTilesForLevel=function(e,n,o){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","createTilesForLevel","missingLevel"));if(!n)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","createTilesForLevel","The specified tile factory is null or undefined"));if(!o)throw new t(i.logMessage(i.LEVEL_SEVERE,"Tile","createTilesForLevel","missingResult"));for(var a,l,h,u=e.tileDelta.latitude,c=e.tileDelta.longitude,d=e.sector,f=s.computeRow(u,d.minLatitude),p=s.computeRow(u,d.maxLatitude),g=s.computeColumn(c,d.minLongitude),m=s.computeColumn(c,d.maxLongitude),y=f*u-90,E=g*c-180,v=y,_=f;_<=p;_+=1){l=v+u,a=E;for(var b=g;b<=m;b+=1){h=a+c;var S=new r(v,l,a,h),w=n.createTile(S,e,_,b);o.push(w),a=h}v=l}},s}),i("globe/TiledElevationCoverage",["../util/AbsentResourceList","../geom/Angle","../error/ArgumentError","../globe/ElevationCoverage","../globe/ElevationImage","../formats/geotiff/GeoTiffReader","../util/LevelSet","../geom/Location","../util/Logger","../cache/MemoryCache","../geom/Sector","../util/Tile","../util/WWMath"],function(t,e,
94i,r,n,o,s,a,l,h,u,c,d){"use strict";var f=function(e){if(!e)throw new i(l.logMessage(l.LEVEL_SEVERE,"TiledElevationCoverage","constructor","missingConfig"));if(!e.coverageSector)throw new i(l.logMessage(l.LEVEL_SEVERE,"TiledElevationCoverage","constructor","missingSector"));if(!e.resolution)throw new i(l.logMessage(l.LEVEL_SEVERE,"TiledElevationCoverage","constructor","missingResolution"));if(!e.retrievalImageFormat)throw new i(l.logMessage(l.LEVEL_SEVERE,"TiledElevationCoverage","constructor","missingImageFormat"));r.call(this,e.resolution);var n=s.numLevelsForResolution(45/256,e.resolution),o=Math.ceil(n);this.coverageSector=e.coverageSector,this.retrievalImageFormat=e.retrievalImageFormat,this.minElevation=e.minElevation||0,this.maxElevation=e.maxElevation||0,this.pixelIsPoint=!1,this.levels=new s(this.coverageSector,new a(45,45),o,256,256),this.currentTiles=[],this.currentSector=new u(0,0,0,0),this.tileCache=new h(1e6,8e5),this.imageCache=new h(1e7,8e6),this.retrievalQueueSize=WorldWind.configuration.coverageRetrievalQueueSize,this.currentRetrievals=[],this.absentResourceList=new t(3,5e3),this.urlBuilder=e.urlBuilder||null};return f.prototype=Object.create(r.prototype),f.prototype.minAndMaxElevationsForSector=function(t,r){if(!t)throw new i(l.logMessage(l.LEVEL_SEVERE,"TiledElevationCoverage","minAndMaxElevationsForSector","missingSector"));if(!r)throw new i(l.logMessage(l.LEVEL_SEVERE,"TiledElevationCoverage","minAndMaxElevationsForSector","missingResult"));var n=this.levels.levelForTexelSize(t.deltaLatitude()*e.DEGREES_TO_RADIANS/64);if(this.assembleTiles(n,t,!1),0===this.currentTiles.length)return!1;for(var o=!0,s=0,a=this.currentTiles.length;s<a;s++){var h=this.imageCache.entryForKey(this.currentTiles[s].tileKey);if(h&&h.hasData){var u=h.minElevation;r[0]>u&&(r[0]=u);var c=h.maxElevation;r[1]<c&&(r[1]=c)}h&&h.hasData&&!h.hasMissingData||(o=!1)}return o},f.prototype.elevationAtLocation=function(t,e){return this.coverageSector.containsLocation(t,e)?this.pointElevationForLocation(t,e):null},f.prototype.elevationsForGrid=function(t,r,n,o){if(!t)throw new i(l.logMessage(l.LEVEL_SEVERE,"TiledElevationCoverage","elevationsForGrid","missingSector"));if(!r||!n||r<1||n<1)throw new i(l.logMessage(l.LEVEL_SEVERE,"TiledElevationCoverage","elevationsForGrid","The specified number of latitudinal or longitudinal positions is less than one."));var s=t.deltaLatitude()/(r-1)*e.DEGREES_TO_RADIANS,a=this.levels.levelForTexelSize(s);return this.pixelIsPoint?this.pointElevationsForGrid(t,r,n,a,o):this.areaElevationsForGrid(t,r,n,a,o)},f.prototype.pointElevationForLocation=function(t,e){for(var i,r=this.levels.lastLevel(),n=r.tileDelta.latitude,o=r.tileDelta.longitude,s=c.computeRow(n,t),a=c.computeColumn(o,e),l=null,h=r.levelNumber;h>=0;h--){if(i=c.computeTileKey(h,s,a),l=this.imageCache.entryForKey(i)){var u=l.elevationAtLocation(t,e);return isNaN(u)?null:u}s=Math.floor(s/2),a=Math.floor(a/2)}return null},f.prototype.pointElevationsForGrid=function(t,e,i,r,n){if(this.assembleTiles(r,t,!0),0===this.currentTiles.length)return!1;this.currentTiles.sort(function(t,e){return t.level.levelNumber-e.level.levelNumber});for(var o=0,s=this.currentTiles.length;o<s;o++){var a=this.imageCache.entryForKey(this.currentTiles[o].tileKey);a&&a.elevationsForGrid(t,e,i,n)}return!n.includes(NaN)},f.prototype.areaElevationsForGrid=function(t,e,i,r,n){var o,s,a,l,h,u,c=t.minLatitude,d=t.maxLatitude,f=t.minLongitude,p=t.maxLongitude,g=t.deltaLatitude()/(e>1?e-1:1),m=t.deltaLongitude()/(i>1?i-1:1),y=0;for(h=0,o=c;h<e;h+=1,o+=g)for(h===e-1&&(o=d),u=0,s=f;u<i;u+=1,s+=m)u===i-1&&(s=p),isNaN(n[y])&&this.coverageSector.containsLocation(o,s)&&(a=(s+180)/360,l=(o+90)/180,this.areaElevationForCoord(a,l,r.levelNumber,n,y)),y++;return!n.includes(NaN)},f.prototype.areaElevationForCoord=function(t,e,i,r,o){for(var s,a,l,h,u,c,f,p,g,m,y,E,v,_,b,S,w=new Float64Array(4),L=i;L>=0;L--)if(s=this.levels.level(L),a=Math.round(360*s.tileWidth/s.tileDelta.longitude),l=Math.round(180*s.tileHeight/s.tileDelta.latitude),h=1/(2*l),u=1-h,c=0,f=l-1,p=a*d.fract(t),g=l*d.clamp(e,h,u),m=d.mod(Math.floor(p-.5),a),y=d.mod(m+1,a),E=d.clamp(Math.floor(g-.5),c,f),v=d.clamp(E+1,c,f),_=d.fract(p-.5),b=d.fract(g-.5),S=L==i||0==L,this.lookupPixels(m,y,E,v,s,S,w))return!n.isNoData(w[0],w[1],w[2],w[3])&&(r[o]=(1-_)*(1-b)*w[0]+_*(1-b)*w[1]+(1-_)*b*w[2]+_*b*w[3],!0);return!1}
94,f.prototype.lookupPixels=function(t,e,i,r,n,o,s){var a,l,h,u,c=n.levelNumber,d=n.tileWidth,f=n.tileHeight,p=Math.floor(i/f),g=Math.floor(r/f),m=Math.floor(t/d),y=Math.floor(e/d);return p==g&&p==this.cachedRow&&m==y&&m==this.cachedCol?a=l=h=u=this.cachedImage:p==g&&m==y?(a=this.lookupImage(c,p,m,o),l=h=u=a,this.cachedRow=p,this.cachedCol=m,this.cachedImage=a):(a=this.lookupImage(c,p,m,o),l=this.lookupImage(c,p,y,o),h=this.lookupImage(c,g,m,o),u=this.lookupImage(c,g,y,o)),!!(a&&l&&h&&u)&&(s[0]=a.pixel(t%d,i%f),s[1]=l.pixel(e%d,i%f),s[2]=h.pixel(t%d,r%f),s[3]=u.pixel(e%d,r%f),!0)},f.prototype.lookupImage=function(t,e,i,r){var n=c.computeTileKey(t,e,i),o=this.imageCache.entryForKey(n);if(null==o&&r){var s=this.tileForLevel(t,e,i);this.retrieveTileImage(s)}return o},f.prototype.assembleTiles=function(t,e,i){if(this.currentTiles=[],this.currentSector.copy(e),this.currentSector.intersection(this.coverageSector),!this.currentSector.isEmpty())for(var r=t.tileDelta.latitude,n=t.tileDelta.longitude,o=c.computeRow(r,this.currentSector.minLatitude),s=c.computeLastRow(r,this.currentSector.maxLatitude),a=c.computeColumn(n,this.currentSector.minLongitude),l=c.computeLastColumn(n,this.currentSector.maxLongitude),h=o;h<=s;h++)for(var u=a;u<=l;u++)this.addTileOrAncestor(t,h,u,i)},f.prototype.addTileOrAncestor=function(t,e,i,r){var n=this.tileForLevel(t.levelNumber,e,i);this.isTileImageInMemory(n)?this.addToCurrentTiles(n):(r&&this.retrieveTileImage(n),t.isFirstLevel()?this.currentTiles.push(n):this.addAncestor(t,e,i,r))},f.prototype.addAncestor=function(t,e,i,r){for(var n=null,o=Math.floor(e/2),s=Math.floor(i/2),a=t.levelNumber-1;a>=0;a--){if(n=this.tileForLevel(a,o,s),this.isTileImageInMemory(n))return void this.addToCurrentTiles(n);o=Math.floor(o/2),s=Math.floor(s/2)}this.addToCurrentTiles(n),r&&this.retrieveTileImage(n)},f.prototype.addToCurrentTiles=function(t){this.currentTiles.push(t)},f.prototype.tileForLevel=function(t,e,i){var r=c.computeTileKey(t,e,i),n=this.tileCache.entryForKey(r);if(n)return n;var o=this.levels.level(t),s=c.computeSector(o,e,i);return n=new c(s,o,e,i),this.tileCache.putEntry(r,n,n.size()),n},f.prototype.isTileImageInMemory=function(t){return this.imageCache.containsKey(t.tileKey)},f.prototype.resourceUrlForTile=function(t){return this.urlBuilder.urlForTile(t,this.retrievalImageFormat)},f.prototype.retrieveTileImage=function(t){if(this.currentRetrievals.indexOf(t.tileKey)<0){if(this.currentRetrievals.length>this.retrievalQueueSize)return;var e=this.resourceUrlForTile(t,this.retrievalImageFormat),i=new XMLHttpRequest,r=this;if(!e)return;i.open("GET",e,!0),i.responseType="arraybuffer",i.onreadystatechange=function(){if(4===i.readyState){r.removeFromCurrentRetrievals(t.tileKey);var n=i.getResponseHeader("content-type");if(200===i.status)if(n===r.retrievalImageFormat||"text/plain"===n||"application/octet-stream"===n){l.log(l.LEVEL_INFO,"Elevations retrieval succeeded: "+e),r.loadElevationImage(t,i),r.absentResourceList.unmarkResourceAbsent(t.tileKey);var o=document.createEvent("Event");o.initEvent(WorldWind.REDRAW_EVENT_TYPE,!0,!0),window.dispatchEvent(o)}else"text/xml"===n?(r.absentResourceList.markResourceAbsent(t.tileKey),l.log(l.LEVEL_WARNING,"Elevations retrieval failed ("+i.statusText+"): "+e+".\n "+String.fromCharCode.apply(null,new Uint8Array(i.response)))):(r.absentResourceList.markResourceAbsent(t.tileKey),l.log(l.LEVEL_WARNING,"Elevations retrieval failed: "+e+". Unexpected content type "+n));else r.absentResourceList.markResourceAbsent(t.tileKey),l.log(l.LEVEL_WARNING,"Elevations retrieval failed ("+i.statusText+"): "+e)}},i.onerror=function(){r.removeFromCurrentRetrievals(t.tileKey),r.absentResourceList.markResourceAbsent(t.tileKey),l.log(l.LEVEL_WARNING,"Elevations retrieval failed: "+e)},i.ontimeout=function(){r.removeFromCurrentRetrievals(t.tileKey),r.absentResourceList.markResourceAbsent(t.tileKey),l.log(l.LEVEL_WARNING,"Elevations retrieval timed out: "+e)},i.send(null),this.currentRetrievals.push(t.tileKey)}},f.prototype.removeFromCurrentRetrievals=function(t){var e=this.currentRetrievals.indexOf(t);e>-1&&this.currentRetrievals.splice(e,1)},f.prototype.loadElevationImage=function(t,e){var i,r=new n(t.sector,t.tileWidth,t.tileHeight);"application/bil16"===this.retrievalImageFormat?(r.imageData=new Int16Array(e.response),r.size=2*r.imageData.length):"application/bil32"===this.retrievalImageFormat?(r.imageData=new Float32Array(e.response),r.size=4*r.imageData.length):"image/tiff"===this.retrievalImageFormat&&(i=new o(e.response),r.imageData=i.getImageData(),r.size=r.imageData.length*i.metadata.bitsPerSample[0]/8),r.imageData&&(r.findMinAndMaxElevation(),this.imageCache.putEntry(t.tileKey,r,r.size),this.timestamp=Date.now())},f}),i("util/WmsUrlBuilder",["../error/ArgumentError","../util/Logger"],function(t,e){"use strict";
94var i=function(i,r,n,o,s){if(!i||0===i.length)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsUrlBuilder","constructor","The WMS service address is missing."));if(!r||0===r.length)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsUrlBuilder","constructor","The WMS layer names are not specified."));this.serviceAddress=i,this.layerNames=r,this.styleNames=n||"",this.transparent=!0,this.wmsVersion=o&&o.length>0?o:"1.3.0",this.isWms130OrGreater=this.wmsVersion>="1.3.0",this.crs="EPSG:4326",this.timeString=s};return i.prototype.urlForTile=function(r,n){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsUrlBuilder","urlForTile","missingTile"));if(!n)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsUrlBuilder","urlForTile","The image format is null or undefined."));var o=r.sector,s=i.fixGetMapString(this.serviceAddress);return s.search(/service=wms/i)<0&&(s+="service=WMS"),s+="&request=GetMap",s=s+"&version="+this.wmsVersion,s=s+"&transparent="+(this.transparent?"TRUE":"FALSE"),s=s+"&layers="+this.layerNames,s=s+"&styles="+this.styleNames,s=s+"&format="+n,s=s+"&width="+r.tileWidth,s=s+"&height="+r.tileHeight,this.timeString&&(s=s+"&time="+this.timeString),this.isWms130OrGreater?(s=s+"&crs="+this.crs,s+="&bbox=","CRS:84"===this.crs?(s=s+o.minLongitude+","+o.minLatitude+",",s=s+o.maxLongitude+","+o.maxLatitude):(s=s+o.minLatitude+","+o.minLongitude+",",s=s+o.maxLatitude+","+o.maxLongitude)):(s=s+"&srs="+this.crs,s+="&bbox=",s=s+o.minLongitude+","+o.minLatitude+",",s=s+o.maxLongitude+","+o.maxLatitude),s=s.replace(" ","%20")},i.fixGetMapString=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsUrlBuilder","fixGetMapString","The specified service address is null or undefined."));var r=i.indexOf("?");return r<0?i+="?":r!==i.length-1&&(r=i.search(/&$/))<0&&(i+="&"),i},i}),i("globe/AsterV2ElevationCoverage",["../geom/Location","../geom/Sector","../globe/TiledElevationCoverage","../util/WmsUrlBuilder"],function(t,e,i,r){"use strict";var n=function(){i.call(this,{coverageSector:new e(-83.0001,83.0001,-180,180),resolution:.000277777777778,retrievalImageFormat:"application/bil16",minElevation:-11e3,maxElevation:8850,urlBuilder:new r("https://worldwind26.arc.nasa.gov/elev","aster_v2","","1.3.0")}),this.displayName="ASTER V2 Earth Elevation Coverage"};return n.prototype=Object.create(i.prototype),n}),i("shaders/AtmosphereProgram",["../error/ArgumentError","../shaders/GpuProgram","../util/Logger"],function(t,e,i){"use strict";var r=function(t,i,r,n){e.call(this,t,i,r,n),this.FRAGMODE_SKY=1,this.FRAGMODE_GROUND_PRIMARY=2,this.FRAGMODE_GROUND_SECONDARY=3,this.FRAGMODE_GROUND_PRIMARY_TEX_BLEND=4,this.altitude=16e4,this.rayleighScaleDepth=.25,this.fragModeLocation=this.uniformLocation(t,"fragMode"),this.mvpMatrixLocation=this.uniformLocation(t,"mvpMatrix"),this.texCoordMatrixLocation=this.uniformLocation(t,"texCoordMatrix"),this.vertexOriginLocation=this.uniformLocation(t,"vertexOrigin"),this.eyePointLocation=this.uniformLocation(t,"eyePoint"),this.eyeMagnitudeLocation=this.uniformLocation(t,"eyeMagnitude"),this.eyeMagnitude2Location=this.uniformLocation(t,"eyeMagnitude2"),this.lightDirectionLocation=this.uniformLocation(t,"lightDirection"),this.atmosphereRadiusLocation=this.uniformLocation(t,"atmosphereRadius"),this.atmosphereRadius2Location=this.uniformLocation(t,"atmosphereRadius2"),this.globeRadiusLocation=this.uniformLocation(t,"globeRadius"),this.scaleLocation=this.uniformLocation(t,"scale"),this.scaleDepthLocation=this.uniformLocation(t,"scaleDepth"),this.scaleOverScaleDepthLocation=this.uniformLocation(t,"scaleOverScaleDepth"),this.scratchArray9=new Float32Array(9)};return r.key="WorldWindGpuAtmosphereProgram",r.prototype=Object.create(e.prototype),r.prototype.getAltitude=function(){return this.altitude},r.prototype.loadFragMode=function(e,r){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"AtmosphereProgram","loadFragMode","missingFragMode"));e.uniform1i(this.fragModeLocation,r)},r.prototype.loadModelviewProjection=function(e,r){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"AtmosphereProgram","loadModelviewProjection","missingMatrix"));this.loadUniformMatrix(e,r,this.mvpMatrixLocation)},r.prototype.loadVertexOrigin=function(e,r){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"AtmosphereProgram","loadVertexOrigin","missingVector"));e.uniform3f(this.vertexOriginLocation,r[0],r[1],r[2])},r.prototype.loadLightDirection=function(e,r){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"AtmosphereProgram","loadLightDirection","missingVector"));e.uniform3f(this.lightDirectionLocation,r[0],r[1],r[2])},r.prototype.loadEyePoint=function(e,r){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"AtmosphereProgram","loadEyePoint","missingVector"));e.uniform3f(this.eyePointLocation,r[0],r[1],r[2]),e.uniform1f(this.eyeMagnitudeLocation,r.magnitude()),e.uniform1f(this.eyeMagnitude2Location,r.magnitudeSquared())},r.prototype.loadGlobeRadius=function(e,r){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"AtmosphereProgram","loadGlobeRadius","missingGlobeRadius"));var n=r,o=n+this.altitude;e.uniform1f(this.globeRadiusLocation,n),e.uniform1f(this.atmosphereRadiusLocation,o),e.uniform1f(this.atmosphereRadius2Location,o*o)},r.prototype.setScale=function(t){t.uniform1f(this.scaleLocation,1/this.getAltitude()),t.uniform1f(this.scaleDepthLocation,this.rayleighScaleDepth),t.uniform1f(this.scaleOverScaleDepthLocation,1/this.getAltitude()/this.rayleighScaleDepth)},r.prototype.loadTexMatrix=function(e,r){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"AtmosphereProgram","loadTexMatrix","missingMatrix"));r.columnMajorComponents(this.scratchArray9),e.uniformMatrix3fv(this.texCoordMatrixLocation,!1,this.scratchArray9)},r}),i("shaders/GroundProgram",["../shaders/AtmosphereProgram"],function(t){"use strict";var e=function(e){ 95t.call(this,e,"precision mediump int;\nconst int FRAGMODE_GROUND_PRIMARY_TEX_BLEND = 4;\nconst int SAMPLE_COUNT = 2;\nconst float SAMPLES = 2.0;\nconst float PI = 3.141592653589;\nconst float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * PI;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * PI;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 invWavelength = vec3(5.60204474633241, 9.473284437923038, 19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nuniform int fragMode;\nuniform mat4 mvpMatrix;\nuniform mat3 texCoordMatrix;\nuniform vec3 vertexOrigin;\nuniform vec3 eyePoint;\nuniform float eyeMagnitude;\nuniform float eyeMagnitude2;\nuniform vec3 lightDirection;\nuniform float atmosphereRadius;\nuniform float atmosphereRadius2;\nuniform float globeRadius;\nuniform float scale;\nuniform float scaleDepth;\nuniform float scaleOverScaleDepth;\nattribute vec4 vertexPoint;\nattribute vec2 vertexTexCoord;\nvarying vec3 primaryColor;\nvarying vec3 secondaryColor;\nvarying vec2 texCoord;
95\nfloat scaleFunc(float cos) {\n float x = 1.0 - cos;\n return scaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid sampleGround() {\n vec3 point = vertexPoint.xyz + vertexOrigin;\n vec3 ray = point - eyePoint;\n float far = length(ray);\n ray /= far;\n vec3 start;\n if (eyeMagnitude < atmosphereRadius) {\n start = eyePoint;\n } else {\n float B = 2.0 * dot(eyePoint, ray);\n float C = eyeMagnitude2 - atmosphereRadius2;\n float det = max(0.0, B*B - 4.0 * C);\n float near = 0.5 * (-B - sqrt(det));\n start = eyePoint + ray * near;\n far -= near;\n}\n float depth = exp((globeRadius - atmosphereRadius) / scaleDepth);\n float eyeAngle = dot(-ray, point) / length(point);\n float lightAngle = dot(lightDirection, point) / length(point);\n float eyeScale = scaleFunc(eyeAngle);\n float lightScale = scaleFunc(lightAngle);\n float eyeOffset = depth*eyeScale;\n float temp = (lightScale + eyeScale);\n float sampleLength = far / SAMPLES;\n float scaledLength = sampleLength * scale;\n vec3 sampleRay = ray * sampleLength;\n vec3 samplePoint = start + sampleRay * 0.5;\n vec3 frontColor = vec3(0.0, 0.0, 0.0);\n vec3 attenuate = vec3(0.0, 0.0, 0.0);\n for(int i=0; i<SAMPLE_COUNT; i++)\n {\n float height = length(samplePoint);\n float depth = exp(scaleOverScaleDepth * (globeRadius - height));\n float scatter = depth*temp - eyeOffset;\n attenuate = exp(-scatter * (invWavelength * Kr4PI + Km4PI));\n frontColor += attenuate * (depth * scaledLength);\n samplePoint += sampleRay;\n }\n primaryColor = frontColor * (invWavelength * KrESun + KmESun);\n secondaryColor = attenuate;\n}\nvoid main()\n {\n sampleGround();\n gl_Position = mvpMatrix * vertexPoint;\n if (fragMode == FRAGMODE_GROUND_PRIMARY_TEX_BLEND) {\n texCoord = (texCoordMatrix * vec3(vertexTexCoord, 1.0)).st;\n }\n}","precision mediump float;\nprecision mediump int;\nconst int FRAGMODE_GROUND_PRIMARY = 2;\nconst int FRAGMODE_GROUND_SECONDARY = 3;\nconst int FRAGMODE_GROUND_PRIMARY_TEX_BLEND = 4;\nuniform int fragMode;\nuniform sampler2D texSampler;\nvarying vec3 primaryColor;\nvarying vec3 secondaryColor;\nvarying vec2 texCoord;\nvoid main (void)\n{\n if (fragMode == FRAGMODE_GROUND_PRIMARY) {\n gl_FragColor = vec4(primaryColor, 1.0);\n } else if (fragMode == FRAGMODE_GROUND_SECONDARY) {\n gl_FragColor = vec4(secondaryColor, 1.0);\n } else if (fragMode == FRAGMODE_GROUND_PRIMARY_TEX_BLEND) {\n vec4 texColor = texture2D(texSampler, texCoord);\n gl_FragColor = vec4(primaryColor + texColor.rgb * (1.0 - secondaryColor), 1.0);\n }\n}",["vertexPoint","vertexTexCoord"])};return e.key="WorldWindGroundProgram",e.prototype=Object.create(t.prototype),e}),i("layer/Layer",["../util/Logger"],function(t){"use strict";var e=function(t){this.displayName=t||"Layer",this.enabled=!0,this.pickEnabled=!0,this.opacity=1,this.minActiveAltitude=-Number.MAX_VALUE,this.maxActiveAltitude=Number.MAX_VALUE,this.inCurrentFrame=!1,this.time=null};return e.prototype.refresh=function(){},e.prototype.render=function(t){this.inCurrentFrame=!1,this.enabled&&(t.pickingMode&&!this.pickEnabled||this.withinActiveAltitudes(t)&&this.isLayerInView(t)&&this.doRender(t))},e.prototype.doRender=function(t){},e.prototype.withinActiveAltitudes=function(t){var e=t.eyePosition;return!!e&&(e.altitude>=this.minActiveAltitude&&e.altitude<=this.maxActiveAltitude)},e.prototype.isLayerInView=function(t){return!0},e}),i("geom/Matrix3",["../error/ArgumentError","../util/Logger"],function(t,e){"use strict";var i=function(t,e,i,r,n,o,s,a,l){this[0]=t,this[1]=e,this[2]=i,this[3]=r,this[4]=n,this[5
95]=o,this[6]=s,this[7]=a,this[8]=l};return i.prototype=new Float64Array(9),i.fromIdentity=function(){return new i(1,0,0,0,1,0,0,0,1)},i.prototype.setToUnitYFlip=function(){return this[0]=1,this[1]=0,this[2]=0,this[3]=0,this[4]=-1,this[5]=1,this[6]=0,this[7]=0,this[8]=1,this},i.prototype.multiplyMatrix=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"Matrix3","multiplyMatrix","missingMatrix"));var r,n,o,s=this,a=i;return r=s[0],n=s[1],o=s[2],s[0]=r*a[0]+n*a[3]+o*a[6],s[1]=r*a[1]+n*a[4]+o*a[7],s[2]=r*a[2]+n*a[5]+o*a[8],r=s[3],n=s[4],o=s[5],s[3]=r*a[0]+n*a[3]+o*a[6],s[4]=r*a[1]+n*a[4]+o*a[7],s[5]=r*a[2]+n*a[5]+o*a[8],r=s[6],n=s[7],o=s[8],s[6]=r*a[0]+n*a[3]+o*a[6],s[7]=r*a[1]+n*a[4]+o*a[7],s[8]=r*a[2]+n*a[5]+o*a[8],this},i.prototype.multiplyByTileTransform=function(t,e){var i=t.deltaLatitude(),r=t.deltaLongitude(),n=e.deltaLatitude(),o=e.deltaLongitude(),s=r/o,a=i/n,l=(t.minLongitude-e.minLongitude)/o,h=(t.minLatitude-e.minLatitude)/n,u=this;return u[2]+=u[0]*l+u[1]*h,u[5]+=u[3]*l+u[4]*h,u[8]+=u[6]*l+u[6]*h,u[0]*=s,u[1]*=a,u[3]*=s,u[4]*=a,u[6]*=s,u[7]*=a,this},i.prototype.columnMajorComponents=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"Matrix3","columnMajorComponents","missingResult"));return i[0]=this[0],i[1]=this[3],i[2]=this[6],i[3]=this[1],i[4]=this[4],i[5]=this[7],i[6]=this[2],i[7]=this[5],i[8]=this[8],i},i}),i("shaders/SkyProgram",["../shaders/AtmosphereProgram"],function(t){"use strict";var e=function(e){t.call(this,e,"precision mediump int;\nconst int SAMPLE_COUNT = 2;\nconst float SAMPLES = 2.0;\nconst float PI = 3.141592653589;\nconst float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * PI;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * PI;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 invWavelength = vec3(5.60204474633241, 9.473284437923038, 19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nuniform mat4 mvpMatrix;\nuniform vec3 vertexOrigin;\nuniform vec3 eyePoint;\nuniform float eyeMagnitude;\nuniform float eyeMagnitude2;\nuniform mediump vec3 lightDirection;\nuniform float atmosphereRadius;\nuniform float atmosphereRadius2;\nuniform float globeRadius;\nuniform float scale;\nuniform float scaleDepth;\nuniform float scaleOverScaleDepth;\nattribute vec4 vertexPoint;\nvarying vec3 primaryColor;\nvarying vec3 secondaryColor;\nvarying vec3 direction;\nfloat scaleFunc(float cos)\n{\n float x = 1.0 - cos;\n return scaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid sampleSky() {\n vec3 point = vertexPoint.xyz + vertexOrigin;\n vec3 ray = point - eyePoint;\n float far = length(ray);\n ray /= far;\n vec3 start;\n float startOffset;\n if (eyeMagnitude < atmosphereRadius) {\n start = eyePoint;\n float height = length(start);\n float depth = exp(scaleOverScaleDepth * (globeRadius - eyeMagnitude));\n float startAngle = dot(ray, start) / height;\n startOffset = depth*scaleFunc(startAngle);\n } else {\n float B = 2.0 * dot(eyePoint, ray);\n float C = eyeMagnitude2 - atmosphereRadius2;\n float det = max(0.0, B*B - 4.0 * C);\n float near = 0.5 * (-B - sqrt(det));\n start = eyePoint + ray * near;\n far -= near;\n float startAngle = dot(ray, start) / atmosphereRadius;\n float startDepth = exp(-1.0 / scaleDepth);\n startOffset = startDepth*scaleFunc(startAngle);\n }\n float sampleLength = far / SAMPLES;\n float scaledLength = sampleLength * scale;\n vec3 sampleRay = ray * sampleLength;\n vec3 samplePoint = start + sampleRay * 0.5;\n vec3 frontColor = vec3(0.0, 0.0, 0.0);\n for(int i=0; i<SAMPLE_COUNT; i++)\n {\n float height = length(samplePoint);\n float depth = exp(scaleOverScaleDepth * (globeRadius - height));\n float lightAngle = dot(lightDirection, samplePoint) / height;\n float cameraAngle = dot(ray, samplePoint) / height;\n float scatter = (startOffset + depth*(scaleFunc(lightAngle) - scaleFunc(cameraAngle)));\n vec3 attenuate = exp(-scatter * (invWavelength * Kr4PI + Km4PI));\n frontColor += attenuate * (depth * scaledLength);\n samplePoint += sampleRay;\n }\n primaryColor = frontColor * (invWavelength * KrESun);\n secondaryColor = frontColor * KmESun;\n direction = eyePoint - point;\n}\nvoid main()\n{\n sampleSky();\n gl_Position = mvpMatrix * vertexPoint;\n}","#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nconst float g = -0.95;\nconst float g2 = g * g;\nuniform mediump vec3 lightDirection;\nvarying vec3 primaryColor;\nvarying vec3 secondaryColor;\nvarying vec3 direction;\nvoid main (void)\n{\n float cos = dot(lightDirection, direction) / length(direction);\n float rayleighPhase = 0.75 * (1.0 + cos * cos);\n float miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cos*cos) / pow(1.0 + g2 - 2.0*g*cos, 1.5);\n const float exposure = 2.0;\n vec3 color = primaryColor * rayleighPhase + secondaryColor * miePhase;\n color = vec3(1.0) - exp(-exposure * color);\n gl_FragColor = vec4(color, color.b);\n}",["vertexPoint"])};return e.key="WorldWindSkyProgram",e.prototype=Object.create(t.prototype),e}),i("util/SunPosition",["../geom/Angle","../error/ArgumentError","./Logger","./WWMath"],function(t,e,
95i,r){"use strict";return{getAsGeographicLocation:function(t){if(t instanceof Date==!1)throw new e(i.logMessage(i.LEVEL_SEVERE,"SunPosition","getAsGeographicLocation","missingDate"));var r=this.getAsCelestialLocation(t);return this.celestialToGeographic(r,t)},getAsCelestialLocation:function(n){if(n instanceof Date==!1)throw new e(i.logMessage(i.LEVEL_SEVERE,"SunPosition","getAsCelestialLocation","missingDate"));var o=this.computeJulianDate(n),s=o-2451545,a=r.normalizeAngle360(280.46+.9856474*s),l=r.normalizeAngle360(357.528+.9856003*s)*t.DEGREES_TO_RADIANS,h=a+1.915*Math.sin(l)+.02*Math.sin(2*l),u=h*t.DEGREES_TO_RADIANS,c=(23.439-4e-7*s)*t.DEGREES_TO_RADIANS,d=Math.asin(Math.sin(c)*Math.sin(u))*t.RADIANS_TO_DEGREES,f=Math.atan(Math.cos(c)*Math.tan(u))*t.RADIANS_TO_DEGREES;return h>=90&&h<270&&(f+=180),f=r.normalizeAngle360(f),{declination:d,rightAscension:f}},celestialToGeographic:function(n,o){if(!n)throw new e(i.logMessage(i.LEVEL_SEVERE,"SunPosition","celestialToGeographic","missingCelestialLocation"));if(o instanceof Date==!1)throw new e(i.logMessage(i.LEVEL_SEVERE,"SunPosition","celestialToGeographic","missingDate"));var s=this.computeJulianDate(o),a=s-2451545,l=r.normalizeAngle360(280.46061837+360.98564736629*a),h=r.normalizeAngle360(l-n.rightAscension),u=t.normalizedDegreesLongitude(-h);return{latitude:n.declination,longitude:u}},computeJulianDate:function(t){if(t instanceof Date==!1)throw new e(i.logMessage(i.LEVEL_SEVERE,"SunPosition","computeJulianDate","missingDate"));var r=t.getUTCFullYear(),n=t.getUTCMonth()+1,o=t.getUTCDate(),s=t.getUTCHours(),a=t.getUTCMinutes(),l=t.getUTCSeconds(),h=(s+a/60+l/3600)/24;n<=2&&(r-=1,n+=12);var u=Math.floor(r/100),c=2-u+Math.floor(u/4);return Math.floor(365.25*(r+4716))+Math.floor(30.6001*(n+1))+o+c-1524.5+h}}}),i("layer/AtmosphereLayer",["../error/ArgumentError","../shaders/GroundProgram","../layer/Layer","../util/Logger","../geom/Matrix","../geom/Matrix3","../geom/Sector","../shaders/SkyProgram","../util/SunPosition","../geom/Vec3","../util/WWUtil"],function(t,e,i,r,n,o,s,a,l,h,u){"use strict";var c=function(t){i.call(this,"Atmosphere"),this.pickEnabled=!1,this._nightImageSource=t||WorldWind.configuration.baseUrl+"images/dnb_land_ocean_ice_2012.png",this._activeLightDirection=new h(0,0,0),this._fullSphereSector=s.FULL_SPHERE,this._skyData={},this._skyWidth=128,this._skyHeight=128,this._numIndices=0,this._texMatrix=o.fromIdentity(),this._activeTexture=null};return c.prototype=Object.create(i.prototype),Object.defineProperties(c.prototype,{nightImageSource:{get:function(){return this._nightImageSource},set:function(t){this._nightImageSource=t}}}),c.prototype.doRender=function(t){t.globe.is2D()||(this.determineLightDirection(t),this.drawSky(t),this.drawGround(t))},c.prototype.applySkyVertices=function(t){var e,i,r=t.currentGlContext,n=t.currentProgram,o=this._skyData;o.verticesVboCacheKey||(o.verticesVboCacheKey=t.gpuResourceCache.generateCacheKey()),i=t.gpuResourceCache.resourceForKey(o.verticesVboCacheKey),i?(r.bindBuffer(r.ARRAY_BUFFER,i),r.vertexAttribPointer(0,3,r.FLOAT,!1,0,0)):(e=this.assembleVertexPoints(t,this._skyHeight,this._skyWidth,n.getAltitude()),i=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,i),r.bufferData(r.ARRAY_BUFFER,e,r.STATIC_DRAW),r.vertexAttribPointer(0,3,r.FLOAT,!1,0,0),t.gpuResourceCache.putResource(o.verticesVboCacheKey,i,4*e.length),t.frameStatistics.incrementVboLoadCount(1))},c.prototype.applySkyIndices=function(t){var e,i,r=t.currentGlContext,n=this._skyData;n.indicesVboCacheKey||(n.indicesVboCacheKey=t.gpuResourceCache.generateCacheKey()),i=t.gpuResourceCache.resourceForKey(n.indicesVboCacheKey),i?r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i):(e=this.assembleTriStripIndices(this._skyWidth,this._skyHeight),i=r.createBuffer(),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e,r.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),t.gpuResourceCache.putResource(n.indicesVboCacheKey,i,2*e.length))},c.prototype.drawSky=function(t){var e=t.currentGlContext,i=t.findAndBindProgram(a);i.loadGlobeRadius(e,t.globe.equatorialRadius),i.loadEyePoint(e,t.eyePoint),i.loadVertexOrigin(e,h.ZERO),i.loadModelviewProjection(e,t.modelviewProjection),i.loadLightDirection(e,this._activeLightDirection),i.setScale(e),this.applySkyVertices(t),this.applySkyIndices(t),e.depthMask(!1),e.frontFace(e.CW),e.enableVertexAttribArray(0),e.drawElements(e.TRIANGLE_STRIP,this._numIndices,e.UNSIGNED_SHORT,0),e.depthMask(!0),e.frontFace(e.CCW),e.disableVertexAttribArray(0)},c.prototype.drawGround=function(t){var i,r=t.currentGlContext,n=t.findAndBindProgram(e),o=t.terrain;n.loadGlobeRadius(r,t.globe.equatorialRadius),n.loadEyePoint(r,t.eyePoint),n.loadLightDirection(r,this._activeLightDirection),n.setScale(r),this.nightImageSource&&null!==this.time&&(this._activeTexture=t.gpuResourceCache.resourceForKey(this.nightImageSource),this._activeTexture||(this._activeTexture=t.gpuResourceCache.retrieveTexture(r,this.nightImageSource)),i=this._activeTexture&&this._activeTexture.bind(t)),o.beginRendering(t);for(var s=0,a=o.surfaceGeometry.length;s<a;s++){var l=o.surfaceGeometry[s],h=l.referencePoint;n.loadVertexOrigin(r,h),i&&(this._texMatrix.setToUnitYFlip(),this._texMatrix.multiplyByTileTransform(l.sector,this._fullSphereSector),n.loadTexMatrix(r,this._texMatrix)),o.beginRenderingTile(t,l),n.loadFragMode(r,n.FRAGMODE_GROUND_SECONDARY),r.blendFunc(r.DST_COLOR,r.ZERO),o.renderTile(t,l);var u=i?n.FRAGMODE_GROUND_PRIMARY_TEX_BLEND:n.FRAGMODE_GROUND_PRIMARY;n.loadFragMode(r,u),r.blendFunc(r.ONE,r.ONE),o.renderTile(t,l),o.endRenderingTile(t,l)}o.endRendering(t),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),this._activeTexture=null}
95,c.prototype.assembleVertexPoints=function(t,e,i,r){var n=e*i,o=new Array(n);u.fillArray(o,r);var s=new Float32Array(3*n);return t.globe.computePointsForGrid(this._fullSphereSector,e,i,o,h.ZERO,s)},c.prototype.assembleTriStripIndices=function(t,e){for(var i=[],r=0,n=0;n<t-1;n++){for(var o=0;o<e;o++)r=o+n*e,i.push(r+e),i.push(r);n<t-2&&(i.push(r),i.push((n+2)*e))}return this._numIndices=i.length,new Uint16Array(i)},c.prototype.determineLightDirection=function(t){if(null!==this.time){var e=l.getAsGeographicLocation(this.time);t.globe.computePointFromLocation(e.latitude,e.longitude,this._activeLightDirection)}else this._activeLightDirection.copy(t.eyePoint);this._activeLightDirection.normalize()},c}),i("util/BasicTimeSequence",["../error/ArgumentError","../util/Logger"],function(t,e){"use strict";var i=function(i){if(!i&&i.length<2)throw new t(e.logMessage(e.LEVEL_SEVERE,"BasicTimeSequence","constructor","missingDates"));this.dates=i,this.currentIndex=0,this.currentTime=i[0]};return Object.defineProperties(i.prototype,{scaleForCurrentTime:{get:function(){return this.currentTime?this.currentIndex/this.dates.length:1}}}),i.prototype.next=function(){return this.currentIndex>=this.dates.length-1?null:(this.currentIndex++,this.currentTime=this.dates[this.currentIndex],this.currentTime)},i.prototype.previous=function(){return this.currentIndex<=0?null:(this.currentIndex--,this.currentTime=this.dates[this.currentIndex],this.currentTime)},i.prototype.reset=function(){this.currentIndex=-1,this.currentTime=null},i.prototype.getTimeForScale=function(t){return this.currentIndex=t<=0?0:t>=1?this.dates.length-1:Math.floor(this.dates.length*t),this.currentTime=this.dates[this.currentIndex],this.currentTime},i}),i("gesture/Touch",[],function(){"use strict";var t=function(t,e,i){this.identifier=t,this._clientX=e,this._clientY=i,this._clientStartX=e,this._clientStartY=i};return Object.defineProperties(t.prototype,{clientX:{get:function(){return this._clientX},set:function(t){this._clientX=t}},clientY:{get:function(){return this._clientY},set:function(t){this._clientY=t}},translationX:{get:function(){return this._clientX-this._clientStartX},set:function(t){this._clientStartX=this._clientX-t}},translationY:{get:function(){return this._clientY-this._clientStartY},set:function(t){this._clientStartY=this._clientY-t}}}),t}),i("gesture/GestureRecognizer",["../error/ArgumentError","../util/Logger","../gesture/Touch"],function(t,e,i){"use strict";var r=function(i,n){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"GestureRecognizer","constructor","missingTarget"));this.target=i,this.enabled=!0,this._state=WorldWind.POSSIBLE,this._nextState=null,this._clientX=0,this._clientY=0,this._clientStartX=0,this._clientStartY=0,this._translationX=0,this._translationY=0,this._translationWeight=.4,this._mouseButtonMask=0,this._touches=[],this._touchCentroidShiftX=0,this._touchCentroidShiftY=0,this._gestureCallbacks=[],this._canRecognizeWith=[],this._requiresFailureOf=[],this._requiredToFailBy=[],n&&this._gestureCallbacks.push(n),this.listenerList=[],r.allRecognizers.push(this)};return r.allRecognizers=[],Object.defineProperties(r.prototype,{state:{get:function(){return this._state},set:function(t){this.transitionToState(t)}},clientX:{get:function(){return this._clientX},set:function(t){this._clientX=t}},clientY:{get:function(){return this._clientY},set:function(t){this._clientY=t}},translationX:{get:function(){return this._translationX},set:function(t){this._translationX=t,this._clientStartX=this._clientX,this._touchCentroidShiftX=0}},translationY:{get:function(){return this._translationY},set:function(t){this._translationY=t,this._clientStartY=this._clientY,this._touchCentroidShiftY=0}},mouseButtonMask:{get:function(){return this._mouseButtonMask}},touchCount:{get:function(){return this._touches.length}},gestureCallbacks:{get:function(){return this._gestureCallbacks}}}),r.prototype.touch=function(i){if(i<0||i>=this._touches.length)throw new t(e.logMessage(e.LEVEL_SEVERE,"GestureRecognizer","touch","indexOutOfRange"));return this._touches[i]},r.prototype.recognizeSimultaneouslyWith=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"GestureRecognizer","recognizeSimultaneouslyWith","The specified gesture recognizer is null or undefined."));-1==this._canRecognizeWith.indexOf(i)&&(this._canRecognizeWith.push(i),i._canRecognizeWith.push(this))},r.prototype.canRecognizeSimultaneouslyWith=function(t){return-1!=this._canRecognizeWith.indexOf(t)},r.prototype.requireRecognizerToFail=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"GestureRecognizer","requireRecognizerToFail","The specified gesture recognizer is null or undefined"));-1==this._requiresFailureOf.indexOf(i)&&(this._requiresFailureOf.push(i),i._requiredToFailBy.push(this))},r.prototype.requiresRecognizerToFail=function(t){return-1!=this._requiresFailureOf.indexOf(t)},r.prototype.requiredToFailByRecognizer=function(t){return-1!=this._requiredToFailBy.indexOf(t)},r.prototype.reset=function(){this._state=WorldWind.POSSIBLE,this._nextState=null,this._clientX=0,this._clientY=0,this._clientStartX=0,this._clientStartY=0,this._translationX=0,this._translationY=0,this._mouseButtonMask=0,this._touches=[],this._touchCentroidShiftX=0,this._touchCentroidShiftY=0},r.prototype.prepareToRecognize=function(){},r.prototype.mouseDown=function(t){},r.prototype.mouseMove=function(t){},r.prototype.mouseUp=function(t){},r.prototype.touchStart=function(t){},r.prototype.touchMove=function(t){},r.prototype.touchCancel=function(t){},r.prototype.touchEnd=function(t){},r.prototype.transitionToState=function(t){this._nextState=null,t===WorldWind.FAILED?(this._state=t,this.updateRecognizersWaitingForFailure(),this.resetIfEventsEnded()):t===WorldWind.RECOGNIZED?(this.tryToRecognize(t),this._state===t&&(this.prepareToRecognize(),this.notifyListeners(),this.callGestureCallbacks(),this.resetIfEventsEnded())):t===WorldWind.BEGAN?(this.tryToRecognize(t),this._state===t&&(this.prepareToRecognize(),this.notifyListeners(),this.callGestureCallbacks())):t===WorldWind.CHANGED?(this._state=t,this.notifyListeners(),this.callGestureCallbacks()):t===WorldWind.CANCELLED?(this._state=t,this.notifyListeners(),this.callGestureCallbacks(),this.resetIfEventsEnded()):t===WorldWind.ENDED&&(this._state=t,this.notifyListeners(),this.callGestureCallbacks(),this.resetIfEventsEnded())},r.prototype.updateRecognizersWaitingForFailure=function(){for(var t=0,e=this._requiredToFailBy.length;t<e;t++){var i=this._requiredToFailBy[t];null!=i._nextState&&i.transitionToState(i._nextState)}},r.prototype.tryToRecognize=function(t){if(r.allRecognizers.some(this.canBePreventedByRecognizer,this))return void this.transitionToState(WorldWind.FAILED);if(r.allRecognizers.some(this.isWaitingForRecognizerToFail,this))return void(this._nextState=t);for(var e=r.allRecognizers.filter(this.canPreventRecognizer,this),i=0,n=e.length;i<n;i++)e[i].transitionToState(WorldWind.FAILED);this._state=t},r.prototype.canPreventRecognizer=function(t){return this!=t&&this.target==t.target&&t.state==WorldWind.POSSIBLE&&(this.requiredToFailByRecognizer(t)||!this.canRecognizeSimultaneouslyWith(t))},r.prototype.canBePreventedByRecognizer=function(t){return this!=t&&this.target==t.target&&t.state==WorldWind.RECOGNIZED&&(this.requiresRecognizerToFail(t)||!this.canRecognizeSimultaneouslyWith(t))},r.prototype.isWaitingForRecognizerToFail=function(t){return this!=t&&this.target==t.target&&t.state==WorldWind.POSSIBLE&&this.requiresRecognizerToFail(t)},r.prototype.addListener=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"GestureRecognizer","addListener","missingListener"));this.listenerList.push(i)},r.prototype.removeListener=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"GestureRecognizer","removeListener","missingListener"));var r=this.listenerList.indexOf(i);-1!==r&&this.listenerList.splice(r,1)},r.prototype.notifyListeners=function(){for(var t=0;t<this.listenerList.length;t++)this.listenerList[t].gestureStateChanged(this)},r.prototype.callGestureCallbacks=function(){for(var t=0,e=this._gestureCallbacks.length;t<e;t++)this._gestureCallbacks[t](this)},r.prototype.onGestureEvent=function(t){if(this.enabled&&(!t.defaultPrevented||this.state!==WorldWind.POSSIBLE)){var i,r;try{if("mousedown"===t.type)this.handleMouseDown(t);else if("mousemove"===t.type)this.handleMouseMove(t);else if("mouseup"===t.type)this.handleMouseUp(t);else if("touchstart"===t.type)for(i=0,r=t.changedTouches.length;i<r;i++)this.handleTouchStart(t.changedTouches.item(i));else if("touchmove"===t.type)for(i=0,r=t.changedTouches.length;i<r;i++)this.handleTouchMove(t.changedTouches.item(i));else if("touchcancel"===t.type)for(i=0,r=t.changedTouches.length;i<r;i++)this.handleTouchCancel(t.changedTouches.item(i));else if("touchend"===t.type)for(i=0,r=t.changedTouches.length;i<r;i++)this.handleTouchEnd(t.changedTouches.item(i));else"pointerdown"===t.type&&"mouse"===t.pointerType?this.handleMouseDown(t):"pointermove"===t.type&&"mouse"===t.pointerType?this.handleMouseMove(t):"pointercancel"===t.type&&"mouse"===t.pointerType||("pointerup"===t.type&&"mouse"===t.pointerType?this.handleMouseUp(t):"pointerdown"===t.type&&"touch"===t.pointerType?this.handleTouchStart(t):"pointermove"===t.type&&"touch"===t.pointerType?this.handleTouchMove(t):"pointercancel"===t.type&&"touch"===t.pointerType?this.handleTouchCancel(t):"pointerup"===t.type&&"touch"===t.pointerType?this.handleTouchEnd(t):e.logMessage(e.LEVEL_INFO,"GestureRecognizer","handleEvent","Unrecognized event type: "+t.type))}catch(t){e.logMessage(e.LEVEL_SEVERE,"GestureRecognizer","handleEvent","Error handling event.\n"+t.toString())}}},r.prototype.handleMouseDown=function(t){if(!("mousedown"==t.type&&this._touches.length>0)){var e=1<<t.button;e&0!=this._mouseButtonMask||(0==this._mouseButtonMask&&(this._clientX=t.clientX,this._clientY=t.clientY,this._clientStartX=t.clientX,this._clientStartY=t.clientY,this._translationX=0,this._translationY=0),this._mouseButtonMask|=e,this.mouseDown(t))}},r.prototype.handleMouseMove=function(t){if(0!=this._mouseButtonMask&&(this._clientX!=t.clientX||this._clientY!=t._clientY)){var e=t.clientX-this._clientStartX,i=t.clientY-this._clientStartY,r=this._translationWeight;this._clientX=t.clientX,this._clientY=t.clientY,this._translationX=this._translationX*(1-r)+e*r,this._translationY=this._translationY*(1-r)+i*r,this.mouseMove(t)}},r.prototype.handleMouseUp=function(t){var e=1<<t.button;e&0==this._mouseButtonMask||(this._mouseButtonMask&=~e,this.mouseUp(t),0==this._mouseButtonMask&&this.resetIfEventsEnded())},r.prototype.handleTouchStart=function(t){var e=new i(t.identifier||t.pointerId,t.clientX,t.clientY);this._touches.push(e),1==this._touches.length?(this._clientX=t.clientX,this._clientY=t.clientY,this._clientStartX=t.clientX,this._clientStartY=t.clientY,this._translationX=0,this._translationY=0,this._touchCentroidShiftX=0,this._touchCentroidShiftY=0):this.touchesAddedOrRemoved(),this.touchStart(e)},r.prototype.handleTouchMove=function(t){var e=this.indexOfTouchWithId(t.identifier||t.pointerId);if(-1!=e){var i=this._touches[e];if(i.clientX!=t.clientX||i.clientY!=t.clientY){i.clientX=t.clientX,i.clientY=t.clientY;var r=this.touchCentroid(),n=r.clientX-this._clientStartX+this._touchCentroidShiftX,o=r.clientY-this._clientStartY+this._touchCentroidShiftY,s=this._translationWeight;this._clientX=r.clientX,this._clientY=r.clientY,this._translationX=this._translationX*(1-s)+n*s,this._translationY=this._translationY*(1-s)+o*s,this.touchMove(i)}}},r.prototype.handleTouchCancel=function(t){var e=this.indexOfTouchWithId(t.identifier||t.pointerId);if(-1!=e){var i=this._touches[e];this._touches.splice(e,1),this.touchesAddedOrRemoved(),this.touchCancel(i),this.resetIfEventsEnded()}},r.prototype.handleTouchEnd=function(t){var e=this.indexOfTouchWithId(t.identifier||t.pointerId);if(-1!=e){var i=this._touches[e];this._touches.splice(e,1),this.touchesAddedOrRemoved(),this.touchEnd(i),this.resetIfEventsEnded()}},r.prototype.resetIfEventsEnded=function(){this._state!=WorldWind.POSSIBLE&&0==this._mouseButtonMask&&0==this._touches.length&&this.reset()},r.prototype.touchesAddedOrRemoved=function(){this._touchCentroidShiftX+=this._clientX,this._touchCentroidShiftY+=this._clientY;var t=this.touchCentroid();this._clientX=t.clientX,this._clientY=t.clientY,this._touchCentroidShiftX-=this._clientX,this._touchCentroidShiftY-=this._clientY},r.prototype.touchCentroid=function(){for(var t=0,e=0,i=0,r=this._touches.length;i<r;i++){var n=this._touches[i];t+=n.clientX/r,e+=n.clientY/r}return{clientX:t,clientY:e}},r.prototype.indexOfTouchWithId=function(t){for(var e=0,i=this._touches.length;e<i;e++)if(this._touches[e].identifier==t)return e;return-1},r}),i("gesture/ClickRecognizer",["../gesture/GestureRecognizer"],function(t){"use strict";var e=function(e,i){t.call(this,e,i),this.numberOfClicks=1,this.button=0,this.maxMouseMovement=5,this.maxClickDuration=500,this.maxClickInterval=400,this.clicks=[],this.timeout=null};return e.prototype=Object.create(t.prototype),e.prototype.reset=function(){t.prototype.reset.call(this),this.clicks=[],this.cancelFailAfterDelay()},e.prototype.mouseDown=function(t){if(this.state==WorldWind.POSSIBLE)if(this.button!=t.button)this.state=WorldWind.FAILED;else{var e={clientX:this.clientX,clientY:this.clientY};this.clicks.push(e),this.failAfterDelay(this.maxClickDuration)}},e.prototype.mouseMove=function(t){if(this.state==WorldWind.POSSIBLE){var e=this.translationX,i=this.translationY;Math.sqrt(e*e+i*i)>this.maxMouseMovement&&(this.state=WorldWind.FAILED)}},e.prototype.mouseUp=function(t){if(this.state==WorldWind.POSSIBLE&&0==this.mouseButtonMask){this.clicks.length==this.numberOfClicks?(this.clientX=this.clicks[0].clientX,this.clientY=this.clicks[0].clientY,this.state=WorldWind.RECOGNIZED):this.failAfterDelay(this.maxClickInterval)}},e.prototype.touchStart=function(t){this.state==WorldWind.POSSIBLE&&(this.state=WorldWind.FAILED)},e.prototype.failAfterDelay=function(t){var e=this;e.timeout&&window.clearTimeout(e.timeout),e.timeout=window.setTimeout(function(){e.timeout=null,e.state==WorldWind.POSSIBLE&&(e.state=WorldWind.FAILED)},t)},e.prototype.cancelFailAfterDelay=function(){var t=this;t.timeout&&(window.clearTimeout(t.timeout),t.timeout=null)},e}),i("gesture/DragRecognizer",["../gesture/GestureRecognizer"],function(t){"use strict";var e=function(e,i){t.call(this,e,i),this.button=0,this.interpretDistance=5};return e.prototype=Object.create(t.prototype),e.prototype.mouseMove=function(t){this.state==WorldWind.POSSIBLE?this.shouldInterpret()&&(this.shouldRecognize()?(this.translationX=0,this.translationY=0,this.state=WorldWind.BEGAN):this.state=WorldWind.FAILED):this.state!=WorldWind.BEGAN&&this.state!=WorldWind.CHANGED||(this.state=WorldWind.CHANGED)},e.prototype.mouseUp=function(t){0==this.mouseButtonMask&&(this.state==WorldWind.POSSIBLE?this.state=WorldWind.FAILED:this.state!=WorldWind.BEGAN&&this.state!=WorldWind.CHANGED||(this.state=WorldWind.ENDED))},e.prototype.touchStart=function(t){this.state==WorldWind.POSSIBLE&&(this.state=WorldWind.FAILED)},e.prototype.shouldInterpret=function(){var t=this.translationX,e=this.translationY;return Math.sqrt(t*t+e*e)>this.interpretDistance},e.prototype.shouldRecognize=function(){return 1<<this.button==this.mouseButtonMask},e}),i("gesture/PanRecognizer",["../gesture/GestureRecognizer"],function(t){"use strict";var e=function(e,i){t.call(this,e,i),this.minNumberOfTouches=1,this.maxNumberOfTouches=Number.MAX_VALUE,this.interpretDistance=20};return e.prototype=Object.create(t.prototype),e.prototype.mouseDown=function(t){this.state==WorldWind.POSSIBLE&&(this.state=WorldWind.FAILED)},e.prototype.touchMove=function(t){this.state==WorldWind.POSSIBLE?this.shouldInterpret()&&(this.shouldRecognize()?this.state=WorldWind.BEGAN:this.state=WorldWind.FAILED):this.state!=WorldWind.BEGAN&&this.state!=WorldWind.CHANGED||(this.state=WorldWind.CHANGED)},e.prototype.touchEnd=function(t){ 960==this.touchCount&&(this.state==WorldWind.POSSIBLE?this.state=WorldWind.FAILED:this.state!=WorldWind.BEGAN&&this.state!=WorldWind.CHANGED||(this.state=WorldWind.ENDED))},e.prototype.touchCancel=function(t){0==this.touchCount&&(this.state==WorldWind.POSSIBLE?this.state=WorldWind.FAILED:this.state!=WorldWind.BEGAN&&this.state!=WorldWind.CHANGED||(this.state=WorldWind.CANCELLED))},e.prototype.pre
96pareToRecognize=function(){this.translationX=0,this.translationY=0},e.prototype.shouldInterpret=function(){var t=this.translationX,e=this.translationY;return Math.sqrt(t*t+e*e)>this.interpretDistance},e.prototype.shouldRecognize=function(){var t=this.touchCount;return 0!=t&&t>=this.minNumberOfTouches&&t<=this.maxNumberOfTouches},e}),i("gesture/PinchRecognizer",["../gesture/GestureRecognizer"],function(t){"use strict";var e=function(e,i){t.call(this,e,i),this._scale=1,this._offsetScale=1,this.referenceDistance=0,this.interpretThreshold=20,this.weight=.4,this.pinchTouches=[]};return e.prototype=Object.create(t.prototype),Object.defineProperties(e.prototype,{scale:{get:function(){return this._scale*this._offsetScale}}}),e.prototype.reset=function(){t.prototype.reset.call(this),this._scale=1,this._offsetScale=1,this.referenceDistance=0,this.pinchTouches=[]},e.prototype.mouseDown=function(t){this.state==WorldWind.POSSIBLE&&(this.state=WorldWind.FAILED)},e.prototype.touchStart=function(t){this.pinchTouches.length<2&&2==this.pinchTouches.push(t)&&(this.referenceDistance=this.currentPinchDistance(),this._offsetScale*=this._scale,this._scale=1)},e.prototype.touchMove=function(t){if(2==this.pinchTouches.length)if(this.state==WorldWind.POSSIBLE)this.shouldRecognize()&&(this.state=WorldWind.BEGAN);else if(this.state==WorldWind.BEGAN||this.state==WorldWind.CHANGED){var e=this.currentPinchDistance(),i=Math.abs(e/this.referenceDistance),r=this.weight;this._scale=this._scale*(1-r)+i*r,this.state=WorldWind.CHANGED}},e.prototype.touchEnd=function(t){var e=this.pinchTouches.indexOf(t);-1!=e&&this.pinchTouches.splice(e,1),0==this.touchCount&&(this.state==WorldWind.POSSIBLE?this.state=WorldWind.FAILED:this.state!=WorldWind.BEGAN&&this.state!=WorldWind.CHANGED||(this.state=WorldWind.ENDED))},e.prototype.touchCancel=function(t){var e=this.pinchTouches.indexOf(t);-1!=e&&this.pinchTouches.splice(e,1),0==this.touchCount&&(this.state==WorldWind.POSSIBLE?this.state=WorldWind.FAILED:this.state!=WorldWind.BEGAN&&this.state!=WorldWind.CHANGED||(this.state=WorldWind.CANCELLED))},e.prototype.prepareToRecognize=function(){this.referenceDistance=this.currentPinchDistance(),this._scale=1},e.prototype.shouldRecognize=function(){var t=this.currentPinchDistance();return Math.abs(t-this.referenceDistance)>this.interpretThreshold},e.prototype.currentPinchDistance=function(){var t=this.pinchTouches[0],e=this.pinchTouches[1],i=t.clientX-e.clientX,r=t.clientY-e.clientY;return Math.sqrt(i*i+r*r)},e}),i("gesture/RotationRecognizer",["../geom/Angle","../gesture/GestureRecognizer"],function(t,e){"use strict";var i=function(t,i){e.call(this,t,i),this._rotation=0,this._offsetRotation=0,this.referenceAngle=0,this.interpretThreshold=20,this.weight=.4,this.rotationTouches=[]};return i.prototype=Object.create(e.prototype),Object.defineProperties(i.prototype,{rotation:{get:function(){return this._rotation+this._offsetRotation}}}),i.prototype.reset=function(){e.prototype.reset.call(this),this._rotation=0,this._offsetRotation=0,this.referenceAngle=0,this.rotationTouches=[]},i.prototype.mouseDown=function(t){this.state==WorldWind.POSSIBLE&&(this.state=WorldWind.FAILED)},i.prototype.touchStart=function(t){this.rotationTouches.length<2&&2==this.rotationTouches.push(t)&&(this.referenceAngle=this.currentTouchAngle(),this._offsetRotation+=this._rotation,this._rotation=0)},i.prototype.touchMove=function(e){if(2==this.rotationTouches.length)if(this.state==WorldWind.POSSIBLE)this.shouldRecognize()&&(this.state=WorldWind.BEGAN);else if(this.state==WorldWind.BEGAN||this.state==WorldWind.CHANGED){var i=this.currentTouchAngle(),r=t.normalizedDegrees(i-this.referenceAngle),n=this.weight;this._rotation=this._rotation*(1-n)+r*n,this.state=WorldWind.CHANGED}},i.prototype.touchEnd=function(t){var e=this.rotationTouches.indexOf(t);-1!=e&&this.rotationTouches.splice(e,1),0==this.touchCount&&(this.state==WorldWind.POSSIBLE?this.state=WorldWind.FAILED:this.state!=WorldWind.BEGAN&&this.state!=WorldWind.CHANGED||(this.state=WorldWind.ENDED))},i.prototype.touchCancel=function(t){var e=this.rotationTouches.indexOf(t);-1!=e&&(this.rotationTouches.splice(e,1),0==this.touchCount&&(this.state==WorldWind.POSSIBLE?this.state=WorldWind.FAILED:this.state!=WorldWind.BEGAN&&this.state!=WorldWind.CHANGED||(this.state=WorldWind.CANCELLED)))},i.prototype.prepareToRecognize=function(){this.referenceAngle=this.currentTouchAngle(),this._rotation=0},i.prototype.shouldRecognize=function(){var e=this.currentTouchAngle(),i=t.normalizedDegrees(e-this.referenceAngle);return Math.abs(i)>this.interpretThreshold},i.prototype.currentTouchAngle=function(){var e=this.rotationTouches[0],i=this.rotationTouches[1],r=e.clientX-i.clientX,n=e.clientY-i.clientY;return Math.atan2(n,r)*t.RADIANS_TO_DEGREES},i}),i("gesture/TapRecognizer",["../gesture/GestureRecognizer"],function(t){"use strict";var e=function(e,i){t.call(this,e,i),this.numberOfTaps=1,this.numberOfTouches=1,this.maxTouchMovement=20,this.maxTapDuration=500,this.maxTapInterval=400,this.taps=[],this.timeout=null};return e.prototype=Object.create(t.prototype),e.prototype.reset=function(){t.prototype.reset.call(this),this.taps=[],this.cancelFailAfterDelay()},e.prototype.mouseDown=function(t){this.state==WorldWind.POSSIBLE&&(this.state=WorldWind.FAILED)},e.prototype.touchStart=function(t){if(this.state==WorldWind.POSSIBLE){var e;this.touchCount>this.numberOfTouches?this.state=WorldWind.FAILED:1==this.touchCount?(e={touchCount:this.touchCount,clientX:this.clientX,clientY:this.clientY},this.taps.push(e),this.failAfterDelay(this.maxTapDuration)):(e=this.taps[this.taps.length-1],e.touchCount=this.touchCount,e.clientX=this.clientX,e.clientY=this.clientY)}},e.prototype.touchMove=function(t){if(this.state==WorldWind.POSSIBLE){var e=this.translationX,i=this.translationY;Math.sqrt(e*e+i*i)>this.maxTouchMovement&&(this.state=WorldWind.FAILED)}},e.prototype.touchEnd=function(t){if(this.state==WorldWind.POSSIBLE&&0==this.touchCount){var e=this.taps.length;this.taps[e-1].touchCount!=this.numberOfTouches?this.state=WorldWind.FAILED:e==this.numberOfTaps?(this.clientX=this.taps[0].clientX,this.clientY=this.taps[0].clientY,this.state=WorldWind.RECOGNIZED):this.failAfterDelay(this.maxTapInterval)}},e.prototype.touchCancel=function(t){this.state==WorldWind.POSSIBLE&&(this.state=WorldWind.FAILED)},e.prototype.failAfterDelay=function(t){var e=this;e.timeout&&window.clearTimeout(e.timeout),e.timeout=window.setTimeout(function(){e.timeout=null,e.state==WorldWind.POSSIBLE&&(e.state=WorldWind.FAILED)},t)},e.prototype.cancelFailAfterDelay=function(){var t=this;t.timeout&&(window.clearTimeout(t.timeout),t.timeout=null)},e}),i("gesture/TiltRecognizer",["../gesture/PanRecognizer"],function(t){"use strict";var e=function(e,i){t.call(this,e,i),this.maxTouchDistance=250,this.maxTouchDivergence=50};return e.LEFT=1,e.RIGHT=2,e.UP=4,e.DOWN=8,e.prototype=Object.create(t.prototype),e.prototype.shouldInterpret=function(){for(var t=0,e=this.touchCount;t<e;t++){var i=this.touch(t),r=i.translationX,n=i.translationY;if(Math.sqrt(r*r+n*n)>this.interpretDistance)return!0}return!1},e.prototype.shouldRecognize=function(){if(this.touchCount<2)return!1;var t=this.touch(0),i=this.touch(1),r=t.clientX-i.clientX,n=t.clientY-i.clientY;if(Math.sqrt(r*r+n*n)>this.maxTouchDistance)return!1;var o=t.translationX-i.translationX,s=t.translationY-i.translationY;if(Math.sqrt(o*o+s*s)>this.maxTouchDivergence)return!1;var a=e.UP|e.DOWN;return 0!=(this.touchDirection(t)&a&this.touchDirection(i)&a)},e.prototype.touchDirection=function(t){var i=t.translationX,r=t.translationY,n=0;return Math.abs(i)>Math.abs(r)?(n|=i<0?e.LEFT:0,n|=i>0?e.RIGHT:0):(n|=r<0?e.UP:0,n|=r>0?e.DOWN:0),n},e}),i("WorldWindowController",["./error/ArgumentError","./util/Logger","./error/UnsupportedOperationError"],function(t,e,
96i){"use strict";var r=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WorldWindowController","constructor","missingWorldWindow"));this.wwd=i,this.allGestureListeners=[]};return r.prototype.onGestureEvent=function(t){for(var e=!1,i=0;i<this.allGestureListeners.length&&!e;i++)e|=this.allGestureListeners[i].onGestureEvent(t);return e},r.prototype.gestureStateChanged=function(t){throw new i(e.logMessage(e.LEVEL_SEVERE,"WorldWindowController","gestureStateChanged","abstractInvocation"))},r.prototype.addGestureListener=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WorldWindowController","addGestureListener","missingListener"));this.allGestureListeners.push(i)},r.prototype.removeGestureListener=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WorldWindowController","removeGestureListener","missingListener"));var r=this.allGestureListeners.indexOf(i);-1!==r&&this.allGestureListeners.splice(r,1)},r.prototype.applyLimits=function(){},r}),i("BasicWorldWindowController",["./geom/Angle","./error/ArgumentError","./gesture/ClickRecognizer","./gesture/DragRecognizer","./gesture/GestureRecognizer","./util/Logger","./geom/Matrix","./gesture/PanRecognizer","./gesture/PinchRecognizer","./geom/Position","./gesture/RotationRecognizer","./gesture/TapRecognizer","./gesture/TiltRecognizer","./geom/Vec2","./geom/Vec3","./WorldWindowController","./ut
96il/WWMath"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g,m){"use strict";var y=function(t){g.call(this,t),this.primaryDragRecognizer=new r(this.wwd,null),this.primaryDragRecognizer.addListener(this),this.secondaryDragRecognizer=new r(this.wwd,null),this.secondaryDragRecognizer.addListener(this),this.secondaryDragRecognizer.button=2,this.panRecognizer=new a(this.wwd,null),this.panRecognizer.addListener(this),this.pinchRecognizer=new l(this.wwd,null),this.pinchRecognizer.addListener(this),this.rotationRecognizer=new u(this.wwd,null),this.rotationRecognizer.addListener(this),this.tiltRecognizer=new d(this.wwd,null),this.tiltRecognizer.addListener(this),this.panRecognizer.recognizeSimultaneouslyWith(this.pinchRecognizer),this.panRecognizer.recognizeSimultaneouslyWith(this.rotationRecognizer),this.pinchRecognizer.recognizeSimultaneouslyWith(this.rotationRecognizer),this.panRecognizer.requireRecognizerToFail(this.tiltRecognizer),this.pinchRecognizer.requireRecognizerToFail(this.tiltRecognizer),this.rotationRecognizer.requireRecognizerToFail(this.tiltRecognizer),this.beginPoint=new f(0,0),this.lastPoint=new f(0,0),this.beginHeading=0,this.beginTilt=0,this.beginRange=0,this.lastRotation=0};return y.prototype=Object.create(g.prototype),y.prototype.onGestureEvent=function(t){var e=g.prototype.onGestureEvent.call(this,t);if(!e)if("wheel"===t.type)e=!0,this.handleWheelEvent(t);else for(var i=0,r=n.allRecognizers.length;i<r;i++){var o=n.allRecognizers[i];o.target===this.wwd&&(e|=o.onGestureEvent(t))}return e},y.prototype.gestureStateChanged=function(t){t===this.primaryDragRecognizer||t===this.panRecognizer?this.handlePanOrDrag(t):t===this.secondaryDragRecognizer?this.handleSecondaryDrag(t):t===this.pinchRecognizer?this.handlePinch(t):t===this.rotationRecognizer?this.handleRotation(t):t===this.tiltRecognizer&&this.handleTilt(t)},y.prototype.handlePanOrDrag=function(t){this.wwd.globe.is2D()?this.handlePanOrDrag2D(t):this.handlePanOrDrag3D(t)},y.prototype.handlePanOrDrag3D=function(e){var i=e.state,r=e.translationX,n=e.translationY,o=this.wwd.navigator;if(i===WorldWind.BEGAN)this.lastPoint.set(0,0);else if(i===WorldWind.CHANGED){var s=this.wwd.canvas,a=this.wwd.globe,l=m.max(a.equatorialRadius,a.polarRadius),h=m.max(1,o.range),u=m.perspectivePixelSize(s.clientWidth,s.clientHeight,h),c=(n-this.lastPoint[1])*u,d=-(r-this.lastPoint[0])*u,f=c/l*t.RADIANS_TO_DEGREES,p=d/l*t.RADIANS_TO_DEGREES,g=Math.sin(o.heading*t.DEGREES_TO_RADIANS),y=Math.cos(o.heading*t.DEGREES_TO_RADIANS);o.lookAtLocation.latitude+=f*y-p*g,o.lookAtLocation.longitude+=f*g+p*y,this.lastPoint.set(r,n),this.applyLimits(),this.wwd.redraw()}},y.prototype.handlePanOrDrag2D=function(t){var e=t.state,i=t.clientX,r=t.clientY,n=t.translationX,o=t.translationY,a=this.wwd.navigator;if(e===WorldWind.BEGAN)this.beginPoint.set(i,r),this.lastPoint.set(i,r);else if(e===WorldWind.CHANGED){var l=this.lastPoint[0],h=this.lastPoint[1],u=this.beginPoint[0]+n,c=this.beginPoint[1]+o;this.lastPoint.set(u,c);var d=this.wwd.globe,f=this.wwd.rayThroughScreenPoint(this.wwd.canvasCoordinates(l,h)),g=new p(0,0,0),m=new p(0,0,0),y=new p(0,0,0);if(!d.intersectsLine(f,g))return;if(f=this.wwd.rayThroughScreenPoint(this.wwd.canvasCoordinates(u,c)),!d.intersectsLine(f,m))return;var E=s.fromIdentity();if(this.wwd.computeViewingTransform(null,E),E.multiplyByTranslation(m[0]-g[0],m[1]-g[1],m[2]-g[2]),E.extractEyePoint(f.origin),E.extractForwardVector(f.direction),!d.intersectsLine(f,y))return;var v=E.extractViewingParameters(y,a.roll,d,{});a.lookAtLocation.copy(v.origin),a.range=v.range,a.heading=v.heading,a.tilt=v.tilt,a.roll=v.roll,this.applyLimits(),this.wwd.redraw()}},y.prototype.handleSecondaryDrag=function(t){var e=t.state,i=t.translationX,r=t.translationY,n=this.wwd.navigator;if(e===WorldWind.BEGAN)this.beginHeading=n.heading,this.beginTilt=n.tilt;else if(e===WorldWind.CHANGED){var o=180*i/this.wwd.canvas.clientWidth,s=90*r/this.wwd.canvas.clientHeight;n.heading=this.beginHeading+o,n.tilt=this.beginTilt+s,this.applyLimits(),this.wwd.redraw()}},y.prototype.handlePinch=function(t){var e=this.wwd.navigator,i=t.state,r=t.scale;i===WorldWind.BEGAN?this.beginRange=e.range:i===WorldWind.CHANGED&&0!==r&&(e.range=this.beginRange/r,this.applyLimits(),this.wwd.redraw())},y.prototype.handleRotation=function(t){var e=this.wwd.navigator,i=t.state,r=t.rotation;i===WorldWind.BEGAN?this.lastRotation=0:i===WorldWind.CHANGED&&(e.heading-=r-this.lastRotation,this.lastRotation=r,this.applyLimits(),this.wwd.redraw())},y.prototype.handleTilt=function(t){var e=this.wwd.navigator,i=t.state,r=t.translationY;if(i===WorldWind.BEGAN)this.beginTilt=e.tilt;else if(i===WorldWind.CHANGED){var n=-90*r/this.wwd.canvas.clientHeight;
96e.tilt=this.beginTilt+n,this.applyLimits(),this.wwd.redraw()}},y.prototype.handleWheelEvent=function(t){var e,i=this.wwd.navigator;t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?e=t.deltaY:t.deltaMode===WheelEvent.DOM_DELTA_LINE?e=40*t.deltaY:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e=400*t.deltaY);var r=1+e/1e3;i.range*=r,this.applyLimits(),this.wwd.redraw()},y.prototype.applyLimits=function(){var e=this.wwd.navigator;if(e.lookAtLocation.latitude=m.clamp(e.lookAtLocation.latitude,-90,90),e.lookAtLocation.longitude=t.normalizedDegreesLongitude(e.lookAtLocation.longitude),e.range=m.clamp(e.range,1,Number.MAX_VALUE),e.heading=t.normalizedDegrees(e.heading),e.tilt=m.clamp(e.tilt,0,90),e.roll=t.normalizedDegrees(e.roll),this.wwd.globe.is2D()&&e.enable2DLimits){var i=2*Math.PI*this.wwd.globe.equatorialRadius;e.range=m.clamp(e.range,1,i),e.tilt=0}},y}),i("util/ImageSource",["../error/ArgumentError","../util/Color","../util/Logger"],function(t,e,i){"use strict";var r=function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"ImageSource","constructor","missingImage"));this.image=e,this.key="ImageSource "+ ++r.keyPool};return r.keyPool=0,r}),i("shapes/ScreenImage",["../error/ArgumentError","../shaders/BasicTextureProgram","../util/Color","../util/ImageSource","../util/Logger","../geom/Matrix","../util/Offset","../pick/PickedObject","../render/Renderable","../geom/Vec3","../util/WWMath"],function(t,e,i,r,n,o,s,a,l,h,u){"use strict";var c=function(e,r){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"ScreenImage","constructor","missingOffset"));if(!r)throw new t(n.logMessage(n.LEVEL_SEVERE,"ScreenImage","constructor","missingImage"));l.call(this),this.screenOffset=e,this._imageSource=r,this.imageColor=i.WHITE,this.imageOffset=new s(WorldWind.OFFSET_FRACTION,.5,WorldWind.OFFSET_FRACTION,.5),this.imageScale=1,this.imageRotation=0,this.imageTilt=0,this.enabled=!0,this.opacity=1,this.pickDelegate=null,this.activeTexture=null,this.imageTransform=o.fromIdentity(),this.texCoordMatrix=o.fromIdentity(),this.imageBounds=null,this.layer=null};return c.matrix=o.fromIdentity(),c.prototype=Object.create(l.prototype),Object.defineProperties(c.prototype,{imageSource:{get:function(){return this._imageSource},set:function(e){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"ScreenImage","imageSource","missingImage"));this._imageSource=e,this.imageSourceWasUpdated=!0}}}),c.prototype.render=function(t){if(this.enabled&&t.accumulateOrderedRenderables){var e=null;this.lastFrameTime!==t.timestamp&&(e=this.makeOrderedRenderable(t)),e&&e.isVisible(t)&&(e.layer=t.currentLayer,this.lastFrameTime=t.timestamp,t.addOrderedRenderable(e))}},c.prototype.renderOrdered=function(t){if(this.drawOrderedScreenImage(t),t.pickingMode){var e=new a(this.pickColor.clone(),this.pickDelegate?this.pickDelegate:this,null,this.layer,!1);t.resolvePick(e)}},c.prototype.makeOrderedRenderable=function(t){var e,i,r,n,o,s,a;return this.activeTexture=this.getActiveTexture(t),this.activeTexture&&!this.imageSourceWasUpdated||(this.activeTexture=t.gpuResourceCache.retrieveTexture(t.currentGlContext,this._imageSource),this.activeTexture)?(this.eyeDistance=0,e=this.activeTexture.imageWidth,i=this.activeTexture.imageHeight,r=this.imageScale,s=this.imageOffset.offsetForSize(e,i),n=t.viewport.width,o=t.viewport.height,a=this.screenOffset.offsetForSize(n,o),this.imageTransform.setTranslation(a[0]-s[0]*r,a[1]-s[1]*r,0),this.imageTransform.setScale(e*r,i*r,1),this.imageBounds=u.boundingRectForUnitQuad(this.imageTransform),this):null},c.prototype.getActiveTexture=function(t){return t.gpuResourceCache.resourceForKey(this._imageSource)},c.prototype.isVisible=function(t){return t.pickingMode?t.pickRectangle&&this.imageBounds.intersects(t.pickRectangle):this.imageBounds.intersects(t.viewport)},c.prototype.drawOrderedScreenImage=function(t){this.beginDrawing(t);try{this.doDrawOrderedScreenImage(t)}finally{this.endDrawing(t)}},c.prototype.beginDrawing=function(t){var i,r=t.currentGlContext;t.findAndBindProgram(e),i=t.currentProgram,r.bindBuffer(r.ARRAY_BUFFER,t.unitQuadBuffer()),r.vertexAttribPointer(i.vertexTexCoordLocation,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(i.vertexPointLocation),r.enableVertexAttribArray(i.vertexTexCoordLocation),i.loadTextureUnit(r,r.TEXTURE0),i.loadModulateColor(r,t.pickingMode),r.disable(r.DEPTH_TEST)},c.prototype.endDrawing=function(t){var e=t.currentGlContext,i=t.currentProgram;e.disableVertexAttribArray(i.vertexPointLocation),e.disableVertexAttribArray(i.vertexTexCoordLocation),e.bindBuffer(e.ARRAY_BUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.enable(e.DEPTH_TEST)},c.prototype.doDrawOrderedScreenImage=function(t){var e=t.currentGlContext,i=t.currentProgram;e.bindBuffer(e.ARRAY_BUFFER,t.unitQuadBuffer3()),e.vertexAttribPointer(i.vertexPointLocation,3,e.FLOAT,!1,0,0),c.matrix.copy(t.screenProjection),c.matrix.multiplyMatrix(this.imageTransform),c.matrix.multiplyByTranslation(.5,.5,.5),c.matrix.multiplyByRotation(1,0,0,this.imageTilt),c.matrix.multiplyByRotation(0,0,1,this.imageRotation),c.matrix.multiplyByTranslation(-.5,-.5,0),i.loadModelviewProjection(e,c.matrix),i.loadTextureEnabled(e,!0),t.pickingMode?(this.pickColor=t.uniquePickColor(),i.loadColor
96(e,this.pickColor),i.loadOpacity(e,1)):(i.loadColor(e,this.imageColor),i.loadOpacity(e,this.opacity*this.layer.opacity)),this.texCoordMatrix.setToIdentity(),this.texCoordMatrix.multiplyByTextureTransform(this.activeTexture),i.loadTextureMatrix(e,this.texCoordMatrix),this.activeTexture.bind(t)&&e.drawArrays(e.TRIANGLE_STRIP,0,4)},c}),i("render/TextureTile",["../error/ArgumentError","../util/Logger","../util/Tile"],function(t,e,i){"use strict";var r=function(t,e,r,n){i.call(this,t,e,r,n),this.gpuCacheKey=null};return r.prototype=Object.create(i.prototype),r.prototype.size=function(){return i.prototype.size.call(this)},r.prototype.bind=function(t){var e=t.gpuResourceCache.resourceForKey(this.gpuCacheKey);return!!e&&e.bind(t)},r.prototype.applyInternalTransform=function(t,e){},r}),i("render/ImageTile",["../error/ArgumentError","../util/Logger","../render/TextureTile","../util/Tile"],function(t,e,i,r){"use strict";var n=function(r,n,o,s,a){if(!a||a.length<1)throw new t(e.logMessage(e.LEVEL_SEVERE,"ImageTile","constructor","The specified image path is null, undefined or zero length."));i.call(this,r,n,o,s),this.imagePath=a,this.fallbackTile=null,this.gpuCacheKey=a};return n.prototype=Object.create(i.prototype),n.prototype.size=function(){return this.__proto__.__proto__.size.call(this)+this.imagePath.length+8},n.prototype.bind=function(t){return!!this.__proto__.__proto__.bind.call(this,t)||!!this.fallbackTile&&this.fallbackTile.bind(t)},n.prototype.applyInternalTransform=function(t,e){this.fallbackTile&&!t.gpuResourceCache.resourceForKey(this.imagePath)&&this.applyFallbackTransform(e)},n.prototype.applyFallbackTransform=function(t){if(!(this.level.levelNumber-this.fallbackTile.level.levelNumber<=0)){var e=this.fallbackTile.sector.deltaLatitude(),i=this.fallbackTile.sector.deltaLongitude(),r=this.sector.deltaLongitude()/i,n=this.sector.deltaLatitude()/e,o=(this.sector.minLongitude-this.fallbackTile.sector.minLongitude)/i,s=(this.sector.minLatitude-this.fallbackTile.sector.minLatitude)/e;t.multiply(r,0,0,o,0,n,0,s,0,0,1,0,0,0,0,1)}},n}),i("layer/TiledImageLayer",["../util/AbsentResourceList","../error/ArgumentError","../render/ImageTile","../layer/Layer","../util/LevelSet","../util/Logger","../geom/Matrix","../cache/MemoryCache","../render/Texture","../util/Tile","../util/WWUtil"],function(t,e,i,r,n,o,s,a,l,h,u){"use strict";var c=function(i,l,h,u,c,d,f){if(!i)throw new e(o.logMessage(o.LEVEL_SEVERE,"TiledImageLayer","constructor","missingSector"));if(!l)throw new e(o.logMessage(o.LEVEL_SEVERE,"TiledImageLayer","constructor","The specified level-zero delta is null or undefined."));if(!u)throw new e(o.logMessage(o.LEVEL_SEVERE,"TiledImageLayer","constructor","The specified image format is null or undefined."));if(!c)throw new e(o.logMessage(o.LEVEL_SEVERE,"TiledImageLayer","constructor","The specified cache path is null or undefined."));if(!h||h<1)throw new e(o.logMessage(o.LEVEL_SEVERE,"TiledImageLayer","constructor","The specified number of levels is less than one."));if(!d||!f||d<1||f<1)throw new e(o.logMessage(o.LEVEL_SEVERE,"TiledImageLayer","constructor","The specified tile width or height is less than one."));r.call(this,"Tiled Image Layer"),this.retrievalImageFormat=u,this.cachePath=c,this.retrievalQueueSize=WorldWind.configuration.layerRetrievalQueueSize,this.levels=new n(i,l,h,d,f),this.detailControl=1.75,this.crossOrigin="anonymous",this.expiration=null,this.currentTiles=[],this.currentTilesInvalid=!0,this.tileCache=new a(5e5,4e5),this.currentRetrievals=[],this.absentResourceList=new t(3,5e4),this.pickEnabled=!1,this.lasTtMVP=s.fromIdentity()};return c.prototype=Object.create(r.prototype),c.prototype.refresh=function(){this.expiration=new Date,this.currentTilesInvalid=!0},c.prototype.prePopulate=function(t){if(!t)throw new e(o.logMessage(o.LEVEL_SEVERE,"TiledImageLayer","prePopulate","missingWorldWindow"));var i=t.drawContext;this.topLevelTiles&&0!==this.topLevelTiles.length||this.createTopLevelTiles(i);for(var r=0;r<this.topLevelTiles.length;r++){var n=this.topLevelTiles[r];this.isTileTextureInMemory(i,n)||this.retrieveTileImage(i,n,!0)}},c.prototype.prePopulateCurrentTiles=function(t){if(!t)throw new e(o.logMessage(o.LEVEL_SEVERE,"TiledImageLayer","prePopulate","missingWorldWindow"));var i=t.drawContext;this.assembleTiles(i);for(var r=0,n=this.currentTiles.length;r<n;r++){var s=this.currentTiles[r];this.isTileTextureInMemory(i,s)||this.retrieveTileImage(i,s,!0)}},c.prototype.isPrePopulated=function(t){if(!t)throw new e(o.logMessage(o.LEVEL_SEVERE,"TiledImageLayer","isPrePopulated","missingWorldWindow"));for(var i=0;i<this.topLevelTiles.length;i++)if(!this.isTileTextureInMemory(t.drawContext,this.topLevelTiles[i]))return!1;return!0},c.prototype.createTile=function(t,e,r,n){var o=this.cachePath+"-layer/"+e.levelNumber+"/"+r+"/"+r+"_"+n+"."+u.suffixForMimeType(this.retrievalImageFormat);return new i(t,e,r,n,o)},c.prototype.doRender=function(t){if(t.terrain){if(this.currentTilesInvali
96d||!t.modelviewProjection.equals(this.lasTtMVP)||t.globeStateKey!==this.lastGlobeStateKey)if(this.currentTilesInvalid=!1,t.surfaceOpacity>=1&&this.opacity>=1){this.previousTiles={};for(var e=0;e<this.currentTiles.length;e++)this.previousTiles[this.currentTiles[e].imagePath]=this.currentTiles[e];this.assembleTiles(t),this.fadeOutgoingTiles(t)}else this.assembleTiles(t);this.lasTtMVP.copy(t.modelviewProjection),this.lastGlobeStateKey=t.globeStateKey,this.currentTiles.length>0&&(t.surfaceTileRenderer.renderTiles(t,this.currentTiles,this.opacity,t.surfaceOpacity>=1),t.frameStatistics.incrementImageTileCount(this.currentTiles.length),this.inCurrentFrame=!0)}},c.prototype.fadeOutgoingTiles=function(t){for(var e=(t.timestamp-t.previousRedrawTimestamp)/t.fadeTime,i={},r=0;r<this.currentTiles.length;r++){var n=this.currentTiles[r];i[n.imagePath]=n}for(var o in this.previousTiles)this.previousTiles.hasOwnProperty(o)&&(n=this.previousTiles[o],n.opacity>0&&!i[n.imagePath]&&(n.opacity=Math.max(0,n.opacity-e),n.opacity>0&&(this.currentTiles.push(n),this.currentTilesInvalid=!0,t.redrawRequested=!0)))},c.prototype.isLayerInView=function(t){return t.terrain&&t.terrain.sector&&t.terrain.sector.intersects(this.levels.sector)},c.prototype.createTopLevelTiles=function(t){this.topLevelTiles=[],h.createTilesForLevel(this.levels.firstLevel(),this,this.topLevelTiles)},c.prototype.assembleTiles=function(t){this.currentTiles=[],this.topLevelTiles&&0!==this.topLevelTiles.length||this.createTopLevelTiles(t);for(var e=0,i=this.topLevelTiles.length;e<i;e++){var r=this.topLevelTiles[e];r.update(t),this.currentAncestorTile=null,this.isTileVisible(t,r)&&this.addTileOrDescendants(t,r)}},c.prototype.addTileOrDescendants=function(t,e){if(this.tileMeetsRenderingCriteria(t,e))return void this.addTile(t,e);var i=null;try{(this.isTileTextureInMemory(t,e)||0===e.level.levelNumber)&&(i=this.currentAncestorTile,this.currentAncestorTile=e);for(var r=this.levels.level(e.level.levelNumber+1),n=e.subdivideToCache(r,this,this.tileCache),o=0,s=n.length;o<s;o++){var a=n[o];a.update(t),this.levels.sector.intersects(a.sector)&&this.isTileVisible(t,a)&&this.addTileOrDescendants(t,a)}}finally{i&&(this.currentAncestorTile=i)}},c.prototype.addTile=function(t,e){e.fallbackTile=null;var i=t.gpuResourceCache.resourceForKey(e.imagePath);if(i)return e.opacity=1,this.currentTiles.push(e),void(this.expiration&&this.isTextureExpired(i)&&this.retrieveTileImage(t,e));this.retrieveTileImage(t,e),this.currentAncestorTile&&this.isTileTextureInMemory(t,this.currentAncestorTile)&&(e.fallbackTile=this.currentAncestorTile,e.fallbackTile.opacity=1,this.currentTiles.push(e))},c.prototype.isTileVisible=function(t,e){return!(t.globe.projectionLimits&&!e.sector.overlaps(t.globe.projectionLimits))&&e.extent.intersectsFrustum(t.frustumInModelCoordinates)},c.prototype.tileMeetsRenderingCriteria=function(t,e){var i=this.detailControl;return(e.sector.minLatitude>=75||e.sector.maxLatitude<=-75)&&(i*=1.2),e.level.isLastLevel()||!e.mustSubdivide(t,i)},c.prototype.isTileTextureInMemory=function(t,e){return t.gpuResourceCache.containsResource(e.imagePath)},c.prototype.isTextureExpired=function(t){return this.expiration&&t.creationTime.getTime()<=this.expiration.getTime()},c.prototype.retrieveTileImage=function(t,e,i){if(this.currentRetrievals.indexOf(e.imagePath)<0){if(this.currentRetrievals.length>this.retrievalQueueSize)return;if(this.absentResourceList.isResourceAbsent(e.imagePath))return;var r=this.resourceUrlForTile(e,this.retrievalImageFormat),n=new Image,s=e.imagePath,a=t.gpuResourceCache,l=t.currentGlContext.canvas,h=this;if(!r)return void(this.currentTilesInvalid=!0);n.onload=function(){o.log(o.LEVEL_INFO,"Image retrieval succeeded: "+r);var u=h.createTexture(t,e,n);if(h.removeFromCurrentRetrievals(s),u&&(a.putResource(s,u,u.size),h.currentTilesInvalid=!0,h.absentResourceList.unmarkResourceAbsent(s),!i)){var c=document.createEvent("Event");c.initEvent(WorldWind.REDRAW_EVENT_TYPE,!0,!0),l.dispatchEvent(c)}},n.onerror=function(){h.removeFromCurrentRetrievals(s),h.absentResourceList.markResourceAbsent(s),o.log(o.LEVEL_WARNING,"Image retrieval failed: "+r)},this.currentRetrievals.push(s),n.crossOrigin=this.crossOrigin,n.src=r}}
96,c.prototype.createTexture=function(t,e,i){return new l(t.currentGlContext,i)},c.prototype.removeFromCurrentRetrievals=function(t){var e=this.currentRetrievals.indexOf(t);e>-1&&this.currentRetrievals.splice(e,1)},c.prototype.resourceUrlForTile=function(t,e){return this.urlBuilder?this.urlBuilder.urlForTile(t,e):null},c}),i("layer/MercatorTiledImageLayer",["../util/Color","../geom/Sector","../layer/TiledImageLayer","../geom/Vec2","../util/WWMath"],function(t,e,i,r,n){"use strict";var o=function(t,e,n,o,s,a,l){i.call(this,t,e,n,o,s,a,l),this.detectBlankImages=!1,this.testPixels=[new r(20,20),new r(235,20),new r(20,235),new r(235,235)],this.destCanvas=document.createElement("canvas"),this.destContext=this.destCanvas.getContext("2d")};return o.prototype=Object.create(i.prototype),o.prototype.createTile=function(t,r,o,s){var a,l,h,u,c,d,f=this.mapSizeForLevel(r.levelNumber),p=n.clamp(s*this.imageSize,0,f),g=n.clamp(o*this.imageSize,0,f),m=n.clamp(p+this.imageSize,0,f),y=n.clamp(g+this.imageSize,0,f);return a=p/f-.5,l=.5-y/f,h=90-360*Math.atan(Math.exp(2*-l*Math.PI))/Math.PI,u=360*a,a=m/f-.5,l=.5-g/f,c=90-360*Math.atan(Math.exp(2*-l*Math.PI))/Math.PI,d=360*a,t=new e(h,c,u,d),i.prototype.createTile.call(this,t,r,o,s)},o.prototype.createTexture=function(t,e,r){var o,s,a,l,h,u,c,d,f=t.canvas2D,p=t.ctx2D,g=this.destCanvas,m=this.destContext,y=m.createImageData(r.width,r.height),E=e.sector,v=n.gudermannianInverse(E.minLatitude),_=n.gudermannianInverse(E.maxLatitude);if(f.width=r.width,f.height=r.height,g.width=r.width,g.height=r.height,p.drawImage(r,0,0,r.width,r.height),o=p.getImageData(0,0,r.width,r.height),this.detectBlankImages&&this.isBlankImage(r,o))return this.absentResourceList.markResourceAbsentPermanently(e.imagePath),null;for(var b=0;b<1;b++)for(var S=0;S<r.height;S++){c=1-S/(r.height-1),s=c*E.deltaLatitude()+E.minLatitude,a=n.gudermannianInverse(s),d=1-(a-v)/(_-v),d=n.clamp(d,0,1),l=Math.floor(d*(r.height-1));for(var w=0;w<r.width;w++)h=4*(w+l*r.width),u=4*(w+S*r.width),y.data[u]=o.data[h],y.data[u+1]=o.data[h+1],y.data[u+2]=o.data[h+2],y.data[u+3]=o.data[h+3]}return m.putImageData(y,0,0),i.prototype.createTexture.call(this,t,e,g)},o.prototype.isBlankImage=function(t,e){for(var i,r,n=null,o=0,s=this.testPixels.length;o<s;o++)if(i=this.testPixels[o],r=4*(i[0]+i[1]*t.width),n){if(e.data[r]!=n[0]||e.data[r+1]!=n[1]||e.data[r+2]!=n[2])return!1}else n=[e.data[r],e.data[r+1],e.data[r+2]];return!0},o}),i("layer/BingTiledImageLayer",["../geom/Angle","../util/Color","../geom/Location","../util/Offset","../shapes/ScreenImage","../geom/Sector","../layer/MercatorTiledImageLayer"],function(t,e,i,r,n,o,s){"use strict";var a=function(t){this.imageSize=256,s.call(this,new o(-85.05,85.05,-180,180),new i(85.05,180),23,"image/jpeg",t,this.imageSize,this.imageSize),this.displayName=t,this.pickEnabled=!0,this.detectBlankImages=!0};return a.logoImage=null,a.logoLastFrameTime=0,a.prototype=Object.create(s.prototype),a.prototype.doRender=function(t){s.prototype.doRender.call(this,t),this.inCurrentFrame&&this.renderLogo(t)},a.prototype.createTopLevelTiles=function(t){this.topLevelTiles=[],this.topLevelTiles.push(this.createTile(null,this.levels.firstLevel(),0,0)),this.topLevelTiles.push(this.createTile(null,this.levels.firstLevel(),0,1)), 97this.topLevelTiles.push(this.createTile(null,this.levels.firstLevel(),1,0)),this.topLevelTiles.push(this.createTile(null,this.levels.firstLevel(),1,1))},a.prototype.renderLogo=function(t){a.logoImage||(a.logoImage=new n(WorldWind.configuration.bingLogoPlacement,WorldWind.configuration.baseUrl+"images/powered-by-bing.png"),a.logoImage.imageColor=new e(1,1,1,.5)),a.logoLastFrameTime!==t.timestamp&&(a.logoImage.screenOffset=WorldWind.configuration.bingLogoPlacement,a.logoImage.imageOffset=WorldWind.configuration.bingLogoAlignment,a.logoImage.render(t),a.logoLastFrameTime=t.timestamp)},a.prototype.mapSizeForLevel=function(t){return 256<<t+1},a}),i("util/BingImageryUrlBuilder",["../error/ArgumentError","../util/Logger","../util/WWUtil"],function(t,e,i){"use strict";var r=function(t,e){var i="AkttWCS8p6qzxvx5RH3qUcCPgwG9nRJ7IwlpFGb14B0rBorB5DvmXr2Y_eCUNIxH";this.bingMapsKey=e,this.bingMapsKey||(this.bingMapsKey=WorldWind.BingMapsKey),this.bingMapsKey||(this.bingMapsKey=i),this.bingMapsKey===i&&r.showBingMapsKeyWarning(),this.imagerySet=t};return r.showBingMapsKeyWarning=function(){r.keyMessagePrinted||(r.keyMessagePrinted=!0,e.log(e.LEVEL_WARNING,"WARNING: You are using a limited use, non-production Bing Maps key.\nIf you are developing an app or a web page this violates the Bing Terms of Use.\nPlease visit https://www.microsoft.com/en-us
97/maps/create-a-bing-maps-key to obtain your own key for your application.\nSpecify that key to WorldWind by setting the WorldWind.BingMapsKey property to your key prior to creating any Bing Maps layers.\n"))},r.prototype.requestMetadata=function(){if(!this.metadataRetrievalInProcess){this.metadataRetrievalInProcess=!0;var t="https://dev.virtualearth.net/REST/V1/Imagery/Metadata/"+this.imagerySet+"/0,0?zl=1&uriScheme=https&key="+this.bingMapsKey,e=this;i.jsonp(t,"jsonp",function(t){e.imageUrl=t.resourceSets[0].resources[0].imageUrl;var i=document.createEvent("Event");i.initEvent(WorldWind.REDRAW_EVENT_TYPE,!0,!0),window.dispatchEvent(i),e.metadataRetrievalInProcess=!1})}},r.prototype.urlForTile=function(i,r){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"BingImageryUrlBuilder","urlForTile","missingTile"));if(!this.imageUrl)return this.requestMetadata(),null;var n,o=this.quadKeyFromLevelRowColumn(i.level.levelNumber,i.row,i.column);return"Aerial"===this.imagerySet?n=this.imageUrl.replace(/a3/,"a"+o):"AerialWithLabels"===this.imagerySet?n=this.imageUrl.replace(/h3/,"h"+o):"Road"===this.imagerySet&&(n=this.imageUrl.replace(/r3/,"r"+o)),n},r.prototype.quadKeyFromLevelRowColumn=function(t,e,i){for(var r,n,o="",s=t+1;s>0;s--)r=0,n=1<<s-1,0!=(i&n)&&(r+=1),0!=(e&n)&&(r+=2),o+=r.toString();return o},r}),i("layer/BingAerialLayer",["../geom/Location","../geom/Sector","../layer/BingTiledImageLayer","../util/BingImageryUrlBuilder"],function(t,e,i,r){"use strict";var n=function(t){i.call(this,"Bing Aerial"),this.urlBuilder=new r("Aerial",t)};return n.prototype=Object.create(i.prototype),n}),i("layer/BingAerialWithLabelsLayer",["../geom/Location","../geom/Sector","../layer/BingTiledImageLayer","../util/BingImageryUrlBuilder"],function(t,e,i,r){"use strict";var n=function(t){i.call(this,"Bing Aerial with Labels"),this.urlBuilder=new r("AerialWithLabels",t)};return n.prototype=Object.create(i.prototype),n}),i("layer/BingRoadsLayer",["../geom/Location","../geom/Sector","../layer/BingTiledImageLayer","../util/BingImageryUrlBuilder"],function(t,e,i,r){"use strict";var n=function(t){i.call(this,"Bing Roads"),this.urlBuilder=new r("Road",t),this.detectBlankImages=!1};return n.prototype=Object.create(i.prototype),n}),i("layer/BingWMSLayer",["../geom/Location","../geom/Sector","../layer/TiledImageLayer","../util/WmsUrlBuilder"],function(t,e,i,r){"use strict";var n=function(){i.call(this,e.FULL_SPHERE,new t(45,45),16,"image/png","BingWMS",256,256),this.displayName="Bing WMS",this.pickEnabled=!1,this.maxActiveAltitude=1e4,this.urlBuilder=new r("https://worldwind27.arc.nasa.gov/wms/virtualearth","ve","","1.3.0")};return n.prototype=Object.create(i.prototype),n}),i("layer/BMNGLandsatLayer",["../geom/Location","../geom/Sector","../layer/TiledImageLayer","../util/WmsUrlBuilder"],function(t,e,i,r){"use strict";var n=function(){i.call(this,e.FULL_SPHERE,new t(45,45),12,"image/jpeg","BMNGLandsat256",256,256),this.displayName="Blue Marble & Landsat",this.pickEnabled=!1,this.urlBuilder=new r("https://worldwind25.arc.nasa.gov/wms","BlueMarble-200405,esat","","1.3.0")};return n.prototype=Object.create(i.prototype),n}),i("layer/BMNGLayer",["../geom/Location","../geom/Sector","../layer/TiledImageLayer","../util/WmsUrlBuilder"],function(t,e,i,r){"use strict";var n=function(n){i.call(this,e.FULL_SPHERE,new t(45,45),7,"image/jpeg",n||"BMNG256",256,256),this.displayName="Blue Marble",this.pickEnabled=!1,this.urlBuilder=new r("https://worldwind25.arc.nasa.gov/wms",n||"BlueMarble-200405","","1.3.0")};return n.prototype=Object.create(i.prototype),n}),i("layer/RenderableLayer",["../error/ArgumentError","../layer/Layer","../util/Logger"],function(t,e,i){"use strict";var r=function(t){e.call(this,t),this.renderables=[]};return r.prototype=Object.create(e.prototype),r.prototype.addRenderable=function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"RenderableLayer","addRenderable","missingRenderable"));this.renderables.push(e)},r.prototype.addRenderables=function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"RenderableLayer","addRenderables","The renderables array is null or undefined."));for(var r=0,n=e.length;r<n;r++)this.addRenderable(e[r])},r.prototype.removeRenderable=function(t){var e=this.renderables.indexOf(t);e>=0&&this.renderables.splice(e,1)},r.prototype.removeAllRenderables=function(){this.renderables=[]},r.prototype.doRender=function(t){for(var e=t.orderedRenderables.length,r=0,n=this.renderables.length;r<n;r++)try{this.renderables[r].render(t)}catch(t){i.logMessage(i.LEVEL_SEVERE,"RenderableLayer","doRender","Error while rendering shape "+this.renderables[r].displayName+".\n"+t.toString())}t.orderedRenderables.length>e&&(this.inCurrentFrame=!0)},r}),i("render/SurfaceTile",["../error/ArgumentError","../util/Logger","../geom/Matrix","../geom/Sector","../error/UnsupportedOperationError"],function(t,e,
97i,r,n){"use strict";var o=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"SurfaceTile","constructor","missingSector"));this.sector=i};return o.prototype.bind=function(t){throw new n(e.logMessage(e.LEVEL_SEVERE,"SurfaceTile","bind","abstractInvocation"))},o.prototype.applyInternalTransform=function(t,i){throw new n(e.logMessage(e.LEVEL_SEVERE,"SurfaceTile","applyInternalTransform","abstractInvocation"))},o}),i("shapes/SurfaceImage",["../error/ArgumentError","../util/Logger","../pick/PickedObject","../render/SurfaceTile"],function(t,e,i,r){"use strict";var n=function(i,n){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"SurfaceImage","constructor","missingSector"));if(!n)throw new t(e.logMessage(e.LEVEL_SEVERE,"SurfaceImage","constructor","missingImage"));r.call(this,i),this.enabled=!0,this._imageSource=n,this.resamplingMode=WorldWind.FILTER_LINEAR,this.opacity=1,this.displayName="Surface Image",this.imageSourceWasUpdated=!0};return n.prototype=Object.create(r.prototype),Object.defineProperties(n.prototype,{imageSource:{get:function(){return this._imageSource},set:function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"SurfaceImage","imageSource","missingImage"));this._imageSource=i,this.imageSourceWasUpdated=!0}}}),n.prototype.bind=function(t){var e=t.gpuResourceCache.resourceForKey(this._imageSource);return e&&!this.imageSourceWasUpdated?this.bindTexture(t,e):(e=t.gpuResourceCache.retrieveTexture(t.currentGlContext,this._imageSource),this.imageSourceWasUpdated=!1,e?this.bindTexture(t,e):void 0)},n.prototype.bindTexture=function(t,e){var i=t.currentGlContext;return e.setTexParameter(i.TEXTURE_MAG_FILTER,this.resamplingMode===WorldWind.FILTER_NEAREST?i.NEAREST:i.LINEAR),e.bind(t)},n.prototype.applyInternalTransform=function(t,e){},n.prototype.render=function(t){if(this.enabled&&t.terrain&&this.sector.overlaps(t.terrain.sector)){if(t.pickingMode&&(this.pickColor=t.uniquePickColor()),t.surfaceTileRenderer.renderTiles(t,[this],this.opacity*t.currentLayer.opacity),t.pickingMode){var e=new i(this.pickColor.clone(),this.pickDelegate?this.pickDelegate:this,null,this.layer,!1);t.resolvePick(e)}t.currentLayer.inCurrentFrame=!0}},n}),i("layer/BMNGOneImageLayer",["../layer/RenderableLayer","../geom/Sector","../shapes/SurfaceImage","../util/WWUtil"],function(t,e,i,r){"use strict";var n=function(){t.call(this,"Blue Marble Image");var r=new i(e.FULL_SPHERE,WorldWind.configuration.baseUrl+"images/BMNG_world.topo.bathy.200405.3.2048x1024.jpg");this.addRenderable(r),this.pickEnabled=!1,this.minActiveAltitude=3e6};return n.prototype=Object.create(t.prototype),n}),i("util/PeriodicTimeSequence",["../error/ArgumentError","../util/Logger"],function(t,e){"use strict";var i=function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"PeriodicTimeSequence","constructor","missingString"));var n=r.split("/");if(3!==n.length)throw new t(e.logMessage(e.LEVEL_SEVERE,"PeriodicTimeSequence","constructor","The interval string "+r+" does not contain 3 elements."));this.sequenceString=r,this.startTime=new Date(n[0]),this.endTime=new Date(n[1]),this.intervalMilliseconds=this.endTime.getTime()-this.startTime.getTime(),this._currentTime=this.startTime,this.infiniteInterval=this.startTime.getTime()==this.endTime.getTime(),this.period=i.parsePeriodString(n[2],!1)};return Object.defineProperties(i.prototype,{currentTime:{get:function(){return this._currentTime},set:function(t){this._currentTime=t}},scaleForCurrentTime:{get:function(){return this.currentTime?(this.currentTime.getTime()-this.startTime.getTime())/this.intervalMilliseconds:1}}}),i.prototype.next=function(){return this.currentTime?this.currentTime.getTime()>=this.endTime.getTime()&&!this.infiniteInterval?this.currentTime=null:this.currentTime=i.incrementTime(this.currentTime,this.period):this.currentTime=this.startTime,this.currentTime},i.prototype.previous=function(){return this.currentTime?this.currentTime.getTime()===this.startTime.getTime()?this.currentTime=null:this.currentTime=this.getTimeForScale(.9999*this.scaleForCurrentTime):this.currentTime=this.endTime,this.currentTime},i.prototype.reset=function(){this.currentTime=null},i.prototype.getTimeForScale=function(t){if(t<=0)return this.startTime;if(t>=1)return this.endTime;var e=new Date(this.startTime.getTime()),r=e,n=0;for(n=0;n<t;n=(e.getTime()-this.startTime.getTime())/this.intervalMilliseconds)r=e,e=i.incrementTime(e,this.period);return r},i.incrementTime=function(t,e){var r=new Date(t.getTime());return 0!=e[0]&&r.setUTCFullYear(r.getUTCFullYear()+e[0]),0!=e[1]&&i.addMonths(r,e[1]),0!=e[2]&&r.setUTCDate(r.getUTCDate()+7*e[2]),0!=e[3]&&r.setUTCDate(r.getUTCDate()+e[3]),0!=e[4]&&r.setUTCHours(r.getUTCHours()+e[4]),0!=e[5]&&r.setUTCMinutes(r.getUTCMinutes()+e[5]),0!=e[6]&&r.setUTCSeconds(r.getUTCSeconds()+e[6]),r},i.isLeapYear=function(t){return t%4==0&&t%100!=0||t%400==0},i.getDaysInMonth=function(t,e){return[31,i.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},i.addMonths=function(t,e){var r=t.getUTCDate();return t.setUTCDate(1),t.setUTCMonth(t.getUTCMonth()+e),t.setUTCDate(Math.min(r,i.getDaysInMonth(t.getUTCFullYear(),t.getUTCMonth()))),t},i.parsePeriodString=function(i,r){var n,o=r||!1,s=[2,3,4,5,7,8,9],a=[0,0,0,0,0,0,0],l=[0,12,4,7,24,60,60];if(!(i=i.toUpperCase().trim()))return a;
97if("string"!=typeof i)throw new t(e.logMessage(e.LEVEL_SEVERE,"PeriodicTimeSequence","parsePeriodString","Invalid ISO8601 period string '"+i+"'"));if(!(n=/^P((\d+Y)?(\d+M)?(\d+W)?(\d+D)?)?(T(\d+H)?(\d+M)?(\d+S)?)?$/.exec(i)))throw new t(e.logMessage(e.LEVEL_SEVERE,"PeriodicTimeSequence","parsePeriodString","String '"+i+"' is not a valid ISO8601 period."));for(var h=0;h<s.length;h++){var u=s[h];a[h]=n[u]?+n[u].replace(/[A-Za-z]+/g,""):0}if(o)for(h=a.length-1;h>0;h--)a[h]>=l[h]&&(a[h-1]=a[h-1]+Math.floor(a[h]/l[h]),a[h]=a[h]%l[h]);return a},i}),i("util/LevelRowColumnUrlBuilder",["../error/ArgumentError","../util/Logger","../util/WWUtil"],function(t,e,i){"use strict";var r=function(t,e){this.serverAddress=t,t&&0!==t.length||(this.serverAddress=i.currentUrlSansFilePart()),this.pathToData=e};return r.prototype.urlForTile=function(r,n){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsUrlBuilder","urlForTile","missingTile"));if(!n)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsUrlBuilder","urlForTile","The image format is null or undefined."));var o=this.serverAddress;return this.pathToData&&(o=o+"/"+this.pathToData),o=o+"/"+r.level.levelNumber.toString(),o=o+"/"+r.row.toString(),o=o+"/"+r.row.toString()+"_"+r.column.toString(),o=o+"."+i.suffixForMimeType(n),o=o.replace(" ","%20")},r}),i("layer/RestTiledImageLayer",["../error/ArgumentError","../geom/Location","../util/Logger","../geom/Sector","../layer/TiledImageLayer","../util/LevelRowColumnUrlBuilder","../util/WWUtil"],function(t,e,i,r,n,o,s){"use strict";var a=function(t,i,a,l){var h=s.urlPath(t+"/"+i);n.call(this,l&&l.sector||r.FULL_SPHERE,l&&l.levelZeroTileDelta||new e(45,45),l&&l.numLevels||5,l&&l.imageFormat||"image/jpeg",h,l&&l.tileWidth||256,l&&l.tileHeight||256),this.displayName=a,this.pickEnabled=!1,this.urlBuilder=new o(t,i)};return a.prototype=Object.create(n.prototype),a}),i("layer/BMNGRestLayer",["../error/ArgumentError","../layer/Layer","../util/Logger","../util/PeriodicTimeSequence","../layer/RestTiledImageLayer"],function(t,e,i,r,n){"use strict";var o=function(t,i,n,s){e.call(this,n||"Blue Marble time series"),this.time=s||new Date("2004-01"),this.timeSequence=new r("2004-01-01/2004-12-01/P1M"),this.serverAddress=t,this.pathToData=i,this.layers={},this.layerNames=[{month:"BlueMarble-200401",time:o.availableTimes[0]},{month:"BlueMarble-200402",time:o.availableTimes[1]},{month:"BlueMarble-200403",time:o.availableTimes[2]},{month:"BlueMarble-200404",time:o.availableTimes[3]},{month:"BlueMarble-200405",time:o.availableTimes[4]},{month:"BlueMarble-200406",time:o.availableTimes[5]},{month:"BlueMarble-200407",time:o.availableTimes[6]},{month:"BlueMarble-200408",time:o.availableTimes[7]},{month:"BlueMarble-200409",time:o.availableTimes[8]},{month:"BlueMarble-200410",time:o.availableTimes[9]},{month:"BlueMarble-200411",time:o.availableTimes[10]},{month:"BlueMarble-200412",time:o.availableTimes[11]}],this.pickEnabled=!1};return o.prototype=Object.create(e.prototype),o.availableTimes=[new Date("2004-01"),new Date("2004-02"),new Date("2004-03"),new Date("2004-04"),new Date("2004-05"),new Date("2004-06"),new Date("2004-07"),new Date("2004-08"),new Date("2004-09"),new Date("2004-10"),new Date("2004-11"),new Date("2004-12")],o.prototype.prePopulate=function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"BMNGRestLayer","prePopulate","missingWorldWindow"));for(var r=0;r<this.layerNames.length;r++){var n=this.layerNames[r].month;this.layers[n]||this.createSubLayer(n),this.layers[n].prePopulate(e)}},o.prototype.isPrePopulated=function(t){for(var e=0;e<this.layerNames.length;e++){var i=this.layers[this.layerNames[e].month];if(!i||!i.isPrePopulated(t))return!1}return!0},o.prototype.doRender=function(t){var e=this.nearestLayer(this.time);e.opacity=this.opacity,this.detailControl&&(e.detailControl=this.detailControl),e.doRender(t),this.inCurrentFrame=e.inCurrentFrame},o.prototype.nearestLayer=function(t){var e=this.nearestLayerName(t);return this.layers[e]||this.createSubLayer(e),this.layers[e]},o.prototype.createSubLayer=function(t){var e="";e=this.pathToData?this.pathToData+"/"+t:t,this.layers[t]=new n(this.serverAddress,e,this.displayName)},o.prototype.nearestLayerName=function(t){var e=t.getTime();if(e<=this.layerNames[0].time.getTime())return this.layerNames[0].month;if(e>=this.layerNames[11].time.getTime())return this.layerNames[11].month;for(var i=0;i<this.layerNames.length-1;i++){var r=this.layerNames[i].time.getTime(),n=this.layerNames[i+1].time.getTime();if(e>=r&&e<=n){return e-r<n-e?this.layerNames[i].month:this.layerNames[i+1].month}}},o}),i("formats/collada/ColladaAsset",[],function(){"use strict";var t=function(t){this.xmlAsset=t.getElementsByTagName("asset")[0],this.asset={daeVersion:t.querySelector("COLLADA").getAttribute("version")}};return t.prototype.parse=function(){if(!this.xmlAsset)return null;for(var t=0;t<this.xmlAsset.childNodes.length;t++){var e=this.xmlAsset.childNodes.item(t);if(1===e.nodeType)switch(e.nodeName){case"contributor":var i=e.querySelector("authoring_tool");i&&(this.asset.authoring_tool=i.textContext);break;case"unit":this.asset.unit=e.getAttribute("meter");break;default:this.asset[e.localName]=e.textContent}}return this.xmlAsset=null,this.asset},t}),i("formats/collada/ColladaUtils",["../../util/Logger"],function(t){"use strict";return{getRawValues:function(t){if(!t)return null;var e=t.textContent;return e=e.replace(/\n/gi," "),e=e.replace(/\s+/gi," "),e=e.trim(),0===e.length?null:e.split(" ")},bufferDataFloat32:function(t){var e=this.getRawValues(t);if(!e)return null;for(var i=e.length,r=new Float32Array(i),n=0;n<i;n++)r[n]=parseFloat(e[n]);return r},bufferDataUInt32:function(t){var e=this.getRawValues(t);if(!e)return null;for(var i=e.length,r=new Uint32Array(i),n=0;n<i;n++)r[n]=parseInt(e[n]);return r},getFirstChildElement:function(t,e){for(var i=t.childNodes,r=0;r<i.length;++r){var n=i.item(r);if(1===n.nodeType&&(n.nodeName&&!e||e&&e===n.nodeName))return n}return null},getFilename:function(t){var e=t.lastIndexOf("\\");return-1!==e&&(t=t.substr(e+1)),e=t.lastIndexOf("/"),-1!==e&&(t=t.substr(e+1)),t},replaceSpace:function(t){return t?t.replace(/ /g,"_"):""},querySelectorById:function(t,e){for(var i=0;i<t.length;i++){var r=t.item(i).getAttribute("id");if(r&&r.toString()===e)return t.item(i)}return null},getTextureType:function(t){for(var e=!0,i=0,r=t.length;i<r;i++)if(t[i]<0||t[i]>1){e=!1;break}return e},fetchFile:function(e,i){var r=new XMLHttpRequest;r.onload=function(){this.status>=200&&this.status<400?i(this.response):(t.log(t.LEVEL_SEVERE,"sever error: "+this.status),i(null))},r.onerror=function(e){t.log(t.LEVEL_SEVERE,"connection error: "+e),i(null)},r.open("get",e,!0),r.send()}}}),i("formats/collada/ColladaImage",["./ColladaUtils"],function(t){"use strict";var e=function(t,e){this.filename="",this.map=t,this.name=e,this.path=""};return e.prototype.parse=function(e){for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"init_from":this.filename=t.getFilename(r.textContent),this.path=r.textContent}}return this},e}),i("formats/collada/ColladaMaterial",["./ColladaUtils"],function(t){"use strict";var e=function(t){this.id=t,this.newParams=[]};return e.prototype.parse=function(t){for(var e=0;e<t.childNodes.length;e++){var i=t.childNodes[e];if(1===i.nodeType)switch(i.nodeName){case"profile_COMMON":this.parseProfileCommon(i)}}return this},e.prototype.parseProfileCommon=function(t){for(var e=0;e<t.childNodes.length;e++){var i=t.childNodes[e];if(1===i.nodeType)switch(i.nodeName){case"newparam":this.parseNewparam(i);break;case"image":break;case"technique":this.parseTechnique(i)}}},e.prototype.parseNewparam=function(t){for(var e=t.getAttribute("sid"),i=0;i<t.childNodes.length;i++){var r=t.childNodes[i];if(1===r.nodeType)switch(r.nodeName){case"surface":var n=r.querySelector("init_from");n&&this.newParams.push({sid:e,type:"surface",initFrom:n.textContent});break;case"sampler2D":var o=r.querySelector("source");this.newParams.push({sid:e,type:"sampler2D",source:o.textContent})}}},e.prototype.parseTechnique=function(t){for(var e=0;e<t.childNodes.length;e++){var i=t.childNodes[e];if(1===i.nodeType)switch(i.nodeName){case"constant":case"lambert":case"blinn":case"phong":this.techniqueType=i.nodeName,this.parseTechniqueType(i)}}},e.prototype.parseTechniqueType=function(e){for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1===r.nodeType&&r.nodeName){var n=r.nodeName,o=t.getFirstChildElement(r);if(o)switch(o.nodeName){case"color":this[n]=t.bufferDataFloat32(o).subarray(0,4);break;case"float":this[n]=t.bufferDataFloat32(o)[0];break;case"texture":var s=o.getAttribute("texture"),a=this.newParams.map(function(t){return t.sid}).indexOf(s),l=this.newParams[a].source;a=this.newParams.map(function(t){return t.sid}).indexOf(l);var h=this.newParams[a].initFrom;this.textures||(this.textures={}),this.textures[n]={mapId:h}}}}},e}),i("formats/collada/ColladaMesh",["./ColladaUtils"],function(t){"use strict";var e=function(t){this.filename=t||"",this.name=t||"",this.buffers=[]};return e.prototype.parse=function(e){for(var i={},r={},n={id:"",inputs:[]},o=0;o<e.childNodes.length;o++){var s=e.childNodes[o];if(1===s.nodeType)switch(s.nodeName){case"source":if(!s.querySelector)continue;var a=s.querySelector("float_array");if(!a)continue;var l=t.bufferDataFloat32(a),h=s.querySelector("accessor"),u=parseInt(h.getAttribute("stride"));i[s.getAttribute("id")]={stride:u,data:l};break;case"vertices":this.parseVertices(s,n);break;case"triangles":r=this.parsePolygons(s,i,n,3),this.buffers.push(r);break;case"polygons":r=this.parsePolygons(s,i,n,4),this.buffers.push(r);break;case"polylist":r=this.parsePolygons(s,i,n,null),this.buffers.push(r)}}return this},e.prototype.parseVertices=function(t,e){e.id=t.getAttribute("id");for(var i=t.querySelectorAll("input"),r=0;r<i.length;r++){var n=i[r],o=n.getAttribute("source").substr(1),s=n.getAttribute("semantic").toUpperCase();e.inputs.push({semantic:s,source:o})}}
97,e.prototype.parsePolygons=function(t,e,i,r){var n=[];if(null==r){n=t.querySelector("vcount").textContent.trim().split(" ")}var o=parseInt(t.getAttribute("count")),s=t.getAttribute("material"),a=this.parseInputs(t,e,i),l=a.inputs,h=a.maxOffset,u=t.querySelector("p"),c=[];u&&(c=u.textContent.trim().split(" "));for(var d=l.length,f=0,p={},g=[],m=0,y=!1,E=0;E<o;E++){if(n.length)var v=parseInt(n[E]);else v=r;for(var _=-1,b=-1,S=-1,w=0;w<v;w++){var L=c.slice(m,m+h).join(" ");if(S=b,p.hasOwnProperty(L))b=p[L],y=!0;else{for(var T=0;T<d;T++){var x=l[T],R=x[4],M=parseInt(c[m+R]),C=x[1],A=x[3];M*=x[2];for(var P=0;P<x[2];P++)C.push(A[M+P])}b=f,f+=1,p[L]=b}v>3&&(0===w&&(_=b),w>2*h&&(g.push(_),g.push(S))),g.push(b),m+=h}}var N={vertices:new Float32Array(l[0][1]),indexedRendering:y,material:s};return this.transformMeshInfo(N,l,g),N},e.prototype.parseInputs=function(t,e,i){for(var r=[],n=0,o=t.querySelectorAll("input"),s=0;s<o.length;s++){var a=o.item(s);if(a.getAttribute){var l=a.getAttribute("semantic").toUpperCase(),h=a.getAttribute("source").substr(1),u=parseInt(a.getAttribute("offset"));n=n<u+1?u+1:n;var c=0;if(a.getAttribute("set")&&(c=parseInt(a.getAttribute("set"))),i.id===h)for(var d=i.inputs,f=0;f<d.length;f++){var p=e[d[f].source];p&&r.push([d[f].semantic,[],p.stride,p.data,u,c])}else p=e[h],r.push([l,[],p.stride,p.data,u,c])}}return{inputs:r,maxOffset:n}},e.prototype.transformMeshInfo=function(e,i,r){for(var n={normal:"normals",texcoord:"uvs"},o=1;o<i.length;o++){var s=i[o][0].toLowerCase(),a=i[o][1];a.length&&(n[s]&&(s=n[s]),e[s]&&(s+=i[o][5]),e[s]=new Float32Array(a),"uvs"===s&&(e.isClamp=t.getTextureType(a)))}return e.indexedRendering&&(e.indices=new Uint16Array(r)),e},e}),i("formats/collada/ColladaNode",["./ColladaUtils","../../geom/Matrix","../../geom/Vec3"],function(t,e,i){"use strict";var r=function(){this.id="",this.name="",this.sid="",this.children=[],this.materials=[],this.mesh="",this.localMatrix=e.fromIdentity(),this.worldMatrix=e.fromIdentity()};return r.prototype.parse=function(t,i,n){this.id=t.getAttribute("id"),this.sid=t.getAttribute("sid"),this.name=t.getAttribute("name"),this.children=[],this.materials=[],this.mesh="",this.localMatrix=e.fromIdentity(),this.worldMatrix=e.fromIdentity(),this.setNodeTransforms(t,n);for(var o=0;o<t.childNodes.length;o++){var s=t.childNodes[o];if(1===s.nodeType)switch(s.nodeName){case"node":this.children.push((new r).parse(s,i,this.worldMatrix));break;case"instance_geometry":this.mesh=s.getAttribute("url").substr(1);for(var a=s.querySelectorAll("instance_material"),l=0;l<a.length;l++){var h=a.item(l);this.materials.push({id:h.getAttribute("target").substr(1),symbol:h.getAttribute("symbol")})}break;case"instance_node":var u=s.getAttribute("url").substr(1),c=this.getLibraryNode(i,u);c&&this.children.push((new r).parse(c,i,this.worldMatrix))}}return this},r.prototype.setNodeTransforms=function(r,n){var o=e.fromIdentity(),s=e.fromIdentity(),a=e.fromIdentity(),l=e.fromIdentity();n||(n=e.fromIdentity());for(var h=[],u=0;u<r.childNodes.length;u++){var c=r.childNodes[u];if(1===c.nodeType)switch(c.nodeName){case"matrix":var d=t.bufferDataFloat32(c);o.copy(d),h.push(o);break;case"rotate":d=t.bufferDataFloat32(c),s.multiplyByRotation(d[0],d[1],d[2],d[3]),h.push(s);break;case"translate":d=t.bufferDataFloat32(c),a.multiplyByTranslation(d[0],d[1],d[2]),h.push(a);break;case"scale":d=t.bufferDataFloat32(c),l.multiplyByScale(d[0],d[1],d[2]),h.push(l)}}for(u=0;u<h.length;u++)this.localMatrix.multiplyMatrix(h[u]);this.worldMatrix.setToMultiply(n,this.localMatrix),this.normalMatrix=e.fromIdentity();var f=new i(0,0,0);this.worldMatrix.extractRotationAngles(f),this.normalMatrix.multiplyByRotation(-1,0,0,f[0]),this.normalMatrix.multiplyByRotation(0,-1,0,f[1]),this.normalMatrix.multiplyByRotation(0,0,-1,f[2])},r.prototype.getLibraryNode=function(t,e){for(var i=0;i<t.length;i++){var r=t[i].attributes.getNamedItem("id");if(r&&r.value===e)return t[i]}return null},r}),i("formats/collada/ColladaScene",["../../error/ArgumentError","../../shaders/BasicTextureProgram","../../util/Color","../../util/Logger","../../geom/Matrix","../../geom/Position","../../pick/PickedObject","../../render/Renderable","../../geom/Vec3"],function(t,e,
97i,r,n,o,s,a,l){"use strict";var h=function(e,i){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"ColladaScene","constructor","missingPosition"));a.call(this),this._position=e,this._nodes=[],this._meshes={},this._materials={},this._images={},this._upAxis="",this._dirPath="",this._xRotation=0,this._yRotation=0,this._zRotation=0,this._xTranslation=0,this._yTranslation=0,this._zTranslation=0,this._scale=1,this._altitudeMode=WorldWind.ABSOLUTE,this._localTransforms=!0,this._useTexturePaths=!0,this._nodesToHide=[],this._hideNodes=!1,this.setSceneData(i),this._placePoint=new l(0,0,0),this._transformationMatrix=n.fromIdentity(),this._normalMatrix=n.fromIdentity(),this._texCoordMatrix=n.fromIdentity().setToUnitYFlip(),this._activeTexture=null};return h.prototype=Object.create(a.prototype),h.prototype.constructor=h,Object.defineProperties(h.prototype,{position:{get:function(){return this._position},set:function(t){this._position=t}},nodes:{get:function(){return this._nodes},set:function(t){this._nodes=t}},meshes:{get:function(){return this._meshes},set:function(t){this._meshes=t}},materials:{get:function(){return this._materials},set:function(t){this._materials=t}},images:{get:function(){return this._images},set:function(t){this._images=t}},upAxis:{get:function(){return this._upAxis},set:function(t){this._upAxis=t}},dirPath:{get:function(){return this._dirPath},set:function(t){this._dirPath=t}},xRotation:{get:function(){return this._xRotation},set:function(t){this._xRotation=t}},yRotation:{get:function(){return this._yRotation},set:function(t){this._yRotation=t}},zRotation:{get:function(){return this._zRotation},set:function(t){this._zRotation=t}},xTranslation:{get:function(){return this._xTranslation},set:function(t){this._xTranslation=t}},yTranslation:{get:function(){return this._yTranslation},set:function(t){this._yTranslation=t}},zTranslation:{get:function(){return this._zTranslation},set:function(t){this._zTranslation=t}},scale:{get:function(){return this._scale},set:function(t){this._scale=t}},placePoint:{get:function(){return this._placePoint},set:function(t){this._placePoint=t}},altitudeMode:{get:function(){return this._altitudeMode},set:function(t){this._altitudeMode=t}},transformationMatrix:{get:function(){return this._transformationMatrix},set:function(t){this._transformationMatrix=t}},normalMatrix:{get:function(){return this._normalMatrix},set:function(t){this._normalMatrix=t}},localTransforms:{get:function(){return this._localTransforms},set:function(t){this._localTransforms=t}},useTexturePaths:{get:function(){return this._useTexturePaths},set:function(t){this._useTexturePaths=t}},nodesToHide:{get:function(){return this._nodesToHide},set:function(t){this._nodesToHide=t}},hideNodes:{get:function(){return this._hideNodes},set:function(t){this._hideNodes=t}}}),h.prototype.setSceneData=function(t){t&&(this.nodes=t.root.children,this.meshes=t.meshes,this.materials=t.materials,this.images=t.images,this.upAxis=t.metadata.up_axis,this.dirPath=t.dirPath)},h.prototype.render=function(t){var e;this.enabled&&(this.lastFrameTime!==t.timestamp&&(e=this.makeOrderedRenderable(t)),e&&(e.layer=t.currentLayer,this.lastFrameTime=t.timestamp,t.addOrderedRenderable(e)))},h.prototype.makeOrderedRenderable=function(t){return t.surfacePointForMode(this.position.latitude,this.position.longitude,this.position.altitude,this.altitudeMode,this.placePoint),this.eyeDistance=t.eyePoint.distanceTo(this.placePoint),this},h.prototype.renderOrdered=function(t){if(this.drawOrderedScene(t),t.pickingMode){var e=new s(this.pickColor.clone(),this,this.position,this.layer,!1);t.resolvePick(e)}},h.prototype.drawOrderedScene=function(t){this.beginDrawing(t);try{this.doDrawOrderedScene(t)}finally{this.endDrawing(t)}},h.prototype.beginDrawing=function(t){var i=t.currentGlContext;t.findAndBindProgram(e),i.enable(i.CULL_FACE),i.enable(i.DEPTH_TEST)},h.prototype.doDrawOrderedScene=function(t){t.pickingMode&&(this.pickColor=t.uniquePickColor()),this.computeTransformationMatrix(t.globe);for(var e=0,i=this.nodes.length;e<i;e++)this.traverseNodeTree(t,this.nodes[e])}
97,h.prototype.traverseNodeTree=function(t,e){if(this.mustRenderNode(e.id)){if(e.mesh)for(var i=e.mesh,r=this.meshes[i].buffers,n=0,o=r.length;n<o;n++){for(var s=r[n].material,a=0;a<e.materials.length;a++)if(s===e.materials[a].symbol){var l=e.materials[a].id;break}var h=this.materials[l];this.draw(t,r[n],h,e.worldMatrix,e.normalMatrix)}for(var u=0;u<e.children.length;u++)this.traverseNodeTree(t,e.children[u])}},h.prototype.draw=function(t,e,i,r,n){var o=t.currentGlContext,s=t.currentProgram;this.applyVertices(t,e),s.loadTextureEnabled(o,!1),this.applyColor(t,i);var a=i&&null!=i.textures&&e.uvs&&e.uvs.length>0;a&&this.applyTexture(t,e,i);var l=null!=e.normals&&e.normals.length>0;l&&!t.pickingMode&&this.applyLighting(t,e),this.applyMatrix(t,l,a,r,n),e.indexedRendering?(this.applyIndices(t,e),o.drawElements(o.TRIANGLES,e.indices.length,o.UNSIGNED_SHORT,0)):o.drawArrays(o.TRIANGLES,0,Math.floor(e.vertices.length/3)),this.resetDraw(t,l,a)},h.prototype.applyVertices=function(t,e){var i,r=t.currentGlContext,n=t.currentProgram;e.verticesVboCacheKey||(e.verticesVboCacheKey=t.gpuResourceCache.generateCacheKey()),i=t.gpuResourceCache.resourceForKey(e.verticesVboCacheKey),i||(i=r.createBuffer(),t.gpuResourceCache.putResource(e.verticesVboCacheKey,i,e.vertices.length),e.refreshVertexBuffer=!0),r.bindBuffer(r.ARRAY_BUFFER,i),e.refreshVertexBuffer&&(r.bufferData(r.ARRAY_BUFFER,e.vertices,r.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),e.refreshVertexBuffer=!1),r.enableVertexAttribArray(n.vertexPointLocation),r.vertexAttribPointer(n.vertexPointLocation,3,r.FLOAT,!1,0,0)},h.prototype.applyColor=function(t,e){var r=t.currentGlContext,n=t.currentProgram;if(e)if("constant"===e.techniqueType)var o=e.reflective;else o=e.diffuse;var s,a=1,l=1,h=1,u=1;o&&(a=o[0],l=o[1],h=o[2],u=null!=o[3]?o[3]:1);var c=new i(a,l,h,u);s=u*this.layer.opacity,r.depthMask(s>=1||t.pickingMode),n.loadColor(r,t.pickingMode?this.pickColor:c),n.loadOpacity(r,t.pickingMode?s>0?1:0:s)},h.prototype.applyTexture=function(t,e,i){var r,n,o,s=t.currentGlContext,a=t.currentProgram;if(i.textures.diffuse)var l=i.textures.diffuse.mapId;else l=i.textures.reflective.mapId 98;var h=this.useTexturePaths?this.images[l].path:this.images[l].filename;this._activeTexture=t.gpuResourceCache.resourceForKey(this.dirPath+h+""),this._activeTexture||(o=e.isClamp?s.CLAMP_TO_EDGE:s.REPEAT,this._activeTexture=t.gpuResourceCache.retrieveTexture(s,this.dirPath+h+"",o)),(r=this._activeTexture&&this._activeTexture.bind(t))&&(e.texCoordsVboCacheKey||(e.texCoordsVboCacheKey=t.gpuResourceCache.generateCacheKey()),n=t.gpuResourceCache.resourceForKey(e.texCoordsVboCacheKey),n||(n=s.createBuffer(),t.gpuResourceCache.putResource(e.texCoordsVboCacheKey,n,e.uvs.length),e.refreshTexCoordBuffer=!0),s.bindBuffer(s.ARRAY_BUFFER,n),e.refreshTexCoordBuffer&&(s.bufferData(s.ARRAY_BUFFER,e.uvs,s.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),e.refreshTexCoordBuffer=!1),a.loadTextureEnabled(s,!0),s.enableVertexAttribArray(a.vertexTexCoordLocation),s.vertexAttribPointer(a.vertexTexCoordLocation,2,s.FLOAT,!1,0,0),a.loadTextureUnit(s,s.TEXTURE0),a.loadModulateColor(s,t.pickingMode))},h.prototype.applyLighting=function(t,e){var i,r=t.currentGlContext,n=t.currentProgram;n.loadApplyLighting(r,!0),e.normalsVboCacheKey||(e.normalsVboCacheKey=t.gpuResourceCache.generateCacheKey()),i=t.gpuResourceCache.resourceForKey(e.normalsVboCacheKey),i||(i=r.createBuffer(),t.gpuResourceCache.putResource(e.normalsVboCacheKey,i,e.normals.length),e.refreshNormalBuffer=!0),r.bindBuffer(r.ARRAY_BUFFER,i),e.refreshNormalBuffer&&(r.bufferData(r.ARRAY_BUFFER,e.normals,r.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),e.refreshNormalBuffer=!1),r.enableVertexAttribArray(n.normalVectorLocation),r.vertexAttribPointer(n.normalVectorLocation,3,r.FLOAT,!1,0,0)},h.prototype.applyMatrix=function(t,e,i,r,o){var s=n.fromIdentity();if(s.copy(t.modelviewProjection),s.multiplyMatrix(this.transformationMatrix),r&&this.localTransforms&&s.multiplyMatrix(r),e&&!t.pickingMode){var a=n.fromIdentity();a.copy(t.modelviewNormalTransform),a.multiplyMatrix(this.normalMatrix),o&&this.localTransforms&&a.multiplyMatrix(o),t.currentProgram.loadModelviewInverse(t.currentGlContext,a)}i&&this._activeTexture&&(t.currentProgram.loadTextureMatrix(t.currentGlContext,this._texCoordMatrix),this._activeTexture=null),t.currentProgram.loadModelviewProjection(t.currentGlContext,s)},h.prototype.applyIndices=function(t,e){var i,r=t.currentGlContext;e.indicesVboCacheKey||(e.indicesVboCacheKey=t.gpuResourceCache.generateCacheKey()),i=t.gpuResourceCache.resourceForKey(e.indicesVboCacheKey),i||(i=r.createBuffer(),t.gpuResourceCache.putResource(e.indicesVboCacheKey,i,e.indices.length),e.refreshIndicesBuffer=!0),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i),e.refreshIndicesBuffer&&(r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.indices,r.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),e.refreshIndicesBuffer=!1)}
98,h.prototype.resetDraw=function(t,e,i){var r=t.currentGlContext,n=t.currentProgram;e&&!t.pickingMode&&(n.loadApplyLighting(r,!1),r.disableVertexAttribArray(n.normalVectorLocation)),i&&r.disableVertexAttribArray(n.vertexTexCoordLocation),r.disableVertexAttribArray(n.vertexPointLocation)},h.prototype.endDrawing=function(t){t.bindProgram(null)},h.prototype.computeTransformationMatrix=function(t){this.transformationMatrix=n.fromIdentity(),this.transformationMatrix.multiplyByLocalCoordinateTransform(this.placePoint,t),this.transformationMatrix.multiplyByRotation(1,0,0,this.xRotation),this.transformationMatrix.multiplyByRotation(0,1,0,this.yRotation),this.transformationMatrix.multiplyByRotation(0,0,1,this.zRotation),this.transformationMatrix.multiplyByScale(this.scale,this.scale,this.scale),this.transformationMatrix.multiplyByTranslation(this.xTranslation,this.yTranslation,this.zTranslation),this.computeNormalMatrix()},h.prototype.computeNormalMatrix=function(){var t=new l(0,0,0);this.transformationMatrix.extractRotationAngles(t),this.normalMatrix=n.fromIdentity(),this.normalMatrix.multiplyByRotation(-1,0,0,t[0]),this.normalMatrix.multiplyByRotation(0,-1,0,t[1]),this.normalMatrix.multiplyByRotation(0,0,-1,t[2])},h.prototype.mustRenderNode=function(t){var e=!0;if(this.hideNodes){e=-1===this.nodesToHide.indexOf(t)}return e},h}),i("formats/collada/ColladaLoader",["../../error/ArgumentError","./ColladaAsset","./ColladaImage","./ColladaMaterial","./ColladaMesh","./ColladaNode","./ColladaScene","./ColladaUtils","../../util/Logger"],function(t,e,i,r,n,o,s,a,l){"use strict";var h=function(e,i){if(!e)throw new t(l.logMessage(l.LEVEL_SEVERE,"ColladaLoader","constructor","missingPosition"));this.position=e,this.dirPath="/",this.init(i)};return h.prototype.init=function(t){t&&(this.dirPath=t.dirPath||"/"),this.scene={type:"SceneTree",dirPath:this.dirPath,images:{},metadata:{},materials:{},meshes:{},root:{children:[]}},this.xmlDoc=null},h.prototype.load=function(t,e){-1===t.indexOf("://")&&(t=this.dirPath+t),a.fetchFile(t,function(t){if(t)try{i=this.parse(t)}catch(t){i=null,l.log(l.LEVEL_SEVERE,"error parsing collada file: "+t)}else var i=null;e(i)}.bind(this))},h.prototype.parse=function(t){this.init();var i=new DOMParser;this.xmlDoc=i.parseFromString(t,"text/xml");var r=this.xmlDoc.querySelectorAll("library_nodes node"),n=this.xmlDoc.querySelectorAll("library_effects effect");return this.scene.metadata=new e(this.xmlDoc).parse(),this.parseLib("visual_scene",r),this.parseLib("library_geometries"),this.parseLib("library_materials",n),this.parseLib("library_images"),this.xmlDoc=null,new s(this.position,this.scene)},h.prototype.parseLib=function(t,e){var s=this.xmlDoc.getElementsByTagName(t),l=[];s&&s.length&&(l=s[0].childNodes);for(var h=0;h<l.length;h++){var u=l[h];if(1===u.nodeType)switch(u.nodeName){case"node":var c=(new o).parse(u,e);c&&this.scene.root.children.push(c);break;case"geometry":var d=u.getAttribute("id"),f=u.querySelector("mesh"),p=new n(d).parse(f);p&&(this.scene.meshes[d]=p);break;case"material":var g=u.getAttribute("id"),m=u.querySelector("instance_effect"),y=m.getAttribute("url").substr(1),E=a.querySelectorById(e,y),v=new r(g).parse(E);v&&(this.scene.materials[g]=v);break;case"image":var _=u.getAttribute("id"),b=u.getAttribute("name"),S=new i(_,b).parse(u);S&&(this.scene.images[_]=S)}}},h}),i("shapes/Compass",["../error/ArgumentError","../util/Logger","../util/Offset","../shapes/ScreenImage"],function(t,e,i,r){"use strict";var n=function(t,e){var n=t||new i(WorldWind.OFFSET_FRACTION,1,WorldWind.OFFSET_FRACTION,1),o=e||WorldWind.configuration.baseUrl+"images/notched-compass.png";r.call(this,n,o),t||(this.imageOffset=new i(WorldWind.OFFSET_FRACTION,1.1,WorldWind.OFFSET_FRACTION,1.1)),this.size=.15};return n.prototype=Object.create(r.prototype),n.prototype.render=function(t){this.imageRotation=t.navigator.heading,this.imageTilt=t.navigator.tilt;var e=this.getActiveTexture(t);e&&(this.imageScale=this.size*t.currentGlContext.drawingBufferWidth/e.imageWidth),r.prototype.render.call(this,t)},n}),i("layer/CompassLayer",["../shapes/Compass","../layer/RenderableLayer"],function(t,e){"use strict";var i=function(){e.call(this,"Compass"),this._compass=new t(null,null),this.addRenderable(this._compass)};return i.prototype=Object.create(e.prototype),Object.defineProperties(i.prototype,{compass:{get:function(){return this._compass}
98,set:function(e){e&&e instanceof t&&(this.removeAllRenderables(),this.addRenderable(e),this._compass=e)}}}),i}),i("shapes/Text",["../error/ArgumentError","../shaders/BasicTextureProgram","../util/Color","../util/Font","../util/Logger","../geom/Matrix","../pick/PickedObject","../render/Renderable","../shapes/TextAttributes","../error/UnsupportedOperationError","../geom/Vec2","../geom/Vec3","../util/WWMath"],function(t,e,i,r,n,o,s,a,l,h,u,c,d){"use strict";var f=function(e){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"Text","constructor","missingText"));a.call(this),this.attributes=new l(null),this.highlightAttributes=null,this.highlighted=!1,this.enabled=!0,this.text=e,this.altitudeMode=WorldWind.ABSOLUTE,this.pickDelegate=null,this.alwaysOnTop=!1,this.targetVisibility=1,this.currentVisibility=1,this.declutterGroup=0,this.markerImageSource=WorldWind.configuration.baseUrl+"images/white-dot.png",this.markerImageScale=.1,this.activeAttributes=null,this.activeTexture=null,this.imageTransform=o.fromIdentity(),this.imageBounds=null,this.layer=null,this.depthOffset=-.003,this.screenPoint=new c(0,0,0)};return f.matrix=o.fromIdentity(),f.glPickPoint=new c(0,0,0),f.prototype=Object.create(a.prototype),f.prototype.copy=function(t){return this.text=t.text,this.attributes=t.attributes,this.highlightAttributes=t.highlightAttributes,this.highlighted=t.highlighted,this.enabled=t.enabled,this.altitudeMode=t.altitudeMode,this.pickDelegate=t.pickDelegate,this.alwaysOnTop=t.alwaysOnTop,this.depthOffset=t.depthOffset,this.declutterGroup=t.declutterGroup,this.targetVisibility=t.targetVisibility,this.currentVisibility=t.currentVisibility,this},Object.defineProperties(f.prototype,{screenBounds:{get:function(){return this.imageBounds}}}),f.prototype.render=function(t){if(this.enabled&&this.text&&0!==this.text.length&&t.accumulateOrderedRenderables){var e;if(this.lastFrameTime!==t.timestamp)e=this.makeOrderedRenderable(t);else{e=this.clone().makeOrderedRenderable(t)}e&&e.isVisible(t)&&(e.layer=t.currentLayer,this.lastFrameTime=t.timestamp,t.addOrderedRenderable(e))}},f.prototype.renderOrdered=function(t){if((0!==this.currentVisibility||0!==this.targetVisibility||this.markerImageSource)&&(this.drawOrderedText(t),t.pickingMode)){var e=new s(this.pickColor.clone(),this.pickDelegate?this.pickDelegate:this,this.position,this.layer,!1);t.resolvePick(e)}},f.prototype.makeOrderedRenderable=function(t){var e,i,r,n;return this.determineActiveAttributes(t),this.activeAttributes&&this.computeScreenPointAndEyeDistance(t)?(this.activeTexture=t.createTextTexture(this.text,this.activeAttributes),e=this.activeTexture.imageWidth,i=this.activeTexture.imageHeight,r=this.activeAttributes.scale,n=this.activeAttributes.offset.offsetForSize(e,i),this.imageTransform.setTranslation(this.screenPoint[0]-n[0]*r,this.screenPoint[1]-n[1]*r,this.screenPoint[2]),this.imageTransform.setScale(e*r,i*r,1),this.imageBounds=d.boundingRectForUnitQuad(this.imageTransform),this):null},f.prototype.computeScreenPointAndEyeDistance=function(t){throw new h(n.logMessage(n.LEVEL_SEVERE,"Renderable","render","abstractInvocation"))},f.prototype.determineActiveAttributes=function(t){this.highlighted&&this.highlightAttributes?this.activeAttributes=this.highlightAttributes:this.activeAttributes=this.attributes},f.prototype.isVisible=function(t){return t.pickingMode?t.pickRectangle&&this.imageBounds.intersects(t.pickRectangle):this.imageBounds.intersects(t.viewport)},f.prototype.drawOrderedText=function(t){this.beginDrawing(t);try{this.doDrawOrderedText(t),t.pickingMode}finally{this.endDrawing(t)}},f.prototype.drawBatchOrderedText=function(t){for(var e;(e=t.peekOrderedRenderable())&&e instanceof f;){t.popOrderedRenderable();try{e.doDrawOrderedText(t)}catch(t){n.logMessage(n.LEVEL_WARNING,"Text","drawBatchOrderedText","Error occurred while rendering text using batching: "+t.message)}}},f.prototype.beginDrawing=function(t){var i,r=t.currentGlContext;t.findAndBindProgram(e),i=t.currentProgram,r.bindBuffer(r.ARRAY_BUFFER,t.unitQuadBuffer3()),r.vertexAttribPointer(i.vertexPointLocation,3,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t.unitQuadBuffer()),r.vertexAttribPointer(i.vertexTexCoordLocation,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(i.vertexPointLocation),r.enableVertexAttribArray(i.vertexTexCoordLocation),i.loadTextureUnit(r,r.TEXTURE0),i.loadModulateColor(r,!1),r.depthMask(!1)},f.prototype.endDrawing=function(t){var e=t.currentGlContext,i=t.currentProgram;e.disableVertexAttribArray(i.vertexPointLocation),e.disableVertexAttribArray(i.vertexTexCoordLocation),e.bindBuffer(e.ARRAY_BUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.depthMask(!0)},f.prototype.doDrawOrderedText=function(t){var e=t.currentGlContext,r=t.currentProgram;if(!t.pickingMode&&this.currentVisibility!==this.targetVisibility){var n=(t.timestamp-t.previousRedrawTimestamp)/t.fadeTime;this.currentVisibility<this.targetVisibility?this.currentVisibility=Math.min(1,this.currentVisibility+n):this.currentVisibility=Math.max(0,this.currentVisibility-n),t.redrawRequested=!0}this.activeAttributes.depthTest||e.disable(e.DEPTH_TEST),t.pickingMode?(this.pickColor=t.uniquePickColor(),r.loadColor
98(e,this.pickColor),r.loadOpacity(e,1),r.loadTextureEnabled(e,!1)):(r.loadColor(e,i.WHITE),r.loadOpacity(e,this.layer.opacity*this.currentVisibility)),this.currentVisibility>0&&this.drawLabel(t),this.currentVisibility<1&&this.markerImageSource&&this.drawMarker(t),this.activeAttributes.depthTest||e.enable(e.DEPTH_TEST)},f.prototype.drawLabel=function(t){var e,i=t.currentGlContext,r=t.currentProgram;!t.pickingMode&&this.activeTexture&&(f.matrix.setToIdentity(),f.matrix.multiplyByTextureTransform(this.activeTexture),e=this.activeTexture.bind(t),r.loadTextureEnabled(i,e),r.loadTextureMatrix(i,f.matrix)),f.matrix.copy(t.screenProjection),f.matrix.multiplyMatrix(this.imageTransform),r.loadModelviewProjection(i,f.matrix),i.drawArrays(i.TRIANGLE_STRIP,0,4)},f.prototype.drawMarker=function(t){var e,i=t.currentGlContext,r=t.currentProgram,n=t.gpuResourceCache.resourceForKey(this.markerImageSource);if(!n)return void t.gpuResourceCache.retrieveTexture(t.currentGlContext,this.markerImageSource);t.pickingMode||(f.matrix.setToIdentity(),f.matrix.multiplyByTextureTransform(n),e=n.bind(t),r.loadTextureEnabled(i,e),r.loadTextureMatrix(i,f.matrix),r.loadOpacity(i,this.layer.opacity*(1-this.currentVisibility)));var o=this.markerImageScale;f.matrix.copy(t.screenProjection),f.matrix.multiplyByTranslation(this.screenPoint[0]-o*n.imageWidth/2,this.screenPoint[1]-o*n.imageWidth/2,this.screenPoint[2]),f.matrix.multiplyByScale(n.imageWidth*o,n.imageHeight*o,1),r.loadModelviewProjection(i,f.matrix),i.drawArrays(i.TRIANGLE_STRIP,0,4)},f}),i("shapes/ScreenText",["../error/ArgumentError","../util/Logger","../util/Offset","../shapes/Text"],function(t,e,i,r){"use strict";var n=function(i,n){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"Text","constructor","missingOffset"));r.call(this,n),this.screenOffset=i,this.altitudeMode=null};return n.prototype=Object.create(r.prototype),n.prototype.render=function(t){this.lastFrameTime!==t.timestamp&&r.prototype.render.call(this,t)},n.prototype.computeScreenPointAndEyeDistance=function(t){var e=t.currentGlContext,i=this.screenOffset.offsetForSize(e.drawingBufferWidth,e.drawingBufferHeight);return this.screenPoint[0]=i[0],this.screenPoint[1]=i[1],this.screenPoint[2]=0,this.eyeDistance=0,!0},n}),i("layer/CoordinatesDisplayLayer",["../error/ArgumentError","../util/Color","../util/Font","../layer/Layer","../util/Logger","../util/Offset","../geom/Position","../shapes/ScreenImage","../shapes/ScreenText","../shapes/TextAttributes","../geom/Vec2"],function(t,e,i,r,n,o,s,a,l,h,u){"use strict";var c=function(i){function s(t){f.handleUIEvent(t)}function u(t,e){f.handleRedraw(e)}if(!i)throw new t(n.logMessage(n.LEVEL_SEVERE,"CoordinatesDisplayLayer","constructor","missingWorldWindow"));r.call(this,"Coordinates"),this.wwd=i,this.pickEnabled=!1,this.eventType=null,this.clientX=null,this.clientY=null,this.terrainPosition=null,this.latText=new l(new o(WorldWind.OFFSET_PIXELS,0,WorldWind.OFFSET_PIXELS,0)," "),this.latText.attributes=new h(null),this.latText.attributes.color=e.YELLOW,this.lonText=new l(new o(WorldWind.OFFSET_PIXELS,0,WorldWind.OFFSET_PIXELS,0)," "),this.lonText.attributes=new h(null),this.lonText.attributes.color=e.YELLOW,this.elevText=new l(new o(WorldWind.OFFSET_PIXELS,0,WorldWind.OFFSET_PIXELS,0)," "),this.elevText.attributes=new h(null),this.elevText.attributes.color=e.YELLOW,this.eyeText=new l(new o(WorldWind.OFFSET_PIXELS,0,WorldWind.OFFSET_PIXELS,0)," "),this.eyeText.attributes=new h(null),this.eyeText.attributes.color=e.YELLOW;var c=new o(WorldWind.OFFSET_FRACTION,.5,WorldWind.OFFSET_FRACTION,.5),d=WorldWind.configuration.baseUrl+"images/crosshair.png";this.crosshairImage=new a(c,d);var f=this;window.PointerEvent?(i.addEventListener("pointerdown",s),i.addEventListener("pointermove",s),i.addEventListener("pointerleave",s)):(i.addEventListener("mousedown",s),i.addEventListener("mousemove",s),i.addEventListener("mouseleave",s),i.addEventListener("touchstart",s),i.addEventListener("touchmove",s)),this.wwd.redrawCallbacks.push(u)};return c.prototype=Object.create(r.prototype),c.prototype.doRender=function(t){var e,i,r,n,s,a=this.terrainPosition,l=t.eyePosition,h=t.currentGlContext.canvas.clientWidth;h>650?(e=h/2-50,i=11,r=WorldWind.OFFSET_PIXELS,n=0):h>400?(e=60,i=5,r=WorldWind.OFFSET_INSET_PIXELS,n=1):(e=60,i=5,r=WorldWind.OFFSET_INSET_PIXELS,n=1,s=!0),this.latText.text=a?this.formatLatitude(a.latitude):null,this.latText.screenOffset=new o(WorldWind.OFFSET_PIXELS,e,r,i),this.latText.attributes.offset=new o(WorldWind.OFFSET_FRACTION,1,WorldWind.OFFSET_FRACTION,n),this.latText.render(t),e+=70,this.lonText.text=a?this.formatLongitude(a.longitude):null,this.lonText.screenOffset=new o(WorldWind.OFFSET_PIXELS,e,r,i),this.lonText.attributes.offset=new o(WorldWind.OFFSET_FRACTION,1,WorldWind.OFFSET_FRACTION,n),this.lonText.render(t),t.globe.is2D()||(e+=70,this.elevText.text=a?this.formatAltitude(a.altitude,"m"):null,this.elevText.screenOffset=new o(WorldWind.OFFSET_PIXELS,e,r,i),this.elevText.attributes.offset=new o(WorldWind.OFFSET_FRACTION,1,WorldWind.OFFSET_FRACTION,n),this.elevText.render(t)),s||(e+=40,this.eyeText.text="Eye "+this.formatAltitude(l.altitude,l.altitude<1e3?"m":"km"),this.eyeText.screenOffset=new o(WorldWind.OFFSET_PIXELS,e,r,i),this.eyeText.attributes.offset=new o(WorldWind.OFFSET_FRACTION,0,WorldWind.OFFSET_FRACTION,n),this.eyeText.render(t)),"touch"===this.eventType&&this.crosshairImage.render(t),this.inCurrentFrame=!0},c.prototype.handleUIEvent=function(t){-1!==t.type.indexOf("pointer")?this.eventType=t.pointerType:-1!==t.type.indexOf("mou
98se")?this.eventType="mouse":-1!==t.type.indexOf("touch")&&(this.eventType="touch"),-1!==t.type.indexOf("leave")?(this.clientX=null,this.clientY=null):(this.clientX=t.clientX,this.clientY=t.clientY),this.wwd.redraw()},c.prototype.handleRedraw=function(t){if(t===WorldWind.BEFORE_REDRAW){var e,i;("mouse"===this.eventType||"pen"===this.eventType)&&this.clientX&&this.clientY?(e=this.wwd.canvasCoordinates(this.clientX,this.clientY),e[0]>=0&&e[0]<this.wwd.canvas.width&&e[1]>=0&&e[1]<this.wwd.canvas.height&&(i=this.wwd.pickTerrain(e).terrainObject())):"touch"===this.eventType&&(e=new u(this.wwd.canvas.width/2,this.wwd.canvas.height/2),i=this.wwd.pickTerrain(e).terrainObject()),this.terrainPosition=i?i.position:null}},c.prototype.formatLatitude=function(t){var e=t<0?"°S":"°N";return Math.abs(t).toFixed(2)+e},c.prototype.formatLongitude=function(t){var e=t<0?"°W":"°E";return Math.abs(t).toFixed(2)+e},c.prototype.formatAltitude=function(t,e){return"km"===e&&(t/=1e3),t.toFixed(0).replace(/\B(?=(\d{3})+(?!\d))/g,",")+" "+e},c}),i("util/Date",[],function(){"use strict";var t=function(t){this._date=t?new Date(t):new Date};return t.prototype=Object.create(Date.prototype),t.prototype.isAfter=function(t){return-1==this.compare(t)},t.prototype.isBefore=function(t){return 1==this.compare(t)},t.prototype.valueOf=function(){return this._date.valueOf()},t.prototype.getTime=function(){return this._date.getTime()},t.prototype.compare=function(t){var e=this._date.valueOf(),i=t.valueOf();return e>i?-1:e<i?1:0},t}),i("layer/DigitalGlobeTiledImageLayer",["../geom/Angle","../error/ArgumentError","../util/Color","../geom/Location","../util/Logger","../geom/Sector","../layer/MercatorTiledImageLayer"],function(t,e,i,r,n,o,s){"use strict";var a=function(t,i,a){if(!i)throw new e(n.logMessage(n.LEVEL_SEVERE,"DigitalGlobeTiledImageLayer","constructor","The map ID is null or undefined."));if(!a)throw new e(n.logMessage(n.LEVEL_SEVERE,"DigitalGlobeTiledImageLayer","constructor","The access token is null or undefined."));this.imageSize=256,t=t||"Digital Globe",s.call(this,new o(-85.05,85.05,-180,180),new r(85.05,180),19,"image/jpeg",t,this.imageSize,this.imageSize),this.mapId=i,this.accessToken=a,this.displayName=t,this.pickEnabled=!0,this.destCanvas=document.createElement("canvas"),this.destContext=this.destCanvas.getContext("2d"),this.requestMetadata();var l=this;this.urlBuilder={urlForTile:function(t,e){return l.metadataRetrievalInProcess?null:l.urlTemplate.replace("{z}",t.level.levelNumber+1).replace("{x}",t.column).replace("{y}",t.row)}}};return a.prototype=Object.create(s.prototype),a.prototype.requestMetadata=function(){if(!this.metadataRetrievalInProcess){this.metadataRetrievalInProcess=!0;var t="https://api.mapbox.com/v4/"+this.mapId+".json?secure&access_token="+this.accessToken,e=new XMLHttpRequest,i=this;e.onreadystatechange=function(){if(4===e.readyState&&200===e.status){var t=JSON.parse(e.responseText);i.urlTemplate=t.tiles[0];var r=document.createEvent("Event");r.initEvent(WorldWind.REDRAW_EVENT_TYPE,!0,!0),window.dispatchEvent(r),i.metadataRetrievalInProcess=!1}},e.open("GET",t,!0),e.send()}},a.prototype.doRender=function(t){s.prototype.doRender.call(this,t),this.inCurrentFrame&&t.screenCreditController.addCredit("© Digital Globe",i.DARK_GRAY)},a.prototype.createTopLevelTiles=function(t){this.topLevelTiles=[],this.topLevelTiles.push(this.createTile(null,this.levels.firstLevel(),0,0)),this.topLevelTiles.push(this.createTile(null,this.levels.firstLevel(),0,1)),this.topLevelTiles.push(this.createTile(null,this.levels.firstLevel(),1,0)),this.topLevelTiles.push(this.createTile(null,this.levels.firstLevel(),1,1))},a.prototype.mapSizeForLevel=function(t){return 256<<t+1},a}),i("util/FrameStatistics",[],function(){"use strict";var t=function(){this.frameCount=0,this.frameTimeCumulative=0,this.frameTimeBase=0,this.frameTimeExtremes=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],this.frameTime=0,this.tessellationTime=0,this.layerRenderingTime=0,this.orderedRenderingTime=0,this.terrainTileCount=0,this.imageTileCount=0,this.renderedTileCount=0,this.tileUpdate
98Count=0,this.textureLoadCount=0,this.vboLoadCount=0,this.frameTimeAverage=0,this.frameRateAverage=0,this.frameTimeMin=0,this.frameTimeMax=0};return t.prototype.beginFrame=function(){this.frameTime=Date.now(),this.tessellationTime=0,this.layerRenderingTime=0,this.orderedRenderingTime=0,this.terrainTileCount=0,this.imageTileCount=0,this.renderedTileCount=0,this.tileUpdateCount=0,this.textureLoadCount=0,this.vboLoadCount=0,++this.frameCount},t.prototype.endFrame=function(){var t=Date.now();this.frameTime=t-this.frameTime,this.frameTimeCumulative+=this.frameTime,this.frameTimeExtremes[0]=Math.min(this.frameTimeExtremes[0],this.frameTime),this.frameTimeExtremes[1]=Math.max(this.frameTimeExtremes[1],this.frameTime),t-this.frameTimeBase>2e3&&(this.frameTimeAverage=this.frameTimeCumulative/this.frameCount,this.frameRateAverage=1e3*this.frameCount/(t-this.frameTimeBase),this.frameTimeMin=this.frameTimeExtremes[0],this.frameTimeMax=this.frameTimeExtremes[1],this.frameCount=0,this.frameTimeCumulative=0,this.frameTimeBase=t,this.frameTimeExtremes=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY])},t.prototype.incrementRenderedTileCount=function(t){this.renderedTileCount+=t},t.prototype.setTerrainTileCount=function(t){this.terrainTileCount=t},t.prototype.incrementImageTileCount=function(t){this.imageTileCount=t},t.prototype.incrementTileUpdateCount=function(t){this.tileUpdateCount+=t},t.prototype.incrementTextureLoadCount=function(t){this.textureLoadCount+=t},t.prototype.incrementVboLoadCount=function(t){this.vboLoadCount+=t},t}),i("render/FramebufferTexture",["../error/ArgumentError","../util/Logger","../util/WWMath"],function(t,e){"use strict";var i=function(i,r,n,o){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"FramebufferTexture","constructor","missingGlContext"));if(r<0||n<0)throw new t(e.logMessage(e.LEVEL_SEVERE,"FramebufferTexture","constructor","The framebuffer width or height is less than zero."));this.width=r,this.height=n,this.depth=o,this.size=r*n*4+(o?r*n*2:0),this.framebufferId=i.createFramebuffer(),i.bindFramebuffer(i.FRAMEBUFFER,this.framebufferId),this.texture=i.createTexture(),i.bindTexture(i.TEXTURE_2D,this.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,r,n,0,i.RGBA,i.UNSIGNED_BYTE,null),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,this.texture,0),this.depthBuffer=null,o&&(this.depthBuffer=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,this.depthBuffer),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,r,n),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,this.depthBuffer));var s=i.checkFramebufferStatus(i.FRAMEBUFFER);s!=i.FRAMEBUFFER_COMPLETE&&(e.logMessage(e.LEVEL_WARNING,"FramebufferTexture","constructor","Error creating framebuffer: "+s),this.framebufferId=null,this.texture=null,this.depthBuffer=null),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindRenderbuffer(i.RENDERBUFFER,null),i.bindTexture(i.TEXTURE_2D,null)};return i.prototype.bind=function(t){return this.texture&&t.currentGlContext.bindTexture(gl.TEXTURE_2D,this.texture),!!this.texture},i}),i("render/FramebufferTile",["../error/ArgumentError","../render/FramebufferTexture","../util/Logger","../geom/Matrix","../geom/Rectangle","../render/TextureTile"],function(t,e,i,r,n,o){"use strict";var s=function(e,n,s,a,l){if(!l||l.length<1)throw new t(i.logMessage(i.LEVEL_SEVERE,"FramebufferTile","constructor","The specified cache name is null, undefined or zero length."));o.call(this,e,n,s,a),this.gpuCacheKey=l,this.textureTransform=r.fromIdentity().setToUnitYFlip(),this.mustClear=!0};return s.prototype=Object.create(o.prototype),s.prototype.clearFramebuffer=function(t){this.mustClear=!0},s.prototype.bindFramebuffer=function(t){var e=t.gpuResourceCache.resourceForKey(this.gpuCacheKey);return e||(e=this.createFramebuffer(t)),t.bindFramebuffer(e),this.mustClear&&(this.doClearFramebuffer(t),this.mustClear=!1),!0},s.prototype.createFramebuffer=function(t){var i=new e(t.currentGlContext,this.tileWidth,this.tileHeight,!1);
98return t.gpuResourceCache.putResource(this.gpuCacheKey,i,i.size),i},s.prototype.doClearFramebuffer=function(t){var e=t.currentGlContext;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},s.prototype.applyInternalTransform=function(t,e){e.multiplyMatrix(this.textureTransform)},s}),i("render/FramebufferTileController",["../error/ArgumentError","../render/FramebufferTile","../util/LevelSet","../geom/Location","../util/Logger","../cache/MemoryCache","../geom/Sector","../util/Tile"],function(t,e,i,r,n,o,s,a){"use strict";var l=function(){this.tileWidth=256,this.tileHeight=256,this.detailControl=1.75,this.levels=new i(s.FULL_SPHERE,new r(45,45),16,this.tileWidth,this.tileHeight),this.topLevelTiles=[],this.currentTiles=[],this.currentTimestamp=null,this.currentGlobeStateKey=null,this.tileCache=new o(5e5,4e5),this.key="FramebufferTileController "+ ++l.keyPool};return l.keyPool=0,l.prototype.selectTiles=function(e,i){if(!i)throw new t(n.logMessage(n.LEVEL_SEVERE,"FramebufferTileController","selectTiles","missingSector"));this.assembleTiles(e);for(var r=[],o=0,s=this.currentTiles.length;o<s;o++){var a=this.currentTiles[o];a.sector.overlaps(i)&&(a.selected=!0,r.push(a))}return r},l.prototype.render=function(t){if(0!=this.currentTiles.length){for(var e=[],i=0,r=this.currentTiles.length;i<r;i++){var n=this.currentTiles[i];n.selected&&e.push(n)}t.surfaceTileRenderer.renderTiles(t,e,1);var o=t.currentGlContext,s=t.currentFramebuffer;try{for(o.clearColor(0,0,0,0),i=0,r=e.length;i<r;i++)n=e[i],n.selected=!1,n.bindFramebuffer(t),o.clear(o.COLOR_BUFFER_BIT)}finally{t.bindFramebuffer(s)}}},l.prototype.assembleTiles=function(t){var e=t.timestamp,i=t.globeStateKey;this.currentTimestamp==e&&this.currentGlobeStateKey==i||(this.doAssembleTiles(t),this.currentTimestamp=e,this.currentGlobeStateKey=i)},l.prototype.doAssembleTiles=function(t){if(this.currentTiles=[],t.terrain){0==this.topLevelTiles.length&&this.createTopLevelTiles();for(var e=0,i=this.topLevelTiles.length;e<i;e++){var r=this.topLevelTiles[e];r.update(t),this.isTileVisible(t,r)&&this.addTileOrDescendants(t,r)}}},l.prototype.createTile=function(t,i,r,n){var o=this.key+" "+i.levelNumber+"."+r+"."+n;return new e(t,i,r,n,o)},l.prototype.createTopLevelTiles=function(){a.createTilesForLevel(this.levels.firstLevel(),this,this.topLevelTiles)},l.prototype.addTileOrDescendants=function(t,e){if(this.tileMeetsRenderingCriteria(t,e))return void this.addTile(e);for(var i=e.subdivideToCache(e.level.nextLevel(),this,this.tileCache),r=0,n=i.length;r<n;r++){var o=i[r];o.update(t),this.isTileVisible(t,o)&&this.addTileOrDescendants(t,o)}},l.prototype.addTile=function(t){this.currentTiles.push(t)},l.prototype.isTileVisible=function(t,e){return!(t.globe.projectionLimits&&!e.sector.overlaps(t.globe.projectionLimits))&&(t.pickingMode?e.extent.intersectsFrustum(t.pickFrustum):e.extent.intersectsFrustum(t.frustumInModelCoordinates))},l.prototype.tileMeetsRenderingCriteria=function(t,e){var i=this.detailControl;return(e.sector.minLatitude>=75||e.sector.maxLatitude<=-75)&&(i*=1.2),e.level.isLastLevel()||!e.mustSubdivide(t,i)},l}),i("globe/ElevationModel",["../error/ArgumentError","../geom/Angle","../geom/Location","../util/Logger"],function(t,e,i,r){"use strict";var n=function(){this.id=0,this.stateKey="",this.coverages=[],this.scratchLocation=new i(0,0),this.computeStateKey()};return Object.defineProperties(n.prototype,{timestamp:{get:function(){var t,e,i=0;for(t=0,e=this.coverages.length;t<e;t++){var r=this.coverages[t];i<r.timestamp&&(i=r.timestamp)}return i}},minElevation:{get:function(){for(var t=Number.MAX_VALUE,e=0,i=this.coverages.length;e<i;e++){var r=this.coverages[e];r.enabled&&r.minElevation<t&&(t=r.minElevation)}return t!==Number.MAX_VALUE?t:0}},maxElevation:{get:function(){for(var t=-Number.MAX_VALUE,e=0,i=this.coverages.length;e<i;e++){var r=this.coverages[e];r.enabled&&r.maxElevation>t&&(t=r.maxElevation)}return t!==-Number.MAX_VALUE?t:0}}}),n.idPool=0,n.prototype.computeStateKey=function(){this.id=++n.idPool,this.stateKey="elevationModel "+this.id.toString()+" "},n.prototype.coverageComparator=function(t,e){var i=t.resolution,r=e.resolution;return i>r?-1:i===r?0:1},n.prototype.performCoverageListChangedActions=function(){this.coverages.length>1&&this.coverages.sort(this.coverageComparator),this.computeStateKey()},n.prototype.addCoverage=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"ElevationModel","addCoverage","missingCoverage"));return!this.containsCoverage(e)&&(this.coverages.push(e),this.performCoverageListChangedActions(),!0)},n.prototype.removeAllCoverages=function(){this.coverages.length>0&&(this.coverages=[],this.performCoverageListChangedActions())},n.prototype.removeCoverage=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"ElevationModel","removeCoverage","missingCoverage"));var i=this.coverages.indexOf(e);i>=0&&(this.coverages.splice(i,1),this.performCoverageListChangedActions())},n.prototype.containsCoverage=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"ElevationModel","containsCoverage","missingCoverage"));return this.coverages.indexOf(e)>=0},n.prototype.minAndMaxElevationsForSector=function(e){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"ElevationModel","minAndMaxElevationsForSector","missingSector"));for(var i=[Number.MAX_VALUE,-Number.MAX_VALUE],n=this.coverages.length-1;n>=0;n--){var o=this.coverages[n];
98if(o.enabled&&o.coverageSector.intersects(e)&&o.minAndMaxElevationsForSector(e,i))break}return i[0]!==Number.MAX_VALUE?i:[0,0]},n.prototype.elevationAtLocation=function(t,e){var i,r=this.coverages.length;for(i=r-1;i>=0;i--){var n=this.coverages[i];if(n.enabled&&n.coverageSector.containsLocation(t,e)){var o=n.elevationAtLocation(t,e) 99;if(null!==o)return o}}return 0},n.prototype.preferredCoverageIndex=function(t,e,i){var r,n=this.coverages.length,o=Number.MAX_VALUE,s=-1;for(r=0;r<n;r++){var a=this.coverages[r];if(a.enabled&&(null!==t&&a.coverageSector.intersects(t)||null!==e&&a.coverageSector.containsLocation(e.latitude,e.longitude))){var l=Math.abs(a.resolution-i);if(l>o)return s;o=l,s=r}}return s},n.prototype.bestCoverageAtLocation=function(e,i,n){if(!n||n<0)throw new t(r.logMessage(r.LEVEL_SEVERE,"ElevationModel","bestCoverageAtLocation","invalidResolution"));this.scratchLocation.set(e,i);var o=this.preferredCoverageIndex(null,this.scratchLocation,n);return o>=0?this.coverages[o]:null},n.prototype.elevationsForGrid=function(e,i,n,o,s){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"ElevationModel","elevationsForGrid","missingSector"));if(!i||!n||i<1||n<1)throw new t(r.logMessage(r.LEVEL_SEVERE,"ElevationModel","elevationsForGrid","The specified number of latitudinal or longitudinal positions is less than one."));if(!o)throw new t(r.logMessage(r.LEVEL_SEVERE,"ElevationModel","elevationsForGrid","missingTargetResolution"));if(!s)throw new t(r.logMessage(r.LEVEL_SEVERE,"ElevationModel","elevationsForGrid","missingResult"));s.fill(NaN);var a=Number.MAX_VALUE,l=!1,h=this.preferredCoverageIndex(e,null,o);if(h>=0)for(var u=h;!l&&u>=0;u--){var c=this.coverages[u];c.enabled&&c.coverageSector.intersects(e)&&(l=c.elevationsForGrid(e,i,n,s))&&(a=c.resolution)}if(!l){var d=s.length;for(u=0;u<d;u++)isNaN(s[u])&&(s[u]=0)}return a},n}),i("projections/GeographicProjection",["../error/ArgumentError","../util/Logger","../geom/Sector","../error/UnsupportedOperationError"],function(t,e,i,r){"use strict";var n=function(t,e,i){this.displayName=t||"Geographic Projection",this.continuous=e,this.projectionLimits=i,this.is2D=!0};return n.prototype.geographicToCartesian=function(t,i,n,o,s,a){throw new r(e.logMessage(e.LEVEL_SEVERE,"GeographicProjection","geographicToCartesian","abstractInvocation"))},n.prototype.geographicToCartesianGrid=function(t,i,n,o,s,a,l,h){throw new r(e.logMessage(e.LEVEL_SEVERE,"GeographicProjection","geographicToCartesianGrid","abstractInvocation"))},n.prototype.cartesianToGeographic=function(t,i,n,o,s,a){throw new r(e.logMessage(e.LEVEL_SEVERE,"GeographicProjection","cartesianToGeographic","abstractInvocation"))},n.prototype.northTangentAtLocation=function(i,r,n,o){if(!o)throw new t(e.logMessage(e.LEVEL_SEVERE,"ProjectionEquirectangular","northTangentAtLocation","missingResult"));return o[0]=0,o[1]=1,o[2]=0,o},n.prototype.northTangentAtPoint=function(i,r,n,o,s,a){if(!a)throw new t(e.logMessage(e.LEVEL_SEVERE,"ProjectionEquirectangular","northTangentAtPoint","missingResult"));return a[0]=0,a[1]=1,a[2]=0,a},n.prototype.surfaceNormalAtLocation=function(i,r,n,o){if(!o)throw new t(e.logMessage(e.LEVEL_SEVERE,"GeographicProjection","surfaceNormalAtLocation","missingResult"));return o[0]=0,o[1]=0,o[2]=1,o},n.prototype.surfaceNormalAtPoint=function(i,r,n,o,s){if(!s)throw new t(e.logMessage(e.LEVEL_SEVERE,"GeographicProjection","surfaceNormalAtPoint","missingResult"));return s[0]=0,s[1]=0,s[2]=1,s},n}),i("projections/ProjectionWgs84",["../geom/Angle","../error/ArgumentError","../projections/GeographicProjection","../util/Logger","../geom/Position","../geom/Vec3","../util/WWMath"],function(t,e,i,r,n,o,s){"use strict";var a=function(){i.call(this,"WGS84",!1,null),this.is2D=!1,this.scratchPosition=new n(0,0,0)};return a.prototype=Object.create(i.prototype),Object.defineProperties(a.prototype,{stateKey:{get:function(){return"projection wgs84 "}}}),a.prototype.geographicToCartesian=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionWgs84","geographicToCartesian","missingGlobe"));var h=Math.cos(n*t.DEGREES_TO_RADIANS),u=Math.sin(n*t.DEGREES_TO_RADIANS),c=Math.cos(o*t.DEGREES_TO_RADIANS),d=Math.sin(o*t.DEGREES_TO_RADIANS),f=i.equatorialRadius/Math.sqrt(1-i.eccentricitySquared*u*u);return l[0]=(f+s)*h*d,l[1]=(f*(1-i.eccentricitySquared)+s)*u,l[2]=(f+s)*h*c,l},a.prototype.geographicToCartesianGrid=function(i,n,s,a,l,h,u,c){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionWgs84","geographicToCartesianGrid","missingGlobe"));var d,f,p,g,m,y,E,v,_=n.minLatitude*t.DEGREES_TO_RADIANS,b=n.maxLatitude*t.DEGREES_TO_RADIANS,S=n.minLongitude*t.DEGREES_TO_RADIANS,w=n.maxLongitude*t.DEGREES_TO_RADIANS,L=(b-_)/(s>1?s-1:1),T=(w-S)/(a>1?a-1:1),x=h||new o(0,0,0),R=0,M=0,C=new Float64Array(a),A=new Float64Array(a);for(f=0,g=S;f<a;f++,g+=T)f===a-1&&(g=w),C[f]=Math.cos(g),A[f]=Math.sin(g);for(d=0,p=_;d<s;d++,p+=L)for(d===s-1&&(p=b),E=Math.cos(p),v=Math.sin(p),m=i.equatorialRadius/Math.sqrt(1-i.eccentricitySquared*v*v),f=0;f<a;f++)y=l[R++],c[M++]=(m+y)*E*A[f]-x[0],c[M++]=(m*(1-i.eccentricitySquared)+y)*v-x[1],c[M++]=(m+y)*E*C[f]-x[2];return c},a.prototype.cartesianToGeographic=function(i,n,o,a,l,h){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionWgs84","cartesianToGeographic","missingGlobe"));var u,c,d,f,p,g,m,y,E,v,_,b,S,w,L,T=a,x=n,R=o,M=T*T+x*x,C=Math.sqrt(M),A=i.equatorialRadius,P=1/(A*A),N=i.eccentricitySquared,O=N*N,I=M*P,D=R*
99R*(1-N)*P,k=(I+D-O)/6,V=8*k*k*k+O*I*D;return V>0||0!=D?(V>0?(f=Math.sqrt(V),p=Math.sqrt(O*I*D),V>10*N?(g=s.cbrt((f+p)*(f+p)),d=k+.5*g+2*k*k/g):d=k+.5*s.cbrt((f+p)*(f+p))+.5*s.cbrt((f-p)*(f-p))):(f=Math.sqrt(-V),p=Math.sqrt(-8*k*k*k),g=Math.sqrt(O*I*D),m=2*Math.atan2(g,f+p)/3,d=-4*k*Math.sin(m)*Math.cos(Math.PI/6+m)),y=Math.sqrt(d*d+O*D),E=N*(d+y-D)/(2*y),v=(d+y)/(Math.sqrt(E*E+d+y)+E),_=v*C/(v+N),b=Math.sqrt(_*_+R*R),u=(v+N-1)*b/v,c=2*Math.atan2(R,b+_)):(f=Math.sqrt(1-N),p=Math.sqrt(N-I),S=Math.sqrt(N),u=-A*f*p/S,c=p/(S*p+f*Math.sqrt(I))),L=Math.sqrt(2),w=(L-1)*x<C+T?2*Math.atan2(x,C+T):C+x<(L+1)*T?.5*-Math.PI+2*Math.atan2(T,C-x):.5*Math.PI-2*Math.atan2(T,C+x),h.latitude=t.RADIANS_TO_DEGREES*c,h.longitude=t.RADIANS_TO_DEGREES*w,h.altitude=u,h},a.prototype.northTangentAtLocation=function(e,i,r,n){var o=Math.cos(i*t.DEGREES_TO_RADIANS),s=Math.cos(r*t.DEGREES_TO_RADIANS),a=Math.sin(i*t.DEGREES_TO_RADIANS),l=Math.sin(r*t.DEGREES_TO_RADIANS);return n[0]=-a*l,n[1]=o,n[2]=-a*s,n.normalize()},a.prototype.northTangentAtPoint=function(t,e,i,r,n,s){return this.cartesianToGeographic(t,e,i,r,o.ZERO,this.scratchPosition),this.northTangentAtLocation(t,this.scratchPosition.latitude,this.scratchPosition.longitude,s)},a.prototype.surfaceNormalAtLocation=function(e,i,r,n){var o=Math.cos(i*t.DEGREES_TO_RADIANS),s=Math.cos(r*t.DEGREES_TO_RADIANS),a=Math.sin(i*t.DEGREES_TO_RADIANS),l=Math.sin(r*t.DEGREES_TO_RADIANS);return n[0]=o*l,n[1]=a,n[2]=o*s,n.normalize()},a.prototype.surfaceNormalAtPoint=function(t,i,n,o,s){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionWgs84","surfaceNormalAtPoint","missingGlobe"));var a=t.equatorialRadius*t.equatorialRadius,l=t.polarRadius*t.polarRadius;return s[0]=i/a,s[1]=n/l,s[2]=o/a,s.normalize()},a}),i("globe/Terrain",["../error/ArgumentError","../util/Logger","../geom/Vec3"],function(t,e,i){"use strict";var r=function(t,e,i,r){this.globe=t,this.verticalExaggeration=r,this.sector=i.sector,this.tessellator=e,this.surfaceGeometry=i.tileArray,this.stateKey=t.stateKey+" ve "+r.toString()};return r.scratchPoint=new i(0,0,0),r.prototype.surfacePoint=function(i,n,o,s){if(!s)throw new t(e.logMessage(e.LEVEL_SEVERE,"Terrain","surfacePoint","missingResult"));for(var a=0,l=this.surfaceGeometry.length;a<l;a++)if(this.surfaceGeometry[a].sector.containsLocation(i,n)){if(this.surfaceGeometry[a].surfacePoint(i,n,s),o){var h=this.globe.surfaceNormalAtPoint(s[0],s[1],s[2],r.scratchPoint);s[0]+=h[0]*o,s[1]+=h[1]*o,s[2]+=h[2]*o}return s}var u=o+this.globe.elevationAtLocation(i,n)*this.verticalExaggeration;return this.globe.computePointFromPosition(i,n,u,s),s},r.prototype.surfacePointForMode=function(i,r,n,o,s){if(!s)throw new t(e.logMessage(e.LEVEL_SEVERE,"Terrain","surfacePointForMode","missingResult"));if(o||(o=WorldWind.ABSOLUTE),o===WorldWind.CLAMP_TO_GROUND)return this.surfacePoint(i,r,0,s);if(o===WorldWind.RELATIVE_TO_GROUND)return this.surfacePoint(i,r,n,s);var a=n*this.verticalExaggeration;return this.globe.computePointFromPosition(i,r,a,s),s},r.prototype.beginRendering=function(t){this.globe&&this.globe.tessellator&&this.globe.tessellator.beginRendering(t)},r.prototype.endRendering=function(t){this.globe&&this.globe.tessellator&&this.globe.tessellator.endRendering(t)},r.prototype.beginRenderingTile=function(i,r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"Terrain","beginRenderingTile","missingTile"));this.globe&&this.globe.tessellator&&this.globe.tessellator.beginRenderingTile(i,r)},r.prototype.endRenderingTile=function(t,e){},r.prototype.renderTile=function(i,r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"Terrain","renderTile","missingTile"));this.globe&&this.globe.tessellator&&this.globe.tessellator.renderTile(i,r)},r.prototype.pick=function(t){this.globe&&this.globe.tessellator&&this.globe.tessellator.pick(t,this.surfaceGeometry,this)},r}),i("globe/TerrainTile",["../error/ArgumentError","../util/Logger","../geom/Matrix","../util/Tile"],function(t,e,i,r){"use strict";var n=function(t,e,n,o){r.call(this,t,e,n,o),this.transformationMatrix=i.fromIdentity(),this.points=null,this.pointsStateKey=null,this.pointsVboStateKey=null,this.neighborMap={},this.neighborMap[WorldWind.NORTH]=null,this.neighborMap[WorldWind.SOUTH]=null,this.neighborMap[WorldWind.EAST]=null,this.neighborMap[WorldWind.WEST]=null,this._stateKey=null,this._elevationTimestamp=null,this.scratchArray=[]};return n.prototype=Object.create(r.prototype),Object.defineProperties(n.prototype,{stateKey:{get:function(){return this._stateKey||(this._stateKey=this.computeStateKey()),this._stateKey}}}),n.prototype.neighborLevel=function(t){return this.neighborMap[t]},n.prototype.setNeighborLevel=function(t,e){this.neighborMap[t]=e,this._stateKey=null},n.prototype.surfacePoint=function(i,r,n){if(!n)throw new t(e.logMessage(e.LEVEL_SEVERE,"TerrainTile","surfacePoint","missingResult"));var o,s,a,l,h,u,c,d,f,p,g=this.sector,m=g.minLatitude,y=g.maxLatitude,E=g.minLongitude,v=g.maxLongitude,_=this.tileWidth,b=this.tileHeight;o=(r-E)/(v-E)*_,s=(i-m)/(y-m)*b,a=o<_?Math.floor(o):_-1,l=s<b?Math.floor(s):b-1,h=_+1,u=this.points,c=this.scratchArray,d=3*(a+l*h);for(var S=0;S<6;S++)c[S]=u[d+S];d=3*(a+(l+1)*h);for(var w=6;w<12;w++)c[w]=u[d+(w-6)];return f=o<_?o-Math.floor(o):1,p=s<b?s-Math.floor(s):1,f>p?(n[0]=c[0]+f*(c[3]-c[0])+p*(c[6]-c[0]),n[1]=c[1]+f*(c[4]-c[1])+p*(c[7]-c[1]),n[2]=c[2]+f*(c[5]-c[2])+p*(c[8]-c[2])):(n[0]=c[9]+(1-f)*(c[6]-c[9])+(1-p)*(c[3]-c[9]),n[1]=c[10]+(1-f)*(c[7]-c[10])+(1-p)*(c[4]-c[10]),n[2]=c[11]+(1-f)*(c[8]-c[11])+(1-p)*(c[5]-c[11])),n[0]+=this.referencePoint[0],n[1]+=this.referencePoint[1],n[2]+=this.referencePoint[2],n},n.prototype.update=function(t){r.prototype.update.call(this,t);var e=t.globe.elevationTimestamp();this._elevationTimestamp!=e&&(this._elevationTimestamp=e,this._stateKey=null)},n.prototype.computeStateKey=function(){var t=[];return t.push(this._elevationTimestamp),t.push(this.neighborMap[WorldWind.NORTH]?this.neighborMap[WorldWind.NORTH].compare(this.level):0),t.push(this.neighborMap[WorldWind.SOUTH]?this.neighborMap[WorldWind.SOUTH].compare(this.level):0),t.push(this.neighborMap[WorldWind.EAST]?this.neighborMap[WorldWind.EAST].compare(this.level):0),t.push(this.neighborMap[WorldWind.WEST]?this.neighborMap[WorldWind.WEST].compare(this.level):0),t.join(".")},n}),i("globe/TerrainTileList",["../error/ArgumentError","../util/Logger","../geom/Sector"],function(t,e,
99i){"use strict";var r=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"TerrainTileList","TerrainTileList","missingTessellator"));this.tessellator=i,this.sector=null,this.tileArray=[]};return Object.defineProperties(r.prototype,{length:{get:function(){return this.tileArray.length}}}),r.prototype.addTile=function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"TerrainTileList","addTile","missingTile"));-1==this.tileArray.indexOf(r)&&(this.tileArray.push(r),this.sector?this.sector.union(r.sector):(this.sector=new i(0,0,0,0),this.sector.copy(r.sector)))},r.prototype.removeAllTiles=function(){this.tileArray=[],this.sector=null},r}),i("globe/Tessellator",["../geom/Angle","../error/ArgumentError","../shaders/BasicProgram","../globe/Globe","../shaders/GpuProgram","../util/Level","../util/LevelSet","../geom/Location","../util/Logger","../geom/Matrix","../cache/MemoryCache","../error/NotYetImplementedError","../pick/PickedObject","../geom/Position","../geom/Rectangle","../geom/Sector","../globe/Terrain","../globe/TerrainTile","../globe/TerrainTileList","../util/Tile","../util/WWMath","../util/WWUtil"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_,b){"use strict";var S=function(){this.numRowsTilesInTopLevel=4,this.numColumnsTilesInTopLevel=8,this.maximumSubdivisionDepth=15,this.tileWidth=32,this.tileHeight=32,this.detailControl=40,this.levels=new s(g.FULL_SPHERE,new a(180/this.numRowsTilesInTopLevel,360/this.numColumnsTilesInTopLevel),this.maximumSubdivisionDepth,this.tileWidth,this.tileHeight),this.topLevelTiles={},this.currentTiles=new E(this),this.tileCache=new u(5e6,4e6),this.elevationTimestamp=void 0,this.lastModelViewProjection=h.fromIdentity(),this.vertexPointLocation=-1,this.vertexTexCoordLocation=-1,this.texCoords=null,this.texCoordVboCacheKey="global_tex_coords",this.indices=null,this.indicesVboCacheKey="global_indices",this.baseIndices=null,this.baseIndicesOffset=null,this.numBaseIndices=null,this.indicesNorth=null,this.indicesNorthOffset=null,this.numIndicesNorth=null,this.indicesSouth=null,this.indicesSouthOffset=null,this.numIndicesSouth=null,this.indicesWest=null,this.indicesWestOffset=null,this.numIndicesWest=null,this.indicesEast=null,this.indicesEastOffset=null,this.numIndicesEast=null,this.indicesLoresNorth=null,this.indicesLoresNorthOffset=null,this.numIndicesLoresNorth=null,this.indicesLoresSouth=null,this.indicesLoresSouthOffset=null,this.numIndicesLoresSouth=null,this.indicesLoresWest=null,this.indicesLoresWestOffset=null,this.numIndicesLoresWest=null,this.indicesLoresEast=null,this.indicesLoresEastOffset=null,this.numIndicesLoresEast=null,this.outlineIndicesOffset=null,this.numOutlineIndices=null,this.wireframeIndicesOffset=null,this.numWireframeIndices=null,this.scratchMatrix=h.fromIdentity(),this.scratchElevations=null,this.scratchPrevElevations=null,this.corners={},this.tiles=[]};return S.prototype.tessellate=function(t){if(!t)throw new e(l.logMessage(l.LEVEL_SEVERE,"Tessellator","tessellate","missingDC"));var i=t.globe.elevationTimestamp();if(this.lastGlobeStateKey===t.globeStateKey&&this.lastVerticalExaggeration===t.verticalExaggeration&&this.elevationTimestamp===i&&t.modelviewProjection.equals(this.lastModelViewProjection))return this.lastTerrain;this.lastModelViewProjection.copy(t.modelviewProjection),this.lastGlobeStateKey=t.globeStateKey,this.elevationTimestamp=i,this.lastVerticalExaggeration=t.verticalExaggeration,this.currentTiles.removeAllTiles(),this.topLevelTiles[t.globeStateKey]&&0!=this.topLevelTiles[t.globeStateKey].length||this.createTopLevelTiles(t),this.corners={},this.tiles=[];for(var r=0,n=this.topLevelTiles[t.globeStateKey].length;r<n;r+=1){var o=this.topLevelTiles[t.globeStateKey][r];o.update(t),this.isTileVisible(t,o)&&this.addTileOrDescendants(t,o)}return this.refineNeighbors(t),this.finishTessellating(t),this.lastTerrain=0===this.currentTiles.length?null:new m(t.globe,this,this.currentTiles,t.verticalExaggeration),this.lastTerrain},S.prototype.createTile=function(t,i,r,n){if(!t)throw new e(l.logMessage(l.LEVEL_SEVERE,"Tile","constructor","missingSector"));if(!i)throw new e(l.logMessage(l.LEVEL_SEVERE,"Tile","constructor","The specified level is null or undefined."));if(r<0||n<0)throw new e(l.logMessage(l.LEVEL_SEVERE,"Tile","constructor","The specified row or c
99olumn is less than zero."));return new y(t,i,r,n)},S.prototype.beginRendering=function(t){var e=t.currentProgram;if(!e)return void l.logMessage(l.LEVEL_INFO,"Tessellator","beginRendering","Current Program is empty");this.buildSharedGeometry(),this.cacheSharedGeometryVBOs(t);var i=t.currentGlContext,r=t.gpuResourceCache;if(this.vertexPointLocation=e.attributeLocation(i,"vertexPoint"),this.vertexTexCoordLocation=e.attributeLocation(i,"vertexTexCoord"),i.enableVertexAttribArray(this.vertexPointLocation),this.vertexTexCoordLocation>=0){var n=r.resourceForKey(this.texCoordVboCacheKey);i.bindBuffer(i.ARRAY_BUFFER,n),i.vertexAttribPointer(this.vertexTexCoordLocation,2,i.FLOAT,!1,0,0),i.enableVertexAttribArray(this.vertexTexCoordLocation)}var o=r.resourceForKey(this.indicesVboCacheKey);i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,o)},S.prototype.endRendering=function(t){var e=t.currentGlContext;e.bindBuffer(e.ARRAY_BUFFER,null),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),this.vertexPointLocation>=0&&e.disableVertexAttribArray(this.vertexPointLocation),this.vertexTexCoordLocation>=0&&e.disableVertexAttribArray(this.vertexTexCoordLocation)},S.prototype.beginRenderingTile=function(t,i){if(!i)throw new e(l.logMessage(l.LEVEL_SEVERE,"Tessellator","beginRenderingTile","missingTile"));var r=t.currentGlContext,n=t.gpuResourceCache;this.scratchMatrix.setToMultiply(t.modelviewProjection,i.transformationMatrix),t.currentProgram.loadModelviewProjection(r,this.scratchMatrix);var o=t.globeStateKey+i.tileKey,s=n.resourceForKey(o);s?i.pointsVboStateKey!=i.pointsStateKey?(r.bindBuffer(r.ARRAY_BUFFER,s),r.bufferSubData(r.ARRAY_BUFFER,0,i.points),i.pointsVboStateKey=i.pointsStateKey):t.currentGlContext.bindBuffer(r.ARRAY_BUFFER,s):(s=r.createBuffer(),r.bindBuffer(r.ARRAY_BUFFER,s),r.bufferData(r.ARRAY_BUFFER,i.points,r.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),n.putResource(o,s,4*i.points.length),i.pointsVboStateKey=i.pointsStateKey),r.vertexAttribPointer(this.vertexPointLocation,3,r.FLOAT,!1,0,0)},S.prototype.endRenderingTile=function(t,e){},S.prototype.renderTile=function(t,i){if(!i)throw new e(l.logMessage(l.LEVEL_SEVERE,"Tessellator","renderTile","missingTile"));var r=t.currentGlContext,n=r.TRIANGLE_STRIP;r.drawElements(n,this.numBaseIndices,r.UNSIGNED_SHORT,2*this.baseIndicesOffset);var o,s=i.level;o=i.neighborLevel(WorldWind.NORTH),o&&o.compare(s)<0?r.drawElements(n,this.numIndicesLoresNorth,r.UNSIGNED_SHORT,2*this.indicesLoresNorthOffset):r.drawElements(n,this.numIndicesNorth,r.UNSIGNED_SHORT,2*this.indicesNorthOffset),o=i.neighborLevel(WorldWind.SOUTH),o&&o.compare(s)<0?r.drawElements(n,this.numIndicesLoresSouth,r.UNSIGNED_SHORT,2*this.indicesLoresSouthOffset):r.drawElements(n,this.numIndicesSouth,r.UNSIGNED_SHORT,2*this.indicesSouthOffset),o=i.neighborLevel(WorldWind.WEST),o&&o.compare(s)<0?r.drawElements(n,this.numIndicesLoresWest,r.UNSIGNED_SHORT,2*this.indicesLoresWestOffset):r.drawElements(n,this.numIndicesWest,r.UNSIGNED_SHORT,2*this.indicesWestOffset),o=i.neighborLevel(WorldWind.EAST),o&&o.compare(s)<0?r.drawElements(n,this.numIndicesLoresEast,r.UNSIGNED_SHORT,2*this.indicesLoresEastOffset):r.drawElements(n,this.numIndicesEast,r.UNSIGNED_SHORT,2*this.indicesEastOffset)},S.prototype.renderWireframeTile=function(t,i){if(!i)throw new e(l.logMessage(l.LEVEL_SEVERE,"Tessellator","renderWireframeTile","missingTile"));var r=t.currentGlContext;this.vertexTexCoordLocation>=0&&r.disableVertexAttribArray(this.vertexTexCoordLocation),r.drawElements(r.LINES,this.numWireframeIndices,r.UNSIGNED_SHORT,2*this.wireframeIndicesOffset)},S.prototype.renderTileOutline=function(t,i){if(!i)throw new e(l.logMessage(l.LEVEL_SEVERE,"Tessellator","renderTileOutline","missingTile"));var r=t.currentGlContext;this.vertexTexCoordLocation>=0&&r.disableVertexAttribArray(this.vertexTexCoordLocation),r.drawElements(r.LINE_LOOP,this.numOutlineIndices,r.UNSIGNED_SHORT,2*this.outlineIndicesOffset)},S.prototype.pick=function(t,i,r){if(!t)throw new e(l.logMessage(l.LEVEL_SEVERE,"Tessellator","pick","missingDc"));if(!i)throw new e(l.logMessage(l.LEVEL_SEVERE,"Tessellator","pick","missingList"));for(var n=null,o=r||this,s=new f(0,0,0),a=[],h=0,u=i.length;h<u;h++){var c=i[h];c.extent.intersectsFrustum(t.pickFrustum)&&a.push(c)}if(t.pickTerrainOnly||(n=t.uniquePickColor(),this.drawPickTiles(t,a,n)),!t.regionPicking){var p=t.pickRay.clone(),g=this.computeNearestIntersection(p,a);g&&(t.globe.computePositionFromPoint(g[0],g[1],g[2],s),s.altitude=t.globe.elevationAtLocation(s.latitude,s.longitude),t.addPickedObject(new d(n,o,s,null,!0)))}},S.prototype.drawPickTiles=function(t,e,r){var n=t.currentGlContext;
99try{t.findAndBindProgram(i),t.currentProgram.loadColor(n,r),this.beginRendering(t);for(var o=0,s=e.length;o<s;o++){var a=e[o];this.beginRenderingTile(t,a),this.renderTile(t,a),this.endRenderingTile(t,a)}}finally{this.endRendering(t)}},S.prototype.computeNearestIntersection=function(t,e){for(var i=[],r=0,n=e.length;r<n;r++)this.computeIntersections(t,e[r],i);if(0==i.length)return null;var o,s=Number.POSITIVE_INFINITY;for(r=0,n=i.length;r<n;r++){var a=t.origin.distanceToSquared(i[r]);s>a&&(s=a,o=r)}return i[o]},S.prototype.computeIntersections=function(t,e,i){var r,n,o=e.level,s=e.points,a=i.length;t.origin.subtract(e.referencePoint),this.buildSharedGeometry(e),n=this.baseIndices,_.computeTriStripIntersections(t,s,n,i),r=e.neighborLevel(WorldWind.SOUTH),n=r&&r.compare(o)<0?this.indicesLoresSouth:this.indicesSouth,_.computeTriStripIntersections(t,s,n,i),r=e.neighborLevel(WorldWind.WEST),n=r&&r.compare(o)<0?this.indicesLoresWest:this.indicesWest,_.computeTriStripIntersections(t,s,n,i),r=e.neighborLevel(WorldWind.EAST),n=r&&r.compare(o)<0?this.indicesLoresEast:this.indicesEast,_.computeTriStripIntersections(t,s,n,i),r=e.neighborLevel(WorldWind.NORTH),n=r&&r.compare(o)<0?this.indicesLoresNorth:this.indicesNorth,_.computeTriStripIntersections(t,s,n,i),t.origin.add(e.referencePoint);for(var l=a,h=i.length;l<h;l++)i[l].add(e.referencePoint)},S.prototype.createTopLevelTiles=function(t){this.topLevelTiles[t.globeStateKey]=[],v.createTilesForLevel(this.levels.firstLevel(),this,this.topLevelTiles[t.globeStateKey])},S.prototype.addTileOrDescendants=function(t,e){if(this.tileMeetsRenderCriteria(t,e))return void this.addTile(t,e);this.addTileDescendants(t,e)},S.prototype.addTileDescendants=function(t,e){for(var i=e.level.nextLevel(),r=e.subdivideToCache(i,this,this.tileCache),n=0;n<r.length;n+=1){var o=r[n];o.update(t),this.levels.sector.intersects(o.sector)&&this.isTileVisible(t,o)&&this.addTileOrDescendants(t,o)}},S.prototype.addTile=function(t,e){var i=this.tiles.length;this.tiles.push(e);var r,n=e.sector,o=[n.maxLatitude,n.maxLongitude].toString(),s=[n.minLatitude,n.maxLongitude].toString(),a=[n.maxLatitude,n.minLongitude].toString(),l=[n.minLatitude,n.minLongitude].toString();r=this.corners[l],r?r.sw=i:this.corners[l]={sw:i},r=this.corners[a],r?r.nw=i:this.corners[a]={nw:i},r=this.corners[s],r?r.se=i:this.corners[s]={se:i},r=this.corners[o],r?r.ne=i:this.corners[o]={ne:i}},S.prototype.refineNeighbors=function(t){for(var e={},i=0,r=this.tiles.length;i<r;i+=1){var n,o,i,r,s=this.tiles[i],a=s.level.levelNumber,l=s.sector,h=[l.maxLatitude,l.maxLongitude].toString(),u=[l.minLatitude,l.maxLongitude].toString(),c=[l.maxLatitude,l.minLongitude].toString(),d=[l.minLatitude,l.minLongitude].toString();n=this.corners[h],n.hasOwnProperty("se")&&(o=n.se,this.tiles[o].level.levelNumber<a-1&&(e[o]||(e[o]=!0))),n.hasOwnProperty("nw")&&(o=n.nw,this.tiles[o].level.levelNumber<a-1&&(e[o]||(e[o]=!0))),n=this.corners[u],n.hasOwnProperty("ne")&&(o=n.ne,this.tiles[o].level.levelNumber<a-1&&(e[o]||(e[o]=!0))),n.hasOwnProperty("sw")&&(o=n.sw,this.tiles[o].level.levelNumber<a-1&&(e[o]||(e[o]=!0))),n=this.corners[c],n.hasOwnProperty("ne")&&(o=n.ne,this.tiles[o].level.levelNumber<a-1&&(e[o]||(e[o]=!0))),n.hasOwnProperty("sw")&&(o=n.sw,this.tiles[o].level.levelNumber<a-1&&(e[o]||(e[o]=!0))),n=this.corners[d],n.hasOwnProperty("se")&&(o=n.se,this.tiles[o].level.levelNumber<a-1&&(e[o]||(e[o]=!0))),n.hasOwnProperty("nw")&&(o=n.nw,this.tiles[o].level.levelNumber<a-1&&(e[o]||(e[o]=!0)))}var f=[],p=[];for(i=0,r=this.tiles.length;i<r;i+=1)s=this.tiles[i],e[i]?f.push(s):p.push(s);if(f.length>0){for(this.tiles=[],this.corners={},i=0,r=p.length;i<r;i+=1)s=p[i],this.addTile(t,s);for(i=0,r=f.length;i<r;i+=1){var s=f[i];this.addTileDescendants(t,s)}this.refineNeighbors(t)}},S.prototype.finishTessellating=function(t){for(var e=0,i=this.tiles.length;e<i;e+=1){var r=this.tiles[e];this.setNeighbors(r),this.regenerateTileGeometryIfNeeded(t,r),this.currentTiles.addTile(r)}},S.prototype.setNeighbors=function(t){var e=t.sector,i=[e.maxLatitude,e.maxLongitude].toString(),r=[e.minLatitude,e.maxLongitude].toString(),n=[e.maxLatitude,e.minLongitude].toString(),o=[e.minLatitude,e.minLongitude].toString(),s=this.corners[i],a=this.corners[r],l=this.corners[n],h=this.corners[o],u=-1,c=-1,d=-1,f=-1;s.hasOwnProperty("se")?u=s.se:l.hasOwnProperty("sw")&&(u=l.sw),a.hasOwnProperty("ne")?c=a.ne:h.hasOwnProperty("nw")&&(c=h.nw),s.hasOwnProperty("nw")?d=s.nw:a.hasOwnProperty("sw")&&(d=a.sw),l.hasOwnProperty("ne")?f=l.ne:h.hasOwnProperty("se")&&(f=h.se),t.setNeighborLevel(WorldWind.NORTH,u>=0?this.tiles[u].level:null),t.setNeighborLevel(WorldWind.SOUTH,c>=0?this.tiles[c].level:null),t.setNeighborLevel(WorldWind.EAST,d>=0?this.tiles[d].level:null),t.setNeighborLevel(WorldWind.WEST,f>=0?this.tiles[f].level:null)},S.prototype.isTileVisible=function(t,e){return!(t.globe.projectionLimits&&!e.sector.overlaps(t.globe.projectionLimits))&&e.extent.intersectsFrustum(t.frustumInModelCoordinates)},S.prototype.tileMeetsRenderCriteria=function(t,e){var i=this.detailControl;return(e.sector.minLatitude>=75||e.sector.maxLatitude<=-75)&&(i*=2),e.level.isLastLevel()||!e.mustSubdivide(t,i)},S.prototype.regenerateTileGeometryIfNeeded=function(t,e){var i=t.globeStateKey+e.stateKey+t.verticalExaggeration;e.points&&e.pointsStateKey==i||(this.regenerateTileGeometry(t,e),e.pointsStateKey=i)},S.prototype.coverageTargetResolution=function(e){return e/8*t.RADIANS_TO_DEGREES},S.prototype.regenerateTileGeometry=function(t,e){var i=e.tileHeight+1,r=e.tileWidth+1,n=e.referencePoint,o=this.scratchElevations;o||(o=new Float64Array(i*r),this.scratchElevations=o),e.points||(e.points=new Float32Array(i*r*3)),b.fillArray(o,0),t.globe.elevationsForGrid(e.sector,i,r,this.coverageTargetResolution(e.texelSize),o),this.mustAlignNeighborElevations(t,e)&&this.alignNeighborElevations(t,e,o),b.multiplyArray(o,t.verticalExaggeration),t.globe.computePointsForGrid(e.sector,i,r,o,n,e.points),e.transformationMatrix.setTranslation(n[0],n[1],n[2])},S.prototype.mustAlignNeighborElevations=function(t,e){var i=e.level,r=e.neighborLevel(WorldWind.NORTH),n=e.neighborLevel(WorldWind.SOUTH),o=e.neighborLevel(WorldWind.EAST),s=e.neighborLevel(WorldWind.WEST);return r&&r.compare(i)<0||n&&n.compare(i)<0||o&&o.compare(i)<0||s&&s.compare(i)<0}
99,S.prototype.alignNeighborElevations=function(t,e,i){var r,n,o,s,a=e.tileHeight+1,l=e.tileWidth+1,h=e.level,u=Math.floor(a/2)+1,c=Math.floor(l/2)+1,d=h.previousLevel(),f=this.scratchPrevElevations;if(f||(f=new Float64Array(u*c),this.scratchPrevElevations=f),b.fillArray(f,0),t.globe.elevationsForGrid(e.sector,u,c,this.coverageTargetResolution(d.texelSize),f),(r=e.neighborLevel(WorldWind.NORTH))&&r.compare(h)<0)for(o=(a-1)*l,s=(u-1)*c,n=0;n<c;n++,o+=2,s+=1)i[o]=f[s],n<c-1&&(i[o+1]=.5*(f[s]+f[s+1]));if((r=e.neighborLevel(WorldWind.SOUTH))&&r.compare(h)<0)for(o=0,s=0,n=0;n<c;n++,o+=2,s+=1)i[o]=f[s],n<c-1&&(i[o+1]=.5*(f[s]+f[s+1]));if((r=e.neighborLevel(WorldWind.EAST))&&r.compare(h)<0)for(o=l-1,s=c-1,n=0;n<u;n++,o+=2*l,s+=c)i[o]=f[s],n<u-1&&(i[o+l]=.5*(f[s]+f[s+c]));if((r=e.neighborLevel(WorldWind.WEST))&&r.compare(h)<0)for(o=0,s=0,n=0;n<u;n++,o+=2*l,s+=c)i[o]=f[s],n<u-1&&(i[o+l]=.5*(f[s]+f[s+c]))},S.prototype.buildSharedGeometry=function(){var t=this.levels.tileWidth,e=this.levels.tileHeight;this.texCoords||this.buildTexCoords(t,e),this.indices||this.buildIndices(t,e)},S.prototype.buildTexCoords=function(t,e){for(var i=t+1,r=e+1,n=1/t,o=1/e,s=new Float32Array(i*r*2),a=0,l=0,h=0;l<r;l++,h+=o){l==r-1&&(h=1);for(var u=0,c=0;u<i;u++,c+=n)u==i-1&&(c=1),s[a++]=c,s[a++]=h}this.texCoords=s},S.prototype.buildIndices=function(t,e){for(var i,r=e+1,n=t+1,o=2*(r-3)*(n-2)+2*(r-3),s=[],a=0,l=1;l<n-2;l+=1){for(var h=1;h<r-1;h+=1)i=l+h*n,s[a++]=i,s[a++]=i+1;s[a++]=i+1,i=l+1+1*n,s[a++]=i}for(this.baseIndicesOffset=s.length-o,this.baseIndices=new Uint16Array(s.slice(this.baseIndicesOffset)),this.numBaseIndices=o,o=2*n-2,h=r-1,l=n-1,i=l+h*n,s[a++]=i,l=n-2;l>0;l-=1)i=l+h*n,s[a++]=i,s[a++]=i-n;for(l=0,i=l+h*n,s[a++]=i,this.indicesNorthOffset=s.length-o,this.indicesNorth=new Uint16Array(s.slice(this.indicesNorthOffset)),this.numIndicesNorth=o,o=2*n-2,h=0,l=0,i=l+h*n,s[a++]=i,l=1;l<n-1;l+=1)i=l+h*n,s[a++]=i,s[a++]=i+n;for(l=n-1,i=l+h*n,s[a++]=i,this.indicesSouthOffset=s.length-o,this.indicesSouth=new Uint16Array(s.slice(this.indicesSouthOffset)),this.numIndicesSouth=o,o=2*r-2,l=0,h=r-1,i=l+h*n,s[a++]=i,h=r-2;h>0;h-=1)i=l+h*n,s[a++]=i,s[a++]=i+1;for(h=0,i=l+h*n,s[a++]=i,this.indicesWestOffset=s.length-o,this.indicesWest=new Uint16Array(s.slice(this.indicesWestOffset)),this.numIndicesWest=o,o=2*r-2,l=n-1,h=0,i=l+h*n,s[a++]=i,h=1;h<r-1;h+=1)i=l+h*n,s[a++]=i,s[a++]=i-1;for(h=r-1,i=l+h*n,s[a++]=i,this.indicesEastOffset=s.length-o,this.indicesEast=new Uint16Array(s.slice(this.indicesEastOffset)),this.numIndicesEast=o,o=2*n-2,h=r-1,l=n-1,i=l+h*n,s[a++]=i,l=n-2;l>0;l-=1)i=(l+1&-2)+h*n,s[a++]=i,i=l+(h-1)*n,s[a++]=i;for(l=0,i=l+h*n,s[a++]=i,this.indicesLoresNorthOffset=s.length-o,this.indicesLoresNorth=new Uint16Array(s.slice(this.indicesLoresNorthOffset)),this.numIndicesLoresNorth=o,o=2*n-2,h=0,l=0,i=l+h*n,s[a++]=i,l=1;l<n-1;l+=1)i=(-2&l)+h*n,s[a++]=i,i=l+(h+1)*n,s[a++]=i;for(l=n-1,i=l+h*n,s[a++]=i,this.indicesLoresSouthOffset=s.length-o,this.indicesLoresSouth=new Uint16Array(s.slice(this.indicesLoresSouthOffset)),this.numIndicesLoresSouth=o,o=2*r-2,l=0,h=r-1,i=l+h*n,s[a++]=i,h=r-2;h>0;h-=1)i=l+(h+1&-2)*n,s[a++]=i,i=l+1+h*n,s[a++]=i;for(h=0,i=l+h*n,s[a++]=i,this.indicesLoresWestOffset=s.length-o,this.indicesLoresWest=new Uint16Array(s.slice(this.indicesLoresWestOffset)),this.numIndicesLoresWest=o,o=2*r-2,l=n-1,h=0,i=l+h*n,s[a++]=i,h=1;h<r-1;h+=1)i=l+(-2&h)*n,s[a++]=i,i=l-1+h*n,s[a++]=i;h=r-1,i=l+h*n,s[a++]=i,this.indicesLoresEastOffset=s.length-o,this.indicesLoresEast=new Uint16Array(s.slice(this.indicesLoresEastOffset)),this.numIndicesLoresEast=o;var u=this.buildWireframeIndices(t,e),c=this.buildOutlineIndices(t,e);s=s.concat(u),this.wireframeIndicesOffset=s.length-this.numWireframeIndices,s=s.concat(c),this.outlineIndicesOffset=s.length-this.numOutlineIndices,this.indices=new Uint16Array(s)},S.prototype.buildWireframeIndices=function(t,e){var i,r,n,o=e+1,s=t+1,a=2*t*o+2*e*s,l=[],h=s,u=0;for(r=0;r<o;r+=1)for(i=0;i<t;i+=1)n=i+r*h,l[u]=n,l[u+1]=n+1,u+=2;for(i=0;i<s;i+=1)for(r=0;r<e;r+=1)n=i+r*h,l[u]=n,l[u+1]=n+h,u+=2;return this.numWireframeIndices=a,l},S.prototype.buildOutlineIndices=function(t,e){var i,r,n,o=e+1,s=t+1,a=2*(o-2)+2*s+1,l=[],h=0;for(r=0,i=0;i<s;i+=1)n=i+r*s,l[h]=n,h+=1;for(i=s-1,r=1;r<o;r+=1)n=i+r*s,l[h]=n,h+=1;for(r=o-1,i=s-1;i>=0;i-=1)n=i+r*s,l[h]=n,h+=1;for(i=0,r=o-1;r>=0;r-=1)n=i+r*s,l[h]=n,h+=1;return this.numOutlineIndices=a,l},S.prototype.cacheSharedGeometryVBOs=function(t){var e=t.currentGlContext,i=t.gpuResourceCache,r=i.resourceForKey(this.texCoordVboCacheKey);r||(r=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,this.texCoords,e.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),i.putResource(this.texCoordVboCacheKey,r,4*this.texCoords.length/2));var n=i.resourceForKey(this.indicesVboCacheKey);n||(n=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n),e.bufferData(e.ELEMENT_ARRAY_BUFFER,this.indices,e.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),i.putResource(this.indicesVboCacheKey,n,2*this.indices.length))},S}), 100i("globe/Globe",["../geom/Angle","../error/ArgumentError","../geom/BoundingBox","../globe/ElevationModel","../geom/Line","../geom/Location","../util/Logger","../geom/Position","../projections/ProjectionWgs84","../geom/Sector","../globe/Tessellator","../geom/Vec3","../util/WWMath"],function(t,e,
100i,r,n,o,s,a,l,h,u,c,d){"use strict";var f=function(t,i){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","constructor","Elevation model is null or undefined."));this.elevationModel=t,this.equatorialRadius=WorldWind.WGS84_SEMI_MAJOR_AXIS;var r=1/WorldWind.WGS84_INVERSE_FLATTENING;this.polarRadius=this.equatorialRadius*(1-r),this.eccentricitySquared=2*r-r*r,this.tessellator=new u,this._projection=i||new l,this._offset=0,this.offsetVector=new c(0,0,0),this.id=++f.idPool,this._stateKey="globe "+this.id.toString()+" "};return f.idPool=0,Object.defineProperties(f.prototype,{stateKey:{get:function(){return this._stateKey+this.elevationModel.stateKey+"offset "+this.offset.toString()+" "+this.projection.stateKey}},continuous:{get:function(){return this.projection.continuous}},projection:{get:function(){return this._projection},set:function(t){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","projection","missingProjection"));this.projection!=t&&(this.tessellator=new u),this._projection=t}},projectionLimits:{get:function(){return this._projection.projectionLimits}},offset:{get:function(){return this._offset},set:function(t){this._offset=t,this.offsetVector[0]=2*t*Math.PI*this.equatorialRadius}}}),f.prototype.is2D=function(){return this.projection.is2D},f.prototype.computePointFromPosition=function(t,i,r,n){if(!n)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","computePointFromPosition","missingResult"));return this.projection.geographicToCartesian(this,t,i,r,this.offsetVector,n)},f.prototype.computePointFromLocation=function(t,i,r){if(!r)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","computePointFromLocation","missingResult"));return this.computePointFromPosition(t,i,0,r)},f.prototype.computePointsForGrid=function(t,i,r,n,o,a){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","computePointsFromPositions","missingSector"));if(i<1||r<1)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","computePointsFromPositions","Number of latitude or longitude locations is less than one."));var l=i*r;if(!n||n.length<l)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","computePointsFromPositions","Elevations array is null, undefined or insufficient length."));if(!a||a.length<l)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","computePointsFromPositions","Result array is null, undefined or insufficient length."));return this.projection.geographicToCartesianGrid(this,t,i,r,n,o,this.offsetVector,a)},f.prototype.computePositionFromPoint=function(t,i,r,n){if(!n)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","computePositionFromPoint","missingResult"));return this.projection.cartesianToGeographic(this,t,i,r,this.offsetVector,n),this.continuous&&(n.longitude<-180?n.longitude+=360:n.longitude>180&&(n.longitude-=360)),n},f.prototype.radiusAt=function(e,i){var r=Math.sin(e*t.DEGREES_TO_RADIANS);return this.equatorialRadius/Math.sqrt(1-this.eccentricitySquared*r*r)*Math.sqrt(1+(this.eccentricitySquared*this.eccentricitySquared-2*this.eccentricitySquared)*r*r)},f.prototype.surfaceNormalAtLocation=function(i,r,n){if(!n)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","surfaceNormalAtLocation","missingResult"));if(this.projection.surfaceNormalAtLocation)return this.projection.surfaceNormalAtLocation(this,i,r,n);if(this.is2D())return n[0]=0,n[1]=0,n[2]=1,n;var o=Math.cos(i*t.DEGREES_TO_RADIANS),a=Math.cos(r*t.DEGREES_TO_RADIANS),l=Math.sin(i*t.DEGREES_TO_RADIANS),h=Math.sin(r*t.DEGREES_TO_RADIANS);return n[0]=o*h,n[1]=l,n[2]=o*a,n.normalize()},f.prototype.surfaceNormalAtPoint=function(t,i,r,n){if(!n)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","surfaceNormalAtPoint","missingResult"));if(this.projection.surfaceNormalAtPoint)return this.projection.surfaceNormalAtPoint(this,t,i,r,n);if(this.is2D())return n[0]=0,n[1]=0,n[2]=1,n;var o=this.equatorialRadius*this.equatorialRadius,a=this.polarRadius*this.polarRadius;return n[0]=t/o,n[1]=i/a,n[2]=r/o,n.normalize()},f.prototype.northTangentAtLocation=function(t,i,r){if(!r)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","northTangentAtLocation","missingResult"));return this.projection.northTangentAtLocation(this,t,i,r)},f.prototype.northTangentAtPoint=function(t,i,r,n){if(!n)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","northTangentAtPoint","missingResult"));return this.projection.northTangentAtPoint(this,t,i,r,this.offsetVector,n)},f.prototype.intersectsFrustum=function(t){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","intersectsFrustum","missingFrustum"));if(this.is2D()){var r=new i;return r.setToSector(h.FULL_SPHERE,this,this.elevationModel.minElevation,this.elevationModel.maxElevation),r.intersectsFrustum(t)}return!(t.far.distance<=this.equatorialRadius)&&(!(t.left.distance<=this.equatorialRadius)&&(!(t.right.distance<=this.equatorialRadius)&&(!(t.top.distance<=this.equatorialRadius)&&(!(t.bottom.distance<=this.equatorialRadius)&&!(t.near.distance<=this.equatorialRadius)))))},f.prototype.intersectsLine=function(t,i){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","intersectWithRay","missingLine"));if(!i)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","intersectsLine","missingResult"));var r,n=t.direction[0],o=t.direction[1],a=t.direction[2],l=t.origin[0],h=t.origin[1],u=t.origin[2];if(this.is2D())return(0!=a||0==u)&&(!((r=-u/a)<0)&&(i[0]=l+n*r,i[1]=h+o*r,i[2]=u+a*r,!0));var c,d,f,p,g=this.equatorialRadius,m=g*g,y=g/this.polarRadius,E=y*y;return c=n*n+E*o*o+a*a,d=2*(l*n+E*h*o+u*a),f=l*l+E*h*h+u*u-m,!((p=d*d-4*c*f)<0)&&((r=(-d-Math.sqrt(p))/(2*c))>0?(i[0]=l+n*r,i[1]=h+o*r,i[2]=u+a*r,!0):(r=(-d+Math.sqrt(p))/(2*c))>0&&(i[0]=l+n*r,i[1]=h+o*r,i[2]=u+a*r,!0))},f.prototype.elevationTimestamp=function(){return this.elevationModel.timestamp},f.prototype.minElevation=function(){return this.elevationModel.minElevation},f.prototype.maxElevation=function(){return this.elevationModel.maxElevation},f.prototype.minAndMaxElevationsForSector=function(t){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","minAndMaxElevationsForSector","missingSector"));return this.elevationModel.minAndMaxElevationsForSector(t)},f.prototype.elevationAtLocation=function(t,e){return this.elevationModel.elevationAtLocation(t,e)},f.prototype.elevationsForGrid=function(t,i,r,n,o){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","elevationsForSector","missingSector"));if(i<=0||r<=0)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","elevationsForSector","numLat or numLon is less than 1"));if(!o||o.length<i*r)throw new e(s.logMessage(s.LEVEL_SEVERE,"Globe","elevationsForSector","missingArray"));return this.elevationModel.elevationsForGrid(t,i,r,n,o)},f}),i("cache/GpuResourceCache",["../util/AbsentResourceList","../error/ArgumentError","../util/ImageSource","../util/Logger","../cache/MemoryCache","../render/Texture"],function(t,e,
100i,r,n,o){"use strict";var s=function(i,o){if(!i||i<1)throw new e(r.logMessage(r.LEVEL_SEVERE,"GpuResourceCache","constructor","Specified cache capacity is undefined, 0 or negative."));if(!o||o<0||o>=i)throw new e(r.logMessage(r.LEVEL_SEVERE,"GpuResourceCache","constructor","Specified cache low-water value is undefined, negative or not less than the capacity."));this.entries=new n(i,o),this.cacheKeyPool=0,this.currentRetrievals={},this.absentResourceList=new t(3,6e4)};return Object.defineProperties(s.prototype,{capacity:{get:function(){return this.entries.capacity}},lowWater:{get:function(){return this.entries.lowWater}},usedCapacity:{get:function(){return this.entries.usedCapacity}},freeCapacity:{get:function(){return this.entries.freeCapacity}}}),s.prototype.generateCacheKey=function(){return"GpuResourceCache "+ ++this.cacheKeyPool},s.prototype.putResource=function(t,n,o){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"GpuResourceCache","putResource","missingKey."));if(!n)throw new e(r.logMessage(r.LEVEL_SEVERE,"GpuResourceCache","putResource","missingResource."));if(!o||o<1)throw new e(r.logMessage(r.LEVEL_SEVERE,"GpuResourceCache","putResource","The specified resource size is undefined or less than 1."));var s={resource:n};this.entries.putEntry(t instanceof i?t.key:t,s,o)},s.prototype.resourceForKey=function(t){var e=t instanceof i?this.entries.entryForKey(t.key):this.entries.entryForKey(t),r=e?e.resource:null;return null!==r&&"function"==typeof r.clearTexParameters&&r.clearTexParameters(),r},s.prototype.setResourceAgingFactor=function(t,e){this.entries.setEntryAgingFactor(t,e)},s.prototype.containsResource=function(t){return this.entries.containsKey(t instanceof i?t.key:t)},s.prototype.removeResource=function(t){this.entries.removeEntry(t instanceof i?t.key:t)},s.prototype.clear=function(){this.entries.clear(!1)},s.prototype.retrieveTexture=function(t,e,n){if(!e)return null;if(e instanceof i){var s=new o(t,e.image,n);return this.putResource(e.key,s,s.size),s}if(this.currentRetrievals[e]||this.absentResourceList.isResourceAbsent(e))return null;var a=this,l=new Image;return l.onload=function(){r.log(r.LEVEL_INFO,"Image retrieval succeeded: "+e);var i=new o(t,l,n);a.putResource(e,i,i.size),delete a.currentRetrievals[e],a.absentResourceList.unmarkResourceAbsent(e);var s=document.createEvent("Event");s.initEvent(WorldWind.REDRAW_EVENT_TYPE,!0,!0),window.dispatchEvent(s)},l.onerror=function(){delete a.currentRetrievals[e],a.absentResourceList.markResourceAbsent(e),r.log(r.LEVEL_WARNING,"Image retrieval failed: "+e)},this.currentRetrievals[e]=e,l.crossOrigin="anonymous",l.src=e,null},s}),i("pick/PickedObjectList",[],function(){"use strict";var t=function(){this.objects=[]};return t.prototype.hasNonTerrainObjects=function(){return this.objects.length>1||1===this.objects.length&&null==this.terrainObject()},t.prototype.terrainObject=function(){for(var t=0,e=this.objects.length;t<e;t++)if(this.objects[t].isTerrain)return this.objects[t];return null},t.prototype.add=function(t){if(t)if(t.isTerrain){for(var e=this.objects.length,i=0,r=this.objects.length;i<r;i++)if(this.objects[i].isTerrain){e=i;break}this.objects[e]=t}else this.objects.push(t)},t.prototype.clear=function(){this.objects=[]},t.prototype.topPickedObject=function(){var t=this.objects.length;if(t>1)for(var e=0;e<t;e++)if(this.objects[e].isOnTop)return this.objects[e];return t>0?this.objects[0]:null},t}),i("render/ScreenCreditController",["../error/ArgumentError","../util/Color","../util/Font","../layer/Layer","../util/Logger","../util/Offset","../shapes/ScreenText"],function(t,e,i,r,n,o,s){"use strict";var a=function(){r.call(this,"ScreenCreditController"),this.creditPlacement=new o(WorldWind.OFFSET_PIXELS,11,WorldWind.OFFSET_PIXELS,2),this.creditMargin=11,this.opacity=.5,this.credits=[]};return a.prototype=Object.create(r.prototype),a.prototype.clear=function(){this.credits=[]},a.prototype.addCredit=function(e,r,a){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"ScreenCreditController","addCredit","missingText"));if(!r)throw new t(n.logMessage(n.LEVEL_SEVERE,"ScreenCreditController","addCredit","missingColor"));for(var l=0,h=this.credits.length;l<h;l++)if(this.credits[l].text===e)return;var u=new s(new o(WorldWind.OFFSET_PIXELS,0,WorldWind.OFFSET_PIXELS,0),e);u.attributes.font=new i(10),u.attributes.color=r,u.attributes.enableOutline=!1,u.attributes.offset=new o(WorldWind.OFFSET_FRACTION,0,WorldWind.OFFSET_FRACTION,0),a&&(u.userProperties.url=a),this.credits.push(u)},a.prototype.doRender=function(t){for(var e=this.creditPlacement.offsetForSize(t.viewport.width,t.viewport.height),i=0,r=this.credits.length;i<r;i++)this.credits[i].screenOffset.x=e[0],this.credits[i].screenOffset.y=e[1],this.credits[i].render(t),t.textRenderer.typeFace=this.credits[i].attributes.font,t.textRenderer.outlineWidth=this.credits[i].attributes.outlineWidth,t.textRenderer.enableOutline=this.credits[i].attributes.enableOutline,e[0]+=t.textRenderer.textSize(this.credits[i].text)[0],e[0]+=this.creditMargin},a}),i("util/HashMap",[],function(){"use strict";var t=function(){this._entries=Object.create(null)};return t.prototype.get=function(t){return this._entries[t]},t.prototype.set=function(t,e){this._entries[t]=e},t.prototype.remove=function(t){delete this._entries[t]},t.prototype.contains=function(t){return t in this._entries},t.reIndex=function(e,i,r){var n=new t;for(var o in e._entries){var s=parseInt(o);s>=i&&(s+=r);var a=e.get(o);a.index=s,n.set(s,a)}return n},t}),i("util/PolygonSplitter",["./HashMap","../geom/Location","../geom/Position","./WWMath"],function(t,e,
100i,r){"use strict";return{addedIndex:-1,poleIndexOffset:-1,splitContours:function(t,e){for(var i=!1,r=0,n=t.length;r<n;r++){var o=this.splitContour(t[r]);o.polygons.length>1&&(i=!0),e.push(o)}return i},splitContour:function(i){var r=new t,n=[],o=[],s=[],a=[],l=-1,h=this.findIntersectionAndPole(i,n,o,r);return 0===o.length?(s.push(n),a.push(r),this.formatContourOutput(s,h,l,a)):(o.length>2&&o.sort(function(t,e){return e.latitude-t.latitude}),h!==e.poles.NONE&&(n=this.handleOnePole(n,o,r,h),r=this.reindexIntersections(o,r,this.poleIndexOffset)),0===o.length?(s.push(n),a.push(r),l=0,this.formatContourOutput(s,h,l,a)):(this.linkIntersections(o,r),l=this.makePolygons(n,o,r,s,a),this.formatContourOutput(s,h,l,a)))},findIntersectionAndPole:function(t,i,n,o){var s=!1,a=90,l=-90;this.addedIndex=-1;for(var h=0,u=t.length;h<u;h++){var c=t[h],d=t[(h+1)%u];a=Math.min(a,c.latitude),l=Math.max(l,c.latitude);if(e.locationsCrossDateLine([c,d])){s=!s;var f=e.meridianIntersection(c,d,180);null===f&&(f=(c.latitude+d.latitude)/2);var p=180*r.signum(c.longitude)||180,g=this.createPoint(f,p,c.altitude),m=this.createPoint(f,-p,d.altitude);this.safeAdd(i,c,h,u);var y=i.length;o.set(y,this.makeIntersectionEntry(y)),o.set(y+1,this.makeIntersectionEntry(y+1)),n.push({indexEnd:y,indexStart:y+1,latitude:f}),i.push(g),i.push(m),this.safeAdd(i,d,h+1,u)}else this.safeAdd(i,c,h,u),this.safeAdd(i,d,h+1,u)}var E=e.poles.NONE;return s&&(E=this.determinePole(a,l)),E},determinePole:function(t,i){return t>0?e.poles.NORTH:i<0?e.poles.SOUTH:Math.abs(i)>=Math.abs(t)?e.poles.NORTH:e.poles.SOUTH},handleOnePole:function(t,i,r,n){var o;if(n===e.poles.NORTH)var s=i.shift(),a=90;else n===e.poles.SOUTH&&(s=i.pop(),a=-90);var l=r.get(s.indexEnd),h=r.get(s.indexStart);l.forPole=!0,h.forPole=!0,this.poleIndexOffset=s.indexStart,o=t.slice(0,s.indexEnd+1);var u=this.createPoint(a,t[l.index].longitude,t[l.index].altitude),c=this.createPoint(a,t[h.index].longitude,t[h.index].altitude);return o.push(u,c),o=o.concat(t.slice(this.poleIndexOffset))},linkIntersections:function(t,e){for(var i=0;i<t.length-1;i+=2){var r=t[i],n=t[i+1],o=e.get(r.indexEnd),s=e.get(r.indexStart),a=e.get(n.indexEnd),l=e.get(n.indexStart);o.linkTo=n.indexStart,s.linkTo=n.indexEnd,a.linkTo=r.indexStart,l.linkTo=r.indexEnd}},reindexIntersections:function(e,i,r){i=t.reIndex(i,r,2);for(var n=0,o=e.length;n<o;n++)e[n].indexEnd>=r&&(e[n].indexEnd+=2),e[n].indexStart>=r&&(e[n].indexStart+=2);return i},makePolygons:function(e,i,r,n,o){for(var s=-1,a=0;a<i.length-1;a+=2){var l=i[a],h=i[a+1],u=l.indexStart,c=h.indexEnd,d=[],f=new t,p=this.makePolygon(u,c,e,r,d,f);d.length&&(n.push(d),o.push(f),p&&(s=n.length-1)),u=h.indexStart,c=l.indexEnd,d=[],f=new t,p=this.makePolygon(u,c,e,r,d,f),d.length&&(n.push(d),o.push(f),p&&(s=n.length-1))}return s},makePolygon:function(t,e,i,r,n,o){var s=!1,a=i.length,l=!1;e<t&&(e+=a);for(var h=t;h<=e;h++){var u=h%a,c=i[u],d=r.get(u);if(d){if(d.visited)break;if(n.push(c),o.set(n.length-1,d),d.forPole)l=!0;else{if(s&&(h=d.linkTo-1)+1===t)break;s=!s,d.visited=!0}}else n.push(c)}return l},safeAdd:function(t,e,i,r){this.addedIndex<i&&this.addedIndex<r-1&&(t.push(e),this.addedIndex=i)},createPoint:function(t,r,n){return null==n?new e(t,r):new i(t,r,n)},formatContourOutput:function(t,e,i,r){return{polygons:t,pole:e,poleIndex:i,iMap:r}},makeIntersectionEntry:function(t){return null==t&&(t=-1),{visited:!1,forPole:!1,index:t,linkTo:-1}}}}),i("shapes/ShapeAttributes",["../util/Color","../util/ImageSource"],function(t,e){"use strict";var i=function(e){this._drawInterior=!e||e._drawInterior,this._drawOutline=!e||e._drawOutline,this._enableLighting=!!e&&e._enableLighting,this._interiorColor=e?e._interior
100Color.clone():t.WHITE.clone(),this._outlineColor=e?e._outlineColor.clone():t.RED.clone(),this._outlineWidth=e?e._outlineWidth:1,this._outlineStippleFactor=e?e._outlineStippleFactor:0,this._outlineStipplePattern=e?e._outlineStipplePattern:61680,this._imageSource=e?e._imageSource:null,this._depthTest=!e||e._depthTest,this._drawVerticals=!!e&&e._drawVerticals,this._applyLighting=!!e&&e._applyLighting,this.stateKeyInvalid=!0};return i.prototype.computeStateKey=function(){return"di "+this._drawInterior+" do "+this._drawOutline+" el "+this._enableLighting+" ic "+this._interiorColor.toHexString(!0)+" oc "+this._outlineColor.toHexString(!0)+" ow "+this._outlineWidth+" osf "+this._outlineStippleFactor+" osp "+this._outlineStipplePattern+" is "+(this._imageSource?this.imageSource instanceof e?this.imageSource.key:this.imageSource:"null")+" dt "+this._depthTest+" dv "+this._drawVerticals+" li "+this._applyLighting},Object.defineProperties(i.prototype,{stateKey:{get:function(){return this.stateKeyInvalid&&(this._stateKey=this.computeStateKey(),this.stateKeyInvalid=!1),this._stateKey}},drawInterior:{get:function(){return this._drawInterior},set:function(t){this._drawInterior=t,this.stateKeyInvalid=!0}},drawOutline:{get:function(){return this._drawOutline},set:function(t){this._drawOutline=t,this.stateKeyInvalid=!0}},enableLighting:{get:function(){return this._enableLighting},set:function(t){this._enableLighting=t,this.stateKeyInvalid=!0}},interiorColor:{get:function(){return this._interiorColor},set:function(t){this._interiorColor=t,this.stateKeyInvalid=!0}},outlineColor:{get:function(){return this._outlineColor},set:function(t){this._outlineColor=t,this.stateKeyInvalid=!0}},outlineWidth:{get:function(){return this._outlineWidth},set:function(t){this._outlineWidth=t,this.stateKeyInvalid=!0}},outlineStipplePattern:{get:function(){return this._outlineStipplePattern},set:function(t){this._outlineStipplePattern=t,this.stateKeyInvalid=!0}},outlineStippleFactor:{get:function(){return this._outlineStippleFactor},set:function(t){this._outlineStippleFactor=t,this.stateKeyInvalid=!0}},imageSource:{get:function(){return this._imageSource},set:function(t){this._imageSource=t,this.stateKeyInvalid=!0}},depthTest:{get:function(){return this._depthTest},set:function(t){this._depthTest=t,this.stateKeyInvalid=!0}},drawVerticals:{get:function(){return this._drawVerticals},set:function(t){this._drawVerticals=t,this.stateKeyInvalid=!0}},applyLighting:{get:function(){return this._applyLighting},set:function(t){this._applyLighting=t,this.stateKeyInvalid=!0}}}),i}),i("shapes/SurfaceShape",["../error/AbstractError","../geom/Angle","../error/ArgumentError","../geom/BoundingBox","../util/Color","../geom/Location","../util/Logger","../cache/MemoryCache","../error/NotYetImplementedError","../pick/PickedObject","../util/PolygonSplitter","../render/Renderable","../geom/Sector","../shapes/ShapeAttributes","../error/UnsupportedOperationError","../geom/Vec3","../util/WWMath"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g,m){"use strict";var y=function(t){c.call(this),this._displayName="Surface Shape",this._attributes=t||new f(null),this._highlightAttributes=null,this._highlighted=!1,this._enabled=!0,this._pathType=WorldWind.GREAT_CIRCLE,this._maximumNumEdgeIntervals=y.DEFAULT_NUM_EDGE_INTERVALS,this._polarThrottle=y.DEFAULT_POLAR_THROTTLE,this._sector=null,this.pickDelegate=null,this._sectors=[],this._locations=null,this._boundaries=null,this._interiorGeometry=null,this._outlineGeometry=null,this._isInteriorInhibited=!1,this.stateKeyInvalid=!0,this._attributesStateKey=null,this.boundariesArePrepared=!1,this.layer=null,this.pickColor=null,this.contours=[],this.containsPole=!1,this.crossesAntiMeridian=!1,this.expirationInterval=2e3,this.shapeDataCache=new a(3,2),this.currentData=null};return y.prototype=Object.create(c.prototype),Object.defineProperties(y.prototype,{stateKey:{get:function(){if(this._attributesStateKey){var t=null;this._highlighted?this._highlightAttributes&&(t=this._highlightAttributes.stateKey):this._attributes&&(t=this._attributes.stateKey),t!=this._attributesStateKey&&(this._attributesStateKey=t,this.stateKeyInvalid=!0)}else this._highlighted?this._highlightAttributes&&(this._attributesStateKey=this._highlightAttributes.stateKey):this._attributes&&(this._attributesStateKey=this._attributes.stateKey),this._attributesStateKey&&(this.stateKeyInvalid=!0);return this.stateKeyInvalid&&(this._stateKey=this.computeStateKey()),this._stateKey}},displayName:{get:function(){return this._displayName},set:function(t){this.stateKeyInvalid=!0,this._displayName=t}},attributes:{get:function(){return this._attributes},set:function(t){this.stateKeyInvalid=!0,this._attributes=t,this._attributesStateKey=t.stateKey}},highlightAttributes:{get:function(){return this._highlightAttributes},set:function(t){this.stateKeyInvalid=!0,this._highlightAttributes=t}},highlighted:{get:function(){return this._highlighted},set:function(t){this.stateKeyInvalid=!0,this._highlighted=t}},enabled:{get:function(){return this._enabled},set:function(t){this.stateKeyInvalid=!0,this._enabled=t}},pathType:{get:function(){return this._pathType},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._pathType=t}},maximumNumEdgeIntervals:{get:function(){return this._maximumNumEdgeIntervals},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._maximumNumEdgeIntervals=t}},polarThrottle:{get:function(){return this._polarThrottle},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._polarThrottle=t}},sector:{get:function(){return this._sector}}}),y.staticStateKey=function(t){return t.stateKeyInvalid=!1,t.highlighted&&t._highlightAttributes?t._attributesStateKey=t._highlightAttributes.stateKey:t._attributes?t._attributesStateKey=t._attributes.stateKey:t._attributesStateKey=null,"dn "+t.displayName+" at "+(t._attributesStateKey?t._attributesStateKey:"null")+" hi "+t.highlighted+" en "+t.enabled+" pt "+t.pathType+" ne "+t.maximumNumEdgeIntervals+" po "+t.polarThrottle+" se ["+t.sector.minLatitude+","+t.sector.maxLatitude+","+t.sector.minLongitude+","+t.sector.maxLongitude+"]"},y.prototype.computeStateKey=function(){return y.staticStateKey(this)},y.prototype.area=function(t,e){throw new l(s.logMessage(s.LEVEL_SEVERE,"SurfaceShape","area","notYetImplemented"))},y.prototype.computeBoundaries=function(e){throw new t(s.logMessage(s.LEVEL_SEVERE,"SurfaceShape","computeBoundaries","abstractInvocation"))},y.prototype.intersectsFrustum=function(t){return!this.currentData||!this.currentData.extent||(t.pickingMode?this.currentData.extent.intersectsFrustum(t.pickFrustum):this.currentData.extent.intersectsFrustum(t.frustumInModelCoordinates))},y.prototype.isShapeDataCurrent=function(t,e){return e.verticalExaggeration===t.verticalExaggeration&&e.expiryTime>Date.now()},y.prototype.createShapeDataObject=function(){return{}},y.prototype.resetExpiration=function(t){t.expiryTime=Date.now()+this.expirationInterval+1e3*Math.random()},y.prototype.establishCurrentData=function(t){this.currentData=this.shapeDataCache.entryForKey(t.globeStateKey),this.currentData||(this.currentData=this.createShapeDataObject(),this.resetExpiration(this.currentData),this.shapeDataCache.putEntry(t.globeStateKey,this.currentData,1)),this.currentData.isExpired=!this.isShapeDataCurrent(t,this.currentData)},y.prototype.render=function(t){this.enabled&&(this.layer=t.currentLayer,this.prepareBoundaries(t),this.establishCurrentData(t),!this.currentData.isExpired&&this.currentData.extent||(this.computeExtent(t),this.currentData.verticalExaggeration=t.verticalExaggeration,this.resetExpiration(this.currentData)),this.currentData&&this.currentData.extent&&!this.intersectsFrustum(t)||t.surfaceShapeTileBuilder.insertSurfaceShape(this))},y.prototype.interpolateLocations=function(t){var e,i,r,n=t[0],o=n,s=!0,a=!0,l=0,h=!0;for(this._locations=[n],i=1,r=t.length;i<r;i+=1)e=o,a=s,o=t[i],s=o.latitude==n.latitude&&o.longitude==n.longitude,h=!0,(s||a)&&(l+=1)>2&&(h=!1),h&&this.interpolateEdge(e,o,this._locations),this._locations.push(o),e=o;this._isInteriorInhibited||e.latitude==n.latitude&&e.longitude==n.longitude||(this.interpolateEdge(e,n,this._locations),this._locations.push(n))}
100,y.prototype.interpolateEdge=function(t,e,i){var r,n,s=o.greatCircleDistance(t,e),a=Math.round(this._maximumNumEdgeIntervals*s/Math.PI);if(a>0){r=1/a,n=t;for(var l=this.throttledStep(r,n);l<1;l+=this.throttledStep(r,n))n=new o(0,0),o.interpolateAlongPath(this._pathType,l,t,e,n),180===t.longitude&&180===e.longitude?n.longitude=180:-180===t.longitude&&-180===e.longitude&&(n.longitude=-180),i.push(n)}},y.prototype.throttledStep=function(t,i){var r=Math.cos(i.latitude*e.DEGREES_TO_RADIANS);r*=r;var n=this._polarThrottle/(1+this._polarThrottle);return t*(1-n+n*r)},y.prototype.prepareBoundaries=function(t){if(!this.boundariesArePrepared){this.computeBoundaries(t);var e=this.formatBoundaries();this.normalizeAngles(e),e=this.interpolateBoundaries(e);var i=[],r=u.splitContours(e,i);this.contours=i,this.crossesAntiMeridian=r,this.prepareGeometry(t,i),this.prepareSectors(),this.boundariesArePrepared=!0}},y.prototype.formatBoundaries=function(){var t=[];return this._boundaries.length?(null!=this._boundaries[0].latitude?t.push(this._boundaries):t=this._boundaries,t):t},y.prototype.resetBoundaries=function(){this.boundariesArePrepared=!1,this.shapeDataCache.clear(!1)},y.prototype.normalizeAngles=function(t){for(var i=0,r=t.length;i<r;i++)for(var n=t[i],o=0,s=n.length;o<s;o++){var a=n[o];(a.longitude<-180||a.longitude>180)&&(a.longitude=e.normalizedDegreesLongitude(a.longitude)),(a.latitude<-90||a.latitude>90)&&(a.latitude=e.normalizedDegreesLatitude(a.latitude))}},y.prototype.interpolateBoundaries=function(t){for(var e=[],i=0,r=t.length;i<r;i++){var n=t[i];this.interpolateLocations(n),e.push(this._locations.slice()),this._locations.length=0}return e},y.prototype.computeSectors=function(t){return this._sectors&&this._sectors.length>0?this._sectors:(this.prepareBoundaries(t),this._sectors)},y.prototype.computeExtent=function(t){if(!this._sectors||0===this._sectors.length)return null;if(!this.currentData)return null;this.currentData.extent||(this.currentData.extent=new r);var e;if(1===this._sectors.length)e=this._sectors[0].computeBoundingPoints(t.globe,t.verticalExaggeration),this.currentData.extent.setToVec3Points(e);else{for(var i=[],n=0;n<this._sectors.length;n++){e=this._sectors[n].computeBoundingPoints(t.globe,t.verticalExaggeration);var o=new r;o.setToVec3Points(e);for(var s=o.getCorners(),a=0;a<s.length;a++)i.push(s[a])}this.currentData.extent.setToVec3Points(i)}return this.currentData.extent},y.prototype.computeShiftedLocations=function(t,e,i,r){for(var n=[],s=new g(0,0,0),a=new WorldWind.Position(0,0,0),l=t.computePointFromLocation(e.latitude,e.longitude,new g(0,0,0)),h=t.computePointFromLocation(i.latitude,i.longitude,new g(0,0,0)),u=h.subtract(l),c=0,d=r.length;c<d;c++)t.computePointFromLocation(r[c].latitude,r[c].longitude,s),s.add(u),t.computePositionFromPoint(s[0],s[1],s[2],a),n.push(new o(a.latitude,a.longitude));return n},y.prototype.prepareSectors=function(){this.determineSectors(),this.crossesAntiMeridian?this.sectorsOverAntiMeridian():this.sectorsNotOverAntiMeridian()},y.prototype.determineSectors=function(){for(var t=0,e=this.contours.length;t<e;t++){var i=this.contours[t],r=i.polygons;i.sectors=[];for(var n=0,s=r.length;n<s;n++){var a=r[n],l=new d(0,0,0,0);if(l.setToBoundingSector(a),this._pathType===WorldWind.GREAT_CIRCLE){var h=o.greatCircleArcExtremeLocations(a),u=Math.min(l.minLatitude,h[0].latitude),c=Math.max(l.maxLatitude,h[1].latitude);l.minLatitude=u,l.maxLatitude=c}i.sectors.push(l)}}},y.prototype.sectorsOverAntiMeridian=function(){for(var t=new d(90,-90,180,-180),e=new d(90,-90,180,-180),i=0,r=this.contours.length;i<r;i++)for(var n=this.contours[i].sectors,o=0,s=n.length;o<s;o++){var a=n[o];a.minLongitude<0&&a.maxLongitude>0?(e.union(a),t.union(a)):a.minLongitude<0?e.union(a):t.union(a)}var l=Math.min(t.minLatitude,e.minLatitude),h=Math.max(t.maxLatitude,t.maxLatitude);this._sector=new d(l,h,-180,180),this._sectors=[t,e]},y.prototype.sectorsNotOverAntiMeridian=function(){this._sector=new d(90,-90,180,-180);for(var t=0,e=this.contours.length;t<e;t++)for(var i=this.contours[t].sectors,r=0,n=i.length;r<n;r++)this._sector.union(i[r]);this._sectors=[this._sector]},y.prototype.prepareGeometry=function(t,e){for(var i=[],r=[],n=0,s=e.length;n<s;n++)for(var a=e[n],l=a.poleIndex,h=0,u=a.polygons.length;h<u;h++){var c=a.polygons[h],d=a.iMap[h];i.push(c),a.pole!==o.poles.NONE&&u>1?h===l?this.outlineForPole(c,d,r):this.outlineForSplit(c,d,r):a.pole!==o.poles.NONE&&1===u?this.outlineForPole(c,d,r):a.pole===o.poles.NONE&&u>1?this.outlineForSplit(c,d,r):a.pole===o.poles.NONE&&1===u&&r.push(c)}this._interiorGeometry=i,this._outlineGeometry=r}
100,y.prototype.outlineForPole=function(t,e,i){this.containsPole=!0;for(var r=[],n=0,o=0,s=t.length;o<s;o++){var a=t[o],l=e.get(o);l&&l.forPole&&++n%2==1&&(r.push(a),i.push(r),r=[]),n%2==0&&r.push(a)}r.length&&i.push(r)},y.prototype.outlineForSplit=function(t,e,i){for(var r=[],n=0,o=0,s=t.length;o<s;o++){var a=t[o],l=e.get(o);l&&!l.forPole&&++n%2==0&&(r.push(a),i.push(r),r=[]),n%2==1&&r.push(a)}},y.prototype.resetPickColor=function(){this.pickColor=null},y.prototype.renderToTexture=function(t,e,i,r,o,s){var a=this._highlighted?this._highlightAttributes||this._attributes:this._attributes;if(a){var l=!this._isInteriorInhibited&&a.drawInterior,u=a.drawOutline&&a.outlineWidth>0;if(l||u){if(t.pickingMode)this.pickColor||(this.pickColor=t.uniquePickColor()),e.fillStyle=this.pickColor.toCssColorString(),e.strokeStyle=e.fillStyle,e.lineWidth=a.outlineWidth;else{var c=a.interiorColor,d=a.outlineColor;e.fillStyle=new n(c.red,c.green,c.blue,c.alpha*this.layer.opacity).toCssColorString(),e.strokeStyle=new n(d.red,d.green,d.blue,d.alpha*this.layer.opacity).toCssColorString(),e.lineWidth=a.outlineWidth}if(this.crossesAntiMeridian||this.containsPole?(l&&(this.draw(this._interiorGeometry,e,i,r,o,s),e.fill()),u&&(this.draw(this._outlineGeometry,e,i,r,o,s),e.stroke())):(this.draw(this._interiorGeometry,e,i,r,o,s),l&&e.fill(),u&&e.stroke()),t.pickingMode){var f=new h(this.pickColor.clone(),this.pickDelegate?this.pickDelegate:this,null,this.layer,!1);t.resolvePick(f)}}}},y.prototype.draw=function(t,e,i,r,n,o){e.beginPath();for(var s=0,a=t.length;s<a;s++){var l=t[s],h=l[0],u=h.longitude*i+n,c=h.latitude*r+o;e.moveTo(u,c);for(var d=1,f=l.length;d<f;d++)h=l[d],u=h.longitude*i+n,c=h.latitude*r+o,e.lineTo(u,c)}},y.DEFAULT_NUM_EDGE_INTERVALS=128,y.DEFAULT_POLAR_THROTTLE=10,y}),i("shapes/SurfaceShapeTile",["../geom/Angle","../error/ArgumentError","../util/Level","../util/Logger","../geom/Sector","../render/Texture","../render/TextureTile"],function(t,e,i,r,n,o,s){"use strict";var a=function(t,e,i,r){s.call(this,t,e,i,r),this.surfaceShapes=[],this.surfaceShapeStateKeys=[],this.asRenderedSurfaceShapeStateKeys=[],this.sector=t,this.cacheKey=null,this.pickSequence=0,this.createCtx2D()};return a.prototype=Object.create(s.prototype),a.prototype.clearShapes=function(){this.surfaceShapes=[],this.surfaceShapeStateKeys=[]},a.prototype.hasShapes=function(){return this.surfaceShapes.length>0},a.prototype.getShapes=function(){return this.surfaceShapes},a.prototype.setShapes=function(t){this.surfaceShapes=t},a.prototype.getSector=function(){return this.sector},a.prototype.addSurfaceShape=function(t){this.surfaceShapes.push(t),this.surfaceShapeStateKeys.push(t.stateKey+" lo "+t.layer.opacity)},a.prototype.needsUpdate=function(t){var e,i 101;if(this.surfaceShapes.length!=this.asRenderedSurfaceShapeStateKeys.length)return!0;for(e=0,i=this.surfaceShapes.length;e<i;e+=1)if(this.surfaceShapeStateKeys[e]!==this.asRenderedSurfaceShapeStateKeys[e])return!0;return!this.hasTexture(t)},a.prototype.hasTexture=function(t){return!t.pickingMode&&(this.gpuCacheKey||(this.gpuCacheKey=this.getCacheKey()),t.gpuResourceCache.containsResource(this.gpuCacheKey))},a.prototype.updateTexture=function(t){var e=t.currentGlContext,i=a.canvas,r=a.ctx2D;i.width=this.tileWidth,i.height=this.tileHeight;var n=this.tileWidth/this.sector.deltaLongitude(),s=-this.tileHeight/this.sector.deltaLatitude(),l=-this.sector.minLongitude*n,h=-this.sector.maxLatitude*s;this.asRenderedSurfaceShapeStateKeys=[];for(var u=0,c=this.surfaceShapes.length;u<c;u+=1){var d=this.surfaceShapes[u];this.asRenderedSurfaceShapeStateKeys.push(this.surfaceShapeStateKeys[u]),d.renderToTexture(t,r,n,s,l,h)}this.gpuCacheKey=this.getCacheKey();var f=t.gpuResourceCache,p=new o(e,i);return f.putResource(this.gpuCacheKey,p,p.size),f.setResourceAgingFactor(this.gpuCacheKey,10),p},a.prototype.getCacheKey=function(){return this.cacheKey||(this.cacheKey="SurfaceShapeTile:"+this.tileKey+","+this.pickSequence.toString()),this.cacheKey},a.prototype.createCtx2D=function(){a.ctx2D||(a.canvas=document.createElement("canvas"),a.ctx2D=a.canvas.getContext("2d"))},a.canvas=null,a.ctx2D=null,a}),i("shapes/SurfaceShapeTileBuilder",["../error/ArgumentError","../render/DrawContext","../globe/Globe","../shaders/GpuProgram","../util/Level","../util/LevelSet","../geom/Location","../util/Logger","../geom/Matrix","../cache/MemoryCache","../error/NotYetImplementedError","../pick/PickedObject","../geom/Rectangle","../geom/Sector","../shapes/SurfaceShape","../shapes/SurfaceShapeTile","../globe/Terrain","../globe/TerrainTile","../globe/TerrainTileList","../render/TextureTile","../util/Tile"],function(t,e,
101i,r,n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_){"use strict";var b=function(){this.numRowsTilesInTopLevel=4,this.numColumnsTilesInTopLevel=8,this.maximumSubdivisionDepth=15,this.tileWidth=256,this.tileHeight=256,this.levels=new o(f.FULL_SPHERE,new s(180/this.numRowsTilesInTopLevel,360/this.numColumnsTilesInTopLevel),this.maximumSubdivisionDepth,this.tileWidth,this.tileHeight),this.surfaceShapes=[],this.surfaceShapeTiles=[],this.topLevelTiles=[],this.sector=new f(-90,90,-180,180),this.detailControl=1.25,this.tileCache=new h(5e5,4e5)};return b.prototype.clear=function(){this.surfaceShapeTiles.splice(0,this.surfaceShapeTiles.length),this.surfaceShapes.splice(0,this.surfaceShapes.length)},b.prototype.insertSurfaceShape=function(t){this.surfaceShapes.push(t)},b.prototype.doRender=function(t){if(t.pickingMode){for(var e=0,i=this.surfaceShapes.length;e<i;e+=1)this.surfaceShapes[e].resetPickColor();b.pickSequence+=1;var r=this.surfaceShapeTiles,n=this.topLevelTiles;this.surfaceShapeTiles=[],this.topLevelTiles=[],this.buildTiles(t),t.deepPicking?this.doDeepPickingRender(t):t.surfaceTileRenderer.renderTiles(t,this.surfaceShapeTiles,1),this.surfaceShapeTiles=r,this.topLevelTiles=n}else this.buildTiles(t),t.surfaceTileRenderer.renderTiles(t,this.surfaceShapeTiles,1)},b.prototype.doDeepPickingRender=function(t){var e,i,r,n,o,s,a,l,h,u=[];for(o=0,s=t.objectsAtPickPoint.objects.length;o<s;o+=1)a=t.objectsAtPickPoint.objects[o],a.userObject instanceof p&&(l=a.userObject,u.indexOf(l)<0&&(u.push(l),t.objectsAtPickPoint.objects.splice(o,1),o-=1,s-=1));if(!(u.length<=0)){var d=[];for(r=0,n=u.length;r<n;r+=1){for(l=u[r],e=0,i=this.surfaceShapeTiles.length;e<i;e+=1)h=this.surfaceShapeTiles[e],h.setShapes([l]),h.updateTexture(t);t.surfaceTileRenderer.renderTiles(t,this.surfaceShapeTiles,1);var f=t.readPickColor(t.pickPoint);f&&l.pickColor.equals(f)&&(a=new c(l.pickColor.clone(),l.pickDelegate?l.pickDelegate:l,null,l.layer,!1),d.push(a))}for(o=0,s=t.objectsAtPickPoint.objects.length;o<s;o+=1)a=t.objectsAtPickPoint.objects[o],a.userObject instanceof p&&(t.objectsAtPickPoint.objects.splice(o,1),o-=1,s-=1);for(o=0,s=d.length;o<s;o+=1)a=d[o],t.objectsAtPickPoint.objects.push(a)}},b.prototype.buildTiles=function(e){if(!e)throw new t(a.logMessage(a.LEVEL_SEVERE,"SurfaceShapeTileBuilder","buildTiles","missingDc"));if(this.surfaceShapes&&!(this.surfaceShapes.length<1)){this.assembleTiles(e),this.surfaceShapes.splice(0,this.surfaceShapes.length);for(var i=0,r=this.surfaceShapeTiles.length;i<r;i+=1){this.surfaceShapeTiles[i].clearShapes()}}},b.prototype.assembleTiles=function(t){var e,i,r,n,o,s,a;this.topLevelTiles.length<1&&this.createTopLevelTiles();var l={};for(i=0,r=this.surfaceShapes.length;i<r;i+=1){var h=this.surfaceShapes[i],u=h.computeSectors(t);if(u)for(s=0,a=u.length;s<a;s+=1){var c=u[s];for(n=0,o=this.topLevelTiles.length;n<o;n+=1)if(e=this.topLevelTiles[n],e.sector.intersects(c)){var d=e.tileKey;l[d]=e,e.addSurfaceShape(h)}}}for(var f in l)l.hasOwnProperty(f)&&(e=l[f],this.addTileOrDescendants(t,this.levels,null,e))},b.prototype.addTileOrDescendants=function(t,e,i,r){if(!this.intersectsFrustum(t,r))return void r.clearShapes();if(null!=i&&this.addIntersectingShapes(t,i,r),r.hasShapes()){if(this.meetsRenderCriteria(t,e,r))return void this.addTile(t,r);for(var n=e.level(r.level.levelNumber+1),o=t.pickingMode?r.subdivide(n,this):r.subdivideToCache(n,this,this.tileCache),s=0,a=o.length;s<a;s+=1){var l=o[s];this.addTileOrDescendants(t,e,r,l)}r.clearShapes()}},b.prototype.addIntersectingShapes=function(t,e,i){for(var r=e.getShapes(),n=0,o=r.length;n<o;n+=1){var s=r[n],a=s.computeSectors(t);if(a)for(var l=0,h=a.length;l<h;l+=1){var u=a[l];if(i.getSector().intersects(u)){i.addSurfaceShape(s);break}}}},b.prototype.addTile=function(t,e){t.pickingMode&&(e.pickSequence=b.pickSequence),e.needsUpdate(t)&&e.updateTexture(t),this.surfaceShapeTiles.push(e)},b.prototype.createTile=function(t,e,i,r){return new g(t,e,i,r)},b.prototype.createTopLevelTiles=function(){_.createTilesForLevel(this.levels.firstLevel(),this,this.topLevelTiles)},b.prototype.intersectsFrustum=function(t,e){return!(t.globe.projectionLimits&&!e.sector.overlaps(t.globe.projectionLimits))&&(e.update(t),e.extent.intersectsFrustum(t.pickingMode?t.pickFrustum:t.frustumInModelCoordinates))}
101,b.prototype.meetsRenderCriteria=function(t,e,i){return i.level.levelNumber==e.lastLevel().levelNumber||!i.mustSubdivide(t,this.detailControl)},b.pickSequence=0,b}),i("shaders/SurfaceTileRendererProgram",["../error/ArgumentError","../util/Color","../shaders/GpuProgram","../util/Logger"],function(t,e,i,r){"use strict";var n=function(t){i.call(this,t,"attribute vec4 vertexPoint;\nattribute vec4 vertexTexCoord;\nuniform mat4 mvpMatrix;\nuniform mat4 texSamplerMatrix;\nuniform mat4 texMaskMatrix;\nvarying vec2 texSamplerCoord;\nvarying vec2 texMaskCoord;\nvoid main() {\ngl_Position = mvpMatrix * vertexPoint;\ntexSamplerCoord = (texSamplerMatrix * vertexTexCoord).st;\ntexMaskCoord = (texMaskMatrix * vertexTexCoord).st;\n}","precision mediump float;\nuniform sampler2D texSampler;\nuniform float opacity;\nuniform vec4 color;\nuniform bool modulateColor;\nvarying vec2 texSamplerCoord;\nvarying vec2 texMaskCoord;\nbool isInsideTextureImage(const vec2 coord) {\n return coord.x >= 0.0 && coord.x <= 1.0 && coord.y >= 0.0 && coord.y <= 1.0;\n}\nvoid main(void) {\nfloat mask = float(isInsideTextureImage(texMaskCoord));if (modulateColor) {\n gl_FragColor = color * mask * floor(texture2D(texSampler, texSamplerCoord).a + 0.5);\n} else {\n gl_FragColor = texture2D(texSampler, texSamplerCoord) * mask * opacity;\n}\n}"),this.vertexPointLocation=this.attributeLocation(t,"vertexPoint"),this.vertexTexCoordLocation=this.attributeLocation(t,"vertexTexCoord"),this.mvpMatrixLocation=this.uniformLocation(t,"mvpMatrix"),this.colorLocation=this.uniformLocation(t,"color"),this.modulateColorLocation=this.uniformLocation(t,"modulateColor"),this.texSamplerMatrixLocation=this.uniformLocation(t,"texSamplerMatrix"),this.texMaskMatrixLocation=this.uniformLocation(t,"texMaskMatrix"),this.texSamplerLocation=this.uniformLocation(t,"texSampler"),this.opacityLocation=this.uniformLocation(t,"opacity"),this.vertexPointLocation=-1};return n.key="WorldWindGpuSurfaceTileRenderingProgram",n.prototype=Object.create(i.prototype),n.prototype.loadModelviewProjection=function(e,i){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"SurfaceTileRendererProgram","loadModelviewProjection","missingMatrix"));this.loadUniformMatrix(e,i,this.mvpMatrixLocation)},n.prototype.loadTexSamplerMatrix=function(e,i){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"SurfaceTileRendererProgram","loadTexSamplerMatrix","missingMatrix"));this.loadUniformMatrix(e,i,this.texSamplerMatrixLocation)},n.prototype.loadTexMaskMatrix=function(e,i){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"SurfaceTileRendererProgram","loadTexMaskMatrix","missingMatrix"));this.loadUniformMatrix(e,i,this.texMaskMatrixLocation)},n.prototype.loadTexSampler=function(t,e){t.uniform1i(this.texSamplerLocation,e-WebGLRenderingContext.TEXTURE0)},n.prototype.loadOpacity=function(t,e){t.uniform1f(this.opacityLocation,e)},n.prototype.loadColor=function(e,i){if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"SurfaceTileRendererProgram","loadColor","missingColor"));this.loadUniformColor(e,i,this.colorLocation)},n.prototype.loadModulateColor=function(t,e){t.uniform1i(this.modulateColorLocation,e?1:0)},n}),i("render/SurfaceTileRenderer",["../error/ArgumentError","../util/Logger","../geom/Matrix","../shapes/SurfaceShapeTile","../shaders/SurfaceTileRendererProgram"],function(t,e,i,r,n){"use strict";var o=function(){this.texMaskMatrix=i.fromIdentity(),this.texSamplerMatrix=i.fromIdentity(),this.isSurfaceShapeTileRendering=!1};return o.prototype.renderTiles=function(i,n,o,s){if(!n)throw new t(e.logMessage(e.LEVEL_SEVERE,"SurfaceTileRenderer","renderTiles","Specified surface tiles array is null or undefined."));if(!(n.length<1)){var a,l,h,u,c=i.terrain,d=i.currentGlContext,f=0,p=1;if(c){this.isSurfaceShapeTileRendering=n[0]instanceof r,o*=i.surfaceOpacity,a=this.beginRendering(i,o),c.beginRendering(i);try{for(var g=0,m=c.surfaceGeometry.length;g<m;g++){l=c.surfaceGeometry[g],h=l.sector,c.beginRenderingTile(i,l);try{for(var y=0,E=n.length;y<E;y++)u=n[y],u.sector.overlaps(h)&&u.bind(i)&&(i.pickingMode?u.pickColor&&a.loadColor(d,u.pickColor):s&&u.opacity!=p&&(a.loadOpacity(d,o*u.opacity),p=u.opacity),this.applyTileState(i,l,u),c.renderTile(i,l),++f)}catch(t){console.log(t)}finally{c.endRenderingTile(i,l)}}}catch(t){console.log(t)}finally{c.endRendering(i),this.endRendering(i),i.frameStatistics.incrementRenderedTileCount(f)}}}},o.prototype.beginRendering=function(t,e){var i=t.currentGlContext,r=t.findAndBindProgram(n);return r.loadTexSampler(i,i.TEXTURE0),t.pickingMode&&!this.isSurfaceShapeTileRendering?r.loadModulateColor(i,!0):(r.loadModulateColor(i,!1),r.loadOpacity(i,e)),r},o.prototype.endRendering=function(t){var e=t.currentGlContext;e.bindTexture(e.TEXTURE_2D,null)}
101,o.prototype.applyTileState=function(t,e,i){var r=t.currentGlContext,n=t.currentProgram,o=e.sector,s=o.deltaLatitude(),a=o.deltaLongitude(),l=i.sector,h=l.deltaLatitude(),u=l.deltaLongitude(),c=h>0?h:1,d=u>0?u:1,f=a/d,p=s/c,g=-(l.minLongitude-o.minLongitude)/d,m=-(l.minLatitude-o.minLatitude)/c;this.texMaskMatrix.set(f,0,0,g,0,p,0,m,0,0,1,0,0,0,0,1),this.texSamplerMatrix.setToUnitYFlip(),i.applyInternalTransform(t,this.texSamplerMatrix),this.texSamplerMatrix.multiplyMatrix(this.texMaskMatrix),n.loadTexSamplerMatrix(r,this.texSamplerMatrix),n.loadTexMaskMatrix(r,this.texMaskMatrix)},o}),i("render/TextRenderer",["../error/ArgumentError","../shaders/BasicTextureProgram","../util/Color","../util/Font","../util/Logger","../geom/Matrix","../render/Texture","../geom/Vec2"],function(t,e,i,r,n,o,s,a){"use strict";var l=function(e){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"TextRenderer","constructor","missingDc"));this.canvas2D=document.createElement("canvas"),this.ctx2D=this.canvas2D.getContext("2d"),this.dc=e,this.enableOutline=!0,this.lineSpacing=.15,this.outlineColor=new i(0,0,0,.5),this.outlineWidth=4,this.textColor=new i(1,1,1,1),this.typeFace=new r(14)};return l.prototype.textSize=function(t){if(0===t.length)return new a(0,0);this.ctx2D.font=this.typeFace.fontString;for(var e=t.split("\n"),i=e.length*(this.typeFace.size*(1+this.lineSpacing)),r=0,n=0;n<e.length;n++)r=Math.max(r,this.ctx2D.measureText(e[n]).width);return this.enableOutline&&(r+=this.outlineWidth,i+=this.outlineWidth),new a(r,i)},l.prototype.renderText=function(t){if(t&&t.length>0){var e=this.drawText(t);return new s(this.dc.currentGlContext,e)}return null},l.prototype.drawText=function(t){var e=this.ctx2D,i=this.canvas2D,r=this.textSize(t),n=t.split("\n"),o=this.enableOutline?this.outlineWidth/2:0,s=this.dc.pixelScale;i.width=Math.ceil(r[0])*s,i.height=Math.ceil(r[1])*s,e.scale(s,s),e.font=this.typeFace.fontString,e.textBaseline="bottom",e.textAlign=this.typeFace.horizontalAlignment,e.fillStyle=this.textColor.toCssColorString(),e.strokeStyle=this.outlineColor.toCssColorString(),e.lineWidth=this.outlineWidth,e.lineCap="round",e.lineJoin="round","left"===this.typeFace.horizontalAlignment?e.translate(o,0):"right"===this.typeFace.horizontalAlignment?e.translate(r[0]-o,0):e.translate(r[0]/2,0);for(var a=0;a<n.length;a++)e.translate(0,this.typeFace.size*(1+this.lineSpacing)+o),this.enableOutline&&e.strokeText(n[a],0,0),e.fillText(n[a],0,0);return i},l.prototype.getMaxLineHeight=function(){return this.textSize("_Ã")[1]},l.prototype.wrap=function(e,i,r){if(!e)throw new t(n.logMessage(n.WARNING,"TextRenderer","wrap","missing text"));var o,s=e.split("\n"),a="";for(o=0;o<s.length;o++)s[o]=this.wrapLine(s[o],i);var l=0,h=!1,u=this.getMaxLineHeight();for(o=0;o<s.length&&!h;o++){for(var c=s[o].split("\n"),d=0;d<c.length&&!h;d++)r<=0||l+u<=r?(a+=c[d],l+=u+this.lineSpacing,d<c.length-1&&(a+="\n")):h=!0;o<s.length-1&&!h&&(a+="\n")}return h&&(a.length>0&&(a=a.substring(0,a.length-1)),a+="..."),a},l.prototype.wrapLine=function(t,e){var i="",r=t.trim();if(this.textSize(r)[0]>e){for(var n="",o=0,s=r.indexOf(" ",o+1);o<r.length;){-1===s&&(s=r.length);var a=r.substring(o,s),l=n+a;this.textSize(l)[0]<=e?n+=a:0!==n.length?(i+=n,i+="\n",n="",n+=a.trim()):n+=a.trim(),(o=s)<r.length-1&&(s=r.indexOf(" ",o+1))}i+=n}else i+=r;return i},l}),i("render/DrawContext",["../error/ArgumentError","../util/Color","../util/FrameStatistics","../render/FramebufferTexture","../render/FramebufferTileController","../geom/Frustum","../globe/Globe","../shaders/GpuProgram","../cache/GpuResourceCache","../layer/Layer","../geom/Line","../util/Logger","../geom/Matrix","../pick/PickedObjectList","../geom/Plane","../geom/Position","../geom/Rectangle","../render/ScreenCreditController","../geom/Sector","../shapes/SurfaceShape","../shapes/SurfaceShapeTileBuilder","../render/SurfaceTileRenderer","../render/TextRenderer","../geom/Vec2","../geom/Vec3","../util/WWMath"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_,b,S,w,L,T){"use strict";var x=function(i){if(!i)throw new t(c.logMessage(c.LEVEL_SEVERE,"Texture","constructor","missingGlContext"));this.currentGlContext=i,this.canvas2D=document.createElement("canvas"),this.ctx2D=this.canvas2D.getContext("2d"),this.clearColor=e.TRANSPARENT,this.gpuResourceCache=new l(WorldWind.c
101onfiguration.gpuCacheSize,.8*WorldWind.configuration.gpuCacheSize),this.surfaceTileRenderer=new b,this.surfaceShapeTileBuilder=new _,this.surfaceShapeTileController=new n,this.screenCreditController=new y,this.textRenderer=new S(this),this.currentFramebuffer=null,this.currentProgram=null,this.surfaceRenderables=[],this.orderedRenderingMode=!1,this.orderedRenderables=[],this.orderedRenderablesCounter=0,this.timestamp=Date.now(),this.previousRedrawTimestamp=this.timestamp,this.redrawRequested=!1,this.globe=null,this.globeStateKey=null,this.layers=null,this.currentLayer=null,this.eyePosition=new g(0,0,0),this.eyePoint=new L(0,0,0),this.screenProjection=d.fromIdentity(),this.terrain=null,this.verticalExaggeration=1,this.fadeTime=500,this.surfaceOpacity=1,this.frameStatistics=null,this.pickingMode=!1,this.pickTerrainOnly=!1,this.deepPicking=!1,this.regionPicking=!1,this.pickPoint=null,this.pickRay=null,this.pickRectangle=null,this.pickFramebuffer=null,this.pickFrustum=null,this.pickColor=new e(0,0,0,1),this.objectsAtPickPoint=new f,this.pixelScale=1,this.navigator=null,this.modelview=d.fromIdentity(),this.projection=d.fromIdentity(),this.modelviewProjection=d.fromIdentity(),this.frustumInModelCoordinates=null,this.modelviewNormalTransform=d.fromIdentity(),this.viewport=new m(0,0,0,0),this.pixelSizeFactor=0,this.pixelSizeOffset=0,this.glExtensionsCache={}};return x.unitCubeKey="DrawContextUnitCubeKey",x.unitCubeElementsKey="DrawContextUnitCubeElementsKey",x.unitQuadKey="DrawContextUnitQuadKey",x.unitQuadKey3="DrawContextUnitQuadKey3",x.prototype.reset=function(){this.screenCreditController.clear(),this.surfaceRenderables=[],this.orderedRenderingMode=!1,this.orderedRenderables=[],this.screenRenderables=[],this.orderedRenderablesCounter=0;var t=this.timestamp;this.timestamp=Date.now(),this.timestamp===t&&++this.timestamp,this.redrawRequested=!1,this.globe=null,this.globeStateKey=null,this.layers=null,this.currentLayer=null,this.terrain=null,this.verticalExaggeration=1,this.frameStatistics=null,this.accumulateOrderedRenderables=!0,this.pickingMode=!1,this.pickTerrainOnly=!1,this.deepPicking=!1,this.regionPicking=!1,this.pickPoint=null,this.pickRay=null,this.pickRectangle=null,this.pickFrustum=null,this.pickColor=new e(0,0,0,1),this.objectsAtPickPoint.clear(),this.eyePoint.set(0,0,0),this.modelview.setToIdentity(),this.projection.setToIdentity(),this.modelviewProjection.setToIdentity(),this.frustumInModelCoordinates=null,this.modelviewNormalTransform.setToIdentity()},x.prototype.update=function(){var t=this.currentGlContext,e=this.eyePoint;this.globeStateKey=this.globe.stateKey,this.globe.computePositionFromPoint(e[0],e[1],e[2],this.eyePosition),this.screenProjection.setToScreenProjection(t.drawingBufferWidth,t.drawingBufferHeight)},x.prototype.contextLost=function(){this.gpuResourceCache.clear(),this.pickFramebuffer=null,this.currentFramebuffer=null,this.currentProgram=null,this.glExtensionsCache={}},x.prototype.contextRestored=function(){this.gpuResourceCache.clear(),this.glExtensionsCache={}},x.prototype.bindFramebuffer=function(t){this.currentFramebuffer!=t&&(this.currentGlContext.bindFramebuffer(this.currentGlContext.FRAMEBUFFER,t?t.framebufferId:null),this.currentFramebuffer=t)},x.prototype.bindProgram=function(t){this.currentProgram!=t&&(this.currentGlContext.useProgram(t?t.programId:null),this.currentProgram=t)},x.prototype.findAndBindProgram=function(e){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"DrawContext","findAndBindProgram","The specified program constructor is null or undefined."));var i=this.gpuResourceCache.resourceForKey(e.key);if(i)this.bindProgram(i);else try{i=new e(this.currentGlContext),this.bindProgram(i),this.gpuResourceCache.putResource(e.key,i,i.size)}catch(t){c.log(c.LEVEL_SEVERE,"Error attempting to create GPU program.")}return i},x.prototype.addSurfaceRenderable=function(t){t&&this.surfaceRenderables.push(t)},x.prototype.peekSurfaceRenderable=function(){return this.surfaceRenderables.length>0?this.surfaceRenderables[this.surfaceRenderables.length-1]:null},x.prototype.popSurfaceRenderable=function(){return this.surfaceRenderables.length>0?this.surfaceRenderables.pop():null},x.prototype.reverseSurfaceRenderables=function(){this.surfaceRenderables.reverse()},x.prototype.addOrderedRenderable=function(t,e){if(t){var i={orderedRenderable:t,insertionOrder:this.orderedRenderablesCounter++,eyeDistance:e||t.eyeDistance,globeStateKey:this.globeStateKey};this.globe.continuous&&(i.globeOffset=this.globe.offset),0===i.eyeDistance?this.screenRenderables.push(i):this.orderedRenderables.push(i)}},x.prototype.addOrderedRenderableToBack=function(t){if(t){var e={orderedRenderable:t,insertionOrder:this.orderedRenderablesCounter++,eyeDistance:Number.MAX_VALUE,globeStateKey:this.globeStateKey};this.globe.continuous&&(e.globeOffset=this.globe.offset),this.orderedRenderables.push(e)}},x.prototype.peekOrderedRenderable=function(){return this.orderedRenderables.length>0?this.orderedRenderables[this.orderedRenderables.length-1].orderedRenderable:null},x.prototype.popOrderedRenderable=function(){if(this.orderedRenderables.length>0){var t=this.orderedRenderables.pop();return this.globeStateKey=t.globeStateKey,this.globe.continuous&&(this.globe.offset=t.globeOffset),t.orderedRenderable}return null},x.prototype.nextScreenRenderable=function(){if(this.screenRenderables.length>0){var t=this.screenRenderables.shift();return this.globeStateKey=t.globeStateKey,this.globe.continuous&&(this.globe.offset=t.globeOffset),t.orderedRenderable}return null},x.prototype.sortOrderedRenderables=function(){this.orderedRenderables.sort(function(t,e){var i=t.eyeDistance,r=e.eyeDistance;if(i<r)return-1;if(i>r)return 1;var n=t.insertionOrder,o=e.insertionOrder;return n>o?-1:n<o?1:0})},x.prototype.readPickColor=function(t){var i=this.convertPointToViewport(t,new w(0,0)),r=new
101Uint8Array(4);return this.currentGlContext.readPixels(i[0],i[1],1,1,this.currentGlContext.RGBA,this.currentGlContext.UNSIGNED_BYTE,r),this.clearColor.equalsBytes(r)?null:e.colorFromByteArray(r)},x.prototype.readPickColors=function(t){var i,r=this.currentGlContext,n=new Uint8Array(t.width*t.height*4),o={},s=new e(0,0,0,0),a=r.getParameter(r.PACK_ALIGNMENT);r.pixelStorei(r.PACK_ALIGNMENT,1),this.currentGlContext.readPixels(t.x,t.y,t.width,t.height,r.RGBA,r.UNSIGNED_BYTE,n),r.pixelStorei(r.PACK_ALIGNMENT,a);for(var l=0,h=t.width*t.height;l<h;l++){var u=4*l;i=e.colorFromBytes(n[u],n[u+1],n[u+2],n[u+3]),i.equals(this.clearColor)||i.equals(s)||(o[i.toByteString()]=i)}return o},x.prototype.resolvePick=function(t){if(t.userObject instanceof v||!this.deepPicking||this.regionPicking)this.addPickedObject(t);else{var e=this.readPickColor(this.pickPoint);if(!e)return null;t.color.equals(e)&&this.addPickedObject(t)}},x.prototype.addPickedObject=function(t){t&&this.objectsAtPickPoint.add(t)},x.prototype.uniquePickColor=function(){var t=this.pickColor.nextColor().clone();return t.equals(this.clearColor)?t.nextColor():t},x.prototype.makePickFramebuffer=function(){var t=this.currentGlContext,e=t.drawingBufferWidth,i=t.drawingBufferHeight;return this.pickFramebuffer&&this.pickFramebuffer.width==e&&this.pickFramebuffer.height==i||(this.pickFramebuffer=new r(t,e,i,!0)),this.pickFramebuffer},x.prototype.makePickFrustum=function(){if(!this.pickPoint&&!this.pickRectangle)return!1;var t,e,i,r,n,s,a,l,h,u,c,f,g,y,E,v,_,b,S,x,R,M,C=new L(0,0,0),A=new L(0,0,0),P=this.pickRectangle,N=this.viewport;P||(M=this.convertPointToViewport(this.pickPoint,new w(0,0)),P=new m(M[0]-2,M[1]-2,4,4));var O=P.x,I=P.x+P.width,D=P.y,k=P.y+P.height;if(I<0||k<0||O>N.x+N.width||D>N.y+N.height)return!1;P.x=T.clamp(O,N.x,N.x+N.width),P.y=T.clamp(D,N.y,N.y+N.height),P.width=T.clamp(I,N.x,N.x+N.width)-P.x,P.height=T.clamp(k,N.y,N.y+N.height)-P.y,this.pickRectangle=P;var V=d.fromIdentity();return V.invertMatrix(this.modelviewProjection),A[0]=P.x,A[1]=P.y,A[2]=0,V.unProject(A,N,t=new L(0,0,0)),A[0]=P.x,A[1]=P.y,A[2]=1,V.unProject(A,N,e=new L(0,0,0)),A[0]=P.x+P.width,A[1]=P.y,A[2]=0,V.unProject(A,N,i=new L(0,0,0)),A[0]=P.x+P.width,A[1]=P.y,A[2]=1,V.unProject(A,N,r=new L(0,0,0)),A[0]=P.x,A[1]=P.y+P.height,A[2]=0,V.unProject(A,N,n=new L(0,0,0)),A[0]=P.x,A[1]=P.y+P.height,A[2]=1,V.unProject(A,N,s=new L(0,0,0)),A[0]=P.x+P.width,A[1]=P.y+P.height,A[2]=0,V.unProject(A,N,a=new L(0,0,0)),A[0]=P.x+P.width,A[1]=P.y+P.height,A[2]=1,V.unProject(A,N,l=new L(0,0,0)),R=new L(s[0]-t[0],s[1]-t[1],s[2]-t[2]),C.set(n[0]-e[0],n[1]-e[1],n[2]-e[2]),h=R.cross(C),E=new p(h[0],h[1],h[2],-h.dot(t)),E.normalize(),R=new L(a[0]-r[0],a[1]-r[1],a[2]-r[2]),C.set(l[0]-i[0],l[1]-i[1],l[2]-i[2]),u=R.cross(C),v=new p(u[0],u[1],u[2],-u.dot(i)),v.normalize(),R=new L(s[0]-a[0],s[1]-a[1],s[2]-a[2]),C.set(l[0]-n[0],l[1]-n[1],l[2]-n[2]),c=R.cross(C),_=new p(c[0],c[1],c[2],-c.dot(n)),_.normalize(),R=new L(r[0]-t[0],r[1]-t[1],r[2]-t[2]),C.set(e[0]-i[0],e[1]-i[1],e[2]-i[2]),f=R.cross(C),b=new p(f[0],f[1],f[2],-f.dot(i)),b.normalize(),R=new L(n[0]-i[0],n[1]-i[1],n[2]-i[2]),C.set(a[0]-t[0],a[1]-t[1],a[2]-t[2]),g=R.cross(C),S=new p(g[0],g[1],g[2],-g.dot(t)),S.normalize(),R=new L(l[0]-e[0],l[1]-e[1],l[2]-e[2]),C.set(s[0]-r[0],s[1]-r[1],s[2]-r[2]),y=R.cross(C),x=new p(y[0],y[1],y[2],-y.dot(e)),x.normalize(),this.pickFrustum=new o(E,v,b,_,S,x),!0},x.prototype.isSmall=function(t,e){if(!t)return!1;var i=this.eyePoint.distanceTo(t.center),r=this.pixelSizeAtDistance(i);return 2*t.radius<e*r},x.prototype.unitCubeBuffer=function(){var t=this.gpuResourceCache.resourceForKey(x.unitCubeKey);if(!t){var e=this.currentGlContext,i=new Float32Array(24),r=0;i[r++]=0,i[r++]=1,i[r++]=0,i[r++]=0,i[r++]=0,i[r++]=0,i[r++]=1,i[r++]=1,i[r++]=0,i[r++]=1,i[r++]=0,i[r++]=0,i[r++]=0,i[r++]=1,i[r++]=1,i[r++]=0,i[r++]=0,i[r++]=1,i[r++]=1,i[r++]=1,i[r++]=1,i[r++]=1,i[r++]=0,i[r]=1,t=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),this.frameStatistics.incrementVboLoadCount(1),this.gpuResourceCache.putResource(x.unitCubeKey,t,4*i.length)}return t},x.prototype.unitCubeElements=function(){var t=this.gpuResourceCache.resourceForKey(x.unitCubeElementsKey);if(!t){var e=this.currentGlContext,i=new Int16Array(60),r=0;i[r++]=1,i[r++]=0,i[r++]=3,i[r++]=3,i[r++]=0,i[r++]=2,i[r++]=4,i[r++]=5,i[r++]=6,i[r++]=6,i[r++]=5,i[r++]=7,i[r++]=5,i[r++]=1,i[r++]=7,i[r++]=7,i[r++]=1,i[r++]=3,i[r++]=6,i[r++]=2,i[r++]=4,i[r++]=4,i[r++]=2,i[r++]=0,i[r++]=4,i[r++]=0,i[r++]=5,i[r++]=5,i[r++]=0,i[r++]=1,i[r++]=7,i[r++]=3,i[r++]=6,i[r++]=6,i[r++]=3,i[r++]=2,i[r++]=0,i[r++]=1,i[r++]=1,i[r++]=3,i[r++]=3,i[r++]=2,i[r++]=2,i[r++]=0,i[r++]=4,i[r++]=5,i[r++]=5,i[r++]=7,i[r++]=7,i[r++]=6,i[r++]=6,i[r++]=4,i[r++]=0,i[r++]=4,i[r++]=5,i[r++]=1,i[r++]=2,i[r++]=6,i[r++]=7,i[r]=3,t=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),e.bufferData(e.ELEMENT_ARRAY_BUFFER,i,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),this.frameStatistics.incrementVboLoadCount(1),this.gpuResourceCache.putResource(x.unitCubeElementsKey,t,2*i.length)}return t},x.prototype.unitQuadBuffer=function(){var t=this.gpuResourceCache.resourceForKey(x.unitQuadKey);if(!t){var e=this.currentGlContext,i=new Float32Array(8);i[0]=0,i[1]=1,i[2]=0,i[3]=0,i[4]=1,i[5]=1,i[6]=1,i[7]=0,t=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),this.frameStatistics.incrementVboLoadCount(1),this.gpuResourceCache.putResource(x.unitQuadKey,t,4*i.length)}return t},x.prototype.unitQuadBuffer3=function(){var t=this.gpuResourceCache.resourceForKey(x.unitQuadKey3);if(!t){var e=this.currentGlContext,i=new Float32Array(12);i[0]=0,i[1]=1,i[2]=0,i[3]=0,i[4]=0,i[5]=0,i[6]=1,i[7]=1,i[8]=0,i[9]=1,i[10]=0,i[11]=0,t=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,i,e.STATIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,null),this.frameStatistics.incrementVboLoadCount(1),this.gpuResourceCache.putResource(x.unitQuadKey3,t,4*i.length)}return t},x.prototype.surfacePointForMode=function(e,i,r,n,o){if(!o)throw new t(c.logMessage(c.LEVEL_SEVERE,"DrawContext","surfacePointForMode","missingResult"));if(this.terrain)this.terrain.surfacePointForMode(e,i,r,n,o);else{var s=r+this.globe.elevationAtLocation(e,i)*this.verticalExaggeration;this.globe.computePointFromPosition(e,i,s,o)}return o},x.prototype.project=function(e,i){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"DrawContext","project","missingPoint"));if(!i)throw new t(c.logMessage(c.LEVEL_SEVERE,"DrawContext","project","missingResult"));var r=e[0],n=e[1],o=e[2],s=this.modelviewProjection,a=s[0]*r+s[1]*n+s[2]*o+s[3],l=s[4]*r+s[5]*n+s[6]*o+s[7],h=s[8]*r+s[9]*n+s[10]*o+s[11],u=s[12]*r+s[13]*n+s[14]*o+s[15];return 0!==u&&(a/=u,l/=u,!((h/=u)<-1||h>1)&&(a=.5*a+.5,l=.5*l+.5,h=.5*h+.5,a=a*this.viewport.width+this.viewport.x,l=l*this.viewport.height+this.viewport.y,i[0]=a,i[1]=l,i[2]=h,!0))},x.prototype.projectWithDepth=function(e,i,r){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"DrawContext","projectWithDepth","missingPoint"));if(!r)throw new t(c.logMessage(c.LEVEL_SEVERE,"DrawContext","projectWithDepth","missingResult"));var n=e[0],o=e[1],s=e[2],a=this.modelview,l=a[0]*n+a[1]*o+a[2]*s+a[3],h=a[4]*n+a[5]*o+a[6]*s+a[7],u=a[8]*n+a[9]*o+a[10]*s+a[11],d=a[12]*n+a[13]*o+a[14]*s+a[15],f=this.projection,p=f[0]*l+f[1]*h+f[2]*u+f[3]*d,g=f[4]*l+f[5]*h+f[6]*u+f[7]*d,m=f[8]*l+f[9]*h+f[10]*u+f[11]*d,y=f[12]*l+f[13]*h+f[14]*u+f[15]*d;return 0!==y&&(p/=y,g/=y,!((m/=y)<-1||m>1)&&(m=f[8]*l+f[9]*h+f[10]*u*(1+i)+f[11]*d,m/=y,m=T.clamp(m,-1,1),p=.5*p+.5,g=.5*g+.5,m=.5*m+.5,p=p*this.viewport.width+this.viewport.x,g=g*this.viewport.height+this.viewport.y,r[0]=p,r[1]=g,r[2]=m,!0))},x.prototype.convertPointToViewport=function(e,i){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"DrawContext","convertPointToViewport","missingPoint"));if(!i)throw new t(c.logMessage(c.LEVEL_SEVERE,"DrawContext","convertPointToViewport","missingResult"));return i[0]=e[0],i[1]=this.viewport.height-e[1],i},x.prototype.pixelSizeAtDistance=function(t){return this.pixelSizeFactor*t+this.pixelSizeOffset},x.prototype.createTextTexture=function(t,e){if(!t||!e)return null;var i=this.computeTextTextureStateKey(t,e),r=this.gpuResourceCache.resourceForKey(i);return r||(this.textRenderer.textColor=e.color,this.textRenderer.typeFace=e.font,this.textRenderer.enableOutline=e.enableOutline,this.textRenderer.outlineColor=e.outlineColor,this.textRenderer.outlineWidth=e.outlineWidth,r=this.textRenderer.renderText(t),this.gpuResourceCache.putResource(i,r,r.size),this.gpuResourceCache.setResourceAgingFactor(i,100)),r},x.prototype.computeTextTextureStateKey=function(t,e){return t&&e?t+"c "+e.color.toHexString(!0)+" f "+e.font.toString()+" eo "+e.enableOutline+" ow "+e.outlineWidth+" oc "+e.outlineColor.toHexString(!0):null},x.prototype.getExtension=function(e){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"DrawContext","getExtension","missingExtensionName"));return e in this.glExtensionsCache||(this.glExtensionsCache[e]=this.currentGlContext.getExtension(e)||null),this.glExtensionsCache[e]},x}),i("globe/GebcoElevationCoverage",["../geom/Location","../geom/Sector","../globe/TiledElevationCoverage","../util/WmsUrlBuilder"],function(t,e,
101i,r){"use strict";var n=function(){i.call(this,{coverageSector:e.FULL_SPHERE,resolution:.008333333333333,retrievalImageFormat:"application/bil16",minElevation:-11e3,maxElevation:8850,urlBuilder:new r("https://worldwind26.arc.nasa.gov/elev","GEBCO","","1.3.0")}),this.displayName="GEBCO Earth Elevation Coverage"};return n.prototype=Object.create(i.prototype),n}),i("globe/UsgsNedElevationCoverage",["../geom/Location","../geom/Sector","../globe/TiledElevationCoverage","../util/WmsUrlBuilder"],function(t,e,i,r){"use strict";var n=function(){i.call(this,{coverageSector:new e(24.396308,49.384358,-124.848974,-66.885444),resolution:92592592593e-15,retrievalImageFormat:"application/bil16",minElevation:-11e3,maxElevation:8850,urlBuilder:new r("https://worldwind26.arc.nasa.gov/elev","USGS-NED","","1.3.0")}),this.displayName="USGS NED Earth Elevation Coverage"};return n.prototype=Object.create(i.prototype),n}),i("globe/UsgsNedHiElevationCoverage",["../geom/Location","../geom/Sector","../globe/TiledElevationCoverage","../util/WmsUrlBuilder"],function(t,e,i,r){"use strict";var n=function(){i.call(this,{coverageSector:new e(18.86546,28.517269,-178.443593,-154.755792),resolution:92592592593e-15,retrievalImageFormat:"application/bil16",minElevation:-11e3,maxElevation:8850,urlBuilder:new r("https://worldwind26.arc.nasa.gov/elev","USGS-NED","","1.3.0")}),this.displayName="USGS NED Hawaii Elevation Coverage"};return n.prototype=Object.create(i.prototype),n}), 102i("globe/EarthElevationModel",["../globe/AsterV2ElevationCoverage","../globe/ElevationModel","../globe/GebcoElevationCoverage","../globe/UsgsNedElevationCoverage","../globe/UsgsNedHiElevationCoverage"],function(t,e,i,r,n){"use strict";var o=function(){e.call(this),this.addCoverage(new i),this.addCoverage(new t),this.addCoverage(new r),this.addCoverage(new n)};return o.prototype=Object.create(e.prototype),o}),i("globe/EarthRestElevationCoverage",["../util/LevelSet","../geom/Location","../geom/Sector","../util/LevelRowColumnUrlBuilder","../globe/TiledElevationCoverage"],function(t,e,i,r,n){"use strict";var o=function(o,s,a){n.call(this,{coverageSector:i.FULL_SPHERE,resolution:.00732421875,retrievalImageFormat:"application/bil16",minElevation:-11e3,maxElevation:8850,urlBuilder:new r(o,s)}),this.displayName=a||"Earth Elevations",this.levels=new t(i.FULL_SPHERE,new e(60,60),5,512,512)};return o.prototype=Object.create(n.prototype),o}),i("layer/FrameStatisticsLayer",["../error/ArgumentError","../util/Color","../util/Font","../layer/Layer","../util/Logger","../util/Offset","../shapes/ScreenText","../shapes/TextAttributes"],function(t,e,i,r,n,o,s,a){"use strict";var l=function(l){function h(t,e){c.handleRedraw(t,e)}if(!l)throw new t(n.logMessage(n.LEVEL_SEVERE,"FrameStatisticsLayer","constructor","missingWorldWindow"));r.call(this,"Frame Statistics"),this.pickEnabled=!1;var u=new a(null);u.color=e.GREEN,u.font=new i(12),u.offset=new o(WorldWind.OFFSET_FRACTION,0,WorldWind.OFFSET_FRACTION,1),this.frameTime=new s(new o(WorldWind.OFFSET_PIXELS,5,WorldWind.OFFSET_INSET_PIXELS,5)," "),this.frameTime.attributes=u,this.frameRate=new s(new o(WorldWind.OFFSET_PIXELS,5,WorldWind.OFFSET_INSET_PIXELS,25)," "),this.frameRate.attributes=u;var c=this;l.redrawCallbacks.push(h)};return l.prototype=Object.create(r.prototype),l.prototype.doRender=function(t){this.frameRate.render(t),this.frameTime.render(t),this.inCurrentFrame=!0},l.prototype.handleRedraw=function(t,e){if(e===WorldWind.BEFORE_REDRAW){var i=t.frameStatistics;this.frameTime.text="Frame time "+i.frameTimeAverage.toFixed(0)+" ms ("+i.frameTimeMin.toFixed(0)+" - "+i.frameTimeMax.toFixed(0)+")",this.frameRate.text="Frame rate "+i.frameRateAverage.toFixed(0)+" fps"}},l}),i("shapes/AbstractShape",["../error/ArgumentError","../util/Logger","../geom/Matrix","../cache/MemoryCache","../render/Renderable","../shapes/ShapeAttributes","../error/UnsupportedOperationError","../geom/Vec3"],function(t,e,i,r,n,o,s,a){"use strict";var l=function(t){n.call(this),this._attributes=t||new o(null),this._highlightAttributes=null,this.highlighted=!1,this._altitudeMode=WorldWind.ABSOLUTE,this.referencePosition=null,this.shapeDataCache=new r(3,2),this.currentData=null,this.activeAttributes=null,this.expirationInterval=2e3,this.useSurfaceShapeFor2D=!1,this.scratchMatrix=i.fromIdentity()};return l.prototype=Object.create(n.prototype),Object.defineProperties(l.prototype,{attributes:{get:function(){return this._attributes},set:function(t){this._attributes=t,this.surfaceShape&&(this.surfaceShape.attributes=this._attributes)}},highlightAttributes:{get:function(){return this._highlightAttributes},set:function(t){this._highlightAttributes=t,this.surfaceShape&&(this.surfaceShape.highlightAttributes=this._highlightAttributes)}},altitudeMode:{get:function(){return this._altitudeMode},set:function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"AbstractShape","altitudeMode","missingAltitudeMode"));this._altitudeMode=i,this.reset()}}}),l.prototype.reset=function(){this.shapeDataCache.clear(!1),this.surfaceShape=null},l.prototype.updateSurfaceShape=function(){this.surfaceShape.displayName=this.displayName,this.surfaceShape.highlighted=this.highlighted,this.surfaceShape.enabled=this.enabled,this.surfaceShape.pathType=this.pathType,this.surfaceShape.pickDelegate=this.pickDelegate?this.pickDelegate:this},l.prototype.createSurfaceShape=function(){return null},l.prototype.render=function(t){if(this.enabled&&t.accumulateOrderedRenderables){if(t.globe.
102is2D()&&this.useSurfaceShapeFor2D&&(this.surfaceShape||(this.surfaceShape=this.createSurfaceShape(),this.surfaceShape&&(this.surfaceShape.attributes=this._attributes,this.surfaceShape.highlightAttributes=this._highlightAttributes)),this.surfaceShape))return this.updateSurfaceShape(),void this.surfaceShape.render(t);if((t.terrain||this.altitudeMode==WorldWind.ABSOLUTE)&&(this.establishCurrentData(t),(!t.globe.projectionLimits||this.isWithinProjectionLimits(t))&&(!this.currentData.extent||this.intersectsFrustum(t))&&(this.determineActiveAttributes(t),this.activeAttributes))){var e=this.makeOrderedRenderable(t);if(e){if(!this.intersectsFrustum(t))return;if(t.isSmall(this.currentData.extent,1))return;e.layer=t.currentLayer,t.addOrderedRenderable(e,this.currentData.eyeDistance)}}}},l.prototype.renderOrdered=function(t){this.currentData=this.shapeDataCache.entryForKey(t.globeStateKey),this.beginDrawing(t);try{this.doRenderOrdered(t)}finally{this.endDrawing(t)}},l.prototype.makeOrderedRenderable=function(t){var e=this.doMakeOrderedRenderable(t);return this.currentData.verticalExaggeration=t.verticalExaggeration,e},l.prototype.doMakeOrderedRenderable=function(t){throw new s(e.logMessage(e.LEVEL_SEVERE,"AbstractShape","makeOrderedRenderable","abstractInvocation"))},l.prototype.doRenderOrdered=function(t){throw new s(e.logMessage(e.LEVEL_SEVERE,"AbstractShape","doRenderOrdered","abstractInvocation"))},l.prototype.beginDrawing=function(t){},l.prototype.endDrawing=function(t){},l.prototype.intersectsFrustum=function(t){return!this.currentData||!this.currentData.extent||(t.pickingMode?this.currentData.extent.intersectsFrustum(t.pickFrustum):this.currentData.extent.intersectsFrustum(t.frustumInModelCoordinates))},l.prototype.establishCurrentData=function(t){this.currentData=this.shapeDataCache.entryForKey(t.globeStateKey),this.currentData||(this.currentData=this.createShapeDataObject(),this.resetExpiration(this.currentData),this.shapeDataCache.putEntry(t.globeStateKey,this.currentData,1)),this.currentData.isExpired=!this.isShapeDataCurrent(t,this.currentData)},l.prototype.createShapeDataObject=function(){return{transformationMatrix:i.fromIdentity(),referencePoint:new a(0,0,0)}},l.prototype.resetExpiration=function(t){t.expiryTime=Date.now()+this.expirationInterval+1e3*Math.random()},l.prototype.isShapeDataCurrent=function(t,e){return e.verticalExaggeration===t.verticalExaggeration&&e.expiryTime>Date.now()},l.prototype.determineActiveAttributes=function(t){this.highlighted&&this._highlightAttributes?this.activeAttributes=this.highlightAttributes:this.activeAttributes=this._attributes},l.prototype.isWithinProjectionLimits=function(t){return!0},l.prototype.applyMvpMatrix=function(t){this.scratchMatrix.copy(t.modelviewProjection),this.scratchMatrix.multiplyMatrix(this.currentData.transformationMatrix),t.currentProgram.loadModelviewProjection(t.currentGlContext,this.scratchMatrix)},l.prototype.applyMvpMatrixForOutline=function(t){this.scratchMatrix.copy(t.projection),this.scratchMatrix.offsetProjectionDepth(-.001),this.scratchMatrix.multiplyMatrix(t.modelview),this.scratchMatrix.multiplyMatrix(this.currentData.transformationMatrix),t.currentProgram.loadModelviewProjection(t.currentGlContext,this.scratchMatrix)},l}),i("shapes/AbstractMesh",["../shapes/AbstractShape","../error/ArgumentError","../shaders/BasicTextureProgram","../geom/BoundingBox","../util/Color","../util/ImageSource","../geom/Line","../geom/Location","../util/Logger","../geom/Matrix","../pick/PickedObject","../geom/Position","../shapes/ShapeAttributes","../geom/Vec2","../geom/Vec3","../util/WWMath"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g){"use strict";var m=function(e){t.call(this,e),this.pickTransparentImagePixels=!0,this._altitudeScale=1};return m.prototype=Object.create(t.prototype),Object.defineProperties(m.prototype,{altitudeScale:{get:function(){return this._altitudeScale},set:function(t){this._altitudeScale=t,this.reset()}}}),m.prototype.mustGenerateGeometry=function(t){return!this.currentData.meshPoints||(this.currentData.drawInterior!==this.activeAttributes.drawInterior||(!(!this.activeAttributes.applyLighting||this.currentData.normals)||this.altitudeMode!==WorldWind.ABSOLUTE&&this.currentData.isExpired))},m.prototype.doMakeOrderedRenderable=function(t){if(!this.activeAttributes.drawInterior&&!this.activeAttributes.drawOutline)return null;if(!this.mustGenerateGeometry(t))return this;var e=this.currentData,i=e.referencePoint;return t.surfacePointForMode(this.referencePosition.latitude,this.referencePosition.longitude,this.referencePosition.altitude*this._altitudeScale,this._altitudeMode,i),e.transformationMatrix.setToTranslation(i[0],i[1],i[2]),e.meshPoints=this.computeMeshPoints(t,e),e.refreshVertexBuffer=!0,this.activeAttributes.imageSource&&!this.texCoords&&(this.texCoords=this.computeTexCoords(),this.texCoords&&(e.refreshTexCoordBuffer=!0)),this.meshIndices||(this.meshIndices=this.computeMeshIndices(),e.refreshMeshIndices=!0),this.meshOutlineIndices||(this.meshOutlineIndices=this.computeOutlineIndices(),this.meshOutlineIndices&&(e.refreshOutlineIndices=!0)),this.activeAttributes.applyLighting&&this.computeNormals(e),e.drawInterior=this.activeAttributes.drawInterior,this.resetExpiration(e),e.extent||(e.extent=new r),e.extent.setToPoints(e.meshPoints),e.extent.translate(e.referencePoint),this},m.prototype.computeMeshPoints=function(t,e){throw new UnsupportedOperationError(l.logMessage(l.LEVEL_SEVERE,"AbstractMesh","computeMeshPoints","abstractInvocation"))},m.prototype.computeTexCoords=function(){return null},m.prototype.computeMeshIndices=function(t){throw new UnsupportedOperationError(l.logMessage(l.LEVEL_SEVERE,"AbstractMesh","computeMeshIndices","abstractInvocation"))},m.prototype.computeOutlineIndices=function(t){},m.prototype.computeNormals=function(t){for(var e,i=new Float32Array(t.meshPoints.length),r=this.meshIndices,n=t.meshPoints,o=[],s=[new p(0,0,0),new p(0,0,0),new p(0,0,0)],a=0;a<r.length;a+=3){for(var l=0;l<3;l++)e=r[a+l],s[l].set(n[3*e],n[3*e+1],n[3*e+2]);var h=p.computeTriangleNormal(s[0],s[1],s[2]);for(l=0;l<3;l++)e=r[a+l],o[e]||(o[e]=[]),o[e].push(h)}for(h=new p(0,0,0),a=0;a<o.length;a++)o[a]?(p.average(o[a],h),h.normalize(),i[3*a]=h[0],i[3*a+1]=h[
1021],i[3*a+2]=h[2]):(i[3*a]=0,i[3*a+1]=0,i[3*a+2]=0);t.normals=i,t.refreshNormalsBuffer=!0},m.prototype.doRenderOrdered=function(t){var e,i,r,n=t.currentGlContext,o=t.currentProgram,s=this.currentData,a=this.texCoords&&!!this.activeAttributes.imageSource;if(t.pickingMode&&(r=t.uniquePickColor()),s.pointsVboCacheKey||(s.pointsVboCacheKey=t.gpuResourceCache.generateCacheKey()),e=t.gpuResourceCache.resourceForKey(s.pointsVboCacheKey),e||(e=n.createBuffer(),t.gpuResourceCache.putResource(s.pointsVboCacheKey,e,4*s.meshPoints.length),s.refreshVertexBuffer=!0),n.bindBuffer(n.ARRAY_BUFFER,e),s.refreshVertexBuffer&&(n.bufferData(n.ARRAY_BUFFER,s.meshPoints,n.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),s.refreshVertexBuffer=!1),n.vertexAttribPointer(o.vertexPointLocation,3,n.FLOAT,!1,0,0),o.loadTextureEnabled(n,!1),this.activeAttributes.drawInterior){var l=!t.pickingMode&&s.normals&&this.activeAttributes.applyLighting;this.applyMvpMatrix(t),s.meshIndicesVboCacheKey||(s.meshIndicesVboCacheKey=t.gpuResourceCache.generateCacheKey()),e=t.gpuResourceCache.resourceForKey(s.meshIndicesVboCacheKey),e||(e=n.createBuffer(),t.gpuResourceCache.putResource(s.meshIndicesVboCacheKey,e,2*this.meshIndices.length),s.refreshMeshIndices=!0),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e),s.refreshMeshIndices&&(n.bufferData(n.ELEMENT_ARRAY_BUFFER,this.meshIndices,n.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),s.refreshMeshIndices=!1),i=this.activeAttributes.interiorColor,n.depthMask(i.alpha*this.layer.opacity>=1||t.pickingMode),o.loadColor(n,t.pickingMode?r:i),o.loadOpacity(n,t.pickingMode?1:this.layer.opacity),!a||t.pickingMode&&this.pickTransparentImagePixels||(this.activeTexture=t.gpuResourceCache.resourceForKey(this.activeAttributes.imageSource),this.activeTexture||(this.activeTexture=t.gpuResourceCache.retrieveTexture(t.currentGlContext,this.activeAttributes.imageSource)),this.activeTexture&&this.activeTexture.bind(t)&&(s.texCoordsVboCacheKey||(s.texCoordsVboCacheKey=t.gpuResourceCache.generateCacheKey()),e=t.gpuResourceCache.resourceForKey(s.texCoordsVboCacheKey),e||(e=n.createBuffer(),t.gpuResourceCache.putResource(s.texCoordsVboCacheKey,e,4*this.texCoords.length),s.refreshTexCoordBuffer=!0),n.bindBuffer(n.ARRAY_BUFFER,e),s.refreshTexCoordBuffer&&(n.bufferData(n.ARRAY_BUFFER,this.texCoords,n.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),s.refreshTexCoordBuffer=!1),n.enableVertexAttribArray(o.vertexTexCoordLocation),n.vertexAttribPointer(o.vertexTexCoordLocation,2,n.FLOAT,!1,0,0),this.scratchMatrix.setToIdentity(),this.scratchMatrix.multiplyByTextureTransform(this.activeTexture),o.loadTextureEnabled(n,!0),o.loadTextureUnit(n,n.TEXTURE0),o.loadTextureMatrix(n,this.scratchMatrix),o.loadModulateColor(n,t.pickingMode))),l&&(o.loadApplyLighting(n,!0),s.normalsVboCacheKey||(s.normalsVboCacheKey=t.gpuResourceCache.generateCacheKey()),e=t.gpuResourceCache.resourceForKey(s.normalsVboCacheKey),e||(e=n.createBuffer(),t.gpuResourceCache.putResource(s.normalsVboCacheKey,e,4*s.normals.length),s.refreshNormalsBuffer=!0),n.bindBuffer(n.ARRAY_BUFFER,e),s.refreshNormalsBuffer&&(n.bufferData(n.ARRAY_BUFFER,s.normals,n.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),s.refreshNormalsBuffer=!1),n.enableVertexAttribArray(o.normalVectorLocation),n.vertexAttribPointer(o.normalVectorLocation,3,n.FLOAT,!1,0,0)),n.drawElements(n.TRIANGLES,this.meshIndices.length,n.UNSIGNED_SHORT,0),a&&n.disableVertexAttribArray(o.vertexTexCoordLocation),l&&(o.loadApplyLighting(n,!1),n.disableVertexAttribArray(o.normalVectorLocation))}if(this.activeAttributes.drawOutline&&this.meshOutlineIndices&&(o.loadTextureEnabled(n,!1),n.disableVertexAttribArray(o.vertexTexCoordLocation),this.applyMvpMatrixForOutline(t),i=this.activeAttributes.outlineColor,n.depthMask(i.alpha*this.layer.opacity>=1||t.pickingMode),o.loadColor(n,t.pickingMode?r:i),o.loadOpacity(n,t.pickingMode?1:this.layer.opacity),n.lineWidth(this.activeAttributes.outlineWidth),s.outlineIndicesVboCacheKey||(s.outlineIndicesVboCacheKey=t.gpuResourceCache.generateCacheKey()),e=t.gpuResourceCache.resourceForKey(s.outlineIndicesVboCacheKey),e||(e=n.createBuffer(),t.gpuResourceCache.putResource(s.outlineIndicesVboCacheKey,e,2*this.meshOutlineIndices.length),s.refreshOutlineIndices=!0),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,e),s.refreshOutlineIndices&&(n.bufferData(n.ELEMENT_ARRAY_BUFFER,this.meshOutlineIndices,n.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),s.refreshOutlineIndices=!1),n.drawElements(n.LINE_STRIP,this.meshOutlineIndices.length,n.UNSIGNED_SHORT,0)),t.pickingMode){var h=this.computePickPosition(t),c=new u(r,this.pickDelegate?this.pickDelegate:this,h,this.layer,!1);t.resolvePick(c)}},m.prototype.computePickPosition=function(t){var e=this.currentData,i=t.pickRay,r=new p(i.origin[0],i.origin[1],i.origin[2]).subtract(e.referencePoint),n=new s(r,i.direction),o=[];if(g.computeIndexedTrianglesIntersection(n,e.meshPoints,this.meshIndices,o)){var a=o[0];if(o.length>1)for(var l=a.distanceToSquared(t.eyePoint),h=1;h<o.length;h++){var u=o[h].distanceToSquared(t.eyePoint);u<l&&(l=u,a=o[h])}var d=new c(0,0,0);return t.globe.computePositionFromPoint(a[0]+e.referencePoint[0],a[1]+e.referencePoint[1],a[2]+e.referencePoint[2],d),d.altitude/=this._altitudeScale,d}return null},m.prototype.beginDrawing=function(t){var e=t.currentGlContext;if(this.activeAttributes.drawInterior){e.disable(e.CULL_FACE),t.findAndBindProgram(i);!t.pickMode&&this.currentData.normals&&this.activeAttributes.applyLighting&&t.currentProgram.loadModelviewInverse(e,t.modelviewNormalTransform)}e.enableVertexAttribArray(t.currentProgram.vertexPointLocation)},m.prototype.endDrawing=function(t){var e=t.currentGlContext;e.disableVertexAttribArray(t.currentProgram.vertexPointLocation),e.depthMask(!0),e.lineWidth(1),e.enable(e.CULL_FACE)},m}),i("shapes/SurfacePolygon",["../error/ArgumentError","../util/Logger","../shapes/ShapeAttributes","../shapes/SurfaceShape"],function(t,e,
102i,r){"use strict";var n=function(i,o){if(!Array.isArray(i))throw new t(e.logMessage(e.LEVEL_SEVERE,"SurfacePolygon","constructor","The specified boundary is not an array."));r.call(this,o),this._boundaries=i,this._stateId=n.stateId++};return n.prototype=Object.create(r.prototype),Object.defineProperties(n.prototype,{boundaries:{get:function(){return this._boundaries},set:function(i){if(!Array.isArray(i))throw new t(e.logMessage(e.LEVEL_SEVERE,"SurfacePolygon","set boundaries","The specified value is not an array."));this.resetBoundaries(),this._boundaries=i,this._stateId=n.stateId++,this.stateKeyInvalid=!0}}}),n.stateId=Number.MIN_SAFE_INTEGER,n.staticStateKey=function(t){return r.staticStateKey(t)+" pg "+t._stateId},n.prototype.computeStateKey=function(){return n.staticStateKey(this)},n.prototype.computeBoundaries=function(t){},n.prototype.getReferencePosition=function(){return this.boundaries.length>0&&this.boundaries[0].length>2?this.boundaries[0][0]:this.boundaries.length>2?this.boundaries[0]:null},n.prototype.moveTo=function(t,e){if(this.boundaries.length>0&&this.boundaries[0].length>2){for(var i=[],r=0,n=this._boundaries.length;r<n;r++){var o=this.computeShiftedLocations(t,this.getReferencePosition(),e,this._boundaries[r]);i.push(o)}this.boundaries=i}else this.boundaries.length>2&&(this.boundaries=this.computeShiftedLocations(t,this.getReferencePosition(),e,this._boundaries))},n}),i("shapes/GeographicMesh",["../shapes/AbstractMesh","../error/ArgumentError","../shaders/BasicTextureProgram","../geom/BoundingBox","../util/Color","../util/ImageSource","../geom/Location","../util/Logger","../geom/Matrix","../pick/PickedObject","../geom/Position","../shapes/ShapeAttributes","../shapes/SurfacePolygon","../geom/Vec2","../geom/Vec3"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p){"use strict";var g=function(i,r){if(!i)throw new e(a.logMessage(a.LEVEL_SEVERE,"GeographicMesh","constructor","missingPositions"));if(i.length<2||i[0].length<2)throw new e(a.logMessage(a.LEVEL_SEVERE,"GeographicMesh","constructor","Number of positions is insufficient."));if(i.length*i[0].length>65536)throw new e(a.logMessage(a.LEVEL_SEVERE,"GeographicMesh","constructor","Too many positions. Must be fewer than 65536. Try using multiple meshes."));for(var n=i[0].length,o=1;o<i.length;o++)if(i[o].length!==n)throw new e(a.logMessage(a.LEVEL_SEVERE,"GeographicMesh","constructor","Array lengths are inconsistent."));var s=i.length,l=i[0].length;t.call(this,r),this.pickTransparentImagePixels=!0,this._positions=i,this._altitudeScale=1,this.numRows=s,this.numColumns=l,this._textureCoordinates=null,this.referencePosition=this.determineReferencePosition(this._positions)};return g.prototype=Object.create(t.prototype),Object.defineProperties(g.prototype,{positions:{get:function(){return this._positions},set:function(t){if(!t)throw new e(a.logMessage(a.LEVEL_SEVERE,"GeographicMesh","positions","missingPositions"));if(t.length<2||t[0].length<2)throw new e(a.logMessage(a.LEVEL_SEVERE,"GeographicMesh","positions","Number of positions is insufficient."));for(var i=t[0].length,r=1;r<t.length;r++)if(t[r].length!==i)throw new e(a.logMessage(a.LEVEL_SEVERE,"GeographicMesh","positions","Array lengths are inconsistent."));this.numRows=t.length,this.numColumns=t[0].length,this._positions=t,this.referencePosition=this.determineReferencePosition(this._positions),this.reset(),this.meshIndices=null,this.outlineIndices=null}},textureCoordinates:{get:function(){return this._textureCoordinates},set:function(t){if(t&&t.length!=this.numRows)throw new e(a.logMessage(a.LEVEL_SEVERE,"GeographicMesh","textureCoordinates","Number of texture coordinate rows is inconsistent with the currently specified positions."));for(var i=0;i<this.numRows;i++)if(t[i].length!==this.numColumns)throw new e(a.logMessage(a.LEVEL_SEVERE,"GeographicMesh","textureCoordinates","Texture coordinate row lengths are inconsistent with the currently specified positions."));this._textureCoordinates=t,this.reset(),this.texCoords=null}}}),g.makeGridIndices=function(t,e){for(var i=[],r=0,n=0;n<t-1;n++)for(var o=0;o<e-1;o++){var s=n*e+o;i[r++]=s,i[r++]=s+1,i[r++]=s+e,i[r++]=s+1,i[r++]=s+1+e,i[r++]=s+e}return i},g.prototype.determineReferencePosition=function(t){return t[0][0]},g.prototype.createSurfaceShape=function(){for(var t=[],e=0;e<this.numColumns;e++)t.push(this._positions[0][e]);for(var i=1;i<this.numRows;i++)t.push(this._positions[i][this.numColumns-1]);for(e=this.numColumns-2;e>=0;e--)t.push(this._positions[this.numRows-1][e]);for(i=this.numRows-2;i>0;i--)t.push(this._positions[i][0]);return new d(t,null)},g.prototype.computeMeshPoints=function(t,e){for(var i,r,n=Number.MAX_VALUE,o=t.eyePoint,
102s=new Float32Array(this.numRows*this.numColumns*3),a=new p(0,0,0),l=0,h=0;h<this._positions.length;h++)for(var u=0,c=this._positions[h].length;u<c;u++)i=this._positions[h][u],t.surfacePointForMode(i.latitude,i.longitude,i.altitude*this._altitudeScale,this.altitudeMode,a),r=a.distanceToSquared(o),r<n&&(n=r),a.subtract(this.currentData.referencePoint),s[l++]=a[0],s[l++]=a[1],s[l++]=a[2];return e.eyeDistance=Math.sqrt(n),s},g.prototype.computeTexCoords=function(){return this._textureCoordinates?this.computeExplicitTexCoords():this.computeImplicitTexCoords()},g.prototype.computeExplicitTexCoords=function(){for(var t=new Float32Array(2*this.numRows*this.numColumns),e=0,i=0;i<this._textureCoordinates.length;i++)for(var r=0,n=this._textureCoordinates[i].length;r<n;r++){var o=this._textureCoordinates[i][r];t[e++]=o[0],t[e++]=o[1]}return t},g.prototype.computeImplicitTexCoords=function(){for(var t=new Float32Array(2*this.numRows*this.numColumns),e=1/(this.numRows-1),i=1/(this.numColumns-1),r=0,n=0;n<this._positions.length;n++)for(var o=n===this.numRows-1?1:n*e,s=0,a=this._positions[n].length;s<a;s++)t[r++]=s===this.numColumns-1?1:s*i,t[r++]=o;return t},g.prototype.computeMeshIndices=function(){for(var t=new Uint16Array((this.numRows-1)*(this.numColumns-1)*6),e=0,i=0;i<this.numRows-1;i++)for(var r=0;r<this.numColumns-1;r++){var n=i*this.numColumns+r;t[e++]=n,t[e++]=n+1,t[e++]=n+this.numColumns,t[e++]=n+1,t[e++]=n+1+this.numColumns,t[e++]=n+this.numColumns}return t},g.prototype.computeOutlineIndices=function(){for(var t=new Uint16Array(2*this.numRows+2*this.numColumns),e=0,i=0;i<this.numColumns;i++)t[e++]=i;for(var r=1;r<this.numRows;r++)t[e++]=(r+1)*this.numColumns-1;for(i=this.numRows*this.numColumns-2;i>=(this.numRows-1)*this.numColumns;i--)t[e++]=i;for(r=this.numRows-2;r>=0;r--)t[e++]=r*this.numColumns;return t},g}),i("shapes/GeographicText",["../error/ArgumentError","../util/Logger","../shapes/Text","../geom/Vec3"],function(t,e,i,r){"use strict";var n=function(r,n){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"Text","constructor","missingPosition"));i.call(this,n),this.position=r,this.declutterGroup=1};return n.placePoint=new r(0,0,0),n.prototype=Object.create(i.prototype),n.prototype.clone=function(){var t=new n(this.position,this.text);return t.copy(this),t.pickDelegate=this.pickDelegate?this.pickDelegate:this,t},n.prototype.render=function(t){t.globe.projectionLimits&&!t.globe.projectionLimits.containsLocation(this.position.latitude,this.position.longitude)||i.prototype.render.call(this,t)},n.prototype.computeScreenPointAndEyeDistance=function(t){return t.surfacePointForMode(this.position.latitude,this.position.longitude,this.position.altitude,this.altitudeMode,n.placePoint),!!t.frustumInModelCoordinates.containsPoint(n.placePoint)&&(this.eyeDistance=this.alwaysOnTop?0:t.eyePoint.distanceTo(n.placePoint),!!t.projectWithDepth(n.placePoint,this.depthOffset,this.screenPoint))},n}),i("formats/geojson/GeoJSONConstants",[],function(){"use strict";var t=function(){};return t.FIELD_TYPE="type",t.FIELD_CRS="crs",t.FIELD_NAME="name",t.FIELD_BBOX="bbox",t.FIELD_COORDINATES="coordinates",t.FIELD_GEOMETRIES="geometries",t.FIELD_GEOMETRY="geometry",t.FIELD_PROPERTIES="properties",t.FIELD_FEATURES="features",t.FIELD_ID="id",t.TYPE_POINT="Point",t.TYPE_MULTI_POINT="MultiPoint",t.TYPE_LINE_STRING="LineString",t.TYPE_MULTI_LINE_STRING="MultiLineString",t.TYPE_POLYGON="Polygon",t.TYPE_MULTI_POLYGON="MultiPolygon",t.TYPE_GEOMETRY_COLLECTION="GeometryCollection",t.TYPE_FEATURE="Feature",t.TYPE_FEATURE_COLLECTION="FeatureCollection",t.FIELD_CRS_NAME="name",t.FIELD_CRS_LINK="link",t.WGS84_CRS="urn:ogc:def:crs:OGC:1.3:CRS84",t.EPSG4326_CRS="EPSG:4326",t}),i("formats/geojson/GeoJSONExporter",["../../error/ArgumentError","./GeoJSONConstants","../../util/Logger"],function(t,e,i){"use strict";return{exportRenderable:function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportRenderable","missingRenderable"));return e instanceof WorldWind.Placemark?this.exportPlacemark(e):e instanceof WorldWind.SurfacePolyline?this.exportSurfacePolyline(e):e instanceof WorldWind.SurfacePolygon?this.exportSurfacePolygon(e):e instanceof WorldWind.SurfaceEllipse?this.exportSurfaceEllipse(e):e instanceof WorldWind.SurfaceCircle?this.exportSurfaceCircle(e):e instanceof WorldWind.SurfaceRectangle?this.exportSurfaceRectangle(e):e instanceof WorldWind.SurfaceSector?this.exportSurfaceSector(e):e instanceof WorldWind.Path?this.exportPath(e):e instanceof WorldWind.Polygon?this.exportPolygon(e):(i.log(i.LEVEL_WARNING,"Export renderable not implemented: "+e),null)},exportRenderables:function(r){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportRenderables","missingRenderables"));if(0!=r.length){if(r.length>1){var n="{";n=n+'"'+e.FIELD_TYPE+'":"'+e.TYPE_GEOMETRY_COLLECTION+'"',n=n+',"'+e.FIELD_GEOMETRIES+'":[';for(var o=0;o<r.length;o++){var s=this.exportRenderable(r[o]);s&&(n+=s,n+=",")}return","===n.slice(-1)&&(n=n.substring(0,n.length-1)),n+="]",n+="}"}return this.exportRenderable(r[0])}},exportLayer:function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportLayer","missingLayer"));return this.exportRenderables(e.renderables)},exportPlacemark:function(r){if(!(r instanceof WorldWind.Placemark))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportPlacemark","invali
102dTypeOfRenderable"));var n="{";return n=n+'"'+e.FIELD_TYPE+'":"'+e.TYPE_POINT+'",',n=n+'"'+e.FIELD_COORDINATES+'":',n=n+"["+r.position.longitude+","+r.position.latitude+"]",n+="}"},exportSurfacePolyline:function(r){if(!(r instanceof WorldWind.SurfacePolyline))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportSurfacePolyline","invalidTypeOfRenderable"));var n="{";n=n+'"'+e.FIELD_TYPE+'":"'+e.TYPE_LINE_STRING+'",',n=n+'"'+e.FIELD_COORDINATES+'":[';for(var o=0;o<r.boundaries.length;o++)n=n+"["+r.boundaries[o].longitude+","+r.boundaries[o].latitude+"]",o!==r.boundaries.length-1&&(n+=",");return n+="]",n+="}"},exportSurfacePolygon:function(r){if(!(r instanceof WorldWind.SurfacePolygon))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportSurfacePolygon","invalidTypeOfRenderable"));var n="{";if(n=n+'"'+e.FIELD_TYPE+'":"'+e.TYPE_POLYGON+'",',n=n+'"'+e.FIELD_COORDINATES+'":[',r.boundaries.length>0&&r.boundaries[0].length>2)for(var o=0;o<r.boundaries.length;o++){n+="[";for(var s=0;s<r.boundaries[o].length;s++)n=n+"["+r.boundaries[o][s].longitude+","+r.boundaries[o][s].latitude+"]",n+=",",s===r.boundaries[o].length-1&&(n=n+"["+r.boundaries[o][0].longitude+","+r.boundaries[o][0].latitude+"]");n+="]",o!==r.boundaries.length-1&&(n+=",")}else{n+="[";for(var o=0;o<r.boundaries.length;o++)n=n+"["+r.boundaries[o].longitude+","+r.boundaries[o].latitude+"]",n+=",",o===r.boundaries.length-1&&(n=n+"["+r.boundaries[0].longitude+","+r.boundaries[0].latitude+"]");n+="]"}return n+="]",n+="}"},exportSurfaceEllipse:function(r){if(!(r instanceof WorldWind.SurfaceEllipse))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportSurfaceEllipse","invalidTypeOfRenderable"));var n="{";n=n+'"'+e.FIELD_TYPE+'":"'+e.TYPE_POLYGON+'",',n=n+'"'+e.FIELD_COORDINATES+'":[',n+="[";for(var o=0;o<r._boundaries.length;o++)n=n+"["+r._boundaries[o].longitude+","+r._boundaries[o].latitude+"]",n+=",",o===r._boundaries.length-1&&(n=n+"["+r._boundaries[0].longitude+","+r._boundaries[0].latitude+"]");return n+="]",n+="]",n+="}"},exportSurfaceCircle:function(r){if(!(r instanceof WorldWind.SurfaceCircle))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportSurfaceCircle","invalidTypeOfRenderable"));var n="{";n=n+'"'+e.FIELD_TYPE+'":"'+e.TYPE_POLYGON+'",',n=n+'"'+e.FIELD_COORDINATES+'":[',n+="[";for(var o=r._boundaries.length-1;o>=0;o--)n=n+"["+r._boundaries[o].longitude+","+r._boundaries[o].latitude+"]",n+=",",0===o&&(n=n+"["+r._boundaries[r._boundaries.length-1].longitude+","+r._boundaries[r._boundaries.length-1].latitude+"]");return n+="]",n+="]",n+="}"},exportSurfaceRectangle:function(r){if(!(r instanceof WorldWind.SurfaceRectangle))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportSurfaceRectangle","invalidTypeOfRenderable"));var n="{";n=n+'"'+e.FIELD_TYPE+'":"'+e.TYPE_POLYGON+'",',n=n+'"'+e.FIELD_COORDINATES+'":[',n+="[";for(var o=0;o<r._boundaries.length;o++)n=n+"["+r._boundaries[o].longitude+","+r._boundaries[o].latitude+"]",n+=",",o===r._boundaries.length-1&&(n=n+"["+r._boundaries[0].longitude+","+r._boundaries[0].latitude+"]");return n+="]",n+="]",n+="}"},exportSurfaceSector:function(r){if(!(r instanceof WorldWind.SurfaceSector))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportSurfaceSector","invalidTypeOfRenderable"));var n="{";n=n+'"'+e.FIELD_TYPE+'":"'+e.TYPE_POLYGON+'",',n=n+'"'+e.FIELD_COORDINATES+'":[',n+="[",r._boundaries.reverse();for(var o=0;o<r._boundaries.length;o++)n=n+"["+r._boundaries[o].longitude+","+r._boundaries[o].latitude+"]",n+=",",o===r._boundaries.length-1&&(n=n+"["+r._boundaries[0].longitude+","+r._boundaries[0].latitude+"]");return n+="]",n+="]",n+="}"},exportPath:function(r){if(!(r instanceof WorldWind.Path))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportPath","invalidTypeOfRenderable"));var n="{";n=n+'"'+e.FIELD_TYPE+'":"'+e.TYPE_LINE_STRING+'",',n=n+'"'+e.FIELD_COORDINATES+'":[';for(var o=0;o<r.positions.length;o++)n=n+"["+r.positions[o].longitude+","+r.positions[o].latitude+","+r.positions[o].altitude+"]",o!==r.positions.length-1&&(n+=",");return n+="]",n+="}"},exportPolygon:function(r){if(!(r instanceof WorldWind.Polygon))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONExporter","exportPolygon","invali
102dTypeOfRenderable"));var n="{";if(n=n+'"'+e.FIELD_TYPE+'":"'+e.TYPE_POLYGON+'",',n=n+'"'+e.FIELD_COORDINATES+'":[',r.boundaries.length>0&&r.boundaries[0].length>2)for(var o=0;o<r.boundaries.length;o++){n+="[";for(var s=0;s<r.boundaries[o].length;s++)n=n+"["+r.boundaries[o][s].longitude+","+r.boundaries[o][s].latitude+","+r.boundaries[o][s].altitude+"]",n+=",",s===r.boundaries[o].length-1&&(n=n+"["+r.boundaries[o][0].longitude+","+r.boundaries[o][0].latitude+","+r.boundaries[o][0].altitude+"]");n+="]",o!==r.boundaries.length-1&&(n+=",")}else{n+="[";for(var o=0;o<r.boundaries.length;o++)n=n+"["+r.boundaries[o].longitude+","+r.boundaries[o].latitude+","+r.boundaries[o].altitude+"]",n+=",",o===r.boundaries.length-1&&(n=n+"["+r.boundaries[0].longitude+","+r.boundaries[0].latitude+","+r.boundaries[0].altitude+"]");n+="]"}return n+="]",n+="}"}}}),i("formats/geojson/GeoJSONGeometry",["../../error/ArgumentError","./GeoJSONConstants","../../util/Logger"],function(t,e,i){"use strict";var r=function(e,r,n){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometry","constructor","missingCoordinates"));if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometry","constructor","missingType"));this._coordinates=e,this._type=r,this._bbox=n||null};return Object.defineProperties(r.prototype,{coordinates:{get:function(){return this._coordinates}},type:{get:function(){return this._type}},bbox:{get:function(){return this._bbox}}}), 103r.prototype.isPointType=function(){return this.type===e.TYPE_POINT},r.prototype.isMultiPointType=function(){return this.type===e.TYPE_MULTI_POINT},r.prototype.isLineStringType=function(){return this.type===e.TYPE_LINE_STRING},r.prototype.isMultiLineStringType=function(){return this.type===e.TYPE_MULTI_LINE_STRING},r.prototype.isPolygonType=function(){return this.type===e.TYPE_POLYGON},r.prototype.isMultiPolygonType=function(){return this.type===e.TYPE_MULTI_POLYGON},r}),i("formats/geojson/GeoJSONGeometryCollection",["../../error/ArgumentError","./GeoJSONConstants","../../util/Logger"],function(t,e,i){"use strict";var r=function(e,r){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryCollection","constructor","missingGeometries"));if("[object Array]"!==Object.prototype.toString.call(e))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryCollection","constructor","invalidGeometries"));this._geometries=e,this._bbox=r};return Object.defineProperties(r.prototype,{geometries:{get:function(){return this._geometries}},bbox:{get:function(){return this._bbox}}}),r}),i("formats/geojson/GeoJSONGeometryLineString",["../../error/ArgumentError","./GeoJSONGeometry","../../util/Logger"],function(t,e,i){"use strict";var r=function(r,n,o){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryLineString","constructor","missingCoordinates"));if(r.length<2||r[0].length<2)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryLineString","constructor","invalidNumberOfCoordinates"));if("[object Array]"!==Object.prototype.toString.call(r[0])||"[object Number]"!==Object.prototype.toString.call(r[0][0]))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryLineString","constructor","invalidCoordinatesType"));if(!n)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryLineString","constructor","missingType"));e.call(this,r,n,o)};return r.prototype=Object.create(e.prototype),r}),i("formats/geojson/GeoJSONGeometryMultiLineString",["../../error/ArgumentError","./GeoJSONGeometry","../../util/Logger"],function(t,e,i){"use strict";var r=function(r,n,o){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryMultiLineString","constructor","missingCoordinates"));if(r[0].length<2||r[0][0].length<2)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryMultiLineString","constructor","invalidNumberOfCoordinates"));if("[object Array]"!==Object.prototype.toString.call(r[0])||"[object Array]"!==Object.prototype.toString.call(r[0][0])||"[object Number]"!==Object.prototype.toString.call(r[0][0][0]))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryMultiLineString","constructor","invalidCoordinatesType"));if(!n)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryLineString","constructor","missingType"));e.call(this,r,n,o)};return r.prototype=Object.create(e.prototype),r}),i("formats/geojson/GeoJSONGeometryMultiPoint",["../../error/ArgumentError","./GeoJSONGeometry","../../util/Logger"],function(t,e,
103i){"use strict";var r=function(r,n,o){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryMultiPoint","constructor","missingCoordinates"));if(r[0].length<2)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryMultiPoint","constructor","invalidNumberOfCoordinates"));if("[object Array]"!==Object.prototype.toString.call(r[0])||"[object Number]"!==Object.prototype.toString.call(r[0][0]))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryMultiPoint","constructor","invalidCoordinatesType"));if(!n)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPoint","constructor","missingType"));e.call(this,r,n,o)};return r.prototype=Object.create(e.prototype),r}),i("formats/geojson/GeoJSONGeometryMultiPolygon",["../../error/ArgumentError","./GeoJSONGeometry","../../util/Logger"],function(t,e,i){"use strict";var r=function(r,n,o){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryMultiPolygon","constructor","missingCoordinates"));if("[object Array]"!==Object.prototype.toString.call(r[0])||"[object Array]"!==Object.prototype.toString.call(r[0][0])||"[object Array]"!==Object.prototype.toString.call(r[0][0][0])||"[object Number]"!==Object.prototype.toString.call(r[0][0][0][0]))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPolygon","constructor","invalidCoordinatesType"));if(!n)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPolygon","constructor","missingType"));e.call(this,r,n,o)};return r.prototype=Object.create(e.prototype),r}),i("formats/geojson/GeoJSONGeometryPoint",["../../error/ArgumentError","./GeoJSONGeometry","../../util/Logger"],function(t,e,i){"use strict";var r=function(r,n,o){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPoint","constructor","missingCoordinates"));if(r.length<2)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPoint","constructor","invalidNumberOfCoordinates"));if("[object Array]"!==Object.prototype.toString.call(r)||"[object Number]"!==Object.prototype.toString.call(r[0]))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPoint","constructor","invalidCoordinatesType"));if(!n)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPoint","constructor","missingType"));e.call(this,r,n,o)};return r.prototype=Object.create(e.prototype),r}),i("formats/geojson/GeoJSONGeometryPolygon",["../../error/ArgumentError","./GeoJSONGeometry","../../util/Logger"],function(t,e,i){"use strict";var r=function(r,n,o){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPolygon","constructor","missingCoordinates"));if(r[0].length<2||r[0][0].length<2)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPolygon","constructor","invalidNumberOfCoordinates"));if("[object Array]"!==Object.prototype.toString.call(r[0])||"[object Array]"!==Object.prototype.toString.call(r[0][0])||"[object Number]"!==Object.prototype.toString.call(r[0][0][0]))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPolygon","constructor","invalidCoordinatesType"));for(var s=0;s<r.length;s++)if(r[s][0][0]!==r[s][r[s].length-1][0]||r[s][0][1]!==r[s][r[s].length-1][1])throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPolygon","constructor","invalidLinearRing"));if(!n)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONGeometryPolygon","constructor","missingType"));e.call(this,r,n,o)};return r.prototype=Object.create(e.prototype),r}),i("formats/geojson/GeoJSONCRS",["../../error/ArgumentError","./GeoJSONConstants","../../util/Logger","../../util/proj4-src"],function(t,e,i,r){"use strict";var n=function(e,r){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONCRS","constructor","missingType"));if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONCRS","constructor","missingProperties"));this._type=e,this._properties=r,this._projectionString=null};return Object.defineProperties(n.prototype,{type:{get:function(){return this._type}},properties:{get:function(){return this._properties}},projectionString:{get:function(){return this._projectionString}}}),n.prototype.isDefault=function(){return!(!this.isNamed()||this._projectionString!==e.EPSG4326_CRS&&this._projectionString!==e.WGS84_CRS)},n.prototype.isNamed=function(){return this._type===e.FIELD_CRS_NAME},n.prototype.isLinked=function(){return this._type===e.FIELD_CRS_LINK},n.prototype.isCRSSupported=function(){try{r(this._projectionString,e.EPSG4326_CRS)}catch(t){return i.log(i.LEVEL_WARNING,"Unknown GeoJSON coordinate reference system ("+t+"): "+this._properties.name),!1}return!0},n.prototype.getLinkedCRSString=function(t,e){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="text",r.onreadystatechange=function(){4===r.readyState&&(200===r.
103status?(this._projectionString=r.response,e()):i.log(i.LEVEL_WARNING,"GeoJSON Linked CRS retrieval failed ("+r.statusText+"): "+t))}.bind(this),r.onerror=function(){i.log(i.LEVEL_WARNING,"GeoJSON Linked CRS retrieval failed: "+t)},r.ontimeout=function(){i.log(i.LEVEL_WARNING,"GeoJSON Linked CRS retrieval timed out: "+t)},r.send(null)},n.prototype.setCRSString=function(t){this.isNamed()?(this._projectionString=this._properties.name,t()):this.isLinked()&&this.getLinkedCRSString(this._properties.href,t)},n}),i("formats/geojson/GeoJSONFeature",["../../error/ArgumentError","./GeoJSONConstants","../../util/Logger"],function(t,e,i){"use strict";var r=function(r,n,o,s){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONFeature","constructor","missingGeometry"));if(!r[e.FIELD_TYPE])throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONFeature","constructor","missingFeatureGeometryType"));if(!n)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONFeature","constructor","missingProperties"));this._geometry=r,this._properties=n,this._id=o,this._bbox=s};return Object.defineProperties(r.prototype,{geometry:{get:function(){return this._geometry}},properties:{get:function(){return this._properties}},id:{get:function(){return this._id}},bbox:{get:function(){return this._bbox}}}),r}),i("formats/geojson/GeoJSONFeatureCollection",["../../error/ArgumentError","./GeoJSONConstants","../../util/Logger"],function(t,e,i){"use strict";var r=function(e,r){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONFeatureCollection","constructor","missingFeatures"));if("[object Array]"!==Object.prototype.toString.call(e))throw new t(i.logMessage(i.LEVEL_SEVERE,"GeoJSONFeatureCollection","constructor","invalidFeatures"));this._features=e,this._bbox=r};return Object.defineProperties(r.prototype,{features:{get:function(){return this._features}},bbox:{get:function(){return this._bbox}}}),r}),i("shapes/PlacemarkAttributes",["../util/Color","../util/Font","../util/Offset","../shapes/ShapeAttributes","../shapes/TextAttributes"],function(t,e,i,r,n){"use strict";var o=function(e){this._imageColor=e?e._imageColor.clone():t.WHITE.clone(),this._imageOffset=e?e._imageOffset:new i(WorldWind.OFFSET_FRACTION,.5,WorldWind.OFFSET_FRACTION,.5),this._imageScale=e?e._imageScale:1,this._imageSource=e?e._imageSource:null,this._depthTest=!e||e._depthTest,this._labelAttributes=e?e._labelAttributes:new n(null),this._drawLeaderLine=!!e&&e._drawLeaderLine,this._leaderLineAttributes=e?e._leaderLineAttributes:new r(null),this.stateKeyInvalid=!0};return o.prototype.computeStateKey=function(){return"ic "+this._imageColor.toHexString(!0)+" io "+this._imageOffset.toString()+" is "+this._imageScale+" ip "+this._imageSource+" dt "+this._depthTest+" la "+this._labelAttributes.stateKey+" dll "+this._drawLeaderLine+" lla "+this._leaderLineAttributes.stateKey},Object.defineProperties(o.prototype,{stateKey:{get:function(){return this.stateKeyInvalid&&(this._stateKey=this.computeStateKey(),this.stateKeyInvalid=!1),this._stateKey}},imageColor:{get:function(){return this._imageColor},set:function(t){this._imageColor=t,this.stateKeyInvalid=!0}},imageOffset:{get:function(){return this._imageOffset},set:function(t){this._imageOffset=t,this.stateKeyInvalid=!0}},imageScale:{get:function(){return this._imageScale},set:function(t){this._imageScale=t,this.stateKeyInvalid=!0}},imageSource:{get:function(){return this._imageSource},set:function(t){this._imageSource=t,this.stateKeyInvalid=!0}},depthTest:{get:function(){return this._depthTest},set:function(t){this._depthTest=t,this.stateKeyInvalid=!0}},labelAttributes:{get:function(){return this._labelAttributes},set:function(t){this._labelAttributes=t,this.stateKeyInvalid=!0}},drawLeaderLine:{get:function(){return this._drawLeaderLine},set:function(t){this._drawLeaderLine=t,this.stateKeyInvalid=!0}},leaderLineAttributes:{get:function(){return this._leaderLineAttributes},set:function(t){this._leaderLineAttributes=t,this.stateKeyInvalid=!0}}}),o}),i("shapes/Placemark",["../error/ArgumentError","../shaders/BasicTextureProgram","../util/Color","../util/Font","../util/Logger","../geom/Matrix","../pick/PickedObject","../shapes/PlacemarkAttributes","../render/Renderable","../geom/Vec2","../geom/Vec3","../util/WWMath"],function(t,e,
103i,r,n,o,s,a,l,h,u,c){"use strict";var d=function(e,i,r){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"Placemark","constructor","missingPosition"));l.call(this),this.attributes=r||new a(null),this.highlightAttributes=null,this.highlighted=!1,this.position=e,this.eyeDistanceScaling=i,this.eyeDistanceScalingThreshold=1e6,this.eyeDistanceScalingLabelThreshold=1.5*this.eyeDistanceScalingThreshold,this.label=null,this.altitudeMode=WorldWind.ABSOLUTE,this.alwaysOnTop=!1,this.enableLeaderLinePicking=!1,this.updateImage=!0,this.declutterGroup=2,this.targetVisibility=1,this.currentVisibility=1,this.imageRotation=0,this.imageTilt=0,this.imageRotationReference=WorldWind.RELATIVE_TO_SCREEN,this.imageTiltReference=WorldWind.RELATIVE_TO_SCREEN,this.activeAttributes=null,this.activeTexture=null,this.labelTexture=null,this.placePoint=new u(0,0,0),this.groundPoint=new u(0,0,0),this.imageTransform=o.fromIdentity(),this.labelTransform=o.fromIdentity(),this.texCoordMatrix=o.fromIdentity(),this.imageBounds=null,this.layer=null,this.depthOffset=-.003};return d.screenPoint=new u(0,0,0),d.matrix=o.fromIdentity(),d.scratchPoint=new u(0,0,0),d.prototype=Object.create(l.prototype),Object.defineProperties(d.prototype,{screenBounds:{get:function(){return this.labelBounds}}}),d.prototype.copy=function(t){return this.position=t.position,this.attributes=t.attributes,this.highlightAttributes=t.highlightAttributes,this.highlighted=t.highlighted,this.enabled=t.enabled,this.label=t.label,this.altitudeMode=t.altitudeMode,this.pickDelegate=t.pickDelegate,this.alwaysOnTop=t.alwaysOnTop,this.depthOffset=t.depthOffset,this.targetVisibility=t.targetVisibility,this.currentVisibility=t.currentVisibility,this.imageRotation=t.imageRotation,this.imageTilt=t.imageTilt,this.imageRotationReference=t.imageRotationReference,this.imageTiltReference=t.imageTiltReference,this},d.prototype.clone=function(){var t=new d(this.position);return t.copy(this),t.pickDelegate=this.pickDelegate?this.pickDelegate:this,t},d.prototype.render=function(t){if(this.enabled&&t.accumulateOrderedRenderables&&(!t.globe.projectionLimits||t.globe.projectionLimits.containsLocation(this.position.latitude,this.position.longitude))){var e;if(this.lastFrameTime!==t.timestamp)e=this.makeOrderedRenderable(t);else{e=this.clone().makeOrderedRenderable(t)}e&&e.isVisible(t)&&(e.layer=t.currentLayer,this.lastFrameTime=t.timestamp,t.addOrderedRenderable(e))}},d.prototype.renderOrdered=function(t){if(this.drawOrderedPlacemark(t),t.pickingMode){var e=new s(this.pickColor.clone(),this.pickDelegate?this.pickDelegate:this,this.position,this.layer,!1);t.pickPoint&&this.mustDrawLabel()&&this.labelBounds.containsPoint(t.convertPointToViewport(t.pickPoint,d.scratchPoint))&&(e.labelPicked=!0),t.resolvePick(e)}},d.prototype.makeOrderedRenderable=function(t){var e,i,r,n;if(this.determineActiveAttributes(t),!this.activeAttributes)return null;if(t.surfacePointForMode(this.position.latitude,this.position.longitude,this.position.altitude,this.altitudeMode,this.placePoint),this.eyeDistance=this.alwaysOnTop?0:t.eyePoint.distanceTo(this.placePoint),this.mustDrawLeaderLine(t)&&t.surfacePointForMode(this.position.latitude,this.position.longitude,0,this.altitudeMode,this.groundPoint),!t.projectWithDepth(this.placePoint,this.depthOffset,d.screenPoint))return null;var o=this.eyeDistanceScaling?Math.max(0,Math.min(1,this.eyeDistanceScalingThreshold/this.eyeDistance)):1;return this.activeTexture?(e=this.activeTexture.originalImageWidth,i=this.activeTexture.originalImageHeight,r=this.activeAttributes.imageScale*o,n=this.activeAttributes.imageOffset.offsetForSize(e,i),this.imageTransform.setTranslation(d.screenPoint[0]-n[0]*r,d.screenPoint[1]-n[1]*r,d.screenPoint[2]),this.imageTransform.setScale(e*r,i*r,1)):(r=this.activeAttributes.imageScale*o,n=this.activeAttributes.imageOffset.offsetForSize(r,r),this.imageTransform.setTranslation(d.screenPoint[0]-n[0],d.screenPoint[1]-n[1],d.screenPoint[2]),this.imageTransform.setScale(r,r,1)),this.imageBounds=c.boundingRectForUnitQuad(this.imageTransform),this.mustDrawLabel()&&(this.labelTexture=t.createTextTexture(this.label,this.activeAttributes.labelAttributes),e=this.labelTexture.imageWidth,i=this.labelTexture.imageHeight,r=this.activeAttributes.labelAttributes.scale*o,n=this.activeAttributes.labelAttributes.offset.offsetForSize(e,i),this.labelTransform.setTranslation(d.screenPoint[0]-n[0]*r,d.screenPoint[1]-n[1]*r,d.screenPoint[2]),this.labelTransform.setScale(e*r,i*r,1),this.labelBounds=c.boundingRectForUnitQuad(this.labelTransform)),this},d.prototype.determineActiveAttributes=function(t){this.highlighted&&this.highlightAttributes?this.activeAttributes=this.highlightAttributes:this.activeAttributes=this.attributes,this.activeAttributes&&this.activeAttributes.imageSource&&(this.activeTexture=t.gpuResourceCache.resourceForKey(this.activeAttributes.imageSource),this.activeTexture&&!this.updateImage||(this.activeTexture=t.gpuResourceCache.retrieveTexture(t.currentGlContext,this.activeAttributes.imageSource),this.updateImage=!1))},d.prototype.isVisible=function(t){return t.pickingMode?t.pickRectangle&&(this.imageBounds.intersects(t.pickRectangle)||this.mustDrawLabel()&&this.labelBounds.intersects(t.pickRectangle)||this.mustDrawLeaderLine(t)&&t.pickFrustum.intersectsSegment(this.groundPoint,this.placePoint)):this.imageBounds.intersects(t.viewport)||this.mustDrawLabel()&&this.labelBounds.intersects(t.viewport)||this.mustDrawLeaderLine(t)&&t.frustumInModelCoordinates.intersectsSegment(this.groundPoint,this.placePoint)},d.prototype.drawOrderedPlacemark=function(t){this.beginDrawing(t);try{this.doDrawOrderedPlacemark(t),t.pickingMode||this.drawBatchOrderedPlacemarks(t)}finally{this.endDrawing(t)}},d.prototype.drawBatchOrderedPlacemarks=function(t){for(var e;(e=t.peekOrderedRenderable())&&e.doDrawOrderedPlacemark;){t.popOrderedRenderable();try{e.doDrawOrderedPlacemark(t)}catch(t){n.logMessage(n.LEVEL_WARNING,"Placemark","drawBatchOrderedPlacemarks","Error occurred while rendering placemark using batching: "+t.message)}}},d.prototype.beginDrawing=function(t){var i,r=t.currentGlContext;t.findAndBindProgram(e),i=t.currentProgram,r.bindBuffer(r.ARRAY_BUFFER,t.unitQuadBuffer()),r.vertexAttribPointer(i.vertexTexCoordLocation,2,r.FLOAT,!1,0,0),r.enableVertexAttribArray(i.vertexPointLocation),r.enableVertexAttribArray(i.vertexTexCoordLocation),i.loadTextureUnit(r,r.TEXTURE0),i.loadModulateColor(r,t.pickingMode)},d.prototype.endDrawing=function(t){var e=t.currentGlContext,i=t.currentProgram;e.disableVertexAttribArray(i.vertexPointLocation),e.disableVertexAttribArray(i.vertexTexCoordLocation),e.bindBuffer(e.ARRAY_BUFFER,null),e.bindTexture(e.TEXTURE_2D,null)},d.prototype.doDrawOrderedPlacemark=function(t){var e,r=t.currentGlContext,n=t.currentProgram,o=!0;if(t.pickingMode&&(this.pickColor=t.uniquePickColor()),this.eyeDistanceScaling&&this.eyeDistance>this.eyeDistanceScalingLabelThreshold&&(this.targetVisibility=0),!t.pickingMode&&this.mustDrawLabel()&&this.currentVisibility!=this.targetVisibility){var s=(t.timestamp-t.previousRedrawTimestamp)/t.fadeTime;this.currentVisibility<this.targetVisibility?this.currentVisibility=Math.min(1,this.currentVisibility+s):this.currentVisibility=Math.max(0,this.currentVisibility-s),t.redrawRequested=!0}if(n.loadOpacity(r,t.pickingMode?1:this.layer.opacity),this.mustDrawLeaderLine(t)){this.leaderLinePoints||(this.leaderLinePoints=new Float32Array(6)),this.leaderLinePoints[0]=this.groundPoint[0],this.leaderLinePoints[1]=this.groundPoint[1],this.leaderLinePoints[2]=this.groundPoint[2],this.leaderLinePoints[3]=this.placePoint[0],this.leaderLinePoints[4]=this.placePoint[1],this.leaderLinePoints[5]=this.placePoint[2],this.leaderLineCac
103heKey||(this.leaderLineCacheKey=t.gpuResourceCache.generateCacheKey());var a=t.gpuResourceCache.resourceForKey(this.leaderLineCacheKey);a||(a=r.createBuffer(),t.gpuResourceCache.putResource(this.leaderLineCacheKey,a,4*this.leaderLinePoints.length)),n.loadTextureEnabled(r,!1),n.loadColor(r,t.pickingMode?this.pickColor:this.activeAttributes.leaderLineAttributes.outlineColor),d.matrix.copy(t.modelviewProjection),n.loadModelviewProjection(r,d.matrix),this.activeAttributes.leaderLineAttributes.depthTest||r.disable(r.DEPTH_TEST),r.lineWidth(this.activeAttributes.leaderLineAttributes.outlineWidth),r.bindBuffer(r.ARRAY_BUFFER,a),r.bufferData(r.ARRAY_BUFFER,this.leaderLinePoints,r.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1),r.vertexAttribPointer(n.vertexPointLocation,3,r.FLOAT,!1,0,0),r.drawArrays(r.LINES,0,2)}this.activeAttributes.depthTest||(o=!1,r.disable(r.DEPTH_TEST)),r.bindBuffer(r.ARRAY_BUFFER,t.unitQuadBuffer3()),r.vertexAttribPointer(n.vertexPointLocation,3,r.FLOAT,!1,0,0),d.matrix.copy(t.screenProjection),d.matrix.multiplyMatrix(this.imageTransform);var l=this.imageRotationReference===WorldWind.RELATIVE_TO_GLOBE?t.navigator.heading-this.imageRotation:-this.imageRotation;d.matrix.multiplyByTranslation(.5,.5,0),d.matrix.multiplyByRotation(0,0,1,l),d.matrix.multiplyByTranslation(-.5,-.5,0);var h=this.imageTiltReference===WorldWind.RELATIVE_TO_GLOBE?t.navigator.tilt+this.imageTilt:this.imageTilt;d.matrix.multiplyByRotation(-1,0,0,h),n.loadModelviewProjection(r,d.matrix),n.loadTextureEnabled(r,!0),t.pickingMode?n.loadColor(r,this.pickColor):n.loadColor(r,this.activeAttributes.imageColor),this.texCoordMatrix.setToIdentity(),this.activeTexture&&this.texCoordMatrix.multiplyByTextureTransform(this.activeTexture),n.loadTextureMatrix(r,this.texCoordMatrix),this.activeTexture?(e=this.activeTexture.bind(t),n.loadTextureEnabled(r,e)):n.loadTextureEnabled(r,!1),r.drawArrays(r.TRIANGLE_STRIP,0,4),this.mustDrawLabel()&&this.currentVisibility>0&&(n.loadOpacity(r,t.pickingMode?1:this.layer.opacity*this.currentVisibility),d.matrix.copy(t.screenProjection),d.matrix.multiplyMatrix(this.labelTransform),n.loadModelviewProjection(r,d.matrix),!t.pickingMode&&this.labelTexture?(this.texCoordMatrix.setToIdentity(),this.texCoordMatrix.multiplyByTextureTransform(this.labelTexture),n.loadTextureMatrix(r,this.texCoordMatrix),n.loadColor(r,i.WHITE),e=this.labelTexture.bind(t),n.loadTextureEnabled(r,e)):(n.loadTextureEnabled(r,!1),n.loadColor(r,this.pickColor)),this.activeAttributes.labelAttributes.depthTest?o||(o=!0,r.enable(r.DEPTH_TEST)):(o=!1,r.disable(r.DEPTH_TEST)),r.drawArrays(r.TRIANGLE_STRIP,0,4)),o||r.enable(r.DEPTH_TEST)},d.prototype.mustDrawLabel=function(){return this.label&&this.label.length>0&&this.activeAttributes.labelAttributes},d.prototype.mustDrawLeaderLine=function(t){return this.activeAttributes.drawLeaderLine&&this.activeAttributes.leaderLineAttributes&&(!t.pickingMode||this.enableLeaderLinePicking)},d}),i("shapes/Polygon",["../shapes/AbstractShape","../error/ArgumentError","../shaders/BasicTextureProgram","../geom/BoundingBox","../util/Color","../util/ImageSource","../geom/Location","../util/Logger","../geom/Matrix","../pick/PickedObject","../geom/Position","../shapes/ShapeAttributes","../shapes/SurfacePolygon","../geom/Vec2","../geom/Vec3","../util/libtess"],function(t,e,i,n,o,s,a,l,h,u,c,d,f,p,g,m){"use strict";var y=function(i,r){if(!i)throw new e(l.logMessage(l.LEVEL_SEVERE,"Polygon","constructor","missingBoundaries"));t.call(this,r),i.length>0&&i[0].latitude&&(i=[i],this._boundariesSpecifiedSimply=!0),this._boundaries=i,this._textureCoordinates=null,this.referencePosition=this.determineReferencePosition(this._boundaries),this._extrude=!1,this.scratchPoint=new g(0,0,0)};return y.prototype=Object.create(t.prototype),Object.defineProperties(y.prototype,{boundaries:{get:function(){return this._boundariesSpecifiedSimply?this._boundaries[0]:this._boundaries},set:function(t){if(!t)throw new e(l.logMessage(l.LEVEL_SEVERE,"Polygon","boundaries","missingBoundaries"));t.length>0&&t[0].latitude&&(t=[t],this._boundariesSpecifiedSimply=!0),this._boundaries=t,this.referencePosition=this.determineReferencePosition(this._boundaries),this.reset()}},textureCoordinates:{get:function(){return this._textureCoordinates},set:function(t){this._textureCoordinates=t,this.reset()}},extrude:{get:function(){return this._extrude},set:function(t){this._extrude=t,this.reset()}}}),y.prototype.determineReferencePosition=function(t){return t.length>0&&t[0].length>2?t[0][0]:null},y.prototype.mustGenerateGeometry=function(t){return!this.currentData.boundaryPoints||(this.currentData.drawInterior!==this.activeAttributes.drawInterior||this.altitudeMode!==WorldWind.ABSOLUTE&&this.currentData.isExpired)},y.prototype.hasCapTexture=function(){return this.textureCoordinates&&this.capImageSource()},y.prototype.capImageSource=function(){return this.activeAttributes.imageSource?"string"==typeof this.activeAttributes.imageSource||this.activeAttributes.imageSource instanceof s?this.activeAttributes.imageSource:Array.isArray(this.activeAttributes.imageSource)&&this.activeAttributes.imageSource[0]&&("string"==typeof this.activeAttributes.imageSource[0]||this.activeAttributes.imageSource instanceof s)?this.activeAttributes.imageSource[0]:null:null},y.prototype.hasSideTextures=function(){return this.activeAttributes.imageSource&&Array.isArray(this.activeAttributes.imageSource)&&this.activeAttributes.imageSource.length>1},y.prototype.sideImageSource=function(t){if(0===t||2===this.activeAttributes.imageSource.length)return this.activeAttributes.imageSource[1];var e=this.activeAttributes.imageSource.length-1;return t=Math.min(t+1,e),this.activeAttributes.imageSource[t]},y.prototype.createSurfaceShape=function(){return new f(this.boundaries,null)},y.prototype.doMakeOrderedRenderable=function(t){if(!this.referencePosition)return null;if(!this.activeAttributes.drawInterior&&!this.activeAttributes.drawOutline)return null;if(!this.mustGenerateGeometry(t))return this;var e=this.currentData,i=e.referencePoint;t.surfacePointForMode(this.referencePosition.latitude,this.referencePosition.longitude,this.referencePosition.altitude,this._altitudeMode,i),e.transformationMatrix.setToTranslation(i[0],i[1],i[2]);for(var r=[],o=0;o<this._boundaries.length;o++)r[o]=this._boundaries[o].slice(0),r[o].push(this._boundaries[o][0]);var s=this.computeBoundaryPoints(t,r);if(this.activeAttributes.drawInterior){var a=this.tessellatePolygon(t,s);if(a){e.capTriangles=new Float32Array(a.length);for(var l=0,h=a.length;l<h;l++)e.capTriangles[l]=a[l]}}if(e.boundaryPoints=s,e.drawInterior=this.activeAttributes.drawInterior,this.resetExpiration(e),e.refreshBuffers=!0,e.extent||(e.extent=new n),1===s.length)e.extent.setToPoints(s[0]);else{var u=[];for(o=0;o<s.length;o++)for(var c=0;c<s[o].length;c++)u.push(s[o][c]);e.extent.setToPoints(u)}return e.extent.translate(e.referencePoint),this},y.prototype.computeBoundaryPoints=function(t,e){for(var i,r,n,o,s=Number.MAX_VALUE,a=t.eyePoint,l=[],h=this._extrude?6:3,u=ne
103w g(0,0,0),c=0;c<e.length;c++){i=(this._extrude?2:1)*e[c].length,l[c]=new Float32Array(3*i);for(var d=0,f=e[c].length;d<f;d++)r=e[c][d],t.surfacePointForMode(r.latitude,r.longitude,r.altitude,this.altitudeMode,u),o=u.distanceToSquared(a),o<s&&(s=o),u.subtract(this.currentData.referencePoint),n=h*d,l[c][n]=u[0],l[c][n+1]=u[1],l[c][n+2]=u[2],this._extrude&&(t.surfacePointForMode(r.latitude,r.longitude,0,WorldWind.CLAMP_TO_GROUND,u),o=u.distanceToSquared(a),o<s&&(s=o),u.subtract(this.currentData.referencePoint),l[c][n+3]=u[0],l[c][n+4]=u[1],l[c][n+5]=u[2])}return this.currentData.eyeDistance=0,l},y.prototype.tessellatePolygon=function(t,e){var i,n,o=[],s=0,a=this._extrude?6:3,h=this.hasCapTexture();this.polygonTessellator||(this.polygonTessellator=new r.GluTesselator,this.polygonTessellator.gluTessCallback(r.gluEnum.GLU_TESS_VERTEX_DATA,function(t,e){e[e.length]=t[0],e[e.length]=t[1],e[e.length]=t[2],h&&(e[e.length]=t[3],e[e.length]=t[4])}),this.polygonTessellator.gluTessCallback(r.gluEnum.GLU_TESS_COMBINE,function(t,e,i){var r=[t[0],t[1],t[2]];if(h)for(var n=3;n<=4;n++){for(var o=0,s=0;s<4;s++)i[s]>0&&(o+=i[s]*e[s][n]);r[n]=o}return r}),this.polygonTessellator.gluTessCallback(r.gluEnum.GLU_TESS_ERROR,function(t){s=t,l.logMessage(l.LEVEL_WARNING,"Polygon","tessellatePolygon","Tessellation error "+t+".")})),n=g.computeBufferNormal(e[0],a),n||(n=new g(0,0,0),t.globe.surfaceNormalAtLocation(this.referencePosition.latitude,this.referencePosition.longitude,n)),this.polygonTessellator.gluTessNormal(n[0],n[1],n[2]),this.currentData.capNormal=n,this.polygonTessellator.gluTessBeginPolygon(o);for(var u=0;u<e.length;u++){var c=0;this.polygonTessellator.gluTessBeginContour();for(var d=e[u],f=0;f<d.length;f+=a)i=[d[f],d[f+1],d[f+2]],h&&(c<this.textureCoordinates[u].length?(i[3]=this.textureCoordinates[u][c][0],i[4]=this.textureCoordinates[u][c][1]):(i[3]=this.textureCoordinates[u][0][0],i[4]=this.textureCoordinates[u][1][1]),++c),this.polygonTessellator.gluTessVertex(i,i);this.polygonTessellator.gluTessEndContour()}return this.polygonTessellator.gluTessEndPolygon(),0===s?o:null},y.prototype.mustDrawVerticals=function(t){return this._extrude&&this.activeAttributes.drawOutline&&this.activeAttributes.drawVerticals&&this.altitudeMode!==WorldWind.CLAMP_TO_GROUND},y.prototype.doRenderOrdered=function(t){var e,i=this.currentData;if(t.pickingMode&&(e=t.uniquePickColor()),this.activeAttributes.drawInterior&&i.capTriangles&&i.capTriangles.length>0&&this.drawCap(t,e),this._extrude&&this.activeAttributes.drawInterior&&this.drawSides(t,e),this.activeAttributes.drawOutline&&this.drawOutline(t,e),i.refreshBuffers=!1,t.pickingMode){var r=new u(e,this.pickDelegate?this.pickDelegate:this,null,this.layer,!1);t.resolvePick(r)}},y.prototype.drawCap=function(t,e){var i,r,n,o,s=t.currentGlContext,a=t.currentProgram,l=this.currentData,h=l.refreshBuffers,u=!!this.hasCapTexture(),c=this.activeAttributes.applyLighting,d=l.capTriangles.length/(u?5:3);a.loadTextureEnabled(s,!1),this.applyMvpMatrix(t),l.capVboCacheKey||(l.capVboCacheKey=t.gpuResourceCache.generateCacheKey()),i=t.gpuResourceCache.resourceForKey(l.capVboCacheKey),i||(i=s.createBuffer(),t.gpuResourceCache.putResource(l.capVboCacheKey,i,4*l.capTriangles.length),h=!0),s.bindBuffer(s.ARRAY_BUFFER,i),h&&(o=c?this.makeCapBufferWithNormals():l.capTriangles,s.bufferData(s.ARRAY_BUFFER,o,s.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1)),r=this.activeAttributes.interiorColor,s.depthMask(r.alpha*this.layer.opacity>=1||t.pickingMode),a.loadColor(s,t.pickingMode?e:r),a.loadOpacity(s,t.pickingMode?1:this.layer.opacity),n=12+(u?8:0)+(c?12:0),u&&!t.pickingMode&&(this.activeTexture=t.gpuResourceCache.resourceForKey(this.capImageSource()),this.activeTexture||(this.activeTexture=t.gpuResourceCache.retrieveTexture(t.currentGlContext,this.capImageSource())),this.activeTexture&&this.activeTexture.bind(t)&&(s.enableVertexAttribArray(a.vertexTexCoordLocation),s.vertexAttribPointer(a.vertexTexCoordLocation,2,s.FLOAT,!1,n,12),this.scratchMatrix.setToIdentity(),this.scratchMatrix.multiplyByTextureTransform(this.activeTexture),a.loadTextureEnabled(s,!0),a.loadTextureUnit(s,s.TEXTURE0),a.loadTextureMatrix(s,this.scratchMatrix),a.loadModulateColor(s,t.pickingMode))),c&&!t.pickingMode&&(a.loadApplyLighting(s,!0),s.enableVertexAttribArray(a.normalVectorLocation),s.vertexAttribPointer(a.normalVectorLocation,3,s.FLOAT,!1,n,n-12)),s.vertexAttribPointer(a.vertexPointLocation,3,s.FLOAT,!1,n,0),s.drawArrays(s.TRIANGLES,0,d)},y.prototype.makeCapBufferWithNormals=function(){for(var t=this.currentData,e=t.capNormal,i=this.hasCapTexture()?5:3,r=i+3,n=t.capTriangles.length/i,o=t.capTriangles,s=new Float32Array(n*r),a=0,l=0;l<n;l++){for(var h=0;h<i;h++)s[a++]=o[l*i+h];s[a++]=e[0],s[a++]=e[1],s[a++]=e[2]}return s},y.prototype.drawSides=function(t,e){var i,r,n,o,s,a=t.currentGlContext,l=t.currentProgram,h=this.currentData,u=h.refreshBuffers,c=this.hasSideTextures(),d=this.activeAttributes.applyLighting,f=3+(c?2:0)+(d?3:0),p=4*f;s=0;for(var g=0;g<h.boundaryPoints.length;g++)s+=h.boundaryPoints[g].length/6-1;if(h.sidesVboCacheKey||(h.sidesVboCacheKey=t.gpuResourceCache.generateCacheKey()),i=t.gpuResourceCache.resourceForKey(h.sidesVboCacheKey),!i||u?(o=this.makeSidesBuffer(s),h.numSideVertices=o.length/f,i||(i=a.createBuffer()),t.gpuResourceCache.putResource(h.sidesVboCacheKey,i,4*o.length), 104a.bindBuffer(a.ARRAY_BUFFER,i),a.bufferData(a.ARRAY_BUFFER,o,a.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1)):a.bindBuffer(a.ARRAY_BUFFER,i),r=this.activeAttributes.interior
104Color,a.depthMask(r.alpha*this.layer.opacity>=1||t.pickingMode),l.loadColor(a,t.pickingMode?e:r),l.loadOpacity(a,t.pickingMode?1:this.layer.opacity),c&&!t.pickingMode){d?(l.loadApplyLighting(a,!0),a.enableVertexAttribArray(l.normalVectorLocation)):l.loadApplyLighting(a,!1);for(var m=0;m<s;m++){var y=this.sideImageSource(m),E=t.gpuResourceCache.resourceForKey(y),v=6*m*p;y&&!E&&(E=t.gpuResourceCache.retrieveTexture(t.currentGlContext,y)),n=E&&E.bind(t),n?(a.enableVertexAttribArray(l.vertexTexCoordLocation),a.vertexAttribPointer(l.vertexTexCoordLocation,2,a.FLOAT,!1,p,v+12),this.scratchMatrix.setToIdentity(),this.scratchMatrix.multiplyByTextureTransform(E),l.loadTextureEnabled(a,!0),l.loadTextureUnit(a,a.TEXTURE0),l.loadTextureMatrix(a,this.scratchMatrix)):(l.loadTextureEnabled(a,!1),a.disableVertexAttribArray(l.vertexTexCoordLocation)),d&&a.vertexAttribPointer(l.normalVectorLocation,3,a.FLOAT,!1,p,v+20),a.vertexAttribPointer(l.vertexPointLocation,3,a.FLOAT,!1,p,v),a.drawArrays(a.TRIANGLES,0,6)}}else l.loadTextureEnabled(a,!1),d&&!t.pickingMode?(l.loadApplyLighting(a,!0),a.enableVertexAttribArray(l.normalVectorLocation),a.vertexAttribPointer(l.normalVectorLocation,3,a.FLOAT,!1,p,p-12)):l.loadApplyLighting(a,!1),a.vertexAttribPointer(l.vertexPointLocation,3,a.FLOAT,!1,p,0),a.drawArrays(a.TRIANGLES,0,h.numSideVertices)},y.prototype.makeSidesBuffer=function(t){var e,i,r,n,o,s,a,l,h,u,c,d=this.currentData,f=this.hasSideTextures(),m=this.activeAttributes.applyLighting,y=3+(f?2:0)+(m?3:0);r=2*t*3*y,e=new Float32Array(r),i=0,n=new g(0,0,0),o=new g(0,0,0),s=new g(0,0,0),a=new g(0,0,0),f?(l=new p(0,1),h=new p(0,0),u=new p(1,1),c=new p(1,0)):l=h=u=c=null;for(var E=0;E<d.boundaryPoints.length;E++)for(var v,_=d.boundaryPoints[E],b=0;b<_.length-6;b+=6)n[0]=_[b],n[1]=_[b+1],n[2]=_[b+2],o[0]=_[b+3],o[1]=_[b+4],o[2]=_[b+5],s[0]=_[b+6],s[1]=_[b+7],s[2]=_[b+8],a[0]=_[b+9],a[1]=_[b+10],a[2]=_[b+11],v=m?g.computeTriangleNormal(n,o,s):null,this.addVertexToBuffer(n,l,v,e,i),i+=y,this.addVertexToBuffer(o,h,v,e,i),i+=y,this.addVertexToBuffer(s,u,v,e,i),i+=y,this.addVertexToBuffer(o,h,v,e,i),i+=y,this.addVertexToBuffer(a,c,v,e,i),i+=y,this.addVertexToBuffer(s,u,v,e,i),i+=y;return e},y.prototype.addVertexToBuffer=function(t,e,i,r,n){r[n++]=t[0],r[n++]=t[1],r[n++]=t[2],e&&(r[n++]=e[0],r[n++]=e[1]),i&&(r[n++]=i[0],r[n++]=i[1],r[n]=i[2])},y.prototype.drawOutline=function(t,e){var i,r,n,o,s,a=t.currentGlContext,l=t.currentProgram,h=this.currentData,u=h.refreshBuffers;l.loadTextureEnabled(a,!1),l.loadApplyLighting(a,!1),this.hasCapTexture()&&a.disableVertexAttribArray(l.vertexTexCoordLocation),this.activeAttributes.applyLighting&&a.disableVertexAttribArray(l.normalVectorLocation),h.boundaryVboCacheKeys||(this.currentData.boundaryVboCacheKeys=[]),this.applyMvpMatrixForOutline(t),l.loadTextureEnabled(a,!1),a.disableVertexAttribArray(l.vertexTexCoordLocation);for(var c=0;c<h.boundaryPoints.length;c++)i=h.boundaryPoints[c].length/3,h.boundaryVboCacheKeys[c]||(h.boundaryVboCacheKeys[c]=t.gpuResourceCache.generateCacheKey()),r=t.gpuResourceCache.resourceForKey(h.boundaryVboCacheKeys[c]),r||(r=a.createBuffer(),t.gpuResourceCache.putResource(h.boundaryVboCacheKeys[c],r,12*i),u=!0),a.bindBuffer(a.ARRAY_BUFFER,r),u&&(a.bufferData(a.ARRAY_BUFFER,h.boundaryPoints[c],a.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1)),n=this.activeAttributes.outlineColor,a.depthMask(n.alpha*this.layer.opacity>=1||t.pickingMode),l.loadColor(a,t.pickingMode?e:n),l.loadOpacity(a,t.pickingMode?1:this.layer.opacity),a.lineWidth(this.activeAttributes.outlineWidth),this._extrude?(o=24,s=i/2):(o=12,s=i),a.vertexAttribPointer(l.vertexPointLocation,3,a.FLOAT,!1,o,0),a.drawArrays(a.LINE_STRIP,0,s),this.mustDrawVerticals(t)&&(a.vertexAttribPointer(l.vertexPointLocation,3,a.FLOAT,!1,0,0),a.drawArrays(a.LINES,0,i-2))},y.prototype.beginDrawing=function(t){var e=t.currentGlContext;this.activeAttributes.drawInterior&&e.disable(e.CULL_FACE),t.findAndBindProgram(i),e.enableVertexAttribArray(t.currentProgram.vertexPointLocation),!t.pickMode&&this.activeAttributes.applyLighting&&t.currentProgram.loadModelviewInverse(e,t.modelviewNormalTransform)},y.prototype.endDrawing=function(t){var e=t.currentGlContext;e.disableVertexAttribArray(t.currentProgram.vertexPointLocation),e.disableVertexAttribArray(t.currentProgram.normalVectorLocation),e.depthMask(!0),e.lineWidth(1),e.enable(e.CULL_FACE)},y}),i("shapes/SurfacePolyline",["../error/ArgumentError","../util/Logger","../shapes/ShapeAttributes","../shapes/SurfaceShape"],function(t,e,
104i,r){"use strict";var n=function(i,o){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"SurfacePolyline","constructor","The specified locations array is null or undefined."));r.call(this,o),this._boundaries=i,this._stateId=n.stateId++,this._isInteriorInhibited=!0};return n.prototype=Object.create(r.prototype),Object.defineProperties(n.prototype,{boundaries:{get:function(){return this._boundaries},set:function(i){if(!Array.isArray(i))throw new t(e.logMessage(e.LEVEL_SEVERE,"SurfacePolyline","set boundaries","The specified value is not an array."));this.resetBoundaries(),this._boundaries=i,this._stateId=n.stateId++,this.stateKeyInvalid=!0}}}),n.stateId=Number.MIN_SAFE_INTEGER,n.staticStateKey=function(t){return r.staticStateKey(t)+" pl "+t._stateId},n.prototype.computeStateKey=function(){return n.staticStateKey(this)},n.prototype.computeBoundaries=function(t){},n.prototype.getReferencePosition=function(){return this.boundaries.length>1?this.boundaries[0]:null},n.prototype.moveTo=function(t,e){this.boundaries=this.computeShiftedLocations(t,this.getReferencePosition(),e,this._boundaries)},n}),i("formats/geojson/GeoJSONParser",["../../error/ArgumentError","../../util/Color","./GeoJSONConstants","./GeoJSONCRS","./GeoJSONFeature","./GeoJSONFeatureCollection","./GeoJSONGeometry","./GeoJSONGeometryCollection","./GeoJSONGeometryLineString","./GeoJSONGeometryMultiLineString","./GeoJSONGeometryMultiPoint","./GeoJSONGeometryMultiPolygon","./GeoJSONGeometryPoint","./GeoJSONGeometryPolygon","../../geom/Location","../../util/Logger","../../shapes/Placemark","../../shapes/PlacemarkAttributes","../../shapes/Polygon","../../geom/Position","../../util/proj4-src","../../layer/RenderableLayer","../../shapes/ShapeAttributes","../../shapes/SurfacePolygon","../../shapes/SurfacePolyline"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_,b,S,w,L){"use strict";var T=function(e){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","constructor","missingDataSource"));this._dataSource=e,this._geoJSONObject=null,this._geoJSONType=null,this._crs=null,this._layer=null,this._parserCompletionCallback=null,this._shapeConfigurationCallback=this.defaultShapeConfigurationCallback,this.defaultPlacemarkAttributes=new y(null),this.defaultShapeAttributes=new S(null),this.setProj4jsAliases()};return Object.defineProperties(T.prototype,{dataSource:{get:function(){return this._dataSource}},geoJSONObject:{get:function(){return this._geoJSONObject}},geoJSONType:{get:function(){return this._geoJSONType}},crs:{get:function(){return this._crs}},layer:{get:function(){return this._layer}},parserCompletionCallback:{get:function(){return this._parserCompletionCallback}},shapeConfigurationCallback:{get:function(){return this._shapeConfigurationCallback}}}),T.prototype.load=function(t,e,i){t&&(this._parserCompletionCallback=t),e&&(this._shapeConfigurationCallback=e),this._layer=i||new b;var r=typeof this.dataSource;if("string"===r){var n=T.tryParseJSONString(this.dataSource);null!==n?this.handle(n):this.requestUrl(this.dataSource)}else"object"===r?this.handle(this.dataSource):g.logMessage(g.LEVEL_SEVERE,"GeoJSON","load","Unsupported data source type: "+r)},T.prototype.defaultShapeConfigurationCallback=function(t,e){var i={},r=e.name||e.Name||e.NAME;return r&&(i.name=r),t.isPointType()||t.isMultiPointType()?i.attributes=this.defaultPlacemarkAttributes:t.isLineStringType()||t.isMultiLineStringType()?i.attributes=this.defaultShapeAttributes:(t.isPolygonType()||t.isMultiPolygonType())&&(i.attributes=this.defaultShapeAttributes),i},T.prototype.requestUrl=function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="text",e.onreadystatechange=function(){4===e.readyState&&(200===e.status?this.handle(T.tryParseJSONString(e.response)):g.log(g.LEVEL_WARNING,"GeoJSON retrieval failed ("+e.statusText+"): "+t))}.bind(this),e.onerror=function(){g.log(g.LEVEL_WARNING,"GeoJSON retrieval failed: "+t)},e.ontimeout=function(){g.log(g.LEVEL_WARNING,"GeoJSON retrieval timed out: "+t)},e.send(null)},T.prototype.handle=function(e){if(e||g.logMessage(g.LEVEL_SEVERE,"GeoJSON","handle","Invalid GeoJSON object"),this._geoJSONObject=e,"[object Array]"===Object.prototype.toString.call(this.geoJSONObject))throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","handle","
104invalidGeoJSONObjectLength"));if(!this.geoJSONObject.hasOwnProperty(i.FIELD_TYPE))throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","handle","missingGeoJSONType"));this.setGeoJSONType(),this.setGeoJSONCRS(),this._parserCompletionCallback&&"function"==typeof this._parserCompletionCallback&&this._parserCompletionCallback(this.layer)},T.prototype.setGeoJSONCRS=function(){if(this.geoJSONObject[i.FIELD_CRS]){this._crs=new r(this.geoJSONObject[i.FIELD_CRS][i.FIELD_TYPE],this.geoJSONObject[i.FIELD_CRS][i.FIELD_PROPERTIES]);var t=function(){this.addRenderablesForGeoJSON(this.layer)}.bind(this);this.crs.setCRSString(t)}else this.addRenderablesForGeoJSON(this.layer)},T.prototype.addRenderablesForGeoJSON=function(e){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForGeoJSON","missingLayer"));switch(this.geoJSONType){case i.TYPE_FEATURE:var r=new n(this.geoJSONObject[i.FIELD_GEOMETRY],this.geoJSONObject[i.FIELD_PROPERTIES],this.geoJSONObject[i.FIELD_ID],this.geoJSONObject[i.FIELD_BBOX]);this.addRenderablesForFeature(e,r);break;case i.TYPE_FEATURE_COLLECTION:var s=new o(this.geoJSONObject[i.FIELD_FEATURES],this.geoJSONObject[i.FIELD_BBOX]);this.addRenderablesForFeatureCollection(e,s);break;case i.TYPE_GEOMETRY_COLLECTION:var l=new a(this.geoJSONObject[i.FIELD_GEOMETRIES],this.geoJSONObject[i.FIELD_BBOX]);this.addRenderablesForGeometryCollection(e,l,null);break;default:this.addRenderablesForGeometry(e,this.geoJSONObject,null)}},T.prototype.addRenderablesForGeometry=function(e,r,n){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForGeometry","missingLayer"));if(!r)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForGeometry","missingGeometry"));switch(r[i.FIELD_TYPE]){case i.TYPE_POINT:var o=new d(r[i.FIELD_COORDINATES],r[i.FIELD_TYPE],r[i.FIELD_BBOX]);this.addRenderablesForPoint(e,o,n||null);break;case i.TYPE_MULTI_POINT:var s=new u(r[i.FIELD_COORDINATES],r[i.FIELD_TYPE],r[i.FIELD_BBOX]);this.addRenderablesForMultiPoint(e,s,n||null);break;case i.TYPE_LINE_STRING:var a=new l(r[i.FIELD_COORDINATES],r[i.FIELD_TYPE],r[i.FIELD_BBOX]);this.addRenderablesForLineString(e,a,n||null);break;case i.TYPE_MULTI_LINE_STRING:var p=new h(r[i.FIELD_COORDINATES],r[i.FIELD_TYPE],r[i.FIELD_BBOX]);this.addRenderablesForMultiLineString(e,p,n||null);break;case i.TYPE_POLYGON:var m=new f(r[i.FIELD_COORDINATES],r[i.FIELD_TYPE],r[i.FIELD_BBOX]);this.addRenderablesForPolygon(e,m,n||null);break;case i.TYPE_MULTI_POLYGON:var y=new c(r[i.FIELD_COORDINATES],r[i.FIELD_TYPE],r[i.FIELD_BBOX]);this.addRenderablesForMultiPolygon(e,y,n||null)}},T.prototype.addRenderablesForPoint=function(e,i,r){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForPoint","missingLayer"));if(!i)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForPoint","missingGeometry"));var n=this.shapeConfigurationCallback(i,r);if(!this.crs||this.crs.isCRSSupported()){var o=i.coordinates[0],s=i.coordinates[1],a=i.coordinates[2]?i.coordinates[2]:0,l=this.getReprojectedIfRequired(s,o,this.crs),h=new v(l[1],l[0],a),u=new m(h,!1,n&&n.attributes?n.attributes:null);u.altitudeMode=WorldWind.RELATIVE_TO_GROUND,n&&n.name&&(u.label=n.name),n.highlightAttributes&&(u.highlightAttributes=n.highlightAttributes),n&&n.pickDelegate&&(u.pickDelegate=n.pickDelegate),n&&n.userProperties&&(u.userProperties=n.userProperties),e.addRenderable(u)}},T.prototype.addRenderablesForMultiPoint=function(e,i,r){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForMultiPoint","missingLayer"));if(!i)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForMultiPoint","missingGeometry"));var n=this.shapeConfigurationCallback(i,r);if(!this.crs||this.crs.isCRSSupported())for(var o=0,s=i.coordinates.length;o<s;o+=1){var a=i.coordinates[o][0],l=i.coordinates[o][1],h=i.coordinates[o][2]?i.coordinates[o][2]:0,u=this.getReprojectedIfRequired(l,a,this.crs),c=new v(u[1],u[0],h),d=new m(c,!1,n&&n.attributes?n.attributes:null);d.altitudeMode=WorldWind.RELATIVE_TO_GROUND,n&&n.name&&(d.label=n.name),n.highlightAttributes&&(d.highlightAttributes=n.highlightAttributes),n&&n.pickDelegate&&(d.pickDelegate=n.pickDelegate),n&&n.userProperties&&(d.userProperties=n.userProperties),e.addRenderable(d)}},T.prototype.addRenderablesForLineString=function(e,i,r){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForLineString","missingLayer"));if(!i)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForLineString","missingGeometry"));var n=this.shapeConfigurationCallback(i,r);if(!this.crs||this.crs.isCRSSupported()){for(var o=[],s=0,a=i.coordinates;s<a.length;s++){var l=a[s][0],h=a[s][1],u=this.getReprojectedIfRequired(h,l,this.crs),c=new p(u[1],u[0]);o.push(c)}var d;d=new L(o,n&&n.attributes?n.attributes:null),n.highlightAttributes&&(d.highlightAttributes=n.highlightAttributes),n&&n.pickDelegate&&(d.pickDelegate=n.pickDelegate),n&&n.userProperties&&(d.userProperties=n.userProperties),e.addRenderable(d)}},T.prototype.addRenderablesForMultiLineString=function(e,i,r){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForMultiLineString","missingLayer"));if(!i)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForMultiLineString","missingGeometry"));var n=this.shapeConfigurationCallback(i,r);if(!this.crs||this.crs.isCRSSupported())for(var o=0,s=i.coordinates;o<s.length;o++){for(var a=[],l=0,h=s[o];l<h.length;l++){var u=h[l][0],c=h[l][1],d=this.getReprojectedIfRequired(c,u,this.crs),f=new p(d[1],d[0]);a.push(f)}var m;m=new L(a,n&&n.attributes?n.attributes:null),n.highlightAttributes&&(m.highlightAttributes=n.highlightAttributes),n&&n.pickDelegate&&(m.pickDelegate=n.pickDelegate),n&&n.userProperties&&(m.userProperties=n.userProperties),e.addRenderable(m)}},T.prototype.addRenderablesForPolygon=function(e,i,r){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForPolygon","missingLayer"));if(!i)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForPolygon","missingGeometry"));var n=this.shapeConfigurationCallback(i,r);if(!this.crs||this.crs.isCRSSupported()){for(var o=[],s=0,a=i.coordinates;s<a.length;s++){for(var l=[],h=0,u=a[s];h<u.length;h++){var c=u[h][0],d=u[h][1],f=this.getReprojectedIfRequired(d,c,this.crs),m=new p(f[1],f[0]);l.push(m)}o.push(l)}var y;y=new w(o,n&&n.attributes?n.attributes:null),n.highlightAttributes&&(y.highlightAttributes=n.highlightAttributes),n&&n.pickDelegate&&(y.pickDelegate=n.pickDelegate),n&&n.userProperties&&(y.userProperties=n.userProperties),e.addRenderable(y)}},T.prototype.addRenderablesForMultiPolygon=function(e,i,r){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForMultiPolygon","missingLayer"));if(!i)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForMultiPolygon","missingGeometry"));var n=this.shapeConfigurationCallback(i,r);if(!this.crs||this.crs.isCRSSupported())for(var o=0,s=i.coordinates;o<s.length;o++){for(var a=[],l=0;l<s[o].length;l++){for(var h=[],u=0,c=s[o][l];
104u<c.length;u++){var d=c[u][0],f=c[u][1],m=this.getReprojectedIfRequired(f,d,this.crs),y=new p(m[1],m[0]);h.push(y)}a.push(h)}var E;E=new w(a,n&&n.attributes?n.attributes:null),n.highlightAttributes&&(E.highlightAttributes=n.highlightAttributes),n&&n.pickDelegate&&(E.pickDelegate=n.pickDelegate),n&&n.userProperties&&(E.userProperties=n.userProperties),e.addRenderable(E)}},T.prototype.addRenderablesForGeometryCollection=function(e,r,n){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForGeometryCollection","missingLayer"));if(!r)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForGeometryCollection","missingGeometryCollection"));for(var o=0,s=r.geometries;o<s.length;o++)s[o].hasOwnProperty(i.FIELD_TYPE)&&this.addRenderablesForGeometry(e,s[o],n)},T.prototype.addRenderablesForFeature=function(e,r){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForFeature","missingLayer"));if(!r)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForFeature","missingFeature"));if(r.geometry.type===i.TYPE_GEOMETRY_COLLECTION){var n=new a(r.geometry.geometries,r.bbox);this.addRenderablesForGeometryCollection(e,n,r.properties)}else this.addRenderablesForGeometry(e,r.geometry,r.properties)},T.prototype.addRenderablesForFeatureCollection=function(e,r){if(!e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForFeatureCollection","missingLayer"));if(!r)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","addRenderablesForFeatureCollection","missingFeatureCollection"));if(r.features.length>0)for(var o=0;o<r.features.length;o++){var s=new n(r.features[o][i.FIELD_GEOMETRY],r.features[o][i.FIELD_PROPERTIES],r.features[o][i.FIELD_ID],r.features[o][i.FIELD_BBOX]);this.addRenderablesForFeature(e,s)}},T.prototype.setGeoJSONType=function(){switch(this.geoJSONObject[i.FIELD_TYPE]){case i.TYPE_POINT:this._geoJSONType=i.TYPE_POINT;break;case i.TYPE_MULTI_POINT:this._geoJSONType=i.TYPE_MULTI_POINT;break;case i.TYPE_LINE_STRING:this._geoJSONType=i.TYPE_LINE_STRING;break;case i.TYPE_MULTI_LINE_STRING:this._geoJSONType=i.TYPE_MULTI_LINE_STRING;break;case i.TYPE_POLYGON:this._geoJSONType=i.TYPE_POLYGON;break;case i.TYPE_MULTI_POLYGON:this._geoJSONType=i.TYPE_MULTI_POLYGON;break;case i.TYPE_GEOMETRY_COLLECTION:this._geoJSONType=i.TYPE_GEOMETRY_COLLECTION;break;case i.TYPE_FEATURE:this._geoJSONType=i.TYPE_FEATURE;break;case i.TYPE_FEATURE_COLLECTION:this._geoJSONType=i.TYPE_FEATURE_COLLECTION;break;default:throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","setGeoJSONType","invali
104dGeoJSONType"))}},T.prototype.getReprojectedIfRequired=function(e,r,n){if(!e&&0!==e)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","getReprojectedIfRequired","missingLatitude"));if(!r&&0!==r)throw new t(g.logMessage(g.LEVEL_SEVERE,"GeoJSON","getReprojectedIfRequired","missingLongitude"));return!n||n.isDefault()?[r,e]:_(n.projectionString,i.EPSG4326_CRS,[r,e])},T.prototype.setProj4jsAliases=function(){_.defs([["urn:ogc:def:crs:EPSG::4326",_.defs("EPSG:4326")],["urn:ogc:def:crs:OGC:1.3:CRS84",_.defs("EPSG:4326")],["urn:ogc:def:crs:EPSG::3857",_.defs("EPSG:3857")]])},T.tryParseJSONString=function(t){try{return JSON.parse(t)}catch(t){return null}},T}),i("projections/ProjectionEquirectangular",["../geom/Angle","../error/ArgumentError","../projections/GeographicProjection","../util/Logger","../geom/Vec3"],function(t,e,i,r,n){"use strict";var o=function(){i.call(this,"Equirectangular",!0,null)};return o.prototype=Object.create(i.prototype),Object.defineProperties(o.prototype,{stateKey:{get:function(){return"projection equirectangular "}}}),o.prototype.geographicToCartesian=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionEquirectangular","geographicToCartesian","missingGlobe"));if(!l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionEquirectangular","geographicToCartesian","missingResult"));return l[0]=i.equatorialRadius*o*t.DEGREES_TO_RADIANS+(a?a[0]:0),l[1]=i.equatorialRadius*n*t.DEGREES_TO_RADIANS,l[2]=s,l},o.prototype.geographicToCartesianGrid=function(i,o,s,a,l,h,u,c){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionEquirectangular","geographicToCartesianGrid","missingGlobe"));if(!o)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionEquirectangular","geographicToCartesianGrid","missingSector"));if(!l||l.length<s*a)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionEquirectangular","geographicToCartesianGrid","The specified elevations array is null, undefined or insufficient length"));if(!c)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionEquirectangular","geographicToCartesianGrid","missingResult"));var d,f,p,g,m,y=i.equatorialRadius,E=o.minLatitude*t.DEGREES_TO_RADIANS,v=o.maxLatitude*t.DEGREES_TO_RADIANS,_=o.minLongitude*t.DEGREES_TO_RADIANS,b=o.maxLongitude*t.DEGREES_TO_RADIANS,S=(v-E)/(s>1?s-1:1),w=(b-_)/(a>1?a-1:1),L=h||new n(0,0,0),T=u?u[0]:0,x=0,R=0;for(d=0,p=E;d<s;d++,p+=S)for(d===s-1&&(p=v),m=y*p-L[1],f=0,g=_;f<a;f++,g+=w)f===a-1&&(g=b),c[R++]=y*g-L[0]+T,c[R++]=m,c[R++]=l[x++]-L[2];return c},o.prototype.cartesianToGeographic=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionEquirectangular","cartesianToGeographic","missingGlobe"));if(!l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionEquirectangular","cartesianToGeographic","missingResult"));return l.latitude=o/i.equatorialRadius*t.RADIANS_TO_DEGREES,l.longitude=(n-(a?a[0]:0))/i.equatorialRadius*t.RADIANS_TO_DEGREES,l.altitude=s,l},o}),i("globe/Globe2D",["../globe/ElevationModel","../globe/Globe","../projections/ProjectionEquirectangular"],function(t,e,i){"use strict";var r=function(){e.call(this,new t,new i)};return r.prototype=Object.create(e.prototype),r}),i("util/GoToAnimator",["../geom/Location","../util/Logger","../geom/Position","../geom/Vec3"],function(t,e,i,r){"use strict";var n=function(t){if(!t)throw new ArgumentError(e.logMessage(e.LEVEL_SEVERE,"GoToAnimator","constructor","missingWorldWindow"));this.wwd=t,this.animationFrequency=20,this.travelTime=3e3,this.cancelled=!1};return n.prototype.cancel=function(){this.cancelled=!0},n.prototype.goTo=function(n,o){if(!n)throw new ArgumentError(e.logMessage(e.LEVEL_SEVERE,"GoToAnimator","goTo","missingPosition"));this.completionCallback=o,this.cancelled=!1,this.targetPosition=new i(n.latitude,n.longitude,n.altitude||this.wwd.navigator.range),this.startPosition=new i(this.wwd.navigator.lookAtLocation.latitude,this.wwd.navigator.lookAtLocation.longitude,this.wwd.navigator.range),this.startTime=Date.now();var s,a=this.travelTime,l=t.greatCircleDistance(this.startPosition,this.targetPosition),h=this.wwd.globe.computePointFromLocation(this.startPosition.latitude,this.startPosition.longitude,new r(0,0,0)),u=this.wwd.globe.computePointFromLocation(this.targetPosition.latitude,this.targetPosition.longitude,new r(0,0,0));this.maxAltitude=h.distanceTo(u);var c=this.wwd.pixelSizeAtDistance(this.startPosition.altitude)*this.wwd.canvas.clientWidth/this.wwd.globe.equatorialRadius;l<=2*c&&(this.maxAltitude=this.startPosition.altitude),this.maxAltitudeReachedTime=this.maxAltitude<=this.wwd.navigator.range?Date.now():null,this.maxAltitude>this.startPosition.altitude?(s=Math.max(0,this.maxAltitude-this.startPosition.altitude),s+=Math.abs(this.targetPosition.altitude-this.maxAltitude)):s=Math.abs(this.targetPosition.altitude-this.startPosition.altitude);var d=Math.max(l,s/this.wwd.globe.equatorialRadius);if(0!==d){d<2*c&&(a=Math.min(d/c*this.travelTime,this.travelTime)),a=Math.max(1,a),this.panVelocity=l/a,this.rangeVelocity=s/a;var f=this,p=function(){if(f.cancelled)return void(f.completionCallback&&f.completionCallback(f));
104f.update()?setTimeout(p,f.animationFrequency):f.completionCallback&&f.completionCallback(f)};setTimeout(p,this.animationFrequency)}},n.prototype.update=function(){var t=new i(this.wwd.navigator.lookAtLocation.latitude,this.wwd.navigator.lookAtLocation.longitude,this.wwd.navigator.range),e=this.updateRange(t);return e=this.updateLocation(t)||e,this.wwd.redraw(),e},n.prototype.updateRange=function(t){var e,i,r=!1;return this.maxAltitudeReachedTime?(i=Date.now()-this.maxAltitudeReachedTime,this.maxAltitude>this.targetPosition.altitude?(e=this.maxAltitude-this.rangeVelocity*i,e=Math.max(e,this.targetPosition.altitude)):(e=this.maxAltitude+this.rangeVelocity*i,e=Math.min(e,this.targetPosition.altitude)),this.wwd.navigator.range=e,r=Math.abs(this.wwd.navigator.range-this.targetPosition.altitude)>1):(i=Date.now()-this.startTime,e=Math.min(this.startPosition.altitude+this.rangeVelocity*i,this.maxAltitude),Math.abs(this.wwd.navigator.range-e)<1&&(this.maxAltitudeReachedTime=Date.now()),this.wwd.navigator.range=e,r=!0),r},n.prototype.updateLocation=function(e){var i=Date.now()-this.startTime,r=t.greatCircleDistance(this.startPosition,e),n=t.greatCircleDistance(e,this.targetPosition),o=t.greatCircleAzimuth(e,this.targetPosition),s=this.panVelocity*i,a=Math.min(s-r,n),l=t.greatCircleLocation(e,o,a,new t(0,0)),h=!1;return this.wwd.navigator.lookAtLocation.latitude=l.latitude,this.wwd.navigator.lookAtLocation.longitude=l.longitude,a<1/this.wwd.globe.equatorialRadius&&(h=!0),!h},n}),i("util/HighlightController",["../error/ArgumentError","../util/Logger"],function(t,e){"use strict";return function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"HighlightController","constructor","missingWorldWindow"));this.worldWindow=i;var r=[],n=function(t){for(var e=t.clientX,n=t.clientY,o=r.length>0,s=0;s<r.length;s++)r[s].highlighted=!1;r=[];var a=i.pick(i.canvasCoordinates(e,n));if(a.objects.length>0&&(o=!0),a.objects.length>0)for(var l=0;l<a.objects.length;l++)a.objects[l].isTerrain||(a.objects[l].userObject.highlighted=!0,r.push(a.objects[l].userObject));o&&i.redraw()};this.worldWindow.addEventListener("mousemove",n);new WorldWind.TapRecognizer(this.worldWindow,n)}}),i("formats/kml/util/KmlAttribute",[],function(){"use strict";var t=function(t,e){this.node=t,this.name=e};return t.prototype.value=function(){return this.node.attributes&&this.node.attributes.getNamedItem(this.name)&&this.node.attributes.getNamedItem(this.name).value||null},t.prototype.exists=function(){return null!=this.value()},t.prototype.save=function(t){this.node.setAttribute(this.name,t)},t}),i("formats/kml/KmlElements",[],function(){"use strict";return{keys:{},addKey:function(t,e){this.keys[t]=e},getKey:function(t){return this.keys[t]}}}),i("formats/kml/util/KmlNodeTransformers",["./KmlAttribute","../KmlElements","../../../geom/Position","../../../util/WWUtil"],function(t,e,i,r){function n(t){var e;return null!=t&&t.childNodes[0]?e=t.childNodes[0].nodeValue:null!=t&&(e=""),e}var o=function(){};return o.string=function(t){return String(n(t))},o.number=function(t){return Number(n(t))},o.boolean=function(t){return r.transformToBoolean(n(t))},o.date=function(t){return r.date(n(t))},o.kmlObject=function(t,i,r){var n=t.nodeName,o=e.getKey(n);return o?new o({objectNode:t,parent:i,controls:r}):null},o.linearRing=function(t,i,r){var n=e.getKey("LinearRing");if(!n)return null;var o=null;return Array.prototype.forEach.call(t.childNodes,function(t){t.nodeName.toUpperCase()=="LinearRing".toUpperCase()&&(o=t)}),new n({objectNode:o,parent:i,controls:r})},o.positions=function(t){var e=[];return n(t).trim().replace(/\s+/g," ").split(" ").forEach(function(t){t=t.split(","),e.push(new i(Number(t[1]),Number(t[0]),Number(t[2]||0)))}),e},o.attribute=function(e){return function(i){return new t(i,e).value()}},o}),i("formats/kml/util/KmlElementsFactory",["./KmlNodeTransformers"],function(t){"use strict";var e=function(t){this.options=t||{},this.options.controls=this.options.controls||[]};e.prototype.specific=function(t,e){var i=t.node,r=null,n=this;return[].forEach.call(i.childNodes,function(i){i.nodeName==e.name&&(r=e.transformer(i,t,n.options.controls))}),r},e.prototype.any=function(e,i){var r=e.node,n=null,o=this;return[].forEach.call(r.childNodes,function(r){-1!=i.name.indexOf(r.nodeName)&&(n=t.kmlObject(r,e,o.options.controls))}),n},e.prototype.all=function(e){var i=e.node,r=[],n=this;return[].forEach.call(i.childNodes,function(i){var o=t.kmlObject(i,e,n.options.controls);o&&r.push(o)}),r};var i=new e;return e.applicationWide=function(){return i},e}),i("formats/kml/util/KmlTreeKeyValueCache",["../../../util/WWUtil"],function(t){"use strict";var e=function(){this.map={}};
104e.prototype.add=function(t,e,i){this.map[t]||(this.map[t]={}),this.map[t][e]=i},e.prototype.value=function(e,i){if(!this.map[e])return null;if(-1==i.indexOf("#")){var r=this.level(e);for(var n in r)if(r.hasOwnProperty(n)&&t.startsWith(n,i))return r[n]}return this.map[e][i]||null},e.prototype.level=function(t){return this.map[t]},e.prototype.remove=function(t,e){delete this.map[t][e]};var i=new e;return e.applicationLevelCache=function(){return i},e}),i("formats/kml/util/KmlElementsFactoryCached",["./KmlAttribute","./KmlElementsFactory","./KmlTreeKeyValueCache","../../../util/WWUtil"],function(t,e,i,r){"use strict";var n=function(t){this.internalFactory=new e(t),this.cache=i.applicationLevelCache()};n.prototype.all=function(t){var e=t.node,i=this.cache.level(this.cacheKey(t.node,"All"));if(i){var r=[];for(var n in i)i.hasOwnProperty(n)&&r.push(i[n]);return r}var o=this.internalFactory.all(t);if(o&&o.length){var s=this;o.forEach(function(t){s.cache.add(s.cacheKey(e,"All"),s.cacheKey(t.node),t)})}return o},n.prototype.specific=function(t,e){var i=t.node,r=e.name;e.attribute&&(r=e.attribute+r);var n=this.cache.value(this.cacheKey(i),r);if(n)return n;var o=this.internalFactory.specific(t,e);return o&&o.node?this.cache.add(this.cacheKey(i),this.cacheKey(o.node),o):o&&this.cache.add(this.cacheKey(i),r,o),o},n.prototype.any=function(t,e){var i,r=t.node,n=this,o=null;if(e.name.forEach(function(t){(i=n.cache.value(n.cacheKey(r),t))&&(o=i)}),o)return o;var s=this.internalFactory.any(t,e);return s&&this.cache.add(n.cacheKey(r),n.cacheKey(s.node),s),s},n.prototype.cacheKey=function(e,i){var n=new t(e,"id");n.exists()||n.save(r.guid());var o=e.nodeName+"#"+n.value();return i&&(o=i+o),o};var o=new n;return n.applicationWide=function(){return o},n}),function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function r(t){return"function"==typeof t}function n(t){return"object"==typeof t&&null!==t}function o(t){G=t}function s(t){K=t}function a(){return function(){F(h)}}function l(){return function(){setTimeout(h,1)}}function h(){for(var t=0;t<U;t+=2){(0,X[t])(X[t+1]),X[t]=void 0,X[t+1]=void 0}U=0}function u(){}function c(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function f(t){try{return t.then}catch(t){return $.error=t,$}}function p(t,e,i,r){try{t.call(e,i,r)}catch(t){return t}}function g(t,e,i){K(function(t){var r=!1,n=p(i,e,function(i){r||(r=!0,e!==i?E(t,i):_(t,i))},function(e){r||(r=!0,b(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&n&&(r=!0,b(t,n))},t)}function m(t,e){e._state===Z?_(t,e._result):e._state===Q?b(t,e._result):S(e,void 0,function(e){E(t,e)},function(e){b(t,e)})}function y(t,e){if(e.constructor===t.constructor)m(t,e);else{var i=f(e);i===$?b(t,$.error):void 0===i?_(t,e):r(i)?g(t,e,i):_(t,e)}}function E(e,i){e===i?b(e,c()):t(i)?y(e,i):_(e,i)}function v(t){t._onerror&&t._onerror(t._result),w(t)}function _(t,e){t._state===J&&(t._result=e,t._state=Z,0!==t._subscribers.length&&K(w,t))}function b(t,e){t._state===J&&(t._state=Q,t._result=e,K(v,t))}function S(t,e,i,r){var n=t._subscribers,o=n.length;t._onerror=null,n[o]=e,n[o+Z]=i,n[o+Q]=r,0===o&&t._state&&K(w,t)}function w(t){var e=t._subscribers,i=t._state;if(0!==e.length){for(var r,n,o=t._result,s=0;s<e.length;s+=3)r=e[s],n=e[s+i],r?x(i,r,n,o):n(o);t._subscribers.length=0}}function L(){this.error=null}function T(t,e){try{return t(e)}catch(t){return tt.error=t,tt}}function x(t,e,i,n){var o,s,a,l,h=r(i);if(h){if(o=T(i,n),o===tt?(l=!0,s=o.error,o=null):a=!0, 105e===o)return void b(e,d())}else o=n,a=!0;e._state!==J||(h&&a?E(e,o):l?b(e,s):t===Z?_(e,o):t===Q&&b(e,o))}function R(t,e){try{e(function(e){E(t,e)},function(e){b(t,e)})}catch(e){b(t,e)}}function M(t,e){var i=this;i._instanceConstructor=t,i.promise=new t(u),i._validateInput(e)?(i._input=e,i.length=e.length,i._remaining=e.length,i._init(),0===i.length?_(i.promise,i._result):(i.length=i.length||0,i._enumerate(),0===i._remaining&&_(i.promise,i._result))):b(i.promise,i._validationError())}function C(t){return new et(this,t).promise}function A(t){function e(t){E(n,t)}function i(t){b(n,t)}var r=this,n=new r(u);if(!B(t))return b(n,new TypeError("You must pass an array to race.")),n;for(var o=t.length,s=0;n._state===J&&s<o;s++)S(r.resolve(t[s]),void 0,e,i);return n}function P(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var i=new e(u);return E(i,t),i}function N(t){var e=this,i=new e(u);return b(i,t),i}function O(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function I(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object c
105onstructor cannot be called as a function.")}function D(t){this._id=st++,this._state=void 0,this._result=void 0,this._subscribers=[],u!==t&&(r(t)||O(),this instanceof D||I(),R(this,t))}function k(){var t;if(void 0!==ut)t=ut;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;e&&"[object Promise]"===Object.prototype.toString.call(e.resolve())&&!e.cast||(t.Promise=at)}var V;V=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var F,G,W,B=V,U=0,K=function(t,e){X[U]=t,X[U+1]=e,2===(U+=2)&&(G?G(h):W())},j="undefined"!=typeof window?window:void 0,z=j||{},q=z.MutationObserver||z.WebKitMutationObserver,Y="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),H="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,X=new Array(1e3);W=Y?function(){return function(){process.nextTick(h)}}():q?function(){var t=0,e=new q(h),i=document.createTextNode("");return e.observe(i,{characterData:!0}),function(){i.data=t=++t%2}}():H?function(){var t=new MessageChannel;return t.port1.onmessage=h,function(){t.port2.postMessage(0)}}():void 0===j&&"function"==typeof e?function(){try{var t=e,i=t("vertx");return F=i.runOnLoop||i.runOnContext,a()}catch(t){return l()}}():l();var J=void 0,Z=1,Q=2,$=new L,tt=new L;M.prototype._validateInput=function(t){return B(t)},M.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},M.prototype._init=function(){this._result=new Array(this.length)};var et=M;M.prototype._enumerate=function(){for(var t=this,e=t.length,i=t.promise,r=t._input,n=0;i._state===J&&n<e;n++)t._eachEntry(r[n],n)},M.prototype._eachEntry=function(t,e){var i=this,r=i._instanceConstructor;n(t)?t.constructor===r&&t._state!==J?(t._onerror=null,i._settledAt(t._state,e,t._result)):i._willSettleAt(r.resolve(t),e):(i._remaining--,i._result[e]=t)},M.prototype._settledAt=function(t,e,i){var r=this,n=r.promise;n._state===J&&(r._remaining--,t===Q?b(n,i):r._result[e]=i),0===r._remaining&&_(n,r._result)},M.prototype._willSettleAt=function(t,e){var i=this;S(t,void 0,function(t){i._settledAt(Z,e,t)},function(t){i._settledAt(Q,e,t)})};var it=C,rt=A,nt=P,ot=N,st=0,at=D;D.all=it,D.race=rt,D.resolve=nt,D.reject=ot,D._setScheduler=o,D._setAsap=s,D._asap=K,D.prototype={constructor:D,then:function(t,e){var i=this,r=i._state;if(r===Z&&!t||r===Q&&!e)return this;var n=new this.constructor(u),o=i._result;if(r){var s=arguments[r-1];K(function(){x(r,n,s,o)})}else S(i,n,t,e);return n},catch:function(t){return this.then(null,t)}};var lt=k,ht={Promise:at,polyfill:lt};"function"==typeof i&&i.amd?i("util/es6-promise",[],function(){return ht}):"undefined"!=typeof module&&module.exports?module.exports=ht:void 0!==this&&(this.ES6Promise=ht);var ut={};lt()}.call(this),i("util/Promise",["./es6-promise"],function(t){"use strict";return window.Promise?window.Promise:t.Promise}),i("formats/kml/KmlObject",["../../error/ArgumentError","./util/KmlAttribute","./KmlElements","./util/KmlElementsFactoryCached","../../util/Logger","../../util/Promise","../../render/Renderable"],function(t,e,i,r,n,o,s){"use strict";var a=function(e){if(s.call(this),e=e||{},!e.objectNode)throw new t(n.logMessage(n.LEVEL_SEVERE,"KmlObject","constructor","Passed node isn't defined."));this._node=e.objectNode,this._cache={},this._controls=e.controls||[],this._factory=new r({controls:this._controls}),this.hook(this._controls,e)};return a.prototype=Object.create(s.prototype),Object.defineProperties(a.prototype,{id:{get:function(){return new e(this.node,"id").value()}},node:{get:function(){return this._node}}}),a.prototype.hook=function(t,e){var i=this;t.forEach(function(t){t.hook(i,e)})},a.prototype.render=function(t){},a.prototype.getTagNames=function(){return[]},a}),i("formats/kml/KmlTimePrimitive",["./KmlObject"],function(t){"use strict";var e=function(e){t.call(this,e)};return e.prototype=Object.create(t.prototype),e.prototype.timeRange=function(){var t,e;return this.kmlBegin&&(e=t=this.kmlBegin.valueOf()),this.kmlEnd&&(e=this.kmlEnd.valueOf(),t||(t=e)),this.kmlWhen&&(e=t=this.kmlWhen.valueOf()),{from:t,to:e}},e.prototype.getTagNames=function(){return["TimeSpan","TimeStamp"]},e}),i("formats/kml/KmlAbstractView",["./KmlObject","./KmlElements","./KmlTimePrimitive"],function(t,e,
105i){"use strict";var r=function(e){t.call(this,e)};return r.prototype=Object.create(t.prototype),Object.defineProperties(r.prototype,{kmlTimePrimitive:{get:function(){return this._factory.any(this,{name:i.prototype.getTagNames()})}}}),r.prototype.getTagNames=function(){return["Camera","LookAt"]},r}),i("formats/kml/styles/KmlSubStyle",["./../KmlObject"],function(t){"use strict";var e=function(e){t.call(this,e)};return e.prototype=Object.create(t.prototype),e.prototype.getTagNames=function(){return["LineStyle","PolyStyle","IconStyle","LabelStyle","BalloonStyle","ListStyle"]},e}),i("formats/kml/styles/KmlBalloonStyle",["../KmlElements","./KmlSubStyle","../util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlBgColor:{get:function(){return this._factory.specific(this,{name:"bgColor",transformer:i.string})}},kmlTextColor:{get:function(){return this._factory.specific(this,{name:"textColor",transformer:i.string})}},kmlText:{get:function(){return this._factory.specific(this,{name:"text",transformer:i.string})}},kmlDisplayMode:{get:function(){return this._factory.specific(this,{name:"displayMode",transformer:i.string})}}}),r.update=function(){},r.prototype.getTagNames=function(){return["BalloonStyle"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/KmlCamera",["./KmlElements","./KmlAbstractView","./util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlLongitude:{get:function(){return this._factory.specific(this,{name:"longitude",transformer:i.string})}},kmlLatitude:{get:function(){return this._factory.specific(this,{name:"latitude",transformer:i.string})}},kmlAltitude:{get:function(){return this._factory.specific(this,{name:"altitude",transformer:i.string})}},kmlHeading:{get:function(){return this._factory.specific(this,{name:"heading",transformer:i.string})}},kmlTilt:{get:function(){return this._factory.specific(this,{name:"tilt",transformer:i.string})}},kmlRoll:{get:function(){return this._factory.specific(this,{name:"roll",transformer:i.string})}},kmlAltitudeMode:{get:function(){return this._factory.specific(this,{name:"altitudeMode",transformer:i.string})}}}),r.prototype.getTagNames=function(){return["Camera"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/util/KmlChange",["../KmlElements","../KmlObject"],function(t,e){var i=function(t){e.call(this,t)};return i.prototype=Object.create(e.prototype),Object.defineProperties(i.prototype,{shapes:{get:function(){return this._factory.all(this)}}}),i.prototype.getTagNames=function(){return["Change"]},t.addKey(i.prototype.getTagNames()[0],i),i}),i("formats/kml/styles/KmlColorStyle",["./KmlSubStyle","../util/KmlNodeTransformers"],function(t,e){"use strict";var i=function(e){t.call(this,e)};return i.prototype=Object.create(t.prototype),Object.defineProperties(i.prototype,{kmlColor:{get:function(){return this._factory.specific(this,{name:"color",transformer:e.string})}},kmlColorMode:{get:function(){return this._factory.specific(this,{name:"colorMode",transformer:e.string})}}}),i.prototype.getTagNames=function(){return["LineStyle","PolyStyle","IconStyle","LabelStyle"]},i}),i("formats/kml/KmlFileCache",[],function(){"use strict";var t=function(){this._rootFile=null,this._map={}};return t.prototype.retrieve=function(t){if(0!=t.indexOf("kmz;")&&0!=t.indexOf("href;")&&(0==t.indexOf("#")||null==t||0!=t.indexOf("http")))return this._rootFile;var e=t;return-1!=t.indexOf("#")&&(e=t.substr(0,t.indexOf("#")-1)),this._map[e]?this._map[e]:null},t.prototype.add=function(t,e,i){i?this._rootFile=e:this._map[t]=e},t}),i("formats/kml/styles/KmlStyleSelector",["./../KmlObject"],function(t){"use strict";var e=function(e){t.call(this,e)};return e.prototype=Object.create(t.prototype),e.prototype.getTagNames=function(){return["Style","StyleMap"]},e}),i("formats/kml/styles/KmlPolyStyle",["../../../util/Color","./KmlColorStyle","./../KmlElements","../util/KmlNodeTransformers"],function(t,e,
105i,r){"use strict";var n=function(t){e.call(this,t)};return n.prototype=Object.create(e.prototype),Object.defineProperties(n.prototype,{kmlFill:{get:function(){return this._factory.specific(this,{name:"fill",transformer:r.boolean})}},kmlOutline:{get:function(){return this._factory.specific(this,{name:"outline",transformer:r.boolean})}}}),n.update=function(e,i){e=e||{};var r=i||{};return r._drawInterior=e.kmlFill||!0,r._drawOutline=e.kmlOutline||!1,r._outlineColor=i._outlineColor||t.WHITE,r._interiorColor=e.kmlColor&&t.colorFromKmlHex(e.kmlColor)||t.WHITE,r._colorMode=e.kmlColorMode||"normal",r},n.prototype.getTagNames=function(){return["PolyStyle"]},i.addKey(n.prototype.getTagNames()[0],n),n}),i("formats/kml/util/KmlHrefResolver",["../../../util/Promise","../../../util/WWUtil"],function(t,e){var i=function(t,e){this._url=t,this._fileCache=e};return i.prototype.url=function(){if(e.startsWith(this._url,"http://")||e.startsWith(this._url,"https://"))return this._url;var t=this._fileCache.retrieve("kmz;"+this._url);return t||((t=this._fileCache.retrieve("href;"+this._url))||this._url)},i}),i("formats/kml/KmlLink",["./util/KmlHrefResolver","./KmlElements","./KmlObject","./util/KmlNodeTransformers"],function(t,e,i,r){"use strict";var n=function(t){i.call(this,t),this.onChangeListeners=[]};return n.prototype=Object.create(i.prototype),Object.defineProperties(n.prototype,{kmlRefreshMode:{get:function(){return this._factory.specific(this,{name:"refreshMode",transformer:r.string})}},kmlRefreshInterval:{get:function(){return this._factory.specific(this,{name:"refreshInterval",transformer:r.number})}},kmlViewRefreshMode:{get:function(){return this._factory.specific(this,{name:"viewRefreshMode",transformer:r.string})}},kmlViewRefreshTime:{get:function(){return this._factory.specific(this,{name:"viewRefreshTime",transformer:r.number})}},kmlViewBoundScale:{get:function(){return this._factory.specific(this,{name:"viewBoundScale",transformer:r.number})}},kmlViewFormat:{get:function(){return this._factory.specific(this,{name:"viewFormat",transformer:r.string})}},kmlHttpQuery:{get:function(){return this._factory.specific(this,{name:"httpQuery",transformer:r.string})}}}),n.prototype.kmlHref=function(e){return new t(this._factory.specific(this,{name:"href",transformer:r.string}),e).url()},n.prototype.getTagNames=function(){return["Link"]},e.addKey(n.prototype.getTagNames()[0],n),n}),i("formats/kml/KmlIcon",["./KmlLink","./KmlElements","./util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(e){t.call(this,e)};return r.prototype=Object.create(t.prototype),Object.defineProperties(r.prototype,{kmlX:{get:function(){return this._factory.specific(this,{name:"gx:x",transformer:i.number})}},kmlY:{get:function(){return this._factory.specific(this,{name:"gx:y",transformer:i.number})}},kmlW:{get:function(){return this._factory.specific(this,{name:"gx:w",transformer:i.number})}},kmlH:{get:function(){return this._factory.specific(this,{name:"gx:h",transformer:i.number})}}}),r.prototype.getTagNames=function(){return["Icon"]},e.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/styles/KmlIconStyle",["./KmlColorStyle","./../KmlElements","../KmlIcon","../util/KmlNodeTransformers"],function(t,e,i,r){"use strict";var n=function(e){t.call(this,e)};return n.prototype=Object.create(t.prototype),Object.defineProperties(n.prototype,{kmlScale:{get:function(){return this._factory.specific(this,{name:"scale",transformer:r.number})}},kmlHeading:{get:function(){return this._factory.specific(this,{name:"heading",transformer:r.number})}},kmlIcon:{get:function(){return this._factory.any(this,{name:i.prototype.getTagNames()})}},kmlHotSpotX:{get:function(){return this._factory.specific(this,{name:"hotSpot",transformer:r.attribute("x")})}},kmlHotSpotY:{get:function(){return this._factory.specific(this,{name:"hotSpot",transformer:r.attribute("y")})}},kmlHotSpotXUnits:{get:function(){return this._factory.specific(this,{name:"hotSpot",transformer:r.attribute("xunits")})}},kmlHotSpotYUnits:{get:function(){return this._factory.specific(this,{name:"hotSpot",transformer:r.attribute("yunits")}
105)}}}),n.update=function(t,e,i){t=t||{};var r=e||{};return r._imageScale=t.kmlScale||1,r._imageSource=t.kmlIcon&&t.kmlIcon.kmlHref(i)||null,r},n.prototype.getTagNames=function(){return["IconStyle"]},e.addKey(n.prototype.getTagNames()[0],n),n}),i("formats/kml/styles/KmlLabelStyle",["./KmlColorStyle","../KmlElements","../util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(e){t.call(this,e)};return r.prototype=Object.create(t.prototype),Object.defineProperties(r.prototype,{kmlScale:{get:function(){return this._factory.specific(this,{name:"scale",transformer:i.number})}}}),r.update=function(){},r.prototype.getTagNames=function(){return["LabelStyle"]},e.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/styles/KmlLineStyle",["../../../util/Color","./KmlColorStyle","./../KmlElements","../util/KmlNodeTransformers"],function(t,e,i,r){"use strict";var n=function(t){e.call(this,t)};return n.prototype=Object.create(e.prototype),Object.defineProperties(n.prototype,{kmlWidth:{get:function(){return this._factory.specific(this,{name:"width",transformer:r.number})}},kmlOuterColor:{get:function(){return this._factory.specific(this,{name:"gx:outerColor",transformer:r.string})}},kmlOuterWidth:{get:function(){return this._factory.specific(this,{name:"gx:outerWidth",transformer:r.number})}},kmlPhysicalWidth:{get:function(){return this._factory.specific(this,{name:"gx:physicalWidth",transformer:r.number})}},kmlLabelVisibility:{get:function(){return this._factory.specific(this,{name:"gx:labelVisibility",transformer:r.boolean})}}}),n.update=function(e,i){var r=i||{};return e=e||{},r._outlineColor=e.kmlColor&&t.colorFromKmlHex(e.kmlColor)||t.WHITE,r._outlineWidth=e.kmlWidth||10,r},n.prototype.getTagNames=function(){return["LineStyle"]},i.addKey(n.prototype.getTagNames()[0],n),n}),i("formats/kml/util/KmlItemIcon",["./KmlHrefResolver","./../KmlElements","../KmlObject","./KmlNodeTransformers"],function(t,e,i,r){"use strict";var n=function(t){i.call(this,t)};return n.prototype=Object.create(i.prototype),Object.defineProperties(n.prototype,{kmlState:{get:function(){return this._factory.specific(this,{name:"state",transformer:r.string})}}}),n.prototype.kmlHref=function(e){return new t(this._factory.specific(this,{name:"href",transformer:r.string}),e).url()},n.prototype.getTagNames=function(){return["ItemIcon"]},e.addKey(n.prototype.getTagNames()[0],n),n}),i("formats/kml/styles/KmlListStyle",["../util/KmlItemIcon","../KmlElements","./KmlSubStyle","../util/KmlNodeTransformers"],function(t,e,i,r){"use strict";var n=function(t){i.call(this,t)};return n.prototype=Object.create(i.prototype),Object.defineProperties(n.prototype,{kmlBgColor:{get:function(){return this._factory.specific(this,{name:"bgColor",transformer:r.string})}},kmlListItemType:{get:function(){return this._factory.specific(this,{name:"listItemType",transformer:r.string})}},kmlItemIcon:{get:function(){return this._factory.any(this,{name:t.prototype.getTagNames()})}}}),n.update=function(){},n.prototype.getTagNames=function(){return["ListStyle"]},e.addKey(n.prototype.getTagNames()[0],n),n}),i("formats/kml/styles/KmlStyle",["../../../util/Color","../../../util/Font","./KmlStyleSelector","./../KmlElements","./KmlPolyStyle","./KmlIconStyle","./KmlLabelStyle","./KmlLineStyle","./KmlListStyle","./KmlBalloonStyle","../../../util/Offset","../../../util/Promise","../../../shapes/ShapeAttributes","../../../shapes/TextAttributes"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f){"use strict";var p=function(t){i.call(this,t)};return p.prototype=Object.create(i.prototype),Object.defineProperties(p.prototype,{kmlIconStyle:{get:function(){return this._factory.any(this,{name:o.prototype.getTagNames()})}},kmlLabelStyle:{get:function(){return this._factory.any(this,{name:s.prototype.getTagNames()})}},kmlLineStyle:{get:function(){return this._factory.any(this,{name:a.prototype.getTagNames()})}},kmlPolyStyle:{get:function(){return this._factory.any(this,{name:n.prototype.getTagNames()})}},kmlBalloonStyle:{get:function(){return this._factory.any(this,{name:h.prototype.getTagNames()})}},kmlListStyle:{get:function(){return this._factory.any(this,{name:l.prototype.getTagNames()})}}}),p.prototype.generate=function(t,e){t=t||{};var i=this||{};return i.kmlIconStyle&&o.update(i.kmlIconStyle,t,e),i.kmlListStyle&&l.update(i.kmlListStyle,t),i.kmlBalloonStyle&&h.update(i.kmlBalloonStyle,t),i.kmlLabelStyle&&s.update(i.kmlLabelStyle,t),i.kmlPolyStyle&&n.update(i.kmlPolyStyle,t),i.kmlLineStyle&&a.update(i.kmlLineStyle,t),t},p.prototype.getStyle=function(){var t=this;return new c(function(e){window.setTimeout(function(){e(t)},0)})},p.prototype.getTagNames=function(){return["Style"]},r.addKey(p.prototype.getTagNames()[0],p),p.placemarkAttributes=function(e){return e=e||{},e._imageColor=e._imageColor||new t(1,1,1,1),e._imageOffset=e._imageOffset||new u(WorldWind.OFFSET_FRACTION,.5,WorldWind.OFFSET_FRACTION,.5),e._imageScale=e._imageScale||1,e._imageSource=e._imageSource||null,e._depthTest=e._depthTest||!0,e._labelAttributes=e._labelAttributes||new f(p.textAttributes()),e._drawLeaderLine=e._drawLeaderLine||!1,e._leaderLineAttributes=e._leaderLineAttributes||new d(p.shapeAttributes()),e},p.textAttributes=function(i){return i=i||{},i._color=i._color||new t(1,1,1,1),i._font=i._font||new e(14),i._offset=i._offset||new u(WorldWind.OFFSET_FRACTION,.5,WorldWind.OFFSET_FRACTION,0),i._scale=i._scale||1,i._depthTest=i._depthTest||!1,i._outlineColor=i._outlineColor||t.RED,i},p.shapeAttributes=function(e){return e=e||{},e._drawInterior=e._drawInterior||!0,e._drawOutline=e._drawOutline||!0,e._enableLighting=e._enableLighting||!1,e._interior
105Color=e._interiorColor||t.WHITE,e._outlineColor=e._outlineColor||t.RED,e._outlineWidth=e._outlineWidth||1,e._outlineStippleFactor=e._outlineStippleFactor||0,e._outlineStipplePattern=e._outlineStipplePattern||61680,e._imageSource=e._imageSource||null,e._depthTest=e._depthTest||!0,e._drawVerticals=e._drawVerticals||!1,e._applyLighting=e._applyLighting||!1,e},p.default=function(){return new p({objectNode:document.createElement("Style")})},p}),i("formats/kml/util/KmlPair",["./../KmlElements","../KmlObject","../styles/KmlStyleSelector","./KmlNodeTransformers"],function(t,e,i,r){"use strict";var n=function(t){e.call(this,t)};return n.prototype=Object.create(e.prototype),Object.defineProperties(n.prototype,{kmlKey:{get:function(){return this._factory.specific(this,{name:"key",transformer:r.string})}},kmlStyleUrl:{get:function(){return this._factory.specific(this,{name:"styleUrl",transformer:r.string})}},kmlStyleSelector:{get:function(){return this._factory.any(this,{name:i.prototype.getTagNames()})}}}),n.prototype.getTagNames=function(){return["Pair"]},n.prototype.getStyle=function(t){return t.handleRemoteStyle(this.kmlStyleUrl,this.kmlStyleSelector)},t.addKey(n.prototype.getTagNames()[0],n),n}),i("formats/kml/styles/KmlStyleMap",["../KmlElements","./KmlSubStyle","../util/KmlPair","../../../util/Promise"],function(t,e,i,r){"use strict";var n=function(t){e.call(this,t)};return n.prototype=Object.create(e.prototype),Object.defineProperties(n.prototype,{kmlPairs:{get:function(){return this._factory.all(this)}},isMap:{get:function(){return!0}}}),n.prototype.resolve=function(t){var e={},i=this.kmlPairs.map(function(i){var r=i.kmlKey;return i.getStyle(t).then(function(t){e[r]=t.normal})});return r.all(i).then(function(){return e.normal||(e.normal=null),e.highlight||(e.highlight=null),e})},n.prototype.getTagNames=function(){return["StyleMap"]},t.addKey(n.prototype.getTagNames()[0],n),n}),i("formats/kml/KmlTimeSpan",["./KmlElements","./KmlTimePrimitive","./util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(t){t.isTimeSpan=!0,e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlBegin:{get:function(){return this._factory.specific(this,{name:"begin",transformer:i.date})}},kmlEnd:{get:function(){return this._factory.specific(this,{name:"end",transformer:i.date})}}}),r.prototype.getTagNames=function(){return["TimeSpan"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/KmlTimeStamp",["./KmlElements","./KmlTimePrimitive","./util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(t){t.isTimeStamp=!0,e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlWhen:{get:function(){return this._factory.specific(this,{name:"when",transformer:i.date})}}}),r.prototype.getTagNames=function(){return["TimeStamp"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("util/jszip",[],function(){return function(t){function e(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};return e.m=t,e.c=i,e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,i){if(1&i&&(t=e(t)),8&i)return t;if(4&i&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&i&&"string"!=typeof t)for(var n in t)e.d(r,n,function(e){return t[e]}.bind(null,n));return r},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=104)}([function(t,e,i){"use strict";function r(t){return t}function n(t,e){for(var i=0;i<t.length;++i)e[i]=255&t.charCodeAt(i);return e}function o(t){var i=65536,r=e.getTypeOf(t),n=!0;if("uint8array"===r?n=d.applyCanBeUsed.uint8array:"nodebuffer"===r&&(n=d.applyCanBeUsed.nodebuffer),n)for(;i>1;)try{return d.stringifyByChunk(t,r,i)}catch(t){i=Math.floor(i/2)}return d.stringifyByChar(t)}function s(t,e){for(var i=0;i<t.length;i++)e[i]=t[i];return e}var a=i(3),l=i(44),h=i(12),u=i(88),c=i(8);e.newBlob=function(t,i){e.checkSupport("blob");try{return new Blob([t],{type:i})}catch(e){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(t),r.getBlob(i)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};
vendor: 4,136 bytes, line 105
105var d={stringifyByChunk:function(t,e,i){var r=[],n=0,o=t.length;if(o<=i)return String.fromCharCode.apply(null,t);for(;n<o;)"array"===e||"nodebuffer"===e?r.push(String.fromCharCode.apply(null,t.slice(n,Math.min(n+i,o)))):r.push(String.fromCharCode.apply(null,t.subarray(n,Math.min(n+i,o)))),n+=i;return r.join("")},stringifyByChar:function(t){for(var e="",i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return e},applyCanBeUsed:{uint8array:function(){try{return a.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return a.nodebuffer&&1===String.fromCharCode.apply(null,h.allocBuffer(1)).length}catch(t){return!1}}()}};e.applyFromCharCode=o;var f={};f.string={string:r,array:function(t){return n(t,new Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return n(t,new Uint8Array(t.length))},nodebuffer:function(t){return n(t,h.allocBuffer(t.length))}},f.array={string:o,array:r,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return h.newBufferFrom(t)}},f.arraybuffer={string:function(t){return o(new Uint8Array(t))},array:function(t){return s(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:r,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return h.newBufferFrom(new Uint8Array(t))}},f.uint8array={string:o,array:function(t){return s(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:r,nodebuffer:function(t){return h.newBufferFrom(t)}},f.nodebuffer={string:o,array:function(t){return s(t,new Array(t.length))},arraybuffer:function(t){return f.nodebuffer.uint8array(t).buffer},uint8array:function(t){return s(t,new Uint8Array(t.length))},nodebuffer:r},e.transformTo=function(t,i){if(i||(i=""),!t)return i;e.checkSupport(t);var r=e.getTypeOf(i);return f[r][t](i)},e.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":a.nodebuffer&&h.isBuffer(t)?"nodebuffer":a.uint8array&&t instanceof Uint8Array?"uint8array":a.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},e.checkSupport=function(t){if(!a[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},e.MAX_VALUE_16BITS=65535,e.MAX_VALUE_32BITS=-1,e.pretty=function(t){var e,i,r="";for(i=0;i<(t||"").length;i++)r+="\\x"+((e=t.charCodeAt(i))<16?"0":"")+e.toString(16).toUpperCase();return r},e.delay=function(t,e,i){u(function(){t.apply(i||null,e||[])})},e.inherits=function(t,e){var i=function(){};i.prototype=e.prototype,t.prototype=new i},e.extend=function(){var t,e,i={};for(t=0;t<arguments.length;t++)for(e in arguments[t])arguments[t].hasOwnProperty(e)&&void 0===i[e]&&(i[e]=arguments[t][e]);return i},e.prepareContent=function(t,i,r,o,s){return c.Promise.resolve(i).then(function(t){return a.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new c.Promise(function(e,i){var r=new FileReader;r.onload=function(t){e(t.target.result)},r.onerror=function(t){i(t.target.error)},r.readAsArrayBuffer(t)}):t}).then(function(i){var h=e.getTypeOf(i);return h?("arraybuffer"===h?i=e.transformTo("uint8array",i):"string"===h&&(s?i=l.decode(i):r&&!0!==o&&(i=function(t){return n(t,a.uint8array?new Uint8Array(t.length):new Array(t.length))}(i))),i):c.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},function(t,e,i){"use strict";function r(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit
105("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var i=0;i<this._listeners[t].length;i++)this._listeners[t][i].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",function(t){e.processChunk(t)}),t.on("end",function(){e.end()}),t.on("error",function(t){e.error(t)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var t=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},t.exports=r},function(t,e,i){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,i,r,n){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+r),n);else for(var o=0;o<r;o++)t[n+o]=e[i+o]},flattenChunks:function(t){var e,i,r,n,o,s;for(r=0,e=0,i=t.length;e<i;e++)r+=t[e].length;for(s=new Uint8Array(r),n=0,e=0,i=t.length;e<i;e++)o=t[e],s.set(o,n),n+=o.length;return s}},o={arraySet:function(t,e,i,r,n){for(var o=0;o<r;o++)t[n+o]=e[i+o]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,o))},e.setTyped(r)},function(t,e,i){"use strict";(function(t){if(e.base64=!0,e.array=!0,e.string=!0,e.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,e.nodebuffer=void 0!==t,e.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)e.blob=!1;else{var r=new ArrayBuffer(0);try{e.blob=0===new Blob([r],{type:"application/zip"}).size}catch(t){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(r),e.blob=0===n.getBlob("application/zip").size}catch(t){e.blob=!1}}}try{e.nodestream=!!i(50).Readable}catch(t){e.nodestream=!1}}).call(this,i(10).Buffer)},function(t,e,i){"use strict";function r(t){if(!(this instanceof r))return new r(t);h.call(this,t),u.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",n)}function n(){this.allowHalfOpen||this._writableState.ended||s.nextTick(o,this)}function o(t){t.end()}var s=i(14),a=Object.keys||function(t){var e=[] 106;for(var i in t)e.push(i);return e};t.exports=r;var l=i(9);l.inherits=i(6);var h=i(49),u=i(21);l.inherits(r,h);for(var c=a(u.prototype),d=0;d<c.length;d++){var f=c[d];r.prototype[f]||(r.prototype[f]=u.prototype[f])}Object.defineProperty(r.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(r.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),r.prototype._destroy=function(t,e){this.push(null),this.end(),s.nextTick(e,t)}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}}
106,function(t,e,i){"use strict";function r(){l.call(this,"utf-8 decode"),this.leftOver=null}function n(){l.call(this,"utf-8 encode")}for(var o=i(0),s=i(3),a=i(12),l=i(1),h=new Array(256),u=0;u<256;u++)h[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;h[254]=h[254]=1,e.utf8encode=function(t){return s.nodebuffer?a.newBufferFrom(t,"utf-8"):function(t){var e,i,r,n,o,a=t.length,l=0;for(n=0;n<a;n++)55296==(64512&(i=t.charCodeAt(n)))&&n+1<a&&56320==(64512&(r=t.charCodeAt(n+1)))&&(i=65536+(i-55296<<10)+(r-56320),n++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=s.uint8array?new Uint8Array(l):new Array(l),o=0,n=0;o<l;n++)55296==(64512&(i=t.charCodeAt(n)))&&n+1<a&&56320==(64512&(r=t.charCodeAt(n+1)))&&(i=65536+(i-55296<<10)+(r-56320),n++),i<128?e[o++]=i:i<2048?(e[o++]=192|i>>>6,e[o++]=128|63&i):i<65536?(e[o++]=224|i>>>12,e[o++]=128|i>>>6&63,e[o++]=128|63&i):(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63,e[o++]=128|i>>>6&63,e[o++]=128|63&i);return e}(t)},e.utf8decode=function(t){return s.nodebuffer?o.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,i,r,n,s=t.length,a=new Array(2*s);for(i=0,e=0;e<s;)if((r=t[e++])<128)a[i++]=r;else if((n=h[r])>4)a[i++]=65533,e+=n-1;else{for(r&=2===n?31:3===n?15:7;n>1&&e<s;)r=r<<6|63&t[e++],n--;n>1?a[i++]=65533:r<65536?a[i++]=r:(r-=65536,a[i++]=55296|r>>10&1023,a[i++]=56320|1023&r)}return a.length!==i&&(a.subarray?a=a.subarray(0,i):a.length=i),o.applyFromCharCode(a)}(t=o.transformTo(s.uint8array?"uint8array":"array",t))},o.inherits(r,l),r.prototype.processChunk=function(t){var i=o.transformTo(s.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var r=i;(i=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),i.set(r,this.leftOver.length)}else i=this.leftOver.concat(i);this.leftOver=null}var n=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0?e:0===i?e:i+h[t[i]]>e?i:e}(i),a=i;n!==i.length&&(s.uint8array?(a=i.subarray(0,n),this.leftOver=i.subarray(n,i.length)):(a=i.slice(0,n),this.leftOver=i.slice(n,i.length))),this.push({data:e.utf8decode(a),meta:t.meta})},r.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},e.Utf8DecodeWorker=r,o.inherits(n,l),n.prototype.processChunk=function(t){this.push({data:e.utf8encode(t.data),meta:t.meta})},e.Utf8EncodeWorker=n},function(t,e,i){"use strict";var r=null;r="undefined"!=typeof Promise?Promise:i(74),t.exports={Promise:r}},function(t,e,i){(function(t){function i(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===i(t)},e.isBoolean=function(t){return"boolean"==typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===i(t)},e.isObject=function(t){return"object"==typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===i(t)},e.isError=function(t){return"[object Error]"===i(t)||t instanceof Error},e.isFunction=function(t){return"function"==typeof t},e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=t.isBuffer}).call(this,i(10).Buffer)},function(t,e,i){"use strict";(function(t){function r(){return o.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function n(t,e){if(r()<e)throw new RangeError("Invalid typed array length");return o.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=o.prototype:(null===t&&(t=new o(e)),t.length=e),t}function o(t,e,i){if(!(o.TYPED_ARRAY_SUPPORT||this instanceof o))return new o(t,e,i);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return s(this,t,e,i)}function s(t,e,i,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,
vendor: 4,202 bytes, line 106
106i,r){if(e.byteLength,i<0||e.byteLength<i)throw new RangeError("'offset' is out of bounds");if(e.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===i&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,i):new Uint8Array(e,i,r),o.TYPED_ARRAY_SUPPORT?(t=e).__proto__=o.prototype:t=h(t,e),t}(t,e,i,r):"string"==typeof e?function(t,e,i){if("string"==typeof i&&""!==i||(i="utf8"),!o.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|c(e,i),s=(t=n(t,r)).write(e,i);return s!==r&&(t=t.slice(0,s)),t}(t,e,i):function(t,e){if(o.isBuffer(e)){var i=0|u(e.length);return 0===(t=n(t,i)).length?t:(e.copy(t,0,0,i),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?n(t,0):h(t,e);if("Buffer"===e.type&&W(e.data))return h(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(a(e),t=n(t,e<0?0:0|u(e)),!o.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function h(t,e){var i=e.length<0?0:0|u(e.length);t=n(t,i);for(var r=0;r<i;r+=1)t[r]=255&e[r];return t}function u(t){if(t>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function c(t,e){if(o.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return k(t).length;default:if(r)return D(t).length;e=(""+e).toLowerCase(),r=!0}}function d(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function f(t,e,i,r,n){if(0===t.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof e&&(e=o.from(e,r)),o.isBuffer(e))return 0===e.length?-1:p(t,e,i,r,n);if("number"==typeof e)return e&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):p(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}function p(t,e,i,r,n){function o(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var s,a=1,l=t.length,h=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,l/=2,h/=2,i/=2}if(n){var u=-1;for(s=i;s<l;s++)if(o(t,s)===o(e,-1===u?0:s-u)){if(-1===u&&(u=s),s-u+1===h)return u*a}else-1!==u&&(s-=s-u),u=-1}else for(i+h>l&&(i=l-h),s=i;s>=0;s--){for(var c=!0,d=0;d<h;d++)if(o(t,s+d)!==o(e,d)){c=!1;break}if(c)return s}return-1}function g(t,e,i,r){i=Number(i)||0;var n=t.length-i;r?(r=Number(r))>n&&(r=n):r=n;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[i+s]=a}return s}function m(t,e,i,r){return V(D(e,t.length-i),t,i,r)}function y(t,e,i,r){return V(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,r)}function E(t,e,i,r){return y(t,e,i,r)}function v(t,e,i,r){return V(k(e),t,i,r)}function _(t,e,i,r){return V(function(t,e){for(var i,r,n,o=[],s=0;s<t.length&&!((e-=2)<0);++s)i=t.charCodeAt(s),r=i>>8,n=i%256,o.push(n),o.push(r);return o}(e,t.length-i),t,i,r)}function b(t,e,i){return 0===e&&i===t.length?F.fromByteArray(t):F.fromByteArray(t.slice(e,i))}function S(t,e,i){i=Math.min(t.length,i);for(var r=[],n=e;n<i;){var o,s,a,l,h=t[n],u=null,c=h>239?4:h>223?3:h>191?2:1;if(n+c<=i)switch(c){case 1:h<128&&(u=h);break;
vendor: 6,492 bytes, line 106
106case 2:128==(192&(o=t[n+1]))&&(l=(31&h)<<6|63&o)>127&&(u=l);break;case 3:o=t[n+1],s=t[n+2],128==(192&o)&&128==(192&s)&&(l=(15&h)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=t[n+1],s=t[n+2],a=t[n+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(u=l)}null===u?(u=65533,c=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),n+=c}return function(t){var e=t.length;if(e<=B)return String.fromCharCode.apply(String,t);for(var i="",r=0;r<e;)i+=String.fromCharCode.apply(String,t.slice(r,r+=B));return i}(r)}function w(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;n<i;++n)r+=String.fromCharCode(127&t[n]);return r}function L(t,e,i){var r="";i=Math.min(t.length,i);for(var n=e;n<i;++n)r+=String.fromCharCode(t[n]);return r}function T(t,e,i){var r=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>r)&&(i=r);for(var n="",o=e;o<i;++o)n+=I(t[o]);return n}function x(t,e,i){for(var r=t.slice(e,i),n="",o=0;o<r.length;o+=2)n+=String.fromCharCode(r[o]+256*r[o+1]);return n}function R(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,i,r,n,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(i+r>t.length)throw new RangeError("Index out of range")}function C(t,e,i,r){e<0&&(e=65535+e+1);for(var n=0,o=Math.min(t.length-i,2);n<o;++n)t[i+n]=(e&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function A(t,e,i,r){e<0&&(e=4294967295+e+1);for(var n=0,o=Math.min(t.length-i,4);n<o;++n)t[i+n]=e>>>8*(r?n:3-n)&255}function P(t,e,i,r,n,o){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function N(t,e,i,r,n){return n||P(t,0,i,4),G.write(t,e,i,r,23,4),i+4}function O(t,e,i,r,n){return n||P(t,0,i,8),G.write(t,e,i,r,52,8),i+8}function I(t){return t<16?"0"+t.toString(16):t.toString(16)}function D(t,e){var i;e=e||1/0;for(var r=t.length,n=null,o=[],s=0;s<r;++s){if((i=t.charCodeAt(s))>55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function k(t){return F.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(U,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function V(t,e,i,r){for(var n=0;n<r&&!(n+i>=e.length||n>=t.length);++n)e[n+i]=t[n];return n}var F=i(102),G=i(101),W=i(51);e.Buffer=o,e.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},e.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=r(),o.poolSize=8192,o._augment=function(t){return t.__proto__=o.prototype,t},o.from=function(t,e,i){return s(null,t,e,i)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(t,e,i){return function(t,e,i,r){return a(e),e<=0?n(t,e):void 0!==i?"string"==typeof r?n(t,e).fill(i,r):n(t,e).fill(i):n(t,e)}(null,t,e,i)},o.allocUnsafe=function(t){return l(null,t)},o.allocUnsafeSlow=function(t){return l(null,t)},o.isBuffer=function(t){return!(null==t||!t._isBuffer)},o.compare=function(t,e){if(!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,r=e.length,n=0,s=Math.min(i,r);n<s;++n)if(t[n]!==e[n]){i=t[n],r=e[n];break}return i<r?-1:r<i?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!W(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var r=o.allocUnsafe(e),n=0;for(i=0;i<t.length;++i){var s=t[i];if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,n),n+=s.length}return r},o.byteLength=c,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},o.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):function(t,e,i){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,i);case"utf8":case"utf-8":return S(this,e,i);case"ascii":return w(this,e,i);case"latin1":case"binary":return L(this,e,i);case"base64":return b(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+t+">"}
vendor: 4,226 bytes, line 106
106,o.prototype.compare=function(t,e,i,r,n){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),e<0||i>t.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&e>=i)return 0;if(r>=n)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,r>>>=0,n>>>=0,this===t)return 0;for(var s=n-r,a=i-e,l=Math.min(s,a),h=this.slice(r,n),u=t.slice(e,i),c=0;c<l;++c)if(h[c]!==u[c]){s=h[c],a=u[c];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},o.prototype.indexOf=function(t,e,i){return f(this,t,e,i,!0)},o.prototype.lastIndexOf=function(t,e,i){return f(this,t,e,i,!1)},o.prototype.write=function(t,e,i,r){if(void 0===e)r="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)r=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-e;if((void 0===i||i>n)&&(i=n),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return g(this,t,e,i);case"utf8":case"utf-8":return m(this,t,e,i);case"ascii":return y(this,t,e,i);case"latin1":case"binary":return E(this,t,e,i);case"base64":return v(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var B=4096;o.prototype.slice=function(t,e){var i,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),o.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=o.prototype;else{var n=e-t;i=new o(n,void 0);for(var s=0;s<n;++s)i[s]=this[s+t]}return i},o.prototype.readUIntLE=function(t,e,i){t|=0,e|=0,i||R(t,e,this.length);for(var r=this[t],n=1,o=0;++o<e&&(n*=256);)r+=this[t+o]*n;return r},o.prototype.readUIntBE=function(t,e,i){t|=0,e|=0,i||R(t,e,this.length);for(var r=this[t+--e],n=1;e>0&&(n*=256);)r+=this[t+--e]*n;return r},o.prototype.readUInt8=function(t,e){return e||R(t,1,this.length),this[t]},o.prototype.readUInt16LE=function(t,e){return e||R(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUInt16BE=function(t,e){return e||R(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUInt32LE=function(t,e){return e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUInt32BE=function(t,e){return e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||R(t,e,this.length);for(var r=this[t],n=1,o=0;++o<e&&(n*=256);)r+=this[t+o]*n;return r>=(n*=128)&&(r-=Math.pow(2,8*e)),r},o.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||R(t,e,this.length);for(var r=e,n=1,o=this[t+--r];r>0&&(n*=256);)o+=this[t+--r]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){e||R(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt16BE=function(t,e){e||R(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt32LE=function(t,e){return e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return e||R(t,4,this.length),G.read(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return e||R(t,4,this.length),G.read(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return e||R(t,8,this.length),G.read(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return e||R(t,8,this.length),G.read(this,t,!1,52,8)},o.prototype.writeUIntLE=function(t,e,i,r){t=+t,e|=0,i|=0,r||M(this,t,e,i,Math.pow(2,8*i)-1,0);var n=1,o=0;for(this[e]=255&t;++o<i&&(n*=256);)this[e+o]=t/n&255;return e+i}
vendor: 4,246 bytes, line 106
106,o.prototype.writeUIntBE=function(t,e,i,r){t=+t,e|=0,i|=0,r||M(this,t,e,i,Math.pow(2,8*i)-1,0);var n=i-1,o=1;for(this[e+n]=255&t;--n>=0&&(o*=256);)this[e+n]=t/o&255;return e+i},o.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,1,255,0),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},o.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):C(this,t,e,!0),e+2},o.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):C(this,t,e,!1),e+2},o.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):A(this,t,e,!0),e+4},o.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):A(this,t,e,!1),e+4},o.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);M(this,t,e,i,n-1,-n)}var o=0,s=1,a=0;for(this[e]=255&t;++o<i&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+i},o.prototype.writeIntBE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);M(this,t,e,i,n-1,-n)}var o=i-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+i},o.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,1,127,-128),o.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):C(this,t,e,!0),e+2},o.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):C(this,t,e,!1),e+2},o.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):A(this,t,e,!0),e+4},o.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),o.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):A(this,t,e,!1),e+4},o.prototype.writeFloatLE=function(t,e,i){return N(this,t,e,!0,i)},o.prototype.writeFloatBE=function(t,e,i){return N(this,t,e,!1,i)},o.prototype.writeDoubleLE=function(t,e,i){return O(this,t,e,!0,i)},o.prototype.writeDoubleBE=function(t,e,i){return O(this,t,e,!1,i)},o.prototype.copy=function(t,e,i,r){if(i||(i=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-i&&(r=t.length-e+i);var n,s=r-i;if(this===t&&i<e&&e<r)for(n=s-1;n>=0;--n)t[n+e]=this[n+i];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(n=0;n<s;++n)t[n+e]=this[n+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+s),e);return s},o.prototype.fill=function(t,e,i,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===t.length){var n=t.charCodeAt(0);n<256&&(t=n)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var s;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(s=e;s<i;++s)this[s]=t;else{var a=o.isBuffer(t)?t:D(new o(t,r).toString()),l=a.length;for(s=0;s<i-e;++s)this[s+e]=a[s%l]}return this};var U=/[^+\/0-9A-Za-z-_]/g}).call(this,i(5))},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)}
vendor: 4,103 bytes, line 106
106,function(t,e,i){"use strict";(function(e){t.exports={isNode:void 0!==e,newBufferFrom:function(t,i){return new e(t,i)},allocBuffer:function(t){return e.alloc?e.alloc(t):new e(t)},isBuffer:function(t){return e.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}}).call(this,i(10).Buffer)},function(t,e,i){function r(t,e){for(var i in t)e[i]=t[i]}function n(t,e,i){return s(t,e,i)}var o=i(10),s=o.Buffer;s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?t.exports=o:(r(o,e),e.Buffer=n),r(s,n),n.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return s(t,e,i)},n.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=s(t);return void 0!==e?"string"==typeof i?r.fill(e,i):r.fill(e):r.fill(0),r},n.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return s(t)},n.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o.SlowBuffer(t)}},function(t,e,i){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,i,r,n){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,i)});case 3:return e.nextTick(function(){t.call(null,i,r)});case 4:return e.nextTick(function(){t.call(null,i,r,n)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return e.nextTick(function(){t.apply(null,o)})}}}:t.exports=e}).call(this,i(15))},function(t,e){function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function n(t){if(h===setTimeout)return setTimeout(t,0);if((h===i||!h)&&setTimeout)return h=setTimeout,setTimeout(t,0);try{return h(t,0)}catch(e){try{return h.call(null,t,0)}catch(e){return h.call(this,t,0)}}}function o(){p&&d&&(p=!1,d.length?f=d.concat(f):g=-1,f.length&&s())}function s(){if(!p){var t=n(o);p=!0;for(var e=f.length;e;){for(d=f,f=[];++g<e;)d&&d[g].run();g=-1,e=f.length}d=null,p=!1,function(t){if(u===clearTimeout)return clearTimeout(t);if((u===r||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(t);try{u(t)}catch(e){try{return u.call(null,t)}catch(e){return u.call(this,t)}}}(t)}}function a(t,e){this.fun=t,this.array=e}function l(){}var h,u,c=t.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:i}catch(t){h=i}try{u="function"==typeof clearTimeout?clearTimeout:r}catch(t){u=r}}();var d,f=[],p=!1,g=-1;c.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];f.push(new a(t,e)),1!==f.length||p||n(s)},a.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=l,c.addListener=l,c.once=l,c.off=l,c.removeListener=l,c.removeAllListeners=l,c.emit=l,c.prependListener=l,c.prependOnceListener=l,c.listeners=function(t){return[]},c.binding=function(t){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(t){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},function(t,e,i){"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"}},function(t,e,i){"use strict";var r=i(0),n=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();t.exports=function(t,e){return void 0!==t&&t.length?"string"!==r.getTypeOf(t)?function(t,e,i,r){var o=n,s=0+i;t^=-1;for(var a=0;a<s;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}(0|e,t,t.length):function(t,e,i,r){var o=n,s=0+i;t^=-1;for(var a=0;a<s;a++)t=t>>>8^o[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length):0}}
106,function(t,e,i){"use strict";function r(t,e,i,r,n){this.compressedSize=t,this.uncompressedSize=e,this.crc32=i,this.compression=r,this.compressedContent=n}var n=i(8),o=i(37),s=i(36),a=i(35);s=i(36),r.prototype={getContentWorker:function(){var t=new o(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new o(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},r.createWorkerFrom=function(t,e,i){return t.pipe(new a).pipe(new s("uncompressedSize")).pipe(e.compressWorker(i)).pipe(new s("compressedSize")).withStreamInfo("compression",e)},t.exports=r},function(t,e,i){t.exports=!i(41)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){"use strict";(function(e,r,n){function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var r=t.entry;for(t.entry=null;r;){var n=r.callback;e.pendingcb--,n(void 0),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}function s(){}function a(t,e){m=m||i(4),t=t||{};var r=e instanceof m;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,s=t.writableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var i=t._writableState,r=i.sync,n=i.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(i),e)!function(t,e,i,r,n){--e.pendingcb,i?(g.nextTick(n,r),g.nextTick(p,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(n(r),t._writableState.errorEmitted=!0,t.emit("error",r),p(t,e))}(t,i,r,e,n);else{var o=d(i);o||i.corked||i.bufferProcessing||!i.bufferedRequest||c(t,i),r?y(u,t,i,o,n):u(t,i,o,n)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function l(t){if(m=m||i(4),!(v.call(l,this)||this instanceof m))return new l(t);this._writableState=new a(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),b.call(this)}function h(t,e,i,r,n,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0, 107i?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function u(t,e,i,r){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),p(t,e)}function c(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var r=e.bufferedRequestCount,n=new Array(r),s=e.corkedRequestsFree;s.entry=i;for(var a=0,l=!0;i;)n[a]=i,i.isBuf||(l=!1),i=i.next,a+=1;n.allBuffers=l,h(t,e,!0,e.length,n,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;i;){var u=i.chunk,c=i.encoding,d=i.callback;if(h(t,e,!1,e.objectMode?1:u.length,u,c,d),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function d(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function f(t,e){t._final(function(i){e.pendingcb--,i&&t.emit("error",i),e.prefinished=!0,t.emit("prefinish"),p(t,e)})}function p(t,e){var i=d(e);return i&&(function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,g.nextTick(f,t,e)):(e.prefinished=!0,t.emit("prefinish")))}
vendor: 1,847 bytes, line 107
107(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),i}var g=i(14);t.exports=l;var m,y=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?r:g.nextTick;l.WritableState=a;var E=i(9);E.inherits=i(6);var v,_={deprecate:i(94)},b=i(48),S=i(13).Buffer,w=n.Uint8Array||function(){},L=i(47);E.inherits(l,b),a.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(a.prototype,"buffer",{get:_.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(v=Function.prototype[Symbol.hasInstance],Object.defineProperty(l,Symbol.hasInstance,{value:function(t){return!!v.call(this,t)||this===l&&t&&t._writableState instanceof a}})):v=function(t){return t instanceof this},l.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},l.prototype.write=function(t,e,i){var r=this._writableState,n=!1,o=!r.objectMode&&function(t){return S.isBuffer(t)||t instanceof w}(t);return o&&!S.isBuffer(t)&&(t=function(t){return S.from(t)}(t)),"function"==typeof e&&(i=e,e=null),o?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof i&&(i=s),r.ended?function(t,e){var i=new Error("write after end");t.emit("error",i),g.nextTick(e,i)}(this,i):(o||function(t,e,i,r){var n=!0,o=!1;return null===i?o=new TypeError("May not write null values to stream"):"string"==typeof i||void 0===i||e.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(t.emit("error",o),g.nextTick(r,o),n=!1),n}(this,r,t,i))&&(r.pendingcb++,n=function(t,e,i,r,n,o){if(!i){var s=function(t,e,i){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=S.from(e,i
vendor: 4,473 bytes, line 107
107)),e}(e,r,n);r!==s&&(i=!0,n="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:n,isBuf:i,callback:o,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else h(t,e,!1,a,r,n,o);return l}(this,r,o,t,e,i)),n},l.prototype.cork=function(){this._writableState.corked++},l.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||c(this,t))},l.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),l.prototype._write=function(t,e,i){i(new Error("_write() is not implemented"))},l.prototype._writev=null,l.prototype.end=function(t,e,i){var r=this._writableState;"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,i){e.ending=!0,p(t,e),i&&(e.finished?g.nextTick(i):t.once("finish",i)),e.ended=!0,t.writable=!1}(this,r,i)},Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),l.prototype.destroy=L.destroy,l.prototype._undestroy=L.undestroy,l.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,i(15),i(96).setImmediate,i(5))},function(t,e,i){(e=t.exports=i(49)).Stream=e,e.Readable=e,e.Writable=i(21),e.Duplex=i(4),e.Transform=i(45),e.PassThrough=i(93)},function(t,e){function i(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function n(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=i,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._maxListeners=void 0,i.defaultMaxListeners=10,i.prototype.setMaxListeners=function(t){if(!function(t){return"number"==typeof t}(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},i.prototype.emit=function(t){var e,i,s,a,l,h;if(this._events||(this._events={}),"error"===t&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var u=new Error('Uncaught, unspecified "error" event. ('+e+")");throw u.context=e,u}if(o(i=this._events[t]))return!1;if(r(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),i.apply(this,a)}else if(n(i))for(a=Array.prototype.slice.call(arguments,1),s=(h=i.slice()).length,l=0;l<s;l++)h[l].apply(this,a);return!0},i.prototype.addListener=function(t,e){var s;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?n(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,n(this._events[t])&&!this._events[t].warned&&(s=o(this._maxListeners)?i.defaultMaxListeners:this._maxListeners)&&s>0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){function i(){this.removeListener(t,i),n||(n=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var n=!1;return i.listener=e,this.on(t,i),this},i.prototype.removeListener=function(t,e){var i,o,s,a;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(s=(i=this._events[t]).length,o=-1,i===e||r(i.listener)&&i.listener===e)delete this._events[t],this._events.removeListener&&this.emit
107("removeListener",t,e);else if(n(i)){for(a=s;a-- >0;)if(i[a]===e||i[a].listener&&i[a].listener===e){o=a;break}if(o<0)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},i.prototype.removeAllListeners=function(t){var e,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r(i=this._events[t]))this.removeListener(t,i);else if(i)for(;i.length;)this.removeListener(t,i[i.length-1]);return delete this._events[t],this},i.prototype.listeners=function(t){return this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},i.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},i.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,i){"use strict";function r(t){n.call(this,t)}var n=i(26);i(0).inherits(r,n),r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,i){"use strict";function r(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}var n=i(0);r.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(t){},readInt:function(t){var e,i=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)i=(i<<8)+this.byteAt(e);return this.index+=t,i},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},t.exports=r},function(t,e,i){"use strict";function r(t){n.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}var n=i(25);i(0).inherits(r,n),r.prototype.byteAt=function(t){return this.data[this.zero+t]},r.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),i=t.charCodeAt(1),r=t.charCodeAt(2),n=t.charCodeAt(3),o=this.length-4;o>=0;--o)if(this.data[o]===e&&this.data[o+1]===i&&this.data[o+2]===r&&this.data[o+3]===n)return o-this.zero;return-1},r.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),i=t.charCodeAt(1),r=t.charCodeAt(2),n=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&i===o[1]&&r===o[2]&&n===o[3]},r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,i){"use strict";var r=i(0),n=i(3),o=i(26),s=i(54),a=i(53),l=i(24);t.exports=function(t){var e=r.getTypeOf(t);return r.checkSupport(e),"string"!==e||n.uint8array?"nodebuffer"===e?new a(t):n.uint8array?new l(r.transformTo("uint8array",t)):new o(r.transformTo("array",t)):new s(t)}},function(t,e,i){"use strict";e.LOCAL_FILE_HEADER="PK��",e.CENTRAL_FILE_HEADER="PK��",e.CENTRAL_DIRECTORY_END="PK��",e.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK��",e.ZIP64_CENTRAL_DIRECTORY_END="PK��",e.DATA_DESCRIPTOR="PK�\b"},function(t,e,i){"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}},function(t,e,i){"use strict";t.exports=function(){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}}
vendor: 4,181 bytes, line 107
107,function(t,e,i){"use strict";function r(t,e){if(e<65537&&(t.subarray&&s||!t.subarray&&o))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var i="",r=0;r<e;r++)i+=String.fromCharCode(t[r]);return i}var n=i(2),o=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(t){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){s=!1}for(var a=new n.Buf8(256),l=0;l<256;l++)a[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;a[254]=a[254]=1,e.string2buf=function(t){var e,i,r,o,s,a=t.length,l=0;for(o=0;o<a;o++)55296==(64512&(i=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),l+=i<128?1:i<2048?2:i<65536?3:4;for(e=new n.Buf8(l),s=0,o=0;s<l;o++)55296==(64512&(i=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),i<128?e[s++]=i:i<2048?(e[s++]=192|i>>>6,e[s++]=128|63&i):i<65536?(e[s++]=224|i>>>12,e[s++]=128|i>>>6&63,e[s++]=128|63&i):(e[s++]=240|i>>>18,e[s++]=128|i>>>12&63,e[s++]=128|i>>>6&63,e[s++]=128|63&i);return e},e.buf2binstring=function(t){return r(t,t.length)},e.binstring2buf=function(t){for(var e=new n.Buf8(t.length),i=0,r=e.length;i<r;i++)e[i]=t.charCodeAt(i);return e},e.buf2string=function(t,e){var i,n,o,s,l=e||t.length,h=new Array(2*l);for(n=0,i=0;i<l;)if((o=t[i++])<128)h[n++]=o;else if((s=a[o])>4)h[n++]=65533,i+=s-1;else{for(o&=2===s?31:3===s?15:7;s>1&&i<l;)o=o<<6|63&t[i++],s--;s>1?h[n++]=65533:o<65536?h[n++]=o:(o-=65536,h[n++]=55296|o>>10&1023,h[n++]=56320|1023&o)}return r(h,n)},e.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0?e:0===i?e:i+a[t[i]]>e?i:e}},function(t,e,i){"use strict";var r=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();t.exports=function(t,e,i,n){var o=r,s=n+i;t^=-1;for(var a=n;a<s;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}},function(t,e,i){"use strict";t.exports=function(t,e,i,r){for(var n=65535&t|0,o=t>>>16&65535|0,s=0;0!==i;){i-=s=i>2e3?2e3:i;do{o=o+(n=n+e[r++]|0)|0}while(--s);n%=65521,o%=65521}return n|o<<16|0}},function(t,e,i){"use strict";var r=i(1);e.STORE={magic:"\0\0",compressWorker:function(t){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},e.DEFLATE=i(68)},function(t,e,i){"use strict";function r(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var n=i(1),o=i(17);i(0).inherits(r,n),r.prototype.processChunk=function(t){this.streamInfo.crc32=o(t.data,this.streamInfo.crc32||0),this.push(t)},t.exports=r},function(t,e,i){"use strict";function r(t){o.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}var n=i(0),o=i(1);n.inherits(r,o),r.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}o.prototype.processChunk.call(this,t)},t.exports=r},function(t,e,i){"use strict";function r(t){o.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=n.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}var n=i(0),o=i(1);n.inherits(r,o),r.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=r}
107,function(t,e,i){"use strict";e.base64=!1,e.binary=!1,e.dir=!1,e.createFolders=!0,e.date=null,e.compression=null,e.compressionOptions=null,e.comment=null,e.unixPermissions=null,e.dosPermissions=null},function(t,e,i){"use strict";(function(e){function r(t,i){return new u.Promise(function(r,n){var s=[],a=t._internalType,h=t._outputType,u=t._mimeType;t.on("data",function(t,e){s.push(t),i&&i(e)}).on("error",function(t){s=[],n(t)}).on("end",function(){try{var t=function(t,e,i){switch(t){case"blob":return o.newBlob(o.transformTo("arraybuffer",e),i);case"base64":return l.encode(e);default:return o.transformTo(t,e)}}(h,function(t,i){var r,n=0,o=null,s=0;for(r=0;r<i.length;r++)s+=i[r].length;switch(t){case"string":return i.join("");case"array":return Array.prototype.concat.apply([],i);case"uint8array":for(o=new Uint8Array(s),r=0;r<i.length;r++)o.set(i[r],n),n+=i[r].length;return o;case"nodebuffer":return e.concat(i);default:throw new Error("concat : unsupported type '"+t+"'")}}(a,s),u);r(t)}catch(t){n(t)}s=[]}).resume()})}function n(t,e,i){var r=e;switch(e){case"blob":case"arraybuffer":r="uint8array";break;case"base64":r="string"}try{this._internalType=r,this._outputType=e,this._mimeType=i,o.checkSupport(r),this._worker=t.pipe(new s(r)),t.lock()}catch(t){this._worker=new a("error"),this._worker.error(t)}}var o=i(0),s=i(72),a=i(1),l=i(44),h=i(3),u=i(8),c=null;if(h.nodestream)try{c=i(71)}catch(t){}n.prototype={accumulate:function(t){return r(this,t)},on:function(t,e){var i=this;return"data"===t?this._worker.on(t,function(t){e.call(i,t.data,t.meta)}):this._worker.on(t,function(){o.delay(e,arguments,i)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(o.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},t)}},t.exports=n}).call(this,i(10).Buffer)},function(t,e,i){var r=i(20),n=i(11).document,o=r(n)&&r(n.createElement);t.exports=function(t){return o?n.createElement(t):{}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,i){var r=i(85);t.exports=function(t,e,i){if(r(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,r){return t.call(e,i,r)};case 3:return function(i,r,n){return t.call(e,i,r,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){var i=t.exports={version:"2.3.0"};"number"==typeof __e&&(__e=i)},function(t,e,i){"use strict";var r=i(0),n=i(3),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.encode=function(t){for(var e,i,n,s,a,l,h,u=[],c=0,d=t.length,f=d,p="string"!==r.getTypeOf(t);c<t.length;)f=d-c,p?(e=t[c++],i=c<d?t[c++]:0,n=c<d?t[c++]:0):(e=t.charCodeAt(c++),i=c<d?t.charCodeAt(c++):0,n=c<d?t.charCodeAt(c++):0),s=e>>2,a=(3&e)<<4|i>>4,l=f>1?(15&i)<<2|n>>6:64,h=f>2?63&n:64,u.push(o.charAt(s)+o.charAt(a)+o.charAt(l)+o.charAt(h));return u.join("")},e.decode=function(t){var e,i,r,s,a,l,h=0,u=0;if("data:"===t.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var c,d=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===o.charAt(64)&&d--,t.charAt(t.length-2)===o.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(c=n.uint8array?new Uint8Array(0|d):new Array(0|d);h<t.length;)e=o.indexOf(t.charAt(h++))<<2|(s=o.indexOf(t.charAt(h++)))>>4,i=(15&s)<<4|(a=o.indexOf(t.charAt(h++)))>>2,r=(3&a)<<6|(l=o.indexOf(t.charAt(h++))),c[u++]=e,64!==a&&(c[u++]=i),64!==l&&(c[u++]=r);return c}},function(t,e,i){"use strict";function r(t){if(!(this instanceof r))return new r(t);s.call(this,t),this._transformState={afterTransform:function(t,e){var i=this._transformState;i.transforming=!1;var r=i.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));i.writechunk=null,i.writecb=null,null!=e&&this.push(e),r(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",n)}function n(){var t=this;"function"==typeof this._flush?this._flush(function(e,i){o(t,e,i)}):o(this,null,null)}function o(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}t.exports=r;var s=i(4),a=i(9);a.inherits=i(6),a.inherits(r,s),r.prototype.push=function(t,e){return this._transformState.needTransform=!1,s.prototype.push.call(this,t,e)}
vendor: 4,218 bytes, line 107
107,r.prototype._transform=function(t,e,i){throw new Error("_transform() is not implemented")},r.prototype._write=function(t,e,i){var r=this._transformState;if(r.writecb=i,r.writechunk=t,r.writeencoding=e,!r.transforming){var n=this._readableState;(r.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},r.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},r.prototype._destroy=function(t,e){var i=this;s.prototype._destroy.call(this,t,function(t){e(t),i.emit("close")})}},function(t,e,i){"use strict";function r(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(d.isEncoding===f||!f(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=s,this.end=a,e=4;break;case"utf8":this.fillLast=o,e=4;break;case"base64":this.text=l,this.end=h,e=3;break;default:return this.write=u,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=d.allocUnsafe(e)}function n(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function o(t){var e=this.lastTotal-this.lastNeed,i=function(t,e,i){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==i?i:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2==0){var i=t.toString("utf16le",e);if(i){var r=i.charCodeAt(i.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function a(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function l(t,e){var i=(t.length-e)%3;return 0===i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function u(t){return t.toString(this.encoding)}function c(t){return t&&t.length?this.write(t):""}var d=i(13).Buffer,f=d.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};e.StringDecoder=r,r.prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""},r.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},r.prototype.text=function(t,e){var i=function(t,e,i){var r=e.length-1;if(r<i)return 0;var o=n(e[r]);return o>=0?(o>0&&(t.lastNeed=o-1),o):--r<i||-2===o?0:(o=n(e[r]))>=0?(o>0&&(t.lastNeed=o-2),o):--r<i||-2===o?0:(o=n(e[r]))>=0?(o>0&&(2===o?o=0:t.lastNeed=o-3),o):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var r=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},r.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}}
vendor: 4,472 bytes, line 107
107,function(t,e,i){"use strict";function r(t,e){t.emit("error",e)}var n=i(14);t.exports={destroy:function(t,e){var i=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(r,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(n.nextTick(r,i,t),i._writableState&&(i._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,i){t.exports=i(23).EventEmitter},function(t,e,i){"use strict";(function(e,r){function n(t,e){b=b||i(4),t=t||{};var r=e instanceof b;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,o=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:r&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new P,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(A||(A=i(46).StringDecoder),this.decoder=new A(t.encoding),this.encoding=t.encoding)}function o(t){if(b=b||i(4),!(this instanceof o))return new o(t);this._readableState=new n(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),L.call(this)}function s(t,e,i,r,n){var o,s=t._readableState;return null===e?(s.reading=!1,function(t,e){if(!e.ended){if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,h(t)}}(t,s)):(n||(o=function(t,e){var i;return function(t){return T.isBuffer(t)||t instanceof x}(e)||"string"==typeof e||void 0===e||t.objectMode||(i=new TypeError("Invalid non-string/buffer chunk")),i}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===T.prototype||(e=function(t){return T.from(t)}(e)),r?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):a(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!i?(e=s.decoder.write(e),s.objectMode||0!==e.length?a(t,s,e,!1):c(t,s)):a(t,s,e,!1))):r||(s.reading=!1)),function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(s)}function a(t,e,i,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",i),t.read(0)):(e.length+=e.objectMode?1:i.length,r?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&h(t)),c(t,e)}function l(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=I?t=I:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function h(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(C("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?_.nextTick(u,t):u(t))}function u(t){C("emit readable"),t.emit("readable"),g(t)}function c(t,e){e.readingMore||(e.readingMore=!0,_.nextTick(d,t,e))}function d(t,e){for(var i=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(C("maybeReadMore read 0"),t.read(0),i!==e.length);)i=e.length;e.readingMore=!1}function f(t){C("readable nexttick read 0"),t.read(0)}function p(t,e){e.reading||(C("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),g(t),e.flowing&&!e.reading&&t.read(0)}function g(t){var e=t._readableState;for(C("flow",e.flowing);e.flowing&&null!==t.read(););}function m(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):i=function(t,e,
vendor: 4,561 bytes, lines 107-108
107i){var r;return t<e.head.data.length?(r=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):r=t===e.head.data.length?e.shift():i?function(t,e){var i=e.head,r=1,n=i.data;for(t-=n.length;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(s===o.length?n+=o:n+=o.slice(0,t),0==(t-=s)){s===o.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++r}return e.length-=r,n}(t,e):function(t,e){var i=T.allocUnsafe(t),r=e.head,n=1;for(r.data.copy(i),t-=r.data.length;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(i,i.length-t,0,s),0==(t-=s)){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}(t,e),r}(t,e.buffer,e.decoder),i);var i}function y(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,_.nextTick(E,e,t))}function E(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function v(t,e){for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}var _=i(14);t.exports=o;var b,S=i(51);o.ReadableState=n,i(23).EventEmitter;var w=function(t,e){return t.listeners(e).length},L=i(48),T=i(13).Buffer,x=e.Uint8Array||function(){},R=i(9);R.inherits=i(6);var M=i(99),C=void 0;C=M&&M.debuglog?M.debuglog("stream"):function(){};var A,P=i(98),N=i(47);R.inherits(o,L);var O=["error","close","destroy","pause","resume"];Object.defineProperty(o.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),o.prototype.destroy=N.destroy,o.prototype._undestroy=N.undestroy,o.prototype._destroy=function(t,e){this.push(null),e(t)},o.prototype.push=function(t,e){var i,r=this._readableState;return r.objectMode?i=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=T.from(t,e),e=""),i=!0),s(this,t,e,!1,i)},o.prototype.unshift=function(t){return s(this,t,null,!0,!1)},o.prototype.isPaused=function(){return!1===this._readableState.flowing},o.prototype.setEncoding=function(t){return A||(A=i(46).StringDecoder),this._readableState.decoder=new A(t),this._readableState.encoding=t,this};var I=8388608 108;o.prototype.read=function(t){C("read",t),t=parseInt(t,10);var e=this._readableState,i=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return C("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?y(this):h(this),null;if(0===(t=l(t,e))&&e.ended)return 0===e.length&&y(this),null;var r,n=e.needReadable;return C("need readable",n),(0===e.length||e.length-t<e.highWaterMark)&&C("length less than watermark",n=!0),e.ended||e.reading?C("reading or ended",n=!1):n&&(C("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=l(i,e))),null===(r=t>0?m(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&y(this)),null!==r&&this.emit("data",r),r},o.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},o.prototype.pipe=function(t,e){function i(e,r){C("onunpipe"),e===u&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,C("cleanup"),t.removeListener("close",a),t.removeListener("finish",l),t.removeListener("drain",f),t.removeListener("error",s),t.removeListener("unpipe",i),u.removeListener("end",n),u.removeListener("end",h),u.removeListener("data",o),p=!0,!c.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function n(){C("onend"),t.end()}function o(e){C("ondata"),m=!1,!1!==t.write(e)||m||((1===c.pipesCount&&c.pipes===t||c.pipesCount>1&&-1!==v(c.pipes,t))&&!p&&(C("false write response, pause",u._readableState.awaitDrain),u._readableState.awaitDrain++,m=!0),u.pause())}function s(e){C("onerror",e),h(),t.removeListener("error",s),0===w(t,"error")&&t.emit("error",e)}function a(){t.removeListener("finish",l),h()}function l(){C("onfinish"),t.removeListener("close",a),h()}function h(){C("unpipe"),u.unpipe(t)}var u=this,c=this._readableState;switch(c.pipesCount){case 0:c.pipes=t;break;case 1:c.pipes=[c.pipes,t];break;default:c.pipes.push(t)}c.pipesCount+=1,C("pipe count=%d opts=%j",c.pipesCount,e);var d=e&&!1===e.end||t===r.stdout||t===r.stderr?h:n;c.endEmitted?_.nextTick(d):u.once("end",d),t.on("unpipe",i);var f=function(t){return function(){var e=t._readableState;C("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&w(t,"data")&&(e.flowing=!0,g(t))}}(u);t.on("drain",f);var p=!1,m=!1;
108return u.on("data",o),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events[e]?S(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]:t.on(e,i)}(t,"error",s),t.once("close",a),t.once("finish",l),t.emit("pipe",u),c.flowing||(C("pipe resume"),u.resume()),t},o.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)r[o].emit("unpipe",this,i);return this}var s=v(e.pipes,t);return-1===s?this:(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i),this)},o.prototype.on=function(t,e){var i=L.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&h(this):_.nextTick(f,this))}return i},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){var t=this._readableState;return t.flowing||(C("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,_.nextTick(p,t,e))}(this,t)),this},o.prototype.pause=function(){return C("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(C("pause"),this._readableState.flowing=!1,this.emit("pause")),this},o.prototype.wrap=function(t){var e=this,i=this._readableState,r=!1;for(var n in t.on("end",function(){if(C("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(n){C("wrapped data"),i.decoder&&(n=i.decoder.write(n)),(!i.objectMode||null!==n&&void 0!==n)&&(i.objectMode||n&&n.length)&&(e.push(n)||(r=!0,t.pause()))}),t)void 0===this[n]&&"function"==typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o<O.length;o++)t.on(O[o],this.emit.bind(this,O[o]));return this._read=function(e){C("wrapped _read",e),r&&(r=!1,t.resume())},this},Object.defineProperty(o.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),o._fromList=m}).call(this,i(5),i(15))},function(t,e,i){t.exports=i(100)},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e,i){"use strict";function r(t,e){this.options=t,this.loadOptions=e}var n=i(27),o=i(0),s=i(18),a=i(17),l=i(7),h=i(34),u=i(3);r.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(t){var e,i;if(t.skip(22),this.fileNameLength=t.readInt(2),i=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(i),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in h)if(h.hasOwnProperty(e)&&h[e].magic===t)return h[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+o.pretty(this.compressionMethod)+" unknown (inner file : "+o.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=n(this.extraFields[1].value);
vendor: 5,091 bytes, line 108
108this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,i,r,n=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index<n;)e=t.readInt(2),i=t.readInt(2),r=t.readData(i),this.extraFields[e]={id:e,length:i,value:r}},handleUTF8:function(){var t=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var i=o.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var n=o.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(n)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=n(t.value);return 1!==e.readInt(1)?null:a(this.fileName)!==e.readInt(4)?null:l.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=n(t.value);return 1!==e.readInt(1)?null:a(this.fileComment)!==e.readInt(4)?null:l.utf8decode(e.readData(t.length-5))}return null}},t.exports=r},function(t,e,i){"use strict";function r(t){n.call(this,t)}var n=i(24);i(0).inherits(r,n),r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,i){"use strict";function r(t){n.call(this,t)}var n=i(25);i(0).inherits(r,n),r.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},r.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},r.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,i){"use strict";function r(t){this.files=[],this.loadOptions=t}var n=i(27),o=i(0),s=i(28),a=i(52),l=(i(7),i(3));r.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+o.pretty(e)+", expected "+o.pretty(t)+")")}},isSignature:function(t,e){var i=this.reader.index;this.reader.setIndex(t);var r=this.reader.readString(4)===e;return this.reader.setIndex(i),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=l.uint8array?"uint8array":"array",i=o.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,i,r=this.zip64EndOfCentralSize-44;0<r;)t=this.reader.readInt(2),e=this.reader.readInt(4),i=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(t=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip f
108ile ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(t);var e=t;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var r=e-i;if(r>0)this.isSignature(e,s.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(t){this.reader=n(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=r},function(t,e,i){"use strict";function r(t){return new o.Promise(function(e,i){var r=t.decompressed.getContentWorker().pipe(new l);r.on("error",function(t){i(t)}).on("end",function(){r.streamInfo.crc32!==t.decompressed.crc32?i(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}var n=i(0),o=i(8),s=i(7),a=(n=i(0),i(55)),l=i(35),h=i(12);t.exports=function(t,e){var i=this;return e=n.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),h.isNode&&h.isStream(t)?o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var i=new a(e);return i.load(t),i}).then(function(t){var i=[o.Promise.resolve(t)],n=t.files;if(e.checkCRC32)for(var s=0;s<n.length;s++)i.push(r(n[s]));return o.Promise.all(i)}).then(function(t){for(var r=t.shift(),n=r.files,o=0;o<n.length;o++){var s=n[o];i.file(s.fileNameStr,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:e.createFolders})}return r.zipComment.length&&(i.comment=r.zipComment),i})}},function(t,e,i){"use strict";function r(t,e){o.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}var n=i(0),o=i(1);n.inherits(r,o),r.prototype._bindStream=function(t){var e=this;this._stream=t,t.pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},r.prototype.pause=function(){return!!o.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=r},function(t,e,i){"use strict";function r(t,e,i,r){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=i,this.encodeFileName=r,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}var n=i(0),o=i(1),s=i(7),a=i(17),l=i(28),h=function(t,e){var i,r="";for(i=0;i<e;i++)r+=String.fromCharCode(255&t),t>>>=8;return r},u=function(t,e,i,r,o,u){var c,d,f=t.file,p=t.compression,g=u!==s.utf8encode,m=n.transformTo("string",u
vendor: 4,255 bytes, line 108
108(f.name)),y=n.transformTo("string",s.utf8encode(f.name)),E=f.comment,v=n.transformTo("string",u(E)),_=n.transformTo("string",s.utf8encode(E)),b=y.length!==f.name.length,S=_.length!==E.length,w="",L="",T="",x=f.dir,R=f.date,M={crc32:0,compressedSize:0,uncompressedSize:0};e&&!i||(M.crc32=t.crc32,M.compressedSize=t.compressedSize,M.uncompressedSize=t.uncompressedSize);var C=0;e&&(C|=8),g||!b&&!S||(C|=2048);var A=0,P=0;x&&(A|=16),"UNIX"===o?(P=798,A|=function(t,e){var i=t;return t||(i=e?16893:33204),(65535&i)<<16}(f.unixPermissions,x)):(P=20,A|=function(t,e){return 63&(t||0)}(f.dosPermissions)),c=R.getUTCHours(),c<<=6,c|=R.getUTCMinutes(),c<<=5,c|=R.getUTCSeconds()/2,d=R.getUTCFullYear()-1980,d<<=4,d|=R.getUTCMonth()+1,d<<=5,d|=R.getUTCDate(),b&&(L=h(1,1)+h(a(m),4)+y,w+="up"+h(L.length,2)+L),S&&(T=h(1,1)+h(a(v),4)+_,w+="uc"+h(T.length,2)+T);var N="";return N+="\n\0",N+=h(C,2),N+=p.magic,N+=h(c,2),N+=h(d,2),N+=h(M.crc32,4),N+=h(M.compressedSize,4),N+=h(M.uncompressedSize,4),N+=h(m.length,2),N+=h(w.length,2),{fileRecord:l.LOCAL_FILE_HEADER+N+m+w,dirRecord:l.CENTRAL_FILE_HEADER+h(P,2)+N+h(v.length,2)+"\0\0\0\0"+h(A,4)+h(r,4)+m+w+v}};n.inherits(r,o),r.prototype.push=function(t){var e=t.meta.percent||0,i=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,o.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:i?(e+100*(i-r-1))/i:100}}))},r.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var i=u(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0},r.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,i=u(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),e)this.push({data:function(t){return l.DATA_DESCRIPTOR+h(t.crc32,4)+h(t.compressedSize,4)+h(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},r.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var i=this.bytesWritten-t,r=function(t,e,i,r,o){var s=n.transformTo("string",o(r));return l.CENTRAL_DIRECTORY_END+"\0\0\0\0"+h(t,2)+h(t,2)+h(e,4)+h(i,4)+h(s.length,2)+s}(this.dirRecords.length,i,t,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})},r.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},r.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",function(t){e.processChunk(t)}),t.on("end",function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()}),t.on("error",function(t){e.error(t)}),this},r.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},r.prototype.error=function(t){var e=this._sources;if(!o.prototype.error.call(this,t))return!1;for(var i=0;i<e.length;i++)try{e[i].error(t)}catch(t){}return!0},r.prototype.lock=function(){o.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},t.exports=r},function(t,e,i){"use strict";t.exports=function(){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}},function(t,e,i){"use strict";var r=i(2),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],s=[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],a=[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];
vendor: 4,256 bytes, line 108
108t.exports=function(t,e,i,l,h,u,c,d){var f,p,g,m,y,E,v,_,b,S=d.bits,w=0,L=0,T=0,x=0,R=0,M=0,C=0,A=0,P=0,N=0,O=null,I=0,D=new r.Buf16(16),k=new r.Buf16(16),V=null,F=0;for(w=0;w<=15;w++)D[w]=0;for(L=0;L<l;L++)D[e[i+L]]++;for(R=S,x=15;x>=1&&0===D[x];x--);if(R>x&&(R=x),0===x)return h[u++]=20971520,h[u++]=20971520,d.bits=1,0;for(T=1;T<x&&0===D[T];T++);for(R<T&&(R=T),A=1,w=1;w<=15;w++)if(A<<=1,(A-=D[w])<0)return-1;if(A>0&&(0===t||1!==x))return-1;for(k[1]=0,w=1;w<15;w++)k[w+1]=k[w]+D[w];for(L=0;L<l;L++)0!==e[i+L]&&(c[k[e[i+L]]++]=L);if(0===t?(O=V=c,E=19):1===t?(O=n,I-=257,V=o,F-=257,E=256):(O=s,V=a,E=-1),N=0,L=0,w=T,y=u,M=R,C=0,g=-1,m=(P=1<<R)-1,1===t&&P>852||2===t&&P>592)return 1;for(;;){v=w-C,c[L]<E?(_=0,b=c[L]):c[L]>E?(_=V[F+c[L]],b=O[I+c[L]]):(_=96,b=0),f=1<<w-C,T=p=1<<M;do{h[y+(N>>C)+(p-=f)]=v<<24|_<<16|b|0}while(0!==p);for(f=1<<w-1;N&f;)f>>=1;if(0!==f?(N&=f-1,N+=f):N=0,L++,0==--D[w]){if(w===x)break;w=e[i+c[L]]}if(w>R&&(N&m)!==g){for(0===C&&(C=R),y+=T,A=1<<(M=w-C);M+C<x&&!((A-=D[M+C])<=0);)M++,A<<=1;if(P+=1<<M,1===t&&P>852||2===t&&P>592)return 1;h[g=N&m]=R<<24|M<<16|y-u|0}}return 0!==N&&(h[y+N]=w-C<<24|64<<16|0),d.bits=R,0}},function(t,e,i){"use strict";t.exports=function(t,e){var i,r,n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_,b,S,w,L,T,x;i=t.state,r=t.next_in,T=t.input,n=r+(t.avail_in-5),o=t.next_out,x=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),l=i.dmax,h=i.wsize,u=i.whave,c=i.wnext,d=i.window,f=i.hold,p=i.bits,g=i.lencode,m=i.distcode,y=(1<<i.lenbits)-1,E=(1<<i.distbits)-1;t:do{p<15&&(f+=T[r++]<<p,p+=8,f+=T[r++]<<p,p+=8),v=g[f&y];e:for(;;){if(f>>>=_=v>>>24,p-=_,0==(_=v>>>16&255))x[o++]=65535&v;else{if(!(16&_)){if(0==(64&_)){v=g[(65535&v)+(f&(1<<_)-1)];continue e}if(32&_){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}b=65535&v,(_&=15)&&(p<_&&(f+=T[r++]<<p,p+=8),b+=f&(1<<_)-1,f>>>=_,p-=_),p<15&&(f+=T[r++]<<p,p+=8,f+=T[r++]<<p,p+=8),v=m[f&E];i:for(;;){if(f>>>=_=v>>>24,p-=_,!(16&(_=v>>>16&255))){if(0==(64&_)){v=m[(65535&v)+(f&(1<<_)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(S=65535&v,p<(_&=15)&&(f+=T[r++]<<p,(p+=8)<_&&(f+=T[r++]<<p,p+=8)),(S+=f&(1<<_)-1)>l){t.msg="invalid distance too far back",i.mode=30;break t}if(f>>>=_,p-=_,S>(_=o-s)){if((_=S-_)>u&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(w=0,L=d,0===c){if(w+=h-_,_<b){b-=_;do{x[o++]=d[w++]}while(--_);w=o-S,L=x}}else if(c<_){if(w+=h+c-_,(_-=c)<b){b-=_;do{x[o++]=d[w++]}while(--_);if(w=0,c<b){b-=_=c;do{x[o++]=d[w++]}while(--_);w=o-S,L=x}}}else if(w+=c-_,_<b){b-=_;do{x[o++]=d[w++]}while(--_);w=o-S,L=x}for(;b>2;)x[o++]=L[w++],x[o++]=L[w++],x[o++]=L[w++],b-=3;b&&(x[o++]=L[w++],b>1&&(x[o++]=L[w++]))}else{w=o-S;do{x[o++]=x[w++],x[o++]=x[w++],x[o++]=x[w++],b-=3}while(b>2);b&&(x[o++]=x[w++],b>1&&(x[o++]=x[w++]))}break}}break}}while(r<n&&o<a);r-=b=p>>3,f&=(1<<(p-=b<<3))-1,t.next_in=r,t.next_out=o,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=o<a?a-o+257:257-(o-a),i.hold=f,i.bits=p}},function(t,e,i){"use strict";function r(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function n(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=b,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new d.Buf32(L),e.distcode=e.distdyn=new d.Buf32(T),e.sane=1,e.back=-1,v):_}function o(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,n(t)):_}function s(t,e){var i,r;return t&&t.state?(r=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,o(t))):_}function a(t,e){var i,r;return t?(r=new function(){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 d.Buf16(320),this.work=new d.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},t.state=r,r.window=null,(i=s(t,e))!==v&&(t.state=null),i):_}function l(t){if(x){var e;
vendor: 8,355 bytes, lines 108-109
108for(u=new d.Buf32(512),c=new d.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(m(y,t.lens,0,288,u,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;m(E,t.lens,0,32,c,0,t.work,{bits:5}),x=!1}t.lencode=u,t.lenbits=9,t.distcode=c,t.distbits=5}function h(t,e,i,r){var n,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new d.Buf8(o.wsize)),r>=o.wsize?(d.arraySet(o.window,e,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((n=o.wsize-o.wnext)>r&&(n=r),d.arraySet(o.window,e,i-r,n,o.wnext),(r-=n)?(d.arraySet(o.window,e,i-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}var u,c,d=i(2),f=i(33),p=i(32),g=i(61),m=i(60),y=1,E=2,v=0,_=-2,b=1,S=12,w=30,L=852,T=592,x=!0;e.inflateReset=o,e.inflateReset2=s,e.inflateResetKeep=n,e.inflateInit=function(t){return a(t,15)},e.inflateInit2=a,e.inflate=function(t,e){var i,n,o,s,a,u,c,L,T,x,R,M,C,A,P,N,O,I,D,k,V,F,G,W,B=0,U=new d.Buf8(4),K=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return _;(i=t.state).mode===S&&(i.mode=13),a=t.next_out,o=t.output,c=t.avail_out,s=t.next_in,n=t.input,u=t.avail_in,L=i.hold,T=i.bits,x=u,R=c,F=v;t:for(;;)switch(i.mode){case b:if(0===i.wrap){i.mode=13;break}for(;T<16;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}if(2&i.wrap&&35615===L){i.check=0,U[0]=255&L,U[1]=L>>>8&255,i.check=p(i.check,U,2,0),L=0,T=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&L)<<8)+(L>>8))%31){t.msg="incorrect header check",i.mode=w;break}if(8!=(15&L)){t.msg="unknown compression method",i.mode=w;break}if(T-=4,V=8+(15&(L>>>=4)),0===i.wbits)i.wbits=V;else if(V>i.wbits){t.msg="invalid window size",i.mode=w;break}i.dmax=1<<V,t.adler=i.check=1,i.mode=512&L?10:S,L=0,T=0;break;case 2:for(;T<16;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}if(i.flags=L,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=w;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=w;break}i.head&&(i.head.text=L>>8&1),512&i.flags&&(U[0]=255&L,U[1]=L>>>8&255,i.check=p(i.check,U,2,0)),L=0,T=0,i.mode=3;case 3:for(;T<32;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}i.head&&(i.head.time=L),512&i.flags&&(U[0]=255&L,U[1]=L>>>8&255,U[2]=L>>>16&255,U[3]=L>>>24&255,i.check=p(i.check,U,4,0)),L=0,T=0,i.mode=4;case 4:for(;T<16;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}i.head&&(i.head.xflags=255&L,i.head.os=L>>8),512&i.flags&&(U[0]=255&L,U[1]=L>>>8&255,i.check=p(i.check,U,2,0)),L=0,T=0,i.mode=5;case 5:if(1024&i.flags){for(;T<16;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}i.length=L,i.head&&(i.head.extra_len=L),512&i.flags&&(U[0]=255&L,U[1]=L>>>8&255,i.check=p(i.check,U,2,0)),L=0,T=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((M=i.length)>u&&(M=u),M&&(i.head&&(V=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),d.arraySet(i.head.extra,n,s,M,V)),512&i.flags&&(i.check=p(i.check,n,M,s)),u-=M,s+=M,i.length-=M),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===u)break t;M=0;do{V=n[s+M++],i.head&&V&&i.length<65536&&(i.head.name+=String.fromCharCode(V))}while(V&&M<u);if(512&i.flags&&(i.check=p(i.check,n,M,s)),u-=M,s+=M,V)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===u)break t;M=0;do{V=n[s+M++],i.head&&V&&i.length<65536&&(i.head.comment+=String.fromCharCode(V))}while(V&&M<u);if(512&i.flags&&(i.check=p(i.check,n,M,s)),u-=M,s+=M,V)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;T<16;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}if(L!==(65535&i.check)){t.msg="header crc mismatch",i.mode=w;break}L=0,T=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=S;break;case 10:for(;T<32;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}t.adler=i.check=r(L),L=0,T=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=a,t.avail_out=c,t.next_in=s,t.avail_in=u,i.hold=L,i.bits=T,2;t.adler=i.check=1,i.mode=S;case S:if(5===e||6===e)break t;case 13:if(i.last){L>>>=7&T,T-=7&T,i.mode=27;break}for(;T<3;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}switch(i.last=1&L,T-=1,3&(L>>>=1)){case 0:i.mode=14;break;case 1:if(l(i),i.mode=20,6===e){L>>>=2,T-=2;break t}break;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=w}L>>>=2,T-=2;break;case 14:for(L>>>=7&T,T-=7&T;T<32;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}if((65535&L)!=(L>>>16^65535)){t.msg="invalid stored block lengths",i.mode=w;break}if(i.length=65535&L,L=0,T=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(M=i.length){if(M>u&&(M=u),M>c&&(M=c),0===M)break t;d.arraySet(o,n,s,M,a),u-=M,s+=M,c-=M,a+=M,i.length-=M;break}i.mode=S;break;case 17:for(;T<14;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}if(i.nlen=257+(31&L),L>>>=5,T-=5,i.ndist=1+(31&L),L>>>=5,T-=5,i.ncode=4+(15&L),L>>>=4,T-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=w;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;T<3;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}i.lens[K[i.have++]]=7&L,L>>>=3,T-=3}for(;i.have<19;)i.lens[K[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,G={bits:i.lenbits},F=m(0,i.lens,0,19,i.lencode,0,i.work,G),i.lenbits=G.bits,F){t.msg="invalid code lengths set",i.mode=w;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;N=(B=i.lencode[L&(1<<i.lenbits)-1])>>>16&255,O=65535&B,!((P=B>>>24)<=T);){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}if(O<16)L>>>=P,T-=P,i.lens[i.have++]=O;else{if(16===O){for(W=P+2;T<W;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}if(L>>>=P,T-=P,0===i.have){t.msg="invalid bit length repeat",i.mode=w;break}V=i.lens[i.have-1],M=3+(3&L),L>>>=2,T-=2}else if(17===O){for(W=P+3;T<W;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}T-=P,V=0,M=3+(7&(L>>>=P)),L>>>=3,T-=3}else{for(W=P+7;T<W;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}T-=P,V=0,M=11+(127&(L>>>=P)),L>>>=7,T-=7}if(i.have+M>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=w;break}for(;M--;)i.lens[i.have++]=V}}if(i.mode===w)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=w;break}if(i.lenbits=9,G={bits:i.lenbits},F=m(y,i.lens,0,i.nlen,i.lencode,0,i.work,G),i.lenbits=G.bits,F){t.msg="invalid literal/lengths set",i.mode=w;break}if(i.distbits=6,i.distcode=i.distdyn,G={bits:i.distbits},F=m(E,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,G),i.distbits=G.bits,F){t.msg="invalid distances set",i.mode=w;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(u>=6&&c>=258){t.next_out=a,t.avail_out=c,t.next_in=s,t.avail_in=u,i.hold=L,i.bits=T,g(t,R),a=t.next_out,o=t.output,c=t.avail_out,s=t.next_in,n=t.input,u=t.avail_in,L=i.hold,T=i.bits,i.mode===S&&(i.back=-1);break}for(i.back=0;N=(B=i.lencode[L&(1<<i.lenbits)-1])>>>16&255,O=65535&B,!((P=B>>>24)<=T);){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}if(N&&0==(240&N)){for(I=P,D=N,k=O;N=(B=i.lencode[k+((L&(1<<I+D)-1)>>I)])>>>16&255,O=65535&B,!(I+(P=B>>>24)<=T);){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}L>>>=I,T-=I,i.back+=I}if(L>>>=P,T-=P,i.back+=P,i.length=O,0===N){i.mode=26;break}if(32&N){i.back=-1,i.mode=S;break}if(64&N){t.msg="invalid literal/length code",i.mode=w;break}i.extra=15&N,i.mode=22;case 22:if(i.extra){for(W=i.extra;T<W;){if(0===u)break t;u--, 109L+=n[s++]<<T,T+=8}i.length+=L&(1<<i.extra)-1,L>>>=i.extra,T-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;N=(B=i.distcode[L&(1<<i.distbits)-1])>>>16&255,O=65535&B,!((P=B>>>24)<=T);){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}if(0==(240&N)){for(I=P,D=N,k=O;N=(B=i.distcode[k+((L&(1<<I+D)-1)>>I)])>>>16&255,O=65535&B,!(I+(P=B>>>24)<=T);){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}L>>>=I,T-=I,i.back+=I}if(L>>>=P,T-=P,i.back+=P,64&N){t.msg="invalid distance code",i.mode=w;break}i.offset=O,i.extra=15&N,i.mode=24;case 24:if(i.extra){for(W=i.extra;T<W;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}i.offset+=L&(1<<i.extra)-1,L>>>=i.extra,T-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=w;break}i.mode=25;case 25:if(0===c)break t;if(M=R-c,i.offset>M){if((M=i.offset-M)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=w;break}M>i.wnext?(M-=i.wnext,C=i.wsize-M):C=i.wnext-M,M>i.length&&(M=i.length),A=i.window}else A=o,C=a-i.offset,M=i.length;M>c&&(M=c),c-=M,i.length-=M;do{o[a++]=A[C++]}while(--M);0===i.length&&(i.mode=21);break;case 26:if(0===c)break t;
vendor: 4,320 bytes, line 109
109o[a++]=i.length,c--,i.mode=21;break;case 27:if(i.wrap){for(;T<32;){if(0===u)break t;u--,L|=n[s++]<<T,T+=8}if(R-=c,t.total_out+=R,i.total+=R,R&&(t.adler=i.check=i.flags?p(i.check,o,R,a-R):f(i.check,o,R,a-R)),R=c,(i.flags?L:r(L))!==i.check){t.msg="incorrect data check",i.mode=w;break}L=0,T=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;T<32;){if(0===u)break t;u--,L+=n[s++]<<T,T+=8}if(L!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=w;break}L=0,T=0}i.mode=29;case 29:F=1;break t;case w:F=-3;break t;case 31:return-4;case 32:default:return _}return t.next_out=a,t.avail_out=c,t.next_in=s,t.avail_in=u,i.hold=L,i.bits=T,(i.wsize||R!==t.avail_out&&i.mode<w&&(i.mode<27||4!==e))&&h(t,t.output,t.next_out,R-t.avail_out)?(i.mode=31,-4):(x-=t.avail_in,R-=t.avail_out,t.total_in+=x,t.total_out+=R,i.total+=R,i.wrap&&R&&(t.adler=i.check=i.flags?p(i.check,o,R,t.next_out-R):f(i.check,o,R,t.next_out-R)),t.data_type=i.bits+(i.last?64:0)+(i.mode===S?128:0)+(20===i.mode||15===i.mode?256:0),(0===x&&0===R||4===e)&&F===v&&(F=-5),F)},e.inflateEnd=function(t){if(!t||!t.state)return _;var e=t.state;return e.window&&(e.window=null),t.state=null,v},e.inflateGetHeader=function(t,e){var i;return t&&t.state?0==(2&(i=t.state).wrap)?_:(i.head=e,e.done=!1,v):_},e.inflateSetDictionary=function(t,e){var i,r=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?_:11===i.mode&&f(1,e,r,0)!==i.check?-3:h(t,e,r,r)?(i.mode=31,-4):(i.havedict=1,v):_},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,i){"use strict";function r(t){if(!(this instanceof r))return new r(t);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var i=o.inflateInit2(this.strm,e.windowBits);if(i!==l.Z_OK)throw new Error(h[i]);this.header=new c,o.inflateGetHeader(this.strm,this.header)}function n(t,e){var i=new r(e);if(i.push(t,!0),i.err)throw i.msg||h[i.err];return i.result}var o=i(62),s=i(2),a=i(31),l=i(29),h=i(16),u=i(30),c=i(59),d=Object.prototype.toString;r.prototype.push=function(t,e){var i,r,n,h,u,c,f=this.strm,p=this.options.chunkSize,g=this.options.dictionary,m=!1;if(this.ended)return!1;r=e===~~e?e:!0===e?l.Z_FINISH:l.Z_NO_FLUSH,"string"==typeof t?f.input=a.binstring2buf(t):"[object ArrayBuffer]"===d.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new s.Buf8(p),f.next_out=0,f.avail_out=p),(i=o.inflate(f,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&g&&(c="string"==typeof g?a.string2buf(g):"[object ArrayBuffer]"===d.call(g)?new Uint8Array(g):g,i=o.inflateSetDictionary(this.strm,c)),i===l.Z_BUF_ERROR&&!0===m&&(i=l.Z_OK,m=!1),i!==l.Z_STREAM_END&&i!==l.Z_OK)return this.onEnd(i),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&i!==l.Z_STREAM_END&&(0!==f.avail_in||r!==l.Z_FINISH&&r!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(n=a.utf8border(f.output,f.next_out),h=f.next_out-n,u=a.buf2string(f.output,n),f.next_out=h,f.avail_out=p-h,h&&s.arraySet(f.output,f.output,n,h,0),this.onData(u)):this.onData(s.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(m=!0)}while((f.avail_in>0||0===f.avail_out)&&i!==l.Z_STREAM_END);return i===l.Z_STREAM_END&&(r=l.Z_FINISH),r===l.Z_FINISH?(i=o.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===l.Z_OK):r!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),f.avail_out=0,!0)},r.prototype.onData=function(t){this.chunks.push(t)},r.prototype.onEnd=function(t){t===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=r,e.inflate=n,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,n(t,e)},e.ungzip=n},function(t,e,i){"use strict";function r(t){for(var e=t.length;--e>=0;)t[e]=0}function n(t,e,i,r,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=t&&t.length}function o(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function s(t){return t<256?W[t]:W[256+(t>>
vendor: 9,384 bytes, line 109
109>7)]}function a(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function l(t,e,i){t.bi_valid>C-i?(t.bi_buf|=e<<t.bi_valid&65535,a(t,t.bi_buf),t.bi_buf=e>>C-t.bi_valid,t.bi_valid+=i-C):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function h(t,e,i){l(t,i[2*e],i[2*e+1])}function u(t,e){var i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1}function c(t,e,i){var r,n,o=new Array(M+1),s=0;for(r=1;r<=M;r++)o[r]=s=s+i[r-1]<<1;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=u(o[a]++,a))}}function d(t){var e;for(e=0;e<L;e++)t.dyn_ltree[2*e]=0;for(e=0;e<T;e++)t.dyn_dtree[2*e]=0;for(e=0;e<x;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*A]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function f(t){t.bi_valid>8?a(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function p(t,e,i,r){var n=2*e,o=2*i;return t[n]<t[o]||t[n]===t[o]&&r[e]<=r[i]}function g(t,e,i){for(var r=t.heap[i],n=i<<1;n<=t.heap_len&&(n<t.heap_len&&p(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!p(e,r,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=r}function m(t,e,i){var r,n,o,a,u=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],n=t.pending_buf[t.l_buf+u],u++,0===r?h(t,n,e):(h(t,(o=B[n])+w+1,e),0!==(a=I[o])&&l(t,n-=U[o],a),h(t,o=s(--r),i),0!==(a=D[o])&&l(t,r-=q[o],a))}while(u<t.last_lit);h(t,A,e)}function y(t,e){var i,r,n,o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.has_stree,l=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=R,i=0;i<l;i++)0!==o[2*i]?(t.heap[++t.heap_len]=h=i,t.depth[i]=0):o[2*i+1]=0;for(;t.heap_len<2;)o[2*(n=t.heap[++t.heap_len]=h<2?++h:0)]=1,t.depth[n]=0,t.opt_len--,a&&(t.static_len-=s[2*n+1]);for(e.max_code=h,i=t.heap_len>>1;i>=1;i--)g(t,o,i);n=l;do{i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],g(t,o,1),r=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=r,o[2*n]=o[2*i]+o[2*r],t.depth[n]=(t.depth[i]>=t.depth[r]?t.depth[i]:t.depth[r])+1,o[2*i+1]=o[2*r+1]=n,t.heap[1]=n++,g(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,r,n,o,s,a,l=e.dyn_tree,h=e.max_code,u=e.stat_desc.static_tree,c=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(o=0;o<=M;o++)t.bl_count[o]=0;for(l[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<R;i++)(o=l[2*l[2*(r=t.heap[i])+1]+1]+1)>p&&(o=p,g++),l[2*r+1]=o,r>h||(t.bl_count[o]++,s=0,r>=f&&(s=d[r-f]),a=l[2*r],t.opt_len+=a*(o+s),c&&(t.static_len+=a*(u[2*r+1]+s)));if(0!==g){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(o=p;0!==o;o--)for(r=t.bl_count[o];0!==r;)(n=t.heap[--i])>h||(l[2*n+1]!==o&&(t.opt_len+=(o-l[2*n+1])*l[2*n],l[2*n+1]=o),r--)}}(t,e),c(o,h,t.bl_count)}function E(t,e,i){var r,n,o=-1,s=e[1],a=0,l=7,h=4;for(0===s&&(l=138,h=3),e[2*(i+1)+1]=65535,r=0;r<=i;r++)n=s,s=e[2*(r+1)+1],++a<l&&n===s||(a<h?t.bl_tree[2*n]+=a:0!==n?(n!==o&&t.bl_tree[2*n]++,t.bl_tree[2*P]++):a<=10?t.bl_tree[2*N]++:t.bl_tree[2*O]++,a=0,o=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4))}function v(t,e,i){var r,n,o=-1,s=e[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),r=0;r<=i;r++)if(n=s,s=e[2*(r+1)+1],!(++a<u&&n===s)){if(a<c)do{h(t,n,t.bl_tree)}while(0!=--a);else 0!==n?(n!==o&&(h(t,n,t.bl_tree),a--),h(t,P,t.bl_tree),l(t,a-3,2)):a<=10?(h(t,N,t.bl_tree),l(t,a-3,3)):(h(t,O,t.bl_tree),l(t,a-11,7));a=0,o=n,0===s?(u=138,c=3):n===s?(u=6,c=3):(u=7,c=4)}}function _(t,e,i,r){l(t,(S<<1)+(r?1:0),3),function(t,e,i,r){f(t),a(t,i),a(t,~i),b.arraySet(t.pending_buf,t.window,e,i,t.pending),t.pending+=i}(t,e,i)}var b=i(2),S=0,w=256,L=w+1+29,T=30,x=19,R=2*L+1,M=15,C=16,A=256,P=16,N=17,O=18,I=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],D=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],k=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],V=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(L+2));r(F);var G=new Array(2*T);r(G);var W=new Array(512);r(W);var B=new Array(256);r(B);var U=new Array(29);r(U);var K,j,z,q=new Array(T);r(q);var Y=!1;e._tr_init=function(t){Y||(function(){var t,e,i,r,o,s=new Array(M+1);for(i=0,r=0;r<28;r++)for(U[r]=i,t=0;t<1<<I[r];t++)B[i++]=r;for(B[i-1]=r,o=0,r=0;r<16;r++)for(q[r]=o,t=0;t<1<<D[r];t++)W[o++]=r;for(o>>=7;r<T;r++)for(q[r]=o<<7,t=0;t<1<<D[r]-7;t++)W[256+o++]=r;for(e=0;e<=M;e++)s[e]=0;for(t=0;t<=143;)F[2*t+1]=8,t++,s[8]++;for(;t<=255;)F[2*t+1]=9,t++,s[9]++;for(;t<=279;)F[2*t+1]=7,t++,s[7]++;for(;t<=287;)F[2*t+1]=8,t++,s[8]++;for(c(F,L+1,s),t=0;t<T;t++)G[2*t+1]=5,G[2*t]=u(t,5);K=new n(F,I,w+1,L,M),j=new n(G,D,0,T,M),z=new n(new Array(0),k,0,x,7)}(),Y=!0),t.l_desc=new o(t.dyn_ltree,K),t.d_desc=new o(t.dyn_dtree,j),t.bl_desc=new o(t.bl_tree,z),t.bi_buf=0,t.bi_valid=0,d(t)},e._tr_stored_block=_,e._tr_flush_block=function(t,e,i,r){var n,o,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<w;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),y(t,t.l_desc),y(t,t.d_desc),s=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),y(t,t.bl_desc),e=x-1;e>=3&&0===t.bl_tree[2*V[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=n&&(n=o)):n=o=i+5,i+4<=n&&-1!==e?_(t,e,i,r):4===t.strategy||o===n?(l(t,2+(r?1:0),3),m(t,F,G)):(l(t,4+(r?1:0),3),function(t,e,i,r){var n;for(l(t,e-257,5),l(t,i-1,5),l(t,r-4,4),n=0;n<r;n++)l(t,t.bl_tree[2*V[n]+1],3);v(t,t.dyn_ltree,e-1),v(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),m(t,t.dyn_ltree,t.dyn_dtree)),d(t),r&&f(t)},e._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(B[i]+w+1)]++,t.dyn_dtree[2*s(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){l(t,2,3),h(t,A,F),function(t){16===t.bi_valid?(a(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},function(t,e,i){"use strict";function r(t,e){return t.msg=L[e],e}function n(t){return(t<<1)-(t>4?9:0)}function o(t){for(var e=t.length;--e>=0;)t[e]=0}function s(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(_.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function a(t,e){b._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,s(t.strm)}function l(t,e){t.pending_buf[t.pending++]=e}function h(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function u(t,e,i,r){var n=t.avail_in;return n>r&&(n=r),0===n?0:(t.avail_in-=n,_.arraySet(e,t.input,t.next_in,n,i),1===t.state.wrap?t.adler=S(t.adler,e,n,i):2===t.state.wrap&&(t.adler=w(t.adler,e,n,i)),t.next_in+=n,t.total_in+=n,n)}function c(t,e){var i,r,n=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,l=t.strstart>t.w_size-U?t.strstart-(t.w_size-U):0,h=t.window,u=t.w_mask,c=t.prev,d=t.strstart+B,f=h[o+s-1],p=h[o+s];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(h[(i=e)+s]===p&&h[i+s-1]===f&&h[i]===h[o]&&h[++i]===h[o+1]){o+=2,i++;do{}while(h[++o]===h[++i]&&h[++o]===h[++i]&&h[++o]===h[++i]&&h[++o]===h[++i]&&h[++o]===h[++i]&&h[++o]===h[++i]&&h[++o]===h[++i]&&h[++o]===h[++i]&&o<d);if(r=B-(d-o),o=d-B,r>s){if(t.match_start=e,s=r,r>=a)break;f=h[o+s-1],p=h[o+s]}}}while((e=c[e&u])>l&&0!=--n);return s<=t.lookahead?s:t.lookahead}function d(t){var e,i,r,n,o,s=t.w_size;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-U)){_.arraySet(t.window,t.window,s,s,0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=i=t.hash_size;do{r=t.head[--e],t.head[e]=r>=s?r-s:0}while(--i);e=i=s;do{r=t.prev[--e],t.prev[e]=r>=s?r-s:0}while(--i);n+=s}if(0===t.strm.avail_in)break;if(i=u(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=i,t.lookahead+t.insert>=W)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+W-1])&t.hash_mask,t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<W)););}while(t.lookahead<U&&0!==t.strm.avail_in)}function f(t,e){for(var i,r;;){if(t.lookahead<U){if(d(t),t.lookahead<U&&e===T)return Y;if(0===t.lookahead)break}if(i=0,t.lookahead>=W&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+W-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-U&&(t.match_length=c(t,i)),t.match_length>=W)if(r=b._tr_tally(t,t.strstart-t.match_start,t.match_length-W),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=W){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+W-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=b._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;
vendor: 4,267 bytes, line 109
109if(r&&(a(t,!1),0===t.strm.avail_out))return Y}return t.insert=t.strstart<W-1?t.strstart:W-1,e===x?(a(t,!0),0===t.strm.avail_out?X:J):t.last_lit&&(a(t,!1),0===t.strm.avail_out)?Y:H}function p(t,e){for(var i,r,n;;){if(t.lookahead<U){if(d(t),t.lookahead<U&&e===T)return Y;if(0===t.lookahead)break}if(i=0,t.lookahead>=W&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+W-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=W-1,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-U&&(t.match_length=c(t,i),t.match_length<=5&&(t.strategy===A||t.match_length===W&&t.strstart-t.match_start>4096)&&(t.match_length=W-1)),t.prev_length>=W&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-W,r=b._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-W),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+W-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=W-1,t.strstart++,r&&(a(t,!1),0===t.strm.avail_out))return Y}else if(t.match_available){if((r=b._tr_tally(t,0,t.window[t.strstart-1]))&&a(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return Y}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=b._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<W-1?t.strstart:W-1,e===x?(a(t,!0),0===t.strm.avail_out?X:J):t.last_lit&&(a(t,!1),0===t.strm.avail_out)?Y:H}function g(t,e,i,r,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=r,this.func=n}function m(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=N,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?K:z,t.adler=2===e.wrap?0:1,e.last_flush=T,b._tr_init(e),R):r(t,M)}function y(t){var e=m(t);return e===R&&function(t){t.window_size=2*t.w_size,o(t.head),t.max_lazy_match=v[t.level].max_lazy,t.good_match=v[t.level].good_length,t.nice_match=v[t.level].nice_length,t.max_chain_length=v[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=W-1,t.match_available=0,t.ins_h=0}(t.state),e}function E(t,e,i,n,s,a){if(!t)return M;var l=1;if(e===C&&(e=6),n<0?(l=0,n=-n):n>15&&(l=2,n-=16),s<1||s>I||i!==O||n<8||n>15||e<0||e>9||a<0||a>P)return r(t,M);8===n&&(n=9);var h=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=O,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new _.Buf16(2*F),this.dyn_dtree=new _.Buf16(2*(2*k+1)),this.bl_tree=new _.Buf16(2*(2*V+1)),o(this.dyn_ltree),o(this.dyn_dtree),o(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new _.Buf16(G+1),this.heap=new _.Buf16(2*D+1),o(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new _.Buf16(2*D+1),o(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return t.state=h,h.strm=t,h.wrap=l,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=s+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+W-1)/W),h.window=new _.Buf8(2*h.w_size),h.head=new _.Buf16(h.hash_size),h.prev=new _.Buf16(h.w_size),h.lit_bufsize=1<<s+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new _.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=a,h.method=i,y(t)}var v,_=i(2),b=i(64),S=i(33),w=i(32),L=i(16),T=0,x=4,R=0,M=-2,C=-1,A=1,P=4,N=2,O=8,I=9,D=286,k=30,V=19,F=2*D+1,G=15,W=3,B=258,U=B+W
vendor: 6,565 bytes, line 109
109+1,K=42,j=103,z=113,q=666,Y=1,H=2,X=3,J=4;v=[new g(0,0,0,0,function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(d(t),0===t.lookahead&&e===T)return Y;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+i;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,a(t,!1),0===t.strm.avail_out))return Y;if(t.strstart-t.block_start>=t.w_size-U&&(a(t,!1),0===t.strm.avail_out))return Y}return t.insert=0,e===x?(a(t,!0),0===t.strm.avail_out?X:J):(t.strstart>t.block_start&&(a(t,!1),t.strm.avail_out),Y)}),new g(4,4,8,4,f),new g(4,5,16,8,f),new g(4,6,32,32,f),new g(4,4,16,16,p),new g(8,16,32,32,p),new g(8,16,128,128,p),new g(8,32,128,256,p),new g(32,128,258,1024,p),new g(32,258,258,4096,p)],e.deflateInit=function(t,e){return E(t,e,O,15,8,0)},e.deflateInit2=E,e.deflateReset=y,e.deflateResetKeep=m,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?M:(t.state.gzhead=e,R):M},e.deflate=function(t,e){var i,u,c,f;if(!t||!t.state||e>5||e<0)return t?r(t,M):M;if(u=t.state,!t.output||!t.input&&0!==t.avail_in||u.status===q&&e!==x)return r(t,0===t.avail_out?-5:M);if(u.strm=t,i=u.last_flush,u.last_flush=e,u.status===K)if(2===u.wrap)t.adler=0,l(u,31),l(u,139),l(u,8),u.gzhead?(l(u,(u.gzhead.text?1:0)+(u.gzhead.hcrc?2:0)+(u.gzhead.extra?4:0)+(u.gzhead.name?8:0)+(u.gzhead.comment?16:0)),l(u,255&u.gzhead.time),l(u,u.gzhead.time>>8&255),l(u,u.gzhead.time>>16&255),l(u,u.gzhead.time>>24&255),l(u,9===u.level?2:u.strategy>=2||u.level<2?4:0),l(u,255&u.gzhead.os),u.gzhead.extra&&u.gzhead.extra.length&&(l(u,255&u.gzhead.extra.length),l(u,u.gzhead.extra.length>>8&255)),u.gzhead.hcrc&&(t.adler=w(t.adler,u.pending_buf,u.pending,0)),u.gzindex=0,u.status=69):(l(u,0),l(u,0),l(u,0),l(u,0),l(u,0),l(u,9===u.level?2:u.strategy>=2||u.level<2?4:0),l(u,3),u.status=z);else{var p=O+(u.w_bits-8<<4)<<8;p|=(u.strategy>=2||u.level<2?0:u.level<6?1:6===u.level?2:3)<<6,0!==u.strstart&&(p|=32),p+=31-p%31,u.status=z,h(u,p),0!==u.strstart&&(h(u,t.adler>>>16),h(u,65535&t.adler)),t.adler=1}if(69===u.status)if(u.gzhead.extra){for(c=u.pending;u.gzindex<(65535&u.gzhead.extra.length)&&(u.pending!==u.pending_buf_size||(u.gzhead.hcrc&&u.pending>c&&(t.adler=w(t.adler,u.pending_buf,u.pending-c,c)),s(t),c=u.pending,u.pending!==u.pending_buf_size));)l(u,255&u.gzhead.extra[u.gzindex]),u.gzindex++;u.gzhead.hcrc&&u.pending>c&&(t.adler=w(t.adler,u.pending_buf,u.pending-c,c)),u.gzindex===u.gzhead.extra.length&&(u.gzindex=0,u.status=73)}else u.status=73;if(73===u.status)if(u.gzhead.name){c=u.pending;do{if(u.pending===u.pending_buf_size&&(u.gzhead.hcrc&&u.pending>c&&(t.adler=w(t.adler,u.pending_buf,u.pending-c,c)),s(t),c=u.pending,u.pending===u.pending_buf_size)){f=1;break}f=u.gzindex<u.gzhead.name.length?255&u.gzhead.name.charCodeAt(u.gzindex++):0,l(u,f)}while(0!==f);u.gzhead.hcrc&&u.pending>c&&(t.adler=w(t.adler,u.pending_buf,u.pending-c,c)),0===f&&(u.gzindex=0,u.status=91)}else u.status=91;if(91===u.status)if(u.gzhead.comment){c=u.pending;do{if(u.pending===u.pending_buf_size&&(u.gzhead.hcrc&&u.pending>c&&(t.adler=w(t.adler,u.pending_buf,u.pending-c,c)),s(t),c=u.pending,u.pending===u.pending_buf_size)){f=1;break}f=u.gzindex<u.gzhead.comment.length?255&u.gzhead.comment.charCodeAt(u.gzindex++):0,l(u,f)}while(0!==f);u.gzhead.hcrc&&u.pending>c&&(t.adler=w(t.adler,u.pending_buf,u.pending-c,c)),0===f&&(u.status=j)}else u.status=j;if(u.status===j&&(u.gzhead.hcrc?(u.pending+2>u.pending_buf_size&&s(t),u.pending+2<=u.pending_buf_size&&(l(u,255&t.adler),l(u,t.adler>>8&255),t.adler=0,u.status=z)):u.status=z),0!==u.pending){if(s(t),0===t.avail_out)return u.last_flush=-1,R}else if(0===t.avail_in&&n(e)<=n(i)&&e!==x)return r(t,-5);if(u.status===q&&0!==t.avail_in)return r(t,-5);if(0!==t.avail_in||0!==u.lookahead||e!==T&&u.status!==q){var g=2===u.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(d(t),0===t.lookahead)){if(e===T)return Y;break}if(t.match_length=0,i=b._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(a(t,!1),0===t.strm.avail_out))return Y}return t.insert=0,e===x?(a(t,!0),0===t.strm.avail_out?X:J):t.last_lit&&(a(t,!1),0===t.strm.avail_out)?Y:H}(u,e):3===u.strategy?function(t,e){for(var i,r,n,o,s=t.window;;){if(t.lookahead<=B){if(d(t),t.lookahead<=B&&e===T)return Y;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=W&&t.strstart>0&&(r=s[n=t.strstart-1])===s[++n]&&r===s[++n]&&r===s[++n]){o=t.strstart+B;do{}while(r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&n<o);t.match_length=B-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=W?(i=b._tr_tally(t,1,t.match_length-W),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=b._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(a(t,!1),0===t.strm.avail_out))return Y}return t.insert=0,e===x?(a(t,!0),0===t.strm.avail_out?X:J):t.last_lit&&(a(t,!1),0===t.strm.avail_out)?Y:H}(u,e):v[u.level].func(u,e);if(g!==X&&g!==J||(u.status=q),g===Y||g===X)return 0===t.avail_out&&(u.last_flush=-1),R;if(g===H&&(1===e?b._tr_align(u):5!==e&&(b._tr_stored_block(u,0,0,!1),3===e&&(o(u.head),0===u.lookahead&&(u.strstart=0,u.block_start=0,u.insert=0))),s(t),0===t.avail_out))return u.last_flush=-1,R}return e!==x?R:u.wrap<=0?1:(2===u.wrap?(l(u,255&t.adler),l(u,t.adler>>8&255),l(u,t.adler>>16&255),l(u,t.adler>>24&255),l(u,255&t.total_in),l(u,t.total_in>>8&255),l(u,t.total_in>>16&255),l(u,t.total_in>>24&255)):(h(u,t.adler>>>16),h(u,65535&t.adler)),s(t),u.wrap>0&&(u.wrap=-u.wrap),0!==u.pending?R:1)},e.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==K&&69!==e&&73!==e&&91!==e&&e!==j&&e!==z&&e!==q?r(t,M):(t.state=null,e===z?r(t,-3):R):M},e.deflateSetDictionary=function(t,e){var i,r,n,s,a,l,h,u,c=e.length;if(!t||!t.state)return M;if(2===(s=(i=t.state).wrap)||1===s&&i.status!==K||i.lookahead)return M;for(1===s&&(t.adler=S(t.adler,e,c,0)),i.wrap=0,c>=i.w_size&&(0===s&&(o(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new _.Buf8(i.w_size),_.arraySet(u,e,c-i.w_size,i.w_size,0),e=u,c=i.w_size),a=t.avail_in,l=t.next_in,h=t.input,t.avail_in=c,t.next_in=0,t.input=e,d(i);i.lookahead>=W;){r=i.strstart,n=i.lookahead-(W-1);do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[r+W-1])&i.hash_mask,i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++}while(--n);i.strstart=r,i.lookahead=W-1,d(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=W-1,i.match_available=0,t.next_in=l,t.input
vendor: 9,757 bytes, lines 109-110
109=h,t.avail_in=a,i.wrap=s,R},e.deflateInfo="pako deflate (from Nodeca project)"},function(t,e,i){"use strict";function r(t){if(!(this instanceof r))return new r(t);this.options=s.assign({level:d,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var i=o.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(i!==c)throw new Error(l[i]);if(e.header&&o.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(n="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(i=o.deflateSetDictionary(this.strm,n))!==c)throw new Error(l[i]);this._dict_set=!0}}function n(t,e){var i=new r(e);if(i.push(t,!0),i.err)throw i.msg||l[i.err];return i.result}var o=i(65),s=i(2),a=i(31),l=i(16),h=i(30),u=Object.prototype.toString,c=0,d=-1,f=0,p=8;r.prototype.push=function(t,e){var i,r,n=this.strm,l=this.options.chunkSize;if(this.ended)return!1;r=e===~~e?e:!0===e?4:0,"string"==typeof t?n.input=a.string2buf(t):"[object ArrayBuffer]"===u.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(0===n.avail_out&&(n.output=new s.Buf8(l),n.next_out=0,n.avail_out=l),1!==(i=o.deflate(n,r))&&i!==c)return this.onEnd(i),this.ended=!0,!1;0!==n.avail_out&&(0!==n.avail_in||4!==r&&2!==r)||("string"===this.options.to?this.onData(a.buf2binstring(s.shrinkBuf(n.output,n.next_out))):this.onData(s.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||0===n.avail_out)&&1!==i);return 4===r?(i=o.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===c):2!==r||(this.onEnd(c),n.avail_out=0,!0)},r.prototype.onData=function(t){this.chunks.push(t)},r.prototype.onEnd=function(t){t===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=r,e.deflate=n,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,n(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,n(t,e)}},function(t,e,i){"use strict";var r={};(0,i(2).assign)(r,i(66),i(63),i(29)),t.exports=r},function(t,e,i){"use strict";function r(t,e){a.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,o=i(67),s=i(0),a=i(1),l=n?"uint8array":"array";e.magic="\b\0",s.inherits(r,a),r.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(l,t.data),!1)},r.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},r.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},r.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},e.compressWorker=function(t){return new r("Deflate",t)},e.uncompressWorker=function(){return new r("Inflate",{})}},function(t,e,i){"use strict";var r=i(34),n=i(58);e.generateWorker=function(t,e,i){var o=new n(e.streamFiles,i,e.platform,e.encodeFileName),s=0;try{t.forEach(function(t,i){s++;var n=function(t,e){var i=t||e,n=r[i];if(!n)throw new Error(i+" is not a valid compression method !");return n}(i.options.compression,e.compression),a=i.options.compressionOptions||e.compressionOptions||{},l=i.dir,h=i.date;i._compressWorker(n,a).withStreamInfo("file",{name:t,dir:l,date:h,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(o)}),o.entriesCount=s}catch(t){o.error(t)}return o}},function(t,e,i){"use strict";var r=i(39),n=i(37),o=i(7),s=i(18),a=i(1),l=function(t,e,i){this.name=t,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=e,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}};l.prototype={internalStream:function(t){var e=null,i="string";try{if(!t)throw new Error("No output type specified.");var n="string"===(i=t.toLowerCase())||"text"===i;"binarystring"!==i&&"text"!==i||(i="string"),e=this._decompressWorker();var s=!this._dataBinary;s&&!n&&(e=e.pipe(new o.Utf8EncodeWorker)),!s&&n&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new a("error")).error(t)}return new r(e,i,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof s&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new o.Utf8EncodeWorker)),s.createWorkerFrom(i,t,e)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof a?this._data:new n(this._data)}};for(var h=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],u=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<h.length;c++)l.prototype[h[c]]=u;t.exports=l},function(t,e,i){"use strict";function r(t,e,i){n.call(this,e),this._helper=t;var r=this;t.on("data",function(t,e){r.push(t)||r._helper.pause(),i&&i(e)}).on("error",function(t){r.emit("error",t)}).on("end",function(){r.push(null)})}var n=i(50).Readable;i(0).inherits(r,n),r.prototype._read=function(){this._helper.resume()},t.exports=r},function(t,e,i){"use strict";function r(t){n.call(this,"ConvertWorker to "+t),this.destType=t}var n=i(1),o=i(0);o.inherits(r,n),r.prototype.processChunk=function(t){this.push({data:o.transformTo(this.destType,t.data),meta:t.meta})},t.exports=r},function(t,e,i){"use strict";(function(e){function i(){var t,e;n=!0;for(var i=u.length;i;){for(e=u,u=[],t=-1;++t<i;)e[t]();i=u.length}n=!1}var r,n,o=e.MutationObserver||e.WebKitMutationObserver;if(o){var s=0,a=new o(i),l=e.document.createTextNode("");a.observe(l,{characterData:!0}),r=function(){l.data=s=++s%2} 110}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){i(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(i,0)};else{var h=new e.MessageChannel;h.port1.onmessage=i,r=function(){h.port2.postMessage(0)}}var u=[];t.exports=function(t){1!==u.push(t)||n||r()}}).call(this,i(5))},function(t,e,i){"use strict";function r(){}function n(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,t!==r&&l(this,t)}function o(t,e,i){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function s(t,e,i){u(function(){var r;try{r=e(i)}catch(e){return c.reject(t,e)}r===t?c.reject(t,new TypeError("Cannot resolve promise with itself")):c.resolve(t,r)})}function a(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function l(t,e){function i(e){n||(n=!0,c.reject(t,e))}function r(e){n||(n=!0,c.resolve(t,e))}var n=!1,o=h(function(){e(r,i)});"error"===o.status&&i(o.value)}function h(t,e){var i={};try{i.value=t(e),i.status="success"}catch(t){i.status="error",i.value=t}return i}var u=i(73),c={},d=["REJECTED"],f=["FULFILLED"],p=["PENDING"];t.exports=n,n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,e){if("function"!=typeof t&&this.state===f||"function"!=typeof e&&this.state===d)return this;var i=new this.constructor(r);return this.state!==p?s(i,this.state===f?t:e,this.outcome):this.queue.push(new o(i,t,e)),i},o.prototype.callFulfilled=function(t){c.resolve(this.promise,t)},o.prototype.otherCallFulfilled=function(t){s(this.promise,this.onFulfilled,t)},o.prototype.callRejected=function(t){c.reject(this.promise,t)},o.prototype.otherCallRejected=function(t){s(this.promise,this.onRejected,t)},c.resolve=function(t,e){var i=h(a,e);if("error"===i.status)return c.reject(t,i.value);var r=i.value;if(r)l(t,r);else{t.state=f,t.outcome=e;for(var n=-1,o=t.queue.length;++n<o;)t.queue[n].callFulfilled(e)}return t},c.reject=function(t,e){t.state=d,t.outcome=e;for(var i=-1,r=t.queue.length;++i<r;)t.queue[i].callRejected(e);return t},n.resolve=function(t){return t instanceof this?t:c.resolve(new this(r),t)},n.reject=function(t){var e=new this(r);return c.reject(e,t)},n.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,n=!1;if(!i)return this.resolve([]);for(var o=new Array(i),s=0,a=-1,l=new this(r);++a<i;)!function(t,r){e.resolve(t).then(function(t){o[r]=t,++s!==i||n||(n=!0,c.resolve(l,o))},function(t){n||(n=!0,c.reject(l,t))})}(t[a],a);return l},n.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var i=t.length,n=!1;if(!i)return this.resolve([]);for(var o=-1,s=new this(r);++o<i;)!function(t){e.resolve(t).then(function(t){n||(n=!0,c.resolve(s,t))},function(t){n||(n=!0,c.reject(s,t))})}(t[o]);return s}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}}
vendor: 4,172 bytes, line 110
110,function(t,e,i){t.exports=i(11).document&&document.documentElement},function(t,e){t.exports=function(t,e,i){var r=void 0===i;switch(e.length){case 0:return r?t():t.call(i);case 1:return r?t(e[0]):t.call(i,e[0]);case 2:return r?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){var r,n,o,s=i(42),a=i(77),l=i(76),h=i(40),u=i(11),c=u.process,d=u.setImmediate,f=u.clearImmediate,p=u.MessageChannel,g=0,m={},y=function(){var t=+this;if(m.hasOwnProperty(t)){var e=m[t];delete m[t],e()}},E=function(t){y.call(t.data)};d&&f||(d=function(t){for(var e=[],i=1;arguments.length>i;)e.push(arguments[i++]);return m[++g]=function(){a("function"==typeof t?t:Function(t),e)},r(g),g},f=function(t){delete m[t]},"process"==i(75)(c)?r=function(t){c.nextTick(s(y,t,1))}:p?(o=(n=new p).port2,n.port1.onmessage=E,r=s(o.postMessage,o,1)):u.addEventListener&&"function"==typeof postMessage&&!u.importScripts?(r=function(t){u.postMessage(t+"","*")},u.addEventListener("message",E,!1)):r="onreadystatechange"in h("script")?function(t){l.appendChild(h("script")).onreadystatechange=function(){l.removeChild(this),y.call(t)}}:function(t){setTimeout(s(y,t,1),0)}),t.exports={set:d,clear:f}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var r=i(20);t.exports=function(t,e){if(!r(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!r(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!r(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!r(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e,i){t.exports=!i(19)&&!i(41)(function(){return 7!=Object.defineProperty(i(40)("div"),"a",{get:function(){return 7}}).a})},function(t,e,i){var r=i(20);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,i){var r=i(82),n=i(81),o=i(80),s=Object.defineProperty;e.f=i(19)?Object.defineProperty:function(t,e,i){if(r(t),e=o(e,!0),r(i),n)try{return s(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var r=i(83),n=i(79);t.exports=i(19)?function(t,e,i){return r.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var r=i(11),n=i(43),o=i(42),s=i(84),a=function(t,e,i){var l,h,u,c=t&a.F,d=t&a.G,f=t&a.S,p=t&a.P,g=t&a.B,m=t&a.W,y=d?n:n[e]||(n[e]={}),E=y.prototype,v=d?r:f?r[e]:(r[e]||{}).prototype;for(l in d&&(i=e),i)(h=!c&&v&&void 0!==v[l])&&l in y||(u=h?v[l]:i[l],y[l]=d&&"function"!=typeof v[l]?i[l]:g&&h?o(u,r):m&&v[l]==u?function(t){var e=function(e,i,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(u):p&&"function"==typeof u?o(Function.call,u):u,p&&((y.virtual||(y.virtual={}))[l]=u,t&a.R&&E&&!E[l]&&s(E,l,u)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,i){var r=i(86),n=i(78);r(r.G+r.B,{setImmediate:n.set,clearImmediate:n.clear})},function(t,e,i){i(87),t.exports=i(43).setImmediate},function(t,e,i){t.exports=i(22).PassThrough},function(t,e,i){t.exports=i(22).Transform},function(t,e,i){t.exports=i(4)},function(t,e,i){t.exports=i(21)},function(t,e,i){"use strict";function r(t){if(!(this instanceof r))return new r(t);n.call(this,t)}t.exports=r;var n=i(45),o=i(9);o.inherits=i(6),o.inherits(r,n),r.prototype._transform=function(t,e,i){i(null,t)}},function(t,e,i){(function(e){function i(t){try{if(!e.localStorage)return!1}catch(t){return!1}var i=e.localStorage[t];return null!=i&&"true"===String(i).toLowerCase()}t.exports=function(t,e){if(i("noDeprecation"))return t;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(e);i("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}).call(this,i(5))}
vendor: 4,644 bytes, line 110
110,function(t,e,i){(function(t,e){!function(t,i){"use strict";function r(t){delete a[t]}function n(t){if(l)setTimeout(n,0,t);else{var e=a[t];if(e){l=!0;try{!function(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(i,r)}}(e)}finally{r(t),l=!1}}}}if(!t.setImmediate){var o,s=1,a={},l=!1,h=t.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(t);u=u&&u.setTimeout?u:t,"[object process]"==={}.toString.call(t.process)?o=function(t){e.nextTick(function(){n(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,i=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=i,e}}()?function(){var e="setImmediate$"+Math.random()+"$",i=function(i){i.source===t&&"string"==typeof i.data&&0===i.data.indexOf(e)&&n(+i.data.slice(e.length))};t.addEventListener?t.addEventListener("message",i,!1):t.attachEvent("onmessage",i),o=function(i){t.postMessage(e+i,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){n(t.data)},o=function(e){t.port2.postMessage(e)}}():h&&"onreadystatechange"in h.createElement("script")?function(){var t=h.documentElement;o=function(e){var i=h.createElement("script");i.onreadystatechange=function(){n(e),i.onreadystatechange=null,t.removeChild(i),i=null},t.appendChild(i)}}():o=function(t){setTimeout(n,0,t)},u.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),i=0;i<e.length;i++)e[i]=arguments[i+1];var r={callback:t,args:e};return a[s]=r,o(s),s++},u.clearImmediate=r}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,i(5),i(15))},function(t,e,i){(function(t){function r(t,e){this._id=t,this._clearFn=e}var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;e.setTimeout=function(){return new r(o.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new r(o.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},i(95),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,i(5))},function(t,e){},function(t,e,i){"use strict";function r(t,e,i){t.copy(e,i)}var n=i(13).Buffer,o=i(97);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e=n.allocUnsafe(t>>>0),i=this.head,o=0;i;)r(i.data,e,o),o+=i.data.length,i=i.next;return e},t}(),o&&o.inspect&&o.inspect.custom&&(t.exports.prototype[o.inspect.custom]=function(){var t=o.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,i){function r(){n.call(this)}t.exports=r;var n=i(23).EventEmitter;i(6)(r,n),r.Readable=i(22),r.Writable=i(92),r.Duplex=i(91),r.Transform=i(90),r.PassThrough=i(89),r.Stream=r,r.prototype.pipe=function(t,e){function i(e){t.writable&&!1===t.write(e)&&h.pause&&h.pause()}function r(){h.readable&&h.resume&&h.resume()}function o(){u||(u=!0,t.end())}function s(){u||(u=!0,"function"==typeof t.destroy&&t.destroy())}function a(t){if(l(),0===n.listenerCount(this,"error"))throw t}function l(){h.removeListener("data",i),t.removeListener("drain",r),h.removeListener("end",o),h.removeListener("close",s
vendor: 4,339 bytes, line 110
110),h.removeListener("error",a),t.removeListener("error",a),h.removeListener("end",l),h.removeListener("close",l),t.removeListener("close",l)}var h=this;h.on("data",i),t.on("drain",r),t._isStdio||e&&!1===e.end||(h.on("end",o),h.on("close",s));var u=!1;return h.on("error",a),t.on("error",a),h.on("end",l),h.on("close",l),t.on("close",l),t.emit("pipe",h),t}},function(t,e){e.read=function(t,e,i,r,n){var o,s,a=8*n-r-1,l=(1<<a)-1,h=l>>1,u=-7,c=i?n-1:0,d=i?-1:1,f=t[e+c];for(c+=d,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=256*o+t[e+c],c+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=256*s+t[e+c],c+=d,u-=8);if(0===o)o=1-h;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=h}return(f?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,i,r,n,o){var s,a,l,h=8*o-n-1,u=(1<<h)-1,c=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?d/l:d*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=u?(a=0,s=u):s+c>=1?(a=(e*l-1)*Math.pow(2,n),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),s=0));n>=8;t[i+f]=255&a,f+=p,a/=256,n-=8);for(s=s<<n|a,h+=n;h>0;t[i+f]=255&s,f+=p,s/=256,h-=8);t[i+f-p]|=128*g}},function(t,e,i){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function n(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}function o(t,e,i){for(var r,o=[],s=e;s<i;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(n(r));return o.join("")}e.byteLength=function(t){var e=r(t),i=e[0],n=e[1];return 3*(i+n)/4-n},e.toByteArray=function(t){for(var e,i=r(t),n=i[0],o=i[1],s=new l(function(t,e,i){return 3*(e+i)/4-i}(0,n,o)),h=0,u=o>0?n-4:n,c=0;c<u;c+=4)e=a[t.charCodeAt(c)]<<18|a[t.charCodeAt(c+1)]<<12|a[t.charCodeAt(c+2)]<<6|a[t.charCodeAt(c+3)],s[h++]=e>>16&255,s[h++]=e>>8&255,s[h++]=255&e;return 2===o&&(e=a[t.charCodeAt(c)]<<2|a[t.charCodeAt(c+1)]>>4,s[h++]=255&e),1===o&&(e=a[t.charCodeAt(c)]<<10|a[t.charCodeAt(c+1)]<<4|a[t.charCodeAt(c+2)]>>2,s[h++]=e>>8&255,s[h++]=255&e),s},e.fromByteArray=function(t){for(var e,i=t.length,r=i%3,n=[],a=0,l=i-r;a<l;a+=16383)n.push(o(t,a,a+16383>l?l:a+16383));return 1===r?(e=t[i-1],n.push(s[e>>2]+s[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],n.push(s[e>>10]+s[e>>4&63]+s[e<<2&63]+"=")),n.join("")};for(var s=[],a=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=h.length;u<c;++u)s[u]=h[u],a[h.charCodeAt(u)]=u;a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(t,e,i){"use strict";function r(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var n=i(7),o=i(0),s=i(1),a=i(39),l=i(38),h=i(18),u=i(70),c=i(69),d=i(12),f=i(57),p=function(t,e,i){var r,n=o.getTypeOf(e),a=o.extend(i||{},l);a.date=a.date||new Date,null!==a.compression&&(a.compression=a.compression.toUpperCase()),"string"==typeof a.unixPermissions&&(a.unixPermissions=parseInt(a.unixPermissions,8)),a.unixPermissions&&16384&a.unixPermissions&&(a.dir=!0),a.dosPermissions&&16&a.dosPermissions&&(a.dir=!0),a.dir&&(t=m(t)),a.createFolders&&(r=g(t))&&y.call(this,r,!0);var c="string"===n&&!1===a.binary&&!1===a.base64;i&&void 0!==i.binary||(a.binary=!c),(e instanceof h&&0===e.uncompressedSize||a.dir||!e||0===e.length)&&(a.base64=!1,a.binary=!0,e="",a.compression="STORE",n="string");var p=null;p=e instanceof h||e instanceof s?e:d.isNode&&d.isStream(e)?new f(t,e):o.prepareContent(t,e,a.binary,a.optimizedBinaryString,a.base64);var E=new u(t,p,a);this.files[t]=E},g=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},y=function(t,e){return e=void 0!==e?e:l.createFolders,t=m(t),this.files[t]||p.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]},E={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,i,r;for(e in this.files)this.files.hasOwnProperty(e)&&(r=this.files[e],(i=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(i,r))},filter:function(t){var e=[];return this.forEach(function(i,r){t(i,r)&&e.push(r)}),e}
110,file:function(t,e,i){if(1===arguments.length){if(r(t)){var n=t;return this.filter(function(t,e){return!e.dir&&n.test(t)})}var o=this.files[this.root+t];return o&&!o.dir?o:null}return t=this.root+t,p.call(this,t,e,i),this},folder:function(t){if(!t)return this;if(r(t))return this.filter(function(e,i){return i.dir&&t.test(e)});var e=this.root+t,i=y.call(this,e),n=this.clone();return n.root=i.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var i=this.filter(function(e,i){return i.name.slice(0,t.length)===t}),r=0;r<i.length;r++)delete this.files[i[r].name];return this},generate:function(t){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,i={};try{if((i=o.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),"binarystring"===i.type&&(i.type="string"),!i.type)throw new Error("No output type specified.");o.checkSupport(i.type),"darwin"!==i.platform&&"freebsd"!==i.platform&&"linux"!==i.platform&&"sunos"!==i.platform||(i.platform="UNIX"),"win32"===i.platform&&(i.platform="DOS");var r=i.comment||this.comment||"";e=c.generateWorker(this,i,r)}catch(t){(e=new s("error")).error(t)}return new a(e,i.type||"string",i.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};t.exports=E},function(t,e,i){"use strict";function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var t=new r;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}r.prototype=i(103),r.prototype.loadAsync=i(56),r.support=i(3),r.defaults=i(38),r.version="3.1.5",r.loadAsync=function(t,e){return(new r).loadAsync(t,e)},r.external=i(8),t.exports=r}])}),i("formats/kml/KmzFile",["../../util/jszip","../../util/Promise","../../util/WWUtil"],function(t,e,i){"use strict";var r=function(t,e){this._binary=t,this._fileCache=e};return r.prototype.load=function(){var i=this,r=null,n=!1;return(new t).loadAsync(this._binary).then(function(t){return e.all(Object.keys(t.files).map(function(e){return t.files[e]}).map(function(t){return i.hasExtension("kml",t.name)&&!n?(n=!0,t.async("text").then(function(t){r=t})):i.hasExtension("kml",t.name)?t.async("base64").then(function(e){return new WorldWind.KmlFile(e).then(function(e){i._fileCache.add("href;"+t.name,e)})}):t.async("base64").then(function(e){var r="data:image/jpeg;base64,"+e;i._fileCache.add("href;"+t.name,r)})}))}).then(function(){return r})},r.prototype.hasExtension=function(t,e){return i.endsWith(e,"."+t)},r}),i("formats/kml/util/KmlRefreshListener",[],function(){var t=function(){this.currentActiveEvents=[]};return t.prototype.addEvent=function(t){var e=this;setTimeout(function(){e.currentActiveEvents.push(t)},t.time)},t.prototype.getActiveEvents=function(){var t=this.currentActiveEvents.slice();return this.currentActiveEvents=[],t},t.Event=function(t,e,i){this.type=t,this.payload=i,this.time=e},t}),i("formats/kml/util/KmlRemoteFile",["../../../error/ArgumentError","../../../util/Logger","../../../util/Promise"],function(t,e,i){"use strict";var r=function(i){if(!i.ajax&&!i.zip)throw new t(e.logMessage(e.LEVEL_SEVERE,"RemoteDocument","constructor","Invalid option for retrieval specified. Use either ajax or zip option."));this.options=i};return r.prototype.get=function(){var i=this.options;if(i.ajax)return this.ajax(i.url,i);if(i.zip)return i.responseType=i.responseType||"arraybuffer",this.ajax(i.url,i);throw new t(e.logMessage(e.LEVEL_SEVERE,"RemoteDocument","constructor","Invalid option for retrieval specified. Use either ajax or zip option."))},r.prototype.ajax=function(t,r){return new i(function(i,n){var o=new XMLHttpRequest;o.open("GET",t,!0),r.responseType&&(o.responseType=r.responseType),o.onreadystatechange=function(){if(4===o.readyState)if(200===o.status){var n;n="arraybuffer"==r.responseType?this.response:this.responseText,i({text:n,headers:o.getAllResponseHeaders()})}else e.log(e.LEVEL_WARNING,"KmlFile retrieval failed ("+o.statusText+"): "+t)},o.onerror=function(){e.log(e.LEVEL_WARNING,"Remote file retrieval failed: "+t),n()}.bind(this),o.ontimeout=function(){e.log(e.LEVEL_WARNING,"Remote file retrieval timed out: "+t),n()}.bind(this),o.send(null)})},r}),i("formats/kml/util/KmlStyleResolver",["../KmlFile","../styles/KmlStyle","../../../util/Logger","../../../util/Prom
110ise"],function(t,e,i,r){"use strict";var n=function(t){this._fileCache=t};return n.prototype.handleRemoteStyle=function(t,n){return t?this.handleStyleUrl(t):n?this.handleStyleSelector(n):(i.logMessage(i.LEVEL_INFO,"KmlStyleResolver","handleRemoteStyle","Style was null."),r.resolve(e.default()))},n.prototype.handleStyleUrl=function(t){var e=this;return this.handlePromiseOfFile(t).then(function(e){return e.resolveStyle(t)}).then(function(t){return t.isMap?t.resolve(e):r.resolve({normal:t,highlight:null})})},n.prototype.handlePromiseOfFile=function(t){var e=this._fileCache.retrieve(t);return e?r.resolve(e):new WorldWind.KmlFile({url:t}).then(function(e){return this._fileCache.add(t,e),e}.bind(this))},n.prototype.handleStyleSelector=function(t){return t.isMap?t.resolve(this):new r(function(e){window.setTimeout(function(){e({normal:t,highlight:null})},0)})},n}),i("util/XmlDocument",["../error/ArgumentError","../util/Logger"],function(t,e){var i=function(t){this._document=t};return i.prototype.dom=function(){if(DOMParser){var i=new DOMParser,r=i.parseFromString(this._document,"text/xml");if(r.getElementsByTagName("parsererror").length||!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"XmlDocument","dom","Invalid XML document. "+r.getElementsByTagName("parsererror")[0].innerHTML));return r}var n=new ActiveXObject("Microsoft.XMLDOM");return n.async=!1,n.loadXML(text),n},i.isValid=function(t){try{return new i(t).dom(),!0}catch(t){return!1}},i}),i("formats/kml/KmlFile",["../../error/ArgumentError","./KmlElements","./KmlFileCache","./KmlObject","./styles/KmlStyle","./styles/KmlStyleMap","./KmlTimeSpan","./KmlTimeStamp","./KmzFile","../../util/Logger","../../util/Promise","./util/KmlRefreshListener","./util/KmlRemoteFile","./util/KmlStyleResolver","../../util/XmlDocument","../../util/WWUtil"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g){"use strict";var m=function(e,n){var o=this;if(!e)throw new t(h.logMessage(h.LEVEL_SEVERE,"KmlFile","constructor","invalidDocumentPassed"));return this._controls=n||null,this._fileCache=new i,this._styleResolver=new f(this._fileCache),this._listener=new c,this._headers=null,this.requestRemote(e).then(function(t){var i=t.text;if(o._headers=t.headers,o.hasExtension("kmz",e)){return new l(i,o._fileCache).load()}return i}).then(function(t){return o._document=new p(t).dom(),r.call(o,{objectNode:o._document.documentElement,controls:n}),o._fileCache.add(e,o,!0),o})};return m.prototype=Object.create(r.prototype),Object.defineProperties(m.prototype,{shapes:{get:function(){return this._factory.all(this)}}}),m.prototype.render=function(t,e){var i=this;e=e||{},this.shapes.forEach(function(r){r.render(t,{lastStyle:e.lastStyle||null,lastVisibility:e.lastVisibility||null,currentTimeInterval:e.currentTimeInterval||null,regionInvisible:e.regionInvisible||null,fileCache:i._fileCache,styleResolver:i._styleResolver,listener:i._listener,activeEvents:i._listener.getActiveEvents()})})},m.prototype.hasExtension=function(t,e){return g.endsWith(e,"."+t)},m.prototype.requestRemote=function(t){var e={};return e.url=t,this.hasExtension("kmz",t)?e.zip=!0:e.ajax=!0,new d(e).get()},m.prototype.resolveStyle=function(t){var e=this,i=t.substring(t.indexOf("#")+1,t.length);return new u(function(t,r){var s;s=e._document.querySelector?e._document.querySelector("*[id='"+i+"']"):e._document.getElementById(i),s&&null!=s||r(),s.nodeName==n.prototype.getTagNames()[0]?t(new n({objectNode:s},{styleResolver:e._styleResolver})):s.nodeName==o.prototype.getTagNames()[0]?t(new o({objectNode:s},{styleResolver:e._styleResolver})):h.logMessage(h.LEVEL_WARNING,"KmlFile","resolveStyle","Style must contain either Style node or StyleMap node.")})},m.prototype.getExpired=function(){var t=new Date(this._headers.getRequestHeader("Expires"));return(new Date).getTime-t.getTime()},m}),i("formats/kml/KmlLatLonAltBox",["./KmlElements","./KmlObject","./util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlNorth:{get:function(){return this._factory.specific(this,{name:"north",transformer:i.number})}},kmlSouth:{get:function(){return this._factory.specific(this,{name:"south",transformer:i.number})}},kmlEast:{get:function(){return this._factory.specific(this,{name:"east",transformer:i.number})}},kmlWest:{get:function(){return this._factory.specific(this,{name:"west",transformer:i.number})}},kmlMinAltitude:{get:function(){return this._factory.specific(this,{name:"minAltitude",transformer:i.number})}},kmlMaxAltitude:{get:function(){return this._factory.specific(this,{name:"maxAltitude",transformer:i.number})}}}),r.prototype.getTagNames=function(){return["LatLonAltBox"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/KmlLod",["./KmlElements","./KmlObject","./util/KmlNodeTransformers"],function(t,e,
110i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlMinLodPixels:{get:function(){return this._factory.specific(this,{name:"minLodPixels",transformer:i.number})}},kmlMaxLodPixels:{get:function(){return this._factory.specific(this,{name:"maxLodPixels",transformer:i.number})}},kmlMinFadeExtent:{get:function(){return this._factory.specific(this,{name:"minFadeExtent",transformer:i.number})}},kmlMaxFadeExtent:{get:function(){return this._factory.specific(this,{name:"maxFadeExtent",transformer:i.number})}}}),r.prototype.getTagNames=function(){return["Lod"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/KmlRegion",["../../geom/BoundingBox","../../util/Color","./KmlElements","./KmlLatLonAltBox","./KmlLod","./KmlObject","./styles/KmlStyle","./util/KmlNodeTransformers","../../geom/Sector"],function(t,e,i,r,n,o,s,a,l){"use strict";var h=function(t){o.call(this,t)};return h.prototype=Object.create(o.prototype),Object.defineProperties(h.prototype,{kmlLatLonAltBox:{get:function(){return this._factory.specific(this,{name:r.prototype.getTagNames(),transformer:a.kmlObject})}},kmlLod:{get:function(){return this._factory.specific(this,{name:n.prototype.getTagNames(),transformer:a.kmlObject})}}}),h.prototype.intersectsVisible=function(e){var i=this.kmlLatLonAltBox,r=new t;return r.setToSector(new l(i.kmlSouth,i.kmlNorth,i.kmlWest,i.kmlEast),e.globe,i.kmlMinAltitude,i.kmlMaxAltitude),r.intersectsFrustum(e.frustumInModelCoordinates)&&(!i.kmlMinAltitude||e.eyePosition.altitude>i.kmlMinAltitude)&&(!i.kmlMaxAltitude||e.eyePosition.altitude<i.kmlMaxAltitude)},h.prototype.getTagNames=function(){return["Region"]},i.addKey(h.prototype.getTagNames()[0],h),h}),i("formats/kml/features/KmlFeature",["./../KmlObject","../KmlAbstractView","../KmlFile","../styles/KmlStyleMap","../styles/KmlStyleSelector","../KmlRegion","../KmlTimePrimitive","../util/KmlNodeTransformers","../../../util/Promise"],function(t,e,i,r,n,o,s,a,l){"use strict";var h=function(e){this.isFeature=e.isFeature=!0,t.call(this,e),this._pStyle=null,this.controlledVisibility=null};return h.prototype=Object.create(t.prototype),Object.defineProperties(h.prototype,{style:{get:function(){return this._pStyle}},kmlName:{get:function(){return this._factory.specific(this,{name:"name",transformer:a.string})}},kmlVisibility:{get:function(){return this._factory.specific(this,{name:"visibility",transformer:a.boolean})}},kmlOpen:{get:function(){return this._factory.specific(this,{name:"open",transformer:a.boolean})}},kmlAddress:{get:function(){return this._factory.specific(this,{name:"address",transformer:a.string})}},kmlPhoneNumber:{get:function(){return this._factory.specific(this,{name:"phoneNumber",transformer:a.string})}},kmlDescription:{get:function(){return this._factory.specific(this,{name:"description",transformer:a.string})}},kmlStyleUrl:{get:function(){return this._factory.specific(this,{name:"styleUrl",transformer:a.string})}},kmlSnippet:{get:function(){return this._factory.specific(this,{name:"Snippet",transformer:a.string})}},kmlAbstractView:{get:function(){return this._factory.any(this,{name:e.prototype.getTagNames()})}},kmlTimePrimitive:{get:function(){return this._factory.any(this,{name:s.prototype.getTagNames()})}},kmlStyleSelector:{get:function(){return this._factory.any(this,{name:n.prototype.getTagNames()})}},kmlRegion:{get:function(){return this._factory.any(this,{name:o.prototype.getTagNames()})}}}),h.prototype.render=function(e,i){t.prototype.render.call(this,e,i),this.solveStyle(e,i),this.solveVisibility(e,i)},h.prototype.solveStyle=function(t,e){this.getStyle(t,e),null!=this.style&&(e.lastStyle=this.style)},h.prototype.solveRegion=function(t){return!this.kmlRegion||this.kmlRegion.intersectsVisible(t)},h.prototype.solveVisibility=function(t,e){var i=!1!==e.lastVisibility,r=this.solveTimeVisibility(t),n=this.solveRegion(t),o=!1!==this.kmlVisibility;!0===this.controlledVisibility?this.enabled=!0:!1===this.controlledVisibility?this.enabled=!1:this.enabled=i&&r&&n&&o,e.lastVisibility=this.enabled,this._renderable&&(this._renderable.enabled=this.enabled)},h.prototype.solveTimeVisibility=function(t){var e=this.kmlTimePrimitive&&this.kmlTimePrimitive.timeRange();if(t.currentLayer.currentTimeInterval&&e){var i=t.currentLayer.currentTimeInterval[0],r=t.currentLayer.currentTimeInterval[1];if(e&&(e.from<i||e.from>r||e.to>r))return!1}return!0},h.prototype.getStyle=function(t,e){if(!this._pStyle){var i=this;return e.styleResolver.handleRemoteStyle(i.kmlStyleUrl,i.kmlStyleSelector).then(function(e){i._pStyle=e,t.redrawRequested=!0})}},h.prototype.getTagNames=function(){return["NetworkLink","Placemark","PhotoOverlay","ScreenOverlay","GroundOverlay","Folder","Document"]},h}),i("formats/kml/features/KmlContainer",["./KmlFeature"],function(t){"use strict";var e=function(e){t.call(this,e)};return e.prototype=Object.create(t.prototype),Object.defineProperties(e.prototype,{kmlShapes:{get:function(){return this._factory.all(this).filter(function(t){return t.isFeature})}}}),e.prototype.render=function(e,i){t.prototype.render.call(this,e,i);var r=this;
110this.kmlShapes.forEach(function(t){t.render(e,{lastStyle:i.lastStyle,lastVisibility:r.enabled,currentTimeInterval:i.currentTimeInterval,regionInvisible:i.regionInvisible,fileCache:i.fileCache,styleResolver:i.styleResolver,listener:i.listener,activeEvents:i.activeEvents})})},e.prototype.getTagNames=function(){return["Folder","Document"]},e}),i("formats/kml/controls/KmlControls",["../../../util/Logger"],function(t){"use strict";var e=function(){};return e.prototype.hook=function(){ 111t.logMessage(t.LEVEL_WARNING,"KmlControls","hook","Every KML controls should override hook method.")},e}),i("formats/kml/util/KmlCreate",["../KmlElements","../KmlObject"],function(t,e){var i=function(t){e.call(this,t)};return i.prototype=Object.create(e.prototype),Object.defineProperties(i.prototype,{shapes:{get:function(){return this._factory.all(this)}}}),i.prototype.getTagNames=function(){return["Create"]},t.addKey(i.prototype.getTagNames()[0],i),i}),i("formats/kml/util/KmlDelete",["../KmlElements","../KmlObject"],function(t,e){var i=function(t){e.call(this,t)};return i.prototype=Object.create(e.prototype),Object.defineProperties(i.prototype,{shapes:{get:function(){return this._factory.all(this)}}}),i.prototype.getTagNames=function(){return["Delete"]},t.addKey(i.prototype.getTagNames()[0],i),i}),i("formats/kml/util/KmlSchema",["./../KmlElements","../KmlObject"],function(t,e){"use strict";var i=function(t){e.call(this,t)};return i.prototype=Object.create(e.prototype),i.prototype.getTagNames=function(){return["Schema"]},t.addKey(i.prototype.getTagNames()[0],i),i}),i("formats/kml/features/KmlDocument",["./KmlContainer","../KmlElements","./KmlFeature","../util/KmlSchema"],function(t,e,i,r){"use strict";var n=function(e){t.call(this,e)};return n.prototype=Object.create(t.prototype),Object.defineProperties(n.prototype,{kmlSchemas:{get:function(){return this._factory.all(this).filter(function(t){return t instanceof r})}}}),n.prototype.getTagNames=function(){return["Document"]},e.addKey(n.prototype.getTagNames()[0],n),n}),i("formats/kml/features/KmlFolder",["./KmlContainer","./../KmlElements"],function(t,e){"use strict";var i=function(e){t.call(this,e)};return i.prototype=Object.create(t.prototype),i.prototype.getTagNames=function(){return["Folder"]},e.addKey(i.prototype.getTagNames()[0],i),i}),i("formats/kml/geom/KmlGeometry",["../KmlObject"],function(t){"use strict";var e=function(e){t.call(this,e),this._renderable=null};return e.prototype=Object.create(t.prototype),e.prototype.render=function(e,i){t.prototype.render.call(this,e,i),this.enabled=i.lastVisibility},e.prototype.getTagNames=e.getTagNames=function(){return["Point","LinearRing","LineString","MultiGeometry","Polygon"]},e}),i("formats/kml/KmlLatLonBox",["./KmlElements","./KmlObject","./util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlNorth:{get:function(){return this._factory.specific(this,{name:"north",transformer:i.number})}},kmlSouth:{get:function(){return this._factory.specific(this,{name:"south",transformer:i.number})}},kmlEast:{get:function(){return this._factory.specific(this,{name:"east",transformer:i.number})}},kmlWest:{get:function(){return this._factory.specific(this,{name:"west",transformer:i.number})}},kmlRotation:{get:function(){return this._factory.specific(this,{name:"rotation",transformer:i.string})}}}),r.prototype.getTagNames=function(){return["LatLonBox"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/KmlLatLonQuad",["./KmlElements","./KmlObject","./util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlCoordinates:{get:function(){return this._factory.specific(this,{name:"coordinates",transformer:i.string})}}}),r.prototype.getTagNames=function(){return["gx:LatLonQuad"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/features/KmlOverlay",["./KmlFeature","./../KmlIcon","../util/KmlNodeTransformers"],function(t,e,
111i){"use strict";var r=function(e){t.call(this,e)};return r.prototype=Object.create(t.prototype),Object.defineProperties(r.prototype,{kmlColor:{get:function(){return this._factory.specific(this,{name:"color",transformer:i.string})}},kmlDrawOrder:{get:function(){return this._factory.specific(this,{name:"drawOrder",transformer:i.string})}},kmlIcon:{get:function(){return this._factory.any(this,{name:e.prototype.getTagNames()})}}}),r.prototype.getTagNames=function(){return["PhotoOverlay","ScreenOverlay","GroundOverlay"]},r}),i("formats/kml/features/KmlGroundOverlay",["./../KmlElements","./KmlFeature","../KmlLatLonBox","../KmlLatLonQuad","./KmlOverlay","../util/KmlNodeTransformers","../../../geom/Sector","../../../shapes/SurfaceImage"],function(t,e,i,r,n,o,s,a){"use strict";var l=function(t){this.isGroundOverlay=!0,n.call(this,t)};return l.prototype=Object.create(n.prototype),Object.defineProperties(l.prototype,{kmlAltitude:{get:function(){return this._factory.specific(this,{name:"altitude",transformer:o.string})}},kmlAltitudeMode:{get:function(){return this._factory.specific(this,{name:"altitudeMode",transformer:o.string})}},kmlLatLonBox:{get:function(){return this._factory.any(this,{name:i.prototype.getTagNames()})}},kmlLatLonQuad:{get:function(){return this._factory.any(this,{name:r.prototype.getTagNames()})}}}),l.prototype.render=function(t,i){e.prototype.render.call(this,t,i),!this._renderable&&this.enabled&&this.kmlIcon&&this.kmlLatLonBox&&(this._renderable=new a(new s(this.kmlLatLonBox.kmlSouth,this.kmlLatLonBox.kmlNorth,this.kmlLatLonBox.kmlWest,this.kmlLatLonBox.kmlEast),this.kmlIcon.kmlHref(i.fileCache)),t.redrawRequested=!0),this._renderable&&this._renderable.render(t)},l.prototype.getTagNames=function(){return["GroundOverlay"]},t.addKey(l.prototype.getTagNames()[0],l),l}),i("formats/kml/util/KmlImagePyramid",["../KmlElements","../KmlObject","../util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlTileSize:{get:function(){return this._factory.specific(this,{name:"tileSize",transformer:i.number})}},kmlMaxWidth:{get:function(){return this._factory.specific(this,{name:"maxWidth",transformer:i.number})}},kmlMaxHeight:{get:function(){return this._factory.specific(this,{name:"maxHeight",transformer:i.number})}},kmlGridOrigin:{get:function(){return this._factory.specific(this,{name:"gridOrigin",transformer:i.string})}}}),r.prototype.getTagNames=function(){return["ImagePyramid"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("shapes/Path",["../shapes/AbstractShape","../error/ArgumentError","../shaders/BasicTextureProgram","../geom/BoundingBox","../util/Color","../geom/Location","../util/Logger","../geom/Matrix","../pick/PickedObject","../geom/Position","../shapes/ShapeAttributes","../shapes/SurfacePolyline","../geom/Vec2","../geom/Vec3"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f){"use strict";var p=function(i,r){if(!i)throw new e(s.logMessage(s.LEVEL_SEVERE,"Path","constructor","missingPositions"));t.call(this,r),this._positions=i,this._pathType=WorldWind.GREAT_CIRCLE,this._terrainConformance=10,this._numSubSegments=10,this.referencePosition=this.determineReferencePosition(this._positions),this.scratchPoint=new f(0,0,0)};return p.prototype=Object.create(t.prototype),Object.defineProperties(p.prototype,{positions:{get:function(){return this._positions},set:function(t){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Path","constructor","missingPositions"));this._positions=t,this.referencePosition=this.determineReferencePosition(this._positions),this.reset()}},followTerrain:{get:function(){return this._followTerrain},set:function(t){this._followTerrain=t,this.reset()}},terrainConformance:{get:function(){return this._terrainConformance},set:function(t){this._terrainConformance=t,this.reset()}},numSubSegments:{get:function(){return this._numSubSegments},set:function(t){this._numSubSegments=t>=0?t:0,this.reset()}},pathType:{get:function(){return this._pathType},set:function(t){this._pathType=t,this.reset()}},extrude:{get:function(){return this._extrude},set:function(t){this._extrude=t,this.reset()}}}),p.prototype.determineReferencePosition=function(t){return t.length>0?t[0]:null},p.prototype.mustGenerateGeometry=function(t){return!this.currentData.tessellatedPoints||(this.currentData.drawInterior!==this.activeAttributes.drawInterior||this.currentData.drawVerticals!==this.activeAttributes.drawVerticals||(!this.followTerrain&&this.currentData.numSubSegments!==this.numSubSegments||(!(!this.followTerrain||this.currentData.terrainConformance===this.terrainConformance)||this.altitudeMode!==WorldWind.ABSOLUTE&&this.currentData.isExpired)))},p.prototype.createSurfaceShape=function(){return new c(this.positions,null)},p.prototype.doMakeOrderedRenderable=function(t){if(!this.referencePosition)return null;if(!this.mustGenerateGeometry(t))return this;var e=this.currentData.referencePoint;t.surfacePointForMode(this.referencePosition.latitude,this.referencePosition.longitude,this.referencePosition.altitude,this._altitudeMode,e),this.currentData.transformationMatrix.setToTranslation(e[0],e[1],e[2]);var i=this.makeTessellatedPositions(t);if(i.length<2)return null;var n=this.computeRenderedPath(t,i);return this.currentData.tessellatedPoints=n,this.currentData.drawInterior=this.activeAttributes.drawInterior,this.currentData.drawVerticals=this.activeAttributes.drawVerticals,this.currentData.numSubSegments=this.numSubSegments,this.currentData.terrainConformance=this.terrainConformance,this.resetExpiration(this.currentData),this.currentData.fillVbo=!0,this.currentData.extent||(this.currentData.extent=new r),this.currentData.extent.setToPoints(n),this.currentData.extent.translate(this.currentData.referencePoint),this},p.prototype.makeTessellatedPositions=function(t){var e,i,r,n=[],o=t.eyePoint,
111s=this.mustDrawVerticals(t),a=new f(0,0,0),l=new f(0,0,0),h=this._positions[0];s&&(this.currentData.verticalIndices=new Int16Array(2*this.positions.length),this.currentData.verticalIndices[0]=0,this.currentData.verticalIndices[1]=1),n.push(h),t.surfacePointForMode(h.latitude,h.longitude,h.altitude,this._altitudeMode,a);for(var u=1,c=this._positions.length;u<c;u++)if(e=this._positions[u],t.surfacePointForMode(e.latitude,e.longitude,e.altitude,this._altitudeMode,l),i=o.distanceTo(a),r=t.pixelSizeAtDistance(i),a.distanceTo(l)<8*r&&this.altitudeMode!==WorldWind.ABSOLUTE?n.push(e):this.makeSegment(t,h,e,a,l,n),h=e,a.copy(l),s){var d=2*(n.length-1);this.currentData.verticalIndices[2*u]=d,this.currentData.verticalIndices[2*u+1]=d+1}return n},p.prototype.makeSegment=function(t,e,i,r,n,s){var a,l,u,c,d,f,p=t.eyePoint,g=new o(0,0),m=0;if(this._pathType===WorldWind.LINEAR&&!this._followTerrain)return void(r.equals(n)||s.push(i));if(u=this._pathType===WorldWind.LINEAR?o.linearDistance(e,i):this._pathType===WorldWind.RHUMB_LINE?o.rhumbDistance(e,i):o.greatCircleDistance(e,i),this._altitudeMode!==WorldWind.CLAMP_TO_GROUND&&(m=.5*(e.altitude+i.altitude)),!((a=u*(t.globe.equatorialRadius+m*t.verticalExaggeration))<=0)){for(l=this._pathType===WorldWind.LINEAR?o.linearAzimuth(e,i):this._pathType===WorldWind.RHUMB_LINE?o.rhumbAzimuth(e,i):o.greatCircleAzimuth(e,i),this.scratchPoint.copy(r),c=0,d=0;c<1&&(this._followTerrain?d+=this._terrainConformance*t.pixelSizeAtDistance(this.scratchPoint.distanceTo(p)):d+=a/this._numSubSegments,!(a<d||a-d<1e-9));)c=d/a,f=c*u,this._pathType===WorldWind.LINEAR?o.linearLocation(e,l,f,g):this._pathType===WorldWind.RHUMB_LINE?o.rhumbLocation(e,l,f,g):o.greatCircleLocation(e,l,f,g),g.altitude=(1-c)*e.altitude+c*i.altitude,s.push(new h(g.latitude,g.longitude,g.altitude)),this._followTerrain&&t.surfacePointForMode(g.latitude,g.longitude,g.altitude,WorldWind.CLAMP_TO_GROUND,this.scratchPoint);s.push(i)}},p.prototype.computeRenderedPath=function(t,e){var i,r,n,o,s=this.mustDrawInterior(t)||this.mustDrawVerticals(t),a=Number.MAX_VALUE,l=t.eyePoint,h=(s?2:1)*e.length,u=new Float32Array(3*h),c=s?6:3,d=new f(0,0,0);i=this._followTerrain&&this.altitudeMode!==WorldWind.CLAMP_TO_GROUND?WorldWind.RELATIVE_TO_GROUND:this.altitudeMode;for(var p=0,g=e.length;p<g;p++)r=e[p],t.surfacePointForMode(r.latitude,r.longitude,r.altitude,i,d),o=d.distanceToSquared(l),o<a&&(a=o),d.subtract(this.currentData.referencePoint),n=c*p,u[n]=d[0],u[n+1]=d[1],u[n+2]=d[2],s&&(t.surfacePointForMode(r.latitude,r.longitude,0,WorldWind.CLAMP_TO_GROUND,d),o=d.distanceToSquared(l),o<a&&(a=o),d.subtract(this.currentData.referencePoint),u[n+3]=d[0],u[n+4]=d[1],u[n+5]=d[2]);return this.currentData.pointBufferHasExtrusionPoints=s,this.currentData.eyeDistance=Math.sqrt(a),u},p.prototype.mustDrawInterior=function(t){return this.activeAttributes.drawInterior&&this._extrude&&this._altitudeMode!==WorldWind.CLAMP_TO_GROUND},p.prototype.mustDrawVerticals=function(t){return this.activeAttributes.drawOutline&&this.activeAttributes.drawVerticals&&this.altitudeMode!==WorldWind.CLAMP_TO_GROUND},p.prototype.doRenderOrdered=function(t){var e,i,r,n,o,s=t.currentGlContext,a=t.currentProgram,h=this.currentData,u=h.tessellatedPoints.length/3;if(this.applyMvpMatrix(t),h.vboCacheKey||(h.vboCacheKey=t.gpuResourceCache.generateCacheKey()),e=t.gpuResourceCache.resourceForKey(h.vboCacheKey),e||(e=s.createBuffer(),t.gpuResourceCache.putResource(this.currentData.vboCacheKey,e,4*h.tessellatedPoints.length),h.fillVbo=!0),s.bindBuffer(s.ARRAY_BUFFER,e),h.fillVbo&&(s.bufferData(s.ARRAY_BUFFER,h.tessellatedPoints,s.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1)),a.loadTextureEnabled(s,!1),t.pickingMode&&(r=t.uniquePickColor()),this.mustDrawInterior(t)&&(i=this.activeAttributes.interiorColor,s.depthMask(i.alpha*this.layer.opacity>=1||t.pickingMode),a.loadColor(s,t.pickingMode?r:i),a.loadOpacity(s,t.pickingMode?1:this.layer.opacity),s.vertexAttribPointer(a.vertexPointLocation,3,s.FLOAT,!1,0,0),s.drawArrays(s.TRIANGLE_STRIP,0,u)),this.activeAttributes.drawOutline&&((this.mustDrawVerticals(t)&&this.mustDrawInterior(t)||this.altitudeMode===WorldWind.CLAMP_TO_GROUND)&&this.applyMvpMatrixForOutline(t),i=this.activeAttributes.outlineColor,s.depthMask(i.alpha*this.layer.opacity>
111=1||t.pickingMode),a.loadColor(s,t.pickingMode?r:i),a.loadOpacity(s,t.pickingMode?1:this.layer.opacity),s.lineWidth(this.activeAttributes.outlineWidth),this.currentData.pointBufferHasExtrusionPoints?(n=24,o=u/2):(n=12,o=u),s.vertexAttribPointer(a.vertexPointLocation,3,s.FLOAT,!1,n,0),s.drawArrays(s.LINE_STRIP,0,o),this.mustDrawVerticals(t)&&(h.verticalIndicesVboCacheKey||(h.verticalIndicesVboCacheKey=t.gpuResourceCache.generateCacheKey()),e=t.gpuResourceCache.resourceForKey(h.verticalIndicesVboCacheKey),e||(e=s.createBuffer(),t.gpuResourceCache.putResource(h.verticalIndicesVboCacheKey,e,4*h.verticalIndices.length),h.fillVbo=!0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e),h.fillVbo&&(s.bufferData(s.ELEMENT_ARRAY_BUFFER,h.verticalIndices,s.STATIC_DRAW),t.frameStatistics.incrementVboLoadCount(1)),s.vertexAttribPointer(a.vertexPointLocation,3,s.FLOAT,!1,0,0),s.drawElements(s.LINES,h.verticalIndices.length,s.UNSIGNED_SHORT,0))),h.fillVbo=!1,t.pickingMode){var c=new l(r,this.pickDelegate?this.pickDelegate:this,null,this.layer,!1);t.resolvePick(c)}},p.prototype.beginDrawing=function(t){var e=t.currentGlContext;this.mustDrawInterior(t)&&e.disable(e.CULL_FACE),t.findAndBindProgram(i),e.enableVertexAttribArray(t.currentProgram.vertexPointLocation)},p.prototype.endDrawing=function(t){var e=t.currentGlContext;e.disableVertexAttribArray(t.currentProgram.vertexPointLocation),e.depthMask(!0),e.lineWidth(1),e.enable(e.CULL_FACE)},p}),i("formats/kml/geom/KmlLineString",["../../../util/Color","../KmlElements","./KmlGeometry","../styles/KmlStyle","../../../geom/Location","../util/KmlNodeTransformers","../../../shapes/Path","../../../geom/Position","../../../shapes/ShapeAttributes","../../../shapes/SurfacePolyline","../../../util/WWUtil"],function(t,e,i,r,n,o,s,a,l,h,u){"use strict";var c=function(t){i.call(this,t),this._style=null};return c.prototype=Object.create(i.prototype),Object.defineProperties(c.prototype,{kmlExtrude:{get:function(){return this._factory.specific(this,{name:"extrude",transformer:o.boolean})||!1}},kmlTessellate:{get:function(){return this._factory.specific(this,{name:"tessellate",transformer:o.boolean})||!1}},kmlAltitudeMode:{get:function(){return this._factory.specific(this,{name:"altitudeMode",transformer:o.string})||WorldWind.ABSOLUTE}},kmlPositions:{get:function(){return this._factory.specific(this,{name:"coordinates",transformer:o.positions})}},kmlCenter:{get:function(){var t=this.kmlPositions,e=0,i=0,r=0;return t.forEach(function(t){e+=t.latitude,i+=t.longitude,r+=t.altitude}),new a(e/this.kmlPositions.length,i/this.kmlPositions.length,r/this.kmlPositions.length)}}}),c.prototype.createPath=function(t,e){this.kmlAltitudeMode==WorldWind.CLAMP_TO_GROUND?this._renderable=new h(this.prepareLocations(),this.prepareAttributes(t.normal,e)):this._renderable=new s(this.prepareLocations(),this.prepareAttributes(t.normal,e)),t.highlight&&(this._renderable.highlightAttributes=this.prepareAttributes(t.highlight,e)),this.moveValidProperties()},c.prototype.render=function(t,e){i.prototype.render.call(this,t,e),e.lastStyle&&!this._renderable&&(this.createPath(e.lastStyle,e.fileCache),t.redrawRequested=!0),this._renderable&&(this._renderable.enabled=this.enabled,this._renderable.render(t))},c.prototype.prepareAttributes=function(t,e){var i=t&&t.generate(e)||{};return i._applyLighting=!0,i._drawOutline=!0,i._drawInterior=!0,i._drawVerticals=this.kmlExtrude||!1,i._outlineStippleFactor=0,i._outlineStipplePattern=61680,i._enableLighting=!0,new l(r.shapeAttributes(i))},c.prototype.prepareLocations=function(){return this.kmlPositions},c.prototype.moveValidProperties=function(){this._renderable.extrude=this.kmlExtrude||!1,this._renderable.altitudeMode=this.kmlAltitudeMode||WorldWind.ABSOLUTE,this._renderable.tesselate=this.kmlTesselate||!1},c.prototype.equals=function(t){return!!t&&(u.arrayEquals(t.kmlPositions,this.kmlPositions)&&t.kmlExtrude==this.kmlExtrude&&t.kmlTessellate==this.kmlTessellate&&t.kmlAltitudeMode==this.kmlAltitudeMode)},c.prototype.getTagNames=function(){return["LineString"]},e.addKey(c.prototype.getTagNames()[0],c),c}),i("formats/kml/geom/KmlLinearRing",["./KmlLineString","../KmlElements"],function(t,e){"use strict";var i=function(e){t.call(this,e)};return i.prototype=Object.create(t.prototype),i.prototype.getTagNames=function(){return["LinearRing"]},e.addKey(i.prototype.getTagNames()[0],i),i}),i("formats/kml/KmlLocation",["./KmlElements","./KmlObject","./util/KmlNodeTransformers"],function(t,e,
111i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlLongitude:{get:function(){return this._factory.specific(this,{name:"longitude",transformer:i.string})}},kmlLatitude:{get:function(){return this._factory.specific(this,{name:"latitude",transformer:i.string})}},kmlAltitude:{get:function(){return this._factory.specific(this,{name:"altitude",transformer:i.string})}}}),r.prototype.getTagNames=function(){return["Location"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/KmlLookAt",["./KmlAbstractView","./KmlElements","./util/KmlNodeTransformers","../../geom/Position"],function(t,e,i,r){"use strict";var n=function(e){t.call(this,e)};return n.prototype=Object.create(t.prototype),Object.defineProperties(n.prototype,{kmlLongitude:{get:function(){return this._factory.specific(this,{name:"longitude",transformer:i.number})}},kmlLatitude:{get:function(){return this._factory.specific(this,{name:"latitude",transformer:i.number})}},kmlAltitude:{get:function(){return this._factory.specific(this,{name:"altitude",transformer:i.number})}},kmlHeading:{get:function(){return this._factory.specific(this,{name:"heading",transformer:i.number})}},kmlTilt:{get:function(){return this._factory.specific(this,{name:"tilt",transformer:i.number})}},kmlRange:{get:function(){return this._factory.specific(this,{name:"range",transformer:i.number})}},kmlAltitudeMode:{get:function(){return this._factory.specific(this,{name:"altitudeMode",transformer:i.string})}}}),n.prototype.update=function(t){if(t.wwd){var e=this.kmlAltitude||4e3;t.wwd.goTo(new r(this.kmlLatitude,this.kmlLongitude,e))}},n.prototype.getTagNames=function(){return["LookAt"]},e.addKey(n.prototype.getTagNames()[0],n),n}),i("formats/kml/geom/KmlMultiGeometry",["./../KmlElements","./KmlGeometry","../../../geom/Position"],function(t,e,i){"use strict";var r=function(t){e.call(this,t),this._style=t.style};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlShapes:{get:function(){return this._factory.all(this)}},kmlCenter:{get:function(){var t=this.kmlShapes.map(function(t){return t.kmlCenter}),e=0,r=0,n=0;return t.forEach(function(t){e+=t.latitude,r+=t.longitude,n+=t.altitude}),new i(e/t.length,r/t.length,n/t.length)}}}),r.prototype.render=function(t,i){e.prototype.render.call(this,t,i),this.kmlShapes.forEach(function(e){e.render(t,i)})},r.prototype.getTagNames=function(){return["MultiGeometry"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/geom/KmlMultiTrack",["./../KmlElements","./KmlGeometry"],function(t,e){"use strict";var i=function(t){e.call(this,t)};return i.prototype=Object.create(e.prototype),i.prototype.getTagNames=function(){return["gx:MultiTrack"]},t.addKey(i.prototype.getTagNames()[0],i),i}),i("formats/kml/features/KmlNetworkLink",["./../KmlElements","./KmlFeature","../KmlFile","../KmlLink","../util/KmlNodeTransformers","../util/KmlRefreshListener"],function(t,e,i,r,n,o){"use strict";var s=function(t){e.call(this,t),this.isFeature=!0,this.resolvedFile=null,this.displayed=!1,this.isDownloading=!1};return s.prototype=Object.create(e.prototype),Object.defineProperties(s.prototype,{kmlRefreshVisibility:{get:function(){return this._factory.specific(this,{name:"refreshVisibility",transformer:n.boolean})}},kmlFlyToView:{get:function(){return this._factory.specific(this,{name:"flyToView",transformer:n.boolean})}},kmlLink:{get:function(){return this._factory.any(this,{name:r.prototype.getTagNames()})}}}),s.prototype.getTagNames=function(){return["NetworkLink"]},s.prototype.render=function(t,r){if(e.prototype.render.call(this,t,r),r.lastVisibility||this.displayed){if(!this.isDownloading&&!this.resolvedFile){this.isDownloading=!0;var n=this;new i(n.buildUrl(r.fileCache)).then(function(t){n.resolvedFile=t,n.isDownloading=!1,n.fireEvent(r)})}this.resolvedFile&&!this.displayed&&(this.resolvedFile.render(t,r),this.handleRefresh(r))}},s.prototype.buildUrl=function(t){return this.kmlLink.kmlHref(t)},s.prototype.handleRefresh=function(t){var e=t.activeEvents;if(e=e.filter(function(t){return"refreshNetworkLinkEvent"==t.type}),e.length>0){var r=this;new i(r.buildUrl(t.fileCache)).then(function(e){r.resolvedFile=e,r.fireEvent(t)})}},s.prototype.fireEvent=function(t){var e=0;if("onInterval"==this.kmlLink.kmlRefreshMode)e=1e3*this.kmlLink.kmlRefresh
111Interval;else{if("onExpire"!=this.kmlLink.kmlRefreshMode)return;if(!this.resolvedFile)return;e=this.resolvedFile.getExpired()}t.listener.addEvent(new o.Event("refreshNetworkLinkEvent",e,null))},t.addKey(s.prototype.getTagNames()[0],s),s}),i("formats/kml/util/KmlUpdate",["./KmlChange","./KmlCreate","./KmlDelete","../KmlElements","../KmlObject","./KmlNodeTransformers"],function(t,e,i,r,n,o){var s=function(t){n.call(this,t)};return s.prototype=Object.create(n.prototype),Object.defineProperties(s.prototype,{targetHref:{get:function(){return this._factory.specific(this,{name:"minRefreshPeriod",transformer:o.number})}},Change:{get:function(){return this._factory.any(this,{name:t.prototype.getTagNames()})}},Create:{get:function(){return this._factory.any(this,{name:e.prototype.getTagNames()})}},Delete:{get:function(){return this._factory.any(this,{name:i.prototype.getTagNames()})}}}),s.prototype.getTagNames=function(){return["Update"]},r.addKey(s.prototype.getTagNames()[0],s),s}),i("formats/kml/util/KmlNetworkLinkControl",["../KmlAbstractView","../KmlElements","../KmlObject","./KmlNodeTransformers","./KmlUpdate"],function(t,e,i,r,n){var o=function(t){i.call(this,t)};return o.prototype=Object.create(i.prototype),Object.defineProperties(o.prototype,{minRefreshPeriod:{get:function(){return this._factory.specific(this,{name:"minRefreshPeriod",transformer:r.number})}},maxSessionLength:{get:function(){return this._factory.specific(this,{name:"maxSessionLength",transformer:r.number})}},cookie:{get:function(){return this._factory.specific(this,{name:"cookie",transformer:r.string})}},message:{get:function(){return this._factory.specific(this,{name:"message",transformer:r.string})}},linkName:{get:function(){return this._factory.specific(this,{name:"linkName",transformer:r.string})}},linkDescription:{get:function(){return this._factory.specific(this,{name:"linkDescription",transformer:r.string})}},linkSnippet:{get:function(){return this._factory.specific(this,{name:"linkSnippet",transformer:r.string})}},expires:{get:function(){return this._factory.specific(this,{name:"expires",transformer:r.date})}},Update:{get:function(){return this._factory.any(this,{name:n.prototype.getTagNames()})}},AbstractView:{get:function(){return this._factory.any(this,{name:t.prototype.getTagNames()})}}}),o.prototype.getTagNames=function(){return["NetworkLinkControl"]},e.addKey(o.prototype.getTagNames()[0],o),o}),i("formats/kml/KmlOrientation",["./KmlElements","./KmlObject","./util/KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlHeading:{get:function(){return this._factory.specific(this,{name:"heading",transformer:i.number})}},kmlTilt:{get:function(){return this._factory.specific(this,{name:"tilt",transformer:i.number})}},kmlRoll:{get:function(){return this._factory.specific(this,{name:"roll",transformer:i.number})}}}),r.prototype.getTagNames=function(){return["Orientation"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/geom/KmlPoint",["../../../util/Color","../KmlElements","./KmlGeometry","../../../geom/Location","../util/KmlNodeTransformers","../../../shapes/Polygon","../../../geom/Position"],function(t,e,i,r,n,o,s){"use strict";var a=function(t){i.call(this,t),this._shape=null};return a.prototype=Object.create(i.prototype),Object.defineProperties(a.prototype,{kmlPosition:{get:function(){var t=this._factory.specific(this,{name:"coordinates",transformer:n.string}).split(",");return new s(t[1],t[0],t[2]||0)}},kmlExtrude:{get:function(){return this._factory.specific(this,{name:"extrude",transformer:n.boolean})}},kmlAltitudeMode:{get:function(){return this._factory.specific(this,{name:"altitudeMode",transformer:n.string})}},kmlCenter:{get:function(){return this.kmlPosition}}}),a.prototype.getTagNames=function(){return["Point"]},e.addKey(a.prototype.getTagNames()[0],a),a}),i("formats/kml/util/KmlViewVolume",["../KmlElements","../KmlObject","./KmlNodeTransformers"],function(t,e,i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlLeftFov:{get:function(){return this._factory.specific(this,{name:"leftFov",transformer:i.number})}},kmlRightFov:{get:function(){return this._factory.specific(this,{name:"rightFov",transformer:i.number})}},kmlBottomFov:{get:function(){return this._factory.specific(this,{name:"bottomFov",transformer:i.number})}},kmlTopFov:{get:function(){return this._factory.specific(this,{name:"topFov",transformer:i.number})}},kmlNear:{get:function(){return this._factory.specific(this,{name:"near",transformer:i.string})}}}),r.prototype.getTagNames=function(){return["ViewVolume"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/features/KmlPhotoOverlay",["../util/KmlImagePyramid","./../KmlElements","./KmlOverlay","../geom/KmlPoint","../util/KmlNodeTransformers","../util/KmlViewVolume"],function(t,e,
111i,r,n,o){"use strict";var s=function(t){i.call(this,t)};return s.prototype=Object.create(i.prototype),Object.defineProperties(s.prototype,{kmlRotation:{get:function(){return this._factory.specific(this,{name:"rotation",transformer:n.string})}},kmlShape:{get:function(){return this._factory.specific(this,{name:"shape",transformer:n.string})}},kmlPoint:{get:function(){return this._factory.any(this,{name:r.prototype.getTagNames()})}},kmlViewVolume:{get:function(){return this._factory.any(this,{name:o.prototype.getTagNames()})}},kmlImagePyramid:{get:function(){return this._factory.any(this,{name:t.prototype.getTagNames()})}}}),s.prototype.getTagNames=function(){return["PhotoOverlay"]},e.addKey(s.prototype.getTagNames[0],s),s}),i("formats/kml/features/KmlPlacemark",["./../KmlElements","./KmlFeature","../geom/KmlGeometry","../styles/KmlStyle","../KmlTimeSpan","../KmlTimeStamp","../../../shapes/PlacemarkAttributes","../../../shapes/Placemark","../../../util/Color","../../../shapes/ShapeAttributes","../../../shapes/TextAttributes","../../../util/Offset","../../../util/WWUtil"],function(t,e,i,r,n,o,s,a,l,h,u,c,d){"use strict";var f=function(t){e.call(this,t)};return f.prototype=Object.create(e.prototype),Object.defineProperties(f.prototype,{kmlGeometry:{get:function(){return this._factory.any(this,{name:i.prototype.getTagNames()})}}}),f.prototype.render=function(t,i){e.prototype.render.call(this,t,i),i=d.clone(i),i.lastStyle&&!this._renderable&&this.kmlGeometry&&(this._renderable=new a(this.kmlGeometry.kmlCenter,!1,this.prepareAttributes(i.lastStyle.normal,i.fileCache)),i.lastStyle.highlight&&(this._renderable.highlightAttributes=this.prepareAttributes(i.lastStyle.highlight,i.fileCache)),this.moveValidProperties(),t.redrawRequested=!0),this._renderable&&this.kmlGeometry&&(this.kmlGeometry.render(t,i),this._renderable.render(t))},f.prototype.prepareAttributes=function(t,e){var i=t&&t.generate({},e)||{normal:{},highlight:{}},n=new s(r.placemarkAttributes(i));return n.imageOffset=new c(WorldWind.OFFSET_FRACTION,.3,WorldWind.OFFSET_FRACTION,0),n.imageColor=l.WHITE,n.labelAttributes=new u(r.textAttributes({_offset:new c(WorldWind.OFFSET_FRACTION,.5,WorldWind.OFFSET_FRACTION,1),_color:l.YELLOW})),n.drawLeaderLine=!0,n.leaderLineAttributes=new h(r.shapeAttributes({_outlineColor:l.RED})),n},f.prototype.moveValidProperties=function(){this._renderable.label=this.kmlName||"",this._renderable.altitudeMode=this.kmlAltitudeMode||WorldWind.RELATIVE_TO_GROUND,this._renderable.enableLeaderLinePicking=!0},f.prototype.getTagNames=function(){return["Placemark"]},t.addKey(f.prototype.getTagNames()[0],f),f}),i("formats/kml/geom/KmlPolygon",["../../../util/Color","../KmlElements","./KmlGeometry","./KmlLinearRing","../styles/KmlStyle","../../../geom/Location","../util/KmlNodeTransformers","../../../shapes/Polygon","../../../shapes/ShapeAttributes","../../../shapes/SurfacePolygon"],function(t,e,i,r,n,o,s,a,l,h){"use strict";var u=function(t){i.call(this,t),this.initialized=!1};return u.prototype=Object.create(i.prototype),Object.defineProperties(u.prototype,{kmlExtrude:{get:function(){return this._factory.specific(this,{name:"extrude",transformer:s.boolean})}},kmlTessellate:{get:function(){return this._factory.specific(this,{name:"tessellate",transformer:s.boolean})}},kmlAltitudeMode:{get:function(){return this._factory.specific(this,{name:"altitudeMode",transformer:s.string})}},kmlOuterBoundary:{get:function(){return this._factory.specific(this,{name:"outerBoundaryIs",transformer:s.linearRing})}},kmlInnerBoundary:{get:function(){return this._factory.specific(this,{name:"innerBoundaryIs",transformer:s.linearRing})}},kmlCenter:{get:function(){return this.kmlOuterBoundary.kmlCenter}}}),u.prototype.createPolygon=function(t,e){this.kmlAltitudeMode===WorldWind.CLAMP_TO_GROUND||this.kmlInnerBoundary&&this.kmlInnerBoundary.kmlAltitudeMode===WorldWind.CLAMP_TO_GROUND||this.kmlOuterBoundary&&this.kmlOuterBoundary.kmlAltitudeMode===WorldWind.CLAMP_TO_GROUND?this._renderable=new h(this.prepareLocations(),this.prepareAttributes(t.normal,e)):this._renderable=new a(this.prepareLocations(),this.prepareAttributes(t.normal,e)),t.highlight&&(this._renderable.highlightAttributes=this.prepareAttributes(t.highlight,e)),this.moveValidProperties()},u.prototype.render=function(t,e){i.prototype.render.call(this,t,e), 112e.lastStyle&&!this._renderable&&(this.createPolygon(e.lastStyle,e.fileCache),t.redrawRequested=!0),this._renderable&&(this._renderable.enabled=this.enabled,this._renderable.render(t))},u.prototype.moveValidProperties=function(){this._renderable.extrude=this.kmlExtrude||!0,this._renderable.altitudeMode=this.kmlAltitudeMode||WorldWind.CLAMP_TO_GROUND},u.prototype.prepareAttributes=function(t,e){var i=t&&t.generate(e)||{};return i._drawVerticals=this.kmlExtrude||!1,i._applyLighting=!0,i._depthTest=!0,i._outlineStippleFactor=0,i._outlineStipplePattern=61680,i._enableLighting=!0,new l(n.shapeAttributes(i))},u.prototype.prepareLocations=function(){var t=[];return null!=this.kmlInnerBoundary?(t[0]=this.kmlInnerBoundary.kmlPositions,t[1]=this.kmlOuterBoundary.kmlPositions):t=this.kmlOuterBoundary.kmlPositions,t},u.prototype.getStyle=function(){return this._style},u.prototype.getTagNames=function(){return["Polygon"]},e.addKey(u.prototype.getTagNames()[0],u),u}),i("formats/kml/util/KmlScale",["./../KmlElements","../KmlObject","./KmlNodeTransformers"],function(t,e,
112i){"use strict";var r=function(t){e.call(this,t)};return r.prototype=Object.create(e.prototype),Object.defineProperties(r.prototype,{kmlX:{get:function(){return this._factory.specific(this,{name:"x",transformer:i.number})}},kmlY:{get:function(){return this._factory.specific(this,{name:"y",transformer:i.number})}},kmlZ:{get:function(){return this._factory.specific(this,{name:"z",transformer:i.number})}}}),r.prototype.getTagNames=function(){return["Scale"]},t.addKey(r.prototype.getTagNames()[0],r),r}),i("formats/kml/features/KmlScreenOverlay",["./../KmlElements","./KmlFeature","./KmlOverlay","../util/KmlNodeTransformers","../../../util/Offset","../../../shapes/ScreenImage"],function(t,e,i,r,n,o){"use strict";var s=function(t){i.call(this,t)};return s.prototype=Object.create(i.prototype),Object.defineProperties(s.prototype,{kmlRotation:{get:function(){return this._factory.specific(this,{name:"rotation",transformer:r.number})}},kmlOverlayXYx:{get:function(){return this._factory.specific(this,{name:"overlayXY",transformer:r.attribute("x"),attribute:"kmlOverlayXYx"})}},kmlOverlayXYy:{get:function(){return this._factory.specific(this,{name:"overlayXY",transformer:r.attribute("y"),attribute:"kmlOverlayXYy"})}},kmlOverlayXYxunits:{get:function(){return this._factory.specific(this,{name:"overlayXY",transformer:r.attribute("xunits"),attribute:"kmlOverlayXYxunits"})}},kmlOverlayXYyunits:{get:function(){return this._factory.specific(this,{name:"overlayXY",transformer:r.attribute("yunits"),attribute:"kmlOverlayXYyunits"})}},kmlScreenXYx:{get:function(){return this._factory.specific(this,{name:"screenXY",transformer:r.attribute("x"),attribute:"kmlScreenXYx"})}},kmlScreenXYy:{get:function(){return this._factory.specific(this,{name:"screenXY",transformer:r.attribute("y"),attribute:"kmlScreenXYy"})}},kmlScreenXYxunits:{get:function(){return this._factory.specific(this,{name:"screenXY",transformer:r.attribute("xunits"),attribute:"kmlScreenXYxunits"})}},kmlScreenXYyunits:{get:function(){return this._factory.specific(this,{name:"screenXY",transformer:r.attribute("yunits"),attribute:"kmlScreenXYyunits"})}},kmlRotationXYx:{get:function(){return this._factory.specific(this,{name:"rotationXY",transformer:r.attribute("x"),attribute:"kmlRotationXYx"})}},kmlRotationXYy:{get:function(){return this._factory.specific(this,{name:"rotationXY",transformer:r.attribute("y"),attribute:"kmlRotationXYy"})}},kmlRotationXYxunits:{get:function(){return this._factory.specific(this,{name:"rotationXY",transformer:r.attribute("xunits"),attribute:"kmlRotationXYxunits"})}},kmlRotationXYyunits:{get:function(){return this._factory.specific(this,{name:"rotationXY",transformer:r.attribute("yunits"),attribute:"kmlRotationXYyunits"})}},kmlSizex:{get:function(){return this._factory.specific(this,{name:"size",transformer:r.attribute("x"),attribute:"kmlSizex"})}},kmlSizey:{get:function(){return this._factory.specific(this,{name:"size",transformer:r.attribute("y"),attribute:"kmlSizey"})}},kmlSizexunits:{get:function(){return this._factory.specific(this,{name:"size",transformer:r.attribute("xunits"),attribute:"kmlSizexunits"})}},kmlSizeyunits:{get:function(){return this._factory.specific(this,{name:"size",transformer:r.attribute("yunits"),attribute:"kmlSizeyunits"})}}}),s.prototype.render=function(t,i){e.prototype.render.call(this,t,i),this._renderable||this.kmlIcon&&(this._renderable=new o(new n(this.kmlScreenXYxunits,this.kmlScreenXYx,this.kmlScreenXYyunits,this.kmlScreenXYy),this.kmlIcon.kmlHref(i.fileCache)),this._renderable.imageOffset=new n(this.kmlOverlayXYxunits,this.kmlOverlayXYx,this.kmlOverlayXYyunits,this.kmlOverlayXYy),t.redrawRequested=!0),this._renderable&&this._renderable.render(t)},s.prototype.getTagNames=function(){return["ScreenOverlay"]},t.addKey(s.prototype.getTagNames()[0],s),s}),i("formats/kml/features/KmlTour",["./../KmlElements","./KmlFeature"],function(t,e){"use strict";var i=function(t){e.call(this,t)};return i.prototype=Object.create(e.prototype),i.prototype.getTagNames=function(){return["gx:Tour"]},t.addKey(i.prototype.getTagNames()[0],i),i}),i("formats/kml/geom/KmlTrack",["./../KmlElements","./KmlGeometry"],function(t,e){"use strict";var i=function(t){e.call(this,t)};return i.prototype=Object.create(e.prototype),i.prototype.getTagNames=function(){return["gx:Track"]},t.addKey(i.prototype.getTagNames()[0],i),i}),i("formats/kml/controls/KmlTreeVisibility",["../../../util/WWUtil","./KmlControls"],function(t,e){"use strict";var i=function(t,i){e.apply(this),this._visualElementId=t,this._wwd=i};return i.prototype=Object.create(e.prototype),i.prototype.hook=function(t,e){e.isFeature&&this.createControls(t)},i.prototype.createControls=function(e){function i(){o=!o,h.updateDescendants(e,o)}function r(){e.kmlAbstractView&&e.kmlAbstractView.update({wwd:h._wwd})}
112var n=e.kmlName||e.id||t.guid(),o=e.enabled&&!0===e.kmlVisibility,s=document.createElement("div"),a=document.createElement("input");a.setAttribute("type","checkbox"),o&&a.setAttribute("checked","checked"),a.addEventListener("click",i,!0),s.appendChild(a);var l;l=e.kmlAbstractView?document.createElement("a"):document.createElement("span"),l.appendChild(document.createTextNode(n)),l.addEventListener("click",r,!0),s.appendChild(l),document.getElementById(this._visualElementId).appendChild(s);var h=this},i.prototype.updateDescendants=function(t,e){t.controlledVisibility=e,this._wwd.redraw()},i}),i("layer/LandsatRestLayer",["../error/ArgumentError","../geom/Location","../util/Logger","../geom/Sector","../layer/TiledImageLayer","../util/LevelRowColumnUrlBuilder","../util/WWUtil"],function(t,e,i,r,n,o,s){"use strict";var a=function(t,i,a){var l=s.urlPath(t+"/"+i);n.call(this,r.FULL_SPHERE,new e(36,36),10,"image/png",l,512,512),this.displayName=a,this.pickEnabled=!1,this.urlBuilder=new o(t,i)};return a.prototype=Object.create(n.prototype),a}),i("util/measure/LengthMeasurer",["../../error/ArgumentError","../../geom/Location","../Logger","./MeasurerUtils","../../geom/Position","../../geom/Vec3"],function(t,e,i,r,n,o){var s=function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"LengthMeasurer","constructor","missingWorldWindow"));this.wwd=e,this.DEFAULT_MIN_SEGMENT_LENGTH=30,this._maxSegmentLength=1e5,this._lengthTerrainSamplingSteps=128,this.subdividedPositions=null};return Object.defineProperties(s.prototype,{maxSegmentLength:{get:function(){return this._maxSegmentLength},set:function(t){this._maxSegmentLength=t}},lengthTerrainSamplingSteps:{get:function(){return this._lengthTerrainSamplingSteps},set:function(t){this._lengthTerrainSamplingSteps=t}}}),s.prototype.getLength=function(t,e,i){return i=i||WorldWind.GREAT_CIRCLE,this.subdividedPositions=null,this.computeLength(t,e,i)},s.prototype.getPathLength=function(t){return this.subdividedPositions=null,this.computeLength(t.positions,t.followTerrain,t.pathType)},s.prototype.getGeographicDistance=function(t,i){if(t instanceof WorldWind.Path)var r=t.positions,n=t.pathType;else Array.isArray(t)&&(r=t,n=i||WorldWind.GREAT_CIRCLE);if(!r||r.length<2)return-1;var o=e.greatCircleDistance;n===WorldWind.RHUMB_LINE?o=e.rhumbDistance:n===WorldWind.LINEAR&&(o=e.linearDistance);for(var s=0,a=0,l=r.length-1;a<l;a++){s+=o(r[a],r[a+1])}return s*this.wwd.globe.equatorialRadius},s.prototype.computeLength=function(t,e,i){if(!t||t.length<2)return-1;var n=this.wwd.globe;if(null==this.subdividedPositions){var s=this._maxSegmentLength;if(e){s=this.computeLength(t,!1,i)/this._lengthTerrainSamplingSteps,s=Math.min(Math.max(s,this.DEFAULT_MIN_SEGMENT_LENGTH),this._maxSegmentLength)}this.subdividedPositions=r.subdividePositions(n,t,e,i,s)}var a=0,l=this.subdividedPositions[0],h=new o(0,0,0),u=new o(0,0,0);h=n.computePointFromPosition(l.latitude,l.longitude,l.altitude,h);for(var c=1,d=this.subdividedPositions.length;c<d;c++){var f=this.subdividedPositions[c];u=n.computePointFromPosition(f.latitude,f.longitude,f.altitude,u),a+=h.distanceTo(u),h.copy(u)}return a},s}),i("navigate/Navigator",[],function(){"use strict";return function(){this.heading=0,this.tilt=0,this.roll=0}}),i("navigate/LookAtNavigator",["../geom/Location","../navigate/Navigator"],function(t,e){"use strict";var i=function(){e.call(this),this.lookAtLocation=new t(30,-110),this.range=1e7,this.enable2DLimits=!0};return i.prototype=Object.create(e.prototype),i}),i("geom/MeasuredLocation",["./Angle","./Location"],function(t,e){"use strict";var i=function(t,i,r){e.call(this,t,i),this.measure=r};return i.prototype=Object.create(e.prototype),i.fromRadians=function(e,r,n){return new i(e*t.RADIANS_TO_DEGREES,r*t.RADIANS_TO_DEGREES,n)},i.prototype.copy=function(t){return e.prototype.copy.call(this,t),this.measure=t.measure,this},i.prototype.set=function(t,i,r){return e.prototype.set.call(this,t,i),this.measure=r,this},i.prototype.equals=function(t){return e.prototype.equals.call(this,t)&&this.measure===t.measure},i}),i("cache/MemoryCacheListener",["../util/Logger","../error/UnsupportedOperationError"],function(t,e){"use strict";var i=function(){};return i.prototype.entryRemoved=function(i,r){throw new e(t.logMessage(t.LEVEL_SEVERE,"MemoryCacheListener","entryRemoved","abstractInvocation"))},i.prototype.removalError=function(i,r,n){throw new e(t.logMessage(t.LEVEL_SEVERE,"MemoryCacheListener","removalError","abstractInvocation"))},i}),i("util/NominatimGeocoder",["../util/Logger"],function(t){"use strict";var e=function(){this.service="https://open.mapquestapi.com/nominatim/v1/search/"};
112return e.prototype.lookup=function(t,e,i){var r=this.service+t.replace(" ","%20")+"?format=json",n=new XMLHttpRequest,o=this;r+="&key="+(i||"lUvVRchXGGDh5Xwk3oidrXeIDAAevOUS"),n.open("GET",r,!0),n.onreadystatechange=function(){if(4===n.readyState&&200===n.status){var t=JSON.parse(n.responseText);e(o,t)}},n.send(null)},e}),i("ogc/ows/OwsLanguageString",["../../error/ArgumentError","../../util/Logger"],function(t,e){"use strict";return function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"LanguageString","constructor","missingDomElement"));this.value=i.textContent,this.lang;var r=i.getAttribute("lang");r&&(this.lang=r)}}),i("ogc/ows/OwsDescription",["../../error/ArgumentError","../../util/Logger","../../ogc/ows/OwsLanguageString"],function(t,e,i){"use strict";return function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsDescription","assembleDescriptions","missingDomElement"));for(var n=r.children||r.childNodes,o=0;o<n.length;o++){var s=n[o];if("Title"===s.localName)this.titles=this.titles||[],this.titles.push(new i(s));else if("Abstract"===s.localName)this.abstracts=this.abstracts||[],this.abstracts.push(new i(s));else if("Keywords"===s.localName){this.keywords=this.keywords||[];for(var a=s.children||s.childNodes,l=0;l<a.length;l++){var h=a[l];"Keyword"===h.localName&&this.keywords.push(new i(h))}}}}}),i("ogc/ows/OwsConstraint",["../../error/ArgumentError","../../util/Logger"],function(t,e){"use strict";return function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsConstraint","constructor","missingDomElement"));this.name=i.getAttribute("name");for(var r=i.children||i.childNodes,n=0;n<r.length;n++){var o=r[n];if("AllowedValues"===o.localName){this.allowedValues=this.allowedValues||[];for(var s=o.children||o.childNodes,a=0;a<s.length;a++)"Value"===s[a].localName&&this.allowedValues.push(s[a].textContent)}else"AnyValue"===o.localName?this.anyValue=!0:"NoValues"===o.localName&&(this.noValues=!0)}}}),i("ogc/ows/OwsOperationsMetadata",["../../error/ArgumentError","../../util/Logger","../../ogc/ows/OwsConstraint"],function(t,e,i){"use strict";var r=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsOperationsMetadata","constructor","missingDomElement"));for(var n=i.children||i.childNodes,o=0;o<n.length;o++){var s=n[o];"Operation"===s.localName&&(this.operation=this.operation||[],this.operation.push(r.assembleOperation(s)))}};return r.prototype.getGetCapabilities=function(){return this.getOperationMetadataByName("GetCapabilities")},r.prototype.getGetTile=function(){return this.getOperationMetadataByName("GetTile")},r.prototype.getOperationMetadataByName=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsOperationsMetadata","getOperationsMetadataByName","missingName"));for(var r=0;r<this.operation.length;r++)if(this.operation[r].name===i)return this.operation[r];return null},r.assembleOperation=function(t){var e={};e.name=t.getAttribute("name");for(var i=t.children||t.childNodes,n=0;n<i.length;n++){var o=i[n];"DCP"===o.localName&&(e.dcp=e.dcp||[],e.dcp.push(r.assembleDcp(o)))}return e},r.assembleDcp=function(t){for(var e={},i=t.children||t.childNodes,n=0;n<i.length;n++){var o=i[n];if("HTTP"===o.localName)for(var s=o.children||o.childNodes,a=0;a<s.length;a++){var l=s[a];"Get"===l.localName?(e.getMethods=e.getMethods||[],e.getMethods.push(r.assembleMethod(l))):"Post"===l.localName&&(e.postMethods=e.postMethods||[],e.postMethods.push(r.assembleMethod(l)))}}return e},r.assembleMethod=function(t){var e={};e.url=t.getAttribute("xlink:href");for(var r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];"Constraint"===o.localName&&(e.constraint=e.constraint||[],e.constraint.push(new i(o)))}return e},r}),i("ogc/ows/OwsServiceIdentification",["../../error/ArgumentError","../../util/Logger","../../ogc/ows/OwsDescription"],function(t,e,i){"use strict";var r=function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsServiceIdentification","constructor","missingDomElement"));i.call(this,r);for(var n=r.children||r.childNodes,o=0;o<n.length;o++){var s=n[o];"ServiceType"===s.localName?this.serviceType=s.textContent:"ServiceTypeVersion"===s.localName?(this.serviceTypeVersions=this.serviceTypeVersions||[],this.serviceTypeVersions.push(s.textContent)):"Profile"===s.localName?(this.profile=this.profile||[],this.profile.push(s.textContent)):"Fees"===s.localName?this.fees=s.textContent:"Acce
112ssConstraints"===s.localName&&(this.accessConstraints=this.accessConstraints||[],this.accessConstraints.push(s.textContent))}};return r.prototype=Object.create(i.prototype),r}),i("ogc/ows/OwsServiceProvider",["../../error/ArgumentError","../../util/Logger"],function(t,e){"use strict";var i=function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsServiceProvider","constructor","missingDomElement"));for(var n=r.children||r.childNodes,o=0;o<n.length;o++){var s=n[o];"ProviderName"===s.localName?this.providerName=s.textContent:"ProviderSite"===s.localName?this.providerSiteUrl=s.getAttribute("xlink:href"):"ServiceContact"===s.localName&&(this.serviceContact=i.assembleServiceContact(s))}};return i.assembleServiceContact=function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsServiceProvider","assembleServiceContact","missingDomElement"));for(var n={},o=r.children||r.childNodes,s=0;s<o.length;s++){var a=o[s];"IndividualName"===a.localName?n.individualName=a.textContent:"PositionName"===a.localName?n.positionName=a.textContent:"ContactInfo"===a.localName&&(n.contactInfo=i.assembleContacts(a))}return n},i.assembleContacts=function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsServiceProvider","assembleContacts","missingDomElement"));for(var n={},o=r.children||r.childNodes,s=0;s<o.length;s++){var a=o[s];"HoursOfService"===a.localName?n.hoursOfService=a.textContent:"ContactInstructions"===a.localName?n.contactInstructions=a.textContent:"Phone"===a.localName?n.phone=i.assemblePhone(a):"Address"===a.localName&&(n.address=i.assembleAddress(a))}return n},i.assemblePhone=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsServiceProvider","assemblePhone","missingDomElement"));for(var r={},n=i.children||i.childNodes,o=0;o<n.length;o++){var s=n[o];"Voice"===s.localName?r.voice=s.textContent:"Facsimile"===s.localName&&(r.facsimile=s.textContent)}return r},i.assembleAddress=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsServiceProvider","assembleAddress","missingDomElement"));for(var r={},n=i.children||i.childNodes,o=0;o<n.length;o++){var s=n[o];"DeliveryPoint"===s.localName?(r.deliveryPoints=r.deliveryPoints||[],r.deliveryPoints.push(s.textContent)):"City"===s.localName?r.city=s.textContent:"AdministrativeArea"===s.localName?r.administrativeArea=s.textContent:"PostalCode"===s.localName?(r.postalCodes=r.postalCodes||[],r.postalCodes.push(s.textContent)):"Country"===s.localName?(r.countries=r.countries||[],r.countries.push(s.textContent)):"ElectronicMailAddress"===s.localName&&(r.electronicMailAddresses=r.electronicMailAddresses||[],r.electronicMailAddresses.push(s.textContent))}return r},i}),i("ogc/wms/WmsLayerCapabilities",["../../error/ArgumentError","../../util/Logger"],function(t,e){"use strict";var i=function(i,r){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsLayerCapabilities","constructor","Layer element is null or undefined."));this.parent=r,this.layers,this.name,this.title,this.abstract,this.keywordList,this.identifiers,this.metadataUrls,this.dataUrls,this.featureListUrls,this.assembleLayer(i)};return Object.defineProperties(i.prototype,{capability:{get:function(){for(var t=this;t&&t instanceof i;)t=t.parent;return t}},queryable:{get:function(){return i.replace(this,"_queryable")}},cascaded:{get:function(){return i.replace(this,"_cascaded")}},opaque:{get:function(){return i.replace(this,"_opaque")}},noSubsets:{get:function(){return i.replace(this,"_noSubsets")}},fixedWidth:{get:function(){return i.replace(this,"_fixedWidth")}},fixedHeight:{get:function(){return i.replace(this,"_fixedHeight")}},styles:{get:function(){return i.accumulate(this,"_styles",[])}},crses:{get:function(){return i.accumulate(this,"_crses",[])}},srses:{get:function(){return i.accumulate(this,"_srses",[])}},geographicBoundingBox:{get:function(){return i.replace(this,"_geographicBoundingBox")}},latLonBoundingBox:{get:function(){return i.replace(this,"_latLonBoundingBox")}},boundingBoxes:{get:function(){return i.replace(this,"_boundingBoxes")}},dimensions:{get:function(){for(var t=[],e=this;e&&e instanceof i;)e._dimensions&&e._dimensions.length>0&&e._dimensions.forEach(function(e){var i=e.name,r=!0;t.forEach(function(t){t.name===i&&(r=!1)}),r&&t.push(e)}),e=e.parent;return t.length>0?t:void 0}},extents:{get:function(){for(var t=[],e=this;e&&e instanceof i;)e._extents&&e._extents.length>
1120&&e._extents.forEach(function(e){var i=e.name,r=!0;t.forEach(function(t){t.name===i&&(r=!1)}),r&&t.push(e)}),e=e.parent;return t.length>0?t:void 0}},attribution:{get:function(){return i.replace(this,"_attribution")}},authorityUrls:{get:function(){return i.accumulate(this,"_authorityUrls",[])}},minScaleDenominator:{get:function(){return i.replace(this,"_minScaleDenominator")}},maxScaleDenominator:{get:function(){return i.replace(this,"_maxScaleDenominator")}},scaleHint:{get:function(){return i.replace(this,"_scaleHint")}}}),i.prototype.style=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsLayerCapabilities","style","Style name is null or undefined."));var r=this.styles;if(!r)return null;for(var n,o=0,s=r.length;o<s;o++)if(n=r[o],n.name===i)return n},i.accumulate=function(t,e,r){for(;t&&t instanceof i;){var n=t[e];if(n)for(var o=0;o<n.length;o++)r.push(n[o]);t=t.parent}return r.length>0?r:null},i.replace=function(t,e){for(;t&&t instanceof i;){var r=t[e];if(r)return r;t=t.parent}},i.prototype.assembleLayer=function(t){var e,r;e=t.getAttribute("queryable"),e&&(this._queryable="1"===e||"true"===e),e=t.getAttribute("opaque"),e&&(this._opaque="1"===e||"true"===e),e=t.getAttribute("noSubsets"),e&&(this._noSubsets="1"===e||"true"===e),e=t.getAttribute("cascaded"),e&&(this._cascaded=parseInt("10")),e=t.getAttribute("fixedWidth"),e&&(this._fixedWidth=parseInt("10")),(e=t.getAttribute("fixedHeight"))&&(this._fixedHeight=parseInt("10"));var n=t.children||t.childNodes;for(r=0;r<n.length;r++){var o=n[r];if("Layer"===o.localName)this.layers||(this.layers=[]),this.layers.push(new i(o,this));else if("Name"===o.localName)this.name=o.textContent;else if("Title"===o.localName)this.title=o.textContent;else if("Abstract"===o.localName)this.abstract=o.textContent;else if("KeywordList"===o.localName){this.keywordList=this.keywordList||[];for(var s=o.children||o.childNodes,a=0;a<s.length;a++){var l=s[a];"Keyword"===l.localName&&this.keywordList.push(l.textContent)}}else"Style"===o.localName?(this._styles||(this._styles=[]),this._styles.push(i.assembleStyle(o))):"CRS"===o.localName?(this._crses||(this._crses=[]),this._crses.push(o.textContent)):"SRS"===o.localName?(this._srses||(this._srses=[]),this._srses.push(o.textContent)):"EX_GeographicBoundingBox"===o.localName?this._geographicBoundingBox=i.assembleGeographicBoundingBox(o):"LatLonBoundingBox"===o.localName?this._geographicBoundingBox=i.assembleLatLonBoundingBox(o):"BoundingBox"===o.localName?(this._boundingBoxes||(this._boundingBoxes=[]),this._boundingBoxes.push(i.assembleBoundingBox(o))):"Dimension"===o.localName?(this._dimensions||(this._dimensions=[]),this._dimensions.push(i.assembleDimension(o))):"Extent"===o.localName?(this._extents||(this._extents=[]),this._extents.push(i.assembleDimension(o))):"Attribution"===o.localName?this._attribution=i.assembleAttribution(o):"AuthorityURL"===o.localName?(this._authorityUrls||(this._authorityUrls=[]),this._authorityUrls.push(i.assembleAuthorityUrl(o))):"Identifier"===o.localName?(this.identifiers||(this.identifiers=[]),this.identifiers.push(i.assembleIdentifier(o))):"MetadataURL"===o.localName?(this.metadataUrls||(this.metadataUrls=[]),this.metadataUrls.push(i.assembleMetadataUrl(o))):"DataURL"===o.localName?(this.dataUrls||(this.dataUrls=[]),this.dataUrls.push(i.assembleUrl(o))):"FeatureListURL"===o.localName?(this.featureListUrls||(this.featureListUrls=[]),this.featureListUrls.push(i.assembleUrl(o))):"MinScaleDenominator"===o.localName?this._minScaleDenominator=parseFloat(o.textContent):"MaxScaleDenominator"===o.localName?this._maxScaleDenominator=parseFloat(o.textContent):"ScaleHint"===o.localName&&(this._scaleHint={},this._scaleHint.min=i.getFloatAttribute(o,"min"),this._scaleHint.max=i.getFloatAttribute(o,"max"))}},i.assembleStyle=function(t){for(var e={},r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];"Name"===o.localName?e.name=o.textContent:"Title"===o.localName?e.title=o.textContent:"Abstract"===o.localName?e.abstract=o.textContent:"LegendURL"===o.localName?(e.legendUrls||(e.legendUrls=[]),e.legendUrls.push(i.assembleLegendUrl(o))):"StyleSheetURL"===o.localName?e.styleSheetUrl=i.assembleUrl(o):"StyleURL"===o.localName&&(e.styleUrl=i.assembleUrl(o))}return e},i.assembleGeographicBoundingBox=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"westBoundLongitude"===n.localName?e.westBoundLongitude=parseFloat(n.textContent):"eastBoundLongitude"===n.localName?e.eastBoundLongitude=parseFloat(n.textContent):"southBoundLatitude"===n.localName?e.southBoundLatitude=parseFloat(n.textContent):"northBoundLatitude"===n.localName&&(e.northBoundLatitude=parseFloat(n.textContent))}return e},i.assembleLatLonBoundingBox=function(t){var e={};return e.minx=i.getFloatAttribute(t,"minx"),e.miny=i.getFloatAttribute(t,"miny"),e.maxx=i.getFloatAttribute(t,"maxx"),e.maxy=i.getFloatAttribute(t,"maxy"),e},i.assembleBoundingBox=function(t){var e={};return e.crs=t.getAttribute("CRS"),e.minx=i.getFloatAttribute(t,"minx"),e.miny=i.getFloatAttribute(t,"miny"),e.maxx=i.getFloatAttribute(t,"maxx"),e.maxy=i.getFloatAttribute(t,"maxy"),e.resx=i.getFloatAttribute(t,"resx"),e.resy=i.getFloatAttribute(t,"resy"),e},i.assembleDimension=function(t){var e={};return e.name=t.getAttribute("name"),e.units=t.getAttribute("units"),e.unitSymbol=t.getAttribute("unitSymbol"),e.default=t.getAttribute("default"),e.multipleValues=t.getAttribute("multipleValues"),e.multipleValues&&(e.multipleValues="true"===e.multipleValues||"1"===e.multipleValues),e.nearestValue=t.getAttribute("nearestValue"),e.nearestValue&&(e.nearestValue="true"===e.nearestValue||"1"===e.nearestValue),e.current=t.getAttribute("current"),e.current&&(e.current="true"===e.current||"1"===e.current),e.content=t.textContent,e},i.assembleAttribution=function(t){for(var e={},r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];"Title"===o.localName?e.title=o.textContent:"OnlineResource"===o.localName?e.url=o.getAttribute("xlink:href"):"LogoUrul"===o.localName&&(e.logoUrl=i.assembleLogoUrl(o))}return e},i.assembleAuthorityUrl=function(t){var e={};e.name=t.getAttribute("name");for(var i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"OnlineResource"===n.localName&&(e.url=n.getAttribute("xlink:href"))}return e},i.assembleIdentifier=function(t){var e={};return e.authority=t.getAttribute("authority"),e.content=t.textContent,e},i.assembleMetadataUrl=function(t){var e={};e.type=t.getAttribute("type");for(var i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Format"===n.localName?e.format=n.textContent:"OnlineResource"===n.localName&&(e.url=n.getAttribute("xlink:href"))}return e},i.assembleLegendUrl=function(t){var e={};e.width=i.getIntegerAttribute(t,"width"),e.height=i.getIntegerAttribute(t,"height");for(var r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];"Format"===o.localName?e.format=o.textContent:"OnlineResource"===o.localName&&(e.url=o.getAttribute("xlink:href"))}return e},i.assembleLogoUrl=function(t){var e={};e.width=i.getIntegerAttribute(t,"width"),e.height=i.getIntegerAttribute(t,"height");for(var r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];"Format"===o.localName?e.format=o.textContent:"OnlineResource"===o.localName&&(e.url=o.getAttribute("xlink:href"))}return e},i.assembleUrl=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Format"===n.localName?e.format=n.textContent:"OnlineResource"===n.localName&&(e.url=n.getAttribute("xlink:href"))}return e},i.getIntegerAttribute=function(t,e){var i=t.getAttribute(e);return i=i?parseInt(i):void 0},i.getFloatAttribute=function(t,e){var i=t.getAttribute(e);return i=i?parseFloat(i):void 0},i}),i("ogc/wms/WmsCapabilities",["../../error/ArgumentError","../../util/Logger","../../ogc/wms/WmsLayerCapabilities"],function(t,e,
112i){"use strict";var r=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsCapabilities","constructor","No XML DOM specified."));this.assembleDocument(i)};return r.prototype.getNamedLayers=function(){return this.accumulateNamedLayers(this.capability.layers)},r.prototype.accumulateNamedLayers=function(t,e){var i=e||[];if(!t)return i;for(var r=0,n=t.length;r<n;r++){var o=t[r];o.name&&i.push(o),o.layers&&this.accumulateNamedLayers(o.layers,i)}return i},r.prototype.getNamedLayer=function(i){if(!i||0===i.length)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsCapabilities","getNamedLayer","No WMS layer name provided."));for(var r=this.getNamedLayers(),n=0,o=r.length;n<o;n++)if(i===r[n].name)return r[n];return null},r.prototype.assembleDocument=function(t){var e=t.documentElement;this.version=e.getAttribute("version"),this.updateSequence=e.getAttribute("updateSequence");for(var i=e.children||e.childNodes,r=0;r<i.length;r++){var n=i[r];"Service"===n.localName?this.service=this.assembleService(n):"Capability"===n.localName&&(this.capability=this.assembleCapability(n))}},r.prototype.assembleService=function(t){for(var e={capsDoc:this},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Name"===n.localName?e.name=n.textContent:"Title"===n.localName?e.title=n.textContent:"Abstract"===n.localName?e.abstract=n.textContent:"KeywordList"===n.localName?e.keywordList=this.assembleKeywordList(n):"OnlineResource"===n.localName?e.url=n.getAttribute("xlink:href"):"Fees"===n.localName?e.fees=n.textContent:"AccessConstraints"===n.localName?e.accessConstraints=n.textContent:"LayerLimit"==n.localName?e.layerLimit=parseInt(n.textContent):"MaxWidth"==n.localName?e.maxWidth=parseInt(n.textContent):"MaxHeight"==n.localName?e.maxHeight=parseInt(n.textContent):"ContactInformation"===n.localName&&(e.contactInformation=this.assembleContactInformation(n))}return e},r.prototype.assembleKeywordList=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Keyword"===n.localName&&e.push(n.textContent)}return e},r.prototype.assembleContactInformation=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"ContactPersonPrimary"===n.localName?e.contactPersonPrimary=this.assembleContactPersonPrimary(n):"ContactPosition"===n.localName?e.contactPosition=n.textContent:"ContactVoiceTelephone"===n.localName?e.contactVoiceTelephone=n.textContent:"ContactFacsimileTelephone"===n.localName?e.contactFacsimileTelephone=n.textContent:"ContactElectronicMailAddress"===n.localName?e.contactElectronicMailAddress=n.textContent:"ContactAddress"===n.localName&&(e.contactAddress=this.assembleContactAddress(n))}return e},r.prototype.assembleContactPersonPrimary=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"ContactPerson"===n.localName?e.contactPerson=n.textContent:"ContactOrganization"===n.localName&&(e.contactOrganization=n.textContent)}return e},r.prototype.assembleContactAddress=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"AddressType"===n.localName?e.addressType=n.textContent:"Address"===n.localName?e.address=n.textContent:"City"===n.localName?e.city=n.textContent:"StateOrProvince"===n.localName?e.stateOrProvince=n.textContent:"PostCode"===n.localName?e.postCode=n.textContent:"Country"===n.localName&&(e.country=n.textContent)}return e},r.prototype.assembleCapability=function(t){for(var e={capsDoc:this},r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];"Request"===o.localName?e.request=this.assembleRequests(o):"Exception"===o.localName?e.exception=this.assembleException(o):"Layer"===o.localName&&(e.layers=e.layers||[],e.layers.push(new i(o,e)))}return e},r.prototype.assembleRequests=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"GetCapabilities"===n.localName?e.getCapabilities=this.assembleRequest(n):"GetMap"===n.localName?e.getMap=this.assembleRequest(n):"GetFeatureInfo"===n.localName&&(e.getFeatureInfo=this.assembleRequest(n))}return e},r.prototype.assembleRequest=function(t){for(var e={name:t.localName},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];if("Format"===n.localName)e.formats=e.formats||[],e.formats.push(n.textContent);else if("DCPType"===n.localName)for(var o=n.children||n.childNodes,s=0;s<o.length;s++){var a=o[s];if("HTTP"===a.localName)for(var l=a.children||a.childNodes,h=0;h<l.length;h++){var u=l[h];if("Get"===u.localName)for(var c=u.children||u.childNodes,d=0;d<c.length;d++){var f=c[d];"OnlineResource"===f.localName&&(e.getUrl=f.getAttribute("xlink:href"))}}}}return e},r.prototype.assembleException=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Format"===n.localName&&(e.formats=e.formats||[],e.formats.push(n.textContent))}return e},r}), 113i("ogc/wmts/WmtsLayerCapabilities",["../../error/ArgumentError","../../geom/Sector","../../ogc/ows/OwsDescription","../../util/Logger"],function(t,e,
113i,r){"use strict";var n=function(e,n){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"WmtsLayerCapabilities","constructor","missingDomElement"));i.call(this,e),this.capabilities=n,this.identifier,this.title,this.abstract,this.keywords,this.wgs84BoundingBox,this.boundingBox,this.styles,this.formats,this.infoFormat,this.dimension,this.metadata,this.tileMatrixSetLink,this.resourceUrl,this.assembleLayer(e)};return n.prototype=Object.create(i.prototype),n.prototype.getLayerSupportedTileMatrixSets=function(){for(var t=[],e=0,i=this.tileMatrixSetLink.length;e<i;e++)for(var r=this.tileMatrixSetLink[e].tileMatrixSet,n=0,o=this.capabilities.contents.tileMatrixSet.length;n<o;n++){var s=this.capabilities.contents.tileMatrixSet[n].identifier;s===r&&t.push(this.capabilities.contents.tileMatrixSet[n])}return t},n.prototype.assembleLayer=function(t){for(var e=t.children||t.childNodes,i=0;i<e.length;i++){var r=e[i];"Identifier"===r.localName?this.identifier=r.textContent:"WGS84BoundingBox"===r.localName?this.wgs84BoundingBox=n.assembleBoundingBox(r):"BoundingBox"===r.localName?(this.boundingBox=this.boundingBox||[],this.boundingBox.push(n.assembleBoundingBox(r))):"Style"===r.localName?(this.style=this.style||[],this.style.push(n.assembleStyle(r))):"Format"===r.localName?(this.format=this.format||[],this.format.push(r.textContent)):"InfoFormat"===r.localName?(this.infoFormat=this.infoFormat||[],this.infoFormat.push(r.textContent)):"Dimension"===r.localName?(this.dimension=this.dimension||[],this.dimension.push(n.assembleDimension(r))):"Metadata"===r.localName?(this.metadata=this.metadata||[],this.metadata.push(n.assembleMetadata(r))):"ResourceURL"===r.localName?(this.resourceUrl=this.resourceUrl||[],this.resourceUrl.push(n.assembleResourceUrl(r))):"TileMatrixSetLink"===r.localName&&(this.tileMatrixSetLink=this.tileMatrixSetLink||[],this.tileMatrixSetLink.push(n.assembleTileMatrixSetLink(r)))}},n.assembleStyle=function(t){var e=new i(t);e.isDefault=t.getAttribute("isDefault");for(var r=t.children||t.childNodes,o=0;o<r.length;o++){var s=r[o];"Identifier"===s.localName?e.identifier=s.textContent:"LegendURL"===s.localName&&(e.legendUrl=e.legendUrl||[],e.legendUrl.push(n.assembleLegendUrl(s)))}return e},n.assembleBoundingBox=function(t){var i={},r=t.getAttribute("crs");r&&(i.crs=r);for(var n=t.children||t.childNodes,o=0;o<n.length;o++){var s=n[o];if("LowerCorner"===s.localName){var a=s.textContent.split(" ");i.lowerCorner=[parseFloat(a[0]),parseFloat(a[1])]}else if("UpperCorner"===s.localName){var l=s.textContent.split(" ");i.upperCorner=[parseFloat(l[0]),parseFloat(l[1])]}}return"WGS84BoundingBox"===t.localName&&(i.getSector=function(){return new e(i.lowerCorner[1],i.upperCorner[1],i.lowerCorner[0],i.upperCorner[0])}),i},n.assembleDimension=function(t){for(var e=new i(t),r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];"Identifier"===o.localName?e.identifier=o.textContent:"UOM"===o.localName?e.uom={name:o.getAttribute("name"),reference:o.getAttribute("reference")}:"UnitSymbol"==o.localName?e.unitSymbol=o.textContent:"Default"===o.localName?e.default=o.textContent:"Current"===o.localName?e.current="true"===o.textContent:"Value"===o.localName&&(e.value=e.value||[],e.value.push(o.textContent))}return e},n.assembleMetadata=function(t){var e={},i=t.getAttribute("xlink:href");i&&(e.url=i);var r=t.getAttribute("about");i&&(e.about=r);var n=t.getAttribute("xlink:type");n&&(e.type=n);var o=t.getAttribute("xlink:role");o&&(e.role=o);var s=t.getAttribute("xlink:title");s&&(e.title=s);for(var a=t.children||t.childNodes,l=0;l<a.length;l++){var h=a[l];"Metadata"===h.localName&&(e.metadata=WmsLayerCapabilities.assembleMetadata(h))}return e},n.assembleResourceUrl=function(t){var e={};return e.format=t.getAttribute("format"),e.resourceType=t.getAttribute("resourceType"),e.template=t.getAttribute("template"),e},n.assembleLegendUrl=function(t){var e={};return e.format=t.getAttribute("format"),e.minScaleDenominator=t.getAttribute("minScaleDenominator"),e.maxScaleDenominator=t.getAttribute("maxScaleDenominator"),e.href=t.getAttribute("xlink:href"),e.width=t.getAttribute("width"),e.height=t.getAttribute("height"),e},n.assembleTileMatrixSetLink=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var o=i[r];"TileMatrixSet"===o.localName?e.tileMatrixSet=o.textContent:"TileMatrixSetLimits"===o.localName&&(e.tileMatrixSetLimits=n.assembleTileMatrixSetLimits(o)
113)}return e},n.assembleTileMatrixSetLimits=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var o=i[r];"TileMatrixLimits"===o.localName&&(e.tileMatrixLimits=e.tileMatrixLimits||[],e.tileMatrixLimits.push(n.assembleTileMatrixLimits(o)))}return e},n.assembleTileMatrixLimits=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"TileMatrix"===n.localName?e.tileMatrix=n.textContent:"MinTileRow"===n.localName?e.minTileRow=parseInt(n.textContent):"MaxTileRow"===n.localName?e.maxTileRow=parseInt(n.textContent):"MinTileCol"===n.localName?e.minTileCol=parseInt(n.textContent):"maxTileCol"===n.localName&&(e.maxTileCol=parseInt(n.textContent))}return e},n}),i("ogc/wmts/WmtsCapabilities",["../../error/ArgumentError","../../util/Logger","../../ogc/ows/OwsDescription","../../ogc/ows/OwsLanguageString","../../ogc/ows/OwsOperationsMetadata","../../ogc/ows/OwsServiceIdentification","../../ogc/ows/OwsServiceProvider","../../ogc/wms/WmsCapabilities","../../ogc/wmts/WmtsLayerCapabilities"],function(t,e,i,r,n,o,s,a,l){"use strict";var h=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmtsCapabilities","constructor","No XML DOM specified."));this.assembleDocument(i)};return h.prototype.getLayers=function(){return this.contents.layer},h.prototype.getLayer=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmtsCapabilities","getLayer","empty identifier"));for(var r=0,n=this.contents.layer.length;r<n;r++){var o=this.contents.layer[r];if(o.identifier===i)return o}return null},h.prototype.assembleDocument=function(t){var e=t.documentElement;this.version=e.getAttribute("version"),this.updateSequence=e.getAttribute("updateSequence");for(var i=e.children||e.childNodes,r=0;r<i.length;r++){var a=i[r];"ServiceIdentification"===a.localName?this.serviceIdentification=new o(a):"ServiceProvider"===a.localName?this.serviceProvider=new s(a):"OperationsMetadata"===a.localName?this.operationsMetadata=new n(a):"Contents"===a.localName?this.contents=this.assembleContents(a):"Themes"===a.localName?this.themes=h.assembleThemes(a):"ServiceMetadataURL"===a.localName&&(this.serviceMetadataUrls=this.serviceMetadataUrls||[],this.serviceMetadataUrls.push(h.assembleServiceMetadataURL(a)))}},h.prototype.assembleContents=function(t){for(var i={},r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];if("Layer"===o.localName){i.layer=i.layer||[];try{i.layer.push(new l(o,this))}catch(t){e.logMessage(e.LEVEL_SEVERE,"WmtsCapabilities","constructor","Exception reading WMTS layer description: "+t.message)}}else if("TileMatrixSet"===o.localName){i.tileMatrixSet=i.tileMatrixSet||[];try{i.tileMatrixSet.push(h.assembleTileMatrixSet(o))}catch(t){e.logMessage(e.LEVEL_SEVERE,"WmtsCapabilities","constructor","Exception reading WMTS tile matrix set description: "+t.message)}}}return i},h.assembleTileMatrixSet=function(t){for(var e=new i(t),r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];"Identifier"===o.localName?e.identifier=o.textContent:"SupportedCRS"===o.localName?e.supportedCRS=o.textContent:"WellKnownScaleSet"===o.localName?e.wellKnownScaleSet=o.textContent:"BoundingBox"===o.localName?e.boundingBox=l.assembleBoundingBox(o):"TileMatrix"===o.localName&&(e.tileMatrix=e.tileMatrix||[],e.tileMatrix.push(h.assembleTileMatrix(o)))}h.sortTileMatrices(e);for(var s=0;s<e.tileMatrix.length;s++)e.tileMatrix[s].levelNumber=s;return e},h.assembleTileMatrix=function(t){for(var e=new i(t),r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];if("Identifier"===o.localName)e.identifier=o.textContent;else if("ScaleDenominator"===o.localName)e.scaleDenominator=parseFloat(o.textContent);else if("TileWidth"===o.localName)e.tileWidth=parseFloat(o.textContent);else if("TileHeight"===o.localName)e.tileHeight=parseFloat(o.textContent);else if("MatrixWidth"===o.localName)e.matrixWidth=parseFloat(o.textContent);else if("MatrixHeight"===o.localName)e.matrixHeight=parseFloat(o.textContent);else if("TopLeftCorner"===o.localName){var s=o.textContent.split(" ");e.topLeftCorner=[parseFloat(s[0]),parseFloat(s[1])]}}return e},h.assembleThemes=function(t){for(var e,i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Theme"===n.localName&&(e=e||[],e.push(h.assembleTheme(n)))}return e},h.assembleTheme=function(t){for(var e=new i(t),r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];"Identifier"===o.localName?e.identifier=o.textContent:"LayerRef"
113===o.localName?(e.layerRef=e.layerRef||[],e.layerRef.push(o.textContent)):"Theme"===o.localName&&(e.themes=e.themes||[],e.themes.push(h.assembleTheme(o)))}return e},h.assembleServiceMetadataURL=function(t){var e={},i=t.getAttribute("xlink:href");return i&&(e.url=i),e},h.sortTileMatrices=function(t){t.tileMatrix.sort(function(t,e){return e.scaleDenominator-t.scaleDenominator})},h.prototype.getGetTileKvpAddress=function(){for(var t=0;t<this.operationsMetadata.operation.length;t++){var e=this.operationsMetadata.operation[t];if("GetTile"===e.name)return e.dcp[0].getMethods[0].url}return null},h}),i("layer/WmtsLayerTile",["../geom/Angle","../error/ArgumentError","../geom/BoundingBox","../util/Logger","../geom/Vec3","../util/WWUtil"],function(t,e,i,r,n,o){"use strict";var s=function(e,i,r,n,o){this.sector=e,this.tileMatrix=i,this.row=r,this.column=n,this.imagePath=o,this.texelSize=e.deltaLatitude()*t.DEGREES_TO_RADIANS/i.tileHeight,this.tileKey=i.levelNumber.toString()+"."+r.toString()+"."+n.toString(),this.gpuCacheKey=o};return s.prototype.isEqual=function(t){return!!t&&(!!t.tileKey&&this.tileKey==t.tileKey)},s.prototype.distanceTo=function(t){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"Tile","distanceTo","missingVector"));for(var i,n,o,s=t[0],a=t[1],l=t[2],h=this.samplePoints,u=Number.POSITIVE_INFINITY,c=0,d=h.length;c<d;c+=3)i=s-h[c],n=a-h[c+1],o=l-h[c+2],u=Math.min(u,i*i+n*n+o*o);return Math.sqrt(u)},s.prototype.subdivide=function(t,i){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"WmtsLayerTile","subdivide","The specified tile matrix is null or undefined."));if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"WmtsLayerTile","subdivide","The specified tile factory is null or undefined."));for(var n,o,s=[],a=t.matrixHeight/this.tileMatrix.matrixHeight,l=t.matrixWidth/this.tileMatrix.matrixWidth,h=0;h<a;h++)for(var u=0;u<l;u++)n=a*this.row+h,o=l*this.column+u,s.push(i.createTile(t,n,o));return s},s.prototype.subdivideToCache=function(t,i,n){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"Tile","subdivideToCache","The specified tile matrix is null or undefined."));if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"Tile","subdivideToCache","The specified tile factory is null or undefined."));var o=n?n.entryForKey(this.tileKey):null;return o||(o=this.subdivide(t,i))&&n&&n.putEntry(this.tileKey,o,o.length),o},s.prototype.mustSubdivide=function(t,e){var i=t.globe.equatorialRadius*this.texelSize,r=this.distanceTo(t.eyePoint),n=t.pixelSizeAtDistance(r);return i>Math.max(e*n,.5)},s.prototype.update=function(t){var e=t.globe.elevationTimestamp(),i=t.verticalExaggeration,r=t.globeStateKey;this.updateTimestamp==e&&this.updateVerticalExaggeration==i&&this.updateGlobeStateKey==r||(this.doUpdate(t),t.frameStatistics.incrementTileUpdateCount(1),this.updateTimestamp=e,this.updateVerticalExaggeration=i,this.updateGlobeStateKey=r)},s.prototype.doUpdate=function(t){var e=t.globe,r=t.verticalExaggeration,s=e.minAndMaxElevationsForSector(this.sector),a=s[0]*r,l=s[1]*r;a===l&&(a=l+10),this.extent||(this.extent=new i),this.extent.setToSector(this.sector,e,a,l),this.samplePoints||(this.sampleElevations=new Float64Array(9),this.samplePoints=new Float64Array(3*this.sampleElevations.length)),o.fillArray(this.sampleElevations,.5*(a+l)),e.computePointsForGrid(this.sector,3,3,this.sampleElevations,n.ZERO,this.samplePoints),this.referencePoint||(this.referencePoint=new n(0,0,0)),e.computePointFromPosition(this.sector.centroidLatitude(),this.sector.centroidLongitude(),0,this.referencePoint)},s.prototype.bind=function(t){var e=t.gpuResourceCache.resourceForKey(this.gpuCacheKey);return!(!e||!e.bind(t))||!!this.fallbackTile&&this.fallbackTile.bind(t)},s.prototype.applyInternalTransform=function(t,e){},s}),i("layer/WmtsLayer",["../util/AbsentResourceList","../error/ArgumentError","../util/Logger","../geom/Matrix","../geom/Sector","../layer/Layer","../cache/MemoryCache","../render/Texture","../util/WmsUrlBuilder","../layer/WmtsLayerTile","../util/WWMath","../util/WWUtil"],function(t,e,i,r,n,o,s,a,l,h,u,c){"use strict";var d=function(a,l){if(!a)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","constructor","No layer configuration specified."));
113if(o.call(this,"WMTS Layer"),this.layerIdentifier=a.identifier,this.styleIdentifier=a.style,this.timeString=l,this.imageFormat=a.format,this.resourceUrl=a.resourceUrl,this.serviceUrl=a.service,this.tileMatrixSet=a.tileMatrixSet,this.lasTtMVP=r.fromIdentity(),a.wgs84BoundingBox||a.boundingBox){if(a.wgs84BoundingBox)this.sector=a.wgs84BoundingBox.getSector();else if(this.tileMatrixSet.boundingBox&&d.isEpsg4326Crs(this.tileMatrixSet.boundingBox.crs))this.sector=new n(this.tileMatrixSet.boundingBox.lowerCorner[1],this.tileMatrixSet.boundingBox.upperCorner[1],this.tileMatrixSet.boundingBox.lowerCorner[0],this.tileMatrixSet.boundingBox.upperCorner[0]);else if(d.isEpsg4326Crs(this.tileMatrixSet.supportedCRS))throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","constructor","No EPSG:4326 bounding box was specified in the layer or tile matrix set capabilities."))}else{if(!this.tileMatrixSet.boundingBox)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","constructor","No bounding box was specified in the layer or tile matrix set capabilities."));this.sector=new n(a.tileMatrixSet.boundingBox.lowerCorner[1],a.tileMatrixSet.boundingBox.upperCorner[1],a.tileMatrixSet.boundingBox.lowerCorner[0],a.tileMatrixSet.boundingBox.upperCorner[0])}if(!d.isTileSubdivisionCompatible(this.tileMatrixSet))throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","constructor","TileMatrixSet level division not compatible."));var h=this.tileMatrixSet.supportedCRS;if(!(d.isEpsg3857Crs(h)||d.isEpsg4326Crs(h)||d.isOGCCrs84(h)))throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","constructor","Provided CRS is not compatible."));this.cachePath=(this.resourceUrl||this.serviceUrl)+this.layerIdentifier+this.styleIdentifier+this.tileMatrixSet.identifier,l&&(this.cachePath=this.cachePath+l),this.displayName=a.title,this.currentTiles=[],this.currentTilesInvalid=!0,this.tileCache=new s(1e3,850),this.currentRetrievals=[],this.absentResourceList=new t(3,5e4),this.pickEnabled=!1,this.detailControl=1.75,this.retrievalQueueSize=WorldWind.configuration.layerRetrievalQueueSize};return d.isTileSubdivisionCompatible=function(t){if(!t||!t.tileMatrix||t.tileMatrix.length<1)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","isTileSubdivisionCompatible","Empty tile matrix set"));for(var r,n,o,s=t.tileMatrix[0],a=1,l=t.tileMatrix.length;a<l;a++)if(o=t.tileMatrix[a],r=o.matrixHeight/s.matrixHeight,n=o.matrixWidth/s.matrixWidth,s=o,2!==r||2!==n)return!1;return!0},d.createTileMatrixSet=function(t){if(!t.matrixSet)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","createTileMatrixSet","No matrixSet provided."));if(!t.projection)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","createTileMatrixSet","No projection provided."));if(!t.extent||4!=t.extent.length)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","createTileMatrixSet","No extent provided."));var r={lowerCorner:[t.extent[0],t.extent[1]],upperCorner:[t.extent[2],t.extent[3]]};if(!t.resolutions)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","createTileMatrixSet","No resolutions provided."));if(!t.tileSize)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","createTileMatrixSet","No tile size provided."));if(!t.topLeftCorner||2!=t.topLeftCorner.length)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","createTileMatrixSet","No extent provided."));if(void 0===t.prefix)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","createTileMatrixSet","Prefix not provided."));if(!(d.isEpsg4326Crs(t.projection)||d.isOGCCrs84(t.projection)||d.isEpsg3857Crs(t.projection)))throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","createTileMatrixSet","Projection provided not supported."));for(var n,o=[],s=0;s<t.resolutions.length;s++){d.isEpsg4326Crs(t.projection)||d.isOGCCrs84(t.projection)?n=6378137*t.resolutions[s]*2*Math.PI/360/28e-5:d.isEpsg3857Crs(t.projection)&&(n=t.resolutions[s]/28e-5);var a=t.tileSize*t.resolutions[s],l=t.tileSize*t.resolutions[s],h=Math.ceil((t.extent[2]-t.extent[0]-.01*a)/a),u=Math.ceil((t.extent[3]-t.extent[1]-.01*l)/l),c={identifier:t.prefix?t.matrixSet+":"+s:s,levelNumber:s,matrixHeight:u,matrixWidth:h,tileHeight:t.tileSize,tileWidth:t.tileSize,topLeftCorner:t.topLeftCorner,scaleDenominator:n};o.push(c)}return{identifier:t.matrixSet,supportedCRS:t.projection,boundingBox:r,tileMatrix:o}},d.formLayerConfiguration=function(t,r,n,o){var s={};if(s.identifier=t.identifier,o){for(var a=!1,h=0;h<t.format.length;h++)if(t.format[h]===o){a=!0,s.format=t.format[h];break}a||(i.logMessage(i.LEVEL_WARNING,"WmtsLayer","formLayerConfiguration","The specified image format is not available. Another one will be used."),s.format=null)}if(s.format||(t.format.indexOf("image/png")>=0?s.format="image/png":t.format.indexOf("image/jpeg")>=0?s.format="image/jpeg":t.format.indexOf("image/tiff")>=0?s.format="image/tiff":t.format.indexOf("image/gif")>=0?s.format="image/gif":s.format=t.format[0]),!s.format)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","formLayerConfiguration","Layer does not provide a supported image format."));if(t.resourceUrl&&t.resourceUrl.length>=1){for(var h=0;h<t.resourceUrl.length;h++)if(s.format===t.resourceUrl[h].format){s.resourceUrl=t.resourceUrl[h].template;break}}else s.service=t.capabilities.getGetTileKvpAddress(),s.service&&(s.service=l.fixGetMapString(s.service));if(!s.resourceUrl&&!s.service)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","formLayerConfiguration","No resource URL or KVP GetTile service URL specified in WMTS capabilities."));if(r){for(var u=!1,h=0;h<t.style.length;h++)if(t.style[h].identifier===r){u=!0,s.style=t.style[h].identifier;break}u||(i.logMessage(i.LEVEL_WARNING,"WmtsLayer","formLayerConfiguration","The specified style identifier is not available. The server's default style will be used."),s.style=null)}if(!s.style)for(h=0;h<t.style.length;h++)if(t.style[h].isDefault){s.style=t.style[h].identifier;break}s.style||i.logMessage(i.LEVEL_WARNING,"WmtsLayer","formLayerConfiguration","No default style available. A style will not be specified in tile requests.");var c=t.getLayerSupportedTileMatrixSets();if(n){for(var h=0,f=c.length;h<f;h++)if(c[h].identifier===n&&d.isTileSubdivisionCompatible(c[h])){
113s.tileMatrixSet=c[h];break}s.tileMatrixSet||(i.logMessage(i.LEVEL_WARNING,"WmtsLayer","formLayerConfiguration","The specified tileMatrixSet is not available. Another one will be used."),s.tileMatrixSet=null)}if(!s.tileMatrixSet){for(var p,g=null,m=null,y=null,h=0,f=c.length;h<f;h++)p=c[h],d.isTileSubdivisionCompatible(p)&&(d.isEpsg4326Crs(p.supportedCRS)?g=g||p:d.isEpsg3857Crs(p.supportedCRS)?m=m||p:d.isOGCCrs84(p.supportedCRS)&&(y=y||p));s.tileMatrixSet=g||m||y}if(!s.tileMatrixSet)throw new e(i.logMessage(i.LEVEL_SEVERE,"WmtsLayer","formLayerConfiguration","No supported Tile Matrix Set could be found."));return s.boundingBox=t.boundingBox,s.wgs84BoundingBox=t.wgs84BoundingBox,t.titles.length>0?s.title=t.titles[0].value:s.title=t.identifier,s},d.prototype=Object.create(o.prototype),d.prototype.doRender=function(t){t.terrain&&(!this.currentTilesInvalid&&t.modelviewProjection.equals(this.lasTtMVP)&&t.globeStateKey===this.lastGlobeStateKey||(this.currentTilesInvalid=!1,this.assembleTiles(t)),this.lasTtMVP.copy(t.modelviewProjection),this.lastGlobeStateKey=t.globeStateKey,this.currentTiles.length>0&&(t.surfaceTileRenderer.renderTiles(t,this.currentTiles,this.opacity),t.frameStatistics.incrementImageTileCount(this.currentTiles.length),this.inCurrentFrame=!0))},d.prototype.isLayerInView=function(t){return t.terrain&&t.terrain.sector&&t.terrain.sector.intersects(this.sector)},d.prototype.isTileVisible=function(t,e){return!(t.globe.projectionLimits&&!e.sector.overlaps(t.globe.projectionLimits))&&e.extent.intersectsFrustum(t.frustumInModelCoordinates)},d.prototype.assembleTiles=function(t){this.currentTiles=[],this.topLevelTiles&&0!==this.topLevelTiles.length||this.createTopLevelTiles(t);for(var e=0,i=this.topLevelTiles.length;e<i;e++){var r=this.topLevelTiles[e];r.update(t),this.currentAncestorTile=null,this.isTileVisible(t,r)&&this.addTileOrDescendants(t,r)}},d.prototype.addTileOrDescendants=function(t,e){if(e.column>=e.tileMatrix.matrixWidth&&(e.column=e.column-e.tileMatrix.matrixWidth),e.column<0&&(e.column=e.column+e.tileMatrix.matrixWidth),this.tileMeetsRenderingCriteria(t,e))return void this.addTile(t,e);var i=null;try{(this.isTileTextureInMemory(t,e)||0===e.tileMatrix.levelNumber)&&(i=this.currentAncestorTile,this.currentAncestorTile=e);for(var r=this.tileMatrixSet.tileMatrix[e.tileMatrix.levelNumber+1],n=e.subdivideToCache(r,this,this.tileCache),o=0,s=n.length;o<s;o++){var a=n[o];a.update(t),this.sector.intersects(a.sector)&&this.isTileVisible(t,a)&&this.addTileOrDescendants(t,a)}}finally{i&&(this.currentAncestorTile=i)}},d.prototype.addTile=function(t,e){e.fallbackTile=null;var i=t.gpuResourceCache.resourceForKey(e.imagePath);if(i)return this.currentTiles.push(e),void(this.expiration&&this.isTextureExpired(i)&&this.retrieveTileImage(t,e));this.retrieveTileImage(t,e),this.currentAncestorTile&&this.isTileTextureInMemory(t,this.currentAncestorTile)&&this.currentTiles.push(this.currentAncestorTile)},d.prototype.isTextureExpired=function(t){return this.expiration&&t.creationTime.getTime()<=this.expiration.getTime()},d.prototype.isTileTextureInMemory=function(t,e){return t.gpuResourceCache.containsResource(e.imagePath)},d.prototype.tileMeetsRenderingCriteria=function(t,e){var i=this.detailControl;return(e.sector.minLatitude>=75||e.sector.maxLatitude<=-75)&&(i*=1.2),e.tileMatrix.levelNumber===this.tileMatrixSet.tileMatrix.length-1||!e.mustSubdivide(t,i)},d.prototype.retrieveTileImage=function(t,e){if(this.currentRetrievals.indexOf(e.imagePath)<0){if(this.currentRetrievals.length>this.retrievalQueueSize)return;if(this.absentResourceList.isResourceAbsent(e.imagePath))return;var r=this.resourceUrlForTile(e,this.imageFormat),n=new Image,o=e.imagePath,s=t.gpuResourceCache,a=t.currentGlContext.canvas,l=this;if(!r)return void(this.currentTilesInvalid=!0);n.onload=function(){i.log(i.LEVEL_INFO,"Image retrieval succeeded: "+r);var h=l.createTexture(t,e,n);if(l.removeFromCurrentRetrievals(o),h){s.putResource(o,h,h.size),l.currentTilesInvalid=!0,l.absentResourceList.unmarkResourceAbsent(o);var u=document.createEvent("Event");u.initEvent(WorldWind.REDRAW_EVENT_TYPE,!0,!0),a.dispatchEvent(u)}},n.onerror=function(){l.removeFromCurrentRetrievals(o),l.absentResourceList.markResourceAbsent(o),i.log(i.LEVEL_WARNING,"Image retrieval failed: "+r)},this.currentRetrievals.push(o),n.crossOrigin="anonymous",n.src=r}},d.prototype.resourceUrlForTile=function(t,e){var i;return this.resourceUrl?(i=this.resourceUrl.replace("{Style}",this.styleIdentifier).replace("{TileMatrixSet}",this.tileMatrixSet.identifier).replace("{TileMatrix}",t.tileMatrix.identifier).replace("{TileCol}",t.column).replace("{TileRow}",t.row),this.timeString&&(i=i.replace("{Time}",this.timeString))):(i=this.serviceUrl+"service=WMTS&request=GetTile&version=1.0.0",i+="&Layer="+this.layerIdentifier,this.styleIdentifier&&(i+="&Style="+this.styleIdentifier),i+="&Format="+e,this.timeString&&(i+="&Time="+this.timeString),i+="&TileMatrixSet="+this.tileMatrixSet.identifier,i+="&TileMatrix="+t.tileMatrix.identifier,i+="&TileRow="+t.row,i+="&TileCol="+t.column),i},d.prototype.removeFromCurrentRetrievals=function(t){var e=this.currentRetrievals.indexOf(t);e>-1&&this.currentRetrievals.splice(e,1)},d.prototype.createTopLevelTiles=function(t){var e=this.tileMatrixSet.tileMatrix[0];this.topLevelTiles=[];for(var i=0;i<e.matrixHeight;i++)for(var r=0;r<e.matrixWidth;r++)this.topLevelTiles.push(this.createTile(e,i,r))}
113,d.prototype.createTile=function(t,e,i){return d.isEpsg4326Crs(this.tileMatrixSet.supportedCRS)?this.createTile4326(t,e,i):d.isEpsg3857Crs(this.tileMatrixSet.supportedCRS)?this.createTile3857(t,e,i):d.isOGCCrs84(this.tileMatrixSet.supportedCRS)?this.createTileCrs84(t,e,i):void 0},d.prototype.createTileCrs84=function(t,e,i){var r=this.sector.deltaLatitude()/t.matrixHeight,o=this.sector.deltaLongitude()/t.matrixWidth,s=t.topLeftCorner[1]-e*r,a=s-r,l=t.topLeftCorner[0]+o*i,h=l+o,u=new n(a,s,l,h);return this.makeTile(u,t,e,i)},d.prototype.createTile4326=function(t,e,i){var r=this.sector.deltaLatitude()/t.matrixHeight,o=this.sector.deltaLongitude()/t.matrixWidth,s=t.topLeftCorner[0]-e*r,a=s-r,l=t.topLeftCorner[1]+o*i,h=l+o,u=new n(a,s,l,h);return this.makeTile(u,t,e,i)},d.prototype.createTile3857=function(t,e,i){t.mapWidth||this.computeTileMatrixValues3857(t);var r,o,s,a,l,h,c=u.clamp(i*t.tileWidth-.5,0,t.mapWidth),d=u.clamp(e*t.tileHeight-.5,0,t.mapHeight),f=u.clamp(c+t.tileWidth+.5,0,t.mapWidth),p=u.clamp(d+t.tileHeight+.5,0,t.mapHeight);r=c/t.mapWidth,o=p/t.mapHeight,a=t.topLeftCorner[0]+r*t.tileMatrixDeltaX,s=t.topLeftCorner[1]-o*t.tileMatrixDeltaY;var g=u.epsg3857ToEpsg4326(a,s);r=f/t.mapWidth,o=d/t.mapHeight,h=t.topLeftCorner[0]+r*t.tileMatrixDeltaX,l=t.topLeftCorner[1]-o*t.tileMatrixDeltaY;var m=u.epsg3857ToEpsg4326(h,l),y=new n(g[0],m[0],g[1],m[1]);return this.makeTile(y,t,e,i)},d.prototype.computeTileMatrixValues3857=function(t){var e=28e-5*t.scaleDenominator,i=t.tileWidth*e,r=t.tileHeight*e,n=t.topLeftCorner[0]+i*t.matrixWidth,o=t.to
113pLeftCorner[1]-r*t.matrixHeight,s=[n,o],a=t.topLeftCorner;t.tileMatrixDeltaX=s[0]-a[0],t.tileMatrixDeltaY=a[1]-s[1],t.mapWidth=t.tileWidth*t.matrixWidth,t.mapHeight=t.tileHeight*t.matrixHeight},d.prototype.makeTile=function(t,e,i,r){var n=this.cachePath+"-layer/"+e.identifier+"/"+i+"/"+r+"."+c.suffixForMimeType(this.imageFormat);return new h(t,e,i,r,n)},d.prototype.createTexture=function(t,e,i){return d.isEpsg4326Crs(this.tileMatrixSet.supportedCRS)?new a(t.currentGlContext,i):d.isEpsg3857Crs(this.tileMatrixSet.supportedCRS)?this.createTexture3857(t,e,i):d.isOGCCrs84(this.tileMatrixSet.supportedCRS)?new a(t.currentGlContext,i):void 0},d.prototype.createTexture3857=function(t,e,i){this.destCanvas||(this.destCanvas=document.createElement("canvas"),this.destContext=this.destCanvas.getContext("2d"));var r,n,o,s,l,h,c,d,f=t.canvas2D,p=t.ctx2D,g=this.destCanvas,m=this.destContext,y=m.createImageData(i.width,i.height),E=e.sector,v=u.gudermannianInverse(E.minLatitude),_=u.gudermannianInverse(E.maxLatitude);f.width=i.width,f.height=i.height,g.width=i.width,g.height=i.height,p.drawImage(i,0,0,i.width,i.height),r=p.getImageData(0,0,i.width,i.height);for(var b=0;b<1;b++)for(var S=0;S<i.height;S++){c=1-S/(i.height-1),n=c*E.deltaLatitude()+E.minLatitude,o=u.gudermannianInverse(n),d=1-(o-v)/(_-v),d=u.clamp(d,0,1),s=Math.floor(d*(i.height-1));for(var w=0;w<i.width;w++)l=4*(w+s*i.width),h=4*(w+S*i.width),y.data[h]=r.data[l],y.data[h+1]=r.data[l+1],y.data[h+2]=r.data[l+2],y.data[h+3]=r.data[l+3]}return m.putImageData(y,0,0),new a(t.currentGlContext,g)},d.isEpsg4326Crs=function(t){return t.indexOf("EPSG")>=0&&t.indexOf("4326")>=0},d.isEpsg3857Crs=function(t){return t.indexOf("EPSG")>=0&&(t.indexOf("3857")>=0||t.indexOf("900913")>=0)},d.isOGCCrs84=function(t){return t.indexOf("OGC")>=0&&t.indexOf("CRS84")>=0},d}),i("layer/OpenStreetMapImageLayer",["../util/Color","../layer/Layer","../util/Logger","../ogc/wmts/WmtsCapabilities","../layer/WmtsLayer"],function(t,e,i,r,n){"use strict";var o=function(t){e.call(this,this.displayName),this.displayName=t||"Open Street Map",this.layer=null,this.xhr=null,this.pickEnabled=!0};return o.prototype=Object.create(e.prototype),o.prototype.doRender=function(e){this.configureLayer(e),this.layer&&(this.layer.opacity=this.opacity,this.layer.doRender(e),this.inCurrentFrame=this.layer.inCurrentFrame,this.inCurrentFrame&&(e.screenCreditController.addCredit("OpenStreetMap ©",t.DARK_GRAY),e.screenCreditController.addCredit("EOX.at ©",t.DARK_GRAY)))},o.prototype.configureLayer=function(t){if(!this.xhr){var e=this,o=t.currentGlContext.canvas;this.xhr=new XMLHttpRequest,this.xhr.open("GET","https://tiles.maps.eox.at/wmts/1.0.0/WMTSCapabilities.xml",!0),this.xhr.onreadystatechange=function(){if(4===e.xhr.readyState)if(200===e.xhr.status){var t=new r(e.xhr.responseXML),s=t.getLayer("osm"),a=n.formLayerConfiguration(s);a.title=e.displayName,e.layer=new n(a);var l=document.createEvent("Event");l.initEvent(WorldWind.REDRAW_EVENT_TYPE,!0,!0),o.dispatchEvent(l)}else i.log(i.LEVEL_WARNING,"OSM retrieval failed ("+xhr.statusText+"): "+url)},this.xhr.onerror=function(){i.log(i.LEVEL_WARNING,"OSM retrieval failed: "+url)},this.xhr.ontimeout=function(){i.log(i.LEVEL_WARNING,"OSM retrieval timed out: "+url)},this.xhr.send(null)}},o}),i("projections/ProjectionGnomonic",["../geom/Angle","../error/ArgumentError","../projections/GeographicProjection","../util/Logger","../geom/Sector","../util/WWMath"],function(t,e,i,r,n,o){"use strict";var s=function(t){this.north=!("South"===t);var e=this.north?new n(30,90,-180,180):new n(-90,-30,-180,180);i.call(this,"Polar Gnomonic",!1,e),this._pole=t,this.displayName=this.north?"North Gnomonic":"South Gnomonic",this._stateKey="projection polar gnomonic "+this._pole+" "};return s.prototype=Object.create(i.prototype),Object.defineProperties(s.prototype,{pole:{get:function(){return this._pole},set:function(t){this._pole=t,this.north=!("South"===this._pole),this.projectionLimits=this.north?new n(30,90,-180,180):new n(-90,-30,-180,180),this._stateKey="projection polar gnomonic "+this._pole+" "}},stateKey:{get:function(){return this._stateKey}}}),s.prototype.geographicToCartesian=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionGnomonic","geographicToCartesian","missingGlobe"));if(!l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionGnomonic","geographicToCartesian","missingResult"));if(this.north&&90===n||!this.north&&-90===n)l[0]=0,l[1]=0,l[2]=s;else{var h=this.north?1:-1,u=i.equatorialRadius/Math.tan(n*t.DEGREES_TO_RADIANS);l[0]=u*Math.sin(o*t.DEGREES_TO_RADIANS)*h,l[1]=u*-Math.cos(o*t.DEGREES_TO_RADIANS),l[2]=s}return l},s.prototype.geographicToCartesianGrid=function(i,n,s,a,l,h,u,c){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionGnomonic","geographicToCartesianGrid","missingGlobe"));if(!n)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionGnomonic","geographicToCartesianGrid","missingSector"));if(!l||l.length<s*a)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionGnomonic","geographicToCartesianGrid","The specified elevations array is null, undefined or insufficient length"));if(!c)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionGnomonic","geographicToCartesianGrid","missingResult"));var d,f,p,g,m,y,E=n.minLatitude*t.DEGREES_TO_RADIANS,v=n.maxLatitude*t.DEGREES_TO_RADIANS,_=n.minLongitude*t.DEGREES_TO_RADIANS,b=n.maxLongitude*t.DEGREES_TO_RADIANS,S=(v-E)/(s>1?s-1:1),w=(b-_)/(a>1?a-1:1),L=this.projectionLimits.minLatitude*t.DEGREES_TO_RADIANS,T=this.projectionLimits.maxLatitude*t.DEGREES_TO_RADIANS,x=this.north?1:-1,R=h||new Vec3(0,0,0),M=0,C=0;for(d=0,p=E;d<s;d++,p+=S)for(d===s-1&&(p=v), 114m=o.clamp(p,L,T),y=i.equatorialRadius/Math.tan(m),(this.north&&m===Math.PI/2||!this.north&&m===-Math.PI/2)&&(y=0),f=0,g=_;f<a;f++,g+=w)f===a-1&&(g=b),c[C++]=y*Math.sin(g)*x-R[0],c[C++]=y*-Math.cos(g)-R[1],c[C++]=l[M++]-R[2];return c},s.prototype.cartesianToGeographic=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionGnomonic","cartesianToGeographic","missingGlobe"));if(!l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionGnomonic","cartesianToGeographic","missingResult"));var h,u=Math.sqrt(n*n+o*o);return u<1e-4?(l.latitude=this.north?90:-90,l.longitude=0,l.altitude=s):(h=Math.atan2(u,i.equatorialRadius),h>Math.PI&&(h=Math.PI),l.latitude=Math.asin(Math.cos(h)*(this.north?1:-1))*t.RADIANS_TO_DEGREES,l.longitude=Math.atan2(n,o*(this.north?-1:1))*t.RADIANS_TO_DEGREES,l.altitude=s),l}
114,s.prototype.northTangentAtLocation=function(i,n,o,s){if(!s)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionGnomonic","northTangentAtLocation","missingResult"));return s[0]=Math.sin(o*t.DEGREES_TO_RADIANS)*(this.north?-1:1),s[1]=Math.cos(o*t.DEGREES_TO_RADIANS),s[2]=0,s},s.prototype.northTangentAtPoint=function(t,i,n,o,s,a){if(!a)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionGnomonic","northTangentAtLocation","missingResult"));var l=Math.sqrt(i*i+n*n);return l<1e-4?(a[0]=0,a[1]=1,a[2]=0):(a[0]=i/l*(this.north?-1:1),a[1]=n/l*(this.north?-1:1),a[2]=0),a},s}),i("projections/ProjectionMercator",["../geom/Angle","../error/ArgumentError","../projections/GeographicProjection","../util/Logger","../geom/Sector","../geom/Vec3","../util/WWMath"],function(t,e,i,r,n,o,s){"use strict";var a=function(){i.call(this,"Mercator",!0,new n(-78,78,-180,180))};return a.prototype=Object.create(i.prototype),a.prototype.geographicToCartesian=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionMercator","geographicToCartesian","missingGlobe"));if(!l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionMercator","geographicToCartesian","missingResult"));n>this.projectionLimits.maxLatitude&&(n=this.projectionLimits.maxLatitude),n<this.projectionLimits.minLatitude&&(n=this.projectionLimits.minLatitude);var h=Math.sqrt(i.eccentricitySquared),u=Math.sin(n*t.DEGREES_TO_RADIANS),c=(1+u)/(1-u)*Math.pow((1-h*u)/(1+h*u),h);return l[0]=i.equatorialRadius*o*t.DEGREES_TO_RADIANS+(a?a[0]:0),l[1]=.5*i.equatorialRadius*Math.log(c),l[2]=s,l},Object.defineProperties(a.prototype,{stateKey:{get:function(){return"projection mercator "}}}),a.prototype.geographicToCartesianGrid=function(i,n,a,l,h,u,c,d){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionMercator","geographicToCartesianGrid","missingGlobe"));if(!n)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionMercator","geographicToCartesianGrid","missingSector"));if(!h||h.length<a*l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionMercator","geographicToCartesianGrid","The specified elevations array is null, undefined or insufficient length"));if(!d)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionMercator","geographicToCartesianGrid","missingResult"));var f,p,g,m,y,E,v,_,b=i.equatorialRadius,S=Math.sqrt(i.eccentricitySquared),w=n.minLatitude*t.DEGREES_TO_RADIANS,L=n.maxLatitude*t.DEGREES_TO_RADIANS,T=n.minLongitude*t.DEGREES_TO_RADIANS,x=n.maxLongitude*t.DEGREES_TO_RADIANS,R=(L-w)/(a>1?a-1:1),M=(x-T)/(l>1?l-1:1),C=this.projectionLimits.minLatitude*t.DEGREES_TO_RADIANS,A=this.projectionLimits.maxLatitude*t.DEGREES_TO_RADIANS,P=u||new o(0,0,0),N=c?c[0]:0,O=0,I=0;for(f=0,g=w;f<a;f++,g+=R)for(f===a-1&&(g=L),y=s.clamp(g,C,A),E=Math.sin(y),v=(1+E)/(1-E)*Math.pow((1-S*E)/(1+S*E),S),_=b*Math.log(v)*.5-P[1],p=0,m=T;p<l;p++,m+=M)p===l-1&&(m=x),d[I++]=b*m-P[0]+N,d[I++]=_,d[I++]=h[O++]-P[2];return d},a.prototype.cartesianToGeographic=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionMercator","cartesianToGeographic","missingGlobe"));if(!l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionMercator","cartesianToGeographic","missingResult"));var h=i.eccentricitySquared,u=h*h,c=u*h,d=c*h,f=Math.pow(Math.E,-o/i.equatorialRadius),p=Math.PI/2-2*Math.atan(f),g=h/2+5*u/24+c/12+13*d/360,m=7*u/48+29*c/240+811*d/11520,y=7*c/120+81*d/1120,E=4279*d/161280,v=p-m+E,_=g-3*y,b=2*m-8*E,S=4*y,w=8*E,L=Math.sin(2*p),T=v+L*(_+L*(b+L*(S+w*L)));return l.latitude=T*t.RADIANS_TO_DEGREES,l.longitude=(n-(a?a[0]:0))/i.equatorialRadius*t.RADIANS_TO_DEGREES,l.altitude=s,l},a}),i("projections/ProjectionPolarEquidistant",["../geom/Angle","../error/ArgumentError","../projections/GeographicProjection","../util/Logger"],function(t,e,i,r){"use strict";var n=function(t){i.call(this,"Polar Equidistant",!1,null),this._pole=t,this.north=!("South"===t),this.displayName=this.north?"North Polar":"South Polar",this._stateKey="projection polar equidistant "+this._pole+" "};return n.prototype=Object.create(i.prototype),Object.defineProperties(n.prototype,{pole:{get:function(){return this._pole},set:function(t){this._pole=t,this.north=!("South"===this._pole),this._stateKey="projection polar equidistant "+this._pole+" "}},stateKey:{get:function(){return this._stateKey}}}),n.prototype.geographicToCartesian=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","geographicToCartesian","missingGlobe"));if(!l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","geographicToCartesian","missingResult"));if(this.north&&90===n||!this.north&&-90===n)l[0]=0,l[1]=0,l[2]=s;else{var h=this.north?-1:1,u=i.equatorialRadius*(Math.PI/2+n*t.DEGREES_TO_RADIANS*h);l[0]=u*Math.sin(o*t.DEGREES_TO_RADIANS),l[1]=u*Math.cos(o*t.DEGREES_TO_RADIANS)*h,l[2]=s}return l},n.prototype.geographicToCartesianGrid=function(i,n,o,s,a,l,h,u){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","geographicToCartesianGrid","missingGlobe"));if(!n)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","geographicToCartesianGrid","missingSector"));if(!a||a.length<o*s)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","geographicToCartesianGrid","The specified elevations array is null, undefined or insufficient length"));if(!u)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","geographicToCartesianGrid","missingResult"));var c,d,f,p,g,m=i.equatorialRadius,y=n.minLatitude*t.DEGREES_TO_RADIANS,E=n.maxLatitude*t.DEGREES_TO_RADIANS,v=n.minLongitude*t.DEGREES_TO_RADIANS,_=n.maxLongitude*t.DEGREES_TO_RADIANS,b=(E-y)/(o>1?o-1:1),S=(_-v)/(s>1?s-1:1),w=this.north?-1:1,L=l||new Vec3(0,0,0),T=Math.PI/2,x=0,R=0,M=new Float64Array(s),C=new Float64Array(s);for(d=0,p=v;d<s;d++,p+=S)d===s-1&&(p=_),M[d]=Math.cos(p),C[d]=Math.sin(p);for(c=0,f=y;c<o;c++,f+=b)for(c===o-1&&(f=E),g=m*(T+f*w),(this.north&&f===T||!this.north&&f===-T)&&(g=0),d=0;d<s;d++)u[R++]=g*C[d]-L[0],u[R++]=g*M[d]*w-L[1],u[R++]=a[x++]-L[2];return u},n.prototype.cartesianToGeographic=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","cartesianToGeographic","missingGlobe"));if(!l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","cartesianToGeographic","missingResult"));var h,u=Math.sqrt(n*n+o*o);return u<1e-4?(l.latitude=this.north?90:-90,l.longitude=0,l.altitude=s):(h=u/i.equatorialRadius,h>Math.PI&&(h=Math.PI),l.latitude=Math.asin(Math.cos(h)*(this.north?1:-1))*t.RADIANS_TO_DEGREES,l.longitude=Math.atan2(n,o*(this.north?-1:1))*t.RADIANS_TO_DEGREES,l.altitude=s),l}
114,n.prototype.northTangentAtLocation=function(i,n,o,s){if(!s)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","northTangentAtLocation","missingResult"));return s[0]=Math.sin(o*t.DEGREES_TO_RADIANS)*(this.north?-1:1),s[1]=Math.cos(o*t.DEGREES_TO_RADIANS),s[2]=0,s},n.prototype.northTangentAtPoint=function(t,i,n,o,s,a){if(!a)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","northTangentAtLocation","missingResult"));var l=Math.sqrt(i*i+n*n);return l<1e-4?(a[0]=0,a[1]=1,a[2]=0):(a[0]=i/l*(this.north?-1:1),a[1]=n/l*(this.north?-1:1),a[2]=0),a},n}),i("projections/ProjectionUPS",["../geom/Angle","../error/ArgumentError","../projections/GeographicProjection","../util/Logger","../geom/Sector","../geom/Vec3","../util/WWMath"],function(t,e,i,r,n,o,s){"use strict";var a=function(t){this.north=!("South"===t);var e=this.north?new n(0,90,-180,180):new n(-90,0,-180,180);i.call(this,"Uniform Polar Stereographic",!1,e),this._pole=t,this.displayName=this.north?"North UPS":"South UPS",this._stateKey="projection ups "+this._pole+" "};return a.prototype=Object.create(i.prototype),Object.defineProperties(a.prototype,{pole:{get:function(){return this._pole},set:function(t){this._pole=t,this.north=!("South"===this._pole),this.projectionLimits=this.north?new n(0,90,-180,180):new n(-90,0,-180,180),this._stateKey="projection ups "+this._pole+" "}},stateKey:{get:function(){return this._stateKey}}}),a.prototype.geographicToCartesian=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionUPS","geographicToCartesian","missingGlobe"));if(!l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionUPS","geographicToCartesian","missingResult"));if(this.north&&90===n||!this.north&&-90===n)l[0]=0,l[1]=0,l[2]=s;else{var h,u,c,d=this.north?1:-1,f=n*t.DEGREES_TO_RADIANS,p=o*t.DEGREES_TO_RADIANS,g=Math.sqrt(i.eccentricitySquared),m=Math.sqrt(Math.pow(1+g,1+g)*Math.pow(1-g,1-g));(this.north&&f<0||!this.north&&f>0)&&(f=0),h=Math.sin(f*d),u=Math.sqrt((1-h)/(1+h)*Math.pow((1+g*h)/(1-g*h),g)),c=2*i.equatorialRadius*.994*u/m,l[0]=c*Math.sin(p),l[1]=-c*Math.cos(p)*d,l[2]=s}return l},a.prototype.geographicToCartesianGrid=function(i,n,a,l,h,u,c,d){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionUPS","geographicToCartesianGrid","missingGlobe"));if(!n)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionUPS","geographicToCartesianGrid","missingSector"));if(!h||h.length<a*l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionUPS","geographicToCartesianGrid","The specified elevations array is null, undefined or insufficient length"));if(!d)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionUPS","geographicToCartesianGrid","missingResult"));var f,p,g,m,y,E,v,_,b=i.equatorialRadius,S=n.minLatitude*t.DEGREES_TO_RADIANS,w=n.maxLatitude*t.DEGREES_TO_RADIANS,L=n.minLongitude*t.DEGREES_TO_RADIANS,T=n.maxLongitude*t.DEGREES_TO_RADIANS,x=(w-S)/(a>1?a-1:1),R=(T-L)/(l>1?l-1:1),M=this.projectionLimits.minLatitude*t.DEGREES_TO_RADIANS,C=this.projectionLimits.maxLatitude*t.DEGREES_TO_RADIANS,A=Math.sqrt(i.eccentricitySquared),P=Math.sqrt(Math.pow(1+A,1+A)*Math.pow(1-A,1-A)),N=this.north?1:-1,O=u||new o(0,0,0),I=0,D=0;for(f=0,g=S;f<a;f++,g+=x)for(f===a-1&&(g=w),y=s.clamp(g,M,C),E=Math.sin(y*N),v=Math.sqrt((1-E)/(1+E)*Math.pow((1+A*E)/(1-A*E),A)),_=2*b*.994*v/P,p=0,m=L;p<l;p++,m+=R)p===l-1&&(m=T),d[D++]=_*Math.sin(m)-O[0],d[D++]=-_*Math.cos(m)*N-O[1],d[D++]=h[I++]-O[2];return d},a.prototype.cartesianToGeographic=function(i,n,o,s,a,l){if(!i)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionUPS","cartesianToGeographic","missingGlobe"));if(!l)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionUPS","cartesianToGeographic","missingResult"));var h=Math.atan2(n,o*(this.north?-1:1)),u=Math.sqrt(i.eccentricitySquared),c=Math.sqrt(n*n+o*o),d=Math.sqrt(Math.pow(1+u,1+u)*Math.pow(1-u,1-u)),f=c*d/(2*i.equatorialRadius*.994),p=i.eccentricitySquared,g=p*p,m=g*p,y=m*p,E=Math.PI/2-2*Math.atan(f),v=p/2+5*g/24+m/12+13*y/360,_=7*g/48+29*m/240+811*y/11520,b=7*m/120+81*y/1120,S=4279*y/161280,w=E-_+S,L=v-3*b,T=2*_-8*S,x=4*b,R=8*S,M=Math.sin(2*E),C=w+M*(L+M*(T+M*(x+R*M)));return C*=this.north?1:-1,l.latitude=C*t.RADIANS_TO_DEGREES,l.longitude=h*t.RADIANS_TO_DEGREES,l.altitude=s,l}
114,a.prototype.northTangentAtLocation=function(i,n,o,s){if(!s)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionUPS","northTangentAtLocation","missingResult"));return s[0]=Math.sin(o*t.DEGREES_TO_RADIANS)*(this.north?-1:1),s[1]=Math.cos(o*t.DEGREES_TO_RADIANS),s[2]=0,s},a.prototype.northTangentAtPoint=function(t,i,n,o,s,a){if(!a)throw new e(r.logMessage(r.LEVEL_SEVERE,"ProjectionPolarEquidistant","northTangentAtLocation","missingResult"));var l=Math.sqrt(i*i+n*n);return l<1e-4?(a[0]=0,a[1]=1,a[2]=0):(a[0]=i/l*(this.north?-1:1),a[1]=n/l*(this.north?-1:1),a[2]=0),a},a}),i("util/ByteBuffer",["../error/ArgumentError","../util/Logger"],function(t,e){"use strict";var i=function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"ByteBuffer","constructor","missingArray"));this.array=r,this.data=new DataView(r),this.position=0,this._order=i.LITTLE_ENDIAN};return i.prototype.getByte=function(){var t=this.data.getUint8(this.position);return this.position+=i.BYTE_SIZE,t},i.prototype.getByteArray=function(t){var e=new Uint8Array(this.array,this.position,t);return this.position+=i.BYTE_SIZE*t,e},i.prototype.getInt16=function(){var t=this.data.getInt16(this.position,this._order);return this.position+=i.INT16_SIZE,t},i.prototype.getInt16Array=function(t){var e=new Int16Array(this.array,this.position,t);return this.position+=i.INT16_SIZE*t,e},i.prototype.getInt32=function(){var t=this.data.getInt32(this.position,this._order);return this.position+=i.INT32_SIZE,t},i.prototype.getInt32Array=function(t){var e=new Int32Array(this.array,this.position,t);return this.position+=i.INT32_SIZE*t,e},i.prototype.getFloat=function(){var t=this.data.getFloat32(this.position,this._order);return this.position+=i.FLOAT_SIZE,t},i.prototype.getFloatArray=function(t){var e=new Float32Array(this.array,this.position,t);return this.position+=i.FLOAT_SIZE*t,e},i.prototype.getDouble=function(){var t=this.data.getFloat64(this.position,this._order);return this.position+=i.DOUBLE_SIZE,t},i.prototype.getDoubleArray=function(t){var e;if(this.position%8!=0){var r=this.array.slice(this.position,this.position+t*i.DOUBLE_SIZE);e=new Float64Array(r)}else e=new Float64Array(this.array,this.position,t);return this.position+=i.DOUBLE_SIZE*t,e},i.prototype.skipBytes=function(t){this.position+=t*i.BYTE_SIZE},i.prototype.skipInt16s=function(t){this.position+=t*i.INT16_SIZE},i.prototype.skipInt32s=function(t){this.position+=t*i.INT32_SIZE},i.prototype.skipFloats=function(t){this.position+=t*i.FLOAT_SIZE},i.prototype.skipDoubles=function(t){this.position+=t*i.DOUBLE_SIZE},i.prototype.seek=function(t){this.position=t},i.prototype.order=function(t){this._order=t},i.prototype.limit=function(){return this.data.byteLength},i.prototype.hasRemaining=function(){return this.position<this.data.byteLength},i.BIG_ENDIAN=!1,i.LITTLE_ENDIAN=!0,i.BYTE_SIZE=1,i.INT16_SIZE=2,i.INT32_SIZE=4,i.FLOAT_SIZE=4,i.DOUBLE_SIZE=8,i}),i("formats/shapefile/DBaseField",["../../error/ArgumentError","../../util/ByteBuffer","../../formats/sh
114apefile/DBaseFile","../../util/Logger"],function(t,e,i,r){"use strict";var n=function(e,i){if(!e)throw new t(r.logMessage(r.LEVEL_SEVERE,"DBaseField","constructor","missingAttributeName"));if(!i)throw new t(r.logMessage(r.LEVEL_SEVERE,"DBaseField","constructor","missingBuffer"));this.name=null,this.type=null,this.typeCode=-1,this.length=-1,this.decimals=-1,this.readFieldDescriptor(e,i)};return n.prototype.getName=function(){return this.name},n.prototype.getType=function(){return this.type},n.prototype.getLength=function(){return this.length},n.prototype.getDecimals=function(){return this.decimals},n.prototype.readFieldDescriptor=function(t,i){i.order(e.LITTLE_ENDIAN);var o=i.position;if(this.name=t.readNullTerminatedString(i,n.FIELD_NAME_LENGTH),i.seek(o+n.FIELD_NAME_LENGTH),this.typeCode=String.fromCharCode(i.getByte()),this.type=n.getFieldType(this.typeCode),null==this.type)throw new Error(r.log(r.LEVEL_SEVERE,"Shapefile dBase encountered unsupported field type: "+this.typeCode));i.skipBytes(4),this.length=i.getByte(),this.decimals=i.getByte(),i.seek(o+n.FIELD_DESCRIPTOR_LENGTH)},n.getFieldType=function(t){switch(t){case"C":return n.TYPE_CHAR;case"D":return n.TYPE_DATE;case"F":return n.TYPE_NUMBER;case"L":return n.TYPE_BOOLEAN;case"N":return n.TYPE_NUMBER;default:return null}},n.prototype.toString=function(){return this.name+"("+this.typeCode+")"},n.TYPE_CHAR="DBase.FieldTypeChar",n.TYPE_NUMBER="DBase.FieldTypeNumber",n.TYPE_DATE="DBase.FieldTypeDate",n.TYPE_BOOLEAN="DBase.FieldTypeBoolean",n.FIELD_NAME_LENGTH=11,n.FIELD_DESCRIPTOR_LENGTH=32,n}),i("formats/shapefile/DBaseRecord",["../../error/ArgumentError","../../util/ByteBuffer","../../formats/sh
114apefile/DBaseField","../../formats/shapefile/DBaseFile","../../util/Logger"],function(t,e,i,r,n){"use strict";var o=function(e,i,r){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"DBaseRecord","constructor","missingAttributeName"));if(!i)throw new t(n.logMessage(n.LEVEL_SEVERE,"DBaseRecord","constructor","missingBuffer"));this.deleted=!1,this.recordNumber=r,this.values=null,this.readFromBuffer(e,i,r)};return o.prototype.isDeleted=function(){return this.deleted},o.prototype.getRecordNumber=function(){return this.recordNumber},o.prototype.readFromBuffer=function(t,r,o){r.order(e.LITTLE_ENDIAN),this.recordNumber=o;var s=r.getByte();this.deleted=42==s;var a=t.getFields();this.values={};for(var l=0,h=a.length;l<h;l+=1){var u=a[l],c=u.getName(),d=t.readNullTerminatedString(r,u.getLength()).trim();try{if(u.getType()==i.TYPE_BOOLEAN){var f=d.charAt(0);this.values[c]="t"==f||"T"==f||"Y"==f||"y"==f}else u.getType()==i.TYPE_CHAR?this.values[c]=d:u.getType()==i.TYPE_DATE?this.values[c]=new Date(d):u.getType()==i.TYPE_NUMBER&&(this.values[c]=+d)}catch(t){n.log(n.LEVEL_WARNING,"Shapefile attribute parsing error:"+u.toString()+" -> "+d.toString()+" ["+t+"]")}}},o}),i("formats/shapefile/DBaseFile",["../../error/ArgumentError","../../util/ByteBuffer","../../formats/sh
114apefile/DBaseField","../../formats/shapefile/DBaseRecord","../../util/Logger"],function(t,e,i,r,n){"use strict";var o=function(e){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"DBaseFile","constructor","missingUrl"));this.url=e,this.header=null,this.fields=null,this.buffer=null,this.boolean=!0,this.numRecordsRead=0,this._completionCallback=null};return o.prototype.getLastModificationDate=function(){return this.header.lastModificationDate},o.prototype.getNumberOfRecords=function(){return this.header.numberOfRecords},o.prototype.getHeaderLength=function(){return this.header.headerLength},o.prototype.getRecordLength=function(){return this.header.recordLength},o.prototype.getNumberOfFields=function(){return(this.header.headerLength-1-o.FIXED_HEADER_LENGTH)/o.FIELD_DESCRIPTOR_LENGTH},o.prototype.getFields=function(){return this.fields},o.prototype.hasNext=function(){return this.numRecordsRead<this.header.numberOfRecords},o.prototype.nextRecord=function(){return this.numRecordsRead>=this.getNumberOfRecords()?null:this.readNextRecord(this._buffer,++this.numRecordsRead)},o.prototype.load=function(t){this._completionCallback=t,this.requestUrl(this.url)},o.prototype.requestUrl=function(t){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onreadystatechange=function(){4===i.readyState&&(200===i.status?(this._buffer=new e(i.response),this.parse(),this._completionCallback&&this._completionCallback(this)):(n.log(n.LEVEL_WARNING,"DBaseFile retrieval failed ("+i.statusText+"): "+t),this._completionCallback&&this._completionCallback(this)))}.bind(this),i.onerror=function(){n.log(n.LEVEL_WARNING,"DBaseFile retrieval failed: "+t),this._completionCallback&&this._completionCallback(this)},i.ontimeout=function(){n.log(n.LEVEL_WARNING,"DBaseFile retrieval timed out: "+t),this._completionCallback&&this._completionCallback(this)},i.send(null)},o.prototype.parse=function(){this.header=this.readHeader(this._buffer),this.fields=this.readFieldDescriptors(this._buffer,this.getNumberOfFields())},o.prototype.readHeader=function(t){var i=t.position;t.order(e.LITTLE_ENDIAN);var r=t.getByte();if(r>5)throw new Error("???");var n=t.getByte(),s=t.getByte(),a=t.getByte(),l=t.getInt32(),h=t.getInt16(),u=t.getInt16(),c={year:1900+n,month:s-1,day:a},d={fileCode:r,lastModificationDate:c,numberOfRecords:l,headerLength:h,recordLength:u};return t.seek(i+o.FIXED_HEADER_LENGTH),d},o.prototype.readFieldDescriptors=function(t,e){for(var r=t.position,n=[],s=0;s<e;s+=1)n[s]=new i(this,t);var a=this.header.headerLength-o.FIXED_HEADER_LENGTH;return t.seek(r+a),n},o.prototype.readNextRecord=function(t,e){return new r(this,t,e)},o.prototype.readNullTerminatedString=function(t,e){if(e<=0)return 0;for(var i="",r=0;r<e;r+=1){var n=t.getByte();if(0==n)break;i+=String.fromCharCode(n)}return this.isStringEmpty(i)?"":i},o.prototype.isStringEmpty=function(t){return t.length<=0||o.isStringFilled(t,32)||o.isStringFilled(t,42)},o.isStringFilled=function(t,e){if(t.length<=0)return!1;for(var i=0;i<t.length;i++)if(t.charAt(i)!=e)return!1;return!0},o.FIXED_HEADER_LENGTH=32,o.FIELD_DESCRIPTOR_LENGTH=32,o}),i("formats/shapefile/PrjFile",["../../error/ArgumentError","../../util/Logger","../../error/NotYetImplementedError"],function(t,e,i){"use strict";var r=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"DBaseFile","constructor","missingUrl"));this._url=i,this._completionCallback=null,this._params=null};return Object.defineProperties(r.prototype,{url:{get:function(){return this._url}},coordinateSystem:{get:function(){return this.params?this.params[r.COORDINATE_SYSTEM]:null}},params:{get:function(){return this._params}}}),r.prototype.load=function(t){this._completionCallback=t,this.requestUrl(this._url)},r.prototype.requestUrl=function(t){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onreadystatechange=function(){if(4===i.readyState){if(200===i.status){var r=String.fromCharCode.apply(null,new Uint8Array(i.response));this._params=this.decodeOGCCoordinateSystem(r)}else e.log(e.LEVEL_WARNING,"PrjFile retrieval failed ("+i.statusText+"): "+t);this._completionCallback&&this._completionCallback(this)}}.bind(this),i.onerror=function(){e.log(e.LEVEL_WARNING,"PrjFile retrieval failed: "+t),this._completionCallback&&this._completionCallback(this)}.bind(this),i.ontimeout=function(){e.log(e.LEVEL_WARNING,"PrjFile retrieval timed out: "+t),this._completionCallback&&this._completionCallback(this)}.bind(this),i.send(null)},r.prototype.decodeOGCCoordinateSystem=function(n){n||new t(e.logMessage(e.LEVEL_SEVERE,"PrjFile","decodeOGCCoordinateSystem","missingText"));var o={};if(n=n.trim().toUpperCase(),r.GEOGCS_WKT_PATTERN.test(n))o[r.COORDINATE_SYSTEM]=r.COORDINATE_SYSTEM_GEOGRAPHIC;else{if(n.match(r.PROJCS_WKT_PATTERN))throw o[PrfFile.COORDINATE_SYSTEM]=r.COORDINATE_SYSTEM_PROJECT
114ED,new i(e.log(e.LEVEL_SEVERE,"PrjFile implementation for projected coordinate systems in incomplete."));o[r.COORDINATE_SYSTEM]=r.COORDINATE_SYSTEM_UNKNOWN}return o},r.prototype.isUnknownCoordinateSystem=function(){return!this.params||this.params.coordinateSystem===r.COORDINATE_SYSTEM_UNKNOWN},r.prototype.isKnownCoordinateSystem=function(){return!!this.params&&this.params.coordinateSystem!==r.COORDINATE_SYSTEM_UNKNOWN},r.prototype.isGeographicCoordinateSystem=function(){return!!this.params&&this.params.coordinateSystem===r.COORDINATE_SYSTEM_GEOGRAPHIC},r.prototype.isProjectedCoordinateSystem=function(){return!!this.params&&this.params.coordinateSystem===r.COORDINATE_SYSTEM_PROJECTED},r.GEOGCS_WKT_PATTERN=new RegExp("\\{*GEOGCS[\\[\\(](.*)[\\]\\)]\\}*"),r.PROJCS_WKT_PATTERN=new RegExp("\\{*PROJCS[\\[\\(](.*)[\\]\\)]\\}*"),r.UTM_NAME_WKT_PATTERN=new RegExp(".*UTM.*ZONE.*?(\\d+).*?([\\w\\s]+).*?"),r.COORDINATE_SYSTEM="Coordinate_system",r.COORDINATE_SYSTEM_GEOGRAPHIC="Coordinate_system_geographic",r.COORDINATE_SYSTEM_PROJECTED="Coordinate_system_projected",r.COORDINATE_SYSTEM_UNKNOWN="Coordinate_system_unknown",r.PROJECTION_NAME="Projection_name",r.PROJECTION_UTM="Projection_UTM",r.PROJECTION_ZONE="Projection_zone",r.PROJECTION_HEMISPHERE="Projection_hemisphere",r.PROJECTION_HEMISPHERE_NORTH="Projection_hemisphere_north",r.PROJECTION_HEMISPHERE_SOUTH="Projection_hemisphere_south",r}),i("formats/shapefile/ShapefileRecord",["../../geom/Angle","../../error/ArgumentError","../../util/ByteBuffer","../../geom/Location","../../util/Logger","../../formats/sh
114apefile/Shapefile"],function(t,e,i,r,n,o){"use strict";var s=function(t,i){if(!t)throw new e(n.logMessage(n.LEVEL_SEVERE,"ShapefileRecord","constructor","The specified shapefile is null or undefined"));if(!i)throw new e(n.logMessage(n.LEVEL_SEVERE,"ShapefileRecord","constructor","The specified buffer is null or undefined"));this._shapefile=t,this._recordNumber=-1,this._attributes={},this._numberOfParts=0,this._firstPartNumber=0,this._lastPartNumber=0,this._numberOfPoints=0,this._boundingRectangle=[],this._zRange=null,this._zValues=null,this._mRange=null,this._mValues=null,this._contentLengthInBytes=-1,this._buffer=i,this._isNormalized=!1,this._parts=[],this.readRecord()};return Object.defineProperties(s.prototype,{shapefile:{get:function(){return this._shapefile}},recordNumber:{get:function(){return this._recordNumber}},attributes:{get:function(){return this._attributes}},numberOfParts:{get:function(){return this._numberOfParts}},firstPartNumber:{get:function(){return this._firstPartNumber}},lastPartNumber:{get:function(){return this._lastPartNumber}},numberOfPoints:{get:function(){return this._numberOfPoints}},boundingRectangle:{get:function(){return this._boundingRectangle}},zRange:{get:function(){return this._zRange}},zValues:{get:function(){return this._zValues}},mRange:{get:function(){return this._mRange}},mValues:{get:function(){return this._mValues}}}),s.prototype.pointBuffer=function(t){return t>=0&&t<this._parts.length?this._parts[t]:null},s.prototype.readRecord=function(){this.readHeader(),this._buffer.order(i.LITTLE_ENDIAN);var t=this._buffer.getInt32(),e=this.shapefile.getShapeType(t);this.validateShapeType(e),this.readContents()},s.prototype.readHeader=function(){this._buffer.order(i.BIG_ENDIAN),this._recordNumber=this._buffer.getInt32(),this._contentLengthInBytes=2*this._buffer.getInt32()},s.prototype.validateShapeType=function(t){if(t!==this.shapefile.NULL&&t!==this.shapefile.shapeType)throw new Error(n.log(n.LEVEL_SEVERE,"Shapefile record is not supported."))},s.prototype.readNullContents=function(){this._numberOfParts=0,this._numberOfPoints=0,this._parts=null,this._boundingRectangle=null,this._buffer.seek(this._contentLengthInBytes-i.INT32_SIZE)},s.prototype.readPointContents=function(){this._numberOfParts=1,this._firstPartNumber=0,this._lastPartNumber=this._numberOfParts-1,this._numberOfPoints=1,this._parts=[this._buffer.getDoubleArray(2)];var t=this._parts[0][1],e=this._parts[0][0];this._boundingRectangle=[t,t,e,e],this.isZType()&&this.readZ(!0),this.isMeasureType()&&this.readOptionalMeasures(!0)},s.prototype.readPolylineContents=function(){var t=this.shapefile.readBoundingRectangle(this._buffer);if(this._boundingRectangle=t.coords,this._isNormalized=t.isNormalized,this._numberOfParts=this._buffer.getInt32(),this._firstPartNumber=0,this._lastPartNumber=this._numberOfParts-1,this._numberOfPoints=this._buffer.getInt32(),this._numberOfParts>0&&this._numberOfPoints>0)for(var e=this._buffer.getInt32Array(this.numberOfParts),i=0;i<this.numberOfParts;i+=1){var r=i==this.numberOfParts-1?this._numberOfPoints-e[i]:e[i+1]-e[i];this._parts[i]=this._buffer.getDoubleArray(2*r),s.normalizeLocations(this._parts[i])}this.isZType()&&this.readZ(!1),this.isMeasureType()&&this.readOptionalMeasures(!1)},s.prototype.readMultiPointContents=function(){var t=this.shapefile.readBoundingRectangle(this._buffer);this._boundingRectangle=t.coords,this._isNormalized=t.isNormalized,this._numberOfParts=1,this._numberOfPoints=this._buffer.getInt32(),this._parts=[this._buffer.getDoubleArray(2*this._numberOfPoints)],s.normalizeLocations(this._parts[0]),this.isZType()&&this.readZ(!1),this.isMeasureType()&&this.readOptionalMeasures(!1)},s.prototype.readZ=function(t){if(t){this._zValues=this._buffer.getDoubleArray(1);var e=this._zValues[0];this._zRange=[e,e]}else this._zRange=this._buffer.getDoubleArray(2),this._zValues=this._buffer.getDoubleArray(this.numberOfPoints)},s.prototype.readOptionalMeasures=function(t){if(this._buffer.hasRemaining()&&this._buffer.limit()-this._buffer.position>=8*this.numberOfPoints)if(t){this._mValues=this._buffer.getDoubleArray(1);var e=this._mValues[0];this._mRange=[e,e]}else this._mRange=this._buffer.getDoubleArray(2),this._mValues=this._buffer.getDoubleArray(this.numberOfPoints)},s.normalizeLocations=function(e){for(var i=0,r=e.length;i<r;i+=2){var n=e[i],o=e[i+1];e[i]=t.normalizedDegreesLongitude(n),e[i+1]=t.normalizedDegreesLatitude(o)}},s.prototype.isPointType=function(){return this.shapefile.isPointType()},s.prototype.isMultiPointType=function(){return this.shapefile.isMultiPointType()},s.prototype.isPolylineType=function(){return this.shapefile.isPolylineType()},s.prototype.isPolygonType=function(){return this.shapefile.isPolygonType()},s.prototype.isZType=function(){return this.shapefile.isZType()},s.prototype.isMeasureType=function(){return this.shapefile.isMeasureType()},s.prototype.setAttributes=function(t){this._attributes=t},s.RECORD_HEADER_LENGTH=8,s}
114),i("formats/shapefile/ShapefileRecordMultiPoint",["../../util/ByteBuffer","../../formats/shapefile/Shapefile","../../formats/shapefile/ShapefileRecord"],function(t,e,i){"use strict";var r=function(t,e){i.call(this,t,e)};return r.prototype=Object.create(i.prototype),r.prototype.readContents=function(){this.readMultiPointContents()},r}),i("formats/shapefile/ShapefileRecordNull",["../../formats/shapefile/Shapefile","../../formats/shapefile/ShapefileRecord"],function(t,e){"use strict";var i=function(t,i){e.call(this,t,i)};return i.prototype=Object.create(e.prototype),i.prototype.readContents=function(){this.readNullContents()},i}),i("formats/shapefile/ShapefileRecordPoint",["../../formats/shapefile/Shapefile","../../formats/shapefile/ShapefileRecord"],function(t,e){"use strict";var i=function(t,i){e.call(this,t,i)};return i.prototype=Object.create(e.prototype),i.prototype.readContents=function(){this.readPointContents()},i}),i("formats/shapefile/ShapefileRecordPolygon",["../../formats/shapefile/Shapefile","../../formats/shapefile/ShapefileRecord"],function(t,e){"use strict";var i=function(t,i){e.call(this,t,i)};return i.prototype=Object.create(e.prototype),i.prototype.readContents=function(){this.readPolylineContents()},i}),i("formats/shapefile/ShapefileRecordPolyline",["../../formats/sh
114apefile/Shapefile","../../formats/shapefile/ShapefileRecord"],function(t,e){"use strict";var i=function(t,i){e.call(this,t,i)};return i.prototype=Object.create(e.prototype),i.prototype.readContents=function(){this.readPolylineContents()},i}),i("formats/shapefile/Shapefile",["../../geom/Angle","../../error/ArgumentError","../../util/ByteBuffer","../../util/Color","../../formats/shapefile/DBaseFile","../../geom/Location","../../util/Logger","../../error/NotYetImplementedError","../../shapes/Path","../../shapes/Placemark","../../shapes/PlacemarkAttributes","../../shapes/Polygon","../../geom/Position","../../formats/shapefile/PrjFile","../../layer/RenderableLayer","../../shapes/ShapeAttributes","../../formats/shapefile/ShapefileRecord","../../formats/shapefile/ShapefileRecordMultiPoint","../../formats/shapefile/ShapefileRecordNull","../../formats/shapefile/ShapefileRecordPoint","../../formats/shapefile/ShapefileRecordPolygon","../../formats/shapefile/ShapefileRecordPolyline","../../shapes/SurfacePolygon","../../shapes/SurfacePolyline"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_,b,S,w){"use strict";var L=function(t){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Shapefile","constructor","missingUrl"));this._url=t,this._shapeType=null,this._layer=null,this._shapeConfigurationCallback=this.defaultShapeConfigurationCallback,this._parserCompletionCallback=this.defaultParserCompletionCallback,this._buffer=null,this.attributeFile=new n(t.replace(".shp",".dbf")),this.projectionFile=new f(t.replace(".shp",".prj")),this.defaultPlacemarkAttributes=new u(null),this.defaultShapeAttributes=new g(null)};return Object.defineProperties(L.prototype,{url:{get:function(){return this._url}}, 115shapeType:{get:function(){return this._shapeType}},layer:{get:function(){return this._layer}},parserCompletionCallback:{get:function(){return this._parserCompletionCallback}},shapeConfigurationCallback:{get:function(){return this._shapeConfigurationCallback}}}),L.prototype.load=function(t,e,i){t&&(this._parserCompletionCallback=t),e&&(this._shapeConfigurationCallback=e),this._layer=i||new p;var r=function(){var t=function(){this.requestUrl(this.url)}.bind(this);this.attributeFile.load(t)}.bind(this);this.projectionFile.load(r)},L.prototype.defaultParserCompletionCallback=function(t){this.addRenderablesForShapefile(this.layer)},L.prototype.defaultShapeConfigurationCallback=function(t,e){var i={},r=t.values.name||t.values.Name||t.values.NAME;if(r&&(i.name=r),e.isPointType())i.attributes=this.defaultPlacemarkAttributes;else if(e.isMultiPointType())i.attributes=this.defaultPlacemarkAttributes;else if(e.isPolylineType())i.attributes=this.defaultShapeAttributes;else if(e.isPolygonType()){i.attributes=this.defaultShapeAttributes;var n=t.values.height||t.values.Height||t.values.HEIGHT;n&&(i.height=n)}return i},L.prototype.addRenderablesForShapefile=function(t){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Shapefile","addRenderablesForShapefile","missingLayer"));this.isPointType()?this.addRenderablesForPoints(t):this.isMultiPointType()?this.addRenderablesForMultiPoints(t):this.isPolylineType()?this.addRenderablesForPolylines(t):this.isPolygonType()&&this.addRenderablesForPolygons(t)},L.prototype.addRenderablesForPoints=function(t){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Shapefile","addRenderablesForPoints","missingLayer"));for(var i=this.next();i;i=this.next()){var r=this.shapeConfigurationCallback(i.attributes,i),n=r&&r.altitude?r.altitude:0;if(r)for(var o=0,a=i.numberOfParts;o<a;o+=1)for(var l=i.pointBuffer(o),u=0,c=l.length;u<c;u+=2){var f=l[u],p=l[u+1],g=new d(p,f,n),m=new h(g,!1,r.attributes);m.altitudeMode=r.altitudeMode||WorldWind.RELATIVE_TO_GROUND,r.highlightAttributes&&(m.highlightAttributes=r.highlightAttributes),r.name&&(m.label=r.name),r.pickDelegate&&(m.pickDelegate=r.pickDelegate),r.userProperties&&(m.userProperties=r.userProperties),t.addRenderable(m)}}},L.prototype.addRenderablesForMultiPoints=function(t){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Shapefile","addRenderablesForMultiPoints","missingLayer"));for(var i=this.next();i;i=this.next()){var r=this.shapeConfigurationCallback(i.attributes,i),n=r&&r.altitude?r.altitude:0;if(r)for(var o=0,a=i.numberOfParts;o<a;o+=1)for(var l=i.pointBuffer(o),u=0,c=l.length;u<c;u+=2){var f=l[u],p=l[u+1],g=new d(p,f,n),m=new h(g,!1,r.attributes);m.altitudeMode=r.altitudeMode||WorldWind.RELATIVE_TO_GROUND,r.highlightAttributes&&(m.highlightAttributes=r.highlightAttributes),r.name&&(m.label=r.name),r.pickDelegate&&(m.pickDelegate=r.pickDelegate),r.userProperties&&(m.userProperties=r.userProperties),t.addRenderable(m)}}},L.prototype.addRenderablesForPolylines=function(t){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Shapef
115ile","addRenderablesForPolylines","missingLayer"));for(var i=this.next();i;i=this.next()){var r=this.shapeConfigurationCallback(i.attributes,i),n=r&&r.altitude?r.altitude:0;if(r)for(var a=0,h=i.numberOfParts;a<h;a+=1){for(var u=i.pointBuffer(a),c=[],f=0,p=u.length;f<p;f+=2){var g=u[f],m=u[f+1],y=n?new d(m,g,n):new o(m,g);c.push(y)}var E;n?(E=new l(c,r.attributes),E.altitudeMode=r.altitudeMode||WorldWind.RELATIVE_TO_GROUND):E=new w(c,r.attributes),r.highlightAttributes&&(E.highlightAttributes=r.highlightAttributes),r.name&&(E.displayName=r.name),r.pickDelegate&&(E.pickDelegate=r.pickDelegate),r.userProperties&&(E.userProperties=r.userProperties),t.addRenderable(E)}}},L.prototype.addRenderablesForPolygons=function(t){if(!t)throw new e(s.logMessage(s.LEVEL_SEVERE,"Shapefile","addRenderablesForPolygons","missingLayer"));for(var i=this.next();i;i=this.next()){for(var r,n=this.shapeConfigurationCallback(i.attributes,i),a=[],l=n.height,h=n.altitude,u=0,f=i.numberOfParts;u<f;u+=1){for(var p=i.pointBuffer(u),g=[],m=0,y=p.length-2;m<y;m+=2){var E=p[m],v=p[m+1];r=l?new d(v,E,l):h?new d(v,E,h):new o(v,E),g.push(r)}a.push(g)}var _;l?(_=new c(a,n.attributes),_.extrude=!0,_.altitudeMode=n.altitudeMode||WorldWind.RELATIVE_TO_GROUND):h?(_=new c(a,n.attributes),_.altitudeMode=n.altitudeMode||WorldWind.RELATIVE_TO_GROUND):_=new S(a,n.attributes),n.highlightAttributes&&(_.highlightAttributes=n.highlightAttributes),n.name&&(_.displayName=n.name),n.pickDelegate&&(_.pickDelegate=n.pickDelegate),n.userProperties&&(_.userProperties=n.userProperties),t.addRenderable(_)}},L.prototype.next=function(){for(;this._buffer.position<this._buffer.limit();){var t=this.readRecord(this._buffer);if(!(t instanceof E))return t}return null},L.prototype.requestUrl=function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onreadystatechange=function(){4===e.readyState&&(200===e.status?(this._buffer=new i(e.response),this.parse()):s.log(s.LEVEL_WARNING,"Shapefile retrieval failed ("+e.statusText+"): "+t),this._parserCompletionCallback&&this._parserCompletionCallback(this))}.bind(this),e.onerror=function(){s.log(s.LEVEL_WARNING,"Shapefile retrieval failed: "+t),this._parserCompletionCallback&&this._parserCompletionCallback(this)},e.ontimeout=function(){s.log(s.LEVEL_WARNING,"Shapefile retrieval timed out: "+t),this._parserCompletionCallback&&this._parserCompletionCallback(this)},e.send(null)},L.prototype.parse=function(){try{var t=this.readHeader(this._buffer);this._shapeType=t.shapeType}catch(t){console.log(t)}},L.prototype.readHeader=function(t){if(t.order(i.BIG_ENDIAN),t.getInt32()!=L.FILE_CODE)throw new Error(s.log(s.LEVEL_SEVERE,"Shapefile header is invalid"));t.skipInt32s(5);var e=t.getInt32();t.order(i.LITTLE_ENDIAN);var r=t.getInt32(),n=t.getInt32(),o=this.readBoundingRectangle(t),a=this.getShapeType(n);if(null==a)throw new Error(s.log(s.LEVEL_SEVERE,"Shapefile type is unsupported: "+n.toString()));var l={fileLength:2*e,version:r,shapeType:a,boundingRectangle:o.coords,normalizePoints:o.isNormalized};return t.skipDoubles(4),l},L.prototype.readBoundingRectangle=function(t){return this.projectionFile?this.projectionFile.isGeographicCoordinateSystem()?this.readGeographicBoundingRectangle(t):this.projectionFile.isProjectedCoordinateSystem()?this.readProjectedBoundingRectangle(t):this.readUnspecifiedBoundingRectangle(t):this.readUnspecifiedBoundingRectangle(t)},L.prototype.readUnspecifiedBoundingRectangle=function(t){return{coords:this.readBoundingRectangleCoordinates(t),isNormalized:!1}},L.prototype.readGeographicBoundingRectangle=function(e){var i=this.readBoundingRectangleCoordinates(e),r=!1,n=0;return i[0]<-90&&(n=t.normalizedDegreesLatitude(i[0]),i[0]=90,r=!0,i[1]<n&&(i[1]=n)),i[1]>90&&(n=t.normalizedDegreesLatitude(i[1]),i[1]=90,r=!0,i[0]>n&&(i[0]=n)),(i[2]<-180||i[3]>180)&&(i[2]=-180,i[3]=180,r=!0),{coords:i,isNormalized:r}},L.prototype.readProjectedBoundingRectangle=function(t){throw new a(s.log(s.LEVEL_SEVERE,"Shapefile.readProjectedBoundingRectangle() not yet implemented"))},L.prototype.readBoundingRectangleCoordinates=function(t){var e=t.getDouble(),i=t.getDouble(),r=t.getDouble();return[i,t.getDouble(),e,r]},L.prototype.readRecord=function(t){var e=this.createRecord(t);if(null!=e&&null!=this.attributeFile&&this.attributeFile.hasNext()){var i=this.attributeFile.nextRecord();e.setAttributes(i)}return e},L.prototype.createRecord=function(t){return this.isNullType()?this.createNull(t):this.isPointType()?this.createPoint(t):this.isMultiPointType()?this.createMultiPoint(t):this.isPolygonType()?this.createPolygon(t):this.isPolylineType()?this.createPolyline(t):null},L.prototype.createNull=function(t){return new E(this,t)},L.prototype.createPoint=function(t){return new v(this,t)},L.prototype.createMultiPoint=function(t){return new y(this,t)},L.prototype.createPolyline=function(t){return new b(this,t)},L.prototype.createPolygon=function(t){return new _(this,t)},L.prototype.getShapeType=function(t){switch(t){case 0:return L.NULL;case 1:return L.POINT;case 3:return L.POLYLINE;case 5:return L.POLYGON;case 8:return L.MULTI_POINT;case 11:return L.POINT_Z;case 13:return L.POLYLINE_Z;case 15:return L.POLYGON_Z;case 18:return L.MULTI_POINT_Z;case 21:return L.POINT_M;case 23:return L.POLYLINE_M;case 25:return L.POLYGON_M;case 28:return L.MULTI_POINT_M;default:return null}},L.prototype.isMeasureType=function(){return L.measureTypes.hasOwnProperty(this._shapeType)},L.prototype.isZType=function(){return L.zTypes.hasOwnProperty(this._shapeType)},L.prototype.isNullType=function(){return this._shapeType===L.NULL},L.prototype.isPointType=function(){return L.pointTypes.hasOwnProperty(this._shapeType)},L.prototype.isMultiPointType=function(){return L.multiPointTypes.hasOwnProperty(this._shapeType)},L.prototype.isPolylineType=function(){return L.polylineTypes.hasOwnProperty(this._shapeType)},L.prototype.isPolygonType=function(){return L.polygonTypes.hasOwnProperty(this._shapeType)},L.NULL="null",L.POINT="point",L.MULTI_POINT="multiPoint",L.POLYLINE="polyline",L.POLYGON="polygon",L.POINT_M=L.POINT+"M",L.MULTI_POINT_M=L.MULTI_POINT+"M",L.POLYLINE_M=L.POLYLINE+"M",L.POLYGON_M=L.POLYGON+"M",L.POINT_Z=L.POINT+"Z",L.MULTI_POINT_Z=L.MULTI_POINT+"Z",L.POLYLINE_Z=L.POLYLINE+"Z",L.POLYGON_Z=L.POLYGON+"Z",L.SHAPE_MULTI_PATCH="multiPatch",L.measureTypes={pointM:L.POINT_M,pointZ:L.POINT_Z,multiPointM:L.MULTI_POINT_M,multiPointZ:L.MULTI_POINT_Z,polylineM:L.POLYLINE_M,polylineZ:L.POLYLINE_Z,polygonM:L.POLYGON_M,polygonZ:L.POLYGON_Z},L.zTypes={pointZ:L.POINT_Z,multiPointZ:L.MULTI_POINT_Z,polylineZ:L.POLYLINE_Z,polygonZ:L.POLYGON_Z},L.pointTypes={point:L.POINT,pointZ:L.POINT_Z,pointM:L.POINT_M},L.multiPointTypes={multiPoint:L.MULTI_POINT,multiPointZ:L.MULTI_POINT_Z,multiPointM:L.MULTI_POINT_M},L.polylineTypes={polyline:L.POLYLINE,polylineZ:L.POLYLINE_Z,polylineM:L.POLYLINE_M},L.polygonTypes={polygon:L.POLYGON,polygonZ:L.POLYGON_Z,polygonM:L.POLYGON_M},L.FILE_CODE=9994,L}),i("layer/ShowTessellationLayer",["../shaders/BasicProgram","../layer/Layer"],function(t,e){"use strict";var i=function(){e.call(this,"Show Tessellation"),this.enableTerrainGeometry=!0,this.enableTerrainExtent=!1};return i.prototype=Object.create(e.prototype),i.prototype.doRender=function(t){try{this.beginRendering(t),this.enableTerrainGeometry&&this.drawTerrainGeometry(t),this.enableTerrainExtent&&this.drawTerrainExtent(t)}finally{this.endRendering(t)}},i.prototype.beginRendering=function(t){t.currentGlContext.depthMask(!1)},i.prototype.endRendering=function(t){t.currentGlContext.depthMask(!0)},i.prototype.drawTerrainGeometry=function(e){if(e.terrain&&e.terrain.tessellator){var i,r,n=e.currentGlContext,o=e.terrain,s=o.tessellator,a=o.surfaceGeometry;try{i=e.findAndBindProgram(t),s.beginRendering(e);for(var l=0,h=a.length;l<h;l++)r=a[l],s.beginRenderingTile(e,r),i.loadColorComponents(n,1,1,1,.3),s.renderWireframeTile(e,r),i.loadColorComponents(n,1,0,0,.6),s.renderTileOutline(e,r),s.endRenderingTile(e,r)}finally{s.endRendering(e)}}},i.prototype.drawTerrainExtent=function(t){for(var e,i=t.terrain.surfaceGeometry,r=0,n=i.length;r<n;r++)e=i[r],e.extent.render(t)},i}),i("shaders/StarFieldProgram",["../error/ArgumentError","../shaders/GpuProgram","../util/Logger"],function(t,e,
115i){"use strict";var r=function(t){e.call(this,t,"attribute vec4 vertexPoint;\nuniform mat4 mvpMatrix;\nuniform float numDays;\nuniform vec2 magnitudeRange;\nvarying float magnitudeWeight;\nfloat normalizeAngle(float angle) {\n float angleDivisions = angle / 360.0;\n return 360.0 * (angleDivisions - floor(angleDivisions));\n}\nvec3 computePosition(float dec, float ra) {\n float GMST = normalizeAngle(280.46061837 + 360.98564736629 * numDays);\n float GHA = normalizeAngle(GMST - ra);\n float lon = -GHA + 360.0 * step(180.0, GHA);\n float latRad = radians(dec);\n float lonRad = radians(lon);\n float radCosLat = cos(latRad);\n return vec3(radCosLat * sin(lonRad), sin(latRad), radCosLat * cos(lonRad));\n}\nfloat normalizeScalar(float value, float minValue, float maxValue){\n return (value - minValue) / (maxValue - minValue);\n}\nvoid main() {\n vec3 vertexPosition = computePosition(vertexPoint.x, vertexPoint.y);\n gl_Position = mvpMatrix * vec4(vertexPosition.xyz, 1.0);\n gl_Position.z = gl_Position.w - 0.00001;\n gl_PointSize = vertexPoint.z;\n magnitudeWeight = normalizeScalar(vertexPoint.w, magnitudeRange.x, magnitudeRange.y);\n}","precision mediump float;\nuniform sampler2D textureSampler;\nuniform int textureEnabled;\nvarying float magnitudeWeight;\nconst vec4 white = vec4(1.0, 1.0, 1.0, 1.0);\nconst vec4 grey = vec4(0.5, 0.5, 0.5, 1.0);\nvoid main() {\n if (textureEnabled == 1) {\n gl_FragColor = texture2D(textureSampler, gl_PointCoord);\n }\n else {\n gl_FragColor = mix(white, grey, magnitudeWeight);\n }\n}",["vertexPoint"]),this.vertexPointLocation=this.attributeLocation(t,"vertexPoint"),this.mvpMatrixLocation=this.uniformLocation(t,"mvpMatrix"),this.numDaysLocation=this.uniformLocation(t,"numDays"),this.magnitudeRangeLocation=this.uniformLocation(t,"magnitudeRange"),this.textureUnitLocation=this.uniformLocation(t,"textureSampler"),this.textureEnabledLocation=this.uniformLocation(t,"textureEnabled")};return r.key="WorldWindGpuStarFieldProgram",r.prototype=Object.create(e.prototype),r.prototype.loadModelviewProjection=function(e,r){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"StarFieldProgram","loadModelviewProjection","missingMatrix"));this.loadUniformMatrix(e,r,this.mvpMatrixLocation)},r.prototype.loadNumDays=function(e,r){if(null==r)throw new t(i.logMessage(i.LEVEL_SEVERE,"StarFieldProgram","loadNumDays","missingNumDays"));e.uniform1f(this.numDaysLocation,r)},r.prototype.loadMagnitudeRange=function(e,r,n){if(null==r)throw new t(i.logMessage(i.LEVEL_SEVERE,"StarFieldProgram","loadMagRange","missingMinMag"));if(null==n)throw new t(i.logMessage(i.LEVEL_SEVERE,"StarFieldProgram","loadMagRange","missingMaxMag"));e.uniform2f(this.magnitudeRangeLocation,r,n)},r.prototype.loadTextureUnit=function(t,e){t.uniform1i(this.textureUnitLocation,e-t.TEXTURE0)},r.prototype.loadTextureEnabled=function(t,e){t.uniform1i(this.textureEnabledLocation,e?1:0)},r}),i("layer/StarFieldLayer",["./Layer","../util/Logger","../geom/Matrix","../shaders/StarFieldProgram","../util/SunPosition"],function(t,e,i,r,n){"use strict";var o=function(e){t.call(this,"StarField"),this.pickEnabled=!1,this.sunSize=128,this.showSun=!0,this._starDataSource=e||WorldWind.configuration.baseUrl+"images/stars.json",this._sunImageSource=WorldWind.configuration.baseUrl+"images/sunTexture.png",this._matrix=i.fromIdentity(),this._starsPositionsVboCacheKey=null,this._numStars=0,this._starData=null,this._minMagnitude=Number.MAX_VALUE,this._maxMagnitude=Number.MIN_VALUE,this._loadStarted=!1,this._minScale=1e7,this._sunPositionsCacheKey="",this._sunBufferView=new Float32Array(4),this._MAX_GL_POINT_SIZE=0};return o.prototype=Object.create(t.prototype),Object.defineProperties(o.prototype,{starDataSource:{get:function(){return this._starDataSource},set:function(t){this._starDataSource=t,this.invalidateStarData()}},sunImageSource:{get:function(){return this._sunImageSource},set:function(t){this._sunImageSource=t}}}),o.prototype.doRender=function(t){if(!t.globe.is2D()){if(!this.haveResources(t))return void this.loadResources(t);this.beginRendering(t);try{this.doDraw(t)}finally{this.endRendering(t)}}},o.prototype.haveResources=function(t){var e=t.gpuResourceCache.resourceForKey(this._sunImageSource);return null!=this._starData&&null!=e},o.prototype.loadResources=function(t){var e=t.currentGlContext,i=t.gpuResourceCache;this._starData||this.fetchStarData(),i.resourceForKey(this._sunImageSource)||i.retrieveTexture(e,this._sunImageSource)},o.prototype.beginRendering=function(t){var e=t.currentGlContext;t.findAndBindProgram(r),e.enableVertexAttribArray(0),e.depthMask(!1)},o.prototype.doDraw=function(t){this.loadCommonUniforms(t),this.renderStars(t),this.showSun&&this.renderSun(t)},o.prototype.loadCommonUniforms=function(t){var e=t.currentGlContext,i=t.currentProgram,r=t.eyePoint,o=t.globe.computePositionFromPoint(r[0],r[1],r[2],{}),s=Math.max(1.5*o.altitude,this._minScale);this._matrix.copy(t.modelviewProjection),this._matrix.multiplyByScale(s,s,s),i.loadModelviewProjection(e,this._matrix);var a=n.computeJulianDate(this.time||new Date);i.loadNumDays(e,a-2451545)},o.prototype.renderStars=function(t){var e=t.currentGlContext,i=t.gpuResourceCache,r=t.currentProgram;this._starsPositionsVboCacheKey||(this._starsPositionsVboCacheKey=i.generateCacheKey());var n=i.resourceForKey(this._starsPositionsVboCacheKey);if(n)e.bindBuffer(e.ARRAY_BUFFER,n);else{n=e.createBuffer();var o=this.createStarsGeometry();i.putResource(this._starsPositionsVboCacheKey,n,4*o.length),e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,new Float32Array(o),e.STATIC_DRAW)}t.frameStatistics.incrementVboLoadCount(1),e.vertexAttribPointer(0,4,e.FLOAT,!1,0,0),r.loadMagnitudeRange(e,this._minMagnitude,this._maxMagnitude),r.loadTextureEnabled(e,!1),e.drawArrays(e.POINTS,0,this._numStars)},o.prototype.renderSun=function(t){var i=t.currentGlContext,r=t.currentProgram,o=t.gpuResourceCache;this._MAX_GL_POINT_SIZE||(this._MAX_GL_POINT_SIZE=i.getParameter(i.ALIASED_POINT_SIZE_RANGE)[1]),this.sunSize>this._MAX_GL_POINT_SIZE&&e.log(e.LEVEL_WARNING,"StarFieldLayer - sunSize is to big, max size allowed is: "+this._MAX_GL_POINT_SIZE);var s=n.getAsCelestialLocation(this.time||new Date);this._sunBufferView[0]=s.declination,this._sunBufferView[1]=s.rightAscension,this._sunBufferView[2]=Math.min(this.sunSize,this._MAX_GL_POINT_SIZE),this._sunBufferView[3]=1,this._sunPositionsCacheKey||(this._sunPositionsCacheKey=o.generateCacheKey());var a=o.resourceForKey(this._sunPositionsCacheKey);a?(i.bindBuffer(i.ARRAY_BUFFER,a),i.bufferSubData(i.ARRAY_BUFFER,0,this._sunBufferView)):(a=i.createBuffer(),o.putResource(this._sunPositionsCacheKey,a,4*this._sunBufferView.length),i.bindBuffer(i.ARRAY_BUFFER,a),i.bufferData(i.ARRAY_BUFFER,this._sunBufferView,i.DYNAMIC_DRAW)),t.frameStatistics.incrementVboLoadCount(1),i.vertexAttribPointer(0,4,i.FLOAT,!1,0,0),r.loadTextureEnabled(i,!0),t.gpuResourceCache.resourceForKey(this._sunImageSource).bind(t),i.drawArrays(i.POINTS,0,1)},o.prototype.endRendering=function(t){var e=t.currentGlContext;e.depthMask(!0),e.disableVertexAttribArray(0)},o.prototype.fetchStarData=function(){if(!this._loadStarted){this._loadStarted=!0;var t=this,i=new XMLHttpRequest;i.onload=function(){if(this.status>=200&&this.status<300)try{t._starData=JSON.parse(this.response),t.sendRedrawRequest()}catch(t){e.log(e.LEVEL_SEVERE,"StarFieldLayer unable to parse JSON for star data "+t.toString())}else e.log(e.LEVEL_SEVERE,"StarFieldLayer unable to fetch star data. Status: "+this.status+" "+this.statusText);t._loadStarted=!1},i.onerror=function(){e.log(e.LEVEL_SEVERE,"StarFieldLayer unable to fetch star data"),t._loadStarted=!1},i.ontimeout=function(){e.log(e.LEVEL_SEVERE,"StarFieldLayer fetch star data has timeout"),t._loadStarted=!1},i.open("GET",this._starDataSource,!0),i.send()}},o.prototype.createStarsGeometry=function(){var t=this.parseStarsMetadata(this._starData.metadata);if(-1===t.raIndex)throw new Error(e.logMessage(e.LEVEL_SEVERE,"StarFieldLayer","createStarsGeometry","Missing ra field in star data."));if(-1===t.decIndex)throw new Error(e.logMessage(e.LEVEL_SEVERE,"StarFieldLayer","createStarsGeometry","Missing dec field in star data."));if(-1===t.magIndex)throw new Error(e.logMessage(e.LEVEL_SEVERE,"StarFieldLayer","createStarsGeometry","Missing vmag field in star data."));var i=this._starData.data,r=[];this._minMagnitude=Number.MAX_VALUE,this._maxMagnitude=Number.MIN_VALUE;for(var n=0,o=i.length;n<o;n++){var s=i[n],a=s[t.decIndex],l=s[t.raIndex],h=s[t.magIndex],u=h<2?2:1;r.push(a,l,u,h),this._minMagnitude=Math.min(this._minMagnitude,h),this._maxMagnitude=Math.max(this._maxMagnitude,h)}return this._numStars=Math.floor(r.length/4),r},o.prototype.parseStarsMetadata=function(t){for(var e=-1,i=-1,r=-1,n=0,o=t.length;n<o;n++){var s=t[n];"ra"===s.name&&(e=n),"dec"===s.name&&(i=n),"vmag"===s.name&&(r=n)}return{raIndex:e,decIndex:i,magIndex:r}},o.prototype.invalidateStarData=function(){this._starData=null,this._starsPositionsVboCacheKey=null},o.prototype.sendRedrawRequest=function(){var t=document.createEvent("Event");t.initEvent(WorldWind.REDRAW_EVENT_TYPE,!0,!0),window.dispatchEvent(t)},o}),i("shapes/SurfaceCircle",["../error/ArgumentError","../geom/Location","../util/Logger","../shapes/ShapeAttributes","../shapes/SurfaceShape"],function(t,e,
115i,r,n){"use strict";var o=function(e,r,s){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"SurfaceCircle","constructor","missingLocation"));if(r<0)throw new t(i.logMessage(i.LEVEL_SEVERE,"SurfaceCircle","constructor","Radius is negative"));n.call(this,s),this._center=e,this._radius=r,this._intervals=o.DEFAULT_NUM_INTERVALS};return o.prototype=Object.create(n.prototype),Object.defineProperties(o.prototype,{center:{get:function(){return this._center},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._center=t}},radius:{get:function(){return this._radius},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._radius=t}},intervals:{get:function(){return this._intervals},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._intervals=t}}}),o.staticStateKey=function(t){return n.staticStateKey(t)+" ce "+t.center.toString()+" ra "+t.radius.toString()},o.prototype.computeStateKey=function(){return o.staticStateKey(this)},o.prototype.computeBoundaries=function(t){if(0===this.radius)return null;var i=1+Math.max(o.MIN_NUM_INTERVALS,this.intervals),r=360/(i-1),n=this.radius/t.globe.radiusAt(this.center.latitude,this.center.longitude);this._boundaries=new Array(i);for(var s=0;s<i;s++){var a=s!==i-1?s*r:0;this._boundaries[s]=e.greatCircleLocation(this.center,a,n,new e(0,0))}},o.prototype.getReferencePosition=function(){return this.center},o.prototype.moveTo=function(t,e){this.center=e},o.MIN_NUM_INTERVALS=8,o.DEFAULT_NUM_INTERVALS=64,o}),i("shapes/SurfaceEllipse",["../geom/Angle","../error/ArgumentError","../geom/Location","../util/Logger","../shapes/ShapeAttributes","../shapes/SurfaceShape","../util/WWMath"],function(t,e,i,r,n,o,s){"use strict";var a=function(t,i,n,s,l){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"SurfaceEllipse","constructor","missingLocation"));if(i<0||n<0)throw new e(r.logMessage(r.LEVEL_SEVERE,"SurfaceEllipse","constructor","Radius is negative."));o.call(this,l),this._center=t,this._majorRadius=i,this._minorRadius=n,this._heading=s,this._intervals=a.DEFAULT_NUM_INTERVALS};return a.prototype=Object.create(o.prototype),Object.defineProperties(a.prototype,{center:{get:function(){return this._center},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._center=t}},majorRadius:{get:function(){return this._majorRadius},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._majorRadius=t}},minorRadius:{get:function(){return this._minorRadius},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._minorRadius=t}},heading:{get:function(){return this._heading},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._heading=t}},intervals:{get:function(){return this._intervals},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._intervals=t}}}),a.staticStateKey=function(t){return o.staticStateKey(t)+" ce "+t.center.toString()+" ma "+t.majorRadius.toString()+" mi "+t.minorRadius.toString()+" he "+t.heading.toString()+" in "+t.intervals.toString()},a.prototype.computeStateKey=function(){return a.staticStateKey(this)},a.prototype.computeBoundaries=function(e){if(0==this.majorRadius&&0==this.minorRadius)return null;var r=e.globe,n=1+Math.max(a.MIN_NUM_INTERVALS,this.intervals),o=2*Math.PI/(n-1),l=r.radiusAt(this.center.latitude,this.center.longitude);this._boundaries=new Array(n);for(var h=0;h<n;h++){var u=h!=n-1?h*o:0,c=this.majorRadius*Math.cos(u),d=this.minorRadius*Math.sin(u),f=Math.sqrt(c*c+d*d),p=Math.PI/2-(Math.acos(c/f)*s.signum(d)-this.heading*t.DEGREES_TO_RADIANS);this._boundaries[h]=i.greatCircleLocation(this.center,p*t.RADIANS_TO_DEGREES,f/l,new i(0,0))}},a.prototype.getReferencePosition=function(){return this.center},a.prototype.moveTo=function(t,e){this.center=e},a.MIN_NUM_INTERVALS=8,a.DEFAULT_NUM_INTERVALS=64,a}),i("shapes/SurfaceRectangle",["../geom/Angle","../error/ArgumentError","../geom/Location","../util/Logger","../shapes/ShapeAttributes","../shapes/SurfaceShape","../util/WWMath"],function(t,e,i,r,n,o,s){"use strict";var a=function(t,i,n,s,a){if(!t)throw new e(r.logMessage(r.LEVEL_SEVERE,"SurfaceRectangle","constructor","missingLocation"));if(i<0||n<0)throw new e(r.logMessage(r.LEVEL_SEVERE,"SurfaceRectangle","constructor","Size is negative."));
115o.call(this,a),this._center=t,this._width=i,this._height=n,this._heading=s};return a.prototype=Object.create(o.prototype),Object.defineProperties(a.prototype,{center:{get:function(){return this._center},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._center=t}},width:{get:function(){return this._width},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._width=t}},height:{get:function(){return this._height},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._height=t}},heading:{get:function(){return this._heading},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._heading=t}}}),a.staticStateKey=function(t){return o.staticStateKey(t)+" ce "+t.center.toString()+" wi "+t.width.toString()+" he "+t.height.toString()+" hd "+t.heading.toString()},a.prototype.computeStateKey=function(){return a.staticStateKey(this)},a.prototype.computeBoundaries=function(t){var e=.5*this.width,i=.5*this.height,r=t.globe.radiusAt(this.center.latitude,this.center.longitude);this._boundaries=new Array(4),this.addLocation(0,-e,-i,r),this.addLocation(1,e,-i,r),this.addLocation(2,e,i,r),this.addLocation(3,-e,i,r)},a.prototype.addLocation=function(e,r,n,o){var a=Math.sqrt(r*r+n*n),l=Math.PI/2-(Math.acos(r/a)*s.signum(n)-this.heading*t.DEGREES_TO_RADIANS);this._boundaries[e]=i.greatCircleLocation(this.center,l*t.RADIANS_TO_DEGREES,a/o,new i(0,0))},a.prototype.getReferencePosition=function(){return this.center},a.prototype.moveTo=function(t,e){this.center=this.computeShiftedLocations(t,this.getReferencePosition(),e,[this.center])[0]},a}),i("render/SurfaceRenderable",["../util/Logger","../error/UnsupportedOperationError"],function(t,e){"use strict";var i=function(){throw this.displayName="Renderable",this.enabled=!0,new e(t.logMessage(t.LEVEL_SEVERE,"SurfaceRenderable","constructor","abstractInvocation"))};return i.prototype.renderSurface=function(i){throw new e(t.logMessage(t.LEVEL_SEVERE,"SurfaceRenderable","renderSurface","abstractInvocation"))},i}),i("shapes/SurfaceSector",["../error/ArgumentError","../geom/Location","../util/Logger","../shapes/ShapeAttributes","../shapes/SurfaceShape"],function(t,e,i,r,n){"use strict";var o=function(e,r){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"SurfaceSector","constructor","missingSector"));n.call(this,r),this._sector=e};return o.prototype=Object.create(n.prototype),Object.defineProperties(o.prototype,{sector:{get:function(){return this._sector},set:function(t){this.stateKeyInvalid=!0,this.resetBoundaries(),this._sector=t}}}),o.staticStateKey=function(t){return n.staticStateKey(t)},o.prototype.computeStateKey=function(){return o.staticStateKey(this)},o.prototype.computeBoundaries=function(t){var i=this._sector;this._boundaries=new Array(4),this._boundaries[0]=new e(i.minLatitude,i.minLongitude),this._boundaries[1]=new e(i.maxLatitude,i.minLongitude),this._boundaries[2]=new e(i.maxLatitude,i.maxLongitude),this._boundaries[3]=new e(i.minLatitude,i.maxLongitude)},o}),i("layer/TectonicPlatesLayer",["../error/ArgumentError","../util/Color","../geom/Location","../util/Logger","../layer/RenderableLayer","../shapes/ShapeAttributes","../shapes/SurfacePolygon"],function(t,e,i,r,n,o,s){"use strict";var a=function(t){n.call(this,"Tectonic Plates"),t?this._attributes=t:(this._attributes=new o(null),this._attributes.drawInterior=!1,this._attributes.drawOutline=!0,this._attributes.outlineColor=e.RED),this.loadPlateData()};return a.prototype=Object.create(n.prototype),Object.defineProperties(a.prototype,{attributes:{get:function(){return this._attributes},set:function(t){t&&this.renderables.map(function(e,i,r){e.attributes=t})}}}),a.prototype.loadPlateData=function(){var t=WorldWind.configuration.baseUrl+"images/TectonicPlates.json",e=new XMLHttpRequest;e.open("GET",t,!0),e.onreadystatechange=function(){4===e.readyState&&(200===e.status?this.parse(e.responseText):r.log(r.LEVEL_WARNING,"Tectonic plate data retrieval failed ("+e.statusText+"): "+t))}.bind(this),e.onerror=function(){r.log(r.LEVEL_WARNING,"Tectonic plate data retrieval failed: "+t)},e.ontimeout=function(){r.log(r.LEVEL_WARNING,"Tectonic plate data retrieval timed out: "+t)},e.send(null)},a.prototype.parse=function(t){var e=JSON.parse(t),r=this;e.features.map(function(t,e,n){var o=[];t.geometry.coordinates.map(function(t,e,r){o.push(new i(t[1],t[0]))});var a=new s(o,r._attributes);r.addRenderable(a)})},a}),i("util/TileFactory",["../util/Logger","../error/UnsupportedOperationError"],function(t,e){"use strict";var i=function(){};return i.prototype.createTile=function(i,r,n,o){throw new e(t.logMessage(t.LEVEL_SEVERE,"TileFactory","createTile","abstractInvocation"))},i}
115),i("shapes/TriangleMesh",["../shapes/AbstractMesh","../error/ArgumentError","../shaders/BasicTextureProgram","../geom/BoundingBox","../util/Color","../util/ImageSource","../geom/Location","../util/Logger","../geom/Matrix","../pick/PickedObject","../geom/Position","../shapes/ShapeAttributes","../shapes/SurfacePolygon","../geom/Vec2","../geom/Vec3"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p){"use strict";var g=function(i,r,n){if(!i)throw new e(a.logMessage(a.LEVEL_SEVERE,"TriangleMesh","constructor","missingPositions"));if(i.length<1)throw new e(a.logMessage(a.LEVEL_SEVERE,"TriangleMesh","constructor","missingPositions"));if(i.length>65536)throw new e(a.logMessage(a.LEVEL_SEVERE,"TriangleMesh","constructor","Too many positions. Must be fewer than 65537. Use TriangleMesh.split to split the shape."));if(!r)throw new e(a.logMessage(a.LEVEL_SEVERE,"TriangleMesh","constructor","Indices array is null or undefined"));if(r.length<3)throw new e(a.logMessage(a.LEVEL_SEVERE,"TriangleMesh","constructor","Too few indices."));t.call(this,n),this._positions=i,this._indices=r,this.referencePosition=this._positions[0]};return g.prototype=Object.create(t.prototype),Object.defineProperties(g.prototype,{positions:{get:function(){return this._positions},set:function(t){if(!t)throw new e(a.logMessage(a.LEVEL_SEVERE,"TriangleMesh","positions","missingPositions"));this._positions=t,this.referencePosition=this._positions[0],this.reset()}},indices:{get:function(){return this._indices},set:function(t){if(!t)throw new e(a.logMessage(a.LEVEL_SEVERE,"TriangleMesh","indices","Indices array is null or undefined"));this._indices=t,this.meshIndices=null,this.reset()}},outlineIndices:{get:function(){return this._outlineIndices},set:function(t){this._outlineIndices=t,this.meshOutlineIndices=null,this.reset()}},textureCoordinates:{get:function(){return this._textureCoordinates},set:function(t){if(t&&t.length!=this._positions.length)throw new e(a.logMessage(a.LEVEL_SEVERE,"TriangleMesh","textureCoordinates","Number of texture coordinates is inconsistent with the currently specified positions."));this._textureCoordinates=t,this.reset(),this.texCoords=null}}}),g.prototype.createSurfaceShape=function(){if(this._outlineIndices){for(var t=[],e=0;e<this._outlineIndices.length;e++)t.push(this._positions[this._outlineIndices[e]]);return new d(t,null)}return null},g.prototype.computeMeshPoints=function(t,e){ 116for(var i,r,n=Number.MAX_VALUE,o=t.eyePoint,s=new Float32Array(3*this._positions.length),a=new p(0,0,0),l=0,h=0;h<this._positions.length;h++)i=this._positions[h],t.surfacePointForMode(i.latitude,i.longitude,i.altitude*this._altitudeScale,this.altitudeMode,a),r=a.distanceToSquared(o),r<n&&(n=r),a.subtract(this.currentData.referencePoint),s[l++]=a[0],s[l++]=a[1],s[l++]=a[2];return e.eyeDistance=Math.sqrt(n),s},g.prototype.computeTexCoords=function(){if(this._textureCoordinates){for(var t=new Float32Array(2*this._textureCoordinates.length),e=0,i=0,r=this._textureCoordinates.length;i<r;i++){var n=this._textureCoordinates[i];t[e++]=n[0],t[e++]=n[1]}return t}return null},g.prototype.computeMeshIndices=function(){for(var t=new Uint16Array(this._indices.length),e=0,i=this._indices.length;e<i;e++)t[e]=this._indices[e];return t},g.prototype.computeOutlineIndices=function(){if(this._outlineIndices){for(var t=new Uint16Array(this._outlineIndices.length),e=0;e<this._outlineIndices.length;e++)t[e]=this._outlineIndices[e];return t}return null},g.split=function(t,e,i,r){for(var n,o,s=[],a=[],l=[],h=[],u=[],c=0;c<=e.length;c++){if(c===e.length||s.length>65533&&l.length%3==0){if(s.length>0){var d={positions:s,indices:l};if(i&&(d.textureCoords=a),r){for(var f=[],p=0;p<r.length;p++)n=r[p],(o=h[n])&&f.push(h[r[p]]);d.outlineIndices=f}u.push(d)}if(c===e.length)break;s=[],l=[],h=[]}n=e[c],o=h[n],o||(o=s.length,h[n]=o,s.push(t[n]),i&&a.push(i[n])),l.push(o)}return u},g}),i("layer/ViewControlsLayer",["../geom/Angle","../error/ArgumentError","../layer/Layer","../geom/Location","../util/Logger","../util/Offset","../shapes/ScreenImage","../geom/Vec2"],function(t,e,i,r,n,o,s,a){"use strict";var l=function(t){if(!t)throw new e(n.logMessage(n.LEVEL_SEVERE,"ViewControl
116sLayer","constructor","missingWorldWindow"));i.call(this,"View Controls"),this.wwd=t,this.placement=new o(WorldWind.OFFSET_PIXELS,11,WorldWind.OFFSET_PIXELS,11),this.alignment=new o(WorldWind.OFFSET_FRACTION,0,WorldWind.OFFSET_FRACTION,0),this.exaggerationIncrement=.01,this.zoomIncrement=.04,this.headingIncrement=1,this.tiltIncrement=1,this.fieldOfViewIncrement=.1,this.panIncrement=.001,this._inactiveOpacity=.5,this._activeOpacity=1;var r=new o(WorldWind.OFFSET_PIXELS,0,WorldWind.OFFSET_PIXELS,0),l=WorldWind.configuration.baseUrl+"images/view/";this.panControl=new s(r.clone(),l+"view-pan-64x64.png"),this.zoomInControl=new s(r.clone(),l+"view-zoom-in-32x32.png"),this.zoomOutControl=new s(r.clone(),l+"view-zoom-out-32x32.png"),this.headingLeftControl=new s(r.clone(),l+"view-heading-left-32x32.png"),this.headingRightControl=new s(r.clone(),l+"view-heading-right-32x32.png"),this.tiltUpControl=new s(r.clone(),l+"view-pitch-up-32x32.png"),this.tiltDownControl=new s(r.clone(),l+"view-pitch-down-32x32.png"),this.exaggerationUpControl=new s(r.clone(),l+"view-elevation-up-32x32.png"),this.exaggerationDownControl=new s(r.clone(),l+"view-elevation-down-32x32.png"),this.fovNarrowControl=new s(r.clone(),l+"view-fov-narrow-32x32.png"),this.fovWideControl=new s(r.clone(),l+"view-fov-wide-32x32.png"),this.fovNarrowControl.enabled=!1,this.fovWideControl.enabled=!1,this.controls=[this.panControl,this.zoomInControl,this.zoomOutControl,this.headingLeftControl,this.headingRightControl,this.tiltUpControl,this.tiltDownControl,this.exaggerationUpControl,this.exaggerationDownControl,this.fovNarrowControl,this.fovWideControl];for(var h=0;h<this.controls.length;h++)this.controls[h].imageOffset=r.clone(),this.controls[h].opacity=this._inactiveOpacity,this.controls[h]===this.panControl?this.controls[h].size=64:this.controls[h].size=32;this.panControlCenter=new a(0,0),this.pickEnabled=!1,this.wwd.worldWindowController.addGestureListener(this)};return l.prototype=Object.create(i.prototype),Object.defineProperties(l.prototype,{showPanControl:{get:function(){return this.panControl.enabled},set:function(t){this.panControl.enabled=t}},showZoomControl:{get:function(){return this.zoomInControl.enabled},set:function(t){this.zoomInControl.enabled=t,this.zoomOutControl.enabled=t}},showHeadingControl:{get:function(){return this.headingLeftControl.enabled},set:function(t){this.headingLeftControl.enabled=t,this.headingRightControl.enabled=t}},showTiltControl:{get:function(){return this.tiltUpControl.enabled},set:function(t){this.tiltUpControl.enabled=t,this.tiltDownControl.enabled=t}},showExaggerationControl:{get:function(){return this.exaggerationUpControl.enabled},set:function(t){this.exaggerationUpControl.enabled=t,this.exaggerationDownControl.enabled=t}},showFieldOfViewControl:{get:function(){return this.fovNarrowControl.enabled},set:function(t){this.fovNarrowControl.enabled=t,this.fovWideControl.enabled=t}},inactiveOpacity:{get:function(){return this._inactiveOpacity},set:function(t){this._inactiveOpacity=t;for(var e=0;e<this.controls.length;e++)this.controls[e].opacity=t}},activeOpacity:{get:function(){return this._activeOpacity},set:function(t){this._activeOpacity=t;for(var e=0;e<this.controls.length;e++)this.controls[e].opacity=t}}}),l.prototype.doRender=function(t){var e,i,r,n,o=0;this.inCurrentFrame=!1,this.showPanControl&&(o+=this.panControl.size,this.inCurrentFrame=!0),this.showZoomControl&&(o+=this.zoomInControl.size,this.inCurrentFrame=!0),this.showHeadingControl&&(o+=this.headingLeftControl.size,this.inCurrentFrame=!0),this.showTiltControl&&(o+=this.tiltDownControl.size,this.inCurrentFrame=!0),this.showExaggerationControl&&(o+=this.exaggerationDownControl.size,this.inCurrentFrame=!0),this.showFieldOfViewControl&&(o+=this.fovNarrowControl.size,this.inCurrentFrame=!0),i=this.placement.offsetForSize(t.viewport.width,t.viewport.height),e=this.alignment.offsetForSize(o,64),r=i[0]-e[0],n=i[1]-e[1],this.showPanControl&&(this.panControl.screenOffset.x=r,this.panControl.screenOffset.y=n,this.panControl.render(t),this.panControlCenter[0]=r+this.panControl.size/2,this.panControlCenter[1]=n+this.panControl.size/2,r+=this.panControl.size),this.showZoomControl&&(this.zoomOutControl.screenOffset.x=r,this.zoomOutControl.screenOffset.y=n,this.zoomInControl.screenOffset.x=r,this.zoomInControl.screenOffset.y=n+this.zoomOutControl.size,this.zoomOutControl.render(t),this.zoomInControl.render(t),r+=this.zoomOutControl.size),this.showHeadingControl&&(this.headingRightControl.screenOffset.x=r,this.headingRightControl.screenOffset.y=n,this.headingLeftControl.screenOffset.x=r,this.headingLeftControl.screenOffset.y=n+this.headingLeftControl.size,this.headingRightControl.render(t),this.headingLeftControl.render(t),r+=this.headingLeftControl.size),this.showTiltControl&&(this.tiltDownControl.screenOffset.x=r,this.tiltDownControl.screenOffset.y=n,this.tiltUpControl.screenOffset.x=r,this.tiltUpControl.screenOffset.y=n+this.tiltDownControl.size,this.tiltDownControl.render(t),this.tiltUpControl.render(t),r+=this.tiltDownControl.size),this.showExaggerationControl&&(this.exaggerationDownControl.screenOffset.x=r,this.exaggerationDownControl.screenOffset.y=n,this.exaggerationUpControl.screenOffset.x=r,this.exaggerationUpControl.screenOffset.y=n+this.exaggerationDownControl.size,this.exaggerationUpControl.render(t),this.exaggerationDownControl.render(t),r+=this.exaggerationDownControl.size),this.show
116FieldOfViewControl&&(this.fovNarrowControl.screenOffset.x=r,this.fovNarrowControl.screenOffset.y=n,this.fovWideControl.screenOffset.x=r,this.fovWideControl.screenOffset.y=n+this.fovNarrowControl.size,this.fovNarrowControl.render(t),this.fovWideControl.render(t))},l.prototype.isPointerDown=function(t){return"pointerdown"===t.type||"mousedown"===t.type&&1===t.which},l.prototype.isPointerUp=function(t){return"pointerup"===t.type||"mouseup"===t.type&&1===t.which},l.prototype.isPointerMove=function(t){return"pointermove"===t.type||"mousemove"===t.type},l.prototype.isTouchStart=function(t){return"touchstart"===t.type},l.prototype.isTouchEnd=function(t){return"touchend"===t.type||"touchcancel"===t.type},l.prototype.isTouchMove=function(t){return"touchmove"===t.type},l.prototype.onGestureEvent=function(t){var e,i=!1;if(!this.enabled)return i;this.highlightedControl&&(this.highlight(this.highlightedControl,!1),this.wwd.redraw());var r=!1;if(t.type&&this.activeControl&&(this.isPointerUp(t)?r=!0:this.isTouchEnd(t)&&this.isCurrentTouch(t)?r=!0:(e=this.pickControl(t),this.activeControl!==e&&(r=!0))),r)this.activeControl=null,this.activeOperation=null,t.preventDefault();else{if(this.activeOperation)i=this.activeOperation.call(this,t,null),t.preventDefault();else if(e=this.pickControl(t)){var n=this.determineOperation(t,e);n&&(i=n.call(this,t,e))}this.handleHighlight(t,e),this.wwd.redraw()}return i},l.prototype.isControl=function(t){for(var e=0;e<this.controls.length;e++)if(this.controls[e]==t)return!0;return!1},l.prototype.pickControl=function(t){var e,i;if(t.changedTouches){var r=t.changedTouches.item(0);e=r.clientX,i=r.clientY}else e=t.clientX,i=t.clientY;for(var n,o=this.wwd.canvasCoordinates(e,i),s=o[0],a=this.wwd.canvas.height-o[1],l=0;l<this.controls.length;l++)if(n=this.controls[l],n.enabled&&s>=n.screenOffset.x&&s<=n.screenOffset.x+n.size&&a>=n.screenOffset.y&&a<=n.screenOffset.y+n.size)return n;return null},l.prototype.determineOperation=function(t,e){var i=null;return e&&e instanceof s&&(e===this.panControl?i=this.handlePan:e===this.zoomInControl||e===this.zoomOutControl?i=this.handleZoom:e===this.headingLeftControl||e===this.headingRightControl?i=this.handleHeading:e===this.tiltUpControl||e===this.tiltDownControl?i=this.handleTilt:e===this.exaggerationUpControl||e===this.exaggerationDownControl?i=this.handleExaggeration:e!==this.fovNarrowControl&&e!==this.fovWideControl||(i=this.handleFov)),i},l.prototype.isCurrentTouch=function(t){for(var e=0;e<t.changedTouches.length;e++)if(t.changedTouches.item(e).identifier===this.currentTouchId)return!0;return!1},l.prototype.handlePan=function(e,i){var n=!1;if(this.isPointerDown(e)||this.isPointerMove(e))this.currentEventPoint=this.wwd.canvasCoordinates(e.clientX,e.clientY);else if(this.isTouchStart(e)||this.isTouchMove(e)){var o=e.changedTouches.item(0);this.currentEventPoint=this.wwd.canvasCoordinates(o.clientX,o.clientY)}if(this.isPointerDown(e)||this.isTouchStart(e)){this.activeControl=i,this.activeOperation=this.handlePan,e.preventDefault(),this.isTouchStart(e)&&(this.currentTouchId=e.changedTouches.item(0).identifier);var s=this,a=function(){if(s.activeControl){var e=s.panControlCenter[0]-s.currentEventPoint[0],i=s.panControlCenter[1]-(s.wwd.viewport.height-s.currentEventPoint[1]),n=s.wwd.navigator.lookAtLocation.latitude,o=s.wwd.navigator.lookAtLocation.longitude,l=s.panIncrement*(s.wwd.navigator.range/s.wwd.globe.radiusAt(n,o)),h=s.wwd.navigator.heading+Math.atan2(e,i)*t.RADIANS_TO_DEGREES,u=l*Math.sqrt(e*e+i*i);r.greatCircleLocation(s.wwd.navigator.lookAtLocation,h,-u,s.wwd.navigator.lookAtLocation),s.wwd.redraw(),setTimeout(a,50)}};setTimeout(a,50),n=!0}return n},l.prototype.handleZoom=function(t,e){var i=!1;if(this.isPointerDown(t)||this.isTouchStart(t)){this.activeControl=e,this.activeOperation=this.handleZoom,t.preventDefault(),this.isTouchStart(t)&&(this.currentTouchId=t.changedTouches.item(0).identifier);var r=this,n=function(){r.activeControl&&(r.activeControl===r.zoomInControl?r.wwd.navigator.range*=1-r.zoomIncrement:r.activeControl===r.zoomOutControl&&(r.wwd.navigator.range*=1+r.zoomIncrement),r.wwd.redraw(),setTimeout(n,50))};setTimeout(n,50),i=!0}return i},l.prototype.handleHeading=function(t,e){var i=!1;if(this.isPointerDown(t)||this.isTouchStart(t)){this.activeControl=e,this.activeOperation=this.handleHeading,t.preventDefault(),this.isTouchStart(t)&&(this.currentTouchId=t.changedTouches.item(0).identifier);var r=this,n=function(){r.activeControl&&(r.activeControl===r.headingLeftControl?r.wwd.navigator.heading+=r.headingIncrement:r.activeControl===r.headingRightControl&&(r.wwd.navigator.heading-=r.headingIncrement),r.wwd.redraw(),setTimeout(n,50))};setTimeout(n,50),i=!0}return i},l.prototype.handleTilt=function(t,e){var i=!1;if(this.isPointerDown(t)||this.isTouchStart(t)){this.activeControl=e,this.activeOperation=this.handleTilt,t.preventDefault(),this.isTouchStart(t)&&(this.currentTouchId=t.changedTouches.item(0).identifier);var r=this,n=function(){r.activeControl&&(r.activeControl===r.tiltUpControl?r.wwd.navigator.tilt=Math.max(0,r.wwd.navigator.tilt-r.tiltIncrement):r.activeControl===r.tiltDownControl&&(r.wwd.navigator.tilt=Math.min(90,r.wwd.navigator.tilt+r.tiltIncrement)),r.wwd.redraw(),setTimeout(n,50))};setTimeout(n,50),i=!0}return i},l.prototype.handleExaggeration=function(t,e){var i=!1;if(this.isPointerDown(t)||this.isTouchStart(t)){this.activeControl=e,this.activeOperation=this.handleExaggeration,t.preventDefault(),this.isTouchStart(t)&&(this.currentTouchId=t.changedTouches.item(0).identifier);var r=this,n=function(){r.activeControl&&(r.activeControl===r.exaggerationUpControl?r.wwd.verticalExaggeration+=r.exaggerationIncrement:r.activeControl===r.exaggerationDownControl&&(r.wwd.verticalExaggeration=Math.max(1,r.wwd.verticalExaggeration-r.exaggerationIncrement)),r.wwd.redraw(),setTimeout(n,50))};setTimeout(n,50),i=!0}return i},l.prototype.handleFov=function(t,e){var i=!1;if(this.isPointerDown(t)||this.isTouchStart(t)){this.activeControl=e,this.activeOperation=this.handleFov,t.preventDefault(),this.isTouchStart(t)&&(this.currentTouchId=t.changedTouches.item(0).identifier);var r=this,n=function(){r.activeControl&&(r.activeControl===r.fovWi
116deControl?r.wwd.navigator.fieldOfView=Math.max(90,r.wwd.navigator.fieldOfView+r.fieldOfViewIncrement):r.activeControl===r.fovNarrowControl&&(r.wwd.navigator.fieldOfView=Math.min(0,r.wwd.navigator.fieldOfView-r.fieldOfViewIncrement)),r.wwd.redraw(),setTimeout(n,50))};setTimeout(n,50),i=!0}return i},l.prototype.handleHighlight=function(t,e){this.activeControl?this.highlight(this.activeControl,!0):e&&this.isControl(e)&&this.highlight(e,!0)},l.prototype.highlight=function(t,e){t.opacity=e?this._activeOpacity:this._inactiveOpacity,this.highlightedControl=e?t:null},l}),i("ogc/ows/OwsBoundingBox",["../../error/ArgumentError","../../util/Logger","../../geom/Sector"],function(t,e,i){"use strict";var r=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsBoundingBox","constructor","missingDomElement"));this.assembleElement(i)};return r.prototype.assembleElement=function(t){this.crs="WGS84BoundingBox"===t.localName?"WGS84":t.getAttribute("crs"),this.dimensions=t.getAttribute("dimensions");for(var e=t.children||t.childNodes,i=0;i<e.length;i++){var r=e[i];"LowerCorner"===r.localName?this.lowerCorner=r.textContent:"UpperCorner"===r.localName&&(this.upperCorner=r.textContent)}},r.prototype.getSector=function(){var t,e,r,n,o;return-1!==this.crs.indexOf("WGS84")||-1!==this.crs.indexOf("EPSG:4326")?(o=this.lowerCorner.split(/\s+/),e=o[0],t=o[1],o=this.upperCorner.split(/\s+/),n=o[0],r=o[1],new i(t,r,e,n)):null},r}),i("ogc/ows/OwsKeywords",["../../error/ArgumentError","../../util/Logger","../../ogc/ows/OwsLanguageString"],function(t,e,i){"use strict";return function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsKeywords","constructor","missingDomElement"));for(var n=r.children||r.childNodes,o=0;o<n.length;o++){var s=n[o];"keyword"===s.localName&&(this.keywords=this.keywords||[],this.keywords.push(new i(s)))}}}),i("ogc/ows/OwsDatasetSummary",["../../error/ArgumentError","../../util/Logger","../../ogc/ows/OwsBoundingBox","../../ogc/ows/OwsKeywords","../../ogc/ows/OwsLanguageString"],function(t,e,i,r,n){"use strict";var o=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"OwsDatasetSummary","constructor","missingDomElement"));this.assembleElement(i)};return o.prototype.assembleElement=function(t){for(var e=t.children||t.childNodes,o=0;o<e.length;o++){var s=e[o];"Title"===s.localName?(this.titles=this.titles||[],this.titles.push(new n(s))):"Abstract"===s.localName?(this.abstracts=this.abtracts||[],this.abstracts.push(new n(s))):"Keywords"===s.localName?(this.keywords=this.keywords||[],this.keywords.push(new r(s))):"Identifier"===s.localName?this.identifier=s.textContent:"WGS84BoundingBox"===s.localName?this.wgs84BoundingBox=new i(s):"BoundingBox"===s.localName?(this.boundingBox=this.boundingBox||[],this.boundingBox.push(new i(s))):"OutputFormat"===s.localName?(this.outputFormat=this.outputFormat||[],this.outputFormat.push(s.textContent)):"AvailableCRS"===s.localName&&(this.availableCrs=this.availableCrs||[],this.availableCRS.push(s.textContent))}},o}),i("ogc/wcs/WcsCapabilities",["../../error/ArgumentError","../../util/Logger","../../ogc/ows/OwsDatasetSummary","../../ogc/ows/OwsKeywords","../../ogc/ows/OwsOperationsMetadata","../../ogc/ows/OwsServiceIdentification","../../ogc/ows/OwsServiceProvider"],function(t,e,i,r,n,o,s){"use strict";var a=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsCapabilities","constructor","missingDom"));this.xmlDom=i,this.assembleDocument()};return a.prototype.getCoverageBaseUrl=function(){return"1.0.0"===this.version?this.capability.request.getCoverage.get:"2.0.1"===this.version||"2.0.0"===this.version?this.operationsMetadata.getOperationMetadataByName("GetCoverage").dcp[0].getMethods[0].url:null},a.prototype.assembleDocument=function(){var i=this.xmlDom.documentElement;if(this.version=i.getAttribute("version"),this.updateSequence=i.getAttribute("updateSequence"),"1.0.0"===this.version)this.assembleDocument100(i);else{if("2.0.0"!==this.version&&"2.0.1"!==this.version)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsCapabilities","assembleDocument","unsupportedVersion"));this.assembleDocument20x(i)}},a.prototype.assembleDocument100=function(t){for(var e=t.children||t.childNodes,i=0;i<e.length;i++){var r=e[i];"Service"===r.localName?this.service=this.assembleService100(r):"Capability"===r.localName?this.capability=this.assemble
116Capability100(r):"ContentMetadata"===r.localName&&this.assembleContents100(r)}},a.prototype.assembleDocument20x=function(t){for(var e=t.children||t.childNodes,i=0;i<e.length;i++){var r=e[i];"ServiceIdentification"===r.localName?this.serviceIdentification=new o(r):"ServiceProvider"===r.localName?this.serviceProvider=new s(r):"OperationsMetadata"===r.localName?this.operationsMetadata=new n(r):"ServiceMetadata"===r.localName?this.serviceMetadata=this.assembleServiceMetadata(r):"Contents"===r.localName&&this.assembleContents20x(r)}},a.prototype.assembleContents100=function(t){for(var e=t.children||t.childNodes,i=0;i<e.length;i++){var r=e[i];"CoverageOfferingBrief"===r.localName&&(this.coverages=this.coverages||[],this.coverages.push(this.assembleCoverages100(r)))}},a.prototype.assembleContents20x=function(t){for(var e,r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];"CoverageSummary"===o.localName&&(e=new i(o),this.assembleDatasetAugment20x(o,e),this.coverages=this.coverages||[],this.coverages.push(e))}},a.prototype.assembleDatasetAugment20x=function(t,e){for(var i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"CoverageId"===n.localName?e.coverageId=n.textContent:"CoverageSubtype"===n.localName&&(e.subType=e.subType||[],e.subType.push(n.textContent))}},a.prototype.assembleCoverages100=function(t){for(var e=t.children||t.childNodes,i={},n=0;n<e.length;n++){var o=e[n];"name"===o.localName?i.name=o.textContent:"description"===o.localName?i.description=o.textContent:"label"===o.localName?i.label=o.textContent:"Keywords"===o.localName?(i.keywords=i.keywords||[],i.keywords.push(new r(o))):"lonLatEnvelope"===o.localName&&(i.wgs84BoundingBox=this.assembleLatLonBoundingBox(o))}return i},a.prototype.assembleService100=function(t){for(var e=t.children||t.childNodes,i={},n=0;n<e.length;n++){var o=e[n];"description"===o.localName?i.description=o.textContent:"name"===o.localName?i.name=o.textContent:"label"===o.localName?i.label=o.textContent:"fees"===o.localName?i.fees=o.textContent:"accessConstraints"===o.localName?(i.accessConstraints=i.accessConstraints||[],i.accessConstraints.push(o.textContent)):"Keywords"===o.localName&&(i.keywords=new r(o))}return i},a.prototype.assembleCapability100=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];"Request"===n.localName?i.request=this.assembleRequestCapabilities100(n):"Exception"===n.localName&&(n=n.children||n.childNodes,n=n[0],i.exception=i.exception||[],i.exception.push(n.textContent))}return i},a.prototype.assembleRequestCapabilities100=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];"GetCapabilities"===n.localName?i.getCapabilities=this.assembleDCPType100(n):"DescribeCoverage"===n.localName?i.describeCoverage=this.assembleDCPType100(n):"GetCoverage"===n.localName&&(i.getCoverage=this.assembleDCPType100(n))}return i},a.prototype.assembleDCPType100=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];"DCPType"===n.localName&&this.assembleHttp100(n,i)}return i},a.prototype.assembleHttp100=function(t,e){for(var i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];if("HTTP"===n.localName)return this.assembleMethod100(n,e)}},a.prototype.assembleMethod100=function(t,e){for(var i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Get"===n.localName?e.get=this.assembleOnlineResource100(n):"Post"===n.localName&&(e.post=this.assembleOnlineResource100(n))}},a.prototype.assembleOnlineResource100=function(t){for(var e=t.children||t.childNodes,i=0;i<e.length;i++){var r=e[i];if("OnlineResource"===r.localName)return r.getAttribute("xlink:href")}},a.prototype.assembleLatLonBoundingBox=function(t){for(var e,i,r,n=t.children||t.childNodes,o={},s=0;s<n.length;s++){var a=n[s];"pos"===a.localName&&(e?(r=parseFloat(a.textContent.split(/\s+/)[0]),i<r?(o.lowerCorner=e,o.upperCorner=a.textContent):(o.lowerCorner=a.textContent,o.upperCorner=e)):(e=a.textContent,i=parseFloat(e.split(/\s+/)[0])))}return o},a.prototype.assembleServiceMetadata=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];"formatSupported"===n.localName?(i.formatsSupported=i.formatsSupported||[],i.formatsSupported.push(n.textContent)):"Extension"===n.localName&&(i.extension=this.assembleServiceMetadataExtension(n))}return i},a.prototype.assembleServiceMetadataExtension=function(t){for(var e=t.children||t.childNodes,i=e.length,r={},n=0;n<i;n++){var o=e[n];"crsSupported"===o.localName?(r.crsSupported=r.crsSupported||[],r.crsSupported.push(o.textContent)):"interpolationSupported"===o.localName&&(r.interpolationSupported=r.interpolationSupported||[],r.interpolationSupported.push(o.textContent))}return r},a}),i("ogc/wcs/WcsUrlBuilder",["../../error/ArgumentError","../../util/Logger"],function(t,e){"use strict";var i=function(i,r){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsUrlBuilder","constructor","missingId"));if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsUrlBuilder","constructor","missingWebCoverageService"));this.coverageId=i,this.service=r};return i.prototype.urlForTile=function(i,r){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsUrlBuilder","urlForTile","missingTile"));if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsUrlBuilder","urlForTile","The specified format is null or undefined."));var n=this.service.capabilities.version,o=this.fixGetCoverageString(this.service.capabilities.getCoverageBaseUrl());return o+="SERVICE=WCS",o+="&REQUEST=GetCoverage","1.0.0"===n?this.buildUrl100(i,r,o):"2.0.1"===n||"2.0.0"===n?this.buildUrl20x(i,r,o):void 0}
116,i.prototype.buildUrl100=function(t,e,i){var r=t.sector;return i+="&VERSION=1.0.0",i+="&COVERAGE="+this.coverageId,i+="&CRS=EPSG:4326",i+="&WIDTH="+t.tileWidth,i+="&HEIGHT="+t.tileHeight,i+="&FORMAT="+e,i+="&BBOX="+r.minLongitude+","+r.minLatitude+","+r.maxLongitude+","+r.maxLatitude,encodeURI(i)},i.prototype.buildUrl20x=function(t,e,i){for(var r,n,o,s,a,l=t.sector,h=0,u=this.service.coverageDescriptions.coverages.length;h<u;h++)if(this.coverageId===this.service.coverageDescriptions.coverages[h].coverageId){o=this.service.coverageDescriptions.coverages[h];break}return s=o.domainSet.rectifiedGrid.axisLabels,a=o.boundedBy.envelope.axisLabels,a[0].toLowerCase().indexOf("lat")>=0?(r=a[0],n=a[1]):(r=a[1],n=a[0]),i+="&VERSION="+this.service.capabilities.version,i+="&COVERAGEID="+this.coverageId,i+="&FORMAT="+e,i+="&SCALESIZE="+s[0]+"("+t.tileWidth+"),",i+=s[1]+"("+t.tileHeight+")",i+="&OVERVIEWPOLICY=NEAREST",i+="&SUBSET="+r+"("+l.minLatitude+","+l.maxLatitude+")",i+="&SUBSET="+n+"("+l.minLongitude+","+l.maxLongitude+")",encodeURI(i)},i.prototype.fixGetCoverageString=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WmsUrlBuilder","fixGetMapString","The specified service address is null or undefined."));var r=i.indexOf("?");return r<0?i+="?":r!==i.length-1&&(r=i.search(/&$/))<0&&(i+="&"),i},i}),i("ogc/wcs/WcsCoverage",["../../error/ArgumentError","../../util/Logger","../../ogc/wcs/WcsUrlBuilder"],function(t,e,i){"use strict";var r=function(i,r){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsCoverage","constructor","missingId"));if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsCoverage","constructor","missingWebCoverageService"));this.coverageId=i,this.service=r,this.sector=this.service.coverageDescriptions.getSector(this.coverageId),this.resolution=this.service.coverageDescriptions.getResolution(this.coverageId),this.elevationConfig=this.createElevationConfig()};
116return r.PREFERRED_FORMATS={GeoTIFF:!0,"image/tiff":!0,TIFF:!0},r.DEFAULT_FORMAT="image/tiff",r.prototype.createElevationConfig=function(){return{resolution:this.resolution,coverageSector:this.sector,retrievalImageFormat:this.determineFormatFromService(),urlBuilder:new i(this.coverageId,this.service)}},r.prototype.determineFormatFromService=function(){var t,e,i,n=this.service.capabilities.version;if("1.0.0"===n){for(e=0,i=this.service.coverageDescriptions.coverages.length;e<i;e++)if(this.coverageId===this.service.coverageDescriptions.coverages[e].name){t=this.service.coverageDescriptions.coverages[e].supportedFormats.formats;break}}else"2.0.1"!==n&&"2.0.0"!==n||(t=this.service.capabilities.serviceMetadata.formatsSupported);if(!t)return r.DEFAULT_FORMAT;for(e=0,i=t.length;e<i;e++)if(r.PREFERRED_FORMATS.hasOwnProperty(t[e]))return t[e];return r.DEFAULT_FORMAT},r}),i("ogc/gml/GmlBoundedBy",["../../error/ArgumentError","../../util/Logger"],function(t,e){"use strict";var i=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"GmlAbstractGeometry","constructor","missingDom"));this.assembleElement(i)};return i.prototype.assembleElement=function(t){var e=t.children||t.childNodes;this.nilReason=t.getAttribute("nilReason");for(var i=0;i<e.length;i++){var r=e[i];"Envelope"===r.localName&&(this.envelope=this.assembleEnvelope(r))}},i.prototype.assembleEnvelope=function(t){var e=t.children||t.childNodes,i={};i.srsName=t.getAttribute("srsName"),i.srsDimension=parseInt(t.getAttribute("srsDimension")),i.axisLabels=t.getAttribute("axisLabels"),i.axisLabels&&(i.axisLabels=i.axisLabels.split(/\s+/)),i.uomLabels=t.getAttribute("uomLabels"),i.uomLabels&&(i.uomLabels=i.uomLabels.split(/\s+/));for(var r=0;r<e.length;r++){var n=e[r];if("lowerCorner"===n.localName){i.lower=n.textContent.split(/\s+/);for(var o=0;o<i.lower.length;o++)i.lower[o]=parseFloat(i.lower[o])}else if("upperCorner"===n.localName){i.upper=n.textContent.split(/\s+/);for(var o=0;o<i.upper.length;o++)i.upper[o]=parseFloat(i.upper[o])}}return i},i}),i("ogc/gml/GmlRectifiedGrid",["../../error/ArgumentError","../../util/Logger"],function(t,e){"use strict";var i=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"GmlRectifiedGrid","constructor","missingDom"));this.assembleElement(i)};return i.prototype.assembleElement=function(t){var e=t.children||t.childNodes;this.captureAttributes(t);for(var i=0;i<e.length;i++){var r=e[i];"description"===r.localName?this.description=r.textContent:"descriptionReference"===r.localName?this.descriptionReference=r.getAttribute("xlink:href"):"identifier"===r.localName?this.identifier=r.textContent:"name"===r.localName?(this.names=this.names||[],this.names.push(r.textContent)):"limits"===r.localName?this.limits=this.assembleLimits(r):"axisLabels"===r.localName?this.axisLabels=r.textContent.split(/\s+/):"axisName"===r.localName?(this.axisNames=this.axisNames||[],this.axisNames.push(r.textContent)):"origin"===r.localName?this.origin=this.assembleOrigin(r):"offsetVector"===r.localName&&(this.offsetVector=this.offsetVector||[],this.offsetVector.push(this.assembleOffsetVector(r)))}},i.prototype.captureAttributes=function(t){this.id=t.getAttribute("gml:id"),this.srsName=t.getAttribute("srsName"),this.srsDimension=t.getAttribute("srsDimension"),this.axisLabels=t.getAttribute("axisLabels"),this.axisLabels&&(this.axisLabels=this.axisLabels.split(/\s+/)),this.uomLabels=t.getAttribute("uomLabels"),this.uomLabels&&(this.uomLabels=this.uomLabels.split(/\s+/)),this.dimension=parseInt(t.getAttribute("dimension"))},i.prototype.assembleLimits=function(t){for(var e=t.children||t.childNodes,i=0;i<e.length;i++){var r=e[i];if("GridEnvelope"===r.localName)return this.assembleGridEnvelope(r)}},i.prototype.assembleGridEnvelope=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];i[n.localName]=n.textContent.split(/\s+/)}return i},i.prototype.assembleOrigin=function(t){var e={};e.type=t.getAttribute("xlink:type"),e.href=t.getAttribute("xlink:href"),e.role=t.getAttribute("xlink:role"),e.arcrole=t.getAttribute("xlink:arcrole"),e.title=t.getAttribute("xlink:title"),e.show=t.getAttribute("xlink:show"),e.actuate=t.getAttribute("xlink:actuate"),e.nilReason=t.getAttribute("nilReason"),e.remoteSchema=t.getAttribute("gml:remoteSchema"),e.owns=t.getAttribute("owns");for(var i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Point"===n.localName?e.point=this.assemblePoint(n):"pos"===n.localName&&(e.pos=this.assemblePos(n))}return e},i.prototype.assemblePoint=function(t){var e={};e.id=t.getAttribute("gml:id"),e.srsName=t.getAttribute("srsName"),e.srsDimension=t.getAttribute("srsDimension"),e.axisLabels=t.getAttribute("axisLabels"),e.axisLabels&&(e.axisLabels=e.axisLabels.split(/\s+/)),e.uomLabels=t.getAttribute("uomLabels"),e.uomLabels&&(e.uomLabels=e.uomLabels.split(/\s+/));for(var i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"description"===n.localName?e.description=n.textContent:"descriptionReference"===n.localName?e.descriptionReference=this.assembleOrigin(n):"identifier"===n.localName?e.identifier=n.textContent:"name"===n.localName?e.name=n.textContent:"pos"===n.localName&&(e.pos=this.assemblePos(n))}return e},i.prototype.assemblePos=function(t){var e={};if(e.srsName=t.getAttribute("srsName"),e.srsDimension=parseInt(t.getAttribute("srsDimension")),e.axisLabels=t.getAttribute("axisLabels"),e.axisLabels&&(e.axisLabels=e.axisLabels.split(/\s+/)),e.uomLabels=t.getAttribute("uomLabels"),e.uomLabels&&(e.uomLabels=e.uomLabels.split(/\s+/)),e.pos=t.textContent,e.pos){e.pos=e.pos.split(/\s+/);for(var i=0;i<e.pos.length;i++)e.pos[i]=parseFloat(e.pos[i])}return e},i.prototype.assembleOffsetVector=function(t){var e,i=(t.children||t.childNodes,{});i.srsName=t.getAttribute("srsName"),i.srsDimension=parseInt(t.getAttribute("srsDimension")),i.axisLabels=t.getAttribute("axisLabels"),i.axisLabels&&(i.axisLabels=i.axisLabels.split(/\s+/)),i.uomLabels=t.getAttribute("uomLabels"),i.uomLabels&&(i.uomLabels=i.uomLabels.split(/\s+/)),e=t.textContent.split(/\s+/),i.values=[];for(var r=0;r<e.length;r++)i.values.push(parseFloat(e[r]));return i},i}),i("ogc/gml/GmlDomainSet",["../../error/ArgumentError","../../ogc/gml/GmlRectifiedGrid","../../util/Logger"],function(t,e,
116i){"use strict";var r=function(e){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"GmlAbstractGeometry","constructor","missingDom"));this.assembleElement(e)};return r.prototype.assembleElement=function(t){for(var i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"RectifiedGrid"===n.localName&&(this.rectifiedGrid=new e(n))}},r}), 117i("ogc/wcs/WcsCoverageDescriptions",["../../error/ArgumentError","../../ogc/gml/GmlBoundedBy","../../ogc/gml/GmlDomainSet","../../ogc/gml/GmlRectifiedGrid","../../util/Logger","../../ogc/ows/OwsKeywords","../../geom/Sector"],function(t,e,i,r,n,o,s){"use strict";var a=function(e){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"WcsCoverageDescriptions","constructor","missingDom"));this.xmlDom=e,this.assembleDocument()};return a.prototype.getSector=function(e){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"WcsCoverageDescriptions","getSector","missingId"));var i,r=this.getCoverage(e);return r?"1.0.0"===this.version?(i=r.lonLatEnvelope.pos,new s(i[0][1],i[1][1],i[0][0],i[1][0])):"2.0.1"===this.version||"2.0.0"===this.version?(i=r.boundedBy.envelope,new s(i.lower[0],i.upper[0],i.lower[1],i.upper[1])):null:null},a.prototype.getResolution=function(e){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"WcsCoverageDescriptions","getResolution","missingId"));var i,r,o,s,a,l,h=this.getCoverage(e),u=this.getSector(e);return h?("1.0.0"===this.version?(i=h.domainSet.spatialDomain.rectifiedGrid.limits.low[0],r=h.domainSet.spatialDomain.rectifiedGrid.limits.low[1],o=h.domainSet.spatialDomain.rectifiedGrid.limits.high[0],s=h.domainSet.spatialDomain.rectifiedGrid.limits.high[1]):"2.0.1"!==this.version&&"2.0.0"!==this.version||(i=h.domainSet.rectifiedGrid.limits.low[0],r=h.domainSet.rectifiedGrid.limits.low[1],o=h.domainSet.rectifiedGrid.limits.high[0],s=h.domainSet.rectifiedGrid.limits.high[1]),a=u.deltaLongitude()/(o-i),l=u.deltaLatitude()/(s-r),Math.max(a,l)):null},a.prototype.getSupportedCrs=function(e){if(!e)throw new t(n.logMessage(n.LEVEL_SEVERE,"WcsCoverageDescriptions","getSupportedCrs","missingId"));var i=this.getCoverage(e),r=[];return i?"1.0.0"===this.version?i.supportedCrs.requests:"2.0.1"===this.version||"2.0.0"===this.version?(r.push(i.boundedBy.envelope.srsName),r):null:null},a.prototype.getCoverage=function(t){for(var e=0,i=this.coverages.length;e<i;e++)if(t===(this.coverages[e].coverageId||this.coverages[e].name))return this.coverages[e];return null},a.prototype.assembleDocument=function(){var e=this.xmlDom.documentElement;if("CoverageDescription"===e.localName)this.assembleDocument100(e),this.version="1.0.0";else{if("CoverageDescriptions"!==e.localName)throw new t(n.logMessage(n.LEVEL_SEVERE,"WcsCapabilities","assembleDocument","unsupportedVersion"));this.assembleDocument20x(e),this.version=e.getAttribute("version")||"2.0.1"}},a.prototype.assembleDocument100=function(t){this.version=t.getAttribute("version");for(var e=t.children||t.childNodes,i=0;i<e.length;i++){var r=e[i];"CoverageOffering"===r.localName&&(this.coverages=this.coverages||[],this.coverages.push(this.assembleCoverages100(r)))}},a.prototype.assembleDocument20x=function(t){for(var e=t.children||t.childNodes,i=0;i<e.length;i++){var r=e[i];"CoverageDescription"===r.localName&&(this.coverages=this.coverages||[],this.coverages.push(this.assembleCoverages20x(r)))}},a.prototype.assembleCoverages100=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];"name"===n.localName?i.name=n.textContent:"description"===n.localName?i.description=n.textContent:"label"===n.localName?i.label=n.textContent:"keywords"===n.localName?i.keywords=new o(n).keywords:"lonLatEnvelope"===n.localName?i.lonLatEnvelope=this.assembleLonLatEnvelope100(n):"supportedCRSs"===n.localName?i.supportedCrs=this.assembleSupportedCrs100(n):"supportedFormats"===n.localName?i.supportedFormats=this.assembleSupportedFormats100(n):"supportedInterpolations"===n.localName?i.supportedInterpolations=this.assembleSupportedInterpolations100(n):"domainSet"===n.localName?i.domainSet=this.assembleDomainSet100(n):"rangeSet"===n.localName&&(i.rangeSet=this.assembleRangeSet100(n))}return i}
117,a.prototype.assembleCoverages20x=function(t){for(var r=t.children||t.childNodes,n={},o=0;o<r.length;o++){var s=r[o];"CoverageId"===s.localName?n.coverageId=s.textContent:"domainSet"===s.localName?n.domainSet=new i(s):"boundedBy"===s.localName?n.boundedBy=new e(s):"ServiceParameters"===s.localName?n.serviceParameters=this.assembleServiceParameters20x(s):"rangeType"===s.localName&&(n.rangeType=s)}return n},a.prototype.assembleServiceParameters20x=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];"nativeFormat"===n.localName?i.nativeFormat=n.textContent:"CoverageSubtype"===n.localName&&(i.coverageSubtype=n.textContent)}return i},a.prototype.assembleLonLatEnvelope100=function(t){var e=t.children||t.childNodes,i={};i.srsName=t.getAttribute("srsName");for(var r=0;r<e.length;r++){var n=e[r];"pos"===n.localName&&(i.pos=i.pos||[],i.pos.push(a.parseSpacedFloatArray(n.textContent)))}return i},a.prototype.assembleSupportedCrs100=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];"requestResponseCRSs"===n.localName?(i.requests=i.requests||[],i.requests.push(n.textContent),i.responses=i.responses||[],i.responses.push(n.textContent)):"requestCRSs"===n.localName?(i.requests=i.requests||[],i.push(n.textContent)):"responseCRSs"===n.localName?(i.responses=i.responses||[],i.push(n.textContent)):"NativeCRSs"===n.localName&&(i.nativeCrs=i.nativeCrs||[],i.push(n.textContent))}return i},a.prototype.assembleSupportedFormats100=function(t){var e=t.children||t.childNodes,i={};i.nativeFormat=t.getAttribute("nativeFormat");for(var r=0;r<e.length;r++){var n=e[r];"formats"===n.localName&&(i.formats=i.formats||[],i.formats.push(n.textContent))}return i},a.prototype.assembleSupportedInterpolations100=function(t){var e=t.children||t.childNodes,i={};i.default=t.getAttribute("default");for(var r=0;r<e.length;r++){var n=e[r];"interpolationMethod"===n.localName&&(i.methods=i.methods||[],i.methods.push(n.textContent))}return i},a.prototype.assembleDomainSet100=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];"spatialDomain"===n.localName&&(i.spatialDomain=this.assembleSpatialDomain100(n))}return i},a.prototype.assembleSpatialDomain100=function(t){for(var e=t.children||t.childNodes,i={},n=0;n<e.length;n++){var o=e[n];"Envelope"===o.localName?i.envelope=this.assembleLonLatEnvelope100(o):"RectifiedGrid"===o.localName&&(i.rectifiedGrid=new r(o))}return i},a.prototype.assembleRangeSet100=function(t){for(var e=t.children||t.childNodes,i=0;i<e.length;i++){var r=e[i];if("RangeSet"===r.localName)return this.assembleRangeSetElement100(r)}},a.prototype.assembleRangeSetElement100=function(t){var e=t.children||t.childNodes,i={};i.semantic=t.getAttribute("semantic"),i.refSys=t.getAttribute("refSys"),i.refSysLable=t.getAttribute("refSysLabel");for(var r=0;r<e.length;r++){var n=e[r];"name"===n.localName?i.name=n.textContent:"label"===n.localName?i.label=n.textContent:"axisDescription"===n.localName&&(i.axisDescriptions=this.assembleRangeSetAxisDescription100(n))}return i},a.prototype.assembleRangeSetAxisDescription100=function(t){for(var e=t.children||t.childNodes,i=[],r=0;r<e.length;r++){var n=e[r];"AxisDescription"===n.localName&&i.push(this.assembleRangeSetAxisDescriptionElement100(n))}return i},a.prototype.assembleRangeSetAxisDescriptionElement100=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];"name"===n.localName?i.name=n.textContent:"label"===n.localName?i.label=n.textContent:"values"===n.localName&&(i.values=this.assembleRangeSetValues100(n))}return i},a.prototype.assembleRangeSetValues100=function(t){for(var e=t.children||t.childNodes,i={},r=0;r<e.length;r++){var n=e[r];"singleValue"===n.localName&&(i.singleValue=n.textContent)}return i},a.parseSpacedFloatArray=function(t){for(var e=[],i=t.split(/\s+/),r=0;r<i.length;r++)e.push(parseFloat(i[r]));return e},a}),i("util/WcsTileUrlBuilder",["../error/ArgumentError","../util/Logger"],function(t,e){"use strict";var i=function(i,r,n){if(!i||0===i.length)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsTileUrlBuilder","constructor","The WCS service address is missing."));if(!r||0===r.length)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsTileUrlBuilder","constructor","The WCS coverage name is missing."));this.serviceAddress=i,this.coverageName=r,this.wcsVersion=n&&n.length>0?n:"1.0.0",this.crs="EPSG:4326"};return i.prototype.urlForTile=function(r,n){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsUrlBuilder","urlForTile","missingTile"));if(!n)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsUrlBuilder","urlForTile","The coverage format is null or undefined."));var o=r.sector,s=i.fixGetCoverageString(this.serviceAddress);return s.search(/service=wcs/i)<0&&(s+="service=WCS"),s+="&request=GetCoverage",s=s+"&version="+this.wcsVersion,s=s+"&coverage="+this.coverageName,s=s+"&format="+n,s=s+"&width="+r.tileWidth,s=s+"&height="+r.tileHeight,s=s+"&crs="+this.crs,s+="&bbox=",s=s+o.minLongitude+","+o.minLatitude+",",s=s+o.maxLongitude+","+o.maxLatitude,s=s.replace(" ","%20")},i.fixGetCoverageString=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WcsTileUrlBuilder","fixGetCoverageString","The specified service address is null or undefined."));var r=i.indexOf("?");return r<0?i+="?":r!==i.length-1&&(r=i.search(/&$/))<0&&(i+="&"),i},i}),i("globe/WcsEarthElevationCoverage",["../geom/Location","../geom/Sector","../globe/TiledElevationCoverage","../util/WcsTileUrlBuilder"],function(t,e,
117i,r){"use strict";var n=function(){i.call(this,{coverageSector:e.FULL_SPHERE,resolution:.008333333333333,retrievalImageFormat:"image/tiff",minElevation:-11e3,maxElevation:8850,urlBuilder:new r("https://worldwind26.arc.nasa.gov/wms2","NASA_SRTM30_900m_Tiled","1.0.0")}),this.displayName="WCS Earth Elevation Coverage"};return n.prototype=Object.create(i.prototype),n}),i("ogc/wcs/WebCoverageService",["../../error/ArgumentError","../../util/Logger","../../util/Promise","../../ogc/wcs/WcsCapabilities","../../ogc/wcs/WcsCoverage","../../ogc/wcs/WcsCoverageDescriptions"],function(t,e,i,r,n,o){"use strict";var s=function(){this.serviceAddress=null,this.coverages=[],this.capabilities=null,this.coverageDescriptions=null};return s.WCS_XLMNS="http://www.opengis.net/wcs",s.WCS_2_XLMNS="http://www.opengis.net/wcs/2.0",s.create=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WebCoverageService","constructor","missingUrl"));var r=new s;return r.serviceAddress=i,r.retrieveCapabilities().then(function(t){return r.capabilities=t,r.retrieveCoverageDescriptions(t)}).then(function(t){return r.parseCoverages(t),r})},s.prototype.getCoverage=function(t){},s.prototype.retrieveCapabilities=function(){var t,e=this;return e.retrieveXml(e.buildCapabilitiesXmlRequest("2.0.1")).then(function(i){return t=i.documentElement.getAttribute("version"),"2.0.1"===t||"2.0.0"===t?i:e.retrieveXml(e.buildCapabilitiesXmlRequest("1.0.0"))}).then(function(t){return new r(t)})},s.prototype.retrieveCoverageDescriptions=function(){return this.retrieveXml(this.buildDescribeCoverageXmlRequest())},s.prototype.parseCoverages=function(t){this.coverageDescriptions=new o(t);for(var e,i,r=this.coverageDescriptions.coverages.length,s=0;s<r;s++)e=this.coverageDescriptions.coverages[s].coverageId||this.coverageDescriptions.coverages[s].name,i=new n(e,this),this.coverages.push(i)},s.prototype.retrieveXml=function(t){return new i(function(i,r){var n=new XMLHttpRequest;n.open("POST",t.url),n.onreadystatechange=function(){4===n.readyState&&(200===n.status?i(n.responseXML):r(new Error(e.logMessage(e.LEVEL_WARNING,"XML retrieval failed ("+n.statusText+"): "+t.url))))},n.onerror=function(){r(new Error(e.logMessage(e.LEVEL_WARNING,"XML retrieval failed: "+t.url)))},n.ontimeout=function(){r(new Error(e.logMessage(e.LEVEL_WARNING,"XML retrieval timed out: "+t.url)))},n.send(t.body)})},s.prototype.buildCapabilitiesXmlRequest=function(t){var e=this.createBaseWcsElement("GetCapabilities",t);return{url:this.serviceAddress,body:(new XMLSerializer).serializeToString(e)}},s.prototype.buildDescribeCoverageXmlRequest=function(){var t,e,i,r=this.capabilities.version,n=this.capabilities.coverages.length;t=this.createBaseWcsElement("DescribeCoverage",r),"1.0.0"===r?i=this.capabilities.capability.request.describeCoverage.get:"2.0.1"!==r&&"2.0.0"!==r||(i=this.capabilities.operationsMetadata.getOperationMetadataByName("DescribeCoverage").dcp[0].getMethods[0].url);for(var o=0;o<n;o++)"1.0.0"===r?(e=document.createElementNS(s.WCS_XLMNS,"Coverage"),e.appendChild(document.createTextNode(this.capabilities.coverages[o].name))):"2.0.1"!==r&&"2.0.0"!==r||(e=document.createElementNS(s.WCS_2_XLMNS,"CoverageId"),e.appendChild(document.createTextNode(this.capabilities.coverages[o].coverageId))),t.appendChild(e);return{url:i,body:(new XMLSerializer).serializeToString(t)}},s.prototype.createBaseWcsElement=function(t,e){var i;return"1.0.0"===e?(i=document.createElementNS(s.WCS_XLMNS,t),i.setAttribute("version","1.0.0")):"2.0.1"!==e&&"2.0.0"!==e||(i=document.createElementNS(s.WCS_2_XLMNS,t),i.setAttribute("version",e)),i.setAttribute("service","WCS"),i},s}),i("ogc/WfsCapabilities",["../error/ArgumentError","../util/Logger","../ogc/ows/OwsLanguageString","../ogc/ows/OwsOperationsMetadata","../ogc/ows/OwsServiceIdentification","../ogc/ows/OwsServiceProvider"],function(t,e,i,r,n,o){"use strict";var s=function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WfsCapabilities","constructor","No XML DOM specified."));this.assembleDocument(i)};return s.prototype.assembleDocument=function(t){var e=t.documentElement;this.version=e.getAttribute("version"),this.updateSequence=e.getAttribute("updateSequence");for(var i=e.children||e.childNodes,s=0;s<i.length;s++){var a=i[s];"ServiceIdentification"===a.localName?this.serviceIdentification=new n(a):"ServiceProvider"===a.localName?this.serviceProvider=new o(a):"OperationsMetadata"===a.localName?this.operationsMetadata=new r(a):"FeatureTypeList"===a.localName?this.featureTypeList=this.assembleFeatureTypeList(a):"Filter_Capabilities"===a.localName&&(this.filterCapabilities=this.assembleFilterCapabilities(a))}},s.prototype.assembleFeatureTypeList=function(t){for(var i={},r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];if("Operations"==o.localName){i.operations=i.operations||[];try{i.operations=s.assembleOperations(o)}catch(t){e.logMessage(e.LEVEL_SEVERE,"WfsCapabilities","constructor","Exception reading WFS operations description: "+t.message)}}else if("FeatureType"==o.localName){i.featureType=i.featureType||[];try{i.featureType.push(s.assembleFeatureType(o))}catch(t){e.logMessage(e.LEVEL_SEVERE,"WfsCapabilities","constructor","Exception reading WFS operations description: "+t.message)}}}return i},s.prototype.assembleFilterCapabilities=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];
117"Conformance"===n.localName?e.conformance=s.assembleConformance(n):"Id_Capabilities"===n.localName?e.idCapabilities=s.assembleIdCapabilities(n):"Scalar_Capabilities"===n.localName?e.scalarCapabilities=s.assembleScalarCapabilities(n):"Spatial_Capabilities"===n.localName?e.spatialCapabilities=s.assembleSpatialCapabilities(n):"Functions"===n.localName&&(e.functions=s.assembleFunctions(n))}return e},s.assembleOperations=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Operation"==n.localName&&e.push(n.textContent)}return e},s.assembleFeatureType=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Name"==n.localName?e.name=n.textContent:"Title"==n.localName?e.title=n.textContent:"Abstract"==n.localName?e.abstract=n.textContent:"Keywords"==n.localName?(e.keywords=e.keywords||[],e.keywords=s.assembleKeywords(n)):"DefaultSRS"==n.localName?e.defaultSRS=n.textContent:"OtherSRS"==n.localName?(e.otherSRS=e.otherSRS||[],e.otherSRS.push(n.textContent)):"WGS84BoundingBox"==n.localName?e.wgs84BoundingBox=s.assembleBoundingBox(n):"DefaultCRS"==n.localName?e.defaultCRS=n.textContent:"OtherCRS"==n.localName?(e.otherCRS=e.otherCRS||[],e.otherCRS.push(n.textContent)):"OutputFormats"==n.localName?e.outputFormats=s.assembleOutputFormats(n):"MetadataURL"==n.localName&&(e.metadataUrl=s.assembleMetadataUrl(n))}return e},s.assembleBoundingBox=function(t){var e={},i=t.getAttribute("crs");i&&(e.crs=i);for(var r=t.children||t.childNodes,n=0;n<r.length;n++){var o=r[n];if("LowerCorner"===o.localName){var s=o.textContent.split(" ");e.lowerCorner=[parseFloat(s[0]),parseFloat(s[1])]}else if("UpperCorner"===o.localName){var a=o.textContent.split(" ");e.upperCorner=[parseFloat(a[0]),parseFloat(a[1])]}}return e},s.assembleOutputFormats=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Format"===n.localName&&e.push(n.textContent)}return e},s.assembleMetadataUrl=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"MetadataURL"===n.localName&&(e.format=n.getAttribute("format"),e.type=n.getAttribute("type"))}return outputFormats},s.assembleKeywords=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Keyword"===n.localName&&e.push(n.textContent)}return e},s.assembleConformance=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];if("Constraint"===n.localName){var o;o=s.assembleConstraint(n),o.name=n.getAttribute("name"),e.push(o)}}return e},s.assembleConstraint=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"DefaultValue"===n.localName&&(e.defaultValue=n.textContent)}return e},s.assembleIdCapabilities=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"ResourceIdentifier"===n.localName&&(e.resourceIdentifier=n.getAttribute("name"))}return e},s.assembleScalarCapabilities=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"ComparisonOperators"===n.localName?e.comparisonOperators=s.assembleComparisonOperators(n):"ArithmeticOperators"===n.localName&&(e.arithmeticOperators=s.assembleArithmeticOperators(n))}return e},s.assembleComparisonOperators=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"ComparisonOperator"===n.localName&&e.push(n.textContent)}return e},s.assembleArithmeticOperators=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Functions"===n.localName&&(e.functions=s.assembleArithmeticFunctions(n))}return e},s.assembleArithmeticFunctions=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"FunctionNames"===n.localName&&(e=s.assembleFunctionNames(n))}return e},s.assembleFunctionNames=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];if("FunctionName"===n.localName){var o={name:n.textContent,nArgs:n.getAttribute("nArgs")};e.push(o)}}return e},s.assembleSpatialCapabilities=function(t){for(var e={},i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"GeometryOperands"===n.localName?e.geometryOperands=s.assembleGeometryOperands(n):"SpatialOperators"===n.localName&&(e.spatialOperators=s.assembleSpatialOperators(n))}return e},s.assembleGeometryOperands=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"GeometryOperand"===n.localName&&e.push(n.getAttribute("name"))}return e},s.assembleSpatialOperators=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"SpatialOperator"===n.localName&&e.push(n.getAttribute("name"))}return e},s.assembleFunctions=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Function"===n.localName&&e.push(s.assembleFunction(n))}return e},s.assembleFunction=function(t){var e={};e.name=t.getAttribute("name");for(var i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Returns"===n.localName?e.returns=n.textContent:"Arguments"===n.localName&&(e.arguments=s.assembleArguments(n))}return e},s.assembleArguments=function(t){for(var e=[],i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Argument"===n.localName&&e.push(s.assembleArgument(n))}return e},s.assembleArgument=function(t){var e={};e.name=t.getAttribute("name");for(var i=t.children||t.childNodes,r=0;r<i.length;r++){var n=i[r];"Type"===n.localName&&(e.type=n.textContent)}return e},s}),i("formats/wkt/WktElements",[],function(){return{}}),i("formats/wkt/WktType",[],function(){var t=function(){};return t.SupportedGeometries={LINE_STRING:"LINESTRING",MULTI_LINE_STRING:"MULTILINESTRING",POLYGON:"POLYGON",MULTI_POLYGON:"MULTIPOLYGON",POINT:"POINT",MULTI_POINT:"MULTIPOINT",TRIANGLE:"TRIANGLE",GEOMETRY_COLLECTION:"GEOMETRYCOLLECTION"},t.TokenType={LEFT_PARENTHESIS:0,COMMA:1,RIGHT_PARENTHESIS:2,NUMBER:3,TEXT:4},t}),i("formats/wkt/geom/WktObject",["../../../geom/Location","../../../geom/Position","../WktElements","../WktType"],function(t,e,
117i,r){var n=function(t){this.type=t,this._is3d=!1,this._isLrs=!1,this.coordinates=[],this.options={coordinates:[],leftParenthesis:0,rightParenthesis:0,tokens:[]}};return n.prototype.set3d=function(){this._is3d=!0},n.prototype.setLrs=function(){this._isLrs=!0},n.prototype.addCoordinates=function(i){this._is3d?this.coordinates.push(new e(i[1],i[0],i[2]||0)):this.coordinates.push(new t(i[1],i[0]))},n.prototype.shapes=function(){return[]},n.prototype.handleToken=function(t){var e=t.value,i=this.options;t.type===r.TokenType.TEXT?this.text(i,e):t.type===r.TokenType.LEFT_PARENTHESIS?this.leftParenthesis(i):t.type===r.TokenType.RIGHT_PARENTHESIS?this.rightParenthesis(i):t.type===r.TokenType.NUMBER?this.number(i,e):t.type===r.TokenType.COMMA&&this.comma(i),i.tokens.push(t)},n.prototype.text=function(t,e){e=e.toUpperCase();if(e.length<=2)this.setOptions(e,this);else if(0===e.indexOf("EMPTY"))t.leftParenthesis=1,t.rightParenthesis=1;else{var r=e.match("[M]?[Z]?$");r&&r.length>0&&""!=r[0]&&this.setOptions(r,null);var o=i[e]&&new i[e];o||(o=new n),r&&r.length>0&&""!=r[0]&&o.setOptions(r[0],o),this.add(o)}},n.prototype.rightParenthesis=function(t){t.rightParenthesis++,t.coordinates&&(this.addCoordinates(t.coordinates),t.coordinates=null)},n.prototype.leftParenthesis=function(t){t.leftParenthesis++},n.prototype.comma=function(t){t.coordinates?(this.addCoordinates(t.coordinates),t.coordinates=null):this.commaWithoutCoordinates(t)},n.prototype.commaWithoutCoordinates=function(t){},n.prototype.number=function(t,e){t.coordinates=t.coordinates||[],t.coordinates.push(e)},n.prototype.setOptions=function(t,e){"Z"==t?e.set3d():"M"==t?e.setLrs():"MZ"==t&&(e.set3d(),e.setLrs())},n.prototype.isFinished=function(){return this.options.leftParenthesis===this.options.rightParenthesis&&this.options.leftParenthesis>0},n}),i("formats/wkt/WktTokens",["./WktElements","./geom/WktObject","./WktType"],function(t,e,i){var r=function(t){this.sourceText=t};return r.prototype.objects=function(){var i,r=[];return this.tokenize(this.sourceText).forEach(function(n){if(i&&i.isFinished()||!i){var o=n.value,s=o.match("[M]?[Z]?$");s&&s.length>0&&""!=s[0]&&(o=o.substring(0,o.length-s.length)),i=t[o]&&new t[o],i||(i=new e),s&&s.length>0&&""!=s[0]&&i.setOptions(s[0],i),r.push(i)}else i.handleToken(n)}),r},r.prototype.tokenize=function(t){this.currentPosition=0;for(var e=[];this.currentPosition<t.length;this.currentPosition++){var r=t.charAt(this.currentPosition);if("("==r)e.push({type:i.TokenType.LEFT_PARENTHESIS});else if(","==r)e.push({type:i.TokenType.COMMA});else if(")"==r)e.push({type:i.TokenType.RIGHT_PARENTHESIS});else if(this.isAlpha(r)){var n=this.readText(t);e.push({type:i.TokenType.TEXT,value:n})}else{if(!this.isNumeric(r)){if(this.isWhiteSpace(r))continue;throw new Error("Invalid character: {{",r,"}}")}var o=this.readNumeric(t);e.push({type:i.TokenType.NUMBER,value:o})}}return e},r.prototype.isAlpha=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"},r.prototype.isNumeric=function(t){return t>="0"&&t<="9"||"."==t||"-"==t},r.prototype.isWhiteSpace=function(t){return" "==t||"\t"==t||"\r"==t||"\n"==t},r.prototype.readText=function(t){for(var e="";this.isAlpha(t.charAt(this.currentPosition));)e+=t.charAt(this.currentPosition),this.currentPosition++;return this.currentPosition--,e},r.prototype.readNumeric=function(t){for(var e="";this.isNumeric(t.charAt(this.currentPosition));)e+=t.charAt(this.currentPosition),this.currentPosition++;return this.currentPosition--,Number(e)},r}),i("formats/wkt/Wkt",["../../error/ArgumentError","../../util/Logger","./WktTokens"],function(t,e,i){var r=function(t){this.textRepresentation=t,this._parserCompletionCallback=this.defaultParserCompletionCallback,this._shapeConfigurationCallback=this.defaultShapeConfigurationCallback,this._layer=null};return Object.defineProperties(r.prototype,{parserCompletionCallback:{get:function(){return this._parserCompletionCallback}},shapeConfigurationCallback:{get:function(){return this._shapeConfigurationCallback}},layer:{get:function(){return this._layer}}}),r.prototype.load=function(t,e,r){r&&(this._layer=r),t&&(this._parserCompletionCallback=t),e&&(this._shapeConfigurationCallback=e),this.parserCompletionCallback(this,new i(this.textRepresentation).objects())},r.prototype.defaultShapeConfigurationCallback=function(t){},r.prototype.defaultParserCompletionCallback=function(t,e){var i=t.shapeConfigurationCallback,r=[];
117e.forEach(function(t){t.shapes().forEach(function(e){var n=i(t);n&&n.attributes&&(e.attributes=n.attributes),n&&n.highlightAttributes&&(e.highlightAttributes=n.highlightAttributes),n&&n.pickDelegate&&(e.pickDelegate=n.pickDelegate),n&&n.userProperties&&(e.userProperties=n.userProperties),r.push(e)})}),t.layer&&t.layer.addRenderables(r)},r}),i("formats/wkt/WktExporter",["../../error/ArgumentError","../../util/Logger","./WktType"],function(t,e,i){"use strict";return{exportRenderable:function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportRenderable","missingRenderable"));return i instanceof WorldWind.Placemark?this.exportPlacemark(i):i instanceof WorldWind.Path?this.exportPath(i):i instanceof WorldWind.Polygon?this.exportPolygon(i):i instanceof WorldWind.SurfacePolyline?this.exportSurfacePolyline(i):i instanceof WorldWind.SurfacePolygon?this.exportSurfacePolygon(i):i instanceof WorldWind.SurfaceEllipse?this.exportSurfaceEllipse(i):i instanceof WorldWind.SurfaceCircle?this.exportSurfaceCircle(i):i instanceof WorldWind.SurfaceRectangle?this.exportSurfaceRectangle(i):i instanceof WorldWind.SurfaceSector?this.exportSurfaceSector(i):(e.log(e.LEVEL_WARNING,"Export renderable not implemented: "+i),null)},exportRenderables:function(r){if(!r)throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportRenderables","missingRenderables"));if(0!=r.length){if(r.length>1){for(var n=i.SupportedGeometries.GEOMETRY_COLLECTION+"(",o=0;o<r.length;o++){var s=this.exportRenderable(r[o]);s&&(n+=s,n+=",")}return n=n.substring(0,n.length-1),n+=")"}return this.exportRenderable(r[0])}},exportLayer:function(i){if(!i)throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportLayer","missingLayer"));return this.exportRenderables(i.renderables)},exportPlacemark:function(r){if(!(r instanceof WorldWind.Placemark))throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportPlacemark","invalidTypeOfRenderable"));var n=i.SupportedGeometries.POINT+"(";return n=n+r.position.longitude+" "+r.position.latitude,n+=")"},exportPath:function(r){if(!(r instanceof WorldWind.Path))throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportPath","invalidTypeOfRenderable"));for(var n=i.SupportedGeometries.LINE_STRING+"(",o=0;o<r.positions.length;o++)n=n+r.positions[o].longitude+" "+r.positions[o].latitude;return n=n.substring(0,n.length-2),n+=")"},exportPolygon:function(r){if(!(r instanceof WorldWind.Polygon))throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportPolygon","invalidTypeOfRenderable"));var n=i.SupportedGeometries.POLYGON+"(";if(r.boundaries.length>0&&r.boundaries[0].length>2){for(var o=0;o<r.boundaries.length;o++){n+="(";for(var s=0;s<r.boundaries[o].length;s++)n=n+r.boundaries[o][s].longitude+" "+r.boundaries[o][s].latitude,n+=", ";n=n.substring(0,n.length-2),n+=")",n+=", "}n=n.substring(0,n.length-2)}else{n+="(";for(var o=0;o<r.boundaries.length;o++)n=n+r.boundaries[o].longitude+" "+r.boundaries[o].latitude,n+=", ";n=n.substring(0,n.length-2),n+=")"}return n+=")"},exportSurfacePolyline:function(r){if(!(r instanceof WorldWind.SurfacePolyline))throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportSurfacePolyline","invalidTypeOfRenderable"));for(var n=i.SupportedGeometries.LINE_STRING+"(",o=0;o<r.boundaries.length;o++)n=n+r.boundaries[o].longitude+" "+r.boundaries[o].latitude,n+=", ";return n=n.substring(0,n.length-2),n+=")"},exportSurfacePolygon:function(r){if(!(r instanceof WorldWind.SurfacePolygon))throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportSurfacePolygon","invalidTypeOfRenderable"));var n=i.SupportedGeometries.POLYGON+"(";if(r.boundaries.length>0&&r.boundaries[0].length>2){for(var o=0;o<r.boundaries.length;o++){n+="(";for(var s=0;s<r.boundaries[o].length;s++)n=n+r.boundaries[o][s].longitude+" "+r.boundaries[o][s].latitude,n+=", ";n=n.substring(0,n.length-2),n+=")",n+=", "}n=n.substring(0,n.length-2)}else{n+="(";for(var o=0;o<r.boundaries.length;o++)n=n+r.boundaries[o].longitude+" "+r.boundaries[o].latitude,n+=", ";n=n.substring(0,n.length-2),n+=")"}return n+=")"},exportSurfaceEllipse:function(r){if(!(r instanceof WorldWind.SurfaceEllipse))throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportSurfaceEllipse","invali
117dTypeOfRenderable"));var n=i.SupportedGeometries.POLYGON+"(";n+="(";for(var o=0;o<r._boundaries.length;o++)n=n+r._boundaries[o].longitude+" "+r._boundaries[o].latitude,n+=", ";return n=n.substring(0,n.length-2),n+=")",n+=")"},exportSurfaceCircle:function(r){if(!(r instanceof WorldWind.SurfaceCircle))throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportSurfaceCircle","invalidTypeOfRenderable"));var n=i.SupportedGeometries.POLYGON+"(";n+="(";for(var o=0;o<r._boundaries.length;o++)n=n+r._boundaries[o].longitude+" "+r._boundaries[o].latitude,n+=", ";return n=n.substring(0,n.length-2),n+=")",n+=")"},exportSurfaceRectangle:function(r){if(!(r instanceof WorldWind.SurfaceRectangle))throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportSurfaceRectangle","invalidTypeOfRenderable"));var n=i.SupportedGeometries.POLYGON+"(";n+="(";for(var o=0;o<r._boundaries.length;o++)n=n+r._boundaries[o].longitude+" "+r._boundaries[o].latitude,n+=", ";return n=n.substring(0,n.length-2),n+=")",n+=")"},exportSurfaceSector:function(r){if(!(r instanceof WorldWind.SurfaceSector))throw new t(e.logMessage(e.LEVEL_SEVERE,"WktExporter","exportSurfaceSector","invalidTypeOfRenderable"));var n=i.SupportedGeometries.POLYGON+"(";n+="(";for(var o=0;o<r._boundaries.length;o++)n=n+r._boundaries[o].longitude+" "+r._boundaries[o].latitude,n+=", ";return n=n.substring(0,n.length-2),n+=")",n+=")"}}}),i("formats/wkt/geom/WktGeometryCollection",["../../../geom/Location","../../../geom/Position","../WktElements","./WktObject","../WktType"],function(t,e,i,r,n){var o=function(){r.call(this,n.SupportedGeometries.GEOMETRY_COLLECTION),this.objects=[]};return o.prototype=Object.create(r.prototype),o.prototype.add=function(t){this.objects.push(t)},o.prototype.addCoordinates=function(i){var r=this.objects[this.objects.length-1];this._is3d?r.coordinates.push(new e(i[0],i[1],i[2]||0)):r.coordinates.push(new t(i[0],i[1]))},o.prototype.shapes=function(){var t=[];return this.objects.forEach(function(e){e.shapes().forEach(function(e){t.push(e)})}),t},i.GEOMETRYCOLLECTION=o,o}),i("formats/wkt/geom/WktLineString",["../../../shapes/Path","../../../shapes/ShapeAttributes","../../../shapes/SurfacePolyline","../WktElements","./WktObject","../WktType"],function(t,e,i,r,n,o){var s=function(){n.call(this,o.SupportedGeometries.LINE_STRING)};return s.prototype=Object.create(n.prototype),s.prototype.shapes=function(){return this._is3d?[new t(this.coordinates,new e(null))]:[new i(this.coordinates,new e(null))]},r.LINESTRING=s,s}), 118i("formats/wkt/geom/WktMultiLineString",["../../../shapes/Path","../../../shapes/ShapeAttributes","../../../shapes/SurfacePolyline","../WktElements","./WktObject","../WktType"],function(t,e,i,r,n,o){var s=function(){n.call(this,o.SupportedGeometries.MULTI_LINE_STRING),this.objectBoundaries=[]};return s.prototype=Object.create(n.prototype),s.prototype.commaWithoutCoordinates=function(){this.objectBoundaries.push(this.coordinates.slice()),this.coordinates=[]},s.prototype.shapes=function(){return this.commaWithoutCoordinates(),this._is3d?this.objectBoundaries.map(function(i){return new t(i,new e(null))}.bind(this)):this.objectBoundaries.map(function(t){return new i(t,new e(null))}.bind(this))},r.MULTILINESTRING=s,s}),i("formats/wkt/geom/WktPoint",["../../../shapes/Placemark","../../../shapes/PlacemarkAttributes","../WktElements","./WktObject","../WktType"],function(t,e,i,r,n){var o=function(){r.call(this,n.SupportedGeometries.POINT)};return o.prototype=Object.create(r.prototype),o.prototype.shapes=function(){return[o.placemark(this.coordinates[0])]},o.placemark=function(i){var r=new e(null);r.imageScale=1,r.imageOffset=new WorldWind.Offset(WorldWind.OFFSET_FRACTION,.3,WorldWind.OFFSET_FRACTION,0),r.imageColor=WorldWind.Color.WHITE,r.labelAttributes.offset=new WorldWind.Offset(WorldWind.OFFSET_FRACTION,.5,WorldWind.OFFSET_FRACTION,1),r.labelAttributes.color=WorldWind.Color.YELLOW,r.drawLeaderLine=!0,r.leaderLineAttributes.outlineColor=WorldWind.Color.RED,r.imageSource=WorldWind.configuration.baseUrl+"images/pushpins/castshadow-purple.png";var n=new t(i,!0,r);return n.altitudeMode=WorldWind.RELATIVE_TO_GROUND,n},i.POINT=o,o}),i("formats/wkt/geom/WktMultiPoint",["../../../shapes/Placemark","../../../shapes/PlacemarkAttributes","../WktElements","./WktObject","./WktPoint","../WktType"],function(t,e,
118i,r,n,o){var s=function(){r.call(this,o.SupportedGeometries.MULTI_POINT)};return s.prototype=Object.create(r.prototype),s.prototype.commaWithoutCoordinates=function(){},s.prototype.shapes=function(){return this.coordinates.map(function(t){return n.placemark(t)}.bind(this))},i.MULTIPOINT=s,s}),i("formats/wkt/geom/WktMultiPolygon",["../../../shapes/Polygon","../../../shapes/ShapeAttributes","../../../shapes/SurfacePolygon","../WktElements","./WktObject","../WktType"],function(t,e,i,r,n,o){var s=function(){n.call(this,o.SupportedGeometries.MULTI_POLYGON),this.objectBoundaries=[],this.currentIndex=0};return s.prototype=Object.create(n.prototype),s.prototype.rightParenthesis=function(t){n.prototype.rightParenthesis.call(this,t),t.tokens[t.tokens.length-1].type!=o.TokenType.RIGHT_PARENTHESIS?this.addBoundaries():t.tokens[t.tokens.length-1].type==o.TokenType.RIGHT_PARENTHESIS&&t.tokens[t.tokens.length-2].type!=o.TokenType.RIGHT_PARENTHESIS&&this.addObject()},s.prototype.addBoundaries=function(){this.objectBoundaries[this.currentIndex]||(this.objectBoundaries[this.currentIndex]=[]),this.objectBoundaries[this.currentIndex].push(this.coordinates.slice()),this.coordinates=[]},s.prototype.addObject=function(){this.currentIndex++},s.prototype.shapes=function(){return this._is3d?this.objectBoundaries.map(function(i){return new t(i,new e(null))}.bind(this)):this.objectBoundaries.map(function(t){return new i(t,new e(null))}.bind(this))},r.MULTIPOLYGON=s,s}),i("formats/wkt/geom/WktPolygon",["../../../shapes/Polygon","../../../shapes/ShapeAttributes","../../../shapes/SurfacePolygon","../WktElements","./WktObject","../WktType"],function(t,e,i,r,n,o){var s=function(){n.call(this,o.SupportedGeometries.POLYGON),this._renderable=null};return s.prototype=Object.create(n.prototype),s.prototype.commaWithoutCoordinates=function(){this.outerBoundaries=this.coordinates.slice(),this.coordinates=[]},s.prototype.shapes=function(){return this._is3d?this.outerBoundaries?[new t([this.outerBoundaries,this.coordinates],new e(null))]:[new t(this.coordinates,new e(null))]:this.outerBoundaries?[new i([this.outerBoundaries,this.coordinates],new e(null))]:[new i(this.coordinates,new e(null))]},r.POLYGON=s,s}),i("formats/wkt/geom/WktTriangle",["../../../shapes/Polygon","../../../shapes/ShapeAttributes","../../../shapes/SurfacePolygon","../WktElements","./WktObject","../WktType"],function(t,e,i,r,n,o){var s=function(){n.call(this,o.SupportedGeometries.TRIANGLE),this._renderable=null};return s.prototype=Object.create(n.prototype),s.prototype.shapes=function(){return this._is3d?[new t(this.coordinates,new e(null))]:[new i(this.coordinates,new e(null))]},r.TRIANGLE=s,s}),i("layer/WmsLayer",["../error/ArgumentError","../geom/Location","../util/Logger","../util/PeriodicTimeSequence","../geom/Sector","../layer/TiledImageLayer","../util/WmsUrlBuilder"],function(t,e,i,r,n,o,s){"use strict";var a=function(e,r){if(!e)throw new t(i.logMessage(i.LEVEL_SEVERE,"WmsLayer","constructor","No configuration specified."));var n=e.service+e.layerNames+e.styleNames;r&&(n+=r),o.call(this,e.sector,e.levelZeroDelta,e.numLevels,e.format,n,e.size,e.size),this.displayName=e.title,this.pickEnabled=!1,this.urlBuilder=new s(e.service,e.layerNames,e.styleNames,e.version,r),e.coordinateSystem&&(this.urlBuilder.crs=e.coordinateSystem),this.timeString=r};return a.prototype=Object.create(o.prototype),a.formLayerConfiguration=function(t){var i={title:t.title,version:t.capability.capsDoc.version},r=t.geographicBoundingBox||t.latLonBoundingBox;r&&r.westBoundLongitude?i.sector=new n(r.southBoundLatitude,r.northBoundLatitude,r.westBoundLongitude,r.eastBoundLongitude):r&&r.minx?i.sector=new n(r.miny,r.maxy,r.minx,r.maxx):i.sector=n.FULL_SPHERE,i.levelZeroDelta=new e(36,36),i.numLevels=19,i.size=256,i.layerNames=t.name;var o=t.capability.request.getMap,s=o.formats;s.indexOf("image/png")>=0?i.format="image/png":s.indexOf("image/jpeg")>=0?i.format="image/jpeg":s.indexOf("image/tiff")>=0?i.format="image/tiff":s.indexOf("image/gif")>=0&&(i.format="image/gif"),i.service=o.getUrl;var l=t.crses;l||(l=t.srses),l&&(l.indexOf("EPSG:4326")>=0||l.indexOf("epsg:4326")>=0?i.coordinateSystem="EPSG:4326":(l.indexOf("CRS84")>=0||l.indexOf("CRS:84")>=0)&&(i.coordinateSystem="CRS:84"));var h=a.parseTimeDimensions(t);return h&&h.length>0&&(i.timeSequences=h),i},a.parseTimeDimensions=function(t){var e=t.extents||t.dimensions,i=null;if(e){i=[];for(var n=0;n<e.length;n++){var o=e[n];if("time"===o.name.toLowerCase()&&(!o.units||"iso8601"===o.units.toLowerCase()))for(var s=o.content.split(","),a=0;a<s.length;a++){var l=s[a],h=l.split("/");1===h.length?i.push(new Date(l)):3===h.length&&i.push(new r(l))}}}return i},a}),i("layer/WmsTimeDimensionedLayer",["../error/ArgumentError","../layer/Layer","../util/Logger","../layer/WmsLayer"],function(t,e,
118i,r){"use strict";var n=function(r){if(!r)throw new t(i.logMessage(i.LEVEL_SEVERE,"WmsTimeDimensionedLayer","constructor","No configuration specified."));e.call(this,"WMS Time Dimensioned Layer"),this.config=r,this.displayName=r.title,this.pickEnabled=!1,this.layers={}};return n.prototype=Object.create(e.prototype),n.prototype.doRender=function(t){if(this.time){var e=this.time.toISOString(),i=this.layers[e];i||(i=new r(this.config,e),this.layers[e]=i),i.opacity=this.opacity,i.doRender(t),this.inCurrentFrame=i.inCurrentFrame}},n}),i("WorldWindow",["./error/ArgumentError","./BasicWorldWindowController","./render/DrawContext","./globe/EarthElevationModel","./util/FrameStatistics","./geom/Frustum","./globe/Globe","./globe/Globe2D","./util/GoToAnimator","./cache/GpuResourceCache","./geom/Line","./util/Logger","./navigate/LookAtNavigator","./geom/Matrix","./pick/PickedObjectList","./geom/Position","./geom/Rectangle","./geom/Sector","./shapes/SurfaceShape","./shapes/SurfaceShapeTileBuilder","./globe/Terrain","./geom/Vec2","./geom/Vec3","./util/WWMath"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_,b,S,w){"use strict";var L=function(o,a){function h(t){t.preventDefault()}function u(t){_.onGestureEvent(t)}function p(t){_.handleContextLost(t)}function g(t){_.handleContextRestored(t)}function y(t){_.handleRedrawEvent(t)}if(!window.WebGLRenderingContext)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","constructor","webglNotSupported"));var E;if(o instanceof HTMLCanvasElement)E=o;else if(!(E=document.getElementById(o)))throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","constructor","The specified canvas ID is not in the document."));var v=this.createContext(E);if(!v)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","constructor","webglNotSupported"));this.drawContext=new i(v),this.eventListeners={},this.redrawRequested=!0,this.redrawRequestId=null,this.scratchModelview=f.fromIdentity(),this.scratchProjection=f.fromIdentity(),this.hasStencilBuffer=v.getContextAttributes().stencil,this.canvas=E,this.depthBits=v.getParameter(v.DEPTH_BITS),this.viewport=new m(0,0,v.drawingBufferWidth,v.drawingBufferHeight),this.globe=new s(a||new r),this.layers=[],this.navigator=new d,this.worldWindowController=new e(this),this.verticalExaggeration=1,this.deepPicking=!1,this.subsurfaceMode=!1,this.surfaceOpacity=1,this.frameStatistics=new n,this.goToAnimator=new l(this),this._redrawCallbacks=[],this._orderedRenderingFilters=[function(t){_.declutter(t,1)},function(t){_.declutter(t,2)}],this.pixelScale=1,this.addEventListener("mousedown",h),this.addEventListener("touchstart",h),this.addEventListener("contextmenu",h),this.addEventListener("wheel",h);var _=this;window.PointerEvent?(this.canvas.style.setProperty("touch-action","none"),this.addEventListener("pointerdown",u,!1),window.addEventListener("pointermove",u,!1),window.addEventListener("pointercancel",u,!1),window.addEventListener("pointerup",u,!1)):(this.addEventListener("mousedown",u,!1),window.addEventListener("mousemove",u,!1),window.addEventListener("mouseup",u,!1),this.addEventListener("touchstart",u,!1),this.addEventListener("touchmove",u,!1),this.addEventListener("touchend",u,!1),this.addEventListener("touchcancel",u,!1)),this.addEventListener("wheel",function(t){u(t)}),this.canvas.addEventListener("webglcontextlost",p,!1),this.canvas.addEventListener("webglcontextrestored",g,!1),this.canvas.addEventListener(WorldWind.REDRAW_EVENT_TYPE,y,!1),window.addEventListener(WorldWind.REDRAW_EVENT_TYPE,y,!1),this.animationFrameLoop()};return Object.defineProperties(L.prototype,{orderedRenderingFilters:{get:function(){return this._orderedRenderingFilters}},redrawCallbacks:{get:function(){return this._redrawCallbacks}}}),L.prototype.canvasCoordinates=function(t,e){var i=this.canvas.getBoundingClientRect(),r=t-(i.left+this.canvas.clientLeft),n=e-(i.top+this.canvas.clientTop);return new b(r,n)},L.prototype.onGestureEvent=function(t){this.worldWindowController.onGestureEvent(t)},L.prototype.addEventListener=function(e,i){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","addEventListener","missingType"));if(!i)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","addEventListener","missingListener"));var r=this,n=this.eventListeners[e];n||(n={listeners:[],callback:function(t){t.worldWindow=r;for(var e=0,i=n.listeners.length;e<i;e++)n.listeners[e](t)}},this.eventListeners[e]=n),-1==n.listeners.indexOf(i)&&(n.listeners.splice(0,0,i),1==n.listeners.length&&this.canvas.addEventListener(e,n.callback,!1))},L.prototype.removeEventListener=function(e,i){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","removeEventListener","missingType"));if(!i)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","removeEventListener","missingListener"));var r=this.eventListeners[e];if(r){var n=r.listeners.indexOf(i);-1!=n&&(r.listeners.splice(n,1),0==r.listeners.length&&this.canvas.removeEventListener(e,r.callback,!1))}},L.prototype.redraw=function(){this.redrawRequested=!0},L.prototype.pick=function(e){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","pick","missingPoint"));
118return this.drawContext.currentGlContext.isContextLost()?new p:(this.resize(),this.resetDrawContext(),this.drawContext.pickingMode=!0,this.drawContext.pickPoint=e,this.drawContext.pickRay=this.rayThroughScreenPoint(e),this.drawFrame(),this.drawContext.objectsAtPickPoint)},L.prototype.pickTerrain=function(e){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","pickTerrain","missingPoint"));return this.drawContext.currentGlContext.isContextLost()?new p:(this.resize(),this.resetDrawContext(),this.drawContext.pickingMode=!0,this.drawContext.pickTerrainOnly=!0,this.drawContext.pickPoint=e,this.drawContext.pickRay=this.rayThroughScreenPoint(e),this.drawFrame(),this.drawContext.objectsAtPickPoint)},L.prototype.pickShapesInRegion=function(e){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","pickShapesInRegion","missingRectangle"));return this.drawContext.currentGlContext.isContextLost()?new p:(this.resize(),this.resetDrawContext(),this.drawContext.pickingMode=!0,this.drawContext.regionPicking=!0,this.drawContext.pickRectangle=new m(e.x,this.canvas.height-e.y,e.width,e.height),this.drawFrame(),this.drawContext.objectsAtPickPoint)},L.prototype.createContext=function(t){var e={antialias:!1,stencil:!0},i=t.getContext("webgl",e);return i||(i=t.getContext("experimental-webgl",e)),i},L.prototype.handleContextLost=function(t){c.log(c.LEVEL_INFO,"WebGL context event: "+t.statusMessage),t.preventDefault(),this.drawContext.contextLost(),window.cancelAnimationFrame(this.redrawRequestId)},L.prototype.handleContextRestored=function(t){c.log(c.LEVEL_INFO,"WebGL context event: "+t.statusMessage),this.drawContext.contextRestored(),this.redraw(),this.animationFrameLoop()},L.prototype.handleRedrawEvent=function(t){this.redraw()},L.prototype.animationFrameLoop=function(){function t(){e.animationFrameLoop()}this.redrawIfNeeded();var e=this;this.redrawRequestId=window.requestAnimationFrame(t)},L.prototype.redrawIfNeeded=function(){if(this.resize(),this.redrawRequested)try{this.redrawRequested=!1,this.drawContext.previousRedrawTimestamp=this.drawContext.timestamp,this.callRedrawCallbacks(WorldWind.BEFORE_REDRAW),this.resetDrawContext(),this.drawFrame()}catch(t){c.logMessage(c.LEVEL_SEVERE,"WorldWindow","redrawIfNeeded","Exception occurred during redrawing.\n"+t.toString())}finally{this.callRedrawCallbacks(WorldWind.AFTER_REDRAW),this.drawContext.redrawRequested&&(this.redrawRequested=!0)}},L.prototype.resize=function(){var t=this.drawContext.currentGlContext,e=t.canvas.clientWidth*this.pixelScale,i=t.canvas.clientHeight*this.pixelScale;t.canvas.width==e&&t.canvas.height==i||(t.canvas.width=e,t.canvas.height=i,t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight),this.viewport=new m(0,0,t.drawingBufferWidth,t.drawingBufferHeight),this.redrawRequested=!0)},L.prototype.computeViewingTransform=function(e,i){if(!i)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","computeViewingTransform","missingModelview"));i.setToIdentity(),this.worldWindowController.applyLimits();var r=this.globe,n=this.navigator,o=new g(n.lookAtLocation.latitude,n.lookAtLocation.longitude,0);if(i.multiplyByLookAtModelview(o,n.range,n.heading,n.tilt,n.roll,r),e){e.setToIdentity();var s=w.max(r.equatorialRadius,r.polarRadius),a=i.extractEyePoint(new S(0,0,0)),l=r.computePositionFromPoint(a[0],a[1],a[2],new g(0,0,0)),h=w.horizonDistanceForGlobeRadius(s,l.altitude),u=w.horizonDistanceForGlobeRadius(s,16e4),d=this.viewport,f=h+u;f<1e3&&(f=1e3);var p=w.perspectiveNearDistanceForFarDistance(f,10,this.depthBits),m=l.altitude-r.elevationAtLocation(l.latitude,l.longitude);if(m>0){var y=w.perspectiveNearDistance(d.width,d.height,m);p>y&&(p=y)}p<1&&(p=1),e.setToPerspectiveProjection(d.width,d.height,p,f)}},L.prototype.computePixelMetrics=function(t){var e=f.fromIdentity();e.invertMatrix(t);var i=new S(-1,-1,-1),r=new S(1,1,-1),n=new S(-1,-1,1),o=new S(1,1,1);i.multiplyByMatrix(e),r.multiplyByMatrix(e),n.multiplyByMatrix(e),o.multiplyByMatrix(e);var s=w.fabs(r[0]-i[0]),a=w.fabs(o[0]-n[0]),l=-i[2],h=-n[2],u=(a-s)/(h-l),c=s-u*l;return{pixelSizeFactor:u/this.viewport.width,pixelSizeOffset:c/this.viewport.height}},L.prototype.pixelSizeAtDistance=function(t){this.computeViewingTransform(this.scratchProjection,this.scratchModelview);var e=this.computePixelMetrics(this.scratchProjection);return e.pixelSizeFactor*t+e.pixelSizeOffset},L.prototype.computeDrawContext=function(){var t=this.drawContext;this.computeViewingTransform(t.projection,t.modelview),t.viewport=this.viewport,t.eyePoint=t.modelview.extractEyePoint(new S(0,0,0)),t.modelviewProjection.setToIdentity(),t.modelviewProjection.setToMultiply(t.projection,t.modelview);var e=this.computePixelMetrics(t.projection);t.pixelSizeFactor=e.pixelSizeFactor,t.pixelSizeOffset=e.pixelSizeOffset;var i=f.fromIdentity();i.invertOrthonormalMatrix(t.modelview),t.modelviewNormalTransform=f.fromIdentity().setToTransposeOfMatrix(i.up
118per3By3());var r=f.fromIdentity();r.setToTransposeOfMatrix(t.modelview),t.frustumInModelCoordinates=o.fromProjectionMatrix(t.projection),t.frustumInModelCoordinates.transformByMatrix(r),t.frustumInModelCoordinates.normalize()},L.prototype.resetDrawContext=function(){this.globe.offset=0;var t=this.drawContext;t.reset(),t.globe=this.globe,t.navigator=this.navigator,t.layers=this.layers.slice(),t.layers.push(t.screenCreditController),this.computeDrawContext(),t.verticalExaggeration=this.verticalExaggeration,t.surfaceOpacity=this.surfaceOpacity,t.deepPicking=this.deepPicking,t.frameStatistics=this.frameStatistics,t.pixelScale=this.pixelScale,t.update()},L.prototype.drawFrame=function(){try{this.drawContext.frameStatistics.beginFrame(),this.beginFrame(),this.drawContext.globe.is2D()&&this.drawContext.globe.continuous?this.do2DContiguousRepaint():this.doNormalRepaint()}finally{this.endFrame(),this.drawContext.frameStatistics.endFrame()}},L.prototype.doNormalRepaint=function(){this.createTerrain(),this.clearFrame(),this.deferOrderedRendering=!1,this.drawContext.pickingMode?this.drawContext.makePickFrustum()&&(this.doPick(),this.resolvePick()):(this.doDraw(),this.subsurfaceMode&&this.hasStencilBuffer&&(this.redrawSurface(),this.drawScreenRenderables()))},L.prototype.do2DContiguousRepaint=function(){this.createTerrain2DContiguous(),this.clearFrame(),this.drawContext.pickingMode?this.drawContext.makePickFrustum()&&(this.pick2DContiguous(),this.resolvePick()):this.draw2DContiguous()},L.prototype.resolvePick=function(){this.drawContext.pickTerrainOnly?this.resolveTerrainPick():this.drawContext.regionPicking?this.resolveRegionPick():this.resolveTopPick()},L.prototype.beginFrame=function(){var t=this.drawContext.currentGlContext;t.enable(t.BLEND),t.enable(t.CULL_FACE),t.enable(t.DEPTH_TEST),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.depthFunc(t.LEQUAL),this.drawContext.pickingMode&&(this.drawContext.makePickFramebuffer(),this.drawContext.bindFramebuffer(this.drawContext.pickFramebuffer))},L.prototype.endFrame=function(){var t=this.drawContext.currentGlContext;t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.blendFunc(t.ONE,t.ZERO),t.depthFunc(t.LESS),t.clearColor(0,0,0,1),this.drawContext.bindFramebuffer(null),this.drawContext.bindProgram(null)},L.prototype.clearFrame=function(){var t=this.drawContext,e=t.currentGlContext;e.clearColor(t.clearColor.red,t.clearColor.green,t.clearColor.blue,t.clearColor.alpha),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)},L.prototype.doDraw=function(){this.drawContext.renderShapes=!0,this.subsurfaceMode&&this.hasStencilBuffer?(this.drawContext.currentGlContext.disable(this.drawContext.currentGlContext.STENCIL_TEST),this.drawContext.surfaceShapeTileBuilder.clear(),this.drawLayers(!0),this.drawSurfaceRenderables(),this.drawContext.surfaceShapeTileBuilder.doRender(this.drawContext),this.deferOrderedRendering||(this.drawContext.currentGlContext.clear(this.drawContext.currentGlContext.DEPTH_BUFFER_BIT|this.drawContext.currentGlContext.STENCIL_BUFFER_BIT),this.drawContext.currentGlContext.enable(this.drawContext.currentGlContext.STENCIL_TEST),this.drawContext.currentGlContext.stencilFunc(this.drawContext.currentGlContext.ALWAYS,1,1),this.drawContext.currentGlContext.stencilOp(this.drawContext.currentGlContext.REPLACE,this.drawContext.currentGlContext.REPLACE,this.drawContext.currentGlContext.REPLACE),this.drawOrderedRenderables())):(this.drawContext.surfaceShapeTileBuilder.clear(),this.drawLayers(!0),this.drawSurfaceRenderables(),this.drawContext.surfaceShapeTileBuilder.doRender(this.drawContext),this.deferOrderedRendering||(this.drawOrderedRenderables(),this.drawScreenRenderables()))},L.prototype.redrawSurface=function(){this.drawContext.currentGlContext.enable(this.drawContext.currentGlContext.STENCIL_TEST),this.drawContext.currentGlContext.stencilFunc(this.drawContext.currentGlContext.EQUAL,1,1),this.drawContext.currentGlContext.stencilOp(this.drawContext.currentGlContext.KEEP,this.drawContext.currentGlContext.KEEP,this.drawContext.currentGlContext.KEEP),this.drawContext.surfaceShapeTileBuilder.clear(),this.drawLayers(!1),this.drawSurfaceRenderables(),this.drawContext.surfaceShapeTileBuilder.doRender(this.drawContext),this.drawContext.currentGlContext.disable(this.drawContext.currentGlContext.STENCIL_TEST)},L.prototype.doPick=function(){this.drawContext.terrain&&this.drawContext.terrain.pick(this.drawContext),this.drawContext.pickTerrainOnly||(this.subsurfaceMode&&this.hasStencilBuffer?(this.drawContext.currentGlContext.disable(this.drawContext.currentGlContext.STENCIL_TEST),this.drawContext.surfaceShapeTileBuilder.clear(),this.drawLayers(!0),this.drawSurfaceRenderables(),this.drawContext.surfaceShapeTileBuilder.doRender(this.drawContext),this.deferOrderedRendering||(this.drawContext.currentGlContext.clear(this.drawContext.currentGlContext.DEPTH_BUFFER_BIT|this.drawContext.currentGlContext.STENCIL_BUFFER_BIT),this.drawContext.currentGlContext.enable(this.drawContext.currentGlContext.STENCIL_TEST),this.drawContext.currentGlContext.stencilFunc(this.drawContext.currentGlContext.ALWAYS,1,1),this.drawContext.currentGlContext.stencilOp(this.drawContext.currentGlContext.REPLACE,this.drawContext.currentGlContext.REPLACE,this.drawContext.currentGlContext.REPLACE),this.drawOrderedRenderables(),this.drawContext.terrain.pick(this.drawContext),this.drawScreenRenderables())):(this.drawContext.surfaceShapeTileBuilder.clear(),this.drawLayers(!0),this.drawSurfaceRenderables(),this.drawContext.surfaceShapeTileBuilder.doRender(this.drawContext),this.deferOrderedRendering||(this.drawOrderedRenderables(),this.drawScreenRenderables())))},L.prototype.createTerrain=function(){var t=this.drawContext;t.terrain=this.globe.tessellator.tessellate(t),t.frameStatistics.setTerrainTileCount(t.terrain?t.terrain.surfaceGeometry.length:0)},L.prototype.makeCurrent=function(t){var e=this.drawContext;switch(e.globe.offset=t,e.globeStateKey=e.globe.stateKey,t){case-1:e.terrain=this.terrainLeft;break;case 0:e.terrain=this.terrainCenter;break;case 1:e.terrain=this.terrainRight}},L.prototype.createTerrain2DContiguous=function(){var t=this.drawContext;this.terrainCenter=null,t.globe.offset=0,t.globeStateKey=t.globe.stateKey,t.globe.intersectsFrustum(t.frustumInModelCoordinates)&&(this.terrainCenter=t.globe.tessellator.tessellate(t)),this.terrainRight=null,t.globe.offset=1,t.globeStateKey=t.globe.stateKey,t.globe.intersectsFrustum(t.frustumInModelCoordinates)&&(this.terrainRight=t.globe.tessellator.tessellate(t)),this.terrainLeft=null,t.globe.offset=-1,t.globeStateKey=t.globe.stateKey,t.globe.intersectsFrustum(t.frustumInModelCoordinates)&&(this.terrainLeft=t.globe.tessellator.tessellate(t))},L.prototype.draw2DContiguous=function(){var t="";this.terrainCenter&&(t+=" 0 ",this.makeCurrent(0),this.deferOrderedRendering=this.terrainLeft||this.terrainRight,this.doDraw()),this.terrainRight&&(t+=" 1 ",this.makeCurrent(1),this.deferOrderedRendering=this.terrainLeft||this.terrainLeft,this.doDraw()),this.deferOrderedRendering=!1,this.terrainLeft&&(t+=" -1 ",this.makeCurrent(-1),this.doDraw()),this.subsurfaceMode&&this.hasStencilBuffer&&(this.deferOrderedRendering=!0,this.terrainCenter&&(t+=" 0 ",this.makeCurrent(0),this.redrawSurface()),this.terrainRight&&(t+=" 1 ",this.makeCurrent(1),this.redrawSurface()),this.terrainLeft&&(t+=" -1 ",this.makeCurrent(-1),this.redrawSurface())),this.drawScreenRenderables()},L.prototype.pick2DContiguous=function(){this.terrainCenter&&(this.makeCurrent(0),this.deferOrderedRendering=this.terrainLeft||this.terrainRight,this.doPick()),this.terrainRight&&(this.makeCurrent(1),this.deferOrderedRendering=this.terrainLeft||this.terrainLeft,this.doPick()),this.deferOrderedRendering=!1,this.terrainLeft&&(this.makeCurrent(-1),this.doPick())},L.prototype.drawLayers=function(t){var e,i=Date.now(),r=this.drawContext,n=r.layers;r.accumulateOrderedRenderables=t;for(var o=0,s=n.length;o<s;o++)if(e=n[o]){r.currentLayer=e;try{e.render(r)}catch(t){c.log(c.LEVEL_SEVERE,"Error while rendering layer "+e.displayName+".\n"+t.toString())}}r.currentLayer=null;var a=Date.now();r.frameStatistics.layerRenderingTime=a-i},L.prototype.addLayer=function(t){t&&this.layers.push(t)},L.prototype.removeLayer=function(t){var e=this.indexOfLayer(t);e>=0&&this.layers.splice(e,1)},L.prototype.insertLayer=function(t,e){e&&this.layers.splice(t,0,e)},L.prototype.indexOfLayer=function(t){return this.layers.indexOf(t)},L.prototype.drawSurfaceRenderables=function(){var t,e=this.drawContext;
118for(e.reverseSurfaceRenderables();t=e.popSurfaceRenderable();)try{t.renderSurface(e)}catch(t){c.logMessage(c.LEVEL_WARNING,"WorldWindow","drawSurfaceRenderables","Error while rendering a surface renderable.\n"+t.message)}},L.prototype.drawOrderedRenderables=function(){var t,e=Date.now(),i=this.drawContext;if(i.sortOrderedRenderables(),this._orderedRenderingFilters)for(var r=0;r<this._orderedRenderingFilters.length;r++)this._orderedRenderingFilters[r](this.drawContext);for(i.orderedRenderingMode=!0;t=i.popOrderedRenderable();)try{t.renderOrdered(i)}catch(t){c.logMessage(c.LEVEL_WARNING,"WorldWindow","drawOrderedRenderables","Error while rendering an ordered renderable.\n"+t.message)}i.orderedRenderingMode=!1,i.frameStatistics.orderedRenderingTime=Date.now()-e},L.prototype.drawScreenRenderables=function(){for(var t,e=this.drawContext;t=e.nextScreenRenderable();)try{t.renderOrdered(e)}catch(t){c.logMessage(c.LEVEL_WARNING,"WorldWindow","drawOrderedRenderables","Error while rendering a screen renderable.\n"+t.message)}},L.prototype.resolveTopPick=function(){if(0!=this.drawContext.objectsAtPickPoint.objects.length){var t=this.drawContext.objectsAtPickPoint,e=this.drawContext.readPickColor(this.drawContext.pickPoint),i=null,r=null;if(e){for(var n=0,o=t.objects.length;n<o;n++){var s=t.objects[n];if(s.isTerrain&&(r=s),s.color.equals(e)&&(s.isOnTop=!0,i=s,r))break}this.drawContext.deepPicking||(t.clear(),i&&t.add(i),r&&r!=i&&t.add(r))}else t.clear()}},L.prototype.resolveTerrainPick=function(){for(var t,e=this.drawContext.objectsAtPickPoint,i=0,r=e.objects.length;i<r;i++)if(t=e.objects[i],t.isTerrain){t.isOnTop=!0;break}},L.prototype.resolveRegionPick=function(){if(0!=this.drawContext.objectsAtPickPoint.objects.length)for(var t,e,i=this.drawContext.objectsAtPickPoint,r=this.drawContext.readPickColors(this.drawContext.pickRectangle),n=0,o=i.objects.length;n<o;n++)if(t=i.objects[n]){var s=t.color.toByteString();e=r[s],e?t.isOnTop=!0:t.userObject instanceof E&&(i.objects.splice(n,1),n-=1)}},L.prototype.callRedrawCallbacks=function(t){for(var e=0,i=this._redrawCallbacks.length;e<i;e++)try{this._redrawCallbacks[e](this,t)}catch(t){c.log(c.LEVEL_SEVERE,"Exception calling redraw callback.\n"+t.toString())}},L.prototype.goTo=function(t,e){this.goToAnimator.goTo(t,e)},L.prototype.declutter=function(e,i){if(!i)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","declutter","Group ID is null, undefined or 0."));for(var r=[],n=0;n<e.orderedRenderables.length;n++){var o=e.orderedRenderables[n].orderedRenderable;o.declutterGroup===i&&r.push(o)}for(var s=[],a=0;a<r.length;a++){var l=r[a],h=l.screenBounds;h&&h.intersectsRectangles(s)?l.targetVisibility=0:(l.targetVisibility=1,h&&s.push(h))}},L.prototype.rayThroughScreenPoint=function(e){if(!e)throw new t(c.logMessage(c.LEVEL_SEVERE,"WorldWindow","rayThroughScreenPoint","missingPoint"));var i=new S(e[0],this.viewport.height-e[1],0),r=new S(0,0,0),n=new S(0,0,0);this.computeViewingTransform(this.scratchProjection,this.scratchModelview);var o=f.fromIdentity();o.setToMultiply(this.scratchProjection,this.scratchModelview);var s=f.fromIdentity();if(s.invertMatrix(o),!s.unProject(i,this.viewport,r))return null;if(i[2]=1,!s.unProject(i,this.viewport,n))return null;var a=this.scratchModelview.extractEyePoint(new S(0,0,0)),l=new S(a[0],a[1],a[2]),h=new S(n[0],n[1],n[2]);return h.subtract(r),h.normalize(),new u(l,h)},L}),i("util/WWMessage",[],function(){"use strict";return function(t,e){this.type=t,this.source=e}}), 119i("WorldWind",["./formats/aaigrid/AAIGridConstants","./formats/aaigrid/AAIGridMetadata","./formats/aaigrid/AAIGridReader","./error/AbstractError","./geom/Angle","./shapes/Annotation","./shapes/AnnotationAttributes","./util/measure/AreaMeasurer","./error/ArgumentError","./globe/AsterV2ElevationCoverage","./layer/AtmosphereLayer","./shaders/AtmosphereProgram","./shaders/BasicProgram","./shaders/BasicTextureProgram","./util/BasicTimeSequence","./BasicWorldWindowController","./layer/BingAerialLayer","./layer/BingAerialWithLabelsLayer","./layer/BingRoadsLayer","./layer/BingWMSLayer","./layer/BMNGLandsatLayer","./layer/BMNGLayer","./layer/BMNGOneImageLayer","./layer/BMNGRestLayer","./geom/BoundingBox","./gesture/ClickRecognizer","./formats/collada/ColladaLoader","./ut
119il/Color","./shapes/Compass","./layer/CompassLayer","./layer/CoordinatesDisplayLayer","./util/Date","./layer/DigitalGlobeTiledImageLayer","./gesture/DragRecognizer","./render/DrawContext","./globe/EarthElevationModel","./globe/EarthRestElevationCoverage","./globe/ElevationCoverage","./globe/ElevationModel","./util/Font","./util/FrameStatistics","./layer/FrameStatisticsLayer","./render/FramebufferTexture","./render/FramebufferTile","./render/FramebufferTileController","./geom/Frustum","./globe/GebcoElevationCoverage","./shapes/GeographicMesh","./projections/GeographicProjection","./shapes/GeographicText","./formats/geojson/GeoJSONExporter","./formats/geojson/GeoJSONGeometry","./formats/geojson/GeoJSONGeometryCollection","./formats/geojson/GeoJSONGeometryLineString","./formats/geojson/GeoJSONGeometryMultiLineString","./formats/geojson/GeoJSONGeometryMultiPoint","./formats/geojson/GeoJSONGeometryMultiPolygon","./formats/geojson/GeoJSONGeometryPoint","./formats/geojson/GeoJSONGeometryPolygon","./formats/geojson/GeoJSONParser","./formats/geotiff/GeoTiffReader","./gesture/GestureRecognizer","./globe/Globe","./globe/Globe2D","./util/GoToAnimator","./shaders/GpuProgram","./cache/GpuResourceCache","./shaders/GpuShader","./shaders/GroundProgram","./util/HashMap","./util/HighlightController","./ut
119il/ImageSource","./render/ImageTile","./util/Insets","./formats/kml/KmlAbstractView","./formats/kml/util/KmlAttribute","./formats/kml/styles/KmlBalloonStyle","./formats/kml/KmlCamera","./formats/kml/util/KmlChange","./formats/kml/styles/KmlColorStyle","./formats/kml/features/KmlContainer","./formats/kml/controls/KmlControls","./formats/kml/util/KmlCreate","./formats/kml/util/KmlDelete","./formats/kml/features/KmlDocument","./formats/kml/KmlElements","./formats/kml/util/KmlElementsFactory","./formats/kml/util/KmlElementsFactoryCached","./formats/kml/features/KmlFeature","./formats/kml/KmlFile","./formats/kml/KmlFileCache","./formats/kml/features/KmlFolder","./formats/kml/geom/KmlGeometry","./formats/kml/features/KmlGroundOverlay","./formats/kml/util/KmlHrefResolver","./formats/kml/KmlIcon","./formats/kml/styles/KmlIconStyle","./formats/kml/util/KmlImagePyramid","./formats/kml/util/KmlItemIcon","./formats/kml/styles/KmlLabelStyle","./formats/kml/KmlLatLonAltBox","./formats/kml/KmlLatLonBox","./formats/kml/KmlLatLonQuad","./formats/kml/geom/KmlLinearRing","./formats/kml/geom/KmlLineString","./formats/kml/styles/KmlLineStyle","./formats/kml/KmlLink","./formats/kml/styles/KmlListStyle","./formats/kml/KmlLocation","./formats/kml/KmlLod","./formats/kml/KmlLookAt","./formats/kml/geom/KmlMultiGeometry","./formats/kml/geom/KmlMultiTrack","./formats/kml/features/KmlNetworkLink","./formats/kml/util/KmlNetworkLinkControl","./formats/kml/util/KmlNodeTransformers","./formats/kml/KmlObject","./formats/kml/KmlOrientation","./formats/kml/features/KmlOverlay","./formats/kml/util/KmlPair","./formats/kml/features/KmlPhotoOverlay","./formats/kml/features/KmlPlacemark","./formats/kml/geom/KmlPoint","./formats/kml/geom/KmlPolygon","./formats/kml/styles/KmlPolyStyle","./formats/kml/util/KmlRefreshListener","./formats/kml/KmlRegion","./formats/kml/util/KmlRemoteFile","./formats/kml/util/KmlScale","./formats/kml/util/KmlSchema","./formats/kml/features/KmlScreenOverlay","./formats/kml/styles/KmlStyle","./formats/kml/styles/KmlStyleMap","./formats/kml/util/KmlStyleResolver","./formats/kml/styles/KmlStyleSelector","./formats/kml/styles/KmlSubStyle","./formats/kml/KmlTimePrimitive","./formats/kml/KmlTimeSpan","./formats/kml/KmlTimeStamp","./formats/kml/features/KmlTour","./formats/kml/geom/KmlTrack","./formats/kml/util/KmlTreeKeyValueCache","./formats/kml/controls/KmlTreeVisibility","./formats/kml/util/KmlUpdate","./formats/kml/util/KmlViewVolume","./formats/kml/KmzFile","./layer/LandsatRestLayer","./layer/Layer","./util/measure/LengthMeasurer","./util/Level","./util/LevelRowColumnUrlBuilder","./util/LevelSet","./geom/Line","./geom/Location","./util/Logger","./navigate/LookAtNavigator","./geom/Matrix","./geom/MeasuredLocation","./util/measure/MeasurerUtils","./cache/MemoryCache","./cache/MemoryCacheListener","./layer/MercatorTiledImageLayer","./navigate/Navigator","./util/NominatimGeocoder","./error/NotYetImplementedError","./util/Offset","./layer/OpenStreetMapImageLayer","./gesture/PanRecognizer","./shapes/Path","./util/PeriodicTimeSequence","./pick/PickedObject","./pick/PickedObjectList","./gesture/PinchRecognizer","./shapes/Placemark","./shapes/PlacemarkAttributes","./geom/Plane","./shapes/Polygon","./util/PolygonSplitter","./geom/Position","./projections/ProjectionEquirectangular","./projections/ProjectionGnomonic","./projections/ProjectionMercator","./projections/ProjectionPolarEquidistant","./projections/ProjectionUPS","./projections/ProjectionWgs84","./geom/Rectangle","./render/Renderable","./layer/RenderableLayer","./layer/RestTiledImageLayer","./gesture/RotationRecognizer","./shapes/ScreenImage","./shapes/ScreenText","./geom/Sector","./shapes/ShapeAttributes","./formats/sh
119apefile/Shapefile","./layer/ShowTessellationLayer","./shaders/SkyProgram","./layer/StarFieldLayer","./shaders/StarFieldProgram","./util/SunPosition","./shapes/SurfaceImage","./shapes/SurfaceCircle","./shapes/SurfaceEllipse","./shapes/SurfacePolygon","./shapes/SurfacePolyline","./shapes/SurfaceRectangle","./render/SurfaceRenderable","./shapes/SurfaceSector","./shapes/SurfaceShape","./shapes/SurfaceShapeTile","./shapes/SurfaceShapeTileBuilder","./render/SurfaceTile","./render/SurfaceTileRenderer","./shaders/SurfaceTileRendererProgram","./gesture/TapRecognizer","./layer/TectonicPlatesLayer","./globe/Terrain","./globe/TerrainTile","./globe/TerrainTileList","./globe/Tessellator","./shapes/Text","./shapes/TextAttributes","./render/TextRenderer","./render/Texture","./render/TextureTile","./util/Tile","./globe/TiledElevationCoverage","./layer/TiledImageLayer","./util/TileFactory","./gesture/TiltRecognizer","./gesture/Touch","./shapes/TriangleMesh","./error/UnsupportedOperationError","./globe/UsgsNedElevationCoverage","./globe/UsgsNedHiElevationCoverage","./geom/Vec2","./geom/Vec3","./layer/ViewControlsLayer","./ogc/wcs/WcsCapabilities","./ogc/wcs/WcsCoverage","./ogc/wcs/WcsCoverageDescriptions","./globe/WcsEarthElevationCoverage","./util/WcsTileUrlBuilder","./ogc/wcs/WebCoverageService","./ogc/WfsCapabilities","./formats/wkt/Wkt","./formats/wkt/WktElements","./formats/wkt/WktExporter","./formats/wkt/geom/WktGeometryCollection","./formats/wkt/geom/WktLineString","./formats/wkt/geom/WktMultiLineString","./formats/wkt/geom/WktMultiPoint","./formats/wkt/geom/WktMultiPolygon","./formats/wkt/geom/WktObject","./formats/wkt/geom/WktPoint","./formats/wkt/geom/WktPolygon","./formats/wkt/WktTokens","./formats/wkt/geom/WktTriangle","./formats/wkt/WktType","./ogc/wms/WmsCapabilities","./layer/WmsLayer","./ogc/wms/WmsLayerCapabilities","./layer/WmsTimeDimensionedLayer","./util/WmsUrlBuilder","./ogc/wmts/WmtsCapabilities","./layer/WmtsLayer","./ogc/wmts/WmtsLayerCapabilities","./WorldWindow","./WorldWindowController","./ut
119il/WWMath","./util/WWMessage","./util/WWUtil","./util/XmlDocument"],function(t,e,i,r,n,o,s,a,l,h,u,c,d,f,p,g,m,y,E,v,_,b,S,w,L,T,x,R,M,C,A,P,N,O,I,D,k,V,F,G,W,B,U,K,j,z,q,Y,H,X,J,Z,Q,$,tt,et,it,rt,nt,ot,st,at,lt,ht,ut,ct,dt,ft,pt,gt,mt,yt,Et,vt,_t,bt,St,wt,Lt,Tt,xt,Rt,Mt,Ct,At,Pt,Nt,Ot,It,Dt,kt,Vt,Ft,Gt,Wt,Bt,Ut,Kt,jt,zt,qt,Yt,Ht,Xt,Jt,Zt,Qt,$t,te,ee,ie,re,ne,oe,se,ae,le,he,ue,ce,de,fe,pe,ge,me,ye,Ee,ve,_e,be,Se,we,Le,Te,xe,Re,Me,Ce,Ae,Pe,Ne,Oe,Ie,De,ke,Ve,Fe,Ge,We,Be,Ue,Ke,je,ze,qe,Ye,He,Xe,Je,Ze,Qe,$e,ti,ei,ii,ri,ni,oi,si,ai,li,hi,ui,ci,di,fi,pi,gi,mi,yi,Ei,vi,_i,bi,Si,wi,Li,Ti,xi,Ri,Mi,Ci,Ai,Pi,Ni,Oi,Ii,Di,ki,Vi,Fi,Gi,Wi,Bi,Ui,Ki,ji,zi,qi,Yi,Hi,Xi,Ji,Zi,Qi,$i,tr,er,ir,rr,nr,or,sr,ar,lr,hr,ur,cr,dr,fr,pr,gr,mr,yr,Er,vr,_r,br,Sr,wr,Lr,Tr,xr,Rr,Mr,Cr,Ar,Pr,Nr,Or,Ir,Dr,kr,Vr,Fr,Gr,Wr,Br,Ur,Kr,jr,zr,qr,Yr,Hr,Xr,Jr,Zr,Qr,$r,tn,en,rn){"use strict";var nn={VERSION:"0.9.0",ABSOLUTE:"absolute",AFTER_REDRAW:"afterRedraw",BEFORE_REDRAW:"beforeRedraw",BEGAN:"began",CANCELLED:"cancelled",CHANGED:"changed",CLAMP_TO_GROUND:"clampToGroun
119d",EARTH_RADIUS:6371e3,EAST:"east",ENDED:"ended",FAILED:"failed",FILTER_LINEAR:"filter_linear",FILTER_NEAREST:"filter_nearest",GREAT_CIRCLE:"greatCircle",LINEAR:"linear",MULTI_POINT:"multiPoint",NORTH:"north",NULL:"null",OFFSET_FRACTION:"fraction",OFFSET_INSET_PIXELS:"insetPixels",OFFSET_PIXELS:"pixels",POINT:"point",POLYLINE:"polyline",POLYGON:"polygon",POSSIBLE:"possible",RECOGNIZED:"recognized",REDRAW_EVENT_TYPE:"WorldWindRedraw",RELATIVE_TO_GLOBE:"relativeToGlobe",RELATIVE_TO_GROUND:"relativeToGround",RELATIVE_TO_SCREEN:"relativeToScreen",RHUMB_LINE:"rhumbLine",SOUTH:"south",WEST:"west",WGS84_SEMI_MAJOR_AXIS:6378137,WGS84_INVERSE_FLATTENING:298.257223563};return nn.AAIGridConstants=t,nn.AAIGridMetadata=e,nn.AAIGridReader=i,nn.AbstractError=r,nn.Angle=n,nn.Annotation=o,nn.AnnotationAttributes=s,nn.AreaMeasurer=a,nn.ArgumentError=l,nn.AsterV2ElevationCoverage=h,nn.AtmosphereLayer=u,nn.AtmosphereProgram=c,nn.BasicProgram=d,nn.BasicTextureProgram=f,nn.BasicTimeSequence=p,nn.BasicWorldWindowController=g,nn.BingAerialLayer=m,nn.BingAerialWithLabelsLayer=y,nn.BingRoadsLayer=E,nn.BingWMSLayer=v,nn.BMNGLandsatLayer=_,nn.BMNGLayer=b,nn.BMNGOneImageLayer=S,nn.BMNGRestLayer=w,nn.BoundingBox=L,nn.ClickRecognizer=T,nn.ColladaLoader=x,nn.Color=R,nn.Compass=M,nn.CompassLayer=C,nn.CoordinatesDisplayLayer=A,nn.DateWW=P,nn.DigitalGlobeTiledImageLayer=N,nn.DragRecognizer=O,nn.DrawContext=I,nn.EarthElevationModel=D,nn.EarthRestElevationCoverage=k,nn.ElevationCoverage=V,nn.ElevationModel=F,nn.Font=G,nn.FrameStatistics=W,nn.FrameStatisticsLayer=B,nn.FramebufferTexture=U,nn.FramebufferTile=K,nn.FramebufferTileController=j,nn.Frustum=z,nn.GebcoElevationCoverage=q,nn.GeographicMesh=Y,nn.GeographicProjection=H,nn.GeographicText=X,nn.GeoJSONExporter=J,nn.GeoJSONGeometry=Z,nn.GeoJSONGeometryCollection=Q,nn.GeoJSONGeometryLineString=$,nn.GeoJSONGeometryMultiLineString=tt,nn.GeoJSONGeometryMultiPoint=et,nn.GeoJSONGeometryMultiPolygon=it,nn.GeoJSONGeometryPoint=rt,nn.GeoJSONGeometryPolygon=nt,nn.GeoJSONParser=ot,nn.GeoTiffReader=st,nn.GestureRecognizer=at,nn.Globe=lt,nn.Globe2D=ht,nn.GoToAnimator=ut,nn.GpuProgram=ct,nn.GpuResourceCache=dt,nn.GpuShader=ft,nn.GroundProgram=pt,nn.HashMap=gt,nn.HighlightController=mt,nn.ImageSource=yt,nn.ImageTile=Et,nn.Insets=vt,nn.KmlAbstractView=_t,nn.KmlAttribute=bt,nn.KmlBalloonStyle=St,nn.KmlCamera=wt,nn.KmlChange=Lt,nn.KmlColorStyle=Tt,nn.KmlContainer=xt,nn.KmlControls=Rt,nn.KmlCreate=Mt,nn.KmlDelete=Ct,nn.KmlDocument=At,nn.KmlElements=Pt,nn.KmlElementsFactory=Nt,nn.KmlElementsFactoryCached=Ot,nn.KmlFeature=It,nn.KmlFile=Dt,nn.KmlFileCache=kt,nn.KmlFolder=Vt,nn.KmlGeometry=Ft,nn.KmlGroundOverlay=Gt,nn.KmlHrefResolver=Wt,nn.KmlIcon=Bt,nn.KmlIconStyle=Ut,nn.KmlImagePyramid=Kt,nn.KmlItemIcon=jt,nn.KmlLabelStyle=zt,nn.KmlLatLonAltBox=qt,nn.KmlLatLonBox=Yt,nn.KmlLatLonQuad=Ht,nn.KmlLinearRing=Xt,nn.KmlLineString=Jt,nn.KmlLineStyle=Zt,nn.KmlListStyle=$t,nn.KmlLink=Qt,nn.KmlLocation=te,nn.KmlLod=ee,nn.KmlLookAt=ie,nn.KmlMultiGeometry=re,nn.KmlMultiTrack=ne,nn.KmlNetworkLink=oe,nn.KmlNetworkLinkControl=se,nn.KmlNodeTransformers=ae,nn.KmlObject=le,nn.KmlOrientation=he,nn.KmlOverlay=ue,nn.KmlPair=ce,nn.KmlPhotoOverlay=de,nn.KmlPlacemark=fe,nn.KmlPoint=pe,nn.KmlPolygon=ge,nn.KmlPolyStyle=me,nn.KmlRefreshListener=ye,nn.KmlRegion=Ee,nn.KmlRemoteFile=ve,nn.KmlScale=_e,nn.KmlSchema=be,nn.KmlScreenOverlay=Se,nn.KmlStyle=we,nn.KmlStyleMap=Le,nn.KmlStyleResolver=Te,nn.KmlStyleSelector=xe,nn.KmlSubStyle=Re,nn.KmlTimePrimitive=Me,nn.KmlTimeSpan=Ce,nn.KmlTimeStamp=Ae,nn.KmlTour=Pe,nn.KmlTrack=Ne,nn.KmlTreeKeyValueCache=Oe,nn.KmlTreeVisibility=Ie,nn.KmlUpdate=De,nn.KmlViewVolume=ke,nn.KmzFile=Ve,nn.LandsatRestLayer=Fe,nn.Layer=Ge,nn.LengthMeasurer=We,nn.Level=Be,nn.LevelRowColumnUrlBuilder=Ue,nn.LevelSet=Ke,nn.Line=je,nn.Location=ze,nn.Logger=qe,nn.LookAtNavigator=Ye,nn.Matrix=He,nn.MeasuredLocation=Xe,nn.MeasurerUtils=Je,nn.MemoryCache=Ze,nn.MemoryCacheListener=Qe,nn.MercatorTiledImageLayer=$e,nn.Navigator=ti,nn.NominatimGeocoder=ei,nn.NotYetImplementedError=ii,nn.Offset=ri,nn.OpenStreetMapImageLayer=ni,nn.PanRecognizer=oi,nn.Path=si,nn.PeriodicTimeSequence=ai,nn.PickedObject=li,nn.PickedObjectList=hi,nn.PinchRecognizer=ui,nn.Placemark=ci,nn.PlacemarkAttributes=di,nn.Plane=fi,nn.Polygon=pi,nn.PolygonSplitter=gi,nn.Position=mi,nn.ProjectionEquirectangular=yi,nn.ProjectionGnomonic=Ei,nn.ProjectionMercator=vi,nn.ProjectionPolarEquidistant=_i,nn.ProjectionUPS=bi,nn.ProjectionWgs84=Si,nn.Rectangle=wi,nn.Renderable=Li,nn.RenderableLayer=Ti,nn.RestTiledImageLayer=xi,nn.RotationRecognizer=Ri,nn.ScreenText=Ci,nn.ScreenImage=Mi,nn.Sector=Ai,nn.ShapeAttributes=Pi,nn.Shapefile=Ni,nn.ShowTessellationLayer=Oi,nn.SkyProgram=Ii,nn.StarFieldLayer=Di,nn.StarFieldProgram=ki,nn.SunPosition=Vi,nn.SurfaceImage=Fi,nn.SurfaceCircle=Gi,nn.SurfaceEllipse=Wi,nn.SurfacePolygon=Bi,nn.SurfacePolyline=Ui,nn.SurfaceRectangle=Ki,nn.SurfaceRenderable=ji,nn.SurfaceSector=zi,nn.SurfaceShape=qi,nn.SurfaceShapeTile=Yi,nn.SurfaceShapeTileBuilder=Hi,nn.SurfaceTile=Xi,nn.SurfaceTileRenderer=Ji,nn.SurfaceTileRendererProgram=Zi,nn.TapRecognizer=Qi,nn.TectonicPlatesLayer=$i,nn.Terrain=tr,nn.TerrainTile=er,nn.TerrainTileList=ir,nn.Tessellator=rr,nn.Text=nr,nn.TextAttributes=or,nn.TextRenderer=sr,nn.Texture=ar,nn.TextureTile=lr,nn.Tile=hr,nn.TiledElevationCoverage=ur,nn.TiledImageLayer=cr,nn.TileFactory=dr,nn.TiltRecognizer=fr,nn.Touch=pr,nn.TriangleMesh=gr,nn.UsgsNedElevationCoverage=mr,nn.UsgsNedHiElevationCoverage=yr,nn.UnsupportedOperationError=Er,nn.Vec2=vr,nn.Vec3=_r,nn.ViewControl
119sLayer=br,nn.WcsCapabilities=Sr,nn.WcsCoverage=wr,nn.WcsCoverageDescriptions=Lr,nn.WcsEarthElevationCoverage=Tr,nn.WcsTileUrlBuilder=xr,nn.WebCoverageService=Rr,nn.WfsCapabilities=Mr,nn.Wkt=Cr,nn.WktElements=Ar,nn.WktExporter=Pr,nn.WktGeometryCollection=Nr,nn.WktLineString=Or,nn.WktMultiLineString=Ir,nn.WktMultiPoint=Dr,nn.WktMultiPolygon=kr,nn.WktObject=Vr,nn.WktPoint=Fr,nn.WktPolygon=Gr,nn.WktTokens=Wr,nn.WktTriangle=Br,nn.WktType=Ur,nn.WmsCapabilities=Kr,nn.WmsLayer=jr,nn.WmsLayerCapabilities=zr,nn.WmsTimeDimensionedLayer=qr,nn.WmsUrlBuilder=Yr,nn.WmtsCapabilities=Hr,nn.WmtsLayer=Xr,nn.WmtsLayerCapabilities=Jr,nn.WWMath=$r,nn.WWMessage=tn,nn.WWUtil=en,nn.WorldWindow=Zr,nn.WorldWindowController=Qr,nn.configuration={gpuCacheSize:25e7,baseUrl:en.worldwindlibLocation()||en.currentUrlSansFilePart()+"/../",layerRetrievalQueueSize:16,coverageRetrievalQueueSize:16,bingLogoPlacement:new ri(nn.OFFSET_INSET_PIXELS,7,nn.OFFSET_PIXELS,7),bingLogoAlignment:new ri(nn.OFFSET_FRACTION,1,nn.OFFSET_FRACTION,0)},nn.BingMapsKey=null,window.WorldWind=nn,nn}),e("WorldWind")});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.