diff --git a/README.md b/README.md index 41b5175..4b1f803 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,26 @@ pip3 install --user --upgrade -r requirements.txt Need to get `cesium.key` from Cesium ION. +# Scripts +The following scripts are available for websites: + +* `gnss-earth.py` --- All satellites +* `beidou-earth.py` --- Beidou (China) satellites +* `galileo-earth.py` --- Galileo (Europe) satellites +* `glonass-earth.py` --- GLONASS (Russia) satellites +* `gps-earth.py` --- GPS (USA) satellites + + +# Websites +Websites available for viewing. + +* https://gnss.spacecruft.org/ +* https://beidou.spacecruft.org/ +* https://galileo.spacecruft.org/ +* https://gps.spacecruft.org/ +* https://glonass.spacecruft.org/ + + # Upstream Dependencies Uses: diff --git a/gnss-earth-single.py b/beidou-earth.py similarity index 75% rename from gnss-earth-single.py rename to beidou-earth.py index 7df999d..bee7cfe 100755 --- a/gnss-earth-single.py +++ b/beidou-earth.py @@ -10,14 +10,6 @@ from datetime import datetime, timedelta from satellite_czml import satellite_czml from satellite_czml import satellite -# GNSS -#url = 'https://celestrak.com/NORAD/elements/gnss.txt' -# GPS Operational -#url = 'https://celestrak.com/NORAD/elements/gps-ops.txt' -# Galileo -#url = 'https://celestrak.com/NORAD/elements/galileo.txt' -# GLONASS Operational -#url = 'https://celestrak.com/NORAD/elements/glo-ops.txt' # Beidou url = 'https://celestrak.com/NORAD/elements/beidou.txt' @@ -25,24 +17,21 @@ apikey = open('cesium.key').read().strip() tles = [l.decode("utf-8").strip() for l in urllib.request.urlopen(url).readlines()] tle_list = [[tles[i],tles[i+1],tles[i+2]] for i,_ in enumerate(tles) if i%3==0] -small_tle_list = tle_list[:4] -small_tle_list -single_tle = [tle_list[0]] -single_czml = satellite_czml(tle_list=single_tle).get_czml() +multiple_czml = satellite_czml(tle_list=tle_list).get_czml() # DASH external_css = ['https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Widgets/widgets.css'] external_scripts = [{'src':'https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js'}] app = dash.Dash(__name__, - title='Spacecruft GNSS Earth', + title='Spacecruft Beidou Earth', external_scripts=external_scripts, external_stylesheets=external_css) app.layout = html.Div(children=[ html.Div(id='cesiumContainer'), - html.Div(id='czml', style={'display': 'none'}, children=single_czml), + html.Div(id='czml', style={'display': 'none'}, children=multiple_czml), html.Div(id='apikey', style={'display': 'none'}, children=apikey), ]) @@ -76,5 +65,5 @@ function(id, czml, apikey) { ) if __name__ == '__main__': - app.run_server(debug=True, use_reloader=False) + app.run_server(debug=False, port=8051, use_reloader=False) diff --git a/cesium/Cesium.js b/cesium/Cesium.js deleted file mode 100644 index 8c20a5f..0000000 --- a/cesium/Cesium.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Cesium={})}(this,function(exports){"use strict";function defined(e){return null!=e}function DeveloperError(e){var t;this.name="DeveloperError",this.message=e;try{throw new Error}catch(e){t=e.stack}this.stack=t}defined(Object.create)&&(DeveloperError.prototype=Object.create(Error.prototype),DeveloperError.prototype.constructor=DeveloperError),DeveloperError.prototype.toString=function(){var e=this.name+": "+this.message;return defined(this.stack)&&(e+="\n"+this.stack.toString()),e},DeveloperError.throwInstantiationError=function(){throw new DeveloperError("This function defines an interface and should not be called directly.")};var Check={};function getUndefinedErrorMessage(e){return e+" is required, actual value was undefined"}function getFailedTypeErrorMessage(e,t,i){return"Expected "+i+" to be typeof "+t+", actual typeof was "+e}function defaultValue(e,t){return null!=e?e:t}function MersenneTwister(e){null==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)}Check.typeOf={},Check.defined=function(e,t){if(!defined(t))throw new DeveloperError(getUndefinedErrorMessage(e))},Check.typeOf.func=function(e,t){if("function"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"function",e))},Check.typeOf.string=function(e,t){if("string"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"string",e))},Check.typeOf.number=function(e,t){if("number"!=typeof t)throw new DeveloperError(getFailedTypeErrorMessage(typeof t,"number",e))},Check.typeOf.number.lessThan=function(e,t,i){if(Check.typeOf.number(e,t),i<=t)throw new DeveloperError("Expected "+e+" to be less than "+i+", actual value was "+t)},Check.typeOf.number.lessThanOrEquals=function(e,t,i){if(Check.typeOf.number(e,t),i>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},MersenneTwister.prototype.genrand_int32=function(){var e,t,i=new Array(0,this.MATRIX_A);if(this.mti>=this.N){for(this.mti==this.N+1&&this.init_genrand(5489),t=0;t>>1^i[1&e];for(;t>>1^i[1&e];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^i[1&e],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,(e^=e>>>18)>>>0},MersenneTwister.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};var CesiumMath={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,EPSILON21:1e-21,GRAVITATIONALPARAMETER:3986004418e5,SOLAR_RADIUS:6955e5,LUNAR_RADIUS:1737400,SIXTY_FOUR_KILOBYTES:65536,FOUR_GIGABYTES:4294967296};CesiumMath.sign=defaultValue(Math.sign,function(e){return 0===(e=+e)||e!=e?e:0=Math.PI?e-t:e},CesiumMath.clampToLatitudeRange=function(e){return CesiumMath.clamp(e,-1*CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO)},CesiumMath.negativePiToPi=function(e){return CesiumMath.zeroToTwoPi(e+CesiumMath.PI)-CesiumMath.PI},CesiumMath.zeroToTwoPi=function(e){var t=CesiumMath.mod(e,CesiumMath.TWO_PI);return Math.abs(t)CesiumMath.EPSILON14?CesiumMath.TWO_PI:t},CesiumMath.mod=function(e,t){return(e%t+t)%t},CesiumMath.equalsEpsilon=function(e,t,i,r){i=defaultValue(i,0),r=defaultValue(r,i);var n=Math.abs(e-t);return n<=r||n<=i*Math.max(Math.abs(e),Math.abs(t))},CesiumMath.lessThan=function(e,t,i){return e-t<-i},CesiumMath.lessThanOrEquals=function(e,t,i){return e-t>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},CesiumMath.clamp=function(e,t,i){return eMath.abs(e)?CesiumMath.PI_OVER_TWO-i:i,i=e<0?CesiumMath.PI-i:i,i=t<0?-i:i},Cartesian3.fromSpherical=function(e,t){defined(t)||(t=new Cartesian3);var i=e.clock,r=e.cone,n=defaultValue(e.magnitude,1),e=n*Math.sin(r);return t.x=e*Math.cos(i),t.y=e*Math.sin(i),t.z=n*Math.cos(r),t},Cartesian3.fromElements=function(e,t,i,r){return defined(r)?(r.x=e,r.y=t,r.z=i,r):new Cartesian3(e,t,i)},Cartesian3.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Cartesian3(e.x,e.y,e.z)},Cartesian3.fromCartesian4=Cartesian3.clone,Cartesian3.packedLength=3,Cartesian3.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i]=e.z,t},Cartesian3.unpack=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new Cartesian3),i.x=e[t++],i.y=e[t++],i.z=e[t],i},Cartesian3.packArray=function(e,t){var i=e.length,r=3*i;if(defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var n=0;nCesiumMath.EPSILON12);return defined(n)?(n.x=a*_,n.y=o*y,n.z=s*C,n):new Cartesian3(a*_,o*y,s*C)}function Cartographic(e,t,i){this.longitude=defaultValue(e,0),this.latitude=defaultValue(t,0),this.height=defaultValue(i,0)}Cartographic.fromRadians=function(e,t,i,r){return i=defaultValue(i,0),defined(r)?(r.longitude=e,r.latitude=t,r.height=i,r):new Cartographic(e,t,i)},Cartographic.fromDegrees=function(e,t,i,r){return e=CesiumMath.toRadians(e),t=CesiumMath.toRadians(t),Cartographic.fromRadians(e,t,i,r)};var cartesianToCartographicN=new Cartesian3,cartesianToCartographicP=new Cartesian3,cartesianToCartographicH=new Cartesian3,wgs84OneOverRadii=new Cartesian3(1/6378137,1/6378137,1/6356752.314245179),wgs84OneOverRadiiSquared=new Cartesian3(1/40680631590769,1/40680631590769,1/40408299984661.445),wgs84CenterToleranceSquared=CesiumMath.EPSILON1;function initialize(e,t,i,r){t=defaultValue(t,0),i=defaultValue(i,0),r=defaultValue(r,0),e._radii=new Cartesian3(t,i,r),e._radiiSquared=new Cartesian3(t*t,i*i,r*r),e._radiiToTheFourth=new Cartesian3(t*t*t*t,i*i*i*i,r*r*r*r),e._oneOverRadii=new Cartesian3(0===t?0:1/t,0===i?0:1/i,0===r?0:1/r),e._oneOverRadiiSquared=new Cartesian3(0===t?0:1/(t*t),0===i?0:1/(i*i),0===r?0:1/(r*r)),e._minimumRadius=Math.min(t,i,r),e._maximumRadius=Math.max(t,i,r),e._centerToleranceSquared=CesiumMath.EPSILON1,0!==e._radiiSquared.z&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Ellipsoid(e,t,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,initialize(this,e,t,i)}Cartographic.fromCartesian=function(e,t,i){var r=defined(t)?t.oneOverRadii:wgs84OneOverRadii,n=defined(t)?t.oneOverRadiiSquared:wgs84OneOverRadiiSquared,r=scaleToGeodeticSurface(e,r,n,defined(t)?t._centerToleranceSquared:wgs84CenterToleranceSquared,cartesianToCartographicP);if(defined(r)){t=Cartesian3.multiplyComponents(r,n,cartesianToCartographicN),t=Cartesian3.normalize(t,t),n=Cartesian3.subtract(e,r,cartesianToCartographicH),r=Math.atan2(t.y,t.x),t=Math.asin(t.z),n=CesiumMath.sign(Cartesian3.dot(n,e))*Cartesian3.magnitude(n);return defined(i)?(i.longitude=r,i.latitude=t,i.height=n,i):new Cartographic(r,t,n)}},Cartographic.toCartesian=function(e,t,i){return Cartesian3.fromRadians(e.longitude,e.latitude,e.height,t,i)},Cartographic.clone=function(e,t){if(defined(e))return defined(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Cartographic(e.longitude,e.latitude,e.height)},Cartographic.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},Cartographic.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.longitude-t.longitude)<=i&&Math.abs(e.latitude-t.latitude)<=i&&Math.abs(e.height-t.height)<=i},Cartographic.ZERO=Object.freeze(new Cartographic(0,0,0)),Cartographic.prototype.clone=function(e){return Cartographic.clone(this,e)},Cartographic.prototype.equals=function(e){return Cartographic.equals(this,e)},Cartographic.prototype.equalsEpsilon=function(e,t){return Cartographic.equalsEpsilon(this,e,t)},Cartographic.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},Object.defineProperties(Ellipsoid.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}}),Ellipsoid.clone=function(e,t){if(defined(e)){var i=e._radii;return defined(t)?(Cartesian3.clone(i,t._radii),Cartesian3.clone(e._radiiSquared,t._radiiSquared),Cartesian3.clone(e._radiiToTheFourth,t._radiiToTheFourth),Cartesian3.clone(e._oneOverRadii,t._oneOverRadii),Cartesian3.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Ellipsoid(i.x,i.y,i.z)}},Ellipsoid.fromCartesian3=function(e,t){return defined(t)||(t=new Ellipsoid),defined(e)&&initialize(t,e.x,e.y,e.z),t},Ellipsoid.WGS84=Object.freeze(new Ellipsoid(6378137,6378137,6356752.314245179)),Ellipsoid.UNIT_SPHERE=Object.freeze(new Ellipsoid(1,1,1)),Ellipsoid.MOON=Object.freeze(new Ellipsoid(CesiumMath.LUNAR_RADIUS,CesiumMath.LUNAR_RADIUS,CesiumMath.LUNAR_RADIUS)),Ellipsoid.prototype.clone=function(e){return Ellipsoid.clone(this,e)},Ellipsoid.packedLength=Cartesian3.packedLength,Ellipsoid.pack=function(e,t,i){return i=defaultValue(i,0),Cartesian3.pack(e._radii,t,i),t},Ellipsoid.unpack=function(e,t,i){t=defaultValue(t,0);t=Cartesian3.unpack(e,t);return Ellipsoid.fromCartesian3(t,i)},Ellipsoid.prototype.geocentricSurfaceNormal=Cartesian3.normalize,Ellipsoid.prototype.geodeticSurfaceNormalCartographic=function(e,t){var i=e.longitude,r=e.latitude,n=Math.cos(r),e=n*Math.cos(i),i=n*Math.sin(i),r=Math.sin(r);return defined(t)||(t=new Cartesian3),t.x=e,t.y=i,t.z=r,Cartesian3.normalize(t,t)},Ellipsoid.prototype.geodeticSurfaceNormal=function(e,t){if(!Cartesian3.equalsEpsilon(e,Cartesian3.ZERO,CesiumMath.EPSILON14))return defined(t)||(t=new Cartesian3),t=Cartesian3.multiplyComponents(e,this._oneOverRadiiSquared,t),Cartesian3.normalize(t,t)};var cartographicToCartesianNormal=new Cartesian3,cartographicToCartesianK=new Cartesian3;Ellipsoid.prototype.cartographicToCartesian=function(e,t){var i=cartographicToCartesianNormal,r=cartographicToCartesianK;this.geodeticSurfaceNormalCartographic(e,i),Cartesian3.multiplyComponents(this._radiiSquared,i,r);var n=Math.sqrt(Cartesian3.dot(i,r));return Cartesian3.divideByScalar(r,n,r),Cartesian3.multiplyByScalar(i,e.height,i),defined(t)||(t=new Cartesian3),Cartesian3.add(r,i,t)},Ellipsoid.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;defined(t)?t.length=i:t=new Array(i);for(var r=0;r=this._radii.z-t))return i};var abscissas=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],weights=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function gaussLegendreQuadrature(e,t,i){for(var r=.5*(t+e),n=.5*(t-e),a=0,o=0;o<5;o++){var s=n*abscissas[o];a+=weights[o]*(i(r+s)+i(r-s))}return a*=n}function GeographicProjection(e){this._ellipsoid=defaultValue(e,Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Ellipsoid.prototype.surfaceArea=function(e){for(var t=e.west,n=e.east,i=e.south,r=e.north;ni&&(l=(i=(i=(e[Matrix3.getElementIndex(u,u)]-e[Matrix3.getElementIndex(c,c)])/2/e[Matrix3.getElementIndex(u,c)])<0?-1/(-i+Math.sqrt(1+i*i)):1/(i+Math.sqrt(1+i*i)))*(s=1/Math.sqrt(1+i*i))),(t=Matrix3.clone(Matrix3.IDENTITY,t))[Matrix3.getElementIndex(c,c)]=t[Matrix3.getElementIndex(u,u)]=s,t[Matrix3.getElementIndex(u,c)]=l,t[Matrix3.getElementIndex(c,u)]=-l,t}var jMatrix=new Matrix3,jMatrixTranspose=new Matrix3;Matrix3.computeEigenDecomposition=function(e,t){var i=CesiumMath.EPSILON20,r=0,n=0;defined(t)||(t={});for(var a=t.unitary=Matrix3.clone(Matrix3.IDENTITY,t.unitary),o=t.diagonal=Matrix3.clone(e,t.diagonal),s=i*computeFrobeniusNorm(o);n<10&&offDiagonalFrobeniusNorm(o)>s;)shurDecomposition(o,jMatrix),Matrix3.transpose(jMatrix,jMatrixTranspose),Matrix3.multiply(o,jMatrix,o),Matrix3.multiply(jMatrixTranspose,o,o),Matrix3.multiply(a,jMatrix,a),2<++r&&(++n,r=0);return t},Matrix3.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t},Matrix3.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],a=e[4],o=e[7],s=e[2],l=e[5],e=e[8];return t*(a*e-l*o)+n*(l*r-i*e)+s*(i*o-a*r)},Matrix3.inverse=function(e,t){var i=e[0],r=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],e=Matrix3.determinant(e);t[0]=o*u-c*s,t[1]=c*n-r*u,t[2]=r*s-o*n,t[3]=l*s-a*u,t[4]=i*u-l*n,t[5]=a*n-i*s,t[6]=a*c-l*o,t[7]=l*r-i*c,t[8]=i*o-a*r;e=1/e;return Matrix3.multiplyByScalar(t,e,t)};var scratchTransposeMatrix=new Matrix3;function Cartesian4(e,t,i,r){this.x=defaultValue(e,0),this.y=defaultValue(t,0),this.z=defaultValue(i,0),this.w=defaultValue(r,0)}Matrix3.inverseTranspose=function(e,t){return Matrix3.inverse(Matrix3.transpose(e,scratchTransposeMatrix),t)},Matrix3.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},Matrix3.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i&&Math.abs(e[4]-t[4])<=i&&Math.abs(e[5]-t[5])<=i&&Math.abs(e[6]-t[6])<=i&&Math.abs(e[7]-t[7])<=i&&Math.abs(e[8]-t[8])<=i},Matrix3.IDENTITY=Object.freeze(new Matrix3(1,0,0,0,1,0,0,0,1)),Matrix3.ZERO=Object.freeze(new Matrix3(0,0,0,0,0,0,0,0,0)),Matrix3.COLUMN0ROW0=0,Matrix3.COLUMN0ROW1=1,Matrix3.COLUMN0ROW2=2,Matrix3.COLUMN1ROW0=3,Matrix3.COLUMN1ROW1=4,Matrix3.COLUMN1ROW2=5,Matrix3.COLUMN2ROW0=6,Matrix3.COLUMN2ROW1=7,Matrix3.COLUMN2ROW2=8,Object.defineProperties(Matrix3.prototype,{length:{get:function(){return Matrix3.packedLength}}}),Matrix3.prototype.clone=function(e){return Matrix3.clone(this,e)},Matrix3.prototype.equals=function(e){return Matrix3.equals(this,e)},Matrix3.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]&&e[4]===t[i+4]&&e[5]===t[i+5]&&e[6]===t[i+6]&&e[7]===t[i+7]&&e[8]===t[i+8]},Matrix3.prototype.equalsEpsilon=function(e,t){return Matrix3.equalsEpsilon(this,e,t)},Matrix3.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},Cartesian4.fromElements=function(e,t,i,r,n){return defined(n)?(n.x=e,n.y=t,n.z=i,n.w=r,n):new Cartesian4(e,t,i,r)},Cartesian4.fromColor=function(e,t){return defined(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new Cartesian4(e.red,e.green,e.blue,e.alpha)},Cartesian4.clone=function(e,t){if(defined(e))return defined(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new Cartesian4(e.x,e.y,e.z,e.w)},Cartesian4.packedLength=4,Cartesian4.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},Cartesian4.unpack=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new Cartesian4),i.x=e[t++],i.y=e[t++],i.z=e[t++],i.w=e[t],i},Cartesian4.packArray=function(e,t){var i=e.length,r=4*i;if(defined(t)){if(!Array.isArray(t)&&t.length!==r)throw new DeveloperError("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==r&&(t.length=r)}else t=new Array(r);for(var n=0;nCesiumMath.PI&&(r-=CesiumMath.TWO_PI),i>CesiumMath.PI&&(i-=CesiumMath.TWO_PI)),defined(t)?(t.west=i,t.south=o,t.east=r,t.north=s,t):new Rectangle(i,o,r,s)},Rectangle.fromCartesianArray=function(e,t,i){t=defaultValue(t,Ellipsoid.WGS84);for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,l=-Number.MAX_VALUE,c=0,u=e.length;cCesiumMath.PI&&(n-=CesiumMath.TWO_PI),r>CesiumMath.PI&&(r-=CesiumMath.TWO_PI)),defined(i)?(i.west=r,i.south=s,i.east=n,i.north=l,i):new Rectangle(r,s,n,l)},Rectangle.clone=function(e,t){if(defined(e))return defined(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Rectangle(e.west,e.south,e.east,e.north)},Rectangle.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e.west-t.west)<=i&&Math.abs(e.south-t.south)<=i&&Math.abs(e.east-t.east)<=i&&Math.abs(e.north-t.north)<=i},Rectangle.prototype.clone=function(e){return Rectangle.clone(this,e)},Rectangle.prototype.equals=function(e){return Rectangle.equals(this,e)},Rectangle.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},Rectangle.prototype.equalsEpsilon=function(e,t){return Rectangle.equalsEpsilon(this,e,t)},Rectangle.validate=function(e){},Rectangle.southwest=function(e,t){return defined(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Cartographic(e.west,e.south)},Rectangle.northwest=function(e,t){return defined(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Cartographic(e.west,e.north)},Rectangle.northeast=function(e,t){return defined(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Cartographic(e.east,e.north)},Rectangle.southeast=function(e,t){return defined(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Cartographic(e.east,e.south)},Rectangle.center=function(e,t){var i=e.east,r=e.west;i=e.south&&r<=e.north};var subsampleLlaScratch=new Cartographic;function BoundingSphere(e,t){this.center=Cartesian3.clone(defaultValue(e,Cartesian3.ZERO)),this.radius=defaultValue(t,0)}Rectangle.subsample=function(e,t,i,r){t=defaultValue(t,Ellipsoid.WGS84),i=defaultValue(i,0),defined(r)||(r=[]);var n=0,a=e.north,o=e.south,s=e.east,l=e.west,c=subsampleLlaScratch;c.height=i,c.longitude=l,c.latitude=a,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.longitude=s,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.latitude=o,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.longitude=l,r[n]=t.cartographicToCartesian(c,r[n]),n++,c.latitude=a<0?a:0o.x&&Cartesian3.clone(i,o),hs.y&&Cartesian3.clone(i,s),pl.z&&Cartesian3.clone(i,l)}var m=Cartesian3.magnitudeSquared(Cartesian3.subtract(o,r,fromPointsScratch)),f=Cartesian3.magnitudeSquared(Cartesian3.subtract(s,n,fromPointsScratch)),g=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),_=r,y=o,m=m;ml.x&&Cartesian3.clone(n,l),mc.y&&Cartesian3.clone(n,c),fu.z&&Cartesian3.clone(n,u)}var g=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),_=Cartesian3.magnitudeSquared(Cartesian3.subtract(c,o,fromPointsScratch)),y=Cartesian3.magnitudeSquared(Cartesian3.subtract(u,s,fromPointsScratch)),C=a,v=l,g=g;g<_&&(g=_,C=o,v=c),gs.x&&Cartesian3.clone(r,s),pl.y&&Cartesian3.clone(r,l),mc.z&&Cartesian3.clone(r,c)}var f=Cartesian3.magnitudeSquared(Cartesian3.subtract(s,n,fromPointsScratch)),g=Cartesian3.magnitudeSquared(Cartesian3.subtract(l,a,fromPointsScratch)),_=Cartesian3.magnitudeSquared(Cartesian3.subtract(c,o,fromPointsScratch)),y=n,C=s,f=f;fi.radius&&(i.radius=t),i},BoundingSphere.intersectPlane=function(e,t){var i=e.center,r=e.radius,e=t.normal,t=Cartesian3.dot(e,i)+t.distance;return t<-r?Intersect$1.OUTSIDE:t>>0,o=Math.max(0,Math.min(p,a)),s=[],l=a-o+1,c=[],u=defer();if(o)for(r=u.progress,i=function(e){c.push(e),--l||(t=i=noop,u.reject(c))},t=function(e){s.push(e),--o||(t=i=noop,u.resolve(s))},n=0;n>>0,a=[],o=defer();if(n)for(i=function(e,t){when(e,s).then(function(e){a[t]=e,--n||o.resolve(a)},o.reject)},r=0;r>>0,a=arguments;if(a.length<=1)for(;;){if(i in r){t=r[i++];break}if(++i>=n)throw new TypeError}else t=a[1];for(;in&&(t=i[n],this._length=n),t},Heap.prototype.pop=function(e){if(e=defaultValue(e,0),0!==this._length){var t=this._array,i=t[e];return swap(t,e,--this._length),this.heapify(e),t[this._length]=void 0,i}};var statistics={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},priorityHeapLength=20,requestHeap=new Heap({comparator:sortRequests});requestHeap.maximumLength=priorityHeapLength,requestHeap.reserve(priorityHeapLength);var activeRequests=[],numberOfActiveRequestsByServer={},pageUri="undefined"!=typeof document?new URI(document.location.href):new URI,requestCompletedEvent=new Event;function RequestScheduler(){}function updatePriority(e){defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function serverHasOpenSlots(e){var t=defaultValue(RequestScheduler.requestsByServer[e],RequestScheduler.maximumRequestsPerServer);return numberOfActiveRequestsByServer[e]e;)cancelRequest(requestHeap.pop());priorityHeapLength=e,requestHeap.maximumLength=e,requestHeap.reserve(e)}}}),RequestScheduler.update=function(){for(var e,t=0,i=activeRequests.length,r=0;r=RequestScheduler.maximumRequests)){updatePriority(e);var t=requestHeap.insert(e);if(defined(t)){if(t===e)return;cancelRequest(t)}return issueRequest(e)}}},RequestScheduler.clearForSpecs=function(){for(;0=this.retryAttempts)return when(!1);var i=this;return when(t(this,e)).then(function(e){return++i._retryCount,e})},Resource.prototype.clone=function(e){return defined(e)||(e=new Resource({url:this._url})),e._url=this._url,e._queryParameters=clone(this._queryParameters),e._templateValues=clone(this._templateValues),e.headers=clone(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},Resource.prototype.getBaseUri=function(e){return getBaseUri(this.getUrlComponent(e),e)},Resource.prototype.appendForwardSlash=function(){this._url=appendForwardSlash(this._url)},Resource.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Resource.fetchArrayBuffer=function(e){return new Resource(e).fetchArrayBuffer()},Resource.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Resource.fetchBlob=function(e){return new Resource(e).fetchBlob()},Resource.prototype.fetchImage=function(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.preferImageBitmap,!1),i=defaultValue(e.preferBlob,!1),r=defaultValue(e.flipY,!1);if(checkAndResetRequest(this.request),!xhrBlobSupported||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!i)return fetchImage({resource:this,flipY:r,preferImageBitmap:t});var n,a,o,s=this.fetchBlob();return defined(s)?Resource.supportsImageBitmapOptions().then(function(e){return n=e&&t,s}).then(function(e){if(defined(e)){if(o=e,n)return Resource.createImageBitmapFromBlob(e,{flipY:r,premultiplyAlpha:!1});e=window.URL.createObjectURL(e);return fetchImage({resource:a=new Resource({url:e}),flipY:r,preferImageBitmap:!1})}}).then(function(e){if(defined(e))return e.blob=o,n||window.URL.revokeObjectURL(a.url),e}).otherwise(function(e){return defined(a)&&window.URL.revokeObjectURL(a.url),e.blob=o,when.reject(e)}):void 0},Resource.fetchImage=function(e){return new Resource(e).fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Resource.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Resource.fetchText=function(e){return new Resource(e).fetchText()},Resource.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(defined(e))return e.then(function(e){if(defined(e))return JSON.parse(e)})},Resource.fetchJson=function(e){return new Resource(e).fetchJson()},Resource.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Resource.fetchXML=function(e){return new Resource(e).fetchXML()},Resource.prototype.fetchJsonp=function(e){var t;for(e=defaultValue(e,"callback"),checkAndResetRequest(this.request);t="loadJsonp"+Math.random().toString().substring(2,8),defined(window[t]););return fetchJsonp(this,e,t)},Resource.fetchJsonp=function(e){return new Resource(e).fetchJsonp(e.callbackParameterName)},Resource.prototype._makeRequest=function(s){var l=this;checkAndResetRequest(l.request);var c=l.request;c.url=l.url,c.requestFunction=function(){var e=s.responseType,t=combine(s.headers,l.headers),i=s.overrideMimeType,r=s.method,n=s.data,a=when.defer(),o=Resource._Implementations.loadWithXhr(l.url,e,r,n,t,a,i);return defined(o)&&defined(o.abort)&&(c.cancelFunction=function(){o.abort()}),a.promise};var e=RequestScheduler.request(c);if(defined(e))return e.then(function(e){return c.cancelFunction=void 0,e}).otherwise(function(t){return c.cancelFunction=void 0,c.state!==RequestState$1.FAILED?when.reject(t):l.retryOnError(t).then(function(e){return e?(c.state=RequestState$1.UNISSUED,c.deferred=void 0,l.fetch(s)):when.reject(t)})})};var dataUriRegex$1=/^data:(.*?)(;base64)?,(.*)$/;function decodeDataUriText(e,t){t=decodeURIComponent(t);return e?atob(t):t}function decodeDataUriArrayBuffer(e,t){for(var i=decodeDataUriText(e,t),t=new ArrayBuffer(i.length),r=new Uint8Array(t),n=0;n/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _toConsumableArray$1(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t/i,t))b(a,e);else{Q&&(t=stringReplace(t,L," "),t=stringReplace(t,F," "));var l=e.nodeName.toLowerCase();if(M(l,s,t))try{o?e.setAttributeNS(o,a,t):e.setAttribute(a,t),arrayPop(c.removed)}catch(e){}}}w("afterSanitizeAttributes",e,null)}}function R(e){var t,i=P(e);for(w("beforeSanitizeShadowDOM",e,null);t=i.nextNode();)w("uponSanitizeShadowNode",t,null),D(t)||(t.content instanceof d&&R(t.content),I(t));w("afterSanitizeShadowDOM",e,null)}var O,L=MUSTACHE_EXPR,F=ERB_EXPR,N=DATA_ATTR,B=ARIA_ATTR,V=IS_SCRIPT_OR_DATA,k=ATTR_WHITESPACE,z=IS_ALLOWED_URI,U=null,$=addToSet({},[].concat(_toConsumableArray$1(html),_toConsumableArray$1(svg),_toConsumableArray$1(svgFilters),_toConsumableArray$1(mathMl),_toConsumableArray$1(text))),G=null,H=addToSet({},[].concat(_toConsumableArray$1(html$1),_toConsumableArray$1(svg$1),_toConsumableArray$1(mathMl$1),_toConsumableArray$1(xml))),W=null,q=null,j=!0,Y=!0,X=!1,Q=!1,J=!1,Z=!1,K=!1,ee=!1,te=!1,ie=!0,re=!1,ne=!0,ae=!0,oe=!1,se=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),le=null,ce=addToSet({},["audio","video","img","source","image","track"]),ue=null,de=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),he=null,pe=a.createElement("form");return c.sanitize=function(e,t){var i,r,n=void 0,a=void 0,o=void 0;if("string"!=typeof(e=e||"\x3c!--\x3e")&&!A(e)){if("function"!=typeof e.toString)throw typeErrorCreate("toString is not a function");if("string"!=typeof(e=e.toString()))throw typeErrorCreate("dirty is not a string, aborting")}if(!c.isSupported){if("object"===_typeof(l.toStaticHTML)||"function"==typeof l.toStaticHTML){if("string"==typeof e)return l.toStaticHTML(e);if(A(e))return l.toStaticHTML(e.outerHTML)}return e}if(Z||T(t),c.removed=[],"string"==typeof e&&(oe=!1),!oe)if(e instanceof h)1===(i=(n=E("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!ee&&!Q&&!J&&-1===e.indexOf("<"))return m&&re?m.createHTML(e):e;if(!(n=E(e)))return ee?null:f}n&&K&&x(n.firstChild);for(var s=P(oe?e:n);r=s.nextNode();)3===r.nodeType&&r===a||D(r)||(r.content instanceof d&&R(r.content),I(r),a=r);if(a=null,oe)return e;if(ee){if(te)for(o=y.call(n.ownerDocument);n.firstChild;)o.appendChild(n.firstChild);else o=n;return ie&&(o=C.call(u,o,!0)),o}e=J?n.outerHTML:n.innerHTML;return Q&&(e=stringReplace(e,L," "),e=stringReplace(e,F," ")),m&&re?m.createHTML(e):e},c.setConfig=function(e){T(e),Z=!0},c.clearConfig=function(){he=null,Z=!1},c.isValidAttribute=function(e,t,i){he||T({});e=stringToLowerCase(e),t=stringToLowerCase(t);return M(e,t,i)},c.addHook=function(e,t){"function"==typeof t&&(S[e]=S[e]||[],arrayPush(S[e],t))},c.removeHook=function(e){S[e]&&arrayPop(S[e])},c.removeHooks=function(e){S[e]&&(S[e]=[])},c.removeAllHooks=function(){S={}},c}var purify=createDOMPurify(),nextCreditId=0,creditToId={};function Credit(e,t){var i,r=e;defined(creditToId[r])?i=creditToId[r]:(i=nextCreditId++,creditToId[r]=i),t=defaultValue(t,!1),this._id=i,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(Credit.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen}},element:{get:function(){if(!defined(this._element)){var e=purify.sanitize(this._html),t=document.createElement("div");t._creditId=this._id,t.style.display="inline",t.innerHTML=e;for(var i=t.querySelectorAll("a"),r=0;r-t?((i=scratchCameraPositionInScaledSpaceShrunk).x=this._cameraPosition.x/(r.radii.x+t),i.y=this._cameraPosition.y/(r.radii.y+t),i.z=this._cameraPosition.z/(r.radii.z+t),i.x*i.x+i.y*i.y+i.z*i.z-1):(i=this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared);return isScaledSpacePointVisible(e,i,t)},EllipsoidalOccluder.prototype.computeHorizonCullingPoint=function(e,t,i){return computeHorizonCullingPointFromPositions(this._ellipsoid,e,t,i)};var scratchEllipsoidShrunk=Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);EllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,i,r){return computeHorizonCullingPointFromPositions(getPossiblyShrunkEllipsoid(this._ellipsoid,i,scratchEllipsoidShrunk),e,t,r)},EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices=function(e,t,i,r,n){return computeHorizonCullingPointFromVertices(this._ellipsoid,e,t,i,r,n)},EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,i,r,n,a){return computeHorizonCullingPointFromVertices(getPossiblyShrunkEllipsoid(this._ellipsoid,n,scratchEllipsoidShrunk),e,t,i,r,a)};var subsampleScratch=[];EllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle=function(e,t,i){var r=Rectangle.subsample(e,t,0,subsampleScratch),e=BoundingSphere.fromPoints(r);if(!(Cartesian3.magnitude(e.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(e.center,r,i)};var scratchEllipsoidShrunkRadii=new Cartesian3;function getPossiblyShrunkEllipsoid(e,t,i){return defined(t)&&t<0&&e.minimumRadius>-t&&(t=Cartesian3.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,scratchEllipsoidShrunkRadii),e=Ellipsoid.fromCartesian3(t,i)),e}function computeHorizonCullingPointFromPositions(e,t,i,r){defined(r)||(r=new Cartesian3);for(var n=computeScaledSpaceDirectionToPoint(e,t),a=0,o=0,s=i.length;oi)}var scaledSpaceScratch=new Cartesian3,directionScratch=new Cartesian3;function computeMagnitude(e,t,i){var r=e.transformPositionToScaledSpace(t,scaledSpaceScratch),e=Cartesian3.magnitudeSquared(r),t=Math.sqrt(e),r=Cartesian3.divideByScalar(r,t,directionScratch),e=Math.max(1,e),t=1/(t=Math.max(1,t));return 1/(Cartesian3.dot(r,i)*t-Cartesian3.magnitude(Cartesian3.cross(r,i,r))*(Math.sqrt(e-1)*t))}function magnitudeToPoint(e,t,i){if(!(t<=0||t===1/0||t!=t))return Cartesian3.multiplyByScalar(e,t,i)}var directionToPointScratch=new Cartesian3;function computeScaledSpaceDirectionToPoint(e,t){return Cartesian3.equals(t,Cartesian3.ZERO)?t:(e.transformPositionToScaledSpace(t,directionToPointScratch),Cartesian3.normalize(directionToPointScratch,directionToPointScratch))}var QuadraticRealPolynomial={};function addWithCancellationCheck(e,t,i){var r=e+t;return CesiumMath.sign(e)!==CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))=o[0]&&l[1]<=o[1]?[o[0],l[0],l[1],o[1]]:o[0]>=l[0]&&o[1]<=l[1]?[l[0],o[0],o[1],l[1]]:l[0]>o[0]&&l[0]=f[0]&&m[1]<=f[1]?[f[0],m[0],m[1],f[1]]:f[0]>=m[0]&&f[1]<=m[1]?[m[0],f[0],f[1],m[1]]:m[0]>f[0]&&m[0]Cartesian3.distance(e,t)))return defined(o)||(o=new Cartesian3),Cartesian3.multiplyByScalar(s.direction,a,o),Cartesian3.add(s.origin,o,o)};var raySphereRoots={root0:0,root1:0};function raySphere(e,t,i){defined(i)||(i=new Interval);var r=e.origin,n=e.direction,e=t.center,t=t.radius*t.radius,e=Cartesian3.subtract(r,e,scratchPVec),t=solveQuadratic(Cartesian3.dot(n,n),2*Cartesian3.dot(n,e),Cartesian3.magnitudeSquared(e)-t,raySphereRoots);if(defined(t))return i.start=t.root0,i.stop=t.root1,i}IntersectionTests.raySphere=function(e,t,i){if(defined(i=raySphere(e,t,i))&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var scratchLineSegmentRay=new Ray;IntersectionTests.lineSegmentSphere=function(e,t,i,r){var n=scratchLineSegmentRay;Cartesian3.clone(e,n.origin);t=Cartesian3.subtract(t,e,n.direction),e=Cartesian3.magnitude(t);if(Cartesian3.normalize(t,t),!(!defined(r=raySphere(n,i,r))||r.stop<0||r.start>e))return r.start=Math.max(r.start,0),r.stop=Math.min(r.stop,e),r};var scratchQ=new Cartesian3,scratchW=new Cartesian3;function addWithCancellationCheck$1(e,t,i){var r=e+t;return CesiumMath.sign(e)!==CesiumMath.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))=t?"":Array(1+t-e.length>>>0).join(i),r?e+i:i+e}function v(e,t,i,r,n,a){var o=r-e.length;return 0>>0;return e=(i=i&&s&&{2:"0b",8:"0",16:"0x"}[t]||"")+C(s.toString(t),a||0,"0",!1),v(e,i,r,n,o)}function T(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),v(e,"",t,i,n,a)}var x=arguments,b=0,e=x[b++];return e.replace(/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,function(e,t,i,r,n,a,o){var s,l,c,u,d;if("%%"==e)return"%";for(var h=!1,p="",m=!1,f=!1,g=" ",_=i.length,y=0;i&&y<_;y++)switch(i.charAt(y)){case" ":p=" ";break;case"+":p="+";break;case"-":h=!0;break;case"'":g=i.charAt(y+1);break;case"0":m=!0;break;case"#":f=!0}if((r=r?"*"==r?+x[b++]:"*"==r.charAt(0)?+x[r.slice(1,-1)]:+r:0)<0&&(r=-r,h=!0),!isFinite(r))throw new Error("sprintf: (minimum-)width must be finite");switch(a=a?"*"==a?+x[b++]:"*"==a.charAt(0)?+x[a.slice(1,-1)]:+a:-1<"fFeE".indexOf(o)?6:"d"==o?0:void 0,d=t?x[t.slice(0,-1)]:x[b++],o){case"s":return T(String(d),h,r,a,m,g);case"c":return T(String.fromCharCode(+d),h,r,a,m);case"b":return S(d,2,f,h,r,a,m);case"o":return S(d,8,f,h,r,a,m);case"x":return S(d,16,f,h,r,a,m);case"X":return S(d,16,f,h,r,a,m).toUpperCase();case"u":return S(d,10,f,h,r,a,m);case"i":case"d":return s=+d||0,d=(l=(s=Math.round(s-s%1))<0?"-":p)+C(String(Math.abs(s)),a,"0",!1),v(d,l,h,r,m);case"e":case"E":case"f":case"F":case"g":case"G":return l=(s=+d)<0?"-":p,c=["toExponential","toFixed","toPrecision"]["efg".indexOf(o.toLowerCase())],u=["toString","toUpperCase"]["eEfFgG".indexOf(o)%2],d=l+Math.abs(s)[c](a),v(d,l,h,r,m)[u]();default:return e}})}function GregorianDate(e,t,i,r,n,a,o,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=a,this.millisecond=o,this.isLeapSecond=s}function isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}function LeapSecond(e,t){this.julianDate=e,this.offset=t}Plane.transform=function(e,t,i){var r=e.normal,e=e.distance,t=Matrix4.inverseTranspose(t,scratchInverseTranspose),e=Cartesian4.fromElements(r.x,r.y,r.z,e,scratchPlaneCartesian4),e=Matrix4.multiplyByVector(t,e,e),t=Cartesian3.fromCartesian4(e,scratchTransformNormal);return e=Cartesian4.divideByScalar(e,Cartesian3.magnitude(t),e),Plane.fromCartesian4(e,i)},Plane.clone=function(e,t){return defined(t)?(Cartesian3.clone(e.normal,t.normal),t.distance=e.distance,t):new Plane(e.normal,e.distance)},Plane.equals=function(e,t){return e.distance===t.distance&&Cartesian3.equals(e.normal,t.normal)},Plane.ORIGIN_XY_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_Z,0)),Plane.ORIGIN_YZ_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_X,0)),Plane.ORIGIN_ZX_PLANE=Object.freeze(new Plane(Cartesian3.UNIT_Y,0));var TimeConstants={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5},TimeConstants$1=Object.freeze(TimeConstants),TimeStandard={UTC:0,TAI:1},TimeStandard$1=Object.freeze(TimeStandard),gregorianDateScratch=new GregorianDate,daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31],daysInLeapFeburary=29;function compareLeapSecondDates(e,t){return JulianDate.compare(e.julianDate,t.julianDate)}var binarySearchScratchLeapSecond=new LeapSecond;function convertUtcToTai(e){binarySearchScratchLeapSecond.julianDate=e;var t=JulianDate.leapSeconds,i=binarySearch(t,binarySearchScratchLeapSecond,compareLeapSecondDates);i<0&&(i=~i),i>=t.length&&(i=t.length-1);var r=t[i].offset;0=i.length)return JulianDate.addSeconds(e,-i[r-1].offset,t);var n=JulianDate.secondsDifference(i[r].julianDate,e);return 0===n?JulianDate.addSeconds(e,-i[r].offset,t):n<=1?void 0:JulianDate.addSeconds(e,-i[--r].offset,t)}function setComponents(e,t,i){var r=t/TimeConstants$1.SECONDS_PER_DAY|0;return e+=r,(t-=TimeConstants$1.SECONDS_PER_DAY*r)<0&&(e--,t+=TimeConstants$1.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function computeJulianDateComponents(e,t,i,r,n,a,o){var s=(t-14)/12|0,e=e+4800+s,i=(1461*e/4|0)+(367*(t-2-12*s)/12|0)-(3*((e+100)/100|0)/4|0)+i-32075;(r-=12)<0&&(r+=24);o=a+(r*TimeConstants$1.SECONDS_PER_HOUR+n*TimeConstants$1.SECONDS_PER_MINUTE+o*TimeConstants$1.SECONDS_PER_MILLISECOND);return 43200<=o&&--i,[i,o]}var matchCalendarYear=/^(\d{4})$/,matchCalendarMonth=/^(\d{4})-(\d{2})$/,matchOrdinalDate=/^(\d{4})-?(\d{3})$/,matchWeekDate=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,matchCalendarDate=/^(\d{4})-?(\d{2})-?(\d{2})$/,utcOffset=/([Z+\-])?(\d{2})?:?(\d{2})?$/,matchHours=/^(\d{2})(\.\d+)?/.source+utcOffset.source,matchHoursMinutes=/^(\d{2}):?(\d{2})(\.\d+)?/.source+utcOffset.source,matchHoursMinutesSeconds=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+utcOffset.source;function JulianDate(e,t,i){this.dayNumber=void 0,this.secondsOfDay=void 0,e=defaultValue(e,0),t=defaultValue(t,0),i=defaultValue(i,TimeStandard$1.UTC);var r=0|e;setComponents(r,t+=(e-r)*TimeConstants$1.SECONDS_PER_DAY,this),i===TimeStandard$1.UTC&&convertUtcToTai(this)}JulianDate.fromGregorianDate=function(e,t){e=computeJulianDateComponents(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return defined(t)?(setComponents(e[0],e[1],t),convertUtcToTai(t),t):new JulianDate(e[0],e[1],TimeStandard$1.UTC)},JulianDate.fromDate=function(e,t){e=computeJulianDateComponents(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return defined(t)?(setComponents(e[0],e[1],t),convertUtcToTai(t),t):new JulianDate(e[0],e[1],TimeStandard$1.UTC)},JulianDate.fromIso8601=function(e,t){var i,r,n,a,o,s=(e=e.replace(",",".")).split("T"),l=1,c=1,u=0,d=0,h=0,p=0,m=s[0],e=s[1];if(null!==(s=m.match(matchCalendarDate))?(i=+s[1],l=+s[2],c=+s[3]):null!==(s=m.match(matchCalendarMonth))?(i=+s[1],l=+s[2]):null!==(s=m.match(matchCalendarYear))?i=+s[1]:(null!==(s=m.match(matchOrdinalDate))?(i=+s[1],a=+s[2],n=isLeapYear(i)):null!==(s=m.match(matchWeekDate))&&(i=+s[1],a=7*+s[2]+(+s[3]||0)-new Date(Date.UTC(i,0,4)).getUTCDay()-3),(r=new Date(Date.UTC(i,0,1))).setUTCDate(a),l=r.getUTCMonth()+1,c=r.getUTCDate()),n=isLeapYear(i),defined(e)){null!==(s=e.match(matchHoursMinutesSeconds))?(u=+s[1],d=+s[2],h=+s[3],p=1e3*+(s[4]||0),o=5):null!==(s=e.match(matchHoursMinutes))?(u=+s[1],d=+s[2],h=60*+(s[3]||0),o=4):null!==(s=e.match(matchHours))&&(u=+s[1],d=60*+(s[2]||0),o=3);var f=s[o],g=+s[o+1],_=+(s[o+2]||0);switch(f){case"+":u-=g,d-=_;break;case"-":u+=g,d+=_;break;case"Z":break;default:d+=new Date(Date.UTC(i,l-1,c,u,d)).getTimezoneOffset()}}f=60===h;for(f&&h--;60<=d;)d-=60,u++;for(;24<=u;)u-=24,c++;for(r=n&&2===l?daysInLeapFeburary:daysInMonth[l-1];rt.length-1)return o.xPoleWander=0,o.yPoleWander=0,o.xPoleOffset=0,o.yPoleOffset=0,o.ut1MinusUtc=0,o;var l=t[n],c=t[a];if(l.equals(c)||r.equals(l))return fillResultFromIndex(e,i,n,s,o),o;if(r.equals(c))return fillResultFromIndex(e,i,a,s,o),o;var u=JulianDate.secondsDifference(r,l)/JulianDate.secondsDifference(c,l),d=n*s,t=a*s,l=i[d+e._ut1MinusUtcSecondsColumn],n=i[t+e._ut1MinusUtcSecondsColumn],a=n-l;return!(.5=this._totalSamples&&(r=this._totalSamples-1);for(var t=t/this._samplesPerXysFile|0,n=r/this._samplesPerXysFile|0,a=[],o=t;o<=n;++o)a.push(requestXysChunk(this,o));return when.all(a)},Iau2006XysData.prototype.computeXysRadians=function(e,t,i){var r=getDaysSinceEpoch(this,e,t);if(!(r<0)){e=r/this._stepSizeDays|0;if(!(e>=this._totalSamples)){var n=this._interpolationOrder,a=e-(n/2|0);a<0&&(a=0);t=a+n;t>=this._totalSamples&&(a=(t=this._totalSamples-1)-n)<0&&(a=0);var e=!1,o=this._samples;if(defined(o[3*a])||(requestXysChunk(this,a/this._samplesPerXysFile|0),e=!0),defined(o[3*t])||(requestXysChunk(this,t/this._samplesPerXysFile|0),e=!0),!e){defined(i)?(i.x=0,i.y=0,i.s=0):i=new Iau2006XysSample(0,0,0);for(var s,l=r-a*this._stepSizeDays,c=this._work,u=this._denominators,d=this._coef,h=this._xTable,p=0;p<=n;++p)c[p]=l-h[p];for(p=0;p<=n;++p){for(d[p]=1,s=0;s<=n;++s)s!==p&&(d[p]*=c[s]);d[p]*=u[p];var m=3*(a+p);i.x+=d[p]*o[m++],i.y+=d[p]*o[m++],i.s+=d[p]*o[m]}return i}}}};var _names={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Fullscreen={},theNavigator,isChromeResult,chromeVersionResult,isSafariResult,safariVersionResult,isWebkitResult,webkitVersionResult,isInternetExplorerResult,internetExplorerVersionResult,isEdgeResult,edgeVersionResult,isFirefoxResult,firefoxVersionResult,isWindowsResult,hasPointerEvents,imageRenderingValueResult,supportsImageRenderingPixelatedResult;function extractVersion(e){for(var t=e.split("."),i=0,r=t.length;is&&(o+=(l=r.x-s)*l),r.y<-t?o+=(l=r.y+t)*l:r.y>t&&(o+=(l=r.y-t)*l),r.z<-e?o+=(l=r.z+e)*l:r.z>e&&(o+=(l=r.z-e)*l),o};var scratchCorner=new Cartesian3,scratchToCenter=new Cartesian3;OrientedBoundingBox.computePlaneDistances=function(e,t,i,r){defined(r)||(r=new Interval);var n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=e.center,s=e.halfAxes,l=Matrix3.getColumn(s,0,scratchCartesianU),c=Matrix3.getColumn(s,1,scratchCartesianV),u=Matrix3.getColumn(s,2,scratchCartesianW),d=Cartesian3.add(l,c,scratchCorner);Cartesian3.add(d,u,d),Cartesian3.add(d,o,d);e=Cartesian3.subtract(d,t,scratchToCenter),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a);return Cartesian3.add(o,l,d),Cartesian3.add(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.add(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.add(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.add(d,c,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.add(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.add(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),Cartesian3.subtract(o,l,d),Cartesian3.subtract(d,c,d),Cartesian3.subtract(d,u,d),Cartesian3.subtract(d,t,e),s=Cartesian3.dot(i,e),n=Math.min(s,n),a=Math.max(s,a),r.start=n,r.stop=a,r};var scratchBoundingSphere$1=new BoundingSphere;OrientedBoundingBox.isOccluded=function(e,t){e=BoundingSphere.fromOrientedBoundingBox(e,scratchBoundingSphere$1);return!t.isBoundingSphereVisible(e)},OrientedBoundingBox.prototype.intersectPlane=function(e){return OrientedBoundingBox.intersectPlane(this,e)},OrientedBoundingBox.prototype.distanceSquaredTo=function(e){return OrientedBoundingBox.distanceSquaredTo(this,e)},OrientedBoundingBox.prototype.computePlaneDistances=function(e,t,i){return OrientedBoundingBox.computePlaneDistances(this,e,t,i)},OrientedBoundingBox.prototype.isOccluded=function(e){return OrientedBoundingBox.isOccluded(this,e)},OrientedBoundingBox.equals=function(e,t){return e===t||defined(e)&&defined(t)&&Cartesian3.equals(e.center,t.center)&&Matrix3.equals(e.halfAxes,t.halfAxes)},OrientedBoundingBox.prototype.clone=function(e){return OrientedBoundingBox.clone(this,e)},OrientedBoundingBox.prototype.equals=function(e){return OrientedBoundingBox.equals(this,e)};var RIGHT_SHIFT=1/256,LEFT_SHIFT=256,AttributeCompression={octEncodeInRange:function(e,t,i){var r;return i.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),i.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0&&(r=i.x,e=i.y,i.x=(1-Math.abs(e))*CesiumMath.signNotZero(r),i.y=(1-Math.abs(r))*CesiumMath.signNotZero(e)),i.x=CesiumMath.toSNorm(i.x,t),i.y=CesiumMath.toSNorm(i.y,t),i},octEncode:function(e,t){return AttributeCompression.octEncodeInRange(e,255,t)}},octEncodeScratch=new Cartesian2,uint8ForceArray=new Uint8Array(1);function forceUint8(e){return uint8ForceArray[0]=e,uint8ForceArray[0]}AttributeCompression.octEncodeToCartesian4=function(e,t){return AttributeCompression.octEncodeInRange(e,65535,octEncodeScratch),t.x=forceUint8(octEncodeScratch.x*RIGHT_SHIFT),t.y=forceUint8(octEncodeScratch.x),t.z=forceUint8(octEncodeScratch.y*RIGHT_SHIFT),t.w=forceUint8(octEncodeScratch.y),t},AttributeCompression.octDecodeInRange=function(e,t,i,r){return r.x=CesiumMath.fromSNorm(e,i),r.y=CesiumMath.fromSNorm(t,i),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0&&(i=r.x,r.x=(1-Math.abs(r.y))*CesiumMath.signNotZero(i),r.y=(1-Math.abs(i))*CesiumMath.signNotZero(r.y)),Cartesian3.normalize(r,r)},AttributeCompression.octDecode=function(e,t,i){return AttributeCompression.octDecodeInRange(e,t,255,i)},AttributeCompression.octDecodeFromCartesian4=function(e,t){var i=e.x,r=e.y,n=e.z,e=e.w,r=i*LEFT_SHIFT+r,e=n*LEFT_SHIFT+e;return AttributeCompression.octDecodeInRange(r,e,65535,t)},AttributeCompression.octPackFloat=function(e){return 256*e.x+e.y};var scratchEncodeCart2=new Cartesian2;function zigZagDecode(e){return e>>1^-(1&e)}AttributeCompression.octEncodeFloat=function(e){return AttributeCompression.octEncode(e,scratchEncodeCart2),AttributeCompression.octPackFloat(scratchEncodeCart2)},AttributeCompression.octDecodeFloat=function(e,t){var i=e/256,e=Math.floor(i),i=256*(i-e);return AttributeCompression.octDecode(e,i,t)},AttributeCompression.octPack=function(e,t,i,r){e=AttributeCompression.octEncodeFloat(e),t=AttributeCompression.octEncodeFloat(t),i=AttributeCompression.octEncode(i,scratchEncodeCart2);return r.x=65536*i.x+e,r.y=65536*i.y+t,r},AttributeCompression.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),o=65536*(n-a),n=e.y/65536,e=Math.floor(n),n=65536*(n-e);AttributeCompression.octDecodeFloat(o,t),AttributeCompression.octDecodeFloat(n,i),AttributeCompression.octDecode(a,e,r)},AttributeCompression.compressTextureCoordinates=function(e){return 4096*(4095*e.x|0)+(4095*e.y|0)},AttributeCompression.decompressTextureCoordinates=function(e,t){var i=e/4096,i=Math.floor(i);return t.x=i/4095,t.y=(e-4096*i)/4095,t},AttributeCompression.zigZagDeltaDecode=function(e,t,i){for(var r=e.length,n=0,a=0,o=0,s=0;sWebMercatorProjection.MaximumLatitude?e=WebMercatorProjection.MaximumLatitude:e<-WebMercatorProjection.MaximumLatitude&&(e=-WebMercatorProjection.MaximumLatitude);e=Math.sin(e);return.5*Math.log((1+e)/(1-e))},WebMercatorProjection.MaximumLatitude=WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI),WebMercatorProjection.prototype.project=function(e,t){var i=this._semimajorAxis,r=e.longitude*i,i=WebMercatorProjection.geodeticLatitudeToMercatorAngle(e.latitude)*i,e=e.height;return defined(t)?(t.x=r,t.y=i,t.z=e,t):new Cartesian3(r,i,e)},WebMercatorProjection.prototype.unproject=function(e,t){var i=this._oneOverSemimajorAxis,r=e.x*i,i=WebMercatorProjection.mercatorAngleToGeodeticLatitude(e.y*i),e=e.z;return defined(t)?(t.longitude=r,t.latitude=i,t.height=e,t):new Cartographic(r,i,e)};var HeightmapTessellator={};HeightmapTessellator.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var cartesian3Scratch$1=new Cartesian3,matrix4Scratch$1=new Matrix4,minimumScratch=new Cartesian3,maximumScratch=new Cartesian3;function returnTrue(){return!0}function destroyObject(e,t){function i(){}for(var r in e)"function"==typeof e[r]&&(e[r]=i);e.isDestroyed=returnTrue}function canTransferArrayBuffer(){if(!defined(TaskProcessor._canTransferArrayBuffer)){var t=new Worker(getWorkerUrl("Workers/transferTypedArrayTest.js"));t.postMessage=defaultValue(t.webkitPostMessage,t.postMessage);var e=new Int8Array([99]);try{t.postMessage({array:e},[e.buffer])}catch(e){return TaskProcessor._canTransferArrayBuffer=!1,TaskProcessor._canTransferArrayBuffer}var i=when.defer();t.onmessage=function(e){e=e.data.array,e=defined(e)&&99===e[0];i.resolve(e),t.terminate(),TaskProcessor._canTransferArrayBuffer=e},TaskProcessor._canTransferArrayBuffer=i.promise}return TaskProcessor._canTransferArrayBuffer}HeightmapTessellator.computeVertices=function(e){var t,i,r,n=Math.cos,a=Math.sin,o=Math.sqrt,s=Math.atan,l=Math.exp,c=CesiumMath.PI_OVER_TWO,u=CesiumMath.toRadians,d=e.heightmap,h=e.width,p=e.height,m=e.skirtHeight,f=defaultValue(e.isGeographic,!0),g=defaultValue(e.ellipsoid,Ellipsoid.WGS84),_=1/g.maximumRadius,y=e.nativeRectangle,C=e.rectangle,v=defined(C)?(t=C.west,i=C.south,r=C.east,C.north):f?(t=u(y.west),i=u(y.south),r=u(y.east),u(y.north)):(t=y.west*_,i=c-2*s(l(-y.south*_)),r=y.east*_,c-2*s(l(-y.north*_))),S=defined(T=e.relativeToCenter),T=S?T:Cartesian3.ZERO,x=defaultValue(e.exaggeration,1),b=defaultValue(e.includeWebMercatorT,!1),E=defaultValue(e.structure,HeightmapTessellator.DEFAULT_STRUCTURE),P=defaultValue(E.heightScale,HeightmapTessellator.DEFAULT_STRUCTURE.heightScale),A=defaultValue(E.heightOffset,HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset),w=defaultValue(E.elementsPerHeight,HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight),D=defaultValue(E.stride,HeightmapTessellator.DEFAULT_STRUCTURE.stride),M=defaultValue(E.elementMultiplier,HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier),I=defaultValue(E.isBigEndian,HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian),R=Rectangle.computeWidth(y),O=Rectangle.computeHeight(y),L=R/(h-1),F=O/(p-1);f||(R*=_,O*=_);var N,B,e=g.radiiSquared,V=e.x,k=e.y,z=e.z,U=65536,$=-65536,E=Transforms.eastNorthUpToFixedFrame(T,g),G=Matrix4.inverseTransformation(E,matrix4Scratch$1);b&&(N=WebMercatorProjection.geodeticLatitudeToMercatorAngle(i),B=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(v)-N));var H=minimumScratch;H.x=Number.POSITIVE_INFINITY,H.y=Number.POSITIVE_INFINITY,H.z=Number.POSITIVE_INFINITY;var W=maximumScratch;W.x=Number.NEGATIVE_INFINITY,W.y=Number.NEGATIVE_INFINITY,W.z=Number.NEGATIVE_INFINITY;var q=Number.POSITIVE_INFINITY,j=h*p,Y=j+(0=this._maximumActiveTasks)){++this._activeTasks;var a=this;return when(canTransferArrayBuffer(),function(e){defined(n)?e||(n.length=0):n=emptyTransferableObjectArray;var t=a._nextID++,i=when.defer();return a._deferreds[t]=i,a._worker.postMessage({id:t,parameters:r,canTransferArrayBuffer:e},n),i.promise})}},TaskProcessor.prototype.initWebAssemblyModule=function(e){defined(this._worker)||(this._worker=createWorker(this));var n=when.defer(),a=this,o=this._worker;return getWebAssemblyLoaderConfig(this,e).then(function(r){return when(canTransferArrayBuffer(),function(e){var t,i=r.wasmBinary;defined(i)&&e&&(t=[i]),o.onmessage=function(e){o.onmessage=function(e){completeTask(a,e.data)},n.resolve(e.data)},o.postMessage({webAssemblyConfig:r},t)})}),n},TaskProcessor.prototype.isDestroyed=function(){return!1},TaskProcessor.prototype.destroy=function(){return defined(this._worker)&&this._worker.terminate(),destroyObject(this)},TaskProcessor.taskCompletedEvent=taskCompletedEvent,TaskProcessor._defaultWorkerModulePrefix="Workers/",TaskProcessor._workerModulePrefix=TaskProcessor._defaultWorkerModulePrefix,TaskProcessor._canTransferArrayBuffer=void 0;var IndexDatatype={UNSIGNED_BYTE:WebGLConstants$1.UNSIGNED_BYTE,UNSIGNED_SHORT:WebGLConstants$1.UNSIGNED_SHORT,UNSIGNED_INT:WebGLConstants$1.UNSIGNED_INT,getSizeInBytes:function(e){switch(e){case IndexDatatype.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case IndexDatatype.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case IndexDatatype.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},fromSizeInBytes:function(e){switch(e){case 2:return IndexDatatype.UNSIGNED_SHORT;case 4:return IndexDatatype.UNSIGNED_INT;case 1:return IndexDatatype.UNSIGNED_BYTE}},validate:function(e){return defined(e)&&(e===IndexDatatype.UNSIGNED_BYTE||e===IndexDatatype.UNSIGNED_SHORT||e===IndexDatatype.UNSIGNED_INT)},createTypedArray:function(e,t){return new(e>=CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(t)},createTypedArrayFromArrayBuffer:function(e,t,i,r){return new(e>=CesiumMath.SIXTY_FOUR_KILOBYTES?Uint32Array:Uint16Array)(t,i,r)}},IndexDatatype$1=Object.freeze(IndexDatatype);function TerrainProvider(){DeveloperError.throwInstantiationError()}Object.defineProperties(TerrainProvider.prototype,{errorEvent:{get:DeveloperError.throwInstantiationError},credit:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},ready:{get:DeveloperError.throwInstantiationError},readyPromise:{get:DeveloperError.throwInstantiationError},hasWaterMask:{get:DeveloperError.throwInstantiationError},hasVertexNormals:{get:DeveloperError.throwInstantiationError},availability:{get:DeveloperError.throwInstantiationError}});var regularGridIndicesCache=[];TerrainProvider.getRegularGridIndices=function(e,t){var i=regularGridIndicesCache[e];defined(i)||(regularGridIndicesCache[e]=i=[]);var r=i[t];return defined(r)||addRegularGridIndices(e,t,r=e*tu.highestEncodedHeight?u.highestEncodedHeight:A)}return new HeightmapTerrainData({buffer:h,width:l,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},HeightmapTerrainData.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!=(this._childTileMask&1<=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function rectangleContainsPosition(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function findMaxLevelFromNode(e,t,i){for(var r=0,n=!1;!n;){var a=t._nw&&rectangleContainsPosition(t._nw.extent,i),o=t._ne&&rectangleContainsPosition(t._ne.extent,i),s=t._sw&&rectangleContainsPosition(t._sw.extent,i),l=t._se&&rectangleContainsPosition(t._se.extent,i);if(1r;--u){var d=c[u];rectangleContainsPosition(d,i)&&(r=d.level)}t=t.parent}return r}function updateCoverageWithNode(e,t,i){if(t){var r=!1;for(a=0;at.east&&i.push(new Rectangle(t.east,n.south,n.east,n.north)),n.southt.north&&i.push(new Rectangle(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):i.push(n)}return i}function formatError(e){var t=e.name,i=e.message,i=defined(t)&&defined(i)?t+": "+i:e.toString(),e=e.stack;return defined(e)&&(i+="\n"+e),i}function TileProviderError(e,t,i,r,n,a,o){this.provider=e,this.message=t,this.x=i,this.y=r,this.level=n,this.timesRetried=defaultValue(a,0),this.retry=!1,this.error=o}function WebMercatorTilingScheme(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.WGS84),this._numberOfLevelZeroTilesX=defaultValue(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=defaultValue(e.numberOfLevelZeroTilesY,1),this._projection=new WebMercatorProjection(this._ellipsoid),defined(e.rectangleSouthwestInMeters)&&defined(e.rectangleNortheastInMeters)?(this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters):(t=this._ellipsoid.maximumRadius*Math.PI,this._rectangleSouthwestInMeters=new Cartesian2(-t,-t),this._rectangleNortheastInMeters=new Cartesian2(t,t));var e=this._projection.unproject(this._rectangleSouthwestInMeters),t=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new Rectangle(e.longitude,e.latitude,t.longitude,t.latitude)}TileAvailability.prototype.isTileAvailable=function(e,t,i){i=this._tilingScheme.tileXYToRectangle(t,i,e,rectangleScratch);return Rectangle.center(i,cartographicScratch),this.computeMaximumLevelAtPosition(cartographicScratch)>=e},TileAvailability.prototype.computeChildMaskForTile=function(e,t,i){var r=e+1;if(r>=this._maximumLevel)return 0;e=0;return e|=this.isTileAvailable(r,2*t,2*i+1)?1:0,e|=this.isTileAvailable(r,2*t+1,2*i+1)?2:0,e|=this.isTileAvailable(r,2*t,2*i)?4:0,e|=this.isTileAvailable(r,2*t+1,2*i)?8:0},Object.defineProperties(QuadtreeNode.prototype,{nw:{get:function(){return this._nw||(this._nw=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new QuadtreeNode(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),TileProviderError.handleError=function(e,t,i,r,n,a,o,s,l){var c=e;return defined(e)?(c.provider=t,c.message=r,c.x=n,c.y=a,c.level=o,c.retry=!1,c.error=l,++c.timesRetried):c=new TileProviderError(t,r,n,a,o,0,l),0e._lodCount)&&(!!a.isTileAvailable(t,i,r)||!n.isTileAvailable(t,i,r)&&void 0)}}function findRange(e,t,i,r){for(var n=t-1,a=i-1,o=r[e.y*t+e.x],s=[],l={startX:e.x,startY:e.y,endX:0,endY:0},c=new Cartesian2(e.x+1,e.y+1),u=!1,d=!1;!u||!d;){var h=c.x,p=d?c.y+1:c.y;if(!u){for(var m=e.y;m>>0,i=defaultValue(i,0),a=i<0?Math.max(n+i,0):Math.min(i,n),r=defaultValue(r,n),o=r<0?Math.max(n+r,0):Math.min(r,n);ai.width?i.width=r:r<0&&(i.width-=r,i.x=t.x),e>i.height?i.height=e:e<0&&(i.height-=e,i.y=t.y),i},BoundingRectangle.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,a=t.y;return i>n+t.width||i+e.widtha+t.height?Intersect$1.OUTSIDE:Intersect$1.INTERSECTING},BoundingRectangle.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},BoundingRectangle.prototype.clone=function(e){return BoundingRectangle.clone(this,e)},BoundingRectangle.prototype.intersect=function(e){return BoundingRectangle.intersect(this,e)},BoundingRectangle.prototype.equals=function(e){return BoundingRectangle.equals(this,e)};var GeometryType={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},GeometryType$1=Object.freeze(GeometryType);function Matrix2(e,t,i,r){this[0]=defaultValue(e,0),this[1]=defaultValue(i,0),this[2]=defaultValue(t,0),this[3]=defaultValue(r,0)}Matrix2.packedLength=4,Matrix2.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t},Matrix2.unpack=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new Matrix2),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i},Matrix2.clone=function(e,t){if(defined(e))return defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Matrix2(e[0],e[2],e[1],e[3])},Matrix2.fromArray=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new Matrix2),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i},Matrix2.fromColumnMajorArray=function(e,t){return Matrix2.clone(e,t)},Matrix2.fromRowMajorArray=function(e,t){return defined(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Matrix2(e[0],e[1],e[2],e[3])},Matrix2.fromScale=function(e,t){return defined(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Matrix2(e.x,0,0,e.y)},Matrix2.fromUniformScale=function(e,t){return defined(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Matrix2(e,0,0,e)},Matrix2.fromRotation=function(e,t){var i=Math.cos(e),e=Math.sin(e);return defined(t)?(t[0]=i,t[1]=e,t[2]=-e,t[3]=i,t):new Matrix2(i,-e,e,i)},Matrix2.toArray=function(e,t){return defined(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},Matrix2.getElementIndex=function(e,t){return 2*e+t},Matrix2.getColumn=function(e,t,i){var r=2*t,t=e[r],r=e[1+r];return i.x=t,i.y=r,i},Matrix2.setColumn=function(e,t,i,r){t*=2;return(r=Matrix2.clone(e,r))[t]=i.x,r[1+t]=i.y,r},Matrix2.getRow=function(e,t,i){var r=e[t],t=e[t+2];return i.x=r,i.y=t,i},Matrix2.setRow=function(e,t,i,r){return(r=Matrix2.clone(e,r))[t]=i.x,r[t+2]=i.y,r};var scratchColumn$2=new Cartesian2;Matrix2.getScale=function(e,t){return t.x=Cartesian2.magnitude(Cartesian2.fromElements(e[0],e[1],scratchColumn$2)),t.y=Cartesian2.magnitude(Cartesian2.fromElements(e[2],e[3],scratchColumn$2)),t};var scratchScale$4=new Cartesian2;Matrix2.getMaximumScale=function(e){return Matrix2.getScale(e,scratchScale$4),Cartesian2.maximumComponent(scratchScale$4)},Matrix2.multiply=function(e,t,i){var r=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],t=e[1]*t[2]+e[3]*t[3];return i[0]=r,i[1]=a,i[2]=n,i[3]=t,i},Matrix2.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},Matrix2.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},Matrix2.multiplyByVector=function(e,t,i){var r=e[0]*t.x+e[2]*t.y,t=e[1]*t.x+e[3]*t.y;return i.x=r,i.y=t,i},Matrix2.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},Matrix2.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.y,i[3]=e[3]*t.y,i},Matrix2.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},Matrix2.transpose=function(e,t){var i=e[0],r=e[2],n=e[1],e=e[3];return t[0]=i,t[1]=r,t[2]=n,t[3]=e,t},Matrix2.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},Matrix2.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},Matrix2.equalsArray=function(e,t,i){return e[0]===t[i]&&e[1]===t[i+1]&&e[2]===t[i+2]&&e[3]===t[i+3]},Matrix2.equalsEpsilon=function(e,t,i){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&Math.abs(e[0]-t[0])<=i&&Math.abs(e[1]-t[1])<=i&&Math.abs(e[2]-t[2])<=i&&Math.abs(e[3]-t[3])<=i},Matrix2.IDENTITY=Object.freeze(new Matrix2(1,0,0,1)),Matrix2.ZERO=Object.freeze(new Matrix2(0,0,0,0)),Matrix2.COLUMN0ROW0=0,Matrix2.COLUMN0ROW1=1,Matrix2.COLUMN1ROW0=2,Matrix2.COLUMN1ROW1=3,Object.defineProperties(Matrix2.prototype,{length:{get:function(){return Matrix2.packedLength}}}),Matrix2.prototype.clone=function(e){return Matrix2.clone(this,e)},Matrix2.prototype.equals=function(e){return Matrix2.equals(this,e)},Matrix2.prototype.equalsEpsilon=function(e,t){return Matrix2.equalsEpsilon(this,e,t)},Matrix2.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"};var PrimitiveType={POINTS:WebGLConstants$1.POINTS,LINES:WebGLConstants$1.LINES,LINE_LOOP:WebGLConstants$1.LINE_LOOP,LINE_STRIP:WebGLConstants$1.LINE_STRIP,TRIANGLES:WebGLConstants$1.TRIANGLES,TRIANGLE_STRIP:WebGLConstants$1.TRIANGLE_STRIP,TRIANGLE_FAN:WebGLConstants$1.TRIANGLE_FAN,validate:function(e){return e===PrimitiveType.POINTS||e===PrimitiveType.LINES||e===PrimitiveType.LINE_LOOP||e===PrimitiveType.LINE_STRIP||e===PrimitiveType.TRIANGLES||e===PrimitiveType.TRIANGLE_STRIP||e===PrimitiveType.TRIANGLE_FAN}},PrimitiveType$1=Object.freeze(PrimitiveType);function Geometry(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=defaultValue(e.primitiveType,PrimitiveType$1.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=defaultValue(e.geometryType,GeometryType$1.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}Geometry.computeNumberOfVertices=function(e){var t,i,r=-1;for(t in e.attributes)e.attributes.hasOwnProperty(t)&&defined(e.attributes[t])&&defined(e.attributes[t].values)&&(r=(i=e.attributes[t]).values.length/i.componentsPerAttribute);return r};var rectangleCenterScratch=new Cartographic,enuCenterScratch=new Cartesian3,fixedFrameToEnuScratch=new Matrix4,boundingRectanglePointsCartographicScratch=[new Cartographic,new Cartographic,new Cartographic],boundingRectanglePointsEnuScratch=[new Cartesian2,new Cartesian2,new Cartesian2],points2DScratch=[new Cartesian2,new Cartesian2,new Cartesian2],pointEnuScratch=new Cartesian3,enuRotationScratch=new Quaternion,enuRotationMatrixScratch=new Matrix4,rotation2DScratch=new Matrix2;function GeometryAttribute(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=defaultValue(e.normalize,!1),this.values=e.values}function GeometryAttributes(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}Geometry._textureCoordinateRotationPoints=function(e,t,i,r){var n=Rectangle.center(r,rectangleCenterScratch),a=Cartographic.toCartesian(n,i,enuCenterScratch),n=Transforms.eastNorthUpToFixedFrame(a,i,fixedFrameToEnuScratch),o=Matrix4.inverse(n,fixedFrameToEnuScratch),s=boundingRectanglePointsEnuScratch,l=boundingRectanglePointsCartographicScratch;l[0].longitude=r.west,l[0].latitude=r.south,l[1].longitude=r.west,l[1].latitude=r.north,l[2].longitude=r.east,l[2].latitude=r.south;for(var c=pointEnuScratch,u=0;u<3;u++)Cartographic.toCartesian(l[u],i,c),c=Matrix4.multiplyByPointAsVector(o,c,c),s[u].x=c.x,s[u].y=c.y;var a=Quaternion.fromAxisAngle(Cartesian3.UNIT_Z,-t,enuRotationScratch),d=Matrix3.fromQuaternion(a,enuRotationMatrixScratch),h=e.length,p=Number.POSITIVE_INFINITY,m=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,g=Number.NEGATIVE_INFINITY;for(u=0;u=r[t=defaultValue(t,0)]){if(t+1=r[t-1])return t-1;if(e>r[t])for(i=t;i=r[i]&&e=r[i]&&e>10),56320+(1023&a)))}return t},"undefined"!=typeof TextDecoder?getStringFromTypedArray.decode=getStringFromTypedArray.decodeWithTextDecoder:getStringFromTypedArray.decode=getStringFromTypedArray.decodeWithFromCharCode;var Intersections2D={};function QuantizedMeshTerrainData(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;var t=this._quantizedVertices.length/3,i=this._uValues=this._quantizedVertices.subarray(0,t),r=this._vValues=this._quantizedVertices.subarray(t,2*t);function n(e,t){return r[e]-r[t]}function a(e,t){return i[e]-i[t]}this._heightValues=this._quantizedVertices.subarray(2*t,3*t),this._westIndices=sortIndicesIfNecessary(e.westIndices,n,t),this._southIndices=sortIndicesIfNecessary(e.southIndices,a,t),this._eastIndices=sortIndicesIfNecessary(e.eastIndices,n,t),this._northIndices=sortIndicesIfNecessary(e.northIndices,a,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=defaultValue(e.childTileMask,15),this._createdByUpsampling=defaultValue(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Intersections2D.clipTriangleAtAxisAlignedThreshold=function(e,t,i,r,n,a){var o,s,l;defined(a)?a.length=0:a=[],l=t?(o=ithis._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(i,e,t))return!0;if(!this._hasMetadata)return!1;for(var r=this._layers,n=r.length,a=0;athis._availability._maximumLevel||this._availability.isTileAvailable(i,e,t))&&this._hasMetadata)for(var r=this._layers,n=r.length,a=0;ar&&(s[t[u]]=c,++c);return(c-r+1)/(n/3)}};Tipsify.tipsify=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).indices,i=e.maximumIndex,r=defaultValue(e.cacheSize,24);function n(e,t,i,r,n,a,o){for(var s,l=-1,c=-1,u=0;ur&&(p.timeStamp=g,++g),++o}f=n(0,r,y,c,g,C,a)}return S};var GeometryPipeline={};function addTriangle(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function trianglesToLines(e){for(var t=e.length,i=t/3*6,r=IndexDatatype$1.createTypedArray(t,i),n=0,a=0;an&&(n=i[a]);e.indices=Tipsify.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},GeometryPipeline.fitToUnsignedShortIndices=function(e){var t=[],i=Geometry.computeNumberOfVertices(e);if(defined(e.indices)&&i>=CesiumMath.SIXTY_FOUR_KILOBYTES){var r,n=[],a=[],o=0,s=copyAttributesDescriptions(e.attributes),l=e.indices,c=l.length;e.primitiveType===PrimitiveType$1.TRIANGLES?r=3:e.primitiveType===PrimitiveType$1.LINES?r=2:e.primitiveType===PrimitiveType$1.POINTS&&(r=1);for(var u=0;u=CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(new Geometry({attributes:s,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],a=[],o=0,s=copyAttributesDescriptions(e.attributes))}0!==a.length&&t.push(new Geometry({attributes:s,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var scratchProjectTo2DCartesian3=new Cartesian3,scratchProjectTo2DCartographic=new Cartographic;GeometryPipeline.projectTo2D=function(e,t,i,r,n){for(var a=e.attributes[t],o=(n=defined(n)?n:new GeographicProjection).ellipsoid,s=a.values,l=new Float64Array(s.length),c=0,u=0;uCesiumMath.EPSILON6?1:0},p0Scratch=new Cartesian3,p1Scratch=new Cartesian3,p2Scratch=new Cartesian3,barycentricScratch=new Cartesian3;function computeTriangleAttributes(e,t,i,r,n,a,o,s,l,c,u,d,h,p,m,f){if(defined(a)||defined(o)||defined(s)||defined(l)||defined(c)||0!==p){var g,_=barycentricCoordinates(r,Cartesian3.fromArray(n,3*e,p0Scratch),Cartesian3.fromArray(n,3*t,p1Scratch),Cartesian3.fromArray(n,3*i,p2Scratch),barycentricScratch);if(defined(a)&&interpolateAndPackCartesian3(e,t,i,_,a,d.normal.values,f,!0),defined(c)&&(n=Cartesian3.fromArray(c,3*e,p0Scratch),a=Cartesian3.fromArray(c,3*t,p1Scratch),c=Cartesian3.fromArray(c,3*i,p2Scratch),Cartesian3.multiplyByScalar(n,_.x,n),Cartesian3.multiplyByScalar(a,_.y,a),Cartesian3.multiplyByScalar(c,_.z,c),Cartesian3.equals(n,Cartesian3.ZERO)&&Cartesian3.equals(a,Cartesian3.ZERO)&&Cartesian3.equals(c,Cartesian3.ZERO)?((g=p0Scratch).x=0,g.y=0,g.z=0):(g=Cartesian3.add(n,a,n),Cartesian3.add(g,c,g),Cartesian3.normalize(g,g)),Cartesian3.pack(g,d.extrudeDirection.values,3*f)),defined(u)&&interpolateAndPackBoolean(e,t,i,_,u,d.applyOffset.values,f),defined(o)&&interpolateAndPackCartesian3(e,t,i,_,o,d.tangent.values,f,!0),defined(s)&&interpolateAndPackCartesian3(e,t,i,_,s,d.bitangent.values,f,!0),defined(l)&&interpolateAndPackCartesian2(e,t,i,_,l,d.st.values,f),0CesiumMath.PI&&(o.north=0CesiumMath.EPSILON8?(o=calculateInverseM(calculateM(n,r,e.latitude)+i*Math.cos(t),n,r),l=calculateSigma(n,e.latitude),s=calculateSigma(n,o),l=Math.tan(t)*(s-l),CesiumMath.negativePiToPi(e.longitude+l)):(o=e.latitude,l=i/(0===n?r*Math.cos(e.latitude):(n=Math.sin(e.latitude),r*Math.cos(e.latitude)/Math.sqrt(1-c*n*n))),080*i){r=a=e[0],n=o=e[1];for(var m=i;ma.x?n.x>o.x?n:o:a.x>o.x?a:o).x,u=(n.y>a.y?n.y>o.y?n:o:a.y>o.y?a:o).y,d=zOrder(s,l,t,i,r),h=zOrder(c,u,t,i,r),p=e.prevZ,m=e.nextZ;p&&p.z>=d&&m&&m.z<=h;){if(p!==e.prev&&p!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=area(p.prev,p,p.next))return;if(p=p.prevZ,m!==e.prev&&m!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,m.x,m.y)&&0<=area(m.prev,m,m.next))return;m=m.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,p.x,p.y)&&0<=area(p.prev,p,p.next))return;p=p.prevZ}for(;m&&m.z<=h;){if(m!==e.prev&&m!==e.next&&pointInTriangle(n.x,n.y,a.x,a.y,o.x,o.y,m.x,m.y)&&0<=area(m.prev,m,m.next))return;m=m.nextZ}return 1}}function cureLocalIntersections(e,t,i){var r=e;do{var n=r.prev,a=r.next.next}while(!equals(n,a)&&intersects(n,r,r.next,a)&&locallyInside(n,a)&&locallyInside(a,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(a.i/i),removeNode(r),removeNode(r.next),r=e=a),(r=r.next)!==e);return filterPoints(r)}function splitEarcut(e,t,i,r,n,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&isValidDiagonal(o,s)){var l=splitPolygon(o,s),o=filterPoints(o,o.next),l=filterPoints(l,l.next);return earcutLinked(o,t,i,r,n,a),void earcutLinked(l,t,i,r,n,a)}s=s.next}}while((o=o.next)!==e)}function eliminateHoles(e,t,i,r){for(var n,a=[],o=0,s=t.length;o=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&o=r.x&&r.x>=u&&n!==r.x&&pointInTriangle(ai.x||r.x===i.x&§orContainsSector(i,r)))&&(i=r,h=l)),r=r.next,r!==c;);return i}function sectorContainsSector(e,t){return area(e.prev,e,t.prev)<0&&area(t.next,e,e.next)<0}function indexCurve(e,t,i,r){for(var n=e;null===n.z&&(n.z=zOrder(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next,n!==e;);n.prevZ.nextZ=null,n.prevZ=null,sortLinked(n)}function sortLinked(e){var t,i,r,n,a,o,s,l,c=1;do{for(i=e,a=e=null,o=0;i;){for(o++,r=i,t=s=0;t=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function sign(e){return 0a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next,i!==e;);return r}function splitPolygon(e,t){var i=new Node$1(e.i,e.x,e.y),r=new Node$1(t.i,t.x,t.y),n=e.next,a=t.prev;return(e.next=t).prev=e,(i.next=n).prev=i,(r.next=i).prev=r,(a.next=r).prev=a,r}function insertNode(e,t,i,r){i=new Node$1(e,t,i);return r?(i.next=r.next,(i.prev=r).next.prev=i,r.next=i):(i.prev=i).next=i,i}function removeNode(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Node$1(e,t,i){this.i=e,this.x=t,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(e,t,i,r){for(var n=0,a=t,o=i-r;ae.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},Queue.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},Queue.prototype.contains=function(e){return-1!==this._array.indexOf(e)},Queue.prototype.clear=function(){this._array.length=this._offset=this._length=0},Queue.prototype.sort=function(e){0CesiumMath.EPSILON12);n=C*(t*t-i*i)/(i*i),r=n*(256+n*(n*(74-47*n)-128))/1024,t=b*b,r=i*(1+n*(4096+n*(n*(320-175*n)-768))/16384)*(x-r*S*(b+r*(T*(2*t-1)-r*b*(4*S*S-3)*(4*t-3)/6)/4)),t=Math.atan2(c*_,d-p*g),o=Math.atan2(o*_,d*g-p);e._distance=r,e._startHeading=t,e._endHeading=o,e._uSquared=n}var scratchCart1$1=new Cartesian3,scratchCart2$1=new Cartesian3;function computeProperties$1(e,t,i,r){Cartesian3.normalize(r.cartographicToCartesian(t,scratchCart2$1),scratchCart1$1),Cartesian3.normalize(r.cartographicToCartesian(i,scratchCart2$1),scratchCart2$1);vincentyInverseFormula(e,r.maximumRadius,r.minimumRadius,t.longitude,t.latitude,i.longitude,i.latitude),e._start=Cartographic.clone(t,e._start),e._end=Cartographic.clone(i,e._end),e._start.height=0,e._end.height=0,setConstants(e)}function EllipsoidGeodesic(e,t,i){i=defaultValue(i,Ellipsoid.WGS84);this._ellipsoid=i,this._start=new Cartographic,this._end=new Cartographic,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,defined(e)&&defined(t)&&computeProperties$1(this,e,t,i)}Object.defineProperties(EllipsoidGeodesic.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}}),EllipsoidGeodesic.prototype.setEndPoints=function(e,t){computeProperties$1(this,e,t,this._ellipsoid)},EllipsoidGeodesic.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance=function(e,t){var i=this._constants,r=i.distanceRatio+e/i.b,n=Math.cos(2*r),a=Math.cos(4*r),o=Math.cos(6*r),s=Math.sin(2*r),l=Math.sin(4*r),c=Math.sin(6*r),u=Math.sin(8*r),d=r*r,h=r*d,p=i.u8Over256,m=i.u2Over4,f=i.u6Over64,e=i.u4Over16,d=2*h*p*n/3+r*(1-m+7*e/4-15*f/4+579*p/64-(e-15*f/4+187*p/16)*n-(5*f/4-115*p/16)*a-29*p*o/16)+(m/2-e+71*f/32-85*p/16)*s+(5*e/16-5*f/4+383*p/96)*l-d*((f-11*p/2)*s+5*p*l/2)+(29*f/96-29*p/16)*c+539*p*u/1536,s=Math.asin(Math.sin(d)*i.cosineAlpha),l=Math.atan(i.a/i.b*Math.tan(s));d-=i.sigma;f=Math.cos(2*i.sigma+d),c=Math.sin(d),p=Math.cos(d),u=i.cosineU*p,s=i.sineU*c,f=Math.atan2(c*i.sineHeading,u-s*i.cosineHeading)-computeDeltaLambda(i.f,i.sineAlpha,i.cosineSquaredAlpha,d,c,p,f);return defined(t)?(t.longitude=this._start.longitude+f,t.latitude=l,t.height=0,t):new Cartographic(this._start.longitude+f,l,0)};var PolylinePipeline={numberOfPoints:function(e,t,i){t=Cartesian3.distance(e,t);return Math.ceil(t/i)},numberOfPointsRhumbLine:function(e,t,i){t=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(t/(i*i))))}},cartoScratch=new Cartographic;PolylinePipeline.extractHeights=function(e,t){for(var i=e.length,r=new Array(i),n=0;n>2],r=(3&s)<<4,o=1;break;case 1:n[a++]=l[r|s>>4],r=(15&s)<<2,o=2;break;case 2:n[a++]=l[r|s>>6],n[a++]=l[63&s],o=0}}return o&&(n[a++]=l[r],n[a]=61,1===o&&(n[a+1]=61)),String.fromCharCode.apply(String,n)};var u="invalid encoding";i.decode=function(e,t,i){for(var r,n=i,a=0,o=0;o>4,r=s,a=2;break;case 2:t[i++]=(15&r)<<4|(60&s)>>2,r=s,a=3;break;case 3:t[i++]=(3&r)<<6|s,a=0}}if(1===a)throw Error(u);return i-n},i.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},{}],3:[function(e,t,i){function r(){this._listeners={}}(t.exports=r).prototype.on=function(e,t,i){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:i||this}),this},r.prototype.off=function(e,t){if(e===undefined$1)this._listeners={};else if(t===undefined$1)this._listeners[e]=[];else for(var i=this._listeners[e],r=0;r>>1,a=null,o=r;return function(e){if(e<1||n>10),a[o++]=56320+(1023&r)):a[o++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],8191>6|192:(55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(o+1)))?(r=65536+((1023&r)<<10)+(1023&n),++o,t[i++]=r>>18|240,t[i++]=r>>12&63|128):t[i++]=r>>12|224,t[i++]=r>>6&63|128),t[i++]=63&r|128);return i-a}},{}],7:[function(e,t,i){var r=i;function n(){r.Reader._configure(r.BufferReader),r.util._configure()}r.build="minimal",r.roots={},r.Writer=e(14),r.BufferWriter=e(15),r.Reader=e(8),r.BufferReader=e(9),r.util=e(13),r.rpc=e(10),r.configure=n,r.Writer._configure(r.BufferWriter),n()},{10:10,13:13,14:14,15:15,8:8,9:9}],8:[function(e,t,i){t.exports=l;var r,n=e(13),a=n.LongBits,o=n.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")};function d(){var e=new a(0,0),t=0;if(!(4=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,4>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw s(this,8);return new a(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}l.create=n.Buffer?function(e){return(l.create=function(e){return n.Buffer.isBuffer(e)?new r(e):u(e)})(e)}:u,l.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)};var m,f,g="undefined"!=typeof Float32Array?(m=new Float32Array(1),f=new Uint8Array(m.buffer),m[0]=-0,f[3]?function(e,t){return f[0]=e[t],f[1]=e[t+1],f[2]=e[t+2],f[3]=e[t+3],m[0]}:function(e,t){return f[0]=e[t+3],f[1]=e[t+2],f[2]=e[t+1],f[3]=e[t],m[0]}):function(e,t){var i=h(e,t+4),e=2*(i>>31)+1,t=i>>>23&255,i=8388607&i;return 255==t?i?NaN:1/0*e:0==t?1401298464324817e-60*e*i:e*Math.pow(2,t-150)*(8388608+i)};l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=g(this.buf,this.pos);return this.pos+=4,e};var _,y,C="undefined"!=typeof Float64Array?(_=new Float64Array(1),y=new Uint8Array(_.buffer),_[0]=-0,y[7]?function(e,t){return y[0]=e[t],y[1]=e[t+1],y[2]=e[t+2],y[3]=e[t+3],y[4]=e[t+4],y[5]=e[t+5],y[6]=e[t+6],y[7]=e[t+7],_[0]}:function(e,t){return y[0]=e[t+7],y[1]=e[t+6],y[2]=e[t+5],y[3]=e[t+4],y[4]=e[t+3],y[5]=e[t+2],y[6]=e[t+1],y[7]=e[t],_[0]}):function(e,t){var i=h(e,t+4),r=h(e,t+8),e=2*(r>>31)+1,t=r>>>20&2047,i=4294967296*(1048575&r)+i;return 2047==t?i?NaN:1/0*e:0==t?5e-324*e*i:e*Math.pow(2,t-1075)*(i+4503599627370496)};l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=C(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,i=this.pos+e;if(i>this.len)throw s(this,e);return this.pos+=e,t===i?new this.buf.constructor(0):this._slice.call(this.buf,t,i)},l.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){r=e;var t=n.Long?"toLong":"toNumber";n.merge(l.prototype,{int64:function(){return d.call(this)[t](!1)},uint64:function(){return d.call(this)[t](!0)},sint64:function(){return d.call(this).zzDecode()[t](!1)},fixed64:function(){return p.call(this)[t](!0)},sfixed64:function(){return p.call(this)[t](!1)}})}},{13:13}],9:[function(e,t,i){t.exports=n;var r=e(8);(n.prototype=Object.create(r.prototype)).constructor=n;e=e(13);function n(e){r.call(this,e)}e.Buffer&&(n.prototype._slice=e.Buffer.prototype.slice),n.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))}},{13:13,8:8}],10:[function(e,t,i){i.Service=e(11)},{11:11}],11:[function(e,t,i){t.exports=r;var s=e(13);function r(e,t,i){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");s.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(i)}((r.prototype=Object.create(s.EventEmitter.prototype)).constructor=r).prototype.rpcCall=function e(i,t,r,n,a){if(!n)throw TypeError("request must be specified");var o=this;if(!a)return s.asPromise(e,o,i,t,r,n);if(!o.rpcImpl)return setTimeout(function(){a(Error("already ended"))},0),undefined$1;try{return o.rpcImpl(i,t[o.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(e,t){if(e)return o.emit("error",e,i),a(e);if(null===t)return o.end(!0),undefined$1;if(!(t instanceof r))try{t=r[o.responseDelimited?"decodeDelimited":"decode"](t)}catch(e){return o.emit("error",e,i),a(e)}return o.emit("data",t,i),a(null,t)})}catch(e){return o.emit("error",e,i),setTimeout(function(){a(e)},0),undefined$1}},r.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{13:13}],12:[function(e,t,i){t.exports=n;var r=e(13);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=n.zero=new n(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return a;var t=e<0;t&&(e=-e);var i=e>>>0,e=(e-i)/4294967296>>>0;return t&&(e=~e>>>0,i=~i>>>0,4294967295<++i&&(i=0,4294967295<++e&&(e=0))),new n(i,e)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(r.isString(e)){if(!r.Long)return n.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):a},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,e=~this.hi>>>0;return t||(e=e+1>>>0),-(t+4294967296*e)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var o=String.prototype.charCodeAt;n.fromHash=function(e){return"\0\0\0\0\0\0\0\0"===e?a:new n((o.call(e,0)|o.call(e,1)<<8|o.call(e,2)<<16|o.call(e,3)<<24)>>>0,(o.call(e,4)|o.call(e,5)<<8|o.call(e,6)<<16|o.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0==i?0==t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10}},{13:13}],13:[function(e,t,i){var r=i;function n(e,t,i){for(var r=Object.keys(t),n=0;n>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;127>>7;t[i++]=e.lo}function f(e,t,i){t[i++]=255&e,t[i++]=e>>>8&255,t[i++]=e>>>16&255,t[i]=e>>>24}d.create=n.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d},d.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(d.alloc=n.pool(d.alloc,n.Array.prototype.subarray)),d.prototype.push=function(e,t,i){return this.tail=this.tail.next=new l(e,t,i),this.len+=t,this},(p.prototype=Object.create(l.prototype)).fn=function(e,t,i){for(;127>>=7;t[i]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this.push(m,10,a.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.int64=d.prototype.uint64=function(e){e=a.from(e);return this.push(m,e.length(),e)},d.prototype.sint64=function(e){e=a.from(e).zzEncode();return this.push(m,e.length(),e)},d.prototype.bool=function(e){return this.push(h,1,e?1:0)},d.prototype.sfixed32=d.prototype.fixed32=function(e){return this.push(f,4,e>>>0)},d.prototype.sfixed64=d.prototype.fixed64=function(e){e=a.from(e);return this.push(f,4,e.lo).push(f,4,e.hi)};var g,_,y="undefined"!=typeof Float32Array?(g=new Float32Array(1),_=new Uint8Array(g.buffer),g[0]=-0,_[3]?function(e,t,i){g[0]=e,t[i++]=_[0],t[i++]=_[1],t[i++]=_[2],t[i]=_[3]}:function(e,t,i){g[0]=e,t[i++]=_[3],t[i++]=_[2],t[i++]=_[1],t[i]=_[0]}):function(e,t,i){var r=e<0?1:0;r&&(e=-e),0===e?f(0<1/e?0:2147483648,t,i):isNaN(e)?f(2147483647,t,i):f(34028234663852886e22>>0:e<11754943508222875e-54?(r<<31|Math.round(e/1401298464324817e-60))>>>0:(r<<31|(r=Math.floor(Math.log(e)/Math.LN2))+127<<23|8388607&Math.round(e*Math.pow(2,-r)*8388608))>>>0,t,i)};d.prototype.float=function(e){return this.push(y,4,e)};var C,v,S="undefined"!=typeof Float64Array?(C=new Float64Array(1),v=new Uint8Array(C.buffer),C[0]=-0,v[7]?function(e,t,i){C[0]=e,t[i++]=v[0],t[i++]=v[1],t[i++]=v[2],t[i++]=v[3],t[i++]=v[4],t[i++]=v[5],t[i++]=v[6],t[i]=v[7]}:function(e,t,i){C[0]=e,t[i++]=v[7],t[i++]=v[6],t[i++]=v[5],t[i++]=v[4],t[i++]=v[3],t[i++]=v[2],t[i++]=v[1],t[i]=v[0]}):function(e,t,i){var r,n,a=e<0?1:0;a&&(e=-e),0===e?(f(0,t,i),f(0<1/e?0:2147483648,t,i+4)):isNaN(e)?(f(4294967295,t,i),f(2147483647,t,i+4)):17976931348623157e292>>0,t,i+4)):e<22250738585072014e-324?(f((r=e/5e-324)>>>0,t,i),f((a<<31|r/4294967296)>>>0,t,i+4)):(1024===(n=Math.floor(Math.log(e)/Math.LN2))&&(n=1023),f(4503599627370496*(r=e*Math.pow(2,-n))>>>0,t,i),f((a<<31|n+1023<<20|1048576*r&1048575)>>>0,t,i+4))};d.prototype.double=function(e){return this.push(S,8,e)};var T=n.Array.prototype.set?function(e,t,i){t.set(e,i)}:function(e,t,i){for(var r=0;r>>0;return i?(n.isString(e)&&(t=d.alloc(i=o.length(e)),o.decode(e,t,0),e=t),this.uint32(i).push(T,i,e)):this.push(h,1,0)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t).push(s.write,t,e):this.push(h,1,0)},d.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(c,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(c,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,i=this.len;return this.reset().uint32(i),i&&(this.tail.next=e.next,this.tail=t,this.len+=i),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),i=0;e;)e.fn(e.val,t,i),i+=e.len,e=e.next;return t},d._configure=function(e){r=e}},{13:13}],15:[function(e,t,i){t.exports=o;var r=e(14);(o.prototype=Object.create(r.prototype)).constructor=o;var n=e(13),a=n.Buffer;function o(){r.call(this)}o.alloc=function(e){return(o.alloc=n._Buffer_allocUnsafe)(e)};var s=a&&a.prototype instanceof Uint8Array&&"set"===a.prototype.set.name?function(e,t,i){t.set(e,i)}:function(e,t,i){if(e.copy)e.copy(t,i,0,e.length);else for(var r=0;r>>0;return this.uint32(t),t&&this.push(s,t,e),this},o.prototype.string=function(e){var t=a.byteLength(e);return this.uint32(t),t&&this.push(l,t,e),this}},{13:13,14:14}]},cKb={},dKb=[7],global.protobuf=function e(t){var i=cKb[t];return i||bKb[t][0].call(i=cKb[t]={exports:{}},e,i,i.exports),i.exports}(dKb[0])}(tmp$1);var protobuf=tmp$1.protobuf;function isBitSet(e,t){return 0!=(e&t)}var childrenBitmasks=[1,2,4,8],anyChildBitmask=15,cacheFlagBitmask=16,imageBitmask=64,terrainBitmask=128;function GoogleEarthEnterpriseTileInformation(e,t,i,r,n,a){this._bits=e,this.cnodeVersion=t,this.imageryVersion=i,this.terrainVersion=r,this.imageryProvider=n,this.terrainProvider=a,this.ancestorHasTerrain=!1,this.terrainState=void 0}function stringToBuffer(e){for(var t=e.length,i=new ArrayBuffer(t),r=new Uint8Array(i),n=0;nmF8J´Ýð.ÝuڌDt"úa"\f3"So¯9D\vŒ9Ù9L¹¿«\\ŒP_Ÿ"uxéq‘h;ÁěðMª>}æÎI‰Ææx\fa1-¤O¥~q ˆì\r1èN\v\0nPh}=\b\r•¦n£h—$[kó#ó¶s³\r\v@ÀŸØQ]ú".jßI\0¹ wUÆïj¿{GLƒîÜÜF…©­S+S4ÿ”Yä8è1ƒN¹XFkË-#†’p\x005ˆ"Ï1²&/çÃu-6,rt°#G·ÓÑ&…7râ\0ŒDÏÚ3-Þ`†i#i*|ÍKQ\r•T9w.)ê¦P¢joP™\\>TûïP[\vE‰m(w7ێJfJo™ åpâ¹q~\fmI-zþrÇòY0»]såÉ êxì ðŠB|G`°½&·q¶ÇŸÑ3‚=Ó«îc™È+S D\\qÆÌD2O<ÊÀ)=RÓaX©}e´ÜÏ\rô=ñ\b©BÚ#\tØ¿^PIøMÀËGLO÷{+ØÅ1’;µoÜl\r’ˆўÛ?âéÚ_ԄâFaZÞUϤ\0¾ýÎgñJi—æ HØ]~®q N®ÀV©‘<‚rçvì)IÖ]-ƒãÛ6©;f—‡jÕ¶=P^R¹KÇsWxÉô.Y•“oÐKW>\'\'Ç`Û;íšSD>?’mw¢\në?R¨ÆU^1I7…ôÅ&-©¿‹\'TÚÃj å*x°Öprª‹h½ˆ÷_H±~ÀXL?fù>áeÀp§Ï8i¯ðVldIœ\'­xtO‡ÞV9\0Úw\vË-‰û5Oõ\bQ`Á\nZGM&30xÚÀœFGâ[y`In7gS\n>éìF9²ñ4\rƄSuná\fYÙÞ)…{II¥wy¾IV.6ç\v:»Ob{ÒM1•/½8{¨O!áìFpv•})"xˆ\nÝ\\ÚÞQÏðüYRe|3ßóHÚ»*uÛ`²Ôüíì5¨ÿ(1-È܈F|Š["');function GoogleEarthEnterpriseMetadata(e){var t=e;"string"==typeof t||t instanceof Resource||(t=e.url);t=Resource.createIfNeeded(t);t.appendForwardSlash(),this._resource=t,this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=CesiumMath.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={};var i=this;this._readyPromise=requestDbRoot(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion)}).then(function(){return!0}).otherwise(function(e){var t="An error occurred while accessing "+getMetadataResource(i,"",1).url+".";return when.reject(new RuntimeError(t))})}Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return this._readyPromise}}}),GoogleEarthEnterpriseMetadata.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;0<=n;--n){var a=1<CesiumMath.PI_OVER_TWO&&(s=!0,o=Cartesian3.subtract(a,i,normalEndpointScratch),c=l.cartesianToCartographic(o,endPosCartographicScratch)),c.height=0;c=e.project(c,n);return(n=Cartesian3.subtract(c,r,n)).z=0,n=Cartesian3.normalize(n,n),s&&Cartesian3.negate(n,n),n}var adjustHeightNormalScratch=new Cartesian3,adjustHeightOffsetScratch=new Cartesian3;function adjustHeights(e,t,i,r,n,a){var o=Cartesian3.subtract(t,e,adjustHeightNormalScratch);Cartesian3.normalize(o,o);i-=WALL_INITIAL_MIN_HEIGHT,i=Cartesian3.multiplyByScalar(o,i,adjustHeightOffsetScratch);Cartesian3.add(e,i,n);r-=WALL_INITIAL_MAX_HEIGHT,i=Cartesian3.multiplyByScalar(o,r,adjustHeightOffsetScratch);Cartesian3.add(t,i,a)}var nudgeDirectionScratch=new Cartesian3;function nudgeXZ(e,t){var i=Plane.getPointDistance(XZ_PLANE,e),r=Plane.getPointDistance(XZ_PLANE,t),n=nudgeDirectionScratch;CesiumMath.equalsEpsilon(i,0,CesiumMath.EPSILON2)?(n=direction(t,e,n),Cartesian3.multiplyByScalar(n,CesiumMath.EPSILON2,n),Cartesian3.add(e,n,e)):CesiumMath.equalsEpsilon(r,0,CesiumMath.EPSILON2)&&(n=direction(e,t,n),Cartesian3.multiplyByScalar(n,CesiumMath.EPSILON2,n),Cartesian3.add(t,n,t))}function nudgeCartographic(e,t){var i=Math.abs(e.longitude),r=Math.abs(t.longitude);if(CesiumMath.equalsEpsilon(i,CesiumMath.PI,CesiumMath.EPSILON11)){var n=CesiumMath.sign(t.longitude);return e.longitude=n*(i-CesiumMath.EPSILON11),1}if(CesiumMath.equalsEpsilon(r,CesiumMath.PI,CesiumMath.EPSILON11)){e=CesiumMath.sign(e.longitude);return t.longitude=e*(r-CesiumMath.EPSILON11),2}return 0}var startCartographicScratch=new Cartographic,endCartographicScratch=new Cartographic,segmentStartTopScratch=new Cartesian3,segmentEndTopScratch=new Cartesian3,segmentStartBottomScratch=new Cartesian3,segmentEndBottomScratch=new Cartesian3,segmentStartNormalScratch=new Cartesian3,segmentEndNormalScratch=new Cartesian3,getHeightCartographics=[startCartographicScratch,endCartographicScratch],getHeightRectangleScratch=new Rectangle,adjustHeightStartTopScratch=new Cartesian3,adjustHeightEndTopScratch=new Cartesian3,adjustHeightStartBottomScratch=new Cartesian3,adjustHeightEndBottomScratch=new Cartesian3,segmentStart2DScratch=new Cartesian3,segmentEnd2DScratch=new Cartesian3,segmentStartNormal2DScratch=new Cartesian3,segmentEndNormal2DScratch=new Cartesian3,offsetScratch$1=new Cartesian3,startUpScratch=new Cartesian3,endUpScratch=new Cartesian3,rightScratch$1=new Cartesian3,startPlaneNormalScratch=new Cartesian3,endPlaneNormalScratch=new Cartesian3,encodeScratch=new EncodedCartesian3,encodeScratch2D=new EncodedCartesian3,forwardOffset2DScratch=new Cartesian3,right2DScratch=new Cartesian3,normalNudgeScratch=new Cartesian3,scratchBoundingSpheres=[new BoundingSphere,new BoundingSphere],REFERENCE_INDICES=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],REFERENCE_INDICES_LENGTH=REFERENCE_INDICES.length;function generateGeometryAttributes(e,t,i,r,n,a,o){var s,l,c,u,d=t._ellipsoid,h=i.length/3-1,p=8*h,m=4*p,f=36*h,g=new(65535MITER_BREAK_SMALL?(W=projectNormal(t,E,J,j,segmentStartNormal2DScratch),q=projectNormal(t,P,U,Y,segmentEndNormal2DScratch)):1===Se?(q=projectNormal(t,P,U,Y,segmentEndNormal2DScratch),W.x=0,W.y=CesiumMath.sign(E.longitude-Math.abs(P.longitude)),W.z=0):(W=projectNormal(t,E,J,j,segmentStartNormal2DScratch),q.x=0,q.y=CesiumMath.sign(E.longitude-P.longitude),q.z=0));var Z,K,ee,te=Cartesian3.distance(Q,z),ie=EncodedCartesian3.fromCartesian(X,encodeScratch),re=Cartesian3.subtract(k,X,offsetScratch$1),ne=Cartesian3.normalize(re,rightScratch$1),ae=Cartesian3.subtract(Q,X,startUpScratch),ae=Cartesian3.normalize(ae,ae),oe=Cartesian3.cross(ne,ae,rightScratch$1),oe=Cartesian3.normalize(oe,oe),se=Cartesian3.cross(ae,J,startPlaneNormalScratch),se=Cartesian3.normalize(se,se),le=Cartesian3.subtract(z,k,endUpScratch),le=Cartesian3.normalize(le,le),ce=Cartesian3.cross(U,le,endPlaneNormalScratch),ce=Cartesian3.normalize(ce,ce),ue=te/I,de=$/I,he=0,pe=0,me=0;for(o&&(he=Cartesian3.distance(j,Y),Z=EncodedCartesian3.fromCartesian(j,encodeScratch2D),K=Cartesian3.subtract(Y,j,forwardOffset2DScratch),Te=(ee=Cartesian3.normalize(K,right2DScratch)).x,ee.x=ee.y,ee.y=-Te,pe=he/b,me=G/b),D=0;D<8;D++){var fe=B+4*D,ge=F+2*D,_e=fe+3,ye=D<4?1:-1,Ce=2===D||3===D||6===D||7===D?1:-1;Cartesian3.pack(ie.high,y,fe),y[_e]=re.x,Cartesian3.pack(ie.low,C,fe),C[_e]=re.y,Cartesian3.pack(se,v,fe),v[_e]=re.z,Cartesian3.pack(ce,S,fe),S[_e]=ue*ye,Cartesian3.pack(oe,T,fe);var ve=de*Ce;0===ve&&Ce<0&&(ve=9),T[_e]=ve,o&&(s[fe]=Z.high.x,s[fe+1]=Z.high.y,s[fe+2]=Z.low.x,s[fe+3]=Z.low.y,c[fe]=-W.y,c[fe+1]=W.x,c[fe+2]=q.y,c[fe+3]=-q.x,l[fe]=K.x,l[fe+1]=K.y,l[fe+2]=ee.x,l[fe+3]=ee.y,u[ge]=pe*ye,0===(ve=me*Ce)&&Ce<0&&(ve=9),u[ge+1]=ve)}var Se=adjustHeightStartBottomScratch,ne=adjustHeightEndBottomScratch,ae=adjustHeightStartTopScratch,J=adjustHeightEndTopScratch,le=Rectangle.fromCartographicArray(getHeightCartographics,getHeightRectangleScratch),Te=ApproximateTerrainHeights.getMinimumMaximumHeights(le,d),le=Te.minimumTerrainHeight,Te=Te.maximumTerrainHeight;H+=le,H+=Te,adjustHeights(X,Q,le,Te,Se,ae),adjustHeights(k,z,le,Te,ne,J);Te=Cartesian3.multiplyByScalar(oe,CesiumMath.EPSILON5,normalNudgeScratch);Cartesian3.add(Se,Te,Se),Cartesian3.add(ne,Te,ne),Cartesian3.add(ae,Te,ae),Cartesian3.add(J,Te,J),nudgeXZ(Se,ne),nudgeXZ(ae,J),Cartesian3.pack(Se,_,N),Cartesian3.pack(ne,_,N+3),Cartesian3.pack(J,_,N+6),Cartesian3.pack(ae,_,N+9),Te=Cartesian3.multiplyByScalar(oe,-2*CesiumMath.EPSILON5,normalNudgeScratch),Cartesian3.add(Se,Te,Se),Cartesian3.add(ne,Te,ne),Cartesian3.add(ae,Te,ae),Cartesian3.add(J,Te,J),nudgeXZ(Se,ne),nudgeXZ(ae,J),Cartesian3.pack(Se,_,N+12),Cartesian3.pack(ne,_,N+15),Cartesian3.pack(J,_,N+18),Cartesian3.pack(ae,_,N+21),L+=2,R+=3,F+=16,N+=24,B+=32,$+=te,G+=he}var xe=R=0;for(O=0;O This application is using Cesium\'s default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.',!0)),defaultTokenCredit},Object.defineProperties(PeliasGeocoderService.prototype,{url:{get:function(){return this._url}}}),PeliasGeocoderService.prototype.geocode=function(e,t){return this._url.getDerivedResource({url:t===GeocodeType$1.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(e){return e.features.map(function(e){var t,i=e.bbox;return t=defined(i)?Rectangle.fromDegrees(i[0],i[1],i[2],i[3]):(i=e.geometry.coordinates[0],t=e.geometry.coordinates[1],Cartesian3.fromDegrees(i,t)),{displayName:e.properties.label,destination:t}})})},IonGeocoderService.prototype.geocode=function(e,t){return this._pelias.geocode(e,t)},defined(Object.create)&&(IonResource.prototype=Object.create(Resource.prototype),IonResource.prototype.constructor=IonResource),IonResource.fromAssetId=function(e,t){var i=IonResource._createEndpointResource(e,t);return i.fetchJson().then(function(e){return new IonResource(e,i)})},Object.defineProperties(IonResource.prototype,{credits:{get:function(){return defined(this._ionRoot)?this._ionRoot.credits:(defined(this._credits)||(this._credits=IonResource.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource)),this._credits)}}}),IonResource.getCreditsFromEndpoint=function(e,t){e=e.attributions.map(Credit.getIonCredit),t=Ion.getDefaultTokenCredit(t.queryParameters.access_token);return defined(t)&&e.push(Credit.clone(t)),e},IonResource.prototype.clone=function(e){var t=defaultValue(this._ionRoot,this);return defined(e)||(e=new IonResource(t._ionEndpoint,t._ionEndpointResource)),(e=Resource.prototype.clone.call(this,e))._ionRoot=t,e._isExternal=this._isExternal,e},IonResource.prototype.fetchImage=function(e){var t;return this._isExternal||(t=e,e={preferBlob:!0},defined(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)),Resource.prototype.fetchImage.call(this,e)},IonResource.prototype._makeRequest=function(e){return this._isExternal||new URI(this.url).authority!==this._ionEndpointDomain||(defined(e.headers)||(e.headers={}),e.headers.Authorization="Bearer "+this._ionEndpoint.accessToken),Resource.prototype._makeRequest.call(this,e)},IonResource._createEndpointResource=function(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=defaultValue(t.server,Ion.defaultServer),t=defaultValue(t.accessToken,Ion.defaultAccessToken),i=Resource.createIfNeeded(i),e={url:"v1/assets/"+e+"/endpoint"};return defined(t)&&(e.queryParameters={access_token:t}),i.getDerivedResource(e)},Object.defineProperties(TimeInterval.prototype,{isEmpty:{get:function(){var e=JulianDate.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var scratchInterval={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};TimeInterval.fromIso8601=function(e,t){var i=e.iso8601.split("/");if(2!==i.length)throw new DeveloperError("options.iso8601 is an invalid ISO 8601 interval.");var r=JulianDate.fromIso8601(i[0]),n=JulianDate.fromIso8601(i[1]),a=defaultValue(e.isStartIncluded,!0),i=defaultValue(e.isStopIncluded,!0),e=e.data;return defined(t)?(t.start=r,t.stop=n,t.isStartIncluded=a,t.isStopIncluded=i,t.data=e,t):(scratchInterval.start=r,scratchInterval.stop=n,scratchInterval.isStartIncluded=a,scratchInterval.isStopIncluded=i,scratchInterval.data=e,new TimeInterval(scratchInterval))},TimeInterval.toIso8601=function(e,t){return JulianDate.toIso8601(e.start,t)+"/"+JulianDate.toIso8601(e.stop,t)},TimeInterval.clone=function(e,t){if(defined(e))return defined(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new TimeInterval(e)},TimeInterval.equals=function(e,t,i){return e===t||defined(e)&&defined(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&JulianDate.equals(e.start,t.start)&&JulianDate.equals(e.stop,t.stop)&&(e.data===t.data||defined(i)&&i(e.data,t.data)))},TimeInterval.equalsEpsilon=function(e,t,i,r){return i=defaultValue(i,0),e===t||defined(e)&&defined(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&JulianDate.equalsEpsilon(e.start,t.start,i)&&JulianDate.equalsEpsilon(e.stop,t.stop,i)&&(e.data===t.data||defined(r)&&r(e.data,t.data)))},TimeInterval.intersect=function(e,t,i,r){if(!defined(t))return TimeInterval.clone(TimeInterval.EMPTY,i);var n=e.start,a=e.stop,o=t.start,s=t.stop,l=JulianDate.greaterThanOrEquals(o,n)&&JulianDate.greaterThanOrEquals(a,o),c=!l&&JulianDate.lessThanOrEquals(o,n)&&JulianDate.lessThanOrEquals(n,s);if(!l&&!c)return TimeInterval.clone(TimeInterval.EMPTY,i);var u=e.isStartIncluded,d=e.isStopIncluded,h=t.isStartIncluded,p=t.isStopIncluded,m=JulianDate.lessThan(a,s);return defined(i)||(i=new TimeInterval),i.start=l?o:n,i.isStartIncluded=u&&h||!JulianDate.equals(o,n)&&(l&&h||c&&u),i.stop=m?a:s,i.isStopIncluded=m?d:d&&p||!JulianDate.equals(s,a)&&p,i.data=defined(r)?r(e.data,t.data):e.data,i},TimeInterval.contains=function(e,t){if(e.isEmpty)return!1;var i=JulianDate.compare(e.start,t);if(0===i)return e.isStartIncluded;t=JulianDate.compare(t,e.stop);return 0===t?e.isStopIncluded:i<0&&t<0},TimeInterval.prototype.clone=function(e){return TimeInterval.clone(this,e)},TimeInterval.prototype.equals=function(e,t){return TimeInterval.equals(this,e,t)},TimeInterval.prototype.equalsEpsilon=function(e,t,i){return TimeInterval.equalsEpsilon(this,e,t,i)},TimeInterval.prototype.toString=function(){return TimeInterval.toIso8601(this)},TimeInterval.EMPTY=Object.freeze(new TimeInterval({start:new JulianDate,stop:new JulianDate,isStartIncluded:!1,isStopIncluded:!1}));var MINIMUM_VALUE=Object.freeze(JulianDate.fromIso8601("0000-01-01T00:00:00Z")),MAXIMUM_VALUE=Object.freeze(JulianDate.fromIso8601("9999-12-31T24:00:00Z")),MAXIMUM_INTERVAL=Object.freeze(new TimeInterval({start:MINIMUM_VALUE,stop:MAXIMUM_VALUE})),Iso8601={MINIMUM_VALUE:MINIMUM_VALUE,MAXIMUM_VALUE:MAXIMUM_VALUE,MAXIMUM_INTERVAL:MAXIMUM_INTERVAL},KeyboardEventModifier={SHIFT:0,CTRL:1,ALT:2},KeyboardEventModifier$1=Object.freeze(KeyboardEventModifier),LagrangePolynomialApproximation={type:"Lagrange",getRequiredDataPoints:function(e){return Math.max(e+1,2)},interpolateOrderZero:function(e,t,i,r,n){defined(n)||(n=new Array(r));for(var a=t.length,o=0;ot.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}}),ManagedArray.prototype.get=function(e){return this._array[e]},ManagedArray.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t},ManagedArray.prototype.peek=function(){return this._array[this._length-1]},ManagedArray.prototype.push=function(e){var t=this.length++;this._array[t]=e},ManagedArray.prototype.pop=function(){if(0!==this._length){var e=this._array[this._length-1];return--this.length,e}},ManagedArray.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)},ManagedArray.prototype.resize=function(e){this.length=e},ManagedArray.prototype.trim=function(e){e=defaultValue(e,this._length),this._array.length=e},Object.defineProperties(MapProjection.prototype,{ellipsoid:{get:DeveloperError.throwInstantiationError}}),MapProjection.prototype.project=DeveloperError.throwInstantiationError,MapProjection.prototype.unproject=DeveloperError.throwInstantiationError,NearFarScalar.clone=function(e,t){if(defined(e))return defined(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new NearFarScalar(e.near,e.nearValue,e.far,e.farValue)},NearFarScalar.packedLength=4,NearFarScalar.pack=function(e,t,i){return i=defaultValue(i,0),t[i++]=e.near,t[i++]=e.nearValue,t[i++]=e.far,t[i]=e.farValue,t},NearFarScalar.unpack=function(e,t,i){return t=defaultValue(t,0),defined(i)||(i=new NearFarScalar),i.near=e[t++],i.nearValue=e[t++],i.far=e[t++],i.farValue=e[t],i},NearFarScalar.equals=function(e,t){return e===t||defined(e)&&defined(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue},NearFarScalar.prototype.clone=function(e){return NearFarScalar.clone(this,e)},NearFarScalar.prototype.equals=function(e){return NearFarScalar.equals(this,e)};var Visibility={NONE:-1,PARTIAL:0,FULL:1},Visibility$1=Object.freeze(Visibility);function Occluder(e,t){this._occluderPosition=Cartesian3.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var scratchCartesian3$7=new Cartesian3;Object.defineProperties(Occluder.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=Cartesian3.clone(e,this._cameraPosition);var t,i,r,n=Cartesian3.subtract(this._occluderPosition,e,scratchCartesian3$7),a=Cartesian3.magnitudeSquared(n),o=this._occluderRadius*this._occluderRadius;oCartesian3.magnitudeSquared(t)}return!1};var occludeePositionScratch=new Cartesian3;Occluder.prototype.isBoundingSphereVisible=function(e){var t=Cartesian3.clone(e.center,occludeePositionScratch),i=e.radius;if(this._horizonDistance===Number.MAX_VALUE)return!1;var r=Cartesian3.subtract(t,this._occluderPosition,tempVecScratch),e=this._occluderRadius-i,e=Cartesian3.magnitudeSquared(r)-e*e;if(iCartesian3.magnitudeSquared(r));if(0t*r?!0:t<(e=Math.sqrt(e)+this._horizonDistance)*e+i}return!0};var tempScratch$1=new Cartesian3;Occluder.prototype.computeVisibility=function(e){var t=Cartesian3.clone(e.center),i=e.radius;if(i>this._occluderRadius)return Visibility$1.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var r=Cartesian3.subtract(t,this._occluderPosition,tempScratch$1),n=this._occluderRadius-i,a=Cartesian3.magnitudeSquared(r);if(0<(n=a-n*n)){n=Math.sqrt(n)+this._horizonDistance,r=Cartesian3.subtract(t,this._cameraPosition,r);e=Cartesian3.magnitudeSquared(r);return n*n+i*i-i?Visibility$1.PARTIAL:Visibility$1.FULL)}}return Visibility$1.NONE};var occludeePointScratch=new Cartesian3;Occluder.computeOccludeePoint=function(e,t,i){var r=Cartesian3.clone(t),n=Cartesian3.clone(e.center),t=e.radius,a=i.length,o=Cartesian3.normalize(Cartesian3.subtract(r,n,occludeePointScratch),occludeePointScratch),s=-Cartesian3.dot(o,n),l=Occluder._anyRotationVector(n,o,s),c=Occluder._horizonToPlaneNormalDotProduct(e,o,s,l,i[0]);if(c){for(var u,d=1;dr.y?0:1;(0===n&&r.z>r.x||1===n&&r.z>r.y)&&(n=2);var a=new Cartesian3,n=0===n?(r.x=e.x,r.y=e.y+1,r.z=e.z+1,Cartesian3.UNIT_X):1===n?(r.x=e.x+1,r.y=e.y,r.z=e.z+1,Cartesian3.UNIT_Y):(r.x=e.x+1,r.y=e.y+1,r.z=e.z,Cartesian3.UNIT_Z),t=(Cartesian3.dot(t,r)+i)/-Cartesian3.dot(t,n);return Cartesian3.normalize(Cartesian3.subtract(Cartesian3.add(r,Cartesian3.multiplyByScalar(n,t,a),r),e,r),r)};var posDirectionScratch=new Cartesian3;Occluder._rotationVector=function(e,t,i,r,n){e=Cartesian3.subtract(r,e,posDirectionScratch),e=Cartesian3.normalize(e,e);if(Cartesian3.dot(t,e)<.9999999847691291){e=Cartesian3.cross(t,e,e);if(Cartesian3.magnitude(e)>CesiumMath.EPSILON13)return Cartesian3.normalize(e,new Cartesian3)}return n};var posScratch1=new Cartesian3,occluerPosScratch=new Cartesian3,posScratch2=new Cartesian3,horizonPlanePosScratch=new Cartesian3;function OffsetGeometryInstanceAttribute(e,t,i){e=defaultValue(e,0),t=defaultValue(t,0),i=defaultValue(i,0),this.value=new Float32Array([e,t,i])}function OpenCageGeocoderService(e,t,i){(e=Resource.createIfNeeded(e)).appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=defaultValue(i,{})}Occluder._horizonToPlaneNormalDotProduct=function(e,t,i,r,n){var a=Cartesian3.clone(n,posScratch1),o=Cartesian3.clone(e.center,occluerPosScratch),s=e.radius,l=Cartesian3.subtract(o,a,posScratch2),n=Cartesian3.magnitudeSquared(l),e=s*s;if(n"+t,document.body.appendChild(u),n.leading=1.2*o;var d=getCSSValue(u,"height");if(2*o<=(d=d.replace("px",""))&&(n.leading=d/2|0),document.body.removeChild(u),c)n.ascent=0,n.descent=0,n.bounds={minx:0,maxx:n.width,miny:0,maxy:0},n.height=0;else{u=document.createElement("canvas");u.width=n.width+100,u.height=3*o,u.style.opacity=1,u.style.fontFamily=a,u.style.fontSize=o,u.style.fontStyle=s,u.style.fontWeight=l;c=u.getContext("2d");c.font=s+" "+l+" "+o+"px "+a;o=u.width,a=u.height,u=a/2;c.fillStyle="white",c.fillRect(-1,-1,o+2,a+2),i&&(c.strokeStyle="black",c.lineWidth=e.lineWidth,c.strokeText(t,50,u)),r&&(c.fillStyle="black",c.fillText(t,50,u));for(var h=c.getImageData(0,0,o,a).data,p=0,m=4*o,f=h.length;++pt.height?a=r*(t.height/t.width):t.widthidlCross.eastOverIDL-idlCross.westOverIDL&&(n.west=idlCross.westOverIDL,n.east=idlCross.eastOverIDL,n.east>CesiumMath.PI&&(n.east=n.east-CesiumMath.TWO_PI),n.west>CesiumMath.PI&&(n.west=n.west-CesiumMath.TWO_PI)),n}var interpolatedCartographicScratch$1=new Cartographic;function interpolateAndGrowRectangle(e,t,i,r){for(var n=e.surfaceDistance,a=Math.ceil(n*t),o=0=e.minX&&t.maxY>=e.minY}function createNode(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(e,t,i,r,n){for(var a,o=[t,i];o.length;)(i=o.pop())-(t=o.pop())<=r||(quickselect(e,a=t+Math.ceil((i-t)/r/2)*r,t,i,n),o.push(t,a,a,i))}function RectangleCollisionChecker(){this._tree=new RBush}function RectangleWithId(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}function idCompare(e,t){return e.id===t.id}PolylineVolumeOutlineGeometry.createGeometry=function(e){var t=arrayRemoveDuplicates(e._positions,Cartesian3.equalsEpsilon),i=e._shape,i=PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(i);if(!(t.length<2||i.length<3)){PolygonPipeline.computeWindingOrder2D(i)===WindingOrder$1.CLOCKWISE&&i.reverse();var r=BoundingRectangle.fromPoints(i,brScratch$1);return computeAttributes$2(PolylineVolumeGeometryLibrary.computePositions(t,i,r,e,!1),i)}},Proxy.prototype.getURL=DeveloperError.throwInstantiationError,Object.defineProperties(QuaternionSpline.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),QuaternionSpline.prototype.findTimeInterval=Spline.prototype.findTimeInterval,QuaternionSpline.prototype.wrapTime=Spline.prototype.wrapTime,QuaternionSpline.prototype.clampTime=Spline.prototype.clampTime,QuaternionSpline.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},RBush.prototype.all=function(){return this._all(this.data,[])},RBush.prototype.search=function(e){var t=this.data,i=[];if(!intersects$1(e,t))return i;for(var r=this.toBBox,n=[];t;){for(var a=0;athis._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},RBush.prototype._split=function(e,t){var i=e[t],r=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,r);r=this._chooseSplitIndex(i,n,r),r=createNode(i.children.splice(r,i.children.length-r));r.height=i.height,r.leaf=i.leaf,calcBBox(i,this.toBBox),calcBBox(r,this.toBBox),t?e[t-1].children.push(r):this._splitRoot(i,r)},RBush.prototype._splitRoot=function(e,t){this.data=createNode([e,t]),this.data.height=e.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)},RBush.prototype._chooseSplitIndex=function(e,t,i){for(var r,n=1/0,a=1/0,o=t;o<=i-t;o++){var s=distBBox(e,0,o,this.toBBox),l=distBBox(e,o,i,this.toBBox),c=intersectionArea(s,l),l=bboxArea(s)+bboxArea(l);cScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds}function checkPixelTolerance(e,t,i){var r=e.x-t.x,t=e.y-t.y;return Math.sqrt(r*r+t*t)keplerEqConvergence;++a)r=(n=r)-(n-t*Math.sin(n)-e)/(1-t*Math.cos(n));return n=r+i*CesiumMath.TWO_PI}function eccentricAnomalyToTrueAnomaly(e,t){var i=Math.floor(e/CesiumMath.TWO_PI);e-=i*CesiumMath.TWO_PI;var r=Math.cos(e)-t,t=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(t,r),r=CesiumMath.zeroToTwoPi(r);return e<0&&(r-=CesiumMath.TWO_PI),r+=i*CesiumMath.TWO_PI}function perifocalToCartesianMatrix(e,t,i,r){var n=Math.cos(e),a=Math.sin(e),o=Math.cos(t),e=Math.sin(t),t=Math.cos(i),i=Math.sin(i);return defined(r)?(r[0]=t*n-i*a*o,r[1]=i*n+t*a*o,r[2]=a*e,r[3]=-t*a-i*n*o,r[4]=-i*a+t*n*o,r[5]=n*e,r[6]=i*e,r[7]=-t*e,r[8]=o):r=new Matrix3(t*n-i*a*o,-t*a-i*n*o,i*e,i*n+t*a*o,-i*a+t*n*o,-t*e,a*e,n*e,o),r}var semiMajorAxis0=1.0000010178*MetersPerAstronomicalUnit,meanLongitude0=100.46645683*RadiansPerDegree,meanLongitude1=1295977422.83429*RadiansPerArcSecond,p1u=16002,p2u=21863,p3u=32004,p4u=10931,p5u=14529,p6u=16368,p7u=15318,p8u=32794,Ca1=64e-7*MetersPerAstronomicalUnit,Ca2=-152e-7*MetersPerAstronomicalUnit,Ca3=62e-7*MetersPerAstronomicalUnit,Ca4=-8e-7*MetersPerAstronomicalUnit,Ca5=32e-7*MetersPerAstronomicalUnit,Ca6=-41e-7*MetersPerAstronomicalUnit,Ca7=19e-7*MetersPerAstronomicalUnit,Ca8=-11e-7*MetersPerAstronomicalUnit,Sa1=1e-7*-150*MetersPerAstronomicalUnit,Sa2=-46e-7*MetersPerAstronomicalUnit,Sa3=68*1e-7*MetersPerAstronomicalUnit,Sa4=54e-7*MetersPerAstronomicalUnit,Sa5=14e-7*MetersPerAstronomicalUnit,Sa6=24e-7*MetersPerAstronomicalUnit,Sa7=-28e-7*MetersPerAstronomicalUnit,Sa8=22e-7*MetersPerAstronomicalUnit,q1u=10,q2u=16002,q3u=21863,q4u=10931,q5u=1473,q6u=32004,q7u=4387,q8u=73,Cl1=-325e-7,Cl2=-322e-7,Cl3=1e-7*-79,Cl4=232*1e-7,Cl5=1e-7*-52,Cl6=97e-7,Cl7=55e-7,Cl8=-41e-7,Sl1=-105e-7,Sl2=-137e-7,Sl3=258e-7,Sl4=35e-7,Sl5=1e-7*-116,Sl6=-88e-7,Sl7=-112e-7,Sl8=-8e-6,scratchDate=new JulianDate(0,0,TimeStandard$1.TAI);function computeSimonEarthMoonBarycenter(e,t){taiToTdb(e,scratchDate);var i=(scratchDate.dayNumber-epoch.dayNumber+(scratchDate.secondsOfDay-epoch.secondsOfDay)/TimeConstants$1.SECONDS_PER_DAY)/(10*TimeConstants$1.DAYS_PER_JULIAN_CENTURY),r=.3595362*i,e=semiMajorAxis0+Ca1*Math.cos(p1u*r)+Sa1*Math.sin(p1u*r)+Ca2*Math.cos(p2u*r)+Sa2*Math.sin(p2u*r)+Ca3*Math.cos(p3u*r)+Sa3*Math.sin(p3u*r)+Ca4*Math.cos(p4u*r)+Sa4*Math.sin(p4u*r)+Ca5*Math.cos(p5u*r)+Sa5*Math.sin(p5u*r)+Ca6*Math.cos(p6u*r)+Sa6*Math.sin(p6u*r)+Ca7*Math.cos(p7u*r)+Sa7*Math.sin(p7u*r)+Ca8*Math.cos(p8u*r)+Sa8*Math.sin(p8u*r),r=meanLongitude0+meanLongitude1*i+Cl1*Math.cos(q1u*r)+Sl1*Math.sin(q1u*r)+Cl2*Math.cos(q2u*r)+Sl2*Math.sin(q2u*r)+Cl3*Math.cos(q3u*r)+Sl3*Math.sin(q3u*r)+Cl4*Math.cos(q4u*r)+Sl4*Math.sin(q4u*r)+Cl5*Math.cos(q5u*r)+Sl5*Math.sin(q5u*r)+Cl6*Math.cos(q6u*r)+Sl6*Math.sin(q6u*r)+Cl7*Math.cos(q7u*r)+Sl7*Math.sin(q7u*r)+Cl8*Math.cos(q8u*r)+Sl8*Math.sin(q8u*r);return elementsToCartesian(e,.0167086342-.0004203654*i,469.97289*RadiansPerArcSecond*i,102.93734808*RadiansPerDegree+11612.3529*RadiansPerArcSecond*i,174.87317577*RadiansPerDegree-8679.27034*RadiansPerArcSecond*i,r,t)}function computeSimonMoon(e,t){taiToTdb(e,scratchDate);var i=(scratchDate.dayNumber-epoch.dayNumber+(scratchDate.secondsOfDay-epoch.secondsOfDay)/TimeConstants$1.SECONDS_PER_DAY)/TimeConstants$1.DAYS_PER_JULIAN_CENTURY,r=i*i,n=r*i,a=n*i,o=383397.7725+.004*i,s=.055545526-16e-9*i,l=5.15668983*RadiansPerDegree,c=-8e-5*i+.02966*r-42e-6*n-13e-8*a,u=83.35324312*RadiansPerDegree,d=14643420.2669*i-38.2702*r-.045047*n+21301e-8*a,h=125.04455501*RadiansPerDegree,p=-6967919.3631*i+6.3602*r+.007625*n-3586e-8*a,m=218.31664563*RadiansPerDegree,f=1732559343.4847*i-6.391*r+.006588*n-3169e-8*a,g=297.85019547*RadiansPerDegree+RadiansPerArcSecond*(1602961601.209*i-6.3706*r+.006593*n-3169e-8*a),_=134.96340251*RadiansPerDegree+RadiansPerArcSecond*(1717915923.2178*i+31.8792*r+.051635*n-2447e-7*a),y=357.52910918*RadiansPerDegree+RadiansPerArcSecond*(129596581.0481*i-.5532*r+136e-6*n-1149e-8*a),C=310.17137918*RadiansPerDegree-RadiansPerArcSecond*(6967051.436*i+6.2068*r+.007618*n-3219e-8*a),v=2*g,S=4*g,T=6*g,x=2*_,b=3*_,e=4*_,a=2*(93.27209062*RadiansPerDegree+RadiansPerArcSecond*(1739527262.8478*i-12.7512*r-.001037*n+417e-8*a));o+=3400.4*Math.cos(v)-635.6*Math.cos(v-_)-235.6*Math.cos(_)+218.1*Math.cos(v-y)+181*Math.cos(v+_),s+=.014216*Math.cos(v-_)+.008551*Math.cos(v-x)-.001383*Math.cos(_)+.001356*Math.cos(v+_)-.001147*Math.cos(S-b)-914e-6*Math.cos(S-x)+869e-6*Math.cos(v-y-_)-627e-6*Math.cos(v)-394e-6*Math.cos(S-e)+282e-6*Math.cos(v-y-x)-279e-6*Math.cos(g-_)-236e-6*Math.cos(x)+231e-6*Math.cos(S)+229e-6*Math.cos(T-e)-201e-6*Math.cos(x-a),c+=486.26*Math.cos(v-a)-40.13*Math.cos(v)+37.51*Math.cos(a)+25.73*Math.cos(x-a)+19.97*Math.cos(v-y-a),d+=-55609*Math.sin(v-_)-34711*Math.sin(v-x)-9792*Math.sin(_)+9385*Math.sin(S-b)+7505*Math.sin(S-x)+5318*Math.sin(v+_)+3484*Math.sin(S-e)-3417*Math.sin(v-y-_)-2530*Math.sin(T-e)-2376*Math.sin(v)-2075*Math.sin(v-b)-1883*Math.sin(x)-1736*Math.sin(T-5*_)+1626*Math.sin(y)-1370*Math.sin(T-b),p+=-5392*Math.sin(v-a)-540*Math.sin(y)-441*Math.sin(v)+423*Math.sin(a)-288*Math.sin(x-a),f+=-3332.9*Math.sin(v)+1197.4*Math.sin(v-_)-662.5*Math.sin(y)+396.3*Math.sin(_)-218*Math.sin(v-y);x=2*C,_=3*C;c+=46.997*Math.cos(C)*i-.614*Math.cos(v-a+C)*i+.614*Math.cos(v-a-C)*i-.0297*Math.cos(x)*r-.0335*Math.cos(C)*r+.0012*Math.cos(v-a+x)*r-16e-5*Math.cos(C)*n+4e-5*Math.cos(_)*n+4e-5*Math.cos(x)*n;y=2.116*Math.sin(C)*i-.111*Math.sin(v-a-C)*i-.0015*Math.sin(C)*r;return d+=y,f+=y,p+=-520.77*Math.sin(C)*i+13.66*Math.sin(v-a+C)*i+1.12*Math.sin(v-C)*i-1.06*Math.sin(a-C)*i+.66*Math.sin(x)*r+.371*Math.sin(C)*r-.035*Math.sin(v-a+x)*r-.015*Math.sin(v-a+C)*r+.0014*Math.sin(C)*n-.0011*Math.sin(_)*n-9e-4*Math.sin(x)*n,elementsToCartesian(o*=MetersPerKilometer,s,l+c*RadiansPerArcSecond,u+d*RadiansPerArcSecond,h+p*RadiansPerArcSecond,m+f*RadiansPerArcSecond,t)}var moonEarthMassRatio=.012300034,factor=moonEarthMassRatio/(moonEarthMassRatio+1)*-1;function computeSimonEarth(e,t){return t=computeSimonMoon(e,t),Cartesian3.multiplyByScalar(t,factor,t)}var axesTransformation=new Matrix3(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),translation$1=new Cartesian3;function interpolateColors$1(e,t,i,r,n,a,o){var s=PolylinePipeline.numberOfPoints(e,t,n),l=i.red,c=i.green,u=i.blue,d=i.alpha,h=r.red,e=r.green,t=r.blue,n=r.alpha;if(Color.equals(i,r)){for(y=0;ymonthLengths[s]||13<=s;)o>monthLengths[s]&&(o-=monthLengths[s],++s),13<=s&&(--s,l+=Math.floor(s/12),s%=12,++s),monthLengths[2]=isLeapYear(l)?29:28;return scratchGregorianDate.millisecond=r,scratchGregorianDate.second=n,scratchGregorianDate.minute=a,scratchGregorianDate.hour=e,scratchGregorianDate.day=o,scratchGregorianDate.month=s,scratchGregorianDate.year=l,JulianDate.fromGregorianDate(scratchGregorianDate,i)}var scratchJulianDate=new JulianDate,durationRegex=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function parseDuration(e,t){if(defined(e)&&0!==e.length){if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,"P"===e[t.millisecond=0]){var i=e.match(durationRegex);if(!defined(i))return;defined(i[1])&&(t.year=Number(i[1].replace(",","."))),defined(i[2])&&(t.month=Number(i[2].replace(",","."))),defined(i[3])&&(t.day=7*Number(i[3].replace(",","."))),defined(i[4])&&(t.day+=Number(i[4].replace(",","."))),defined(i[5])&&(t.hour=Number(i[5].replace(",","."))),defined(i[6])&&(t.minute=Number(i[6].replace(",","."))),defined(i[7])&&(i=Number(i[7].replace(",",".")),t.second=Math.floor(i),t.millisecond=i%1*1e3)}else"Z"!==e[e.length-1]&&(e+="Z"),JulianDate.toGregorianDate(JulianDate.fromIso8601(e,scratchJulianDate),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}}var scratchDuration=new GregorianDate;TimeIntervalCollection.fromIso8601=function(e,t){var i=e.iso8601.split("/"),r=JulianDate.fromIso8601(i[0]),n=JulianDate.fromIso8601(i[1]),a=[];if(parseDuration(i[2],scratchDuration)){var o=JulianDate.clone(r);for(a.push(o);JulianDate.compare(o,n)<0;){o=addToDate(o,scratchDuration);JulianDate.compare(n,o)<=0&&JulianDate.clone(n,o),a.push(o)}}else a.push(r,n);return TimeIntervalCollection.fromJulianDateArray({julianDates:a,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},TimeIntervalCollection.fromIso8601DateArray=function(e,t){return TimeIntervalCollection.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(e){return JulianDate.fromIso8601(e)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)},TimeIntervalCollection.fromIso8601DurationArray=function(e,t){for(var i,r,n=e.epoch,a=e.iso8601Durations,o=defaultValue(e.relativeToPrevious,!1),s=[],l=a.length,c=0;cr&&(this._seeking=!0,n.currentTime=e)))};var WallGeometryLibrary={};function latLonEquals(e,t){return CesiumMath.equalsEpsilon(e.latitude,t.latitude,CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(e.longitude,t.longitude,CesiumMath.EPSILON10)}var scratchCartographic1$2=new Cartographic,scratchCartographic2$1=new Cartographic;function removeDuplicates(e,t,i,r){var n=(t=arrayRemoveDuplicates(t,Cartesian3.equalsEpsilon)).length;if(!(n<2)){var a=defined(r),o=defined(i),s=new Array(n),l=new Array(n),c=new Array(n),u=t[0];s[0]=u;var d=e.cartesianToCartographic(u,scratchCartographic1$2);o&&(d.height=i[0]),l[0]=d.height,c[0]=a?r[0]:0;for(var h=l[0]===c[0],p=1,m=1;m>n,b=h>>n,E=PixelFormat$1.isCompressedFormat(c)?PixelFormat$1.compressedTextureSizeInBytes(c,x,b):PixelFormat$1.textureSizeInBytes(c,o,x,b),P=new Uint8Array(_.buffer,C,E);S[faceOrder[T]]=new CompressedTextureBuffer(c,x,b,P),C+=E}C+=3-(C+3)%4+4}var A=v;if(1===f)for(n=0;n=CesiumMath.SIXTY_FOUR_KILOBYTES&&o.elementIndexUint?Buffer$1.createIndexBuffer({context:o,typedArray:new Uint32Array(p),usage:l,indexDatatype:IndexDatatype$1.UNSIGNED_INT}):Buffer$1.createIndexBuffer({context:o,typedArray:new Uint16Array(p),usage:l,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT})),new VertexArray({context:o,attributes:d,indexBuffer:a})},Object.defineProperties(VertexArray.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),VertexArray.prototype.getAttribute=function(e){return this._attributes[e]},VertexArray.prototype._bind=function(){defined(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&setVertexAttribDivisor(this),this._hasConstantAttributes&&setConstantAttributes(this,this._gl)):bind(this._gl,this._attributes,this._indexBuffer)},VertexArray.prototype._unBind=function(){if(defined(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,i=0;iShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS}ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes=function(e,t,i,r){var n=latLongToSpherical(e.south,e.west,i,sphericalScratch),a=n.x,o=n.y,s=latLongToSpherical(e.north,e.east,i,sphericalScratch),n=s.x,i=s.y,s=0;i>>StencilConstants$1.SKIP_LOD_BIT_SHIFT}function getTranslucentRenderState(e){e=clone(e,!0);return e.cull.enabled=!1,e.depthTest.enabled=!0,e.depthMask=!1,e.blending=BlendingState$1.ALPHA_BLEND,RenderState.fromCache(e)}function getOpaqueRenderState(e){e=clone(e,!0);return e.stencilTest=StencilConstants$1.setCesium3DTileBit(),e.stencilMask=StencilConstants$1.CESIUM_3D_TILE_MASK,RenderState.fromCache(e)}function createTexture$1(e,t,i){e=e._textureDimensions;return new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{width:e.x,height:e.y,arrayBufferView:i},flipY:!1,sampler:Sampler.NEAREST})}function createPickTexture(e,t){var i=e.featuresLength;if(!defined(e._pickTexture)&&0r&&e.inverseBindMatrices--}),ForEach.animation(e,function(e){ForEach.animationSampler(e,function(e){defined(e.input)&&e.input>r&&e.input--,defined(e.output)&&e.output>r&&e.output--})})},Remove.buffer=function(e,t){e.buffers.splice(t,1),ForEach.bufferView(e,function(e){defined(e.buffer)&&e.buffer>t&&e.buffer--})},Remove.bufferView=function(e,i){e.bufferViews.splice(i,1),ForEach.accessor(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--}),ForEach.shader(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--}),ForEach.image(e,function(e){defined(e.bufferView)&&e.bufferView>i&&e.bufferView--,ForEach.compressedImage(e,function(e){var t=e.bufferView;defined(t)&&ii&&e.extensions.KHR_draco_mesh_compression.bufferView--})})},Remove.mesh=function(e,t){e.meshes.splice(t,1),ForEach.node(e,function(e){defined(e.mesh)&&(e.mesh>t?e.mesh--:e.mesh===t&&delete e.mesh)})},Remove.node=function(e,t){e.nodes.splice(t,1),ForEach.skin(e,function(e){defined(e.skeleton)&&e.skeleton>t&&e.skeleton--,e.joints=e.joints.map(function(e){return tt&&e.target.node--})}),ForEach.technique(e,function(e){ForEach.techniqueUniform(e,function(e){defined(e.node)&&e.node>t&&e.node--})}),ForEach.node(e,function(e){defined(e.children)&&(e.children=e.children.filter(function(e){return e!==t}).map(function(e){return tt&&e.material--})})},getListOfElementsIdsInUse.accessor=function(e){var t={};return ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){ForEach.meshPrimitiveAttribute(e,function(e){t[e]=!0}),ForEach.meshPrimitiveTarget(e,function(e){ForEach.meshPrimitiveTargetAttribute(e,function(e){t[e]=!0})});e=e.indices;defined(e)&&(t[e]=!0)})}),ForEach.skin(e,function(e){defined(e.inverseBindMatrices)&&(t[e.inverseBindMatrices]=!0)}),ForEach.animation(e,function(e){ForEach.animationSampler(e,function(e){defined(e.input)&&(t[e.input]=!0),defined(e.output)&&(t[e.output]=!0)})}),t},getListOfElementsIdsInUse.buffer=function(e){var t={};return ForEach.bufferView(e,function(e){defined(e.buffer)&&(t[e.buffer]=!0)}),t},getListOfElementsIdsInUse.bufferView=function(e){var t={};return ForEach.accessor(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)}),ForEach.shader(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)}),ForEach.image(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0),ForEach.compressedImage(e,function(e){defined(e.bufferView)&&(t[e.bufferView]=!0)})}),hasExtension(e,"KHR_draco_mesh_compression")&&ForEach.mesh(e,function(e){ForEach.meshPrimitive(e,function(e){defined(e.extensions)&&defined(e.extensions.KHR_draco_mesh_compression)&&(t[e.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),t},getListOfElementsIdsInUse.mesh=function(i){var r={};return ForEach.node(i,function(e){var t;!defined(e.mesh&&defined(i.meshes))||defined(t=i.meshes[e.mesh])&&defined(t.primitives)&&0r&&e.hasOwnProperty(i)&&(r=t);return r}function q3d(e){return k3d[e]||0}function r3d(e,t,i){return{type:"||"===e||"&&"===e?"LogicalExpression":"BinaryExpression",operator:e,left:t,right:i}}function s3d(e){return 48<=e&&e<=57}function t3d(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||128<=e&&!k3d[String.fromCharCode(e)]}function v3d(r){for(var e,l=0,t=r.charAt,i=r.charCodeAt,n=function(e){return t.call(r,e)},a=function(e){return i.call(r,e)},o=r.length,s=function(){for(var e=a(l);32===e||9===e;)e=a(++l)},c=function(){var e,t,i=d();return s(),63!==a(l)?i:(l++,(e=c())||h3d("Expected expression",l),s(),58===a(l)?(l++,(t=c())||h3d("Expected expression",l),{type:"ConditionalExpression",test:i,consequent:e,alternate:t}):void h3d("Expected :",l))},u=function(){s();for(var e=r.substr(l,n3d),t=e.length;0":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},m3d=l3d(j3d),n3d=l3d(k3d),o3d={true:!0,false:!1,null:null},v3d.version="0.3.1",v3d.toString=function(){return"JavaScript Expression Parser (JSEP) v"+v3d.version},v3d.addUnaryOp=function(e){return m3d=Math.max(e.length,m3d),j3d[e]=!0,this},v3d.addBinaryOp=function(e,t){return n3d=Math.max(e.length,n3d),k3d[e]=t,this},v3d.addLiteral=function(e,t){return o3d[e]=t,this},v3d.removeUnaryOp=function(e){return delete j3d[e],e.length===m3d&&(m3d=l3d(j3d)),this},v3d.removeAllUnaryOps=function(){return j3d={},m3d=0,this},v3d.removeBinaryOp=function(e){return delete k3d[e],e.length===n3d&&(n3d=l3d(k3d)),this},v3d.removeAllBinaryOps=function(){return k3d={},n3d=0,this},v3d.removeLiteral=function(e){return delete o3d[e],this},v3d.removeAllLiterals=function(){return o3d={},this},M2d.jsep=v3d;var jsep=tmp$2.jsep,ExpressionNodeType={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},ExpressionNodeType$1=Object.freeze(ExpressionNodeType);function Expression(e,t){var i;e=replaceVariables(removeBackslashes(e=replaceDefines(this._expression=e,t))),jsep.addBinaryOp("=~",0),jsep.addBinaryOp("!~",0);try{i=jsep(e)}catch(e){throw new RuntimeError(e)}this._runtimeAst=createRuntimeAst(this,i)}Object.defineProperties(Expression.prototype,{expression:{get:function(){return this._expression}}});var scratchStorage={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new Cartesian2],cartesian3Array:[new Cartesian3],cartesian4Array:[new Cartesian4],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);var e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new Cartesian2),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new Cartesian3),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new Cartesian4),this.cartesian4Array[this.cartesian4Index++]}};Expression.prototype.evaluate=function(e,t){scratchStorage.reset();e=this._runtimeAst.evaluate(e);return t instanceof Color&&e instanceof Cartesian4?Color.fromCartesian4(e,t):e instanceof Cartesian2||e instanceof Cartesian3||e instanceof Cartesian4?e.clone(t):e},Expression.prototype.evaluateColor=function(e,t){scratchStorage.reset();e=this._runtimeAst.evaluate(e);return Color.fromCartesian4(e,t)},Expression.prototype.getShaderFunction=function(e,t,i,r){return r+" "+e+"() \n{ \n return "+this.getShaderExpression(t,i)+"; \n} \n"},Expression.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};var unaryOperators=["!","-","+"],binaryOperators=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],variableRegex=/\${(.*?)}/g,backslashRegex=/\\/g,backslashReplacement="@#%",replacementRegex=/@#%/g,scratchColor$2=new Color,unaryFunctions={abs:getEvaluateUnaryComponentwise(Math.abs),sqrt:getEvaluateUnaryComponentwise(Math.sqrt),cos:getEvaluateUnaryComponentwise(Math.cos),sin:getEvaluateUnaryComponentwise(Math.sin),tan:getEvaluateUnaryComponentwise(Math.tan),acos:getEvaluateUnaryComponentwise(Math.acos),asin:getEvaluateUnaryComponentwise(Math.asin),atan:getEvaluateUnaryComponentwise(Math.atan),radians:getEvaluateUnaryComponentwise(CesiumMath.toRadians),degrees:getEvaluateUnaryComponentwise(CesiumMath.toDegrees),sign:getEvaluateUnaryComponentwise(CesiumMath.sign),floor:getEvaluateUnaryComponentwise(Math.floor),ceil:getEvaluateUnaryComponentwise(Math.ceil),round:getEvaluateUnaryComponentwise(Math.round),exp:getEvaluateUnaryComponentwise(Math.exp),exp2:getEvaluateUnaryComponentwise(exp2),log:getEvaluateUnaryComponentwise(Math.log),log2:getEvaluateUnaryComponentwise(log2),fract:getEvaluateUnaryComponentwise(fract),length:length,normalize:normalize},binaryFunctions={atan2:getEvaluateBinaryComponentwise(Math.atan2,!1),pow:getEvaluateBinaryComponentwise(Math.pow,!1),min:getEvaluateBinaryComponentwise(Math.min,!0),max:getEvaluateBinaryComponentwise(Math.max,!0),distance:distance,dot:dot,cross:cross},ternaryFunctions={clamp:getEvaluateTernaryComponentwise(CesiumMath.clamp,!0),mix:getEvaluateTernaryComponentwise(CesiumMath.lerp,!0)};function fract(e){return e-Math.floor(e)}function exp2(e){return Math.pow(2,e)}function log2(e){return CesiumMath.log2(e)}function getEvaluateUnaryComponentwise(i){return function(e,t){if("number"==typeof t)return i(t);if(t instanceof Cartesian2)return Cartesian2.fromElements(i(t.x),i(t.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.fromElements(i(t.x),i(t.y),i(t.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.fromElements(i(t.x),i(t.y),i(t.z),i(t.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}}function getEvaluateBinaryComponentwise(r,n){return function(e,t,i){if(n&&"number"==typeof i){if("number"==typeof t)return r(t,i);if(t instanceof Cartesian2)return Cartesian2.fromElements(r(t.x,i),r(t.y,i),scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.fromElements(r(t.x,i),r(t.y,i),r(t.z,i),scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.fromElements(r(t.x,i),r(t.y,i),r(t.z,i),r(t.w,i),scratchStorage.getCartesian4())}if("number"==typeof t&&"number"==typeof i)return r(t,i);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.fromElements(r(t.x,i.x),r(t.y,i.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.fromElements(r(t.x,i.x),r(t.y,i.y),r(t.z,i.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.fromElements(r(t.x,i.x),r(t.y,i.y),r(t.z,i.z),r(t.w,i.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}}function getEvaluateTernaryComponentwise(n,a){return function(e,t,i,r){if(a&&"number"==typeof r){if("number"==typeof t&&"number"==typeof i)return n(t,i,r);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),n(t.z,i.z,r),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.fromElements(n(t.x,i.x,r),n(t.y,i.y,r),n(t.z,i.z,r),n(t.w,i.w,r),scratchStorage.getCartesian4())}if("number"==typeof t&&"number"==typeof i&&"number"==typeof r)return n(t,i,r);if(t instanceof Cartesian2&&i instanceof Cartesian2&&r instanceof Cartesian2)return Cartesian2.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),scratchStorage.getCartesian2());if(t instanceof Cartesian3&&i instanceof Cartesian3&&r instanceof Cartesian3)return Cartesian3.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),n(t.z,i.z,r.z),scratchStorage.getCartesian3());if(t instanceof Cartesian4&&i instanceof Cartesian4&&r instanceof Cartesian4)return Cartesian4.fromElements(n(t.x,i.x,r.x),n(t.y,i.y,r.y),n(t.z,i.z,r.z),n(t.w,i.w,r.w),scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+", "+i+", and "+r+".")}}function length(e,t){if("number"==typeof t)return Math.abs(t);if(t instanceof Cartesian2)return Cartesian2.magnitude(t);if(t instanceof Cartesian3)return Cartesian3.magnitude(t);if(t instanceof Cartesian4)return Cartesian4.magnitude(t);throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}function normalize(e,t){if("number"==typeof t)return 1;if(t instanceof Cartesian2)return Cartesian2.normalize(t,scratchStorage.getCartesian2());if(t instanceof Cartesian3)return Cartesian3.normalize(t,scratchStorage.getCartesian3());if(t instanceof Cartesian4)return Cartesian4.normalize(t,scratchStorage.getCartesian4());throw new RuntimeError('Function "'+e+'" requires a vector or number argument. Argument is '+t+".")}function distance(e,t,i){if("number"==typeof t&&"number"==typeof i)return Math.abs(t-i);if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.distance(t,i);if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.distance(t,i);if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.distance(t,i);throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}function dot(e,t,i){if("number"==typeof t&&"number"==typeof i)return t*i;if(t instanceof Cartesian2&&i instanceof Cartesian2)return Cartesian2.dot(t,i);if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.dot(t,i);if(t instanceof Cartesian4&&i instanceof Cartesian4)return Cartesian4.dot(t,i);throw new RuntimeError('Function "'+e+'" requires vector or number arguments of matching types. Arguments are '+t+" and "+i+".")}function cross(e,t,i){if(t instanceof Cartesian3&&i instanceof Cartesian3)return Cartesian3.cross(t,i,scratchStorage.getCartesian3());throw new RuntimeError('Function "'+e+'" requires vec3 arguments. Arguments are '+t+" and "+i+".")}function Node$2(e,t,i,r,n){this._type=e,this._value=t,this._left=i,this._right=r,this._test=n,this.evaluate=void 0,setEvaluateFunction(this)}function replaceDefines(e,t){if(!defined(t))return e;for(var i in t){var r,n;t.hasOwnProperty(i)&&(r=new RegExp("\\$\\{"+i+"\\}","g"),defined(n="("+t[i]+")")&&(e=e.replace(r,n)))}return e}function removeBackslashes(e){return e.replace(backslashRegex,backslashReplacement)}function replaceBackslashes(e){return e.replace(replacementRegex,"\\")}function replaceVariables(e){for(var t=e,i="",r=t.indexOf("${");0<=r;){var n,a=t.indexOf("'"),o=t.indexOf('"');if(0<=a&&a=ExpressionNodeType$1.LITERAL_NULL}function isVariable(e){return"czm_"===e.substr(0,4)}function getPropertyName(e){return e.substr(4)}function createRuntimeAst(e,t){if("Literal"===t.type)o=parseLiteral(t);else if("CallExpression"===t.type)o=parseCall(e,t);else if("Identifier"===t.type)o=parseKeywordsAndVariables(t);else if("UnaryExpression"===t.type){r=t.operator;var i=createRuntimeAst(e,t.argument);if(!(-1"===e._value?e.evaluate=e._evaluateGreaterThan:">="===e._value?e.evaluate=e._evaluateGreaterThanOrEquals:"&&"===e._value?e.evaluate=e._evaluateAnd:"||"===e._value?e.evaluate=e._evaluateOr:"=~"===e._value?e.evaluate=e._evaluateRegExpMatch:"!~"===e._value?e.evaluate=e._evaluateRegExpNotMatch:defined(binaryFunctions[e._value])&&(e.evaluate=getEvaluateBinaryFunction(e._value)):e._type===ExpressionNodeType$1.TERNARY?e.evaluate=getEvaluateTernaryFunction(e._value):e._type===ExpressionNodeType$1.MEMBER?"brackets"===e._value?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===ExpressionNodeType$1.ARRAY?e.evaluate=e._evaluateArray:e._type===ExpressionNodeType$1.VARIABLE?e.evaluate=e._evaluateVariable:e._type===ExpressionNodeType$1.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===ExpressionNodeType$1.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===ExpressionNodeType$1.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===ExpressionNodeType$1.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===ExpressionNodeType$1.REGEX?e.evaluate=e._evaluateRegExp:e._type===ExpressionNodeType$1.BUILTIN_VARIABLE?"tiles3d_tileset_time"===e._value&&(e.evaluate=evaluateTilesetTime):e.evaluate=e._evaluateLiteral}function evaluateTilesetTime(e){return defined(e)?e.content.tileset.timeSinceLoad:0}function getEvaluateUnaryFunction(t){var i=unaryFunctions[t];return function(e){e=this._left.evaluate(e);return i(t,e)}}function getEvaluateBinaryFunction(i){var r=binaryFunctions[i];return function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);return r(i,t,e)}}function getEvaluateTernaryFunction(r){var n=ternaryFunctions[r];return function(e){var t=this._left.evaluate(e),i=this._right.evaluate(e),e=this._test.evaluate(e);return n(r,t,i,e)}}function getFeatureProperty(e,t){if(defined(e))return e.getProperty(t)}function checkFeature(e){return"feature"===e._value}function convertHSLToRGB(e){for(var t=e._left,i=t.length,r=0;r" requires number arguments. Arguments are '+t+" and "+e+".");return e=" requires number arguments. Arguments are '+t+" and "+e+".");return e<=t},Node$2.prototype._evaluateOr=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError('Operator "||" requires boolean arguments. First argument is '+t+".");if(t)return!0;e=this._right.evaluate(e);if("boolean"!=typeof e)throw new RuntimeError('Operator "||" requires boolean arguments. Second argument is '+e+".");return t||e},Node$2.prototype._evaluateAnd=function(e){var t=this._left.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError('Operator "&&" requires boolean arguments. First argument is '+t+".");if(!t)return!1;e=this._right.evaluate(e);if("boolean"!=typeof e)throw new RuntimeError('Operator "&&" requires boolean arguments. Second argument is '+e+".");return t&&e},Node$2.prototype._evaluatePlus=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.add(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.add(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.add(t,e,scratchStorage.getCartesian4());if("string"==typeof t||"string"==typeof e)return t+e;if("number"==typeof t&&"number"==typeof e)return t+e;throw new RuntimeError('Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are '+t+" and "+e+".")},Node$2.prototype._evaluateMinus=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.subtract(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.subtract(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.subtract(t,e,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t-e;throw new RuntimeError('Operator "-" requires vector or number arguments of matching types. Arguments are '+t+" and "+e+".")},Node$2.prototype._evaluateTimes=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.multiplyComponents(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian2&&"number"==typeof t)return Cartesian2.multiplyByScalar(e,t,scratchStorage.getCartesian2());if(t instanceof Cartesian2&&"number"==typeof e)return Cartesian2.multiplyByScalar(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.multiplyComponents(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian3&&"number"==typeof t)return Cartesian3.multiplyByScalar(e,t,scratchStorage.getCartesian3());if(t instanceof Cartesian3&&"number"==typeof e)return Cartesian3.multiplyByScalar(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.multiplyComponents(t,e,scratchStorage.getCartesian4());if(e instanceof Cartesian4&&"number"==typeof t)return Cartesian4.multiplyByScalar(e,t,scratchStorage.getCartesian4());if(t instanceof Cartesian4&&"number"==typeof e)return Cartesian4.multiplyByScalar(t,e,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t*e;throw new RuntimeError('Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are '+t+" and "+e+".")},Node$2.prototype._evaluateDivide=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.divideComponents(t,e,scratchStorage.getCartesian2());if(t instanceof Cartesian2&&"number"==typeof e)return Cartesian2.divideByScalar(t,e,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.divideComponents(t,e,scratchStorage.getCartesian3());if(t instanceof Cartesian3&&"number"==typeof e)return Cartesian3.divideByScalar(t,e,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.divideComponents(t,e,scratchStorage.getCartesian4());if(t instanceof Cartesian4&&"number"==typeof e)return Cartesian4.divideByScalar(t,e,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t/e;throw new RuntimeError('Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are '+t+" and "+e+".")},Node$2.prototype._evaluateMod=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(e instanceof Cartesian2&&t instanceof Cartesian2)return Cartesian2.fromElements(t.x%e.x,t.y%e.y,scratchStorage.getCartesian2());if(e instanceof Cartesian3&&t instanceof Cartesian3)return Cartesian3.fromElements(t.x%e.x,t.y%e.y,t.z%e.z,scratchStorage.getCartesian3());if(e instanceof Cartesian4&&t instanceof Cartesian4)return Cartesian4.fromElements(t.x%e.x,t.y%e.y,t.z%e.z,t.w%e.w,scratchStorage.getCartesian4());if("number"==typeof t&&"number"==typeof e)return t%e;throw new RuntimeError('Operator "%" requires vector or number arguments of matching types. Arguments are '+t+" and "+e+".")},Node$2.prototype._evaluateEqualsStrict=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);return e instanceof Cartesian2&&t instanceof Cartesian2||e instanceof Cartesian3&&t instanceof Cartesian3||e instanceof Cartesian4&&t instanceof Cartesian4?t.equals(e):t===e},Node$2.prototype._evaluateNotEqualsStrict=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);return e instanceof Cartesian2&&t instanceof Cartesian2||e instanceof Cartesian3&&t instanceof Cartesian3||e instanceof Cartesian4&&t instanceof Cartesian4?!t.equals(e):t!==e},Node$2.prototype._evaluateConditional=function(e){var t=this._test.evaluate(e);if("boolean"!=typeof t)throw new RuntimeError("Conditional argument of conditional expression must be a boolean. Argument is "+t+".");return(t?this._left:this._right).evaluate(e)},Node$2.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))},Node$2.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))},Node$2.prototype._evaluateIsExactClass=function(e){return!!defined(e)&&e.isExactClass(this._left.evaluate(e))},Node$2.prototype._evaluateIsClass=function(e){return!!defined(e)&&e.isClass(this._left.evaluate(e))},Node$2.prototype._evaluateGetExactClassName=function(e){if(defined(e))return e.getExactClassName()},Node$2.prototype._evaluateBooleanConversion=function(e){return Boolean(this._left.evaluate(e))},Node$2.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))},Node$2.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))},Node$2.prototype._evaluateRegExp=function(e){var t,i=this._value.evaluate(e),r="";defined(this._left)&&(r=this._left.evaluate(e));try{t=new RegExp(i,r)}catch(e){throw new RuntimeError(e)}return t},Node$2.prototype._evaluateRegExpTest=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof e))throw new RuntimeError("RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+e+".");return t.test(e)},Node$2.prototype._evaluateRegExpMatch=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof e)return t.test(e);if(e instanceof RegExp&&"string"==typeof t)return e.test(t);throw new RuntimeError('Operator "=~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+e+".")},Node$2.prototype._evaluateRegExpNotMatch=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(t instanceof RegExp&&"string"==typeof e)return!t.test(e);if(e instanceof RegExp&&"string"==typeof t)return!e.test(t);throw new RuntimeError('Operator "!~" requires one RegExp argument and one string argument. Arguments are '+t+" and "+e+".")},Node$2.prototype._evaluateRegExpExec=function(e){var t=this._left.evaluate(e),e=this._right.evaluate(e);if(!(t instanceof RegExp&&"string"==typeof e))throw new RuntimeError("RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are "+t+" and "+e+".");e=t.exec(e);return defined(e)?e[1]:null},Node$2.prototype._evaluateToString=function(e){e=this._left.evaluate(e);if(e instanceof RegExp||e instanceof Cartesian2||e instanceof Cartesian3||e instanceof Cartesian4)return String(e);throw new RuntimeError('Unexpected function call "'+this._value+'".')};var nullSentinel="czm_infinity";function Vector3DTilePrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=defaultValue(e.center,Cartesian3.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=Color.clone(Color.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=defaultValue(e.classificationType,ClassificationType$1.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};for(var t=this._batchIds.length,i=0;i 0.0 && clipDistance < clippingPlanesEdgeWidth) \n { \n gl_FragColor = clippingPlanesEdgeColor;\n } \n"}DracoLoader._maxDecodingConcurrency=Math.max(FeatureDetection.hardwareConcurrency-1,1),DracoLoader._decoderTaskProcessor=void 0,DracoLoader._taskProcessorReady=!1,DracoLoader._getDecoderTaskProcessor=function(){var e;return defined(DracoLoader._decoderTaskProcessor)||((e=new TaskProcessor("decodeDraco",DracoLoader._maxDecodingConcurrency)).initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_wasm_wrapper.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm",fallbackModulePath:"ThirdParty/Workers/draco_decoder.js"}).then(function(){DracoLoader._taskProcessorReady=!0}),DracoLoader._decoderTaskProcessor=e),DracoLoader._decoderTaskProcessor},DracoLoader.hasExtension=function(e){return defined(e.extensionsRequired.KHR_draco_mesh_compression)||defined(e.extensionsUsed.KHR_draco_mesh_compression)},DracoLoader._decodedModelResourceCache=void 0,DracoLoader.parse=function(e,t){if(DracoLoader.hasExtension(e)){var a=e._loadResources,i=e.cacheKey;if(defined(i)){defined(DracoLoader._decodedModelResourceCache)||(defined(t.cache.modelDecodingCache)||(t.cache.modelDecodingCache={}),DracoLoader._decodedModelResourceCache=t.cache.modelDecodingCache);i=DracoLoader._decodedModelResourceCache[i];if(defined(i))return i.count++,void(a.pendingDecodingCache=!0)}var o=e._dequantizeInShader,s=e.gltf;ForEach.mesh(s,function(e,n){ForEach.meshPrimitive(e,function(e,t){var i,r;!defined(e.extensions)||defined(i=e.extensions.KHR_draco_mesh_compression)&&(r=s.bufferViews[i.bufferView],e=arraySlice(s.buffers[r.buffer].extras._pipeline.source,r.byteOffset,r.byteOffset+r.byteLength),a.primitivesToDecode.enqueue({mesh:n,primitive:t,array:e,bufferView:r,compressedAttributes:i.attributes,dequantizeInShader:o}))})})}},DracoLoader.decodeModel=function(e,t){if(!DracoLoader.hasExtension(e))return when.resolve();var i=e._loadResources,r=e.cacheKey;if(defined(r)&&defined(DracoLoader._decodedModelResourceCache)){var n=DracoLoader._decodedModelResourceCache[r];if(defined(n)&&i.pendingDecodingCache)return when(n.ready,function(){e._decodedData=n.data,i.pendingDecodingCache=!1});DracoLoader._decodedModelResourceCache[r]={ready:!1,count:1,data:void 0}}if(0===i.primitivesToDecode.length)return when.resolve();for(var a=DracoLoader._getDecoderTaskProcessor(),o=[],s=scheduleDecodingTask(a,e,i);defined(s);)o.push(s),s=scheduleDecodingTask(a,e,i);return when.all(o)},DracoLoader.decodePointCloud=function(e){var t=DracoLoader._getDecoderTaskProcessor();if(DracoLoader._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])},DracoLoader.cacheDataForModel=function(e){var t=e.cacheKey;defined(t)&&defined(DracoLoader._decodedModelResourceCache)&&(defined(t=DracoLoader._decodedModelResourceCache[t])&&(t.ready=!0,t.data=e._decodedData))},DracoLoader.destroyCachedDataForModel=function(e){var t=e.cacheKey;defined(t)&&defined(DracoLoader._decodedModelResourceCache)&&(defined(e=DracoLoader._decodedModelResourceCache[t])&&0==--e.count&&delete DracoLoader._decodedModelResourceCache[t])};var textureResolutionScratch$1=new Cartesian2;function getClippingFunction(e,t){var i=e.unionClippingRegions,r=e.length,n=ClippingPlaneCollection.useFloatTexture(t),e=ClippingPlaneCollection.getTextureResolution(e,t,textureResolutionScratch$1),t=e.x,e=e.y,e=(n?getClippingPlaneFloat:getClippingPlaneUint8)(t,e);return e+="\n",e+=(i?clippingFunctionUnion:clippingFunctionIntersect)(r)}function clippingFunctionUnion(e){return"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float clipAmount;\n float pixelWidth = czm_metersPerPixel(position);\n bool breakAndDiscard = false;\n for (int i = 0; i < "+e+"; ++i)\n {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\n if (amount <= 0.0)\n {\n breakAndDiscard = true;\n break;\n }\n }\n if (breakAndDiscard) {\n discard;\n }\n return clipAmount;\n}\n"}function clippingFunctionIntersect(e){return"float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n{\n bool clipped = true;\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float clipAmount = 0.0;\n float pixelWidth = czm_metersPerPixel(position);\n for (int i = 0; i < "+e+"; ++i)\n {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n clipAmount = max(amount, clipAmount);\n clipped = clipped && (amount <= 0.0);\n }\n if (clipped)\n {\n discard;\n }\n return clipAmount;\n}\n"}function getClippingPlaneFloat(e,t){var i=1/t,t=1/e+"";-1===t.indexOf(".")&&(t+=".0");i+="";return-1===i.indexOf(".")&&(i+=".0"),"vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n int pixY = clippingPlaneNumber / "+e+";\n int pixX = clippingPlaneNumber - (pixY * "+e+");\n float u = (float(pixX) + 0.5) * "+t+";\n float v = (float(pixY) + 0.5) * "+i+";\n vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n return czm_transformPlane(plane, transform);\n}\n"}function getClippingPlaneUint8(e,t){var i=1/t,t=1/e+"";-1===t.indexOf(".")&&(t+=".0");i+="";return-1===i.indexOf(".")&&(i+=".0"),"vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n{\n int clippingPlaneStartIndex = clippingPlaneNumber * 2;\n int pixY = clippingPlaneStartIndex / "+e+";\n int pixX = clippingPlaneStartIndex - (pixY * "+e+");\n float u = (float(pixX) + 0.5) * "+t+";\n float v = (float(pixY) + 0.5) * "+i+";\n vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\n vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n vec4 plane;\n plane.xyz = czm_octDecode(oct, 65535.0);\n plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + "+t+", v)));\n return czm_transformPlane(plane, transform);\n}\n"}var JobType={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},JobType$1=Object.freeze(JobType);function ModelAnimationCache(){}var dataUriRegex$2=/^data\:/i;function getAccessorKey(e,t){var i=e.gltf,r=i.buffers,i=i.bufferViews[t.bufferView],r=r[i.buffer],i=i.byteOffset+t.byteOffset,t=t.count*numberOfComponentsForType(t.type),r=dataUriRegex$2.test(r.uri)?"":r.uri;return e.cacheKey+"//"+r+"/"+i+"/"+t}var cachedAnimationParameters={};ModelAnimationCache.getAnimationParameterValues=function(e,t){var i=getAccessorKey(e,t);if(!defined(h=cachedAnimationParameters[i])){for(var r=e.gltf,n=r.buffers,a=r.bufferViews[t.bufferView],o=n[a.buffer].extras._pipeline.source,s=t.componentType,l=t.type,c=numberOfComponentsForType(l),u=t.count,d=getAccessorByteStride(r,t),h=new Array(u),t=defaultValue(t.byteOffset,0),p=a.byteOffset+t,m=0;m=r[i+1]?r[i+1]:r[i];return this._spline.evaluate(i,t)},Object.defineProperties(SteppedSpline.prototype,{times:{get:function(){return this._spline.times}}}),SteppedSpline.prototype.wrapTime=function(e){return this._spline.wrapTime(e)},SteppedSpline.prototype.clampTime=function(e){return this._spline.clampTime(e)},ModelAnimationCache.getAnimationSpline=function(e,t,i,r,n,a,o,s){t=getAnimationSplineKey(e,t,r),r=cachedAnimationSplines[t];return defined(r)||(s=s,1===(a=a).length&&1===s.length?r=new ConstantSpline(s[0]):"LINEAR"!==n.interpolation&&"STEP"!==n.interpolation||("translation"===o||"scale"===o?r=new LinearSpline({times:a,points:s}):"rotation"===o?r=new QuaternionSpline({times:a,points:s}):"weights"===o&&(r=new WeightSpline({times:a,weights:s})),defined(r)&&"STEP"===n.interpolation&&(r=new SteppedSpline(r))),defined(e.cacheKey)&&(cachedAnimationSplines[t]=r)),r};var cachedSkinInverseBindMatrices={};ModelAnimationCache.getSkinInverseBindMatrices=function(e,t){var i=getAccessorKey(e,t);if(!defined(d=cachedSkinInverseBindMatrices[i])){var r=e.gltf,n=r.buffers,e=r.bufferViews[t.bufferView],a=n[e.buffer].extras._pipeline.source,o=t.componentType,n=t.type,s=t.count,l=getAccessorByteStride(r,t),c=e.byteOffset+t.byteOffset,u=numberOfComponentsForType(n),d=new Array(s);if(o===WebGLConstants$1.FLOAT&&n===AttributeType$1.MAT4)for(var h=0;h>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}function matchAndStoreCoordinates(e,t,i,r,n,a,o){var s=o?1:0,l=n?1:0,c=computeOrderMask(e,t,s,l,0);if(0===c)return t;var u=n?1:0,d=a?1:0,h=computeOrderMask(e,i,0,u,d);if(0===h)return i;var p=o?1:0,n=a?1:0,o=computeOrderMask(e,r,p,0,n);if(0===o)return r;var m,f,g,a=c&h&o;if(1&a)m=0,f=1,g=2;else if(2&a)m=0,g=1,f=2;else if(4&a)f=0,m=1,g=2;else if(8&a)f=0,g=1,m=2;else if(16&a)g=0,m=1,f=2;else{if(!(32&a)){c=popcount0to63(c),h=popcount0to63(h),o=popcount0to63(o);return c>=1,o.push(createTexture$2(n));r=new Texture({context:t,source:{arrayBufferView:a,mipLevels:o},width:r,height:1,pixelFormat:PixelFormat$1.LUMINANCE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})});return i.outlineTexture=r},ComputeCommand.prototype.execute=function(e){e.execute(this)};var OctahedralProjectionAtlasFS="varying vec2 v_textureCoordinates;\nuniform float originalSize;\nuniform sampler2D texture0;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\nconst float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));\nconst float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));\nconst float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));\nconst float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));\nvoid main()\n{\nvec2 uv = v_textureCoordinates;\nvec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);\nvec2 pixel = 1.0 / textureSize;\nfloat mipLevel = 0.0;\nif (uv.x - pixel.x > (textureSize.y / textureSize.x))\n{\nmipLevel = 1.0;\nif (uv.y - pixel.y > yMipLevel1)\n{\nmipLevel = 2.0;\nif (uv.y - pixel.y * 3.0 > yMipLevel2)\n{\nmipLevel = 3.0;\nif (uv.y - pixel.y * 5.0 > yMipLevel3)\n{\nmipLevel = 4.0;\nif (uv.y - pixel.y * 7.0 > yMipLevel4)\n{\nmipLevel = 5.0;\n}\n}\n}\n}\n}\nif (mipLevel > 0.0)\n{\nfloat scale = pow(2.0, mipLevel);\nuv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);\nuv.x *= ((textureSize.x - 2.0) / textureSize.y);\nuv.x -= 1.0 + pixel.x;\nuv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));\nuv *= scale;\n}\nelse\n{\nuv.x *= (textureSize.x / textureSize.y);\n}\nif(mipLevel == 0.0)\n{\ngl_FragColor = texture2D(texture0, uv);\n}\nelse if(mipLevel == 1.0)\n{\ngl_FragColor = texture2D(texture1, uv);\n}\nelse if(mipLevel == 2.0)\n{\ngl_FragColor = texture2D(texture2, uv);\n}\nelse if(mipLevel == 3.0)\n{\ngl_FragColor = texture2D(texture3, uv);\n}\nelse if(mipLevel == 4.0)\n{\ngl_FragColor = texture2D(texture4, uv);\n}\nelse if(mipLevel == 5.0)\n{\ngl_FragColor = texture2D(texture5, uv);\n}\nelse\n{\ngl_FragColor = vec4(0.0);\n}\n}\n",OctahedralProjectionFS="varying vec3 v_cubeMapCoordinates;\nuniform samplerCube cubeMap;\nvoid main()\n{\nvec4 rgbm = textureCube(cubeMap, v_cubeMapCoordinates);\nfloat m = rgbm.a * 16.0;\nvec3 r = rgbm.rgb * m;\ngl_FragColor = vec4(r * r, 1.0);\n}\n",OctahedralProjectionVS="attribute vec4 position;\nattribute vec3 cubeMapCoordinates;\nvarying vec3 v_cubeMapCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_cubeMapCoordinates = cubeMapCoordinates;\n}\n";function OctahedralProjectedCubeMap(e){this._url=e,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._readyPromise=when.defer()}Object.defineProperties(OctahedralProjectedCubeMap.prototype,{url:{get:function(){return this._url}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),OctahedralProjectedCubeMap.isSupported=function(e){return e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat};for(var v1$1=new Cartesian3(1,0,0),v2$1=new Cartesian3(0,0,1),v3=new Cartesian3(-1,0,0),v4=new Cartesian3(0,0,-1),v5=new Cartesian3(0,1,0),v6=new Cartesian3(0,-1,0),cubeMapCoordinates=[v5,v3,v2$1,v6,v1$1,v5,v4,v5,v5],length$1=cubeMapCoordinates.length,flatCubeMapCoordinates=new Float32Array(3*length$1),offset=0,i$2=0;i$2D||T.center.y-T.radiusD||T.center.y-T.radius=o.clientWidth?m=!0:(positionCC=(h.x>.5*o.clientWidth?(s.width=h.x,p.frustum.right=l.x-t,positionCC=worldToClip(a,i,p,positionCC),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord0),s.x+=h.x,p.position.x=-p.position.x,e=p.frustum.right,p.frustum.right=-p.frustum.left,p.frustum.left=-e):(s.x+=h.x,s.width-=h.x,p.frustum.left=-l.x-t,positionCC=worldToClip(a,i,p,positionCC),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord0),s.x=s.x-s.width,p.position.x=-p.position.x,t=p.frustum.left,p.frustum.left=-p.frustum.right,p.frustum.right=-t),worldToClip(a,i,p,positionCC)),SceneTransforms.clipToGLWindowCoordinates(s,positionCC,scratchWindowCoord1),Cartesian3.clone(c,p.position),p.frustum=u.clone(),((r=Cartesian2.clone(scratchWindowCoord0,r)).x<0||r.x>o.clientWidth)&&(r.x=scratchWindowCoord1.x))),n.mode!==SceneMode$1.SCENE2D||m){if((positionCC=worldToClip(a,i,p,positionCC)).z<0&&!(p.frustum instanceof OrthographicFrustum)&&!(p.frustum instanceof OrthographicOffCenterFrustum))return;r=SceneTransforms.clipToGLWindowCoordinates(s,positionCC,r)}return r.y=o.clientHeight-r.y,r}},SceneTransforms.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(defined(i=SceneTransforms.wgs84ToWindowCoordinates(e,t,i)))return SceneTransforms.transformWindowToDrawingBuffer(e,i,i)};var projectedPosition=new Cartesian3,positionInCartographic=new Cartographic;SceneTransforms.computeActualWgs84Position=function(e,t,i){var r=e.mode;if(r===SceneMode$1.SCENE3D)return Cartesian3.clone(t,i);var n=e.mapProjection,a=n.ellipsoid.cartesianToCartographic(t,positionInCartographic);if(defined(a)){if(n.project(a,projectedPosition),r===SceneMode$1.COLUMBUS_VIEW)return Cartesian3.fromElements(projectedPosition.z,projectedPosition.x,projectedPosition.y,i);if(r===SceneMode$1.SCENE2D)return Cartesian3.fromElements(0,projectedPosition.x,projectedPosition.y,i);e=e.morphTime;return Cartesian3.fromElements(CesiumMath.lerp(projectedPosition.z,t.x,e),CesiumMath.lerp(projectedPosition.x,t.y,e),CesiumMath.lerp(projectedPosition.y,t.z,e),i)}};var positionNDC=new Cartesian3,positionWC=new Cartesian3,viewportTransform=new Matrix4;SceneTransforms.clipToGLWindowCoordinates=function(e,t,i){return Cartesian3.divideByScalar(t,t.w,positionNDC),Matrix4.computeViewportTransformation(e,0,1,viewportTransform),Matrix4.multiplyByPoint(viewportTransform,positionNDC,positionWC),Cartesian2.fromCartesian3(positionWC,i)},SceneTransforms.transformWindowToDrawingBuffer=function(e,t,i){var r=e.canvas,n=e.drawingBufferWidth/r.clientWidth,r=e.drawingBufferHeight/r.clientHeight;return Cartesian2.fromElements(t.x*n,t.y*r,i)};var scratchNDC=new Cartesian4,scratchWorldCoords=new Cartesian4;function Billboard(e,t){var i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).translucencyByDistance,r=e.pixelOffsetScaleByDistance,n=e.scaleByDistance,a=e.distanceDisplayCondition;defined(i)&&(i=NearFarScalar.clone(i)),defined(r)&&(r=NearFarScalar.clone(r)),defined(n)&&(n=NearFarScalar.clone(n)),defined(a)&&(a=DistanceDisplayCondition.clone(a)),this._show=defaultValue(e.show,!0),this._position=Cartesian3.clone(defaultValue(e.position,Cartesian3.ZERO)),this._actualPosition=Cartesian3.clone(this._position),this._pixelOffset=Cartesian2.clone(defaultValue(e.pixelOffset,Cartesian2.ZERO)),this._translate=new Cartesian2(0,0),this._eyeOffset=Cartesian3.clone(defaultValue(e.eyeOffset,Cartesian3.ZERO)),this._heightReference=defaultValue(e.heightReference,HeightReference$1.NONE),this._verticalOrigin=defaultValue(e.verticalOrigin,VerticalOrigin$1.CENTER),this._horizontalOrigin=defaultValue(e.horizontalOrigin,HorizontalOrigin$1.CENTER),this._scale=defaultValue(e.scale,1),this._color=Color.clone(defaultValue(e.color,Color.WHITE)),this._rotation=defaultValue(e.rotation,0),this._alignedAxis=Cartesian3.clone(defaultValue(e.alignedAxis,Cartesian3.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=n,this._translucencyByDistance=i,this._pixelOffsetScaleByDistance=r,this._sizeInMeters=defaultValue(e.sizeInMeters,!1),this._distanceDisplayCondition=a,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=defaultValue(e.collection,t),this._pickId=void 0,this._pickPrimitive=defaultValue(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;a=e.image,t=e.imageId;defined(a)&&(defined(t)||(t="string"==typeof a?a:defined(a.src)?a.src:createGuid()),this._imageId=t,this._image=a),defined(e.imageSubRegion)&&(this._imageId=t,this._imageSubRegion=e.imageSubRegion),defined(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=SceneMode$1.SCENE3D,this._clusterShow=!0,this._outlineColor=Color.clone(defaultValue(e.outlineColor,Color.BLACK)),this._outlineWidth=defaultValue(e.outlineWidth,0),this._updateClamping()}SceneTransforms.drawingBufferToWgs84Coordinates=function(e,t,i,r){var n=e.context.uniformState,a=n.currentFrustum,o=a.x,s=a.y;e.frameState.useLogDepth&&(c=i*n.log2FarDepthFromNearPlusOne,i=s*(1-o/(Math.pow(2,c)-1+o))/(s-o));var l,a=e.view.passState.viewport,c=Cartesian4.clone(Cartesian4.UNIT_W,scratchNDC);c.x=(t.x-a.x)/a.width*2-1,c.y=(t.y-a.y)/a.height*2-1,c.z=2*i-1,c.w=1;i=e.camera.frustum;return defined(i.fovy)?(e=1/(l=Matrix4.multiplyByVector(n.inverseViewProjection,c,scratchWorldCoords)).w,Cartesian3.multiplyByScalar(l,e,l)):(defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),(l=scratchWorldCoords).x=.5*(c.x*(i.right-i.left)+i.left+i.right),l.y=.5*(c.y*(i.top-i.bottom)+i.bottom+i.top),l.z=.5*(c.z*(o-s)-o-s),l.w=1,l=Matrix4.multiplyByVector(n.inverseView,l,l)),Cartesian3.fromCartesian4(l,r)};var SHOW_INDEX=Billboard.SHOW_INDEX=0,POSITION_INDEX=Billboard.POSITION_INDEX=1,PIXEL_OFFSET_INDEX=Billboard.PIXEL_OFFSET_INDEX=2,EYE_OFFSET_INDEX=Billboard.EYE_OFFSET_INDEX=3,HORIZONTAL_ORIGIN_INDEX=Billboard.HORIZONTAL_ORIGIN_INDEX=4,VERTICAL_ORIGIN_INDEX=Billboard.VERTICAL_ORIGIN_INDEX=5,SCALE_INDEX=Billboard.SCALE_INDEX=6,IMAGE_INDEX_INDEX=Billboard.IMAGE_INDEX_INDEX=7,COLOR_INDEX=Billboard.COLOR_INDEX=8,ROTATION_INDEX=Billboard.ROTATION_INDEX=9,ALIGNED_AXIS_INDEX=Billboard.ALIGNED_AXIS_INDEX=10,SCALE_BY_DISTANCE_INDEX=Billboard.SCALE_BY_DISTANCE_INDEX=11,TRANSLUCENCY_BY_DISTANCE_INDEX=Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX=12,PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,DISTANCE_DISPLAY_CONDITION=Billboard.DISTANCE_DISPLAY_CONDITION=14,DISABLE_DEPTH_DISTANCE=Billboard.DISABLE_DEPTH_DISTANCE=15;Billboard.TEXTURE_COORDINATE_BOUNDS=16;var SDF_INDEX=Billboard.SDF_INDEX=17;function makeDirty(e,t){var i=e._billboardCollection;defined(i)&&(i._updateBillboard(e,t),e._dirty=!0)}Billboard.NUMBER_OF_PROPERTIES=18,Object.defineProperties(Billboard.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,makeDirty(this,SHOW_INDEX))}},position:{get:function(){return this._position},set:function(e){var t=this._position;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),Cartesian3.clone(e,this._actualPosition),this._updateClamping(),makeDirty(this,POSITION_INDEX))}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightReference=e,this._updateClamping(),makeDirty(this,POSITION_INDEX))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var t=this._pixelOffset;Cartesian2.equals(t,e)||(Cartesian2.clone(e,t),makeDirty(this,PIXEL_OFFSET_INDEX))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;NearFarScalar.equals(t,e)||(this._scaleByDistance=NearFarScalar.clone(e,t),makeDirty(this,SCALE_BY_DISTANCE_INDEX))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;NearFarScalar.equals(t,e)||(this._translucencyByDistance=NearFarScalar.clone(e,t),makeDirty(this,TRANSLUCENCY_BY_DISTANCE_INDEX))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;NearFarScalar.equals(t,e)||(this._pixelOffsetScaleByDistance=NearFarScalar.clone(e,t),makeDirty(this,PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),makeDirty(this,EYE_OFFSET_INDEX))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,makeDirty(this,HORIZONTAL_ORIGIN_INDEX))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,makeDirty(this,VERTICAL_ORIGIN_INDEX))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,makeDirty(this,SCALE_INDEX))}},color:{get:function(){return this._color},set:function(e){var t=this._color;Color.equals(t,e)||(Color.clone(e,t),makeDirty(this,COLOR_INDEX))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,makeDirty(this,ROTATION_INDEX))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;Cartesian3.equals(t,e)||(Cartesian3.clone(e,t),makeDirty(this,ALIGNED_AXIS_INDEX))}},width:{get:function(){return defaultValue(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,makeDirty(this,IMAGE_INDEX_INDEX))}},height:{get:function(){return defaultValue(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,makeDirty(this,IMAGE_INDEX_INDEX))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,makeDirty(this,COLOR_INDEX))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){DistanceDisplayCondition.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=DistanceDisplayCondition.clone(e,this._distanceDisplayCondition),makeDirty(this,DISTANCE_DISPLAY_CONDITION))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,makeDirty(this,DISABLE_DEPTH_DISTANCE))}},id:{get:function(){return this._id},set:function(e){this._id=e,defined(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,defined(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){defined(e)?"string"==typeof e?this.setImage(e,e):e instanceof Resource?this.setImage(e.url,e):defined(e.src)?this.setImage(e.src,e):this.setImage(createGuid(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,makeDirty(this,IMAGE_INDEX_INDEX))}},ready:{get:function(){return-1!==this._imageIndex}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=Cartesian3.clone(e,this._actualClampedPosition),makeDirty(this,POSITION_INDEX)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,makeDirty(this,SHOW_INDEX))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;Color.equals(t,e)||(Color.clone(e,t),makeDirty(this,SDF_INDEX))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,makeDirty(this,SDF_INDEX))}}}),Billboard.prototype.getPickId=function(e){return defined(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},Billboard.prototype._updateClamping=function(){Billboard._updateClamping(this._billboardCollection,this)};var scratchCartographic$4=new Cartographic,scratchPosition$7=new Cartesian3;Billboard._updateClamping=function(e,i){var r,t,n,a,o=e._scene;function s(e){var t;i._heightReference===HeightReference$1.RELATIVE_TO_GROUND&&(i._mode===SceneMode$1.SCENE3D?((t=r.cartesianToCartographic(e,scratchCartographic$4)).height+=n.height,r.cartographicToCartesian(t,e)):e.x+=n.height),i._clampedPosition=Cartesian3.clone(e,i._clampedPosition)}defined(o)&&defined(o.globe)&&(a=o.globe,r=a.ellipsoid,t=a._surface,o=(e=o.frameState.mode)!==i._mode,i._mode=e,(i._heightReference===HeightReference$1.NONE||o)&&defined(i._removeCallbackFunc)&&(i._removeCallbackFunc(),i._removeCallbackFunc=void 0,i._clampedPosition=void 0),i._heightReference!==HeightReference$1.NONE&&defined(i._position)&&(defined(n=r.cartesianToCartographic(i._position))?(defined(i._removeCallbackFunc)&&i._removeCallbackFunc(),i._removeCallbackFunc=t.updateHeight(n,s),Cartographic.clone(n,scratchCartographic$4),defined(a=a.getHeight(n))&&(scratchCartographic$4.height=a),r.cartographicToCartesian(scratchCartographic$4,scratchPosition$7),s(scratchPosition$7)):i._actualClampedPosition=void 0))},Billboard.prototype._loadImage=function(){var e,i,r=this._billboardCollection._textureAtlas,n=this._imageId,a=this._image,o=this._imageSubRegion;defined(a)&&(e=r.addImage(n,a)),defined(o)&&(e=r.addSubRegion(n,o)),defined(this._imageIndexPromise=e)&&(i=this,e.then(function(e){var t;i._imageId===n&&i._image===a&&BoundingRectangle.equals(i._imageSubRegion,o)&&(t=r.textureCoordinates[e],i._imageWidth=r.texture.width*t.width,i._imageHeight=r.texture.height*t.height,i._imageIndex=e,i._ready=!0,i._image=void 0,i._imageIndexPromise=void 0,makeDirty(i,IMAGE_INDEX_INDEX))}).otherwise(function(e){console.error("Error loading image for billboard: "+e),i._imageIndexPromise=void 0}))},Billboard.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,defined(this._billboardCollection._textureAtlas)&&this._loadImage())},Billboard.prototype.setImageSubRegion=function(e,t){this._imageId===e&&BoundingRectangle.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=BoundingRectangle.clone(t),defined(this._billboardCollection._textureAtlas)&&this._loadImage())},Billboard.prototype._setTranslate=function(e){var t=this._translate;Cartesian2.equals(t,e)||(Cartesian2.clone(e,t),makeDirty(this,PIXEL_OFFSET_INDEX))},Billboard.prototype._getActualPosition=function(){return defined(this._clampedPosition)?this._clampedPosition:this._actualPosition},Billboard.prototype._setActualPosition=function(e){defined(this._clampedPosition)||Cartesian3.clone(e,this._actualPosition),makeDirty(this,POSITION_INDEX)};var tempCartesian3=new Cartesian4;Billboard._computeActualPosition=function(e,t,i,r){return defined(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===SceneMode$1.SCENE3D?t:(Matrix4.multiplyByPoint(r,t,tempCartesian3),SceneTransforms.computeActualWgs84Position(i,tempCartesian3))};var scratchCartesian3$9=new Cartesian3;Billboard._computeScreenSpacePosition=function(e,t,i,r,n,a){t=Matrix4.multiplyByPoint(e,t,scratchCartesian3$9),a=SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(n,t,i,a);if(defined(a))return Cartesian2.add(a,r,a),a};var scratchPixelOffset=new Cartesian2(0,0);Billboard.prototype.computeScreenSpacePosition=function(e,t){var i=this._billboardCollection;defined(t)||(t=new Cartesian2),Cartesian2.clone(this._pixelOffset,scratchPixelOffset),Cartesian2.add(scratchPixelOffset,this._translate,scratchPixelOffset);var r,n=i.modelMatrix,a=this._position;return defined(this._clampedPosition)&&(a=this._clampedPosition,e.mode!==SceneMode$1.SCENE3D&&(i=(r=e.mapProjection).ellipsoid,r=r.unproject(a,scratchCartographic$4),a=i.cartographicToCartesian(r,scratchCartesian3$9),n=Matrix4.IDENTITY)),Billboard._computeScreenSpacePosition(n,a,this._eyeOffset,scratchPixelOffset,e,t)},Billboard.getScreenSpaceBoundingBox=function(e,t,i){var r=e.width,n=e.height,a=e.scale;r*=a,n*=a;a=t.x;e.horizontalOrigin===HorizontalOrigin$1.RIGHT?a-=r:e.horizontalOrigin===HorizontalOrigin$1.CENTER&&(a-=.5*r);t=t.y;return e.verticalOrigin===VerticalOrigin$1.BOTTOM||e.verticalOrigin===VerticalOrigin$1.BASELINE?t-=n:e.verticalOrigin===VerticalOrigin$1.CENTER&&(t-=.5*n),defined(i)||(i=new BoundingRectangle),i.x=a,i.y=t,i.width=r,i.height=n,i},Billboard.prototype.equals=function(e){return this===e||defined(e)&&this._id===e._id&&Cartesian3.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&BoundingRectangle.equals(this._imageSubRegion,e._imageSubRegion)&&Color.equals(this._color,e._color)&&Cartesian2.equals(this._pixelOffset,e._pixelOffset)&&Cartesian2.equals(this._translate,e._translate)&&Cartesian3.equals(this._eyeOffset,e._eyeOffset)&&NearFarScalar.equals(this._scaleByDistance,e._scaleByDistance)&&NearFarScalar.equals(this._translucencyByDistance,e._translucencyByDistance)&&NearFarScalar.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&DistanceDisplayCondition.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},Billboard.prototype._destroy=function(){defined(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),defined(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var BlendOption={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},BlendOption$1=Object.freeze(BlendOption),SDFSettings={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},SDFSettings$1=Object.freeze(SDFSettings);function TextureAtlasNode(e,t,i,r,n){this.bottomLeft=defaultValue(e,Cartesian2.ZERO),this.topRight=defaultValue(t,Cartesian2.ZERO),this.childNode1=i,this.childNode2=r,this.imageIndex=n}var defaultInitialSize=new Cartesian2(16,16);function TextureAtlas(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=defaultValue(e.borderWidthInPixels,1),i=defaultValue(e.initialSize,defaultInitialSize);this._context=e.context,this._pixelFormat=defaultValue(e.pixelFormat,PixelFormat$1.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=createGuid(),this._idHash={},this._initialSize=i,this._root=void 0}function resizeAtlas(e,t){var i=e._context,r=e.numberOfImages,n=e._borderWidthInPixels;if(0]/,n=[],a="",o=textTypes.LTR,s="",l=e.length,c=0;c";case">":return"<"}}Object.defineProperties(Label.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,i=0,r=t.length;ic+1?o[c+1].Type===textTypes.RTL?(l=d+l,s=0):(l=spliceWord(l,s,u.Word),s+=u.Word.length):l=spliceWord(l,0,d)):u.Type===textTypes.RTL?l=spliceWord(l,s,d):u.Type===textTypes.LTR?s=(l+=u.Word).length:u.Type!==textTypes.WEAK&&u.Type!==textTypes.BRACKETS||(0c+1?o[c+1].Type===textTypes.RTL?l=spliceWord(l,s,d):s=(l+=u.Word).length:l+=u.Word:s=(l+=u.Word).length)}i+=l,r=e.length-1)return e.length;for(var i,r,n,a,o,s,l=F(L(e,t)),c=[],u=t+1;uCesiumMath.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:a,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,a.count=o,a=new VertexArrayBucketLocator(r=o=0,0,this),i[++n]=[a]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,o+=6,r+=6,l+=4;p._locatorBuckets.push({locator:a,count:g}),l+4>CesiumMath.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),l=0,a.count=o,a=new VertexArrayBucketLocator(o=r=0,0,this),i[++n]=[a])}p._clean()}return a.count=o,r},PolylineBucket.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;ns&&(o=new Float32Array(o.buffer,0,s));for(var l,r=this.getSegments(t,r),c=r.positions,u=r.lengths,d=0,h=0,p=0,m=c.length,f=0;fi._depth+e.skipLevels)}function sortChildrenByDistanceToCamera(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}function updateAndPushChildren$1(e,t,i,r){for(var n=t.refine===Cesium3DTileRefine$1.REPLACE,a=t.children,o=a.length,s=0;si:t._screenSpaceError>i))}function canTraverse$1(e,t){return 0!==t.children.length&&(t.hasTilesetContent?!t.contentExpired:t._screenSpaceError>e._maximumScreenSpaceError)}function executeTraversal(e,t,i,r,n){var a=traversal$1.stack;for(a.push(t);0e._maximumScreenSpaceError;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;var r=t.parent,n=e._maximumScreenSpaceError,e=t._screenSpaceErrorProgressiveResolution<=n,n=defined(r)&&r._screenSpaceErrorProgressiveResolution>n;return e&&n&&(i=t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0),i}function getPriorityReverseScreenSpaceError(e,t){var i=t.parent,t=(defined(i)&&(!e._skipLevelOfDetail||0===t._screenSpaceError||i.hasTilesetContent)?i:t)._screenSpaceError;return e.root._screenSpaceError-t}function updateExpireDate(e){var t;defined(e.expireDuration)&&(t=JulianDate.now(scratchJulianDate$1),JulianDate.addSeconds(t,e.expireDuration,t),defined(e.expireDate)?JulianDate.lessThan(e.expireDate,t)&&JulianDate.clone(t,e.expireDate):e.expireDate=JulianDate.clone(t))}function getContentFailedFunction(t,i){return function(e){t._contentState===Cesium3DTileContentState$1.PROCESSING?--i.statistics.numberOfTilesProcessing:--i.statistics.numberOfPendingRequests,t._contentState=Cesium3DTileContentState$1.FAILED,t._contentReadyPromise.reject(e),t._contentReadyToProcessPromise.reject(e)}}function createPriorityFunction(e){return function(){return e._priority}}Cesium3DTile.prototype.getScreenSpaceError=function(e,t,i){var r=this._tileset,n=defaultValue(i,1),a=defined(this.parent)?this.parent.geometricError:r._geometricError,o=t?a:this.geometricError;if(0===o)return 0;var s,l=e.camera,i=l.frustum,t=e.context,a=t.drawingBufferWidth,n=t.drawingBufferHeight*n;return e.mode===SceneMode$1.SCENE2D||i instanceof OrthographicFrustum?(defined(i._offCenterFrustum)&&(i=i._offCenterFrustum),s=o/(Math.max(i.top-i.bottom,i.right-i.left)/Math.max(a,n))):(s=o*n/((n=Math.max(this._distanceToCamera,CesiumMath.EPSILON7))*l.frustum.sseDenominator),r.dynamicScreenSpaceError&&(l=r._dynamicScreenSpaceErrorComputedDensity,r=r.dynamicScreenSpaceErrorFactor,s-=CesiumMath.fog(n,l)*r)),s/=e.pixelRatio},Cesium3DTile.prototype.updateVisibility=function(e){var t=this.parent,i=this._tileset,r=defined(t)?t.computedTransform:i.modelMatrix,t=defined(t)?t._visibilityPlaneMask:CullingVolume.MASK_INDETERMINATE;this.updateTransform(r),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,i.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,t),this._visible=this._visibilityPlaneMask!==CullingVolume.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=getPriorityReverseScreenSpaceError(i,this),this._priorityProgressiveResolution=isPriorityProgressiveResolution(i,this),this.priorityDeferred=isPriorityDeferred(this,e)},Cesium3DTile.prototype.updateExpiration=function(){var e;defined(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&(e=JulianDate.now(scratchJulianDate$1),JulianDate.lessThan(this.expireDate,e)&&(this._contentState=Cesium3DTileContentState$1.EXPIRED,this._expiredContent=this._content))},Cesium3DTile.prototype.requestContent=function(){var n=this,a=this._tileset;if(this.hasEmptyContent)return!1;var e=this._contentResource.clone(),o=this.contentExpired;o&&e.setQueryParameters({expired:this.expireDate.toString()});var t=new Request({throttle:!0,throttleByServer:!0,type:RequestType$1.TILES3D,priorityFunction:createPriorityFunction(this),serverKey:this._serverKey});this._request=t,e.request=t;e=e.fetchArrayBuffer();if(!defined(e))return!1;var i=this._contentState;this._contentState=Cesium3DTileContentState$1.LOADING,this._contentReadyToProcessPromise=when.defer(),this._contentReadyPromise=when.defer();var s=getContentFailedFunction(this,a);return e.then(function(e){if(!n.isDestroyed()){var t,i=getMagic(new Uint8Array(e)),r=Cesium3DTileContentFactory[i];return a._disableSkipLevelOfDetail=a._disableSkipLevelOfDetail||"vctr"===i||"geom"===i,defined(r)?t=r(a,n,n._contentResource,e,0):(t=Cesium3DTileContentFactory.json(a,n,n._contentResource,e,0),n.hasTilesetContent=!0),o&&(n.expireDate=void 0),n._content=t,n._contentState=Cesium3DTileContentState$1.PROCESSING,n._contentReadyToProcessPromise.resolve(t),t.readyPromise.then(function(e){n.isDestroyed()?s():(updateExpireDate(n),n._selectedFrame=0,n.lastStyleTime=0,JulianDate.now(n._loadTimestamp),n._contentState=Cesium3DTileContentState$1.READY,n._contentReadyPromise.resolve(e))})}s()}).otherwise(function(e){return t.state===RequestState$1.CANCELLED?(n._contentState=i,--a.statistics.numberOfPendingRequests,void++a.statistics.numberOfAttemptedRequests):void s(e)}),!0},Cesium3DTile.prototype.unloadContent=function(){this.hasEmptyContent||this.hasTilesetContent||(this._content=this._content&&this._content.destroy(),this._contentState=Cesium3DTileContentState$1.UNLOADED,this._contentReadyToProcessPromise=void 0,this._contentReadyPromise=void 0,this.lastStyleTime=0,this.clippingPlanesDirty=0===this._clippingPlanesState,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var scratchProjectedBoundingSphere=new BoundingSphere;function getBoundingVolume(e,t){var i;return t.mode===SceneMode$1.SCENE3D||defined(e._boundingVolume2D)||(i=e._boundingVolume.boundingSphere,i=BoundingSphere.projectTo2D(i,t.mapProjection,scratchProjectedBoundingSphere),e._boundingVolume2D=new TileBoundingSphere(i.center,i.radius)),t.mode!==SceneMode$1.SCENE3D?e._boundingVolume2D:e._boundingVolume}function getContentBoundingVolume(e,t){var i;return t.mode===SceneMode$1.SCENE3D||defined(e._contentBoundingVolume2D)||(i=e._contentBoundingVolume.boundingSphere,i=BoundingSphere.projectTo2D(i,t.mapProjection,scratchProjectedBoundingSphere),e._contentBoundingVolume2D=new TileBoundingSphere(i.center,i.radius)),t.mode!==SceneMode$1.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Cesium3DTile.prototype.visibility=function(e,t){var i=e.cullingVolume,r=getBoundingVolume(this,e),n=this._tileset,e=n.clippingPlanes;if(defined(e)&&e.enabled){n=e.computeIntersectionWithBoundingVolume(r,n.clippingPlanesOriginMatrix);if(this._isClipped=n!==Intersect$1.INSIDE,n===Intersect$1.OUTSIDE)return CullingVolume.MASK_OUTSIDE}return i.computeVisibilityWithPlaneMask(r,t)},Cesium3DTile.prototype.contentVisibility=function(e){if(!defined(this._contentBoundingVolume))return Intersect$1.INSIDE;if(this._visibilityPlaneMask===CullingVolume.MASK_INSIDE)return Intersect$1.INSIDE;var t=e.cullingVolume,i=getContentBoundingVolume(this,e),r=this._tileset,e=r.clippingPlanes;if(defined(e)&&e.enabled){r=e.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=r!==Intersect$1.INSIDE,r===Intersect$1.OUTSIDE)return Intersect$1.OUTSIDE}return t.computeVisibility(i)},Cesium3DTile.prototype.distanceToTile=function(e){return getBoundingVolume(this,e).distanceToCamera(e)};var scratchToTileCenter=new Cartesian3;Cesium3DTile.prototype.distanceToTileCenter=function(e){var t=getBoundingVolume(this,e).boundingVolume,t=Cartesian3.subtract(t.center,e.camera.positionWC,scratchToTileCenter);return Cartesian3.dot(e.camera.directionWC,t)},Cesium3DTile.prototype.insideViewerRequestVolume=function(e){var t=this._viewerRequestVolume;return!defined(t)||0===t.distanceToCamera(e)};var scratchMatrix$2=new Matrix3,scratchScale$6=new Cartesian3,scratchHalfAxes=new Matrix3,scratchCenter$3=new Cartesian3,scratchRectangle$2=new Rectangle,scratchOrientedBoundingBox=new OrientedBoundingBox,scratchTransform=new Matrix4;function createBox(e,t,i){var r=Cartesian3.fromElements(e[0],e[1],e[2],scratchCenter$3),e=Matrix3.fromArray(e,3,scratchHalfAxes),r=Matrix4.multiplyByPoint(t,r,r),t=Matrix4.getMatrix3(t,scratchMatrix$2),e=Matrix3.multiply(t,e,e);return defined(i)?(i.update(r,e),i):new TileOrientedBoundingBox(r,e)}function createBoxFromTransformedRegion(e,t,i,r){var n=Rectangle.unpack(e,0,scratchRectangle$2),a=e[4],e=e[5],a=OrientedBoundingBox.fromRectangle(n,a,e,Ellipsoid.WGS84,scratchOrientedBoundingBox),e=a.center,a=a.halfAxes;t=Matrix4.multiplyTransformation(t,Matrix4.inverseTransformation(i,scratchTransform),scratchTransform),e=Matrix4.multiplyByPoint(t,e,e);t=Matrix4.getMatrix3(t,scratchMatrix$2),a=Matrix3.multiply(t,a,a);return defined(r)&&r instanceof TileOrientedBoundingBox?(r.update(e,a),r):new TileOrientedBoundingBox(e,a)}function createRegion(e,t,i,r){return Matrix4.equalsEpsilon(t,i,CesiumMath.EPSILON8)?defined(r)?r:new TileBoundingRegion({rectangle:Rectangle.unpack(e,0,scratchRectangle$2),minimumHeight:e[4],maximumHeight:e[5]}):createBoxFromTransformedRegion(e,t,i,r)}function createSphere(e,t,i){var r=Cartesian3.fromElements(e[0],e[1],e[2],scratchCenter$3),e=e[3],r=Matrix4.multiplyByPoint(t,r,r),t=Matrix4.getScale(t,scratchScale$6);return e*=Cartesian3.maximumComponent(t),defined(i)?(i.update(r,e),i):new TileBoundingSphere(r,e)}function applyDebugSettings(e,t,i,r){var n,a,o;r.isRender&&(o=defined(e._header.content)&&defined(e._header.content.boundingVolume),n=e.hasEmptyContent||e.hasTilesetContent,(a=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o)?(r=e._finalResolution?n?Color.DARKGRAY:Color.WHITE:Color.YELLOW,defined(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(r)),e._debugBoundingVolume.update(i),(n=e._debugBoundingVolume.getGeometryInstanceAttributes("outline")).color=ColorGeometryInstanceAttribute.toValue(r,n.color)):!a&&defined(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy()),t.debugShowContentBoundingVolume&&o?(defined(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(Color.BLUE)),e._debugContentBoundingVolume.update(i)):!t.debugShowContentBoundingVolume&&defined(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&defined(e._viewerRequestVolume)?(defined(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(Color.YELLOW)),e._debugViewerRequestVolume.update(i)):!t.debugShowViewerRequestVolume&&defined(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy()),a=t.debugColorizeTiles&&!e._debugColorizeTiles||defined(t._heatmap.tilePropertyName),o=!t.debugColorizeTiles&&e._debugColorizeTiles,a?(t._heatmap.colorize(e,i),e._debugColorizeTiles=!0,e.color=e._debugColor):o&&(e._debugColorizeTiles=!1,e.color=Color.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),o&&t.makeStyleDirty())}function updateContent(e,t,i){var r=e._content,n=e._expiredContent;if(defined(n)){if(!e.contentReady)return void n.update(t,i);e._expiredContent.destroy(),e._expiredContent=void 0}r.update(t,i)}function updateClippingPlanes$1(e,t){var i=t.clippingPlanes,t=0;defined(i)&&e._isClipped&&i.enabled&&(t=i.clippingPlanesState),t!==e._clippingPlanesState&&(e._clippingPlanesState=t,e.clippingPlanesDirty=!0)}Cesium3DTile.prototype.createBoundingVolume=function(e,t,i){if(!defined(e))throw new RuntimeError("boundingVolume must be defined");if(defined(e.box))return createBox(e.box,t,i);if(defined(e.region))return createRegion(e.region,t,this._initialTransform,i);if(defined(e.sphere))return createSphere(e.sphere,t,i);throw new RuntimeError("boundingVolume must contain a sphere, region, or box")},Cesium3DTile.prototype.updateTransform=function(e){e=defaultValue(e,Matrix4.IDENTITY);var t=Matrix4.multiply(e,this.transform,scratchTransform);Matrix4.equals(t,this.computedTransform)||(Matrix4.clone(t,this.computedTransform),e=this._header,t=this._header.content,this._boundingVolume=this.createBoundingVolume(e.boundingVolume,this.computedTransform,this._boundingVolume),defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())},Cesium3DTile.prototype.updateGeometricErrorScale=function(){var e=Matrix4.getScale(this.computedTransform,scratchScale$6),e=Cartesian3.maximumComponent(e);this.geometricError=this._geometricError*e},Cesium3DTile.prototype.update=function(e,t,i){var r=t.commandList.length;updateClippingPlanes$1(this,e),applyDebugSettings(this,e,t,i),updateContent(this,e,t),this._commandsLength=t.commandList.length-r,this.clippingPlanesDirty=!1};var scratchCommandList=[];function isolateDigits(e,t,i){t=e*Math.pow(10,t);return parseInt(t)*Math.pow(10,i)}function priorityNormalizeAndClamp(e,t,i){return Math.max(CesiumMath.normalize(e,t,i)-CesiumMath.EPSILON7,0)}Cesium3DTile.prototype.process=function(e,t){var i=t.commandList;t.commandList=scratchCommandList,this._content.update(e,t),scratchCommandList.length=0,t.commandList=i},Cesium3DTile.prototype.updatePriority=function(){var e=this.tileset,t=e.preferLeaves,i=e._minimumPriority,r=e._maximumPriority,n=Math.pow(10,8),a=Math.pow(10,9),o=Math.pow(10,10),s=priorityNormalizeAndClamp(this._depth,i.depth,r.depth),s=t?1-s:s,t=isolateDigits(!e._skipLevelOfDetail&&this.refine===Cesium3DTileRefine$1.REPLACE?priorityNormalizeAndClamp(this._priorityHolder._distanceToCamera,i.distance,r.distance):priorityNormalizeAndClamp(this._priorityReverseScreenSpaceError,i.reverseScreenSpaceError,r.reverseScreenSpaceError),4,0),n=this._priorityProgressiveResolution?0:n,r=isolateDigits(priorityNormalizeAndClamp(this._priorityHolder._foveatedFactor,i.foveatedFactor,r.foveatedFactor),4,4),a=this.priorityDeferred?a:0,o=e._pass===Cesium3DTilePass$1.PRELOAD_FLIGHT?0:o;this._priority=s+t+n+r+a+o},Cesium3DTile.prototype.isDestroyed=function(){return!1},Cesium3DTile.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),destroyObject(this)};var Cesium3DTileOptimizations={},scratchAxis=new Cartesian3;function Cesium3DTilesetCache(){this._list=new DoublyLinkedList,this._sentinel=this._list.add(),this._trimTiles=!1}function Cesium3DTilesetHeatmap(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function getHeatmapValue(e,t){e="_loadTimestamp"===t?JulianDate.toDate(e).getTime():e;return e}function getHeatmapValueAndUpdateMinimumMaximum(e,t){var i=e.tilePropertyName;if(defined(i)){i=getHeatmapValue(t[i],i);return defined(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}Cesium3DTileOptimizations.checkChildrenWithinParent=function(e){var t=e.children,i=t.length,r=e.boundingVolume;if(r instanceof TileOrientedBoundingBox||r instanceof TileBoundingRegion){var n=r._orientedBoundingBox;e._optimChildrenWithinParent=Cesium3DTileOptimizationHint$1.USE_OPTIMIZATION;for(var a=0;an||i);){var s=o.item,o=o.next;this.unloadTile(e,s,t)}},Cesium3DTilesetCache.prototype.trim=function(){this._trimTiles=!0},Cesium3DTilesetHeatmap.prototype.setReferenceMinimumMaximum=function(e,t,i){this._referenceMinimum[i]=getHeatmapValue(e,i),this._referenceMaximum[i]=getHeatmapValue(t,i)};var heatmapColors=[new Color(.1,.1,.1,1),new Color(.153,.278,.878,1),new Color(.827,.231,.49,1),new Color(.827,.188,.22,1),new Color(1,.592,.259,1),new Color(1,.843,0,1)];function Cesium3DTilesetStatistics(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}function updatePointAndFeatureCounts(e,t,i,r){var n=t.innerContents,a=t.pointsLength,o=t.trianglesLength,s=t.featuresLength,l=t.geometryByteLength,c=t.texturesByteLength,t=t.batchTableByteLength;if(r?(e.numberOfFeaturesLoaded+=i?-s:s,e.numberOfPointsLoaded+=i?-a:a,e.geometryByteLength+=i?-l:l,e.texturesByteLength+=i?-c:c,e.batchTableByteLength+=i?-t:t):(e.numberOfFeaturesSelected+=i?-s:s,e.numberOfPointsSelected+=i?-a:a,e.numberOfTrianglesSelected+=i?-o:o),defined(n))for(var u=n.length,d=0;dApproximateTerrainHeights._defaultMinTerrainHeight&&(l._initialClippingPlanesOriginMatrix=Transforms.eastNorthUpToFixedFrame(i)),l._clippingPlanesOriginMatrix=Matrix4.clone(l._initialClippingPlanesOriginMatrix),l._readyPromise.resolve(l)}).otherwise(function(e){l._readyPromise.reject(e)})}Cesium3DTilesetHeatmap.prototype.colorize=function(e,t){var i,r,n;defined(this.tilePropertyName)&&e.contentAvailable&&e._selectedFrame===t.frameNumber&&(r=getHeatmapValueAndUpdateMinimumMaximum(this,e),n=this._previousMinimum,i=this._previousMaximum,n!==Number.MAX_VALUE&&i!==-Number.MAX_VALUE&&(t=i-n+CesiumMath.EPSILON7,i=CesiumMath.clamp(r-n,0,t)/t*(heatmapColors.length-1),r=Math.floor(i),n=Math.ceil(i),t=i-r,i=heatmapColors[r],r=heatmapColors[n],(n=Color.clone(Color.WHITE)).red=CesiumMath.lerp(i.red,r.red,t),n.green=CesiumMath.lerp(i.green,r.green,t),n.blue=CesiumMath.lerp(i.blue,r.blue,t),e._debugColor=n))},Cesium3DTilesetHeatmap.prototype.resetMinimumMaximum=function(){var e,t,i=this.tilePropertyName;defined(i)&&(e=this._referenceMinimum[i],t=this._referenceMaximum[i],i=defined(e)&&defined(t),this._previousMinimum=i?e:this._minimum,this._previousMaximum=i?t:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE)},Cesium3DTilesetStatistics.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0},Cesium3DTilesetStatistics.prototype.incrementSelectionCounts=function(e){updatePointAndFeatureCounts(this,e,!1,!1)},Cesium3DTilesetStatistics.prototype.incrementLoadCounts=function(e){updatePointAndFeatureCounts(this,e,!1,!0)},Cesium3DTilesetStatistics.prototype.decrementLoadCounts=function(e){updatePointAndFeatureCounts(this,e,!0,!0)},Cesium3DTilesetStatistics.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength},Object.defineProperties(Cesium3DTileStyleEngine.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}}),Cesium3DTileStyleEngine.prototype.makeDirty=function(){this._styleDirty=!0},Cesium3DTileStyleEngine.prototype.resetDirty=function(){this._styleDirty=!1},Cesium3DTileStyleEngine.prototype.applyStyle=function(e){if(e.ready&&(!defined(this._style)||this._style.ready)){var t=this._styleDirty;t&&++this._lastStyleTime;for(var i=this._lastStyleTime,r=e._statistics,n=t?e._selectedTiles:e._selectedTilesToStyle,a=n.length,o=0;or.minimumRadius?(s=Cartographic.fromCartesian(t,r,scratchCartographic$7),p=Cartesian3.normalize(c.positionWC,scratchPositionNormal),n=c.directionWC,a=c.positionCartographic.height,h=0,o=2*s.height):(s=Matrix4.multiplyByPoint(i,c.positionWC,scratchPosition$9),p=Cartesian3.UNIT_Z,n=Matrix4.multiplyByPointAsVector(i,c.directionWC,scratchDirection),n=Cartesian3.normalize(n,n),a=s.z,d instanceof TileOrientedBoundingBox?(u=u._header.boundingVolume.box[11],h=t.z-u,o=t.z+u):d instanceof TileBoundingSphere&&(l=l.radius,h=t.z-l,o=t.z+l)));var h=h+(o-h)*e.dynamicScreenSpaceErrorHeightFalloff,h=CesiumMath.clamp((a-h)/(o-h),0,1),p=1-Math.abs(Cartesian3.dot(n,p));p*=1-h;h=e.dynamicScreenSpaceErrorDensity;h*=p,e._dynamicScreenSpaceErrorComputedDensity=h}function requestContent(e,t){var i,r;t.hasEmptyContent||(i=e._statistics,r=t.contentExpired,t.requestContent()?(r&&(t.hasTilesetContent?destroySubtree(e,t):(i.decrementLoadCounts(t.content),--i.numberOfTilesWithContentReady)),++i.numberOfPendingRequests,e._requestedTilesInFlight.push(t),t.contentReadyToProcessPromise.then(addToProcessingQueue(e,t)),t.contentReadyPromise.then(handleTileSuccess(e,t)).otherwise(handleTileFailure(e,t))):++i.numberOfAttemptedRequests)}function sortRequestByPriority(e,t){return e._priority-t._priority}function cancelOutOfViewRequests(e,t){for(var i=e._requestedTilesInFlight,r=0,n=i.length,a=0;au&&swapItem(e,t,r,n);du;)h--}t[2*r+a]===u?swapItem(e,t,r,h):swapItem(e,t,++h,n),h<=i&&(r=h+1),i<=h&&(n=h-1)}}function swapItem(e,t,i,r){swap$2(e,i,r),swap$2(t,2*i,2*r),swap$2(t,2*i+1,2*r+1)}function swap$2(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function within(e,t,i,r,n,a){for(var o=[0,e.length-1,0],s=[],l=n*n;o.length;){var c=o.pop(),u=o.pop(),d=o.pop();if(u-d<=a)for(var h=d;h<=u;h++)sqDist(t[2*h],t[2*h+1],i,r)<=l&&s.push(e[h]);else{var p=Math.floor((d+u)/2),m=t[2*p],f=t[2*p+1];sqDist(m,f,i,r)<=l&&s.push(e[p]);var g=(c+1)%2;(0===c?i-n<=m:r-n<=f)&&(o.push(d),o.push(p-1),o.push(g)),(0===c?m<=i+n:f<=r+n)&&(o.push(p+1),o.push(u),o.push(g))}}return s}function sqDist(e,t,i,r){i=e-i,r=t-r;return i*i+r*r}function EntityCluster(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._enabled=defaultValue(e.enabled,!1),this._pixelRange=defaultValue(e.pixelRange,80),this._minimumClusterSize=defaultValue(e.minimumClusterSize,2),this._clusterBillboards=defaultValue(e.clusterBillboards,!0),this._clusterLabels=defaultValue(e.clusterLabels,!0),this._clusterPoints=defaultValue(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new Event}function getX(e){return e.coord.x}function getY(e){return e.coord.y}function expandBoundingBox(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}PointPrimitiveCollection.prototype.update=function(e){removePointPrimitives(this),this._maxTotalPointSize=ContextLimits.maximumAliasedPointSize,updateMode$2(this,e);var t=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,n=this._propertiesChanged,a=this._createVertexArray,o=e.context,s=e.passes,l=s.pick;if(a||!l&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var c=0;cl)return;if(this._backwardExtrapolationType===ExtrapolationType$1.HOLD)return n.unpack(a,0,t)}if(r<=o){var c=i[o=r-1];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===ExtrapolationType$1.NONE||0!==l&&JulianDate.secondsDifference(e,c)>l)return;if(this._forwardExtrapolationType===ExtrapolationType$1.HOLD)return o=r-1,n.unpack(a,o*n.packedLength,t)}var u=this._xTable,d=this._yTable,h=this._interpolationAlgorithm,s=this._packedInterpolationLength,c=this._inputOrder;this._updateTableLength&&(this._updateTableLength=!1,(p=Math.min(h.getRequiredDataPoints(this._interpolationDegree,c),r))!==this._numberOfPoints&&(this._numberOfPoints=p,u.length=p,d.length=p*s));l=this._numberOfPoints-1;if(l<1)return;var p,m=0,f=r-1;1+l<=f-m+1&&((p=o-(l/2|0)-1). version format.");i=t._documentPacket;defined(e.name)&&(i.name=e.name);t=e.clock;defined(t)&&(defined(e=i.clock)?(e.interval=defaultValue(t.interval,e.interval),e.currentTime=defaultValue(t.currentTime,e.currentTime),e.range=defaultValue(t.range,e.range),e.step=defaultValue(t.step,e.step),e.multiplier=defaultValue(t.multiplier,e.multiplier)):i.clock={interval:t.interval,currentTime:t.currentTime,range:t.range,step:t.step,multiplier:t.multiplier})}function processEllipse(e,t,i,r){var n,a=t.ellipse;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.ellipse)||(e.ellipse=t=new EllipseGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Number,t,"semiMajorAxis",a.semiMajorAxis,n,r,i),processPacketData(Number,t,"semiMinorAxis",a.semiMinorAxis,n,r,i),processPacketData(Number,t,"height",a.height,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Number,t,"extrudedHeight",a.extrudedHeight,n,r,i),processPacketData(HeightReference$1,t,"extrudedHeightReference",a.extrudedHeightReference,n,r,i),processPacketData(Rotation,t,"rotation",a.rotation,n,r,i),processPacketData(Rotation,t,"stRotation",a.stRotation,n,r,i),processPacketData(Number,t,"granularity",a.granularity,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(Number,t,"numberOfVerticalLines",a.numberOfVerticalLines,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(ClassificationType$1,t,"classificationType",a.classificationType,n,r,i),processPacketData(Number,t,"zIndex",a.zIndex,n,r,i))}function processEllipsoid(e,t,i,r){var n,a=t.ellipsoid;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.ellipsoid)||(e.ellipsoid=t=new EllipsoidGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(Cartesian3,t,"radii",a.radii,n,r,i),processPacketData(Cartesian3,t,"innerRadii",a.innerRadii,n,r,i),processPacketData(Number,t,"minimumClock",a.minimumClock,n,r,i),processPacketData(Number,t,"maximumClock",a.maximumClock,n,r,i),processPacketData(Number,t,"minimumCone",a.minimumCone,n,r,i),processPacketData(Number,t,"maximumCone",a.maximumCone,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Boolean,t,"fill",a.fill,n,r,i),processMaterialPacketData(t,"material",a.material,n,r,i),processPacketData(Boolean,t,"outline",a.outline,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(Number,t,"stackPartitions",a.stackPartitions,n,r,i),processPacketData(Number,t,"slicePartitions",a.slicePartitions,n,r,i),processPacketData(Number,t,"subdivisions",a.subdivisions,n,r,i),processPacketData(ShadowMode$1,t,"shadows",a.shadows,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i))}function processLabel(e,t,i,r){var n,a=t.label;defined(a)&&(n=intervalFromString(a.interval),defined(t=e.label)||(e.label=t=new LabelGraphics),processPacketData(Boolean,t,"show",a.show,n,r,i),processPacketData(String,t,"text",a.text,n,r,i),processPacketData(String,t,"font",a.font,n,r,i),processPacketData(LabelStyle$1,t,"style",a.style,n,r,i),processPacketData(Number,t,"scale",a.scale,n,r,i),processPacketData(Boolean,t,"showBackground",a.showBackground,n,r,i),processPacketData(Color,t,"backgroundColor",a.backgroundColor,n,r,i),processPacketData(Cartesian2,t,"backgroundPadding",a.backgroundPadding,n,r,i),processPacketData(Cartesian2,t,"pixelOffset",a.pixelOffset,n,r,i),processPacketData(Cartesian3,t,"eyeOffset",a.eyeOffset,n,r,i),processPacketData(HorizontalOrigin$1,t,"horizontalOrigin",a.horizontalOrigin,n,r,i),processPacketData(VerticalOrigin$1,t,"verticalOrigin",a.verticalOrigin,n,r,i),processPacketData(HeightReference$1,t,"heightReference",a.heightReference,n,r,i),processPacketData(Color,t,"fillColor",a.fillColor,n,r,i),processPacketData(Color,t,"outlineColor",a.outlineColor,n,r,i),processPacketData(Number,t,"outlineWidth",a.outlineWidth,n,r,i),processPacketData(NearFarScalar,t,"translucencyByDistance",a.translucencyByDistance,n,r,i),processPacketData(NearFarScalar,t,"pixelOffsetScaleByDistance",a.pixelOffsetScaleByDistance,n,r,i),processPacketData(NearFarScalar,t,"scaleByDistance",a.scaleByDistance,n,r,i),processPacketData(DistanceDisplayCondition,t,"distanceDisplayCondition",a.distanceDisplayCondition,n,r,i),processPacketData(Number,t,"disableDepthTestDistance",a.disableDepthTestDistance,n,r,i))}function processModel(e,t,i,r){t=t.model;if(defined(t)){var n,a,o=intervalFromString(t.interval),s=e.model;defined(s)||(e.model=s=new ModelGraphics),processPacketData(Boolean,s,"show",t.show,o,r,i),processPacketData(URI,s,"uri",t.gltf,o,r,i),processPacketData(Number,s,"scale",t.scale,o,r,i),processPacketData(Number,s,"minimumPixelSize",t.minimumPixelSize,o,r,i),processPacketData(Number,s,"maximumScale",t.maximumScale,o,r,i),processPacketData(Boolean,s,"incrementallyLoadTextures",t.incrementallyLoadTextures,o,r,i),processPacketData(Boolean,s,"runAnimations",t.runAnimations,o,r,i),processPacketData(Boolean,s,"clampAnimations",t.clampAnimations,o,r,i),processPacketData(ShadowMode$1,s,"shadows",t.shadows,o,r,i),processPacketData(HeightReference$1,s,"heightReference",t.heightReference,o,r,i),processPacketData(Color,s,"silhouetteColor",t.silhouetteColor,o,r,i),processPacketData(Number,s,"silhouetteSize",t.silhouetteSize,o,r,i),processPacketData(Color,s,"color",t.color,o,r,i),processPacketData(ColorBlendMode$1,s,"colorBlendMode",t.colorBlendMode,o,r,i),processPacketData(Number,s,"colorBlendAmount",t.colorBlendAmount,o,r,i),processPacketData(DistanceDisplayCondition,s,"distanceDisplayCondition",t.distanceDisplayCondition,o,r,i);var l=t.nodeTransformations;if(defined(l))if(Array.isArray(l))for(n=0,a=l.length;nnorthUpAxisFactor*o.maximumRadius?(c=updateTransformCartesian3Scratch2,Cartesian3.normalize(v,c),Cartesian3.negate(c,c),d=Cartesian3.clone(Cartesian3.UNIT_Z,updateTransformCartesian3Scratch3),u=Cartesian3.cross(d,c,updateTransformCartesian3Scratch1),Cartesian3.magnitude(u)>CesiumMath.EPSILON7&&(Cartesian3.normalize(c,c),Cartesian3.normalize(u,u),d=Cartesian3.cross(c,u,updateTransformCartesian3Scratch3),Cartesian3.normalize(d,d),s=!0)):Cartesian3.equalsEpsilon(v,h,CesiumMath.EPSILON7)||(d=updateTransformCartesian3Scratch2,Cartesian3.normalize(n,d),Cartesian3.normalize(a,a),u=Cartesian3.cross(d,a,updateTransformCartesian3Scratch3),l&&(u=Cartesian3.multiplyByScalar(u,-1,u)),Cartesian3.equalsEpsilon(u,Cartesian3.ZERO,CesiumMath.EPSILON7)||(c=Cartesian3.cross(u,d,updateTransformCartesian3Scratch1),Matrix3.multiplyByVector(y,c,c),Matrix3.multiplyByVector(y,u,u),Matrix3.multiplyByVector(y,d,d),Cartesian3.normalize(c,c),Cartesian3.normalize(u,u),Cartesian3.normalize(d,d),s=!0)))),defined(e.boundingSphere)&&(v=e.boundingSphere.center),r&&(f=Cartesian3.clone(t.position,updateTransformCartesian3Scratch4),g=Cartesian3.clone(t.direction,updateTransformCartesian3Scratch5),_=Cartesian3.clone(t.up,updateTransformCartesian3Scratch6)),y=updateTransformMatrix4Scratch,s?(y[0]=c.x,y[1]=c.y,y[2]=c.z,y[3]=0,y[4]=u.x,y[5]=u.y,y[6]=u.z,y[7]=0,y[8]=d.x,y[9]=d.y,y[10]=d.z,y[11]=0,y[12]=v.x,y[13]=v.y,y[14]=v.z,y[15]=0):Transforms.eastNorthUpToFixedFrame(v,o,y),t._setTransform(y),r&&(Cartesian3.clone(f,t.position),Cartesian3.clone(g,t.direction),Cartesian3.clone(_,t.up),Cartesian3.cross(g,_,t.right))),i&&(e=C===SceneMode$1.SCENE2D||Cartesian3.equals(e._offset3D,Cartesian3.ZERO)?void 0:e._offset3D,t.lookAtTransform(t.transform,e))}function EntityView(e,t,i){this.entity=e,this.scene=t,this.ellipsoid=defaultValue(i,Ellipsoid.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new Cartesian3,this._defaultOffset3D=void 0,this._offset3D=new Cartesian3}Object.defineProperties(EntityView,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=Cartesian3.clone(e,new Cartesian3)}}}),EntityView.defaultOffset3D=new Cartesian3(-14e3,3500,3500);var scratchHeadingPitchRange=new HeadingPitchRange,scratchCartesian$7=new Cartesian3;EntityView.prototype.update=function(e,t){var i,r,n,a,o,s,l,c,u=this.scene,d=this.ellipsoid,h=u.mode;h===SceneMode$1.MORPHING||defined(r=(i=this.entity).position)&&(c=i!==this._lastEntity,n=h!==this._mode,a=u.camera,o=c||n,s=!0,c?!(u=defined(l=i.viewFrom))&&defined(t)?(scratchHeadingPitchRange.pitch=-CesiumMath.PI_OVER_FOUR,scratchHeadingPitchRange.range=0,defined(c=r.getValue(e,scratchCartesian$7))&&(c=2-1/Math.max(1,Cartesian3.magnitude(c)/d.maximumRadius),scratchHeadingPitchRange.pitch*=c),a.viewBoundingSphere(t,scratchHeadingPitchRange),this.boundingSphere=t,s=o=!1):u&&defined(l.getValue(e,this._offset3D))||Cartesian3.clone(EntityView._defaultOffset3D,this._offset3D):n||this._mode===SceneMode$1.SCENE2D||Cartesian3.clone(a.position,this._offset3D),this._lastEntity=i,this._mode=h,updateTransform(this,a,o,s,r,e,d))};var tmp$3={},nIg,oIg;nIg=tmp$3,oIg=function(e){function t(e){return e}function m(e){var t,n=h(e.transform),a=1/0,o=a,s=-a,l=-a;function i(e){(e=n(e))[0]s&&(s=e[0]),e[1]l&&(l=e[1])}function r(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(r);break;case"Point":i(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(i)}}for(t in e.arcs.forEach(function(e){for(var t,i=-1,r=e.length;++is&&(s=t[0]),t[1]l&&(l=t[1])}),e.objects)r(e.objects[t]);return[a,o,s,l]}function a(t,e){return"GeometryCollection"===e.type?{type:"FeatureCollection",features:e.geometries.map(function(e){return i(t,e)})}:i(t,e)}var h=function(e){if(null==e)return t;var a,o,s=e.scale[0],l=e.scale[1],c=e.translate[0],u=e.translate[1];return function(e,t){t||(a=o=0);var i=2,r=e.length,n=new Array(r);for(n[0]=(a+=e[0])*s+c,n[1]=(o+=e[1])*l+u;io&&(n=i[0],i[0]=i[a],i[a]=n,o=r);return i})}}function g(e,t){for(var i=0,r=e.length;i>>1;e[n]=n)throw new Error("full hashset");i=l[t=t+1&c]}return l[t]=e,!0},has:function(e){for(var t=a(e)&c,i=l[t],r=0;i!=s;){if(o(i,e))return!0;if(++r>=n)break;i=l[t=t+1&c]}return!1},values:function(){for(var e=[],t=0,i=l.length;t=a)throw new Error("full hashmap");r=c[i=i+1&d]}return c[i]=e,u[i]=t},maybeSet:function(e,t){for(var i=o(e)&d,r=c[i],n=0;r!=l;){if(s(r,e))return u[i];if(++n>=a)throw new Error("full hashmap");r=c[i=i+1&d]}return c[i]=e,u[i]=t},get:function(e,t){for(var i=o(e)&d,r=c[i],n=0;r!=l;){if(s(r,e))return u[i];if(++n>=a)break;r=c[i=i+1&d]}return t},keys:function(){for(var e=[],t=0,i=c.length;t>7^l[2]^l[3])}function v(e){for(var n=e.coordinates,t=e.lines,i=e.rings,r=function(){for(var e=P(1.4*n.length,S,T,Int32Array,-1,Int32Array),t=new Int32Array(n.length),i=0,r=n.length;i>1);t=r}}function F(e,t){return e[1][2]-t[1][2]}function N(e){return[e[0],e[1],0]}function B(e,t){return t-e}var s=Math.PI,V=2*s,k=s/4,z=s/180,U=Math.abs,$=Math.atan2,G=Math.cos,H=Math.sin;function W(e,t){for(var i=0,r=e.length,n=0,a=e[t?i++:r-1],o=a[0]*z,s=a[1]*z/2+k,l=G(s),c=H(s);i>1)-1,r=o[i];if(0<=F(e,r))break;o[r._=t]=r,o[e._=t=i]=e}}function n(e,t){for(;;){var i=t+1<<1,r=i-1,n=t,a=o[n];if(r=o&&(a[r++]=[t[0],t[1]]);return a.length=r,a});return{type:"Topology",transform:e.transform,bbox:e.bbox,objects:e.objects,arcs:t}},e.sphericalRingArea=function(e,t){return e=W(e,!0),t&&(e*=-1),2*(e<0?V+e:e)},e.sphericalTriangleArea=function(e){return 2*U(W(e,!1))},Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?oIg(exports):oIg(nIg.topojson=nIg.topojson||{});var topojson=tmp$3.topojson;function defaultCrsFunction(e){return Cartesian3.fromDegrees(e[0],e[1],e[2])}var crsNames={"urn:ogc:def:crs:OGC:1.3:CRS84":defaultCrsFunction,"EPSG:4326":defaultCrsFunction,"urn:ogc:def:crs:EPSG::4326":defaultCrsFunction},crsLinkHrefs={},crsLinkTypes={},defaultMarkerSize=48,defaultMarkerSymbol,defaultMarkerColor=Color.ROYALBLUE,defaultStroke=Color.YELLOW,defaultStrokeWidth=2,defaultFill$1=Color.fromBytes(255,255,0,100),defaultClampToGround=!1,sizes={small:24,medium:48,large:64},simpleStyleIdentifiers=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function defaultDescribe(e,t){var i,r,n="";for(i in e)!e.hasOwnProperty(i)||i===t||-1!==simpleStyleIdentifiers.indexOf(i)||defined(r=e[i])&&(n+="object"==typeof r?""+i+""+defaultDescribe(r)+"":""+i+""+r+"");return 0'+n+""),n}function createDescriptionCallback(i,r,n){var a;return function(e,t){return defined(a)||(a=i(r,n)),a}}function defaultDescribeProperty(e,t){return new CallbackProperty(createDescriptionCallback(defaultDescribe,e,t),!0)}function createObject(e,t,i){var r=e.id;if(defined(r)&&"Feature"===e.type){for(var n=2,a=r;defined(t.getById(a));)a=r+"_"+n,n++;r=a}else r=createGuid();var o=t.getOrCreateEntity(r),s=e.properties;if(defined(s)){var l,e=(o.properties=s).title;if(defined(e))o.name=e,l="title";else{var c,u=Number.MAX_VALUE;for(c in s)if(s.hasOwnProperty(c)&&s[c]){var d=c.toLowerCase();if(1t&&(r=null==i?(i="…",3):i.length,e=e.substring(0,t-r)+i),e}function g_g(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i",this.getInnerHtml(),""].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e,t=this.getAttrs(),i=[];for(e in t)t.hasOwnProperty(e)&&i.push(e+'="'+t[e]+'"');return i.join(" ")},e}(),o_g=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new k_g({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},i=this.createCssClass(e);return i&&(t.class=i),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length=o)return(s.host.length==t?s.host.substr(0,t-c)+n:a(e,o)).substr(0,o+i);var c="";s.path&&(c+="/"+s.path);s.query&&(c+="?"+s.query);if(c){if(o<=(e+c).length){if((e+c).length==t)return(e+c).substr(0,t);var u=o-e.length;return(e+a(c,u)).substr(0,o+i)}e+=c}if(s.fragment){u="#"+s.fragment;if(o<=(e+u).length){if((e+u).length==t)return(e+u).substr(0,t);c=o-e.length;return(e+a(u,c)).substr(0,o+i)}e+=u}if(s.scheme&&s.host){s=s.scheme+"://";if((e+s).length"!==e&&z_g.test(e)?u=3:m()}(p);break;case 3:!function(e){B_g.test(e)?(h=new Z_g(s_g({},h,{name:_()})),u=4):"<"===e?f():"/"===e?(h=new Z_g(s_g({},h,{name:_()})),u=12):">"===e?(h=new Z_g(s_g({},h,{name:_()})),g()):z_g.test(e)||A_g.test(e)||":"===e||m()}(p);break;case 4:!function(e){B_g.test(e)||("/"===e?u=12:">"===e?g():"<"===e?f():"="===e||C_g.test(e)||D_g.test(e)?m():u=5)}(p);break;case 5:!function(e){B_g.test(e)?u=6:"/"===e?u=12:"="===e?u=7:">"===e?g():"<"===e?f():C_g.test(e)&&m()}(p);break;case 6:!function(e){B_g.test(e)||("/"===e?u=12:"="===e?u=7:">"===e?g():"<"===e?f():C_g.test(e)?m():u=5)}(p);break;case 7:!function(e){B_g.test(e)||('"'===e?u=8:"'"===e?u=9:/[>=`]/.test(e)?m():"<"===e?f():u=10)}(p);break;case 8:!void('"'===p&&(u=11));break;case 9:!void("'"===p&&(u=11));break;case 10:!function(e){B_g.test(e)?u=4:">"===e?g():"<"===e&&f()}(p);break;case 11:!function(e){B_g.test(e)?u=4:"/"===e?u=12:">"===e?g():"<"===e?f():(u=4,l--)}(p);break;case 12:!void(">"===p?(h=new Z_g(s_g({},h,{isClosing:!0})),g()):u=4);break;case 13:"--"===t.substr(l,2)?(l+=2,h=new Z_g(s_g({},h,{type:"comment"})),u=14):"DOCTYPE"===t.substr(l,7).toUpperCase()?(l+=7,h=new Z_g(s_g({},h,{type:"doctype"})),u=20):m();break;case 14:!function(e){"-"===e?u=15:">"===e?m():u=16}(p);break;case 15:!function(e){"-"===e?u=18:">"===e?m():u=16}(p);break;case 16:!void("-"===p&&(u=17));break;case 17:!void(u="-"===p?18:16);break;case 18:!function(e){">"===e?g():"!"===e?u=19:"-"===e||(u=16)}(p);break;case 19:!function(e){"-"===e?u=17:">"===e?g():u=16}(p);break;case 20:!function(e){">"===e?g():"<"===e&&f()}(p);break;default:j_g(u)}l++}function m(){u=0,h=s}function f(){u=1,h=new Z_g({idx:l})}function g(){var e=t.slice(d,h.idx);e&&n(e,d),"comment"===h.type?a(h.idx):"doctype"===h.type?o(h.idx):(h.isOpening&&i(h.name,h.idx),h.isClosing&&r(h.name,h.idx)),m(),d=l+1}function _(){var e=h.idx+(h.isClosing?2:1);return t.slice(e,l).toLowerCase()}dn?t:t+1,e.splice(n,1)))}return e},i.prototype.removeUnwantedMatches=function(e){return this.hashtag||h_g(e,function(e){return"hashtag"===e.getType()}),this.email||h_g(e,function(e){return"email"===e.getType()}),this.phone||h_g(e,function(e){return"phone"===e.getType()}),this.mention||h_g(e,function(e){return"mention"===e.getType()}),this.urls.schemeMatches||h_g(e,function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()}),this.urls.wwwMatches||h_g(e,function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()}),this.urls.tldMatches||h_g(e,function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()}),e},i.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var i=this.getMatchers(),r=[],n=0,a=i.length;n>>8^t[255&(r^e[i])]},n.get=function(){return~r}}function P(e,t){var i=new ArrayBuffer(e),e=new Uint8Array(i);return t&&e.set(t,0),{buffer:i,array:e,view:new DataView(i)}}function i(){}function r(r){var n,a=this;a.size=0,a.init=function(e,t){var i=new Blob([r],{type:l});(n=new u(i)).init(function(){a.size=n.size,e()},t)},a.readUint8Array=function(e,t,i,r){n.readUint8Array(e,t,i,r)}}function c(c){var u,i=this;i.size=0,i.init=function(e){for(var t=c.length;"="==c.charAt(t-1);)t--;u=c.indexOf(",")+1,i.size=Math.floor(.75*(t-u)),e()},i.readUint8Array=function(e,t,i){for(var r=P(t),n=4*Math.floor(e/3),a=4*Math.ceil((e+t)/3),o=window.atob(c.substring(n+u,a+u)),s=e-3*Math.floor(n/4),l=s;l>16,i=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&i)>>11,(2016&i)>>5,2*(31&i),0)}catch(e){}}(e.lastModDateRaw),1!=(1&e.bitFlag)?(!r&&8==(8&e.bitFlag)||(e.crc32=t.view.getUint32(i+10,!0),e.compressedSize=t.view.getUint32(i+14,!0),e.uncompressedSize=t.view.getUint32(i+18,!0)),4294967295!==e.compressedSize&&4294967295!==e.uncompressedSize?(e.filenameLength=t.view.getUint16(i+22,!0),e.extraFieldLength=t.view.getUint16(i+24,!0)):n(s)):n(o)}function v(T,c){function u(){}return u.prototype.getData=function(m,r,f,g){var _,y=this;function n(e,t){_&&_.terminate(),_=null,e&&e(t)}function C(e,t){var i;g&&(i=t,(t=P(4)).view.setUint32(0,i),y.crc32!=t.view.getUint32(0))?v():m.getData(function(e){n(r,e)})}function v(){n(c,t)}function S(){n(c,"Error while writing file data.")}T.readUint8Array(y.offset,30,function(e){var p,e=P(e.length,e);1347093252==e.view.getUint32(0)?(M(y,e,4,!1,c),p=y.offset+30+y.filenameLength+y.extraFieldLength,m.init(function(){function e(e,t){o&&!e&&h.append(t)}function t(e){s(e,h.get())}var i,r,n,a,o,s,l,c,u,d,h;0===y.compressionMethod?D(T,m,p,y.compressedSize,g,C,f,v,S):(i=T,r=m,n=p,a=y.compressedSize,o=g,s=C,l=f,c=v,u=S,h=new E,x.zip.useWebWorkers?A(d=new Worker(x.zip.workerScriptsPath+b),i,r,n,a,e,l,t,c,u):w(new x.zip.Inflater,i,r,n,a,e,l,t,c,u),_=d)},S)):c(d)},v)},{getEntries:function(l){T.size<22?c(d):function t(i,r){T.readUint8Array(T.size-i,i,function(e){1347093766!=(e=P(e.length,e).view).getUint32(0)?t(i+1,r):r(e)},function(){c(n)})}(22,function(e){var t=e.getUint32(16,!0),s=e.getUint16(8,!0);T.readUint8Array(t,T.size-t,function(e){for(var t,i,r=0,n=[],a=P(e.length,e),o=0;o>>1^3988292384:t>>>=1;i[r]=t}return i}(),(r.prototype=new i).constructor=r,(c.prototype=new i).constructor=c,(u.prototype=new i).constructor=u,h.prototype.getData=function(e){e(this.data)},(p.prototype=new h).constructor=p,(m.prototype=new h).constructor=m,(f.prototype=new h).constructor=f,x.zip={Reader:i,Writer:h,BlobReader:u,Data64URIReader:c,TextReader:r,BlobWriter:f,Data64URIWriter:m,TextWriter:p,createReader:function(e,t,i){e.init(function(){t(v(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(O(e,i,r))},i)},useWebWorkers:!0},Object.defineProperties(x.zip,{workerScriptsPath:{get:function(){return void 0===e&&(e=buildModuleUrl("ThirdParty/Workers/")),e}}})}(tmp$5);var zip=tmp$5.zip;function KmlLookAt(e,t){this.position=e,this.headingPitchRange=t}function KmlTour(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new Event,this.tourEnd=new Event,this.entryStart=new Event,this.entryEnd=new Event,this._activeEntries=[]}function cancelAllEntries(e){for(var t=e.pop();void 0!==t;t=e.pop())t.stop()}function playEntry(e,t,i){var r,n,a=this.playlist[this.playlistIndex];a?(r=playNext.bind(this,e,t,i),this._activeEntries.push(a),this.entryStart.raiseEvent(a),a.blocking?a.play(r,e.scene.camera,t):(n=this,a.play(function(){n.entryEnd.raiseEvent(a);var e=n._activeEntries.indexOf(a);0<=e&&n._activeEntries.splice(e,1)}),r(e,t,i))):defined(i)&&i(!1)}function playNext(e,t,i,r){var n=this.playlist[this.playlistIndex];this.entryEnd.raiseEvent(n,r),r?i(r):(0<=(n=this._activeEntries.indexOf(n))&&this._activeEntries.splice(n,1),this.playlistIndex++,playEntry.call(this,e,t,i))}function KmlTourFlyTo(e,t,i){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=i,this.flyToMode=t}function KmlTourWait(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}KmlTour.prototype.addPlaylistEntry=function(e){this.playlist.push(e)},KmlTour.prototype.play=function(e,t){this.tourStart.raiseEvent();var i=this;playEntry.call(this,e,t,function(e){i.playlistIndex=0,e||cancelAllEntries(i._activeEntries),i.tourEnd.raiseEvent(e)})},KmlTour.prototype.stop=function(){cancelAllEntries(this._activeEntries)},KmlTourFlyTo.prototype.play=function(t,e,i){var r;this.activeCamera=e,defined(t)&&null!==t&&((r=this).activeCallback=function(e){delete r.activeCallback,delete r.activeCamera,t(!defined(e)&&e)});var n=this.getCameraOptions(i);this.view.headingPitchRoll?e.flyTo(n):this.view.headingPitchRange&&(i=new BoundingSphere(this.view.position),e.flyToBoundingSphere(i,n))},KmlTourFlyTo.prototype.stop=function(){defined(this.activeCamera)&&this.activeCamera.cancelFlight(),defined(this.activeCallback)&&this.activeCallback(!0)},KmlTourFlyTo.prototype.getCameraOptions=function(e){var t={duration:this.duration};return defined(this.activeCallback)&&(t.complete=this.activeCallback),"smooth"===this.flyToMode&&(t.easingFunction=EasingFunction$1.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),defined(e)&&(t=combine(t,e)),t},KmlTourWait.prototype.play=function(e){var t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},1e3*this.duration)},KmlTourWait.prototype.stop=function(){clearTimeout(this.timeout),defined(this.activeCallback)&&this.activeCallback(!0)};var MimeTypes={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){e=getExtensionFromUri(e=e.toLowerCase());return MimeTypes[e]}},parser;"undefined"!=typeof DOMParser&&(parser=new DOMParser);var autolinker=new Autolinker({stripPrefix:!1,email:!1,replaceFn:function(e){if(!e.protocolUrlMatch)return!1}}),BILLBOARD_SIZE=32,BILLBOARD_NEAR_DISTANCE=2414016,BILLBOARD_NEAR_RATIO=1,BILLBOARD_FAR_DISTANCE=16093e3,BILLBOARD_FAR_RATIO=.1,kmlNamespaces=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],gxNamespaces=["http://www.google.com/kml/ext/2.2"],atomNamespaces=["http://www.w3.org/2005/Atom"],namespaces={kml:kmlNamespaces,gx:gxNamespaces,atom:atomNamespaces,kmlgx:kmlNamespaces.concat(gxNamespaces)},featureTypes={Document:processDocument$1,Folder:processFolder,Placemark:processPlacemark,NetworkLink:processNetworkLink,GroundOverlay:processGroundOverlay,PhotoOverlay:processUnsupportedFeature,ScreenOverlay:processUnsupportedFeature,Tour:processTour};function DeferredLoading(e){this._dataSource=e,this._deferred=when.defer(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}function isZipFile(e){var e=e.slice(0,Math.min(4,e.size)),t=when.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(1347093252===new DataView(i.result).getUint32(0,!1))}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsArrayBuffer(e),t.promise}function readBlobAsText(e){var t=when.defer(),i=new FileReader;return i.addEventListener("load",function(){t.resolve(i.result)}),i.addEventListener("error",function(){t.reject(i.error)}),i.readAsText(e),t.promise}function insertNamespaces(e){var t,i,r,n,a={xsi:"http://www.w3.org/2001/XMLSchema-instance"};for(n in a)a.hasOwnProperty(n)&&(r="xmlns:"+n+"=",RegExp("[< ]"+n+":").test(e)&&-1===e.indexOf(r)&&(defined(t)||(t=e.substr(0,e.indexOf("",r);-1!==r&&rthis._started+this._timeThreshold))return void this._giveUpTime();r=this._nextNode()}this._pop()&&e&&this._process(!0)};var colorOptions={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function parseColorString(e,t){if(defined(e)&&!/^\s*$/gm.test(e)){"#"===e[0]&&(e=e.substring(1));var i=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,e=parseInt(e.substring(6,8),16)/255;return t?(0:clampToSeaFloor is currently not supported, using :clampToGround."),HeightReference$1.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(oneTimeWarning("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),HeightReference$1.RELATIVE_TO_GROUND):(defined(e)?oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown :"+e+", using :CLAMP_TO_GROUND."):oneTimeWarning("kml-gx:altitudeMode-unknown","KML - Unknown :"+t+", using :CLAMP_TO_GROUND."),HeightReference$1.CLAMP_TO_GROUND)}function createPositionPropertyFromAltitudeMode(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((defined(t)&&"clampToGround"!==t||defined(i)&&"clampToSeaFloor"!==i)&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+defaultValue(t,i)),new ScaledPositionProperty(e))}function createPositionPropertyArrayFromAltitudeMode(e,t,i,r){if(defined(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(defined(t)&&"clampToGround"!==t||defined(i)&&"clampToSeaFloor"!==i)&&oneTimeWarning("kml-altitudeMode-unknown","KML - Unknown altitudeMode: "+defaultValue(t,i));for(var n=e.length,a=0;a',y=0;y"+defaultValue((p=l[a=o[y]]).displayName,a)+""+defaultValue(p.value,"")+"";d+=""}if(defined(d)){d=autolinker.link(d),scratchDiv.innerHTML=d;for(var _=scratchDiv.querySelectorAll("a"),y=0;y<_.length;y++)_[y].setAttribute("target","_blank");defined(r)&&1",scratchDiv.innerHTML="",t.description=n}}function processFeature$1(e,t,i){var r=i.entityCollection,n=i.parentEntity,a=i.sourceResource,o=i.uriResolver,s=createEntity(t,r,i.context),l=s.kml,r=computeFinalStyle(e,t,i.styleCollection,a,o),i=queryStringValue(t,"name",namespaces.kml);s.name=i,s.parent=n;i=processTimeSpan(t);defined(i)||(i=processTimeStamp(t)),s.availability=i,mergeAvailabilityWithParent(s);i=queryBooleanValue(t,"visibility",namespaces.kml);s.show=function e(t){return!t||t.show&&e(t.parent)}(n)&&defaultValue(i,!0);n=queryFirstNode(t,"author",namespaces.atom),i=l.author;i.name=queryStringValue(n,"name",namespaces.atom),i.uri=queryStringValue(n,"uri",namespaces.atom),i.email=queryStringValue(n,"email",namespaces.atom);i=queryFirstNode(t,"link",namespaces.atom),n=l.link;n.href=queryStringAttribute(i,"href"),n.hreflang=queryStringAttribute(i,"hreflang"),n.rel=queryStringAttribute(i,"rel"),n.type=queryStringAttribute(i,"type"),n.title=queryStringAttribute(i,"title"),n.length=queryStringAttribute(i,"length"),l.address=queryStringValue(t,"address",namespaces.kml),l.phoneNumber=queryStringValue(t,"phoneNumber",namespaces.kml),l.snippet=queryStringValue(t,"Snippet",namespaces.kml),processExtendedData(t,s),processDescription$1(t,s,r,o,a);e=e._ellipsoid;return processLookAt(t,s,e),processCamera(t,s,e),defined(queryFirstNode(t,"Region",namespaces.kml))&&oneTimeWarning("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:r}}function processDocument$1(e,t,i,r){r.addNodes(t.childNodes,i),r.process()}function processFolder(e,t,i,r){var n=processFeature$1(e,t,i),i=clone(i);i.parentEntity=n.entity,processDocument$1(e,t,i,r)}function processPlacemark(e,t,i,r){for(var n=processFeature$1(e,t,i),a=n.entity,o=n.styleEntity,s=!1,l=t.childNodes,c=0,u=l.length;cCesiumMath.PI_OVER_TWO?CesiumMath.PI_OVER_TWO:e}function s(e){return e>CesiumMath.PI?e-CesiumMath.TWO_PI:e<-CesiumMath.PI?e+CesiumMath.TWO_PI:e}var l,c,u,d,h=objectToQuery(e.queryParameters);h=h.replace(/%5B/g,"[").replace(/%5D/g,"]"),h=defined(t)&&t._mode!==SceneMode$1.MORPHING?(n=defaultValue(n,zeroRectangle),defined(i)&&(scratchCartesian2$9.x=.5*i.clientWidth,scratchCartesian2$9.y=.5*i.clientHeight,l=t.pickEllipsoid(scratchCartesian2$9,a,scratchCartesian3$a)),defined(l)?d=a.cartesianToCartographic(l,scratchCartographic$9):(d=Rectangle.center(n,scratchCartographic$9),l=a.cartographicToCartesian(d)),defined(r)&&!CesiumMath.equalsEpsilon(r,1,CesiumMath.EPSILON9)&&(c=n.width*r*.5,u=n.height*r*.5,n=new Rectangle(s(d.longitude-c),o(d.latitude-u),s(d.longitude+c),o(d.latitude+u))),h=(h=(h=(h=h.replace("[bboxWest]",CesiumMath.toDegrees(n.west).toString())).replace("[bboxSouth]",CesiumMath.toDegrees(n.south).toString())).replace("[bboxEast]",CesiumMath.toDegrees(n.east).toString())).replace("[bboxNorth]",CesiumMath.toDegrees(n.north).toString()),u=CesiumMath.toDegrees(d.longitude).toString(),n=CesiumMath.toDegrees(d.latitude).toString(),h=(h=(h=(h=(h=(h=(h=(h=h.replace("[lookatLon]",u)).replace("[lookatLat]",n)).replace("[lookatTilt]",CesiumMath.toDegrees(t.pitch).toString())).replace("[lookatHeading]",CesiumMath.toDegrees(t.heading).toString())).replace("[lookatRange]",Cartesian3.distance(t.positionWC,l))).replace("[lookatTerrainLon]",u)).replace("[lookatTerrainLat]",n)).replace("[lookatTerrainAlt]",d.height.toString()),a.cartesianToCartographic(t.positionWC,scratchCartographic$9),h=(h=(h=h.replace("[cameraLon]",CesiumMath.toDegrees(scratchCartographic$9.longitude).toString())).replace("[cameraLat]",CesiumMath.toDegrees(scratchCartographic$9.latitude).toString())).replace("[cameraAlt]",CesiumMath.toDegrees(scratchCartographic$9.height).toString()),d=n="",defined(t=(a=t.frustum).aspectRatio)&&(a=CesiumMath.toDegrees(a.fov),1t.time&&(r=!0):t.refreshMode===RefreshMode.EXPIRE?JulianDate.greaterThan(a,t.time)&&(r=!0):t.refreshMode===RefreshMode.STOP&&(s&&(t.needsUpdate=!0,t.cameraUpdateTime=a),t.needsUpdate&&JulianDate.secondsDifference(a,t.cameraUpdateTime)>=t.time&&(r=!0)),r&&(function e(t){for(var i=t._children,r=i.length,n=0;nt.width?2*Math.tan(.5*r)/t.height:2*Math.tan(.5*r)/t.width:1/Math.max(t.width,t.height);this._geometricToleranceOverMeter=t*e.maximumScreenSpaceError,Color.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};var cameraPositionMC=new Cartesian3;function cleanEncodedCameraPositionMC(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,Matrix4.multiplyByPoint(e.inverseModel,e._cameraPosition,cameraPositionMC),EncodedCartesian3.fromCartesian(cameraPositionMC,e._encodedCameraPositionMC))}var view2Dto3DPScratch=new Cartesian3,view2Dto3DRScratch=new Cartesian3,view2Dto3DUScratch=new Cartesian3,view2Dto3DDScratch=new Cartesian3,view2Dto3DCartographicScratch=new Cartographic,view2Dto3DCartesian3Scratch=new Cartesian3,view2Dto3DMatrix4Scratch=new Matrix4;function view2Dto3D(e,t,i,r,n,a,o,s){var l=view2Dto3DPScratch;l.x=e.y,l.y=e.z,l.z=e.x;e=view2Dto3DRScratch;e.x=i.y,e.y=i.z,e.z=i.x;i=view2Dto3DUScratch;i.x=r.y,i.y=r.z,i.z=r.x;r=view2Dto3DDScratch;r.x=t.y,r.y=t.z,r.z=t.x,a===SceneMode$1.SCENE2D&&(l.z=.5*n);l=o.unproject(l,view2Dto3DCartographicScratch);l.longitude=CesiumMath.clamp(l.longitude,-Math.PI,Math.PI),l.latitude=CesiumMath.clamp(l.latitude,-CesiumMath.PI_OVER_TWO,CesiumMath.PI_OVER_TWO);o=o.ellipsoid,l=o.cartographicToCartesian(l,view2Dto3DCartesian3Scratch),o=Transforms.eastNorthUpToFixedFrame(l,o,view2Dto3DMatrix4Scratch);return Matrix4.multiplyByPointAsVector(o,e,e),Matrix4.multiplyByPointAsVector(o,i,i),Matrix4.multiplyByPointAsVector(o,r,r),defined(s)||(s=new Matrix4),s[0]=e.x,s[1]=i.x,s[2]=-r.x,s[3]=0,s[4]=e.y,s[5]=i.y,s[6]=-r.y,s[7]=0,s[8]=e.z,s[9]=i.z,s[10]=-r.z,s[11]=0,s[12]=-Cartesian3.dot(e,l),s[13]=-Cartesian3.dot(i,l),s[14]=Cartesian3.dot(r,l),s[15]=1,s}function updateView3D(e){e._view3DDirty&&(e._mode===SceneMode$1.SCENE3D?Matrix4.clone(e._view,e._view3D):view2Dto3D(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),Matrix4.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function updateInverseView3D(e){e._inverseView3DDirty&&(Matrix4.inverseTransformation(e.view3D,e._inverseView3D),Matrix4.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}function errorToString(e,t){var i="WebGL Error: ";switch(t){case e.INVALID_ENUM:i+="INVALID_ENUM";break;case e.INVALID_VALUE:i+="INVALID_VALUE";break;case e.INVALID_OPERATION:i+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:i+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:i+="CONTEXT_LOST_WEBGL lost";break;default:i+="Unknown ("+t+")"}return i}function createErrorMessage(e,t,i,r){for(var n=errorToString(e,r)+": "+t.name+"(",a=0;a"+i+""+e(r)+"":""+i+""+r+"");return n+=""}(e)},Object.defineProperties(ImageryProvider.prototype,{ready:{get:DeveloperError.throwInstantiationError},readyPromise:{get:DeveloperError.throwInstantiationError},rectangle:{get:DeveloperError.throwInstantiationError},tileWidth:{get:DeveloperError.throwInstantiationError},tileHeight:{get:DeveloperError.throwInstantiationError},maximumLevel:{get:DeveloperError.throwInstantiationError},minimumLevel:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},tileDiscardPolicy:{get:DeveloperError.throwInstantiationError},errorEvent:{get:DeveloperError.throwInstantiationError},credit:{get:DeveloperError.throwInstantiationError},proxy:{get:DeveloperError.throwInstantiationError},hasAlphaChannel:{get:DeveloperError.throwInstantiationError}}),ImageryProvider.prototype.getTileCredits=function(e,t,i){DeveloperError.throwInstantiationError()},ImageryProvider.prototype.requestImage=function(e,t,i,r){DeveloperError.throwInstantiationError()},ImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){DeveloperError.throwInstantiationError()};var ktxRegex$2=/\.ktx$/i,crnRegex$2=/\.crn$/i;function ArcGisMapServerImageryProvider(n){n=defaultValue(n,defaultValue.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;var e=Resource.createIfNeeded(n.url);e.appendForwardSlash(),defined(n.token)&&e.setQueryParameters({token:n.token}),this._resource=e,this._tileDiscardPolicy=n.tileDiscardPolicy,this._tileWidth=defaultValue(n.tileWidth,256),this._tileHeight=defaultValue(n.tileHeight,256),this._maximumLevel=n.maximumLevel,this._tilingScheme=defaultValue(n.tilingScheme,new GeographicTilingScheme({ellipsoid:n.ellipsoid})),this._useTiles=defaultValue(n.usePreCachedTilesIfAvailable,!0),this._rectangle=defaultValue(n.rectangle,this._tilingScheme.rectangle),this._layers=n.layers;e=n.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e,this.enablePickFeatures=defaultValue(n.enablePickFeatures,!0),this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();var a,o=this;function t(e){var t=e.tileInfo;if(defined(t)){if(o._tileWidth=t.rows,o._tileHeight=t.cols,102100===t.spatialReference.wkid||102113===t.spatialReference.wkid)o._tilingScheme=new WebMercatorTilingScheme({ellipsoid:n.ellipsoid});else{if(4326!==e.tileInfo.spatialReference.wkid){var i="Tile spatial reference WKID "+e.tileInfo.spatialReference.wkid+" is not supported.";return void(a=TileProviderError.handleError(a,o,o._errorEvent,i,void 0,void 0,void 0,s))}o._tilingScheme=new GeographicTilingScheme({ellipsoid:n.ellipsoid})}if(o._maximumLevel=e.tileInfo.lods.length-1,defined(e.fullExtent)){if(defined(e.fullExtent.spatialReference)&&defined(e.fullExtent.spatialReference.wkid))if(102100===e.fullExtent.spatialReference.wkid||102113===e.fullExtent.spatialReference.wkid){var t=new WebMercatorProjection,r=e.fullExtent,i=t.unproject(new Cartesian3(Math.max(r.xmin,-o._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-o._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),r=t.unproject(new Cartesian3(Math.min(r.xmax,o._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,o._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));o._rectangle=new Rectangle(i.longitude,i.latitude,r.longitude,r.latitude)}else{if(4326!==e.fullExtent.spatialReference.wkid){r="fullExtent.spatialReference WKID "+e.fullExtent.spatialReference.wkid+" is not supported.";return void(a=TileProviderError.handleError(a,o,o._errorEvent,r,void 0,void 0,void 0,s))}o._rectangle=Rectangle.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax)}}else o._rectangle=o._tilingScheme.rectangle;defined(o._tileDiscardPolicy)||(o._tileDiscardPolicy=new DiscardMissingTileImagePolicy({missingImageUrl:buildImageResource(o,0,0,o._maximumLevel).url,pixelsToCheck:[new Cartesian2(0,0),new Cartesian2(200,20),new Cartesian2(20,200),new Cartesian2(80,110),new Cartesian2(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),o._useTiles=!0}else o._useTiles=!1;defined(e.copyrightText)&&0'),this._tilingScheme=new WebMercatorTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();e=this._tileProtocol;defined(e)?0=d.zoomMin&&t<=d.zoomMax&&defined(Rectangle.intersection(i,d.bbox,intersectionScratch$1))&&(l=!0)}l&&r.push(o.credit)}return r}BingMapsImageryProvider._metadataCache={};var defaultDimensions=new Cartesian3(1,1,1);function BoxEmitter(e){e=defaultValue(e,defaultDimensions),this._dimensions=Cartesian3.clone(e)}Object.defineProperties(BoxEmitter.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){Cartesian3.clone(e,this._dimensions)}}});var scratchHalfDim=new Cartesian3;BoxEmitter.prototype.emit=function(e){var t=this._dimensions,i=Cartesian3.multiplyByScalar(t,.5,scratchHalfDim),r=CesiumMath.randomBetween(-i.x,i.x),t=CesiumMath.randomBetween(-i.y,i.y),i=CesiumMath.randomBetween(-i.z,i.z);e.position=Cartesian3.fromElements(r,t,i,e.position),e.velocity=Cartesian3.normalize(e.position,e.velocity)};var BrdfLutGeneratorFS="varying vec2 v_textureCoordinates;\nconst float M_PI = 3.141592653589793;\nfloat vdcRadicalInverse(int i)\n{\nfloat r;\nfloat base = 2.0;\nfloat value = 0.0;\nfloat invBase = 1.0 / base;\nfloat invBi = invBase;\nfor (int x = 0; x < 100; x++)\n{\nif (i <= 0)\n{\nbreak;\n}\nr = mod(float(i), base);\nvalue += r * invBi;\ninvBi *= invBase;\ni = int(float(i) * invBase);\n}\nreturn value;\n}\nvec2 hammersley2D(int i, int N)\n{\nreturn vec2(float(i) / float(N), vdcRadicalInverse(i));\n}\nvec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N)\n{\nfloat a = roughness * roughness;\nfloat phi = 2.0 * M_PI * xi.x;\nfloat cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y));\nfloat sinTheta = sqrt(1.0 - cosTheta * cosTheta);\nvec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\nvec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\nvec3 tangentX = normalize(cross(upVector, N));\nvec3 tangentY = cross(N, tangentX);\nreturn tangentX * H.x + tangentY * H.y + N * H.z;\n}\nfloat G1_Smith(float NdotV, float k)\n{\nreturn NdotV / (NdotV * (1.0 - k) + k);\n}\nfloat G_Smith(float roughness, float NdotV, float NdotL)\n{\nfloat k = roughness * roughness / 2.0;\nreturn G1_Smith(NdotV, k) * G1_Smith(NdotL, k);\n}\nvec2 integrateBrdf(float roughness, float NdotV)\n{\nvec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);\nfloat A = 0.0;\nfloat B = 0.0;\nconst int NumSamples = 1024;\nfor (int i = 0; i < NumSamples; i++)\n{\nvec2 xi = hammersley2D(i, NumSamples);\nvec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0));\nvec3 L = 2.0 * dot(V, H) * H - V;\nfloat NdotL = clamp(L.z, 0.0, 1.0);\nfloat NdotH = clamp(H.z, 0.0, 1.0);\nfloat VdotH = clamp(dot(V, H), 0.0, 1.0);\nif (NdotL > 0.0)\n{\nfloat G = G_Smith(roughness, NdotV, NdotL);\nfloat G_Vis = G * VdotH / (NdotH * NdotV);\nfloat Fc = pow(1.0 - VdotH, 5.0);\nA += (1.0 - Fc) * G_Vis;\nB += Fc * G_Vis;\n}\n}\nreturn vec2(A, B) / float(NumSamples);\n}\nvoid main()\n{\ngl_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);\n}\n";function BrdfLutGenerator(){this._framebuffer=void 0,this._colorTexture=void 0,this._drawCommand=void 0}function createCommand$1(e,t){var i=e._framebuffer,i=t.createViewportQuadCommand(BrdfLutGeneratorFS,{framebuffer:i,renderState:RenderState.fromCache({viewport:new BoundingRectangle(0,0,256,256)})});e._drawCommand=i}function createFramebuffer$2(e,t){var i=new Texture({context:t,width:256,height:256,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),i=new Framebuffer({context:t,colorTextures:[e._colorTexture=i],destroyAttachments:!1});e._framebuffer=i}Object.defineProperties(BrdfLutGenerator.prototype,{colorTexture:{get:function(){return this._colorTexture}}}),BrdfLutGenerator.prototype.update=function(e){defined(this._colorTexture)||(createFramebuffer$2(this,e=e.context),createCommand$1(this,e),this._drawCommand.execute(e),this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy())},BrdfLutGenerator.prototype.isDestroyed=function(){return!1},BrdfLutGenerator.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),destroyObject(this)};var CameraFlightPath={};function getAltitude(e,t,i){if(e instanceof PerspectiveFrustum){var r=Math.tan(.5*e.fovy),n=e.near,a=e.near*r,r=e.aspectRatio*a;return Math.max(t*n/r,i*n/a)}return e instanceof PerspectiveOffCenterFrustum?(n=e.near,a=e.top,r=e.right,Math.max(t*n/r,i*n/a)):Math.max(t,i)}var scratchCart=new Cartesian3,scratchCart2$2=new Cartesian3;function createPitchFunction(i,r,n,e){if(defined(e)&&n(.5)>e){var a=n(0),o=n(1),e=n(.5),s=e-a,l=e-o;return function(e){var t=n(e);if(e<=.5){e=(t-a)/s;return CesiumMath.lerp(i,-CesiumMath.PI_OVER_TWO,e)}t=(t-o)/l;return CesiumMath.lerp(-CesiumMath.PI_OVER_TWO,r,1-t)}}return function(e){return CesiumMath.lerp(i,r,e)}}function createHeightFunction(e,t,i,r,n){var a,o,s=n,l=Math.max(i,r);if(defined(s)||(a=e.position,o=e.up,n=e.right,e=e.frustum,t=Cartesian3.subtract(a,t,scratchCart),o=Cartesian3.magnitude(Cartesian3.multiplyByScalar(o,Cartesian3.dot(t,o),scratchCart2$2)),n=Cartesian3.magnitude(Cartesian3.multiplyByScalar(n,Cartesian3.dot(t,n),scratchCart2$2)),s=Math.min(.2*getAltitude(e,o,n),1e9)),le+Math.PI?e+=CesiumMath.TWO_PI:tCesiumMath.PI&&(t.longitude+=CesiumMath.TWO_PI)}var scratchStartCart=new Cartographic,scratchEndCart=new Cartographic;function createUpdate3D(e,i,t,r,n,a,o,s,l,c){var u=e.camera,d=e.mapProjection.ellipsoid,h=Cartographic.clone(u.positionCartographic,scratchStartCart),p=u.pitch,m=adjustAngleForLERP(u.heading,r),f=adjustAngleForLERP(u.roll,a),g=d.cartesianToCartographic(t,scratchEndCart);h.longitude=CesiumMath.zeroToTwoPi(h.longitude),g.longitude=CesiumMath.zeroToTwoPi(g.longitude);var _=!1;defined(s)&&(e=CesiumMath.zeroToTwoPi(s),d=Math.min(h.longitude,g.longitude),s=Math.max(h.longitude,g.longitude),d=d<=e&&e<=s,defined(l)?(e=Math.abs(h.longitude-g.longitude),s=CesiumMath.TWO_PI-e,(d?e:s)<(d?s:e)*l&&!d&&(_=!0)):d||(_=!0)),(_?useLongestFlight:useShortestFlight)(h,g);var y,C,v,S,T=createHeightFunction(u,t,h.height,g.height,o),x=createPitchFunction(p,n,T,c);return y=h.longitude,C=g.longitude,v=h.latitude,S=g.latitude,function(e){var t=e.time/i,e=Cartesian3.fromRadians(CesiumMath.lerp(y,C,t),CesiumMath.lerp(v,S,t),T(t));u.setView({destination:e,orientation:{heading:CesiumMath.lerp(m,r,t),pitch:x(t),roll:CesiumMath.lerp(f,a,t)}})}}function createUpdate2D(e,r,n,a,t,i,o){var s=e.camera,l=Cartesian3.clone(s.position,scratchStart),c=adjustAngleForLERP(s.heading,a),e=s.frustum.right-s.frustum.left,u=createHeightFunction(s,n,e,n.z,o);return function(e){var t=e.time/r;s.setView({orientation:{heading:CesiumMath.lerp(c,a,t)}}),Cartesian2.lerp(l,n,t,s.position);var i=u(t),t=(e=s.frustum).top/e.right,i=.5*(i-(e.right-e.left));e.right+=i,e.left-=i,e.top=t*e.right,e.bottom=-e.top}}var scratchCartographic$b=new Cartographic,scratchDestination=new Cartesian3;function emptyFlight(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function wrapCallback(e,t){return function(){"function"==typeof t&&t(),e.enableInputs=!0}}CameraFlightPath.createTween=function(e,t){var i=(t=defaultValue(t,defaultValue.EMPTY_OBJECT)).destination,r=e.mode;if(r===SceneMode$1.MORPHING)return emptyFlight();var n=defaultValue(t.convert,!0),a=e.mapProjection,o=a.ellipsoid,s=t.maximumHeight,l=t.flyOverLongitude,c=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,d=t.easingFunction;n&&r!==SceneMode$1.SCENE3D&&(o.cartesianToCartographic(i,scratchCartographic$b),i=a.project(scratchCartographic$b,scratchDestination));var h=e.camera,p=t.endTransform;defined(p)&&h._setTransform(p);n=t.duration;defined(n)||(n=Math.ceil(Cartesian3.distance(h.position,i)/1e6)+2,n=Math.min(n,3));var m=defaultValue(t.heading,0),f=defaultValue(t.pitch,-CesiumMath.PI_OVER_TWO),g=defaultValue(t.roll,0),a=e.screenSpaceCameraController;a.enableInputs=!1;var _=wrapCallback(a,t.complete),p=wrapCallback(a,t.cancel),a=h.frustum,t=e.mode===SceneMode$1.SCENE2D;if(t=(t=(t=(t=t&&Cartesian2.equalsEpsilon(h.position,i,CesiumMath.EPSILON6))&&CesiumMath.equalsEpsilon(Math.max(a.right-a.left,a.top-a.bottom),i.z,CesiumMath.EPSILON6))||e.mode!==SceneMode$1.SCENE2D&&Cartesian3.equalsEpsilon(i,h.position,CesiumMath.EPSILON10))&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(m),CesiumMath.negativePiToPi(h.heading),CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(f),CesiumMath.negativePiToPi(h.pitch),CesiumMath.EPSILON10)&&CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(g),CesiumMath.negativePiToPi(h.roll),CesiumMath.EPSILON10))return emptyFlight(_,p);var y=new Array(4);if(y[SceneMode$1.SCENE2D]=createUpdate2D,y[SceneMode$1.SCENE3D]=createUpdate3D,y[SceneMode$1.COLUMBUS_VIEW]=createUpdateCV,n<=0)return emptyFlight(function(){y[r](e,1,i,m,f,g,s,l,c,u)({time:1}),"function"==typeof _&&_()},p);t=y[r](e,n,i,m,f,g,s,l,c,u);return defined(d)||(h=h.positionCartographic.height,d=(r===SceneMode$1.SCENE3D?o.cartesianToCartographic(i).height:i.z)CesiumMath.EPSILON10?Cartesian3.cross(s,c,l):(r=Cartesian4.add(Matrix4.getColumn(e._transform,1,scratchCartesian3$c),r,scratchCartesian3$c),i.cartesianToCartographic(r,n),t.project(n,a),l.x=a.z,l.y=a.x,l.z=a.y,l.w=0,Cartesian3.subtract(l,o,l),l.x=0,Cartesian3.magnitudeSquared(l)CesiumMath.EPSILON2&&(p=1/Cartesian3.magnitudeSquared(l),p=Cartesian3.dot(l,o)*p,p=Cartesian3.multiplyByScalar(o,p,scratchCartesian$8),l=Cartesian3.normalize(Cartesian3.subtract(l,p,e._up),e._up),Cartesian3.clone(l,e.up),u=Cartesian3.cross(o,l,e._right),Cartesian3.clone(u,e.right))),(s||h)&&(e._directionWC=Matrix4.multiplyByPointAsVector(i,o,e._directionWC),Cartesian3.normalize(e._directionWC,e._directionWC)),(c||h)&&(e._upWC=Matrix4.multiplyByPointAsVector(i,l,e._upWC),Cartesian3.normalize(e._upWC,e._upWC)),(d||h)&&(e._rightWC=Matrix4.multiplyByPointAsVector(i,u,e._rightWC),Cartesian3.normalize(e._rightWC,e._rightWC)),(a||s||c||d||h)&&updateViewMatrix(e)}function getHeading(e,t){e=CesiumMath.equalsEpsilon(Math.abs(e.z),1,CesiumMath.EPSILON3)?Math.atan2(t.y,t.x)-CesiumMath.PI_OVER_TWO:Math.atan2(e.y,e.x)-CesiumMath.PI_OVER_TWO;return CesiumMath.TWO_PI-CesiumMath.zeroToTwoPi(e)}function getPitch(e){return CesiumMath.PI_OVER_TWO-CesiumMath.acosClamped(e.z)}function getRoll(e,t,i){var r=0;return CesiumMath.equalsEpsilon(Math.abs(e.z),1,CesiumMath.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=CesiumMath.zeroToTwoPi(r+CesiumMath.TWO_PI)),r}var scratchHPRMatrix1=new Matrix4,scratchHPRMatrix2=new Matrix4;Object.defineProperties(Camera.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return updateMembers(this),this._invTransform}},viewMatrix:{get:function(){return updateMembers(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return updateMembers(this),this._invViewMatrix}},positionCartographic:{get:function(){return updateMembers(this),this._positionCartographic}},positionWC:{get:function(){return updateMembers(this),this._positionWC}},directionWC:{get:function(){return updateMembers(this),this._directionWC}},upWC:{get:function(){return updateMembers(this),this._upWC}},rightWC:{get:function(){return updateMembers(this),this._rightWC}},heading:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),e=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(e);e=getHeading(this.direction,this.up);return this._setTransform(t),e}}},pitch:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),e=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(e);e=getPitch(this.direction);return this._setTransform(t),e}}},roll:{get:function(){if(this._mode!==SceneMode$1.MORPHING){var e=this._projection.ellipsoid,t=Matrix4.clone(this._transform,scratchHPRMatrix1),e=Transforms.eastNorthUpToFixedFrame(this.positionWC,e,scratchHPRMatrix2);this._setTransform(e);e=getRoll(this.direction,this.up,this.right);return this._setTransform(t),e}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),Camera.prototype.update=function(e){var t=!1;e!==this._mode&&(this._mode=e,this._modeChanged=e!==SceneMode$1.MORPHING,t=this._mode===SceneMode$1.SCENE2D),t&&(t=(e=this._max2Dfrustum=this.frustum.clone()).top/e.right,e.right=2*this._maxCoord.x,e.left=-e.right,e.top=t*e.right,e.bottom=-e.top),this._mode===SceneMode$1.SCENE2D&&clampMove2D(this,this.position)};var setTransformPosition=new Cartesian3,setTransformUp=new Cartesian3,setTransformDirection=new Cartesian3;Camera.prototype._setTransform=function(e){var t=Cartesian3.clone(this.positionWC,setTransformPosition),i=Cartesian3.clone(this.upWC,setTransformUp),r=Cartesian3.clone(this.directionWC,setTransformDirection);Matrix4.clone(e,this._transform),this._transformChanged=!0,updateMembers(this);e=this._actualInvTransform;Matrix4.multiplyByPoint(e,t,this.position),Matrix4.multiplyByPointAsVector(e,r,this.direction),Matrix4.multiplyByPointAsVector(e,i,this.up),Cartesian3.cross(this.direction,this.up,this.right),updateMembers(this)};var scratchAdjustOrthographicFrustumMousePosition=new Cartesian2,scratchPickRay=new Ray,scratchRayIntersection=new Cartesian3,scratchDepthIntersection=new Cartesian3;function calculateOrthographicFrustumWidth(e){if(!Matrix4.equals(Matrix4.IDENTITY,e.transform))return Cartesian3.magnitude(e.position);var t,i,r=e._scene,n=r.globe,a=scratchAdjustOrthographicFrustumMousePosition;return a.x=r.drawingBufferWidth/2,a.y=r.drawingBufferHeight/2,defined(n)&&(i=e.getPickRay(a,scratchPickRay),i=n.pickWorldCoordinates(i,r,!0,scratchRayIntersection)),r.pickPositionSupported&&(t=r.pickPositionWorldCoordinates(a,scratchDepthIntersection)),defined(i)||defined(t)?(t=defined(t)?Cartesian3.distance(t,e.positionWC):Number.POSITIVE_INFINITY,i=defined(i)?Cartesian3.distance(i,e.positionWC):Number.POSITIVE_INFINITY,Math.min(t,i)):Math.max(e.positionCartographic.height,0)}Camera.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof OrthographicFrustum&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=calculateOrthographicFrustumWidth(this)))};var scratchSetViewCartesian=new Cartesian3,scratchSetViewTransform1=new Matrix4,scratchSetViewTransform2=new Matrix4,scratchSetViewQuaternion=new Quaternion,scratchSetViewMatrix3=new Matrix3,scratchSetViewCartographic=new Cartographic;function setView3D(e,t,i){var r=Matrix4.clone(e.transform,scratchSetViewTransform1),t=Transforms.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,scratchSetViewTransform2);e._setTransform(t),Cartesian3.clone(Cartesian3.ZERO,e.position),i.heading=i.heading-CesiumMath.PI_OVER_TWO;i=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion),i=Matrix3.fromQuaternion(i,scratchSetViewMatrix3);Matrix3.getColumn(i,0,e.direction),Matrix3.getColumn(i,2,e.up),Cartesian3.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function setViewCV(e,t,i,r){var n,a=Matrix4.clone(e.transform,scratchSetViewTransform1);e._setTransform(Matrix4.IDENTITY),Cartesian3.equals(t,e.positionWC)||(r&&(r=(n=e._projection).ellipsoid.cartesianToCartographic(t,scratchSetViewCartographic),t=n.project(r,scratchSetViewCartesian)),Cartesian3.clone(t,e.position)),i.heading=i.heading-CesiumMath.PI_OVER_TWO;i=Quaternion.fromHeadingPitchRoll(i,scratchSetViewQuaternion),i=Matrix3.fromQuaternion(i,scratchSetViewMatrix3);Matrix3.getColumn(i,0,e.direction),Matrix3.getColumn(i,2,e.up),Cartesian3.cross(e.direction,e.up,e.right),e._setTransform(a),e._adjustOrthographicFrustum(!0)}function setView2D(e,t,i,r){var n,a,o=Matrix4.clone(e.transform,scratchSetViewTransform1);e._setTransform(Matrix4.IDENTITY),Cartesian3.equals(t,e.positionWC)||(r&&(a=(n=e._projection).ellipsoid.cartesianToCartographic(t,scratchSetViewCartographic),t=n.project(a,scratchSetViewCartesian)),Cartesian2.clone(t,e.position),n=-(r=.5*-t.z),a=e.frustum,rn&&(t.x=i),t.x<-n&&(t.x=r),t.y>e&&(t.y=e),t.y<-e&&(t.y=-e)}Camera.prototype.flyHome=function(e){var t,i,r=this._mode;r===SceneMode$1.MORPHING&&this._scene.completeMorph(),r===SceneMode$1.SCENE2D?this.flyTo({destination:Camera.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:Matrix4.IDENTITY}):r===SceneMode$1.SCENE3D?(i=this.getRectangleCameraCoordinates(Camera.DEFAULT_VIEW_RECTANGLE),t=Cartesian3.magnitude(i),t+=t*Camera.DEFAULT_VIEW_FACTOR,Cartesian3.normalize(i,i),Cartesian3.multiplyByScalar(i,t,i),this.flyTo({destination:i,duration:e,endTransform:Matrix4.IDENTITY})):r===SceneMode$1.COLUMBUS_VIEW&&(i=this._projection.ellipsoid.maximumRadius,r=new Cartesian3(0,-1,1),r=Cartesian3.multiplyByScalar(Cartesian3.normalize(r,r),5*i,r),this.flyTo({destination:r,duration:e,orientation:{heading:0,pitch:-Math.acos(Cartesian3.normalize(r,pitchScratch).z),roll:0},endTransform:Matrix4.IDENTITY,convert:!1}))},Camera.prototype.worldToCameraCoordinates=function(e,t){return defined(t)||(t=new Cartesian4),updateMembers(this),Matrix4.multiplyByVector(this._actualInvTransform,e,t)},Camera.prototype.worldToCameraCoordinatesPoint=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPoint(this._actualInvTransform,e,t)},Camera.prototype.worldToCameraCoordinatesVector=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPointAsVector(this._actualInvTransform,e,t)},Camera.prototype.cameraToWorldCoordinates=function(e,t){return defined(t)||(t=new Cartesian4),updateMembers(this),Matrix4.multiplyByVector(this._actualTransform,e,t)},Camera.prototype.cameraToWorldCoordinatesPoint=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPoint(this._actualTransform,e,t)},Camera.prototype.cameraToWorldCoordinatesVector=function(e,t){return defined(t)||(t=new Cartesian3),updateMembers(this),Matrix4.multiplyByPointAsVector(this._actualTransform,e,t)};var moveScratch=new Cartesian3;Camera.prototype.move=function(e,t){var i=this.position;Cartesian3.multiplyByScalar(e,t,moveScratch),Cartesian3.add(i,moveScratch,i),this._mode===SceneMode$1.SCENE2D&&clampMove2D(this,i),this._adjustOrthographicFrustum(!0)},Camera.prototype.moveForward=function(e){e=defaultValue(e,this.defaultMoveAmount),this._mode===SceneMode$1.SCENE2D?zoom2D(this,e):this.move(this.direction,e)},Camera.prototype.moveBackward=function(e){e=defaultValue(e,this.defaultMoveAmount),this._mode===SceneMode$1.SCENE2D?zoom2D(this,-e):this.move(this.direction,-e)},Camera.prototype.moveUp=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.up,e)},Camera.prototype.moveDown=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.up,-e)},Camera.prototype.moveRight=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.right,e)},Camera.prototype.moveLeft=function(e){e=defaultValue(e,this.defaultMoveAmount),this.move(this.right,-e)},Camera.prototype.lookLeft=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.up,-e)},Camera.prototype.lookRight=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.up,e)},Camera.prototype.lookUp=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.right,-e)},Camera.prototype.lookDown=function(e){e=defaultValue(e,this.defaultLookAmount),this._mode!==SceneMode$1.SCENE2D&&this.look(this.right,e)};var lookScratchQuaternion=new Quaternion,lookScratchMatrix=new Matrix3;Camera.prototype.look=function(e,t){var i=defaultValue(t,this.defaultLookAmount),r=Quaternion.fromAxisAngle(e,-i,lookScratchQuaternion),t=Matrix3.fromQuaternion(r,lookScratchMatrix),e=this.direction,i=this.up,r=this.right;Matrix3.multiplyByVector(t,e,e),Matrix3.multiplyByVector(t,i,i),Matrix3.multiplyByVector(t,r,r)},Camera.prototype.twistLeft=function(e){e=defaultValue(e,this.defaultLookAmount),this.look(this.direction,e)},Camera.prototype.twistRight=function(e){e=defaultValue(e,this.defaultLookAmount),this.look(this.direction,-e)};var rotateScratchQuaternion=new Quaternion,rotateScratchMatrix=new Matrix3;Camera.prototype.rotate=function(e,t){t=defaultValue(t,this.defaultRotateAmount),t=Quaternion.fromAxisAngle(e,-t,rotateScratchQuaternion),t=Matrix3.fromQuaternion(t,rotateScratchMatrix);Matrix3.multiplyByVector(t,this.position,this.position),Matrix3.multiplyByVector(t,this.direction,this.direction),Matrix3.multiplyByVector(t,this.up,this.up),Cartesian3.cross(this.direction,this.up,this.right),Cartesian3.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},Camera.prototype.rotateDown=function(e){rotateVertical(this,e=defaultValue(e,this.defaultRotateAmount))},Camera.prototype.rotateUp=function(e){rotateVertical(this,-(e=defaultValue(e,this.defaultRotateAmount)))};var rotateVertScratchP=new Cartesian3,rotateVertScratchA=new Cartesian3,rotateVertScratchTan=new Cartesian3,rotateVertScratchNegate=new Cartesian3;function rotateVertical(e,t){var i,r,n,a=e.position;defined(e.constrainedAxis)&&!Cartesian3.equalsEpsilon(e.position,Cartesian3.ZERO,CesiumMath.EPSILON2)?(n=Cartesian3.normalize(a,rotateVertScratchP),i=Cartesian3.equalsEpsilon(n,e.constrainedAxis,CesiumMath.EPSILON2),r=Cartesian3.equalsEpsilon(n,Cartesian3.negate(e.constrainedAxis,rotateVertScratchNegate),CesiumMath.EPSILON2),i||r?(i&&t<0||r&&0Math.abs(a.left)+Math.abs(a.right)?(r=a.top-t,n=a.bottom+t,i=e._maxCoord.y,e._scene.mapMode2D===MapMode2D$1.ROTATE&&(i*=e.maximumZoomFactor),iCesiumMath.PI_OVER_TWO-CesiumMath.RADIANS_PER_DEGREE?0:((y=viewRectangle3DCartographic1).longitude=u,y.latitude=o,y.height=0,(C=viewRectangle3DCartographic2).longitude=u,C.latitude=s,C.height=0,defined(v=viewRectangle3DEllipsoidGeodesic)&&v.ellipsoid===n||(viewRectangle3DEllipsoidGeodesic=v=new EllipsoidGeodesic(void 0,void 0,n)),v.setEndPoints(y,C),v.interpolateUsingFraction(.5,viewRectangle3DCartographic1).latitude),h=viewRectangle3DCartographic1;h.longitude=u,h.latitude=d,h.height=0;var p=n.cartographicToCartesian(h,viewRectangle3DCenter),m=viewRectangle3DCartographic1;m.longitude=l,m.latitude=o;var f=n.cartographicToCartesian(m,viewRectangle3DNorthEast);m.longitude=c;var g=n.cartographicToCartesian(m,viewRectangle3DNorthWest);m.longitude=u;var _=n.cartographicToCartesian(m,viewRectangle3DNorthCenter);m.latitude=s;r=n.cartographicToCartesian(m,viewRectangle3DSouthCenter);m.longitude=l;t=n.cartographicToCartesian(m,viewRectangle3DSouthEast);m.longitude=c;var y=n.cartographicToCartesian(m,viewRectangle3DSouthWest);Cartesian3.subtract(g,p,g),Cartesian3.subtract(t,p,t),Cartesian3.subtract(f,p,f),Cartesian3.subtract(y,p,y),Cartesian3.subtract(_,p,_),Cartesian3.subtract(r,p,r);var C=n.geodeticSurfaceNormal(p,a.direction);Cartesian3.negate(C,C);var v=Cartesian3.cross(C,Cartesian3.UNIT_Z,a.right);Cartesian3.normalize(v,v);var S,T,d=Cartesian3.cross(v,C,a.up);return e.frustum instanceof OrthographicFrustum?(h=Math.max(Cartesian3.distance(f,g),Cartesian3.distance(t,y)),(a=(u=Math.max(Cartesian3.distance(f,t),Cartesian3.distance(g,y)))*(m=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top))t.east&&(t=Rectangle.MAX_VALUE);var n=e._actualTransform,a=e._actualInvTransform,o=viewRectangleCVCartographic;o.longitude=t.east,o.latitude=t.north;var s=r.project(o,viewRectangleCVNorthEast);Matrix4.multiplyByPoint(n,s,s),Matrix4.multiplyByPoint(a,s,s),o.longitude=t.west,o.latitude=t.south;var l,o=r.project(o,viewRectangleCVSouthWest);return Matrix4.multiplyByPoint(n,o,o),Matrix4.multiplyByPoint(a,o,o),i.x=.5*(s.x-o.x)+o.x,i.y=.5*(s.y-o.y)+o.y,defined(e.frustum.fovy)?(l=Math.tan(.5*e.frustum.fovy),e=e.frustum.aspectRatio*l,i.z=.5*Math.max((s.x-o.x)/e,(s.y-o.y)/l)):(l=s.x-o.x,o=s.y-o.y,i.z=Math.max(l,o)),i}var viewRectangle2DCartographic=new Cartographic,viewRectangle2DNorthEast=new Cartesian3,viewRectangle2DSouthWest=new Cartesian3;function rectangleCameraPosition2D(e,t,i){var r=e._projection,n=t.east;t.west>t.east&&(e._scene.mapMode2D===MapMode2D$1.INFINITE_SCROLL?n+=CesiumMath.TWO_PI:n=(t=Rectangle.MAX_VALUE).east);var a=viewRectangle2DCartographic;a.longitude=n,a.latitude=t.north;var o=r.project(a,viewRectangle2DNorthEast);a.longitude=t.west,a.latitude=t.south;var s,l,c=r.project(a,viewRectangle2DSouthWest),u=.5*Math.abs(o.x-c.x),n=.5*Math.abs(o.y-c.y),t=e.frustum.right/e.frustum.top,e=n*t;return eCesiumMath.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(t,r)}var pickEllipsoidCVRay=new Ray;function pickMapColumbusView(e,t,i,r){e=e.getPickRay(t,pickEllipsoidCVRay),t=-e.origin.x/e.direction.x;Ray.getPoint(e,t,r);t=i.unproject(new Cartesian3(r.y,r.z,0));if(!(t.latitude<-CesiumMath.PI_OVER_TWO||t.latitude>CesiumMath.PI_OVER_TWO||t.longitude<-Math.PI||t.longitude>Math.PI))return i.ellipsoid.cartographicToCartesian(t,r)}Camera.prototype.pickEllipsoid=function(e,t,i){var r=this._scene.canvas;if(0!==r.clientWidth&&0!==r.clientHeight){if(defined(i)||(i=new Cartesian3),t=defaultValue(t,Ellipsoid.WGS84),this._mode===SceneMode$1.SCENE3D)i=pickEllipsoid3D(this,e,t,i);else if(this._mode===SceneMode$1.SCENE2D)i=pickMap2D(this,e,this._projection,i);else{if(this._mode!==SceneMode$1.COLUMBUS_VIEW)return;i=pickMapColumbusView(this,e,this._projection,i)}return i}};var pickPerspCenter=new Cartesian3,pickPerspXDir=new Cartesian3,pickPerspYDir=new Cartesian3;function getPickRayPerspective(e,t,i){var r=e._scene.canvas,n=r.clientWidth,a=r.clientHeight,o=Math.tan(.5*e.frustum.fovy),s=e.frustum.aspectRatio*o,l=e.frustum.near,r=2/n*t.x-1,n=2/a*(a-t.y)-1,a=e.positionWC;Cartesian3.clone(a,i.origin);t=Cartesian3.multiplyByScalar(e.directionWC,l,pickPerspCenter);Cartesian3.add(a,t,t);s=Cartesian3.multiplyByScalar(e.rightWC,r*l*s,pickPerspXDir),o=Cartesian3.multiplyByScalar(e.upWC,n*l*o,pickPerspYDir),s=Cartesian3.add(t,s,i.direction);return Cartesian3.add(s,o,s),Cartesian3.subtract(s,a,s),Cartesian3.normalize(s,s),i}var scratchDirection$1=new Cartesian3;function getPickRayOrthographic(e,t,i){var r=e._scene.canvas,n=r.clientWidth,a=r.clientHeight,r=e.frustum;defined(r._offCenterFrustum)&&(r=r._offCenterFrustum);n=2/n*t.x-1;n*=.5*(r.right-r.left);t=2/a*(a-t.y)-1;t*=.5*(r.top-r.bottom);r=i.origin;return Cartesian3.clone(e.position,r),Cartesian3.multiplyByScalar(e.right,n,scratchDirection$1),Cartesian3.add(scratchDirection$1,r,r),Cartesian3.multiplyByScalar(e.up,t,scratchDirection$1),Cartesian3.add(scratchDirection$1,r,r),Cartesian3.clone(e.directionWC,i.direction),e._mode!==SceneMode$1.COLUMBUS_VIEW&&e._mode!==SceneMode$1.SCENE2D||Cartesian3.fromElements(i.origin.z,i.origin.x,i.origin.y,i.origin),i}Camera.prototype.getPickRay=function(e,t){defined(t)||(t=new Ray);var i=this.frustum;return(defined(i.aspectRatio)&&defined(i.fov)&&defined(i.near)?getPickRayPerspective:getPickRayOrthographic)(this,e,t)};var scratchToCenter$1=new Cartesian3,scratchProj=new Cartesian3;Camera.prototype.distanceToBoundingSphere=function(e){var t=Cartesian3.subtract(this.positionWC,e.center,scratchToCenter$1),t=Cartesian3.multiplyByScalar(this.directionWC,Cartesian3.dot(t,this.directionWC),scratchProj);return Math.max(0,Cartesian3.magnitude(t)-e.radius)};var scratchPixelSize=new Cartesian2;function createAnimationTemplateCV(t,i,e,r,n,a){var o=Cartesian3.clone(i);return e.y>r?o.y-=e.y-r:e.y<-r&&(o.y+=-r-e.y),e.z>n?o.z-=e.z-n:e.z<-n&&(o.z+=-n-e.z),{easingFunction:EasingFunction$1.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:function(e){e=Cartesian3.lerp(i,o,e.time,new Cartesian3),t.worldToCameraCoordinatesPoint(e,t.position)}}}Camera.prototype.getPixelSize=function(e,t,i){e=this.distanceToBoundingSphere(e),e=this.frustum.getPixelDimensions(t,i,e,this._scene.pixelRatio,scratchPixelSize);return Math.max(e.x,e.y)};var normalScratch$4=new Cartesian3,centerScratch$4=new Cartesian3,posScratch=new Cartesian3,scratchCartesian3Subtract=new Cartesian3;function createAnimationCV(e,t){var i=e.position,r=e.direction,n=e.worldToCameraCoordinatesVector(Cartesian3.UNIT_X,normalScratch$4),a=-Cartesian3.dot(n,i)/Cartesian3.dot(n,r),o=Cartesian3.add(i,Cartesian3.multiplyByScalar(r,a,centerScratch$4),centerScratch$4);e.cameraToWorldCoordinatesPoint(o,o),i=e.cameraToWorldCoordinatesPoint(e.position,posScratch);var s=Math.tan(.5*e.frustum.fovy),n=e.frustum.aspectRatio*s,r=Cartesian3.magnitude(Cartesian3.subtract(i,o,scratchCartesian3Subtract)),a=n*r,n=s*r,s=e._maxCoord.x,r=e._maxCoord.y,a=Math.max(a-s,s),s=Math.max(n-r,r);if(i.z<-a||i.z>a||i.y<-s||i.y>s){n=o.y<-a||o.y>a,r=o.z<-s||o.z>s;if(n||r)return createAnimationTemplateCV(e,i,o,a,s,t)}}Camera.prototype.createCorrectPositionTween=function(e){if(this._mode===SceneMode$1.COLUMBUS_VIEW)return createAnimationCV(this,e)};var scratchFlyToDestination=new Cartesian3,newOptions={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};function distanceToBoundingSphere3D(e,t){var i=e.frustum,e=Math.tan(.5*i.fovy),i=i.aspectRatio*e;return Math.max(t/i,t/e)}function distanceToBoundingSphere2D(e,t){var i,r,n=e.frustum;defined(n._offCenterFrustum)&&(n=n._offCenterFrustum);e=n.right/n.top,n=t*e;return nCesiumMath.PI?o+=CesiumMath.TWO_PI-u:o+=u,s=c}return CesiumMath.equalsEpsilon(Math.abs(o),CesiumMath.TWO_PI,CesiumMath.EPSILON9)&&(t.west=-CesiumMath.PI,t.east=CesiumMath.PI,0<=cartoArray[0].latitude?t.north=CesiumMath.PI_OVER_TWO:t.south=-CesiumMath.PI_OVER_TWO),t}},Camera.prototype.switchToPerspectiveFrustum=function(){var e;this._mode===SceneMode$1.SCENE2D||this.frustum instanceof PerspectiveFrustum||(e=this._scene,this.frustum=new PerspectiveFrustum,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=CesiumMath.toRadians(60))},Camera.prototype.switchToOrthographicFrustum=function(){var e,t;this._mode===SceneMode$1.SCENE2D||this.frustum instanceof OrthographicFrustum||(e=calculateOrthographicFrustumWidth(this),t=this._scene,this.frustum=new OrthographicFrustum,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e)},Camera.clone=function(e,t){return defined(t)||(t=new Camera(e._scene)),Cartesian3.clone(e.position,t.position),Cartesian3.clone(e.direction,t.direction),Cartesian3.clone(e.up,t.up),Cartesian3.clone(e.right,t.right),Matrix4.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var CameraEventType={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},CameraEventType$1=Object.freeze(CameraEventType);function getKey(e,t){return defined(t)&&(e+="+"+t),e}function clonePinchMovement(e,t){Cartesian2.clone(e.distance.startPosition,t.distance.startPosition),Cartesian2.clone(e.distance.endPosition,t.distance.endPosition),Cartesian2.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),Cartesian2.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function listenToPinch(t,e,n){var a=getKey(CameraEventType$1.PINCH,e),o=t._update,s=t._isDown,i=t._eventStartPosition,r=t._pressTime,l=t._releaseTime;o[a]=!0,s[a]=!1,i[a]=new Cartesian2;var c=t._movement[a];defined(c)||(c=t._movement[a]={}),c.distance={startPosition:new Cartesian2,endPosition:new Cartesian2},c.angleAndHeight={startPosition:new Cartesian2,endPosition:new Cartesian2},c.prevAngle=0,t._eventHandler.setInputAction(function(e){t._buttonsDown++,s[a]=!0,r[a]=new Date,Cartesian2.lerp(e.position1,e.position2,.5,i[a])},ScreenSpaceEventType$1.PINCH_START,e),t._eventHandler.setInputAction(function(){t._buttonsDown=Math.max(t._buttonsDown-1,0),s[a]=!1,l[a]=new Date},ScreenSpaceEventType$1.PINCH_END,e),t._eventHandler.setInputAction(function(e){if(s[a]){o[a]?(clonePinchMovement(e,c),o[a]=!1,c.prevAngle=c.angleAndHeight.startPosition.x):(Cartesian2.clone(e.distance.endPosition,c.distance.endPosition),Cartesian2.clone(e.angleAndHeight.endPosition,c.angleAndHeight.endPosition));for(var t=c.angleAndHeight.endPosition.x,i=c.prevAngle,r=2*Math.PI;t>=i+Math.PI;)t-=r;for(;t ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:textColor}),e+=addStyle(".cesium-credit-lightbox > ul > li a:hover",{color:highlightColor}),e+=addStyle(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),e+=addStyle(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),e+=addStyle(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),e+=addStyle(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:textColor}),e+=addStyle(".cesium-credit-lightbox-close:hover",{color:highlightColor}),e+=addStyle(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),e+=addStyle(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),e+=addStyle(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),e+=addStyle(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:textColor}),e+=addStyle(".cesium-credit-expand-link:hover",{color:highlightColor}),e+=addStyle(".cesium-credit-text",{color:textColor}),e+=addStyle(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});var t=document.head,i=document.createElement("style");i.innerHTML=e,t.insertBefore(i,t.firstChild)}function CreditDisplay(e,t,i){var r=this;i=defaultValue(i,document.body);var n=document.createElement("div");n.className="cesium-credit-lightbox-overlay",i.appendChild(n);var a=document.createElement("div");function o(e){a.contains(e.target)||r.hideLightbox()}a.className="cesium-credit-lightbox",n.appendChild(a),n.addEventListener("click",o,!1);var s=document.createElement("div");s.className="cesium-credit-lightbox-title",s.textContent="Data provided by:",a.appendChild(s);var l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="×",l.className="cesium-credit-lightbox-close",a.appendChild(l);var c=document.createElement("ul");a.appendChild(c);var u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);var d=document.createElement("div");d.className="cesium-credit-textContainer",d.style.display="inline",e.appendChild(d);s=document.createElement("a");s.className="cesium-credit-expand-link",s.onclick=this.showLightbox.bind(this),s.textContent="Data attribution",e.appendChild(s),appendCss();l=Credit.clone(CreditDisplay.cesiumCredit);this._delimiter=defaultValue(t," • "),this._screenContainer=d,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=a,this._creditList=c,this._lightbox=n,this._hideLightbox=o,this._expandLink=s,this._expanded=!1,this._defaultCredits=[],this._cesiumCredit=l,this._previousCesiumCredit=void 0,this._currentCesiumCredit=l,this._currentFrameCredits={screenCredits:new AssociativeArray,lightboxCredits:new AssociativeArray},this._defaultCredit=void 0,this.viewport=i,this.container=e}function getDefaultCredit(){var e;return defined(defaultCredit)||(0!==(e=buildModuleUrl("Assets/Images/ion-credit.png")).indexOf("http://")&&0!==e.indexOf("https://")&&0!==e.indexOf("data:")&&(e=new URI(e).getPath()),defaultCredit=new Credit('',!0)),CreditDisplay._cesiumCreditInitialized||(CreditDisplay._cesiumCredit=defaultCredit,CreditDisplay._cesiumCreditInitialized=!0),defaultCredit}function DebugAppearance(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).attributeName,i=e.perInstanceAttribute;defined(i)||(i=!1);var r,n=defaultValue(e.glslDatatype,"vec3"),a="v_"+t;if("normal"===t||"tangent"===t||"bitangent"===t)r="vec4 getColor() { return vec4(("+a+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===t&&(n="vec2"),n){case"float":r="vec4 getColor() { return vec4(vec3("+a+"), 1.0); }\n";break;case"vec2":r="vec4 getColor() { return vec4("+a+", 0.0, 1.0); }\n";break;case"vec3":r="vec4 getColor() { return vec4("+a+", 1.0); }\n";break;case"vec4":r="vec4 getColor() { return "+a+"; }\n"}var o="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(i?"":"attribute "+n+" "+t+";\n")+"varying "+n+" "+a+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(i?a+" = czm_batchTable_"+t+"(batchId);\n":a+" = "+t+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",i="varying "+n+" "+a+";\n"+r+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=defaultValue(e.translucent,!1),this._vertexShaderSource=defaultValue(e.vertexShaderSource,o),this._fragmentShaderSource=defaultValue(e.fragmentShaderSource,i),this._renderState=Appearance.getDefaultRenderState(!1,!1,e.renderState),this._closed=defaultValue(e.closed,!1),this._attributeName=t,this._glslDatatype=n}function DebugCameraPrimitive(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=defaultValue(e.color,Color.CYAN),this._updateOnChange=defaultValue(e.updateOnChange,!0),this.show=defaultValue(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}CreditDisplay.prototype.addCredit=function(e){if(e._isIon)return defined(this._defaultCredit)||(this._defaultCredit=Credit.clone(getDefaultCredit())),void(this._currentCesiumCredit=this._defaultCredit);(e.showOnScreen?this._currentFrameCredits.screenCredits:this._currentFrameCredits.lightboxCredits).set(e.id,e)},CreditDisplay.prototype.addDefaultCredit=function(e){var t=this._defaultCredits;contains$1(t,e)||t.push(e)},CreditDisplay.prototype.removeDefaultCredit=function(e){var t=this._defaultCredits,e=t.indexOf(e);-1!==e&&t.splice(e,1)},CreditDisplay.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0},CreditDisplay.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1},CreditDisplay.prototype.update=function(){this._expanded&&styleLightboxContainer(this)},CreditDisplay.prototype.beginFrame=function(){var e=this._currentFrameCredits,t=e.screenCredits;t.removeAll();for(var i=this._defaultCredits,r=0;ri[r-1])return tableLastIndex=r-2;if(e>=i[tableLastIndex]){if(tableLastIndex+1=i[tableLastIndex-1])return--tableLastIndex;for(t=0;t=i[t]&&e=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/TimeConstants$1.SECONDS_PER_MILLISECOND;if(2<=e._frameTimes.length&&e._frameTimes[0]<=r){for(;2<=e._frameTimes.length&&e._frameTimes[1]e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup)\s*<\/body>/im,wmsServiceExceptionReportRegex=//im,titleRegex=/([\s\S]*)<\/title>/im;function textToFeatureInfo(e){if(!emptyBodyRegex.test(e)&&!wmsServiceExceptionReportRegex.test(e)){var t,i=titleRegex.exec(e);i&&1<i.length&&(t=i[1]);i=new ImageryLayerFeatureInfo;return i.name=t,i.description=e,i.data=e,[i]}}var GlobeFS="uniform vec4 u_initialColor;\n#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];\n#ifdef APPLY_ALPHA\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_DAY_NIGHT_ALPHA\nuniform float u_dayTextureNightAlpha[TEXTURE_UNITS];\nuniform float u_dayTextureDayAlpha[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SPLIT\nuniform float u_dayTextureSplit[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_BRIGHTNESS\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_CONTRAST\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_HUE\nuniform float u_dayTextureHue[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_SATURATION\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_GAMMA\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_IMAGERY_CUTOUT\nuniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];\n#endif\n#ifdef APPLY_COLOR_TO_ALPHA\nuniform vec4 u_colorsToAlpha[TEXTURE_UNITS];\n#endif\nuniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nuniform vec2 u_lightingFadeDistance;\n#endif\n#ifdef TILE_LIMIT_RECTANGLE\nuniform vec4 u_cartographicLimitRectangle;\n#endif\n#ifdef GROUND_ATMOSPHERE\nuniform vec2 u_nightFadeDistance;\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nuniform highp sampler2D u_clippingPlanes;\nuniform mat4 u_clippingPlanesMatrix;\nuniform vec4 u_clippingPlanesEdgeStyle;\n#endif\n#if defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nuniform float u_minimumBrightness;\n#endif\n#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\n#ifdef HIGHLIGHT_FILL_TILE\nuniform vec4 u_fillHighlightColor;\n#endif\n#ifdef TRANSLUCENT\nuniform vec4 u_frontFaceAlphaByDistance;\nuniform vec4 u_backFaceAlphaByDistance;\nuniform vec4 u_translucencyRectangle;\n#endif\n#ifdef UNDERGROUND_COLOR\nuniform vec4 u_undergroundColor;\nuniform vec4 u_undergroundColorAlphaByDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_height;\nvarying float v_slope;\nvarying float v_aspect;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nvarying float v_distance;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying vec3 v_fogRayleighColor;\nvarying vec3 v_fogMieColor;\n#endif\n#ifdef GROUND_ATMOSPHERE\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nfloat interpolateByDistance(vec4 nearFarScalar, float distance)\n{\nfloat startDistance = nearFarScalar.x;\nfloat startValue = nearFarScalar.y;\nfloat endDistance = nearFarScalar.z;\nfloat endValue = nearFarScalar.w;\nfloat t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);\nreturn mix(startValue, endValue, t);\n}\n#endif\n#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)\nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)\n{\nreturn sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);\n}\n#endif\n#ifdef TRANSLUCENT\nbool inTranslucencyRectangle()\n{\nreturn\nv_textureCoordinates.x > u_translucencyRectangle.x &&\nv_textureCoordinates.x < u_translucencyRectangle.z &&\nv_textureCoordinates.y > u_translucencyRectangle.y &&\nv_textureCoordinates.y < u_translucencyRectangle.w;\n}\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D textureToSample,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureNightAlpha,\nfloat textureDayAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split,\nvec4 colorToAlpha,\nfloat nightBlend)\n{\nvec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\ntextureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);\n#endif\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 value = texture2D(textureToSample, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_COLOR_TO_ALPHA\nvec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);\ncolorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b);\nalpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);\n#endif\n#if !defined(APPLY_GAMMA)\nvec4 tempColor = czm_gammaCorrect(vec4(color, alpha));\ncolor = tempColor.rgb;\nalpha = tempColor.a;\n#else\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\n#ifdef APPLY_SPLIT\nfloat splitPosition = czm_imagerySplitPosition;\nif (split < 0.0 && gl_FragCoord.x > splitPosition) {\nalpha = 0.0;\n}\nelse if (split > 0.0 && gl_FragCoord.x < splitPosition) {\nalpha = 0.0;\n}\n#endif\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\noutAlpha += sign(outAlpha) - 1.0;\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, max(outAlpha, 0.0));\n}\nvec3 colorCorrect(vec3 rgb) {\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = czm_HSBToRGB(hsb);\n#endif\nreturn rgb;\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);\n#ifdef GROUND_ATMOSPHERE\nvec3 computeGroundAtmosphereColor(vec3 fogColor, vec4 finalColor, vec3 atmosphereLightDirection, float cameraDist);\n#endif\nconst float fExposure = 2.0;\nvoid main()\n{\n#ifdef TILE_LIMIT_RECTANGLE\nif (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||\nv_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)\n{\ndiscard;\n}\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nfloat clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);\n#endif\n#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)\nfloat nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);\n#else\nfloat nightBlend = 0.0;\n#endif\nvec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\ncolor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n#endif\n#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)\nfloat cameraDist;\nif (czm_sceneMode == czm_sceneMode2D)\n{\ncameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;\n}\nelse if (czm_sceneMode == czm_sceneModeColumbusView)\n{\ncameraDist = -czm_view[3].z;\n}\nelse\n{\ncameraDist = length(czm_view[3]);\n}\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nif (czm_sceneMode != czm_sceneMode3D) {\nvec3 radii = czm_ellipsoidRadii;\nfloat maxRadii = max(radii.x, max(radii.y, radii.z));\nfadeOutDist -= maxRadii;\nfadeInDist -= maxRadii;\n}\nfloat fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#else\nfloat fade = 0.0;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\nwaterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);\n}\n#endif\n#ifdef APPLY_MATERIAL\nczm_materialInput materialInput;\nmaterialInput.st = v_textureCoordinates.st;\nmaterialInput.normalEC = normalize(v_normalEC);\nmaterialInput.slope = v_slope;\nmaterialInput.height = v_height;\nmaterialInput.aspect = v_aspect;\nczm_material material = czm_getMaterial(materialInput);\nvec4 materialColor = vec4(material.diffuse, material.alpha);\ncolor = alphaBlend(materialColor, color);\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, fade);\nvec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef ENABLE_CLIPPING_PLANES\nvec4 clippingPlanesEdgeColor = vec4(1.0);\nclippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;\nfloat clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;\nif (clipDistance < clippingPlanesEdgeWidth)\n{\nfinalColor = clippingPlanesEdgeColor;\n}\n#endif\n#ifdef HIGHLIGHT_FILL_TILE\nfinalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvec3 fogColor = colorCorrect(v_fogMieColor) + finalColor.rgb * colorCorrect(v_fogRayleighColor);\n#ifndef HDR\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\n#endif\n#endif\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)\nvec3 atmosphereLightDirection = czm_sunDirectionWC;\n#else\nvec3 atmosphereLightDirection = czm_lightDirectionWC;\n#endif\n#ifdef FOG\n#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))\nfloat darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);\nfogColor *= darken;\n#endif\n#ifdef HDR\nconst float modifier = 0.15;\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor, modifier), finalColor.a);\n#else\nfinalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#endif\n#endif\n#ifdef GROUND_ATMOSPHERE\nif (!czm_backFacing())\n{\nvec3 groundAtmosphereColor = computeGroundAtmosphereColor(fogColor, finalColor, atmosphereLightDirection, cameraDist);\nfinalColor = vec4(mix(finalColor.rgb, groundAtmosphereColor, fade), finalColor.a);\n}\n#endif\n#ifdef UNDERGROUND_COLOR\nif (czm_backFacing())\n{\nfloat distanceFromEllipsoid = max(czm_eyeHeight, 0.0);\nfloat distance = max(v_distance - distanceFromEllipsoid, 0.0);\nfloat blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);\nvec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);\nfinalColor = alphaBlend(undergroundColor, finalColor);\n}\n#endif\n#ifdef TRANSLUCENT\nif (inTranslucencyRectangle())\n{\nvec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;\nfinalColor.a *= interpolateByDistance(alphaByDistance, v_distance);\n}\n#endif\ngl_FragColor = finalColor;\n}\n#ifdef GROUND_ATMOSPHERE\nvec3 computeGroundAtmosphereColor(vec3 fogColor, vec4 finalColor, vec3 atmosphereLightDirection, float cameraDist)\n{\n#if defined(PER_FRAGMENT_GROUND_ATMOSPHERE) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))\nfloat mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);\nvec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);\nxy *= czm_viewport.zw * mpp * 0.5;\nvec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));\nczm_ray ray = czm_ray(vec3(0.0), direction);\nvec3 ellipsoid_center = czm_view[3].xyz;\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);\nvec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);\nellipsoidPosition = (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(ellipsoidPosition, true, atmosphereLightDirection);\nvec3 groundAtmosphereColor = colorCorrect(atmosColor.mie) + finalColor.rgb * colorCorrect(atmosColor.rayleigh);\n#ifndef HDR\ngroundAtmosphereColor = vec3(1.0) - exp(-fExposure * groundAtmosphereColor);\n#endif\nfloat fadeInDist = u_nightFadeDistance.x;\nfloat fadeOutDist = u_nightFadeDistance.y;\nfloat sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\n#ifdef HDR\nsunlitAtmosphereIntensity = max(sunlitAtmosphereIntensity * sunlitAtmosphereIntensity, 0.03);\n#endif\ngroundAtmosphereColor = mix(groundAtmosphereColor, fogColor, sunlitAtmosphereIntensity);\n#else\nvec3 groundAtmosphereColor = fogColor;\n#endif\n#ifdef HDR\ngroundAtmosphereColor = czm_saturation(groundAtmosphereColor, 1.6);\n#endif\nreturn groundAtmosphereColor;\n}\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nfloat linearFade(float edge0, float edge1, float x)\n{\nreturn clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n}\nconst float oceanFrequencyLowAltitude = 825000.0;\nconst float oceanAnimationSpeedLowAltitude = 0.004;\nconst float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;\nconst float oceanSpecularIntensity = 0.5;\nconst float oceanFrequencyHighAltitude = 125000.0;\nconst float oceanAnimationSpeedHighAltitude = 0.008;\nconst float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)\n{\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nfloat time = czm_frameNumber * oceanAnimationSpeedHighAltitude;\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);\nvec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);\ntime = czm_frameNumber * oceanAnimationSpeedLowAltitude;\nnoise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);\nvec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);\nfloat highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);\nfloat lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);\nvec3 normalTangentSpace =\n(highAltitudeFade * normalTangentSpaceHighAltitude) +\n(lowAltitudeFade * normalTangentSpaceLowAltitude);\nnormalTangentSpace = normalize(normalTangentSpace);\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\n#ifdef HDR\nspecular *= 1.4;\nfloat e = 0.2;\nfloat d = 3.3;\nfloat c = 1.7;\nvec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));\n#else\nvec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;\n#endif\nreturn vec4(color, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n",GlobeVS="#ifdef QUANTIZATION_BITS12\nattribute vec4 compressed0;\nattribute float compressed1;\n#else\nattribute vec4 position3DAndHeight;\nattribute vec4 textureCoordAndEncodedNormals;\n#endif\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform mat4 u_modifiedModelViewProjection;\nuniform vec4 u_tileRectangle;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec2 u_southMercatorYAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef APPLY_MATERIAL\nvarying float v_slope;\nvarying float v_aspect;\nvarying float v_height;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nvarying float v_distance;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nvarying vec3 v_fogMieColor;\nvarying vec3 v_fogRayleighColor;\n#endif\nvec4 getPosition(vec3 position, float height, vec2 textureCoordinates);\nfloat get2DYPositionFraction(vec2 textureCoordinates);\nvec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn u_modifiedModelViewProjection * vec4(position, 1.0);\n}\nfloat get2DMercatorYPositionFraction(vec2 textureCoordinates)\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorY = u_southMercatorYAndOneOverHeight.x;\nfloat oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction(vec2 textureCoordinates)\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)\n{\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn u_modifiedModelViewProjection * rtcPosition2D;\n}\nvec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, 0.0, textureCoordinates);\n}\nvec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)\n{\nreturn getPositionPlanarEarth(position, height, textureCoordinates);\n}\nvec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)\n{\nvec3 position3DWC = position + u_center3D;\nfloat yPositionFraction = get2DYPositionFraction(textureCoordinates);\nvec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\n#ifdef QUANTIZATION_BITS12\nuniform vec2 u_minMaxHeight;\nuniform mat4 u_scaleAndBias;\n#endif\nvoid main()\n{\n#ifdef QUANTIZATION_BITS12\nvec2 xy = czm_decompressTextureCoordinates(compressed0.x);\nvec2 zh = czm_decompressTextureCoordinates(compressed0.y);\nvec3 position = vec3(xy, zh.x);\nfloat height = zh.y;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);\nheight = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;\nposition = (u_scaleAndBias * vec4(position, 1.0)).xyz;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = compressed1;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;\nfloat encodedNormal = 0.0;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = compressed0.w;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#else\nvec3 position = position3DAndHeight.xyz;\nfloat height = position3DAndHeight.w;\nvec2 textureCoordinates = textureCoordAndEncodedNormals.xy;\n#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = textureCoordAndEncodedNormals.z;\n#elif defined(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = 0.0;\n#else\nfloat webMercatorT = textureCoordinates.y;\nfloat encodedNormal = 0.0;\n#endif\n#endif\nvec3 position3DWC = position + u_center3D;\ngl_Position = getPosition(position, height, textureCoordinates);\nv_textureCoordinates = vec3(textureCoordinates, webMercatorT);\n#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nvec3 normalMC = czm_octDecode(encodedNormal);\nv_normalMC = normalMC;\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION) || defined(HDR)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE)\nAtmosphereColor atmosFogColor = computeGroundAtmosphereFromSpace(position3DWC, false, vec3(0.0));\nv_fogMieColor = atmosFogColor.mie;\nv_fogRayleighColor = atmosFogColor.rayleigh;\n#endif\n#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n#ifdef APPLY_MATERIAL\nfloat northPoleZ = czm_ellipsoidRadii.z;\nvec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);\nvec3 ellipsoidNormal = normalize(v_positionMC);\nvec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));\nfloat dotProd = abs(dot(ellipsoidNormal, v_normalMC));\nv_slope = acos(dotProd);\nvec3 normalRejected = ellipsoidNormal * dotProd;\nvec3 normalProjected = v_normalMC - normalRejected;\nvec3 aspectVector = normalize(normalProjected);\nv_aspect = acos(dot(aspectVector, vectorEastMC));\nfloat determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);\nv_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);\nv_height = height;\n#endif\n}\n",GroundAtmosphere="const float Kr = 0.0025;\nconst float Km = 0.0015;\nconst float ESun = 15.0;\nconst float fKrESun = Kr * ESun;\nconst float fKmESun = Km * ESun;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst vec3 v3InvWavelength = vec3(5.60204474633241, 9.473284437923038, 19.64380261047721);\nconst float fScaleDepth = 0.25;\nstruct AtmosphereColor\n{\nvec3 mie;\nvec3 rayleigh;\n};\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nAtmosphereColor computeGroundAtmosphereFromSpace(vec3 v3Pos, bool dynamicLighting, vec3 lightDirectionWC)\n{\nfloat fInnerRadius = czm_ellipsoidRadii.x;\nfloat fOuterRadius = czm_ellipsoidRadii.x * 1.025;\nfloat fOuterRadius2 = fOuterRadius * fOuterRadius;\nfloat fScale = 1.0 / (fOuterRadius - fInnerRadius);\nfloat fScaleOverScaleDepth = fScale / fScaleDepth;\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\nfloat fCameraHeight = length(czm_viewerPositionWC);\nfloat fCameraHeight2 = fCameraHeight * fCameraHeight;\nfloat B = 2.0 * length(czm_viewerPositionWC) * dot(normalize(czm_viewerPositionWC), v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\nfloat fLightAngle = czm_branchFreeTernary(dynamicLighting, dot(lightDirectionWC, v3Pos) / length(v3Pos), 1.0);\nfloat fCameraAngle = dot(-v3Ray, v3Pos) / length(v3Pos);\nfloat fCameraScale = scale(fCameraAngle);\nfloat fLightScale = scale(fLightAngle);\nfloat fCameraOffset = fDepth*fCameraScale;\nfloat fTemp = (fLightScale + fCameraScale);\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0);\nvec3 v3Attenuate = vec3(0.0);\nfor(int i=0; i<nSamples; i++)\n{\nfloat fHeight = length(v3SamplePoint);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\nfloat fScatter = fDepth*fTemp - fCameraOffset;\nv3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\nv3FrontColor += v3Attenuate * (fDepth * fScaledLength);\nv3SamplePoint += v3SampleRay;\n}\nAtmosphereColor color;\ncolor.mie = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\ncolor.rayleigh = v3Attenuate;\nreturn color;\n}\n";function GlobeSurfaceShader(e,t,i,r,n){this.numberOfDayTextures=e,this.flags=t,this.material=i,this.shaderProgram=r,this.clippingShaderState=n}function GlobeSurfaceShaderSet(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function getPositionMode(e){var t;switch(e){case SceneMode$1.SCENE3D:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }";break;case SceneMode$1.SCENE2D:case SceneMode$1.COLUMBUS_VIEW:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }";break;case SceneMode$1.MORPHING:t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }"}return t}function get2DYPositionFraction(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}GlobeSurfaceShaderSet.prototype.getShaderProgram=function(e){var t=e.frameState,i=e.surfaceTile,r=e.numberOfDayTextures,n=e.applyBrightness,a=e.applyContrast,o=e.applyHue,s=e.applySaturation,l=e.applyGamma,c=e.applyAlpha,u=e.applyDayNightAlpha,d=e.applySplit,h=e.showReflectiveOcean,p=e.showOceanWaves,m=e.enableLighting,f=e.dynamicAtmosphereLighting,g=e.dynamicAtmosphereLightingFromSun,_=e.showGroundAtmosphere,y=e.perFragmentGroundAtmosphere,C=e.hasVertexNormals,v=e.useWebMercatorProjection,S=e.enableFog,T=e.enableClippingPlanes,x=e.clippingPlanes,b=e.clippedByBoundaries,E=e.hasImageryLayerCutout,P=e.colorCorrect,A=e.highlightFillTile,w=e.colorToAlpha,D=e.showUndergroundColor,M=e.translucent,I=0,R="",O=i.renderedMesh.encoding;O.quantization===TerrainQuantization$1.BITS12&&(I=1,R="QUANTIZATION_BITS12");var L=0,F="";b&&(L=1,F="TILE_LIMIT_RECTANGLE");var N=0,B="";E&&(N=1,B="APPLY_IMAGERY_CUTOUT");var V=t.mode,k=V|n<<2|a<<3|o<<4|s<<5|l<<6|c<<7|h<<8|p<<9|m<<10|f<<11|g<<12|_<<13|y<<14|C<<15|v<<16|S<<17|I<<18|d<<19|T<<20|L<<21|N<<22|P<<23|A<<24|w<<25|D<<26|M<<27|u<<28,e=0;if(defined(x)&&0<x.length&&(e=T?x.clippingPlanesState:0),defined(b=i.surfaceShader)&&b.numberOfDayTextures===r&&b.flags===k&&b.material===this.material&&b.clippingShaderState===e)return b.shaderProgram;I=this._shadersByTexturesFlags[r];if(defined(I)||(I=this._shadersByTexturesFlags[r]=[]),!defined(b=I[k])||b.material!==this.material||b.clippingShaderState!==e){L=this.baseVertexShaderSource.clone(),N=this.baseFragmentShaderSource.clone();0!==e&&N.sources.unshift(getClippingFunction(x,t.context)),L.defines.push(R),N.defines.push("TEXTURE_UNITS "+r,F,B),n&&N.defines.push("APPLY_BRIGHTNESS"),a&&N.defines.push("APPLY_CONTRAST"),o&&N.defines.push("APPLY_HUE"),s&&N.defines.push("APPLY_SATURATION"),l&&N.defines.push("APPLY_GAMMA"),c&&N.defines.push("APPLY_ALPHA"),u&&N.defines.push("APPLY_DAY_NIGHT_ALPHA"),h&&(N.defines.push("SHOW_REFLECTIVE_OCEAN"),L.defines.push("SHOW_REFLECTIVE_OCEAN")),p&&N.defines.push("SHOW_OCEAN_WAVES"),w&&N.defines.push("APPLY_COLOR_TO_ALPHA"),D&&(L.defines.push("UNDERGROUND_COLOR"),N.defines.push("UNDERGROUND_COLOR")),M&&(L.defines.push("TRANSLUCENT"),N.defines.push("TRANSLUCENT")),m&&(C?(L.defines.push("ENABLE_VERTEX_LIGHTING"),N.defines.push("ENABLE_VERTEX_LIGHTING")):(L.defines.push("ENABLE_DAYNIGHT_SHADING"),N.defines.push("ENABLE_DAYNIGHT_SHADING"))),f&&(N.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),g&&N.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN")),_&&(L.defines.push("GROUND_ATMOSPHERE"),N.defines.push("GROUND_ATMOSPHERE"),y&&N.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE")),L.defines.push("INCLUDE_WEB_MERCATOR_Y"),N.defines.push("INCLUDE_WEB_MERCATOR_Y"),S&&(L.defines.push("FOG"),N.defines.push("FOG")),d&&N.defines.push("APPLY_SPLIT"),T&&N.defines.push("ENABLE_CLIPPING_PLANES"),P&&N.defines.push("COLOR_CORRECT"),A&&N.defines.push("HIGHLIGHT_FILL_TILE");var z=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)\n {\n vec4 color = initialColor;\n";E&&(z+=" vec4 cutoutAndColorResult;\n bool texelUnclipped;\n");for(var U=0;U<r;++U)z+=E?" cutoutAndColorResult = u_dayTextureCutoutRectangles["+U+"];\n texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;\n cutoutAndColorResult = sampleAndBlend(\n":" color = sampleAndBlend(\n",z+=" color,\n u_dayTextures["+U+"],\n u_dayTextureUseWebMercatorT["+U+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+U+"],\n u_dayTextureTranslationAndScale["+U+"],\n "+(c?"u_dayTextureAlpha["+U+"]":"1.0")+",\n "+(u?"u_dayTextureNightAlpha["+U+"]":"1.0")+",\n"+(u?"u_dayTextureDayAlpha["+U+"]":"1.0")+",\n"+(n?"u_dayTextureBrightness["+U+"]":"0.0")+",\n "+(a?"u_dayTextureContrast["+U+"]":"0.0")+",\n "+(o?"u_dayTextureHue["+U+"]":"0.0")+",\n "+(s?"u_dayTextureSaturation["+U+"]":"0.0")+",\n "+(l?"u_dayTextureOneOverGamma["+U+"]":"0.0")+",\n "+(d?"u_dayTextureSplit["+U+"]":"0.0")+",\n "+(w?"u_colorsToAlpha["+U+"]":"vec4(0.0)")+",\n nightBlend );\n",E&&(z+=" color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);\n");z+=" return color;\n }",N.sources.push(z),L.sources.push(getPositionMode(V)),L.sources.push(get2DYPositionFraction(v));O=ShaderProgram.fromCache({context:t.context,vertexShaderSource:L,fragmentShaderSource:N,attributeLocations:O.getAttributeLocations()}),b=I[k]=new GlobeSurfaceShader(r,k,this.material,O,e)}return(i.surfaceShader=b).shaderProgram},GlobeSurfaceShaderSet.prototype.destroy=function(){var e,t,i,r=this._shadersByTexturesFlags;for(i in r)if(r.hasOwnProperty(i)){var n=r[i];if(defined(n))for(e in n)n.hasOwnProperty(e)&&defined(t=n[e])&&t.shaderProgram.destroy()}return destroyObject(this)};var ImageryState={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ImageryState$1=Object.freeze(ImageryState),QuadtreeTileLoadState={START:0,LOADING:1,DONE:2,FAILED:3},QuadtreeTileLoadState$1=Object.freeze(QuadtreeTileLoadState),TerrainState$1={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},TerrainState$2=Object.freeze(TerrainState$1);function GlobeSurfaceTile(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new Cartesian4(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.orientedBoundingBox=void 0,this.boundingVolumeSourceTile=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new Cartesian3,this.terrainState=TerrainState$2.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new BoundingSphere,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}function getPosition$2(e,t,i,r,n,a){return e.decodePosition(r,n,a),defined(t)&&t!==SceneMode$1.SCENE3D&&(t=i.ellipsoid.cartesianToCartographic(a),i.project(t,a),Cartesian3.fromElements(a.z,a.x,a.y,a)),a}Object.defineProperties(GlobeSurfaceTile.prototype,{eligibleForUnloading:{get:function(){for(var e=this.terrainState,t=!(e===TerrainState$2.RECEIVING||e===TerrainState$2.TRANSFORMING),i=this.imagery,r=0,n=i.length;t&&r<n;++r)var a=i[r],t=!defined(a.loadingImagery)||a.loadingImagery.state!==ImageryState$1.TRANSITIONING;return t}},renderedMesh:{get:function(){return defined(this.vertexArray)?this.mesh:defined(this.fill)?this.fill.mesh:void 0}}});var scratchV0=new Cartesian3,scratchV1=new Cartesian3,scratchV2=new Cartesian3;function prepareNewTile(e,t,i){var r,n,a=t.getTileDataAvailable(e.x,e.y,e.level);defined(a)||!defined(e.parent)||defined(n=(r=e.parent).data)&&defined(n.terrainData)&&(a=n.terrainData.isChildAvailable(r.x,r.y,e.x,e.y)),!1===a&&(e.data.terrainState=TerrainState$2.FAILED);for(var o=0,s=i.length;o<s;++o){var l=i.get(o);l.show&&l._createTileImagerySkeletons(e,t)}}function processTerrainStateMachine(e,t,i,r,n){var a=e.data,o=e.parent;a.terrainState===TerrainState$2.FAILED&&void 0!==o&&(void 0!==o.data&&void 0!==o.data.terrainData&&!1!==o.data.terrainData.canUpsample||GlobeSurfaceTile.processStateMachine(o,t,i,r,!0)),a.terrainState===TerrainState$2.FAILED&&upsample(a,e,t,i,e.x,e.y,e.level),a.terrainState===TerrainState$2.UNLOADED&&requestTileGeometry$1(a,i,e.x,e.y,e.level),a.terrainState===TerrainState$2.RECEIVED&&transform$1(a,t,i,e.x,e.y,e.level),a.terrainState===TerrainState$2.TRANSFORMED&&createResources$4(a,t.context,i,e.x,e.y,e.level,n),a.terrainState>=TerrainState$2.RECEIVED&&void 0===a.waterMaskTexture&&i.hasWaterMask&&(void 0!==a.terrainData.waterMask?createWaterMaskTextureIfNeeded(t.context,a):defined(t=a._findAncestorTileWithTerrainData(e))&&defined(t.data.waterMaskTexture)&&(a.waterMaskTexture=t.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,t,a.waterMaskTranslationAndScale)))}function upsample(t,e,i,r,n,a,o){var s,l,c,u=e.parent;u?(s=u.data.terrainData,l=u.x,c=u.y,u=u.level,!defined(s)||defined(o=s.upsample(r.tilingScheme,l,c,u,n,a,o))&&(t.terrainState=TerrainState$2.RECEIVING,when(o,function(e){t.terrainData=e,t.terrainState=TerrainState$2.RECEIVED},function(){t.terrainState=TerrainState$2.FAILED}))):e.state=QuadtreeTileLoadState$1.FAILED}function requestTileGeometry$1(t,i,r,n,a){function o(e){t.terrainData=e,t.terrainState=TerrainState$2.RECEIVED,t.request=void 0}function s(){if(t.request.state===RequestState$1.CANCELLED)return t.terrainData=void 0,t.terrainState=TerrainState$2.UNLOADED,void(t.request=void 0);t.terrainState=TerrainState$2.FAILED,t.request=void 0;var e="Failed to obtain terrain tile X: "+r+" Y: "+n+" Level: "+a+".";i._requestError=TileProviderError.handleError(i._requestError,i,i.errorEvent,e,r,n,a,l)}function l(){var e=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.TERRAIN});t.request=e;e=i.requestTileGeometry(r,n,a,e);defined(e)?(t.terrainState=TerrainState$2.RECEIVING,when(e,o,s)):(t.terrainState=TerrainState$2.UNLOADED,t.request=void 0)}l()}function transform$1(t,e,i,r,n,a){i=i.tilingScheme,e=t.terrainData.createMesh(i,r,n,a,e.terrainExaggeration);defined(e)&&(t.terrainState=TerrainState$2.TRANSFORMING,when(e,function(e){t.mesh=e,t.orientedBoundingBox=OrientedBoundingBox.clone(e.orientedBoundingBox,t.orientedBoundingBox),t.occludeePointInScaledSpace=Cartesian3.clone(e.occludeePointInScaledSpace,t.occludeePointInScaledSpace),t.terrainState=TerrainState$2.TRANSFORMED},function(){t.terrainState=TerrainState$2.FAILED}))}function createResources$4(e,t,i,r,n,a,o){e.vertexArray=GlobeSurfaceTile._createVertexArrayForMesh(t,e.mesh),e.terrainState=TerrainState$2.READY,e.fill=e.fill&&e.fill.destroy(o)}function getContextWaterMaskData(e){var t,i=e.cache.tile_waterMaskData;return defined(i)||((t=Texture.create({context:e,pixelFormat:PixelFormat$1.LUMINANCE,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}})).referenceCount=1,i={allWaterTexture:t,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR}),destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=i),i}function createWaterMaskTextureIfNeeded(e,t){var i=t.terrainData.waterMask,r=getContextWaterMaskData(e),n=i.length;if(1===n){if(0===i[0])return;a=r.allWaterTexture}else{var a,n=Math.sqrt(n);(a=Texture.create({context:e,pixelFormat:PixelFormat$1.LUMINANCE,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{width:n,height:n,arrayBufferView:i},sampler:r.sampler,flipY:!1})).referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,Cartesian4.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}GlobeSurfaceTile.prototype.pick=function(e,t,i,r,n){var a=this.renderedMesh;if(defined(a)){for(var o=a.vertices,s=a.indices,l=a.encoding,c=s.length,u=Number.MAX_VALUE,d=0;d<c;d+=3){var h=s[d],p=s[d+1],m=s[d+2],h=getPosition$2(l,t,i,o,h,scratchV0),p=getPosition$2(l,t,i,o,p,scratchV1),m=getPosition$2(l,t,i,o,m,scratchV2),m=IntersectionTests.rayTriangleParametric(e,h,p,m,r);defined(m)&&m<u&&0<=m&&(u=m)}return u!==Number.MAX_VALUE?Ray.getPoint(e,u,n):void 0}},GlobeSurfaceTile.prototype.freeResources=function(){defined(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=TerrainState$2.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();for(var e=this.imagery,t=0,i=e.length;t<i;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()},GlobeSurfaceTile.prototype.freeVertexArray=function(){GlobeSurfaceTile._freeVertexArray(this.vertexArray),this.vertexArray=void 0,GlobeSurfaceTile._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0},GlobeSurfaceTile.initialize=function(e,t,i){defined(e.data)||(e.data=new GlobeSurfaceTile),e.state===QuadtreeTileLoadState$1.START&&(prepareNewTile(e,t,i),e.state=QuadtreeTileLoadState$1.LOADING)},GlobeSurfaceTile.processStateMachine=function(e,t,i,r,n,a){GlobeSurfaceTile.initialize(e,i,r);var o=e.data;if(e.state===QuadtreeTileLoadState$1.LOADING&&processTerrainStateMachine(e,t,i,r,n),!a){n=e.renderable;e.renderable=defined(o.vertexArray);a=o.terrainState===TerrainState$2.READY;e.upsampledFromParent=defined(o.terrainData)&&o.terrainData.wasCreatedByUpsampling();t=o.processImagery(e,i,t);if(a&&t){var s,l=e._loadedCallbacks,c={};for(s in l)l.hasOwnProperty(s)&&(l[s](e)||(c[s]=l[s]));e._loadedCallbacks=c,e.state=QuadtreeTileLoadState$1.DONE}n&&(e.renderable=!0)}},GlobeSurfaceTile.prototype.processImagery=function(e,t,i,r){for(var n=e.data,a=e.upsampledFromParent,o=!1,s=!0,l=n.imagery,c=0,u=l.length;c<u;++c){var d=l[c];if(defined(d.loadingImagery)){if(d.loadingImagery.state===ImageryState$1.PLACEHOLDER){var h=d.loadingImagery.imageryLayer;if(h.imageryProvider.ready){d.freeResources(),l.splice(c,1),h._createTileImagerySkeletons(e,t,c),--c,u=l.length;continue}a=!1}h=d.processStateMachine(e,i,r),s=s&&h,o=o||h||defined(d.readyImagery),a=a&&defined(d.loadingImagery)&&(d.loadingImagery.state===ImageryState$1.FAILED||d.loadingImagery.state===ImageryState$1.INVALID)}else a=!1}return e.upsampledFromParent=a,e.renderable=e.renderable&&(o||s),s},GlobeSurfaceTile._createVertexArrayForMesh=function(e,t){var i=t.vertices,r=Buffer$1.createVertexBuffer({context:e,typedArray:i,usage:BufferUsage$1.STATIC_DRAW}),n=t.encoding.getAttributes(r),a=t.indices.indexBuffers||{},i=a[e.id];return!defined(i)||i.isDestroyed()?(r=t.indices,(i=Buffer$1.createIndexBuffer({context:e,typedArray:r,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.fromSizeInBytes(r.BYTES_PER_ELEMENT)})).vertexArrayDestroyable=!1,i.referenceCount=1,a[e.id]=i,t.indices.indexBuffers=a):++i.referenceCount,new VertexArray({context:e,attributes:n,indexBuffer:i})},GlobeSurfaceTile._freeVertexArray=function(e){var t;defined(e)&&(t=e.indexBuffer,e.destroy(),defined(t)&&!t.isDestroyed()&&defined(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy()))},GlobeSurfaceTile.prototype._findAncestorTileWithTerrainData=function(e){for(var t=e.parent;defined(t)&&(!defined(t.data)||!defined(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t},GlobeSurfaceTile.prototype._computeWaterMaskTranslationAndScale=function(e,t,i){var r=t.rectangle,n=e.rectangle,a=n.width,o=n.height,t=a/r.width,e=o/r.height;return i.x=t*(n.west-r.west)/a,i.y=e*(n.south-r.south)/o,i.z=t,i.w=e,i};var ReprojectWebMercatorFS="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n",ReprojectWebMercatorVS="attribute vec4 position;\nattribute float webMercatorT;\nuniform vec2 u_textureDimensions;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nv_textureCoordinates = vec2(position.x, webMercatorT);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n";function Imagery(e,t,i,r,n){var a,o,s;this.imageryLayer=e,this.x=t,this.y=i,this.level=r,this.request=void 0,0!==r&&(a=t/2|0,o=i/2|0,s=r-1,this.parent=e.getImageryFromCache(a,o,s)),this.state=ImageryState$1.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!defined(n)&&e.imageryProvider.ready&&(n=e.imageryProvider.tilingScheme.tileXYToRectangle(t,i,r)),this.rectangle=n}Imagery.createPlaceholder=function(e){e=new Imagery(e,0,0,0);return e.addReference(),e.state=ImageryState$1.PLACEHOLDER,e},Imagery.prototype.addReference=function(){++this.referenceCount},Imagery.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),defined(this.parent)&&this.parent.releaseReference(),defined(this.image)&&defined(this.image.destroy)&&this.image.destroy(),defined(this.texture)&&this.texture.destroy(),defined(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),destroyObject(this),0):this.referenceCount},Imagery.prototype.processStateMachine=function(e,t,i){this.state!==ImageryState$1.UNLOADED||i||(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ImageryState$1.RECEIVED&&(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));i=this.state===ImageryState$1.READY&&t&&!this.texture;this.state!==ImageryState$1.TEXTURE_LOADED&&!i||(this.state=ImageryState$1.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var ImagerySplitDirection={LEFT:-1,NONE:0,RIGHT:1},ImagerySplitDirection$1=Object.freeze(ImagerySplitDirection);function TileImagery(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}function ImageryLayer(e,t){this._imageryProvider=e,t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.alpha=defaultValue(t.alpha,defaultValue(e.defaultAlpha,1)),this.nightAlpha=defaultValue(t.nightAlpha,defaultValue(e.defaultNightAlpha,1)),this.dayAlpha=defaultValue(t.dayAlpha,defaultValue(e.defaultDayAlpha,1)),this.brightness=defaultValue(t.brightness,defaultValue(e.defaultBrightness,ImageryLayer.DEFAULT_BRIGHTNESS)),this.contrast=defaultValue(t.contrast,defaultValue(e.defaultContrast,ImageryLayer.DEFAULT_CONTRAST)),this.hue=defaultValue(t.hue,defaultValue(e.defaultHue,ImageryLayer.DEFAULT_HUE)),this.saturation=defaultValue(t.saturation,defaultValue(e.defaultSaturation,ImageryLayer.DEFAULT_SATURATION)),this.gamma=defaultValue(t.gamma,defaultValue(e.defaultGamma,ImageryLayer.DEFAULT_GAMMA)),this.splitDirection=defaultValue(t.splitDirection,defaultValue(e.defaultSplit,ImageryLayer.DEFAULT_SPLIT)),this.minificationFilter=defaultValue(t.minificationFilter,defaultValue(e.defaultMinificationFilter,ImageryLayer.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=defaultValue(t.magnificationFilter,defaultValue(e.defaultMagnificationFilter,ImageryLayer.DEFAULT_MAGNIFICATION_FILTER)),this.show=defaultValue(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=defaultValue(t.rectangle,Rectangle.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new TileImagery(Imagery.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=defaultValue(t.colorToAlphaThreshold,ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}TileImagery.prototype.freeResources=function(){defined(this.readyImagery)&&this.readyImagery.releaseReference(),defined(this.loadingImagery)&&this.loadingImagery.releaseReference()},TileImagery.prototype.processStateMachine=function(e,t,i){var r=this.loadingImagery,n=r.imageryLayer;if(r.processStateMachine(t,!this.useWebMercatorT,i),r.state===ImageryState$1.READY)return defined(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this),!0;for(var a,o=r.parent;defined(o)&&(o.state!==ImageryState$1.READY||!this.useWebMercatorT&&!defined(o.texture));)o.state!==ImageryState$1.FAILED&&o.state!==ImageryState$1.INVALID&&(a=a||o),o=o.parent;return this.readyImagery!==o&&(defined(this.readyImagery)&&this.readyImagery.releaseReference(),defined(this.readyImagery=o)&&(o.addReference(),this.textureTranslationAndScale=n._calculateTextureTranslationAndScale(e,this))),(r.state===ImageryState$1.FAILED||r.state===ImageryState$1.INVALID)&&(!defined(a)||(a.processStateMachine(t,!this.useWebMercatorT,i),!1))},Object.defineProperties(ImageryLayer.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),ImageryLayer.DEFAULT_BRIGHTNESS=1,ImageryLayer.DEFAULT_CONTRAST=1,ImageryLayer.DEFAULT_HUE=0,ImageryLayer.DEFAULT_SATURATION=1,ImageryLayer.DEFAULT_GAMMA=1,ImageryLayer.DEFAULT_SPLIT=ImagerySplitDirection$1.NONE,ImageryLayer.DEFAULT_MINIFICATION_FILTER=TextureMinificationFilter$1.LINEAR,ImageryLayer.DEFAULT_MAGNIFICATION_FILTER=TextureMagnificationFilter$1.LINEAR,ImageryLayer.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004,ImageryLayer.prototype.isBaseLayer=function(){return this._isBaseLayer},ImageryLayer.prototype.isDestroyed=function(){return!1},ImageryLayer.prototype.destroy=function(){return destroyObject(this)};var imageryBoundsScratch=new Rectangle,tileImageryBoundsScratch=new Rectangle,clippedRectangleScratch=new Rectangle,terrainRectangleScratch=new Rectangle;function getSamplerKey(e,t,i){return e+":"+t+":"+i}function getImageryCacheKey(e,t,i){return JSON.stringify([e,t,i])}ImageryLayer.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return Rectangle.intersection(e.rectangle,t)})},ImageryLayer.prototype._createTileImagerySkeletons=function(e,t,i){var r=e.data;if(defined(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(defined(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var n=this._imageryProvider;if(defined(i)||(i=r.imagery.length),!n.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),r.imagery.splice(i,0,this._skeletonPlaceholder),!0;var a=n.tilingScheme.projection instanceof WebMercatorProjection&&e.rectangle.north<WebMercatorProjection.MaximumLatitude&&e.rectangle.south>-WebMercatorProjection.MaximumLatitude,o=Rectangle.intersection(n.rectangle,this._rectangle,imageryBoundsScratch);if(!defined(c=Rectangle.intersection(e.rectangle,o,tileImageryBoundsScratch))){if(!this.isBaseLayer())return!1;var s=o,l=e.rectangle,c=tileImageryBoundsScratch;l.south>=s.north?c.north=c.south=s.north:l.north<=s.south?c.north=c.south=s.south:(c.south=Math.max(l.south,s.south),c.north=Math.min(l.north,s.north)),l.west>=s.east?c.west=c.east=s.east:l.east<=s.west?c.west=c.east=s.west:(c.west=Math.max(l.west,s.west),c.east=Math.min(l.east,s.east))}s=0;0<c.south?s=c.south:c.north<0&&(s=c.north);var u=getLevelWithMaximumTexelSpacing(this,+t.getLevelMaximumGeometricError(e.level),s),u=Math.max(0,u),s=n.maximumLevel;s<u&&(u=s),!defined(n.minimumLevel)||u<(s=n.minimumLevel)&&(u=s);var n=n.tilingScheme,d=n.positionToTileXY(Rectangle.northwest(c),u),h=n.positionToTileXY(Rectangle.southeast(c),u),p=e.rectangle.width/512,m=e.rectangle.height/512,c=n.tileXYToRectangle(d.x,d.y,u);Math.abs(c.south-e.rectangle.north)<m&&d.y<h.y&&++d.y,Math.abs(c.east-e.rectangle.west)<p&&d.x<h.x&&++d.x;c=n.tileXYToRectangle(h.x,h.y,u);Math.abs(c.north-e.rectangle.south)<m&&h.y>d.y&&--h.y,Math.abs(c.west-e.rectangle.east)<p&&h.x>d.x&&--h.x;var f,g,_=Rectangle.clone(e.rectangle,terrainRectangleScratch),y=n.tileXYToRectangle(d.x,d.y,u),C=Rectangle.intersection(y,o,clippedRectangleScratch);a?(n.rectangleToNativeRectangle(_,_),n.rectangleToNativeRectangle(y,y),n.rectangleToNativeRectangle(C,C),n.rectangleToNativeRectangle(o,o),f=n.tileXYToNativeRectangle.bind(n),p=_.width/512,m=_.height/512):f=n.tileXYToRectangle.bind(n);var v=0,S=1;!this.isBaseLayer()&&Math.abs(C.west-_.west)>=p&&(v=Math.min(1,(C.west-_.west)/_.width)),!this.isBaseLayer()&&Math.abs(C.north-_.north)>=m&&(S=Math.max(0,(C.north-_.south)/_.height));for(var T=S,x=d.x;x<=h.x;x++)if(g=v,y=f(x,d.y,u),defined(C=Rectangle.simpleIntersection(y,o,clippedRectangleScratch))){v=Math.min(1,(C.east-_.west)/_.width),x===h.x&&(this.isBaseLayer()||Math.abs(C.east-_.east)<p)&&(v=1),S=T;for(var b=d.y;b<=h.y;b++){var E,P=S,y=f(x,b,u);defined(C=Rectangle.simpleIntersection(y,o,clippedRectangleScratch))&&(S=Math.max(0,(C.south-_.south)/_.height),b===h.y&&(this.isBaseLayer()||Math.abs(C.south-_.south)<m)&&(S=0),E=new Cartesian4(g,S,v,P),P=this.getImageryFromCache(x,b,u),r.imagery.splice(i,0,new TileImagery(P,E,a)),++i)}}return!0},ImageryLayer.prototype._calculateTextureTranslationAndScale=function(e,t){var i=t.readyImagery.rectangle,r=e.rectangle;t.useWebMercatorT&&(i=(a=t.readyImagery.imageryLayer.imageryProvider.tilingScheme).rectangleToNativeRectangle(i,imageryBoundsScratch),r=a.rectangleToNativeRectangle(r,terrainRectangleScratch));var n=r.width,e=r.height,t=n/i.width,a=e/i.height;return new Cartesian4(t*(r.west-i.west)/n,a*(r.south-i.south)/e,t,a)},ImageryLayer.prototype._requestImagery=function(i){var r=this._imageryProvider,n=this;function t(e){if(!defined(e))return a();i.image=e,i.state=ImageryState$1.RECEIVED,i.request=void 0,TileProviderError.handleSuccess(n._requestImageError)}function a(e){if(i.request.state===RequestState$1.CANCELLED)return i.state=ImageryState$1.UNLOADED,void(i.request=void 0);i.state=ImageryState$1.FAILED,i.request=void 0;var t="Failed to obtain image tile X: "+i.x+" Y: "+i.y+" Level: "+i.level+".";n._requestImageError=TileProviderError.handleError(n._requestImageError,r,r.errorEvent,t,i.x,i.y,i.level,o,e)}function o(){var e=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.IMAGERY});i.request=e,i.state=ImageryState$1.TRANSITIONING;e=r.requestImage(i.x,i.y,i.level,e);if(!defined(e))return i.state=ImageryState$1.UNLOADED,void(i.request=void 0);defined(r.getTileCredits)&&(i.credits=r.getTileCredits(i.x,i.y,i.level)),when(e,t,a)}o()},ImageryLayer.prototype._createTextureWebGL=function(e,t){var i=new Sampler({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),t=t.image;return defined(t.internalFormat)?new Texture({context:e,pixelFormat:t.internalFormat,width:t.width,height:t.height,source:{arrayBufferView:t.bufferView},sampler:i}):new Texture({context:e,source:t,pixelFormat:this._imageryProvider.hasAlphaChannel?PixelFormat$1.RGBA:PixelFormat$1.RGB,sampler:i})},ImageryLayer.prototype._createTexture=function(e,t){var i=this._imageryProvider,r=t.image;if(defined(i.tileDiscardPolicy)){var n=i.tileDiscardPolicy;if(defined(n)){if(!n.isReady())return void(t.state=ImageryState$1.RECEIVED);if(n.shouldDiscardImage(r))return void(t.state=ImageryState$1.INVALID)}}e=this._createTextureWebGL(e,t);i.tilingScheme.projection instanceof WebMercatorProjection?t.textureWebMercator=e:t.texture=e,t.image=void 0,t.state=ImageryState$1.TEXTURE_LOADED},ImageryLayer.prototype._finalizeReprojectTexture=function(e,t){var i,r,n,a,o=this.minificationFilter,s=this.magnificationFilter;o===TextureMinificationFilter$1.LINEAR&&s===TextureMagnificationFilter$1.LINEAR&&!PixelFormat$1.isCompressedFormat(t.pixelFormat)&&CesiumMath.isPowerOfTwo(t.width)&&CesiumMath.isPowerOfTwo(t.height)?(o=TextureMinificationFilter$1.LINEAR_MIPMAP_LINEAR,a=ContextLimits.maximumTextureFilterAnisotropy,i=getSamplerKey(o,s,n=Math.min(a,defaultValue(this._maximumAnisotropy,a))),defined(r=e.cache.imageryLayerMipmapSamplers)||(r={},e.cache.imageryLayerMipmapSamplers=r),defined(a=r[i])||(a=r[i]=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:o,magnificationFilter:s,maximumAnisotropy:n})),t.generateMipmap(MipmapHint$1.NICEST),t.sampler=a):(n=getSamplerKey(o,s,0),defined(a=e.cache.imageryLayerNonMipmapSamplers)||(a={},e.cache.imageryLayerNonMipmapSamplers=a),defined(e=a[n])||(e=a[n]=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:o,magnificationFilter:s})),t.sampler=e)},ImageryLayer.prototype._reprojectTexture=function(e,t,i){var r,n=t.textureWebMercator||t.texture,a=t.rectangle,o=e.context;(i=defaultValue(i,!0))&&!(this._imageryProvider.tilingScheme.projection instanceof GeographicProjection)&&1e-5<a.width/n.width?(r=this,t.addReference(),a=new ComputeCommand({persists:!0,owner:this,preExecute:function(e){reprojectToGeographic(e,o,n,t.rectangle)},postExecute:function(e){t.texture=e,r._finalizeReprojectTexture(o,e),t.state=ImageryState$1.READY,t.releaseReference()},canceled:function(){t.state=ImageryState$1.TEXTURE_LOADED,t.releaseReference()}}),this._reprojectComputeCommands.push(a)):(i&&(t.texture=n),this._finalizeReprojectTexture(o,n),t.state=ImageryState$1.READY)},ImageryLayer.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,i=t.length,r=0;r<i;++r)e.commandList.push(t[r]);t.length=0},ImageryLayer.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){defined(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0},ImageryLayer.prototype.getImageryFromCache=function(e,t,i,r){var n=getImageryCacheKey(e,t,i),a=this._imageryCache[n];return defined(a)||(a=new Imagery(this,e,t,i,r),this._imageryCache[n]=a),a.addReference(),a},ImageryLayer.prototype.removeImageryFromCache=function(e){e=getImageryCacheKey(e.x,e.y,e.level);delete this._imageryCache[e]};var uniformMap={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new Cartesian2,texture:void 0},float32ArrayScratch=FeatureDetection.supportsTypedArrays()?new Float32Array(128):void 0;function reprojectToGeographic(e,t,i,r){var n=t.cache.imageryLayer_reproject;if(!defined(n)){n=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){defined(this.framebuffer)&&this.framebuffer.destroy(),defined(this.vertexArray)&&this.vertexArray.destroy(),defined(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),o=0,s=0;s<64;++s){var l=s/63;a[o++]=0,a[o++]=l,a[o++]=1,a[o++]=l}var c={position:0,webMercatorT:1},u=TerrainProvider.getRegularGridIndices(2,64),u=Buffer$1.createIndexBuffer({context:t,typedArray:u,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT});n.vertexArray=new VertexArray({context:t,attributes:[{index:c.position,vertexBuffer:Buffer$1.createVertexBuffer({context:t,typedArray:a,usage:BufferUsage$1.STATIC_DRAW}),componentsPerAttribute:2},{index:c.webMercatorT,vertexBuffer:Buffer$1.createVertexBuffer({context:t,sizeInBytes:512,usage:BufferUsage$1.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:u});u=new ShaderSource({sources:[ReprojectWebMercatorVS]});n.shaderProgram=ShaderProgram.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:ReprojectWebMercatorFS,attributeLocations:c}),n.sampler=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}i.sampler=n.sampler;u=i.width,c=i.height;uniformMap.textureDimensions.x=u,uniformMap.textureDimensions.y=c,uniformMap.texture=i;var d=Math.sin(r.south),h=.5*Math.log((1+d)/(1-d));d=Math.sin(r.north);var p=1/(.5*Math.log((1+d)/(1-d))-h),i=new Texture({context:t,width:u,height:c,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});CesiumMath.isPowerOfTwo(u)&&CesiumMath.isPowerOfTwo(c)&&i.generateMipmap(MipmapHint$1.NICEST);for(var m=r.south,f=r.north,g=float32ArrayScratch,_=0,y=0;y<64;++y){var C=y/63,C=CesiumMath.lerp(m,f,C),d=Math.sin(C),C=(.5*Math.log((1+d)/(1-d))-h)*p;g[_++]=C,g[_++]=C}n.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(g),e.shaderProgram=n.shaderProgram,e.outputTexture=i,e.uniformMap=uniformMap,e.vertexArray=n.vertexArray}function getLevelWithMaximumTexelSpacing(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,a=n.ellipsoid,e=e._imageryProvider.tilingScheme.projection instanceof GeographicProjection?1:Math.cos(i),i=n.rectangle,t=a.maximumRadius*i.width*e/(r.tileWidth*n.getNumberOfXTilesAtLevel(0))/t,t=Math.log(t)/Math.log(2);return 0|Math.round(t)}var TileSelectionResult={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=TileSelectionResult.RENDERED_AND_KICKED},originalResult:function(e){return 3&e},kick:function(e){return 4|e}};function TerrainFillMesh(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new Cartesian4}TerrainFillMesh.prototype.update=function(e,t,i){this.changedThisFrame&&(createFillMesh(e,t,this.tile,i),this.changedThisFrame=!1)},TerrainFillMesh.prototype.destroy=function(e){defined(this.vertexArray)&&(defined(e)?e.push(this.vertexArray):GlobeSurfaceTile._freeVertexArray(this.vertexArray,e),this.vertexArray=void 0),defined(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};var traversalQueueScratch=new Queue;function visitRenderedTiles(e,t,i,r,n,a,o,s,l){if(void 0!==r){for(var c=r;c&&(c._lastSelectionResultFrame!==n||TileSelectionResult.wasKicked(c._lastSelectionResult)||TileSelectionResult.originalResult(c._lastSelectionResult)===TileSelectionResult.CULLED);){if(o)return;var u=c.parent;if(a>=TileEdge.NORTHWEST&&void 0!==u)switch(a){case TileEdge.NORTHWEST:c=c===u.northwestChild?u:void 0;break;case TileEdge.NORTHEAST:c=c===u.northeastChild?u:void 0;break;case TileEdge.SOUTHWEST:c=c===u.southwestChild?u:void 0;break;case TileEdge.SOUTHEAST:c=c===u.southeastChild?u:void 0}else c=u}if(void 0!==c){if(c._lastSelectionResult===TileSelectionResult.RENDERED)return!defined(c.data.vertexArray)&&void visitTile$2(e,t,i,c,a,n,s,l);if(TileSelectionResult.originalResult(r._lastSelectionResult)!==TileSelectionResult.CULLED)switch(a){case TileEdge.WEST:visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l);break;case TileEdge.EAST:visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l);break;case TileEdge.SOUTH:visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l);break;case TileEdge.NORTH:visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l),visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l);break;case TileEdge.NORTHWEST:visitRenderedTiles(e,t,i,r.northwestChild,n,a,!0,s,l);break;case TileEdge.NORTHEAST:visitRenderedTiles(e,t,i,r.northeastChild,n,a,!0,s,l);break;case TileEdge.SOUTHWEST:visitRenderedTiles(e,t,i,r.southwestChild,n,a,!0,s,l);break;case TileEdge.SOUTHEAST:visitRenderedTiles(e,t,i,r.southeastChild,n,a,!0,s,l);break;default:throw new DeveloperError("Invalid edge")}}}}function visitTile$2(e,t,i,r,n,a,o,s){var l=r.data;if(void 0===l.fill)l.fill=new TerrainFillMesh(r);else if(l.fill.visitedFrame===a)return;l.fill.enqueuedFrame!==a&&(l.fill.enqueuedFrame=a,l.fill.changedThisFrame=!1,o.enqueue(r)),propagateEdge(e,t,i,r,n,s)}function propagateEdge(e,t,i,r,n,a){var o,s,l,c,u,d=r.data.fill,h=i.data.fill,p=defined(h)?(h.visitedFrame=t.frameNumber,h.changedThisFrame&&(createFillMesh(e,t,i,a),h.changedThisFrame=!1),i.data.fill.mesh):i.data.mesh;switch(n){case TileEdge.WEST:o=d.westMeshes,s=d.westTiles;break;case TileEdge.SOUTH:o=d.southMeshes,s=d.southTiles;break;case TileEdge.EAST:o=d.eastMeshes,s=d.eastTiles;break;case TileEdge.NORTH:o=d.northMeshes,s=d.northTiles;break;case TileEdge.NORTHWEST:return d.changedThisFrame=d.changedThisFrame||d.northwestMesh!==p,d.northwestMesh=p,void(d.northwestTile=i);case TileEdge.NORTHEAST:return d.changedThisFrame=d.changedThisFrame||d.northeastMesh!==p,d.northeastMesh=p,void(d.northeastTile=i);case TileEdge.SOUTHWEST:return d.changedThisFrame=d.changedThisFrame||d.southwestMesh!==p,d.southwestMesh=p,void(d.southwestTile=i);case TileEdge.SOUTHEAST:return d.changedThisFrame=d.changedThisFrame||d.southeastMesh!==p,d.southeastMesh=p,void(d.southeastTile=i)}if(i.level<=r.level)return d.changedThisFrame=d.changedThisFrame||o[0]!==p||1!==o.length,o[0]=p,s[0]=i,o.length=1,void(s.length=1);var m,f=i.rectangle,g=r.rectangle;switch(n){case TileEdge.WEST:for(m=(g.north-g.south)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.greaterThan(f.north,u.south,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.greaterThanOrEquals(f.south,u.north,m));++c);break;case TileEdge.SOUTH:for(m=(g.east-g.west)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.lessThan(f.west,u.east,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.lessThanOrEquals(f.east,u.west,m));++c);break;case TileEdge.EAST:for(m=(g.north-g.south)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.lessThan(f.south,u.north,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.lessThanOrEquals(f.north,u.south,m));++c);break;case TileEdge.NORTH:for(m=(g.east-g.west)*CesiumMath.EPSILON5,l=0;l<s.length&&(u=s[l].rectangle,!CesiumMath.greaterThan(f.east,u.west,m));++l);for(c=l;c<s.length&&(u=s[c].rectangle,!CesiumMath.greaterThanOrEquals(f.west,u.east,m));++c);}c-l==1?(d.changedThisFrame=d.changedThisFrame||o[l]!==p,o[l]=p,s[l]=i):(d.changedThisFrame=!0,o.splice(l,c-l,p),s.splice(l,c-l,i))}TerrainFillMesh.updateFillTiles=function(e,t,i,r){var n=e._quadtree,a=n._levelZeroTiles,o=n._lastSelectionFrameNumber,s=traversalQueueScratch;s.clear();for(var l=0;l<t.length;++l)defined(t[l].data.vertexArray)&&s.enqueue(t[l]);for(var c=s.dequeue();void 0!==c;){var u=c.findTileToWest(a),d=c.findTileToSouth(a),h=c.findTileToEast(a),p=c.findTileToNorth(a);visitRenderedTiles(e,i,c,u,o,TileEdge.EAST,!1,s,r),visitRenderedTiles(e,i,c,d,o,TileEdge.NORTH,!1,s,r),visitRenderedTiles(e,i,c,h,o,TileEdge.WEST,!1,s,r),visitRenderedTiles(e,i,c,p,o,TileEdge.SOUTH,!1,s,r);d=u.findTileToNorth(a),p=u.findTileToSouth(a),u=h.findTileToNorth(a),h=h.findTileToSouth(a);visitRenderedTiles(e,i,c,d,o,TileEdge.SOUTHEAST,!1,s,r),visitRenderedTiles(e,i,c,u,o,TileEdge.SOUTHWEST,!1,s,r),visitRenderedTiles(e,i,c,p,o,TileEdge.NORTHEAST,!1,s,r),visitRenderedTiles(e,i,c,h,o,TileEdge.NORTHWEST,!1,s,r),c=s.dequeue()}};var cartographicScratch$3=new Cartographic,centerCartographicScratch=new Cartographic,cartesianScratch=new Cartesian3,normalScratch$5=new Cartesian3,octEncodedNormalScratch=new Cartesian2,uvScratch2=new Cartesian2,uvScratch=new Cartesian2;function HeightAndNormal(){this.height=0,this.encodedNormal=new Cartesian2}function fillMissingCorner(e,t,i,r,n,a,o,s,l){if(defined(n))return n;var c=defined(a)&&defined(o)?.5*(a.height+o.height):defined(a)?a.height:defined(o)?o.height:defined(s)?s.height:(c=o=0,defined(s=e.tile.data.tileBoundingRegion)&&(o=s.minimumHeight,c=s.maximumHeight),.5*(o+c));return getVertexWithHeightAtCorner(e,t,i,r,c,l),l}var heightRangeScratch={minimumHeight:0,maximumHeight:0},swVertexScratch=new HeightAndNormal,seVertexScratch=new HeightAndNormal,nwVertexScratch=new HeightAndNormal,neVertexScratch=new HeightAndNormal,heightmapBuffer="undefined"!=typeof Uint8Array?new Uint8Array(81):void 0;function createFillMesh(e,t,i,r){GlobeSurfaceTile.initialize(i,e.terrainProvider,e._imageryLayers);var n=i.data,a=n.fill,o=i.rectangle,s=i.tilingScheme.ellipsoid,l=getCorner(a,s,0,1,a.northwestTile,a.northwestMesh,a.northTiles,a.northMeshes,a.westTiles,a.westMeshes,nwVertexScratch),c=getCorner(a,s,0,0,a.southwestTile,a.southwestMesh,a.westTiles,a.westMeshes,a.southTiles,a.southMeshes,swVertexScratch),u=getCorner(a,s,1,0,a.southeastTile,a.southeastMesh,a.southTiles,a.southMeshes,a.eastTiles,a.eastMeshes,seVertexScratch),l=fillMissingCorner(a,s,0,1,l,c,d=getCorner(a,s,1,1,a.northeastTile,a.northeastMesh,a.eastTiles,a.eastMeshes,a.northTiles,a.northMeshes,neVertexScratch),u,nwVertexScratch),c=fillMissingCorner(a,s,0,0,c,l,u,d,swVertexScratch),u=fillMissingCorner(a,s,1,1,u,c,d,l,seVertexScratch),d=fillMissingCorner(a,s,1,1,d,u,l,c,neVertexScratch),h=c.height,p=u.height,m=l.height,f=d.height,g=Math.min(h,p,m,f),_=Math.max(h,p,m,f),y=.5*(g+_),h=e.getLevelMaximumGeometricError(i.level),p=s.maximumRadius-h,m=4*Math.acos(p/s.maximumRadius);if(m*=1.5,o.width>m&&_-g<=h){var C=new HeightmapTerrainData({width:9,height:9,buffer:heightmapBuffer,structure:{heightOffset:_}});a.mesh=C._createMeshSync(i.tilingScheme,i.x,i.y,i.level,1)}else{var v=new TerrainEncoding(void 0,void 0,void 0,void 0,!0,!0),f=centerCartographicScratch;f.longitude=.5*(o.east+o.west),f.latitude=.5*(o.north+o.south),f.height=y,v.center=s.cartographicToCartesian(f,v.center);for(var S=5,T=a.westMeshes,x=0,b=T.length;x<b;++x)S+=T[x].eastIndicesNorthToSouth.length;for(x=0,b=(T=a.southMeshes).length;x<b;++x)S+=T[x].northIndicesWestToEast.length;for(x=0,b=(T=a.eastMeshes).length;x<b;++x)S+=T[x].westIndicesSouthToNorth.length;for(x=0,b=(T=a.northMeshes).length;x<b;++x)S+=T[x].southIndicesEastToWest.length;p=heightRangeScratch;p.minimumHeight=g,p.maximumHeight=_;var m=v.getStride(),h=new Float32Array(S*m),C=0,E=C=addEdge(a,s,v,h,C=addVertexWithComputedPosition(s,o,v,h,0,0,1,l.height,l.encodedNormal,1,p),a.westTiles,a.westMeshes,TileEdge.EAST,p),P=C=addEdge(a,s,v,h,C=addVertexWithComputedPosition(s,o,v,h,C,0,0,c.height,c.encodedNormal,0,p),a.southTiles,a.southMeshes,TileEdge.NORTH,p),A=C=addEdge(a,s,v,h,C=addVertexWithComputedPosition(s,o,v,h,C,1,0,u.height,u.encodedNormal,0,p),a.eastTiles,a.eastMeshes,TileEdge.WEST,p);C=addEdge(a,s,v,h,C=addVertexWithComputedPosition(s,o,v,h,C,1,1,d.height,d.encodedNormal,1,p),a.northTiles,a.northMeshes,TileEdge.SOUTH,p),g=p.minimumHeight,_=p.maximumHeight;u=OrientedBoundingBox.fromRectangle(o,g,_,i.tilingScheme.ellipsoid),d=WebMercatorProjection.geodeticLatitudeToMercatorAngle(o.south),p=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(o.north)-d),p=(WebMercatorProjection.geodeticLatitudeToMercatorAngle(f.latitude)-d)*p;s.geodeticSurfaceNormalCartographic(cartographicScratch$3,normalScratch$5);var s=AttributeCompression.octEncode(normalScratch$5,octEncodedNormalScratch),w=C;v.encode(h,C*m,u.center,Cartesian2.fromElements(.5,.5,uvScratch),y,s,p);var D,M=++C,p=3*(M-1);D=p*(M<256?1:2)<=(h.length-M*m)*Float32Array.BYTES_PER_ELEMENT?(C=M*m*Float32Array.BYTES_PER_ELEMENT,new(M<256?Uint8Array:Uint16Array)(h.buffer,C,p)):new(M<256?Uint8Array:Uint16Array)(p),h=new Float32Array(h.buffer,0,M*m);var I=0;for(x=0;x<M-2;++x)D[I++]=w,D[I++]=x,D[I++]=x+1;D[I++]=w,D[I++]=x,D[I++]=0;var R=[];for(x=E;0<=x;--x)R.push(x);var O=[];for(x=P;E<=x;--x)O.push(x);var L=[];for(x=A;P<=x;--x)L.push(x);var F=[];for(F.push(0),x=w-1;A<=x;--x)F.push(x);a.mesh=new TerrainMesh(v.center,h,D,p,M,g,_,BoundingSphere.fromOrientedBoundingBox(u),computeOccludeePoint(e,u.center,o,g,_),v.getStride(),u,v,t.terrainExaggeration,R,O,L,F)}v=t.context;defined(a.vertexArray)&&(defined(r)?r.push(a.vertexArray):GlobeSurfaceTile._freeVertexArray(a.vertexArray)),a.vertexArray=GlobeSurfaceTile._createVertexArrayForMesh(v,a.mesh),n.processImagery(i,e.terrainProvider,t,!0);t=a.waterMaskTexture;a.waterMaskTexture=void 0,!e.terrainProvider.hasWaterMask||defined(e=n._findAncestorTileWithTerrainData(i))&&defined(e.data.waterMaskTexture)&&(a.waterMaskTexture=e.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,n._computeWaterMaskTranslationAndScale(i,e,a.waterMaskTranslationAndScale)),defined(t)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function addVertexWithComputedPosition(e,t,i,r,n,a,o,s,l,c,u){var d=cartographicScratch$3;d.longitude=CesiumMath.lerp(t.west,t.east,a),d.latitude=CesiumMath.lerp(t.south,t.north,o),d.height=s;e=e.cartographicToCartesian(d,cartesianScratch),d=uvScratch2;return d.x=a,d.y=o,i.encode(r,n*i.getStride(),e,d,s,l,c),u.minimumHeight=Math.min(u.minimumHeight,s),u.maximumHeight=Math.max(u.maximumHeight,s),n+1}var sourceRectangleScratch=new Rectangle;function transformTextureCoordinates(e,t,i,r){var n=e.rectangle,a=t.rectangle;0===t.x&&1===i.x&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?((n=Rectangle.clone(e.rectangle,sourceRectangleScratch)).west-=CesiumMath.TWO_PI,n.east-=CesiumMath.TWO_PI):0===e.x&&0===i.x&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&((n=Rectangle.clone(e.rectangle,sourceRectangleScratch)).west+=CesiumMath.TWO_PI,n.east+=CesiumMath.TWO_PI);var o=n.east-n.west,s=(a.west-n.west)/o,t=(a.east-n.west)/o,e=n.north-n.south,o=(a.south-n.south)/e,e=(a.north-n.south)/e,s=(i.x-s)/(t-s),o=(i.y-o)/(e-o);return Math.abs(s)<Math.EPSILON5?s=0:Math.abs(s-1)<Math.EPSILON5&&(s=1),Math.abs(o)<Math.EPSILON5?o=0:Math.abs(o-1)<Math.EPSILON5&&(o=1),r.x=s,r.y=o,r}var encodedNormalScratch=new Cartesian2;function getVertexFromTileAtCorner(e,t,i,r,n){var a=e.encoding,e=e.vertices;n.height=a.decodeHeight(e,t),a.hasVertexNormals?a.getOctEncodedNormal(e,t,n.encodedNormal):((n=n.encodedNormal).x=0,n.y=0)}var encodedNormalScratch2=new Cartesian2,cartesianScratch2=new Cartesian3;function getInterpolatedVertexAtCorner(e,t,i,r,n,a,o,s,l,c){var u,d=r.encoding,h=r.vertices,r=transformTextureCoordinates(t,i,d.decodeTextureCoordinates(h,n,uvScratch),uvScratch),t=transformTextureCoordinates(t,i,d.decodeTextureCoordinates(h,a,uvScratch2),uvScratch2),l=l?(o-r.x)/(t.x-r.x):(s-r.y)/(t.y-r.y),t=d.decodeHeight(h,n),r=d.decodeHeight(h,a),i=i.rectangle;cartographicScratch$3.longitude=CesiumMath.lerp(i.west,i.east,o),cartographicScratch$3.latitude=CesiumMath.lerp(i.south,i.north,s),c.height=cartographicScratch$3.height=CesiumMath.lerp(t,r,l),d.hasVertexNormals?(n=d.getOctEncodedNormal(h,n,encodedNormalScratch),u=d.getOctEncodedNormal(h,a,encodedNormalScratch2),n=AttributeCompression.octDecode(n.x,n.y,cartesianScratch),u=AttributeCompression.octDecode(u.x,u.y,cartesianScratch2),u=Cartesian3.lerp(n,u,l,cartesianScratch),Cartesian3.normalize(u,u)):u=e.geodeticSurfaceNormalCartographic(cartographicScratch$3,cartesianScratch),AttributeCompression.octEncode(u,c.encodedNormal)}function getVertexWithHeightAtCorner(e,t,i,r,n,a){a.height=n;t=t.geodeticSurfaceNormalCartographic(cartographicScratch$3,cartesianScratch);AttributeCompression.octEncode(t,a.encodedNormal)}function getCorner(e,t,i,r,n,a,o,s,l,c,u){return getCornerFromEdge(e,t,s,o,!1,i,r,u)||getCornerFromEdge(e,t,c,l,!0,i,r,u)?u:meshIsUsable(n,a)?(getVertexFromTileAtCorner(a,(0===i?0===r?a.eastIndicesNorthToSouth:a.southIndicesEastToWest:0===r?a.northIndicesWestToEast:a.westIndicesSouthToNorth)[0],i,r,u),u):defined(a=0===i?0===r?getClosestHeightToCorner(e.westMeshes,e.westTiles,TileEdge.EAST,e.southMeshes,e.southTiles,TileEdge.NORTH):getClosestHeightToCorner(e.northMeshes,e.northTiles,TileEdge.SOUTH,e.westMeshes,e.westTiles,TileEdge.EAST):0===r?getClosestHeightToCorner(e.southMeshes,e.southTiles,TileEdge.NORTH,e.eastMeshes,e.eastTiles,TileEdge.WEST):getClosestHeightToCorner(e.eastMeshes,e.eastTiles,TileEdge.WEST,e.northMeshes,e.northTiles,TileEdge.SOUTH))?(getVertexWithHeightAtCorner(e,t,i,r,a,u),u):void 0}function getClosestHeightToCorner(e,t,i,r,n,a,o,s){i=getNearestHeightOnEdge(e,t,!1,i),a=getNearestHeightOnEdge(r,n,!0,a);return defined(i)&&defined(a)?.5*(i+a):defined(i)?i:a}function addEdge(e,t,i,r,n,a,o,s,l){for(var c=0;c<a.length;++c)n=addEdgeMesh(e,t,i,r,n,a[c],o[c],s,l);return n}function addEdgeMesh(e,t,i,r,n,a,o,s,l){var c=a.rectangle;s===TileEdge.EAST&&0===e.tile.x?((c=Rectangle.clone(a.rectangle,sourceRectangleScratch)).west-=CesiumMath.TWO_PI,c.east-=CesiumMath.TWO_PI):s===TileEdge.WEST&&0===a.x&&((c=Rectangle.clone(a.rectangle,sourceRectangleScratch)).west+=CesiumMath.TWO_PI,c.east+=CesiumMath.TWO_PI);var u,d,h,p,m=e.tile.rectangle;switch(0<n&&(i.decodeTextureCoordinates(r,n-1,uvScratch),u=uvScratch.x,d=uvScratch.y),s){case TileEdge.WEST:h=o.westIndicesSouthToNorth,p=!1;break;case TileEdge.NORTH:h=o.northIndicesWestToEast,p=!0;break;case TileEdge.EAST:h=o.eastIndicesNorthToSouth,p=!1;break;case TileEdge.SOUTH:h=o.southIndicesEastToWest,p=!0}var f,g,_=a,y=e.tile,C=o.encoding,v=o.vertices,S=i.getStride();C.hasWebMercatorT&&(f=WebMercatorProjection.geodeticLatitudeToMercatorAngle(m.south),g=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(m.north)-f));for(var T=0;T<h.length;++T){var x=h[T],b=C.decodeTextureCoordinates(v,x,uvScratch);transformTextureCoordinates(_,y,b,b);var E,P=b.x,A=b.y,w=p?P:A;w<0||1<w||Math.abs(P-u)<CesiumMath.EPSILON5&&Math.abs(A-d)<CesiumMath.EPSILON5||(w=Math.abs(P)<CesiumMath.EPSILON5||Math.abs(P-1)<CesiumMath.EPSILON5,P=Math.abs(A)<CesiumMath.EPSILON5||Math.abs(A-1)<CesiumMath.EPSILON5,w&&P||(w=C.decodePosition(v,x,cartesianScratch),P=C.decodeHeight(v,x),C.hasVertexNormals?E=C.getOctEncodedNormal(v,x,octEncodedNormalScratch):((E=octEncodedNormalScratch).x=0,E.y=0),x=A,C.hasWebMercatorT&&(A=CesiumMath.lerp(m.south,m.north,A),x=(WebMercatorProjection.geodeticLatitudeToMercatorAngle(A)-f)*g),i.encode(r,n*S,w,b,P,E,x),l.minimumHeight=Math.min(l.minimumHeight,P),l.maximumHeight=Math.max(l.maximumHeight,P),++n))}return n}function getNearestHeightOnEdge(e,t,i,r,n,a){for(var o,s,l=i?(o=0,s=e.length,1):(o=e.length-1,s=-1),c=o;c!==s;c+=l){var u,d=e[c];if(meshIsUsable(t[c],d)){switch(r){case TileEdge.WEST:u=d.westIndicesSouthToNorth;break;case TileEdge.SOUTH:u=d.southIndicesEastToWest;break;case TileEdge.EAST:u=d.eastIndicesNorthToSouth;break;case TileEdge.NORTH:u=d.northIndicesWestToEast}var h=u[i?0:u.length-1];if(defined(h))return d.encoding.decodeHeight(d.vertices,h)}}}function meshIsUsable(e,t){return defined(t)&&(!defined(e.data.fill)||!e.data.fill.changedThisFrame)}function getCornerFromEdge(i,e,t,r,n,a,o,s){var l,c,u,d=r[n?0:t.length-1],h=t[n?0:t.length-1];if(meshIsUsable(d,h)&&(u=0===a?0===o?(l=n?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,c=n):(l=n?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,c=!n,!1):0===o?(l=n?h.westIndicesSouthToNorth:h.northIndicesWestToEast,c=!n,!0):(l=n?h.southIndicesEastToWest:h.westIndicesSouthToNorth,!(c=n)),0<l.length)){t=l[r=n?0:l.length-1],h.encoding.decodeTextureCoordinates(h.vertices,t,uvScratch);n=transformTextureCoordinates(d,i.tile,uvScratch,uvScratch);if(n.x===a&&n.y===o)return getVertexFromTileAtCorner(h,t,a,o,s),!0;if(!((r=binarySearch(l,c?a:o,function(e,t){h.encoding.decodeTextureCoordinates(h.vertices,e,uvScratch);e=transformTextureCoordinates(d,i.tile,uvScratch,uvScratch);return u?c?e.x-a:e.y-o:c?a-e.x:o-e.y}))<0))return getVertexFromTileAtCorner(h,l[r],a,o,s),!0;if(0<(r=~r)&&r<l.length)return getInterpolatedVertexAtCorner(e,d,i.tile,h,l[r-1],l[r],a,o,c,s),!0}return!1}var cornerPositionsScratch=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeOccludeePoint(e,t,i,r,n,a){var o=e.quadtree._occluders.ellipsoid,s=o.ellipsoid,e=cornerPositionsScratch;return Cartesian3.fromRadians(i.west,i.south,n,s,e[0]),Cartesian3.fromRadians(i.east,i.south,n,s,e[1]),Cartesian3.fromRadians(i.west,i.north,n,s,e[2]),Cartesian3.fromRadians(i.east,i.north,n,s,e[3]),o.computeHorizonCullingPointPossiblyUnderEllipsoid(t,e,r,a)}function GlobeSurfaceTileProvider(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=ShadowMode$1.RECEIVE_ONLY,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new Event,this._imageryLayers.layerAdded.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new Event,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new Color(0,0,.5,1),this._clippingPlanes=void 0,this.cartographicLimitRectangle=Rectangle.clone(Rectangle.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}function sortTileImageryByLayerIndex(e,t){var i=e.loadingImagery;defined(i)||(i=e.readyImagery);e=t.loadingImagery;return defined(e)||(e=t.readyImagery),i.imageryLayer._layerIndex-e.imageryLayer._layerIndex}function updateCredits(e,t){var i=t.creditDisplay;e._terrainProvider.ready&&defined(e._terrainProvider.credit)&&i.addCredit(e._terrainProvider.credit);for(var r=e._imageryLayers,n=0,a=r.length;n<a;++n){var o=r.get(n).imageryProvider;o.ready&&defined(o.credit)&&i.addCredit(o.credit)}}function pushCommand(e,t){var i,r=t.globeTranslucencyState;r.translucent?(i=e.renderState.blending.enabled,r.pushDerivedCommands(e,i,t)):t.commandList.push(e)}Object.defineProperties(GlobeSurfaceTileProvider.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=Cartesian4.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},ready:{get:function(){return this._terrainProvider.ready&&(0===this._imageryLayers.length||this._imageryLayers.get(0).imageryProvider.ready)}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,defined(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}}}),GlobeSurfaceTileProvider.prototype.update=function(e){this._imageryLayers._update()},GlobeSurfaceTileProvider.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(sortTileImageryByLayerIndex)})),updateCredits(this,e);for(var t=this._vertexArraysToDestroy,i=t.length,r=0;r<i;++r)GlobeSurfaceTile._freeVertexArray(t[r]);t.length=0},GlobeSurfaceTileProvider.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];defined(n)&&(n.length=0)}var a=this._clippingPlanes;defined(a)&&a.enabled&&a.update(e),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1},GlobeSurfaceTileProvider.prototype.endUpdate=function(e){var t;defined(this._renderState)||(this._renderState=RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:DepthFunction$1.LESS}}),this._blendRenderState=RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:DepthFunction$1.LESS_OR_EQUAL},blending:BlendingState$1.ALPHA_BLEND}),(t=clone(this._renderState,!0)).cull.enabled=!1,this._disableCullingRenderState=RenderState.fromCache(t),(t=clone(this._blendRenderState,!0)).cull.enabled=!1,this._disableCullingBlendRenderState=RenderState.fromCache(t)),this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&TerrainFillMesh.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);for(var i=this._tilesToRenderByTextureCount,r=0,n=i.length;r<n;++r){var a=i[r];if(defined(a))for(var o=0,s=a.length;o<s;++o){var l=a[o],c=l.data.tileBoundingRegion;addDrawCommandsForTile(this,l,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,c.minimumHeight)}}},GlobeSurfaceTileProvider.prototype.updateForPick=function(e){for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)pushCommand(t[i],e)},GlobeSurfaceTileProvider.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},GlobeSurfaceTileProvider.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},GlobeSurfaceTileProvider.prototype.loadTile=function(e,t){var i,r=t.data,n=!0;defined(r)&&(n=r.boundingVolumeSourceTile!==t||t._lastSelectionResult===TileSelectionResult.CULLED_BUT_NEEDED,i=r.terrainState),GlobeSurfaceTile.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this._vertexArraysToDestroy,n),r=t.data,n&&i!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==Visibility$1.NONE&&r.boundingVolumeSourceTile===t&&(n=!1,GlobeSurfaceTile.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this._vertexArraysToDestroy,n))};var boundingSphereScratch$1=new BoundingSphere,rectangleIntersectionScratch=new Rectangle,splitCartographicLimitRectangleScratch=new Rectangle,rectangleCenterScratch$3=new Cartographic;function clipRectangleAntimeridian(e,t){if(t.west<t.east)return t;t=Rectangle.clone(t,splitCartographicLimitRectangleScratch);return 0<Rectangle.center(e,rectangleCenterScratch$3).longitude?t.east=CesiumMath.PI:t.west=-CesiumMath.PI,t}function isUndergroundVisible(e,t){if(t.cameraUnderground)return!0;if(t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;t=e._clippingPlanes;return!(!defined(t)||!t.enabled)||!Rectangle.equals(e.cartographicLimitRectangle,Rectangle.MAX_VALUE)}GlobeSurfaceTileProvider.prototype.computeTileVisibility=function(e,t,i){var r=this.computeDistanceToTile(e,t);e._distance=r;var n=isUndergroundVisible(this,t);if(t.fog.enabled&&!n&&1<=CesiumMath.fog(r,t.fog.density))return Visibility$1.NONE;var a=e.data,o=a.tileBoundingRegion;if(void 0===a.boundingVolumeSourceTile)return Visibility$1.PARTIAL;var s=t.cullingVolume,l=a.orientedBoundingBox;!defined(l)&&defined(a.renderedMesh)&&(l=a.renderedMesh.boundingSphere3D),a.clippedByBoundaries=!1;r=clipRectangleAntimeridian(e.rectangle,this.cartographicLimitRectangle),r=Rectangle.simpleIntersection(r,e.rectangle,rectangleIntersectionScratch);if(!defined(r))return Visibility$1.NONE;if(Rectangle.equals(r,e.rectangle)||(a.clippedByBoundaries=!0),t.mode!==SceneMode$1.SCENE3D&&(l=boundingSphereScratch$1,BoundingSphere.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,o.minimumHeight,o.maximumHeight,l),Cartesian3.fromElements(l.center.z,l.center.x,l.center.y,l.center),t.mode===SceneMode$1.MORPHING&&defined(a.renderedMesh)&&(l=BoundingSphere.union(a.renderedMesh.boundingSphere3D,l,l))),!defined(l))return Visibility$1.PARTIAL;var c,r=this._clippingPlanes;if(defined(r)&&r.enabled){r=r.computeIntersectionWithBoundingVolume(l);if(e.isClipped=r!==Intersect$1.INSIDE,r===Intersect$1.OUTSIDE)return Visibility$1.NONE}l=s.computeVisibility(l);if(l===Intersect$1.OUTSIDE?c=Visibility$1.NONE:l===Intersect$1.INTERSECTING?c=Visibility$1.PARTIAL:l===Intersect$1.INSIDE&&(c=Visibility$1.FULL),c===Visibility$1.NONE)return c;l=t.mode===SceneMode$1.SCENE3D&&t.camera.frustum instanceof OrthographicFrustum;if(t.mode!==SceneMode$1.SCENE3D||l||!defined(i)||n)return c;a=a.occludeePointInScaledSpace;return!defined(a)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(a,o.minimumHeight)?c:Visibility$1.NONE},GlobeSurfaceTileProvider.prototype.canRefine=function(e){return!!defined(e.data.terrainData)||void 0!==this.terrainProvider.getTileDataAvailable(2*e.x,2*e.y,e.level+1)};var readyImageryScratch=[],canRenderTraversalStack=[];GlobeSurfaceTileProvider.prototype.canRenderWithoutLosingDetail=function(e,t){var i=e.data,r=readyImageryScratch;r.length=this._imageryLayers.length;var n,a=!1,o=!1;for(defined(i)&&(a=i.terrainState===TerrainState$2.READY,o=!0,n=i.imagery),m=0,f=r.length;m<f;++m)r[m]=o;if(defined(n))for(m=0,f=n.length;m<f;++m){var s=n[m],l=s.loadingImagery,l=!defined(l)||l.state===ImageryState$1.FAILED||l.state===ImageryState$1.INVALID,s=(s.loadingImagery||s.readyImagery).imageryLayer._layerIndex;r[s]=l&&r[s]}var c=this.quadtree._lastSelectionFrameNumber,u=canRenderTraversalStack;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);0<u.length;){var d=u.pop(),h=d._lastSelectionResultFrame===c?d._lastSelectionResult:TileSelectionResult.NONE;if(h===TileSelectionResult.RENDERED){if(defined(d.data)){if(!a&&d.data.terrainState===TerrainState$2.READY)return!1;for(var p=d.data.imagery,m=0,f=p.length;m<f;++m){var g=p[m],_=g.loadingImagery,_=!defined(_)||_.state===ImageryState$1.FAILED||_.state===ImageryState$1.INVALID,g=(g.loadingImagery||g.readyImagery).imageryLayer._layerIndex;if(_&&!r[g])return!1}}}else h===TileSelectionResult.REFINED&&u.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0};var tileDirectionScratch=new Cartesian3;GlobeSurfaceTileProvider.prototype.computeTileLoadPriority=function(e,t){var i=e.data;if(void 0===i)return 0;var r=i.orientedBoundingBox;if(void 0===r)return 0;i=t.camera.positionWC,t=t.camera.directionWC,r=Cartesian3.subtract(r.center,i,tileDirectionScratch),i=Cartesian3.magnitude(r);return i<CesiumMath.EPSILON5?0:(Cartesian3.divideByScalar(r,i,r),(1-Cartesian3.dot(r,t))*e._distance)};var modifiedModelViewScratch$3=new Matrix4,modifiedModelViewProjectionScratch=new Matrix4,tileRectangleScratch=new Cartesian4,localizedCartographicLimitRectangleScratch=new Cartesian4,localizedTranslucencyRectangleScratch=new Cartesian4,rtcScratch$3=new Cartesian3,centerEyeScratch=new Cartesian3,southwestScratch=new Cartesian3,northeastScratch=new Cartesian3;GlobeSurfaceTileProvider.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,a=r.length;n<a;++n){var o=r[n];defined(o.readyImagery)&&0!==o.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];defined(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e),defined(e.data.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;e=this._debug;++e.tilesRendered,e.texturesRendered+=i};var cornerPositionsScratch$1=[new Cartesian3,new Cartesian3,new Cartesian3,new Cartesian3];function computeOccludeePoint$1(e,t,i,r,n,a){var o=e.quadtree._occluders.ellipsoid,s=o.ellipsoid,e=cornerPositionsScratch$1;return Cartesian3.fromRadians(i.west,i.south,n,s,e[0]),Cartesian3.fromRadians(i.east,i.south,n,s,e[1]),Cartesian3.fromRadians(i.west,i.north,n,s,e[2]),Cartesian3.fromRadians(i.east,i.north,n,s,e[3]),o.computeHorizonCullingPointPossiblyUnderEllipsoid(t,e,r,a)}function updateTileBoundingRegion(e,t,i){var r=e.data;void 0===r&&(r=e.data=new GlobeSurfaceTile),void 0===r.tileBoundingRegion&&(r.tileBoundingRegion=new TileBoundingRegion({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:e.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0}));var n=r.terrainData,a=r.mesh,o=r.tileBoundingRegion;if(void 0!==a&&void 0!==a.minimumHeight&&void 0!==a.maximumHeight)return o.minimumHeight=a.minimumHeight,o.maximumHeight=a.maximumHeight,e;if(void 0!==n&&void 0!==n._minimumHeight&&void 0!==n._maximumHeight)return o.minimumHeight=n._minimumHeight*i.terrainExaggeration,o.maximumHeight=n._maximumHeight*i.terrainExaggeration,e;o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;for(var s=e.parent;void 0!==s;){var l=s.data;if(void 0!==l){var c=l.mesh;if(void 0!==c&&void 0!==c.minimumHeight&&void 0!==c.maximumHeight)return o.minimumHeight=c.minimumHeight,o.maximumHeight=c.maximumHeight,s;l=l.terrainData;if(void 0!==l&&void 0!==l._minimumHeight&&void 0!==l._maximumHeight)return o.minimumHeight=l._minimumHeight*i.terrainExaggeration,o.maximumHeight=l._maximumHeight*i.terrainExaggeration,s}s=s.parent}}function getTileReadyCallback(l,c,u){return function(e){for(var t=-1,i=e.data.imagery,r=i.length,n=0;n<r;++n)if((s=defaultValue((a=i[n]).readyImagery,a.loadingImagery)).imageryLayer===c){t=n;break}if(-1!==t){var a,o=t+l,s=defined(a=i[o])?defaultValue(a.readyImagery,a.loadingImagery):void 0;if(!defined(s)||s.imageryLayer!==c)return!c._createTileImagerySkeletons(e,u,o);for(n=t;n<o;++n)i[n].freeResources();i.splice(t,l)}return!0}}GlobeSurfaceTileProvider.prototype.computeDistanceToTile=function(e,t){var i=updateTileBoundingRegion(e,this.terrainProvider,t),r=e.data,n=r.tileBoundingRegion;if(void 0===i)return 9999999999;r.boundingVolumeSourceTile!==i&&(r.boundingVolumeSourceTile=i,defined(e.rectangle)&&(r.orientedBoundingBox=OrientedBoundingBox.fromRectangle(e.rectangle,n.minimumHeight,n.maximumHeight,e.tilingScheme.ellipsoid,r.orientedBoundingBox),r.occludeePointInScaledSpace=computeOccludeePoint$1(this,r.orientedBoundingBox.center,e.rectangle,n.minimumHeight,n.maximumHeight,r.occludeePointInScaledSpace)));var a=n.minimumHeight,i=n.maximumHeight;r.boundingVolumeSourceTile!==e&&(r=t.camera.positionCartographic.height,e=Math.abs(r-a),Math.abs(r-i)<e?(n.minimumHeight=a,n.maximumHeight=a):(n.minimumHeight=i,n.maximumHeight=i));t=n.distanceToCamera(t);return n.minimumHeight=a,n.maximumHeight=i,t},GlobeSurfaceTileProvider.prototype.isDestroyed=function(){return!1},GlobeSurfaceTileProvider.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),destroyObject(this)},GlobeSurfaceTileProvider.prototype._onLayerAdded=function(l,e){var c,t,i,r;l.show&&(c=this._terrainProvider,t=this,i=l.imageryProvider,r=this._imageryLayersUpdatedEvent,i._reload=function(){l._imageryCache={},t._quadtree.forEachLoadedTile(function(e){if(!defined(e._loadedCallbacks[l._layerIndex])){for(var t,i=e.data.imagery,r=i.length,n=-1,a=0,o=0;o<r;++o){var s=i[o];if(defaultValue(s.readyImagery,s.loadingImagery).imageryLayer===l)-1===n&&(n=o),++a;else if(-1!==n)break}-1!==n&&(t=n+a,l._createTileImagerySkeletons(e,c,t)&&(e._loadedCallbacks[l._layerIndex]=getTileReadyCallback(a,l,c),e.state=QuadtreeTileLoadState$1.LOADING))}})},this._quadtree.forEachLoadedTile(function(e){l._createTileImagerySkeletons(e,c)&&(e.state=QuadtreeTileLoadState$1.LOADING,0===e.level||e._lastSelectionResultFrame===t.quadtree._lastSelectionFrameNumber&&e._lastSelectionResult===TileSelectionResult.RENDERED||(e.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent())},GlobeSurfaceTileProvider.prototype._onLayerRemoved=function(l,e){this._quadtree.forEachLoadedTile(function(e){for(var t=e.data.imagery,i=-1,r=0,n=0,a=t.length;n<a;++n){var o=t[n],s=o.loadingImagery;if(defined(s)||(s=o.readyImagery),s.imageryLayer===l)-1===i&&(i=n),o.freeResources(),++r;else if(-1!==i)break}-1!==i&&t.splice(i,r)}),defined(l.imageryProvider)&&(l.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()},GlobeSurfaceTileProvider.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()},GlobeSurfaceTileProvider.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var scratchClippingPlanesMatrix$2=new Matrix4,scratchInverseTransposeClippingPlanesMatrix$1=new Matrix4,getDebugOrientedBoundingBox,getDebugBoundingSphere,debugDestroyPrimitive,Xmi,Ymi,Umi,Vmi,Wmi;function createTileUniformMap(r,t){var e={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var e=r.context.uniformState.view,t=Matrix4.multiplyByPoint(e,this.properties.rtc,centerEyeScratch);return Matrix4.setTranslation(e,t,modifiedModelViewScratch$3),modifiedModelViewScratch$3},u_modifiedModelViewProjection:function(){var e=r.context.uniformState.view,t=r.context.uniformState.projection,i=Matrix4.multiplyByPoint(e,this.properties.rtc,centerEyeScratch);return Matrix4.setTranslation(e,i,modifiedModelViewProjectionScratch),Matrix4.multiply(t,modifiedModelViewProjectionScratch,modifiedModelViewProjectionScratch),modifiedModelViewProjectionScratch},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){var e=t._clippingPlanes;return defined(e)&&defined(e.texture)?e.texture:r.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){var e=t._clippingPlanes,e=defined(e)?Matrix4.multiply(r.context.uniformState.view,e.modelMatrix,scratchClippingPlanesMatrix$2):Matrix4.IDENTITY;return Matrix4.inverseTranspose(e,scratchInverseTransposeClippingPlanesMatrix$1)},u_clippingPlanesEdgeStyle:function(){var e=this.properties.clippingPlanesEdgeColor;return e.alpha=this.properties.clippingPlanesEdgeWidth,e},u_minimumBrightness:function(){return r.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},properties:{initialColor:new Cartesian4(0,0,.5,1),fillHighlightColor:new Color(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new Cartesian2(65e5,9e6),nightFadeDistance:new Cartesian2(1e7,4e7),hsbShift:new Cartesian3,center3D:void 0,rtc:new Cartesian3,modifiedModelView:new Matrix4,tileRectangle:new Cartesian4,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new Cartesian2,southMercatorYAndOneOverHeight:new Cartesian2,waterMask:void 0,waterMaskTranslationAndScale:new Cartesian4,minMaxHeight:new Cartesian2,scaleAndBias:new Matrix4,clippingPlanesEdgeColor:Color.clone(Color.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new Cartesian4,frontFaceAlphaByDistance:new Cartesian4,backFaceAlphaByDistance:new Cartesian4,localizedTranslucencyRectangle:new Cartesian4,undergroundColor:Color.clone(Color.TRANSPARENT),undergroundColorAlphaByDistance:new Cartesian4}};return defined(t.materialUniformMap)?combine(e,t.materialUniformMap):e}function createWireframeVertexArrayIfNecessary(e,t,i){var r,n,i=i.data;if(defined(i.vertexArray)?(r=i.mesh,n=i.vertexArray):defined(i.fill)&&defined(i.fill.vertexArray)&&(r=i.fill.mesh,n=i.fill.vertexArray),defined(r)&&defined(n)){if(defined(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===r)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=createWireframeVertexArray(e,n,r),i.wireframeVertexArray.mesh=r}}function createWireframeVertexArray(e,t,i){i={indices:i.indices,primitiveType:PrimitiveType$1.TRIANGLES};GeometryPipeline.toWireframe(i);i=i.indices,i=Buffer$1.createIndexBuffer({context:e,typedArray:i,usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.fromSizeInBytes(i.BYTES_PER_ELEMENT)});return new VertexArray({context:e,attributes:t._attributes,indexBuffer:i})}function Zmi(e){return new Primitive({geometryInstances:e,appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}Umi=new GeometryInstance({geometry:BoxOutlineGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2)})}),Vmi=new GeometryInstance({geometry:new SphereOutlineGeometry({radius:1})}),Wmi=new Matrix4,getDebugOrientedBoundingBox=function(e,t){return e===Xmi?Ymi:(debugDestroyPrimitive(),Xmi=e,Wmi=Matrix4.fromRotationTranslation(e.halfAxes,e.center,Wmi),Umi.modelMatrix=Wmi,Umi.attributes.color=ColorGeometryInstanceAttribute.fromColor(t),Ymi=Zmi(Umi))},getDebugBoundingSphere=function(e,t){return e===Xmi?Ymi:(debugDestroyPrimitive(),Xmi=e,Wmi=Matrix4.fromTranslation(e.center,Wmi),Wmi=Matrix4.multiplyByUniformScale(Wmi,e.radius,Wmi),Vmi.modelMatrix=Wmi,Vmi.attributes.color=ColorGeometryInstanceAttribute.fromColor(t),Ymi=Zmi(Vmi))},debugDestroyPrimitive=function(){defined(Ymi)&&(Ymi.destroy(),Xmi=Ymi=void 0)};var otherPassesInitialColor=new Cartesian4(0,0,0,0),surfaceShaderSetOptionsScratch={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0},defaultUndergroundColor=Color.TRANSPARENT,defaultundergroundColorAlphaByDistance=new NearFarScalar;function addDrawCommandsForTile(e,t,i){var r=t.data;defined(r.vertexArray)||(void 0===r.fill&&(r.fill=new TerrainFillMesh(t)),r.fill.update(e,i));var n=i.creditDisplay,a=r.terrainData;if(defined(a)&&defined(a.credits))for(var o=a.credits,s=0,l=o.length;s<l;++s)n.addCredit(o[s]);var c=ContextLimits.maximumTextureImageUnits,u=r.waterMaskTexture,d=r.waterMaskTranslationAndScale;!defined(u)&&defined(r.fill)&&(u=r.fill.waterMaskTexture,d=r.fill.waterMaskTranslationAndScale);var h=i.cameraUnderground,p=i.globeTranslucencyState,m=p.translucent,f=p.frontFaceAlphaByDistance,g=p.backFaceAlphaByDistance,_=p.rectangle,y=defaultValue(e.undergroundColor,defaultUndergroundColor),C=defaultValue(e.undergroundColorAlphaByDistance,defaultundergroundColorAlphaByDistance),v=isUndergroundVisible(e,i)&&i.mode===SceneMode$1.SCENE3D&&0<y.alpha&&(0<C.nearValue||0<C.farValue),S=e.hasWaterMask&&defined(u),T=e.oceanNormalMap,x=S&&defined(T),b=e.terrainProvider.ready&&e.terrainProvider.hasVertexNormals,E=i.fog.enabled&&!h,P=e.showGroundAtmosphere&&i.mode===SceneMode$1.SCENE3D,A=ShadowMode$1.castShadows(e.shadows)&&!m,w=ShadowMode$1.receiveShadows(e.shadows)&&!m,D=e.hueShift,M=e.saturationShift,I=e.brightnessShift,R=!(CesiumMath.equalsEpsilon(D,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(M,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(I,0,CesiumMath.EPSILON7)),O=!1;P&&(F=Cartesian3.magnitude(i.camera.positionWC),O=e.nightFadeOutDistance<F),S&&--c,x&&--c,defined(i.shadowState)&&i.shadowState.shadowsEnabled&&--c,defined(e.clippingPlanes)&&e.clippingPlanes.enabled&&--c,c-=p.numberOfTextureUniforms;var L,F,N=r.renderedMesh,B=N.center,V=N.encoding,k=tileRectangleScratch,z=0,U=0,$=0,G=0,H=!1;i.mode!==SceneMode$1.SCENE3D&&(a=(L=i.mapProjection).project(Rectangle.southwest(t.rectangle),southwestScratch),F=L.project(Rectangle.northeast(t.rectangle),northeastScratch),k.x=a.x,k.y=a.y,k.z=F.x,k.w=F.y,i.mode!==SceneMode$1.MORPHING&&((B=rtcScratch$3).x=0,B.y=.5*(k.z+k.x),B.z=.5*(k.w+k.y),k.x-=B.y,k.y-=B.z,k.z-=B.y,k.w-=B.z),i.mode===SceneMode$1.SCENE2D&&V.quantization===TerrainQuantization$1.BITS12&&(a=1/(Math.pow(2,12)-1)*.5,F=(k.z-k.x)*a,a=(k.w-k.y)*a,k.x-=F,k.y-=a,k.z+=F,k.w+=a),L instanceof WebMercatorProjection&&(z=t.rectangle.south,U=t.rectangle.north,$=WebMercatorProjection.geodeticLatitudeToMercatorAngle(z),G=1/(WebMercatorProjection.geodeticLatitudeToMercatorAngle(U)-$),H=!0));var W=surfaceShaderSetOptionsScratch;W.frameState=i,W.surfaceTile=r,W.showReflectiveOcean=S,W.showOceanWaves=x,W.enableLighting=e.enableLighting,W.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,W.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,W.showGroundAtmosphere=P,W.perFragmentGroundAtmosphere=O,W.hasVertexNormals=b,W.useWebMercatorProjection=H,W.clippedByBoundaries=r.clippedByBoundaries;var q=r.imagery,j=0,Y=q.length,X=e.showSkirts&&!h&&!m,b=e.backFaceCulling&&!h&&!m,H=b?e._renderState:e._disableCullingRenderState,Q=b?e._blendRenderState:e._disableCullingBlendRenderState,J=H,Z=e._firstPassInitialColor,K=i.context;if(defined(e._debug.boundingSphereTile)||debugDestroyPrimitive(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;for(var ee=e._drawCommands.length,te=0;te<ee;++te)e._uniformMaps[te]=createTileUniformMap(i,e)}do{var ie,re,ne=0;e._drawCommands.length<=e._usedDrawCommands?((ie=new DrawCommand).owner=t,ie.cull=!1,ie.boundingVolume=new BoundingSphere,ie.orientedBoundingBox=void 0,re=createTileUniformMap(i,e),e._drawCommands.push(ie),e._uniformMaps.push(re)):(ie=e._drawCommands[e._usedDrawCommands],re=e._uniformMaps[e._usedDrawCommands]),ie.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile&&(defined(ue=r.orientedBoundingBox)?getDebugOrientedBoundingBox(ue,Color.RED).update(i):defined(N)&&defined(N.boundingSphere3D)&&getDebugBoundingSphere(N.boundingSphere3D,Color.RED).update(i));var ae=re.properties;Cartesian4.clone(Z,ae.initialColor),ae.oceanNormalMap=T,ae.lightingFadeDistance.x=e.lightingFadeOutDistance,ae.lightingFadeDistance.y=e.lightingFadeInDistance,ae.nightFadeDistance.x=e.nightFadeOutDistance,ae.nightFadeDistance.y=e.nightFadeInDistance,ae.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;var oe=h?g:f,se=h?f:g;defined(oe)&&(Cartesian4.fromElements(oe.near,oe.nearValue,oe.far,oe.farValue,ae.frontFaceAlphaByDistance),Cartesian4.fromElements(se.near,se.nearValue,se.far,se.farValue,ae.backFaceAlphaByDistance)),Cartesian4.fromElements(C.near,C.nearValue,C.far,C.farValue,ae.undergroundColorAlphaByDistance),Color.clone(y,ae.undergroundColor);var le=!defined(r.vertexArray)&&defined(e.fillHighlightColor)&&0<e.fillHighlightColor.alpha;le&&Color.clone(e.fillHighlightColor,ae.fillHighlightColor),ae.center3D=N.center,Cartesian3.clone(B,ae.rtc),Cartesian4.clone(k,ae.tileRectangle),ae.southAndNorthLatitude.x=z,ae.southAndNorthLatitude.y=U,ae.southMercatorYAndOneOverHeight.x=$,ae.southMercatorYAndOneOverHeight.y=G;var ce=localizedCartographicLimitRectangleScratch,ue=clipRectangleAntimeridian(t.rectangle,e.cartographicLimitRectangle),oe=localizedTranslucencyRectangleScratch,se=clipRectangleAntimeridian(t.rectangle,_);Cartesian3.fromElements(D,M,I,ae.hsbShift);var de=t.rectangle,he=1/de.width,pe=1/de.height;ce.x=(ue.west-de.west)*he,ce.y=(ue.south-de.south)*pe,ce.z=(ue.east-de.west)*he,ce.w=(ue.north-de.south)*pe,Cartesian4.clone(ce,ae.localizedCartographicLimitRectangle),oe.x=(se.west-de.west)*he,oe.y=(se.south-de.south)*pe,oe.z=(se.east-de.west)*he,oe.w=(se.north-de.south)*pe,Cartesian4.clone(oe,ae.localizedTranslucencyRectangle);for(var ce=E&&CesiumMath.fog(t._distance,i.fog.density)>CesiumMath.EPSILON3,R=R&&(ce||P),me=!1,fe=!1,ge=!1,_e=!1,ye=!1,Ce=!1,ve=!1,Se=!1,Te=!1,xe=!1;ne<c&&j<Y;){var be=q[j],Ee=be.readyImagery;if(++j,defined(Ee)&&0!==Ee.imageryLayer.alpha){var Pe=be.useWebMercatorT?Ee.textureWebMercator:Ee.texture,Ae=Ee.imageryLayer;defined(be.textureTranslationAndScale)||(be.textureTranslationAndScale=Ae._calculateTextureTranslationAndScale(t,be)),ae.dayTextures[ne]=Pe,ae.dayTextureTranslationAndScale[ne]=be.textureTranslationAndScale,ae.dayTextureTexCoordsRectangle[ne]=be.textureCoordinateRectangle,ae.dayTextureUseWebMercatorT[ne]=be.useWebMercatorT,ae.dayTextureAlpha[ne]=Ae.alpha,Ce=Ce||1!==ae.dayTextureAlpha[ne],ae.dayTextureNightAlpha[ne]=Ae.nightAlpha,ve=ve||1!==ae.dayTextureNightAlpha[ne],ae.dayTextureDayAlpha[ne]=Ae.dayAlpha,ve=ve||1!==ae.dayTextureDayAlpha[ne],ae.dayTextureBrightness[ne]=Ae.brightness,me=me||ae.dayTextureBrightness[ne]!==ImageryLayer.DEFAULT_BRIGHTNESS,ae.dayTextureContrast[ne]=Ae.contrast,fe=fe||ae.dayTextureContrast[ne]!==ImageryLayer.DEFAULT_CONTRAST,ae.dayTextureHue[ne]=Ae.hue,ge=ge||ae.dayTextureHue[ne]!==ImageryLayer.DEFAULT_HUE,ae.dayTextureSaturation[ne]=Ae.saturation,_e=_e||ae.dayTextureSaturation[ne]!==ImageryLayer.DEFAULT_SATURATION,ae.dayTextureOneOverGamma[ne]=1/Ae.gamma,ye=ye||ae.dayTextureOneOverGamma[ne]!==1/ImageryLayer.DEFAULT_GAMMA,ae.dayTextureSplit[ne]=Ae.splitDirection,Se=Se||0!==ae.dayTextureSplit[ne];be=ae.dayTextureCutoutRectangles[ne];defined(be)||(be=ae.dayTextureCutoutRectangles[ne]=new Cartesian4),Cartesian4.clone(Cartesian4.ZERO,be),defined(Ae.cutoutRectangle)&&(we=clipRectangleAntimeridian(de,Ae.cutoutRectangle),Te=defined(Rectangle.simpleIntersection(we,de,rectangleIntersectionScratch))||Te,be.x=(we.west-de.west)*he,be.y=(we.south-de.south)*pe,be.z=(we.east-de.west)*he,be.w=(we.north-de.south)*pe);be=ae.colorsToAlpha[ne];defined(be)||(be=ae.colorsToAlpha[ne]=new Cartesian4);var we=defined(Ae.colorToAlpha)&&0<Ae.colorToAlphaThreshold,xe=xe||we;if(we?(we=Ae.colorToAlpha,be.x=we.red,be.y=we.green,be.z=we.blue,be.w=Ae.colorToAlphaThreshold):be.w=-1,defined(Ee.credits))for(var De=Ee.credits,Me=0,Ie=De.length;Me<Ie;++Me)n.addCredit(De[Me]);++ne}}ae.dayTextures.length=ne,ae.waterMask=u,Cartesian4.clone(d,ae.waterMaskTranslationAndScale),ae.minMaxHeight.x=V.minimumHeight,ae.minMaxHeight.y=V.maximumHeight,Matrix4.clone(V.matrix,ae.scaleAndBias);se=e._clippingPlanes,oe=defined(se)&&se.enabled&&t.isClipped;oe&&(ae.clippingPlanesEdgeColor=Color.clone(se.edgeColor,ae.clippingPlanesEdgeColor),ae.clippingPlanesEdgeWidth=se.edgeWidth),W.numberOfDayTextures=ne,W.applyBrightness=me,W.applyContrast=fe,W.applyHue=ge,W.applySaturation=_e,W.applyGamma=ye,W.applyAlpha=Ce,W.applyDayNightAlpha=ve,W.applySplit=Se,W.enableFog=ce,W.enableClippingPlanes=oe,W.clippingPlanes=se,W.hasImageryLayerCutout=Te,W.colorCorrect=R,W.highlightFillTile=le,W.colorToAlpha=xe,W.showUndergroundColor=v,W.translucent=m;oe=r.renderedMesh.indices.length;X||(oe=r.renderedMesh.indexCountWithoutSkirts),ie.shaderProgram=e._surfaceShaderSet.getShaderProgram(W),ie.castShadows=A,ie.receiveShadows=w,ie.renderState=J,ie.primitiveType=PrimitiveType$1.TRIANGLES,ie.vertexArray=r.vertexArray||r.fill.vertexArray,ie.count=oe,ie.uniformMap=re,ie.pass=Pass$1.GLOBE,e._debug.wireframe&&(createWireframeVertexArrayIfNecessary(K,e,t),defined(r.wireframeVertexArray)&&(ie.vertexArray=r.wireframeVertexArray,ie.primitiveType=PrimitiveType$1.LINES,ie.count=2*oe));se=ie.boundingVolume,le=ie.orientedBoundingBox}while(i.mode!==SceneMode$1.SCENE3D?(oe=r.tileBoundingRegion,BoundingSphere.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,oe.minimumHeight,oe.maximumHeight,se),Cartesian3.fromElements(se.center.z,se.center.x,se.center.y,se.center),i.mode===SceneMode$1.MORPHING&&(se=BoundingSphere.union(N.boundingSphere3D,se,se))):(ie.boundingVolume=BoundingSphere.clone(N.boundingSphere3D,se),ie.orientedBoundingBox=OrientedBoundingBox.clone(r.orientedBoundingBox,le)),ie.dirty=!0,m&&p.updateDerivedCommands(ie,i),pushCommand(ie,i),J=Q,Z=otherPassesInitialColor,j<Y)}function GlobeTranslucency(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=Rectangle.clone(Rectangle.MAX_VALUE)}function ImageryLayerCollection(){this._layers=[],this.layerAdded=new Event,this.layerRemoved=new Event,this.layerMoved=new Event,this.layerShownOrHidden=new Event}function getLayerIndex(e,t){return e.indexOf(t)}function swapLayers(e,t,i){var r,n=e._layers;(t=CesiumMath.clamp(t,0,n.length-1))!==(i=CesiumMath.clamp(i,0,n.length-1))&&(r=n[t],n[t]=n[i],n[i]=r,e._update(),e.layerMoved.raiseEvent(r,i,t))}Object.defineProperties(GlobeTranslucency.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=NearFarScalar.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=NearFarScalar.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){defined(e)||(e=Rectangle.clone(Rectangle.MAX_VALUE)),Rectangle.clone(e,this._rectangle)}}}),Object.defineProperties(ImageryLayerCollection.prototype,{length:{get:function(){return this._layers.length}}}),ImageryLayerCollection.prototype.add=function(e,t){defined(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t)},ImageryLayerCollection.prototype.addImageryProvider=function(e,t){e=new ImageryLayer(e);return this.add(e,t),e},ImageryLayerCollection.prototype.remove=function(e,t){t=defaultValue(t,!0);var i=this._layers.indexOf(e);return-1!==i&&(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(e,i),t&&e.destroy(),!0)},ImageryLayerCollection.prototype.removeAll=function(e){e=defaultValue(e,!0);for(var t=this._layers,i=0,r=t.length;i<r;i++){var n=t[i];this.layerRemoved.raiseEvent(n,i),e&&n.destroy()}this._layers=[]},ImageryLayerCollection.prototype.contains=function(e){return-1!==this.indexOf(e)},ImageryLayerCollection.prototype.indexOf=function(e){return this._layers.indexOf(e)},ImageryLayerCollection.prototype.get=function(e){return this._layers[e]},ImageryLayerCollection.prototype.raise=function(e){e=getLayerIndex(this._layers,e);swapLayers(this,e,e+1)},ImageryLayerCollection.prototype.lower=function(e){e=getLayerIndex(this._layers,e);swapLayers(this,e,e-1)},ImageryLayerCollection.prototype.raiseToTop=function(e){var t=getLayerIndex(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))},ImageryLayerCollection.prototype.lowerToBottom=function(e){var t=getLayerIndex(this._layers,e);0!==t&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var applicableRectangleScratch=new Rectangle,comparisonPoint;function QuadtreeOccluders(e){this._ellipsoid=new EllipsoidalOccluder(e.ellipsoid,Cartesian3.ZERO)}function QuadtreeTile(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=TileSelectionResult.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=QuadtreeTileLoadState$1.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function freeTile(e){defined(e)&&e.freeResources()}function TileReplacementQueue(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function remove$1(e,t){var i=t.replacementPrevious,r=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=r),t===e.head?e.head=r:i.replacementNext=r,t===e.tail?e.tail=i:r.replacementPrevious=i,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}function QuadtreePrimitive(e){this._tileProvider=e.tileProvider,(this._tileProvider.quadtree=this)._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new TileReplacementQueue,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=defaultValue(e.maximumScreenSpaceError,2),this.tileCacheSize=defaultValue(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new QuadtreeOccluders({ellipsoid:t}),this._tileLoadProgressEvent=new Event,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}function invalidateAllTiles(e){var t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,clearTileLoadQueue(e);var i=e._levelZeroTiles;if(defined(i))for(var r=0;r<i.length;++r){for(var n=i[r].customData,a=n.length,o=0;o<a;++o){var s=n[o];s.level=0,e._addHeightCallbacks.push(s)}i[r].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}function clearTileLoadQueue(e){var t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}function updateTileLoadProgress(e,t){var i=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;i===e._lastTileLoadQueueLength&&!e._tilesInvalidated||(t.afterRender.push(Event.prototype.raiseEvent.bind(e._tileLoadProgressEvent,i)),e._lastTileLoadQueueLength=i);i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(e,t){return Math.max(e,t.level)},-1),i.tilesRendered=e._tilesToRender.length,i.tilesVisited===i.lastTilesVisited&&i.tilesRendered===i.lastTilesRendered&&i.tilesCulled===i.lastTilesCulled&&i.maxDepth===i.lastMaxDepth&&i.tilesWaitingForChildren===i.lastTilesWaitingForChildren&&i.maxDepthVisited===i.lastMaxDepthVisited||(console.log("Visited "+i.tilesVisited+", Rendered: "+i.tilesRendered+", Culled: "+i.tilesCulled+", Max Depth Rendered: "+i.maxDepth+", Max Depth Visited: "+i.maxDepthVisited+", Waiting for children: "+i.tilesWaitingForChildren),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}ImageryLayerCollection.prototype.pickImageryLayerFeatures=function(e,t){e=t.globe.pick(e,t);if(defined(e)){for(var i,s=t.globe.ellipsoid.cartesianToCartographic(e),r=t.globe._surface._tilesToRender,n=0;!defined(i)&&n<r.length;++n){var a=r[n];Rectangle.contains(a.rectangle,s)&&(i=a)}if(defined(i)){for(var o=i.data.imagery,l=[],c=[],u=o.length-1;0<=u;--u){var d,h,p,m=o[u],f=m.readyImagery;defined(f)&&(defined((p=f.imageryLayer.imageryProvider).pickFeatures)&&Rectangle.contains(f.rectangle,s)&&(h=1/1024,(d=applicableRectangleScratch).west=CesiumMath.lerp(i.rectangle.west,i.rectangle.east,m.textureCoordinateRectangle.x-h),d.east=CesiumMath.lerp(i.rectangle.west,i.rectangle.east,m.textureCoordinateRectangle.z+h),d.south=CesiumMath.lerp(i.rectangle.south,i.rectangle.north,m.textureCoordinateRectangle.y-h),d.north=CesiumMath.lerp(i.rectangle.south,i.rectangle.north,m.textureCoordinateRectangle.w+h),!Rectangle.contains(d,s)||defined(p=p.pickFeatures(f.x,f.y,f.level,s.longitude,s.latitude))&&(l.push(p),c.push(f.imageryLayer))))}if(0!==l.length)return when.all(l,function(e){for(var t=[],i=0;i<e.length;++i){var r=e[i],n=c[i];if(defined(r)&&0<r.length)for(var a=0;a<r.length;++a){var o=r[a];o.imageryLayer=n,defined(o.position)||(o.position=s),t.push(o)}}return t})}}},ImageryLayerCollection.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},ImageryLayerCollection.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},ImageryLayerCollection.prototype.isDestroyed=function(){return!1},ImageryLayerCollection.prototype.destroy=function(){return this.removeAll(!0),destroyObject(this)},ImageryLayerCollection.prototype._update=function(){for(var e,t,i=!0,r=this._layers,n=0,a=r.length;n<a;++n)(t=r[n])._layerIndex=n,t.show?(t._isBaseLayer=i,i=!1):t._isBaseLayer=!1,t.show!==t._show&&(defined(t._show)&&(defined(e)||(e=[]),e.push(t)),t._show=t.show);if(defined(e))for(n=0,a=e.length;n<a;++n)t=e[n],this.layerShownOrHidden.raiseEvent(t,t._layerIndex,t.show)},Object.defineProperties(QuadtreeOccluders.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),QuadtreeTile.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),i=e.getNumberOfYTilesAtLevel(0),r=new Array(t*i),n=0,a=0;a<i;++a)for(var o=0;o<t;++o)r[n++]=new QuadtreeTile({tilingScheme:e,x:o,y:a,level:0});return r},QuadtreeTile.prototype._updateCustomData=function(e,t,i){var r,n,a=this.customData;if(defined(t)&&defined(i)){for(a=a.filter(function(e){return-1===i.indexOf(e)}),this._customData=a,n=this._rectangle,s=0;s<t.length;++s)r=t[s],Rectangle.contains(n,r.positionCartographic)&&a.push(r);this._frameUpdated=e}else{e=this._parent;if(defined(e)&&this._frameUpdated!==e._frameUpdated){a.length=0,n=this._rectangle;for(var o=e.customData,s=0;s<o.length;++s)r=o[s],Rectangle.contains(n,r.positionCartographic)&&a.push(r);this._frameUpdated=e._frameUpdated}}},Object.defineProperties(QuadtreeTile.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return defined(this._southwestChild)||(this._southwestChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return defined(this._southeastChild)||(this._southeastChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return defined(this._northwestChild)||(this._northwestChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return defined(this._northeastChild)||(this._northeastChild=new QuadtreeTile({tilingScheme:this.tilingScheme,x:2*this.x+1,y:2*this.y,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<QuadtreeTileLoadState$1.DONE}},eligibleForUnloading:{get:function(){var e=!0;return defined(this.data)&&(defined(e=this.data.eligibleForUnloading)||(e=!0)),e}}}),QuadtreeTile.prototype.findLevelZeroTile=function(e,t,i){var r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=r:r<=t&&(t-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(e){return e.x===t&&e.y===i})[0]},QuadtreeTile.prototype.findTileToWest=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;e=t.findTileToWest(e);return void 0!==e?t.southwestChild===this?e.southeastChild:e.northeastChild:void 0},QuadtreeTile.prototype.findTileToEast=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;e=t.findTileToEast(e);return void 0!==e?t.southeastChild===this?e.southwestChild:e.northwestChild:void 0},QuadtreeTile.prototype.findTileToSouth=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;e=t.findTileToSouth(e);return void 0!==e?t.southwestChild===this?e.northwestChild:e.northeastChild:void 0},QuadtreeTile.prototype.findTileToNorth=function(e){var t=this.parent;if(void 0===t)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;e=t.findTileToNorth(e);return void 0!==e?t.northwestChild===this?e.southwestChild:e.southeastChild:void 0},QuadtreeTile.prototype.freeResources=function(){this.state=QuadtreeTileLoadState$1.START,this.renderable=!1,this.upsampledFromParent=!1,defined(this.data)&&defined(this.data.freeResources)&&this.data.freeResources(),freeTile(this._southwestChild),this._southwestChild=void 0,freeTile(this._southeastChild),this._southeastChild=void 0,freeTile(this._northwestChild),this._northwestChild=void 0,freeTile(this._northeastChild),this._northeastChild=void 0},TileReplacementQueue.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},TileReplacementQueue.prototype.trimTiles=function(e){for(var t=this.tail,i=!0;i&&defined(this._lastBeforeStartOfFrame)&&this.count>e&&defined(t);){i=t!==this._lastBeforeStartOfFrame;var r=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),remove$1(this,t)),t=r}},TileReplacementQueue.prototype.markTileRendered=function(e){var t=this.head;if(t!==e){if(++this.count,!defined(t))return e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,void(this.tail=e);(defined(e.replacementPrevious)||defined(e.replacementNext))&&remove$1(this,e),e.replacementPrevious=void 0,(e.replacementNext=t).replacementPrevious=e,this.head=e}else e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext)},Object.defineProperties(QuadtreePrimitive.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}}),QuadtreePrimitive.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0},QuadtreePrimitive.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;defined(t);)t.state!==QuadtreeTileLoadState$1.START&&e(t),t=t.replacementNext},QuadtreePrimitive.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},QuadtreePrimitive.prototype.updateHeight=function(e,t){var r=this,n={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t,removeFunc:function(){for(var e=r._addHeightCallbacks,t=e.length,i=0;i<t;++i)if(e[i]===n){e.splice(i,1);break}r._removeHeightCallbacks.push(n)}};return r._addHeightCallbacks.push(n),n.removeFunc},QuadtreePrimitive.prototype.update=function(e){defined(this._tileProvider.update)&&this._tileProvider.update(e)},QuadtreePrimitive.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(invalidateAllTiles(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),clearTileLoadQueue(this),this._debug.suspendLodUpdate||this._tileReplacementQueue.markStartOfRenderFrame())},QuadtreePrimitive.prototype.render=function(e){var t=e.passes,i=this._tileProvider;t.render&&(i.beginUpdate(e),selectTilesForRendering(this,e),createRenderCommandsForSelectedTiles(this,e),i.endUpdate(e)),t.pick&&0<this._tilesToRender.length&&i.updateForPick(e)},QuadtreePrimitive.prototype.endFrame=function(e){e.passes.render&&e.mode!==SceneMode$1.MORPHING&&(processTileLoadQueue(this,e),updateHeights(this,e),updateTileLoadProgress(this,e))},QuadtreePrimitive.prototype.isDestroyed=function(){return!1},QuadtreePrimitive.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var centerScratch$5=new Cartographic;function compareDistanceToPoint(e,t){var i=Rectangle.center(e.rectangle,centerScratch$5),r=i.longitude-comparisonPoint.longitude,e=i.latitude-comparisonPoint.latitude,t=(i=Rectangle.center(t.rectangle,centerScratch$5)).longitude-comparisonPoint.longitude,i=i.latitude-comparisonPoint.latitude;return r*r+e*e-(t*t+i*i)}var cameraOriginScratch=new Cartesian3,rootTraversalDetails=[];function selectTilesForRendering(e,t){var i,r=e._debug;if(!r.suspendLodUpdate){e._tilesToRender.length=0;var n,a=e._tileProvider;if(!defined(e._levelZeroTiles)){if(!a.ready)return;var o=a.tilingScheme;e._levelZeroTiles=QuadtreeTile.createLevelZeroTiles(o);var s=e._levelZeroTiles.length;if(rootTraversalDetails.length<s)for(rootTraversalDetails=new Array(s),i=0;i<s;++i)void 0===rootTraversalDetails[i]&&(rootTraversalDetails[i]=new TraversalDetails)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l=e._levelZeroTiles,c=1<l.length?e._occluders:void 0;comparisonPoint=t.camera.positionCartographic,l.sort(compareDistanceToPoint);var u,d=e._addHeightCallbacks,h=e._removeHeightCallbacks,p=t.frameNumber;if(0<d.length||0<h.length){for(i=0,u=l.length;i<u;++i)(n=l[i])._updateCustomData(p,d,h);d.length=0,h.length=0}o=t.camera;e._cameraPositionCartographic=o.positionCartographic;o=Matrix4.getTranslation(o.transform,cameraOriginScratch);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(o,e._cameraReferenceFrameOriginCartographic),i=0,u=l.length;i<u;++i)n=l[i],e._tileReplacementQueue.markTileRendered(n),n.renderable?visitIfVisible(e,n,a,t,c,!1,rootTraversalDetails[i]):(queueTileLoad(e,e._tileLoadQueueHigh,n,t),++r.tilesWaitingForChildren);e._lastSelectionFrameNumber=p}}function queueTileLoad(e,t,i,r){i.needsLoading&&(void 0!==e.tileProvider.computeTileLoadPriority&&(i._loadPriority=e.tileProvider.computeTileLoadPriority(i,r)),t.push(i))}function TraversalDetails(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function TraversalQuadDetails(){this.southwest=new TraversalDetails,this.southeast=new TraversalDetails,this.northwest=new TraversalDetails,this.northeast=new TraversalDetails}TraversalQuadDetails.prototype.combine=function(e){var t=this.southwest,i=this.southeast,r=this.northwest,n=this.northeast;e.allAreRenderable=t.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable&&n.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount+n.notYetRenderableCount};for(var traversalQuadsByLevel=new Array(31),i$4=0;i$4<traversalQuadsByLevel.length;++i$4)traversalQuadsByLevel[i$4]=new TraversalQuadDetails;function visitTile$3(e,t,i,r,n){var a=e._debug;++a.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>a.maxDepthVisited&&(a.maxDepthVisited=i.level);var o=screenSpaceError(e,t,i)<e.maximumScreenSpaceError,s=i.southwestChild,l=i.southeastChild,c=i.northwestChild,u=i.northeastChild,d=e._lastSelectionFrameNumber,h=i._lastSelectionResultFrame===d?i._lastSelectionResult:TileSelectionResult.NONE,d=e.tileProvider;if(o||r){var p=TileSelectionResult.originalResult(h)===TileSelectionResult.RENDERED,m=TileSelectionResult.originalResult(h)===TileSelectionResult.CULLED||h===TileSelectionResult.NONE,f=i.state===QuadtreeTileLoadState$1.DONE,p=p||m||f;if(p||defined(d.canRenderWithoutLosingDetail)&&(p=d.canRenderWithoutLosingDetail(i)),p)return o&&queueTileLoad(e,e._tileLoadQueueMedium,i,t),addTileToRenderList(e,i),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,void(n.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));r=!0,o&&queueTileLoad(e,e._tileLoadQueueHigh,i,t)}if(d.canRefine(i)){if(s.upsampledFromParent&&l.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent)return addTileToRenderList(e,i),queueTileLoad(e,e._tileLoadQueueMedium,i,t),e._tileReplacementQueue.markTileRendered(s),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1,i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,void(n.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(i));i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.REFINED;m=e._tilesToRender.length,f=e._tileLoadQueueLow.length,p=e._tileLoadQueueMedium.length,o=e._tileLoadQueueHigh.length,d=e._tileToUpdateHeights.length;if(visitVisibleChildrenNearToFar(e,s,l,c,u,t,r,n),m!==e._tilesToRender.length){l=n.allAreRenderable,c=n.anyWereRenderedLastFrame,u=n.notYetRenderableCount,r=!1;if(!l&&!c){for(var g=e._tilesToRender,_=m;_<g.length;++_)for(var y=g[_];void 0!==y&&y._lastSelectionResult!==TileSelectionResult.KICKED&&y!==i;)y._lastSelectionResult=TileSelectionResult.kick(y._lastSelectionResult),y=y.parent;e._tilesToRender.length=m,e._tileToUpdateHeights.length=d,addTileToRenderList(e,i),i._lastSelectionResult=TileSelectionResult.RENDERED;d=h===TileSelectionResult.RENDERED;!d&&u>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=f,e._tileLoadQueueMedium.length=p,e._tileLoadQueueHigh.length=o,queueTileLoad(e,e._tileLoadQueueMedium,i,t),n.notYetRenderableCount=i.renderable?0:1,r=!0),n.allAreRenderable=i.renderable,(n.anyWereRenderedLastFrame=d)||e._tileToUpdateHeights.push(i),++a.tilesWaitingForChildren}e.preloadAncestors&&!r&&queueTileLoad(e,e._tileLoadQueueLow,i,t)}}else i._lastSelectionResultFrame=t.frameNumber,i._lastSelectionResult=TileSelectionResult.RENDERED,addTileToRenderList(e,i),queueTileLoad(e,e._tileLoadQueueHigh,i,t),n.allAreRenderable=i.renderable,n.anyWereRenderedLastFrame=h===TileSelectionResult.RENDERED,n.notYetRenderableCount=i.renderable?0:1}function visitVisibleChildrenNearToFar(e,t,i,r,n,a,o,s){var l=a.camera.positionCartographic,c=e._tileProvider,u=e._occluders,d=traversalQuadsByLevel[t.level],h=d.southwest,p=d.southeast,m=d.northwest,f=d.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(visitIfVisible(e,t,c,a,u,o,h),visitIfVisible(e,i,c,a,u,o,p),visitIfVisible(e,r,c,a,u,o,m),visitIfVisible(e,n,c,a,u,o,f)):(visitIfVisible(e,r,c,a,u,o,m),visitIfVisible(e,t,c,a,u,o,h),visitIfVisible(e,n,c,a,u,o,f),visitIfVisible(e,i,c,a,u,o,p)):l.latitude<t.rectangle.north?(visitIfVisible(e,i,c,a,u,o,p),visitIfVisible(e,t,c,a,u,o,h),visitIfVisible(e,n,c,a,u,o,f),visitIfVisible(e,r,c,a,u,o,m)):(visitIfVisible(e,n,c,a,u,o,f),visitIfVisible(e,r,c,a,u,o,m),visitIfVisible(e,i,c,a,u,o,p),visitIfVisible(e,t,c,a,u,o,h)),d.combine(s)}function containsNeededPosition(e,t){t=t.rectangle;return defined(e._cameraPositionCartographic)&&Rectangle.contains(t,e._cameraPositionCartographic)||defined(e._cameraReferenceFrameOriginCartographic)&&Rectangle.contains(t,e._cameraReferenceFrameOriginCartographic)}function visitIfVisible(e,t,i,r,n,a,o){if(i.computeTileVisibility(t,r,n)!==Visibility$1.NONE)return visitTile$3(e,r,t,a,o);++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),o.allAreRenderable=!0,o.anyWereRenderedLastFrame=!1,o.notYetRenderableCount=0,containsNeededPosition(e,t)?(defined(t.data)&&defined(t.data.vertexArray)||queueTileLoad(e,e._tileLoadQueueMedium,t,r),o=e._lastSelectionFrameNumber,(o=t._lastSelectionResultFrame===o?t._lastSelectionResult:TileSelectionResult.NONE)!==TileSelectionResult.CULLED_BUT_NEEDED&&o!==TileSelectionResult.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=TileSelectionResult.CULLED_BUT_NEEDED):(!e.preloadSiblings&&0!==t.level||queueTileLoad(e,e._tileLoadQueueLow,t,r),t._lastSelectionResult=TileSelectionResult.CULLED),t._lastSelectionResultFrame=r.frameNumber}function screenSpaceError(e,t,i){if(t.mode===SceneMode$1.SCENE2D||t.camera.frustum instanceof OrthographicFrustum||t.camera.frustum instanceof OrthographicOffCenterFrustum)return screenSpaceError2D(e,t,i);e=e._tileProvider.getLevelMaximumGeometricError(i.level),i=i._distance,e=e*t.context.drawingBufferHeight/(i*t.camera.frustum.sseDenominator);return t.fog.enabled&&(e-=CesiumMath.fog(i,t.fog.density)*t.fog.sse),e/=t.pixelRatio}function screenSpaceError2D(e,t,i){var r=t.camera.frustum;defined(r._offCenterFrustum)&&(r=r._offCenterFrustum);var n=t.context,a=n.drawingBufferWidth,n=n.drawingBufferHeight,n=e._tileProvider.getLevelMaximumGeometricError(i.level)/(Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,n));return t.fog.enabled&&t.mode!==SceneMode$1.SCENE2D&&(n-=CesiumMath.fog(i._distance,t.fog.density)*t.fog.sse),n/=t.pixelRatio}function addTileToRenderList(e,t){e._tilesToRender.push(t)}function processTileLoadQueue(e,t){var i,r,n=e._tileLoadQueueHigh,a=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;0===n.length&&0===a.length&&0===o.length||(e._tileReplacementQueue.trimTiles(e.tileCacheSize),i=getTimestamp$1()+e._loadQueueTimeSlice,n=processSinglePriorityLoadQueue(e,t,r=e._tileProvider,i,n,!1),n=processSinglePriorityLoadQueue(e,t,r,i,a,n),processSinglePriorityLoadQueue(e,t,r,i,o,n))}function sortByLoadPriority(e,t){return e._loadPriority-t._loadPriority}function processSinglePriorityLoadQueue(e,t,i,r,n,a){void 0!==i.computeTileLoadPriority&&n.sort(sortByLoadPriority);for(var o=0,s=n.length;o<s&&(getTimestamp$1()<r||!a);++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l),a=!0}return a}var scratchRay=new Ray,scratchCartographic$d=new Cartographic,scratchPosition$a=new Cartesian3,scratchArray=[];function updateHeights(e,t){if(e.tileProvider.ready){var i=scratchArray;i.length=0;for(var r=e._tileToUpdateHeights,n=e._tileProvider.terrainProvider,a=getTimestamp$1()+e._updateHeightsTimeSlice,o=t.mode,s=t.mapProjection,l=e.tileProvider.tilingScheme.ellipsoid;0<r.length;){var c=r[0];if(defined(c.data)&&defined(c.data.mesh)){for(var u=c.customData,d=u.length,h=!1,p=e._lastTileIndex;p<d;++p){var m,f,g=u[p];if(c.level>g.level){defined(g.positionOnEllipsoidSurface)||(g.positionOnEllipsoidSurface=Cartesian3.fromRadians(g.positionCartographic.longitude,g.positionCartographic.latitude,0,l)),o===SceneMode$1.SCENE3D?(m=l.geodeticSurfaceNormal(g.positionOnEllipsoidSurface,scratchRay.direction),defined(l.getSurfaceNormalIntersectionWithZAxis(g.positionOnEllipsoidSurface,11500,scratchRay.origin))||(defined(c.data.tileBoundingRegion)&&(f=c.data.tileBoundingRegion.minimumHeight),_=Math.min(defaultValue(f,0),-11500),T=Cartesian3.multiplyByScalar(m,Math.abs(_)+1,scratchPosition$a),Cartesian3.subtract(g.positionOnEllipsoidSurface,T,scratchRay.origin))):(Cartographic.clone(g.positionCartographic,scratchCartographic$d),scratchCartographic$d.height=-11500,s.project(scratchCartographic$d,scratchPosition$a),Cartesian3.fromElements(scratchPosition$a.z,scratchPosition$a.x,scratchPosition$a.y,scratchPosition$a),Cartesian3.clone(scratchPosition$a,scratchRay.origin),Cartesian3.clone(Cartesian3.UNIT_X,scratchRay.direction));var _=c.data.pick(scratchRay,o,s,!1,scratchPosition$a);defined(_)&&(g.callback(_),g.level=c.level)}else if(c.level===g.level){for(var y,C=c.children,v=C.length,S=0;S<v&&(y=C[S],!Rectangle.contains(y.rectangle,g.positionCartographic));++S);var T=n.getTileDataAvailable(y.x,y.y,y.level),_=c.parent;(defined(T)&&!T||defined(_)&&defined(_.data)&&defined(_.data.terrainData)&&!_.data.terrainData.isChildAvailable(_.x,_.y,y.x,y.y))&&g.removeFunc()}if(getTimestamp$1()>=a){h=!0;break}}if(h){e._lastTileIndex=p;break}e._lastTileIndex=0,r.shift()}else{var x=c._lastSelectionResultFrame===e._lastSelectionFrameNumber?c._lastSelectionResult:TileSelectionResult.NONE;x!==TileSelectionResult.RENDERED&&x!==TileSelectionResult.CULLED_BUT_NEEDED||i.push(c),r.shift(),e._lastTileIndex=0}}for(p=0;p<i.length;p++)r.push(i[p])}}function createRenderCommandsForSelectedTiles(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=0,a=r.length;n<a;++n){var o=r[n];i.showTileThisFrame(o,t)}}function Globe(e){var t=new EllipsoidTerrainProvider({ellipsoid:e=defaultValue(e,Ellipsoid.WGS84)}),i=new ImageryLayerCollection;this._ellipsoid=e,this._imageryLayerCollection=i,this._surfaceShaderSet=new GlobeSurfaceShaderSet,this._material=void 0,this._surface=new QuadtreePrimitive({tileProvider:new GlobeSurfaceTileProvider({terrainProvider:t,imageryLayers:i,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new Event,this._undergroundColor=Color.clone(Color.BLACK),this._undergroundColorAlphaByDistance=new NearFarScalar(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new GlobeTranslucency,makeShadersDirty(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Resource({url:buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=ShadowMode$1.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0}function makeShadersDirty(e){var t=[],i=defined(e._material)&&(e._material.shaderSource.match(/slope/)||e._material.shaderSource.match("normalEC")),r=[GroundAtmosphere];!defined(e._material)||i&&!e._terrainProvider.requestVertexNormals?e._surface._tileProvider.materialUniformMap=void 0:(r.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms),r.push(GlobeFS),e._surfaceShaderSet.baseVertexShaderSource=new ShaderSource({sources:[GroundAtmosphere,GlobeVS],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new ShaderSource({sources:r,defines:t}),e._surfaceShaderSet.material=e._material}function createComparePickTileFunction(i){return function(e,t){return BoundingSphere.distanceSquaredTo(e.pickBoundingSphere,i)-BoundingSphere.distanceSquaredTo(t.pickBoundingSphere,i)}}Object.defineProperties(Globe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return!defined(this._surface)||this._surface.tileProvider.ready&&0===this._surface._tileLoadQueueHigh.length&&0===this._surface._tileLoadQueueMedium.length&&0===this._surface._tileLoadQueueLow.length}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){defined(e)||(e=Rectangle.clone(Rectangle.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),defined(this._material)&&makeShadersDirty(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,makeShadersDirty(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=Color.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=NearFarScalar.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});var scratchArray$1=[],scratchSphereIntersectionResult={start:0,stop:0};Globe.prototype.pickWorldCoordinates=function(e,t,i,r){i=defaultValue(i,!0);var n=t.mode,a=t.mapProjection,o=scratchArray$1;o.length=0;for(var s,l,c=this._surface._tilesToRender,u=c.length,d=0;d<u;++d){var h=(s=c[d]).data;if(defined(h)){var p=h.pickBoundingSphere;if(n!==SceneMode$1.SCENE3D)h.pickBoundingSphere=p=BoundingSphere.fromRectangleWithHeights2D(s.rectangle,a,h.tileBoundingRegion.minimumHeight,h.tileBoundingRegion.maximumHeight,p),Cartesian3.fromElements(p.center.z,p.center.x,p.center.y,p.center);else{if(!defined(h.renderedMesh))continue;BoundingSphere.clone(h.renderedMesh.boundingSphere3D,p)}defined(IntersectionTests.raySphere(e,p,scratchSphereIntersectionResult))&&o.push(h)}}for(o.sort(createComparePickTileFunction(e.origin)),u=o.length,d=0;d<u&&!defined(l=o[d].pick(e,t.mode,t.mapProjection,i,r));++d);return l};var cartoScratch$2=new Cartographic;Globe.prototype.pick=function(e,t,i){return defined(i=this.pickWorldCoordinates(e,t,!0,i))&&t.mode!==SceneMode$1.SCENE3D&&(i=Cartesian3.fromElements(i.y,i.z,i.x,i),e=t.mapProjection.unproject(i,cartoScratch$2),i=t.globe.ellipsoid.cartographicToCartesian(e,i)),i};var scratchGetHeightCartesian=new Cartesian3,scratchGetHeightIntersection=new Cartesian3,scratchGetHeightCartographic=new Cartographic,scratchGetHeightRay=new Ray;function tileIfContainsCartographic(e,t){return defined(e)&&Rectangle.contains(e.rectangle,t)?e:void 0}Globe.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(defined(t)){for(var i,r=t.length,n=0;n<r&&(i=t[n],!Rectangle.contains(i.rectangle,e));++n);if(!(r<=n)){for(var a=i;defined(i);)defined(i=tileIfContainsCartographic(i._southwestChild,e)||tileIfContainsCartographic(i._southeastChild,e)||tileIfContainsCartographic(i._northwestChild,e)||i._northeastChild)&&defined(i.data)&&defined(i.data.renderedMesh)&&(a=i);if(defined(i=a)&&defined(i.data)&&defined(i.data.renderedMesh)){var o,s=this._surface._tileProvider.tilingScheme.ellipsoid,l=Cartesian3.fromRadians(e.longitude,e.latitude,0,s,scratchGetHeightCartesian),c=scratchGetHeightRay,u=s.geodeticSurfaceNormal(l,c.direction);defined(s.getSurfaceNormalIntersectionWithZAxis(l,11500,c.origin))||(defined(i.data.tileBoundingRegion)&&(o=i.data.tileBoundingRegion.minimumHeight),o=Math.min(defaultValue(o,0),-11500),o=Cartesian3.multiplyByScalar(u,Math.abs(o)+1,scratchGetHeightIntersection),Cartesian3.subtract(l,o,c.origin));c=i.data.pick(c,void 0,void 0,!1,scratchGetHeightIntersection);if(defined(c))return s.cartesianToCartographic(c,scratchGetHeightCartographic).height}}}},Globe.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)},Globe.prototype.beginFrame=function(t){var i,r,e=this._surface,n=e.tileProvider,a=this.terrainProvider,o=this.showWaterEffect&&a.ready&&a.hasWaterMask;o&&this._oceanNormalMapResourceDirty&&(this._oceanNormalMapResourceDirty=!1,s=this._oceanNormalMapResource,defined(i=s.url)?(r=this,when(s.fetchImage(),function(e){i===r._oceanNormalMapResource.url&&(r._oceanNormalMap=r._oceanNormalMap&&r._oceanNormalMap.destroy(),r._oceanNormalMap=new Texture({context:t.context,source:e}))})):this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy());var a=t.passes,s=t.mode;a.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e.tileCacheSize=this.tileCacheSize,e.loadingDescendantLimit=this.loadingDescendantLimit,e.preloadAncestors=this.preloadAncestors,e.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===SceneMode$1.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,e.beginFrame(t))},Globe.prototype.render=function(e){this.show&&(defined(this._material)&&this._material.update(e.context),this._surface.render(e))},Globe.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},Globe.prototype.isDestroyed=function(){return!1},Globe.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),destroyObject(this)};var PassThrough="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(colorTexture, v_textureCoordinates);\n}\n",PassThroughDepth="uniform highp sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = czm_packDepth(texture2D(u_depthTexture, v_textureCoordinates).r);\n}\n";function GlobeDepth(){this._globeColorTexture=void 0,this._primitiveColorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this._tempGlobeDepthTexture=void 0,this._tempCopyDepthTexture=void 0,this._globeColorFramebuffer=void 0,this._primitiveColorFramebuffer=void 0,this._copyDepthFramebuffer=void 0,this._tempCopyDepthFramebuffer=void 0,this._updateDepthFramebuffer=void 0,this._clearGlobeColorCommand=void 0,this._clearPrimitiveColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._mergeColorCommand=void 0,this._viewport=new BoundingRectangle,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useLogDepth=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0,this._debugGlobeDepthViewportCommand=void 0}function executeDebugGlobeDepth(e,t,i,r){var n;defined(e._debugGlobeDepthViewportCommand)&&r===e._useLogDepth||(n=new ShaderSource({defines:[r?"LOG_DEPTH":""],sources:["uniform highp sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\n z_window = czm_reverseLogDepth(z_window); \n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n"]}),e._debugGlobeDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_depthTexture:function(){return e._globeDepthTexture}},owner:e}),e._useLogDepth=r),e._debugGlobeDepthViewportCommand.execute(t,i)}function destroyTextures(e){e._globeColorTexture=e._globeColorTexture&&!e._globeColorTexture.isDestroyed()&&e._globeColorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function destroyFramebuffers$1(e){e._globeColorFramebuffer=e._globeColorFramebuffer&&!e._globeColorFramebuffer.isDestroyed()&&e._globeColorFramebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function destroyUpdateDepthResources(e){e._tempCopyDepthFramebuffer=e._tempCopyDepthFramebuffer&&!e._tempCopyDepthFramebuffer.isDestroyed()&&e._tempCopyDepthFramebuffer.destroy(),e._updateDepthFramebuffer=e._updateDepthFramebuffer&&!e._updateDepthFramebuffer.isDestroyed()&&e._updateDepthFramebuffer.destroy(),e._tempGlobeDepthTexture=e._tempGlobeDepthTexture&&!e._tempGlobeDepthTexture.isDestroyed()&&e._tempGlobeDepthTexture.destroy()}function createUpdateDepthResources(e,t,i,r,n){e._tempGlobeDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e._tempCopyDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._tempGlobeDepthTexture],destroyAttachments:!1}),e._updateDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeDepthTexture],depthStencilTexture:n.framebuffer.depthStencilTexture,destroyAttachments:!1})}function createTextures$1(e,t,i,r,n){n=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._globeColorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:n,sampler:Sampler.NEAREST}),e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}),e._globeDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST})}function createFramebuffers$1(e,t){e._globeColorFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeColorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function createPrimitiveFramebuffer(e,t,i,r,n){n=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._primitiveColorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:n,sampler:Sampler.NEAREST}),e._primitiveColorFramebuffer=new Framebuffer({context:t,colorTextures:[e._primitiveColorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1})}function destroyPrimitiveFramebuffer(e){e._primitiveColorTexture=e._primitiveColorTexture&&!e._primitiveColorTexture.isDestroyed()&&e._primitiveColorTexture.destroy(),e._primitiveColorFramebuffer=e._primitiveColorFramebuffer&&!e._primitiveColorFramebuffer.isDestroyed()&&e._primitiveColorFramebuffer.destroy()}function updateFramebuffers(e,t,i,r,n,a){var o=e._globeColorTexture,o=!defined(o)||o.width!==i||o.height!==r||n!==e._useHdr;o&&(destroyTextures(e),destroyFramebuffers$1(e),createTextures$1(e,t,i,r,n),createFramebuffers$1(e,t)),!o&&a===e._clearGlobeDepth||(destroyPrimitiveFramebuffer(e),a&&createPrimitiveFramebuffer(e,t,i,r,n))}function updateCopyCommands(e,t,i,r,n){e._viewport.width=i,e._viewport.height=r;i=!BoundingRectangle.equals(e._viewport,n.viewport),r=i!==e._useScissorTest;e._useScissorTest=i,BoundingRectangle.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=BoundingRectangle.clone(n.viewport,e._scissorRectangle),r=!0),defined(e._rs)&&BoundingRectangle.equals(e._viewport,e._rs.viewport)&&!r||(e._rs=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:BlendingState$1.ALPHA_BLEND}),e._rsUpdate=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK}})),defined(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._depthStencilTexture}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer,e._copyDepthCommand.renderState=e._rs,defined(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._globeColorTexture}},owner:e})),e._copyColorCommand.renderState=e._rs,defined(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer,e._tempCopyDepthCommand.renderState=e._rs,defined(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._tempGlobeDepthTexture}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer,e._updateDepthCommand.renderState=e._rsUpdate,defined(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ClearCommand({color:new Color(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e._globeColorFramebuffer,defined(e._clearPrimitiveColorCommand)||(e._clearPrimitiveColorCommand=new ClearCommand({color:new Color(0,0,0,0),stencil:0,owner:e})),e._clearPrimitiveColorCommand.framebuffer=e._primitiveColorFramebuffer,defined(e._mergeColorCommand)||(e._mergeColorCommand=t.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return e._primitiveColorTexture}},owner:e})),e._mergeColorCommand.framebuffer=e._globeColorFramebuffer,e._mergeColorCommand.renderState=e._rsBlend}function GlobeTranslucencyFramebuffer(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._framebuffer=void 0,this._packedDepthTexture=void 0,this._packedDepthFramebuffer=void 0,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new BoundingRectangle,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}function destroyResources(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&!e._depthStencilRenderbuffer.isDestroyed()&&e._depthStencilRenderbuffer.destroy(),e._framebuffer=e._framebuffer&&!e._framebuffer.isDestroyed()&&e._framebuffer.destroy(),e._packedDepthTexture=e._packedDepthTexture&&!e._packedDepthTexture.isDestroyed()&&e._packedDepthTexture.destroy(),e._packedDepthFramebuffer=e._packedDepthFramebuffer&&!e._packedDepthFramebuffer.isDestroyed()&&e._packedDepthFramebuffer.destroy()}function createResources$5(e,t,i,r,n){n=n?t.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE;e._colorTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:n,sampler:Sampler.NEAREST}),t.depthTexture?e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}):e._depthStencilRenderbuffer=new Renderbuffer({context:t,width:i,height:r,format:RenderbufferFormat$1.DEPTH_STENCIL}),e._framebuffer=new Framebuffer({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,depthStencilRenderbuffer:e._depthStencilRenderbuffer,destroyAttachments:!1}),e._packedDepthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e._packedDepthFramebuffer=new Framebuffer({context:t,colorTextures:[e._packedDepthTexture],destroyAttachments:!1})}function updateResources(e,t,i,r,n){var a=e._colorTexture;defined(a)&&a.width===i&&a.height===r&&n===e._useHdr||(destroyResources(e),createResources$5(e,t,i,r,n))}function updateCommands(e,t,i,r,n){e._viewport.width=i,e._viewport.height=r;i=!BoundingRectangle.equals(e._viewport,n.viewport),r=i!==e._useScissorTest;e._useScissorTest=i,BoundingRectangle.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=BoundingRectangle.clone(n.viewport,e._scissorRectangle),r=!0),defined(e._renderState)&&BoundingRectangle.equals(e._viewport,e._renderState.viewport)&&!r||(e._renderState=RenderState.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),defined(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(PassThroughDepth,{uniformMap:{u_depthTexture:function(){return e._depthStencilTexture}},owner:e})),defined(e._clearCommand)||(e._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e._framebuffer,e._clearCommand.renderState=e._renderState}Object.defineProperties(GlobeDepth.prototype,{framebuffer:{get:function(){return this._globeColorFramebuffer}},primitiveFramebuffer:{get:function(){return this._primitiveColorFramebuffer}}}),GlobeDepth.prototype.executeDebugGlobeDepth=function(e,t,i){executeDebugGlobeDepth(this,e,t,i)},GlobeDepth.prototype.update=function(e,t,i,r,n){var a=i.width,i=i.height;updateFramebuffers(this,e,a,i,r,n),updateCopyCommands(this,e,a,i,t),e.uniformState.globeDepthTexture=void 0,this._useHdr=r,this._clearGlobeDepth=n},GlobeDepth.prototype.executeCopyDepth=function(e,t){defined(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},GlobeDepth.prototype.executeUpdateDepth=function(e,t,i){var r,n=t.framebuffer.depthStencilTexture;i||n!==this._depthStencilTexture?defined(this._updateDepthCommand)&&(defined(this._updateDepthFramebuffer)&&this._updateDepthFramebuffer.depthStencilTexture===n&&this._updateDepthFramebuffer.getColorTexture(0)===this._globeDepthTexture||(r=this._globeDepthTexture.width,i=this._globeDepthTexture.height,destroyUpdateDepthResources(this),createUpdateDepthResources(this,e,r,i,t),updateCopyCommands(this,e,r,i,t)),this._tempCopyDepthTexture=n,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)):defined(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t)},GlobeDepth.prototype.executeCopyColor=function(e,t){defined(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},GlobeDepth.prototype.executeMergeColor=function(e,t){defined(this._mergeColorCommand)&&this._mergeColorCommand.execute(e,t)},GlobeDepth.prototype.clear=function(e,t,i){var r=this._clearGlobeColorCommand;defined(r)&&(Color.clone(i,r.color),r.execute(e,t)),defined(r=this._clearPrimitiveColorCommand)&&defined(this._primitiveColorFramebuffer)&&r.execute(e,t)},GlobeDepth.prototype.isDestroyed=function(){return!1},GlobeDepth.prototype.destroy=function(){return destroyTextures(this),destroyFramebuffers$1(this),destroyPrimitiveFramebuffer(this),destroyUpdateDepthResources(this),defined(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),defined(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),defined(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),defined(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),defined(this._mergeColorCommand)&&(this._mergeColorCommand.shaderProgram=this._mergeColorCommand.shaderProgram.destroy()),defined(this._debugGlobeDepthViewportCommand)&&(this._debugGlobeDepthViewportCommand.shaderProgram=this._debugGlobeDepthViewportCommand.shaderProgram.destroy()),destroyObject(this)},Object.defineProperties(GlobeTranslucencyFramebuffer.prototype,{classificationTexture:{get:function(){return this._colorTexture}},classificationFramebuffer:{get:function(){return this._framebuffer}}}),GlobeTranslucencyFramebuffer.prototype.updateAndClear=function(e,t,i,r){var n=t.width,t=t.height;updateResources(this,i,n,t,e),updateCommands(this,i,n,t,r),this._useHdr=e},GlobeTranslucencyFramebuffer.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)},GlobeTranslucencyFramebuffer.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this._packedDepthTexture},GlobeTranslucencyFramebuffer.prototype.isDestroyed=function(){return!1},GlobeTranslucencyFramebuffer.prototype.destroy=function(){return destroyResources(this),destroyObject(this)};var DerivedCommandType={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},derivedCommandsMaximumLength=DerivedCommandType.DERIVED_COMMANDS_MAXIMUM_LENGTH,DerivedCommandNames=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function GlobeTranslucencyState(){this._frontFaceAlphaByDistance=new NearFarScalar(0,1,0,1),this._backFaceAlphaByDistance=new NearFarScalar(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=Rectangle.clone(Rectangle.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(derivedCommandsMaximumLength),this._derivedBlendCommandTypes=new Array(derivedCommandsMaximumLength),this._derivedPickCommandTypes=new Array(derivedCommandsMaximumLength),this._derivedCommandTypesToUpdate=new Array(derivedCommandsMaximumLength),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}function updateAlphaByDistance(e,t,i,r){return e?defined(i)?(NearFarScalar.clone(i,r),r.nearValue*=t,r.farValue*=t):(r.nearValue=t,r.farValue=t):(r.nearValue=1,r.farValue=1),r}function isFaceTranslucent(e,t,i){return e&&(i.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function isSunVisibleThroughGlobe(e,t){var i=e._frontFaceTranslucent,e=e._backFaceTranslucent;return i&&(t.cameraUnderground||e)}function isEnvironmentVisible(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function useDepthPlane(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function requiresManualDepthTest(e,t,i){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!i.depthTestAgainstTerrain&&t.mode!==SceneMode$1.SCENE2D&&t.context.depthTexture}function getNumberOfTextureUniforms(e){var t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function gatherDerivedCommandRequirements(e,t){e._derivedCommandsLength=getDerivedCommandTypes(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=getDerivedCommandTypes(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=getDerivedCommandTypes(e,t,!1,!0,e._derivedPickCommandTypes);for(var i=0,r=0;r<e._derivedCommandsLength;++r)i|=1<<e._derivedCommandTypes[r];for(r=0;r<e._derivedBlendCommandsLength;++r)i|=1<<e._derivedBlendCommandTypes[r];for(r=0;r<e._derivedPickCommandsLength;++r)i|=1<<e._derivedPickCommandTypes[r];var n=0;for(r=0;r<derivedCommandsMaximumLength;++r)0<(i&1<<r)&&(e._derivedCommandTypesToUpdate[n++]=r);e._derivedCommandsToUpdateLength=n;t=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=t,!defined(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=createDerivedCommandPacks())}function getDerivedCommandTypes(e,t,i,r,n){var a=0,o=e._frontFaceTranslucent,s=e._backFaceTranslucent;if(!o)return a;var l=t.cameraUnderground,o=e._requiresManualDepthTest,e=r?DerivedCommandType.PICK_FRONT_FACE:o?DerivedCommandType.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:DerivedCommandType.TRANSLUCENT_FRONT_FACE,o=r?DerivedCommandType.PICK_BACK_FACE:o?DerivedCommandType.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:DerivedCommandType.TRANSLUCENT_BACK_FACE;return t.mode===SceneMode$1.SCENE2D?(n[a++]=DerivedCommandType.DEPTH_ONLY_FRONT_FACE,n[a++]=e):s?(i||(n[a++]=DerivedCommandType.DEPTH_ONLY_FRONT_AND_BACK_FACE),l?(n[a++]=e,n[a++]=o):(n[a++]=o,n[a++]=e)):l?(i||(n[a++]=DerivedCommandType.DEPTH_ONLY_BACK_FACE),n[a++]=DerivedCommandType.OPAQUE_FRONT_FACE,n[a++]=o):(i||(n[a++]=DerivedCommandType.DEPTH_ONLY_FRONT_FACE),n[a++]=DerivedCommandType.OPAQUE_BACK_FACE,n[a++]=e),a}function removeDefine(e,t){t=e.indexOf(t);-1<t&&e.splice(t,1)}function hasDefine(e,t){return-1<e.indexOf(t)}function getOpaqueFrontFaceShaderProgram(e,t){removeDefine(e.defines,"TRANSLUCENT"),removeDefine(t.defines,"TRANSLUCENT")}function getOpaqueBackFaceShaderProgram(e,t){removeDefine(e.defines,"GROUND_ATMOSPHERE"),removeDefine(t.defines,"GROUND_ATMOSPHERE"),removeDefine(e.defines,"FOG"),removeDefine(t.defines,"FOG"),removeDefine(e.defines,"TRANSLUCENT"),removeDefine(t.defines,"TRANSLUCENT")}function getDepthOnlyShaderProgram$1(e,t){hasDefine(t.defines,"TILE_LIMIT_RECTANGLE")||hasDefine(t.defines,"ENABLE_CLIPPING_PLANES")||(t.sources=["void main() \n{ \n gl_FragColor = vec4(1.0); \n} \n"])}function getTranslucentShaderProgram(e,t){for(var i=t.sources,r=i.length,n=0;n<r;++n)i[n]=ShaderSource.replaceMain(i[n],"czm_globe_translucency_main");i.push("\n\nuniform sampler2D u_classificationTexture; \nvoid main() \n{ \n vec2 st = gl_FragCoord.xy / czm_viewport.zw; \n#ifdef MANUAL_DEPTH_TEST \n float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st)); \n if (logDepthOrDepth != 0.0) \n { \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); \n float depthEC = eyeCoordinate.z / eyeCoordinate.w; \n if (v_positionEC.z < depthEC) \n { \n discard; \n } \n } \n#endif \n czm_globe_translucency_main(); \n vec4 classificationColor = texture2D(u_classificationTexture, st); \n if (classificationColor.a > 0.0) \n { \n // Reverse premultiplication process to get the correct composited result of the classification primitives \n classificationColor.rgb /= classificationColor.a; \n } \n gl_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + gl_FragColor * (1.0 - classificationColor.a); \n} \n")}function getTranslucentBackFaceShaderProgram(e,t){getTranslucentShaderProgram(e,t),removeDefine(e.defines,"GROUND_ATMOSPHERE"),removeDefine(t.defines,"GROUND_ATMOSPHERE"),removeDefine(e.defines,"FOG"),removeDefine(t.defines,"FOG")}function getTranslucentFrontFaceManualDepthTestShaderProgram(e,t){getTranslucentShaderProgram(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function getTranslucentBackFaceManualDepthTestShaderProgram(e,t){getTranslucentBackFaceShaderProgram(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function getPickShaderProgram$1(e,t){t.sources=["uniform sampler2D u_classificationTexture; \nvoid main() \n{ \n vec2 st = gl_FragCoord.xy / czm_viewport.zw; \n vec4 pickColor = texture2D(u_classificationTexture, st); \n if (pickColor == vec4(0.0)) \n { \n discard; \n } \n gl_FragColor = pickColor; \n} \n"]}function getDerivedShaderProgram(e,t,i,r,n,a){if(!defined(n))return t;if(!r&&defined(i))return i;var o,s=e.shaderCache.getDerivedShaderProgram(t,a);return defined(s)||(o=t._attributeLocations,r=t.vertexShaderSource.clone(),i=t.fragmentShaderSource.clone(),r.defines=defined(r.defines)?r.defines.slice(0):[],i.defines=defined(i.defines)?i.defines.slice(0):[],n(r,i),s=e.shaderCache.createDerivedShaderProgram(t,a,{vertexShaderSource:r,fragmentShaderSource:i,attributeLocations:o})),s}function getOpaqueFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0}function getOpaqueBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0}function getDepthOnlyFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function getDepthOnlyBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function getDepthOnlyFrontAndBackFaceRenderState(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function getTranslucentFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=BlendingState$1.ALPHA_BLEND}function getTranslucentBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=BlendingState$1.ALPHA_BLEND}function getPickFrontFaceRenderState(e){e.cull.face=CullFace$1.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function getPickBackFaceRenderState(e){e.cull.face=CullFace$1.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function getDerivedRenderState(e,t,i,r,n){if(!defined(r))return e;if(!i&&defined(t))return t;t=n[e.id];return defined(t)||(r(r=RenderState.getState(e)),t=RenderState.fromCache(r),n[e.id]=t),t}function getTranslucencyUniformMap(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function getDerivedUniformMap(e,t,i,r,n){return defined(n)?!r&&defined(i)?i:combine(t,n(e),!1):t}function DerivedCommandPack(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function createDerivedCommandPacks(){return[new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getOpaqueFrontFaceShaderProgram,getRenderStateFunction:getOpaqueFrontFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getOpaqueBackFaceShaderProgram,getRenderStateFunction:getOpaqueBackFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getDepthOnlyShaderProgram$1,getRenderStateFunction:getDepthOnlyFrontFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getDepthOnlyShaderProgram$1,getRenderStateFunction:getDepthOnlyBackFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.GLOBE,pickOnly:!1,getShaderProgramFunction:getDepthOnlyShaderProgram$1,getRenderStateFunction:getDepthOnlyFrontAndBackFaceRenderState,getUniformMapFunction:void 0}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentShaderProgram,getRenderStateFunction:getTranslucentFrontFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentBackFaceShaderProgram,getRenderStateFunction:getTranslucentBackFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentFrontFaceManualDepthTestShaderProgram,getRenderStateFunction:getTranslucentFrontFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:getTranslucentBackFaceManualDepthTestShaderProgram,getRenderStateFunction:getTranslucentBackFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:getPickShaderProgram$1,getRenderStateFunction:getPickFrontFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap}),new DerivedCommandPack({pass:Pass$1.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:getPickShaderProgram$1,getRenderStateFunction:getPickBackFaceRenderState,getUniformMapFunction:getTranslucencyUniformMap})]}Object.defineProperties(GlobeTranslucencyState.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}}),GlobeTranslucencyState.prototype.update=function(e){var t=e.globe;if(!defined(t)||!t.show)return this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,void(this._useDepthPlane=!1);this._frontFaceAlphaByDistance=updateAlphaByDistance(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=updateAlphaByDistance(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=isFaceTranslucent(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=isFaceTranslucent(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=requiresManualDepthTest(this,e,t),this._sunVisibleThroughGlobe=isSunVisibleThroughGlobe(this,e),this._environmentVisible=isEnvironmentVisible(this,e),this._useDepthPlane=useDepthPlane(this,e),this._numberOfTextureUniforms=getNumberOfTextureUniforms(this),this._rectangle=Rectangle.clone(t.translucency.rectangle,this._rectangle),gatherDerivedCommandRequirements(this,e)};var derivedCommandNames=new Array(derivedCommandsMaximumLength),derivedCommandPacks=new Array(derivedCommandsMaximumLength);function updateDerivedCommands(e,t,i,r,n,a,o){var s=t.derivedCommands.globeTranslucency,l=e._derivedCommandsDirty;if(t.dirty||!defined(s)||l){t.dirty=!1,defined(s)||(s={},t.derivedCommands.globeTranslucency=s);var c=o.frameNumber,u=defaultValue(s.uniformMapDirtyFrame,0),d=defaultValue(s.shaderProgramDirtyFrame,0),h=defaultValue(s.renderStateDirtyFrame,0),p=s.uniformMap!==t.uniformMap,m=s.shaderProgramId!==t.shaderProgram.id,f=s.renderStateId!==t.renderState.id;p&&(s.uniformMapDirtyFrame=c),m&&(s.shaderProgramDirtyFrame=c),f&&(s.renderStateDirtyFrame=c),s.uniformMap=t.uniformMap,s.shaderProgramId=t.shaderProgram.id,s.renderStateId=t.renderState.id;for(var g=0;g<i;++g){var _,y,C=a[g],v=r[g],S=n[g],T=defined(x=s[S])?(_=x.uniformMap,y=x.shaderProgram,x.renderState):y=_=void 0,x=DrawCommand.shallowClone(t,x),b=defaultValue((s[S]=x).derivedCommands.uniformMapDirtyFrame,0),E=defaultValue(x.derivedCommands.shaderProgramDirtyFrame,0),P=defaultValue(x.derivedCommands.renderStateDirtyFrame,0),b=p||b<u,E=m||E<d,P=f||P<h;b&&(x.derivedCommands.uniformMapDirtyFrame=c),E&&(x.derivedCommands.shaderProgramDirtyFrame=c),P&&(x.derivedCommands.renderStateDirtyFrame=c),x.derivedCommands.type=v,x.pass=C.pass,x.pickOnly=C.pickOnly,x.uniformMap=getDerivedUniformMap(e,t.uniformMap,_,b,C.getUniformMapFunction),x.shaderProgram=getDerivedShaderProgram(o.context,t.shaderProgram,y,E,C.getShaderProgramFunction,S),x.renderState=getDerivedRenderState(t.renderState,T,P,C.getRenderStateFunction,C.renderStateCache)}}}function executeCommandsMatchingType(e,t,i,r,n,a,o){for(var s=0;s<t;++s){var l=e[s],c=l.derivedCommands.type;(!defined(o)||-1<o.indexOf(c))&&i(l,r,n,a)}}function executeCommands(e,t,i,r,n,a){for(var o=0;o<t;++o)i(e[o],r,n,a)}GlobeTranslucencyState.prototype.updateDerivedCommands=function(e,t){var i=this._derivedCommandTypesToUpdate,r=this._derivedCommandsToUpdateLength;if(0!==r){for(var n=0;n<r;++n)derivedCommandPacks[n]=this._derivedCommandPacks[i[n]],derivedCommandNames[n]=DerivedCommandNames[i[n]];updateDerivedCommands(this,e,r,i,derivedCommandNames,derivedCommandPacks,t)}},GlobeTranslucencyState.prototype.pushDerivedCommands=function(e,t,i){var r=i.passes.pick;if(!r||!t){var n=this._derivedCommandTypes,a=this._derivedCommandsLength;if(r?(n=this._derivedPickCommandTypes,a=this._derivedPickCommandsLength):t&&(n=this._derivedBlendCommandTypes,a=this._derivedBlendCommandsLength),0!==a)for(var o=e.derivedCommands.globeTranslucency,s=0;s<a;++s){var l=DerivedCommandNames[n[s]];i.commandList.push(o[l])}else i.commandList.push(e)}};var opaqueTypes=[DerivedCommandType.OPAQUE_FRONT_FACE,DerivedCommandType.OPAQUE_BACK_FACE],depthOnlyTypes=[DerivedCommandType.DEPTH_ONLY_FRONT_FACE,DerivedCommandType.DEPTH_ONLY_BACK_FACE,DerivedCommandType.DEPTH_ONLY_FRONT_AND_BACK_FACE];function GoogleEarthEnterpriseDiscardPolicy(){this._image=new Image}function GoogleEarthEnterpriseImageryProvider(e){var t;e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,t=defined(e.metadata)?e.metadata:new GoogleEarthEnterpriseMetadata(Resource.createIfNeeded(e.url)),this._metadata=t,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Rectangle(-CesiumMath.PI,-CesiumMath.PI,CesiumMath.PI,CesiumMath.PI),ellipsoid:e.ellipsoid});e=e.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,defined(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new GoogleEarthEnterpriseDiscardPolicy),this._errorEvent=new Event,this._ready=!1;var i,r=this;this._readyPromise=t.readyPromise.then(function(e){if(t.imageryPresent)return TileProviderError.handleSuccess(i),r._ready=e;e=new RuntimeError("The server "+t.url+" doesn't have imagery");return i=TileProviderError.handleError(i,r,r._errorEvent,e.message,void 0,void 0,void 0,e),when.reject(e)}).otherwise(function(e){return i=TileProviderError.handleError(i,r,r._errorEvent,e.message,void 0,void 0,void 0,e),when.reject(e)})}function buildImageResource$2(e,t,i,r,n,a){n=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(i,r,n),t=defined(t=t.imageryVersion)&&0<t?t:1;return e._metadata.resource.getDerivedResource({url:"flatfile?f1-0"+n+"-i."+t.toString(),request:a})}function getImageType(e){var t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";return e[1]==="PNG".charCodeAt(0)&&e[2]==="PNG".charCodeAt(1)&&e[3]==="PNG".charCodeAt(2)?"image/png":void 0}function decodeEarthImageryPacket(e){for(var t=protobuf.Reader.create(e),i=t.len,r={};t.pos<i;){var n=t.uint32();switch(n>>>3){case 1:r.imageType=t.uint32();break;case 2:r.imageData=t.bytes();break;case 3:r.alphaType=t.uint32();break;case 4:r.imageAlpha=t.bytes();break;case 5:var a=r.copyrightIds;if(defined(a)||(a=r.copyrightIds=[]),2==(7&n))for(var o=t.uint32()+t.pos;t.pos<o;)a.push(t.uint32());else a.push(t.uint32());break;default:t.skipType(7&n)}}e=r.imageType;if(defined(e))switch(e){case 0:r.imageType="image/jpeg";break;case 4:r.imageType="image/png";break;default:throw new RuntimeError("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}e=r.alphaType;return defined(e)&&0!==e&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete r.alphaType,delete r.imageAlpha),r}function GoogleEarthEnterpriseMapsProvider(a){a=defaultValue(a,{}),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=1.9,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;var e=a.url,t=defaultValue(a.path,"/default_map"),i=Resource.createIfNeeded(e).getDerivedResource({url:"/"===t[0]?t.substring(1):t});i.appendForwardSlash(),this._resource=i,this._url=e,this._path=t,this._tileDiscardPolicy=a.tileDiscardPolicy,this._channel=a.channel,this._requestType="ImageryMaps",this._credit=new Credit('<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="'+GoogleEarthEnterpriseMapsProvider.logoUrl+'" title="Google Imagery"/></a>'),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=a.maximumLevel,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();var o,r=i.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=this;function n(t){var i,e;try{i=JSON.parse(t)}catch(e){i=JSON.parse(t.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var r,n=0;n<i.layers.length;n++)if(i.layers[n].id===s._channel){e=i.layers[n];break}if(!defined(e))throw r="Could not find layer with channel (id) of "+s._channel+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,c),new RuntimeError(r);if(!defined(e.version))throw r="Could not find a version in channel (id) "+s._channel+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,c),new RuntimeError(r);if(s._version=e.version,defined(i.projection)&&"flat"===i.projection)s._tilingScheme=new GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Rectangle(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:a.ellipsoid});else{if(defined(i.projection)&&"mercator"!==i.projection)throw r="Unsupported projection "+i.projection+".",o=TileProviderError.handleError(o,s,s._errorEvent,r,void 0,void 0,void 0,c),new RuntimeError(r);s._tilingScheme=new WebMercatorTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:a.ellipsoid})}s._ready=!0,s._readyPromise.resolve(!0),TileProviderError.handleSuccess(o)}function l(e){var t="An error occurred while accessing "+r.url+".";o=TileProviderError.handleError(o,s,s._errorEvent,t,void 0,void 0,void 0,c),s._readyPromise.reject(new RuntimeError(t))}function c(){when(r.fetchText(),n,l)}c()}GlobeTranslucencyState.prototype.executeGlobeCommands=function(e,t,i,r,n){var a=r.context,o=e.commands[Pass$1.GLOBE],e=e.indices[Pass$1.GLOBE];0!==e&&((this._globeTranslucencyFramebuffer=i).clearClassification(a,n),executeCommandsMatchingType(o,e,t,r,a,n,opaqueTypes))},GlobeTranslucencyState.prototype.executeGlobeClassificationCommands=function(e,t,i,r,n){var a,o=r.context,s=e.commands[Pass$1.GLOBE],l=e.indices[Pass$1.GLOBE],c=e.commands[Pass$1.TERRAIN_CLASSIFICATION],u=e.indices[Pass$1.TERRAIN_CLASSIFICATION];0!==l&&0!==u&&(a=this._frontFaceTranslucent,e=this._backFaceTranslucent,a&&e||executeCommands(c,u,t,r,o,n),(a||e)&&(this._globeTranslucencyFramebuffer=i,a=o.uniformState.globeDepthTexture,e=n.framebuffer,n.framebuffer=i.classificationFramebuffer,executeCommandsMatchingType(s,l,t,r,o,n,depthOnlyTypes),o.depthTexture&&(i=i.packDepth(o,n),o.uniformState.globeDepthTexture=i),executeCommands(c,u,t,r,o,n),o.uniformState.globeDepthTexture=a,n.framebuffer=e))},GoogleEarthEnterpriseDiscardPolicy.prototype.isReady=function(){return!0},GoogleEarthEnterpriseDiscardPolicy.prototype.shouldDiscardImage=function(e){return e===this._image},Object.defineProperties(GoogleEarthEnterpriseImageryProvider.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}}),GoogleEarthEnterpriseImageryProvider.prototype.getTileCredits=function(e,t,i){var r=this._metadata,i=r.getTileInformation(e,t,i);if(defined(i)){i=r.providers[i.imageryProvider];if(defined(i))return[i]}},GoogleEarthEnterpriseImageryProvider.prototype.requestImage=function(e,t,i,r){var n=this._tileDiscardPolicy._image,a=this._metadata,o=GoogleEarthEnterpriseMetadata.tileXYToQuadKey(e,t,i),s=a.getTileInformation(e,t,i);if(!defined(s)){if(a.isValid(o)){o=new Request({throttle:r.throttle,throttleByServer:r.throttleByServer,type:r.type,priorityFunction:r.priorityFunction});return void a.populateSubtree(e,t,i,o)}return n}if(!s.hasImagery())return n;r=buildImageResource$2(this,s,e,t,i,r).fetchArrayBuffer();return defined(r)?r.then(function(e){decodeGoogleEarthEnterpriseData(a.key,e);var t,i=new Uint8Array(e),e=a.protoImagery;return defined(e)&&e||(t=getImageType(i)),defined(t)||defined(e)&&!e||(t=(e=decodeEarthImageryPacket(i)).imageType,i=e.imageData),defined(t)&&defined(i)?loadImageFromTypedArray({uint8Array:i,format:t,flipY:!0}):n}):void 0},GoogleEarthEnterpriseImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},Object.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),GoogleEarthEnterpriseMapsProvider.prototype.getTileCredits=function(e,t,i){},GoogleEarthEnterpriseMapsProvider.prototype.requestImage=function(e,t,i,r){i=this._resource.getDerivedResource({url:"query",request:r,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:i+1}});return ImageryProvider.loadImage(this,i)},GoogleEarthEnterpriseMapsProvider.prototype.pickFeatures=function(e,t,i,r,n){},GoogleEarthEnterpriseMapsProvider._logoUrl=void 0,Object.defineProperties(GoogleEarthEnterpriseMapsProvider,{logoUrl:{get:function(){return defined(GoogleEarthEnterpriseMapsProvider._logoUrl)||(GoogleEarthEnterpriseMapsProvider._logoUrl=buildModuleUrl("Assets/Images/google_earth_credit.png")),GoogleEarthEnterpriseMapsProvider._logoUrl},set:function(e){GoogleEarthEnterpriseMapsProvider._logoUrl=e}}});var defaultColor$8=new Color(1,1,1,.4),defaultGlowColor=new Color(0,1,0,.05),defaultBackgroundColor$2=new Color(0,.5,0,.2);function GridImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new GeographicTilingScheme({ellipsoid:e.ellipsoid}),this._cells=defaultValue(e.cells,8),this._color=defaultValue(e.color,defaultColor$8),this._glowColor=defaultValue(e.glowColor,defaultGlowColor),this._glowWidth=defaultValue(e.glowWidth,6),this._backgroundColor=defaultValue(e.backgroundColor,defaultBackgroundColor$2),this._errorEvent=new Event,this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._canvasSize=defaultValue(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=when.resolve(!0)}function InvertClassification(){this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._texture=void 0,this._classifiedTexture=void 0,this._depthStencilTexture=void 0,this._fbo=void 0,this._fboClassified=void 0,this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,stencil:0});var e=this;this._uniformMap={colorTexture:function(){return e._texture},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._classifiedTexture}}}Object.defineProperties(GridImageryProvider.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),GridImageryProvider.prototype._drawGrid=function(e){for(var t=this._canvasSize,i=0;i<=this._cells;++i){var r=1+i/this._cells*(t-1);e.moveTo(r,0),e.lineTo(r,t),e.moveTo(0,r),e.lineTo(t,r)}e.stroke()},GridImageryProvider.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(0,0,t,t);r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(0,0,t,t),this._drawGrid(i),i.lineWidth=.5*this._glowWidth,i.strokeRect(0,0,t,t),this._drawGrid(i);r=this._color.toCssColorString();return i.strokeStyle=r,i.lineWidth=2,i.strokeRect(0,0,t,t),i.lineWidth=1,this._drawGrid(i),e},GridImageryProvider.prototype.getTileCredits=function(e,t,i){},GridImageryProvider.prototype.requestImage=function(e,t,i,r){return this._canvas},GridImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},Object.defineProperties(InvertClassification.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}}),InvertClassification.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var rsUnclassified={depthMask:!1,stencilTest:{enabled:!0,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},blending:BlendingState$1.ALPHA_BLEND},rsClassified={depthMask:!1,stencilTest:{enabled:!0,frontFunction:StencilFunction$1.NOT_EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.NEVER,reference:0,mask:StencilConstants$1.CLASSIFICATION_MASK},blending:BlendingState$1.ALPHA_BLEND},rsDefault={depthMask:!0,depthTest:{enabled:!0},stencilTest:StencilConstants$1.setCesium3DTileBit(),stencilMask:StencilConstants$1.CESIUM_3D_TILE_MASK,blending:BlendingState$1.ALPHA_BLEND},translucentFS="#extension GL_EXT_frag_depth : enable\nuniform sampler2D colorTexture;\nuniform sampler2D depthTexture;\nuniform sampler2D classifiedTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n bool isClassified = all(equal(texture2D(classifiedTexture, v_textureCoordinates), vec4(0.0)));\n#ifdef UNCLASSIFIED\n vec4 highlightColor = czm_invertClassificationColor;\n if (isClassified)\n {\n discard;\n }\n#else\n vec4 highlightColor = vec4(1.0);\n if (!isClassified)\n {\n discard;\n }\n#endif\n gl_FragColor = color * highlightColor;\n gl_FragDepthEXT = texture2D(depthTexture, v_textureCoordinates).r;\n}\n",opaqueFS="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n vec4 color = texture2D(colorTexture, v_textureCoordinates);\n if (color.a == 0.0)\n {\n discard;\n }\n#ifdef UNCLASSIFIED\n gl_FragColor = color * czm_invertClassificationColor;\n#else\n gl_FragColor = color;\n#endif\n}\n";InvertClassification.prototype.update=function(e){var t=this._texture,i=!defined(t)||this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;var r,n,a=e.drawingBufferWidth,o=e.drawingBufferHeight,t=!defined(t)||t.width!==a||t.height!==o;(t||i)&&(this._texture=this._texture&&this._texture.destroy(),this._classifiedTexture=this._classifiedTexture&&this._classifiedTexture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._texture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}),defined(this._previousFramebuffer)||(this._classifiedTexture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:TextureMinificationFilter$1.LINEAR,magnificationFilter:TextureMagnificationFilter$1.LINEAR})}),this._depthStencilTexture=new Texture({context:e,width:a,height:o,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}))),defined(this._fbo)&&!t&&!i||(this._fbo=this._fbo&&this._fbo.destroy(),this._fboClassified=this._fboClassified&&this._fboClassified.destroy(),defined(this._previousFramebuffer)?(n=this._previousFramebuffer.depthStencilTexture,r=this._previousFramebuffer.depthStencilRenderbuffer):n=this._depthStencilTexture,this._fbo=new Framebuffer({context:e,colorTextures:[this._texture],depthStencilTexture:n,depthStencilRenderbuffer:r,destroyAttachments:!1}),defined(this._previousFramebuffer)||(this._fboClassified=new Framebuffer({context:e,colorTextures:[this._classifiedTexture],depthStencilTexture:n,destroyAttachments:!1}))),defined(this._rsUnclassified)||(this._rsUnclassified=RenderState.fromCache(rsUnclassified),this._rsClassified=RenderState.fromCache(rsClassified),this._rsDefault=RenderState.fromCache(rsDefault)),defined(this._unclassifiedCommand)&&!i||(defined(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),i=new ShaderSource({defines:["UNCLASSIFIED"],sources:[n=defined(this._previousFramebuffer)?opaqueFS:translucentFS]}),n=new ShaderSource({sources:[n]}),this._unclassifiedCommand=e.createViewportQuadCommand(i,{renderState:defined(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(n,{renderState:defined(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),defined(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),defined(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(PassThrough,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this})))},InvertClassification.prototype.clear=function(e,t){var i=t.framebuffer;defined(this._previousFramebuffer)?(t.framebuffer=this._fbo,this._clearColorCommand.execute(e,t)):(t.framebuffer=this._fbo,this._clearCommand.execute(e,t),t.framebuffer=this._fboClassified,this._clearCommand.execute(e,t)),t.framebuffer=i},InvertClassification.prototype.executeClassified=function(e,t){var i;defined(this._previousFramebuffer)||(i=t.framebuffer,t.framebuffer=this._fboClassified,this._translucentCommand.execute(e,t),t.framebuffer=i),this._classifiedCommand.execute(e,t)},InvertClassification.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)},InvertClassification.prototype.isDestroyed=function(){return!1},InvertClassification.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),defined(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),destroyObject(this)};var templateRegex=/{[^}]+}/g,tags={x:xTag,y:yTag,z:zTag,s:sTag,reverseX:reverseXTag,reverseY:reverseYTag,reverseZ:reverseZTag,westDegrees:westDegreesTag,southDegrees:southDegreesTag,eastDegrees:eastDegreesTag,northDegrees:northDegreesTag,westProjected:westProjectedTag,southProjected:southProjectedTag,eastProjected:eastProjectedTag,northProjected:northProjectedTag,width:widthTag,height:heightTag},pickFeaturesTags=combine(tags,{i:iTag,j:jTag,reverseI:reverseITag,reverseJ:reverseJTag,longitudeDegrees:longitudeDegreesTag,latitudeDegrees:latitudeDegreesTag,longitudeProjected:longitudeProjectedTag,latitudeProjected:latitudeProjectedTag,format:formatTag});function UrlTemplateImageryProvider(e){this._errorEvent=new Event,this._resource=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesResource=void 0,this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._minimumLevel=void 0,this._tilingScheme=void 0,this._rectangle=void 0,this._tileDiscardPolicy=void 0,this._credit=void 0,this._hasAlphaChannel=void 0,this._readyPromise=void 0,this._tags=void 0,this._pickFeaturesTags=void 0,this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this.enablePickFeatures=!0,this.reinitialize(e)}Object.defineProperties(UrlTemplateImageryProvider.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return defined(this._resource)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),UrlTemplateImageryProvider.prototype.reinitialize=function(e){var a=this;a._readyPromise=when(e).then(function(e){var t=e.customTags,i=combine(tags,t),r=combine(pickFeaturesTags,t),n=Resource.createIfNeeded(e.url),t=Resource.createIfNeeded(e.pickFeaturesUrl);a.enablePickFeatures=defaultValue(e.enablePickFeatures,a.enablePickFeatures),a._urlSchemeZeroPadding=defaultValue(e.urlSchemeZeroPadding,a.urlSchemeZeroPadding),a._tileDiscardPolicy=e.tileDiscardPolicy,a._getFeatureInfoFormats=e.getFeatureInfoFormats,a._subdomains=e.subdomains,Array.isArray(a._subdomains)?a._subdomains=a._subdomains.slice():defined(a._subdomains)&&0<a._subdomains.length?a._subdomains=a._subdomains.split(""):a._subdomains=["a","b","c"],a._tileWidth=defaultValue(e.tileWidth,256),a._tileHeight=defaultValue(e.tileHeight,256),a._minimumLevel=defaultValue(e.minimumLevel,0),a._maximumLevel=e.maximumLevel,a._tilingScheme=defaultValue(e.tilingScheme,new WebMercatorTilingScheme({ellipsoid:e.ellipsoid})),a._rectangle=defaultValue(e.rectangle,a._tilingScheme.rectangle),a._rectangle=Rectangle.intersection(a._rectangle,a._tilingScheme.rectangle),a._hasAlphaChannel=defaultValue(e.hasAlphaChannel,!0);e=e.credit;return"string"==typeof e&&(e=new Credit(e)),a._credit=e,a._resource=n,a._tags=i,a._pickFeaturesResource=t,a._pickFeaturesTags=r,!0})},UrlTemplateImageryProvider.prototype.getTileCredits=function(e,t,i){},UrlTemplateImageryProvider.prototype.requestImage=function(e,t,i,r){return ImageryProvider.loadImage(this,buildImageResource$3(this,e,t,i,r))},UrlTemplateImageryProvider.prototype.pickFeatures=function(r,n,a,o,s){if(this.enablePickFeatures&&defined(this._pickFeaturesResource)&&0!==this._getFeatureInfoFormats.length){var l=0,c=this;return function e(){if(l>=c._getFeatureInfoFormats.length)return when([]);var t=c._getFeatureInfoFormats[l],i=buildPickFeaturesResource(c,r,n,a,o,s,t.format);return++l,("json"===t.type?i.fetchJson().then(t.callback):"xml"===t.type?i.fetchXML().then(t.callback):"text"===t.type||"html"===t.type?i.fetchText().then(t.callback):i.fetch({responseType:t.format}).then(function(e,t){return e.callback(t)}.bind(void 0,t))).otherwise(e)}()}};var degreesScratchComputed=!1,degreesScratch=new Rectangle,projectedScratchComputed=!1,projectedScratch=new Rectangle;function buildImageResource$3(t,i,r,n,e){projectedScratchComputed=degreesScratchComputed=!1;var a=t._resource,o=a.getUrlComponent(!0),s=t._tags,l={},o=o.match(templateRegex);return defined(o)&&o.forEach(function(e){e=e.substring(1,e.length-1);defined(s[e])&&(l[e]=s[e](t,i,r,n))}),a.getDerivedResource({request:e,templateValues:l})}var ijScratchComputed=!1,ijScratch=new Cartesian2,longitudeLatitudeProjectedScratchComputed=!1;function buildPickFeaturesResource(t,i,r,n,a,o,s){longitudeLatitudeProjectedScratchComputed=ijScratchComputed=projectedScratchComputed=degreesScratchComputed=!1;var e=t._pickFeaturesResource,l=e.getUrlComponent(!0),c=t._pickFeaturesTags,u={},l=l.match(templateRegex);return defined(l)&&l.forEach(function(e){e=e.substring(1,e.length-1);defined(c[e])&&(u[e]=c[e](t,i,r,n,a,o,s))}),e.getDerivedResource({templateValues:u})}function padWithZerosIfNecessary(e,t,i){return e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)&&("string"!=typeof(t=e.urlSchemeZeroPadding[t])||1<(t=t.length)&&(i=i.length>=t?i:new Array(t-i.toString().length+1).join("0")+i)),i}function xTag(e,t,i,r){return padWithZerosIfNecessary(e,"{x}",t)}function reverseXTag(e,t,i,r){t=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return padWithZerosIfNecessary(e,"{reverseX}",t)}function yTag(e,t,i,r){return padWithZerosIfNecessary(e,"{y}",i)}function reverseYTag(e,t,i,r){i=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return padWithZerosIfNecessary(e,"{reverseY}",i)}function reverseZTag(e,t,i,r){var n=e.maximumLevel;return padWithZerosIfNecessary(e,"{reverseZ}",defined(n)&&r<n?n-r-1:r)}function zTag(e,t,i,r){return padWithZerosIfNecessary(e,"{z}",r)}function sTag(e,t,i,r){r=(t+i+r)%e._subdomains.length;return e._subdomains[r]}function computeDegrees(e,t,i,r){degreesScratchComputed||(e.tilingScheme.tileXYToRectangle(t,i,r,degreesScratch),degreesScratch.west=CesiumMath.toDegrees(degreesScratch.west),degreesScratch.south=CesiumMath.toDegrees(degreesScratch.south),degreesScratch.east=CesiumMath.toDegrees(degreesScratch.east),degreesScratch.north=CesiumMath.toDegrees(degreesScratch.north),degreesScratchComputed=!0)}function westDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.west}function southDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.south}function eastDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.east}function northDegreesTag(e,t,i,r){return computeDegrees(e,t,i,r),degreesScratch.north}function computeProjected(e,t,i,r){projectedScratchComputed||(e.tilingScheme.tileXYToNativeRectangle(t,i,r,projectedScratch),projectedScratchComputed=!0)}function westProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.west}function southProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.south}function eastProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.east}function northProjectedTag(e,t,i,r){return computeProjected(e,t,i,r),projectedScratch.north}function widthTag(e,t,i,r){return e.tileWidth}function heightTag(e,t,i,r){return e.tileHeight}function iTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),ijScratch.x}function jTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),ijScratch.y}function reverseITag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),e.tileWidth-ijScratch.x-1}function reverseJTag(e,t,i,r,n,a,o){return computeIJ(e,t,i,r,n,a),e.tileHeight-ijScratch.y-1}var rectangleScratch$6=new Rectangle,longitudeLatitudeProjectedScratch=new Cartesian3;function computeIJ(e,t,i,r,n,a,o){ijScratchComputed||(computeLongitudeLatitudeProjected(e,t,i,r,n,a),a=longitudeLatitudeProjectedScratch,r=e.tilingScheme.tileXYToNativeRectangle(t,i,r,rectangleScratch$6),ijScratch.x=e.tileWidth*(a.x-r.west)/r.width|0,ijScratch.y=e.tileHeight*(r.north-a.y)/r.height|0,ijScratchComputed=!0)}function longitudeDegreesTag(e,t,i,r,n,a,o){return CesiumMath.toDegrees(n)}function latitudeDegreesTag(e,t,i,r,n,a,o){return CesiumMath.toDegrees(a)}function longitudeProjectedTag(e,t,i,r,n,a,o){return computeLongitudeLatitudeProjected(e,t,i,r,n,a),longitudeLatitudeProjectedScratch.x}function latitudeProjectedTag(e,t,i,r,n,a,o){return computeLongitudeLatitudeProjected(e,t,i,r,n,a),longitudeLatitudeProjectedScratch.y}var cartographicScratch$4=new Cartographic;function computeLongitudeLatitudeProjected(e,t,i,r,n,a,o){var s;longitudeLatitudeProjectedScratchComputed||(e.tilingScheme.projection instanceof GeographicProjection?(longitudeLatitudeProjectedScratch.x=CesiumMath.toDegrees(n),longitudeLatitudeProjectedScratch.y=CesiumMath.toDegrees(a)):((s=cartographicScratch$4).longitude=n,s.latitude=a,e.tilingScheme.projection.project(s,longitudeLatitudeProjectedScratch)),longitudeLatitudeProjectedScratchComputed=!0)}function formatTag(e,t,i,r,n,a,o){return o}function TileMapServiceImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t,i=when.defer();UrlTemplateImageryProvider.call(this,i.promise),this._tmsResource=void 0,this._xmlResource=void 0,this._options=e,this._deferred=i,this._metadataError=void 0,this._metadataSuccess=this._metadataSuccess.bind(this),this._metadataFailure=this._metadataFailure.bind(this),this._requestMetadata=this._requestMetadata.bind(this);var r=this;when(e.url).then(function(e){(t=Resource.createIfNeeded(e)).appendForwardSlash(),r._tmsResource=t,r._xmlResource=t.getDerivedResource({url:"tilemapresource.xml"}),r._requestMetadata()}).otherwise(function(e){i.reject(e)})}function confineRectangleToTilingScheme(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function calculateSafeMinimumDetailLevel(e,t,i){var r=e.positionToTileXY(Rectangle.southwest(t),i),t=e.positionToTileXY(Rectangle.northeast(t),i);return 4<(Math.abs(t.x-r.x)+1)*(Math.abs(t.y-r.y)+1)?0:i}defined(Object.create)&&(TileMapServiceImageryProvider.prototype=Object.create(UrlTemplateImageryProvider.prototype),TileMapServiceImageryProvider.prototype.constructor=TileMapServiceImageryProvider),TileMapServiceImageryProvider.prototype._requestMetadata=function(){this._xmlResource.fetchXML().then(this._metadataSuccess).otherwise(this._metadataFailure)},TileMapServiceImageryProvider.prototype._metadataSuccess=function(e){for(var t,i,r,n=/tileformat/i,a=/tileset/i,o=/tilesets/i,s=/boundingbox/i,l=[],c=this._xmlResource,u=this._metadataError,d=this._deferred,h=this._requestMetadata,p=e.childNodes[0].childNodes,m=0;m<p.length;m++)if(n.test(p.item(m).nodeName))t=p.item(m);else if(o.test(p.item(m).nodeName)){r=p.item(m);for(var f=p.item(m).childNodes,g=0;g<f.length;g++)a.test(f.item(g).nodeName)&&l.push(f.item(g))}else s.test(p.item(m).nodeName)&&(i=p.item(m));if(!defined(r)||!defined(i))return P="Unable to find expected tilesets or bbox attributes in "+c.url+".",(u=TileProviderError.handleError(u,this,this.errorEvent,P,void 0,void 0,void 0,h)).retry||d.reject(new RuntimeError(P)),void(this._metadataError=u);var _=this._options,y=defaultValue(_.fileExtension,t.getAttribute("extension")),C=defaultValue(_.tileWidth,parseInt(t.getAttribute("width"),10)),v=defaultValue(_.tileHeight,parseInt(t.getAttribute("height"),10)),S=defaultValue(_.minimumLevel,parseInt(l[0].getAttribute("order"),10)),T=defaultValue(_.maximumLevel,parseInt(l[l.length-1].getAttribute("order"),10)),x=r.getAttribute("profile"),e=_.tilingScheme;if(!defined(e))if("geodetic"===x||"global-geodetic"===x)e=new GeographicTilingScheme({ellipsoid:_.ellipsoid});else{if("mercator"!==x&&"global-mercator"!==x)return P=c.url+"specifies an unsupported profile attribute, "+x+".",(u=TileProviderError.handleError(u,this,this.errorEvent,P,void 0,void 0,void 0,h)).retry||d.reject(new RuntimeError(P)),void(this._metadataError=u);e=new WebMercatorTilingScheme({ellipsoid:_.ellipsoid})}var b,E,P=Rectangle.clone(_.rectangle);defined(P)||(u=defaultValue(_.flipXY,!1)?(b=new Cartesian2(parseFloat(i.getAttribute("miny")),parseFloat(i.getAttribute("minx"))),new Cartesian2(parseFloat(i.getAttribute("maxy")),parseFloat(i.getAttribute("maxx")))):(b=new Cartesian2(parseFloat(i.getAttribute("minx")),parseFloat(i.getAttribute("miny"))),new Cartesian2(parseFloat(i.getAttribute("maxx")),parseFloat(i.getAttribute("maxy")))),x="geodetic"===x||"mercator"===x,u=e.projection instanceof GeographicProjection||x?(E=Cartographic.fromDegrees(b.x,b.y),Cartographic.fromDegrees(u.x,u.y)):(E=(x=e.projection).unproject(b),x.unproject(u)),P=new Rectangle(E.longitude,E.latitude,u.longitude,u.latitude)),S=calculateSafeMinimumDetailLevel(e,P=confineRectangleToTilingScheme(P,e),S);y=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+y});d.resolve({url:y,tilingScheme:e,rectangle:P,tileWidth:C,tileHeight:v,minimumLevel:S,maximumLevel:T,tileDiscardPolicy:_.tileDiscardPolicy,credit:_.credit})},TileMapServiceImageryProvider.prototype._metadataFailure=function(e){var t=this._options,i=defaultValue(t.fileExtension,"png"),r=defaultValue(t.tileWidth,256),n=defaultValue(t.tileHeight,256),a=t.maximumLevel,o=defined(t.tilingScheme)?t.tilingScheme:new WebMercatorTilingScheme({ellipsoid:t.ellipsoid}),s=defaultValue(t.rectangle,o.rectangle),l=calculateSafeMinimumDetailLevel(o,s=confineRectangleToTilingScheme(s,o),t.maximumLevel),i=this._tmsResource.getDerivedResource({url:"{z}/{x}/{reverseY}."+i});this._deferred.resolve({url:i,tilingScheme:o,rectangle:s,tileWidth:r,tileHeight:n,minimumLevel:l,maximumLevel:a,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit})};var trailingSlashRegex=/\/$/,defaultCredit$1=new Credit('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function MapboxImageryProvider(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).mapId,i=e.accessToken;this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;var r=Resource.createIfNeeded(defaultValue(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=i;var n=defaultValue(e.format,"png");/\./.test(n)||(n="."+n),this._format=n;var a,n=r.getUrlComponent();trailingSlashRegex.test(n)||(n+="/"),n+=t+"/{z}/{x}/{y}"+this._format,r.url=n,r.setQueryParameters({access_token:i}),defined(e.credit)?"string"==typeof(a=e.credit)&&(a=new Credit(a)):a=defaultCredit$1,this._resource=r,this._imageryProvider=new UrlTemplateImageryProvider({url:r,credit:a,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function SingleTileImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;var i=Resource.createIfNeeded(e.url),t=new GeographicTilingScheme({rectangle:defaultValue(e.rectangle,Rectangle.MAX_VALUE),numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=t,this._resource=i,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new Event,this._ready=!1,this._readyPromise=when.defer();e=e.credit;"string"==typeof e&&(e=new Credit(e)),this._credit=e;var r,n=this;function a(e){n._image=e,n._tileWidth=e.width,n._tileHeight=e.height,n._ready=!0,n._readyPromise.resolve(!0),TileProviderError.handleSuccess(n._errorEvent)}function o(e){var t="Failed to load image "+i.url+".";r=TileProviderError.handleError(r,n,n._errorEvent,t,0,0,0,s,e),n._readyPromise.reject(new RuntimeError(t))}function s(){ImageryProvider.loadImage(null,i).then(a).otherwise(o)}s()}function TimeDynamicImagery(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];var t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}function getKey$1(e,t,i){return e+"-"+t+"-"+i}function getKeyElements(e){e=e.split("-");if(3===e.length)return{x:Number(e[0]),y:Number(e[1]),level:Number(e[2])}}function getApproachingInterval(e){var t=e._times;if(defined(t)){var i=e._clock,r=i.currentTime,n=i.canAnimate&&i.shouldAnimate,e=i.multiplier;if(n||0===e){var a,i=t.indexOf(r);if(!(i<0)){n=t.get(i);return 0<e?(a=JulianDate.secondsDifference(n.stop,r),++i):(a=JulianDate.secondsDifference(n.start,r),--i),a/=e,0<=i&&a<=5?t.get(i):void 0}}}}function addToCache(e,t,i){var r=e._times.indexOf(i.start),n=e._tileCache,a=n[r];defined(a)||(a=n[r]={});n=t.key;if(defined(a[n]))return!0;r=getKeyElements(n),t=new Request({throttle:!1,throttleByServer:!0,type:RequestType$1.IMAGERY,priorityFunction:t.priorityFunction}),i=e._requestImageFunction(r.x,r.y,r.level,t,i);return!!defined(i)&&(a[n]={promise:i,request:t},!0)}function WebMapServiceImageryProvider(e){if(defined((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).times)&&!defined(e.clock))throw new DeveloperError("options.times was specified, so options.clock is required.");this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;var t=Resource.createIfNeeded(e.url),i=t.clone();t.setQueryParameters(WebMapServiceImageryProvider.DefaultParameters,!0),i.setQueryParameters(WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters,!0),defined(e.parameters)&&t.setQueryParameters(objectToLowercase(e.parameters)),defined(e.getFeatureInfoParameters)&&i.setQueryParameters(objectToLowercase(e.getFeatureInfoParameters));var a=this;this._reload=void 0,defined(e.times)&&(this._timeDynamicImagery=new TimeDynamicImagery({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,n){return requestImage(a,e,t,i,r,n)},reloadFunction:function(){defined(a._reload)&&a._reload()}}));var r={};r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",1.3<=parseFloat(t.queryParameters.version)?r.crs=defaultValue(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof WebMercatorProjection?"EPSG:3857":"CRS:84"):r.srs=defaultValue(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof WebMercatorProjection?"EPSG:3857":"EPSG:4326"),t.setQueryParameters(r,!0),i.setQueryParameters(r,!0);r={query_layers:e.layers,info_format:"{format}"};1.3<=parseFloat(i.queryParameters.version)?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),i.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=i,this._layers=e.layers,this._tileProvider=new UrlTemplateImageryProvider({url:t,pickFeaturesUrl:i,tilingScheme:defaultValue(e.tilingScheme,new GeographicTilingScheme({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:defaultValue(e.getFeatureInfoFormats,WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function requestImage(e,t,i,r,n,a){a=defined(a)?a.data:void 0,e=e._tileProvider;return defined(a)&&e._resource.setQueryParameters(a),e.requestImage(t,i,r,n)}function pickFeatures(e,t,i,r,n,a,o){o=defined(o)?o.data:void 0,e=e._tileProvider;return defined(o)&&e._pickFeaturesResource.setQueryParameters(o),e.pickFeatures(t,i,r,n,a)}function objectToLowercase(e){var t,i={};for(t in e)e.hasOwnProperty(t)&&(i[t.toLowerCase()]=e[t]);return i}Object.defineProperties(MapboxImageryProvider.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),MapboxImageryProvider.prototype.getTileCredits=function(e,t,i){},MapboxImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},MapboxImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},MapboxImageryProvider._defaultCredit=defaultCredit$1,Object.defineProperties(SingleTileImageryProvider.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}}),SingleTileImageryProvider.prototype.getTileCredits=function(e,t,i){},SingleTileImageryProvider.prototype.requestImage=function(e,t,i,r){return this._image},SingleTileImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},Object.defineProperties(TimeDynamicImagery.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}}),TimeDynamicImagery.prototype.getFromCache=function(e,t,i,r){var n,a,t=getKey$1(e,t,i),i=this._tileCache[this._currentIntervalIndex];return defined(i)&&defined(i[t])&&(a=(n=i[t]).promise.otherwise(function(e){throw r.state=n.request.state,e}),delete i[t]),a},TimeDynamicImagery.prototype.checkApproachingInterval=function(e,t,i,r){e=getKey$1(e,t,i),t=this._tilesRequestedForInterval,i=getApproachingInterval(this),r={key:e,priorityFunction:r.priorityFunction};defined(i)&&addToCache(this,r,i)||t.push(r),512<=t.length&&t.splice(0,256)},TimeDynamicImagery.prototype._clockOnTick=function(e){var t=e.currentTime,e=this._times.indexOf(t),t=this._currentIntervalIndex;if(e!==t){var i,r=this._tileCache[t];for(i in r)r.hasOwnProperty(i)&&r[i].request.cancel();return delete this._tileCache[t],this._tilesRequestedForInterval=[],this._currentIntervalIndex=e,void this._reloadFunction()}var n=getApproachingInterval(this);if(defined(n))for(var a=this._tilesRequestedForInterval,o=!0;o&&0!==a.length;){var s=a.pop();(o=addToCache(this,s,n))||a.push(s)}},Object.defineProperties(WebMapServiceImageryProvider.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return this._tileProvider.ready}},readyPromise:{get:function(){return this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}}}),WebMapServiceImageryProvider.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},WebMapServiceImageryProvider.prototype.requestImage=function(e,t,i,r){var n,a,o=this._timeDynamicImagery;return defined(o)&&(a=o.currentInterval,n=o.getFromCache(e,t,i,r)),defined(n)||(n=requestImage(this,e,t,i,r,a)),defined(n)&&defined(o)&&o.checkApproachingInterval(e,t,i,r),n},WebMapServiceImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){var a=this._timeDynamicImagery;return pickFeatures(this,e,t,i,r,n,defined(a)?a.currentInterval:void 0)},WebMapServiceImageryProvider.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),WebMapServiceImageryProvider.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),WebMapServiceImageryProvider.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new GetFeatureInfoFormat("json","application/json")),Object.freeze(new GetFeatureInfoFormat("xml","text/xml")),Object.freeze(new GetFeatureInfoFormat("text","text/html"))]);var defaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function WebMapTileServiceImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;var t,i=Resource.createIfNeeded(e.url),r=e.style,n=e.tileMatrixSetID;0<=i.url.indexOf("{")?(t={style:r,Style:r,TileMatrixSet:n},i.setTemplateValues(t),this._useKvp=!1):(i.setQueryParameters(defaultParameters),this._useKvp=!0),this._resource=i,this._layer=e.layer,this._style=r,this._tileMatrixSetID=n,this._tileMatrixLabels=e.tileMatrixLabels,this._format=defaultValue(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new WebMercatorTilingScheme({ellipsoid:e.ellipsoid}),this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._minimumLevel=defaultValue(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=defaultValue(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;var a=this;this._reload=void 0,defined(e.times)&&(this._timeDynamicImagery=new TimeDynamicImagery({clock:e.clock,times:e.times,requestImageFunction:function(e,t,i,r,n){return requestImage$1(a,e,t,i,r,n)},reloadFunction:function(){defined(a._reload)&&a._reload()}})),this._readyPromise=when.resolve(!0);r=this._tilingScheme.positionToTileXY(Rectangle.southwest(this._rectangle),this._minimumLevel),n=this._tilingScheme.positionToTileXY(Rectangle.northeast(this._rectangle),this._minimumLevel),Math.abs(n.x-r.x),Math.abs(n.y-r.y);this._errorEvent=new Event;r=e.credit;this._credit="string"==typeof r?new Credit(r):r,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():defined(this._subdomains)&&0<this._subdomains.length?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function requestImage$1(e,t,i,r,n,a){var o,s=e._tileMatrixLabels,l=defined(s)?s[r]:r.toString(),c=e._subdomains,s=e._dimensions,a=defined(a)?a.data:void 0;return e._useKvp?((o={}).tilematrix=l,o.layer=e._layer,o.style=e._style,o.tilerow=i,o.tilecol=t,o.tilematrixset=e._tileMatrixSetID,o.format=e._format,defined(s)&&(o=combine(o,s)),defined(a)&&(o=combine(o,a)),o=e._resource.getDerivedResource({queryParameters:o,request:n})):(c={TileMatrix:l,TileRow:i.toString(),TileCol:t.toString(),s:c[(t+i+r)%c.length]},(o=e._resource.getDerivedResource({request:n})).setTemplateValues(c),defined(s)&&o.setTemplateValues(s),defined(a)&&o.setTemplateValues(a)),ImageryProvider.loadImage(e,o)}function createFactory(t){return function(e){return new t(e)}}Object.defineProperties(WebMapTileServiceImageryProvider.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{value:!0},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,defined(this._reload)&&this._reload())}}}),WebMapTileServiceImageryProvider.prototype.getTileCredits=function(e,t,i){},WebMapTileServiceImageryProvider.prototype.requestImage=function(e,t,i,r){var n,a,o=this._timeDynamicImagery;return defined(o)&&(a=o.currentInterval,n=o.getFromCache(e,t,i,r)),defined(n)||(n=requestImage$1(this,e,t,i,r,a)),defined(n)&&defined(o)&&o.checkApproachingInterval(e,t,i,r),n},WebMapTileServiceImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){};var ImageryProviderMapping={ARCGIS_MAPSERVER:createFactory(ArcGisMapServerImageryProvider),BING:createFactory(BingMapsImageryProvider),GOOGLE_EARTH:createFactory(GoogleEarthEnterpriseMapsProvider),MAPBOX:createFactory(MapboxImageryProvider),SINGLE_TILE:createFactory(SingleTileImageryProvider),TMS:createFactory(TileMapServiceImageryProvider),URL_TEMPLATE:createFactory(UrlTemplateImageryProvider),WMS:createFactory(WebMapServiceImageryProvider),WMTS:createFactory(WebMapTileServiceImageryProvider)};function IonImageryProvider(e){var r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).assetId;this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new Event;var n=this,a=IonResource._createEndpointResource(r,e),t=e.assetId.toString()+e.accessToken+e.server,e=IonImageryProvider._endpointCache[t];defined(e)||(e=a.fetchJson(),IonImageryProvider._endpointCache[t]=e),this._readyPromise=e.then(function(e){if("IMAGERY"!==e.type)return when.reject(new RuntimeError("Cesium ion asset "+r+" is not an imagery asset."));var t=e.externalType;if(defined(t)){var i=ImageryProviderMapping[t];if(!defined(i))return when.reject(new RuntimeError("Unrecognized Cesium ion imagery type: "+t));i=i(e.options)}else i=new TileMapServiceImageryProvider({url:new IonResource(e,a)});return n._tileCredits=IonResource.getCreditsFromEndpoint(e,a),i.errorEvent.addEventListener(function(e){(e.provider=n)._errorEvent.raiseEvent(e)}),(n._imageryProvider=i).readyPromise.then(function(){return n._ready=!0})})}Object.defineProperties(IonImageryProvider.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel},proxy:{get:function(){}}}}),IonImageryProvider.prototype.getTileCredits=function(e,t,i){i=this._imageryProvider.getTileCredits(e,t,i);return defined(i)?this._tileCredits.concat(i):this._tileCredits},IonImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},IonImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},IonImageryProvider._endpointCache={};var IonWorldImageryStyle={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},IonWorldImageryStyle$1=Object.freeze(IonWorldImageryStyle);function JobTypeBudget(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function JobScheduler(e){var t=new Array(JobType$1.NUMBER_OF_JOB_TYPES);t[JobType$1.TEXTURE]=new JobTypeBudget(defined(e)?e[JobType$1.TEXTURE]:10),t[JobType$1.PROGRAM]=new JobTypeBudget(defined(e)?e[JobType$1.PROGRAM]:10),t[JobType$1.BUFFER]=new JobTypeBudget(defined(e)?e[JobType$1.BUFFER]:30);for(var i=t.length,r=0,n=0;n<i;++n)r+=t[n].total;var a=new Array(i);for(n=0;n<i;++n)a[n]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=a}function Light(){}Object.defineProperties(JobTypeBudget.prototype,{total:{get:function(){return this._total}}}),JobScheduler.getTimestamp=getTimestamp$1,Object.defineProperties(JobScheduler.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),JobScheduler.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},JobScheduler.prototype.resetBudgets=function(){for(var e=this._budgets,t=e.length,i=0;i<t;++i){var r=e[i];r.starvedLastFrame=r.starvedThisFrame,r.starvedThisFrame=!1,r.usedThisFrame=0,r.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0},JobScheduler.prototype.execute=function(e,t){var i,r=this._budgets,n=r[t],a=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&a)return!(n.starvedThisFrame=!0);if(n.usedThisFrame+n.stolenFromMeThisFrame>=n.total){for(var o=r.length,s=0;s<o&&(!((i=r[s]).usedThisFrame+i.stolenFromMeThisFrame<i.total)||i.starvedLastFrame);++s);if(s===o&&a)return!1;a&&(n.starvedThisFrame=!0)}a=JobScheduler.getTimestamp();e.execute();a=JobScheduler.getTimestamp()-a;return this._totalUsedThisFrame+=a,i?i.stolenFromMeThisFrame+=a:n.usedThisFrame+=a,this._executedThisFrame[t]=!0},Object.defineProperties(Light.prototype,{color:{get:DeveloperError.throwInstantiationError},intensity:{get:DeveloperError.throwInstantiationError}});var trailingSlashRegex$1=/\/$/,defaultCredit$2=new Credit('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function MapboxStyleImageryProvider(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).styleId,i=e.accessToken;this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0;var r=Resource.createIfNeeded(defaultValue(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=i;var n=defaultValue(e.tilesize,512);this._tilesize=n;var a=defaultValue(e.username,"mapbox");this._username=a;var o,n=defined(e.scaleFactor)?"@2x":"",a=r.getUrlComponent();trailingSlashRegex$1.test(a)||(a+="/"),a+=this._username+"/"+t+"/tiles/"+this._tilesize+"/{z}/{x}/{y}"+n,r.url=a,r.setQueryParameters({access_token:i}),defined(e.credit)?"string"==typeof(o=e.credit)&&(o=new Credit(o)):o=defaultCredit$2,this._resource=r,this._imageryProvider=new UrlTemplateImageryProvider({url:r,credit:o,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}function Moon(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).textureUrl;defined(t)||(t=buildModuleUrl("Assets/Textures/moonSmall.jpg")),this.show=defaultValue(e.show,!0),this.textureUrl=t,this._ellipsoid=defaultValue(e.ellipsoid,Ellipsoid.MOON),this.onlySunLighting=defaultValue(e.onlySunLighting,!0),this._ellipsoidPrimitive=new EllipsoidPrimitive({radii:this.ellipsoid.radii,material:Material.fromType(Material.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new IauOrientationAxes}Object.defineProperties(MapboxStyleImageryProvider.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return this._imageryProvider.ready}},readyPromise:{get:function(){return this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}}),MapboxStyleImageryProvider.prototype.getTileCredits=function(e,t,i){},MapboxStyleImageryProvider.prototype.requestImage=function(e,t,i,r){return this._imageryProvider.requestImage(e,t,i,r)},MapboxStyleImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},MapboxStyleImageryProvider._defaultCredit=defaultCredit$2,Object.defineProperties(Moon.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var icrfToFixed=new Matrix3,rotationScratch$1=new Matrix3,translationScratch=new Cartesian3,scratchCommandList$1=[];function NeverTileDiscardPolicy(e){}Moon.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var i=e.time;defined(Transforms.computeIcrfToFixedMatrix(i,icrfToFixed))||Transforms.computeTemeToPseudoFixedMatrix(i,icrfToFixed);var r=this._axes.evaluate(i,rotationScratch$1);Matrix3.transpose(r,r),Matrix3.multiply(icrfToFixed,r,r);i=Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(i,translationScratch);Matrix3.multiplyByVector(icrfToFixed,i,i),Matrix4.fromRotationTranslation(r,i,t.modelMatrix);i=e.commandList;return(e.commandList=scratchCommandList$1).length=0,t.update(e),e.commandList=i,1===scratchCommandList$1.length?scratchCommandList$1[0]:void 0}},Moon.prototype.isDestroyed=function(){return!1},Moon.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),destroyObject(this)},NeverTileDiscardPolicy.prototype.isReady=function(){return!0},NeverTileDiscardPolicy.prototype.shouldDiscardImage=function(e){return!1};var AdjustTranslucentFS="#ifdef MRT\n#extension GL_EXT_draw_buffers : enable\n#endif\nuniform vec4 u_bgColor;\nuniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nif (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)\n{\n#ifdef MRT\ngl_FragData[0] = u_bgColor;\ngl_FragData[1] = vec4(u_bgColor.a);\n#else\ngl_FragColor = u_bgColor;\n#endif\nreturn;\n}\ndiscard;\n}\n",CompositeOITFS="uniform sampler2D u_opaque;\nuniform sampler2D u_accumulation;\nuniform sampler2D u_revealage;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 opaque = texture2D(u_opaque, v_textureCoordinates);\nvec4 accum = texture2D(u_accumulation, v_textureCoordinates);\nfloat r = texture2D(u_revealage, v_textureCoordinates).r;\n#ifdef MRT\nvec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);\n#else\nvec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);\n#endif\ngl_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;\nif (opaque != czm_backgroundColor)\n{\ngl_FragColor.a = 1.0;\n}\n}\n";function OIT(e){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var t=e.colorBufferFloat&&e.depthTexture;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=void 0,this._alphaFBO=void 0,this._adjustTranslucentFBO=void 0,this._adjustAlphaFBO=void 0,this._opaqueClearCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ClearCommand({color:new Color(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ClearCommand({color:new Color(0,0,0,0),owner:this}),this._alphaClearCommand=new ClearCommand({color:new Color(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new BoundingRectangle,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function destroyTextures$1(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function destroyFramebuffers$2(e){e._translucentFBO=e._translucentFBO&&!e._translucentFBO.isDestroyed()&&e._translucentFBO.destroy(),e._alphaFBO=e._alphaFBO&&!e._alphaFBO.isDestroyed()&&e._alphaFBO.destroy(),e._adjustTranslucentFBO=e._adjustTranslucentFBO&&!e._adjustTranslucentFBO.isDestroyed()&&e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO=e._adjustAlphaFBO&&!e._adjustAlphaFBO.isDestroyed()&&e._adjustAlphaFBO.destroy()}function destroyResources$1(e){destroyTextures$1(e),destroyFramebuffers$2(e)}function updateTextures(e,t,i,r){destroyTextures$1(e),e._accumulationTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.FLOAT});var n=new Float32Array(i*r*4);e._revealageTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.FLOAT,source:{arrayBufferView:n,width:i,height:r},flipY:!1})}function updateFramebuffers$1(e,t){destroyFramebuffers$2(e);var i,r,n=WebGLConstants$1.FRAMEBUFFER_COMPLETE,a=!0;return e._translucentMRTSupport&&(e._translucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===n&&e._adjustTranslucentFBO.status===n||(destroyFramebuffers$2(e),e._translucentMRTSupport=!1)),e._translucentMRTSupport||(e._translucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new Framebuffer({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new Framebuffer({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new Framebuffer({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1}),i=e._translucentFBO.status===n,r=e._alphaFBO.status===n,t=e._adjustTranslucentFBO.status===n,n=e._adjustAlphaFBO.status===n,i&&r&&t&&n||(destroyResources$1(e),a=e._translucentMultipassSupport=!1)),a}OIT.prototype.update=function(e,t,i,r){var n,a,o,s,l;this.isSupported()&&(this._opaqueFBO=i,this._opaqueTexture=i.getColorTexture(0),this._depthStencilTexture=i.depthStencilTexture,s=this._opaqueTexture.width,l=this._opaqueTexture.height,(i=!defined(i=this._accumulationTexture)||i.width!==s||i.height!==l||r!==this._useHDR)&&updateTextures(this,e,s,l),(defined(this._translucentFBO)&&!i||updateFramebuffers$1(this,e))&&(this._useHDR=r,defined((n=this)._compositeCommand)||(a=new ShaderSource({sources:[CompositeOITFS]}),this._translucentMRTSupport&&a.defines.push("MRT"),o={u_opaque:function(){return n._opaqueTexture},u_accumulation:function(){return n._accumulationTexture},u_revealage:function(){return n._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(a,{uniformMap:o,owner:this})),defined(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(a=new ShaderSource({defines:["MRT"],sources:[AdjustTranslucentFS]}),o={u_bgColor:function(){return n._translucentMRTClearCommand.color},u_depthTexture:function(){return n._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(a,{uniformMap:o,owner:this})):this._translucentMultipassSupport&&(a=new ShaderSource({sources:[AdjustTranslucentFS]}),o={u_bgColor:function(){return n._translucentMultipassClearCommand.color},u_depthTexture:function(){return n._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(a,{uniformMap:o,owner:this}),o={u_bgColor:function(){return n._alphaClearCommand.color},u_depthTexture:function(){return n._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(a,{uniformMap:o,owner:this}))),this._viewport.width=s,this._viewport.height=l,l=(s=!BoundingRectangle.equals(this._viewport,t.viewport))!==this._useScissorTest,this._useScissorTest=s,BoundingRectangle.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=BoundingRectangle.clone(t.viewport,this._scissorRectangle),l=!0),defined(this._rs)&&BoundingRectangle.equals(this._viewport,this._rs.viewport)&&!l||(this._rs=RenderState.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),defined(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),defined(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)))};var translucentMRTBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE,functionSourceAlpha:BlendFunction$1.ZERO,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA},translucentColorBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ONE,functionDestinationRgb:BlendFunction$1.ONE,functionSourceAlpha:BlendFunction$1.ONE,functionDestinationAlpha:BlendFunction$1.ONE},translucentAlphaBlend={enabled:!0,color:new Color(0,0,0,0),equationRgb:BlendEquation$1.ADD,equationAlpha:BlendEquation$1.ADD,functionSourceRgb:BlendFunction$1.ZERO,functionDestinationRgb:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:BlendFunction$1.ZERO,functionDestinationAlpha:BlendFunction$1.ONE_MINUS_SOURCE_ALPHA};function getTranslucentRenderState$2(e,t,i,r){var n,a=i[r.id];return defined(a)||((n=RenderState.getState(r)).depthMask=!1,n.blending=t,a=RenderState.fromCache(n),i[r.id]=a),a}function getTranslucentMRTRenderState(e,t,i){return getTranslucentRenderState$2(t,translucentMRTBlend,e._translucentRenderStateCache,i)}function getTranslucentColorRenderState(e,t,i){return getTranslucentRenderState$2(t,translucentColorBlend,e._translucentRenderStateCache,i)}function getTranslucentAlphaRenderState(e,t,i){return getTranslucentRenderState$2(t,translucentAlphaBlend,e._alphaRenderStateCache,i)}var mrtShaderSource=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragData[0] = vec4(Ci * wzi, ai);\n gl_FragData[1] = vec4(ai * wzi);\n",colorShaderSource=" vec3 Ci = czm_gl_FragColor.rgb * czm_gl_FragColor.a;\n float ai = czm_gl_FragColor.a;\n float wzi = czm_alphaWeight(ai);\n gl_FragColor = vec4(Ci, ai) * wzi;\n",alphaShaderSource=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";function getTranslucentShaderProgram$1(e,t,i,r){var n,a,o=e.shaderCache.getDerivedShaderProgram(t,i);return defined(o)||(n=t._attributeLocations,(a=t.fragmentShaderSource.clone()).sources=a.sources.map(function(e){return e=(e=(e=(e=ShaderSource.replaceMain(e,"czm_translucent_main")).replace(/gl_FragColor/g,"czm_gl_FragColor")).replace(/\bdiscard\b/g,"czm_discard = true")).replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,(-1!==r.indexOf("gl_FragData")?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),a.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+r+"}\n"),o=e.shaderCache.createDerivedShaderProgram(t,i,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:n})),o}function getTranslucentMRTShaderProgram(e,t){return getTranslucentShaderProgram$1(e,t,"translucentMRT",mrtShaderSource)}function getTranslucentColorShaderProgram(e,t){return getTranslucentShaderProgram$1(e,t,"translucentMultipass",colorShaderSource)}function getTranslucentAlphaShaderProgram(e,t){return getTranslucentShaderProgram$1(e,t,"alphaMultipass",alphaShaderSource)}function executeTranslucentCommandsSortedMultipass(e,t,i,r,n,a){var o,s,l=t.context,c=t.frameState.useLogDepth,u=t._hdr,d=r.framebuffer,h=n.length,p=t.frameState.shadowState.lightShadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var m=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<h;++s)o=n[s],o=c?o.derivedCommands.logDepth.command:o,o=u?o.derivedCommands.hdr.command:o,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).translucentCommand,t,l,r,m);for(defined(a)&&(o=a.unclassifiedCommand,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).translucentCommand,t,l,r,m)),r.framebuffer=e._alphaFBO,s=0;s<h;++s)o=n[s],o=c?o.derivedCommands.logDepth.command:o,o=u?o.derivedCommands.hdr.command:o,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).alphaCommand,t,l,r,m);defined(a)&&(o=a.unclassifiedCommand,i((p&&o.receiveShadows?o.derivedCommands.oit.shadows:o.derivedCommands.oit).alphaCommand,t,l,r,m)),r.framebuffer=d}function executeTranslucentCommandsSortedMRT(e,t,i,r,n,a){var o=t.context,s=t.frameState.useLogDepth,l=t._hdr,c=r.framebuffer,u=n.length,d=t.frameState.shadowState.lightShadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,r);var h,p=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var m=0;m<u;++m)h=n[m],h=s?h.derivedCommands.logDepth.command:h,h=l?h.derivedCommands.hdr.command:h,i((d&&h.receiveShadows?h.derivedCommands.oit.shadows:h.derivedCommands.oit).translucentCommand,t,o,r,p);defined(a)&&(h=a.unclassifiedCommand,i((d&&h.receiveShadows?h.derivedCommands.oit.shadows:h.derivedCommands.oit).translucentCommand,t,o,r,p)),r.framebuffer=c}OIT.prototype.createDerivedCommands=function(e,t,i){var r,n,a,o,s,l;return defined(i)||(i={}),this._translucentMRTSupport?(defined(i.translucentCommand)&&(r=i.translucentCommand.shaderProgram,n=i.translucentCommand.renderState),i.translucentCommand=DrawCommand.shallowClone(e,i.translucentCommand),defined(r)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=r,i.translucentCommand.renderState=n):(i.translucentCommand.shaderProgram=getTranslucentMRTShaderProgram(t,e.shaderProgram),i.translucentCommand.renderState=getTranslucentMRTRenderState(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)):(defined(i.translucentCommand)&&(a=i.translucentCommand.shaderProgram,o=i.translucentCommand.renderState,s=i.alphaCommand.shaderProgram,l=i.alphaCommand.renderState),i.translucentCommand=DrawCommand.shallowClone(e,i.translucentCommand),i.alphaCommand=DrawCommand.shallowClone(e,i.alphaCommand),defined(a)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=a,i.translucentCommand.renderState=o,i.alphaCommand.shaderProgram=s,i.alphaCommand.renderState=l):(i.translucentCommand.shaderProgram=getTranslucentColorShaderProgram(t,e.shaderProgram),i.translucentCommand.renderState=getTranslucentColorRenderState(this,t,e.renderState),i.alphaCommand.shaderProgram=getTranslucentAlphaShaderProgram(t,e.shaderProgram),i.alphaCommand.renderState=getTranslucentAlphaRenderState(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)),i},OIT.prototype.executeCommands=function(e,t,i,r,n){(this._translucentMRTSupport?executeTranslucentCommandsSortedMRT:executeTranslucentCommandsSortedMultipass)(this,e,t,i,r,n)},OIT.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},OIT.prototype.clear=function(e,t,i){var r=t.framebuffer;t.framebuffer=this._opaqueFBO,Color.clone(i,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,t)),t.framebuffer=r},OIT.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},OIT.prototype.isDestroyed=function(){return!1},OIT.prototype.destroy=function(){return destroyResources$1(this),defined(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),defined(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),defined(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),destroyObject(this)};var defaultCredit$3=new Credit("MapQuest, Open Street Map and contributors, CC-BY-SA");function OpenStreetMapImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=Resource.createIfNeeded(defaultValue(e.url,"https://a.tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+="{z}/{x}/{y}."+defaultValue(e.fileExtension,"png");var i=new WebMercatorTilingScheme({ellipsoid:e.ellipsoid}),r=defaultValue(e.minimumLevel,0),n=e.maximumLevel,a=defaultValue(e.rectangle,i.rectangle),o=i.positionToTileXY(Rectangle.southwest(a),r),s=i.positionToTileXY(Rectangle.northeast(a),r),e=(Math.abs(s.x-o.x),Math.abs(s.y-o.y),defaultValue(e.credit,defaultCredit$3));"string"==typeof e&&(e=new Credit(e)),UrlTemplateImageryProvider.call(this,{url:t,credit:e,tilingScheme:i,tileWidth:256,tileHeight:256,minimumLevel:r,maximumLevel:n,rectangle:a})}defined(Object.create)&&(OpenStreetMapImageryProvider.prototype=Object.create(UrlTemplateImageryProvider.prototype),OpenStreetMapImageryProvider.prototype.constructor=OpenStreetMapImageryProvider);var defaultSize=new Cartesian2(1,1);function Particle(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.mass=defaultValue(e.mass,1),this.position=Cartesian3.clone(defaultValue(e.position,Cartesian3.ZERO)),this.velocity=Cartesian3.clone(defaultValue(e.velocity,Cartesian3.ZERO)),this.life=defaultValue(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=Color.clone(defaultValue(e.startColor,Color.WHITE)),this.endColor=Color.clone(defaultValue(e.endColor,Color.WHITE)),this.startScale=defaultValue(e.startScale,1),this.endScale=defaultValue(e.endScale,1),this.imageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultSize)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Particle.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var deltaScratch=new Cartesian3;function ParticleBurst(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.time=defaultValue(e.time,0),this.minimum=defaultValue(e.minimum,0),this.maximum=defaultValue(e.maximum,50),this._complete=!1}function ParticleEmitter(e){}Particle.prototype.update=function(e,t){return Cartesian3.multiplyByScalar(this.velocity,e,deltaScratch),Cartesian3.add(this.position,deltaScratch,this.position),defined(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life},Object.defineProperties(ParticleBurst.prototype,{complete:{get:function(){return this._complete}}}),ParticleEmitter.prototype.emit=function(e){DeveloperError.throwInstantiationError()};var defaultImageSize=new Cartesian2(1,1);function ParticleSystem(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this.updateCallback=e.updateCallback,this.loop=defaultValue(e.loop,!0),this.image=defaultValue(e.image,void 0);var t=e.emitter;defined(t)||(t=new CircleEmitter(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this._emitterModelMatrix=Matrix4.clone(defaultValue(e.emitterModelMatrix,Matrix4.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new Matrix4,this._startColor=Color.clone(defaultValue(e.color,defaultValue(e.startColor,Color.WHITE))),this._endColor=Color.clone(defaultValue(e.color,defaultValue(e.endColor,Color.WHITE))),this._startScale=defaultValue(e.scale,defaultValue(e.startScale,1)),this._endScale=defaultValue(e.scale,defaultValue(e.endScale,1)),this._emissionRate=defaultValue(e.emissionRate,5),this._minimumSpeed=defaultValue(e.speed,defaultValue(e.minimumSpeed,1)),this._maximumSpeed=defaultValue(e.speed,defaultValue(e.maximumSpeed,1)),this._minimumParticleLife=defaultValue(e.particleLife,defaultValue(e.minimumParticleLife,5)),this._maximumParticleLife=defaultValue(e.particleLife,defaultValue(e.maximumParticleLife,5)),this._minimumMass=defaultValue(e.mass,defaultValue(e.minimumMass,1)),this._maximumMass=defaultValue(e.mass,defaultValue(e.maximumMass,1)),this._minimumImageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultValue(e.minimumImageSize,defaultImageSize))),this._maximumImageSize=Cartesian2.clone(defaultValue(e.imageSize,defaultValue(e.maximumImageSize,defaultImageSize))),this._sizeInMeters=defaultValue(e.sizeInMeters,!1),this._lifetime=defaultValue(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new Event,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}function updateParticlePool(e){var t=e._emissionRate,i=e._maximumParticleLife,r=0,n=e._bursts;if(defined(n))for(var a=n.length,o=0;o<a;++o)r+=n[o].maximum;for(var s=e._billboardCollection,l=e.image,t=Math.ceil(t*i+r),i=e._particles,c=e._particlePool,u=Math.max(t-i.length-c.length,0),d=0;d<u;++d){var h=new Particle;h._billboard=s.add({image:l}),c.push(h)}e._particleEstimate=t}function getOrCreateParticle(e){e=e._particlePool.pop();return defined(e)||(e=new Particle),e}function addParticleToPool(e,t){e._particlePool.push(t)}function freeParticlePool(e){for(var t=e._particles,i=e._particlePool,r=e._billboardCollection,t=t.length,n=i.length,e=e._particleEstimate,t=n-Math.max(e-t-n,0),a=t;a<n;++a){var o=i[a];r.remove(o._billboard)}i.length=t}function removeBillboard(e){defined(e._billboard)&&(e._billboard.show=!1)}function updateBillboard(e,t){var i=t._billboard;defined(i)||(i=t._billboard=e._billboardCollection.add({image:t.image})),i.width=t.imageSize.x,i.height=t.imageSize.y,i.position=t.position,i.sizeInMeters=e.sizeInMeters,i.show=!0;var r=CesiumMath.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),n=CesiumMath.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),a=CesiumMath.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),e=CesiumMath.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);i.color=new Color(r,n,a,e),i.scale=CesiumMath.lerp(t.startScale,t.endScale,t.normalizedAge)}function addParticle(e,t){t.startColor=Color.clone(e._startColor,t.startColor),t.endColor=Color.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=CesiumMath.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=CesiumMath.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=CesiumMath.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=CesiumMath.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;var i=CesiumMath.randomBetween(e._minimumSpeed,e._maximumSpeed);Cartesian3.multiplyByScalar(t.velocity,i,t.velocity),e._particles.push(t)}function calculateNumberToEmit(e,t){if(e._isComplete)return 0;var t=(t=CesiumMath.mod(t,e._lifetime))*e._emissionRate,i=Math.floor(t);if(e._carryOver+=t-i,1<e._carryOver&&(i++,--e._carryOver),defined(e.bursts))for(var r=e.bursts.length,n=0;n<r;n++){var a=e.bursts[n],o=e._currentTime;defined(a)&&!a._complete&&o>a.time&&(i+=CesiumMath.randomBetween(a.minimum,a.maximum),a._complete=!0)}return i}Object.defineProperties(ParticleSystem.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!Matrix4.equals(this._modelMatrix,e),Matrix4.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!Matrix4.equals(this._emitterModelMatrix,e),Matrix4.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){Color.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){Color.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});var rotatedVelocityScratch=new Cartesian3;function getElement(e){return"string"==typeof e&&(e=document.getElementById(e)),e}function PerformanceDisplay(e){var t=getElement((e=defaultValue(e,defaultValue.EMPTY_OBJECT)).container);this._container=t;var i=document.createElement("div");i.className="cesium-performanceDisplay";e=document.createElement("div");e.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),e.appendChild(this._fpsText);t=document.createElement("div");t.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),t.appendChild(this._msText),i.appendChild(t),i.appendChild(e),this._container.appendChild(i),this._lastFpsSampleTime=getTimestamp$1(),this._lastMsSampleTime=getTimestamp$1(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;e=document.createElement("div");e.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),e.appendChild(this._throttledText),i.appendChild(e)}function PickDepth(){this._framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._useLogDepth=void 0,this._debugPickDepthViewportCommand=void 0}function executeDebugPickDepth(e,t,i,r){var n;defined(e._debugPickDepthViewportCommand)&&r===e._useLogDepth||(n=new ShaderSource({defines:[r?"LOG_DEPTH":""],sources:["uniform highp sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\n z_window = czm_reverseLogDepth(z_window); \n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n float scale = pow(z_ndc * 0.5 + 0.5, 8.0);\n gl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n"]}),e._debugPickDepthViewportCommand=t.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return e._depthTexture}},owner:e}),e._useLogDepth=r),e._debugPickDepthViewportCommand.execute(t,i)}function destroyTextures$2(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function destroyFramebuffers$3(e){e._framebuffer=e._framebuffer&&!e._framebuffer.isDestroyed()&&e._framebuffer.destroy()}function createTextures$2(e,t,i,r){e._depthTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE})}function createFramebuffers$2(e,t,i,r){destroyTextures$2(e),destroyFramebuffers$3(e),createTextures$2(e,t,i,r),e._framebuffer=new Framebuffer({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function updateFramebuffers$2(e,t,i){var r=i.width,n=i.height,i=e._depthTexture,i=!defined(i)||i.width!==r||i.height!==n;defined(e._framebuffer)&&!i||createFramebuffers$2(e,t,r,n)}function updateCopyCommands$1(e,t,i){defined(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand("uniform highp sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n",{renderState:RenderState.fromCache(),uniformMap:{u_texture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=i,e._copyDepthCommand.framebuffer=e._framebuffer}ParticleSystem.prototype.update=function(e){if(this.show){defined(this._billboardCollection)||(this._billboardCollection=new BillboardCollection),this._updateParticlePool&&(updateParticlePool(this),this._updateParticlePool=!1);var t=0;this._previousTime&&(t=JulianDate.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);var i,r=this._particles,n=this._emitter,a=this.updateCallback,o=r.length;for(c=0;c<o;++c)(i=r[c]).update(t,a)?updateBillboard(this,i):(removeBillboard(i),addParticleToPool(this,i),r[c]=r[o-1],--c,--o);r.length=o;var s=calculateNumberToEmit(this,t);if(0<s&&defined(n)){this._matrixDirty&&(this._combinedMatrix=Matrix4.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);for(var l=this._combinedMatrix,c=0;c<s;c++)i=getOrCreateParticle(this),this._emitter.emit(i),Cartesian3.add(i.position,i.velocity,rotatedVelocityScratch),Matrix4.multiplyByPoint(l,rotatedVelocityScratch,rotatedVelocityScratch),i.position=Matrix4.multiplyByPoint(l,i.position,i.position),Cartesian3.subtract(rotatedVelocityScratch,i.position,i.velocity),Cartesian3.normalize(i.velocity,i.velocity),addParticle(this,i),updateBillboard(this,i)}if(this._billboardCollection.update(e),this._previousTime=JulianDate.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=CesiumMath.mod(this._currentTime,this._lifetime),this.bursts){var u=this.bursts.length;for(c=0;c<u;c++)this.bursts[c]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120==0&&freeParticlePool(this)}},ParticleSystem.prototype.isDestroyed=function(){return!1},ParticleSystem.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),destroyObject(this)},Object.defineProperties(PerformanceDisplay.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(this._throttledText.nodeValue=e?"(throttled)":"",this._throttled=e)}}}),PerformanceDisplay.prototype.update=function(e){var t=getTimestamp$1(),i=defaultValue(e,!0);this._fpsFrameCount++;e=t-this._lastFpsSampleTime;1e3<e&&(r="N/A",i&&(r=1e3*this._fpsFrameCount/e|0),this._fpsText.nodeValue=r+" FPS",this._lastFpsSampleTime=t,this._fpsFrameCount=0),this._msFrameCount++;var r,e=t-this._lastMsSampleTime;200<e&&(r="N/A",i&&(r=(e/this._msFrameCount).toFixed(2)),this._msText.nodeValue=r+" MS",this._lastMsSampleTime=t,this._msFrameCount=0)},PerformanceDisplay.prototype.destroy=function(){return destroyObject(this)},PickDepth.prototype.executeDebugPickDepth=function(e,t,i){executeDebugPickDepth(this,e,t,i)},PickDepth.prototype.update=function(e,t){updateFramebuffers$2(this,e,t),updateCopyCommands$1(this,e,t)};var scratchPackedDepth=new Cartesian4,packedDepthScale=new Cartesian4(1,1/255,1/65025,1/16581375);function PickDepthFramebuffer(){this._depthStencilTexture=void 0,this._framebuffer=void 0,this._passState=void 0}function destroyResources$2(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy()}function createResources$6(e,t){var i=t.drawingBufferWidth,r=t.drawingBufferHeight;e._depthStencilTexture=new Texture({context:t,width:i,height:r,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8}),e._framebuffer=new Framebuffer({context:t,depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1});t=new PassState(t);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new BoundingRectangle},t.viewport=new BoundingRectangle,e._passState=t}function PickFramebuffer(e){var t=new PassState(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new BoundingRectangle},t.viewport=new BoundingRectangle,this._context=e,this._fb=void 0,this._passState=t,this._width=0,this._height=0}PickDepth.prototype.getDepth=function(e,t,i){if(defined(this._framebuffer)){i=e.readPixels({x:t,y:i,width:1,height:1,framebuffer:this._framebuffer}),i=Cartesian4.unpack(i,0,scratchPackedDepth);return Cartesian4.divideByScalar(i,255,i),Cartesian4.dot(i,packedDepthScale)}},PickDepth.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},PickDepth.prototype.isDestroyed=function(){return!1},PickDepth.prototype.destroy=function(){return destroyTextures$2(this),destroyFramebuffers$3(this),defined(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=defined(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),destroyObject(this)},PickDepthFramebuffer.prototype.update=function(e,t,i){var r=i.width,n=i.height;defined(this._framebuffer)&&r===this._depthStencilTexture.width&&n===this._depthStencilTexture.height||(destroyResources$2(this),createResources$6(this,e));i=this._framebuffer,e=this._passState;return e.framebuffer=i,e.viewport.width=r,e.viewport.height=n,e.scissorTest.rectangle.x=t.x,e.scissorTest.rectangle.y=n-t.y,e.scissorTest.rectangle.width=1,e.scissorTest.rectangle.height=1,e},PickDepthFramebuffer.prototype.isDestroyed=function(){return!1},PickDepthFramebuffer.prototype.destroy=function(){return destroyResources$2(this),destroyObject(this)},PickFramebuffer.prototype.begin=function(e,t){var i=this._context,r=t.width,t=t.height;return BoundingRectangle.clone(e,this._passState.scissorTest.rectangle),defined(this._fb)&&this._width===r&&this._height===t||(this._width=r,this._height=t,this._fb=this._fb&&this._fb.destroy(),this._fb=new Framebuffer({context:i,colorTextures:[new Texture({context:i,width:r,height:t})],depthStencilRenderbuffer:new Renderbuffer({context:i,width:r,height:t,format:RenderbufferFormat$1.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=r,this._passState.viewport.height=t,this._passState};var colorScratch$7=new Color;function SceneFramebuffer(){this._colorTexture=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._framebuffer=void 0,this._idFramebuffer=void 0,this._idClearColor=new Color(0,0,0,0),this._useHdr=void 0,this._clearCommand=new ClearCommand({color:new Color(0,0,0,0),depth:1,owner:this})}function destroyResources$3(e){e._framebuffer=e._framebuffer&&e._framebuffer.destroy(),e._idFramebuffer=e._idFramebuffer&&e._idFramebuffer.destroy(),e._colorTexture=e._colorTexture&&e._colorTexture.destroy(),e._idTexture=e._idTexture&&e._idTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._depthStencilIdTexture=e._depthStencilIdTexture&&e._depthStencilIdTexture.destroy(),e._depthStencilIdRenderbuffer=e._depthStencilIdRenderbuffer&&e._depthStencilIdRenderbuffer.destroy(),e._framebuffer=void 0,e._idFramebuffer=void 0,e._colorTexture=void 0,e._idTexture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,e._depthStencilIdTexture=void 0,e._depthStencilIdRenderbuffer=void 0}function ShadowMapShader(){}function ShadowMap(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).context;this._enabled=defaultValue(e.enabled,!0),this._softShadows=defaultValue(e.softShadows,!1),this._normalOffset=defaultValue(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=defaultValue(e.fromLightSource,!0),this.darkness=defaultValue(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=defaultValue(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1;var i,r=this._needsUpdate=!0;(FeatureDetection.isInternetExplorer()||FeatureDetection.isEdge()||(FeatureDetection.isChrome()||FeatureDetection.isFirefox())&&FeatureDetection.isWindows()&&!t.depthTexture)&&(r=!1),this._polygonOffsetSupported=r,this._terrainBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:r,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Matrix4,this._shadowMapTexture=void 0,this._lightDirectionEC=new Cartesian3,this._lightPositionEC=new Cartesian4,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new ShadowMapCamera,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new BoundingSphere,this._isPointLight=defaultValue(e.isPointLight,!1),this._pointLightRadius=defaultValue(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&defaultValue(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?defaultValue(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Cartesian2,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new OrthographicOffCenterFrustum:defined(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Cartesian4,new Cartesian4],this._cascadeMatrices=[new Matrix4,new Matrix4,new Matrix4,new Matrix4],this._cascadeDistances=new Cartesian4,i=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(i);for(var n=0;n<i;++n)this._passes[n]=new ShadowPass(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,createRenderStates$5(this),this._clearCommand=new ClearCommand({depth:1,color:new Color}),this._clearPassState=new PassState(t),this._size=defaultValue(e.size,2048),this.size=this._size}function ShadowPass(e){this.camera=new ShadowMapCamera,this.passState=new PassState(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function createRenderState$1(e,t){return RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function createRenderStates$5(e){var t=!e._usesDepthTexture;e._primitiveRenderState=createRenderState$1(t,e._primitiveBias),e._terrainRenderState=createRenderState$1(t,e._terrainBias),e._pointRenderState=createRenderState$1(t,e._pointBias)}function destroyFramebuffer$1(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;defined(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function createFramebufferColor(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),n=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),a=e._passes.length,o=0;o<a;++o){var s=e._passes[o];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebufferDepth(e,t){for(var i=new Texture({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST}),r=new Framebuffer({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,a=0;a<n;++a){var o=e._passes[a];o.framebuffer=r,o.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function createFramebufferCube(e,t){for(var i=new Renderbuffer({context:t,width:e._textureSize.x,height:e._textureSize.y,format:RenderbufferFormat$1.DEPTH_COMPONENT16}),r=new CubeMap({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],a=0;a<6;++a){var o=new Framebuffer({context:t,depthRenderbuffer:i,colorTextures:[n[a]],destroyAttachments:!1}),s=e._passes[a];s.framebuffer=o,s.passState.framebuffer=o}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function createFramebuffer$3(e,t){(e._isPointLight?createFramebufferCube:e._usesDepthTexture?createFramebufferDepth:createFramebufferColor)(e,t)}function checkFramebuffer(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==WebGLConstants$1.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,createRenderStates$5(e),destroyFramebuffer$1(e),createFramebuffer$3(e,t))}function updateFramebuffer(e,t){defined(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(destroyFramebuffer$1(e),createFramebuffer$3(e,t),checkFramebuffer(e,t),clearFramebuffer(e,t))}function clearFramebuffer(e,t,i){i=defaultValue(i,0),!e._isPointLight&&0!==i||(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function resize(e,t){e._size=t;var i,r=e._passes,n=r.length,a=e._textureSize;e._isPointLight?(t=ContextLimits.maximumCubeMapSize>=t?t:ContextLimits.maximumCubeMapSize,a.x=t,i=new BoundingRectangle(0,0,a.y=t,t),r[0].passState.viewport=i,r[1].passState.viewport=i,r[2].passState.viewport=i,r[3].passState.viewport=i,r[4].passState.viewport=i,r[5].passState.viewport=i):1===n?(t=ContextLimits.maximumTextureSize>=t?t:ContextLimits.maximumTextureSize,a.x=t,a.y=t,r[0].passState.viewport=new BoundingRectangle(0,0,t,t)):4===n&&(t=ContextLimits.maximumTextureSize>=2*t?t:ContextLimits.maximumTextureSize/2,a.x=2*t,a.y=2*t,r[0].passState.viewport=new BoundingRectangle(0,0,t,t),r[1].passState.viewport=new BoundingRectangle(t,0,t,t),r[2].passState.viewport=new BoundingRectangle(0,t,t,t),r[3].passState.viewport=new BoundingRectangle(t,t,t,t)),e._clearPassState.viewport=new BoundingRectangle(0,0,a.x,a.y);for(var o=0;o<n;++o){var s=r[o],l=s.passState.viewport,c=l.x/a.x,u=l.y/a.y,d=l.width/a.x,l=l.height/a.y;s.textureOffsets=new Matrix4(d,0,0,c,0,l,0,u,0,0,1,0,0,0,0,1)}}PickFramebuffer.prototype.end=function(e){for(var t=defaultValue(e.width,1),i=defaultValue(e.height,1),r=this._context,n=r.readPixels({x:e.x,y:e.y,width:t,height:i,framebuffer:this._fb}),e=Math.max(t,i),a=e*e,o=Math.floor(.5*t),s=Math.floor(.5*i),l=0,c=0,u=0,d=-1,h=0;h<a;++h){if(-o<=l&&l<=o&&-s<=c&&c<=s){var p=4*((s-c)*t+l+o);colorScratch$7.red=Color.byteToFloat(n[p]),colorScratch$7.green=Color.byteToFloat(n[1+p]),colorScratch$7.blue=Color.byteToFloat(n[2+p]),colorScratch$7.alpha=Color.byteToFloat(n[3+p]);var p=r.getObjectByPickColor(colorScratch$7);if(defined(p))return p}(l===c||l<0&&-l===c||0<l&&l===1-c)&&(p=u,u=-d,d=p),l+=u,c+=d}},PickFramebuffer.prototype.isDestroyed=function(){return!1},PickFramebuffer.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),destroyObject(this)},SceneFramebuffer.prototype.update=function(e,t,i){var r=t.width,n=t.height,t=this._colorTexture;defined(t)&&t.width===r&&t.height===n&&i===this._useHdr||(destroyResources$3(this),i=(this._useHdr=i)?e.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE,this._colorTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:i,sampler:Sampler.NEAREST}),this._idTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,sampler:Sampler.NEAREST}),e.depthTexture?(this._depthStencilTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST}),this._depthStencilIdTexture=new Texture({context:e,width:r,height:n,pixelFormat:PixelFormat$1.DEPTH_STENCIL,pixelDatatype:PixelDatatype$1.UNSIGNED_INT_24_8,sampler:Sampler.NEAREST})):(this._depthStencilRenderbuffer=new Renderbuffer({context:e,width:r,height:n,format:RenderbufferFormat$1.DEPTH_STENCIL}),this._depthStencilIdRenderbuffer=new Renderbuffer({context:e,width:r,height:n,format:RenderbufferFormat$1.DEPTH_STENCIL})),this._framebuffer=new Framebuffer({context:e,colorTextures:[this._colorTexture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}),this._idFramebuffer=new Framebuffer({context:e,colorTextures:[this._idTexture],depthStencilTexture:this._depthStencilIdTexture,depthStencilRenderbuffer:this._depthStencilIdRenderbuffer,destroyAttachments:!1}))},SceneFramebuffer.prototype.clear=function(e,t,i){var r=t.framebuffer;t.framebuffer=this._framebuffer,Color.clone(i,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=this._idFramebuffer,Color.clone(this._idClearColor,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=r},SceneFramebuffer.prototype.getFramebuffer=function(){return this._framebuffer},SceneFramebuffer.prototype.getIdFramebuffer=function(){return this._idFramebuffer},SceneFramebuffer.prototype.isDestroyed=function(){return!1},SceneFramebuffer.prototype.destroy=function(){return destroyResources$3(this),destroyObject(this)},ShadowMapShader.getShadowCastShaderKeyword=function(e,t,i,r){return"castShadow "+e+" "+t+" "+i+" "+r},ShadowMapShader.createShadowCastVertexShader=function(e,t,i){var r=e.defines.slice(0),n=e.sources.slice(0);r.push("SHADOW_MAP"),i&&r.push("GENERATE_POSITION");e=defined(ShaderSource.findPositionVarying(e));if(t&&!e){for(var a=n.length,o=0;o<a;++o)n[o]=ShaderSource.replaceMain(n[o],"czm_shadow_cast_main");n.push("varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}")}return new ShaderSource({defines:r,sources:n})},ShadowMapShader.createShadowCastFragmentShader=function(e,t,i,r){var n=e.defines.slice(0),a=e.sources.slice(0),o=ShaderSource.findPositionVarying(e),s=defined(o);s||(o="v_positionEC");for(var l=a.length,c=0;c<l;++c)a[c]=ShaderSource.replaceMain(a[c],"czm_shadow_cast_main");e="";return t&&(s||(e+="varying vec3 v_positionEC; \n"),e+="uniform vec4 shadowMap_lightPositionEC; \n"),e+=r?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",e+=t?" float distance = length("+o+"); \n if (distance >= shadowMap_lightPositionEC.w) \n { \n discard; \n } \n distance /= shadowMap_lightPositionEC.w; // radius \n gl_FragColor = czm_packDepth(distance); \n":i?" gl_FragColor = vec4(1.0); \n":" gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",e+="} \n",a.push(e),new ShaderSource({defines:n,sources:a})},ShadowMapShader.getShadowReceiveShaderKeyword=function(e,t,i,r){return"receiveShadow "+e._usesDepthTexture+e._polygonOffsetSupported+e._isPointLight+e._isSpotLight+(1<e._numberOfCascades)+e.debugCascadeColors+e.softShadows+t+i+r},ShadowMapShader.createShadowReceiveVertexShader=function(e,t,i){var r=e.defines.slice(0),e=e.sources.slice(0);return r.push("SHADOW_MAP"),t&&(i?r.push("GENERATE_POSITION_AND_NORMAL"):r.push("GENERATE_POSITION")),new ShaderSource({defines:r,sources:e})},ShadowMapShader.createShadowReceiveFragmentShader=function(e,t,i,r,n){for(var a=ShaderSource.findNormalVarying(e),o=!r&&defined(a)||r&&n,s=ShaderSource.findPositionVarying(e),l=defined(s),c=t._usesDepthTexture,u=t._polygonOffsetSupported,d=t._isPointLight,h=t._isSpotLight,p=1<t._numberOfCascades,m=t.debugCascadeColors,f=t.softShadows,n=d?t._pointBias:r?t._terrainBias:t._primitiveBias,t=e.defines.slice(0),g=e.sources.slice(0),_=g.length,y=0;y<_;++y)g[y]=ShaderSource.replaceMain(g[y],"czm_shadow_receive_main");d?t.push("USE_CUBE_MAP_SHADOW"):c&&t.push("USE_SHADOW_DEPTH_TEXTURE"),f&&!d&&t.push("USE_SOFT_SHADOWS"),p&&i&&r&&(o?t.push("ENABLE_VERTEX_LIGHTING"):t.push("ENABLE_DAYNIGHT_SHADING")),i&&n.normalShading&&o&&(t.push("USE_NORMAL_SHADING"),0<n.normalShadingSmooth&&t.push("USE_NORMAL_SHADING_SMOOTH"));i="";return i+=d?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",i+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \n#ifdef LOG_DEPTH \nvarying vec3 v_logPositionEC; \n#endif \nvec4 getPositionEC() \n{ \n"+(l?" return vec4("+s+", 1.0); \n":"#ifndef LOG_DEPTH \n return czm_windowToEyeCoordinates(gl_FragCoord); \n#else \n return vec4(v_logPositionEC, 1.0); \n#endif \n")+"} \nvec3 getNormalEC() \n{ \n"+(o?" return normalize("+a+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(n.normalOffset&&o?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",i+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",i+=" czm_shadowParameters shadowParameters; \n shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; \n shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; \n shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; \n shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; \n",r?i+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":u||(i+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),i+=d?" vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; \n float distance = length(directionEC); \n directionEC = normalize(directionEC); \n float radius = shadowMap_lightPositionEC.w; \n // Stop early if the fragment is beyond the point light radius \n if (distance > radius) \n { \n return; \n } \n vec3 directionWC = czm_inverseViewRotation * directionEC; \n shadowParameters.depth = distance / radius; \n shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n shadowParameters.texCoords = directionWC; \n float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); \n":h?" vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); \n float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Spot light uses a perspective projection, so perform the perspective divide \n shadowPosition /= shadowPosition.w; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n":p?" float maxDepth = shadowMap_cascadeSplits[1].w; \n // Stop early if the eye depth exceeds the last cascade \n if (depth > maxDepth) \n { \n return; \n } \n // Get the cascade based on the eye-space depth \n vec4 weights = czm_cascadeWeights(depth); \n // Apply normal offset \n float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n // Transform position into the cascade \n vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; \n // Get visibility \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n // Fade out shadows that are far away \n float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; \n float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); \n visibility = mix(visibility, 1.0, fade); \n"+(m?" // Draw cascade colors for debugging \n gl_FragColor *= czm_cascadeColor(weights); \n":""):" float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); \n applyNormalOffset(positionEC, normalEC, nDotL); \n vec4 shadowPosition = shadowMap_matrix * positionEC; \n // Stop early if the fragment is not in the shadow bounds \n if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) \n { \n return; \n } \n shadowParameters.texCoords = shadowPosition.xy; \n shadowParameters.depth = shadowPosition.z; \n shadowParameters.nDotL = nDotL; \n float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); \n",i+=" gl_FragColor.rgb *= visibility; \n} \n",g.push(i),new ShaderSource({defines:t,sources:g})},ShadowMap.MAXIMUM_DISTANCE=2e4,ShadowMap.prototype.debugCreateRenderStates=function(){createRenderStates$5(this)},Object.defineProperties(ShadowMap.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){resize(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});var scratchViewport$2=new BoundingRectangle;function createDebugShadowViewCommand(e,t){var i=e._isPointLight?"uniform samplerCube shadowMap_textureCube; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n vec2 uv = v_textureCoordinates; \n vec3 dir; \n \n if (uv.y < 0.5) \n { \n if (uv.x < 0.333) \n { \n dir.x = -1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = -1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 1.0; \n } \n else \n { \n dir.z = -1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 1.0; \n } \n } \n else \n { \n if (uv.x < 0.333) \n { \n dir.x = 1.0; \n dir.y = uv.x * 6.0 - 1.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else if (uv.x < 0.666) \n { \n dir.y = 1.0; \n dir.x = uv.x * 6.0 - 3.0; \n dir.z = uv.y * 4.0 - 3.0; \n } \n else \n { \n dir.z = 1.0; \n dir.x = uv.x * 6.0 - 5.0; \n dir.y = uv.y * 4.0 - 3.0; \n } \n } \n \n float shadow = czm_unpackDepth(textureCube(shadowMap_textureCube, dir)); \n gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n":"uniform sampler2D shadowMap_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n"+(e._usesDepthTexture?" float shadow = texture2D(shadowMap_texture, v_textureCoordinates).r; \n":" float shadow = czm_unpackDepth(texture2D(shadowMap_texture, v_textureCoordinates)); \n")+" gl_FragColor = vec4(vec3(shadow), 1.0); \n} \n",i=t.createViewportQuadCommand(i,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Pass$1.OVERLAY,i}function updateDebugShadowViewCommand(e,t){var i=t.context,r=t.context.drawingBufferWidth,n=t.context.drawingBufferHeight,a=.3*Math.min(r,n),n=scratchViewport$2;n.x=r-a,n.y=0,n.width=a,n.height=a;a=e._debugShadowViewCommand;defined(a)||(a=createDebugShadowViewCommand(e,i),e._debugShadowViewCommand=a),defined(a.renderState)&&BoundingRectangle.equals(a.renderState.viewport,n)||(a.renderState=RenderState.fromCache({viewport:BoundingRectangle.clone(n)})),t.commandList.push(e._debugShadowViewCommand)}var frustumCornersNDC$1=new Array(8);frustumCornersNDC$1[0]=new Cartesian4(-1,-1,-1,1),frustumCornersNDC$1[1]=new Cartesian4(1,-1,-1,1),frustumCornersNDC$1[2]=new Cartesian4(1,1,-1,1),frustumCornersNDC$1[3]=new Cartesian4(-1,1,-1,1),frustumCornersNDC$1[4]=new Cartesian4(-1,-1,1,1),frustumCornersNDC$1[5]=new Cartesian4(1,-1,1,1),frustumCornersNDC$1[6]=new Cartesian4(1,1,1,1),frustumCornersNDC$1[7]=new Cartesian4(-1,1,1,1);for(var scratchMatrix$4=new Matrix4,scratchFrustumCorners$1=new Array(8),i$5=0;i$5<8;++i$5)scratchFrustumCorners$1[i$5]=new Cartesian4;function createDebugPointLight(e,t){return new Primitive({geometryInstances:[new GeometryInstance({geometry:new BoxOutlineGeometry({minimum:new Cartesian3(-.5,-.5,-.5),maximum:new Cartesian3(.5,.5,.5)}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}}),new GeometryInstance({geometry:new SphereOutlineGeometry({radius:.5}),attributes:{color:ColorGeometryInstanceAttribute.fromColor(t)}})],appearance:new PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var debugOutlineColors=[Color.RED,Color.GREEN,Color.BLUE,Color.MAGENTA],scratchScale$8=new Cartesian3;function applyDebugSettings$1(e,t){updateDebugShadowViewCommand(e,t);var i,r,n,a=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(a&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new DebugCameraPrimitive({camera:e._sceneCamera,color:Color.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){a&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var o=0;o<e._numberOfCascades;++o)a&&(e._debugCascadeFrustums[o]=e._debugCascadeFrustums[o]&&e._debugCascadeFrustums[o].destroy(),e._debugCascadeFrustums[o]=new DebugCameraPrimitive({camera:e._passes[o].camera,color:debugOutlineColors[o],updateOnChange:!1})),e._debugCascadeFrustums[o].update(t)}}else e._isPointLight?defined(e._debugLightFrustum)&&!e._needsUpdate||(i=e._shadowMapCamera.positionWC,r=Quaternion.IDENTITY,n=2*e._pointLightRadius,n=Cartesian3.fromElements(n,n,n,scratchScale$8),n=Matrix4.fromTranslationQuaternionRotationScale(i,r,n,scratchMatrix$4),e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=createDebugPointLight(n,Color.YELLOW)):defined(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new DebugCameraPrimitive({camera:e._shadowMapCamera,color:Color.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function ShadowMapCamera(){this.viewMatrix=new Matrix4,this.inverseViewMatrix=new Matrix4,this.frustum=void 0,this.positionCartographic=new Cartographic,this.positionWC=new Cartesian3,this.directionWC=Cartesian3.clone(Cartesian3.UNIT_Z),this.upWC=Cartesian3.clone(Cartesian3.UNIT_Y),this.rightWC=Cartesian3.clone(Cartesian3.UNIT_X),this.viewProjectionMatrix=new Matrix4}ShadowMapCamera.prototype.clone=function(e){Matrix4.clone(e.viewMatrix,this.viewMatrix),Matrix4.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),Cartographic.clone(e.positionCartographic,this.positionCartographic),Cartesian3.clone(e.positionWC,this.positionWC),Cartesian3.clone(e.directionWC,this.directionWC),Cartesian3.clone(e.upWC,this.upWC),Cartesian3.clone(e.rightWC,this.rightWC)};var scaleBiasMatrix=new Matrix4(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);ShadowMapCamera.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return Matrix4.multiply(t,e,this.viewProjectionMatrix),Matrix4.multiply(scaleBiasMatrix,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var scratchSplits$1=new Array(5),scratchFrustum=new PerspectiveFrustum,scratchCascadeDistances=new Array(4),scratchMin$3=new Cartesian3,scratchMax$3=new Cartesian3;function computeCascades(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=r.frustum.near,a=r.frustum.far,o=e._numberOfCascades,s=a-n,l=a/n,c=.9,u=!1;t.shadowState.closestObjectSize<200&&(u=!0,c=.9);var d=scratchCascadeDistances,h=scratchSplits$1;for(h[0]=n,h[o]=a,g=0;g<o;++g){var p=(g+1)/o,m=n*Math.pow(l,p),p=n+s*p,m=CesiumMath.lerp(p,m,c);h[g+1]=m,d[g]=m-h[g]}if(u){for(g=0;g<o;++g)d[g]=Math.min(d[g],e._maximumCascadeDistances[g]);for(var f=h[0],g=0;g<o-1;++g)f+=d[g],h[g+1]=f}Cartesian4.unpack(h,0,e._cascadeSplits[0]),Cartesian4.unpack(h,1,e._cascadeSplits[1]),Cartesian4.unpack(d,0,e._cascadeDistances);var u=i.frustum,_=u.left,y=u.right,C=u.bottom,v=u.top,S=u.near,T=u.far,x=i.positionWC,b=i.directionWC,E=i.upWC,P=r.frustum.clone(scratchFrustum),A=i.getViewProjection();for(g=0;g<o;++g){P.near=h[g],P.far=h[g+1];for(var w=Matrix4.multiply(P.projectionMatrix,r.viewMatrix,scratchMatrix$4),D=Matrix4.inverse(w,scratchMatrix$4),M=Matrix4.multiply(A,D,scratchMatrix$4),I=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$3),R=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$3),O=0;O<8;++O){var L=Cartesian4.clone(frustumCornersNDC$1[O],scratchFrustumCorners$1[O]);Matrix4.multiplyByVector(M,L,L),Cartesian3.divideByScalar(L,L.w,L),Cartesian3.minimumByComponent(L,I,I),Cartesian3.maximumByComponent(L,R,R)}I.x=Math.max(I.x,0),I.y=Math.max(I.y,0),I.z=0,R.x=Math.min(R.x,1),R.y=Math.min(R.y,1),R.z=Math.min(R.z,1);var F=e._passes[g],w=F.camera;w.clone(i);D=w.frustum;D.left=_+I.x*(y-_),D.right=_+R.x*(y-_),D.bottom=C+I.y*(v-C),D.top=C+R.y*(v-C),D.near=S+I.z*(T-S),D.far=S+R.z*(T-S),F.cullingVolume=w.frustum.computeCullingVolume(x,b,E);D=e._cascadeMatrices[g];Matrix4.multiply(w.getViewProjection(),r.inverseViewMatrix,D),Matrix4.multiply(F.textureOffsets,D,D)}}var scratchLightView=new Matrix4,scratchRight$2=new Cartesian3,scratchUp$1=new Cartesian3,scratchTranslation$1=new Cartesian3;function fitShadowMapToScene(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,n=Matrix4.multiply(r.frustum.projectionMatrix,r.viewMatrix,scratchMatrix$4),a=Matrix4.inverse(n,scratchMatrix$4),o=i.directionWC,s=r.directionWC;Cartesian3.equalsEpsilon(o,s,CesiumMath.EPSILON10)&&(s=r.upWC);var l=Cartesian3.cross(o,s,scratchRight$2),s=Cartesian3.cross(l,o,scratchUp$1);Cartesian3.normalize(s,s),Cartesian3.normalize(l,l);for(var c=Cartesian3.fromElements(0,0,0,scratchTranslation$1),e=Matrix4.computeView(c,o,s,l,scratchLightView),u=Matrix4.multiply(e,a,scratchMatrix$4),d=Cartesian3.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,scratchMin$3),h=Cartesian3.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,scratchMax$3),p=0;p<8;++p){var m=Cartesian4.clone(frustumCornersNDC$1[p],scratchFrustumCorners$1[p]);Matrix4.multiplyByVector(u,m,m),Cartesian3.divideByScalar(m,m.w,m),Cartesian3.minimumByComponent(m,d,d),Cartesian3.maximumByComponent(m,h,h)}h.z+=1e3,d.z-=10;n=scratchTranslation$1;n.x=-.5*(d.x+h.x),n.y=-.5*(d.y+h.y),n.z=-h.z;r=Matrix4.fromTranslation(n,scratchMatrix$4),e=Matrix4.multiply(r,e,e),c=.5*(h.x-d.x),a=.5*(h.y-d.y),n=h.z-d.z,r=i.frustum;r.left=-c,r.right=c,r.bottom=-a,r.top=a,r.near=.01,r.far=n,Matrix4.clone(e,i.viewMatrix),Matrix4.inverse(e,i.inverseViewMatrix),Matrix4.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),Cartesian3.clone(o,i.directionWC),Cartesian3.clone(s,i.upWC),Cartesian3.clone(l,i.rightWC)}var directions=[new Cartesian3(-1,0,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(0,1,0),new Cartesian3(0,0,1)],ups=[new Cartesian3(0,-1,0),new Cartesian3(0,0,-1),new Cartesian3(0,-1,0),new Cartesian3(0,-1,0),new Cartesian3(0,0,1),new Cartesian3(0,-1,0)],rights=[new Cartesian3(0,0,1),new Cartesian3(1,0,0),new Cartesian3(-1,0,0),new Cartesian3(0,0,-1),new Cartesian3(1,0,0),new Cartesian3(1,0,0)];function computeOmnidirectional(e,t){var i=new PerspectiveFrustum;i.fov=CesiumMath.PI_OVER_TWO,i.near=1,i.far=e._pointLightRadius,i.aspectRatio=1;for(var r=0;r<6;++r){var n=e._passes[r].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=directions[r],n.upWC=ups[r],n.rightWC=rights[r],Matrix4.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),Matrix4.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}var scratchCartesian1$8=new Cartesian3,scratchCartesian2$b=new Cartesian3,scratchBoundingSphere$4=new BoundingSphere,scratchCenter$5=scratchBoundingSphere$4.center;function checkVisibility(e,t){var i=e._sceneCamera,r=e._shadowMapCamera,n=scratchBoundingSphere$4;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var a=t.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,scratchCartesian1$8),i=Cartesian3.negate(r.directionWC,scratchCartesian2$b),a=Cartesian3.dot(a,i),i=CesiumMath.clamp(a/.1,0,1);if(e._darkness=CesiumMath.lerp(1,e.darkness,i),a<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else e._isPointLight?(n.center=r.positionWC,n.radius=e._pointLightRadius):(a=r.frustum.far/2,r=Cartesian3.add(r.positionWC,Cartesian3.multiplyByScalar(r.directionWC,a,scratchCenter$5),scratchCenter$5),n.center=r,n.radius=a),e._outOfView=t.cullingVolume.computeVisibility(n)===Intersect$1.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(n),BoundingSphere.clone(n,e._boundingSphere)}function updateCameras(e,t){var i=t.camera,r=e._lightCamera,n=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?Cartesian3.clone(r.directionWC,a.directionWC):e._isPointLight?Cartesian3.clone(r.positionWC,a.positionWC):a.clone(r);var o,s,r=e._lightDirectionEC;Matrix4.multiplyByPointAsVector(i.viewMatrix,a.directionWC,r),Cartesian3.normalize(r,r),Cartesian3.negate(r,r),Matrix4.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius,s=e._fitNearFar?(o=Math.min(t.shadowState.nearPlane,e.maximumDistance),s=Math.min(t.shadowState.farPlane,e.maximumDistance),Math.max(s,o+1)):(o=i.frustum.near,e.maximumDistance),e._sceneCamera=Camera.clone(i,n),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=o,e._sceneCamera.frustum.far=s,e._distance=s-o,checkVisibility(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}ShadowMap.prototype.update=function(e){var t,i,r,n;updateCameras(this,e),this._needsUpdate&&(updateFramebuffer(this,e.context),this._isPointLight&&computeOmnidirectional(this,e),this._cascadesEnabled&&(fitShadowMapToScene(this,e),1<this._numberOfCascades&&computeCascades(this,e)),this._isPointLight?this._shadowMapCullingVolume=CullingVolume.fromBoundingSphere(this._boundingSphere):(t=(n=this._shadowMapCamera).positionWC,i=n.directionWC,r=n.upWC,this._shadowMapCullingVolume=n.frustum.computeCullingVolume(t,i,r),1===this._passes.length&&this._passes[0].camera.clone(n))),1===this._passes.length&&(n=this._sceneCamera.inverseViewMatrix,Matrix4.multiply(this._shadowMapCamera.getViewProjection(),n,this._shadowMapMatrix)),this.debugShow&&applyDebugSettings$1(this,e)},ShadowMap.prototype.updatePass=function(e,t){clearFramebuffer(this,e,t)};var scratchTexelStepSize=new Cartesian2;function combineUniforms(t,e,i){var r=t._isPointLight?t._pointBias:i?t._terrainBias:t._primitiveBias;return combine(e,{shadowMap_texture:function(){return t._shadowMapTexture},shadowMap_textureCube:function(){return t._shadowMapTexture},shadowMap_matrix:function(){return t._shadowMapMatrix},shadowMap_cascadeSplits:function(){return t._cascadeSplits},shadowMap_cascadeMatrices:function(){return t._cascadeMatrices},shadowMap_lightDirectionEC:function(){return t._lightDirectionEC},shadowMap_lightPositionEC:function(){return t._lightPositionEC},shadowMap_cascadeDistances:function(){return t._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var e=scratchTexelStepSize;return e.x=1/t._textureSize.x,e.y=1/t._textureSize.y,Cartesian4.fromElements(e.x,e.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Cartesian4.fromElements(r.normalOffsetScale,t._distance,t.maximumDistance,t._darkness,this.combinedUniforms2)},combinedUniforms1:new Cartesian4,combinedUniforms2:new Cartesian4},!1)}function createCastDerivedCommand(e,t,i,r,n,a){var o,s,l,c,u,d,h,p,m;return defined(a)&&(m=a.shaderProgram,o=a.renderState,s=a.uniformMap),(a=DrawCommand.shallowClone(i,a)).castShadows=!0,a.receiveShadows=!1,defined(m)&&n===i.shaderProgram.id&&!t||(l=i.shaderProgram,c=i.pass===Pass$1.GLOBE,p=i.pass!==Pass$1.TRANSLUCENT,u=e._isPointLight,d=e._usesDepthTexture,h=ShadowMapShader.getShadowCastShaderKeyword(u,c,d,p),defined(m=r.shaderCache.getDerivedShaderProgram(l,h))||(n=l.vertexShaderSource,t=l.fragmentShaderSource,n=ShadowMapShader.createShadowCastVertexShader(n,u,c),p=ShadowMapShader.createShadowCastFragmentShader(t,u,d,p),m=r.shaderCache.createDerivedShaderProgram(l,h,{vertexShaderSource:n,fragmentShaderSource:p,attributeLocations:l._attributeLocations})),o=e._primitiveRenderState,u?o=e._pointRenderState:c&&(o=e._terrainRenderState),i.renderState.cull.enabled||((o=clone(o,!1)).cull=clone(o.cull,!1),o.cull.enabled=!1,o=RenderState.fromCache(o)),s=combineUniforms(e,i.uniformMap,c)),a.shaderProgram=m,a.renderState=o,a.uniformMap=s,a}function CommandExtent(){this.command=void 0,this.near=void 0,this.far=void 0}function View(e,t,i){var r,n,a=e.context;a.depthTexture&&(r=new GlobeDepth),e._useOIT&&a.depthTexture&&(n=new OIT(a));e=new PassState(a);e.viewport=BoundingRectangle.clone(i),this.camera=t,this._cameraClone=Camera.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=i,this.passState=e,this.pickFramebuffer=new PickFramebuffer(a),this.pickDepthFramebuffer=new PickDepthFramebuffer,this.sceneFramebuffer=new SceneFramebuffer,this.globeDepth=r,this.globeTranslucencyFramebuffer=new GlobeTranslucencyFramebuffer,this.oit=n,this.pickDepths=[],this.debugGlobeDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}ShadowMap.createReceiveDerivedCommand=function(e,t,i,r,n){defined(n)||(n={});var a,o,s,l=0<e.length,c=t.shaderProgram,u=c.vertexShaderSource,d=c.fragmentShaderSource,h=t.pass===Pass$1.GLOBE,p=!1;return h&&(p=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&l&&(defined(n.receiveCommand)&&(s=n.receiveCommand.shaderProgram,a=n.receiveCommand.uniformMap),n.receiveCommand=DrawCommand.shallowClone(t,n.receiveCommand),n.castShadows=!1,n.receiveShadows=!0,o=n.receiveShaderCastShadows!==t.castShadows,l=n.receiveShaderProgramId!==t.shaderProgram.id,(!defined(s)||l||i||o)&&(o=ShadowMapShader.getShadowReceiveShaderKeyword(e[0],t.castShadows,h,p),defined(s=r.shaderCache.getDerivedShaderProgram(c,o))||(u=ShadowMapShader.createShadowReceiveVertexShader(u,h,p),p=ShadowMapShader.createShadowReceiveFragmentShader(d,e[0],t.castShadows,h,p),s=r.shaderCache.createDerivedShaderProgram(c,o,{vertexShaderSource:u,fragmentShaderSource:p,attributeLocations:c._attributeLocations})),a=combineUniforms(e[0],t.uniformMap,h)),n.receiveCommand.shaderProgram=s,n.receiveCommand.uniformMap=a,n.receiveShaderProgramId=t.shaderProgram.id,n.receiveShaderCastShadows=t.castShadows),n},ShadowMap.createCastDerivedCommand=function(e,t,i,r,n){if(defined(n)||(n={}),t.castShadows){var a=n.castCommands;defined(a)||(a=n.castCommands=[]);var o=n.castShaderProgramId,s=e.length;a.length=s;for(var l=0;l<s;++l)a[l]=createCastDerivedCommand(e[l],i,t,r,o,a[l]);n.castShaderProgramId=t.shaderProgram.id}return n},ShadowMap.prototype.isDestroyed=function(){return!1},ShadowMap.prototype.destroy=function(){destroyFramebuffer$1(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(var e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return destroyObject(this)};var scratchPosition0=new Cartesian3,scratchPosition1=new Cartesian3;function maxComponent(e,t){var i=Math.max(Math.abs(e.x),Math.abs(t.x)),r=Math.max(Math.abs(e.y),Math.abs(t.y)),t=Math.max(Math.abs(e.z),Math.abs(t.z));return Math.max(Math.max(i,r),t)}function cameraEqual(e,t,i){var r=1/Math.max(1,maxComponent(e.position,t.position));return Cartesian3.multiplyByScalar(e.position,r,scratchPosition0),Cartesian3.multiplyByScalar(t.position,r,scratchPosition1),Cartesian3.equalsEpsilon(scratchPosition0,scratchPosition1,i)&&Cartesian3.equalsEpsilon(e.direction,t.direction,i)&&Cartesian3.equalsEpsilon(e.up,t.up,i)&&Cartesian3.equalsEpsilon(e.right,t.right,i)&&Matrix4.equalsEpsilon(e.transform,t.transform,i)&&e.frustum.equalsEpsilon(t.frustum,i)}function updateFrustums(e,t,i,r){var n,a=t.frameState,o=a.camera,s=a.useLogDepth?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,l=t.mode===SceneMode$1.SCENE2D,c=t.nearToFarDistance2D;r*=1+CesiumMath.EPSILON2,i=Math.min(Math.max(i,o.frustum.near),o.frustum.far),r=Math.max(Math.min(r,o.frustum.far),i),n=l?(r=Math.min(r,o.position.z+t.nearToFarDistance2D),i=Math.min(i,r),Math.ceil(Math.max(1,r-i)/t.nearToFarDistance2D)):Math.ceil(Math.log(r/i)/Math.log(s));var u=e.frustumCommandsList;u.length=n;for(var d=0;d<n;++d){var h,p=l?(h=Math.min(r-c,i+d*c),Math.min(r,h+c)):(h=Math.max(i,Math.pow(s,d)*i),Math.min(r,s*h)),m=u[d];defined(m)?(m.near=h,m.far=p):m=u[d]=new FrustumCommands(h,p)}}function insertIntoBin(e,t,i,r,n){t.debugShowFrustums&&(i.debugOverlappingFrustums=0);for(var a,o=e.frustumCommandsList,s=o.length,l=0;l<s;++l){var c=o[l],u=c.near;if(!(c.far<r)){if(n<u)break;var d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<l),i.executeInClosestFrustum)break}}t.debugShowFrustums&&((a=e.debugFrustumStatistics.commandsInFrustums)[i.debugOverlappingFrustums]=defined(a[i.debugOverlappingFrustums])?a[i.debugOverlappingFrustums]+1:1,++e.debugFrustumStatistics.totalCommands),t.updateDerivedCommands(i)}View.prototype.checkForCameraUpdates=function(e){var t=this.camera,i=this._cameraClone;return cameraEqual(t,i,CesiumMath.EPSILON15)?(this._cameraStartFired&&getTimestamp$1()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=getTimestamp$1(),Camera.clone(t,i),!0)};var scratchCullingVolume=new CullingVolume,scratchNearFarInterval=new Interval;View.prototype.createPotentiallyVisibleSet=function(e){var t=e.frameState,i=t.camera,r=i.directionWC,n=i.positionWC,a=e._computeCommandList,o=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=this.frustumCommandsList,c=l.length,u=Pass$1.NUMBER_OF_PASSES,d=0;d<c;++d)for(var h=0;h<u;++h)l[d].indices[h]=0;a.length=0,o.length=0;for(var p=this._commandExtents,m=p.length,f=0,g=+Number.MAX_VALUE,_=-Number.MAX_VALUE,y=t.shadowState.shadowsEnabled,C=+Number.MAX_VALUE,v=-Number.MAX_VALUE,S=Number.MAX_VALUE,T=t.mode===SceneMode$1.SCENE3D?t.occluder:void 0,x=t.cullingVolume,b=scratchCullingVolume.planes,E=0;E<5;++E)b[E]=x.planes[E];x=scratchCullingVolume;for(var P,A,w=s.length,D=0;D<w;++D){var M=s[D],I=M.pass;if(I===Pass$1.COMPUTE)a.push(M);else if(I===Pass$1.OVERLAY)o.push(M);else{var R=M.boundingVolume;if(defined(R)){if(!e.isVisible(M,x,T))continue;var O=R.computePlaneDistances(n,r,scratchNearFarInterval),L=O.start,O=O.stop,g=Math.min(g,L),_=Math.max(_,O);y&&M.receiveShadows&&L<ShadowMap.MAXIMUM_DISTANCE&&!(I===Pass$1.GLOBE&&L<-100&&100<O)&&(F=O-L,I!==Pass$1.GLOBE&&L<100&&(S=Math.min(S,F)),C=Math.min(C,L),v=Math.max(v,O))}else M instanceof ClearCommand?(L=i.frustum.near,O=i.frustum.far):(L=i.frustum.near,O=i.frustum.far,g=Math.min(g,L),_=Math.max(_,O));var F=p[f];defined(F)||(F=p[f]=new CommandExtent),F.command=M,F.near=L,F.far=O,f++}}for(y&&(C=Math.min(Math.max(C,i.frustum.near),i.frustum.far),v=Math.max(Math.min(v,i.frustum.far),C)),y&&(t.shadowState.nearPlane=C,t.shadowState.farPlane=v,t.shadowState.closestObjectSize=S),updateFrustums(this,e,g,_),P=0;P<f;P++)insertIntoBin(this,e,(A=p[P]).command,A.near,A.far);if(f<m)for(P=f;P<m&&defined((A=p[P]).command);P++)A.command=void 0;var N=l.length,B=t.frustumSplits;B.length=N+1;for(var V=0;V<N;++V)B[V]=l[V].near,V===N-1&&(B[V+1]=l[V].far)},View.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();for(var e=this.pickDepths,t=this.debugGlobeDepths,i=e.length,r=0;r<i;++r)e[r].destroy();for(i=t.length,r=0;r<i;++r)t[r].destroy()};var offscreenDefaultWidth=.1,mostDetailedPreloadTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.MOST_DETAILED_PRELOAD}),mostDetailedPickTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.MOST_DETAILED_PICK}),pickTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PICK});function Picking(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;var t=new BoundingRectangle(0,0,1,1),i=new Camera(e);i.frustum=new OrthographicFrustum({width:offscreenDefaultWidth,aspectRatio:1,near:.1}),this._pickOffscreenView=new View(e,i,t)}Picking.prototype.update=function(){this._pickPositionCacheDirty=!0},Picking.prototype.getPickDepth=function(e,t){var i=e.view.pickDepths,e=i[t];return defined(e)||(e=new PickDepth,i[t]=e),e};var scratchOrthoPickingFrustum=new OrthographicOffCenterFrustum,scratchOrthoOrigin=new Cartesian3,scratchOrthoDirection=new Cartesian3,scratchOrthoPixelSize=new Cartesian2,scratchOrthoPickVolumeMatrix4=new Matrix4;function getPickOrthographicCullingVolume(e,t,i,r,n){var a=e.camera,o=a.frustum;defined(o._offCenterFrustum)&&(o=o._offCenterFrustum);var s=2*(t.x-n.x)/n.width-1;s*=.5*(o.right-o.left);var l=2*(n.height-t.y-n.y)/n.height-1;l*=.5*(o.top-o.bottom);var c=Matrix4.clone(a.transform,scratchOrthoPickVolumeMatrix4);a._setTransform(Matrix4.IDENTITY);t=Cartesian3.clone(a.position,scratchOrthoOrigin);Cartesian3.multiplyByScalar(a.right,s,scratchOrthoDirection),Cartesian3.add(scratchOrthoDirection,t,t),Cartesian3.multiplyByScalar(a.up,l,scratchOrthoDirection),Cartesian3.add(scratchOrthoDirection,t,t),a._setTransform(c),e.mode===SceneMode$1.SCENE2D&&Cartesian3.fromElements(t.z,t.x,t.y,t);e=o.getPixelDimensions(n.width,n.height,1,1,scratchOrthoPixelSize),n=scratchOrthoPickingFrustum;return n.right=.5*e.x,n.left=-n.right,n.top=.5*e.y,n.bottom=-n.top,n.near=o.near,n.far=o.far,n.computeCullingVolume(t,a.directionWC,a.upWC)}var scratchPerspPickingFrustum=new PerspectiveOffCenterFrustum,scratchPerspPixelSize=new Cartesian2;function getPickPerspectiveCullingVolume(e,t,i,r,n){var a=e.camera,o=a.frustum,s=o.near,l=Math.tan(.5*o.fovy),e=o.aspectRatio*l,e=(2*(t.x-n.x)/n.width-1)*s*e,l=(2*(n.height-t.y-n.y)/n.height-1)*s*l,n=o.getPixelDimensions(n.width,n.height,1,1,scratchPerspPixelSize),i=n.x*i*.5,n=n.y*r*.5,r=scratchPerspPickingFrustum;return r.top=l+n,r.bottom=l-n,r.right=e+i,r.left=e-i,r.near=s,r.far=o.far,r.computeCullingVolume(a.positionWC,a.directionWC,a.upWC)}function getPickCullingVolume(e,t,i,r,n){var a=e.camera.frustum;return(a instanceof OrthographicFrustum||a instanceof OrthographicOffCenterFrustum?getPickOrthographicCullingVolume:getPickPerspectiveCullingVolume)(e,t,i,r,n)}var scratchRectangleWidth=3,scratchRectangleHeight=3,scratchRectangle$7=new BoundingRectangle(0,0,scratchRectangleWidth,scratchRectangleHeight),scratchPosition$b=new Cartesian2,scratchColorZero=new Color(0,0,0,0);function renderTranslucentDepthForPick(e,t){var i=e.context,r=e.frameState,n=e.environmentState,a=e.defaultView,o=(e.view=a).viewport;o.x=0,o.y=0,o.width=i.drawingBufferWidth,o.height=i.drawingBufferHeight;var s=a.passState;s.viewport=BoundingRectangle.clone(o,s.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=getPickCullingVolume(e,t,1,1,o),r.tilesetPassState=pickTilesetPassState,e.updateEnvironment(),n.renderTranslucentDepthForPick=!0,s=a.pickDepthFramebuffer.update(i,t,o),e.updateAndExecuteCommands(s,scratchColorZero),e.resolveFramebuffers(s),i.endFrame()}Picking.prototype.pick=function(e,t,i,r){scratchRectangleWidth=defaultValue(i,3),scratchRectangleHeight=defaultValue(r,scratchRectangleWidth);var n=e.context,a=n.uniformState,o=e.frameState,s=e.defaultView,i=(e.view=s).viewport;i.x=0,i.y=0,i.width=n.drawingBufferWidth,i.height=n.drawingBufferHeight;r=s.passState;r.viewport=BoundingRectangle.clone(i,r.viewport);t=SceneTransforms.transformWindowToDrawingBuffer(e,t,scratchPosition$b);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=getPickCullingVolume(e,t,scratchRectangleWidth,scratchRectangleHeight,i),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=pickTilesetPassState,a.update(o),e.updateEnvironment(),scratchRectangle$7.x=t.x-.5*(scratchRectangleWidth-1),scratchRectangle$7.y=e.drawingBufferHeight-t.y-.5*(scratchRectangleHeight-1),scratchRectangle$7.width=scratchRectangleWidth,scratchRectangle$7.height=scratchRectangleHeight,r=s.pickFramebuffer.begin(scratchRectangle$7,s.viewport),e.updateAndExecuteCommands(r,scratchColorZero),e.resolveFramebuffers(r);s=s.pickFramebuffer.end(scratchRectangle$7);return n.endFrame(),s};var scratchPerspectiveFrustum=new PerspectiveFrustum,scratchPerspectiveOffCenterFrustum=new PerspectiveOffCenterFrustum,scratchOrthographicFrustum=new OrthographicFrustum,scratchOrthographicOffCenterFrustum=new OrthographicOffCenterFrustum;Picking.prototype.pickPositionWorldCoordinates=function(e,t,i){if(e.useDepthPicking){var r=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(r))return Cartesian3.clone(this._pickPositionCache[r],i);var n=e.frameState,a=e.context,o=a.uniformState,s=e.defaultView;e.view=s;var l=SceneTransforms.transformWindowToDrawingBuffer(e,t,scratchPosition$b);e.pickTranslucentDepth?renderTranslucentDepthForPick(e,l):(e.updateFrameState(),o.update(n),e.updateEnvironment()),l.y=e.drawingBufferHeight-l.y;for(var c=e.camera,u=defined(c.frustum.fov)?c.frustum.clone(scratchPerspectiveFrustum):defined(c.frustum.infiniteProjectionMatrix)?c.frustum.clone(scratchPerspectiveOffCenterFrustum):defined(c.frustum.width)?c.frustum.clone(scratchOrthographicFrustum):c.frustum.clone(scratchOrthographicOffCenterFrustum),d=s.frustumCommandsList,h=d.length,p=0;p<h;++p){var m=this.getPickDepth(e,p).getDepth(a,l.x,l.y);if(defined(m)&&(0<m&&m<1)){var f,g=d[p];return e.mode===SceneMode$1.SCENE2D?(f=c.position.z,c.position.z=f-g.near+1,u.far=Math.max(1,g.far-g.near),u.near=1,o.update(n)):(u.near=g.near*(0!==p?e.opaqueFrustumNearOffset:1),u.far=g.far),o.updateFrustum(u),i=SceneTransforms.drawingBufferToWgs84Coordinates(e,l,m,i),e.mode===SceneMode$1.SCENE2D&&(c.position.z=f,o.update(n)),this._pickPositionCache[r]=Cartesian3.clone(i),i}}this._pickPositionCache[r]=void 0}};var scratchPickPositionCartographic=new Cartographic;function drillPick(e,t){var i,r,n=[],a=[],o=[],s=[];defined(e)||(e=Number.MAX_VALUE);for(var l=t();defined(l);){var c=l.object,u=l.position,d=l.exclude;if(defined(u)&&!defined(c)){n.push(l);break}if(!defined(c)||!defined(c.primitive))break;if(!d&&(n.push(l),--e<=0))break;u=c.primitive,d=!1;"function"==typeof u.getGeometryInstanceAttributes&&defined(c.id)&&defined(r=u.getGeometryInstanceAttributes(c.id))&&defined(r.show)&&(d=!0,r.show=ShowGeometryInstanceAttribute.toValue(!1,r.show),o.push(r)),c instanceof Cesium3DTileFeature&&(d=!0,c.show=!1,s.push(c)),d||(u.show=!1,a.push(u)),l=t()}for(i=0;i<a.length;++i)a[i].show=!0;for(i=0;i<o.length;++i)(r=o[i]).show=ShowGeometryInstanceAttribute.toValue(!0,r.show);for(i=0;i<s.length;++i)s[i].show=!0;return n}Picking.prototype.pickPosition=function(e,t,i){return defined(i=this.pickPositionWorldCoordinates(e,t,i))&&e.mode!==SceneMode$1.SCENE3D&&(Cartesian3.fromElements(i.y,i.z,i.x,i),e=(t=e.mapProjection).ellipsoid,t=t.unproject(i,scratchPickPositionCartographic),e.cartographicToCartesian(t,i)),i},Picking.prototype.drillPick=function(t,i,e,r,n){var a=this;return drillPick(e,function(){var e=a.pick(t,i,r,n);if(defined(e))return{object:e,position:void 0,exclude:!1}}).map(function(e){return e.object})};var scratchRight$3=new Cartesian3,scratchUp$2=new Cartesian3;function MostDetailedRayPick(e,t,i){this.ray=e,this.width=t,this.tilesets=i,this.ready=!1,this.deferred=when.defer(),this.promise=this.deferred.promise}function updateOffscreenCameraFromRay(e,t,i,r){var n=t.direction,a=Cartesian3.mostOrthogonalAxis(n,scratchRight$3),o=Cartesian3.cross(n,a,scratchRight$3),a=Cartesian3.cross(n,o,scratchUp$2);return r.position=t.origin,r.direction=n,r.up=a,r.right=o,r.frustum.width=defaultValue(i,offscreenDefaultWidth),r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function updateMostDetailedRayPick(e,t,i){var r=t.frameState,n=i.ray,a=i.width,o=i.tilesets,s=e._pickOffscreenView.camera,a=updateOffscreenCameraFromRay(e,n,a,s),l=mostDetailedPreloadTilesetPassState;l.camera=s,l.cullingVolume=a;for(var c=!0,u=o.length,d=0;d<u;++d){var h=o[d];h.show&&t.primitives.contains(h)&&(h.updateForPass(r,l),c=c&&l.ready)}return c&&i.deferred.resolve(),c}function getTilesets(e,t,i){for(var r=e.length,n=0;n<r;++n){var a=e.get(n);a.show&&(defined(a.isCesium3DTileset)?defined(t)&&-1!==t.indexOf(a)||i.push(a):a instanceof PrimitiveCollection&&getTilesets(a,t,i))}}function launchMostDetailedRayPick(e,t,i,r,n,a){var o=[];if(getTilesets(t.primitives,r,o),0===o.length)return when.resolve(a());o=new MostDetailedRayPick(i,n,o);return e._mostDetailedRayPicks.push(o),o.promise.then(function(){return a()})}function isExcluded(e,t){return!(!defined(e)||!defined(t)||0===t.length)&&(-1<t.indexOf(e)||-1<t.indexOf(e.primitive)||-1<t.indexOf(e.id))}function getRayIntersection(e,t,i,r,n,a,o){var s=t.context,l=s.uniformState,c=t.frameState,u=e._pickOffscreenView;updateOffscreenCameraFromRay(e,i,n,(t.view=u).camera),scratchRectangle$7=BoundingRectangle.clone(u.viewport,scratchRectangle$7);n=u.pickFramebuffer.begin(scratchRectangle$7,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,c.tilesetPassState=o?mostDetailedPickTilesetPassState:pickTilesetPassState,l.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(n,scratchColorZero),t.resolveFramebuffers(n);n=u.pickFramebuffer.end(s);if(t.context.depthTexture)for(var d=u.frustumCommandsList.length,h=0;h<d;++h){var p=e.getPickDepth(t,h).getDepth(s,0,0);if(defined(p)&&(0<p&&p<1)){var m=u.frustumCommandsList[h],f=m.near*(0!==h?t.opaqueFrustumNearOffset:1),f=f+p*(m.far-f),g=Ray.getPoint(i,f);break}}if(t.view=t.defaultView,s.endFrame(),defined(n)||defined(g))return{object:n,position:g,exclude:!defined(g)&&a||isExcluded(n,r)}}function getRayIntersections(e,t,i,r,n,a,o,s){return drillPick(r,function(){return getRayIntersection(e,t,i,n,a,o,s)})}function pickFromRay(e,t,i,r,n,a,o){o=getRayIntersections(e,t,i,1,r,n,a,o);if(0<o.length)return o[0]}function drillPickFromRay(e,t,i,r,n,a,o,s){return getRayIntersections(e,t,i,r,n,a,o,s)}function deferPromiseUntilPostRender(i,e){var r=when.defer();return e.then(function(e){var t=i.postRender.addEventListener(function(){r.resolve(e),t()});i.requestRender()}).otherwise(function(e){r.reject(e)}),r.promise}Picking.prototype.updateMostDetailedRayPicks=function(e){for(var t=this._mostDetailedRayPicks,i=0;i<t.length;++i)updateMostDetailedRayPick(this,e,t[i])&&t.splice(i--,1)},Picking.prototype.pickFromRay=function(e,t,i,r){return pickFromRay(this,e,t,i,r,!1,!1)},Picking.prototype.drillPickFromRay=function(e,t,i,r,n){return drillPickFromRay(this,e,t,i,r,n,!1,!1)},Picking.prototype.pickFromRayMostDetailed=function(e,t,i,r){var n=this;return t=Ray.clone(t),i=defined(i)?i.slice():i,deferPromiseUntilPostRender(e,launchMostDetailedRayPick(n,e,t,i,r,function(){return pickFromRay(n,e,t,i,r,!1,!0)}))},Picking.prototype.drillPickFromRayMostDetailed=function(e,t,i,r,n){var a=this;return t=Ray.clone(t),r=defined(r)?r.slice():r,deferPromiseUntilPostRender(e,launchMostDetailedRayPick(a,e,t,r,n,function(){return drillPickFromRay(a,e,t,i,r,n,!1,!0)}))};var scratchSurfacePosition=new Cartesian3,scratchSurfaceNormal=new Cartesian3,scratchSurfaceRay=new Ray,scratchCartographic$e=new Cartographic;function getRayForSampleHeight(e,t){var i=e.globe,r=(defined(i)?i:e.mapProjection).ellipsoid,i=ApproximateTerrainHeights._defaultMaxTerrainHeight,e=r.geodeticSurfaceNormalCartographic(t,scratchSurfaceNormal),t=Cartographic.toCartesian(t,r,scratchSurfacePosition),r=scratchSurfaceRay;r.origin=t,r.direction=e;t=new Ray;return Ray.getPoint(r,i,t.origin),Cartesian3.negate(e,t.direction),t}function getRayForClampToHeight(e,t){var i=e.globe,i=(defined(i)?i:e.mapProjection).ellipsoid;return getRayForSampleHeight(e,Cartographic.fromCartesian(t,i,scratchCartographic$e))}function getHeightFromCartesian(e,t){var i=e.globe,e=(defined(i)?i:e.mapProjection).ellipsoid;return Cartographic.fromCartesian(t,e,scratchCartographic$e).height}function sampleHeightMostDetailed(t,i,e,r,n){var a=getRayForSampleHeight(i,e);return launchMostDetailedRayPick(t,i,a,r,n,function(){var e=pickFromRay(t,i,a,r,n,!0,!0);if(defined(e))return getHeightFromCartesian(i,e.position)})}function clampToHeightMostDetailed(t,i,e,r,n,a){var o=getRayForClampToHeight(i,e);return launchMostDetailedRayPick(t,i,o,r,n,function(){var e=pickFromRay(t,i,o,r,n,!0,!0);if(defined(e))return Cartesian3.clone(e.position,a)})}Picking.prototype.sampleHeight=function(e,t,i,r){r=pickFromRay(this,e,getRayForSampleHeight(e,t),i,r,!0,!1);if(defined(r))return getHeightFromCartesian(e,r.position)},Picking.prototype.clampToHeight=function(e,t,i,r,n){r=pickFromRay(this,e,getRayForClampToHeight(e,t),i,r,!0,!1);if(defined(r))return Cartesian3.clone(r.position,n)},Picking.prototype.sampleHeightMostDetailed=function(e,r,t,i){t=defined(t)?t.slice():t;for(var n=r.length,a=new Array(n),o=0;o<n;++o)a[o]=sampleHeightMostDetailed(this,e,r[o],t,i);return deferPromiseUntilPostRender(e,when.all(a).then(function(e){for(var t=e.length,i=0;i<t;++i)r[i].height=e[i];return r}))},Picking.prototype.clampToHeightMostDetailed=function(e,r,t,i){t=defined(t)?t.slice():t;for(var n=r.length,a=new Array(n),o=0;o<n;++o)a[o]=clampToHeightMostDetailed(this,e,r[o],t,i,r[o]);return deferPromiseUntilPostRender(e,when.all(a).then(function(e){for(var t=e.length,i=0;i<t;++i)r[i]=e[i];return r}))},Picking.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var PostProcessStageSampleMode={NEAREST:0,LINEAR:1};function PostProcessStage(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).fragmentShader,i=defaultValue(e.textureScale,1),r=defaultValue(e.pixelFormat,PixelFormat$1.RGBA);this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=i,this._forcePowerOfTwo=defaultValue(e.forcePowerOfTwo,!1),this._sampleMode=defaultValue(e.sampleMode,PostProcessStageSampleMode.NEAREST),this._pixelFormat=r,this._pixelDatatype=defaultValue(e.pixelDatatype,PixelDatatype$1.UNSIGNED_BYTE),this._clearColor=defaultValue(e.clearColor,Color.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;r=new PassState;r.scissorTest={enabled:!0,rectangle:defined(e.scissorRectangle)?BoundingRectangle.clone(e.scissorRectangle):new BoundingRectangle},this._passState=r,this._ready=!1;e=e.name;defined(e)||(e=createGuid()),this._name=e,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(PostProcessStage.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(defined(this._textureCache)){var e=this._textureCache.getFramebuffer(this._name);if(defined(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var depthTextureRegex=/uniform\s+sampler2D\s+depthTexture/g;function getUniformValueGetterAndSetter(n,a,o){var e=a[o];return("string"==typeof e||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData)&&n._dirtyUniforms.push(o),{get:function(){return a[o]},set:function(e){var t=a[o];a[o]=e;var i=n._actualUniforms,r=i[o];defined(r)&&r!==t&&r instanceof Texture&&!defined(n._textureCache.getStageByName(o))&&(n._texturesToRelease.push(r),delete i[o],delete i[o+"Dimensions"]),t instanceof Texture&&n._texturesToRelease.push(t),"string"==typeof e||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData?n._dirtyUniforms.push(o):i[o]=e}}}function getUniformMapFunction(t,i){return function(){var e=t._actualUniforms[i];return"function"==typeof e?e():e}}function getUniformMapDimensionsFunction(t,i){return function(){var e=t[i]();if(defined(e))return e.dimensions}}function createUniformMap$5(e){if(!defined(e._uniformMap)){var t,i,r={},n={},a=e._uniforms,o=e._actualUniforms;for(t in a)a.hasOwnProperty(t)&&("function"!=typeof a[t]?(r[t]=getUniformMapFunction(e,t),n[t]=getUniformValueGetterAndSetter(e,a,t)):(r[t]=a[t],n[t]=a[t]),o[t]=a[t],("string"==typeof(i=r[t]())||i instanceof Texture||i instanceof HTMLImageElement||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement)&&(r[t+"Dimensions"]=getUniformMapDimensionsFunction(r,t)));e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=combine(r,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}}function createDrawCommand(e,t){var i;defined(e._command)&&!e._logDepthChanged&&!e._selectedDirty||(i=e._fragmentShader,defined(e._selectedIdTexture)&&(i="#define CZM_SELECTED_FEATURE \nuniform sampler2D czm_idTexture; \nuniform sampler2D czm_selectedIdTexture; \nuniform float czm_selectedIdTextureStep; \nvarying vec2 v_textureCoordinates; \nbool czm_selected(vec2 offset) \n{ \n bool selected = false;\n vec4 id = texture2D(czm_idTexture, v_textureCoordinates + offset); \n for (int i = 0; i < "+e._selectedIdTexture.width+"; ++i) \n { \n vec4 selectedId = texture2D(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); \n if (all(equal(id, selectedId))) \n { \n return true; \n } \n } \n return false; \n} \n\nbool czm_selected() \n{ \n return czm_selected(vec2(0.0)); \n} \n\n"+(i=i.replace(/varying\s+vec2\s+v_textureCoordinates;/g,""))),i=new ShaderSource({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[i]}),e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e}))}function createSampler(e){var t,i=e._sampleMode===PostProcessStageSampleMode.LINEAR?(t=TextureMinificationFilter$1.LINEAR,TextureMagnificationFilter$1.LINEAR):(t=TextureMinificationFilter$1.NEAREST,TextureMagnificationFilter$1.NEAREST),r=e._sampler;defined(r)&&r.minificationFilter===t&&r.magnificationFilter===i||(e._sampler=new Sampler({wrapS:TextureWrap$1.CLAMP_TO_EDGE,wrapT:TextureWrap$1.CLAMP_TO_EDGE,minificationFilter:t,magnificationFilter:i}))}function createLoadImageFunction(t,i){return function(e){t._texturesToCreate.push({name:i,source:e})}}function createStageOutputTextureFunction(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function updateUniformTextures(e,t){var i,r=e._texturesToRelease,n=r.length;for(d=0;d<n;++d)i=(i=r[d])&&i.destroy();r.length=0;var a=e._texturesToCreate,n=a.length;for(d=0;d<n;++d){var o=a[d],s=o.name,o=o.source;e._actualUniforms[s]=new Texture({context:t,source:o})}a.length=0;var l=e._dirtyUniforms;if(0!==l.length||defined(e._texturePromise)){if(0!==l.length&&!defined(e._texturePromise)){n=l.length;for(var c=e._uniforms,u=[],d=0;d<n;++d){var h,p=c[s=l[d]];defined(e._textureCache.getStageByName(p))?e._actualUniforms[s]=createStageOutputTextureFunction(e,p):"string"==typeof p?(h=new Resource({url:p}),u.push(h.fetchImage().then(createLoadImageFunction(e,s)))):e._texturesToCreate.push({name:s,source:p})}(l.length=0)<u.length?(e._ready=!1,e._texturePromise=when.all(u).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}}else e._ready=!0}function releaseResources(e){defined(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();var t=e._textureCache;if(defined(t)){var i,r=e._uniforms,n=e._actualUniforms;for(i in n)n.hasOwnProperty(i)&&n[i]instanceof Texture&&(defined(t.getStageByName(r[i]))||n[i].destroy(),e._dirtyUniforms.push(i))}}function isSelectedTextureDirty(e){var t=defined(e._selected)?e._selected.length:0,i=defined(e._parentSelected)?e._parentSelected:0,r=(r=e._selected!==e._selectedShadow||t!==e._selectedLength)||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength;if(defined(e._selected)&&defined(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):defined(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&defined(e._combinedSelected)){if(!defined(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(var n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return r}function createSelectedTexture(e,t){if(e._selectedDirty){e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;var i=e._combinedSelected;if(defined(i)){for(var r,n,a=0,o=i.length,s=0;s<o;++s)defined((r=i[s]).pickIds)?a+=r.pickIds.length:defined(r.pickId)&&++a;if(0===o||0===a){var l=new Uint8Array(4);return l[0]=255,l[1]=255,l[2]=255,l[3]=255,void(e._selectedIdTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:l,width:1,height:1},sampler:Sampler.NEAREST}))}var c=0,u=new Uint8Array(4*a);for(s=0;s<o;++s)if(defined((r=i[s]).pickIds))for(var d=r.pickIds,h=d.length,p=0;p<h;++p)n=d[p].color,u[c]=Color.floatToByte(n.red),u[c+1]=Color.floatToByte(n.green),u[c+2]=Color.floatToByte(n.blue),u[c+3]=Color.floatToByte(n.alpha),c+=4;else defined(r.pickId)&&(n=r.pickId.color,u[c]=Color.floatToByte(n.red),u[c+1]=Color.floatToByte(n.green),u[c+2]=Color.floatToByte(n.blue),u[c+3]=Color.floatToByte(n.alpha),c+=4);e._selectedIdTexture=new Texture({context:t,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:u,width:a,height:1},sampler:Sampler.NEAREST})}}}PostProcessStage.prototype._isSupported=function(e){return!depthTextureRegex.test(this._fragmentShader)||e.depthTexture},PostProcessStage.prototype.update=function(e,t){var i;this.enabled===this._enabled||this.enabled||releaseResources(this),this._enabled=this.enabled,this._enabled&&(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=isSelectedTextureDirty(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=defined(this._selected)?this._selected.length:0,this._parentSelectedLength=defined(this._parentSelected)?this._parentSelected.length:0,createSelectedTexture(this,e),createUniformMap$5(this),updateUniformTextures(this,e),createDrawCommand(this,e),createSampler(this),this._selectedDirty=!1,this._ready&&(t=this._textureCache.getFramebuffer(this._name),defined(this._command.framebuffer=t)&&((t=t.getColorTexture(0)).width===e.drawingBufferWidth&&t.height===e.drawingBufferHeight||defined(i=this._renderState)&&t.width===i.viewport.width&&t.height===i.viewport.height||(this._renderState=RenderState.fromCache({viewport:new BoundingRectangle(0,0,t.width,t.height)})),this._command.renderState=i)))},PostProcessStage.prototype.execute=function(e,t,i,r){defined(this._command)&&defined(this._command.framebuffer)&&this._ready&&this._enabled&&(this._colorTexture=t,this._depthTexture=i,this._idTexture=r,Sampler.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler),defined(r=0<this.scissorRectangle.width&&0<this.scissorRectangle.height?this._passState:void 0)&&(r.context=e),this._command.execute(e,r))},PostProcessStage.prototype.isDestroyed=function(){return!1},PostProcessStage.prototype.destroy=function(){return releaseResources(this),destroyObject(this)};var AcesTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\ncolor /= texture2D(autoExposure, vec2(0.5)).r;\n#endif\ncolor = czm_acesTonemapping(color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",AmbientOcclusionGenerate="uniform sampler2D randomTexture;\nuniform sampler2D depthTexture;\nuniform float intensity;\nuniform float bias;\nuniform float lengthCap;\nuniform float stepSize;\nuniform float frustumLength;\nvarying vec2 v_textureCoordinates;\nvec4 clipToEye(vec2 uv, float depth)\n{\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\nvec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);\nposEC = posEC / posEC.w;\nreturn posEC;\n}\nvec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize)\n{\nvec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU);\nvec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD);\nvec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL);\nvec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR);\nvec3 up = posInCamera.xyz - posInCameraUp.xyz;\nvec3 down = posInCameraDown.xyz - posInCamera.xyz;\nvec3 left = posInCamera.xyz - posInCameraLeft.xyz;\nvec3 right = posInCameraRight.xyz - posInCamera.xyz;\nvec3 DX = length(left) < length(right) ? left : right;\nvec3 DY = length(up) < length(down) ? up : down;\nreturn normalize(cross(DY, DX));\n}\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nvec4 posInCamera = clipToEye(v_textureCoordinates, depth);\nif (posInCamera.z > frustumLength)\n{\ngl_FragColor = vec4(1.0);\nreturn;\n}\nvec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\nfloat depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y));\nfloat depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y));\nfloat depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0));\nfloat depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0));\nvec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize);\nfloat ao = 0.0;\nvec2 sampleDirection = vec2(1.0, 0.0);\nfloat gapAngle = 90.0 * czm_radiansPerDegree;\nfloat randomVal = texture2D(randomTexture, v_textureCoordinates).x;\nfor (int i = 0; i < 4; i++)\n{\nfloat newGapAngle = gapAngle * (float(i) + randomVal);\nfloat cosVal = cos(newGapAngle);\nfloat sinVal = sin(newGapAngle);\nvec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\nfloat localAO = 0.0;\nfloat localStepSize = stepSize;\nfor (int j = 0; j < 6; j++)\n{\nvec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize;\nif(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0)\n{\nbreak;\n}\nfloat stepDepthInfo = czm_readDepth(depthTexture, newCoords);\nvec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo);\nvec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz;\nfloat len = length(diffVec);\nif (len > lengthCap)\n{\nbreak;\n}\nfloat dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 );\nfloat weight = len / lengthCap;\nweight = 1.0 - weight * weight;\nif (dotVal < bias)\n{\ndotVal = 0.0;\n}\nlocalAO = max(localAO, dotVal * weight);\nlocalStepSize += stepSize;\n}\nao += localAO;\n}\nao /= 4.0;\nao = 1.0 - clamp(ao, 0.0, 1.0);\nao = pow(ao, intensity);\ngl_FragColor = vec4(vec3(ao), 1.0);\n}\n",AmbientOcclusionModulate="uniform sampler2D colorTexture;\nuniform sampler2D ambientOcclusionTexture;\nuniform bool ambientOcclusionOnly;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 color = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 ao = texture2D(ambientOcclusionTexture, v_textureCoordinates).rgb;\ngl_FragColor.rgb = ambientOcclusionOnly ? ao : ao * color;\n}\n",BlackAndWhite="uniform sampler2D colorTexture;\nuniform float gradations;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\n#ifdef CZM_SELECTED_FEATURE\nif (czm_selected()) {\ngl_FragColor = vec4(rgb, 1.0);\nreturn;\n}\n#endif\nfloat luminance = czm_luminance(rgb);\nfloat darkness = luminance * gradations;\ndarkness = (darkness - fract(darkness)) / gradations;\ngl_FragColor = vec4(vec3(darkness), 1.0);\n}\n",BloomComposite="uniform sampler2D colorTexture;\nuniform sampler2D bloomTexture;\nuniform bool glowOnly;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\n#ifdef CZM_SELECTED_FEATURE\nif (czm_selected()) {\ngl_FragColor = color;\nreturn;\n}\n#endif\nvec4 bloom = texture2D(bloomTexture, v_textureCoordinates);\ngl_FragColor = glowOnly ? bloom : bloom + color;\n}\n",Brightness="uniform sampler2D colorTexture;\nuniform float brightness;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 target = vec3(0.0);\ngl_FragColor = vec4(mix(target, rgb, brightness), 1.0);\n}\n",ContrastBias="uniform sampler2D colorTexture;\nuniform float contrast;\nuniform float brightness;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec3 sceneColor = texture2D(colorTexture, v_textureCoordinates).xyz;\nsceneColor = czm_RGBToHSB(sceneColor);\nsceneColor.z += brightness;\nsceneColor = czm_HSBToRGB(sceneColor);\nfloat factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));\nsceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);\ngl_FragColor = vec4(sceneColor, 1.0);\n}\n",DepthOfField="uniform sampler2D colorTexture;\nuniform sampler2D blurTexture;\nuniform sampler2D depthTexture;\nuniform float focalDistance;\nvarying vec2 v_textureCoordinates;\nvec4 toEye(vec2 uv, float depth)\n{\nvec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));\nvec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\nposInCamera = posInCamera / posInCamera.w;\nreturn posInCamera;\n}\nfloat computeDepthBlur(float depth)\n{\nfloat f;\nif (depth < focalDistance)\n{\nf = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);\n}\nelse\n{\nf = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);\nf = pow(f, 0.1);\n}\nf *= f;\nf = clamp(f, 0.0, 1.0);\nreturn pow(f, 0.5);\n}\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\nvec4 posInCamera = toEye(v_textureCoordinates, depth);\nfloat d = computeDepthBlur(-posInCamera.z);\ngl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), texture2D(blurTexture, v_textureCoordinates), d);\n}\n",DepthView="uniform sampler2D depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nfloat depth = czm_readDepth(depthTexture, v_textureCoordinates);\ngl_FragColor = vec4(vec3(depth), 1.0);\n}\n",EdgeDetection="uniform sampler2D depthTexture;\nuniform float length;\nuniform vec4 color;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nfloat directions[3];\ndirections[0] = -1.0;\ndirections[1] = 0.0;\ndirections[2] = 1.0;\nfloat scalars[3];\nscalars[0] = 3.0;\nscalars[1] = 10.0;\nscalars[2] = 3.0;\nfloat padx = czm_pixelRatio / czm_viewport.z;\nfloat pady = czm_pixelRatio / czm_viewport.w;\n#ifdef CZM_SELECTED_FEATURE\nbool selected = false;\nfor (int i = 0; i < 3; ++i)\n{\nfloat dir = directions[i];\nselected = selected || czm_selected(vec2(-padx, dir * pady));\nselected = selected || czm_selected(vec2(padx, dir * pady));\nselected = selected || czm_selected(vec2(dir * padx, -pady));\nselected = selected || czm_selected(vec2(dir * padx, pady));\nif (selected)\n{\nbreak;\n}\n}\nif (!selected)\n{\ngl_FragColor = vec4(color.rgb, 0.0);\nreturn;\n}\n#endif\nfloat horizEdge = 0.0;\nfloat vertEdge = 0.0;\nfor (int i = 0; i < 3; ++i)\n{\nfloat dir = directions[i];\nfloat scale = scalars[i];\nhorizEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;\nhorizEdge += texture2D(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;\nvertEdge -= texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;\nvertEdge += texture2D(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;\n}\nfloat len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);\ngl_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);\n}\n",FilmicTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\nconst float A = 0.22;\nconst float B = 0.30;\nconst float C = 0.10;\nconst float D = 0.20;\nconst float E = 0.01;\nconst float F = 0.30;\nconst float white = 11.2;\nvec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;\nfloat w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;\nc = czm_inverseGamma(c / w);\ngl_FragColor = vec4(c, fragmentColor.a);\n}\n",FXAA="varying vec2 v_textureCoordinates;\nuniform sampler2D colorTexture;\nconst float fxaaQualitySubpix = 0.5;\nconst float fxaaQualityEdgeThreshold = 0.125;\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\nvoid main()\n{\nvec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;\nvec4 color = FxaaPixelShader(\nv_textureCoordinates,\ncolorTexture,\nfxaaQualityRcpFrame,\nfxaaQualitySubpix,\nfxaaQualityEdgeThreshold,\nfxaaQualityEdgeThresholdMin);\nfloat alpha = texture2D(colorTexture, v_textureCoordinates).a;\ngl_FragColor = vec4(color.rgb, alpha);\n}\n",GaussianBlur1D="#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D colorTexture;\n#ifdef USE_STEP_SIZE\nuniform float stepSize;\n#else\nuniform vec2 step;\n#endif\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\n#ifdef USE_STEP_SIZE\nvec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));\n#else\nvec2 step = step;\n#endif\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(colorTexture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * step;\nresult += texture2D(colorTexture, st - offset) * g.x;\nresult += texture2D(colorTexture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n",LensFlare="uniform sampler2D colorTexture;\nuniform sampler2D dirtTexture;\nuniform sampler2D starTexture;\nuniform vec2 dirtTextureDimensions;\nuniform float distortion;\nuniform float ghostDispersal;\nuniform float haloWidth;\nuniform float dirtAmount;\nuniform float earthRadius;\nuniform float intensity;\nvarying vec2 v_textureCoordinates;\n#define DISTANCE_TO_SPACE 6500000.0\nvec4 getNDCFromWC(vec3 WC, float earthRadius)\n{\nvec4 positionEC = czm_view * vec4(WC, 1.0);\npositionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nreturn czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\n}\nfloat isInEarth(vec2 texcoord, vec2 sceneSize)\n{\nvec2 NDC = texcoord * 2.0 - 1.0;\nvec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);\nvec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);\nNDC.xy -= earthPosSC.xy;\nfloat X = abs(NDC.x) * sceneSize.x;\nfloat Y = abs(NDC.y) * sceneSize.y;\nreturn clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));\n}\nvec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)\n{\nvec2 sceneSize = czm_viewport.zw;\nvec3 color;\nif(isSpace)\n{\ncolor.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture2D(tex, texcoord + direction * distortion.r).r;\ncolor.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture2D(tex, texcoord + direction * distortion.g).g;\ncolor.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture2D(tex, texcoord + direction * distortion.b).b;\n}\nelse\n{\ncolor.r = texture2D(tex, texcoord + direction * distortion.r).r;\ncolor.g = texture2D(tex, texcoord + direction * distortion.g).g;\ncolor.b = texture2D(tex, texcoord + direction * distortion.b).b;\n}\nreturn vec4(clamp(color, 0.0, 1.0), 0.0);\n}\nvoid main(void)\n{\nvec4 originalColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 rgb = originalColor.rgb;\nbool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;\nvec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);\nvec4 sunPositionEC = czm_view * sunPos;\nvec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);\nsunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);\nif(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))\n{\ngl_FragColor = originalColor;\nreturn;\n}\nvec2 texcoord = vec2(1.0) - v_textureCoordinates;\nvec2 pixelSize = czm_pixelRatio / czm_viewport.zw;\nvec2 invPixelSize = 1.0 / pixelSize;\nvec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);\nvec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;\nvec3 direction = normalize(vec3(ghostVec, 0.0));\nvec4 result = vec4(0.0);\nvec4 ghost = vec4(0.0);\nfor (int i = 0; i < 4; ++i)\n{\nvec2 offset = fract(texcoord + ghostVec * float(i));\nghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);\n}\nresult += ghost;\nvec2 haloVec = normalize(ghostVec) * haloWidth;\nfloat weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\nweightForHalo = pow(1.0 - weightForHalo, 5.0);\nresult += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;\nvec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;\nif (dirtTexCoords.x > 1.0)\n{\ndirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);\n}\nif (dirtTexCoords.y > 1.0)\n{\ndirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);\n}\nresult += dirtAmount * texture2D(dirtTexture, dirtTexCoords);\nfloat camrot = czm_view[0].z + czm_view[1].y;\nfloat cosValue = cos(camrot);\nfloat sinValue = sin(camrot);\nmat3 rotation = mat3(\ncosValue, -sinValue, 0.0,\nsinValue, cosValue, 0.0,\n0.0, 0.0, 1.0\n);\nvec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);\nvec3 st2 = vec3((rotation * st1).xy, 1.0);\nvec3 st3 = st2 * 0.5 + vec3(0.5);\nvec2 lensStarTexcoord = st3.xy;\nfloat weightForLensFlare = length(vec3(sunPos.xy, 0.0));\nfloat oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);\nif (!isSpace)\n{\nresult *= oneMinusWeightForLensFlare * intensity * 0.2;\n}\nelse\n{\nresult *= oneMinusWeightForLensFlare * intensity;\nresult *= texture2D(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;\n}\nresult += texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = result;\n}\n",ModifiedReinhardTonemapping="uniform sampler2D colorTexture;\nuniform vec3 white;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\ncolor = (color * (1.0 + color / white)) / (1.0 + color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",NightVision="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\nfloat rand(vec2 co)\n{\nreturn fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);\n}\nvoid main(void)\n{\nfloat noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;\nvec3 rgb = texture2D(colorTexture, v_textureCoordinates).rgb;\nvec3 green = vec3(0.0, 1.0, 0.0);\ngl_FragColor = vec4((noiseValue + rgb) * green, 1.0);\n}\n",ReinhardTonemapping="uniform sampler2D colorTexture;\nvarying vec2 v_textureCoordinates;\n#ifdef AUTO_EXPOSURE\nuniform sampler2D autoExposure;\n#endif\nvoid main()\n{\nvec4 fragmentColor = texture2D(colorTexture, v_textureCoordinates);\nvec3 color = fragmentColor.rgb;\n#ifdef AUTO_EXPOSURE\nfloat exposure = texture2D(autoExposure, vec2(0.5)).r;\ncolor /= exposure;\n#endif\ncolor = color / (1.0 + color);\ncolor = czm_inverseGamma(color);\ngl_FragColor = vec4(color, fragmentColor.a);\n}\n",Silhouette="uniform sampler2D colorTexture;\nuniform sampler2D silhouetteTexture;\nvarying vec2 v_textureCoordinates;\nvoid main(void)\n{\nvec4 silhouetteColor = texture2D(silhouetteTexture, v_textureCoordinates);\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\ngl_FragColor = mix(color, silhouetteColor, silhouetteColor.a);\n}\n",FXAA3_11="#if (FXAA_QUALITY_PRESET == 10)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 3.0\n#define FXAA_QUALITY_P2 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 11)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 3.0\n#define FXAA_QUALITY_P3 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 12)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 4.0\n#define FXAA_QUALITY_P4 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 13)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 4.0\n#define FXAA_QUALITY_P5 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 14)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 4.0\n#define FXAA_QUALITY_P6 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 15)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 12.0\n#endif\n#if (FXAA_QUALITY_PRESET == 20)\n#define FXAA_QUALITY_PS 3\n#define FXAA_QUALITY_P0 1.5\n#define FXAA_QUALITY_P1 2.0\n#define FXAA_QUALITY_P2 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 21)\n#define FXAA_QUALITY_PS 4\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 22)\n#define FXAA_QUALITY_PS 5\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 23)\n#define FXAA_QUALITY_PS 6\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 24)\n#define FXAA_QUALITY_PS 7\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 3.0\n#define FXAA_QUALITY_P6 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 25)\n#define FXAA_QUALITY_PS 8\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 4.0\n#define FXAA_QUALITY_P7 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 26)\n#define FXAA_QUALITY_PS 9\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 4.0\n#define FXAA_QUALITY_P8 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 27)\n#define FXAA_QUALITY_PS 10\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 4.0\n#define FXAA_QUALITY_P9 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 28)\n#define FXAA_QUALITY_PS 11\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 4.0\n#define FXAA_QUALITY_P10 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 29)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.5\n#define FXAA_QUALITY_P2 2.0\n#define FXAA_QUALITY_P3 2.0\n#define FXAA_QUALITY_P4 2.0\n#define FXAA_QUALITY_P5 2.0\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#if (FXAA_QUALITY_PRESET == 39)\n#define FXAA_QUALITY_PS 12\n#define FXAA_QUALITY_P0 1.0\n#define FXAA_QUALITY_P1 1.0\n#define FXAA_QUALITY_P2 1.0\n#define FXAA_QUALITY_P3 1.0\n#define FXAA_QUALITY_P4 1.0\n#define FXAA_QUALITY_P5 1.5\n#define FXAA_QUALITY_P6 2.0\n#define FXAA_QUALITY_P7 2.0\n#define FXAA_QUALITY_P8 2.0\n#define FXAA_QUALITY_P9 2.0\n#define FXAA_QUALITY_P10 4.0\n#define FXAA_QUALITY_P11 8.0\n#endif\n#define FxaaBool bool\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 vec2\n#define FxaaTex sampler2D\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTexTop(t, p) texture2D(t, p)\n#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r))\nFxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\nFxaaFloat4 FxaaPixelShader(\nFxaaFloat2 pos,\nFxaaTex tex,\nFxaaFloat2 fxaaQualityRcpFrame,\nFxaaFloat fxaaQualitySubpix,\nFxaaFloat fxaaQualityEdgeThreshold,\nFxaaFloat fxaaQualityEdgeThresholdMin\n) {\nFxaaFloat2 posM;\nposM.x = pos.x;\nposM.y = pos.y;\nFxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n#define lumaM rgbyM.y\nFxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\nFxaaFloat maxSM = max(lumaS, lumaM);\nFxaaFloat minSM = min(lumaS, lumaM);\nFxaaFloat maxESM = max(lumaE, maxSM);\nFxaaFloat minESM = min(lumaE, minSM);\nFxaaFloat maxWN = max(lumaN, lumaW);\nFxaaFloat minWN = min(lumaN, lumaW);\nFxaaFloat rangeMax = max(maxWN, maxESM);\nFxaaFloat rangeMin = min(minWN, minESM);\nFxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\nFxaaFloat range = rangeMax - rangeMin;\nFxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\nFxaaBool earlyExit = range < rangeMaxClamped;\nif(earlyExit)\nreturn rgbyM;\nFxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\nFxaaFloat lumaNS = lumaN + lumaS;\nFxaaFloat lumaWE = lumaW + lumaE;\nFxaaFloat subpixRcpRange = 1.0/range;\nFxaaFloat subpixNSWE = lumaNS + lumaWE;\nFxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\nFxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\nFxaaFloat lumaNESE = lumaNE + lumaSE;\nFxaaFloat lumaNWNE = lumaNW + lumaNE;\nFxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\nFxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\nFxaaFloat lumaNWSW = lumaNW + lumaSW;\nFxaaFloat lumaSWSE = lumaSW + lumaSE;\nFxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\nFxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\nFxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\nFxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\nFxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\nFxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\nFxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\nFxaaFloat lengthSign = fxaaQualityRcpFrame.x;\nFxaaBool horzSpan = edgeHorz >= edgeVert;\nFxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\nif(!horzSpan) lumaN = lumaW;\nif(!horzSpan) lumaS = lumaE;\nif(horzSpan) lengthSign = fxaaQualityRcpFrame.y;\nFxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;\nFxaaFloat gradientN = lumaN - lumaM;\nFxaaFloat gradientS = lumaS - lumaM;\nFxaaFloat lumaNN = lumaN + lumaM;\nFxaaFloat lumaSS = lumaS + lumaM;\nFxaaBool pairN = abs(gradientN) >= abs(gradientS);\nFxaaFloat gradient = max(abs(gradientN), abs(gradientS));\nif(pairN) lengthSign = -lengthSign;\nFxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\nFxaaFloat2 posB;\nposB.x = posM.x;\nposB.y = posM.y;\nFxaaFloat2 offNP;\noffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\noffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\nif(!horzSpan) posB.x += lengthSign * 0.5;\nif( horzSpan) posB.y += lengthSign * 0.5;\nFxaaFloat2 posN;\nposN.x = posB.x - offNP.x * FXAA_QUALITY_P0;\nposN.y = posB.y - offNP.y * FXAA_QUALITY_P0;\nFxaaFloat2 posP;\nposP.x = posB.x + offNP.x * FXAA_QUALITY_P0;\nposP.y = posB.y + offNP.y * FXAA_QUALITY_P0;\nFxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;\nFxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\nFxaaFloat subpixE = subpixC * subpixC;\nFxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\nif(!pairN) lumaNN = lumaSS;\nFxaaFloat gradientScaled = gradient * 1.0/4.0;\nFxaaFloat lumaMM = lumaM - lumaNN * 0.5;\nFxaaFloat subpixF = subpixD * subpixE;\nFxaaBool lumaMLTZero = lumaMM < 0.0;\nlumaEndN -= lumaNN * 0.5;\nlumaEndP -= lumaNN * 0.5;\nFxaaBool doneN = abs(lumaEndN) >= gradientScaled;\nFxaaBool doneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;\nFxaaBool doneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;\n#if (FXAA_QUALITY_PS > 3)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;\n#if (FXAA_QUALITY_PS > 4)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;\n#if (FXAA_QUALITY_PS > 5)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;\n#if (FXAA_QUALITY_PS > 6)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;\n#if (FXAA_QUALITY_PS > 7)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;\n#if (FXAA_QUALITY_PS > 8)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;\n#if (FXAA_QUALITY_PS > 9)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;\n#if (FXAA_QUALITY_PS > 10)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;\n#if (FXAA_QUALITY_PS > 11)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;\n#if (FXAA_QUALITY_PS > 12)\nif(doneNP) {\nif(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\nif(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\nif(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\nif(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\ndoneN = abs(lumaEndN) >= gradientScaled;\ndoneP = abs(lumaEndP) >= gradientScaled;\nif(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;\nif(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;\ndoneNP = (!doneN) || (!doneP);\nif(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;\nif(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\n#endif\n}\nFxaaFloat dstN = posM.x - posN.x;\nFxaaFloat dstP = posP.x - posM.x;\nif(!horzSpan) dstN = posM.y - posN.y;\nif(!horzSpan) dstP = posP.y - posM.y;\nFxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\nFxaaFloat spanLength = (dstP + dstN);\nFxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\nFxaaFloat spanLengthRcp = 1.0/spanLength;\nFxaaBool directionN = dstN < dstP;\nFxaaFloat dst = min(dstN, dstP);\nFxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\nFxaaFloat subpixG = subpixF * subpixF;\nFxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\nFxaaFloat subpixH = subpixG * fxaaQualitySubpix;\nFxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\nFxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\nif(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\nif( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\nreturn FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n}\n";function PostProcessStageComposite(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=defaultValue(e.inputPreviousStageTexture,!0);var t=e.name;defined(t)||(t=createGuid()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}function isSelectedTextureDirty$1(e){var t=defined(e._selected)?e._selected.length:0,i=defined(e._parentSelected)?e._parentSelected:0,r=(r=e._selected!==e._selectedShadow||t!==e._selectedLength)||e._parentSelected!==e._parentSelectedShadow||i!==e._parentSelectedLength;if(defined(e._selected)&&defined(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):defined(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!r&&defined(e._combinedSelected)){if(!defined(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(var n=0;n<t;++n)if(e._combinedSelected[n]!==e._combinedSelectedShadow[n])return!0}return r}Object.defineProperties(PostProcessStageComposite.prototype,{ready:{get:function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)if(!e[i].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){for(var t=this._stages,i=t.length,r=0;r<i;++r)t[r].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}}),PostProcessStageComposite.prototype._isSupported=function(e){for(var t=this._stages,i=t.length,r=0;r<i;++r)if(!t[r]._isSupported(e))return!1;return!0},PostProcessStageComposite.prototype.get=function(e){return this._stages[e]},PostProcessStageComposite.prototype.update=function(e,t){this._selectedDirty=isSelectedTextureDirty$1(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=defined(this._selected)?this._selected.length:0,this._parentSelectedLength=defined(this._parentSelected)?this._parentSelected.length:0;for(var i=this._stages,r=i.length,n=0;n<r;++n){var a=i[n];this._selectedDirty&&(a.parentSelected=this._combinedSelected),a.update(e,t)}},PostProcessStageComposite.prototype.isDestroyed=function(){return!1},PostProcessStageComposite.prototype.destroy=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)e[i].destroy();return destroyObject(this)};var PostProcessStageLibrary={};function createBlur(e){var t="#define USE_STEP_SIZE\n"+GaussianBlur1D,r=new PostProcessStage({name:e+"_x_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:PostProcessStageSampleMode.LINEAR}),n=new PostProcessStage({name:e+"_y_direction",fragmentShader:t,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:PostProcessStageSampleMode.LINEAR}),t={};return Object.defineProperties(t,{delta:{get:function(){return r.uniforms.delta},set:function(e){var t=r.uniforms,i=n.uniforms;t.delta=i.delta=e}},sigma:{get:function(){return r.uniforms.sigma},set:function(e){var t=r.uniforms,i=n.uniforms;t.sigma=i.sigma=e}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(e){var t=r.uniforms,i=n.uniforms;t.stepSize=i.stepSize=e}}}),new PostProcessStageComposite({name:e,stages:[r,n],uniforms:t})}function getSilhouetteEdgeDetection(e){if(!defined(e))return PostProcessStageLibrary.createEdgeDetectionStage();for(var t=new PostProcessStageComposite({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),i={},r="",n="",a=0;a<e.length;++a)r+="uniform sampler2D edgeTexture"+a+"; \n",n+=" vec4 edge"+a+" = texture2D(edgeTexture"+a+", v_textureCoordinates); \n if (edge"+a+".a > 0.0) \n { \n color = edge"+a+"; \n break; \n } \n",i["edgeTexture"+a]=e[a].name;return new PostProcessStageComposite({name:"czm_edge_detection_composite",stages:[t,new PostProcessStage({name:"czm_edge_detection_combine",fragmentShader:r+"varying vec2 v_textureCoordinates; \nvoid main() { \n vec4 color = vec4(0.0); \n for (int i = 0; i < "+e.length+"; i++) \n { \n"+n+" } \n gl_FragColor = color; \n} \n",uniforms:i})]})}PostProcessStageLibrary.createBlurStage=function(){return createBlur("czm_blur")},PostProcessStageLibrary.createDepthOfFieldStage=function(){var t=createBlur("czm_depth_of_field_blur"),i=new PostProcessStage({name:"czm_depth_of_field_composite",fragmentShader:DepthOfField,uniforms:{focalDistance:5,blurTexture:t.name}}),e={};return Object.defineProperties(e,{focalDistance:{get:function(){return i.uniforms.focalDistance},set:function(e){i.uniforms.focalDistance=e}},delta:{get:function(){return t.uniforms.delta},set:function(e){t.uniforms.delta=e}},sigma:{get:function(){return t.uniforms.sigma},set:function(e){t.uniforms.sigma=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}}}),new PostProcessStageComposite({name:"czm_depth_of_field",stages:[t,i],inputPreviousStageTexture:!1,uniforms:e})},PostProcessStageLibrary.isDepthOfFieldSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createEdgeDetectionStage=function(){return new PostProcessStage({name:"czm_edge_detection_"+createGuid(),fragmentShader:EdgeDetection,uniforms:{length:.25,color:Color.clone(Color.BLACK)}})},PostProcessStageLibrary.isEdgeDetectionSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createSilhouetteStage=function(e){e=getSilhouetteEdgeDetection(e);return new PostProcessStageComposite({name:"czm_silhouette",stages:[e,new PostProcessStage({name:"czm_silhouette_color_edges",fragmentShader:Silhouette,uniforms:{silhouetteTexture:e.name}})],inputPreviousStageTexture:!1,uniforms:e.uniforms})},PostProcessStageLibrary.isSilhouetteSupported=function(e){return e.context.depthTexture},PostProcessStageLibrary.createBloomStage=function(){var t=new PostProcessStage({name:"czm_bloom_contrast_bias",fragmentShader:ContrastBias,uniforms:{contrast:128,brightness:-.3}}),i=createBlur("czm_bloom_blur"),e=new PostProcessStageComposite({name:"czm_bloom_contrast_bias_blur",stages:[t,i]}),r=new PostProcessStage({name:"czm_bloom_generate_composite",fragmentShader:BloomComposite,uniforms:{glowOnly:!1,bloomTexture:e.name}}),n={};return Object.defineProperties(n,{glowOnly:{get:function(){return r.uniforms.glowOnly},set:function(e){r.uniforms.glowOnly=e}},contrast:{get:function(){return t.uniforms.contrast},set:function(e){t.uniforms.contrast=e}},brightness:{get:function(){return t.uniforms.brightness},set:function(e){t.uniforms.brightness=e}},delta:{get:function(){return i.uniforms.delta},set:function(e){i.uniforms.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){i.uniforms.sigma=e}},stepSize:{get:function(){return i.uniforms.stepSize},set:function(e){i.uniforms.stepSize=e}}}),new PostProcessStageComposite({name:"czm_bloom",stages:[e,r],inputPreviousStageTexture:!1,uniforms:n})},PostProcessStageLibrary.createAmbientOcclusionStage=function(){var t=new PostProcessStage({name:"czm_ambient_occlusion_generate",fragmentShader:AmbientOcclusionGenerate,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),i=createBlur("czm_ambient_occlusion_blur");i.uniforms.stepSize=.86;var e=new PostProcessStageComposite({name:"czm_ambient_occlusion_generate_blur",stages:[t,i]}),r=new PostProcessStage({name:"czm_ambient_occlusion_composite",fragmentShader:AmbientOcclusionModulate,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return t.uniforms.intensity},set:function(e){t.uniforms.intensity=e}},bias:{get:function(){return t.uniforms.bias},set:function(e){t.uniforms.bias=e}},lengthCap:{get:function(){return t.uniforms.lengthCap},set:function(e){t.uniforms.lengthCap=e}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(e){t.uniforms.stepSize=e}},frustumLength:{get:function(){return t.uniforms.frustumLength},set:function(e){t.uniforms.frustumLength=e}},randomTexture:{get:function(){return t.uniforms.randomTexture},set:function(e){t.uniforms.randomTexture=e}},delta:{get:function(){return i.uniforms.delta},set:function(e){i.uniforms.delta=e}},sigma:{get:function(){return i.uniforms.sigma},set:function(e){i.uniforms.sigma=e}},blurStepSize:{get:function(){return i.uniforms.stepSize},set:function(e){i.uniforms.stepSize=e}},ambientOcclusionOnly:{get:function(){return r.uniforms.ambientOcclusionOnly},set:function(e){r.uniforms.ambientOcclusionOnly=e}}}),new PostProcessStageComposite({name:"czm_ambient_occlusion",stages:[e,r],inputPreviousStageTexture:!1,uniforms:n})},PostProcessStageLibrary.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var fxaaFS="#define FXAA_QUALITY_PRESET 39 \n"+FXAA3_11+"\n"+FXAA;function PostProcessStageTextureCache(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function getLastStageName(e){for(;defined(e.length);)e=e.get(e.length-1);return e.name}function getStageDependencies(e,t,i,r,n){if(!r.enabled||!r._isSupported(t))return n;var a=i[r.name]={};defined(n)&&(a[getLastStageName(e.getStageByName(n))]=!0);var o=r.uniforms;if(defined(o))for(var s=Object.getOwnPropertyNames(o),l=s.length,c=0;c<l;++c){var u=o[s[c]];"string"!=typeof u||defined(u=e.getStageByName(u))&&(a[getLastStageName(u)]=!0)}return r.name}function getCompositeDependencies(e,t,i,r,n){if(defined(r.enabled)&&!r.enabled||defined(r._isSupported)&&!r._isSupported(t))return n;for(var a,o,s=n,l=!defined(r.inputPreviousStageTexture)||r.inputPreviousStageTexture,c=n,u=r.length,d=0;d<u;++d){var h=r.get(d),c=(defined(h.length)?getCompositeDependencies:getStageDependencies)(e,t,i,h,n);l&&(n=c)}if(l)for(a=1;a<u;++a)defined(i[o=getLastStageName(r.get(a))])||(i[o]={}),i[o][s]=!0;else for(a=1;a<u;++a)for(var p=i[o=getLastStageName(r.get(a))],m=0;m<a;++m)p[getLastStageName(r.get(m))]=!0;return c}function getDependencies(e,t){var i,r,n,a,o={};return defined(e.ambientOcclusion)?(a=e.ambientOcclusion,i=e.bloom,r=e._tonemapping,n=e.fxaa,a=getCompositeDependencies(e,t,o,a,void 0),a=getStageDependencies(e,t,o,r,a=getCompositeDependencies(e,t,o,i,a)),getStageDependencies(e,t,o,n,a=getCompositeDependencies(e,t,o,e,a))):getCompositeDependencies(e,t,o,e,void 0),o}function getFramebuffer(e,t,i){for(var r,n=e._collection.getStageByName(t),a=n._textureScale,o=n._forcePowerOfTwo,s=n._pixelFormat,l=n._pixelDatatype,c=n._clearColor,u=e._framebuffers,d=u.length,h=0;h<d;++h)if(a===(r=u[h]).textureScale&&o===r.forcePowerOfTwo&&s===r.pixelFormat&&l===r.pixelDatatype&&Color.equals(c,r.clearColor)){for(var p=r.stages,m=p.length,f=!1,g=0;g<m;++g)if(i[p[g]]){f=!0;break}if(!f)break}return defined(r)&&h<d?r.stages.push(t):(r={textureScale:a,forcePowerOfTwo:o,pixelFormat:s,pixelDatatype:l,clearColor:c,stages:[t],buffer:void 0,clear:void 0},u.push(r)),r}function createFramebuffers$3(e,t){var i,r=getDependencies(e._collection,t);for(i in r)r.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=getFramebuffer(e,i,r[i]))}function releaseResources$1(e){for(var t=e._framebuffers,i=t.length,r=0;r<i;++r){var n=t[r];n.buffer=n.buffer&&n.buffer.destroy(),n.buffer=void 0}}function updateFramebuffers$3(e,t){for(var i=e._width,r=e._height,n=e._framebuffers,a=n.length,o=0;o<a;++o){var s=n[o],l=s.textureScale,c=Math.ceil(i*l),u=Math.ceil(r*l),l=Math.min(c,u);s.forcePowerOfTwo&&(CesiumMath.isPowerOfTwo(l)||(l=CesiumMath.nextPowerOfTwo(l)),u=c=l),s.buffer=new Framebuffer({context:t,colorTextures:[new Texture({context:t,width:c,height:u,pixelFormat:s.pixelFormat,pixelDatatype:s.pixelDatatype})]}),s.clear=new ClearCommand({color:s.clearColor,framebuffer:s.buffer})}}PostProcessStageLibrary.createFXAAStage=function(){return new PostProcessStage({name:"czm_FXAA",fragmentShader:fxaaFS,sampleMode:PostProcessStageSampleMode.LINEAR})},PostProcessStageLibrary.createAcesTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_aces",fragmentShader:e+=AcesTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createFilmicTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_filmic",fragmentShader:e+=FilmicTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createReinhardTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_reinhard",fragmentShader:e+=ReinhardTonemapping,uniforms:{autoExposure:void 0}})},PostProcessStageLibrary.createModifiedReinhardTonemappingStage=function(e){e=e?"#define AUTO_EXPOSURE\n":"";return new PostProcessStage({name:"czm_modified_reinhard",fragmentShader:e+=ModifiedReinhardTonemapping,uniforms:{white:Color.WHITE,autoExposure:void 0}})},PostProcessStageLibrary.createAutoExposureStage=function(){return new AutoExposure},PostProcessStageLibrary.createBlackAndWhiteStage=function(){return new PostProcessStage({name:"czm_black_and_white",fragmentShader:BlackAndWhite,uniforms:{gradations:5}})},PostProcessStageLibrary.createBrightnessStage=function(){return new PostProcessStage({name:"czm_brightness",fragmentShader:Brightness,uniforms:{brightness:.5}})},PostProcessStageLibrary.createNightVisionStage=function(){return new PostProcessStage({name:"czm_night_vision",fragmentShader:NightVision})},PostProcessStageLibrary.createDepthViewStage=function(){return new PostProcessStage({name:"czm_depth_view",fragmentShader:DepthView})},PostProcessStageLibrary.createLensFlareStage=function(){return new PostProcessStage({name:"czm_lens_flare",fragmentShader:LensFlare,uniforms:{dirtTexture:buildModuleUrl("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:buildModuleUrl("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:Ellipsoid.WGS84.maximumRadius}})},PostProcessStageTextureCache.prototype.updateDependencies=function(){this._updateDependencies=!0},PostProcessStageTextureCache.prototype.update=function(e){var t=this._collection,i=this._updateDependencies,r=defined(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),n=defined(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),a=defined(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),o=defined(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),n=!defined(t._activeStages)||0<t._activeStages.length||r||n||a||o;(i||!n&&0<this._framebuffers.length)&&(releaseResources$1(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),(i||n)&&(0===this._framebuffers.length&&createFramebuffers$3(this,e),a=e.drawingBufferWidth,o=e.drawingBufferHeight,n=this._width!==a||this._height!==o,(i||n)&&(this._width=a,this._height=o,this._updateDependencies=!1,releaseResources$1(this),updateFramebuffers$3(this,e)))},PostProcessStageTextureCache.prototype.clear=function(e){for(var t=this._framebuffers,i=0;i<t.length;++i)t[i].clear.execute(e)},PostProcessStageTextureCache.prototype.getStageByName=function(e){return this._collection.getStageByName(e)},PostProcessStageTextureCache.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)},PostProcessStageTextureCache.prototype.getFramebuffer=function(e){e=this._stageNameToFramebuffer[e];if(defined(e))return e.buffer},PostProcessStageTextureCache.prototype.isDestroyed=function(){return!1},PostProcessStageTextureCache.prototype.destroy=function(){return releaseResources$1(this),destroyObject(this)};var Tonemapper={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(e){return e===Tonemapper.REINHARD||e===Tonemapper.MODIFIED_REINHARD||e===Tonemapper.FILMIC||e===Tonemapper.ACES}},Tonemapper$1=Object.freeze(Tonemapper),stackScratch=[];function PostProcessStageCollection(){var e=PostProcessStageLibrary.createFXAAStage(),t=PostProcessStageLibrary.createAmbientOcclusionStage(),i=PostProcessStageLibrary.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=PostProcessStageLibrary.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=Tonemapper$1.ACES;var r=this._tonemapping;e.enabled=!1,t.enabled=!1,i.enabled=!1,r.enabled=!1;var n=new PostProcessStageTextureCache(this),a={},o=stackScratch;for(o.push(e,t,i,r);0<o.length;){var s=o.pop();(a[s.name]=s)._textureCache=n;var l=s.length;if(defined(l))for(var c=0;c<l;++c)o.push(s.get(c))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;var u=this;t.uniforms.randomTexture=function(){return u._randomTexture},this._ao=t,this._bloom=i,this._fxaa=e,this._lastLength=void 0,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=a,this._textureCache=n}function removeStages(e){if(e._stagesRemoved){e._stagesRemoved=!1;for(var t=[],i=e._stages,r=i.length,n=0,a=0;n<r;++n){var o=i[n];o&&(o._index=a++,t.push(o))}e._stages=t}}function getOutputTexture(e){for(;defined(e.length);)e=e.get(e.length-1);return e.outputTexture}function execute(e,t,i,r,n){if(defined(e.execute))e.execute(t,i,r,n);else{var a,o=e.length;if(e.inputPreviousStageTexture)for(execute(e.get(0),t,i,r,n),a=1;a<o;++a)execute(e.get(a),t,getOutputTexture(e.get(a-1)),r,n);else for(a=0;a<o;++a)execute(e.get(a),t,i,r,n)}}function QuadtreeTileProvider(){DeveloperError.throwInstantiationError()}function SceneTransitioner(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}Object.defineProperties(PostProcessStageCollection.prototype,{ready:{get:function(){for(var e=!1,t=this._stages,i=t.length-1;0<=i;--i)var r=t[i],e=e||r.ready&&r.enabled;var n=this._fxaa,a=this._ao,o=this._bloom,s=this._tonemapping;return e=(e=(e=(e=e||n.ready&&n.enabled)||a.ready&&a.enabled)||o.ready&&o.enabled)||s.ready&&s.enabled}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return removeStages(this),this._stages.length}},outputTexture:{get:function(){var e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);for(var t=this._stages,i=t.length-1;0<=i;--i){var r=t[i];if(defined(r)&&r.ready&&r.enabled)return this.getOutputTexture(r.name)}e=this._tonemapping;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);e=this._bloom;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);e=this._ao;return e.enabled&&e.ready?this.getOutputTexture(e.name):void 0}},hasSelected:{get:function(){for(var e=arraySlice(this._stages);0<e.length;){var t=e.pop();if(defined(t)){if(defined(t.selected))return!0;var i=t.length;if(defined(i))for(var r=0;r<i;++r)e.push(t.get(r))}}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper!==e){defined(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());var t,i,r=this._autoExposureEnabled;switch(e){case Tonemapper$1.REINHARD:t=PostProcessStageLibrary.createReinhardTonemappingStage(r);break;case Tonemapper$1.MODIFIED_REINHARD:t=PostProcessStageLibrary.createModifiedReinhardTonemappingStage(r);break;case Tonemapper$1.FILMIC:t=PostProcessStageLibrary.createFilmicTonemappingStage(r);break;default:t=PostProcessStageLibrary.createAcesTonemappingStage(r)}r&&(i=this._autoExposure,t.uniforms.autoExposure=function(){return i.outputTexture}),this._tonemapper=e,this._tonemapping=t,defined(this._stageNames)&&((this._stageNames[t.name]=t)._textureCache=this._textureCache),this._textureCacheDirty=!0}}}}),PostProcessStageCollection.prototype.add=function(e){var t=this._stageNames,i=stackScratch;for(i.push(e);0<i.length;){var r=i.pop();(t[r.name]=r)._textureCache=this._textureCache;var n=r.length;if(defined(n))for(var a=0;a<n;++a)i.push(r.get(a))}var o=this._stages;return e._index=o.length,o.push(e),this._textureCacheDirty=!0,e},PostProcessStageCollection.prototype.remove=function(e){if(!this.contains(e))return!1;var t=this._stageNames,i=stackScratch;for(i.push(e);0<i.length;){var r=i.pop();delete t[r.name];var n=r.length;if(defined(n))for(var a=0;a<n;++a)i.push(r.get(a))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0},PostProcessStageCollection.prototype.contains=function(e){return defined(e)&&defined(e._index)&&e._textureCache===this._textureCache},PostProcessStageCollection.prototype.get=function(e){return removeStages(this),this._stages[e]},PostProcessStageCollection.prototype.removeAll=function(){for(var e=this._stages,t=e.length,i=0;i<t;++i)this.remove(e[i]);e.length=0},PostProcessStageCollection.prototype.getStageByName=function(e){return this._stageNames[e]},PostProcessStageCollection.prototype.update=function(e,t,i){removeStages(this);var r=this._activeStages,n=this._activeStages=this._previousActiveStages;this._previousActiveStages=r;var a,o=this._stages,s=n.length=o.length,l=0;for(C=0;C<s;++C)(a=o[C]).ready&&a.enabled&&a._isSupported(e)&&(n[l++]=a);var c=(n.length=l)!==r.length;if(!c)for(C=0;C<l;++C)if(n[C]!==r[C]){c=!0;break}var u=this._ao,d=this._bloom,h=this._autoExposure,p=this._tonemapping,m=this._fxaa;p.enabled=i;var f=u.enabled&&u._isSupported(e),g=d.enabled&&d._isSupported(e),_=p.enabled&&p._isSupported(e),i=m.enabled&&m._isSupported(e);if((c||this._textureCacheDirty||l!==this._lastLength||f!==this._aoEnabled||g!==this._bloomEnabled||_!==this._tonemappingEnabled||i!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._lastLength=l,this._aoEnabled=f,this._bloomEnabled=g,this._tonemappingEnabled=_,this._fxaaEnabled=i,this._textureCacheDirty=!1),defined(this._randomTexture)&&!f&&(this._randomTexture.destroy(),this._randomTexture=void 0),!defined(this._randomTexture)&&f){s=196608;for(var y=new Uint8Array(s),C=0;C<s;C+=3)y[C]=Math.floor(255*Math.random());this._randomTexture=new Texture({context:e,pixelFormat:PixelFormat$1.RGB,pixelDatatype:PixelDatatype$1.UNSIGNED_BYTE,source:{arrayBufferView:y,width:256,height:256},sampler:new Sampler({wrapS:TextureWrap$1.REPEAT,wrapT:TextureWrap$1.REPEAT,minificationFilter:TextureMinificationFilter$1.NEAREST,magnificationFilter:TextureMagnificationFilter$1.NEAREST})})}for(this._textureCache.update(e),m.update(e,t),u.update(e,t),d.update(e,t),p.update(e,t),this._autoExposureEnabled&&h.update(e,t),s=o.length,C=0;C<s;++C)o[C].update(e,t)},PostProcessStageCollection.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)},PostProcessStageCollection.prototype.getOutputTexture=function(e){e=this.getStageByName(e);if(defined(e))return getOutputTexture(e)},PostProcessStageCollection.prototype.execute=function(e,t,i,r){var n=this._activeStages,a=n.length,o=this._fxaa,s=this._ao,l=this._bloom,c=this._autoExposure,u=this._tonemapping,d=s.enabled&&s._isSupported(e),h=l.enabled&&l._isSupported(e),p=this._autoExposureEnabled,m=u.enabled&&u._isSupported(e),f=o.enabled&&o._isSupported(e);if(f||d||h||m||0!==a){t=t;d&&s.ready&&(execute(s,e,t,i,r),t=getOutputTexture(s)),h&&l.ready&&(execute(l,e,t,i,r),t=getOutputTexture(l)),p&&c.ready&&execute(c,e,t,i,r),m&&u.ready&&(execute(u,e,t,i,r),t=getOutputTexture(u));u=t;if(0<a){execute(n[0],e,t,i,r);for(var g=1;g<a;++g)execute(n[g],e,getOutputTexture(n[g-1]),i,r);u=getOutputTexture(n[a-1])}f&&o.ready&&execute(o,e,u,i,r)}},PostProcessStageCollection.prototype.copy=function(e,t){var i;defined(this._copyColorCommand)||((i=this)._copyColorCommand=e.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return i.outputTexture}},owner:this})),this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},PostProcessStageCollection.prototype.isDestroyed=function(){return!1},PostProcessStageCollection.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),destroyObject(this)},QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},Object.defineProperties(QuadtreeTileProvider.prototype,{quadtree:{get:DeveloperError.throwInstantiationError,set:DeveloperError.throwInstantiationError},ready:{get:DeveloperError.throwInstantiationError},tilingScheme:{get:DeveloperError.throwInstantiationError},errorEvent:{get:DeveloperError.throwInstantiationError}}),QuadtreeTileProvider.prototype.update=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.beginUpdate=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.endUpdate=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.getLevelMaximumGeometricError=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.loadTile=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.computeTileVisibility=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.showTileThisFrame=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.computeDistanceToTile=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.isDestroyed=DeveloperError.throwInstantiationError,QuadtreeTileProvider.prototype.destroy=DeveloperError.throwInstantiationError,SceneTransitioner.prototype.completeMorph=function(){defined(this._completeMorph)&&this._completeMorph()},SceneTransitioner.prototype.morphTo2D=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i=this._scene;this._previousMode=i.mode,this._morphToOrthographic=i.camera.frustum instanceof OrthographicFrustum,this._previousMode!==SceneMode$1.SCENE2D&&this._previousMode!==SceneMode$1.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.SCENE2D,!0),i._mode=SceneMode$1.MORPHING,i.camera._setTransform(Matrix4.IDENTITY),this._previousMode===SceneMode$1.COLUMBUS_VIEW?morphFromColumbusViewTo2D(this,e):morphFrom3DTo2D(this,e,t),0===e&&defined(this._completeMorph)&&this._completeMorph())};var scratchToCVPosition=new Cartesian3,scratchToCVDirection=new Cartesian3,scratchToCVUp=new Cartesian3,scratchToCVPosition2D=new Cartesian3,scratchToCVDirection2D=new Cartesian3,scratchToCVUp2D=new Cartesian3,scratchToCVSurfacePosition=new Cartesian3,scratchToCVCartographic=new Cartographic,scratchToCVToENU=new Matrix4,scratchToCVFrustumPerspective=new PerspectiveFrustum,scratchToCVFrustumOrthographic=new OrthographicFrustum,scratchToCVCamera={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};SceneTransitioner.prototype.morphToColumbusView=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i,r,n,a,o,s,l=this._scene;this._previousMode=l.mode,this._previousMode!==SceneMode$1.COLUMBUS_VIEW&&this._previousMode!==SceneMode$1.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.COLUMBUS_VIEW,!0),l.camera._setTransform(Matrix4.IDENTITY),i=scratchToCVPosition,r=scratchToCVDirection,n=scratchToCVUp,0<e?(i.x=0,i.y=-1,i.z=1,i=Cartesian3.multiplyByScalar(Cartesian3.normalize(i,i),5*t.maximumRadius,i),Cartesian3.negate(Cartesian3.normalize(i,r),r),Cartesian3.cross(Cartesian3.UNIT_X,r,n)):(a=l.camera,this._previousMode===SceneMode$1.SCENE2D?(Cartesian3.clone(a.position,i),i.z=a.frustum.right-a.frustum.left,Cartesian3.negate(Cartesian3.UNIT_Z,r),Cartesian3.clone(Cartesian3.UNIT_Y,n)):(Cartesian3.clone(a.positionWC,i),Cartesian3.clone(a.directionWC,r),Cartesian3.clone(a.upWC,n),o=t.scaleToGeodeticSurface(i,scratchToCVSurfacePosition),o=Transforms.eastNorthUpToFixedFrame(o,t,scratchToCVToENU),Matrix4.inverseTransformation(o,o),l.mapProjection.project(t.cartesianToCartographic(i,scratchToCVCartographic),i),Matrix4.multiplyByPointAsVector(o,r,r),Matrix4.multiplyByPointAsVector(o,n,n))),this._morphToOrthographic?((s=scratchToCVFrustumOrthographic).width=l.camera.frustum.right-l.camera.frustum.left,s.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight):((s=scratchToCVFrustumPerspective).aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,s.fov=CesiumMath.toRadians(60)),(o=scratchToCVCamera).position=i,o.direction=r,o.up=n,o.frustum=s,createMorphHandler(this,s=completeColumbusViewCallback(o)),this._previousMode===SceneMode$1.SCENE2D?morphFrom2DToColumbusView(this,e,o,s):(o.position2D=Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,i,scratchToCVPosition2D),o.direction2D=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,r,scratchToCVDirection2D),o.up2D=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,n,scratchToCVUp2D),l._mode=SceneMode$1.MORPHING,morphFrom3DToColumbusView(this,e,o,s)),0===e&&defined(this._completeMorph)&&this._completeMorph())};var scratchCVTo3DCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,frustum:void 0},scratch2DTo3DFrustumPersp=new PerspectiveFrustum;function createMorphHandler(e,t){var i;e._scene.completeMorphOnUserInput&&(e._morphHandler=new ScreenSpaceEventHandler(e._scene.canvas),i=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)},e._completeMorph=i,e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.LEFT_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.MIDDLE_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.RIGHT_DOWN),e._morphHandler.setInputAction(i,ScreenSpaceEventType$1.WHEEL))}function destroyMorphHandler(e){for(var t=e._currentTweens,i=0;i<t.length;++i)t[i].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}SceneTransitioner.prototype.morphTo3D=function(e,t){defined(this._completeMorph)&&this._completeMorph();var i,r,n=this._scene;this._previousMode=n.mode,this._previousMode!==SceneMode$1.SCENE3D&&this._previousMode!==SceneMode$1.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,SceneMode$1.SCENE3D,!0),n._mode=SceneMode$1.MORPHING,n.camera._setTransform(Matrix4.IDENTITY),this._previousMode===SceneMode$1.SCENE2D?morphFrom2DTo3D(this,e,t):(0<e?(i=scratchCVTo3DCamera,Cartesian3.fromDegrees(0,0,5*t.maximumRadius,t,i.position),Cartesian3.negate(i.position,i.direction),Cartesian3.normalize(i.direction,i.direction),Cartesian3.clone(Cartesian3.UNIT_Z,i.up)):i=getColumbusViewTo3DCamera(this,t),(t=n.camera).frustum instanceof OrthographicFrustum?r=t.frustum.clone():((r=scratch2DTo3DFrustumPersp).aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=CesiumMath.toRadians(60)),i.frustum=r,createMorphHandler(this,r=complete3DCallback(i)),morphFromColumbusViewTo3D(this,e,i,r)),0===e&&defined(this._completeMorph)&&this._completeMorph())},SceneTransitioner.prototype.isDestroyed=function(){return!1},SceneTransitioner.prototype.destroy=function(){return destroyMorphHandler(this),destroyObject(this)};var scratchCVTo3DCartographic=new Cartographic,scratchCVTo3DSurfacePoint=new Cartesian3,scratchCVTo3DFromENU=new Matrix4;function getColumbusViewTo3DCamera(e,t){var i=e._scene,r=i.camera,n=scratchCVTo3DCamera,a=n.position,o=n.direction,e=n.up,i=i.mapProjection.unproject(r.position,scratchCVTo3DCartographic);t.cartographicToCartesian(i,a);a=t.scaleToGeodeticSurface(a,scratchCVTo3DSurfacePoint),t=Transforms.eastNorthUpToFixedFrame(a,t,scratchCVTo3DFromENU);return Matrix4.multiplyByPointAsVector(t,r.direction,o),Matrix4.multiplyByPointAsVector(t,r.up,e),n}var scratchCVTo3DStartPos=new Cartesian3,scratchCVTo3DStartDir=new Cartesian3,scratchCVTo3DStartUp=new Cartesian3,scratchCVTo3DEndPos=new Cartesian3,scratchCVTo3DEndDir=new Cartesian3,scratchCVTo3DEndUp=new Cartesian3;function morphFromColumbusViewTo3D(e,t,i,r){t*=.5;var n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratchCVTo3DStartPos),s=Cartesian3.clone(a.direction,scratchCVTo3DStartDir),l=Cartesian3.clone(a.up,scratchCVTo3DStartUp),c=Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,i.position,scratchCVTo3DEndPos),u=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D_INVERSE,i.direction,scratchCVTo3DEndDir),d=Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D_INVERSE,i.up,scratchCVTo3DEndUp);i=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,c,e.time,a.position),columbusViewMorph(s,u,e.time,a.direction),columbusViewMorph(l,d,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right)},complete:function(){addMorphTimeAnimations(e,n,0,1,t,r)}});e._currentTweens.push(i)}var scratch2DTo3DFrustumOrtho=new OrthographicFrustum,scratch3DToCVStartPos=new Cartesian3,scratch3DToCVStartDir=new Cartesian3,scratch3DToCVStartUp=new Cartesian3,scratch3DToCVEndPos=new Cartesian3,scratch3DToCVEndDir=new Cartesian3,scratch3DToCVEndUp=new Cartesian3;function morphFrom2DTo3D(e,t,i){t/=3;var r,n,a=e._scene,o=a.camera;0<t?(r=scratchCVTo3DCamera,Cartesian3.fromDegrees(0,0,5*i.maximumRadius,i,r.position),Cartesian3.negate(r.position,r.direction),Cartesian3.normalize(r.direction,r.direction),Cartesian3.clone(Cartesian3.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=getColumbusViewTo3DCamera(e,i)),e._morphToOrthographic?((n=scratch2DTo3DFrustumOrtho).aspectRatio=a.drawingBufferWidth/a.drawingBufferHeight,n.width=o.frustum.right-o.frustum.left):((n=scratch2DTo3DFrustumPersp).aspectRatio=a.drawingBufferWidth/a.drawingBufferHeight,n.fov=CesiumMath.toRadians(60)),r.frustum=n;var s,l=complete3DCallback(r);createMorphHandler(e,l),s=e._morphToOrthographic?function(){morphFromColumbusViewTo3D(e,t,r,l)}:function(){morphOrthographicToPerspective(e,t,r,function(){morphFromColumbusViewTo3D(e,t,r,l)})},0<t?(a._mode=SceneMode$1.SCENE2D,o.flyTo({duration:t,destination:Cartesian3.fromDegrees(0,0,5*i.maximumRadius,i,scratch3DToCVEndPos),complete:function(){a._mode=SceneMode$1.MORPHING,s()}})):s()}function columbusViewMorph(e,t,i,r){return Cartesian3.lerp(e,t,i,r)}function morphPerspectiveToOrthographic(e,t,i,r,n){var a,o,s,l=e._scene,c=l.camera;c.frustum instanceof OrthographicFrustum||(a=c.frustum.fov,o=.5*CesiumMath.RADIANS_PER_DEGREE,s=i.position.z*Math.tan(.5*a),c.frustum.far=s/Math.tan(.5*o)+1e7,t=l.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){c.frustum.fov=CesiumMath.lerp(a,o,e.time),e=s/Math.tan(.5*c.frustum.fov),r(c,e)},complete:function(){c.frustum=i.frustum.clone(),n(e)}}),e._currentTweens.push(t))}var scratchCVTo2DStartPos=new Cartesian3,scratchCVTo2DStartDir=new Cartesian3,scratchCVTo2DStartUp=new Cartesian3,scratchCVTo2DEndPos=new Cartesian3,scratchCVTo2DEndDir=new Cartesian3,scratchCVTo2DEndUp=new Cartesian3,scratchCVTo2DFrustum=new OrthographicOffCenterFrustum,scratchCVTo2DRay=new Ray,scratchCVTo2DPickPos=new Cartesian3,scratchCVTo2DCamera={position:void 0,direction:void 0,up:void 0,frustum:void 0};function morphFromColumbusViewTo2D(e,t){t*=.5;var i,r,n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratchCVTo2DStartPos),s=Cartesian3.clone(a.direction,scratchCVTo2DStartDir),l=Cartesian3.clone(a.up,scratchCVTo2DStartUp),c=Cartesian3.negate(Cartesian3.UNIT_Z,scratchCVTo2DEndDir),u=Cartesian3.clone(Cartesian3.UNIT_Y,scratchCVTo2DEndUp),d=scratchCVTo2DEndPos;0<t?(Cartesian3.clone(Cartesian3.ZERO,scratchCVTo2DEndPos),d.z=5*n.mapProjection.ellipsoid.maximumRadius):(Cartesian3.clone(o,scratchCVTo2DEndPos),i=scratchCVTo2DRay,Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,o,i.origin),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,s,i.direction),!defined(r=n.globe)||defined(h=r.pickWorldCoordinates(i,n,!0,scratchCVTo2DPickPos))&&(Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,h,d),d.z+=Cartesian3.distance(o,d)));var h=scratchCVTo2DFrustum;h.right=.5*d.z,h.left=-h.right,h.top=h.right*(n.drawingBufferHeight/n.drawingBufferWidth),h.bottom=-h.top;var p=scratchCVTo2DCamera;p.position=d,p.direction=c,p.up=u,p.frustum=h;var m=complete2DCallback(p);function f(e,t){e.position.z=t}createMorphHandler(e,m);n=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,d,e.time,a.position),columbusViewMorph(s,c,e.time,a.direction),columbusViewMorph(l,u,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right),a._adjustOrthographicFrustum(!0)},complete:function(){morphPerspectiveToOrthographic(e,t,p,f,m)}});e._currentTweens.push(n)}var scratch3DTo2DCartographic=new Cartographic,scratch3DTo2DCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,position2D:new Cartesian3,direction2D:new Cartesian3,up2D:new Cartesian3,frustum:new OrthographicOffCenterFrustum},scratch3DTo2DEndCamera={position:new Cartesian3,direction:new Cartesian3,up:new Cartesian3,frustum:void 0},scratch3DTo2DPickPosition=new Cartesian3,scratch3DTo2DRay=new Ray,scratch3DTo2DToENU=new Matrix4,scratch3DTo2DSurfacePoint=new Cartesian3;function morphFrom3DTo2D(e,t,i){t*=.5;var r,n,a=e._scene,o=a.camera,s=scratch3DTo2DCamera;function l(e,t){e.position.x=t}0<t?(Cartesian3.clone(Cartesian3.ZERO,s.position),s.position.z=5*i.maximumRadius,Cartesian3.negate(Cartesian3.UNIT_Z,s.direction),Cartesian3.clone(Cartesian3.UNIT_Y,s.up)):(i.cartesianToCartographic(o.positionWC,scratch3DTo2DCartographic),a.mapProjection.project(scratch3DTo2DCartographic,s.position),Cartesian3.negate(Cartesian3.UNIT_Z,s.direction),Cartesian3.clone(Cartesian3.UNIT_Y,s.up),n=scratch3DTo2DRay,Cartesian3.clone(s.position2D,n.origin),r=Cartesian3.clone(o.directionWC,n.direction),o=i.scaleToGeodeticSurface(o.positionWC,scratch3DTo2DSurfacePoint),i=Transforms.eastNorthUpToFixedFrame(o,i,scratch3DTo2DToENU),Matrix4.inverseTransformation(i,i),Matrix4.multiplyByPointAsVector(i,r,r),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,r,r),!defined(r=a.globe)||defined(c=r.pickWorldCoordinates(n,a,!0,scratch3DTo2DPickPosition))&&(n=Cartesian3.distance(s.position2D,c),c.x+=n,Cartesian3.clone(c,s.position2D))),Matrix4.multiplyByPoint(Camera.TRANSFORM_2D,s.position,s.position2D),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,s.direction,s.direction2D),Matrix4.multiplyByPointAsVector(Camera.TRANSFORM_2D,s.up,s.up2D);var c=s.frustum;c.right=.5*s.position.z,c.left=-c.right,c.top=c.right*(a.drawingBufferHeight/a.drawingBufferWidth),c.bottom=-c.top;a=scratch3DTo2DEndCamera;Matrix4.multiplyByPoint(Camera.TRANSFORM_2D_INVERSE,s.position2D,a.position),Cartesian3.clone(s.direction,a.direction),Cartesian3.clone(s.up,a.up),a.frustum=c;var u=complete2DCallback(a);createMorphHandler(e,u),morphFrom3DToColumbusView(e,t,s,function(){morphPerspectiveToOrthographic(e,t,s,l,u)})}function morphOrthographicToPerspective(e,t,i,r){var n=e._scene,a=n.camera,o=a.frustum.right-a.frustum.left;a.frustum=i.frustum.clone();var s=a.frustum.fov,l=.5*CesiumMath.RADIANS_PER_DEGREE,c=o*Math.tan(.5*s);a.frustum.far=c/Math.tan(.5*l)+1e7,a.frustum.fov=l;t=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){a.frustum.fov=CesiumMath.lerp(l,s,e.time),a.position.z=c/Math.tan(.5*a.frustum.fov)},complete:function(){r(e)}});e._currentTweens.push(t)}function morphFrom2DToColumbusView(n,a,o,s){a*=.5;var l=n._scene,c=l.camera,u=Cartesian3.clone(o.position,scratch3DToCVEndPos),d=Cartesian3.clone(o.direction,scratch3DToCVEndDir),h=Cartesian3.clone(o.up,scratch3DToCVEndUp);function e(){c.frustum=o.frustum.clone();var t=Cartesian3.clone(c.position,scratch3DToCVStartPos),i=Cartesian3.clone(c.direction,scratch3DToCVStartDir),r=Cartesian3.clone(c.up,scratch3DToCVStartUp);t.z=u.z;var e=l.tweens.add({duration:a,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(t,u,e.time,c.position),columbusViewMorph(i,d,e.time,c.direction),columbusViewMorph(r,h,e.time,c.up),Cartesian3.cross(c.direction,c.up,c.right),Cartesian3.normalize(c.right,c.right)},complete:function(){s(n)}});n._currentTweens.push(e)}l._mode=SceneMode$1.MORPHING,n._morphToOrthographic?e():morphOrthographicToPerspective(n,0,o,e)}function morphFrom3DToColumbusView(e,t,i,r){var n=e._scene,a=n.camera,o=Cartesian3.clone(a.position,scratch3DToCVStartPos),s=Cartesian3.clone(a.direction,scratch3DToCVStartDir),l=Cartesian3.clone(a.up,scratch3DToCVStartUp),c=Cartesian3.clone(i.position2D,scratch3DToCVEndPos),u=Cartesian3.clone(i.direction2D,scratch3DToCVEndDir),d=Cartesian3.clone(i.up2D,scratch3DToCVEndUp);i=n.tweens.add({duration:t,easingFunction:EasingFunction$1.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:function(e){columbusViewMorph(o,c,e.time,a.position),columbusViewMorph(s,u,e.time,a.direction),columbusViewMorph(l,d,e.time,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.right,a.right),a._adjustOrthographicFrustum(!0)},complete:function(){addMorphTimeAnimations(e,n,1,0,t,r)}});e._currentTweens.push(i)}function addMorphTimeAnimations(e,t,i,r,n,a){n={object:t,property:"morphTime",startValue:i,stopValue:r,duration:n,easingFunction:EasingFunction$1.QUARTIC_OUT};defined(a)&&(n.complete=function(){a(e)});n=t.tweens.addProperty(n);e._currentTweens.push(n)}function complete3DCallback(r){return function(e){var t=e._scene;t._mode=SceneMode$1.SCENE3D,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.SCENE3D),destroyMorphHandler(e);var i=t.camera;e._previousMode===SceneMode$1.MORPHING&&!e._morphCancelled||(e._morphCancelled=!1,Cartesian3.clone(r.position,i.position),Cartesian3.clone(r.direction,i.direction),Cartesian3.clone(r.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right),i.frustum=r.frustum.clone());i=i.frustum;t.frameState.useLogDepth&&(i.near=.1,i.far=1e10);i=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.SCENE3D,i)}}function complete2DCallback(r){return function(e){var t=e._scene;t._mode=SceneMode$1.SCENE2D,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.SCENE2D),destroyMorphHandler(e);var i=t.camera;Cartesian3.clone(r.position,i.position),i.position.z=2*t.mapProjection.ellipsoid.maximumRadius,Cartesian3.clone(r.direction,i.direction),Cartesian3.clone(r.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right),i.frustum=r.frustum.clone();i=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.SCENE2D,i)}}function completeColumbusViewCallback(r){return function(e){var t=e._scene;t._mode=SceneMode$1.COLUMBUS_VIEW,t.morphTime=SceneMode$1.getMorphTime(SceneMode$1.COLUMBUS_VIEW),destroyMorphHandler(e);var i=t.camera;e._previousModeMode===SceneMode$1.MORPHING&&!e._morphCancelled||(e._morphCancelled=!1,Cartesian3.clone(r.position,i.position),Cartesian3.clone(r.direction,i.direction),Cartesian3.clone(r.up,i.up),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.normalize(i.right,i.right));i=i.frustum;t.frameState.useLogDepth&&(i.near=.1,i.far=1e10);i=defined(e._completeMorph);e._completeMorph=void 0,t.camera.update(t.mode),e._scene.morphComplete.raiseEvent(e,e._previousMode,SceneMode$1.COLUMBUS_VIEW,i)}}function Tween(e,t,i,r,n,a,o,s,l,c){this._tweens=e,this._tweenjs=t,this._startObject=clone(i),this._stopObject=clone(r),this._duration=n,this._delay=a,this._easingFunction=o,this._update=s,this._complete=l,this.cancel=c,this.needsStart=!0}function TweenCollection(){this._tweens=[]}function ScreenSpaceCameraController(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=CameraEventType$1.LEFT_DRAG,this.zoomEventTypes=[CameraEventType$1.RIGHT_DRAG,CameraEventType$1.WHEEL,CameraEventType$1.PINCH],this.rotateEventTypes=CameraEventType$1.LEFT_DRAG,this.tiltEventTypes=[CameraEventType$1.MIDDLE_DRAG,CameraEventType$1.PINCH,{eventType:CameraEventType$1.LEFT_DRAG,modifier:KeyboardEventModifier$1.CTRL},{eventType:CameraEventType$1.RIGHT_DRAG,modifier:KeyboardEventModifier$1.CTRL}],this.lookEventTypes={eventType:CameraEventType$1.LEFT_DRAG,modifier:KeyboardEventModifier$1.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this._scene=e,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new CameraEventAggregator(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new TweenCollection,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new Cartesian2(-1,-1),this._tiltCenter=new Cartesian3,this._rotateMousePosition=new Cartesian2(-1,-1),this._rotateStartPosition=new Cartesian3,this._strafeStartPosition=new Cartesian3,this._strafeMousePosition=new Cartesian2,this._strafeEndMousePosition=new Cartesian2,this._zoomMouseStart=new Cartesian2(-1,-1),this._zoomWorldPosition=new Cartesian3,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;e=e.mapProjection;this._maxCoord=e.project(new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=2e-4,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function decay(e,t){if(e<0)return 0;t=25*(1-t);return Math.exp(-t*e)}function sameMousePosition(e){return Cartesian2.equalsEpsilon(e.startPosition,e.endPosition,CesiumMath.EPSILON14)}Object.defineProperties(Tween.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}}),Tween.prototype.cancelTween=function(){this._tweens.remove(this)},Object.defineProperties(TweenCollection.prototype,{length:{get:function(){return this._tweens.length}}}),TweenCollection.prototype.add=function(e){if(0===(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).duration)return defined(e.complete)&&e.complete(),new Tween(this);var t=e.duration/TimeConstants$1.SECONDS_PER_MILLISECOND,i=defaultValue(e.delay,0),r=i/TimeConstants$1.SECONDS_PER_MILLISECOND,n=defaultValue(e.easingFunction,EasingFunction$1.LINEAR_NONE),a=e.startObject,o=new TWEEN.Tween(a);o.to(clone(e.stopObject),t),o.delay(r),o.easing(n),defined(e.update)&&o.onUpdate(function(){e.update(a)}),o.onComplete(defaultValue(e.complete,null)),o.repeat(defaultValue(e._repeat,0));n=new Tween(this,o,e.startObject,e.stopObject,e.duration,i,n,e.update,e.complete,e.cancel);return this._tweens.push(n),n},TweenCollection.prototype.addProperty=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).object,i=e.property,r=e.startValue,n=e.stopValue;return this.add({startObject:{value:r},stopObject:{value:n},duration:defaultValue(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){t[i]=e.value},complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},TweenCollection.prototype.addAlpha=function(e){var t,r=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).material,n=[];for(t in r.uniforms)r.uniforms.hasOwnProperty(t)&&defined(r.uniforms[t])&&defined(r.uniforms[t].alpha)&&n.push(t);return this.add({startObject:{alpha:defaultValue(e.startValue,0)},stopObject:{alpha:defaultValue(e.stopValue,1)},duration:defaultValue(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:function(e){for(var t=n.length,i=0;i<t;++i)r.uniforms[n[i]].alpha=e.alpha},complete:e.complete,cancel:e.cancel})},TweenCollection.prototype.addOffsetIncrement=function(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).material.uniforms;return this.addProperty({object:t,property:"offset",startValue:t.offset,stopValue:t.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},TweenCollection.prototype.remove=function(e){if(!defined(e))return!1;var t=this._tweens.indexOf(e);return-1!==t&&(e.tweenjs.stop(),defined(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},TweenCollection.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var i=e[t];i.tweenjs.stop(),defined(i.cancel)&&i.cancel()}e.length=0},TweenCollection.prototype.contains=function(e){return defined(e)&&-1!==this._tweens.indexOf(e)},TweenCollection.prototype.get=function(e){return this._tweens[e]},TweenCollection.prototype.update=function(e){var t=this._tweens,i=0;for(e=defined(e)?e/TimeConstants$1.SECONDS_PER_MILLISECOND:getTimestamp$1();i<t.length;){var r=t[i],n=r.tweenjs;r.needsStart?(r.needsStart=!1,n.start(e)):n.update(e)?i++:(n.stop(),t.splice(i,1))}};var inertiaMaxClickTimeThreshold=.4;function maintainInertia(e,t,i,r,n,a,o){var s=a[o];defined(s)||(s=a[o]={startPosition:new Cartesian2,endPosition:new Cartesian2,motion:new Cartesian2,inertiaEnabled:!0});var l=e.getButtonPressTime(t,i),c=e.getButtonReleaseTime(t,i),u=l&&c&&(c.getTime()-l.getTime())/1e3,o=new Date,o=c&&(o.getTime()-c.getTime())/1e3;l&&c&&u<inertiaMaxClickTimeThreshold&&(o=decay(o,r),defined(r=e.getLastMovement(t,i))&&!sameMousePosition(r)&&s.inertiaEnabled&&(s.motion.x=.5*(r.endPosition.x-r.startPosition.x),s.motion.y=.5*(r.endPosition.y-r.startPosition.y),s.startPosition=Cartesian2.clone(r.startPosition,s.startPosition),s.endPosition=Cartesian2.multiplyByScalar(s.motion,o,s.endPosition),s.endPosition=Cartesian2.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||Cartesian2.distance(s.startPosition,s.endPosition)<.5||e.isButtonDown(t,i)||n(a,e.getStartMousePosition(t,i),s)))}function activateInertia(e,t){if(defined(t)){var i=e[t];defined(i)&&(i.inertiaEnabled=!0);var r=e._inertiaDisablers[t];if(defined(r))for(var n=r.length,a=0;a<n;++a)defined(i=e[r[a]])&&(i.inertiaEnabled=!1)}}var scratchEventTypeArray=[];function reactToInput(e,t,i,r,n,a){if(defined(i)){var o=e._aggregator;Array.isArray(i)||(scratchEventTypeArray[0]=i,i=scratchEventTypeArray);for(var s=i.length,l=0;l<s;++l){var c=i[l],u=defined(c.eventType)?c.eventType:c,d=c.modifier,h=o.isMoving(u,d)&&o.getMovement(u,d),c=o.getStartMousePosition(u,d);e.enableInputs&&t&&(h?(r(e,c,h),activateInertia(e,a)):n<1&&maintainInertia(o,u,d,n,r,e,a))}}}var scratchZoomPickRay=new Ray,scratchPickCartesian=new Cartesian3,scratchZoomOffset=new Cartesian2,scratchZoomDirection=new Cartesian3,scratchCenterPixel=new Cartesian2,scratchCenterPosition=new Cartesian3,scratchPositionNormal$2=new Cartesian3,scratchPickNormal=new Cartesian3,scratchZoomAxis=new Cartesian3,scratchCameraPositionNormal=new Cartesian3,scratchTargetNormal=new Cartesian3,scratchCameraPosition$1=new Cartesian3,scratchCameraUpNormal=new Cartesian3,scratchCameraRightNormal=new Cartesian3,scratchForwardNormal=new Cartesian3,scratchPositionToTarget=new Cartesian3,scratchPositionToTargetNormal=new Cartesian3,scratchPan=new Cartesian3,scratchCenterMovement=new Cartesian3,scratchCenter$6=new Cartesian3,scratchCartesian$9=new Cartesian3,scratchCartesianTwo=new Cartesian3,scratchCartesianThree=new Cartesian3,scratchZoomViewOptions={orientation:new HeadingPitchRoll};function handleZoom(e,t,i,r,n,a){var o=1;defined(a)&&(o=CesiumMath.clamp(Math.abs(a),.25,1));var s=e.minimumZoomDistance*o,l=e.maximumZoomDistance,c=r*(n-s),c=CesiumMath.clamp(c,e._minimumZoomRate,e._maximumZoomRate),a=(i.endPosition.y-i.startPosition.y)/e._scene.canvas.clientHeight,o=c*(a=Math.min(a,e.maximumMovementRatio));if(e.enableCollisionDetection||0===e.minimumZoomDistance||!defined(e._globe)){if(0<o&&Math.abs(n-s)<1)return;if(o<0&&Math.abs(n-l)<1)return;n-o<s?o=n-s-1:l<n-o&&(o=n-l)}r=e._scene,i=r.camera,c=r.mode,a=scratchZoomViewOptions.orientation;if(a.heading=i.heading,a.pitch=i.pitch,a.roll=i.roll,i.frustum instanceof OrthographicFrustum)0<Math.abs(o)&&(i.zoomIn(o),i._adjustOrthographicFrustum());else{s=Cartesian2.equals(t,e._zoomMouseStart),n=e._zoomingOnVector,l=e._rotatingZoom;if(s||(e._zoomMouseStart=Cartesian2.clone(t,e._zoomMouseStart),defined(e._globe)&&(_=c===SceneMode$1.SCENE2D?(_=i.getPickRay(t,scratchZoomPickRay).origin,Cartesian3.fromElements(_.y,_.z,_.x)):pickGlobe(e,t,scratchPickCartesian)),defined(_)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=Cartesian3.clone(_,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,n=e._zoomingOnVector=!1,l=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),e._useZoomWorldPosition){a=c===SceneMode$1.COLUMBUS_VIEW;if(i.positionCartographic.height<2e6&&(l=!0),!s||l){if(c===SceneMode$1.SCENE2D){var u=e._zoomWorldPosition,d=i.position;!Cartesian3.equals(u,d)&&i.positionCartographic.height<2*e._maxCoord.x&&(f=i.position.x,h=Cartesian3.subtract(u,d,scratchZoomDirection),Cartesian3.normalize(h,h),m=Cartesian3.distance(u,d)*o/(.5*i.getMagnitude()),i.move(h,.5*m),(i.position.x<0&&0<f||0<i.position.x&&f<0)&&(_=i.getPickRay(t,scratchZoomPickRay).origin,_=Cartesian3.fromElements(_.y,_.z,_.x),e._zoomWorldPosition=Cartesian3.clone(_,e._zoomWorldPosition)))}else if(c===SceneMode$1.SCENE3D){l=Cartesian3.normalize(i.position,scratchCameraPositionNormal);if(e._cameraUnderground||e._zoomingUnderground||i.positionCartographic.height<3e3&&Math.abs(Cartesian3.dot(i.direction,l))<.6)a=!0;else{u=r.canvas,d=scratchCenterPixel;d.x=u.clientWidth/2,d.y=u.clientHeight/2;var h=pickGlobe(e,d,scratchCenterPosition);if(defined(h))if(i.positionCartographic.height<1e6){if(!(-.5<=Cartesian3.dot(i.direction,l))){var p=scratchCameraPosition$1;Cartesian3.clone(i.position,p);var m=e._zoomWorldPosition,f=scratchTargetNormal,f=Cartesian3.normalize(m,f);if(Cartesian3.dot(f,l)<0)return;var g=scratchCenter$6,_=scratchForwardNormal;Cartesian3.clone(i.direction,_),Cartesian3.add(p,Cartesian3.multiplyByScalar(_,1e3,scratchCartesian$9),g);u=scratchPositionToTarget,d=scratchPositionToTargetNormal;Cartesian3.subtract(m,p,u),Cartesian3.normalize(u,d);f=Cartesian3.dot(l,d);if(0<=f)return void(e._zoomMouseStart.x=-1);l=Math.acos(-f),f=Cartesian3.magnitude(p),m=Cartesian3.magnitude(m),f=f-o,u=Cartesian3.magnitude(u),u=Math.asin(CesiumMath.clamp(u/m*Math.sin(l),-1,1))-Math.asin(CesiumMath.clamp(f/m*Math.sin(l),-1,1))+l,m=scratchCameraUpNormal;Cartesian3.normalize(p,m);l=scratchCameraRightNormal,l=Cartesian3.cross(d,m,l);l=Cartesian3.normalize(l,l),Cartesian3.normalize(Cartesian3.cross(m,l,scratchCartesian$9),_),Cartesian3.multiplyByScalar(Cartesian3.normalize(g,scratchCartesian$9),Cartesian3.magnitude(g)-o,g),Cartesian3.normalize(p,p),Cartesian3.multiplyByScalar(p,f,p);d=scratchPan;Cartesian3.multiplyByScalar(Cartesian3.add(Cartesian3.multiplyByScalar(m,Math.cos(u)-1,scratchCartesianTwo),Cartesian3.multiplyByScalar(_,Math.sin(u),scratchCartesianThree),scratchCartesian$9),f,d),Cartesian3.add(p,d,p),Cartesian3.normalize(g,m),Cartesian3.normalize(Cartesian3.cross(m,l,scratchCartesian$9),_);l=scratchCenterMovement;return Cartesian3.multiplyByScalar(Cartesian3.add(Cartesian3.multiplyByScalar(m,Math.cos(u)-1,scratchCartesianTwo),Cartesian3.multiplyByScalar(_,Math.sin(u),scratchCartesianThree),scratchCartesian$9),Cartesian3.magnitude(g),l),Cartesian3.add(g,l,g),Cartesian3.clone(p,i.position),Cartesian3.normalize(Cartesian3.subtract(g,p,scratchCartesian$9),i.direction),Cartesian3.clone(i.direction,i.direction),Cartesian3.cross(i.direction,i.up,i.right),Cartesian3.cross(i.right,i.direction,i.up),void i.setView(scratchZoomViewOptions)}a=!0}else{g=Cartesian3.normalize(h,scratchPositionNormal$2),p=Cartesian3.normalize(e._zoomWorldPosition,scratchPickNormal),h=Cartesian3.dot(p,g);0<h&&h<1&&(h=CesiumMath.acosClamped(h),p=Cartesian3.cross(p,g,scratchZoomAxis),g=o/(Math.abs(h)>CesiumMath.toRadians(20)?.75*i.positionCartographic.height:i.positionCartographic.height-o),i.rotate(p,h*g))}else a=!0}}e._rotatingZoom=!a}!s&&a||n?(r=SceneTransforms.wgs84ToWindowCoordinates(r,e._zoomWorldPosition,scratchZoomOffset),t=(c!==SceneMode$1.COLUMBUS_VIEW&&Cartesian2.equals(t,e._zoomMouseStart)&&defined(r)?i.getPickRay(r,scratchZoomPickRay):i.getPickRay(t,scratchZoomPickRay)).direction,c!==SceneMode$1.COLUMBUS_VIEW&&c!==SceneMode$1.SCENE2D||Cartesian3.fromElements(t.y,t.z,t.x,t),i.move(t,o),e._zoomingOnVector=!0):i.zoomIn(o),e._cameraUnderground||i.setView(scratchZoomViewOptions)}else i.zoomIn(o)}}var translate2DStart=new Ray,translate2DEnd=new Ray,scratchTranslateP0=new Cartesian3;function translate2D(e,t,i){var r=e._scene.camera,e=r.getPickRay(i.startPosition,translate2DStart).origin,i=r.getPickRay(i.endPosition,translate2DEnd).origin,e=Cartesian3.fromElements(e.y,e.z,e.x,e),i=Cartesian3.fromElements(i.y,i.z,i.x,i),e=Cartesian3.subtract(e,i,scratchTranslateP0),i=Cartesian3.magnitude(e);0<i&&(Cartesian3.normalize(e,e),r.move(e,i))}function zoom2D$1(e,t,i){defined(i.distance)&&(i=i.distance);var r=e._scene.camera;handleZoom(e,t,i,e._zoomFactor,r.getMagnitude())}var twist2DStart=new Cartesian2,twist2DEnd=new Cartesian2;function twist2D(e,t,i){var r,n,a;defined(i.angleAndHeight)?singleAxisTwist2D(e,t,i.angleAndHeight):(r=(a=e._scene).camera,t=(n=a.canvas).clientWidth,e=n.clientHeight,(a=twist2DStart).x=2/t*i.startPosition.x-1,a.y=2/e*(e-i.startPosition.y)-1,a=Cartesian2.normalize(a,a),(n=twist2DEnd).x=2/t*i.endPosition.x-1,n.y=2/e*(e-i.endPosition.y)-1,n=Cartesian2.normalize(n,n),i=CesiumMath.acosClamped(a.x),a.y<0&&(i=CesiumMath.TWO_PI-i),a=CesiumMath.acosClamped(n.x),n.y<0&&(a=CesiumMath.TWO_PI-a),i=a-i,r.twistRight(i))}function singleAxisTwist2D(e,t,i){var r=e._rotateFactor*e._rotateRateRangeAdjustment;r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);var n=e._scene,a=n.camera,n=n.canvas,n=(i.endPosition.x-i.startPosition.x)/n.clientWidth,n=r*(n=Math.min(n,e.maximumMovementRatio))*Math.PI*4;a.twistRight(n)}function update2D(e){var t=e._scene.mapMode2D===MapMode2D$1.ROTATE;Matrix4.equals(Matrix4.IDENTITY,e._scene.camera.transform)?(reactToInput(e,e.enableTranslate,e.translateEventTypes,translate2D,e.inertiaTranslate,"_lastInertiaTranslateMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom2D$1,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&reactToInput(e,e.enableRotate,e.tiltEventTypes,twist2D,e.inertiaSpin,"_lastInertiaTiltMovement")):(reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom2D$1,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&reactToInput(e,e.enableRotate,e.translateEventTypes,twist2D,e.inertiaSpin,"_lastInertiaSpinMovement"))}var pickGlobeScratchRay=new Ray,scratchDepthIntersection$1=new Cartesian3,scratchRayIntersection$1=new Cartesian3;function pickGlobe(e,t,i){var r=e._scene,n=e._globe,a=r.camera;if(defined(n)){var o,e=!e._cameraUnderground;r.pickPositionSupported&&(o=r.pickPositionWorldCoordinates(t,scratchDepthIntersection$1));t=a.getPickRay(t,pickGlobeScratchRay),e=n.pickWorldCoordinates(t,r,e,scratchRayIntersection$1);return(defined(o)?Cartesian3.distance(o,a.positionWC):Number.POSITIVE_INFINITY)<(defined(e)?Cartesian3.distance(e,a.positionWC):Number.POSITIVE_INFINITY)?Cartesian3.clone(o,i):Cartesian3.clone(e,i)}}var scratchDistanceCartographic=new Cartographic;function getDistanceFromSurface(e){var t=e._ellipsoid,i=e._scene,r=i.camera,n=0;i.mode===SceneMode$1.SCENE3D?defined(t=t.cartesianToCartographic(r.position,scratchDistanceCartographic))&&(n=t.height):n=r.position.z;e=defaultValue(e._scene.globeHeight,0);return Math.abs(e-n)}var scratchSurfaceNormal$1=new Cartesian3;function getZoomDistanceUnderground(e,t){var i=t.origin,t=t.direction,e=getDistanceFromSurface(e),i=Cartesian3.normalize(i,scratchSurfaceNormal$1),t=Math.abs(Cartesian3.dot(i,t));return e*(t=2*Math.max(t,.5))}function getTiltCenterUnderground(e,t,i,r){var n=Cartesian3.distance(t.origin,i),i=getDistanceFromSurface(e);return CesiumMath.clamp(5*i,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance)<n&&(n=Math.min(n,i/5),n=Math.max(n,100)),Ray.getPoint(t,n,r)}function getStrafeStartPositionUnderground(e,t,i,r){var n;return(!defined(i)||(n=Cartesian3.distance(t.origin,i))>e._maximumUndergroundPickDistance)&&(n=getDistanceFromSurface(e)),Ray.getPoint(t,n,r)}var scratchInertialDelta=new Cartesian2;function continueStrafing(e,t){var i=t.endPosition,r=Cartesian2.subtract(t.endPosition,t.startPosition,scratchInertialDelta),n=e._strafeEndMousePosition;Cartesian2.add(n,r,n),t.endPosition=n,strafe(e,t,e._strafeStartPosition),t.endPosition=i}var translateCVStartRay=new Ray,translateCVEndRay=new Ray,translateCVStartPos=new Cartesian3,translateCVEndPos=new Cartesian3,translateCVDifference=new Cartesian3,translateCVOrigin=new Cartesian3,translateCVPlane=new Plane(Cartesian3.UNIT_X,0),translateCVStartMouse=new Cartesian2,translateCVEndMouse=new Cartesian2;function translateCV(e,t,i){if(Cartesian3.equals(t,e._translateMousePosition)||(e._looking=!1),Cartesian3.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking)look3D(e,t,i);else if(e._strafing)continueStrafing(e,i);else{var r,n=e._scene.camera,a=e._cameraUnderground,o=Cartesian2.clone(i.startPosition,translateCVStartMouse),s=Cartesian2.clone(i.endPosition,translateCVEndMouse),l=n.getPickRay(o,translateCVStartRay),c=Cartesian3.clone(Cartesian3.ZERO,translateCVOrigin),u=Cartesian3.UNIT_X;if(n.position.z<e._minimumPickingTerrainHeight&&defined(r=pickGlobe(e,o,translateCVStartPos))&&(c.x=r.x),a||c.x>n.position.z&&defined(r)){var d=r;return a&&(d=getStrafeStartPositionUnderground(e,l,r,translateCVStartPos)),Cartesian2.clone(t,e._strafeMousePosition),Cartesian2.clone(t,e._strafeEndMousePosition),Cartesian3.clone(d,e._strafeStartPosition),e._strafing=!0,void strafe(e,i,e._strafeStartPosition)}u=Plane.fromPointNormal(c,u,translateCVPlane),l=n.getPickRay(o,translateCVStartRay),l=IntersectionTests.rayPlane(l,u,translateCVStartPos),s=n.getPickRay(s,translateCVEndRay),u=IntersectionTests.rayPlane(s,u,translateCVEndPos);if(!defined(l)||!defined(u))return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._translateMousePosition);l=Cartesian3.subtract(l,u,translateCVDifference),u=l.x;l.x=l.y,l.y=l.z,l.z=u;u=Cartesian3.magnitude(l);u>CesiumMath.EPSILON6&&(Cartesian3.normalize(l,l),n.move(l,u))}}var rotateCVWindowPos=new Cartesian2,rotateCVWindowRay=new Ray,rotateCVCenter=new Cartesian3,rotateCVVerticalCenter=new Cartesian3,rotateCVTransform=new Matrix4,rotateCVVerticalTransform=new Matrix4,rotateCVOrigin=new Cartesian3,rotateCVPlane=new Plane(Cartesian3.UNIT_X,0),rotateCVCartesian3=new Cartesian3,rotateCVCart=new Cartographic,rotateCVOldTransform=new Matrix4,rotateCVQuaternion=new Quaternion,rotateCVMatrix=new Matrix3,tilt3DCartesian3=new Cartesian3;function rotateCV(e,t,i){var r;defined(i.angleAndHeight)&&(i=i.angleAndHeight),Cartesian2.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking?look3D(e,t,i):(r=e._scene.camera,e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,rotateCVOnPlane(e,t,i)):rotateCVOnTerrain(e,t,i))}function rotateCVOnPlane(e,t,i){var r=e._scene,n=r.camera,a=r.canvas,o=rotateCVWindowPos;o.x=a.clientWidth/2,o.y=a.clientHeight/2;var s=n.getPickRay(o,rotateCVWindowRay),l=Cartesian3.UNIT_X,a=s.origin,o=s.direction,s=Cartesian3.dot(l,o);if(Math.abs(s)>CesiumMath.EPSILON6&&(c=-Cartesian3.dot(l,a)/s),!defined(c)||c<=0)return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._tiltCenterMousePosition);o=Cartesian3.multiplyByScalar(o,c,rotateCVCenter);Cartesian3.add(a,o,o);var c=r.mapProjection,a=c.ellipsoid;Cartesian3.fromElements(o.y,o.z,o.x,o);r=c.unproject(o,rotateCVCart);a.cartographicToCartesian(r,o);c=Transforms.eastNorthUpToFixedFrame(o,a,rotateCVTransform),r=e._globe,o=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;a=Matrix4.clone(n.transform,rotateCVOldTransform);n._setTransform(c),rotate3D(e,t,i,Cartesian3.UNIT_Z),n._setTransform(a),e._globe=r;o=(e._ellipsoid=o).maximumRadius;e._rotateFactor=1/o,e._rotateRateRangeAdjustment=o}function rotateCVOnTerrain(e,t,i){var r=e._scene,n=r.camera,a=e._cameraUnderground,o=Cartesian3.UNIT_X;if(Cartesian2.equals(t,e._tiltCenterMousePosition))h=Cartesian3.clone(e._tiltCenter,rotateCVCenter);else{if(n.position.z<e._minimumPickingTerrainHeight&&(h=pickGlobe(e,t,rotateCVCenter)),!defined(h)){var s=(d=n.getPickRay(t,rotateCVWindowRay)).origin,l=d.direction,c=Cartesian3.dot(o,l);if(Math.abs(c)>CesiumMath.EPSILON6&&(u=-Cartesian3.dot(o,s)/c),!defined(u)||u<=0)return e._looking=!0,look3D(e,t,i),void Cartesian2.clone(t,e._tiltCenterMousePosition);h=Cartesian3.multiplyByScalar(l,u,rotateCVCenter),Cartesian3.add(s,h,h)}a&&(defined(d)||(d=n.getPickRay(t,rotateCVWindowRay)),getTiltCenterUnderground(e,d,h,h)),Cartesian2.clone(t,e._tiltCenterMousePosition),Cartesian3.clone(h,e._tiltCenter)}var u=r.canvas,s=rotateCVWindowPos;s.x=u.clientWidth/2,s.y=e._tiltCenterMousePosition.y,d=n.getPickRay(s,rotateCVWindowRay);r=Cartesian3.clone(Cartesian3.ZERO,rotateCVOrigin);r.x=h.x;u=Plane.fromPointNormal(r,o,rotateCVPlane),s=IntersectionTests.rayPlane(d,u,rotateCVVerticalCenter),r=n._projection,o=r.ellipsoid;Cartesian3.fromElements(h.y,h.z,h.x,h);var d=r.unproject(h,rotateCVCart);o.cartographicToCartesian(d,h);var u=Transforms.eastNorthUpToFixedFrame(h,o,rotateCVTransform),h=defined(s)?(Cartesian3.fromElements(s.y,s.z,s.x,s),d=r.unproject(s,rotateCVCart),o.cartographicToCartesian(d,s),Transforms.eastNorthUpToFixedFrame(s,o,rotateCVVerticalTransform)):u,r=e._globe,d=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;s=Cartesian3.UNIT_Z,o=Matrix4.clone(n.transform,rotateCVOldTransform);n._setTransform(u);u=Cartesian3.cross(Cartesian3.UNIT_Z,Cartesian3.normalize(n.position,rotateCVCartesian3),rotateCVCartesian3),u=Cartesian3.dot(n.right,u);rotate3D(e,t,i,s,!1,!0),n._setTransform(h),u<0?(u=i.startPosition.y-i.endPosition.y,(a&&u<0||!a&&0<u)&&(s=void 0),u=n.constrainedAxis,rotate3D(e,t,i,s,!(n.constrainedAxis=void 0),!1),n.constrainedAxis=u):rotate3D(e,t,i,s,!0,!1),defined(n.constrainedAxis)&&(s=Cartesian3.cross(n.direction,n.constrainedAxis,tilt3DCartesian3),Cartesian3.equalsEpsilon(s,Cartesian3.ZERO,CesiumMath.EPSILON6)||(Cartesian3.dot(s,n.right)<0&&Cartesian3.negate(s,s),Cartesian3.cross(s,n.direction,n.up),Cartesian3.cross(n.direction,n.up,n.right),Cartesian3.normalize(n.up,n.up),Cartesian3.normalize(n.right,n.right))),n._setTransform(o),e._globe=r;d=(e._ellipsoid=d).maximumRadius;e._rotateFactor=1/d,e._rotateRateRangeAdjustment=d;d=Cartesian3.clone(n.positionWC,rotateCVCartesian3);e.enableCollisionDetection&&adjustHeightForTerrain(e),Cartesian3.equals(n.positionWC,d)||(n._setTransform(h),n.worldToCameraCoordinatesPoint(d,d),h=Cartesian3.magnitudeSquared(d),Cartesian3.magnitudeSquared(n.position)>h&&(Cartesian3.normalize(n.position,n.position),Cartesian3.multiplyByScalar(n.position,Math.sqrt(h),n.position)),h=Cartesian3.angleBetween(d,n.position),d=Cartesian3.cross(d,n.position,d),Cartesian3.normalize(d,d),h=Quaternion.fromAxisAngle(d,h,rotateCVQuaternion),h=Matrix3.fromQuaternion(h,rotateCVMatrix),Matrix3.multiplyByVector(h,n.direction,n.direction),Matrix3.multiplyByVector(h,n.up,n.up),Cartesian3.cross(n.direction,n.up,n.right),Cartesian3.cross(n.right,n.direction,n.up),n._setTransform(o))}var zoomCVWindowPos=new Cartesian2,zoomCVWindowRay=new Ray,zoomCVIntersection=new Cartesian3;function zoomCV(e,t,i){defined(i.distance)&&(i=i.distance);var r,n=e._scene,a=n.camera,o=n.canvas,s=e._cameraUnderground;s?r=t:((r=zoomCVWindowPos).x=o.clientWidth/2,r.y=o.clientHeight/2);var l,c,u,d=a.getPickRay(r,zoomCVWindowRay),n=d.origin,o=d.direction;a.position.z<e._minimumPickingTerrainHeight&&(l=pickGlobe(e,r,zoomCVIntersection)),defined(l)&&(c=Cartesian3.distance(n,l)),s&&(u=getZoomDistanceUnderground(e,d),c=defined(c)?Math.min(c,u):u),defined(c)||(u=Cartesian3.UNIT_X,c=-Cartesian3.dot(u,n)/Cartesian3.dot(u,o)),handleZoom(e,t,i,e._zoomFactor,c)}function updateCV(e){var t,i=e._scene.camera;Matrix4.equals(Matrix4.IDENTITY,i.transform)?(t=e._tweens,e._aggregator.anyButtonDown&&t.removeAll(),reactToInput(e,e.enableTilt,e.tiltEventTypes,rotateCV,e.inertiaSpin,"_lastInertiaTiltMovement"),reactToInput(e,e.enableTranslate,e.translateEventTypes,translateCV,e.inertiaTranslate,"_lastInertiaTranslateMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoomCV,e.inertiaZoom,"_lastInertiaZoomMovement"),reactToInput(e,e.enableLook,e.lookEventTypes,look3D),e._aggregator.anyButtonDown||t.contains(e._tween)||defined(i=i.createCorrectPositionTween(e.bounceAnimationTime))&&(e._tween=t.add(i)),t.update()):(reactToInput(e,e.enableRotate,e.rotateEventTypes,rotate3D,e.inertiaSpin,"_lastInertiaSpinMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom3D$1,e.inertiaZoom,"_lastInertiaZoomMovement"))}var scratchStrafeRay=new Ray,scratchStrafePlane=new Plane(Cartesian3.UNIT_X,0),scratchStrafeIntersection=new Cartesian3,scratchStrafeDirection=new Cartesian3,scratchMousePos=new Cartesian3;function strafe(e,t,i){var r=e._scene,n=r.camera,a=n.getPickRay(t.endPosition,scratchStrafeRay),e=Cartesian3.clone(n.direction,scratchStrafeDirection);r.mode===SceneMode$1.COLUMBUS_VIEW&&Cartesian3.fromElements(e.z,e.x,e.y,e);t=Plane.fromPointNormal(i,e,scratchStrafePlane),t=IntersectionTests.rayPlane(a,t,scratchStrafeIntersection);defined(t)&&(e=Cartesian3.subtract(i,t,e),r.mode===SceneMode$1.COLUMBUS_VIEW&&Cartesian3.fromElements(e.y,e.z,e.x,e),Cartesian3.add(n.position,e,n.position))}var spin3DPick=new Cartesian3,scratchCartographic$f=new Cartographic,scratchRadii$2=new Cartesian3,scratchEllipsoid$e=new Ellipsoid,scratchLookUp=new Cartesian3,scratchNormal$7=new Cartesian3;function spin3D(e,t,i){var r=e._scene.camera,n=e._cameraUnderground,a=e._ellipsoid;if(Matrix4.equals(r.transform,Matrix4.IDENTITY)){var o,s,l=a.geodeticSurfaceNormal(r.position,scratchLookUp);if(Cartesian2.equals(t,e._rotateMousePosition))if(e._looking)look3D(e,t,i,l);else if(e._rotating)rotate3D(e,t,i);else if(e._strafing)continueStrafing(e,i);else{if(Cartesian3.magnitude(r.position)<Cartesian3.magnitude(e._rotateStartPosition))return;o=Cartesian3.magnitude(e._rotateStartPosition),(s=scratchRadii$2).x=s.y=s.z=o,pan3D(e,t,i,a=Ellipsoid.fromCartesian3(s,scratchEllipsoid$e))}else{e._looking=!1,e._rotating=!1,e._strafing=!1;var c,u,d,h=a.cartesianToCartographic(r.positionWC,scratchCartographic$f).height;defined(e._globe)&&h<e._minimumPickingTerrainHeight?defined(c=pickGlobe(e,i.startPosition,scratchMousePos))?(d=!1,u=r.getPickRay(i.startPosition,pickGlobeScratchRay),n?(d=!0,getStrafeStartPositionUnderground(e,u,c,c)):(n=a.geodeticSurfaceNormal(c,scratchNormal$7),d=Math.abs(Cartesian3.dot(u.direction,n))<.05||Cartesian3.magnitude(r.position)<Cartesian3.magnitude(c)),d?(Cartesian2.clone(t,e._strafeEndMousePosition),Cartesian3.clone(c,e._strafeStartPosition),e._strafing=!0,strafe(e,i,e._strafeStartPosition)):(o=Cartesian3.magnitude(c),(s=scratchRadii$2).x=s.y=s.z=o,pan3D(e,t,i,a=Ellipsoid.fromCartesian3(s,scratchEllipsoid$e)),Cartesian3.clone(c,e._rotateStartPosition))):(e._looking=!0,look3D(e,t,i,l)):defined(r.pickEllipsoid(i.startPosition,e._ellipsoid,spin3DPick))?(pan3D(e,t,i,e._ellipsoid),Cartesian3.clone(spin3DPick,e._rotateStartPosition)):h>e._minimumTrackBallHeight?(e._rotating=!0,rotate3D(e,t,i)):(e._looking=!0,look3D(e,t,i,l)),Cartesian2.clone(t,e._rotateMousePosition)}}else rotate3D(e,t,i)}function rotate3D(e,t,i,r,n,a){n=defaultValue(n,!1),a=defaultValue(a,!1);var o=e._scene,s=o.camera,l=o.canvas,c=s.constrainedAxis;defined(r)&&(s.constrainedAxis=r);o=Cartesian3.magnitude(s.position),r=e._rotateFactor*(o-e._rotateRateRangeAdjustment);r>e._maximumRotateRate&&(r=e._maximumRotateRate),r<e._minimumRotateRate&&(r=e._minimumRotateRate);o=(i.startPosition.x-i.endPosition.x)/l.clientWidth,l=(i.startPosition.y-i.endPosition.y)/l.clientHeight,o=Math.min(o,e.maximumMovementRatio),l=Math.min(l,e.maximumMovementRatio),o=r*o*Math.PI*2,l=r*l*Math.PI;n||s.rotateRight(o),a||s.rotateUp(l),s.constrainedAxis=c}var pan3DP0=Cartesian4.clone(Cartesian4.UNIT_W),pan3DP1=Cartesian4.clone(Cartesian4.UNIT_W),pan3DTemp0=new Cartesian3,pan3DTemp1=new Cartesian3,pan3DTemp2=new Cartesian3,pan3DTemp3=new Cartesian3,pan3DStartMousePosition=new Cartesian2,pan3DEndMousePosition=new Cartesian2;function pan3D(e,t,i,r){var n,a,o=e._scene.camera,s=Cartesian2.clone(i.startPosition,pan3DStartMousePosition),l=Cartesian2.clone(i.endPosition,pan3DEndMousePosition),c=o.pickEllipsoid(s,r,pan3DP0),u=o.pickEllipsoid(l,r,pan3DP1);if(!defined(c)||!defined(u))return e._rotating=!0,void rotate3D(e,t,i);c=o.worldToCameraCoordinates(c,c),u=o.worldToCameraCoordinates(u,u),defined(o.constrainedAxis)?(n=o.constrainedAxis,s=Cartesian3.mostOrthogonalAxis(n,pan3DTemp0),Cartesian3.cross(s,n,s),Cartesian3.normalize(s,s),l=Cartesian3.cross(n,s,pan3DTemp1),r=Cartesian3.magnitude(c),a=Cartesian3.dot(n,c),e=Math.acos(a/r),t=Cartesian3.multiplyByScalar(n,a,pan3DTemp2),Cartesian3.subtract(c,t,t),Cartesian3.normalize(t,t),i=Cartesian3.magnitude(u),r=Cartesian3.dot(n,u),a=Math.acos(r/i),i=Cartesian3.multiplyByScalar(n,r,pan3DTemp3),Cartesian3.subtract(u,i,i),Cartesian3.normalize(i,i),r=Math.acos(Cartesian3.dot(t,s)),Cartesian3.dot(t,l)<0&&(r=CesiumMath.TWO_PI-r),s=Math.acos(Cartesian3.dot(i,s)),Cartesian3.dot(i,l)<0&&(s=CesiumMath.TWO_PI-s),l=r-s,r=Cartesian3.equalsEpsilon(n,o.position,CesiumMath.EPSILON2)?o.right:Cartesian3.cross(n,o.position,pan3DTemp0),s=Cartesian3.cross(n,r,pan3DTemp0),r=Cartesian3.dot(s,Cartesian3.subtract(c,n,pan3DTemp1)),s=Cartesian3.dot(s,Cartesian3.subtract(u,n,pan3DTemp1)),a=0<r&&0<s?a-e:0<r&&s<=0?0<Cartesian3.dot(o.position,n)?-e-a:e+a:e-a,o.rotateRight(l),o.rotateUp(a)):(Cartesian3.normalize(c,c),Cartesian3.normalize(u,u),a=Cartesian3.dot(c,u),u=Cartesian3.cross(c,u,pan3DTemp0),a<1&&!Cartesian3.equalsEpsilon(u,Cartesian3.ZERO,CesiumMath.EPSILON14)&&(a=Math.acos(a),o.rotate(u,a)))}var zoom3DUnitPosition=new Cartesian3,zoom3DCartographic=new Cartographic;function zoom3D$1(e,t,i){defined(i.distance)&&(i=i.distance);var r,n=e._ellipsoid,a=e._scene,o=a.camera,s=a.canvas,a=e._cameraUnderground;a?r=t:((r=zoomCVWindowPos).x=s.clientWidth/2,r.y=s.clientHeight/2);var l,c,s=o.getPickRay(r,zoomCVWindowRay),n=n.cartesianToCartographic(o.position,zoom3DCartographic).height;n<e._minimumPickingTerrainHeight&&(l=pickGlobe(e,r,zoomCVIntersection)),defined(l)&&(c=Cartesian3.distance(s.origin,l)),a&&(s=getZoomDistanceUnderground(e,s),c=defined(c)?Math.min(c,s):s),defined(c)||(c=n);n=Cartesian3.normalize(o.position,zoom3DUnitPosition);handleZoom(e,t,i,e._zoomFactor,c,Cartesian3.dot(n,o.direction))}var tilt3DWindowPos=new Cartesian2,tilt3DRay=new Ray,tilt3DCenter=new Cartesian3,tilt3DVerticalCenter=new Cartesian3,tilt3DTransform=new Matrix4,tilt3DVerticalTransform=new Matrix4,tilt3DOldTransform=new Matrix4,tilt3DQuaternion=new Quaternion,tilt3DMatrix=new Matrix3,tilt3DCart=new Cartographic,tilt3DLookUp=new Cartesian3;function tilt3D(e,t,i){var r,n=e._scene.camera;Matrix4.equals(n.transform,Matrix4.IDENTITY)&&(defined(i.angleAndHeight)&&(i=i.angleAndHeight),Cartesian2.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking?(r=e._ellipsoid.geodeticSurfaceNormal(n.position,tilt3DLookUp),look3D(e,t,i,r)):(n=e._ellipsoid.cartesianToCartographic(n.position,tilt3DCart),e._tiltOnEllipsoid||n.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,tilt3DOnEllipsoid(e,t,i)):tilt3DOnTerrain(e,t,i)))}var tilt3DOnEllipsoidCartographic=new Cartographic;function tilt3DOnEllipsoid(e,t,i){var r=e._ellipsoid,n=e._scene,a=n.camera,o=.25*e.minimumZoomDistance,s=r.cartesianToCartographic(a.positionWC,tilt3DOnEllipsoidCartographic).height;if(!(s-o-1<CesiumMath.EPSILON3&&i.endPosition.y-i.startPosition.y<0)){o=n.canvas,n=tilt3DWindowPos;n.x=o.clientWidth/2,n.y=o.clientHeight/2;o=a.getPickRay(n,tilt3DRay),n=IntersectionTests.rayEllipsoid(o,r);if(defined(n))u=Ray.getPoint(o,n.start,tilt3DCenter);else{if(!(s>e._minimumTrackBallHeight)){e._looking=!0;var l=e._ellipsoid.geodeticSurfaceNormal(a.position,tilt3DLookUp);return look3D(e,t,i,l),void Cartesian2.clone(t,e._tiltCenterMousePosition)}var c=IntersectionTests.grazingAltitudeLocation(o,r);if(!defined(c))return;l=r.cartesianToCartographic(c,tilt3DCart);l.height=0,u=r.cartographicToCartesian(l,tilt3DCenter)}var c=Transforms.eastNorthUpToFixedFrame(u,r,tilt3DTransform),l=e._globe,u=e._ellipsoid;e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;r=Matrix4.clone(a.transform,tilt3DOldTransform);a._setTransform(c),rotate3D(e,t,i,Cartesian3.UNIT_Z),a._setTransform(r),e._globe=l;u=(e._ellipsoid=u).maximumRadius;e._rotateFactor=1/u,e._rotateRateRangeAdjustment=u}}function tilt3DOnTerrain(e,t,i){var r=e._ellipsoid,n=e._scene,a=n.camera,o=e._cameraUnderground;if(Cartesian2.equals(t,e._tiltCenterMousePosition))d=Cartesian3.clone(e._tiltCenter,tilt3DCenter);else{if(!defined(d=pickGlobe(e,t,tilt3DCenter))){var s=a.getPickRay(t,tilt3DRay),l=IntersectionTests.rayEllipsoid(s,r);if(!defined(l))return void(r.cartesianToCartographic(a.position,tilt3DCart).height<=e._minimumTrackBallHeight&&(e._looking=!0,u=e._ellipsoid.geodeticSurfaceNormal(a.position,tilt3DLookUp),look3D(e,t,i,u),Cartesian2.clone(t,e._tiltCenterMousePosition)));d=Ray.getPoint(s,l.start,tilt3DCenter)}o&&(defined(s)||(s=a.getPickRay(t,tilt3DRay)),getTiltCenterUnderground(e,s,d,d)),Cartesian2.clone(t,e._tiltCenterMousePosition),Cartesian3.clone(d,e._tiltCenter)}var c=n.canvas,u=tilt3DWindowPos;u.x=c.clientWidth/2,u.y=e._tiltCenterMousePosition.y,s=a.getPickRay(u,tilt3DRay);var d,n=Cartesian3.magnitude(d),c=Cartesian3.fromElements(n,n,n,scratchRadii$2),u=Ellipsoid.fromCartesian3(c,scratchEllipsoid$e);defined(l=IntersectionTests.rayEllipsoid(s,u))&&(c=Cartesian3.magnitude(s.origin)>n?l.start:l.stop,n=Ray.getPoint(s,c,tilt3DVerticalCenter),l=Transforms.eastNorthUpToFixedFrame(d,r,tilt3DTransform),s=Transforms.eastNorthUpToFixedFrame(n,u,tilt3DVerticalTransform),c=e._globe,d=e._ellipsoid,e._globe=void 0,e._ellipsoid=Ellipsoid.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1,r=Cartesian3.UNIT_Z,u=Matrix4.clone(a.transform,tilt3DOldTransform),a._setTransform(l),n=Cartesian3.cross(n,a.positionWC,tilt3DCartesian3),n=Cartesian3.dot(a.rightWC,n),rotate3D(e,t,i,r,!1,!0),a._setTransform(s),n<0?(n=i.startPosition.y-i.endPosition.y,(o&&n<0||!o&&0<n)&&(r=void 0),n=a.constrainedAxis,rotate3D(e,t,i,r,!(a.constrainedAxis=void 0),!1),a.constrainedAxis=n):rotate3D(e,t,i,r,!0,!1),defined(a.constrainedAxis)&&(r=Cartesian3.cross(a.direction,a.constrainedAxis,tilt3DCartesian3),Cartesian3.equalsEpsilon(r,Cartesian3.ZERO,CesiumMath.EPSILON6)||(Cartesian3.dot(r,a.right)<0&&Cartesian3.negate(r,r),Cartesian3.cross(r,a.direction,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.normalize(a.up,a.up),Cartesian3.normalize(a.right,a.right))),a._setTransform(u),e._globe=c,d=(e._ellipsoid=d).maximumRadius,e._rotateFactor=1/d,e._rotateRateRangeAdjustment=d,d=Cartesian3.clone(a.positionWC,tilt3DCartesian3),e.enableCollisionDetection&&adjustHeightForTerrain(e),Cartesian3.equals(a.positionWC,d)||(a._setTransform(s),a.worldToCameraCoordinatesPoint(d,d),s=Cartesian3.magnitudeSquared(d),Cartesian3.magnitudeSquared(a.position)>s&&(Cartesian3.normalize(a.position,a.position),Cartesian3.multiplyByScalar(a.position,Math.sqrt(s),a.position)),s=Cartesian3.angleBetween(d,a.position),d=Cartesian3.cross(d,a.position,d),Cartesian3.normalize(d,d),s=Quaternion.fromAxisAngle(d,s,tilt3DQuaternion),s=Matrix3.fromQuaternion(s,tilt3DMatrix),Matrix3.multiplyByVector(s,a.direction,a.direction),Matrix3.multiplyByVector(s,a.up,a.up),Cartesian3.cross(a.direction,a.up,a.right),Cartesian3.cross(a.right,a.direction,a.up),a._setTransform(u)))}var look3DStartPos=new Cartesian2,look3DEndPos=new Cartesian2,look3DStartRay=new Ray,look3DEndRay=new Ray,look3DNegativeRot=new Cartesian3,look3DTan=new Cartesian3;function look3D(e,t,i,r){var n=e._scene.camera,a=look3DStartPos;a.x=i.startPosition.x,a.y=0;var o=look3DEndPos;o.x=i.endPosition.x,o.y=0;var s=n.getPickRay(a,look3DStartRay),l=n.getPickRay(o,look3DEndRay),c=0;n.frustum instanceof OrthographicFrustum?(h=s.origin,d=l.origin,Cartesian3.add(n.direction,h,h),Cartesian3.add(n.direction,d,d),Cartesian3.subtract(h,n.position,h),Cartesian3.subtract(d,n.position,d),Cartesian3.normalize(h,h),Cartesian3.normalize(d,d)):(h=s.direction,d=l.direction);var u=Cartesian3.dot(h,d);u<1&&(c=Math.acos(u)),c=i.startPosition.x>i.endPosition.x?-c:c;var d,h,e=e._horizontalRotationAxis;defined(r)?n.look(r,-c):defined(e)?n.look(e,-c):n.lookLeft(c),a.x=0,a.y=i.startPosition.y,o.x=0,o.y=i.endPosition.y,s=n.getPickRay(a,look3DStartRay),l=n.getPickRay(o,look3DEndRay),c=0,n.frustum instanceof OrthographicFrustum?(h=s.origin,d=l.origin,Cartesian3.add(n.direction,h,h),Cartesian3.add(n.direction,d,d),Cartesian3.subtract(h,n.position,h),Cartesian3.subtract(d,n.position,d),Cartesian3.normalize(h,h),Cartesian3.normalize(d,d)):(h=s.direction,d=l.direction),(u=Cartesian3.dot(h,d))<1&&(c=Math.acos(u)),c=i.startPosition.y>i.endPosition.y?-c:c,defined(r=defaultValue(r,e))?(h=n.direction,d=Cartesian3.negate(r,look3DNegativeRot),i=Cartesian3.equalsEpsilon(h,r,CesiumMath.EPSILON2),e=Cartesian3.equalsEpsilon(h,d,CesiumMath.EPSILON2),i||e?(i&&c<0||e&&0<c)&&n.look(n.right,-c):(u=Cartesian3.dot(h,r),e=CesiumMath.acosClamped(u),0<c&&e<c&&(c=e-CesiumMath.EPSILON4),u=Cartesian3.dot(h,d),e=CesiumMath.acosClamped(u),c<0&&e<-c&&(c=-e+CesiumMath.EPSILON4),h=Cartesian3.cross(r,h,look3DTan),n.look(h,c))):n.lookUp(c)}function update3D(e){reactToInput(e,e.enableRotate,e.rotateEventTypes,spin3D,e.inertiaSpin,"_lastInertiaSpinMovement"),reactToInput(e,e.enableZoom,e.zoomEventTypes,zoom3D$1,e.inertiaZoom,"_lastInertiaZoomMovement"),reactToInput(e,e.enableTilt,e.tiltEventTypes,tilt3D,e.inertiaSpin,"_lastInertiaTiltMovement"),reactToInput(e,e.enableLook,e.lookEventTypes,look3D)}var scratchAdjustHeightTransform=new Matrix4,scratchAdjustHeightCartographic=new Cartographic;function adjustHeightForTerrain(e){e._adjustedHeightForTerrain=!0;var t,i,r,n,a,o,s=e._scene,l=s.mode,c=s.globe;defined(c)&&l!==SceneMode$1.SCENE2D&&l!==SceneMode$1.MORPHING&&(t=s.camera,i=c.ellipsoid,r=s.mapProjection,Matrix4.equals(t.transform,Matrix4.IDENTITY)||(n=Matrix4.clone(t.transform,scratchAdjustHeightTransform),a=Cartesian3.magnitude(t.position),t._setTransform(Matrix4.IDENTITY)),o=scratchAdjustHeightCartographic,l===SceneMode$1.SCENE3D?i.cartesianToCartographic(t.position,o):r.unproject(t.position,o),c=!1,o.height<e._minimumCollisionTerrainHeight&&(defined(s=e._scene.globeHeight)&&(s=s+e.minimumZoomDistance,o.height<s&&(o.height=s,l===SceneMode$1.SCENE3D?i.cartographicToCartesian(o,t.position):r.project(o,t.position),c=!0))),defined(n)&&(t._setTransform(n),c&&(Cartesian3.normalize(t.position,t.position),Cartesian3.negate(t.position,t.direction),Cartesian3.multiplyByScalar(t.position,Math.max(a,e.minimumZoomDistance),t.position),Cartesian3.normalize(t.direction,t.direction),Cartesian3.cross(t.direction,t.up,t.right),Cartesian3.cross(t.right,t.direction,t.up))))}ScreenSpaceCameraController.prototype.onMap=function(){var e=this._scene,t=e.mode,e=e.camera;return t!==SceneMode$1.COLUMBUS_VIEW||Math.abs(e.position.x)-this._maxCoord.x<0&&Math.abs(e.position.y)-this._maxCoord.y<0};var scratchPreviousPosition=new Cartesian3,scratchPreviousDirection=new Cartesian3;ScreenSpaceCameraController.prototype.update=function(){var e=this._scene,t=e.camera,i=e.globe,r=e.mode;Matrix4.equals(t.transform,Matrix4.IDENTITY)?(this._globe=i,this._ellipsoid=(defined(this._globe)?this._globe:e.mapProjection).ellipsoid):(this._globe=void 0,this._ellipsoid=Ellipsoid.UNIT_SPHERE),this._cameraUnderground=e.cameraUnderground&&defined(this._globe),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*e.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*e.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*e.terrainExaggeration;i=this._ellipsoid.maximumRadius;this._rotateFactor=1/i,this._rotateRateRangeAdjustment=i,this._adjustedHeightForTerrain=!1;e=Cartesian3.clone(t.positionWC,scratchPreviousPosition),i=Cartesian3.clone(t.directionWC,scratchPreviousDirection);r===SceneMode$1.SCENE2D?update2D(this):r===SceneMode$1.COLUMBUS_VIEW?(this._horizontalRotationAxis=Cartesian3.UNIT_Z,updateCV(this)):r===SceneMode$1.SCENE3D&&(this._horizontalRotationAxis=void 0,update3D(this)),!this.enableCollisionDetection||this._adjustedHeightForTerrain||Cartesian3.equals(e,t.positionWC)&&Cartesian3.equals(i,t.directionWC)||adjustHeightForTerrain(this),this._aggregator.reset()},ScreenSpaceCameraController.prototype.isDestroyed=function(){return!1},ScreenSpaceCameraController.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),destroyObject(this)};var AdditiveBlend="uniform sampler2D colorTexture;\nuniform sampler2D colorTexture2;\nuniform vec2 center;\nuniform float radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(colorTexture, v_textureCoordinates);\nvec4 color1 = texture2D(colorTexture2, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - center) / radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color1, t);\n}\n",BrightPass="uniform sampler2D colorTexture;\nuniform float avgLuminance;\nuniform float threshold;\nuniform float offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(colorTexture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(avgLuminance) * luminance / avgLuminance;\nfloat brightLum = max(scaledLum - threshold, 0.0);\nfloat brightness = brightLum / (offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n";function SunPostProcess(){this._sceneFramebuffer=new SceneFramebuffer;var e=new Array(6);e[0]=new PostProcessStage({fragmentShader:PassThrough,textureScale:.125,forcePowerOfTwo:!0,sampleMode:PostProcessStageSampleMode.LINEAR});var t=e[1]=new PostProcessStage({fragmentShader:BrightPass,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:.125,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new Cartesian2,e[2]=new PostProcessStage({fragmentShader:GaussianBlur1D,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/t.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:.125,forcePowerOfTwo:!0}),e[3]=new PostProcessStage({fragmentShader:GaussianBlur1D,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/t.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:.125,forcePowerOfTwo:!0}),e[4]=new PostProcessStage({fragmentShader:PassThrough,sampleMode:PostProcessStageSampleMode.LINEAR}),this._uCenter=new Cartesian2,this._uRadius=void 0,e[5]=new PostProcessStage({fragmentShader:AdditiveBlend,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.getFramebuffer().getColorTexture(0)}}}),this._stages=new PostProcessStageComposite({stages:e});for(var r=new PostProcessStageTextureCache(this),n=e.length,a=0;a<n;++a)e[a]._textureCache=r;this._textureCache=r,this.length=e.length}SunPostProcess.prototype.get=function(e){return this._stages.get(e)},SunPostProcess.prototype.getStageByName=function(e){for(var t=this._stages.length,i=0;i<t;++i){var r=this._stages.get(i);if(r.name===e)return r}};var sunPositionECScratch=new Cartesian4,sunPositionWCScratch=new Cartesian2,sizeScratch=new Cartesian2,postProcessMatrix4Scratch=new Matrix4;function updateSunPosition(e,t,i){var r=t.uniformState,n=r.sunPositionWC,a=r.view,o=r.viewProjection,s=r.projection,l=Matrix4.computeViewportTransformation(i,0,1,postProcessMatrix4Scratch),c=Matrix4.multiplyByPoint(a,n,sunPositionECScratch),u=Transforms.pointToGLWindowCoordinates(o,l,n,sunPositionWCScratch);c.x+=CesiumMath.SOLAR_RADIUS;r=Transforms.pointToGLWindowCoordinates(s,l,c,c),i=30*Cartesian2.magnitude(Cartesian2.subtract(r,u,r))*2,a=sizeScratch;a.x=i,a.y=i,e._uCenter=Cartesian2.clone(u,e._uCenter),e._uRadius=.15*Math.max(a.x,a.y);var s=t.drawingBufferWidth,c=t.drawingBufferHeight,d=e._stages,r=d.get(0),i=r.outputTexture.width,t=r.outputTexture.height,e=new BoundingRectangle;e.width=i,e.height=t,l=Matrix4.computeViewportTransformation(e,0,1,postProcessMatrix4Scratch),u=Transforms.pointToGLWindowCoordinates(o,l,n,sunPositionWCScratch),a.x*=i/s,a.y*=t/c;var h=r.scissorRectangle;h.x=Math.max(u.x-.5*a.x,0),h.y=Math.max(u.y-.5*a.y,0),h.width=Math.min(a.x,s),h.height=Math.min(a.y,c);for(var p=1;p<4;++p)BoundingRectangle.clone(h,d.get(p).scissorRectangle)}SunPostProcess.prototype.clear=function(e,t,i){this._sceneFramebuffer.clear(e,t,i),this._textureCache.clear(e)},SunPostProcess.prototype.update=function(e){var t=e.context,i=e.viewport,e=this._sceneFramebuffer;e.update(t,i);e=e.getFramebuffer();return this._textureCache.update(t),this._stages.update(t,!1),updateSunPosition(this,t,i),e},SunPostProcess.prototype.execute=function(e){var t=this._sceneFramebuffer.getFramebuffer().getColorTexture(0),i=this._stages,r=i.length;i.get(0).execute(e,t);for(var n=1;n<r;++n)i.get(n).execute(e,i.get(n-1).outputTexture)},SunPostProcess.prototype.copy=function(e,t){var i;defined(this._copyColorCommand)||((i=this)._copyColorCommand=e.createViewportQuadCommand(PassThrough,{uniformMap:{colorTexture:function(){return i._stages.get(i._stages.length-1).outputTexture}},owner:this})),this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)},SunPostProcess.prototype.isDestroyed=function(){return!1},SunPostProcess.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),destroyObject(this)};var requestRenderAfterFrame=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Scene(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).canvas,i=e.creditContainer,r=e.creditViewport,n=clone(e.contextOptions);defined(n)||(n={}),defined(n.webgl)||(n.webgl={}),n.webgl.powerPreference=defaultValue(n.webgl.powerPreference,"high-performance");var a=defined(i),n=new Context(t,n);a||((i=document.createElement("div")).style.position="absolute",i.style.bottom="0",i.style["text-shadow"]="0 0 2px #000000",i.style.color="#ffffff",i.style["font-size"]="10px",i.style["padding-right"]="5px",t.parentNode.appendChild(i)),defined(r)||(r=t.parentNode),this._id=createGuid(),this._jobScheduler=new JobScheduler,this._frameState=new FrameState(n,new CreditDisplay(i," • ",r),this._jobScheduler),this._frameState.scene3DOnly=defaultValue(e.scene3DOnly,!1),this._removeCreditContainer=!a,this._creditContainer=i,this._canvas=t,this._context=n,this._computeEngine=new ComputeEngine(n),this._globe=void 0,this._globeTranslucencyState=new GlobeTranslucencyState,this._primitives=new PrimitiveCollection,this._groundPrimitives=new PrimitiveCollection,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=n.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new TweenCollection,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=defaultValue(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new DepthPlane,this._clearColorCommand=new ClearCommand({color:new Color,stencil:0,owner:this}),this._depthClearCommand=new ClearCommand({depth:1,owner:this}),this._stencilClearCommand=new ClearCommand({stencil:0}),this._classificationStencilClearCommand=new ClearCommand({stencil:0,renderState:RenderState.fromCache({stencilMask:StencilConstants$1.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new SceneTransitioner(this),this._preUpdate=new Event,this._postUpdate=new Event,this._renderError=new Event,this._preRender=new Event,this._postRender=new Event,this._minimumDisableDepthTestDistance=0,this._debugInspector=new DebugInspector,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new Event,this.morphComplete=new Event,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=Color.clone(Color.BLACK),this._mode=SceneMode$1.SCENE3D,this._mapProjection=defined(e.mapProjection)?e.mapProjection:new GeographicProjection,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new Fog,this._shadowMapCamera=new Camera(this),this.shadowMap=new ShadowMap({context:n,lightCamera:this._shadowMapCamera,enabled:defaultValue(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=Color.clone(Color.WHITE),this._actualInvertClassificationColor=Color.clone(this._invertClassificationColor),this._invertClassification=new InvertClassification,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new PostProcessStageCollection,this._brdfLutGenerator=new BrdfLutGenerator,this._terrainExaggeration=defaultValue(e.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new ScreenSpaceCameraController(this),this._cameraUnderground=!1,this._mapMode2D=defaultValue(e.mapMode2D,MapMode2D$1.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,separatePrimitiveFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=defaultValue(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=defaultValue(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=RequestScheduler.requestCompletedEvent.addEventListener(requestRenderAfterFrame(this)),this._removeTaskProcessorListenerCallback=TaskProcessor.taskCompletedEvent.addEventListener(requestRenderAfterFrame(this)),this._removeGlobeCallbacks=[];e=new BoundingRectangle(0,0,n.drawingBufferWidth,n.drawingBufferHeight),n=new Camera(this);this._logDepthBuffer&&(n.frustum.near=.1,n.frustum.far=1e10),this.preloadFlightCamera=new Camera(this),this.preloadFlightCullingVolume=void 0,this._picking=new Picking(this),this._defaultView=new View(this,n,e),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new SunLight,updateFrameNumber(this,0,JulianDate.now()),this.updateFrameState(),this.initializeFrame()}function updateGlobeListeners(e,t){for(var i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;var r=[];defined(t)&&(r.push(t.imageryLayersUpdatedEvent.addEventListener(requestRenderAfterFrame(e))),r.push(t.terrainProviderChanged.addEventListener(requestRenderAfterFrame(e)))),e._removeGlobeCallbacks=r}function updateDerivedCommands$1(e,t,i){var r=e._frameState,n=e._context,a=e._view.oit,o=r.shadowState.lightShadowMaps,s=r.shadowState.lightShadowsEnabled,r=t.derivedCommands;defined(t.pickId)&&(r.picking=DerivedCommand.createPickDerivedCommand(e,t,n,r.picking)),t.pickOnly||(r.depth=DerivedCommand.createDepthOnlyDerivedCommand(e,t,n,r.depth)),r.originalCommand=t,e._hdr&&(r.hdr=DerivedCommand.createHdrCommand(t,n,r.hdr),r=(t=r.hdr.command).derivedCommands),s&&t.receiveShadows&&(r.shadows=ShadowMap.createReceiveDerivedCommand(o,t,i,n,r.shadows)),t.pass===Pass$1.TRANSLUCENT&&defined(a)&&a.isSupported()&&(s&&t.receiveShadows?(r.oit=defined(r.oit)?r.oit:{},r.oit.shadows=a.createDerivedCommands(r.shadows.receiveCommand,n,r.oit.shadows)):r.oit=a.createDerivedCommands(t,n,r.oit))}Object.defineProperties(Scene.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return ContextLimits.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return ContextLimits.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return OctahedralProjectedCubeMap.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,updateGlobeListeners(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(defined(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(defined(this.globe))return this.globe.terrainProvider},set:function(e){defined(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(defined(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===SceneMode$1.SCENE2D?this.morphTo2D(0):e===SceneMode$1.SCENE3D?this.morphTo3D(0):e===SceneMode$1.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},terrainExaggeration:{get:function(){return this._terrainExaggeration}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Camera(this),defined(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new DeviceOrientationCameraController(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},imagerySplitPosition:{get:function(){return this._frameState.imagerySplitPosition},set:function(e){this._frameState.imagerySplitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){var t=this._context,t=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=t!==this._hdr,this._hdr=t}},highDynamicRangeSupported:{get:function(){var e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return.9999}},globeHeight:{get:function(){return this._globeHeight}}}),Scene.prototype.getCompressedTextureFormatSupported=function(e){var t=this.context;return("WEBGL_compressed_texture_s3tc"===e||"s3tc"===e)&&t.s3tc||("WEBGL_compressed_texture_pvrtc"===e||"pvrtc"===e)&&t.pvrtc||("WEBGL_compressed_texture_etc1"===e||"etc1"===e)&&t.etc1},Scene.prototype.updateDerivedCommands=function(e){var t,i,r,n,a,o,s,l,c,u;defined(e.derivedCommands)&&(t=this._frameState,i=this._context,r=!1,l=t.shadowState.lastDirtyTime,e.lastDirtyTime!==l&&(e.lastDirtyTime=l,r=e.dirty=!0),n=t.useLogDepth,c=this._hdr,o=defined((a=e.derivedCommands).logDepth),u=defined(a.hdr),s=defined(a.originalCommand),l=n&&!o,u=c&&!u,c=!(n&&c||s),e.dirty=e.dirty||l||u||c,e.dirty&&(e.dirty=!1,u=t.shadowState.shadowMaps,t.shadowState.shadowsEnabled&&e.castShadows&&(a.shadows=ShadowMap.createCastDerivedCommand(u,e,r,i,a.shadows)),(o||l)&&(a.logDepth=DerivedCommand.createLogDepthCommand(e,i,a.logDepth),updateDerivedCommands$1(this,a.logDepth.command,r)),(s||c)&&updateDerivedCommands$1(this,e,r)))};var renderTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.RENDER}),preloadTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PRELOAD}),preloadFlightTilesetPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.PRELOAD_FLIGHT}),requestRenderModeDeferCheckPassState=new Cesium3DTilePassState({pass:Cesium3DTilePass$1.REQUEST_RENDER_MODE_DEFER_CHECK}),scratchOccluderBoundingSphere=new BoundingSphere,scratchOccluder;function getOccluder(e){var t=e.globe;if(e._mode===SceneMode$1.SCENE3D&&defined(t)&&t.show&&!e._cameraUnderground&&!e._globeTranslucencyState.translucent){var i=t.ellipsoid,t=e.frameState.minimumTerrainHeight;return scratchOccluderBoundingSphere.radius=i.minimumRadius+t,scratchOccluder=Occluder.fromBoundingSphere(scratchOccluderBoundingSphere,e.camera.positionWC,scratchOccluder)}}function updateFrameNumber(e,t,i){e=e._frameState;e.frameNumber=t,e.time=JulianDate.clone(i,e.time)}Scene.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1},Scene.prototype.updateFrameState=function(){var e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=getOccluder(this),t.terrainExaggeration=this._terrainExaggeration,t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof OrthographicFrustum||this.camera.frustum instanceof OrthographicOffCenterFrustum),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState,defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(t.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=Color.clone(this.invertClassificationColor,this._actualInvertClassificationColor),InvertClassification.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,defined(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0},Scene.prototype.isVisible=function(e,t,i){return defined(e)&&(!defined(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==Intersect$1.OUTSIDE&&(!defined(i)||!e.occlude||!e.boundingVolume.isOccluded(i)))};var transformFrom2D=new Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);function debugShowBoundingVolume(e,t,i,r){var n=t._frameState,a=n.context,o=e.boundingVolume;defined(t._debugVolume)&&t._debugVolume.destroy();var s,l,c,u=Cartesian3.clone(o.center);n.mode!==SceneMode$1.SCENE3D&&(u=Matrix4.multiplyByPoint(transformFrom2D,u,u),l=(s=n.mapProjection).unproject(u),u=s.ellipsoid.cartographicToCartesian(l)),defined(o.radius)?(c=o.radius,c=GeometryPipeline.toWireframe(EllipsoidGeometry.createGeometry(new EllipsoidGeometry({radii:new Cartesian3(c,c,c),vertexFormat:PerInstanceColorAppearance.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Primitive({geometryInstances:new GeometryInstance({geometry:c,modelMatrix:Matrix4.fromTranslation(u),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)}}),appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1})):(h=o.halfAxes,c=GeometryPipeline.toWireframe(BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2),vertexFormat:PerInstanceColorAppearance.FLAT_VERTEX_FORMAT}))),t._debugVolume=new Primitive({geometryInstances:new GeometryInstance({geometry:c,modelMatrix:Matrix4.fromRotationTranslation(h,u,new Matrix4),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)}}),appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1}),asynchronous:!1}));var d,h=n.commandList,u=n.commandList=[];t._debugVolume.update(n),e=u[0],n.useLogDepth&&(e=DerivedCommand.createLogDepthCommand(e,a).command),defined(r)&&(d=i.framebuffer,i.framebuffer=r),e.execute(a,i),defined(d)&&(i.framebuffer=d),n.commandList=h}function executeCommand(e,t,i,r,n){var a=t._frameState;if(!defined(t.debugCommandFilter)||t.debugCommandFilter(e))if(e instanceof ClearCommand)e.execute(i,r);else{e.debugShowBoundingVolume&&defined(e.boundingVolume)&&debugShowBoundingVolume(e,t,r,n),a.useLogDepth&&defined(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);n=a.passes;if(!n.pick&&!n.depth&&t._hdr&&defined(e.derivedCommands)&&defined(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),n.pick||n.depth){if(n.pick&&!n.depth&&defined(e.derivedCommands.picking))return void(e=e.derivedCommands.picking.pickCommand).execute(i,r);if(defined(e.derivedCommands.depth))return void(e=e.derivedCommands.depth.depthOnlyCommand).execute(i,r)}t.debugShowCommands||t.debugShowFrustums?t._debugInspector.executeDebugShowFrustumsCommand(t,e,r):(a.shadowState.lightShadowsEnabled&&e.receiveShadows&&defined(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand:e).execute(i,r)}}function executeIdCommand(e,t,i,r){var n=t._frameState,t=e.derivedCommands;defined(t)&&(n.useLogDepth&&defined(t.logDepth)&&(e=t.logDepth.command),defined((t=e.derivedCommands).picking)?(e=t.picking.pickCommand).execute(i,r):defined(t.depth)&&(e=t.depth.depthOnlyCommand).execute(i,r))}function backToFront(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function frontToBack(e,t,i){return e.boundingVolume.distanceSquaredTo(i)-t.boundingVolume.distanceSquaredTo(i)+CesiumMath.EPSILON12}function executeTranslucentCommandsBackToFront(e,t,i,r,n){var a=e.context;mergeSort(r,backToFront,e.camera.positionWC),defined(n)&&t(n.unclassifiedCommand,e,a,i);for(var o=r.length,s=0;s<o;++s)t(r[s],e,a,i)}function executeTranslucentCommandsFrontToBack(e,t,i,r,n){var a=e.context;mergeSort(r,frontToBack,e.camera.positionWC),defined(n)&&t(n.unclassifiedCommand,e,a,i);for(var o=r.length,s=0;s<o;++s)t(r[s],e,a,i)}function getDebugGlobeDepth(e,t){var i=e._view.debugGlobeDepths,r=i[t];return!defined(r)&&e.context.depthTexture&&(r=new GlobeDepth,i[t]=r),r}transformFrom2D=Matrix4.inverseTransformation(transformFrom2D,transformFrom2D);var scratchPerspectiveFrustum$1=new PerspectiveFrustum,scratchPerspectiveOffCenterFrustum$1=new PerspectiveOffCenterFrustum,scratchOrthographicFrustum$1=new OrthographicFrustum,scratchOrthographicOffCenterFrustum$1=new OrthographicOffCenterFrustum;function executeCommands$1(e,t){var i,r=e.camera,n=e.context,a=e.frameState,o=n.uniformState;o.updateCamera(r),(i=defined(r.frustum.fov)?r.frustum.clone(scratchPerspectiveFrustum$1):defined(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(scratchPerspectiveOffCenterFrustum$1):defined(r.frustum.width)?r.frustum.clone(scratchOrthographicFrustum$1):r.frustum.clone(scratchOrthographicOffCenterFrustum$1)).near=r.frustum.near,i.far=r.frustum.far,o.updateFrustum(i),o.updatePass(Pass$1.ENVIRONMENT);var s,l,c=a.passes,u=c.pick,d=e._environmentState,h=e._view,p=d.renderTranslucentDepthForPick,m=d.useWebVR;u||(defined(s=d.skyBoxCommand)&&executeCommand(s,e,n,t),d.isSkyAtmosphereVisible&&executeCommand(d.skyAtmosphereCommand,e,n,t),d.isSunVisible&&(d.sunDrawCommand.execute(n,t),e.sunBloom&&!m&&(m=d.useGlobeDepthFramebuffer?h.globeDepth.framebuffer:d.usePostProcess?h.sceneFramebuffer.getFramebuffer():d.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,m),t.framebuffer=m)),d.isMoonVisible&&d.moonCommand.execute(n,t)),l=d.useOIT?(defined(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r,n){h.oit.executeCommands(e,t,i,r,n)}),e._executeOITFunction):c.render?executeTranslucentCommandsBackToFront:executeTranslucentCommandsFrontToBack;for(var f,g=h.frustumCommandsList,_=g.length,y=d.clearGlobeDepth,C=d.useDepthPlane,v=e._globeTranslucencyState,S=v.translucent,T=e._view.globeTranslucencyFramebuffer,x=(d.separatePrimitiveFramebuffer=!1,e._depthClearCommand),b=e._stencilClearCommand,E=e._classificationStencilClearCommand,P=e._depthPlane,A=d.usePostProcessSelected,w=r.position.z,D=0;D<_;++D){var M=_-D-1,I=g[M];e.mode===SceneMode$1.SCENE2D?(r.position.z=w-I.near+1,i.far=Math.max(1,I.far-I.near),i.near=1,o.update(a)):(i.near=0!=M?I.near*e.opaqueFrustumNearOffset:I.near,i.far=I.far),o.updateFrustum(i);var R,O=e.debugShowGlobeDepth?getDebugGlobeDepth(e,M):h.globeDepth;0,e.debugShowGlobeDepth&&defined(O)&&d.useGlobeDepthFramebuffer&&(O.update(n,t,h.viewport,e._hdr,y),O.clear(n,t,e._clearColorCommand.color),R=t.framebuffer,t.framebuffer=O.framebuffer),x.execute(n,t),n.stencilBuffer&&b.execute(n,t),o.updatePass(Pass$1.GLOBE);var L,F=I.commands[Pass$1.GLOBE],N=I.indices[Pass$1.GLOBE];if(S)v.executeGlobeCommands(I,executeCommand,T,e,t);else for(f=0;f<N;++f)executeCommand(F[f],e,n,t);if(defined(O)&&d.useGlobeDepthFramebuffer&&O.executeCopyDepth(n,t),e.debugShowGlobeDepth&&defined(O)&&d.useGlobeDepthFramebuffer&&(t.framebuffer=R),!d.renderTranslucentDepthForPick)if(o.updatePass(Pass$1.TERRAIN_CLASSIFICATION),F=I.commands[Pass$1.TERRAIN_CLASSIFICATION],N=I.indices[Pass$1.TERRAIN_CLASSIFICATION],S)v.executeGlobeClassificationCommands(I,executeCommand,T,e,t);else for(f=0;f<N;++f)executeCommand(F[f],e,n,t);if(y&&(x.execute(n,t),C&&P.execute(n,t)),!d.useInvertClassification||u||d.renderTranslucentDepthForPick){for(o.updatePass(Pass$1.CESIUM_3D_TILE),F=I.commands[Pass$1.CESIUM_3D_TILE],N=I.indices[Pass$1.CESIUM_3D_TILE],f=0;f<N;++f)executeCommand(F[f],e,n,t);if(0<N&&(defined(O)&&d.useGlobeDepthFramebuffer&&O.executeUpdateDepth(n,t,y),!d.renderTranslucentDepthForPick))for(o.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION),F=I.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],f=0;f<N;++f)executeCommand(F[f],e,n,t)}else{e._invertClassification.clear(n,t);var B=t.framebuffer;for(t.framebuffer=e._invertClassification._fbo,o.updatePass(Pass$1.CESIUM_3D_TILE),F=I.commands[Pass$1.CESIUM_3D_TILE],N=I.indices[Pass$1.CESIUM_3D_TILE],f=0;f<N;++f)executeCommand(F[f],e,n,t);for(defined(O)&&d.useGlobeDepthFramebuffer&&O.executeUpdateDepth(n,t,y),o.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),F=I.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],N=I.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],f=0;f<N;++f)executeCommand(F[f],e,n,t);for(t.framebuffer=B,e._invertClassification.executeClassified(n,t),1===a.invertClassificationColor.alpha&&e._invertClassification.executeUnclassified(n,t),0<N&&n.stencilBuffer&&E.execute(n,t),o.updatePass(Pass$1.CESIUM_3D_TILE_CLASSIFICATION),F=I.commands[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],N=I.indices[Pass$1.CESIUM_3D_TILE_CLASSIFICATION],f=0;f<N;++f)executeCommand(F[f],e,n,t)}for(0<N&&n.stencilBuffer&&b.execute(n,t),o.updatePass(Pass$1.OPAQUE),F=I.commands[Pass$1.OPAQUE],N=I.indices[Pass$1.OPAQUE],f=0;f<N;++f)executeCommand(F[f],e,n,t);if(0!=M&&e.mode!==SceneMode$1.SCENE2D&&(i.near=I.near,o.updateFrustum(i)),!u&&d.useInvertClassification&&a.invertClassificationColor.alpha<1&&(L=e._invertClassification),o.updatePass(Pass$1.TRANSLUCENT),(F=I.commands[Pass$1.TRANSLUCENT]).length=I.indices[Pass$1.TRANSLUCENT],l(e,executeCommand,t,F,L),n.depthTexture&&e.useDepthPicking&&(d.useGlobeDepthFramebuffer||p)&&(O=(p?t:O).framebuffer.depthStencilTexture,(V=e._picking.getPickDepth(e,M)).update(n,O),V.executeCopyDepth(n,t)),!u&&A){var V=t.framebuffer;if(t.framebuffer=h.sceneFramebuffer.getIdFramebuffer(),i.near=0!=M?I.near*e.opaqueFrustumNearOffset:I.near,i.far=I.far,o.updateFrustum(i),o.updatePass(Pass$1.GLOBE),F=I.commands[Pass$1.GLOBE],N=I.indices[Pass$1.GLOBE],S)v.executeGlobeCommands(I,executeIdCommand,T,e,t);else for(f=0;f<N;++f)executeIdCommand(F[f],e,n,t);for(y&&(x.framebuffer=t.framebuffer,x.execute(n,t),x.framebuffer=void 0),y&&C&&P.execute(n,t),o.updatePass(Pass$1.CESIUM_3D_TILE),F=I.commands[Pass$1.CESIUM_3D_TILE],N=I.indices[Pass$1.CESIUM_3D_TILE],f=0;f<N;++f)executeIdCommand(F[f],e,n,t);for(o.updatePass(Pass$1.OPAQUE),F=I.commands[Pass$1.OPAQUE],N=I.indices[Pass$1.OPAQUE],f=0;f<N;++f)executeIdCommand(F[f],e,n,t);for(o.updatePass(Pass$1.TRANSLUCENT),F=I.commands[Pass$1.TRANSLUCENT],N=I.indices[Pass$1.TRANSLUCENT],f=0;f<N;++f)executeIdCommand(F[f],e,n,t);t.framebuffer=V}}}function executeComputeCommands(e){e.context.uniformState.updatePass(Pass$1.COMPUTE);var t=e._environmentState.sunComputeCommand;defined(t)&&t.execute(e._computeEngine);for(var i=e._computeCommandList,r=i.length,n=0;n<r;++n)i[n].execute(e._computeEngine)}function executeOverlayCommands(e,t){e.context.uniformState.updatePass(Pass$1.OVERLAY);for(var i=e.context,r=e._overlayCommandList,n=r.length,a=0;a<n;++a)r[a].execute(i,t)}function insertShadowCastCommands(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,a=i.passes,o=a.length,s=t.length,l=0;l<s;++l){var c=t[l];if(e.updateDerivedCommands(c),c.castShadows&&(c.pass===Pass$1.GLOBE||c.pass===Pass$1.CESIUM_3D_TILE||c.pass===Pass$1.OPAQUE||c.pass===Pass$1.TRANSLUCENT)&&e.isVisible(c,r))if(n)for(var u=0;u<o;++u)a[u].commandList.push(c);else if(1===o)a[0].commandList.push(c);else for(var d=!1,h=o-1;0<=h;--h){var p=a[h].cullingVolume;if(e.isVisible(c,p))a[h].commandList.push(c),d=!0;else if(d)break}}}function executeShadowMapCastCommands(e){var t=e.frameState,i=t.shadowState.shadowMaps,r=i.length;if(t.shadowState.shadowsEnabled)for(var n=e.context,a=n.uniformState,o=0;o<r;++o){var s=i[o];if(!s.outOfView){for(var l=s.passes,c=l.length,u=0;u<c;++u)l[u].commandList.length=0;for(insertShadowCastCommands(e,e.frameState.commandList,s),u=0;u<c;++u){var d=s.passes[u];a.updateCamera(d.camera),s.updatePass(n,u);for(var h=d.commandList.length,p=0;p<h;++p){var m=d.commandList[p];a.updatePass(m.pass),executeCommand(m.derivedCommands.shadows.castCommands[o],e,n,d.passState)}}}}}var scratchEyeTranslation=new Cartesian3;function executeWebVRCommands(e,t,i){var r=e._view,n=r.camera,a=e._environmentState.renderTranslucentDepthForPick;updateAndClearFramebuffers(e,t,i),a||updateAndRenderPrimitives(e),r.createPotentiallyVisibleSet(e),a||(executeComputeCommands(e),executeShadowMapCastCommands(e));var o=t.viewport;o.x=0,o.y=0,o.width=.5*o.width;var s=Camera.clone(n,e._cameraVR);s.frustum=n.frustum;var l=n.frustum.near,i=l*defaultValue(e.focalLength,5),r=defaultValue(e.eyeSeparation,i/30),a=Cartesian3.multiplyByScalar(s.right,.5*r,scratchEyeTranslation);n.frustum.aspectRatio=o.width/o.height;i=.5*r*l/i;Cartesian3.add(s.position,a,n.position),n.frustum.xOffset=i,executeCommands$1(e,t),o.x=o.width,Cartesian3.subtract(s.position,a,n.position),n.frustum.xOffset=-i,executeCommands$1(e,t),Camera.clone(s,n)}Scene.prototype.updateAndExecuteCommands=function(e,t){var i=this._frameState.mode;this._environmentState.useWebVR?executeWebVRCommands(this,e,t):i!==SceneMode$1.SCENE2D||this._mapMode2D===MapMode2D$1.ROTATE?executeCommandsInViewport(!0,this,e,t):(updateAndClearFramebuffers(this,e,t),execute2DViewportCommands(this,e))};var scratch2DViewportCartographic=new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO),scratch2DViewportMaxCoord=new Cartesian3,scratch2DViewportSavedPosition=new Cartesian3,scratch2DViewportTransform=new Matrix4,scratch2DViewportCameraTransform=new Matrix4,scratch2DViewportEyePoint=new Cartesian3,scratch2DViewportWindowCoords=new Cartesian3,scratch2DViewport=new BoundingRectangle;function execute2DViewportCommands(e,t){var i=e.context,r=e.frameState,n=e.camera,a=t.viewport,o=BoundingRectangle.clone(a,scratch2DViewport);t.viewport=o;var s=scratch2DViewportMaxCoord;e.mapProjection.project(scratch2DViewportCartographic,s);var l=Cartesian3.clone(n.position,scratch2DViewportSavedPosition),c=Matrix4.clone(n.transform,scratch2DViewportCameraTransform),u=n.frustum.clone();n._setTransform(Matrix4.IDENTITY);var d=Matrix4.computeViewportTransformation(o,0,1,scratch2DViewportTransform),h=n.frustum.projectionMatrix,p=n.positionWC.y,m=Cartesian3.fromElements(CesiumMath.sign(p)*s.x-p,0,-n.positionWC.x,scratch2DViewportEyePoint),f=Transforms.pointToGLWindowCoordinates(h,d,m,scratch2DViewportWindowCoords);f.x=Math.floor(f.x);h=o.x,d=o.width;0===p||f.x<=h||f.x>=h+d?executeCommandsInViewport(!0,e,t):(Math.abs(h+.5*d-f.x)<1?(o.width=f.x-o.x,n.position.x*=CesiumMath.sign(n.position.x),n.frustum.right=0,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=f.x,n.position.x=-n.position.x,n.frustum.right=-n.frustum.left,n.frustum.left=0):f.x>h+.5*d?(o.width=f.x-h,m=n.frustum.right,n.frustum.right=s.x-p,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=f.x,o.width=h+d-f.x,n.position.x=-n.position.x,n.frustum.left=-n.frustum.right,n.frustum.right=m-2*n.frustum.right):(o.x=f.x,o.width=h+d-f.x,d=n.frustum.left,n.frustum.left=-s.x-p,r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!0,e,t),o.x=h,o.width=f.x-h,n.position.x=-n.position.x,n.frustum.right=-n.frustum.left,n.frustum.left=d-2*n.frustum.left),r.cullingVolume=n.frustum.computeCullingVolume(n.positionWC,n.directionWC,n.upWC),i.uniformState.update(r),executeCommandsInViewport(!1,e,t)),n._setTransform(c),Cartesian3.clone(l,n.position),n.frustum=u.clone(),t.viewport=a}function executeCommandsInViewport(e,t,i,r){var n=t._environmentState,a=t._view,n=n.renderTranslucentDepthForPick;e||n||(t.frameState.commandList.length=0),n||updateAndRenderPrimitives(t),a.createPotentiallyVisibleSet(t),e&&(defined(r)&&updateAndClearFramebuffers(t,i,r),n||(executeComputeCommands(t),executeShadowMapCastCommands(t))),executeCommands$1(t,i)}var scratchCullingVolume$1=new CullingVolume;function updateDebugFrustumPlanes(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new DebugCameraPrimitive({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),defined(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function updateShadowMaps(e){var t=e._frameState,i=t.shadowMaps,r=i.length,e=0<r&&!t.passes.pick&&e.mode===SceneMode$1.SCENE3D;if(e!==t.shadowState.shadowsEnabled&&(++t.shadowState.lastDirtyTime,t.shadowState.shadowsEnabled=e),t.shadowState.lightShadowsEnabled=!1,e){for(var n=0;n<r;++n)if(i[n]!==t.shadowState.shadowMaps[n]){++t.shadowState.lastDirtyTime;break}t.shadowState.shadowMaps.length=0;for(var a=t.shadowState.lightShadowMaps.length=0;a<r;++a){var o=i[a];o.update(t),t.shadowState.shadowMaps.push(o),o.fromLightSource&&(t.shadowState.lightShadowMaps.push(o),t.shadowState.lightShadowsEnabled=!0),o.dirty&&(++t.shadowState.lastDirtyTime,o.dirty=!1)}}}function updateAndRenderPrimitives(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),updateDebugFrustumPlanes(e),updateShadowMaps(e),e._globe&&e._globe.render(t)}function updateAndClearFramebuffers(e,t,i){var r=e._context,n=e._frameState,a=e._environmentState,o=e._view,s=e._frameState.passes.pick,l=a.useWebVR;a.originalFramebuffer=t.framebuffer,defined(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!l?e._sunPostProcess=new SunPostProcess:defined(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!defined(e.sun)&&defined(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var c=e._clearColorCommand;Color.clone(i,c.color),c.execute(r,t);var u=a.useGlobeDepthFramebuffer=defined(o.globeDepth);u&&(o.globeDepth.update(r,t,o.viewport,e._hdr,a.clearGlobeDepth),o.globeDepth.clear(r,t,i));var d=o.oit,h=a.useOIT=!s&&defined(d)&&d.isSupported();h&&(d.update(r,t,o.globeDepth.framebuffer,e._hdr),d.clear(r,t,i),a.useOIT=d.isSupported());var p,m=e.postProcessStages,f=a.usePostProcess=!s&&(e._hdr||0<m.length||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);a.usePostProcessSelected=!1,f&&(o.sceneFramebuffer.update(r,o.viewport,e._hdr),o.sceneFramebuffer.clear(r,t,i),m.update(r,n.useLogDepth,e._hdr),m.clear(r),f=a.usePostProcess=m.ready,a.usePostProcessSelected=f&&m.hasSelected),a.isSunVisible&&e.sunBloom&&!l?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(r,t,i)):u?t.framebuffer=o.globeDepth.framebuffer:f&&(t.framebuffer=o.sceneFramebuffer.getFramebuffer()),defined(t.framebuffer)&&c.execute(r,t),(a.useInvertClassification=!s&&defined(t.framebuffer)&&e.invertClassification)&&(1===e.frameState.invertClassificationColor.alpha&&a.useGlobeDepthFramebuffer&&(p=o.globeDepth.framebuffer),defined(p)||r.depthTexture?(e._invertClassification.previousFramebuffer=p,e._invertClassification.update(r),e._invertClassification.clear(r,t),e.frameState.invertClassificationColor.alpha<1&&h&&((h=(p=e._invertClassification.unclassifiedCommand).derivedCommands).oit=d.createDerivedCommands(p,r,h.oit))):a.useInvertClassification=!1),e._globeTranslucencyState.translucent&&o.globeTranslucencyFramebuffer.updateAndClear(e._hdr,o.viewport,r,t)}function callAfterRenderFunctions(e){for(var t=e._frameState.afterRender,i=0,r=t.length;i<r;++i)t[i](),e.requestRender();t.length=0}function getGlobeHeight(e){var t=e._globe,e=e.camera.positionCartographic;if(defined(t)&&t.show&&defined(e))return t.getHeight(e)}function isCameraUnderground(e){var t=e.camera,i=e._mode,r=e.globe,n=e._screenSpaceCameraController,t=t.positionCartographic;if(!defined(t))return!1;if(!n.onMap()&&t.height<0)return!0;if(!defined(r)||!r.show||i===SceneMode$1.SCENE2D||i===SceneMode$1.MORPHING)return!1;e=e._globeHeight;return defined(e)&&t.height<e}function updateDebugShowFramesPerSecond(e,t){var i,r;e.debugShowFramesPerSecond?(defined(e._performanceDisplay)||((i=document.createElement("div")).className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(i),r=new PerformanceDisplay({container:i}),e._performanceDisplay=r,e._performanceContainer=i),e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)):defined(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function prePassesUpdate(e){e._jobScheduler.resetBudgets();var t=e._frameState;e.primitives.prePassesUpdate(t),defined(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function postPassesUpdate(e){var t=e._frameState;e.primitives.postPassesUpdate(t),RequestScheduler.update()}Scene.prototype.updateEnvironment=function(){var e=this._frameState,t=this._view,i=this._environmentState,r=e.passes.render,n=e.passes.offscreen,a=this.skyAtmosphere,o=this.globe,s=this._globeTranslucencyState;!r||this._mode!==SceneMode$1.SCENE2D&&t.camera.frustum instanceof OrthographicFrustum||!s.environmentVisible?(i.skyAtmosphereCommand=void 0,i.skyBoxCommand=void 0,i.sunDrawCommand=void 0,i.sunComputeCommand=void 0,i.moonCommand=void 0):(defined(a)?(defined(o)&&(a.setDynamicAtmosphereColor(o.enableLighting&&o.dynamicAtmosphereLighting,o.dynamicAtmosphereLightingFromSun),i.isReadyForAtmosphere=i.isReadyForAtmosphere||0<o._surface._tilesToRender.length),i.skyAtmosphereCommand=a.update(e,o),defined(i.skyAtmosphereCommand)&&this.updateDerivedCommands(i.skyAtmosphereCommand)):i.skyAtmosphereCommand=void 0,i.skyBoxCommand=defined(this.skyBox)?this.skyBox.update(e,this._hdr):void 0,t=defined(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0,i.sunDrawCommand=defined(t)?t.drawCommand:void 0,i.sunComputeCommand=defined(t)?t.computeCommand:void 0,i.moonCommand=defined(this.moon)?this.moon.update(e):void 0);o=i.clearGlobeDepth=defined(o)&&o.show&&(!o.depthTestAgainstTerrain||this.mode===SceneMode$1.SCENE2D);(i.useDepthPlane=o&&this.mode===SceneMode$1.SCENE3D&&s.useDepthPlane)&&this._depthPlane.update(e),i.renderTranslucentDepthForPick=!1,i.useWebVR=this._useWebVR&&this.mode!==SceneMode$1.SCENE2D&&!n;for(var s=e.mode!==SceneMode$1.SCENE3D||s.sunVisibleThroughGlobe?void 0:e.occluder,l=e.cullingVolume,c=scratchCullingVolume$1.planes,u=0;u<5;++u)c[u]=l.planes[u];l=scratchCullingVolume$1,i.isSkyAtmosphereVisible=defined(i.skyAtmosphereCommand)&&i.isReadyForAtmosphere,i.isSunVisible=this.isVisible(i.sunDrawCommand,l,s),i.isMoonVisible=this.isVisible(i.moonCommand,l,s);i=this.specularEnvironmentMaps,s=this._specularEnvironmentMapAtlas;!defined(i)||defined(s)&&s.url===i?!defined(i)&&defined(s)&&(s.destroy(),this._specularEnvironmentMapAtlas=void 0):(s=s&&s.destroy(),this._specularEnvironmentMapAtlas=new OctahedralProjectedCubeMap(i)),defined(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(e)},Scene.prototype.resolveFramebuffers=function(e){var t=this._context,i=this._frameState,r=this._environmentState,n=this._view,a=n.globeDepth,o=r.useOIT,s=r.useGlobeDepthFramebuffer,l=r.usePostProcess,c=r.originalFramebuffer,u=s?a.framebuffer:void 0,d=n.sceneFramebuffer.getFramebuffer(),h=n.sceneFramebuffer.getIdFramebuffer();r.separatePrimitiveFramebuffer&&a.executeMergeColor(t,e),o&&(e.framebuffer=l?d:c,n.oit.execute(t,e)),l&&(r=s&&!o?u:d,n=this.postProcessStages,r=r.getColorTexture(0),h=h.getColorTexture(0),d=defaultValue(u,d).depthStencilTexture,n.execute(t,r,d,h),n.copy(t,c)),o||l||!s||(e.framebuffer=c,a.executeCopyColor(t,e));i=i.useLogDepth;this.debugShowGlobeDepth&&s&&getDebugGlobeDepth(this,this.debugShowDepthFrustum-1).executeDebugGlobeDepth(t,e,i),this.debugShowPickDepth&&s&&this._picking.getPickDepth(this,this.debugShowDepthFrustum-1).executeDebugPickDepth(t,e,i)},Scene.prototype.initializeFrame=function(){120==this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=getGlobeHeight(this),this._cameraUnderground=isCameraUnderground(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),defined(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};var scratchBackgroundColor=new Color;function render(e){var t=e._frameState,i=e.context,r=i.uniformState,n=e._defaultView;e._view=n,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=renderTilesetPassState;var a=defaultValue(e.backgroundColor,Color.BLACK);e._hdr&&((a=Color.clone(a,scratchBackgroundColor)).red=Math.pow(a.red,e.gamma),a.green=Math.pow(a.green,e.gamma),a.blue=Math.pow(a.blue,e.gamma)),t.backgroundColor=a,e.fog.update(t),r.update(t);var o=e.shadowMap;defined(o)&&o.enabled&&(!defined(e.light)||e.light instanceof SunLight?Cartesian3.negate(r.sunDirectionWC,e._shadowMapCamera.direction):Cartesian3.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(o)),e._computeCommandList.length=0,e._overlayCommandList.length=0;o=n.viewport;o.x=0,o.y=0,o.width=i.drawingBufferWidth,o.height=i.drawingBufferHeight;n=n.passState;n.framebuffer=void 0,n.blendingEnabled=void 0,n.scissorTest=void 0,n.viewport=BoundingRectangle.clone(o,n.viewport),defined(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(n,a),e.resolveFramebuffers(n),n.framebuffer=void 0,executeOverlayCommands(e,n),defined(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),i.endFrame()}function tryAndCatchError(t,e){try{e(t)}catch(e){if(t._renderError.raiseEvent(t,e),t.rethrowRenderErrors)throw e}}function updateMostDetailedRayPicks(e){return e._picking.updateMostDetailedRayPicks(e)}function updatePreloadPass(e){var t=e._frameState;preloadTilesetPassState.camera=t.camera,preloadTilesetPassState.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,preloadTilesetPassState)}function updatePreloadFlightPass(e){var t=e._frameState;t.camera.canPreloadFlight()&&(preloadFlightTilesetPassState.camera=e.preloadFlightCamera,preloadFlightTilesetPassState.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,preloadFlightTilesetPassState))}function updateRequestRenderModeDeferCheckPass(e){e.primitives.updateForPass(e._frameState,requestRenderModeDeferCheckPassState)}Scene.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);var t=this._frameState;t.newFrame=!1,defined(e)||(e=JulianDate.now());var i=this._view.checkForCameraUpdates(this),r=!this.requestRenderMode||this._renderRequested||i||this._logDepthBufferDirty||this._hdrDirty||this.mode===SceneMode$1.MORPHING;!r&&defined(this.maximumRenderTimeChange)&&defined(this._lastRenderTime)&&(i=Math.abs(JulianDate.secondsDifference(this._lastRenderTime,e)),r=r||i>this.maximumRenderTimeChange),r&&(this._lastRenderTime=JulianDate.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1,updateFrameNumber(this,CesiumMath.incrementWrap(t.frameNumber,15e6,1),e),t.newFrame=!0),tryAndCatchError(this,prePassesUpdate),this.primitives.show&&(tryAndCatchError(this,updateMostDetailedRayPicks),tryAndCatchError(this,updatePreloadPass),tryAndCatchError(this,updatePreloadFlightPass),r||tryAndCatchError(this,updateRequestRenderModeDeferCheckPass)),this._postUpdate.raiseEvent(this,e),r&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),tryAndCatchError(this,render)),updateDebugShowFramesPerSecond(this,r),tryAndCatchError(this,postPassesUpdate),callAfterRenderFunctions(this),r&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())},Scene.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)},Scene.prototype.requestRender=function(){this._renderRequested=!0},Scene.prototype.clampLineWidth=function(e){return Math.max(ContextLimits.minimumAliasedLineWidth,Math.min(e,ContextLimits.maximumAliasedLineWidth))},Scene.prototype.pick=function(e,t,i){return this._picking.pick(this,e,t,i)},Scene.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)},Scene.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)},Scene.prototype.drillPick=function(e,t,i,r){return this._picking.drillPick(this,e,t,i,r)},Scene.prototype.pickFromRay=function(e,t,i){return this._picking.pickFromRay(this,e,t,i)},Scene.prototype.drillPickFromRay=function(e,t,i,r){return this._picking.drillPickFromRay(this,e,t,i,r)},Scene.prototype.pickFromRayMostDetailed=function(e,t,i){return this._picking.pickFromRayMostDetailed(this,e,t,i)},Scene.prototype.drillPickFromRayMostDetailed=function(e,t,i,r){return this._picking.drillPickFromRayMostDetailed(this,e,t,i,r)},Scene.prototype.sampleHeight=function(e,t,i){return this._picking.sampleHeight(this,e,t,i)},Scene.prototype.clampToHeight=function(e,t,i,r){return this._picking.clampToHeight(this,e,t,i,r)},Scene.prototype.sampleHeightMostDetailed=function(e,t,i){return this._picking.sampleHeightMostDetailed(this,e,t,i)},Scene.prototype.clampToHeightMostDetailed=function(e,t,i){return this._picking.clampToHeightMostDetailed(this,e,t,i)},Scene.prototype.cartesianToCanvasCoordinates=function(e,t){return SceneTransforms.wgs84ToWindowCoordinates(this,e,t)},Scene.prototype.completeMorph=function(){this._transitioner.completeMorph()},Scene.prototype.morphTo2D=function(e){var t=this.globe,t=(defined(t)?t:this.mapProjection).ellipsoid;e=defaultValue(e,2),this._transitioner.morphTo2D(e,t)},Scene.prototype.morphToColumbusView=function(e){var t=this.globe,t=(defined(t)?t:this.mapProjection).ellipsoid;e=defaultValue(e,2),this._transitioner.morphToColumbusView(e,t)},Scene.prototype.morphTo3D=function(e){var t=this.globe,t=(defined(t)?t:this.mapProjection).ellipsoid;e=defaultValue(e,2),this._transitioner.morphTo3D(e,t)},Scene.prototype.isDestroyed=function(){return!1},Scene.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),defined(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(var e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,destroyObject(this)};var SkyAtmosphereCommon="const float Kr = 0.0025;\nconst float Kr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float Km4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float KmESun = Km * ESun;\nconst float KrESun = Kr * ESun;\nconst vec3 InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nconst float g = -0.95;\nconst float g2 = g * g;\n#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nuniform vec3 u_radiiAndDynamicAtmosphereColor;\nfloat scale(float cosAngle)\n{\nfloat x = 1.0 - cosAngle;\nreturn rayleighScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvec3 getLightDirection(vec3 positionWC)\n{\nfloat lightEnum = u_radiiAndDynamicAtmosphereColor.z;\nvec3 lightDirection =\npositionWC * float(lightEnum == 0.0) +\nczm_lightDirectionWC * float(lightEnum == 1.0) +\nczm_sunDirectionWC * float(lightEnum == 2.0);\nreturn normalize(lightDirection);\n}\nvoid calculateRayScatteringFromSpace(in vec3 positionWC, in vec3 ray, in float innerRadius, in float outerRadius, inout float far, out vec3 start, out float startOffset)\n{\nfloat cameraHeight = length(positionWC);\nfloat B = 2.0 * dot(positionWC, ray);\nfloat C = cameraHeight * cameraHeight - outerRadius * outerRadius;\nfloat det = max(0.0, B * B - 4.0 * C);\nfloat near = 0.5 * (-B - sqrt(det));\nstart = positionWC + ray * near;\nfar -= near;\nfloat startAngle = dot(ray, start) / outerRadius;\nfloat startDepth = exp(-1.0 / rayleighScaleDepth);\nstartOffset = startDepth * scale(startAngle);\n}\nvoid calculateRayScatteringFromGround(in vec3 positionWC, in vec3 ray, in float atmosphereScale, in float innerRadius, out vec3 start, out float startOffset)\n{\nfloat cameraHeight = length(positionWC);\nstart = positionWC;\nfloat height = length(start);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - cameraHeight));\nfloat startAngle = dot(ray, start) / height;\nstartOffset = depth*scale(startAngle);\n}\nczm_raySegment rayEllipsoidIntersection(czm_ray ray, vec3 inverseRadii)\n{\nvec3 o = inverseRadii * (czm_inverseView * vec4(ray.origin, 1.0)).xyz;\nvec3 d = inverseRadii * (czm_inverseView * vec4(ray.direction, 0.0)).xyz;\nfloat a = dot(d, d);\nfloat b = dot(d, o);\nfloat c = dot(o, o) - 1.0;\nfloat discriminant = b * b - a * c;\nif (discriminant < 0.0)\n{\nreturn czm_emptyRaySegment;\n}\ndiscriminant = sqrt(discriminant);\nfloat t1 = (-b - discriminant) / a;\nfloat t2 = (-b + discriminant) / a;\nif (t1 < 0.0 && t2 < 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nif (t1 < 0.0 && t2 >= 0.0)\n{\nt1 = 0.0;\n}\nreturn czm_raySegment(t1, t2);\n}\nvec3 getAdjustedPosition(vec3 positionWC, float innerRadius)\n{\nfloat cameraHeight = czm_eyeHeight + innerRadius;\nreturn normalize(positionWC) * cameraHeight;\n}\nvec3 getTranslucentPosition(vec3 positionWC, vec3 outerPositionWC, float innerRadius, out bool intersectsEllipsoid)\n{\nvec3 directionWC = normalize(outerPositionWC - positionWC);\nvec3 directionEC = czm_viewRotation * directionWC;\nczm_ray viewRay = czm_ray(vec3(0.0), directionEC);\nczm_raySegment raySegment = rayEllipsoidIntersection(viewRay, czm_ellipsoidInverseRadii);\nintersectsEllipsoid = raySegment.start >= 0.0;\nif (intersectsEllipsoid)\n{\nreturn positionWC + raySegment.stop * directionWC;\n}\nreturn getAdjustedPosition(positionWC, innerRadius);\n}\nvoid calculateMieColorAndRayleighColor(vec3 outerPositionWC, out vec3 mieColor, out vec3 rayleighColor)\n{\nfloat outerRadius = u_radiiAndDynamicAtmosphereColor.x;\nfloat innerRadius = u_radiiAndDynamicAtmosphereColor.y;\n#ifdef GLOBE_TRANSLUCENT\nbool intersectsEllipsoid = false;\nvec3 startPositionWC = getTranslucentPosition(czm_viewerPositionWC, outerPositionWC, innerRadius, intersectsEllipsoid);\n#else\nvec3 startPositionWC = getAdjustedPosition(czm_viewerPositionWC, innerRadius);\n#endif\nvec3 lightDirection = getLightDirection(startPositionWC);\nvec3 ray = outerPositionWC - startPositionWC;\nfloat far = length(ray);\nray /= far;\nfloat atmosphereScale = 1.0 / (outerRadius - innerRadius);\nvec3 start;\nfloat startOffset;\n#ifdef SKY_FROM_SPACE\n#ifdef GLOBE_TRANSLUCENT\nif (intersectsEllipsoid)\n{\ncalculateRayScatteringFromGround(startPositionWC, ray, atmosphereScale, innerRadius, start, startOffset);\n}\nelse\n{\ncalculateRayScatteringFromSpace(startPositionWC, ray, innerRadius, outerRadius, far, start, startOffset);\n}\n#else\ncalculateRayScatteringFromSpace(startPositionWC, ray, innerRadius, outerRadius, far, start, startOffset);\n#endif\n#else\ncalculateRayScatteringFromGround(startPositionWC, ray, atmosphereScale, innerRadius, start, startOffset);\n#endif\nfloat sampleLength = far / fSamples;\nfloat scaledLength = sampleLength * atmosphereScale;\nvec3 sampleRay = ray * sampleLength;\nvec3 samplePoint = start + sampleRay * 0.5;\nvec3 frontColor = vec3(0.0, 0.0, 0.0);\nfor (int i = 0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDirection, samplePoint) / height;\nfloat fCameraAngle = dot(ray, samplePoint) / height;\nfloat fScatter = (startOffset + depth*(scale(fLightAngle) - scale(fCameraAngle)));\nvec3 attenuate = exp(-fScatter * (InvWavelength * Kr4PI + Km4PI));\nfrontColor += attenuate * (depth * scaledLength);\nsamplePoint += sampleRay;\n}\nmieColor = frontColor * KmESun;\nrayleighColor = frontColor * (InvWavelength * KrESun);\nmieColor = min(mieColor, vec3(10000000.0));\nrayleighColor = min(rayleighColor, vec3(10000000.0));\n}\nvec4 calculateFinalColor(vec3 positionWC, vec3 toCamera, vec3 lightDirection, vec3 mieColor, vec3 rayleighColor)\n{\nfloat cosAngle = dot(lightDirection, normalize(toCamera)) / length(toCamera);\nfloat rayleighPhase = 0.75 * (1.0 + cosAngle * cosAngle);\nfloat miePhase = 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + cosAngle * cosAngle) / pow(1.0 + g2 - 2.0 * g * cosAngle, 1.5);\nvec3 rgb = rayleighPhase * rayleighColor + miePhase * mieColor;\nconst float exposure = 2.0;\nvec3 rgbExposure = vec3(1.0) - exp(-exposure * rgb);\n#ifndef HDR\nrgb = rgbExposure;\n#endif\n#ifdef COLOR_CORRECT\nvec3 hsb = czm_RGBToHSB(rgb);\nhsb.x += u_hsbShift.x;\nhsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0);\nhsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0;\nrgb = czm_HSBToRGB(hsb);\n#endif\nfloat outerRadius = u_radiiAndDynamicAtmosphereColor.x;\nfloat innerRadius = u_radiiAndDynamicAtmosphereColor.y;\nfloat lightEnum = u_radiiAndDynamicAtmosphereColor.z;\nfloat cameraHeight = czm_eyeHeight + innerRadius;\nfloat atmosphereAlpha = clamp((outerRadius - cameraHeight) / (outerRadius - innerRadius), 0.0, 1.0);\nfloat nightAlpha = (lightEnum != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;\natmosphereAlpha *= pow(nightAlpha, 0.5);\nvec4 finalColor = vec4(rgb, mix(clamp(rgbExposure.b, 0.0, 1.0), 1.0, atmosphereAlpha) * smoothstep(0.0, 1.0, czm_morphTime));\nif (mieColor.b > 1.0)\n{\nfloat strength = mieColor.b;\nfloat minDistance = outerRadius;\nfloat maxDistance = outerRadius * 3.0;\nfloat maxStrengthLerp = 1.0 - clamp((maxDistance - cameraHeight) / (maxDistance - minDistance), 0.0, 1.0);\nfloat maxStrength = mix(100.0, 10000.0, maxStrengthLerp);\nstrength = min(strength, maxStrength);\nfloat alpha = 1.0 - (strength / maxStrength);\nfinalColor.a = alpha;\n}\nreturn finalColor;\n}\n",SkyAtmosphereFS="varying vec3 v_outerPositionWC;\n#ifndef PER_FRAGMENT_ATMOSPHERE\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvoid main (void)\n{\nvec3 toCamera = czm_viewerPositionWC - v_outerPositionWC;\nvec3 lightDirection = getLightDirection(czm_viewerPositionWC);\nvec3 mieColor;\nvec3 rayleighColor;\n#ifdef PER_FRAGMENT_ATMOSPHERE\ncalculateMieColorAndRayleighColor(v_outerPositionWC, mieColor, rayleighColor);\n#else\nmieColor = v_mieColor;\nrayleighColor = v_rayleighColor;\n#endif\ngl_FragColor = calculateFinalColor(czm_viewerPositionWC, toCamera, lightDirection, mieColor, rayleighColor);\n}\n",SkyAtmosphereVS="attribute vec4 position;\nvarying vec3 v_outerPositionWC;\n#ifndef PER_FRAGMENT_ATMOSPHERE\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\n#endif\nvoid main(void)\n{\nvec4 positionWC = czm_model * position;\n#ifndef PER_FRAGMENT_ATMOSPHERE\ncalculateMieColorAndRayleighColor(positionWC.xyz, v_mieColor, v_rayleighColor);\n#endif\nv_outerPositionWC = positionWC.xyz;\ngl_Position = czm_modelViewProjection * position;\n}\n";function SkyAtmosphere(e){e=defaultValue(e,Ellipsoid.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;var t=Cartesian3.multiplyByScalar(e.radii,1.025,new Cartesian3);this._scaleMatrix=Matrix4.fromScale(t),this._modelMatrix=new Matrix4,this._command=new DrawCommand({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Cartesian3;t=new Cartesian3;t.x=1.025*e.maximumRadius,t.y=e.maximumRadius,t.z=0,this._radiiAndDynamicAtmosphereColor=t;var i=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return i._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return i._hueSaturationBrightness.x=i.hueShift,i._hueSaturationBrightness.y=i.saturationShift,i._hueSaturationBrightness.z=i.brightnessShift,i._hueSaturationBrightness}}}Object.defineProperties(SkyAtmosphere.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),SkyAtmosphere.prototype.setDynamicAtmosphereColor=function(e,t){t=e?t?2:1:0;this._radiiAndDynamicAtmosphereColor.z=t};var scratchModelMatrix=new Matrix4;function hasColorCorrection(e){return!(CesiumMath.equalsEpsilon(e.hueShift,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(e.saturationShift,0,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(e.brightnessShift,0,CesiumMath.EPSILON7))}SkyAtmosphere.prototype.update=function(e,t){if(this.show){var i=e.mode;if((i===SceneMode$1.SCENE3D||i===SceneMode$1.MORPHING)&&e.passes.render){var r=Matrix4.fromRotationTranslation(e.context.uniformState.inverseViewRotation,Cartesian3.ZERO,scratchModelMatrix),n=Matrix4.multiplyTransformation(r,Axis$1.Y_UP_TO_Z_UP,scratchModelMatrix),a=Matrix4.multiply(this._scaleMatrix,n,scratchModelMatrix);Matrix4.clone(a,this._modelMatrix);i=e.context,r=hasColorCorrection(this),n=e.globeTranslucencyState.translucent,a=this.perFragmentAtmosphere||n||!defined(t)||!t.show,t=this._command;defined(t.vertexArray)||(o=EllipsoidGeometry.createGeometry(new EllipsoidGeometry({radii:new Cartesian3(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:VertexFormat.POSITION_ONLY})),t.vertexArray=VertexArray.fromGeometry({context:i,geometry:o,attributeLocations:GeometryPipeline.createAttributeLocations(o),bufferUsage:BufferUsage$1.STATIC_DRAW}),t.renderState=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},blending:BlendingState$1.ALPHA_BLEND,depthMask:!1}));var o=r|a<<2|n<<3;o!==this._flags&&(this._flags=o,o=[],r&&o.push("COLOR_CORRECT"),a&&o.push("PER_FRAGMENT_ATMOSPHERE"),n&&o.push("GLOBE_TRANSLUCENT"),a=new ShaderSource({defines:o.concat("SKY_FROM_SPACE"),sources:[SkyAtmosphereCommon,SkyAtmosphereVS]}),n=new ShaderSource({defines:o.concat("SKY_FROM_SPACE"),sources:[SkyAtmosphereCommon,SkyAtmosphereFS]}),this._spSkyFromSpace=ShaderProgram.fromCache({context:i,vertexShaderSource:a,fragmentShaderSource:n}),a=new ShaderSource({defines:o.concat("SKY_FROM_ATMOSPHERE"),sources:[SkyAtmosphereCommon,SkyAtmosphereVS]}),n=new ShaderSource({defines:o.concat("SKY_FROM_ATMOSPHERE"),sources:[SkyAtmosphereCommon,SkyAtmosphereFS]}),this._spSkyFromAtmosphere=ShaderProgram.fromCache({context:i,vertexShaderSource:a,fragmentShaderSource:n}));e=e.camera.positionWC;return Cartesian3.magnitude(e)>this._radiiAndDynamicAtmosphereColor.x?t.shaderProgram=this._spSkyFromSpace:t.shaderProgram=this._spSkyFromAtmosphere,t}}},SkyAtmosphere.prototype.isDestroyed=function(){return!1},SkyAtmosphere.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyFromSpace=this._spSkyFromSpace&&this._spSkyFromSpace.destroy(),this._spSkyFromAtmosphere=this._spSkyFromAtmosphere&&this._spSkyFromAtmosphere.destroy(),destroyObject(this)};var SkyBoxFS="uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\ngl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n}\n",SkyBoxVS="attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n";function SkyBox(e){this.sources=e.sources,this._sources=void 0,this.show=defaultValue(e.show,!0),this._command=new DrawCommand({modelMatrix:Matrix4.clone(Matrix4.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}function SphereEmitter(e){e=defaultValue(e,1),this._radius=defaultValue(e,1)}function StyleExpression(){}SkyBox.prototype.update=function(e,t){var i=this;if(this.show&&(e.mode===SceneMode$1.SCENE3D||e.mode===SceneMode$1.MORPHING)&&e.passes.render){var r=e.context;this._sources!==this.sources&&(this._sources=this.sources,"string"==typeof(n=this.sources).positiveX?loadCubeMap(r,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new CubeMap({context:r,source:n})));var n,a,e=this._command;if(defined(e.vertexArray)||(e.uniformMap={u_cubeMap:function(){return i._cubeMap}},n=BoxGeometry.createGeometry(BoxGeometry.fromDimensions({dimensions:new Cartesian3(2,2,2),vertexFormat:VertexFormat.POSITION_ONLY})),a=this._attributeLocations=GeometryPipeline.createAttributeLocations(n),e.vertexArray=VertexArray.fromGeometry({context:r,geometry:n,attributeLocations:a,bufferUsage:BufferUsage$1.STATIC_DRAW}),e.renderState=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND})),defined(e.shaderProgram)&&this._useHdr===t||(a=new ShaderSource({defines:[t?"HDR":""],sources:[SkyBoxFS]}),e.shaderProgram=ShaderProgram.fromCache({context:r,vertexShaderSource:SkyBoxVS,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t),defined(this._cubeMap))return e}},SkyBox.prototype.isDestroyed=function(){return!1},SkyBox.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),destroyObject(this)},Object.defineProperties(SphereEmitter.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}}),SphereEmitter.prototype.emit=function(e){var t=CesiumMath.randomBetween(0,CesiumMath.TWO_PI),i=CesiumMath.randomBetween(0,CesiumMath.PI),r=CesiumMath.randomBetween(0,this._radius),n=r*Math.cos(t)*Math.sin(i),t=r*Math.sin(t)*Math.sin(i),i=r*Math.cos(i);e.position=Cartesian3.fromElements(n,t,i,e.position),e.velocity=Cartesian3.normalize(e.position,e.velocity)},StyleExpression.prototype.evaluate=function(e,t){DeveloperError.throwInstantiationError()},StyleExpression.prototype.evaluateColor=function(e,t){DeveloperError.throwInstantiationError()},StyleExpression.prototype.getShaderFunction=function(e,t,i,r){DeveloperError.throwInstantiationError()};var SunFS="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\ngl_FragColor = czm_gammaCorrect(color);\n}\n",SunTextureFS="uniform float u_radiusTS;\nvarying vec2 v_textureCoordinates;\nvec2 rotate(vec2 p, vec2 direction)\n{\nreturn vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);\n}\nvec4 addBurst(vec2 position, vec2 direction, float lengthScalar)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition) * lengthScalar;\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nfloat lengthScalar = 2.0 / sqrt(2.0);\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position) * lengthScalar;\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(vec2(1.0), surface + 0.2, surface);\nfloat glow = 1.0 - smoothstep(0.0, 0.55, radius);\ncolor.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;\nvec4 burst = vec4(0.0);\nburst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar);\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar);\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar);\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n",SunVS="attribute vec2 direction;\nuniform float u_size;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = vec2(u_size * 0.5);\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n";function Sun(){this.show=!0,this._drawCommand=new DrawCommand({primitiveType:PrimitiveType$1.TRIANGLES,boundingVolume:new BoundingSphere,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new BoundingSphere,this._boundingVolume2D=new BoundingSphere,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;var e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(Sun.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var scratchPositionWC=new Cartesian2,scratchLimbWC=new Cartesian2,scratchPositionEC=new Cartesian4,scratchCartesian4$6=new Cartesian4;function TileBoundingVolume(){}function TileCoordinatesImageryProvider(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this._tilingScheme=defined(e.tilingScheme)?e.tilingScheme:new GeographicTilingScheme({ellipsoid:e.ellipsoid}),this._color=defaultValue(e.color,Color.YELLOW),this._errorEvent=new Event,this._tileWidth=defaultValue(e.tileWidth,256),this._tileHeight=defaultValue(e.tileHeight,256),this._readyPromise=when.resolve(!0),this.defaultAlpha=void 0,this.defaultNightAlpha=void 0,this.defaultDayAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,this.defaultMinificationFilter=void 0,this.defaultMagnificationFilter=void 0}function TileDiscardPolicy(e){DeveloperError.throwInstantiationError()}Sun.prototype.update=function(e,t,i){if(this.show){var r=e.mode;if(r!==SceneMode$1.SCENE2D&&r!==SceneMode$1.MORPHING&&e.passes.render){var n,a=e.context,o=t.viewport.width,s=t.viewport.height;defined(this._texture)&&o===this._drawingBufferWidth&&s===this._drawingBufferHeight&&!this._glowFactorDirty&&i===this._useHdr||(this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=i,s=Math.max(o,s),s=Math.pow(2,Math.ceil(Math.log(s)/Math.log(2))-2),s=Math.max(1,s),l=i?a.halfFloatingPointTexture?PixelDatatype$1.HALF_FLOAT:PixelDatatype$1.FLOAT:PixelDatatype$1.UNSIGNED_BYTE,this._texture=new Texture({context:a,width:s,height:s,pixelFormat:PixelFormat$1.RGBA,pixelDatatype:l}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5,l={u_radiusTS:function(){return n._radiusTS}},(n=this)._commands.computeCommand=new ComputeCommand({fragmentShaderSource:SunTextureFS,outputTexture:this._texture,uniformMap:l,persists:!1,owner:this,postExecute:function(){n._commands.computeCommand=void 0}}));var l=this._drawCommand;defined(l.vertexArray)||(h={direction:0},(d=new Uint8Array(8))[0]=0,d[1]=0,d[2]=255,d[3]=0,d[4]=255,d[5]=255,d[6]=0,d[7]=255,c=Buffer$1.createVertexBuffer({context:a,typedArray:d,usage:BufferUsage$1.STATIC_DRAW}),u=[{index:h.direction,vertexBuffer:c,componentsPerAttribute:2,normalize:!0,componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE}],d=Buffer$1.createIndexBuffer({context:a,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:BufferUsage$1.STATIC_DRAW,indexDatatype:IndexDatatype$1.UNSIGNED_SHORT}),l.vertexArray=new VertexArray({context:a,attributes:u,indexBuffer:d}),l.shaderProgram=ShaderProgram.fromCache({context:a,vertexShaderSource:SunVS,fragmentShaderSource:SunFS,attributeLocations:h}),l.renderState=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND}),l.uniformMap=this._uniformMap);var c=a.uniformState.sunPositionWC,u=a.uniformState.sunPositionColumbusView,d=this._boundingVolume,h=this._boundingVolume2D;Cartesian3.clone(c,d.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,d.radius=CesiumMath.SOLAR_RADIUS+CesiumMath.SOLAR_RADIUS*this._glowLengthTS,h.radius=d.radius,r===SceneMode$1.SCENE3D?BoundingSphere.clone(d,l.boundingVolume):r===SceneMode$1.COLUMBUS_VIEW&&BoundingSphere.clone(h,l.boundingVolume);c=SceneTransforms.computeActualWgs84Position(e,c,scratchCartesian4$6),c=Cartesian3.magnitude(Cartesian3.subtract(c,e.camera.position,scratchCartesian4$6)),e=a.uniformState.projection,a=scratchPositionEC;a.x=0,a.y=0,a.z=-c,a.w=1;c=Matrix4.multiplyByVector(e,a,scratchCartesian4$6),c=SceneTransforms.clipToGLWindowCoordinates(t.viewport,c,scratchPositionWC);a.x=CesiumMath.SOLAR_RADIUS;a=Matrix4.multiplyByVector(e,a,scratchCartesian4$6),a=SceneTransforms.clipToGLWindowCoordinates(t.viewport,a,scratchLimbWC);return this._size=Cartesian2.magnitude(Cartesian2.subtract(a,c,scratchCartesian4$6)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands}}},Sun.prototype.isDestroyed=function(){return!1},Sun.prototype.destroy=function(){var e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),destroyObject(this)},TileBoundingVolume.prototype.boundingVolume=void 0,TileBoundingVolume.prototype.boundingSphere=void 0,TileBoundingVolume.prototype.distanceToCamera=function(e){DeveloperError.throwInstantiationError()},TileBoundingVolume.prototype.intersectPlane=function(e){DeveloperError.throwInstantiationError()},TileBoundingVolume.prototype.createDebugVolume=function(e){DeveloperError.throwInstantiationError()},Object.defineProperties(TileCoordinatesImageryProvider.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return!0}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}}),TileCoordinatesImageryProvider.prototype.getTileCredits=function(e,t,i){},TileCoordinatesImageryProvider.prototype.requestImage=function(e,t,i,r){var n=document.createElement("canvas");n.width=256,n.height=256;var a=n.getContext("2d"),o=this._color.toCssColorString();return a.strokeStyle=o,a.lineWidth=2,a.strokeRect(1,1,255,255),a.font="bold 25px Arial",a.textAlign="center",a.fillStyle=o,a.fillText("L: "+i,124,86),a.fillText("X: "+e,124,136),a.fillText("Y: "+t,124,186),n},TileCoordinatesImageryProvider.prototype.pickFeatures=function(e,t,i,r,n){},TileDiscardPolicy.prototype.isReady=DeveloperError.throwInstantiationError,TileDiscardPolicy.prototype.shouldDiscardImage=DeveloperError.throwInstantiationError;var TileState={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},TileState$1=Object.freeze(TileState);function TimeDynamicPointCloud(e){e=defaultValue(e,defaultValue.EMPTY_OBJECT),this.show=defaultValue(e.show,!0),this.modelMatrix=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),this.shadows=defaultValue(e.shadows,ShadowMode$1.ENABLED),this.maximumMemoryUsage=defaultValue(e.maximumMemoryUsage,256),this.shading=new PointCloudShading(e.shading),this.style=e.style,this.frameFailed=new Event,this.frameChanged=new Event,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new PointCloudEyeDomeLighting,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._readyPromise=when.defer(),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=arrayFill(new Array(5),0),this._runningAverage=0}function getFragmentShaderLoaded$1(e){return"uniform vec4 czm_pickColor;\n"+e}function getUniformMapLoaded$1(t){return function(e){return combine(e,{czm_pickColor:function(){return t._pickId.color}})}}function getPickIdLoaded$1(){return"czm_pickColor"}Object.defineProperties(TimeDynamicPointCloud.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){ClippingPlaneCollection.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(defined(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return this._readyPromise.promise}}}),TimeDynamicPointCloud.prototype.makeStyleDirty=function(){this._styleDirty=!0},TimeDynamicPointCloud.prototype._getAverageLoadTime=function(){return 0===this._runningLength?.05:this._runningAverage};var scratchDate$1=new JulianDate;function getClockMultiplier(e){var t=e._clock,e=t.canAnimate&&t.shouldAnimate,t=t.multiplier;return e?t:0}function getIntervalIndex(e,t){return e._intervals.indexOf(t.start)}function getNextInterval(e,t){var i=e._intervals,r=e._clock,n=getClockMultiplier(e);if(0!==n){var a=e._getAverageLoadTime(),a=JulianDate.addSeconds(r.currentTime,a*n,scratchDate$1),a=i.indexOf(a);return a===getIntervalIndex(e,t)&&(0<=n?++a:--a),i.get(a)}}function getCurrentInterval(e){var t=e._intervals,e=e._clock.currentTime,e=t.indexOf(e);return t.get(e)}function reachedInterval(e,t,i){var r=getClockMultiplier(e),t=getIntervalIndex(e,t),i=getIntervalIndex(e,i);return 0<=r?i<=t:t<=i}function handleFrameFailure(t,i){return function(e){e=defined(e.message)?e.message:e.toString();0<t.frameFailed.numberOfListeners?t.frameFailed.raiseEvent({uri:i,message:e}):(console.log("A frame failed to load: "+i),console.log("Error: "+e))}}function requestFrame(t,e,i){var r,n=getIntervalIndex(t,e),a=t._frames,o=a[n];return defined(o)||(r=defined(r=e.data.transform)?Matrix4.fromArray(r):void 0,e=e.data.uri,o={pointCloud:void 0,transform:r,timestamp:getTimestamp$1(),sequential:!0,ready:!1,touchedFrameNumber:i.frameNumber},a[n]=o,Resource.fetchArrayBuffer({url:e}).then(function(e){return o.pointCloud=new PointCloud({arrayBuffer:e,cull:!0,fragmentShaderLoaded:getFragmentShaderLoaded$1,uniformMapLoaded:getUniformMapLoaded$1(t),pickIdLoaded:getPickIdLoaded$1}),o.pointCloud.readyPromise}).otherwise(handleFrameFailure(t,e))),o}function updateAverageLoadTime(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function prepareFrame(e,t,i,r){t.touchedFrameNumber<r.frameNumber-1&&(t.sequential=!1);var n,a,o=t.pointCloud;defined(o)&&!t.ready&&(a=(n=r.commandList).length,renderFrame(e,t,i,r),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,n.length=a,t.sequential&&updateAverageLoadTime(e,(getTimestamp$1()-t.timestamp)/1e3))),t.touchedFrameNumber=r.frameNumber}var scratchModelMatrix$1=new Matrix4;function getGeometricError$1(e,t){e=e.shading;return defined(e)&&defined(e.baseResolution)?e.baseResolution:defined(t.boundingSphere)?CesiumMath.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function getMaximumAttenuation(e){e=e.shading;return defined(e)&&defined(e.maximumAttenuation)?e.maximumAttenuation:10}var defaultShading$1=new PointCloudShading;function renderFrame(e,t,i,r){var n=defaultValue(e.shading,defaultShading$1),a=t.pointCloud,o=defaultValue(t.transform,Matrix4.IDENTITY);a.modelMatrix=Matrix4.multiplyTransformation(e.modelMatrix,o,scratchModelMatrix$1),a.style=e.style,a.time=i.timeSinceLoad,a.shadows=e.shadows,a.clippingPlanes=e._clippingPlanes,a.isClipped=i.isClipped,a.attenuation=n.attenuation,a.backFaceCulling=n.backFaceCulling,a.normalShading=n.normalShading,a.geometricError=getGeometricError$1(e,a),a.geometricErrorScale=n.geometricErrorScale,a.maximumAttenuation=getMaximumAttenuation(e),a.update(r),t.touchedFrameNumber=r.frameNumber}function loadFrame(e,t,i,r){prepareFrame(e,requestFrame(e,t,r),i,r)}function getUnloadCondition(t){return function(e){return e.touchedFrameNumber<t.frameNumber}}function unloadFrames(e,t){for(var i=e._frames,r=i.length,n=0;n<r;++n){var a,o=i[n];defined(o)&&(defined(t)&&!t(o)||(a=o.pointCloud,o.ready&&(e._totalMemoryUsageInBytes-=a.geometryByteLength),defined(a)&&a.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),i[n]=void 0))}}function getFrame(e,t){t=getIntervalIndex(e,t),t=e._frames[t];if(defined(t)&&t.ready)return t}function updateInterval(e,t,i,r,n){return defined(i)&&(i.ready||(loadFrame(e,t,r,n),i.ready))}function getNearestReadyInterval(e,t,i,r,n){var a,o,s=e._intervals,l=e._frames,i=getIntervalIndex(e,i),c=getIntervalIndex(e,t);if(c<=i){for(a=i;c<=a;--a)if(updateInterval(e,o=s.get(a),l[a],r,n))return o}else for(a=i;a<=c;++a)if(updateInterval(e,o=s.get(a),l[a],r,n))return o;return t}function setFramesDirty(e,t,i){for(var r=e._frames,n=r.length,a=0;a<n;++a){var o=r[a];defined(o)&&defined(o.pointCloud)&&(o.pointCloud.clippingPlanesDirty=t,o.pointCloud.styleDirty=i)}}var updateState={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};TimeDynamicPointCloud.prototype.update=function(e){var t,i,r,n,a,o,s,l,c,u,d;e.mode!==SceneMode$1.MORPHING&&this.show&&(defined(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),defined(this._loadTimestamp)||(this._loadTimestamp=JulianDate.clone(e.time)),s=Math.max(1e3*JulianDate.secondsDifference(e.time,this._loadTimestamp),0),a=0,u=!1,(l=defined(n=this._clippingPlanes)&&n.enabled)&&(n.update(e),a=n.clippingPlanesState),this._clippingPlanesState!==a&&(this._clippingPlanesState=a,u=!0),o=this._styleDirty,this._styleDirty=!1,(u||o)&&setFramesDirty(this,u,o),updateState.timeSinceLoad=s,updateState.isClipped=l,t=this.shading,i=this._pointCloudEyeDomeLighting,r=(d=e.commandList).length,n=this._previousInterval,a=this._nextInterval,defined(u=getCurrentInterval(this))&&(o=!1,l=0===(s=getClockMultiplier(this)),s!==this._clockMultiplier&&(o=!0,this._clockMultiplier=s),defined(n)&&!l||(n=u),defined(a)&&!o&&!reachedInterval(this,u,a)||(a=getNextInterval(this,u)),defined(u=getFrame(this,n=getNearestReadyInterval(this,n,u,updateState,e)))||(loadFrame(this,n,updateState,e),u=this._lastRenderedFrame),defined(u)&&renderFrame(this,u,updateState,e),defined(a)&&loadFrame(this,a,updateState,e),c=this,defined(u)&&!defined(this._lastRenderedFrame)&&e.afterRender.push(function(){c._readyPromise.resolve(c)}),defined(u)&&u!==this._lastRenderedFrame&&0<c.frameChanged.numberOfListeners&&e.afterRender.push(function(){c.frameChanged.raiseEvent(c)}),this._previousInterval=n,this._nextInterval=a,this._lastRenderedFrame=u,u=this._totalMemoryUsageInBytes,1024*this.maximumMemoryUsage*1024<u&&unloadFrames(this,getUnloadCondition(e)),d=d.length-r,defined(t)&&t.attenuation&&t.eyeDomeLighting&&0<d&&i.update(e,r,t,this.boundingSphere)))},TimeDynamicPointCloud.prototype.isDestroyed=function(){return!1},TimeDynamicPointCloud.prototype.destroy=function(){return unloadFrames(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),destroyObject(this)};var ViewportQuadFS="varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n";function ViewportQuad(e,t){this.show=!0,defined(e)||(e=new BoundingRectangle),this.rectangle=BoundingRectangle.clone(e),defined(t)||(t=Material.fromType(Material.ColorType,{color:new Color(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}function computeFlyToLocationForRectangle(t,i){var r=i.terrainProvider,e=i.mapProjection,n=e.ellipsoid,a=i.camera.getRectangleCameraCoordinates(t),o=i.mode===SceneMode$1.SCENE3D?n.cartesianToCartographic(a):e.unproject(a);return defined(r)?r.readyPromise.then(function(){if(!defined(r.availability)||i.mode===SceneMode$1.SCENE2D)return o;var e=[Rectangle.center(t),Rectangle.southeast(t),Rectangle.southwest(t),Rectangle.northeast(t),Rectangle.northwest(t)];return computeFlyToLocationForRectangle._sampleTerrainMostDetailed(r,e).then(function(e){var t=e.reduce(function(e,t){return Math.max(t.height,e)},-Number.MAX_VALUE),e=o;return e.height+=t,e})}):when.resolve(o)}function createOsmBuildings(e){var t=new Cesium3DTileset(e=combine(e,{url:IonResource.fromAssetId(96188)})),i=e.style;return defined(i)||(i=new Cesium3DTileStyle({color:"Boolean(${feature['cesium#color']}) ? color(${feature['cesium#color']}) : "+defaultValue(e.defaultColor,Color.WHITE).toCssColorString()})),t.style=i,t}function createTangentSpaceDebugPrimitive(e){var t=[],i=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).geometry;defined(i.attributes)&&defined(i.primitiveType)||(i=i.constructor.createGeometry(i));var r=i.attributes,n=Matrix4.clone(defaultValue(e.modelMatrix,Matrix4.IDENTITY)),e=defaultValue(e.length,1e4);if(defined(r.normal)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"normal",e),attributes:{color:new ColorGeometryInstanceAttribute(1,0,0,1)},modelMatrix:n})),defined(r.tangent)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"tangent",e),attributes:{color:new ColorGeometryInstanceAttribute(0,1,0,1)},modelMatrix:n})),defined(r.bitangent)&&t.push(new GeometryInstance({geometry:GeometryPipeline.createLineSegmentsForVectors(i,"bitangent",e),attributes:{color:new ColorGeometryInstanceAttribute(0,0,1,1)},modelMatrix:n})),0<t.length)return new Primitive({asynchronous:!1,geometryInstances:t,appearance:new PerInstanceColorAppearance({flat:!0,translucent:!1})})}function createWorldImagery(e){return e=defaultValue(e,defaultValue.EMPTY_OBJECT),new IonImageryProvider({assetId:defaultValue(e.style,IonWorldImageryStyle$1.AERIAL)})}ViewportQuad.prototype.update=function(e){var t,i;this.show&&(defined(i=this._rs)&&BoundingRectangle.equals(i.viewport,this.rectangle)||(this._rs=RenderState.fromCache({blending:BlendingState$1.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render&&(t=e.context,this._material===this.material&&defined(this._overlayCommand)||(this._material=this.material,defined(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy(),i=new ShaderSource({sources:[this._material.shaderSource,ViewportQuadFS]}),this._overlayCommand=t.createViewportQuadCommand(i,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Pass$1.OVERLAY),this._material.update(t),this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)))},ViewportQuad.prototype.isDestroyed=function(){return!1},ViewportQuad.prototype.destroy=function(){return defined(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),destroyObject(this)},computeFlyToLocationForRectangle._sampleTerrainMostDetailed=sampleTerrainMostDetailed;var tmp$6={},bFj,cFj,dFj,eFj,fFj,gFj,eNj,ZEj,$Ej,_Ej,aFj;bFj={defaultNoDataValue:-34027999387901484e22,decode:function(e,t){var i=(t=t||{}).encodedMaskData||null===t.encodedMaskData,r=fFj(e,t.inputOffset||0,i),e=null!==t.noDataValue?t.noDataValue:bFj.defaultNoDataValue,i=cFj(r,t.pixelType||Float32Array,t.encodedMaskData,e,t.returnMask),e={width:r.width,height:r.height,pixelData:i.resultPixels,minValue:i.minValue,maxValue:r.pixels.maxValue,noDataValue:e};return i.resultMask&&(e.maskData=i.resultMask),t.returnEncodedMask&&r.mask&&(e.encodedMaskData=r.mask.bitset||null),t.returnFileInfo&&(e.fileInfo=dFj(r),t.computeUsedBitDepths&&(e.fileInfo.bitDepths=eFj(r))),e}},cFj=function(e,t,i,r,n){var a,o,s,l=0,c=e.pixels.numBlocksX,u=e.pixels.numBlocksY,d=Math.floor(e.width/c),h=Math.floor(e.height/u),p=2*e.maxZError,m=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),o=new t(e.width*e.height),n&&i&&(s=new Uint8Array(e.width*e.height));for(var f,g,_=new Float32Array(d*h),y=0;y<=u;y++){var C=y!==u?h:e.height%u;if(0!==C)for(var v=0;v<=c;v++){var S=v!==c?d:e.width%c;if(0!==S){var T,x,b,E,P=y*e.width*h+v*d,A=e.width-S,w=e.pixels.blocks[l];if(w.encoding<2?(T=0===w.encoding?w.rawData:(gFj(w.stuffedData,w.bitsPerPixel,w.numValidPixels,w.offset,p,_,e.pixels.maxValue),_),x=0):b=2===w.encoding?0:w.offset,i)for(g=0;g<C;g++){for(7&P&&(E=i[P>>3],E<<=7&P),f=0;f<S;f++)7&P||(E=i[P>>3]),128&E?(s&&(s[P]=1),m=(a=w.encoding<2?T[x++]:b)<m?a:m,o[P++]=a):(s&&(s[P]=0),o[P++]=r),E<<=1;P+=A}else if(w.encoding<2)for(g=0;g<C;g++){for(f=0;f<S;f++)m=(a=T[x++])<m?a:m,o[P++]=a;P+=A}else for(m=b<m?b:m,g=0;g<C;g++){for(f=0;f<S;f++)o[P++]=b;P+=A}if(1===w.encoding&&x!==w.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:o,resultMask:s,minValue:m}},dFj=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},eFj=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},r=0;r<t;r++){var n=e.pixels.blocks[r];0===n.encoding?i.float32=!0:1===n.encoding?i[n.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},fFj=function(e,t,i){var r={},n=new Uint8Array(e,t,10);if(r.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==r.fileIdentifierString.trim())throw"Unexpected file identifier string: "+r.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(r.fileVersion=a.getInt32(0,!0),r.imageType=a.getInt32(4,!0),r.height=a.getUint32(8,!0),r.width=a.getUint32(12,!0),r.maxZError=a.getFloat64(16,!0),t+=24,!i)if(a=new DataView(e,t,16),r.mask={},r.mask.numBlocksY=a.getUint32(0,!0),r.mask.numBlocksX=a.getUint32(4,!0),r.mask.numBytes=a.getUint32(8,!0),r.mask.maxValue=a.getFloat32(12,!0),t+=16,0<r.mask.numBytes){var o=new Uint8Array(Math.ceil(r.width*r.height/8)),s=(a=new DataView(e,t,r.mask.numBytes)).getInt16(0,!0),l=2,c=0;do{if(0<s)for(;s--;)o[c++]=a.getUint8(l++);else for(var u=a.getUint8(l++),s=-s;s--;)o[c++]=u}while(s=a.getInt16(l,!0),(l+=2)<r.mask.numBytes);if(-32768!==s||c<o.length)throw"Unexpected end of mask RLE encoding";r.mask.bitset=o,t+=r.mask.numBytes}else 0==(r.mask.numBytes|r.mask.numBlocksY|r.mask.maxValue)&&(r.mask.bitset=new Uint8Array(Math.ceil(r.width*r.height/8)));a=new DataView(e,t,16),r.pixels={},r.pixels.numBlocksY=a.getUint32(0,!0),r.pixels.numBlocksX=a.getUint32(4,!0),r.pixels.numBytes=a.getUint32(8,!0),r.pixels.maxValue=a.getFloat32(12,!0),t+=16;var n=r.pixels.numBlocksX,i=r.pixels.numBlocksY,d=n+(0<r.width%n?1:0),h=i+(0<r.height%i?1:0);r.pixels.blocks=new Array(d*h);for(var p=0,m=0;m<h;m++)for(var f=0;f<d;f++){var g=0,_=e.byteLength-t;a=new DataView(e,t,Math.min(10,_));var y={};r.pixels.blocks[p++]=y;var C,_=a.getUint8(0);if(g++,y.encoding=63&_,3<y.encoding)throw"Invalid block encoding ("+y.encoding+")";if(2!==y.encoding){if(0!==_&&2!==_){if(_>>=6,2===(y.offsetType=_))y.offset=a.getInt8(1),g++;else if(1===_)y.offset=a.getInt16(1,!0),g+=2;else{if(0!==_)throw"Invalid block offset type";y.offset=a.getFloat32(1,!0),g+=4}if(1===y.encoding)if(_=a.getUint8(g),g++,y.bitsPerPixel=63&_,_>>=6,2===(y.numValidPixelsType=_))y.numValidPixels=a.getUint8(g),g++;else if(1===_)y.numValidPixels=a.getUint16(g,!0),g+=2;else{if(0!==_)throw"Invalid valid pixel count type";y.numValidPixels=a.getUint32(g,!0),g+=4}}if(t+=g,3!==y.encoding)if(0===y.encoding){var v=(r.pixels.numBytes-1)/4;if(v!==Math.floor(v))throw"uncompressed block has invalid length";C=new ArrayBuffer(4*v),new Uint8Array(C).set(new Uint8Array(e,t,4*v));var S=new Float32Array(C);y.rawData=S,t+=4*v}else 1===y.encoding&&(S=Math.ceil(y.numValidPixels*y.bitsPerPixel/8),v=Math.ceil(S/4),C=new ArrayBuffer(4*v),new Uint8Array(C).set(new Uint8Array(e,t,S)),y.stuffedData=new Uint32Array(C),t+=S)}else t++}return r.eofOffset=t,r},gFj=function(e,t,i,r,n,a,o){var s,l,c,u,d=(1<<t)-1,h=0,p=0,m=Math.ceil((o-r)/n),f=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*f,s=0;s<i;s++)0===p&&(u=e[h++],p=32),t<=p?(c=u>>>p-t&d,p-=t):(c=(u&d)<<(l=t-p)&d,c+=(u=e[h++])>>>(p=32-l)),a[s]=c<m?r+c*n:o;return a},ZEj=bFj,$Ej=function(){var v=function(e,t,i,r,n,a,o,s){var l,c,u,d,h,p=(1<<i)-1,m=0,f=0,g=4*e.length-Math.ceil(i*r/8);if(e[e.length-1]<<=8*g,n)for(l=0;l<r;l++)0===f&&(u=e[m++],f=32),i<=f?(c=u>>>f-i&p,f-=i):(c=(u&p)<<(d=i-f)&p,c+=(u=e[m++])>>>(f=32-d)),t[l]=n[c];else for(h=Math.ceil((s-a)/o),l=0;l<r;l++)0===f&&(u=e[m++],f=32),i<=f?(c=u>>>f-i&p,f-=i):(c=(u&p)<<(d=i-f)&p,c+=(u=e[m++])>>>(f=32-d)),t[l]=c<h?a+c*o:s},S=function(e,t,i,r,n,a){var o,s,l=(1<<t)-1,c=0,u=0,d=0,h=0,p=[],m=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*m;for(var f=Math.ceil((a-r)/n),u=0;u<i;u++)0===d&&(s=e[c++],d=32),t<=d?(h=s>>>d-t&l,d-=t):(h=(s&l)<<(o=t-d)&l,h+=(s=e[c++])>>>(d=32-o)),p[u]=h<f?r+h*n:a;return p.unshift(r),p},T=function(e,t,i,r,n,a,o,s){var l,c,u,d=(1<<i)-1,h=0,p=0,m=0;if(n)for(g=0;g<r;g++)0===p&&(c=e[h++],p=32,m=0),i<=p?(l=c>>>m&d,p-=i,m+=i):(l=c>>>m&d,p=32-(u=i-p),l|=((c=e[h++])&(1<<u)-1)<<i-u,m=u),t[g]=n[l];else for(var f=Math.ceil((s-a)/o),g=0;g<r;g++)0===p&&(c=e[h++],p=32,m=0),i<=p?(l=c>>>m&d,p-=i,m+=i):(l=c>>>m&d,p=32-(u=i-p),l|=((c=e[h++])&(1<<u)-1)<<i-u,m=u),t[g]=l<f?a+l*o:s;return t},x=function(e,t,i,r,n,a){for(var o,s,l=(1<<t)-1,c=0,u=0,d=0,h=0,p=0,m=[],f=Math.ceil((a-r)/n),u=0;u<i;u++)0===d&&(s=e[c++],d=32,p=0),t<=d?(h=s>>>p&l,d-=t,p+=t):(h=s>>>p&l,d=32-(o=t-d),h|=((s=e[c++])&(1<<o)-1)<<t-o,p=o),m[u]=h<f?r+h*n:a;return m.unshift(r),m},b=function(e,t,i,r){var n,a,o,s,l=(1<<i)-1,c=0,u=0,d=4*e.length-Math.ceil(i*r/8);for(e[e.length-1]<<=8*d,n=0;n<r;n++)0===u&&(o=e[c++],u=32),i<=u?(a=o>>>u-i&l,u-=i):(a=(o&l)<<(s=i-u)&l,a+=(o=e[c++])>>>(u=32-s)),t[n]=a;return t},E=function(e,t,i,r){for(var n,a,o,s=(1<<i)-1,l=0,c=0,u=0,d=0;d<r;d++)0===c&&(a=e[l++],c=32,u=0),i<=c?(n=a>>>u&s,c-=i,u+=i):(n=a>>>u&s,c=32-(o=i-c),n|=((a=e[l++])&(1<<o)-1)<<i-o,u=o),t[d]=n;return t},k={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,r=e.length,n=Math.floor(r/2),a=0;n;){var o=359<=n?359:n;for(n-=o;t+=e[a++]<<8,i+=t+=e[a++],--o;);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&r&&(i+=t+=e[a]<<8),((i=(65535&i)+(i>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var i=t.ptr,r=new Uint8Array(e,i,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,r),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;i+=6;var a=new DataView(e,i,8),r=a.getInt32(0,!0);if(n.fileVersion=r,i+=4,3<=r&&(n.checksum=a.getUint32(4,!0),i+=4),a=new DataView(e,i,12),n.height=a.getUint32(0,!0),n.width=a.getUint32(4,!0),i+=8,4<=r?(n.numDims=a.getUint32(8,!0),i+=4):n.numDims=1,a=new DataView(e,i,40),n.numValidPixel=a.getUint32(0,!0),n.microBlockSize=a.getInt32(4,!0),n.blobSize=a.getInt32(8,!0),n.imageType=a.getInt32(12,!0),n.maxZError=a.getFloat64(16,!0),n.zMin=a.getFloat64(24,!0),n.zMax=a.getFloat64(32,!0),i+=40,t.headerInfo=n,t.ptr=i,3<=r&&(r=4<=r?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-r,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,r=this.getDataTypeArray(i.imageType),n=i.numDims*this.getDataTypeSize(i.imageType),a=this.readSubArray(e,t.ptr,r,n),o=this.readSubArray(e,t.ptr+n,r,n);t.ptr+=2*n;for(var s=!0,l=0;l<i.numDims;l++)if(a[l]!==o[l]){s=!1;break}return i.minValues=a,i.maxValues=o,s},readSubArray:function(e,t,i,r){var n=i===Uint8Array?new Uint8Array(e,t,r):(n=new ArrayBuffer(r),new Uint8Array(n).set(new Uint8Array(e,t,r)),new i(n));return n},readMask:function(e,t){var i,r,n=t.ptr,a=t.headerInfo,o=a.width*a.height,a=a.numValidPixel,s=new DataView(e,n,4),l={};if(l.numBytes=s.getUint32(0,!0),n+=4,(0===a||o===a)&&0!==l.numBytes)throw"invalid mask";if(0===a)i=new Uint8Array(Math.ceil(o/8)),l.bitset=i,r=new Uint8Array(o),t.pixels.resultMask=r,n+=l.numBytes;else if(0<l.numBytes){i=new Uint8Array(Math.ceil(o/8));var c,u=(s=new DataView(e,n,l.numBytes)).getInt16(0,!0),d=2,h=0;do{if(0<u)for(;u--;)i[h++]=s.getUint8(d++);else for(c=s.getUint8(d++),u=-u;u--;)i[h++]=c}while(u=s.getInt16(d,!0),(d+=2)<l.numBytes);if(-32768!==u||h<i.length)throw"Unexpected end of mask RLE encoding";r=new Uint8Array(o);for(var p=0,m=0,m=0;m<o;m++)7&m?(p=i[m>>3],p<<=7&m):p=i[m>>3],128&p&&(r[m]=1);t.pixels.resultMask=r,l.bitset=i,n+=l.numBytes}return t.ptr=n,t.mask=l,!0},readDataOneSweep:function(e,t,i){var r=t.ptr,n=t.headerInfo,a=n.numDims,o=n.width*n.height,s=n.imageType,n=n.numValidPixel*k.getDataTypeSize(s)*a,l=t.pixels.resultMask,c=i===Uint8Array?new Uint8Array(e,r,n):(s=new ArrayBuffer(n),new Uint8Array(s).set(new Uint8Array(e,r,n)),new i(s));if(c.length===o*a)t.pixels.resultPixels=c;else{t.pixels.resultPixels=new i(o*a);var u,d=0,h=0,p=0;if(1<a)for(p=0;p<a;p++)for(u=p*o,h=0;h<o;h++)l[h]&&(t.pixels.resultPixels[u+h]=c[d++]);else for(h=0;h<o;h++)l[h]&&(t.pixels.resultPixels[h]=c[d++])}return r+=n,t.ptr=r,!0},readHuffmanTree:function(e,t){var i=this.HUFFMAN_LUT_BITS_MAX,r=new DataView(e,t.ptr,16);if(t.ptr+=16,r.getInt32(0,!0)<2)throw"unsupported Huffman version";var n=r.getInt32(4,!0),a=r.getInt32(8,!0),o=r.getInt32(12,!0);if(o<=a)return!1;var s=new Uint32Array(o-a);k.decodeBits(e,t,s);for(var l,c,u,d=[],h=a;h<o;h++)d[l=h-(h<n?0:n)]={first:s[h-a],second:null};var p=e.byteLength-t.ptr,r=Math.ceil(p/4),r=new ArrayBuffer(4*r);new Uint8Array(r).set(new Uint8Array(e,t.ptr,p));var m=new Uint32Array(r),f=0,g=0,_=m[0];for(h=a;h<o;h++)0<(u=d[l=h-(h<n?0:n)].first)&&(d[l].second=_<<f>>>32-u,u<=32-f?32===(f+=u)&&(f=0,_=m[++g]):(f+=u-32,_=m[++g],d[l].second|=_>>>32-f));var y=0,C=0,v=new A;for(h=0;h<d.length;h++)void 0!==d[h]&&(y=Math.max(y,d[h].first));C=i<=y?i:y,30<=y&&console.log("WARning, large NUM LUT BITS IS "+y);var S,T,x,b,E,P=[];for(h=a;h<o;h++)if(0<(u=d[l=h-(h<n?0:n)].first))if(S=[u,l],u<=C)for(T=d[l].second<<C-u,x=1<<C-u,c=0;c<x;c++)P[T|c]=S;else for(T=d[l].second,E=v,b=u-1;0<=b;b--)E=T>>>b&1?(E.right||(E.right=new A),E.right):(E.left||(E.left=new A),E.left),0!==b||E.val||(E.val=S[1]);return{decodeLut:P,numBitsLUTQick:C,numBitsLUT:y,tree:v,stuffedData:m,srcPtr:g,bitPos:f}},readHuffman:function(e,t,i){var r,n,a,o,s,l,c,u,d,h=t.headerInfo,p=h.numDims,m=t.headerInfo.height,f=t.headerInfo.width,g=f*m,e=this.readHuffmanTree(e,t),_=e.decodeLut,y=e.tree,C=e.stuffedData,v=e.srcPtr,S=e.bitPos,T=e.numBitsLUTQick,x=e.numBitsLUT,b=0===t.headerInfo.imageType?128:0,E=t.pixels.resultMask,P=0;0<S&&(v++,S=0);for(var A=C[v],w=1===t.encodeMode,D=new i(g*p),M=D,I=0;I<h.numDims;I++){if(1<p&&(M=new i(D.buffer,g*I,g),P=0),t.headerInfo.numValidPixel===f*m)for(l=u=0;l<m;l++)for(c=0;c<f;c++,u++){if(n=0,s=o=A<<S>>>32-T,32-S<T&&(s=o|=C[v+1]>>>64-S-T),_[s])n=_[s][1],S+=_[s][0];else for(s=o=A<<S>>>32-x,32-S<x&&(s=o|=C[v+1]>>>64-S-x),r=y,d=0;d<x;d++)if(!(r=o>>>x-d-1&1?r.right:r.left).left&&!r.right){n=r.val,S=S+d+1;break}32<=S&&(S-=32,A=C[++v]),a=n-b,w?(a+=!(0<c)&&0<l?M[u-f]:P,a&=255,P=M[u]=a):M[u]=a}else for(l=u=0;l<m;l++)for(c=0;c<f;c++,u++)if(E[u]){if(n=0,s=o=A<<S>>>32-T,32-S<T&&(s=o|=C[v+1]>>>64-S-T),_[s])n=_[s][1],S+=_[s][0];else for(s=o=A<<S>>>32-x,32-S<x&&(s=o|=C[v+1]>>>64-S-x),r=y,d=0;d<x;d++)if(!(r=o>>>x-d-1&1?r.right:r.left).left&&!r.right){n=r.val,S=S+d+1;break}32<=S&&(S-=32,A=C[++v]),a=n-b,w?(!(0<c&&E[u-1])&&0<l&&E[u-f]?a+=M[u-f]:a+=P,a&=255,P=M[u]=a):M[u]=a}t.ptr=t.ptr+4*(v+1)+(0<S?4:0)}t.pixels.resultPixels=D},decodeBits:function(e,t,i,r,n){var a=t.headerInfo,o=a.fileVersion,s=0,l=5<=e.byteLength-t.ptr?5:e.byteLength-t.ptr,c=new DataView(e,t.ptr,l),u=c.getUint8(0);s++;var d=u>>6,h=0==d?4:3-d,l=0<(32&u),d=31&u,u=0;if(1==h)u=c.getUint8(s),s++;else if(2==h)u=c.getUint16(s,!0),s+=2;else{if(4!=h)throw"Invalid valid pixel count type";u=c.getUint32(s,!0),s+=4}var p,m,f,g,_,y,C,h=2*a.maxZError,a=1<a.numDims?a.maxValues[n]:a.zMax;if(l){for(t.counter.lut++,y=c.getUint8(s),s++,g=Math.ceil((y-1)*d/8),_=Math.ceil(g/4),m=new ArrayBuffer(4*_),f=new Uint8Array(m),t.ptr+=s,f.set(new Uint8Array(e,t.ptr,g)),c=new Uint32Array(m),t.ptr+=g,C=0;y-1>>>C;)C++;g=Math.ceil(u*C/8),_=Math.ceil(g/4),m=new ArrayBuffer(4*_),(f=new Uint8Array(m)).set(new Uint8Array(e,t.ptr,g)),p=new Uint32Array(m),t.ptr+=g,c=(3<=o?x:S)(c,d,y-1,r,h,a),(3<=o?T:v)(p,i,C,u,c)}else t.counter.bitstuffer++,C=d,t.ptr+=s,0<C&&(g=Math.ceil(u*C/8),_=Math.ceil(g/4),m=new ArrayBuffer(4*_),(f=new Uint8Array(m)).set(new Uint8Array(e,t.ptr,g)),p=new Uint32Array(m),t.ptr+=g,3<=o?null===r?E(p,i,C,u):T(p,i,C,u,!1,r,h,a):null===r?b(p,i,C,u):v(p,i,C,u,!1,r,h,a))},readTiles:function(e,t,i){var r=t.headerInfo,n=r.width,a=r.height,o=r.microBlockSize,s=r.imageType,l=k.getDataTypeSize(s),c=Math.ceil(n/o),u=Math.ceil(a/o);t.pixels.numBlocksY=u,t.pixels.numBlocksX=c;for(var d,h,p,m,f,g,_,y,C,v,S,T,x,b,E=t.pixels.ptr=0,P=0,A=0,w=0,D=0,M=0,I=0,R=0,O=new i(o*o),L=a%o||o,F=n%o||o,N=r.numDims,B=t.pixels.resultMask,V=t.pixels.resultPixels,A=0;A<u;A++)for(d=A!==u-1?o:L,w=0;w<c;w++)for(D=A*n*o+w*o,g=n-(h=w!==c-1?o:F),b=0;b<N;b++){if(1<N&&(V=new i(t.pixels.resultPixels.buffer,n*a*b*l,n*a)),p=e.byteLength-t.ptr,C={},R=0,R++,f=(m=(y=new DataView(e,t.ptr,Math.min(10,p))).getUint8(0))>>6&255,(m>>2&15)!=(w*o>>3&15))throw"integrity issue";if(3<(S=3&m))throw t.ptr+=R,"Invalid block encoding ("+S+")";if(2!=S)if(0==S){if(t.counter.uncompressed++,t.ptr+=R,M=(M=d*h*l)<(_=e.byteLength-t.ptr)?M:_,T=new ArrayBuffer(M%l==0?M:M+l-M%l),new Uint8Array(T).set(new Uint8Array(e,t.ptr,M)),v=new i(T),I=0,B)for(E=0;E<d;E++){for(P=0;P<h;P++)B[D]&&(V[D]=v[I++]),D++;D+=g}else for(E=0;E<d;E++){for(P=0;P<h;P++)V[D++]=v[I++];D+=g}t.ptr+=I*l}else if(T=k.getDataTypeUsed(s,f),x=k.getOnePixel(C,R,T,y),R+=k.getDataTypeSize(T),3==S)if(t.ptr+=R,t.counter.constantoffset++,B)for(E=0;E<d;E++){for(P=0;P<h;P++)B[D]&&(V[D]=x),D++;D+=g}else for(E=0;E<d;E++){for(P=0;P<h;P++)V[D++]=x;D+=g}else if(t.ptr+=R,k.decodeBits(e,t,O,x,b),R=0,B)for(E=0;E<d;E++){for(P=0;P<h;P++)B[D]&&(V[D]=O[R++]),D++;D+=g}else for(E=0;E<d;E++){for(P=0;P<h;P++)V[D++]=O[R++];D+=g}else t.counter.constant++,t.ptr+=R}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:k.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t,i=e.headerInfo.zMax,r=e.headerInfo.numDims,n=e.headerInfo.height*e.headerInfo.width,a=n*r,o=0,s=0,l=e.pixels.resultMask;if(l)if(1<r)for(o=0;o<r;o++)for(t=o*n,s=0;s<n;s++)l[s]&&(e.pixels.resultPixels[t+s]=i);else for(s=0;s<n;s++)l[s]&&(e.pixels.resultPixels[s]=i);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(i);else for(s=0;s<a;s++)e.pixels.resultPixels[s]=i},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:t=Float32Array;break;case 7:t=Float64Array;break;default:t=Float32Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:t="F32";break;case 7:t="F64";break;default:t="F32"}return t},isValidPixelValue:function(e,t){if(null===t)return!1;var i;switch(e){case 0:i=-128<=t&&t<=127;break;case 1:i=0<=t&&t<=255;break;case 2:i=-32768<=t&&t<=32767;break;case 3:i=0<=t&&t<=65536;break;case 4:i=-2147483648<=t&&t<=2147483647;break;case 5:i=0<=t&&t<=4294967296;break;case 6:i=-34027999387901484e22<=t&&t<=34027999387901484e22;break;case 7:i=5e-324<=t&&t<=17976931348623157e292;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,r){var n=0;switch(i){case 0:n=r.getInt8(t);break;case 1:n=r.getUint8(t);break;case 2:n=r.getInt16(t,!0);break;case 3:n=r.getUint16(t,!0);break;case 4:n=r.getInt32(t,!0);break;case 5:n=r.getUInt32(t,!0);break;case 6:n=r.getFloat32(t,!0);break;case 7:n=r.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n}},A=function(e,t,i){this.val=e,this.left=t,this.right=i};return{decode:function(e,t){var i=(t=t||{}).noDataValue,r=0,n={};if(n.ptr=t.inputOffset||0,n.pixels={},k.readHeaderInfo(e,n)){var a=n.headerInfo,o=a.fileVersion,s=k.getDataTypeArray(a.imageType);k.readMask(e,n),a.numValidPixel===a.width*a.height||n.pixels.resultMask||(n.pixels.resultMask=t.maskData);var l,c=a.width*a.height;if(n.pixels.resultPixels=new s(c*a.numDims),n.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==a.numValidPixel)if(a.zMax===a.zMin)k.constructConstantSurface(n);else if(4<=o&&k.checkMinMaxRanges(e,n))k.constructConstantSurface(n);else{var u=new DataView(e,n.ptr,2),d=u.getUint8(0);if(n.ptr++,d)k.readDataOneSweep(e,n,s);else if(1<o&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){u=u.getUint8(1);if(n.ptr++,2<(n.encodeMode=u)||o<4&&1<u)throw"Invalid Huffman flag "+u;u?k.readHuffman(e,n,s):k.readTiles(e,n,s)}else k.readTiles(e,n,s)}n.eofOffset=n.ptr,t.inputOffset?(l=n.headerInfo.blobSize+t.inputOffset-n.ptr,1<=Math.abs(l)&&(n.eofOffset=t.inputOffset+n.headerInfo.blobSize)):(l=n.headerInfo.blobSize-n.ptr,1<=Math.abs(l)&&(n.eofOffset=n.headerInfo.blobSize));var h={width:a.width,height:a.height,pixelData:n.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:n.pixels.resultMask};if(n.pixels.resultMask&&k.isValidPixelValue(a.imageType,i)){for(var p=n.pixels.resultMask,r=0;r<c;r++)p[r]||(h.pixelData[r]=i);h.noDataValue=i}return n.noDataValue=i,t.returnFileInfo&&(h.fileInfo=k.formatFileInfo(n)),h}},getBandCount:function(e){for(var t=0,i=0,r={ptr:0,pixels:{}};i<e.byteLength-58;)k.readHeaderInfo(e,r),i+=r.headerInfo.blobSize,t++,r.ptr=i;return t}}}(),eNj=new ArrayBuffer(4),aFj=new Uint8Array(eNj),_Ej=(new Uint32Array(eNj)[0]=1)===aFj[0],aFj={decode:function(e,t){if(!_Ej)throw"Big endian system is not supported.";var i,r,n=(t=t||{}).inputOffset||0,a=new Uint8Array(e,n,10),a=String.fromCharCode.apply(null,a);if("CntZImage"===a.trim())i=ZEj,r=1;else{if("Lerc2"!==a.substring(0,5))throw"Unexpected file identifier string: "+a;i=$Ej,r=2}for(var o,s,l,c,u,d,h=0,p=e.byteLength-10,m=[],f={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};n<p;){var g=i.decode(e,{inputOffset:n,encodedMaskData:o,maskData:l,returnMask:0===h,returnEncodedMask:0===h,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null}),n=g.fileInfo.eofOffset;0===h&&(o=g.encodedMaskData,l=g.maskData,f.width=g.width,f.height=g.height,f.dimCount=g.dimCount||1,f.pixelType=g.pixelType||g.fileInfo.pixelType,f.mask=g.maskData),1<r&&g.fileInfo.mask&&0<g.fileInfo.mask.numBytes&&m.push(g.maskData),h++,f.pixels.push(g.pixelData),f.statistics.push({minValue:g.minValue,maxValue:g.maxValue,noDataValue:g.noDataValue,dimStats:g.dimStats})}if(1<r&&1<m.length){for(d=f.width*f.height,f.bandMasks=m,(l=new Uint8Array(d)).set(m[0]),c=1;c<m.length;c++)for(s=m[c],u=0;u<d;u++)l[u]=l[u]&s[u];f.maskData=l}return f}},tmp$6.Lerc=aFj;var LercDecode=tmp$6.Lerc,tmp$7={},ANj,BNj;ANj=tmp$7,BNj=function(){return n={},r.m=i=[function(e,t,i){var r=function(e,t,i){return t&&n(e.prototype,t),i&&n(e,i),e};function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=i(1),a=i.webm,o=i.mp4,s="undefined"!=typeof navigator&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,r=(r(l,[{key:"_addSourceToVideo",value:function(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}},{key:"enable",value:function(){s?(this.disable(),console.warn("\n NoSleep enabled for older iOS devices. This can interrupt\n active or long-running network requests from completing successfully.\n See https://github.com/richtr/NoSleep.js/issues/15 for more details.\n "),this.noSleepTimer=window.setInterval(function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3)):this.noSleepVideo.play()}},{key:"disable",value:function(){s?this.noSleepTimer&&(console.warn("\n NoSleep now disabled for older iOS devices.\n "),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause()}}]),l);function l(){var e=this;!function(e){if(!(e instanceof l))throw new TypeError("Cannot call a class as a function")}(this),s?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("muted",""),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",a),this._addSourceToVideo(this.noSleepVideo,"mp4",o),this.noSleepVideo.addEventListener("loadedmetadata",function(){e.noSleepVideo.duration<=1?e.noSleepVideo.setAttribute("loop",""):e.noSleepVideo.addEventListener("timeupdate",function(){.5<e.noSleepVideo.currentTime&&(e.noSleepVideo.currentTime=Math.random())})}))}e.exports=r},function(e,t,i){e.exports={webm:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",mp4:"data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA="}}],r.c=n,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0);function r(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var i,n},ANj.NoSleep=BNj();var NoSleep=tmp$7.NoSleep,oldValue;"undefined"!=typeof ko&&(oldValue=ko),function(I){var T=this||(0,eval)("this"),x=T.document,v=T.navigator,b=T.jQuery,S=T.JSON;b||"undefined"==typeof jQuery||(b=jQuery),function(e,r){function i(e,t){return(null===e||typeof e in l)&&e===t}function a(e,t){var i;return function(){i=i||M.a.setTimeout(function(){i=I,e()},t)}}function o(e,t){var i;return function(){clearTimeout(i),i=M.a.setTimeout(e,t)}}function c(e,t){t&&"change"!==t?"beforeChange"===t?this.pc(e):this.gb(e,t):this.qc(e)}function n(e,t){null!==t&&t.s&&t.s()}function s(e,t){var i=this.qd,r=i[p];r.ra||(this.Qb&&this.mb[t]?(i.uc(t,e,this.mb[t]),this.mb[t]=null,--this.Qb):r.I[t]||i.uc(t,e,r.J?{da:e}:i.$c(e)),e.Ja&&e.gd())}var M=void 0!==e?e:{};M.b=function(e,t){for(var i=e.split("."),r=M,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},M.L=function(e,t,i){e[t]=i},M.version="3.5.1",M.b("version",M.version),M.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},M.a=function(){function d(e,t){for(var i in e)a.call(e,i)&&t(i,e[i])}function e(e,t){if(t)for(var i in t)a.call(t,i)&&(e[i]=t[i]);return e}function t(e,t){return e.__proto__=t,e}function n(e,t,i,r){var n=e[t].match(h)||[];M.a.D(i.match(h),function(e){M.a.Na(n,e,r)}),e[t]=n.join(" ")}var a=Object.prototype.hasOwnProperty,i={__proto__:[]}instanceof Array,r="function"==typeof Symbol,o={},s={};o[v&&/Firefox\/2/i.test(v.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],o.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),d(o,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)s[t[i]]=e});var l,c={propertychange:!0},u=x&&function(){for(var e=3,t=x.createElement("div"),i=t.getElementsByTagName("i");t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e",i[0];);return 4<e?e:I}(),h=/\S+/g;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(e,t,i){for(var r=0,n=e.length;r<n;r++)t.call(i,e[r],r,e)},A:"function"==typeof Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t)}:function(e,t){for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Lb:function(e,t,i){for(var r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r,e))return e[r];return I},Pa:function(e,t){t=M.a.A(e,t);0<t?e.splice(t,1):0===t&&e.shift()},wc:function(e){var t=[];return e&&M.a.D(e,function(e){M.a.A(t,e)<0&&t.push(e)}),t},Mb:function(e,t,i){var r=[];if(e)for(var n=0,a=e.length;n<a;n++)r.push(t.call(i,e[n],n));return r},jb:function(e,t,i){var r=[];if(e)for(var n=0,a=e.length;n<a;n++)t.call(i,e[n],n)&&r.push(e[n]);return r},Nb:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var i=0,r=t.length;i<r;i++)e.push(t[i]);return e},Na:function(e,t,i){var r=M.a.A(M.a.bc(e),t);r<0?i&&e.push(t):i||e.splice(r,1)},Ba:i,extend:e,setPrototypeOf:t,Ab:i?t:e,P:d,Ga:function(e,t,i){if(!e)return e;var r,n={};for(r in e)a.call(e,r)&&(n[r]=t.call(i,e[r],r,e));return n},Tb:function(e){for(;e.firstChild;)M.removeNode(e.firstChild)},Yb:function(e){for(var t=((e=M.a.la(e))[0]&&e[0].ownerDocument||x).createElement("div"),i=0,r=e.length;i<r;i++)t.appendChild(M.oa(e[i]));return t},Ca:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var a=e[i].cloneNode(!0);n.push(t?M.oa(a):a)}return n},va:function(e,t){if(M.a.Tb(e),t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},Xc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,a=0,o=t.length;a<o;a++)n.insertBefore(t[a],r);for(a=0,o=i.length;a<o;a++)M.removeNode(i[a])}},Ua:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var i=e[0],r=e[e.length-1];for(e.length=0;i!==r;)e.push(i),i=i.nextSibling;e.push(r)}}return e},Zc:function(e,t){u<7?e.setAttribute("selected",t):e.selected=t},Db:function(e){return null===e||e===I?"":e.trim?e.trim():e.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},vd:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(1!==e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},Sb:function(e){return M.a.vd(e,e.ownerDocument.documentElement)},kd:function(e){return!!M.a.Lb(e,M.a.Sb)},R:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Ac:function(e){return M.onError?function(){try{return e.apply(this,arguments)}catch(e){throw M.onError&&M.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(M.a.Ac(e),t)},Gc:function(e){setTimeout(function(){throw M.onError&&M.onError(e),e},0)},B:function(t,e,i){var r=M.a.Ac(i);if(i=c[e],M.options.useOnlyNativeEvents||i||!b)if(i||"function"!=typeof t.addEventListener){if(void 0===t.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var n=function(e){r.call(t,e)},a="on"+e;t.attachEvent(a,n),M.a.K.za(t,function(){t.detachEvent(a,n)})}else t.addEventListener(e,r,!1);else l=l||("function"==typeof b(t).on?"on":"bind"),b(t)[l](e,r)},Fb:function(e,t){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var i=!("input"!==M.a.R(e)||!e.type||"click"!=t.toLowerCase())&&("checkbox"==(i=e.type)||"radio"==i);if(M.options.useOnlyNativeEvents||!b||i)if("function"==typeof x.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");(i=x.createEvent(s[t]||"HTMLEvents")).initEvent(t,!0,!0,T,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(i)}else if(i&&e.click)e.click();else{if(void 0===e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+t)}else b(e).trigger(t)},f:function(e){return M.O(e)?e():e},bc:function(e){return M.O(e)?e.v():e},Eb:function(t,e,i){var r;e&&("object"==typeof t.classList?(r=t.classList[i?"add":"remove"],M.a.D(e.match(h),function(e){r.call(t.classList,e)})):"string"==typeof t.className.baseVal?n(t.className,"baseVal",e,i):n(t,"className",e,i))},Bb:function(e,t){var i=M.a.f(t);null!==i&&i!==I||(i="");t=M.h.firstChild(e);!t||3!=t.nodeType||M.h.nextSibling(t)?M.h.va(e,[e.ownerDocument.createTextNode(i)]):t.data=i,M.a.Ad(e)},Yc:function(e,t){if(e.name=t,u<=7)try{var i=e.name.replace(/[&<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"});e.mergeAttributes(x.createElement("<input name='"+i+"'/>"),!1)}catch(e){}},Ad:function(e){9<=u&&((e=1==e.nodeType?e:e.parentNode).style&&(e.style.zoom=e.style.zoom))},wd:function(e){var t;u&&(t=e.style.width,e.style.width=0,e.style.width=t)},Pd:function(e,t){e=M.a.f(e),t=M.a.f(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},la:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Da:function(e){return r?Symbol(e):e},Zd:6===u,$d:7===u,W:u,Lc:function(e,t){for(var i=M.a.la(e.getElementsByTagName("input")).concat(M.a.la(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],a=i.length-1;0<=a;a--)r(i[a])&&n.push(i[a]);return n},Nd:function(e){return"string"==typeof e&&(e=M.a.Db(e))?S&&S.parse?S.parse(e):new Function("return "+e)():null},hc:function(e,t,i){if(!S||!S.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return S.stringify(M.a.f(e),t,i)},Od:function(e,t,i){var r=(i=i||{}).params||{},n=i.includeFields||this.Jc,a=e;if("object"==typeof e&&"form"===M.a.R(e))for(var a=e.action,o=n.length-1;0<=o;o--)for(var s=M.a.Lc(e,n[o]),l=s.length-1;0<=l;l--)r[s[l].name]=s[l].value;t=M.a.f(t);var c,u=x.createElement("form");for(c in u.style.display="none",u.action=a,u.method="post",t)e=x.createElement("input"),e.type="hidden",e.name=c,e.value=M.a.hc(M.a.f(t[c])),u.appendChild(e);d(r,function(e,t){var i=x.createElement("input");i.type="hidden",i.name=e,i.value=t,u.appendChild(i)}),x.body.appendChild(u),i.submitter?i.submitter(u):u.submit(),setTimeout(function(){u.parentNode.removeChild(u)},0)}}}(),M.b("utils",M.a),M.b("utils.arrayForEach",M.a.D),M.b("utils.arrayFirst",M.a.Lb),M.b("utils.arrayFilter",M.a.jb),M.b("utils.arrayGetDistinctValues",M.a.wc),M.b("utils.arrayIndexOf",M.a.A),M.b("utils.arrayMap",M.a.Mb),M.b("utils.arrayPushAll",M.a.Nb),M.b("utils.arrayRemoveItem",M.a.Pa),M.b("utils.cloneNodes",M.a.Ca),M.b("utils.createSymbolOrString",M.a.Da),M.b("utils.extend",M.a.extend),M.b("utils.fieldsIncludedWithJsonPost",M.a.Jc),M.b("utils.getFormFields",M.a.Lc),M.b("utils.objectMap",M.a.Ga),M.b("utils.peekObservable",M.a.bc),M.b("utils.postJson",M.a.Od),M.b("utils.parseJson",M.a.Nd),M.b("utils.registerEventHandler",M.a.B),M.b("utils.stringifyJson",M.a.hc),M.b("utils.range",M.a.Pd),M.b("utils.toggleDomNodeCssClass",M.a.Eb),M.b("utils.triggerEvent",M.a.Fb),M.b("utils.unwrapObservable",M.a.f),M.b("utils.objectForEach",M.a.P),M.b("utils.addOrRemoveItem",M.a.Na),M.b("utils.setTextContent",M.a.Bb),M.b("unwrap",M.a.f),Function.prototype.bind||(Function.prototype.bind=function(t){var i=this;if(1===arguments.length)return function(){return i.apply(t,arguments)};var r=Array.prototype.slice.call(arguments,1);return function(){var e=r.slice(0);return e.push.apply(e,arguments),i.apply(t,e)}}),M.a.g=new function(){var r,n=0,a="__ko__"+(new Date).getTime(),o={},e=M.a.W?(r=function(e,t){var i=e[a];if(!i||"null"===i||!o[i]){if(!t)return I;i=e[a]="ko"+n++,o[i]={}}return o[i]},function(e){var t=e[a];return!!t&&(delete o[t],!(e[a]=null))}):(r=function(e,t){var i=e[a];return!i&&t&&(i=e[a]={}),i},function(e){return!!e[a]&&(delete e[a],!0)});return{get:function(e,t){e=r(e,!1);return e&&e[t]},set:function(e,t,i){(e=r(e,i!==I))&&(e[t]=i)},Ub:function(e,t,i){return(e=r(e,!0))[t]||(e[t]=i)},clear:e,Z:function(){return n+++a}}},M.b("utils.domData",M.a.g),M.b("utils.domData.clear",M.a.g.clear),M.a.K=new function(){function r(e,t){var i=M.a.g.get(e,o);return i===I&&t&&(i=[],M.a.g.set(e,o,i)),i}function a(e){if(t=r(e,!1))for(var t=t.slice(0),i=0;i<t.length;i++)t[i](e);M.a.g.clear(e),M.a.K.cleanExternalData(e),s[e.nodeType]&&n(e.childNodes,!0)}function n(e,t){for(var i,r=[],n=0;n<e.length;n++)if((!t||8===e[n].nodeType)&&(a(r[r.length]=i=e[n]),e[n]!==i))for(;n--&&-1==M.a.A(r,e[n]););}var o=M.a.g.Z(),t={1:!0,8:!0,9:!0},s={1:!0,9:!0};return{za:function(e,t){if("function"!=typeof t)throw Error("Callback must be a function");r(e,!0).push(t)},yb:function(e,t){var i=r(e,!1);i&&(M.a.Pa(i,t),0==i.length&&M.a.g.set(e,o,I))},oa:function(e){return M.u.G(function(){t[e.nodeType]&&(a(e),s[e.nodeType]&&n(e.getElementsByTagName("*")))}),e},removeNode:function(e){M.oa(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){b&&"function"==typeof b.cleanData&&b.cleanData([e])}}},M.oa=M.a.K.oa,M.removeNode=M.a.K.removeNode,M.b("cleanNode",M.oa),M.b("removeNode",M.removeNode),M.b("utils.domNodeDisposal",M.a.K),M.b("utils.domNodeDisposal.addDisposeCallback",M.a.K.za),M.b("utils.domNodeDisposal.removeDisposeCallback",M.a.K.yb),function(){var o=[0,"",""],e=[1,"<table>","</table>"],t=[3,"<table><tbody><tr>","</tr></tbody></table>"],i=[1,"<select multiple='multiple'>","</select>"],s={thead:e,tbody:e,tfoot:e,tr:[2,"<table><tbody>","</tbody></table>"],td:t,th:t,option:i,optgroup:i},l=M.a.W<=8;M.a.ua=function(e,t){var i;if(b){if(b.parseHTML)i=b.parseHTML(e,t)||[];else if((i=b.clean([e],t))&&i[0]){for(var r=i[0];r.parentNode&&11!==r.parentNode.nodeType;)r=r.parentNode;r.parentNode&&r.parentNode.removeChild(r)}}else{(i=t)||(i=x);var r=i.parentWindow||i.defaultView||T,n=M.a.Db(e).toLowerCase(),a=i.createElement("div"),t=(n=n.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&s[n[1]]||o,n=t[0];for(t="ignored<div>"+t[1]+e+t[2]+"</div>","function"==typeof r.innerShiv?a.appendChild(r.innerShiv(t)):(l&&i.body.appendChild(a),a.innerHTML=t,l&&a.parentNode.removeChild(a));n--;)a=a.lastChild;i=M.a.la(a.lastChild.childNodes)}return i},M.a.Md=function(e,t){t=M.a.ua(e,t);return t.length&&t[0].parentElement||M.a.Yb(t)},M.a.fc=function(e,t){if(M.a.Tb(e),null!==(t=M.a.f(t))&&t!==I)if("string"!=typeof t&&(t=t.toString()),b)b(e).html(t);else for(var i=M.a.ua(t,e.ownerDocument),r=0;r<i.length;r++)e.appendChild(i[r])}}(),M.b("utils.parseHtmlFragment",M.a.ua),M.b("utils.setHtml",M.a.fc),M.aa=function(){var r={};return{Xb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return r[t]=e,"\x3c!--[ko_memo:"+t+"]--\x3e"},bd:function(e,t){var i=r[e];if(i===I)throw Error("Couldn't find any memo with ID "+e+". Perhaps it's already been unmemoized.");try{return i.apply(null,t||[]),!0}finally{delete r[e]}},cd:function(e,t){var i=[];!function e(t,i){if(t)if(8==t.nodeType)null!=(r=M.aa.Uc(t.nodeValue))&&i.push({ud:t,Kd:r});else if(1==t.nodeType)for(var r=0,n=t.childNodes,a=n.length;r<a;r++)e(n[r],i)}(e,i);for(var r=0,n=i.length;r<n;r++){var a=i[r].ud,o=[a];t&&M.a.Nb(o,t),M.aa.bd(i[r].Kd,o),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},Uc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),M.b("memoization",M.aa),M.b("memoization.memoize",M.aa.Xb),M.b("memoization.unmemoize",M.aa.bd),M.b("memoization.parseMemoText",M.aa.Uc),M.b("memoization.unmemoizeDomNodeAndDescendants",M.aa.cd),M.na=function(){function e(){if(n)for(var e,t=n,i=0;o<n;)if(e=r[o++]){if(t<o){if(5e3<=++i){o=n,M.a.Gc(Error("'Too much recursion' after processing "+i+" task groups."));break}t=n}try{e()}catch(e){M.a.Gc(e)}}}function t(){e(),o=n=r.length=0}var i,r=[],n=0,a=1,o=0,s=T.MutationObserver?(s=t,i=x.createElement("div"),new MutationObserver(s).observe(i,{attributes:!0}),function(){i.classList.toggle("foo")}):x&&"onreadystatechange"in x.createElement("script")?function(e){var t=x.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,x.documentElement.removeChild(t),t=null,e()},x.documentElement.appendChild(t)}:function(e){setTimeout(e,0)};return{scheduler:s,zb:function(e){return n||M.na.scheduler(t),r[n++]=e,a++},cancel:function(e){o<=(e-=a-n)&&e<n&&(r[e]=null)},resetForTesting:function(){var e=n-o;return o=n=r.length=0,e},Sd:e}}(),M.b("tasks",M.na),M.b("tasks.schedule",M.na.zb),M.b("tasks.runEarly",M.na.Sd),M.Ta={throttle:function(t,i){t.throttleEvaluation=i;var r=null;return M.$({read:t,write:function(e){clearTimeout(r),r=M.a.setTimeout(function(){t(e)},i)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),e.Hb=!1,n="function"==typeof r?r:"notifyWhenChangesStop"==r?o:a,e.ub(function(e){return n(e,i,t)})},deferred:function(r,e){if(!0!==e)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");r.Hb||(r.Hb=!0,r.ub(function(e){var t,i=!1;return function(){if(!i){M.na.cancel(t),t=M.na.zb(e);try{i=!0,r.notifySubscribers(I,"dirty")}finally{i=!1}}}}))},notify:function(e,t){e.equalityComparer="always"==t?null:i}};var l={undefined:1,boolean:1,number:1,string:1};M.b("extenders",M.Ta),M.ic=function(e,t,i){this.da=e,this.lc=t,this.mc=i,this.Ib=!1,this.fb=this.Jb=null,M.L(this,"dispose",this.s),M.L(this,"disposeWhenNodeIsRemoved",this.l)},M.ic.prototype.s=function(){this.Ib||(this.fb&&M.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},M.ic.prototype.l=function(e){this.Jb=e,M.a.K.za(e,this.fb=this.s.bind(this))},M.T=function(){M.a.Ab(this,t),t.qb(this)};var t={qb:function(e){e.U={change:[]},e.sc=1},subscribe:function(e,t,i){var r=this;i=i||"change";var n=new M.ic(r,t?e.bind(t):e,function(){M.a.Pa(r.U[i],n),r.hb&&r.hb(i)});return r.Qa&&r.Qa(i),r.U[i]||(r.U[i]=[]),r.U[i].push(n),n},notifySubscribers:function(e,t){if("change"===(t=t||"change")&&this.Gb(),this.Wa(t)){var i="change"===t&&this.ed||this.U[t].slice(0);try{M.u.xc();for(var r,n=0;r=i[n];++n)r.Ib||r.lc(e)}finally{M.u.end()}}},ob:function(){return this.sc},Dd:function(e){return this.ob()!==e},Gb:function(){++this.sc},ub:function(e){var i,t,r,n,a,o=this,s=M.O(o);o.gb||(o.gb=o.notifySubscribers,o.notifySubscribers=c);var l=e(function(){o.Ja=!1,s&&n===o&&(n=o.nc?o.nc():o());var e=t||a&&o.sb(r,n);a=t=i=!1,e&&o.gb(r=n)});o.qc=function(e,t){t&&o.Ja||(a=!t),o.ed=o.U.change.slice(0),o.Ja=i=!0,n=e,l()},o.pc=function(e){i||(r=e,o.gb(e,"beforeChange"))},o.rc=function(){a=!0},o.gd=function(){o.sb(r,o.v(!0))&&(t=!0)}},Wa:function(e){return this.U[e]&&this.U[e].length},Bd:function(e){if(e)return this.U[e]&&this.U[e].length||0;var i=0;return M.a.P(this.U,function(e,t){"dirty"!==e&&(i+=t.length)}),i},sb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},toString:function(){return"[object Object]"},extend:function(e){var i=this;return e&&M.a.P(e,function(e,t){e=M.Ta[e];"function"==typeof e&&(i=e(i,t)||i)}),i}};M.L(t,"init",t.qb),M.L(t,"subscribe",t.subscribe),M.L(t,"extend",t.extend),M.L(t,"getSubscriptionsCount",t.Bd),M.a.Ba&&M.a.setPrototypeOf(t,Function.prototype),M.T.fn=t,M.Qc=function(e){return null!=e&&"function"==typeof e.subscribe&&"function"==typeof e.notifySubscribers},M.b("subscribable",M.T),M.b("isSubscribable",M.Qc),M.S=M.u=function(){function r(e){i.push(t),t=e}function n(){t=i.pop()}var t,i=[],a=0;return{xc:r,end:n,cc:function(e){if(t){if(!M.Qc(e))throw Error("Only subscribable things can act as dependencies");t.od.call(t.pd,e,e.fd||(e.fd=++a))}},G:function(e,t,i){try{return r(),e.apply(t,i||[])}finally{n()}},qa:function(){if(t)return t.o.qa()},Va:function(){if(t)return t.o.Va()},Ya:function(){if(t)return t.Ya},o:function(){if(t)return t.o}}}(),M.b("computedContext",M.S),M.b("computedContext.getDependenciesCount",M.S.qa),M.b("computedContext.getDependencies",M.S.Va),M.b("computedContext.isInitial",M.S.Ya),M.b("computedContext.registerDependency",M.S.cc),M.b("ignoreDependencies",M.Yd=M.u.G);var u=M.a.Da("_latestValue");M.ta=function(e){function t(){return 0<arguments.length?(t.sb(t[u],arguments[0])&&(t.ya(),t[u]=arguments[0],t.xa()),this):(M.u.cc(t),t[u])}return t[u]=e,M.a.Ba||M.a.extend(t,M.T.fn),M.T.fn.qb(t),M.a.Ab(t,d),M.options.deferUpdates&&M.Ta.deferred(t,!0),t};var d={equalityComparer:i,v:function(){return this[u]},xa:function(){this.notifySubscribers(this[u],"spectate"),this.notifySubscribers(this[u])},ya:function(){this.notifySubscribers(this[u],"beforeChange")}};M.a.Ba&&M.a.setPrototypeOf(d,M.T.fn);var h=M.ta.Ma="__ko_proto__";d[h]=M.ta,M.O=function(e){if((e="function"==typeof e&&e[h])&&e!==d[h]&&e!==M.o.fn[h])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!e},M.Za=function(e){return"function"==typeof e&&(e[h]===d[h]||e[h]===M.o.fn[h]&&e.Nc)},M.b("observable",M.ta),M.b("isObservable",M.O),M.b("isWriteableObservable",M.Za),M.b("isWritableObservable",M.Za),M.b("observable.fn",d),M.L(d,"peek",d.v),M.L(d,"valueHasMutated",d.xa),M.L(d,"valueWillMutate",d.ya),M.Ha=function(e){if("object"!=typeof(e=e||[])||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=M.ta(e),M.a.Ab(e,M.Ha.fn),e.extend({trackArrayChanges:!0})},M.Ha.fn={remove:function(t){for(var e=this.v(),i=[],r="function"!=typeof t||M.O(t)?function(e){return e===t}:t,n=0;n<e.length;n++){var a=e[n];if(r(a)){if(0===i.length&&this.ya(),e[n]!==a)throw Error("Array modified during remove; cannot remove item");i.push(a),e.splice(n,1),n--}}return i.length&&this.xa(),i},removeAll:function(t){if(t!==I)return t?this.remove(function(e){return 0<=M.a.A(t,e)}):[];var e=this.v(),i=e.slice(0);return this.ya(),e.splice(0,e.length),this.xa(),i},destroy:function(t){var e=this.v(),i="function"!=typeof t||M.O(t)?function(e){return e===t}:t;this.ya();for(var r=e.length-1;0<=r;r--){var n=e[r];i(n)&&(n._destroy=!0)}this.xa()},destroyAll:function(t){return t===I?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=M.a.A(t,e)}):[]},indexOf:function(e){var t=this();return M.a.A(t,e)},replace:function(e,t){e=this.indexOf(e);0<=e&&(this.ya(),this.v()[e]=t,this.xa())},sorted:function(e){var t=this().slice(0);return e?t.sort(e):t.sort()},reversed:function(){return this().slice(0).reverse()}},M.a.Ba&&M.a.setPrototypeOf(M.Ha.fn,M.ta.fn),M.a.D("pop push reverse shift sort splice unshift".split(" "),function(i){M.Ha.fn[i]=function(){var e=this.v();this.ya(),this.zc(e,i,arguments);var t=e[i].apply(e,arguments);return this.xa(),t===e?this:t}}),M.a.D(["slice"],function(t){M.Ha.fn[t]=function(){var e=this();return e[t].apply(e,arguments)}}),M.Pc=function(e){return M.O(e)&&"function"==typeof e.remove&&"function"==typeof e.push},M.b("observableArray",M.Ha),M.b("isObservableArray",M.Pc),M.Ta.trackArrayChanges=function(i,e){var d,h,r,n,p,a,o,t;i.Ob={},e&&"object"==typeof e&&M.a.extend(i.Ob,e),i.Ob.sparse=!0,i.zc||(d=!1,h=null,p=0,o=i.Qa,t=i.hb,i.Qa=function(e){function t(){var e,t;p&&(e=[].concat(i.v()||[]),i.Wa("arrayChange")&&((!h||1<p)&&(h=M.a.Pb(a,e,i.Ob)),t=h),a=e,h=null,p=0,t&&t.length&&i.notifySubscribers(t,"arrayChange"))}o&&o.call(i,e),"arrayChange"===e&&(d?t():(d=!0,n=i.subscribe(function(){++p},null,"spectate"),a=[].concat(i.v()||[]),h=null,r=i.subscribe(t)))},i.hb=function(e){t&&t.call(i,e),"arrayChange"!==e||i.Wa("arrayChange")||(r&&r.s(),n&&n.s(),n=r=null,d=!1,a=I)},i.zc=function(e,t,i){function r(e,t,i){return n[n.length]={status:e,value:t,index:i}}if(d&&!p){var n=[],a=e.length,o=i.length,s=0;switch(t){case"push":s=a;case"unshift":for(t=0;t<o;t++)r("added",i[t],s+t);break;case"pop":s=a-1;case"shift":a&&r("deleted",e[s],s);break;case"splice":t=Math.min(Math.max(0,i[0]<0?a+i[0]:i[0]),a);for(var a=1===o?a:Math.min(t+(i[1]||0),a),o=t+o-2,s=Math.max(a,o),l=[],c=[],u=2;t<s;++t,++u)t<a&&c.push(r("deleted",e[t],t)),t<o&&l.push(r("added",i[u],t));M.a.Kc(c,l);break;default:return}h=n}})};var p=M.a.Da("_state");M.o=M.$=function(e,t,i){function r(){if(0<arguments.length){if("function"!=typeof n)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return n.apply(a.nb,arguments),this}return a.ra||M.u.cc(r),(a.ka||a.J&&r.Xa())&&r.ha(),a.X}if("object"==typeof e?i=e:(i=i||{},e&&(i.read=e)),"function"!=typeof i.read)throw Error("Pass a function that returns the value of the ko.computed");var n=i.write,a={X:I,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:i.read,nb:t||i.owner,l:i.disposeWhenNodeIsRemoved||i.l||null,Sa:i.disposeWhen||i.Sa,Rb:null,I:{},V:0,Ic:null};return r[p]=a,r.Nc="function"==typeof n,M.a.Ba||M.a.extend(r,M.T.fn),M.T.fn.qb(r),M.a.Ab(r,m),i.pure?(a.wb=!0,a.J=!0,M.a.extend(r,f)):i.deferEvaluation&&M.a.extend(r,g),M.options.deferUpdates&&M.Ta.deferred(r,!0),a.l&&(a.jc=!0,a.l.nodeType||(a.l=null)),a.J||i.deferEvaluation||r.ha(),a.l&&r.ja()&&M.a.K.za(a.l,a.Rb=function(){r.s()}),r};var m={equalityComparer:i,qa:function(){return this[p].V},Va:function(){var i=[];return M.a.P(this[p].I,function(e,t){i[t.Ka]=t.da}),i},Vb:function(t){if(!this[p].V)return!1;var e=this.Va();return-1!==M.a.A(e,t)||!!M.a.Lb(e,function(e){return e.Vb&&e.Vb(t)})},uc:function(e,t,i){if(this[p].wb&&t===this)throw Error("A 'pure' computed must not be called recursively");(this[p].I[e]=i).Ka=this[p].V++,i.La=t.ob()},Xa:function(){var e,t,i=this[p].I;for(e in i)if(Object.prototype.hasOwnProperty.call(i,e)&&(t=i[e],this.Ia&&t.da.Ja||t.da.Dd(t.La)))return!0},Jd:function(){this.Ia&&!this[p].rb&&this.Ia(!1)},ja:function(){var e=this[p];return e.ka||0<e.V},Rd:function(){this.Ja?this[p].ka&&(this[p].sa=!0):this.Hc()},$c:function(e){if(e.Hb){var t=e.subscribe(this.Jd,this,"dirty"),i=e.subscribe(this.Rd,this);return{da:e,s:function(){t.s(),i.s()}}}return e.subscribe(this.Hc,this)},Hc:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[p].Ic),this[p].Ic=M.a.setTimeout(function(){e.ha(!0)},t)):e.Ia?e.Ia(!0):e.ha(!0)},ha:function(e){var t=this[p],i=t.Sa,r=!1;if(!t.rb&&!t.ra){if(t.l&&!M.a.Sb(t.l)||i&&i()){if(!t.jc)return void this.s()}else t.jc=!1;t.rb=!0;try{r=this.zd(e)}finally{t.rb=!1}return r}},zd:function(e){var t=this[p],i=!1,r=t.wb?I:!t.V,i={qd:this,mb:t.I,Qb:t.V};M.u.xc({pd:i,od:s,o:this,Ya:r}),t.I={},t.V=0;var n=this.yd(t,i);return(i=t.V?this.sb(t.X,n):(this.s(),!0))&&(t.J?this.Gb():this.notifySubscribers(t.X,"beforeChange"),t.X=n,this.notifySubscribers(t.X,"spectate"),!t.J&&e&&this.notifySubscribers(t.X),this.rc&&this.rc()),r&&this.notifySubscribers(t.X,"awake"),i},yd:function(e,t){try{var i=e.Wc;return e.nb?i.call(e.nb):i()}finally{M.u.end(),t.Qb&&!e.J&&M.a.P(t.mb,n),e.sa=e.ka=!1}},v:function(e){var t=this[p];return(t.ka&&(e||!t.V)||t.J&&this.Xa())&&this.ha(),t.X},ub:function(e){M.T.fn.ub.call(this,e),this.nc=function(){return this[p].J||(this[p].sa?this.ha():this[p].ka=!1),this[p].X},this.Ia=function(e){this.pc(this[p].X),this[p].ka=!0,e&&(this[p].sa=!0),this.qc(this,!e)}},s:function(){var e=this[p];!e.J&&e.I&&M.a.P(e.I,function(e,t){t.s&&t.s()}),e.l&&e.Rb&&M.a.K.yb(e.l,e.Rb),e.I=I,e.V=0,e.ra=!0,e.sa=!1,e.ka=!1,e.J=!1,e.l=I,e.Sa=I,e.Wc=I,this.Nc||(e.nb=I)}},f={Qa:function(e){var i,n=this,a=n[p];!a.ra&&a.J&&"change"==e&&(a.J=!1,a.sa||n.Xa()?(a.I=null,a.V=0,n.ha()&&n.Gb()):(i=[],M.a.P(a.I,function(e,t){i[t.Ka]=e}),M.a.D(i,function(e,t){var i=a.I[e],r=n.$c(i.da);r.Ka=t,r.La=i.La,a.I[e]=r}),n.Xa()&&n.ha()&&n.Gb()),a.ra||n.notifySubscribers(a.X,"awake"))},hb:function(e){var i=this[p];i.ra||"change"!=e||this.Wa("change")||(M.a.P(i.I,function(e,t){t.s&&(i.I[e]={da:t.da,Ka:t.Ka,La:t.La},t.s())}),i.J=!0,this.notifySubscribers(I,"asleep"))},ob:function(){var e=this[p];return e.J&&(e.sa||this.Xa())&&this.ha(),M.T.fn.ob.call(this)}},g={Qa:function(e){"change"!=e&&"beforeChange"!=e||this.v()}};M.a.Ba&&M.a.setPrototypeOf(m,M.T.fn);var _=M.ta.Ma;m[_]=M.o,M.Oc=function(e){return"function"==typeof e&&e[_]===m[_]},M.Fd=function(e){return M.Oc(e)&&e[p]&&e[p].wb},M.b("computed",M.o),M.b("dependentObservable",M.o),M.b("isComputed",M.Oc),M.b("isPureComputed",M.Fd),M.b("computed.fn",m),M.L(m,"peek",m.v),M.L(m,"dispose",m.s),M.L(m,"isActive",m.ja),M.L(m,"getDependenciesCount",m.qa),M.L(m,"getDependencies",m.Va),M.xb=function(e,t){return"function"==typeof e?M.o(e,t,{pure:!0}):((e=M.a.extend({},e)).pure=!0,M.o(e,t))},M.b("pureComputed",M.xb),function(){function s(r,n,a){if(a=a||new e,"object"!=typeof(r=n(r))||null===r||r===I||r instanceof RegExp||r instanceof Date||r instanceof String||r instanceof Number||r instanceof Boolean)return r;var o=r instanceof Array?[]:{};return a.save(r,o),function(e,t){if(e instanceof Array){for(var i=0;i<e.length;i++)t(i);"function"==typeof e.toJSON&&t("toJSON")}else for(i in e)t(i)}(r,function(e){var t=n(r[e]);switch(typeof t){case"boolean":case"number":case"string":case"function":o[e]=t;break;case"object":case"undefined":var i=a.get(t);o[e]=i!==I?i:s(t,n,a)}}),o}function e(){this.keys=[],this.values=[]}M.ad=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return s(e,function(e){for(var t=0;M.O(e)&&t<10;t++)e=e();return e})},M.toJSON=function(e,t,i){return e=M.ad(e),M.a.hc(e,t,i)},e.prototype={constructor:e,save:function(e,t){var i=M.a.A(this.keys,e);0<=i?this.values[i]=t:(this.keys.push(e),this.values.push(t))},get:function(e){return 0<=(e=M.a.A(this.keys,e))?this.values[e]:I}}}(),M.b("toJS",M.ad),M.b("toJSON",M.toJSON),M.Wd=function(r,e,n){function t(t){var e=M.xb(r,n).extend({ma:"always"}),i=e.subscribe(function(e){e&&(i.s(),t(e))});return e.notifySubscribers(e.v()),i}return"function"!=typeof Promise||e?t(e.bind(n)):new Promise(t)},M.b("when",M.Wd),M.w={M:function(e){switch(M.a.R(e)){case"option":return!0===e.__ko__hasDomDataOptionValue__?M.a.g.get(e,M.c.options.$b):!(M.a.W<=7)||e.getAttributeNode("value")&&e.getAttributeNode("value").specified?e.value:e.text;case"select":return 0<=e.selectedIndex?M.w.M(e.options[e.selectedIndex]):I;default:return e.value}},cb:function(e,t,i){switch(M.a.R(e)){case"option":"string"==typeof t?(M.a.g.set(e,M.c.options.$b,I),"__ko__hasDomDataOptionValue__"in e&&delete e.__ko__hasDomDataOptionValue__,e.value=t):(M.a.g.set(e,M.c.options.$b,t),e.__ko__hasDomDataOptionValue__=!0,e.value="number"==typeof t?t:"");break;case"select":""!==t&&null!==t||(t=I);for(var r,n=-1,a=0,o=e.options.length;a<o;++a)if((r=M.w.M(e.options[a]))==t||""===r&&t===I){n=a;break}(i||0<=n||t===I&&1<e.size)&&(e.selectedIndex=n,6===M.a.W&&M.a.setTimeout(function(){e.selectedIndex=n},0));break;default:null!==t&&t!==I||(t=""),e.value=t}}},M.b("selectExtensions",M.w),M.b("selectExtensions.readValue",M.w.M),M.b("selectExtensions.writeValue",M.w.cb),M.m=function(){function i(e){123===(e=M.a.Db(e)).charCodeAt(0)&&(e=e.slice(1,-1));var t,i=[],r=(e+="\n,").match(d),n=[],a=0;if(1<r.length){for(var o,s=0;o=r[s];++s){var l=o.charCodeAt(0);if(44===l){if(a<=0){i.push(t&&n.length?{key:t,value:n.join("")}:{unknown:t||n.join("")}),t=a=0,n=[];continue}}else if(58===l){if(!a&&!t&&1===n.length){t=n.pop();continue}}else{if(47===l&&1<o.length&&(47===o.charCodeAt(1)||42===o.charCodeAt(1)))continue;47===l&&s&&1<o.length?(l=r[s-1].match(h))&&!p[l[0]]&&(r=(e=e.substr(e.indexOf(o)+1)).match(d),s=-1,o="/"):40===l||123===l||91===l?++a:41===l||125===l||93===l?--a:t||n.length||34!==l&&39!==l||(o=o.slice(1,-1))}n.push(o)}if(0<a)throw Error("Unbalanced parentheses, braces, or brackets")}return i}var c=["true","false","null","undefined"],u=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,d=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),h=/[\])"'A-Za-z0-9_$]+$/,p={in:1,return:1,typeof:1},m={};return{Ra:[],wa:m,ac:i,vb:function(e,t){function n(e,t){var i;if(!l){var r=M.getBindingHandler(e);if(r&&r.preprocess&&!(t=r.preprocess(t,e,n)))return;(r=m[e])&&(i=t,r=i=!(0<=M.a.A(c,i))&&(null!==(r=i.match(u))&&(r[1]?"Object("+r[1]+")"+r[2]:i))),r&&o.push("'"+("string"==typeof m[e]?m[e]:e)+"':function(_z){"+i+"=_z}")}s&&(t="function(){return "+t+" }"),a.push("'"+e+"':"+t)}var a=[],o=[],s=(t=t||{}).valueAccessors,l=t.bindingParams,e="string"==typeof e?i(e):e;return M.a.D(e,function(e){n(e.key||e.unknown,e.value)}),o.length&&n("_ko_property_writers","{"+o.join(",")+" }"),a.join(",")},Id:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},eb:function(e,t,i,r,n){e&&M.O(e)?!M.Za(e)||n&&e.v()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),M.b("expressionRewriting",M.m),M.b("expressionRewriting.bindingRewriteValidators",M.m.Ra),M.b("expressionRewriting.parseObjectLiteral",M.m.ac),M.b("expressionRewriting.preProcessBindings",M.m.vb),M.b("expressionRewriting._twoWayBindings",M.m.wa),M.b("jsonExpressionRewriting",M.m),M.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",M.m.vb),function(){function a(e){return 8==e.nodeType&&r.test(t?e.text:e.nodeValue)}function o(e){return 8==e.nodeType&&n.test(t?e.text:e.nodeValue)}function i(e,t){for(var i=e,r=1,n=[];i=i.nextSibling;){if(o(i)&&(M.a.g.set(i,c,!0),0===--r))return n;n.push(i),a(i)&&r++}if(!t)throw Error("Cannot find closing comment tag to match: "+e.nodeValue);return null}function s(e,t){t=i(e,t);return t?(0<t.length?t[t.length-1]:e).nextSibling:null}var t=x&&"\x3c!--test--\x3e"===x.createComment("test").text,r=t?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,n=t?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0},c="__ko_matchedEndComment__";M.h={ea:{},childNodes:function(e){return a(e)?i(e):e.childNodes},Ea:function(e){if(a(e))for(var t=0,i=(e=M.h.childNodes(e)).length;t<i;t++)M.removeNode(e[t]);else M.a.Tb(e)},va:function(e,t){if(a(e)){M.h.Ea(e);for(var i=e.nextSibling,r=0,n=t.length;r<n;r++)i.parentNode.insertBefore(t[r],i)}else M.a.va(e,t)},Vc:function(e,t){var i;a(e)?(i=e.nextSibling,e=e.parentNode):i=e.firstChild,i?t!==i&&e.insertBefore(t,i):e.appendChild(t)},Wb:function(e,t,i){i?(i=i.nextSibling,a(e)&&(e=e.parentNode),i?t!==i&&e.insertBefore(t,i):e.appendChild(t)):M.h.Vc(e,t)},firstChild:function(e){if(a(e))return!e.nextSibling||o(e.nextSibling)?null:e.nextSibling;if(e.firstChild&&o(e.firstChild))throw Error("Found invalid end comment, as the first child of "+e);return e.firstChild},nextSibling:function(e){if(a(e)&&(e=s(e)),e.nextSibling&&o(e.nextSibling)){var t=e.nextSibling;if(o(t)&&!M.a.g.get(t,c))throw Error("Found end comment without a matching opening comment, as child of "+e);return null}return e.nextSibling},Cd:a,Vd:function(e){return(e=(t?e.text:e.nodeValue).match(r))?e[1]:null},Sc:function(e){if(l[M.a.R(e)]){var t=e.firstChild;if(t)do{if(1===t.nodeType){var i,r=t.firstChild,n=null;if(r)do{}while(n?n.push(r):a(r)?(i=s(r,!0))?r=i:n=[r]:o(r)&&(n=[r]),r=r.nextSibling);if(r=n)for(n=t.nextSibling,i=0;i<r.length;i++)n?e.insertBefore(r[i],n):e.appendChild(r[i])}}while(t=t.nextSibling)}}}}(),M.b("virtualElements",M.h),M.b("virtualElements.allowedBindings",M.h.ea),M.b("virtualElements.emptyNode",M.h.Ea),M.b("virtualElements.insertAfter",M.h.Wb),M.b("virtualElements.prepend",M.h.Vc),M.b("virtualElements.setDomNodeChildren",M.h.va),M.ga=function(){this.nd={}},M.a.extend(M.ga.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||M.j.getComponentNameForNode(e);case 8:return M.h.Cd(e);default:return!1}},getBindings:function(e,t){var i=(i=this.getBindingsString(e,t))?this.parseBindingsString(i,t,e):null;return M.j.tc(i,e,t,!1)},getBindingAccessors:function(e,t){var i=(i=this.getBindingsString(e,t))?this.parseBindingsString(i,t,e,{valueAccessors:!0}):null;return M.j.tc(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return M.h.Vd(e);default:return null}},parseBindingsString:function(t,e,i,r){try{var n,a,o=this.nd,s=t+(r&&r.valueAccessors||"");return(a=o[s])||(n="with($context){with($data||{}){return{"+M.m.vb(t,r)+"}}}",n=new Function("$context","$element",n),a=o[s]=n),a(e,i)}catch(e){throw e.message="Unable to parse bindings.\nBindings value: "+t+"\nMessage: "+e.message,e}}}),M.ga.instance=new M.ga,M.b("bindingProvider",M.ga),function(){function r(e){var t=(e=M.a.g.get(e,S))&&e.N;t&&(e.N=null,t.Tc())}function n(e,t,i){this.node=e,this.yc=t,this.kb=[],this.H=!1,t.N||M.a.K.za(e,r),i&&i.N&&(i.N.kb.push(e),this.Kb=i)}function a(e){return function(){return e}}function _(e){return e()}function o(i){return M.a.Ga(M.u.G(i),function(e,t){return function(){return i()[t]}})}function y(e,t){return o(this.getBindings.bind(this,e,t))}function s(e,t){var i=M.h.firstChild(t);if(i){var r,n=M.ga.instance,a=n.preprocessNode;if(a){for(;r=i;)i=M.h.nextSibling(r),a.call(n,r);i=M.h.firstChild(t)}for(;r=i;)i=M.h.nextSibling(r),l(e,r)}M.i.ma(t,M.i.H)}function l(e,t){var i=e,r=1===t.nodeType;r&&M.h.Sc(t),(r||M.ga.instance.nodeHasBindings(t))&&(i=c(t,null,e).bindingContextForDescendants),i&&!d[M.a.R(t)]&&s(i,t)}function c(n,e,t){var a,i,r,o,s=M.a.g.Ub(n,S,{}),l=s.hd;if(!e){if(l)throw Error("You cannot apply bindings multiple times to the same element.");s.hd=!0}l||(s.context=t),s.Zb||(s.Zb={}),e&&"function"!=typeof e?a=e:(i=M.ga.instance,r=i.getBindingAccessors||y,o=M.$(function(){return(a=e?e(t,n):r.call(i,n,t))&&(t[C]&&t[C](),t[v]&&t[v]()),a},null,{l:n}),a&&o.ja()||(o=null));var c,u,d,h,p,m,f,g=t;return a&&(u=function(){return M.a.Ga(o?o():a,_)},d=o?function(e){return function(){return _(o()[e])}}:function(e){return a[e]},u.get=function(e){return a[e]&&d(e)()},u.has=function(e){return e in a},M.i.H in a&&M.i.subscribe(n,M.i.H,function(){var e,t=(0,a[M.i.H])();!t||(e=M.h.childNodes(n)).length&&t(e,M.Ec(e[0]))}),M.i.pa in a&&(g=M.i.Cb(n,t),M.i.subscribe(n,M.i.pa,function(){var e=(0,a[M.i.pa])();e&&M.h.firstChild(n)&&e(n)})),h=a,p=[],m={},f=[],M.a.P(h,function t(e){var i;m[e]||((i=M.getBindingHandler(e))&&(i.after&&(f.push(e),M.a.D(i.after,function(e){if(h[e]){if(-1!==M.a.A(f,e))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+f.join(", "));t(e)}}),f.length--),p.push({key:e,Mc:i})),m[e]=!0)}),s=p,M.a.D(s,function(e){var t=e.Mc.init,i=e.Mc.update,r=e.key;if(8===n.nodeType&&!M.h.ea[r])throw Error("The binding '"+r+"' cannot be used with virtual elements");try{"function"==typeof t&&M.u.G(function(){var e=t(n,d(r),u,g.$data,g);if(e&&e.controlsDescendantBindings){if(c!==I)throw Error("Multiple bindings ("+c+" and "+r+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");c=r}}),"function"==typeof i&&M.$(function(){i(n,d(r),u,g.$data,g)},null,{l:n})}catch(e){throw e.message='Unable to process binding "'+r+": "+a[r]+'"\nMessage: '+e.message,e}})),{shouldBindDescendants:s=c===I,bindingContextForDescendants:s&&g}}function u(e,t){return e&&e instanceof M.fa?e:new M.fa(e,I,I,t)}var C=M.a.Da("_subscribable"),h=M.a.Da("_ancestorBindingInfo"),v=M.a.Da("_dataDependency");M.c={};var d={script:!0,textarea:!0,template:!0};M.getBindingHandler=function(e){return M.c[e]};var p={};M.fa=function(e,i,r,n,t){function a(){var e=u?c():c,t=M.a.f(e);return i?(M.a.extend(s,i),h in i&&(s[h]=i[h])):(s.$parents=[],s.$root=t,s.ko=M),s[C]=o,l?t=s.$data:(s.$rawData=e,s.$data=t),r&&(s[r]=t),n&&n(s,i,t),i&&i[C]&&!M.S.o().Vb(i[C])&&i[C](),d&&(s[v]=d),s.$data}var o,s=this,l=e===p,c=l?I:e,u="function"==typeof c&&!M.O(c),d=t&&t.dataDependency;t&&t.exportDependencies?a():((o=M.xb(a)).v(),o.ja()?o.equalityComparer=null:s[C]=I)},M.fa.prototype.createChildContext=function(t,i,r,e){if(!e&&i&&"object"==typeof i&&(i=(e=i).as,r=e.extend),i&&e&&e.noChildContext){var n="function"==typeof t&&!M.O(t);return new M.fa(p,this,null,function(e){r&&r(e),e[i]=n?t():t},e)}return new M.fa(t,this,i,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),r&&r(e)},e)},M.fa.prototype.extend=function(t,e){return new M.fa(p,this,null,function(e){M.a.extend(e,"function"==typeof t?t(e):t)},e)};var S=M.a.g.Z();n.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},n.prototype.sd=function(e){M.a.Pa(this.kb,e),!this.kb.length&&this.H&&this.Cc()},n.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,M.a.K.yb(this.node,r),M.i.ma(this.node,M.i.pa),this.Tc())},M.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(e,t,i,r,n){var a=M.a.g.Ub(e,S,{});return a.Fa||(a.Fa=new M.T),n&&n.notifyImmediately&&a.Zb[t]&&M.u.G(i,r,[e]),a.Fa.subscribe(i,r,t)},ma:function(e,t){var i=M.a.g.get(e,S);if(i&&(i.Zb[t]=!0,i.Fa&&i.Fa.notifySubscribers(e,t),t==M.i.H))if(i.N)i.N.Cc();else if(i.N===I&&i.Fa&&i.Fa.Wa(M.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")},Cb:function(e,t){var i=M.a.g.Ub(e,S,{});return i.N||(i.N=new n(e,i,t[h])),t[h]==i?t:t.extend(function(e){e[h]=i})}},M.Td=function(e){return(e=M.a.g.get(e,S))&&e.context},M.ib=function(e,t,i){return 1===e.nodeType&&M.h.Sc(e),c(e,t,u(i))},M.ld=function(e,t,i){return i=u(i),M.ib(e,(r=i,e=e,"function"==typeof(t=t)?o(t.bind(null,r,e)):M.a.Ga(t,a)),i);var r},M.Oa=function(e,t){1!==t.nodeType&&8!==t.nodeType||s(u(e),t)},M.vc=function(e,t,i){if(!b&&T.jQuery&&(b=T.jQuery),arguments.length<2){if(!(t=x.body))throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!t||1!==t.nodeType&&8!==t.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");l(u(e,i),t)},M.Dc=function(e){return!e||1!==e.nodeType&&8!==e.nodeType?I:M.Td(e)},M.Ec=function(e){return(e=M.Dc(e))?e.$data:I},M.b("bindingHandlers",M.c),M.b("bindingEvent",M.i),M.b("bindingEvent.subscribe",M.i.subscribe),M.b("bindingEvent.startPossiblyAsyncContentBinding",M.i.Cb),M.b("applyBindings",M.vc),M.b("applyBindingsToDescendants",M.Oa),M.b("applyBindingAccessorsToNode",M.ib),M.b("applyBindingsToNode",M.ld),M.b("contextFor",M.Dc),M.b("dataFor",M.Ec)}(),function(s){function r(i,e){var r,n,a,o=Object.prototype.hasOwnProperty.call(c,i)?c[i]:s;o?o.subscribe(e):((o=c[i]=new M.T).subscribe(e),a=function(e,t){t=!(!t||!t.synchronous);u[i]={definition:e,Gd:t},delete c[i],r||t?o.notifySubscribers(e):M.na.zb(function(){o.notifySubscribers(e)})},l("getConfig",[n=i],function(t){t?l("loadComponent",[n,t],function(e){a(e,t)}):a(null,null)}),r=!0)}function l(t,i,r,n){var e=(n=n||M.j.loaders.slice(0)).shift();if(e){var a=e[t];if(a){var o=!1;if(a.apply(e,i.concat(function(e){o?r(null):null!==e?r(e):l(t,i,r,n)}))!==s&&(o=!0,!e.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else l(t,i,r,n)}else r(null)}var c={},u={};M.j={get:function(e,t){var i=Object.prototype.hasOwnProperty.call(u,e)?u[e]:s;i?i.Gd?M.u.G(function(){t(i.definition)}):M.na.zb(function(){t(i.definition)}):r(e,t)},Bc:function(e){delete u[e]},oc:l},M.j.loaders=[],M.b("components",M.j),M.b("components.get",M.j.get),M.b("components.clearCachedDefinition",M.j.Bc)}(),function(){function n(e){switch(M.a.R(e)){case"script":return M.a.ua(e.text);case"textarea":return M.a.ua(e.value);case"template":if(a(e.content))return M.a.Ca(e.content.childNodes)}return M.a.Ca(e.childNodes)}function a(e){return T.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function d(e,t,i){"string"==typeof t.require?r||T.require?(r||T.require)([t.require],function(e){e&&"object"==typeof e&&e.Xd&&e.default&&(e=e.default),i(e)}):e("Uses require, but no AMD loader is present"):i(t)}function o(t){return function(e){throw Error("Component '"+t+"': "+e)}}var i={};M.j.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(M.j.tb(e))throw Error("Component "+e+" is already registered");i[e]=t},M.j.tb=function(e){return Object.prototype.hasOwnProperty.call(i,e)},M.j.unregister=function(e){delete i[e],M.j.Bc(e)},M.j.Fc={getConfig:function(e,t){t(M.j.tb(e)?i[e]:null)},loadComponent:function(l,e,c){var u=o(l);d(u,e,function(e){function t(){0==--s&&a(o)}var i,r,n,a,o,s;i=l,r=u,a=c,o={},s=2,e=(n=e).template,n=n.viewModel,e?d(r,e,function(e){M.j.oc("loadTemplate",[i,e],function(e){o.template=e,t()})}):t(),n?d(r,n,function(e){M.j.oc("loadViewModel",[i,e],function(e){o[h]=e,t()})}):t()})},loadTemplate:function(e,t,i){var r;e=o(e),"string"==typeof t?i(M.a.ua(t)):t instanceof Array?i(t):a(t)?i(M.a.la(t.childNodes)):t.element?(t=t.element,(T.HTMLElement?t instanceof HTMLElement:t&&t.tagName&&1===t.nodeType)?i(n(t)):"string"==typeof t?(r=x.getElementById(t))?i(n(r)):e("Cannot find element with ID "+t):e("Unknown element type: "+t)):e("Unknown template value: "+t)},loadViewModel:function(e,t,i){!function e(t,i,r){var n;"function"==typeof i?r(function(e){return new i(e)}):"function"==typeof i[h]?r(i[h]):"instance"in i?(n=i.instance,r(function(){return n})):"viewModel"in i?e(t,i.viewModel,r):t("Unknown viewModel value: "+i)}(o(e),t,i)}};var h="createViewModel";M.b("components.register",M.j.register),M.b("components.isRegistered",M.j.tb),M.b("components.unregister",M.j.unregister),M.b("components.defaultLoader",M.j.Fc),M.j.loaders.push(M.j.Fc),M.j.dd=i}(),function(){M.j.getComponentNameForNode=function(e){var t=M.a.R(e);if(M.j.tb(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||M.a.W<=8&&e.tagName===t))return t},M.j.tc=function(e,t,i,r){if(1===t.nodeType){var n=M.j.getComponentNameForNode(t);if(n){if((e=e||{}).component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:n,params:function(i,e){if(t=i.getAttribute("params")){var t=o.parseBindingsString(t,e,i,{valueAccessors:!0,bindingParams:!0}),t=M.a.Ga(t,function(e){return M.o(e,null,{l:i})}),e=M.a.Ga(t,function(t){var e=t.v();return t.ja()?M.o({read:function(){return M.a.f(t())},write:M.Za(e)&&function(e){t()(e)},l:i}):e});return Object.prototype.hasOwnProperty.call(e,"$raw")||(e.$raw=t),e}return{$raw:{}}}(t,i)};e.component=r?function(){return a}:a}}return e};var o=new M.ga;M.a.W<9&&(M.j.register=function(t){return function(e){return t.apply(this,arguments)}}(M.j.register),x.createDocumentFragment=function(t){return function(){var e=t();M.j.dd;return e}}(x.createDocumentFragment))}(),function(){var n=0;M.c.component={init:function(u,t,e,i,r){function d(){var e=h&&h.dispose;"function"==typeof e&&e.call(h),m&&m.s(),p=h=m=null}var h,p,m,f=M.a.la(M.h.childNodes(u));return M.h.Ea(u),M.a.K.za(u,d),M.o(function(){var o,s,e=M.a.f(t());if("string"==typeof e?o=e:(o=M.a.f(e.name),s=M.a.f(e.params)),!o)throw Error("No component name specified");var l=M.i.Cb(u,r),c=p=++n;M.j.get(o,function(e){if(p===c){if(d(),!e)throw Error("Unknown component '"+o+"'");!function(e,t,i){if(!(t=t.template))throw Error("Component '"+e+"' has no template");e=M.a.Ca(t),M.h.va(i,e)}(o,e,u);var t=(r=s,n={element:u,templateNodes:f},(a=(i=e).createViewModel)?a.call(i,r,n):r);e=l.createChildContext(t,{extend:function(e){e.$component=t,e.$componentTemplateNodes=f}}),t&&t.koDescendantsComplete&&(m=M.i.subscribe(u,M.i.pa,t.koDescendantsComplete,t)),h=t,M.Oa(e,u)}var i,r,n,a})},null,{l:u}),{controlsDescendantBindings:!0}}},M.h.ea.component=!0}();var y={class:"className",for:"htmlFor"};M.c.attr={update:function(n,e){e=M.a.f(e())||{};M.a.P(e,function(e,t){t=M.a.f(t);var i=e.indexOf(":"),i="lookupNamespaceURI"in n&&0<i&&n.lookupNamespaceURI(e.substr(0,i)),r=!1===t||null===t||t===I;r?i?n.removeAttributeNS(i,e):n.removeAttribute(e):t=t.toString(),M.a.W<=8&&e in y?(e=y[e],r?n.removeAttribute(e):n[e]=t):r||(i?n.setAttributeNS(i,e,t):n.setAttribute(e,t)),"name"===e&&M.a.Yc(n,r?"":t)})}},M.c.checked={after:["value","attr"],init:function(a,o,s){function e(){var e,t,i,r=a.checked,n=d();M.S.Ya()||!r&&(p||M.S.qa())||(e=M.u.G(o),l?(t=c?e.v():e,(i=u)!==(u=n)?r&&(M.a.Na(t,n,!0),M.a.Na(t,i,!1)):M.a.Na(t,n,r),c&&M.Za(e)&&e(t)):(h&&(n===I?n=r:r||(n=I)),M.m.eb(e,s,"checked",n,!0)))}var t,l,c,i,u,d=M.xb(function(){return s.has("checkedValue")?M.a.f(s.get("checkedValue")):i?s.has("value")?M.a.f(s.get("value")):a.value:void 0}),h="checkbox"==a.type,p="radio"==a.type;(h||p)&&(t=o(),l=h&&M.a.f(t)instanceof Array,c=!(l&&t.push&&t.splice),i=p||l,u=l?d():I,p&&!a.name&&M.c.uniqueName.init(a,function(){return!0}),M.o(e,null,{l:a}),M.a.B(a,"click",e),M.o(function(){var e=M.a.f(o()),t=d();l?(a.checked=0<=M.a.A(e,t),u=t):a.checked=h&&t===I?!!e:d()===e},null,{l:a}),t=I)}},M.m.wa.checked=!0,M.c.checkedValue={update:function(e,t){e.value=M.a.f(t())}},M.c.class={update:function(e,t){t=M.a.Db(M.a.f(t()));M.a.Eb(e,e.__ko__cssValue,!1),e.__ko__cssValue=t,M.a.Eb(e,t,!0)}},M.c.css={update:function(i,e){var t=M.a.f(e());null!==t&&"object"==typeof t?M.a.P(t,function(e,t){t=M.a.f(t),M.a.Eb(i,e,t)}):M.c.class.update(i,e)}},M.c.enable={update:function(e,t){t=M.a.f(t());t&&e.disabled?e.removeAttribute("disabled"):t||e.disabled||(e.disabled=!0)}},M.c.disable={update:function(e,t){M.c.enable.update(e,function(){return!M.a.f(t())})}},M.c.event={init:function(e,a,o,s,l){var t=a()||{};M.a.P(t,function(n){"string"==typeof n&&M.a.B(e,n,function(e){var t,i=a()[n];if(i){try{var r=M.a.la(arguments);s=l.$data,r.unshift(s),t=i.apply(s,r)}finally{!0!==t&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===o.get(n+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},M.c.foreach={Rc:function(i){return function(){var e=i(),t=M.a.bc(e);return t&&"number"!=typeof t.length?(M.a.f(e),{foreach:t.data,as:t.as,noChildContext:t.noChildContext,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:M.ba.Ma}):{foreach:e,templateEngine:M.ba.Ma}}},init:function(e,t){return M.c.template.init(e,M.c.foreach.Rc(t))},update:function(e,t,i,r,n){return M.c.template.update(e,M.c.foreach.Rc(t),i,r,n)}},M.m.Ra.foreach=!1,M.h.ea.foreach=!0,M.c.hasfocus={init:function(r,n,a){function e(e){r.__ko_hasfocusUpdating=!0;var t,i=r.ownerDocument;if("activeElement"in i){try{t=i.activeElement}catch(e){t=i.body}e=t===r}i=n(),M.m.eb(i,a,"hasfocus",e,!0),r.__ko_hasfocusLastValue=e,r.__ko_hasfocusUpdating=!1}var t=e.bind(null,!0),i=e.bind(null,!1);M.a.B(r,"focus",t),M.a.B(r,"focusin",t),M.a.B(r,"blur",i),M.a.B(r,"focusout",i),r.__ko_hasfocusLastValue=!1},update:function(e,t){t=!!M.a.f(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===t||(t?e.focus():e.blur(),!t&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),M.u.G(M.a.Fb,null,[e,t?"focusin":"focusout"]))}},M.m.wa.hasfocus=!0,M.c.hasFocus=M.c.hasfocus,M.m.wa.hasFocus="hasfocus",M.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){M.a.fc(e,t())}},function(){function e(e,p,m){M.c[e]={init:function(n,a,e,t,o){var s,l,c,u,i,d,h={};return p&&(t=e.get("as"),i=e.get("noChildContext"),h={as:t,noChildContext:i,exportDependencies:d=!(t&&i)}),u=(c="render"==e.get("completeOn"))||e.has(M.i.pa),M.o(function(){var e,t=M.a.f(a()),i=!m!=!t,r=!l;!d&&i===s||(u&&(o=M.i.Cb(n,o)),i&&(p&&!d||(h.dataDependency=M.S.o()),e=p?o.createChildContext("function"==typeof t?t:a,h):M.S.qa()?o.extend(null,h):o),r&&M.S.qa()&&(l=M.a.Ca(M.h.childNodes(n),!0)),i?(r||M.h.va(n,M.a.Ca(l)),M.Oa(e,n)):(M.h.Ea(n),c||M.i.ma(n,M.i.H)),s=i)},null,{l:n}),{controlsDescendantBindings:!0}}},M.m.Ra[e]=!1,M.h.ea[e]=!0}e("if"),e("ifnot",!1,!0),e("with",!0)}(),M.c.let={init:function(e,t,i,r,n){return t=n.extend(t),M.Oa(t,e),{controlsDescendantBindings:!0}}},M.h.ea.let=!0;var C={};M.c.options={init:function(e){if("select"!==M.a.R(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(r,e,n){function t(){return M.a.jb(r.options,function(e){return e.selected})}function a(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function i(e,t){var i;p&&c?M.i.ma(r,M.i.H):h.length&&(i=0<=M.a.A(h,M.w.M(t[0])),M.a.Zc(t[0],i),p&&!i&&M.u.G(M.a.Fb,null,[r,"change"]))}var o=r.multiple,s=0!=r.length&&o?r.scrollTop:null,l=M.a.f(e()),c=n.get("valueAllowUnset")&&n.has("value"),u=n.get("optionsIncludeDestroyed");e={};var d,h=[];c||(o?h=M.a.Mb(t(),M.w.M):0<=r.selectedIndex&&h.push(M.w.M(r.options[r.selectedIndex]))),l&&(void 0===l.length&&(l=[l]),d=M.a.jb(l,function(e){return u||e===I||null===e||!M.a.f(e._destroy)}),!n.has("optionsCaption")||null!==(l=M.a.f(n.get("optionsCaption")))&&l!==I&&d.unshift(C));var p=!1;e.beforeRemove=function(e){r.removeChild(e)},l=i,n.has("optionsAfterRender")&&"function"==typeof n.get("optionsAfterRender")&&(l=function(e,t){i(0,t),M.u.G(n.get("optionsAfterRender"),null,[t[0],e!==C?e:I])}),M.a.ec(r,d,function(e,t,i){return i.length&&(h=!c&&i[0].selected?[M.w.M(i[0])]:[],p=!0),t=r.ownerDocument.createElement("option"),e===C?(M.a.Bb(t,n.get("optionsCaption")),M.w.cb(t,I)):(i=a(e,n.get("optionsValue"),e),M.w.cb(t,M.a.f(i)),e=a(e,n.get("optionsText"),i),M.a.Bb(t,e)),[t]},e,l),c||(o?h.length&&t().length<h.length:h.length&&0<=r.selectedIndex?M.w.M(r.options[r.selectedIndex])!==h[0]:h.length||0<=r.selectedIndex)&&M.u.G(M.a.Fb,null,[r,"change"]),(c||M.S.Ya())&&M.i.ma(r,M.i.H),M.a.wd(r),s&&20<Math.abs(s-r.scrollTop)&&(r.scrollTop=s)}},M.c.options.$b=M.a.g.Z(),M.c.selectedOptions={init:function(r,n,i){function e(){var e=n(),t=[];M.a.D(r.getElementsByTagName("option"),function(e){e.selected&&t.push(M.w.M(e))}),M.m.eb(e,i,"selectedOptions",t)}function t(){var i=M.a.f(n()),e=r.scrollTop;i&&"number"==typeof i.length&&M.a.D(r.getElementsByTagName("option"),function(e){var t=0<=M.a.A(i,M.w.M(e));e.selected!=t&&M.a.Zc(e,t)}),r.scrollTop=e}if("select"!=M.a.R(r))throw Error("selectedOptions binding applies only to SELECT elements");var a;M.i.subscribe(r,M.i.H,function(){a?e():(M.a.B(r,"change",e),a=M.o(t,null,{l:r}))},null,{notifyImmediately:!0})},update:function(){}},M.m.wa.selectedOptions=!0,M.c.style={update:function(r,e){e=M.a.f(e()||{});M.a.P(e,function(e,t){var i;null!==(t=M.a.f(t))&&t!==I&&!1!==t||(t=""),b?b(r).css(e,t):/^--/.test(e)?r.style.setProperty(e,t):(e=e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()}),i=r.style[e],(r.style[e]=t)===i||r.style[e]!=i||isNaN(t)||(r.style[e]=t+"px"))})}},M.c.submit={init:function(r,n,e,t,a){if("function"!=typeof n())throw Error("The value for a submit binding must be a function");M.a.B(r,"submit",function(e){var t,i=n();try{t=i.call(a.$data,r)}finally{!0!==t&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}})}},M.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){M.a.Bb(e,t())}},M.h.ea.text=!0,function(){var e,t,d,h,p,m,f,r,n,a,g;T&&T.navigator&&(e=function(e){if(e)return parseFloat(e[1])},t=T.navigator.userAgent,(d=T.opera&&T.opera.version&&parseInt(T.opera.version()))||(f=e(t.match(/Edge\/([^ ]+)$/)))||e(t.match(/Chrome\/([^ ]+)/))||(h=e(t.match(/Version\/([^ ]+) Safari/)))||(p=e(t.match(/Firefox\/([^ ]+)/)))||(m=M.a.W||e(t.match(/MSIE ([^ ]+)/)))||(m=e(t.match(/rv:([^ )]+)/)))),8<=m&&m<10&&(r=M.a.g.Z(),n=M.a.g.Z(),a=function(e){var t=this.activeElement;(t=t&&M.a.g.get(t,n))&&t(e)},g=function(e,t){var i=e.ownerDocument;M.a.g.get(i,r)||(M.a.g.set(i,r,!0),M.a.B(i,"selectionchange",a)),M.a.g.set(e,n,t)}),M.c.textInput={init:function(i,r,t){function e(e,t){M.a.B(i,e,t)}function n(){o||(s=i.value,o=M.a.setTimeout(a,4))}function a(){clearTimeout(o),s=o=I;var e=i.value;l!==e&&(l=e,M.m.eb(r(),t,"textInput",e))}var o,s,l=i.value,c=9==M.a.W?n:a,u=!1;m&&e("keypress",a),m<11&&e("propertychange",function(e){u||"value"!==e.propertyName||c()}),8==m&&(e("keyup",a),e("keydown",a)),g&&(g(i,c),e("dragend",n)),(!m||9<=m)&&e("input",c),h<5&&"textarea"===M.a.R(i)?(e("keydown",n),e("paste",n),e("cut",n)):d<11?e("keydown",n):p<4?(e("DOMAutoComplete",a),e("dragdrop",a),e("drop",a)):f&&"number"===i.type&&e("keydown",n),e("change",a),e("blur",a),M.o(function e(){var t=M.a.f(r());null!==t&&t!==I||(t=""),s!==I&&t===s?M.a.setTimeout(e,4):i.value!==t&&(u=!0,i.value=t,u=!1,l=i.value)},null,{l:i})}},M.m.wa.textInput=!0,M.c.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),M.c.uniqueName={init:function(e,t){t()&&(t="ko_unique_"+ ++M.c.uniqueName.rd,M.a.Yc(e,t))}},M.c.uniqueName.rd=0,M.c.using={init:function(e,t,i,r,n){var a;return i.has("as")&&(a={as:i.get("as"),noChildContext:i.get("noChildContext")}),t=n.createChildContext(t,a),M.Oa(t,e),{controlsDescendantBindings:!0}}},M.h.ea.using=!0,M.c.value={init:function(i,r,n){var e,t,a,o,s,l,c,u=M.a.R(i),d="input"==u;!d||"checkbox"!=i.type&&"radio"!=i.type?(e=[],t=n.get("valueUpdate"),a=!1,o=null,t&&(e="string"==typeof t?[t]:M.a.wc(t),M.a.Pa(e,"change")),s=function(){o=null,a=!1;var e=r(),t=M.w.M(i);M.m.eb(e,n,"value",t)},!M.a.W||!d||"text"!=i.type||"off"==i.autocomplete||i.form&&"off"==i.form.autocomplete||-1!=M.a.A(e,"propertychange")||(M.a.B(i,"propertychange",function(){a=!0}),M.a.B(i,"focus",function(){a=!1}),M.a.B(i,"blur",function(){a&&s()})),M.a.D(e,function(e){var t=s;M.a.Ud(e,"after")&&(t=function(){o=M.w.M(i),M.a.setTimeout(s,0)},e=e.substring(5)),M.a.B(i,e,t)}),l=d&&"file"==i.type?function(){var e=M.a.f(r());null===e||e===I||""===e?i.value="":M.u.G(s)}:function(){var e=M.a.f(r()),t=M.w.M(i);null!==o&&e===o?M.a.setTimeout(l,0):e===t&&t!==I||("select"===u?(t=n.get("valueAllowUnset"),M.w.cb(i,e,t),t||e===M.w.M(i)||M.u.G(s)):M.w.cb(i,e))},"select"===u?M.i.subscribe(i,M.i.H,function(){c?(n.get("valueAllowUnset")?l:s)():(M.a.B(i,"change",s),c=M.o(l,null,{l:i}))},null,{notifyImmediately:!0}):(M.a.B(i,"change",s),M.o(l,null,{l:i}))):M.ib(i,{checkedValue:r})},update:function(){}},M.m.wa.value=!0,M.c.visible={update:function(e,t){var i=M.a.f(t()),t="none"!=e.style.display;i&&!t?e.style.display="":!i&&t&&(e.style.display="none")}},M.c.hidden={update:function(e,t){M.c.visible.update(e,function(){return!M.a.f(t())})}},M.c.click={init:function(e,t,i,r,n){return M.c.event.init.call(this,e,function(){var e={};return e.click=t(),e},i,r,n)}},M.ca=function(){},M.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},M.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},M.ca.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=(t=t||x).getElementById(e);if(!t)throw Error("Cannot find template with ID "+e);return new M.C.F(t)}if(1==e.nodeType||8==e.nodeType)return new M.C.ia(e);throw Error("Unknown template type: "+e)},M.ca.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i,r)},M.ca.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},M.ca.prototype.rewriteTemplate=function(e,t,i){t=t((e=this.makeTemplateSource(e,i)).text()),e.text(t),e.data("isRewritten",!0)},M.b("templateEngine",M.ca),M.kc=function(){function o(e,t,i,r){e=M.m.ac(e);for(var n=M.m.Ra,a=0;a<e.length;a++){var o=e[a].key;if(Object.prototype.hasOwnProperty.call(n,o)){var s=n[o];if("function"==typeof s){if(o=s(e[a].value))throw Error(o)}else if(!s)throw Error("This template engine does not support the '"+o+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+M.m.vb(e,{valueAccessors:!0})+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return M.kc.Ld(e,t)},i)},Ld:function(e,a){return e.replace(t,function(e,t,i,r,n){return o(n,t,i,a)}).replace(i,function(e,t){return o(t,"\x3c!-- ko --\x3e","#comment",a)})},md:function(i,r){return M.aa.Xb(function(e,t){e=e.nextSibling;e&&e.nodeName.toLowerCase()===r&&M.ib(e,i,t)})}}}(),M.b("__tr_ambtns",M.kc.md),function(){M.C={},M.C.F=function(e){var t;(this.F=e)&&(t=M.a.R(e),this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4)},M.C.F.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.F[e];var t=arguments[0];"innerHTML"==e?M.a.fc(this.F,t):this.F[e]=t};var t=M.a.g.Z()+"_";M.C.F.prototype.data=function(e){if(1===arguments.length)return M.a.g.get(this.F,t+e);M.a.g.set(this.F,t+e,arguments[1])};var n=M.a.g.Z();M.C.F.prototype.nodes=function(){var e=this.F;if(0==arguments.length){var t,i=M.a.g.get(e,n)||{},r=i.lb||(3===this.ab?e.content:4===this.ab?e:I);return r&&!i.jd||(t=this.text())&&t!==i.bb&&(r=M.a.Md(t,e.ownerDocument),M.a.g.set(e,n,{lb:r,bb:t,jd:!0})),r}i=arguments[0],this.ab!==I&&this.text(""),M.a.g.set(e,n,{lb:i})},M.C.ia=function(e){this.F=e},M.C.ia.prototype=new M.C.F,M.C.ia.prototype.constructor=M.C.ia,M.C.ia.prototype.text=function(){if(0==arguments.length){var e=M.a.g.get(this.F,n)||{};return e.bb===I&&e.lb&&(e.bb=e.lb.innerHTML),e.bb}M.a.g.set(this.F,n,{bb:arguments[0]})},M.b("templateSources",M.C),M.b("templateSources.domElement",M.C.F),M.b("templateSources.anonymousTemplate",M.C.ia)}(),function(){function r(e,t,i){var r;for(t=M.h.nextSibling(t);e&&(r=e)!==t;)i(r,e=M.h.nextSibling(r))}function h(e,t){if(e.length){var n=e[0],a=e[e.length-1],i=n.parentNode,o=M.ga.instance,s=o.preprocessNode;if(s){if(r(n,a,function(e,t){var i=e.previousSibling,r=s.call(o,e);r&&(e===n&&(n=r[0]||t),e===a&&(a=r[r.length-1]||i))}),e.length=0,!n)return;n===a?e.push(n):(e.push(n,a),M.a.Ua(e,i))}r(n,a,function(e){1!==e.nodeType&&8!==e.nodeType||M.vc(t,e)}),r(n,a,function(e){1!==e.nodeType&&8!==e.nodeType||M.aa.cd(e,[t])}),M.a.Ua(e,i)}}function l(e){return e.nodeType?e:0<e.length?e[0]:null}function p(e,t,i,r,n){n=n||{};var a=(e&&l(e)||i||{}).ownerDocument,o=n.templateEngine||c;if(M.kc.xd(i,o,a),"number"!=typeof(i=o.renderTemplate(i,r,n,a)).length||0<i.length&&"number"!=typeof i[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(a=!1,t){case"replaceChildren":M.h.va(e,i),a=!0;break;case"replaceNode":M.a.Xc(e,i),a=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return a&&(h(i,r),n.afterRender&&M.u.G(n.afterRender,null,[i,r[n.as||"$data"]]),"replaceChildren"==t&&M.i.ma(e,M.i.H)),i}function m(e,t,i){return M.O(e)?e():"function"==typeof e?e(t,i):e}var c;M.gc=function(e){if(e!=I&&!(e instanceof M.ca))throw Error("templateEngine must inherit from ko.templateEngine");c=e},M.dc=function(i,r,n,a,o){if(((n=n||{}).templateEngine||c)==I)throw Error("Set a template engine before calling renderTemplate");if(o=o||"replaceChildren",a){var s=l(a);return M.$(function(){var e=r&&r instanceof M.fa?r:new M.fa(r,null,null,null,{exportDependencies:!0}),t=m(i,e.$data,e),e=p(a,o,t,e,n);"replaceNode"==o&&(s=l(a=e))},null,{Sa:function(){return!s||!M.a.Sb(s)},l:s&&"replaceNode"==o?s.parentNode:s})}return M.aa.Xb(function(e){M.dc(i,r,n,e,"replaceNode")})},M.Qd=function(i,t,r,n,a){function o(e,t){M.u.G(M.a.ec,null,[n,e,l,r,s,t]),M.i.ma(n,M.i.H)}function s(e,t){h(t,c),r.afterRender&&r.afterRender(t,e),c=null}function l(e,t){c=a.createChildContext(e,{as:u,noChildContext:r.noChildContext,extend:function(e){e.$index=t,u&&(e[u+"Index"]=t)}});e=m(i,e,c);return p(n,"ignoreTargetNode",e,c,r)}var c,u=r.as,d=!1===r.includeDestroyed||M.options.foreachHidesDestroyed&&!r.includeDestroyed;if(d||r.beforeRemove||!M.Pc(t))return M.$(function(){var e=M.a.f(t)||[];void 0===e.length&&(e=[e]),d&&(e=M.a.jb(e,function(e){return e===I||null===e||!M.a.f(e._destroy)})),o(e)},null,{l:n});o(t.v());var e=t.subscribe(function(e){o(t(),e)},null,"arrayChange");return e.l(n),e};var o=M.a.g.Z(),n=M.a.g.Z();M.c.template={init:function(e,t){t=M.a.f(t());if("string"==typeof t||"name"in t)M.h.Ea(e);else if("nodes"in t){if(t=t.nodes||[],M.O(t))throw Error('The "nodes" option must be a plain, non-observable array.');var i=t[0]&&t[0].parentNode;i&&M.a.g.get(i,n)||(i=M.a.Yb(t),M.a.g.set(i,n,!0)),new M.C.ia(e).nodes(i)}else{if(!(0<(t=M.h.childNodes(e)).length))throw Error("Anonymous template defined, but no template content was provided");i=M.a.Yb(t),new M.C.ia(e).nodes(i)}return{controlsDescendantBindings:!0}},update:function(e,t,i,r,n){var a=t();i=!0,r=null,"string"==typeof(t=M.a.f(a))?t={}:(a="name"in t?t.name:e,"if"in t&&(i=M.a.f(t.if)),i&&"ifnot"in t&&(i=!M.a.f(t.ifnot)),i&&!a&&(i=!1)),"foreach"in t?r=M.Qd(a,i&&t.foreach||[],t,e,n):i?(i=n,"data"in t&&(i=n.createChildContext(t.data,{as:t.as,noChildContext:t.noChildContext,exportDependencies:!0})),r=M.dc(a,i,t,e)):M.h.Ea(e),n=r,(t=M.a.g.get(e,o))&&"function"==typeof t.s&&t.s(),M.a.g.set(e,o,!n||n.ja&&!n.ja()?I:n)}},M.m.Ra.template=function(e){return 1==(e=M.m.ac(e)).length&&e[0].unknown||M.m.Id(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},M.h.ea.template=!0}(),M.b("setTemplateEngine",M.gc),M.b("renderTemplate",M.dc),M.a.Kc=function(e,t,i){if(e.length&&t.length)for(var r,n,a,o,s=r=0;(!i||s<i)&&(a=e[r]);++r){for(n=0;o=t[n];++n)if(a.value===o.value){a.moved=o.index,o.moved=a.index,t.splice(n,1),s=n=0;break}s+=n}},M.a.Pb=function(){function r(e,t,i,r,n){for(var a,o,s,l,c=Math.min,u=Math.max,d=[],h=e.length,p=t.length,m=p-h||1,f=h+p+1,g=0;g<=h;g++)for(s=o,d.push(o=[]),l=c(p,g+m),a=u(0,g-1);a<=l;a++)o[a]=a?g?e[g-1]===t[a-1]?s[a-1]:c(s[a]||f,o[a-1]||f)+1:a+1:g+1;for(c=[],u=[],m=[],g=h,a=p;g||a;)p=d[g][a]-1,a&&p===d[g][a-1]?u.push(c[c.length]={status:i,value:t[--a],index:a}):g&&p===d[g-1][a]?m.push(c[c.length]={status:r,value:e[--g],index:g}):(--a,--g,n.sparse||c.push({status:"retained",value:t[a]}));return M.a.Kc(m,u,!n.dontLimitMoves&&10*h),c.reverse()}return function(e,t,i){return i="boolean"==typeof i?{dontLimitMoves:i}:i||{},(e=e||[]).length<(t=t||[]).length?r(e,t,"added","deleted",i):r(t,e,"deleted","added",i)}}(),M.b("utils.compareArrays",M.a.Pb),function(){var w=M.a.g.Z(),D=M.a.g.Z();M.a.ec=function(t,e,i,r,n,a){function o(e){c={Aa:e,pb:M.ta(_++)},f.push(c),m||T.push(c)}function s(e){c=p[e],_!==c.pb.v()&&S.push(c),c.pb(_++),M.a.Ua(c.Y,t),f.push(c)}function l(t,i){if(t)for(var r=0,e=i.length;r<e;r++)M.a.D(i[r].Y,function(e){t(e,r,i[r].Aa)})}void 0===(e=e||[]).length&&(e=[e]),r=r||{};var c,u,d,h,p=M.a.g.get(t,w),m=!p,f=[],g=0,_=0,y=[],C=[],v=[],S=[],T=[],x=0;if(m)M.a.D(e,o);else{(!a||p&&p._countWaitingForRemove)&&(A=M.a.Mb(p,function(e){return e.Aa}),a=M.a.Pb(A,e,{dontLimitMoves:r.dontLimitMoves,sparse:!0}));for(var b,E,P,A=0;b=a[A];A++)switch(E=b.moved,P=b.index,b.status){case"deleted":for(;g<P;)s(g++);E===I&&((c=p[g]).$&&(c.$.s(),c.$=I),M.a.Ua(c.Y,t).length&&(r.beforeRemove&&(f.push(c),x++,c.Aa===D?c=null:v.push(c)),c&&y.push.apply(y,c.Y))),g++;break;case"added":for(;_<P;)s(g++);E!==I?(C.push(f.length),s(E)):o(b.value)}for(;_<e.length;)s(g++);f._countWaitingForRemove=x}M.a.g.set(t,w,f),l(r.beforeMove,S),M.a.D(y,r.beforeRemove?M.oa:M.removeNode);try{h=t.ownerDocument.activeElement}catch(e){}if(C.length)for(;(A=C.shift())!=I;){for(c=f[A],u=I;A;)if((d=f[--A].Y)&&d.length){u=d[d.length-1];break}for(e=0;g=c.Y[e];u=g,e++)M.h.Wb(t,g,u)}for(A=0;c=f[A];A++){for(c.Y||M.a.extend(c,function(t,i,r,n,a){var o=[],e=M.$(function(){var e=i(r,a,M.a.Ua(o,t))||[];0<o.length&&(M.a.Xc(o,e),n&&M.u.G(n,null,[r,e,a])),o.length=0,M.a.Nb(o,e)},null,{l:t,Sa:function(){return!M.a.kd(o)}});return{Y:o,$:e.ja()?e:I}}(t,i,c.Aa,n,c.pb)),e=0;g=c.Y[e];u=g,e++)M.h.Wb(t,g,u);!c.Ed&&n&&(n(c.Aa,c.Y,c.pb),c.Ed=!0,u=c.Y[c.Y.length-1])}for(h&&t.ownerDocument.activeElement!=h&&h.focus(),l(r.beforeRemove,v),A=0;A<v.length;++A)v[A].Aa=D;l(r.afterMove,S),l(r.afterAdd,T)}}(),M.b("utils.setDomNodeChildrenFromArrayMapping",M.a.ec),M.ba=function(){this.allowTemplateRewriting=!1},M.ba.prototype=new M.ca,M.ba.prototype.constructor=M.ba,M.ba.prototype.renderTemplateSource=function(e,t,i,r){return(t=M.a.W<9||!e.nodes?null:e.nodes())?M.a.la(t.cloneNode(!0).childNodes):(e=e.text(),M.a.ua(e,r))},M.ba.Ma=new M.ba,M.gc(M.ba.Ma),M.b("nativeTemplateEngine",M.ba),function(){M.$a=function(){var a=this.Hd=function(){if(!b||!b.tmpl)return 0;try{if(0<=b.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(e,t,i,r){if(r=r||x,i=i||{},a<2)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var n=e.data("precompiled");return n||(n=e.text()||"",n=b.template(null,"{{ko_with $item.koBindingContext}}"+n+"{{/ko_with}}"),e.data("precompiled",n)),e=[t.$data],t=b.extend({koBindingContext:t},i.templateOptions),(t=b.tmpl(n,e,t)).appendTo(r.createElement("div")),b.fragments={},t},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){x.write("<script type='text/html' id='"+e+"'>"+t+"<\/script>")},0<a&&(b.tmpl.tag.ko_code={open:"__.push($1 || '');"},b.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},M.$a.prototype=new M.ca,M.$a.prototype.constructor=M.$a;var e=new M.$a;0<e.Hd&&M.gc(e),M.b("jqueryTmplTemplateEngine",M.$a)}()}(T.ko={})}();var knockout=ko;"undefined"!=typeof window?(ko=window.ko,void 0!==oldValue?window.ko=oldValue:delete window.ko):(ko=global.ko,void 0!==oldValue?global.ko=oldValue:delete global.ko);var OBSERVABLES_PROPERTY="__knockoutObservables",SUBSCRIBABLE_PROPERTY="__knockoutSubscribable";function track(r,e){if(!r)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,a=getAllObservablesForObject(r,!0);return(e=e||Object.getOwnPropertyNames(r)).forEach(function(e){var t,i;e!==OBSERVABLES_PROPERTY&&e!==SUBSCRIBABLE_PROPERTY&&(e in a||(t=(i=r[e])instanceof Array,i=n.isObservable(i)?i:t?n.observableArray(i):n.observable(i),Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:i,set:n.isWriteableObservable(i)?i:void 0}),a[e]=i,t&¬ifyWhenPresentOrFutureArrayValuesMutate(n,i)))}),r}function getAllObservablesForObject(e,t){var i=e[OBSERVABLES_PROPERTY];return!i&&t&&(i={},Object.defineProperty(e,OBSERVABLES_PROPERTY,{value:i})),i}function defineComputedProperty(e,t,i){var r={owner:e,deferEvaluation:!0};if("function"==typeof i)r.read=i;else{if("value"in i)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof i.get)throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=i.get,r.write=i.set}return e[t]=this.computed(r),track.call(this,e,[t]),e}function notifyWhenPresentOrFutureArrayValuesMutate(t,i){var r=null;t.computed(function(){r&&(r.dispose(),r=null);var e=i();e instanceof Array&&(r=startWatchingArrayInstance(t,i,e))})}function startWatchingArrayInstance(e,t,i){return getSubscribableForArray(e,i).subscribe(t)}function getSubscribableForArray(e,t){var i,r=t[SUBSCRIBABLE_PROPERTY];return r||(r=new e.subscribable,Object.defineProperty(t,SUBSCRIBABLE_PROPERTY,{value:r}),wrapStandardArrayMutators(t,r,i={}),addKnockoutArrayMutators(e,t,r,i)),r}function wrapStandardArrayMutators(i,r,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(e){var t=i[e];i[e]=function(){var e=t.apply(this,arguments);return!0!==n.pause&&r.notifySubscribers(this),e}})}function addKnockoutArrayMutators(i,r,n,a){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(t){Object.defineProperty(r,t,{enumerable:!1,value:function(){var e;a.pause=!0;try{e=i.observableArray.fn[t].apply(i.observableArray(r),arguments)}finally{a.pause=!1}return n.notifySubscribers(r),e}})})}function getObservable(e,t){if(!e)return null;e=getAllObservablesForObject(e,!1);return e&&e[t]||null}function valueHasMutated(e,t){t=getObservable(e,t);t&&t.valueHasMutated()}function attachToKo(e){e.track=track,e.getObservable=getObservable,e.valueHasMutated=valueHasMutated,e.defineProperty=defineComputedProperty}var knockout_es5={attachToKo:attachToKo},svgNS="http://www.w3.org/2000/svg",svgClassName="cesium-svgPath-svg",SvgPathBindingHandler={register:function(o){o.bindingHandlers.cesiumSvgPath={init:function(e,r){var n=document.createElementNS(svgNS,"svg:svg");n.setAttribute("class",svgClassName);var a=document.createElementNS(svgNS,"path");return n.appendChild(a),o.virtualElements.setDomNodeChildren(e,[n]),o.computed({read:function(){var e=o.unwrap(r());a.setAttribute("d",o.unwrap(e.path));var t=o.unwrap(e.width),i=o.unwrap(e.height);n.setAttribute("width",t),n.setAttribute("height",i),n.setAttribute("viewBox","0 0 "+t+" "+i),e.css&&n.setAttribute("class",svgClassName+" "+o.unwrap(e.css))},disposeWhenNodeIsRemoved:e}),{controlsDescendantBindings:!0}}},o.virtualElements.allowedBindings.cesiumSvgPath=!0}};function quickselect$1(e,t,i,r,n){quickselectStep$1(e,t,i||0,r||e.length-1,n||defaultCompare$1)}function quickselectStep$1(e,t,i,r,n){for(;i<r;){var a,o,s,l;600<r-i&&(a=r-i+1,o=t-i+1,l=Math.log(a),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(a-s)/a)*(o-a/2<0?-1:1),quickselectStep$1(e,t,Math.max(i,Math.floor(t-o*s/a+l)),Math.min(r,Math.floor(t+(a-o)*s/a+l)),n));var c=e[t],u=i,d=r;for(swap$3(e,i,t),0<n(e[r],c)&&swap$3(e,i,r);u<d;){for(swap$3(e,u,d),u++,d--;n(e[u],c)<0;)u++;for(;0<n(e[d],c);)d--}0===n(e[i],c)?swap$3(e,i,d):swap$3(e,++d,r),d<=t&&(i=d+1),t<=d&&(r=d-1)}}function swap$3(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function defaultCompare$1(e,t){return e<t?-1:t<e?1:0}function ClockViewModel(t){defined(t)||(t=new Clock),this._clock=t,this._eventHelper=new EventHelper,this._eventHelper.add(t.onTick,this.synchronize,this),this.systemTime=knockout.observable(JulianDate.now()),this.systemTime.equalityComparer=JulianDate.equals,this.startTime=knockout.observable(t.startTime),this.startTime.equalityComparer=JulianDate.equals,this.startTime.subscribe(function(e){t.startTime=e,this.synchronize()},this),this.stopTime=knockout.observable(t.stopTime),this.stopTime.equalityComparer=JulianDate.equals,this.stopTime.subscribe(function(e){t.stopTime=e,this.synchronize()},this),this.currentTime=knockout.observable(t.currentTime),this.currentTime.equalityComparer=JulianDate.equals,this.currentTime.subscribe(function(e){t.currentTime=e,this.synchronize()},this),this.multiplier=knockout.observable(t.multiplier),this.multiplier.subscribe(function(e){t.multiplier=e,this.synchronize()},this),this.clockStep=knockout.observable(t.clockStep),this.clockStep.subscribe(function(e){t.clockStep=e,this.synchronize()},this),this.clockRange=knockout.observable(t.clockRange),this.clockRange.subscribe(function(e){t.clockRange=e,this.synchronize()},this),this.canAnimate=knockout.observable(t.canAnimate),this.canAnimate.subscribe(function(e){t.canAnimate=e,this.synchronize()},this),this.shouldAnimate=knockout.observable(t.shouldAnimate),this.shouldAnimate.subscribe(function(e){t.shouldAnimate=e,this.synchronize()},this),knockout.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}function Command(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,DeveloperError.throwInstantiationError()}knockout_es5.attachToKo(knockout),SvgPathBindingHandler.register(knockout),Object.defineProperties(ClockViewModel.prototype,{clock:{get:function(){return this._clock}}}),ClockViewModel.prototype.synchronize=function(){var e=this._clock;this.systemTime=JulianDate.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate},ClockViewModel.prototype.isDestroyed=function(){return!1},ClockViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var InspectorShared={};function ToggleButtonViewModel(e,t){this._command=e,t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.toggled=defaultValue(t.toggled,!1),this.tooltip=defaultValue(t.tooltip,""),knockout.track(this,["toggled","tooltip"])}function createCommand$2(i,e){e=defaultValue(e,!0);var r=new Event,n=new Event;function t(){var e,t={args:arguments,cancel:!1};return r.raiseEvent(t),t.cancel||(e=i.apply(null,arguments),n.raiseEvent(e)),e}return t.canExecute=e,knockout.track(t,["canExecute"]),Object.defineProperties(t,{beforeExecute:{value:r},afterExecute:{value:n}}),t}function subscribeAndEvaluate(e,t,i,r,n){return i.call(r,e[t]),knockout.getObservable(e,t).subscribe(i,r,n)}InspectorShared.createCheckbox=function(e,t,i){var r=document.createElement("div"),n=document.createElement("label"),a=document.createElement("input");a.type="checkbox";t="checked: "+t;return defined(i)&&(t+=", enable: "+i),a.setAttribute("data-bind",t),n.appendChild(a),n.appendChild(document.createTextNode(e)),r.appendChild(n),r},InspectorShared.createSection=function(e,t,i,r){var n=document.createElement("div");n.className="cesium-cesiumInspector-section",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-section-collapsed": !'+i+" }"),e.appendChild(n);e=document.createElement("h3");e.className="cesium-cesiumInspector-sectionHeader",e.appendChild(document.createTextNode(t)),e.setAttribute("data-bind","click: "+r),n.appendChild(e);e=document.createElement("div");return e.className="cesium-cesiumInspector-sectionContent",n.appendChild(e),e},Object.defineProperties(ToggleButtonViewModel.prototype,{command:{get:function(){return this._command}}});var DepthViewPacked="uniform sampler2D u_depthTexture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat z_window = czm_unpackDepth(texture2D(u_depthTexture, v_textureCoordinates));\nz_window = czm_reverseLogDepth(z_window);\nfloat n_range = czm_depthRange.near;\nfloat f_range = czm_depthRange.far;\nfloat z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);\nfloat scale = pow(z_ndc * 0.5 + 0.5, 8.0);\ngl_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);\n}\n";function removePipelineExtras(e){return ForEach.shader(e,function(e){removeExtras(e)}),ForEach.buffer(e,function(e){removeExtras(e)}),ForEach.image(e,function(e){removeExtras(e),ForEach.compressedImage(e,function(e){removeExtras(e)})}),removeExtras(e),e}function removeExtras(e){defined(e.extras)&&(defined(e.extras._pipeline)&&delete e.extras._pipeline,0===Object.keys(e.extras).length&&delete e.extras)}var svgNS$1="http://www.w3.org/2000/svg",xlinkNS="http://www.w3.org/1999/xlink",widgetForDrag,gradientEnabledColor0=Color.fromCssColorString("rgba(247,250,255,0.384)"),gradientEnabledColor1=Color.fromCssColorString("rgba(143,191,255,0.216)"),gradientEnabledColor2=Color.fromCssColorString("rgba(153,197,255,0.098)"),gradientEnabledColor3=Color.fromCssColorString("rgba(255,255,255,0.086)"),gradientDisabledColor0=Color.fromCssColorString("rgba(255,255,255,0.267)"),gradientDisabledColor1=Color.fromCssColorString("rgba(255,255,255,0)"),gradientKnobColor=Color.fromCssColorString("rgba(66,67,68,0.3)"),gradientPointerColor=Color.fromCssColorString("rgba(0,0,0,0.5)");function getElementColor(e){return Color.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var svgIconsById={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function svgFromObject(e){var t,i=document.createElementNS(svgNS$1,e.tagName);for(t in e)if(e.hasOwnProperty(t)&&"tagName"!==t)if("children"===t)for(var r=e.children.length,n=0;n<r;++n)i.appendChild(svgFromObject(e.children[n]));else 0===t.indexOf("xlink:")?i.setAttributeNS(xlinkNS,t.substring(6),e[t]):"textContent"===t?i.textContent=e[t]:i.setAttribute(t,e[t]);return i}function svgText(e,t,i){var r=document.createElementNS(svgNS$1,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");t=document.createElementNS(svgNS$1,"tspan");return t.textContent=i,r.appendChild(t),r}function setShuttleRingPointer(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}var makeColorStringScratch=new Color;function makeColorString(e,t){var i=t.alpha,r=1-i;return makeColorStringScratch.red=e.red*r+t.red*i,makeColorStringScratch.green=e.green*r+t.green*i,makeColorStringScratch.blue=e.blue*r+t.blue*i,makeColorStringScratch.toCssColorString()}function rectButton(e,t,i){var r=svgIconsById[i];return svgFromObject({tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:i,tagName:r.tagName,transform:r.transform,d:r.d},{tagName:"title",textContent:""}]})}function wingButton(e,t,i){var r=svgIconsById[i],n=svgIconsById.animation_pathWingButton;return svgFromObject({tagName:"g",class:"cesium-animation-rectButton",transform:"translate("+e+","+t+")",children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:n.tagName,d:n.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:n.tagName,d:n.d},{class:"cesium-animation-buttonPath",id:i,tagName:r.tagName,transform:r.transform,d:r.d},{tagName:"title",textContent:""}]})}function setShuttleRingFromMouseOrTouch(e,t){var i,r,n,a,o,s,l=e._viewModel,c=l.shuttleRingDragging;c&&widgetForDrag!==e||("mousedown"===t.type||c&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||c&&"touchmove"===t.type&&1===t.touches.length?(s=e._centerX,i=e._centerY,o=e._svgNode.getBoundingClientRect(),n="touchstart"===t.type||"touchmove"===t.type?(r=t.touches[0].clientX,t.touches[0].clientY):(r=t.clientX,t.clientY),!c&&(r>o.right||r<o.left||n<o.top||n>o.bottom)||(a=e._shuttleRingPointer.getBoundingClientRect(),s=r-s-o.left,o=n-i-o.top,180<(o=180*Math.atan2(o,s)/Math.PI+90)&&(o-=360),s=l.shuttleRingAngle,c||r<a.right&&r>a.left&&n>a.top&&n<a.bottom?(widgetForDrag=e,l.shuttleRingDragging=!0,l.shuttleRingAngle=o):o<s?l.slower():s<o&&l.faster(),t.preventDefault())):(e===widgetForDrag&&(widgetForDrag=void 0),l.shuttleRingDragging=!1))}function SvgButton(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var i=this;this._clickFunction=function(){var e=i._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[subscribeAndEvaluate(t,"toggled",this.setToggled,this),subscribeAndEvaluate(t,"tooltip",this.setTooltip,this),subscribeAndEvaluate(t.command,"canExecute",this.setEnabled,this)]}function Animation(e,t){e=getElement(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;var i=e.ownerDocument,r=document.createElement("style");r.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",i.head.insertBefore(r,i.head.childNodes[0]);var n=document.createElement("div");n.className="cesium-animation-theme",n.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=n,this._themeNormal=n.childNodes[0],this._themeHover=n.childNodes[1],this._themeSelect=n.childNodes[2],this._themeDisabled=n.childNodes[3],this._themeKnob=n.childNodes[4],this._themePointer=n.childNodes[5],this._themeSwoosh=n.childNodes[6],this._themeSwooshHover=n.childNodes[7];var a=document.createElementNS(svgNS$1,"svg:svg");(this._svgNode=a).setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",xlinkNS);var o=document.createElementNS(svgNS$1,"g");this._topG=o,this._realtimeSVG=new SvgButton(wingButton(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new SvgButton(rectButton(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new SvgButton(rectButton(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new SvgButton(rectButton(84,99,"animation_pathPause"),t.pauseViewModel);var s=document.createElementNS(svgNS$1,"g");s.appendChild(this._realtimeSVG.svgElement),s.appendChild(this._playReverseSVG.svgElement),s.appendChild(this._playForwardSVG.svgElement),s.appendChild(this._pauseSVG.svgElement);var l=svgFromObject({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=l;var c=svgIconsById.animation_pathSwooshFX,u=svgIconsById.animation_pathPointer,d=svgFromObject({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:c.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:c.d},{tagName:c.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:c.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=svgFromObject({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});var h=svgFromObject({tagName:"g",transform:"translate(100,100)"});this._knobOuter=svgFromObject({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});r=svgFromObject({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:61});this._knobDate=svgText(0,-24,""),this._knobTime=svgText(0,-7,""),this._knobStatus=svgText(0,-41,"");c=svgFromObject({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:61}),u=document.createElementNS(svgNS$1,"g");u.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),o.appendChild(u),o.appendChild(h),o.appendChild(s),u.appendChild(l),u.appendChild(d),u.appendChild(this._shuttleRingPointer),h.appendChild(this._knobOuter),h.appendChild(r),h.appendChild(this._knobDate),h.appendChild(this._knobTime),h.appendChild(this._knobStatus),h.appendChild(c),a.appendChild(o),e.appendChild(a);var p=this;function m(e){setShuttleRingFromMouseOrTouch(p,e)}this._mouseCallback=m,l.addEventListener("mousedown",m,!0),l.addEventListener("touchstart",m,!0),d.addEventListener("mousedown",m,!0),d.addEventListener("touchstart",m,!0),i.addEventListener("mousemove",m,!0),i.addEventListener("touchmove",m,!0),i.addEventListener("mouseup",m,!0),i.addEventListener("touchend",m,!0),i.addEventListener("touchcancel",m,!0),this._shuttleRingPointer.addEventListener("mousedown",m,!0),this._shuttleRingPointer.addEventListener("touchstart",m,!0),this._knobOuter.addEventListener("mousedown",m,!0),this._knobOuter.addEventListener("touchstart",m,!0);var f,g=this._knobTime.childNodes[0],_=this._knobDate.childNodes[0],y=this._knobStatus.childNodes[0];this._subscriptions=[subscribeAndEvaluate(t.pauseViewModel,"toggled",function(e){f!==e&&((f=e)?p._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):p._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),subscribeAndEvaluate(t,"shuttleRingAngle",function(e){setShuttleRingPointer(p._shuttleRingPointer,p._knobOuter,e)}),subscribeAndEvaluate(t,"dateLabel",function(e){_.textContent!==e&&(_.textContent=e)}),subscribeAndEvaluate(t,"timeLabel",function(e){g.textContent!==e&&(g.textContent=e)}),subscribeAndEvaluate(t,"multiplierLabel",function(e){y.textContent!==e&&(y.textContent=e)})],this.applyThemeChanges(),this.resize()}SvgButton.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,i=e.length;t<i;t++)e[t].dispose();destroyObject(this)},SvgButton.prototype.isDestroyed=function(){return!1},SvgButton.prototype.setEnabled=function(e){this._enabled!==e&&((this._enabled=e)?this._toggled?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton"):this.svgElement.setAttribute("class","cesium-animation-buttonDisabled"))},SvgButton.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))},SvgButton.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},Object.defineProperties(Animation.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),Animation.prototype.isDestroyed=function(){return!1},Animation.prototype.destroy=function(){defined(this._observer)&&(this._observer.disconnect(),this._observer=void 0);var e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();for(var i=this._subscriptions,r=0,n=i.length;r<n;r++)i[r].dispose();return destroyObject(this)},Animation.prototype.resize=function(){var e,t,i,r,n,a=this._container.clientWidth,o=this._container.clientHeight;a===this._lastWidth&&o===this._lastHeight||(i=o,0===(t=a)&&0===o?(t=200,i=132):0===a?t=(i=o)/132*200:0===o&&(i=(t=a)/200*132),r=t/200,n=i/132,(e=this._svgNode).style.cssText="width: "+t+"px; height: "+i+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",e.setAttribute("width",t),e.setAttribute("height",i),e.setAttribute("viewBox","0 0 "+t+" "+i),this._topG.setAttribute("transform","scale("+r+","+n+")"),this._centerX=Math.max(1,100*r),this._centerY=Math.max(1,100*n),this._lastHeight=a,this._lastWidth=o)},Animation.prototype.applyThemeChanges=function(){var e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(defined(this._observer))return;var t=this;return t._observer=new MutationObserver(function(){e.body.contains(t._container)&&(t._observer.disconnect(),t._observer=void 0,t.applyThemeChanges())}),void t._observer.observe(e,{childList:!0,subtree:!0})}var i=getElementColor(this._themeNormal),r=getElementColor(this._themeHover),n=getElementColor(this._themeSelect),a=getElementColor(this._themeDisabled),o=getElementColor(this._themeKnob),s=getElementColor(this._themePointer),l=getElementColor(this._themeSwoosh),c=getElementColor(this._themeSwooshHover),o=svgFromObject({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(i,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(i,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(i,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(i,gradientEnabledColor3)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(r,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(r,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(r,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(r,gradientEnabledColor3)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(n,gradientEnabledColor0)},{tagName:"stop",offset:"12%","stop-color":makeColorString(n,gradientEnabledColor1)},{tagName:"stop",offset:"46%","stop-color":makeColorString(n,gradientEnabledColor2)},{tagName:"stop",offset:"81%","stop-color":makeColorString(n,gradientEnabledColor3)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":makeColorString(a,gradientDisabledColor0)},{tagName:"stop",offset:"75%","stop-color":makeColorString(a,gradientDisabledColor1)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":l.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":makeColorString(s,gradientPointerColor)},{tagName:"stop",offset:"100%","stop-color":makeColorString(s,gradientPointerColor)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":makeColorString(o,gradientEnabledColor0)},{tagName:"stop",offset:"60%","stop-color":makeColorString(o,gradientKnobColor)},{tagName:"stop",offset:"85%","stop-color":makeColorString(o,gradientEnabledColor1)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":makeColorString(o,gradientKnobColor)},{tagName:"stop",offset:"60%","stop-color":makeColorString(o,gradientEnabledColor0)},{tagName:"stop",offset:"85%","stop-color":makeColorString(o,gradientEnabledColor3)}]}]});defined(this._defsElement)?this._svgNode.replaceChild(o,this._defsElement):this._svgNode.appendChild(o),this._defsElement=o};var monthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],realtimeShuttleRingAngle=15,maxShuttleRingAngle=105;function numberComparator(e,t){return e-t}function getTypicalMultiplierIndex(e,t){e=binarySearch(t,e,numberComparator);return e<0?~e:e}function angleToMultiplier(e,t){if(Math.abs(e)<=realtimeShuttleRingAngle)return e/realtimeShuttleRingAngle;var i,r=realtimeShuttleRingAngle,n=maxShuttleRingAngle;return 0<e?(i=+Math.log(t[t.length-1])/(n-r),Math.exp(0+i*(e-r))):(i=+Math.log(-t[0])/(n-r),-Math.exp(0+i*(Math.abs(e)-r)))}function multiplierToAngle(e,t,i){if(i.clockStep===ClockStep$1.SYSTEM_CLOCK)return realtimeShuttleRingAngle;if(Math.abs(e)<=1)return e*realtimeShuttleRingAngle;var r=t[t.length-1];r<e?e=r:e<-r&&(e=-r);var n,a=realtimeShuttleRingAngle,i=maxShuttleRingAngle;return 0<e?(n=+Math.log(r)/(i-a),+Math.log(e)/n+a):(n=+Math.log(-t[0])/(i-a),-(+Math.log(Math.abs(e))/n+a))}function AnimationViewModel(e){var o=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=AnimationViewModel.defaultDateFormatter,this._timeFormatter=AnimationViewModel.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,knockout.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(AnimationViewModel.defaultTicks),this.timeLabel=void 0,knockout.defineProperty(this,"timeLabel",function(){return o._timeFormatter(o._clockViewModel.currentTime,o)}),this.dateLabel=void 0,knockout.defineProperty(this,"dateLabel",function(){return o._dateFormatter(o._clockViewModel.currentTime,o)}),this.multiplierLabel=void 0,knockout.defineProperty(this,"multiplierLabel",function(){var e=o._clockViewModel;if(e.clockStep===ClockStep$1.SYSTEM_CLOCK)return"Today";e=e.multiplier;return e%1==0?e.toFixed(0)+"x":e.toFixed(3).replace(/0{0,3}$/,"")+"x"}),this.shuttleRingAngle=void 0,knockout.defineProperty(this,"shuttleRingAngle",{get:function(){return multiplierToAngle(e.multiplier,o._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,maxShuttleRingAngle),-maxShuttleRingAngle);var t,i,r,n=o._allShuttleRingTicks,a=o._clockViewModel;a.clockStep=ClockStep$1.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)!==maxShuttleRingAngle?(r=angleToMultiplier(e,n),o.snapToTicks?r=n[getTypicalMultiplierIndex(r,n)]:0!==r&&(100<(t=Math.abs(r))?(i=t.toFixed(0).length-2,i=Math.pow(10,i),r=Math.round(r/i)*i|0):realtimeShuttleRingAngle<t?r=Math.round(r):1<t?r=+r.toFixed(1):0<t&&(r=+r.toFixed(2))),a.multiplier=r):a.multiplier=0<e?n[n.length-1]:n[0]}}),this._canAnimate=void 0,knockout.defineProperty(this,"_canAnimate",function(){var e=o._clockViewModel,t=e.clockRange;if(o.shuttleRingDragging||t===ClockRange$1.UNBOUNDED)return!0;var i=e.multiplier,r=e.currentTime,n=e.startTime,a=!1;return(a=t===ClockRange$1.LOOP_STOP?JulianDate.greaterThan(r,n)||r.equals(n)&&0<i:(t=e.stopTime,JulianDate.greaterThan(r,n)&&JulianDate.lessThan(r,t)||r.equals(n)&&0<i||r.equals(t)&&i<0))||(e.shouldAnimate=!1),a}),this._isSystemTimeAvailable=void 0,knockout.defineProperty(this,"_isSystemTimeAvailable",function(){var e=o._clockViewModel;if(e.clockRange===ClockRange$1.UNBOUNDED)return!0;var t=e.systemTime;return JulianDate.greaterThanOrEquals(t,e.startTime)&&JulianDate.lessThanOrEquals(t,e.stopTime)}),this._isAnimating=void 0,knockout.defineProperty(this,"_isAnimating",function(){return o._clockViewModel.shouldAnimate&&(o._canAnimate||o.shuttleRingDragging)});var t=createCommand$2(function(){var e=o._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:o._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return!o._isAnimating}),tooltip:"Pause"});t=createCommand$2(function(){var e=o._clockViewModel,t=e.multiplier;0<t&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return o._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});t=createCommand$2(function(){var e=o._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return o._isAnimating&&0<e.multiplier&&e.clockStep!==ClockStep$1.SYSTEM_CLOCK}),tooltip:"Play Forward"});t=createCommand$2(function(){o._clockViewModel.clockStep=ClockStep$1.SYSTEM_CLOCK},knockout.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new ToggleButtonViewModel(t,{toggled:knockout.computed(function(){return e.clockStep===ClockStep$1.SYSTEM_CLOCK}),tooltip:knockout.computed(function(){return o._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=createCommand$2(function(){var e=o._clockViewModel,t=o._allShuttleRingTicks,i=getTypicalMultiplierIndex(e.multiplier,t)-1;0<=i&&(e.multiplier=t[i])}),this._faster=createCommand$2(function(){var e=o._clockViewModel,t=o._allShuttleRingTicks,i=getTypicalMultiplierIndex(e.multiplier,t)+1;i<t.length&&(e.multiplier=t[i])})}function BaseLayerPickerViewModel(e){var t=(e=defaultValue(e,defaultValue.EMPTY_OBJECT)).globe,i=defaultValue(e.imageryProviderViewModels,[]),r=defaultValue(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=i.slice(0),this.terrainProviderViewModels=r.slice(0),this.dropDownVisible=!1,knockout.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);var l=knockout.getObservable(this,"imageryProviderViewModels"),t=knockout.pureComputed(function(){for(var e=l(),t={},i=0;i<e.length;i++){var r=e[i],n=r.category;defined(t[n])?t[n].push(r):t[n]=[r]}var a=Object.keys(t),o=[];for(i=0;i<a.length;i++){var s=a[i];o.push({name:s,providers:t[s]})}return o});this._imageryProviders=t;var c=knockout.getObservable(this,"terrainProviderViewModels"),t=knockout.pureComputed(function(){for(var e=c(),t={},i=0;i<e.length;i++){var r=e[i],n=r.category;defined(t[n])?t[n].push(r):t[n]=[r]}var a=Object.keys(t),o=[];for(i=0;i<a.length;i++){var s=a[i];o.push({name:s,providers:t[s]})}return o});this._terrainProviders=t,this.buttonTooltip=void 0,knockout.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,t=this.selectedTerrain,e=defined(e)?e.name:void 0,t=defined(t)?t.name:void 0;return defined(e)&&defined(t)?e+"\n"+t:defined(e)?e:t}),this.buttonImageUrl=void 0,knockout.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;if(defined(e))return e.iconUrl}),this.selectedImagery=void 0;var d=knockout.observable();this._currentImageryProviders=[],knockout.defineProperty(this,"selectedImagery",{get:function(){return d()},set:function(e){if(d()!==e){var t=this._currentImageryProviders,i=t.length,r=this._globe.imageryLayers,n=!1;for(u=0;u<i;u++)for(var a=r.length,o=0;o<a;o++){var s=r.get(o);if(s.imageryProvider===t[u]){r.remove(s),n=!0;break}}if(defined(e)){var l,c=e.creationCommand();if(Array.isArray(c)){for(var u=c.length-1;0<=u;u--)r.addImageryProvider(c[u],0);this._currentImageryProviders=c.slice(0)}else this._currentImageryProviders=[c],n||defined(l=r.get(0))&&r.remove(l),r.addImageryProvider(c,0)}d(e),this.dropDownVisible=!1}else this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var n=knockout.observable();knockout.defineProperty(this,"selectedTerrain",{get:function(){return n()},set:function(e){var t;n()!==e&&(defined(e)&&(t=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(t instanceof EllipsoidTerrainProvider),this._globe.terrainProvider=t,n(e)),this.dropDownVisible=!1}});var a=this;this._toggleDropDown=createCommand$2(function(){a.dropDownVisible=!a.dropDownVisible}),this.selectedImagery=defaultValue(e.selectedImageryProviderViewModel,i[0]),this.selectedTerrain=defaultValue(e.selectedTerrainProviderViewModel,r[0])}function BaseLayerPicker(e,t){e=getElement(e);var i=new BaseLayerPickerViewModel(t),r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(r);var n=document.createElement("img");n.setAttribute("draggable","false"),n.className="cesium-baseLayerPicker-selected",n.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),r.appendChild(n);var a=document.createElement("div");a.className="cesium-baseLayerPicker-dropDown",a.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(a);t=document.createElement("div");t.className="cesium-baseLayerPicker-sectionTitle",t.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),t.innerHTML="Imagery",a.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-section",n.setAttribute("data-bind","foreach: _imageryProviders"),a.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-category",n.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-categoryTitle",n.setAttribute("data-bind","text: name"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-choices",n.setAttribute("data-bind","foreach: providers"),t.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-item",t.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),n.appendChild(t);n=document.createElement("img");n.className="cesium-baseLayerPicker-itemIcon",n.setAttribute("data-bind","attr: { src: iconUrl }"),n.setAttribute("draggable","false"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-itemLabel",n.setAttribute("data-bind","text: name"),t.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-sectionTitle",t.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),t.innerHTML="Terrain",a.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-section",n.setAttribute("data-bind","foreach: _terrainProviders"),a.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-category",n.appendChild(t);n=document.createElement("div");n.className="cesium-baseLayerPicker-categoryTitle",n.setAttribute("data-bind","text: name"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-choices",n.setAttribute("data-bind","foreach: providers"),t.appendChild(n);t=document.createElement("div");t.className="cesium-baseLayerPicker-item",t.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),n.appendChild(t);n=document.createElement("img");n.className="cesium-baseLayerPicker-itemIcon",n.setAttribute("data-bind","attr: { src: iconUrl }"),n.setAttribute("draggable","false"),t.appendChild(n);n=document.createElement("div");n.className="cesium-baseLayerPicker-itemLabel",n.setAttribute("data-bind","text: name"),t.appendChild(n),knockout.applyBindings(i,r),knockout.applyBindings(i,a),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=a,this._closeDropDown=function(e){r.contains(e.target)||a.contains(e.target)||(i.dropDownVisible=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}function ProviderViewModel(e){var t=e.creationFunction;defined(t.canExecute)||(t=createCommand$2(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=defaultValue(e.category,""),knockout.track(this,["name","tooltip","iconUrl"])}function createDefaultImageryProviderViewModels(){var e=[];return e.push(new ProviderViewModel({name:"Bing Maps Aerial",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.AERIAL})}})),e.push(new ProviderViewModel({name:"Bing Maps Aerial with Labels",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.AERIAL_WITH_LABELS})}})),e.push(new ProviderViewModel({name:"Bing Maps Roads",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldImagery({style:IonWorldImageryStyle$1.ROAD})}})),e.push(new ProviderViewModel({name:"ESRI World Imagery",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriWorldImagery.png"),tooltip:"World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"ESRI World Street Map",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"),tooltip:"This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"ESRI National Geographic",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/esriNationalGeographic.png"),tooltip:"This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com",category:"Other",creationFunction:function(){return new ArcGisMapServerImageryProvider({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),e.push(new ProviderViewModel({name:"Open­Street­Map",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:"OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://a.tile.openstreetmap.org/"})}})),e.push(new ProviderViewModel({name:"Stamen Watercolor",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:"Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new ProviderViewModel({name:"Stamen Toner",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",category:"Other",creationFunction:function(){return new OpenStreetMapImageryProvider({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),e.push(new ProviderViewModel({name:"Sentinel-2",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return new IonImageryProvider({assetId:3954})}})),e.push(new ProviderViewModel({name:"Blue Marble",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return new IonImageryProvider({assetId:3845})}})),e.push(new ProviderViewModel({name:"Earth at night",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return new IonImageryProvider({assetId:3812})}})),e.push(new ProviderViewModel({name:"Natural Earth II",iconUrl:buildModuleUrl("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",category:"Cesium ion",creationFunction:function(){return new TileMapServiceImageryProvider({url:buildModuleUrl("Assets/Textures/NaturalEarthII")})}})),e}function createDefaultTerrainProviderViewModels(){var e=[];return e.push(new ProviderViewModel({name:"WGS84 Ellipsoid",iconUrl:buildModuleUrl("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new EllipsoidTerrainProvider}})),e.push(new ProviderViewModel({name:"Cesium World Terrain",iconUrl:buildModuleUrl("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return createWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0})}})),e}function getPickTileset(t){return function(e){e=t._scene.pick(e.position);defined(e)&&e.primitive instanceof Cesium3DTileset&&(t.tileset=e.primitive),t.pickActive=!1}}function selectTilesetOnHover(t,e){e?t._eventHandler.setInputAction(function(e){e=t._scene.pick(e.endPosition);defined(e)&&e.primitive instanceof Cesium3DTileset&&(t.tileset=e.primitive)},ScreenSpaceEventType$1.MOUSE_MOVE):(t._eventHandler.removeInputAction(ScreenSpaceEventType$1.MOUSE_MOVE),t.picking=t.picking)}AnimationViewModel.defaultDateFormatter=function(e,t){e=JulianDate.toGregorianDate(e);return monthNames[e.month-1]+" "+e.day+" "+e.year},AnimationViewModel.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800],AnimationViewModel.defaultTimeFormatter=function(e,t){var i=JulianDate.toGregorianDate(e),e=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?sprintf("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,e):sprintf("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},AnimationViewModel.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},AnimationViewModel.prototype.setShuttleRingTicks=function(e){var t,i={},r=this._sortedFilteredPositiveTicks;for(o=r.length=0,n=e.length;o<n;++o)t=e[o],i.hasOwnProperty(t)||(i[t]=!0,r.push(t));r.sort(numberComparator);for(var n,a=[],o=(n=r.length)-1;0<=o;--o)0!==(t=r[o])&&a.push(-t);Array.prototype.push.apply(a,r),this._allShuttleRingTicks=a},Object.defineProperties(AnimationViewModel.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}}),AnimationViewModel._maxShuttleRingAngle=maxShuttleRingAngle,AnimationViewModel._realtimeShuttleRingAngle=realtimeShuttleRingAngle,Object.defineProperties(BaseLayerPickerViewModel.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),Object.defineProperties(BaseLayerPicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),BaseLayerPicker.prototype.isDestroyed=function(){return!1},BaseLayerPicker.prototype.destroy=function(){return FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._element),knockout.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),destroyObject(this)},Object.defineProperties(ProviderViewModel.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var stringOptions$1={maximumFractionDigits:3};function formatMemoryString$1(e){e/=1048576;return e<1?e.toLocaleString(void 0,stringOptions$1):Math.round(e).toLocaleString()}function getStatistics(e,t){if(!defined(e))return"";var i=t?e._statisticsPerPass[Cesium3DTilePass$1.PICK]:e._statisticsPerPass[Cesium3DTilePass$1.RENDER],e='<ul class="cesium-cesiumInspector-statistics">';return e+="<li><strong>Visited: </strong>"+i.visited.toLocaleString()+"</li><li><strong>Selected: </strong>"+i.selected.toLocaleString()+"</li><li><strong>Commands: </strong>"+i.numberOfCommands.toLocaleString()+"</li>",e+="</ul>",t||(e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Requests: </strong>"+i.numberOfPendingRequests.toLocaleString()+"</li><li><strong>Attempted: </strong>"+i.numberOfAttemptedRequests.toLocaleString()+"</li><li><strong>Processing: </strong>"+i.numberOfTilesProcessing.toLocaleString()+"</li><li><strong>Content Ready: </strong>"+i.numberOfTilesWithContentReady.toLocaleString()+"</li><li><strong>Total: </strong>"+i.numberOfTilesTotal.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Features Selected: </strong>"+i.numberOfFeaturesSelected.toLocaleString()+"</li><li><strong>Features Loaded: </strong>"+i.numberOfFeaturesLoaded.toLocaleString()+"</li><li><strong>Points Selected: </strong>"+i.numberOfPointsSelected.toLocaleString()+"</li><li><strong>Points Loaded: </strong>"+i.numberOfPointsLoaded.toLocaleString()+"</li><li><strong>Triangles Selected: </strong>"+i.numberOfTrianglesSelected.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Tiles styled: </strong>"+i.numberOfTilesStyled.toLocaleString()+"</li><li><strong>Features styled: </strong>"+i.numberOfFeaturesStyled.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Children Union Culled: </strong>"+i.numberOfTilesCulledWithChildrenUnion.toLocaleString()+"</li>",e+="</ul>",e+='<ul class="cesium-cesiumInspector-statistics">',e+="<li><strong>Geometry Memory (MB): </strong>"+formatMemoryString$1(i.geometryByteLength)+"</li><li><strong>Texture Memory (MB): </strong>"+formatMemoryString$1(i.texturesByteLength)+"</li><li><strong>Batch Table Memory (MB): </strong>"+formatMemoryString$1(i.batchTableByteLength)+"</li>",e+="</ul>"),e}var colorBlendModes=[{text:"Highlight",value:Cesium3DTileColorBlendMode$1.HIGHLIGHT},{text:"Replace",value:Cesium3DTileColorBlendMode$1.REPLACE},{text:"Mix",value:Cesium3DTileColorBlendMode$1.MIX}],highlightColor$1=new Color(1,1,0,.4),scratchColor$l=new Color,oldColor=new Color;function Cesium3DTilesInspectorViewModel(r,e){var n=this,t=r.canvas;this._eventHandler=new ScreenSpaceEventHandler(t),this._scene=r,this._performanceContainer=e,this._canvas=t,this._performanceDisplay=new PerformanceDisplay({container:e}),this._statisticsText="",this._pickStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this._tileset=void 0,this._feature=void 0,this._tile=void 0,knockout.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_editorError","showPickStatistics","showStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile"]),this._properties=knockout.observable({}),this.properties=[],knockout.defineProperty(this,"properties",function(){var e,t=[],i=n._properties();for(e in i)i.hasOwnProperty(e)&&t.push(e);return t});var i=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return i()},set:function(e){i(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceError=e)}}),this.dynamicScreenSpaceError=!1;var a=knockout.observable();knockout.defineProperty(this,"colorBlendMode",{get:function(){return a()},set:function(e){a(e),defined(n._tileset)&&(n._tileset.colorBlendMode=e,n._scene.requestRender())}}),this.colorBlendMode=Cesium3DTileColorBlendMode$1.HIGHLIGHT;var o=knockout.observable(),s=knockout.observable();knockout.defineProperty(this,"picking",{get:function(){return s()},set:function(e){s(e),e?n._eventHandler.setInputAction(function(e){var t,i=r.pick(e.endPosition);i instanceof Cesium3DTileFeature?(n.feature=i,n.tile=i.content.tile):defined(i)&&defined(i.content)?(n.feature=void 0,n.tile=i.content.tile):(n.feature=void 0,n.tile=void 0),defined(n._tileset)&&(o&&defined(i)&&defined(i.content)?(r.pickPositionSupported&&defined(t=r.pickPosition(e.endPosition))&&(n._tileset.debugPickPosition=t),n._tileset.debugPickedTile=i.content.tile):n._tileset.debugPickedTile=void 0,n._scene.requestRender())},ScreenSpaceEventType$1.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(ScreenSpaceEventType$1.MOUSE_MOVE))}}),this.picking=!0;var l=knockout.observable();knockout.defineProperty(this,"colorize",{get:function(){return l()},set:function(e){l(e),defined(n._tileset)&&(n._tileset.debugColorizeTiles=e,n._scene.requestRender())}}),this.colorize=!1;var c=knockout.observable();knockout.defineProperty(this,"wireframe",{get:function(){return c()},set:function(e){c(e),defined(n._tileset)&&(n._tileset.debugWireframe=e,n._scene.requestRender())}}),this.wireframe=!1;var u=knockout.observable();knockout.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(e){u(e),defined(n._tileset)&&(n._tileset.debugShowBoundingVolume=e,n._scene.requestRender())}}),this.showBoundingVolumes=!1;var d=knockout.observable();knockout.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(e){d(e),defined(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=e,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;var h=knockout.observable();knockout.defineProperty(this,"showRequestVolumes",{get:function(){return h()},set:function(e){h(e),defined(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=e,n._scene.requestRender())}}),this.showRequestVolumes=!1;var p=knockout.observable();knockout.defineProperty(this,"freezeFrame",{get:function(){return p()},set:function(e){p(e),defined(n._tileset)&&(n._tileset.debugFreezeFrame=e,n._scene.debugShowFrustumPlanes=e,n._scene.requestRender())}}),this.freezeFrame=!1,knockout.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return o()},set:function(e){o(e),defined(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=e,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;var m=knockout.observable();knockout.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(e){m(e),defined(n._tileset)&&(n._tileset.debugShowGeometricError=e,n._scene.requestRender())}}),this.showGeometricError=!1;var f=knockout.observable();knockout.defineProperty(this,"showRenderingStatistics",{get:function(){return f()},set:function(e){f(e),defined(n._tileset)&&(n._tileset.debugShowRenderingStatistics=e,n._scene.requestRender())}}),this.showRenderingStatistics=!1;var g=knockout.observable();knockout.defineProperty(this,"showMemoryUsage",{get:function(){return g()},set:function(e){g(e),defined(n._tileset)&&(n._tileset.debugShowMemoryUsage=e,n._scene.requestRender())}}),this.showMemoryUsage=!1;var _=knockout.observable();knockout.defineProperty(this,"showUrl",{get:function(){return _()},set:function(e){_(e),defined(n._tileset)&&(n._tileset.debugShowUrl=e,n._scene.requestRender())}}),this.showUrl=!1;var y=knockout.observable();knockout.defineProperty(this,"maximumScreenSpaceError",{get:function(){return y()},set:function(e){e=Number(e),isNaN(e)||(y(e),defined(n._tileset)&&(n._tileset.maximumScreenSpaceError=e))}}),this.maximumScreenSpaceError=16;var C=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return C()},set:function(e){e=Number(e),isNaN(e)||(C(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=e))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,knockout.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(C(),1/6)},set:function(e){C(Math.pow(e,6))}});var v=knockout.observable();knockout.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return v()},set:function(e){e=Number(e),isNaN(e)||(v(e),defined(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=e))}}),this.dynamicScreenSpaceErrorFactor=4;var S=getPickTileset(this),T=knockout.observable();knockout.defineProperty(this,"pickActive",{get:function(){return T()},set:function(e){T(e),e?n._eventHandler.setInputAction(S,ScreenSpaceEventType$1.LEFT_CLICK):n._eventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}});var x=knockout.observable();knockout.defineProperty(this,"pointCloudShading",{get:function(){return x()},set:function(e){x(e),defined(n._tileset)&&(n._tileset.pointCloudShading.attenuation=e)}}),this.pointCloudShading=!1;var b=knockout.observable();knockout.defineProperty(this,"geometricErrorScale",{get:function(){return b()},set:function(e){e=Number(e),isNaN(e)||(b(e),defined(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=e))}}),this.geometricErrorScale=1;var E=knockout.observable();knockout.defineProperty(this,"maximumAttenuation",{get:function(){return E()},set:function(e){e=Number(e),isNaN(e)||(E(e),defined(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=0===e?void 0:e))}}),this.maximumAttenuation=0;var P=knockout.observable();knockout.defineProperty(this,"baseResolution",{get:function(){return P()},set:function(e){e=Number(e),isNaN(e)||(P(e),defined(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=0===e?void 0:e))}}),this.baseResolution=0;var A=knockout.observable();knockout.defineProperty(this,"eyeDomeLighting",{get:function(){return A()},set:function(e){A(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=e)}}),this.eyeDomeLighting=!1;var w=knockout.observable();knockout.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return w()},set:function(e){e=Number(e),isNaN(e)||(w(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=e))}}),this.eyeDomeLightingStrength=1;var D=knockout.observable();knockout.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return D()},set:function(e){e=Number(e),isNaN(e)||(D(e),defined(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=e))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;var M=knockout.observable();knockout.defineProperty(this,"skipLevelOfDetail",{get:function(){return M()},set:function(e){M(e),defined(n._tileset)&&(n._tileset.skipLevelOfDetail=e)}}),this.skipLevelOfDetail=!0;var I=knockout.observable();knockout.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return I()},set:function(e){e=Number(e),isNaN(e)||(I(e),defined(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=e))}}),this.skipScreenSpaceErrorFactor=16;var R=knockout.observable();knockout.defineProperty(this,"baseScreenSpaceError",{get:function(){return R()},set:function(e){e=Number(e),isNaN(e)||(R(e),defined(n._tileset)&&(n._tileset.baseScreenSpaceError=e))}}),this.baseScreenSpaceError=1024;var O=knockout.observable();knockout.defineProperty(this,"skipLevels",{get:function(){return O()},set:function(e){e=Number(e),isNaN(e)||(O(e),defined(n._tileset)&&(n._tileset.skipLevels=e))}}),this.skipLevels=1;var L=knockout.observable();knockout.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return L()},set:function(e){L(e),defined(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=e)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;var F=knockout.observable();knockout.defineProperty(this,"loadSiblings",{get:function(){return F()},set:function(e){F(e),defined(n._tileset)&&(n._tileset.loadSiblings=e)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=r.postRender.addEventListener(function(){n._update()}),defined(this._tileset)||selectTilesetOnHover(this,!0)}function hasFeatures(e){if(0<e.featuresLength)return 1;var t=e.innerContents;if(defined(t)){for(var i=t.length,r=0;r<i;++r)if(!hasFeatures(t[r]))return;return 1}}function Cesium3DTilesInspector(e,t){e=getElement(e);var i=document.createElement("div"),r=document.createElement("div");r.setAttribute("data-bind","visible: performance");var n=new Cesium3DTilesInspectorViewModel(t,r);this._viewModel=n,this._container=e,this._element=i;var a=document.createElement("div");a.textContent="3D Tiles Inspector",a.className="cesium-cesiumInspector-button",a.setAttribute("data-bind","click: toggleInspector"),i.appendChild(a),i.className="cesium-cesiumInspector cesium-3DTilesInspector",i.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(i);var o=document.createElement("div");(this._panel=o).className="cesium-cesiumInspector-dropDown",i.appendChild(o);var s=InspectorShared.createSection,l=InspectorShared.createCheckbox,c=s(o,"Tileset","tilesetVisible","toggleTileset"),u=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Update","updateVisible","toggleUpdate"),h=s(o,"Logging","loggingVisible","toggleLogging"),p=s(o,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),t=s(o,"Style","styleVisible","toggleStyle"),a=s(o,"Optimization","optimizationVisible","toggleOptimization"),e=document.createElement("div");e.className="field-group";s=document.createElement("label");s.className="field-label",s.appendChild(document.createTextNode("Properties: "));o=document.createElement("div");o.setAttribute("data-bind","text: properties"),e.appendChild(s),e.appendChild(o),c.appendChild(e),c.appendChild(makeButton("togglePickTileset","Pick Tileset","pickActive")),c.appendChild(makeButton("trimTilesCache","Trim Tiles Cache")),c.appendChild(l("Enable Picking","picking")),u.appendChild(l("Colorize","colorize")),u.appendChild(l("Wireframe","wireframe")),u.appendChild(l("Bounding Volumes","showBoundingVolumes")),u.appendChild(l("Content Volumes","showContentBoundingVolumes")),u.appendChild(l("Request Volumes","showRequestVolumes")),u.appendChild(l("Point Cloud Shading","pointCloudShading"));c=document.createElement("div");c.setAttribute("data-bind","visible: pointCloudShading"),c.appendChild(makeRangeInput("geometricErrorScale",0,2,.01,"Geometric Error Scale")),c.appendChild(makeRangeInput("maximumAttenuation",0,32,1,"Maximum Attenuation")),c.appendChild(makeRangeInput("baseResolution",0,1,.01,"Base Resolution")),c.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),u.appendChild(c);u=document.createElement("div");u.setAttribute("data-bind","visible: eyeDomeLighting"),u.appendChild(makeRangeInput("eyeDomeLightingStrength",0,2,.1,"EDL Strength")),u.appendChild(makeRangeInput("eyeDomeLightingRadius",0,4,.1,"EDL Radius")),c.appendChild(u),d.appendChild(l("Freeze Frame","freezeFrame")),d.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));u=document.createElement("div");u.appendChild(makeRangeInput("maximumScreenSpaceError",0,128,1,"Maximum Screen Space Error")),d.appendChild(u);u=document.createElement("div");u.setAttribute("data-bind","visible: dynamicScreenSpaceError"),u.appendChild(makeRangeInput("dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"Screen Space Error Density","dynamicScreenSpaceErrorDensity")),u.appendChild(makeRangeInput("dynamicScreenSpaceErrorFactor",1,10,.1,"Screen Space Error Factor")),d.appendChild(u),h.appendChild(l("Performance","performance")),h.appendChild(r),h.appendChild(l("Statistics","showStatistics"));r=document.createElement("div");r.className="cesium-3dTilesInspector-statistics",r.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(r),h.appendChild(l("Pick Statistics","showPickStatistics"));r=document.createElement("div");r.className="cesium-3dTilesInspector-statistics",r.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(r);r=document.createElement("div");t.appendChild(r),r.appendChild(document.createTextNode("Color Blend Mode: "));t=document.createElement("select");t.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),r.appendChild(t);t=document.createElement("textarea");t.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),r.className="cesium-cesiumInspector-styleEditor",r.appendChild(t);t=makeButton("compileStyle","Compile (Ctrl+Enter)");r.appendChild(t);t=document.createElement("div");t.className="cesium-cesiumInspector-error",t.setAttribute("data-bind","text: editorError"),r.appendChild(t),p.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),p.appendChild(l("Geometric Error","showGeometricError")),p.appendChild(l("Rendering Statistics","showRenderingStatistics")),p.appendChild(l("Memory Usage (MB)","showMemoryUsage")),p.appendChild(l("Url","showUrl")),a.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));p=document.createElement("div");p.appendChild(makeRangeInput("skipScreenSpaceErrorFactor",1,50,1,"Skip SSE Factor")),a.appendChild(p);p=document.createElement("div");p.appendChild(makeRangeInput("baseScreenSpaceError",0,4096,1,"SSE before skipping LOD")),a.appendChild(p);p=document.createElement("div");p.appendChild(makeRangeInput("skipLevels",0,10,1,"Min. levels to skip")),a.appendChild(p),a.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),a.appendChild(l("Load siblings of visible tiles","loadSiblings")),knockout.applyBindings(n,i)}function makeRangeInput(e,t,i,r,n,a){a=defaultValue(a,e);var o=document.createElement("input");o.setAttribute("data-bind","value: "+a),o.type="number";a=document.createElement("input");a.type="range",a.min=t,a.max=i,a.step=r,a.setAttribute("data-bind",'valueUpdate: "input", value: '+e);e=document.createElement("div");e.appendChild(a);a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(n)),a.appendChild(o),a.appendChild(e),a}function makeButton(e,t,i){var r=document.createElement("button");r.type="button",r.textContent=t,r.className="cesium-cesiumInspector-pickButton";e="click: "+e;return defined(i)&&(e+=', css: {"cesium-cesiumInspector-pickButtonHighlight" : '+i+"}"),r.setAttribute("data-bind",e),r}function frustumStatisticsToString(e){var t;if(defined(e)){t="Command Statistics";var i,r=e.commandsInFrustums;for(i in r)if(r.hasOwnProperty(i)){var n,a=parseInt(i,10);if(7===a)n="1, 2 and 3";else{for(var o=[],s=2;0<=s;s--){var l=Math.pow(2,s);l<=a&&(o.push(s+1),a-=l)}n=o.reverse().join(" and ")}t+="<br>    "+r[i]+" in frustum "+n}t+="<br>Total: "+e.totalCommands}return t}function boundDepthFrustum(e,t,i){t=Math.min(i,t);return t=Math.max(t,e)}Object.defineProperties(Cesium3DTilesInspectorViewModel.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},colorBlendModes:{get:function(){return colorBlendModes}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,defined(e)){var t=this;e.readyPromise.then(function(e){t.isDestroyed()||t._properties(e.properties)});for(var i=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],r=i.length,n=0;n<r;++n){var a=i[n];this[a]=this[a]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings;var o=e.pointCloudShading;this.pointCloudShading=o.attenuation,this.geometricErrorScale=o.geometricErrorScale,this.maximumAttenuation=o.maximumAttenuation||0,this.baseResolution=o.baseResolution||0,this.eyeDomeLighting=o.eyeDomeLighting,this.eyeDomeLightingStrength=o.eyeDomeLightingStrength,this.eyeDomeLightingRadius=o.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=getStatistics(e,!1),this._pickStatisticsText=getStatistics(e,!0),selectTilesetOnHover(this,!1)}},feature:{get:function(){return this._feature},set:function(e){var t;this._feature!==e&&(defined(t=this._feature)&&!t.content.isDestroyed()&&(!this.colorize&&defined(this._style)?t.color=defined(this._style.color)?this._style.color.evaluateColor(t,scratchColor$l):Color.WHITE:t.color=oldColor,this._scene.requestRender()),defined(e)&&(Color.clone(e.color,oldColor),e.color=highlightColor$1,this._scene.requestRender()),this._feature=e)}},tile:{get:function(){return this._tile},set:function(e){var t;this._tile!==e&&(!defined(t=this._tile)||t.isDestroyed()||hasFeatures(t.content)||(t.color=oldColor,this._scene.requestRender()),defined(e)&&!hasFeatures(e.content)&&(Color.clone(e.color,oldColor),e.color=highlightColor$1,this._scene.requestRender()),this._tile=e)}}}),Cesium3DTilesInspectorViewModel.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive},Cesium3DTilesInspectorViewModel.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible},Cesium3DTilesInspectorViewModel.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible},Cesium3DTilesInspectorViewModel.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible},Cesium3DTilesInspectorViewModel.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible},Cesium3DTilesInspectorViewModel.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible},Cesium3DTilesInspectorViewModel.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible},Cesium3DTilesInspectorViewModel.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible},Cesium3DTilesInspectorViewModel.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible},Cesium3DTilesInspectorViewModel.prototype.trimTilesCache=function(){defined(this._tileset)&&this._tileset.trimLoadedTiles()},Cesium3DTilesInspectorViewModel.prototype.compileStyle=function(){var e=this._tileset;if(defined(e)&&this.styleString!==JSON.stringify(e.style)){this._editorError="";try{0===this.styleString.length&&(this.styleString="{}"),this._style=new Cesium3DTileStyle(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(e){this._editorError=e.toString()}this.feature=this._feature,this.tile=this._tile}},Cesium3DTilesInspectorViewModel.prototype.styleEditorKeyPress=function(e,t){if(9===t.keyCode){t.preventDefault();var i,r=t.target,n=r.selectionStart,a=r.selectionEnd,o=a,s=r.value.slice(n,a).split("\n"),l=s.length;if(t.shiftKey)for(i=0;i<l;++i)" "===s[i][0]&&(" "===s[i][1]?(s[i]=s[i].substr(2),o-=2):(s[i]=s[i].substr(1),--o));else for(i=0;i<l;++i)s[i]=" "+s[i],o+=2;var c=s.join("\n");r.value=r.value.slice(0,n)+c+r.value.slice(a),r.selectionStart=n!==a?n:o,r.selectionEnd=o}else!t.ctrlKey||10!==t.keyCode&&13!==t.keyCode||this.compileStyle();return!0},Cesium3DTilesInspectorViewModel.prototype._update=function(){var e=this._tileset;if(this.performance&&this._performanceDisplay.update(),defined(e)){if(e.isDestroyed())return this.tile=void 0,this.feature=void 0,void(this.tileset=void 0);var t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=getStatistics(e,!1),this._pickStatisticsText=getStatistics(e,!0))},Cesium3DTilesInspectorViewModel.prototype.isDestroyed=function(){return!1},Cesium3DTilesInspectorViewModel.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();var t=this;return this._definedProperties.forEach(function(e){knockout.getObservable(t,e).dispose()}),destroyObject(this)},Cesium3DTilesInspectorViewModel.getStatistics=getStatistics,Object.defineProperties(Cesium3DTilesInspector.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),Cesium3DTilesInspector.prototype.isDestroyed=function(){return!1},Cesium3DTilesInspector.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),destroyObject(this)};var scratchPickRay$1=new Ray,scratchPickCartesian$1=new Cartesian3;function CesiumInspectorViewModel(e,t){var c=this,i=e.canvas,r=new ScreenSpaceEventHandler(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;var n,u=this._scene.globe;function a(e){e=c._scene.pick({x:e.position.x,y:e.position.y});defined(e)&&(c.primitive=defined(e.collection)?e.collection:e.primitive),c._scene.requestRender(),c.pickPrimitiveActive=!1}function o(e){var t,i=u.ellipsoid,e=c._scene.camera.getPickRay(e.position,scratchPickRay$1),e=u.pick(e,c._scene,scratchPickCartesian$1);if(defined(e))for(var r=i.cartesianToCartographic(e),n=u._surface.tileProvider._tilesToRenderByTextureCount,a=0;!t&&a<n.length;++a){var o=n[a];if(defined(o))for(var s=0;!t&&s<o.length;++s){var l=o[s];Rectangle.contains(l.rectangle,r)&&(t=l)}}c.tile=t,c.pickTileActive=!1}u.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.globeDepth=!1,this.pickDepth=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",knockout.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","globeDepth","pickDepth","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=createCommand$2(function(){c.dropDownVisible=!c.dropDownVisible}),this._toggleGeneral=createCommand$2(function(){c.generalVisible=!c.generalVisible}),this._togglePrimitives=createCommand$2(function(){c.primitivesVisible=!c.primitivesVisible}),this._toggleTerrain=createCommand$2(function(){c.terrainVisible=!c.terrainVisible}),this._frustumsSubscription=knockout.getObservable(this,"frustums").subscribe(function(e){c._scene.debugShowFrustums=e,c._scene.requestRender()}),this._frustumPlanesSubscription=knockout.getObservable(this,"frustumPlanes").subscribe(function(e){c._scene.debugShowFrustumPlanes=e,c._scene.requestRender()}),this._performanceSubscription=knockout.getObservable(this,"performance").subscribe(function(e){e?c._performanceDisplay=new PerformanceDisplay({container:c._performanceContainer}):c._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=createCommand$2(function(){return c._primitive.debugShowBoundingVolume=c.primitiveBoundingSphere,c._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=knockout.getObservable(this,"primitiveBoundingSphere").subscribe(function(){c._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=createCommand$2(function(){var e;return c.primitiveReferenceFrame?(e=c._primitive.modelMatrix,c._modelMatrixPrimitive=new DebugModelMatrixPrimitive({modelMatrix:e}),c._scene.primitives.add(c._modelMatrixPrimitive)):defined(c._modelMatrixPrimitive)&&(c._scene.primitives.remove(c._modelMatrixPrimitive),c._modelMatrixPrimitive=void 0),c._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=knockout.getObservable(this,"primitiveReferenceFrame").subscribe(function(){c._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=createCommand$2(function(){return c.filterPrimitive?c._scene.debugCommandFilter=function(e){return!(!defined(c._modelMatrixPrimitive)||e.owner!==c._modelMatrixPrimitive._primitive)||!!defined(c._primitive)&&(e.owner===c._primitive||e.owner===c._primitive._billboardCollection||e.owner.primitive===c._primitive)}:c._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=knockout.getObservable(this,"filterPrimitive").subscribe(function(){c._doFilterPrimitive(),c._scene.requestRender()}),this._wireframeSubscription=knockout.getObservable(this,"wireframe").subscribe(function(e){u._surface.tileProvider._debug.wireframe=e,c._scene.requestRender()}),this._globeDepthSubscription=knockout.getObservable(this,"globeDepth").subscribe(function(e){c._scene.debugShowGlobeDepth=e,c._scene.requestRender()}),this._pickDepthSubscription=knockout.getObservable(this,"pickDepth").subscribe(function(e){c._scene.debugShowPickDepth=e,c._scene.requestRender()}),this._depthFrustumSubscription=knockout.getObservable(this,"depthFrustum").subscribe(function(e){c._scene.debugShowDepthFrustum=e,c._scene.requestRender()}),this._incrementDepthFrustum=createCommand$2(function(){var e=c.depthFrustum+1;return c.depthFrustum=boundDepthFrustum(1,c._numberOfFrustums,e),c._scene.requestRender(),!0}),this._decrementDepthFrustum=createCommand$2(function(){var e=c.depthFrustum-1;return c.depthFrustum=boundDepthFrustum(1,c._numberOfFrustums,e),c._scene.requestRender(),!0}),this._suspendUpdatesSubscription=knockout.getObservable(this,"suspendUpdates").subscribe(function(e){(u._surface._debug.suspendLodUpdate=e)||(c.filterTile=!1)}),this._showTileCoordinates=createCommand$2(function(){return c.tileCoordinates&&!defined(n)?n=e.imageryLayers.addImageryProvider(new TileCoordinatesImageryProvider({tilingScheme:e.terrainProvider.tilingScheme})):!c.tileCoordinates&&defined(n)&&(e.imageryLayers.remove(n),n=void 0),!0}),this._tileCoordinatesSubscription=knockout.getObservable(this,"tileCoordinates").subscribe(function(){c._showTileCoordinates(),c._scene.requestRender()}),this._tileBoundingSphereSubscription=knockout.getObservable(this,"tileBoundingSphere").subscribe(function(){c._showTileBoundingSphere(),c._scene.requestRender()}),this._showTileBoundingSphere=createCommand$2(function(){return c.tileBoundingSphere?u._surface.tileProvider._debug.boundingSphereTile=c._tile:u._surface.tileProvider._debug.boundingSphereTile=void 0,c._scene.requestRender(),!0}),this._doFilterTile=createCommand$2(function(){return c.filterTile?(c.suspendUpdates=!0,u._surface._tilesToRender=[],defined(c._tile)&&c._tile.renderable&&u._surface._tilesToRender.push(c._tile)):c.suspendUpdates=!1,!0}),this._filterTileSubscription=knockout.getObservable(this,"filterTile").subscribe(function(){c.doFilterTile(),c._scene.requestRender()}),this._pickPrimitive=createCommand$2(function(){c.pickPrimitiveActive=!c.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=knockout.getObservable(this,"pickPrimitiveActive").subscribe(function(e){e?r.setInputAction(a,ScreenSpaceEventType$1.LEFT_CLICK):r.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}),this._pickTile=createCommand$2(function(){c.pickTileActive=!c.pickTileActive}),this._pickTileActiveSubscription=knockout.getObservable(this,"pickTileActive").subscribe(function(e){e?r.setInputAction(o,ScreenSpaceEventType$1.LEFT_CLICK):r.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){c._update()})}function CesiumInspector(e,t){e=getElement(e);var i=document.createElement("div"),r=new CesiumInspectorViewModel(t,i);this._viewModel=r,this._container=e;var n=document.createElement("div");this._element=n;var a=document.createElement("div");a.textContent="Cesium Inspector",a.className="cesium-cesiumInspector-button",a.setAttribute("data-bind","click: toggleDropDown"),n.appendChild(a),n.className="cesium-cesiumInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var o=document.createElement("div");(this._panel=o).className="cesium-cesiumInspector-dropDown",n.appendChild(o);var s=InspectorShared.createSection,l=InspectorShared.createCheckbox,c=s(o,"General","generalVisible","toggleGeneral"),u=l("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(d),c.appendChild(u),c.appendChild(l("Show Frustum Planes","frustumPlanes")),c.appendChild(l("Performance Display","performance")),i.className="cesium-cesiumInspector-performanceDisplay",c.appendChild(i);var h=document.createElement("div");h.className="cesium-cesiumInspector-shaderCache",h.setAttribute("data-bind","html: shaderCacheText"),c.appendChild(h);var p=document.createElement("div");c.appendChild(p);t=document.createElement("span");t.setAttribute("data-bind",'html: "     Frustum:"'),p.appendChild(t);a=document.createElement("span");a.setAttribute("data-bind","text: depthFrustumText"),p.appendChild(a);e=document.createElement("input");e.type="button",e.value="-",e.className="cesium-cesiumInspector-pickButton",e.setAttribute("data-bind","click: decrementDepthFrustum"),p.appendChild(e);n=document.createElement("input");n.type="button",n.value="+",n.className="cesium-cesiumInspector-pickButton",n.setAttribute("data-bind","click: incrementDepthFrustum"),p.appendChild(n);d=s(o,"Primitives","primitivesVisible","togglePrimitives"),u=document.createElement("div");u.className="cesium-cesiumInspector-pickSection",d.appendChild(u);i=document.createElement("input");i.type="button",i.value="Pick a primitive",i.className="cesium-cesiumInspector-pickButton",i.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');h=document.createElement("div");h.className="cesium-cesiumInspector-center",h.appendChild(i),u.appendChild(h),u.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),u.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),u.appendChild(this._primitiveOnly);c=s(o,"Terrain","terrainVisible","toggleTerrain"),t=document.createElement("div");t.className="cesium-cesiumInspector-pickSection",c.appendChild(t);a=document.createElement("input");a.type="button",a.value="Pick a tile",a.className="cesium-cesiumInspector-pickButton",a.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),(h=document.createElement("div")).appendChild(a),h.className="cesium-cesiumInspector-center",t.appendChild(h);e=document.createElement("div");t.appendChild(e);p=document.createElement("input");p.type="button",p.value="Parent",p.className="cesium-cesiumInspector-pickButton",p.setAttribute("data-bind","click: selectParent");n=document.createElement("input");n.type="button",n.value="NW",n.className="cesium-cesiumInspector-pickButton",n.setAttribute("data-bind","click: selectNW");d=document.createElement("input");d.type="button",d.value="NE",d.className="cesium-cesiumInspector-pickButton",d.setAttribute("data-bind","click: selectNE");i=document.createElement("input");i.type="button",i.value="SW",i.className="cesium-cesiumInspector-pickButton",i.setAttribute("data-bind","click: selectSW");u=document.createElement("input");u.type="button",u.value="SE",u.className="cesium-cesiumInspector-pickButton",u.setAttribute("data-bind","click: selectSE");s=document.createElement("div");s.className="cesium-cesiumInspector-tileText",e.className="cesium-cesiumInspector-frustumStatistics",e.appendChild(s),e.setAttribute("data-bind","visible: hasPickedTile"),s.setAttribute("data-bind","html: tileText");o=document.createElement("div");o.className="cesium-cesiumInspector-relativeText",o.textContent="Select relative:",e.appendChild(o);a=document.createElement("table"),h=document.createElement("tr"),s=document.createElement("tr"),o=document.createElement("td");o.appendChild(p);p=document.createElement("td");p.appendChild(n);n=document.createElement("td");n.appendChild(d),h.appendChild(o),h.appendChild(p),h.appendChild(n);p=document.createElement("td"),n=document.createElement("td");n.appendChild(i);i=document.createElement("td");i.appendChild(u),s.appendChild(p),s.appendChild(n),s.appendChild(i),a.appendChild(h),a.appendChild(s),e.appendChild(a),t.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),t.appendChild(l("Show only selected","filterTile","hasPickedTile")),c.appendChild(l("Wireframe","wireframe")),c.appendChild(l("Suspend LOD update","suspendUpdates")),c.appendChild(l("Show tile coordinates","tileCoordinates")),knockout.applyBindings(r,this._element)}function getDefaultSkyBoxUrl(e){return buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_"+e+".jpg")}function startRenderLoop(n){n._renderLoopRunning=!0;var a=0;requestAnimationFramePolyFill(function e(t){if(!n.isDestroyed())if(n._useDefaultRenderLoop)try{var i,r=n._targetFrameRate;defined(r)?(i=1e3/r)<(r=t-a)&&(n.resize(),n.render(),a=t-r%i):(n.resize(),n.render()),requestAnimationFramePolyFill(e)}catch(e){n._useDefaultRenderLoop=!1,n._renderLoopRunning=!1,n._showRenderLoopErrors&&n.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,e)}else n._renderLoopRunning=!1})}function configurePixelRatio(e){var t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,defined(e._scene)&&(e._scene.pixelRatio=t),t}function configureCanvasSize(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,n=configurePixelRatio(e);e._canvasClientWidth=i,e._canvasClientHeight=r,i*=n,r*=n,t.width=i,t.height=r,e._canRender=0!=i&&0!=r,e._lastDevicePixelRatio=window.devicePixelRatio}function configureCameraFrustum(e){var t=e._canvas,i=t.width,t=t.height;0!==i&&0!==t&&(defined((e=e._scene.camera.frustum).aspectRatio)?e.aspectRatio=i/t:(e.top=e.right*(t/i),e.bottom=-e.top))}function CesiumWidget(e,t){e=getElement(e),t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=document.createElement("div");i.className="cesium-widget",e.appendChild(i);var r=document.createElement("canvas"),n=FeatureDetection.supportsImageRenderingPixelated();function a(){r!==r.ownerDocument.activeElement&&r.ownerDocument.activeElement.blur()}(this._supportsImageRenderingPixelated=n)&&(r.style.imageRendering=FeatureDetection.imageRenderingValue()),r.oncontextmenu=function(){return!1},r.onselectstart=function(){return!1},r.addEventListener("mousedown",a),r.addEventListener("pointerdown",a),i.appendChild(r);var o=document.createElement("div");o.className="cesium-widget-credits";var s=defined(t.creditContainer)?getElement(t.creditContainer):i;s.appendChild(o);var l=defined(t.creditViewport)?getElement(t.creditViewport):i,c=defaultValue(t.showRenderLoopErrors,!0),n=defaultValue(t.useBrowserRecommendedResolution,!0);this._element=i,this._container=e,this._canvas=r,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=l,this._creditContainer=s,this._innerCreditContainer=o,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=c,this._resolutionScale=1,this._useBrowserRecommendedResolution=n,this._forceResize=!1,this._clock=defined(t.clock)?t.clock:new Clock,configureCanvasSize(this);try{var u=new Scene({canvas:r,contextOptions:t.contextOptions,creditContainer:o,creditViewport:l,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:defaultValue(t.scene3DOnly,!1),terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange});(this._scene=u).camera.constrainedAxis=Cartesian3.UNIT_Z,configurePixelRatio(this),configureCameraFrustum(this);var d=defaultValue(u.mapProjection.ellipsoid,Ellipsoid.WGS84),h=t.globe;defined(h)||(h=new Globe(d)),!1!==h&&(u.globe=h,u.globe.shadows=defaultValue(t.terrainShadows,ShadowMode$1.RECEIVE_ONLY));h=t.skyBox;defined(h)||(h=new SkyBox({sources:{positiveX:getDefaultSkyBoxUrl("px"),negativeX:getDefaultSkyBoxUrl("mx"),positiveY:getDefaultSkyBoxUrl("py"),negativeY:getDefaultSkyBoxUrl("my"),positiveZ:getDefaultSkyBoxUrl("pz"),negativeZ:getDefaultSkyBoxUrl("mz")}})),!1!==h&&(u.skyBox=h,u.sun=new Sun,u.moon=new Moon);h=t.skyAtmosphere;defined(h)||(h=new SkyAtmosphere(d)),!1!==h&&(u.skyAtmosphere=h);h=!1!==t.globe&&t.imageryProvider;defined(h)||(h=createWorldImagery()),!1!==h&&u.imageryLayers.addImageryProvider(h),defined(t.terrainProvider)&&!1!==t.globe&&(u.terrainProvider=t.terrainProvider),this._screenSpaceEventHandler=new ScreenSpaceEventHandler(r),defined(t.sceneMode)&&(t.sceneMode===SceneMode$1.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===SceneMode$1.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=defaultValue(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;var p=this;this._onRenderError=function(e,t){p._useDefaultRenderLoop=!1,p._renderLoopRunning=!1,p._showRenderLoopErrors&&p.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,t)},u.renderError.addEventListener(this._onRenderError)}catch(e){throw c&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',e),e}}function FullscreenButtonViewModel(e,t){defined(t)||(t=document.body),t=getElement(t);var i=this,r=knockout.observable(Fullscreen.fullscreen),n=knockout.observable(Fullscreen.enabled),t=t.ownerDocument;this.isFullscreen=void 0,knockout.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,knockout.defineProperty(this,"isFullscreenEnabled",{get:function(){return n()},set:function(e){n(e&&Fullscreen.enabled)}}),this.tooltip=void 0,knockout.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=createCommand$2(function(){Fullscreen.fullscreen?Fullscreen.exitFullscreen():Fullscreen.requestFullscreen(i._fullscreenElement)},knockout.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=defaultValue(getElement(e),t.body),this._callback=function(){r(Fullscreen.fullscreen)},t.addEventListener(Fullscreen.changeEventName,this._callback)}Object.defineProperties(CesiumInspectorViewModel.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){var e=this;return createCommand$2(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return createCommand$2(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return createCommand$2(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return createCommand$2(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return createCommand$2(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){var t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,defined(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,defined(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),(this._primitive=e).show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){var t;defined(e)?(this.hasPickedTile=!0,e!==this._tile&&(this.tileText="L: "+e.level+" X: "+e.x+" Y: "+e.y,this.tileText+="<br>SW corner: "+e.rectangle.west+", "+e.rectangle.south,this.tileText+="<br>NE corner: "+e.rectangle.east+", "+e.rectangle.north,defined(t=e.data)&&defined(t.tileBoundingRegion)?this.tileText+="<br>Min: "+t.tileBoundingRegion.minimumHeight+" Max: "+t.tileBoundingRegion.maximumHeight:this.tileText+="<br>(Tile is not loaded)"),this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()):(this.hasPickedTile=!1,this._tile=void 0)}}}),CesiumInspectorViewModel.prototype._update=function(){this.frustums&&(this.frustumStatisticText=frustumStatisticsToString(this._scene.debugFrustumStatistics));var e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=boundDepthFrustum(1,e,this.depthFrustum),this.depthFrustumText=this.depthFrustum+" of "+e,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText="Cached shaders: "+this._scene.context.shaderCache.numberOfShaders},CesiumInspectorViewModel.prototype.isDestroyed=function(){return!1},CesiumInspectorViewModel.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._globeDepthSubscription.dispose(),this._pickDepthSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),destroyObject(this)},Object.defineProperties(CesiumInspector.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),CesiumInspector.prototype.isDestroyed=function(){return!1},CesiumInspector.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),destroyObject(this)},Object.defineProperties(CesiumWidget.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e)&&!this._renderLoopRunning&&startRenderLoop(this)}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}}}),CesiumWidget.prototype.showErrorPanel=function(e,t,i){var r=this._element,n=document.createElement("div");n.className="cesium-widget-errorPanel";var a=document.createElement("div");a.className="cesium-widget-errorPanel-content",n.appendChild(a);var o=document.createElement("div");o.className="cesium-widget-errorPanel-header",o.appendChild(document.createTextNode(e)),a.appendChild(o);var s=document.createElement("div");function l(){s.style.maxHeight=Math.max(Math.round(.9*r.clientHeight-100),30)+"px"}s.className="cesium-widget-errorPanel-scroll",a.appendChild(s),l(),defined(window.addEventListener)&&window.addEventListener("resize",l,!1);var c,u,d,h=defined(t),o=defined(i);(h||o)&&((p=document.createElement("div")).className="cesium-widget-errorPanel-message",s.appendChild(p),o&&(c=formatError(i),h||("string"==typeof i&&(i=new Error(i)),t=formatError({name:i.name,message:i.message}),c=i.stack),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+c),(u=document.createElement("div")).className="cesium-widget-errorPanel-message-details collapsed",(d=document.createElement("span")).className="cesium-widget-errorPanel-more-details",d.appendChild(document.createTextNode("See more...")),u.appendChild(d),u.onclick=function(e){u.removeChild(d),u.appendChild(document.createTextNode(c)),u.className="cesium-widget-errorPanel-message-details",a.className="cesium-widget-errorPanel-content expanded",u.onclick=void 0},s.appendChild(u)),p.innerHTML="<p>"+t+"</p>");var p=document.createElement("div");p.className="cesium-widget-errorPanel-buttonPanel",a.appendChild(p);t=document.createElement("button");t.setAttribute("type","button"),t.className="cesium-button",t.appendChild(document.createTextNode("OK")),t.onclick=function(){defined(l)&&defined(window.removeEventListener)&&window.removeEventListener("resize",l,!1),r.removeChild(n)},p.appendChild(t),r.appendChild(n)},CesiumWidget.prototype.isDestroyed=function(){return!1},CesiumWidget.prototype.destroy=function(){defined(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),destroyObject(this)},CesiumWidget.prototype.resize=function(){var e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,configureCanvasSize(this),configureCameraFrustum(this),this._scene.requestRender())},CesiumWidget.prototype.render=function(){var e;this._canRender?(this._scene.initializeFrame(),e=this._clock.tick(),this._scene.render(e)):this._clock.tick()},Object.defineProperties(FullscreenButtonViewModel.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),FullscreenButtonViewModel.prototype.isDestroyed=function(){return!1},FullscreenButtonViewModel.prototype.destroy=function(){document.removeEventListener(Fullscreen.changeEventName,this._callback),destroyObject(this)};var enterFullScreenPath="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",exitFullScreenPath="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function FullscreenButton(e,t){var i=new FullscreenButtonViewModel(t,e=getElement(e));i._exitFullScreenPath=exitFullScreenPath,i._enterFullScreenPath=enterFullScreenPath;t=document.createElement("button");t.type="button",t.className="cesium-button cesium-fullscreenButton",t.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(t),knockout.applyBindings(i,t),this._container=e,this._viewModel=i,this._element=t}Object.defineProperties(FullscreenButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),FullscreenButton.prototype.isDestroyed=function(){return!1},FullscreenButton.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var DEFAULT_HEIGHT=1e3;function GeocoderViewModel(e){defined(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new CartographicGeocoderService,new IonGeocoderService({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new Event,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=handleArrowDown,this._handleArrowUp=handleArrowUp;var n=this;this._suggestionsVisible=knockout.pureComputed(function(){var e=0<knockout.getObservable(n,"_suggestions")().length,t=knockout.getObservable(n,"_showSuggestions")();return e&&t}),this._searchCommand=createCommand$2(function(e){return e=defaultValue(e,GeocodeType$1.SEARCH),n._focusTextbox=!1,defined(n._selectedSuggestion)?(n.activateSuggestion(n._selectedSuggestion),!1):(n.hideSuggestions(),void(n.isSearchInProgress?cancelGeocode(n):geocode(n,n._geocoderServices,e)))}),this.deselectSuggestion=function(){n._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(i||r)&&t.preventDefault(),!0},this.handleKeyUp=function(e,t){var i="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,r="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode,t="Enter"===t.key||13===t.keyCode;return r?handleArrowUp(n):i?handleArrowDown(n):t&&n._searchCommand(),!0},this.activateSuggestion=function(e){n.hideSuggestions(),n._searchText=e.displayName;e=e.destination;clearSuggestions(n),n.destinationFound(n,e)},this.hideSuggestions=function(){n._showSuggestions=!1,n._selectedSuggestion=void 0},this.showSuggestions=function(){n._showSuggestions=!0},this.handleMouseover=function(e,t){e!==n._selectedSuggestion&&(n._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=defaultValue(e.autocomplete,!0),this.destinationFound=defaultValue(e.destinationFound,GeocoderViewModel.flyToDestination),this._focusTextbox=!1,knockout.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);e=knockout.getObservable(this,"_searchText");e.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=e.subscribe(function(){GeocoderViewModel._updateSearchSuggestions(n)}),this.isSearchInProgress=void 0,knockout.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,knockout.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,knockout.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function handleArrowUp(e){var t;0!==e._suggestions.length&&(-1!==(t=e._suggestions.indexOf(e._selectedSuggestion))&&0!==t?(t=t-1,e._selectedSuggestion=e._suggestions[t],GeocoderViewModel._adjustSuggestionsScroll(e,t)):e._selectedSuggestion=void 0)}function handleArrowDown(e){var t;0!==e._suggestions.length&&(t=e._suggestions.length,t=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t,e._selectedSuggestion=e._suggestions[t],GeocoderViewModel._adjustSuggestionsScroll(e,t))}function computeFlyToLocationForCartographic(t,e){var i=defined(e)?e.availability:void 0;return defined(i)?sampleTerrainMostDetailed(e,[t]).then(function(e){return(t=e[0]).height+=DEFAULT_HEIGHT,t}):(t.height+=DEFAULT_HEIGHT,when.resolve(t))}function flyToDestination(e,t){var i,r=e._scene,n=r.mapProjection.ellipsoid,a=r.camera,o=r.terrainProvider,s=t;t instanceof Rectangle?CesiumMath.equalsEpsilon(t.south,t.north,CesiumMath.EPSILON7)&&CesiumMath.equalsEpsilon(t.east,t.west,CesiumMath.EPSILON7)?t=Rectangle.center(t):i=computeFlyToLocationForRectangle(t,r):t=n.cartesianToCartographic(t),defined(i)||(i=computeFlyToLocationForCartographic(t,o)),i.then(function(e){s=n.cartographicToCartesian(e)}).always(function(){a.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:Matrix4.IDENTITY})})}function chainPromise(e,t,i,r){return e.then(function(e){return defined(e)&&"fulfilled"===e.state&&0<e.value.length?e:t.geocode(i,r).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}})})}function geocode(i,e,t){var r=i._searchText;if(hasOnlyWhitespace(r))i.showSuggestions();else{i._isSearchInProgress=!0;for(var n=when.resolve(),a=0;a<e.length;a++)n=chainPromise(n,e[a],r,t);(i._geocodePromise=n).then(function(e){if(!n.cancel){i._isSearchInProgress=!1;var t=e.value;if("fulfilled"===e.state&&defined(t)&&0<t.length)return i._searchText=t[0].displayName,void i.destinationFound(i,t[0].destination);i._searchText=r+" (not found)"}})}}function adjustSuggestionsScroll(e,t){var i=getElement(e._viewContainer),e=i.getElementsByClassName("search-results")[0],i=i.getElementsByTagName("li")[t];0!==t?(t=i.offsetTop)+i.clientHeight>e.clientHeight?e.scrollTop=t+i.clientHeight:t<e.scrollTop&&(e.scrollTop=t):e.scrollTop=0}function cancelGeocode(e){e._isSearchInProgress=!1,defined(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function hasOnlyWhitespace(e){return/^\s*$/.test(e)}function clearSuggestions(e){knockout.getObservable(e,"_suggestions").removeAll()}function updateSearchSuggestions(r){var i,t;r.autoComplete&&(i=r._searchText,clearSuggestions(r),hasOnlyWhitespace(i)||(t=when.resolve([]),r._geocoderServices.forEach(function(e){t=t.then(function(t){return 5<=t.length?t:e.geocode(i,GeocodeType$1.AUTOCOMPLETE).then(function(e){return t=t.concat(e)})})}),t.then(function(e){for(var t=r._suggestions,i=0;i<e.length;i++)t.push(e[i])})))}Object.defineProperties(GeocoderViewModel.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}}),GeocoderViewModel.prototype.destroy=function(){this._suggestionSubscription.dispose()},GeocoderViewModel.flyToDestination=flyToDestination,GeocoderViewModel._updateSearchSuggestions=updateSearchSuggestions,GeocoderViewModel._adjustSuggestionsScroll=adjustSuggestionsScroll;var startSearchPath="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",stopSearchPath="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function Geocoder(e){var i=getElement(e.container),r=new GeocoderViewModel(e);r._startSearchPath=startSearchPath,r._stopSearchPath=stopSearchPath;var t=document.createElement("form");t.setAttribute("data-bind","submit: search");var n=document.createElement("input");n.type="search",n.className="cesium-geocoder-input",n.setAttribute("placeholder","Enter an address or landmark..."),n.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){n.select()},0)},n.addEventListener("focus",this._onTextBoxFocus,!1),t.appendChild(n),this._textBox=n;var a=document.createElement("span");a.className="cesium-geocoder-searchButton",a.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),t.appendChild(a),i.appendChild(t);var o=document.createElement("div");o.className="search-results",o.setAttribute("data-bind","visible: _suggestionsVisible");e=document.createElement("ul");e.setAttribute("data-bind","foreach: _suggestions");a=document.createElement("li");e.appendChild(a),a.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),o.appendChild(e),i.appendChild(o),knockout.applyBindings(r,t),knockout.applyBindings(r,o),this._container=i,this._searchSuggestionsContainer=o,this._viewModel=r,this._form=t,this._onInputBegin=function(e){var t=e.target;"function"==typeof e.composedPath&&(t=e.composedPath()[0]),i.contains(t)||(r._focusTextbox=!1,r.hideSuggestions())},this._onInputEnd=function(e){r._focusTextbox=!0,r.showSuggestions()},FeatureDetection.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),i.addEventListener("pointerup",this._onInputEnd,!0),i.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),i.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),i.addEventListener("touchend",this._onInputEnd,!0),i.addEventListener("touchcancel",this._onInputEnd,!0))}function HomeButtonViewModel(e,t){this._scene=e,this._duration=t;var i=this;this._command=createCommand$2(function(){i._scene.camera.flyHome(i._duration)}),this.tooltip="View Home",knockout.track(this,["tooltip"])}function HomeButton(e,t,i){e=getElement(e);t=new HomeButtonViewModel(t,i);t._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-home-button",i.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(i),knockout.applyBindings(t,i),this._container=e,this._viewModel=t,this._element=i}Object.defineProperties(Geocoder.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}}),Geocoder.prototype.isDestroyed=function(){return!1},Geocoder.prototype.destroy=function(){var e=this._container;return FeatureDetection.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),knockout.cleanNode(this._form),knockout.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),destroyObject(this)},Object.defineProperties(HomeButtonViewModel.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}}),Object.defineProperties(HomeButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),HomeButton.prototype.isDestroyed=function(){return!1},HomeButton.prototype.destroy=function(){return knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var cameraEnabledPath="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",cameraDisabledPath="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function InfoBoxViewModel(){this._cameraClicked=new Event,this._closeClicked=new Event,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",knockout.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,knockout.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?cameraDisabledPath:cameraEnabledPath}}),knockout.defineProperty(this,"_bodyless",{get:function(){return!defined(this.description)||0===this.description.length}})}function InfoBox(e){e=getElement(e);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(n);var t=document.createElement("div");t.className="cesium-infoBox-title",t.setAttribute("data-bind","text: titleText"),n.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-infoBox-camera",t.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-infoBox-close",t.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),t.innerHTML="×",n.appendChild(t);var a=document.createElement("iframe");a.className="cesium-infoBox-iframe",a.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),a.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),a.setAttribute("allowfullscreen",!0),n.appendChild(a);var i=new InfoBoxViewModel;knockout.applyBindings(i,n),this._container=e,this._element=n,this._frame=a,this._viewModel=i,this._descriptionSubscription=void 0;var o=this;a.addEventListener("load",function(){var e=a.contentDocument,t=e.createElement("link");t.href=buildModuleUrl("Widgets/InfoBox/InfoBoxDescription.css"),t.rel="stylesheet",t.type="text/css";var r=e.createElement("div");r.className="cesium-infoBox-description",e.head.appendChild(t),e.body.appendChild(r),o._descriptionSubscription=subscribeAndEvaluate(i,"description",function(e){a.style.height="5px",r.innerHTML=e;var t=null,i=r.firstElementChild;null===i||1!==r.childNodes.length||null!==(e=window.getComputedStyle(i))&&(i=e["background-color"],defined(i=Color.fromCssColorString(i))&&0!==i.alpha&&(t=e["background-color"])),n.style["background-color"]=t;t=r.getBoundingClientRect().height;a.style.height=t+"px"})}),a.setAttribute("src","about:blank")}function NavigationHelpButtonViewModel(){this.showInstructions=!1;var e=this;this._command=createCommand$2(function(){e.showInstructions=!e.showInstructions}),this._showClick=createCommand$2(function(){e._touch=!1}),this._showTouch=createCommand$2(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",knockout.track(this,["tooltip","showInstructions","_touch"])}function NavigationHelpButton(e){var t=getElement(e.container),i=new NavigationHelpButtonViewModel,r=defaultValue(e.instructionsInitiallyVisible,!1);i.showInstructions=r,i._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";var n=document.createElement("span");n.className="cesium-navigationHelpButton-wrapper",t.appendChild(n);var a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",a.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),n.appendChild(a);var o=document.createElement("div");o.className="cesium-navigation-help",o.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),n.appendChild(o);e=document.createElement("button");e.type="button",e.className="cesium-navigation-button cesium-navigation-button-left",e.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');r=document.createElement("img");r.src=buildModuleUrl("Widgets/Images/NavigationHelp/Mouse.svg"),r.className="cesium-navigation-button-icon",r.style.width="25px",r.style.height="25px",e.appendChild(r),e.appendChild(document.createTextNode("Mouse"));a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-right",a.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');r=document.createElement("img");r.src=buildModuleUrl("Widgets/Images/NavigationHelp/Touch.svg"),r.className="cesium-navigation-button-icon",r.style.width="25px",r.style.height="25px",a.appendChild(r),a.appendChild(document.createTextNode("Touch")),o.appendChild(e),o.appendChild(a);a=document.createElement("div");a.className="cesium-click-navigation-help cesium-navigation-help-instructions",a.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),a.innerHTML=' <table> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/MouseLeft.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/MouseRight.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/MouseMiddle.svg")+'" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>',o.appendChild(a);a=document.createElement("div");a.className="cesium-touch-navigation-help cesium-navigation-help-instructions",a.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),a.innerHTML=' <table> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/TouchDrag.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/TouchZoom.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/TouchTilt.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="'+buildModuleUrl("Widgets/Images/NavigationHelp/TouchRotate.svg")+'" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>',o.appendChild(a),knockout.applyBindings(i,n),this._container=t,this._viewModel=i,this._wrapper=n,this._closeInstructions=function(e){n.contains(e.target)||(i.showInstructions=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}function PerformanceWatchdogViewModel(e){this._scene=e.scene,this.lowFrameRateMessage=defaultValue(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,knockout.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var t=this;this._dismissMessage=createCommand$2(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});e=FrameRateMonitor.fromScene(e.scene);this._unsubscribeLowFrameRate=e.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=e.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}function PerformanceWatchdog(e){var t=getElement(e.container),i=new PerformanceWatchdogViewModel(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");e=document.createElement("button");e.setAttribute("type","button"),e.className="cesium-performance-watchdog-message-dismiss",e.innerHTML="×",e.setAttribute("data-bind","click: dismissMessage"),r.appendChild(e);e=document.createElement("div");e.className="cesium-performance-watchdog-message",e.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(e),t.appendChild(r),knockout.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}function ProjectionPickerViewModel(e){this._scene=e,this._orthographic=e.camera.frustum instanceof OrthographicFrustum,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,knockout.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);var n=this;knockout.defineProperty(this,"selectedTooltip",function(){return n._orthographic?n.tooltipOrthographic:n.tooltipPerspective}),this._toggleDropDown=createCommand$2(function(){n.sceneMode===SceneMode$1.SCENE2D||n._flightInProgress||(n.dropDownVisible=!n.dropDownVisible)}),this._eventHelper=new EventHelper,this._eventHelper.add(e.morphComplete,function(e,t,i,r){n.sceneMode=i,n._orthographic=i===SceneMode$1.SCENE2D||n._scene.camera.frustum instanceof OrthographicFrustum}),this._eventHelper.add(e.preRender,function(){n._flightInProgress=defined(e.camera._currentFlight)}),this._switchToPerspective=createCommand$2(function(){n.sceneMode!==SceneMode$1.SCENE2D&&(n._scene.camera.switchToPerspectiveFrustum(),n._orthographic=!1,n.dropDownVisible=!1)}),this._switchToOrthographic=createCommand$2(function(){n.sceneMode!==SceneMode$1.SCENE2D&&(n._scene.camera.switchToOrthographicFrustum(),n._orthographic=!0,n.dropDownVisible=!1)}),this._sceneMode=SceneMode$1}InfoBoxViewModel.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},Object.defineProperties(InfoBoxViewModel.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),Object.defineProperties(InfoBox.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),InfoBox.prototype.isDestroyed=function(){return!1},InfoBox.prototype.destroy=function(){var e=this._container;return knockout.cleanNode(this._element),e.removeChild(this._element),defined(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),destroyObject(this)},Object.defineProperties(NavigationHelpButtonViewModel.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),Object.defineProperties(NavigationHelpButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),NavigationHelpButton.prototype.isDestroyed=function(){return!1},NavigationHelpButton.prototype.destroy=function(){return FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)},Object.defineProperties(PerformanceWatchdogViewModel.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),PerformanceWatchdogViewModel.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),destroyObject(this)},Object.defineProperties(PerformanceWatchdog.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),PerformanceWatchdog.prototype.isDestroyed=function(){return!1},PerformanceWatchdog.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)},Object.defineProperties(ProjectionPickerViewModel.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}}),ProjectionPickerViewModel.prototype.isDestroyed=function(){return!1},ProjectionPickerViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var perspectivePath="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",orthographicPath="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function ProjectionPicker(e,t){e=getElement(e);var i=new ProjectionPickerViewModel(t);i._perspectivePath=perspectivePath,i._orthographicPath=orthographicPath;var r=document.createElement("span");r.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(r);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-toolbar-button",t.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),t.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --\x3e\x3c!-- /ko --\x3e',r.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",t.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),r.appendChild(t);t=document.createElement("button");t.type="button",t.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",t.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),r.appendChild(t),knockout.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(e){r.contains(e.target)||(i.dropDownVisible=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}function SceneModePickerViewModel(e,t){this._scene=e;var n=this;this._eventHelper=new EventHelper,this._eventHelper.add(e.morphStart,function(e,t,i,r){n.sceneMode=i,n.dropDownVisible=!1}),this._duration=defaultValue(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",knockout.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,knockout.defineProperty(this,"selectedTooltip",function(){var e=n.sceneMode;return e===SceneMode$1.SCENE2D?n.tooltip2D:e===SceneMode$1.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=createCommand$2(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=createCommand$2(function(){e.morphTo2D(n._duration)}),this._morphTo3D=createCommand$2(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=createCommand$2(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=SceneMode$1}Object.defineProperties(ProjectionPicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),ProjectionPicker.prototype.isDestroyed=function(){return!1},ProjectionPicker.prototype.destroy=function(){return this._viewModel.destroy(),FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)},Object.defineProperties(SceneModePickerViewModel.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}}),SceneModePickerViewModel.prototype.isDestroyed=function(){return!1},SceneModePickerViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),destroyObject(this)};var globePath="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",flatMapPath="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",columbusViewPath="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function SceneModePicker(e,t,i){e=getElement(e);var r=new SceneModePickerViewModel(t,i);r._globePath=globePath,r._flatMapPath=flatMapPath,r._columbusViewPath=columbusViewPath;var n=document.createElement("span");n.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(n);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),i.innerHTML='\x3c!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --\x3e\x3c!-- /ko --\x3e\x3c!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --\x3e\x3c!-- /ko --\x3e',n.appendChild(i);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",i.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),n.appendChild(i);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",i.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),n.appendChild(i);i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",i.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),n.appendChild(i),knockout.applyBindings(r,n),this._viewModel=r,this._container=e,this._wrapper=n,this._closeDropDown=function(e){n.contains(e.target)||(r.dropDownVisible=!1)},FeatureDetection.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(SceneModePicker.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),SceneModePicker.prototype.isDestroyed=function(){return!1},SceneModePicker.prototype.destroy=function(){return this._viewModel.destroy(),FeatureDetection.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),knockout.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),destroyObject(this)};var screenSpacePos=new Cartesian2,offScreen="-1000px";function SelectionIndicatorViewModel(i,e,t){this._scene=i,this._screenPositionX=offScreen,this._screenPositionY=offScreen,this._tweens=i.tweens,this._container=defaultValue(t,document.body),this._selectionIndicatorElement=e,this._scale=1,this.position=void 0,this.showSelection=!1,knockout.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,knockout.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&defined(this.position)}}),knockout.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(e,t){return SceneTransforms.wgs84ToWindowCoordinates(i,e,t)}}function SelectionIndicator(e,t){e=getElement(e),this._container=e;var i=document.createElement("div");i.className="cesium-selection-wrapper",i.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(i),this._element=i;var r="http://www.w3.org/2000/svg",n=document.createElementNS(r,"svg:svg");n.setAttribute("width",160),n.setAttribute("height",160),n.setAttribute("viewBox","0 0 160 160");e=document.createElementNS(r,"g");e.setAttribute("transform","translate(80,80)"),n.appendChild(e);r=document.createElementNS(r,"path");r.setAttribute("data-bind","attr: { transform: _transform }"),r.setAttribute("d","M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z"),e.appendChild(r),i.appendChild(n);t=new SelectionIndicatorViewModel(t,this._element,this._container);this._viewModel=t,knockout.applyBindings(this._viewModel,this._element)}function TimelineHighlightRange(e,t,i){this._color=e,this._height=t,this._base=defaultValue(i,0)}function TimelineTrack(e,t,i,r){this.interval=e,this.height=t,this.color=i||new Color(.5,.5,.5,1),this.backgroundColor=r||new Color(0,0,0,0)}SelectionIndicatorViewModel.prototype.update=function(){var e,t,i,r,n;this.showSelection&&defined(this.position)&&(defined(e=this.computeScreenSpacePosition(this.position,screenSpacePos))?(t=(n=this._container).parentNode.clientWidth,i=n.parentNode.clientHeight,n=.5*(r=this._selectionIndicatorElement.clientWidth),e.x=Math.min(Math.max(e.x,-r),t+r)-n,e.y=Math.min(Math.max(e.y,-r),i+r)-n,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"):(this._screenPositionX=offScreen,this._screenPositionY=offScreen))},SelectionIndicatorViewModel.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:EasingFunction$1.EXPONENTIAL_OUT})},SelectionIndicatorViewModel.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:EasingFunction$1.EXPONENTIAL_OUT})},Object.defineProperties(SelectionIndicatorViewModel.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),Object.defineProperties(SelectionIndicator.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),SelectionIndicator.prototype.isDestroyed=function(){return!1},SelectionIndicator.prototype.destroy=function(){var e=this._container;return knockout.cleanNode(this._element),e.removeChild(this._element),destroyObject(this)},TimelineHighlightRange.prototype.getHeight=function(){return this._height},TimelineHighlightRange.prototype.getBase=function(){return this._base},TimelineHighlightRange.prototype.getStartTime=function(){return this._start},TimelineHighlightRange.prototype.getStopTime=function(){return this._stop},TimelineHighlightRange.prototype.setRange=function(e,t){this._start=e,this._stop=t},TimelineHighlightRange.prototype.render=function(e){var t,i,r="";return this._start&&this._stop&&this._color&&(i=JulianDate.secondsDifference(this._start,e.epochJulian),t=Math.round(e.timeBarWidth*e.getAlpha(i)),i=JulianDate.secondsDifference(this._stop,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(i))-t,t<0&&(i+=t,t=0),t+i>e.timeBarWidth&&(i=e.timeBarWidth-t),0<i&&(r='<span class="cesium-timeline-highlight" style="left: '+t.toString()+"px; width: "+i.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')),r},TimelineTrack.prototype.render=function(e,t){var i=this.interval.start,r=this.interval.stop,n=t.startJulian,a=JulianDate.addSeconds(t.startJulian,t.duration,new JulianDate);if(JulianDate.lessThan(i,n)&&JulianDate.greaterThan(r,a))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(JulianDate.lessThanOrEquals(i,a)&&JulianDate.greaterThanOrEquals(r,n)){for(var o,s,l=0;l<t.timeBarWidth;++l){var c=JulianDate.addSeconds(t.startJulian,l/t.timeBarWidth*t.duration,new JulianDate);!defined(o)&&JulianDate.greaterThanOrEquals(c,i)?o=l:!defined(s)&&JulianDate.greaterThanOrEquals(c,r)&&(s=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),defined(o)&&(defined(s)||(s=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(o,t.y,Math.max(s-o,1),this.height))}};var timelineWheelDelta=1e12,timelineMouseMode={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},timelineTouchMode={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},timelineTicScales=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],timelineMonthNames=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Timeline(e,t){var i=(e=getElement(e)).ownerDocument;this.container=e;var r=i.createElement("div");r.className="cesium-timeline-main",e.appendChild(r),this._topDiv=r,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=timelineMouseMode.none,this._touchMode=timelineTouchMode.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=createMouseDownCallback(this),this._onMouseUp=createMouseUpCallback(this),this._onMouseMove=createMouseMoveCallback(this),this._onMouseWheel=createMouseWheelCallback(this),this._onTouchStart=createTouchStartCallback(this),this._onTouchMove=createTouchMoveCallback(this),this._onTouchEnd=createTouchEndCallback(this);r=this._timeBarEle;i.addEventListener("mouseup",this._onMouseUp,!1),i.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function twoDigits(e){return e<10?"0"+e.toString():e.toString()}function createMouseDownCallback(t){return function(e){t._mouseMode!==timelineMouseMode.touchOnly&&(0===e.button?(t._mouseMode=timelineMouseMode.scrub,t._scrubElement&&(t._scrubElement.style.backgroundPosition="-16px 0"),t._onMouseMove(e)):(t._mouseX=e.clientX,2===e.button?t._mouseMode=timelineMouseMode.zoom:t._mouseMode=timelineMouseMode.slide)),e.preventDefault()}}function createMouseUpCallback(t){return function(e){t._mouseMode=timelineMouseMode.none,t._scrubElement&&(t._scrubElement.style.backgroundPosition="0 0"),t._timelineDrag=0,t._timelineDragLocation=void 0}}function createMouseMoveCallback(r){return function(e){var t,i;r._mouseMode===timelineMouseMode.scrub?(e.preventDefault(),(t=e.clientX-r._topDiv.getBoundingClientRect().left)<0?(r._timelineDragLocation=0,r._timelineDrag=-.01*r._timeBarSecondsSpan):t>r._topDiv.clientWidth?(r._timelineDragLocation=r._topDiv.clientWidth,r._timelineDrag=.01*r._timeBarSecondsSpan):(r._timelineDragLocation=void 0,r._setTimeBarTime(t,t*r._timeBarSecondsSpan/r._topDiv.clientWidth))):r._mouseMode===timelineMouseMode.slide?(i=r._mouseX-e.clientX,r._mouseX=e.clientX,0!==i&&(t=i*r._timeBarSecondsSpan/r._topDiv.clientWidth,r.zoomTo(JulianDate.addSeconds(r._startJulian,t,new JulianDate),JulianDate.addSeconds(r._endJulian,t,new JulianDate)))):r._mouseMode===timelineMouseMode.zoom&&(i=r._mouseX-e.clientX,r._mouseX=e.clientX,0!==i&&r.zoomFrom(Math.pow(1.01,i)))}}function createMouseWheelCallback(t){return function(e){e=e.wheelDeltaY||e.wheelDelta||-e.detail;e/=timelineWheelDelta=Math.max(Math.min(Math.abs(e),timelineWheelDelta),1),t.zoomFrom(Math.pow(1.05,-e))}}function createTouchStartCallback(n){return function(e){var t,i=e.touches.length,r=n._topDiv.getBoundingClientRect().left;e.preventDefault(),n._mouseMode=timelineMouseMode.touchOnly,1===i?(t=JulianDate.secondsDifference(n._scrubJulian,n._startJulian),t=Math.round(t*n._topDiv.clientWidth/n._timeBarSecondsSpan+r),Math.abs(e.touches[0].clientX-t)<50?(n._touchMode=timelineTouchMode.scrub,n._scrubElement&&(n._scrubElement.style.backgroundPosition=1===i?"-16px 0":"0 0")):(n._touchMode=timelineTouchMode.singleTap,n._touchState.centerX=e.touches[0].clientX-r)):2===i?(n._touchMode=timelineTouchMode.slideZoom,n._touchState.centerX=.5*(e.touches[0].clientX+e.touches[1].clientX)-r,n._touchState.spanX=Math.abs(e.touches[0].clientX-e.touches[1].clientX)):n._touchMode=timelineTouchMode.ignore}}function createTouchEndCallback(r){return function(e){var t=e.touches.length,i=r._topDiv.getBoundingClientRect().left;r._touchMode===timelineTouchMode.singleTap?(r._touchMode=timelineTouchMode.scrub,r._onTouchMove(e)):r._touchMode===timelineTouchMode.scrub&&r._onTouchMove(e),r._mouseMode=timelineMouseMode.touchOnly,1!==t?r._touchMode=0<t?timelineTouchMode.ignore:timelineTouchMode.none:r._touchMode===timelineTouchMode.slideZoom&&(r._touchState.centerX=e.touches[0].clientX-i),r._scrubElement&&(r._scrubElement.style.backgroundPosition="0 0")}}function createTouchMoveCallback(s){return function(e){var t,i,r,n,a=1,o=s._topDiv.getBoundingClientRect().left;s._touchMode===timelineTouchMode.singleTap&&(s._touchMode=timelineTouchMode.slideZoom),s._mouseMode=timelineMouseMode.touchOnly,s._touchMode===timelineTouchMode.scrub?(e.preventDefault(),1===e.changedTouches.length&&0<=(t=e.changedTouches[0].clientX-o)&&t<=s._topDiv.clientWidth&&s._setTimeBarTime(t,t*s._timeBarSecondsSpan/s._topDiv.clientWidth)):s._touchMode===timelineTouchMode.slideZoom&&(2===(t=e.touches.length)?(i=.5*(e.touches[0].clientX+e.touches[1].clientX)-o,r=Math.abs(e.touches[0].clientX-e.touches[1].clientX)):1===t&&(i=e.touches[0].clientX-o,r=0),defined(i)&&(n=0<r&&0<s._touchState.spanX?(a=s._touchState.spanX/r,JulianDate.addSeconds(s._startJulian,(s._touchState.centerX*s._timeBarSecondsSpan-i*s._timeBarSecondsSpan*a)/s._topDiv.clientWidth,new JulianDate)):(n=s._touchState.centerX-i,JulianDate.addSeconds(s._startJulian,n*s._timeBarSecondsSpan/s._topDiv.clientWidth,new JulianDate)),s.zoomTo(n,JulianDate.addSeconds(n,s._timeBarSecondsSpan*a,new JulianDate)),s._touchState.centerX=i,s._touchState.spanX=r))}}function lockScreen(e){var t=!1,i=window.screen;return defined(i)&&(defined(i.lockOrientation)?t=i.lockOrientation(e):defined(i.mozLockOrientation)?t=i.mozLockOrientation(e):defined(i.msLockOrientation)?t=i.msLockOrientation(e):defined(i.orientation&&i.orientation.lock)&&(t=i.orientation.lock(e))),t}function unlockScreen(){var e=window.screen;defined(e)&&(defined(e.unlockOrientation)?e.unlockOrientation():defined(e.mozUnlockOrientation)?e.mozUnlockOrientation():defined(e.msUnlockOrientation)?e.msUnlockOrientation():defined(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function toggleVR(e,t,i,r){r()||(i()?(t.useWebVR=!1,e._locked&&(unlockScreen(),e._locked=!1),e._noSleep.disable(),Fullscreen.exitFullscreen(),i(!1)):(Fullscreen.fullscreen||Fullscreen.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=lockScreen("landscape")),i(t.useWebVR=!0)))}function VRButtonViewModel(e,t){var i=this,r=knockout.observable(Fullscreen.enabled),n=knockout.observable(!1);this.isVRMode=void 0,knockout.defineProperty(this,"isVRMode",{get:function(){return n()}}),this.isVREnabled=void 0,knockout.defineProperty(this,"isVREnabled",{get:function(){return r()},set:function(e){r(e&&Fullscreen.enabled)}}),this.tooltip=void 0,knockout.defineProperty(this,"tooltip",function(){return r()?n()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});var a=knockout.observable(!1);this._isOrthographic=void 0,knockout.defineProperty(this,"_isOrthographic",{get:function(){return a()}}),this._eventHelper=new EventHelper,this._eventHelper.add(e.preRender,function(){a(e.camera.frustum instanceof OrthographicFrustum)}),this._locked=!1,this._noSleep=new NoSleep,this._command=createCommand$2(function(){toggleVR(i,e,n,a)},knockout.getObservable(this,"isVREnabled")),this._vrElement=defaultValue(getElement(t),document.body),this._callback=function(){!Fullscreen.fullscreen&&n()&&(e.useWebVR=!1,i._locked&&(unlockScreen(),i._locked=!1),i._noSleep.disable(),n(!1))},document.addEventListener(Fullscreen.changeEventName,this._callback)}Timeline.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},Timeline.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},Timeline.prototype.isDestroyed=function(){return!1},Timeline.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);var e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),destroyObject(this)},Timeline.prototype.addHighlightRange=function(e,t,i){i=new TimelineHighlightRange(e,t,i);return this._highlightRanges.push(i),this.resize(),i},Timeline.prototype.addTrack=function(e,t,i,r){r=new TimelineTrack(e,t,i,r);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r},Timeline.prototype.zoomTo=function(e,t){var i,r;this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=JulianDate.secondsDifference(t,e),this._clock&&this._clock.clockRange!==ClockRange$1.UNBOUNDED&&(i=this._clock.startTime,n=this._clock.stopTime,r=JulianDate.secondsDifference(n,i),t=JulianDate.secondsDifference(i,this._startJulian),e=JulianDate.secondsDifference(n,this._endJulian),this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):0<t?(this._endJulian=JulianDate.addSeconds(this._endJulian,t,new JulianDate),this._startJulian=i,this._timeBarSecondsSpan=JulianDate.secondsDifference(this._endJulian,this._startJulian)):e<0&&(this._startJulian=JulianDate.addSeconds(this._startJulian,e,new JulianDate),this._endJulian=n,this._timeBarSecondsSpan=JulianDate.secondsDifference(this._endJulian,this._startJulian))),this._makeTics();var n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)},Timeline.prototype.zoomFrom=function(e){var t=JulianDate.secondsDifference(this._scrubJulian,this._startJulian);1<e||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(JulianDate.addSeconds(this._startJulian,t-t*e,new JulianDate),JulianDate.addSeconds(this._endJulian,i*e-i,new JulianDate))},Timeline.prototype.makeLabel=function(e){var t=JulianDate.toGregorianDate(e),e=t.millisecond,i=" UTC";if(0<e&&this._timeBarSecondsSpan<3600){for(i=Math.floor(e).toString();i.length<3;)i="0"+i;i="."+i}return timelineMonthNames[t.month-1]+" "+t.day+" "+t.year+" "+twoDigits(t.hour)+":"+twoDigits(t.minute)+":"+twoDigits(t.second)+i},Timeline.prototype.smallestTicInPixels=7,Timeline.prototype._makeTics=function(){var e,t=this._timeBarEle,i=JulianDate.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan),n=r-8,a=this;this._needleEle.style.left=r.toString()+"px";var o="",i=31536e6,s=0,l=this._timeBarSecondsSpan;l<.01?(l=.01,this._timeBarSecondsSpan=.01,this._endJulian=JulianDate.addSeconds(this._startJulian,.01,new JulianDate)):i<l&&(l=i,this._timeBarSecondsSpan=i,this._endJulian=JulianDate.addSeconds(this._startJulian,i,new JulianDate));var c=this._timeBarEle.clientWidth;c<10&&(c=10);var u=this._startJulian,r=Math.min(l/c*1e-5,.4),i=JulianDate.toGregorianDate(u),i=31536e4<l?JulianDate.fromDate(new Date(Date.UTC(100*Math.floor(i.year/100),0))):31536e3<l?JulianDate.fromDate(new Date(Date.UTC(10*Math.floor(i.year/10),0))):86400<l?JulianDate.fromDate(new Date(Date.UTC(i.year,0))):JulianDate.fromDate(new Date(Date.UTC(i.year,i.month,i.day))),d=JulianDate.secondsDifference(this._startJulian,JulianDate.addSeconds(i,r,new JulianDate)),h=d+l;function p(e){return Math.floor(d/e)*e}function m(e,t){return Math.ceil(e/t+.5)*t}function f(e){return(e-d)/l}function g(e,t){return e-t*Math.round(e/t)}this._epochJulian=i,this._rulerEle.innerHTML=this.makeLabel(JulianDate.addSeconds(this._endJulian,-.01,new JulianDate));var _=this._rulerEle.offsetWidth+20;_<30&&(_=180);r=s;s-=1e-10;var y={startTime:d,startJulian:u,epochJulian:i,duration:l,timeBarWidth:c,getAlpha:f};this._highlightRanges.forEach(function(e){o+=e.render(y)});var C=0,v=0,S=0,T=_/c;1<T&&(T=1),T*=this._timeBarSecondsSpan;for(var x=-1,b=-1,E=timelineTicScales.length,P=0;P<E;++P){var A=timelineTicScales[P];if(++x,T<(C=A)&&s<A)break;b<0&&c*(A/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(b=x)}if(0<x){for(;0<x;)if(--x,Math.abs(g(C,timelineTicScales[x]))<1e-5){timelineTicScales[x]>=s&&(v=timelineTicScales[x]);break}if(0<=b)for(;b<x;){if(Math.abs(g(v,timelineTicScales[b]))<1e-5&&timelineTicScales[b]>=s){S=timelineTicScales[b];break}++b}}1e-10<(s=r)&&S<1e-5&&1e-10<Math.abs(s-C)&&(S=s)<=C+1e-10&&(v=0);var w=-999999;if(3<=c*(S/this._timeBarSecondsSpan))for(e=p(S);e<=h;e=m(e,S))o+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(c*f(e)).toString()+'px;"></span>';if(3<=c*(v/this._timeBarSecondsSpan))for(e=p(v);e<=h;e=m(e,v))o+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(c*f(e)).toString()+'px;"></span>';if(2<=c*(C/this._timeBarSecondsSpan)){h+=this._mainTicSpan=C,e=p(C);for(var D=JulianDate.computeTaiMinusUtc(i);e<=h;){var M,I=JulianDate.addSeconds(u,e-d,new JulianDate);2.1<C&&(M=JulianDate.computeTaiMinusUtc(I),.1<Math.abs(M-D)&&(e+=M-D,I=JulianDate.addSeconds(u,e-d,new JulianDate)));var R=Math.round(c*f(e)),O=this.makeLabel(I);this._rulerEle.innerHTML=O,(M=this._rulerEle.offsetWidth)<10&&(M=_);I=R-(M/2-1);w<I?(w=I+M+5,o+='<span class="cesium-timeline-ticMain" style="left: '+R.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+I.toString()+'px;">'+O+"</span>"):o+='<span class="cesium-timeline-ticSub" style="left: '+R.toString()+'px;"></span>',e=m(e,C)}}else this._mainTicSpan=-1;o+='<span class="cesium-timeline-icon16" style="left:'+n+'px;bottom:0;background-position: 0 0;"></span>',t.innerHTML=o,this._scrubElement=t.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),y.y=0,this._trackList.forEach(function(e){e.render(a._context,y),y.y+=e.height})},Timeline.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e,t=this._scrubElement;defined(this._scrubElement)&&(e=JulianDate.secondsDifference(this._scrubJulian,this._startJulian),e=Math.round(e*this._topDiv.clientWidth/this._timeBarSecondsSpan),this._lastXPos!==e&&(this._lastXPos=e,t.style.left=e-8+"px",this._needleEle.style.left=e+"px")),defined(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(JulianDate.addSeconds(this._startJulian,this._timelineDrag,new JulianDate),JulianDate.addSeconds(this._endJulian,this._timelineDrag,new JulianDate)))},Timeline.prototype._setTimeBarTime=function(e,t){e=Math.round(e),this._scrubJulian=JulianDate.addSeconds(this._startJulian,t,new JulianDate),this._scrubElement&&(i=e-8,this._scrubElement.style.left=i.toString()+"px",this._needleEle.style.left=e.toString()+"px");var i=document.createEvent("Event");i.initEvent("settime",!0,!0),i.clientX=e,i.timeSeconds=t,i.timeJulian=this._scrubJulian,i.clock=this._clock,this._topDiv.dispatchEvent(i)},Timeline.prototype.resize=function(){var t,e=this.container.clientWidth,i=this.container.clientHeight;e===this._lastWidth&&i===this._lastHeight||(this._trackContainer.style.height=i+"px",t=1,this._trackList.forEach(function(e){t+=e.height}),this._trackListEle.style.height=t.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=t,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=i)},Object.defineProperties(VRButtonViewModel.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),VRButtonViewModel.prototype.isDestroyed=function(){return!1},VRButtonViewModel.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Fullscreen.changeEventName,this._callback),destroyObject(this)};var enterVRPath="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",exitVRPath="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function VRButton(e,t,i){e=getElement(e);t=new VRButtonViewModel(t,i);t._exitVRPath=exitVRPath,t._enterVRPath=enterVRPath;i=document.createElement("button");i.type="button",i.className="cesium-button cesium-vrButton",i.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(i),knockout.applyBindings(t,i),this._container=e,this._viewModel=t,this._element=i}Object.defineProperties(VRButton.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),VRButton.prototype.isDestroyed=function(){return!1},VRButton.prototype.destroy=function(){return this._viewModel.destroy(),knockout.cleanNode(this._element),this._container.removeChild(this._element),destroyObject(this)};var boundingSphereScratch$2=new BoundingSphere;function onTimelineScrubfunction(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function getCesium3DTileFeatureDescription(i){var e=i.getPropertyNames(),r="";return e.forEach(function(e){var t=i.getProperty(e);defined(t)&&(r+="<tr><th>"+e+"</th><td>"+t+"</td></tr>")}),0<r.length&&(r='<table class="cesium-infoBox-defaultTable"><tbody>'+r+"</tbody></table>"),r}function getCesium3DTileFeatureName(e){for(var t=[],i=e.getPropertyNames(),r=0;r<i.length;r++){var n=i[r];/^name$/i.test(n)?t[0]=e.getProperty(n):/name/i.test(n)?t[1]=e.getProperty(n):/^title$/i.test(n)?t[2]=e.getProperty(n):/^(id|identifier)$/i.test(n)?t[3]=e.getProperty(n):/element/i.test(n)?t[4]=e.getProperty(n):/(id|identifier)$/i.test(n)&&(t[5]=e.getProperty(n))}var a=t.length;for(r=0;r<a;r++){var o=t[r];if(defined(o)&&""!==o)return o}return"Unnamed Feature"}function pickEntity(e,t){var i=e.scene.pick(t.position);if(defined(i)){var r=defaultValue(i.id,i.primitive.id);if(r instanceof Entity)return r;if(i instanceof Cesium3DTileFeature)return new Entity({name:getCesium3DTileFeatureName(i),description:getCesium3DTileFeatureDescription(i),feature:i})}if(defined(e.scene.globe))return pickImageryLayerFeature(e,t.position)}function trackDataSourceClock(e,t,i){!defined(i)||defined(i=i.clock)&&(i.getValue(t),defined(e)&&(e.updateFromClock(),e.zoomTo(i.startTime,i.stopTime)))}var cartesian3Scratch$3=new Cartesian3;function pickImageryLayerFeature(i,e){var t=i.scene,e=t.camera.getPickRay(e),t=t.imageryLayers.pickImageryLayerFeatures(e,t);if(defined(t)){var r=new Entity({id:"Loading...",description:"Loading feature information..."});return when(t,function(e){var t;i.selectedEntity===r&&(defined(e)&&0!==e.length?(e=new Entity({id:(t=e[0]).name,description:t.description}),defined(t.position)&&(t=i.scene.globe.ellipsoid.cartographicToCartesian(t.position,cartesian3Scratch$3),e.position=new ConstantPositionProperty(t)),i.selectedEntity=e):i.selectedEntity=createNoFeaturesEntity())},function(){i.selectedEntity===r&&(i.selectedEntity=createNoFeaturesEntity())}),r}}function createNoFeaturesEntity(){return new Entity({id:"None",description:"No features found."})}function enableVRUI(e,t){var i=e._geocoder,r=e._homeButton,n=e._sceneModePicker,a=e._projectionPicker,o=e._baseLayerPicker,s=e._animation,l=e._timeline,c=e._fullscreenButton,u=e._infoBox,d=e._selectionIndicator,h=t?"hidden":"visible";defined(i)&&(i.container.style.visibility=h),defined(r)&&(r.container.style.visibility=h),defined(n)&&(n.container.style.visibility=h),defined(a)&&(a.container.style.visibility=h),defined(o)&&(o.container.style.visibility=h),defined(s)&&(s.container.style.visibility=h),defined(l)&&(l.container.style.visibility=h),defined(c)&&c.viewModel.isFullscreenEnabled&&(c.container.style.visibility=h),defined(u)&&(u.container.style.visibility=h),defined(d)&&(d.container.style.visibility=h),e._container&&(c=t||!defined(c)?0:c.container.clientWidth,e._vrButton.container.style.right=c+"px",e.forceResize())}function Viewer(e,t){e=getElement(e);var i=!(defined((t=defaultValue(t,defaultValue.EMPTY_OBJECT)).globe)&&!1===t.globe||defined(t.baseLayerPicker)&&!1===t.baseLayerPicker),r=this,n=document.createElement("div");n.className="cesium-viewer",e.appendChild(n);var a=document.createElement("div");a.className="cesium-viewer-cesiumWidgetContainer",n.appendChild(a);var o=document.createElement("div");o.className="cesium-viewer-bottom",n.appendChild(o);var s,l,c=defaultValue(t.scene3DOnly,!1),u=!1;defined(t.clockViewModel)?s=(l=t.clockViewModel).clock:(l=new ClockViewModel(s=new Clock),u=!0),defined(t.shouldAnimate)&&(s.shouldAnimate=t.shouldAnimate);var d=new CesiumWidget(a,{imageryProvider:!i&&!defined(t.imageryProvider)&&void 0,clock:s,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:defined(t.creditContainer)?t.creditContainer:o,creditViewport:t.creditViewport,scene3DOnly:c,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange}),h=t.dataSources,p=!1;defined(h)||(h=new DataSourceCollection,p=!0);var m,f,g=d.scene,_=new DataSourceDisplay({scene:g,dataSourceCollection:h}),a=new EventHelper;a.add(s.onTick,Viewer.prototype._onTick,this),a.add(g.morphStart,Viewer.prototype._clearTrackedObject,this),defined(t.selectionIndicator)&&!1===t.selectionIndicator||((m=document.createElement("div")).className="cesium-viewer-selectionIndicatorContainer",n.appendChild(m),m=new SelectionIndicator(m,g)),defined(t.infoBox)&&!1===t.infoBox||((B=document.createElement("div")).className="cesium-viewer-infoBoxContainer",n.appendChild(B),C=(f=new InfoBox(B)).viewModel,a.add(C.cameraClicked,Viewer.prototype._onInfoBoxCameraClicked,this),a.add(C.closeClicked,Viewer.prototype._onInfoBoxClockClicked,this));var y,C,v,S,T,x,b,E,P,A,w,D,M,I,R,O,L,F,N,B=document.createElement("div");if(B.className="cesium-viewer-toolbar",n.appendChild(B),defined(t.geocoder)&&!1===t.geocoder||((C=document.createElement("div")).className="cesium-viewer-geocoderContainer",B.appendChild(C),defined(t.geocoder)&&"boolean"!=typeof t.geocoder&&(v=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),y=new Geocoder({container:C,geocoderServices:v,scene:g}),a.add(y.viewModel.search.beforeExecute,Viewer.prototype._clearObjects,this)),defined(t.homeButton)&&!1===t.homeButton||(S=new HomeButton(B,g),defined(y)&&a.add(S.viewModel.command.afterExecute,function(){var e=y.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),a.add(S.viewModel.command.beforeExecute,Viewer.prototype._clearTrackedObject,this)),c||defined(t.sceneModePicker)&&!1===t.sceneModePicker||(T=new SceneModePicker(B,g)),t.projectionPicker&&(x=new ProjectionPicker(B,g)),i&&(b=defaultValue(t.imageryProviderViewModels,createDefaultImageryProviderViewModels()),E=defaultValue(t.terrainProviderViewModels,createDefaultTerrainProviderViewModels()),b=new BaseLayerPicker(B,{globe:g.globe,imageryProviderViewModels:b,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:E,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),E=B.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]),defined(t.imageryProvider)&&!1!==t.imageryProvider&&(i&&(b.viewModel.selectedImagery=void 0),g.imageryLayers.removeAll(),g.imageryLayers.addImageryProvider(t.imageryProvider)),defined(t.terrainProvider)&&(i&&(b.viewModel.selectedTerrain=void 0),g.terrainProvider=t.terrainProvider),!defined(t.navigationHelpButton)||!1!==t.navigationHelpButton){var V,k=!0;try{defined(window.localStorage)&&(defined(V=window.localStorage.getItem("cesium-hasSeenNavHelp"))&&Boolean(V)?k=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true"))}catch(e){}P=new NavigationHelpButton({container:B,instructionsInitiallyVisible:defaultValue(t.navigationInstructionsInitiallyVisible,k)})}defined(t.animation)&&!1===t.animation||((D=document.createElement("div")).className="cesium-viewer-animationContainer",n.appendChild(D),A=new Animation(D,new AnimationViewModel(l))),defined(t.timeline)&&!1===t.timeline||((D=document.createElement("div")).className="cesium-viewer-timelineContainer",n.appendChild(D),(w=new Timeline(D,s)).addEventListener("settime",onTimelineScrubfunction,!1),w.zoomTo(s.startTime,s.stopTime)),defined(t.fullscreenButton)&&!1===t.fullscreenButton||((R=document.createElement("div")).className="cesium-viewer-fullscreenContainer",n.appendChild(R),I=subscribeAndEvaluate((M=new FullscreenButton(R,t.fullscreenElement)).viewModel,"isFullscreenEnabled",function(e){R.style.display=e?"block":"none",defined(w)&&(w.container.style.right=R.clientWidth+"px",w.resize())})),t.vrButton&&((N=document.createElement("div")).className="cesium-viewer-vrContainer",n.appendChild(N),L=subscribeAndEvaluate((O=new VRButton(N,g,t.fullScreenElement)).viewModel,"isVREnabled",function(e){N.style.display=e?"block":"none",defined(M)&&(N.style.right=R.clientWidth+"px"),defined(w)&&(w.container.style.right=N.clientWidth+"px",w.resize())}),F=subscribeAndEvaluate(O.viewModel,"isVRMode",function(e){enableVRUI(r,e)})),this._baseLayerPickerDropDown=E,this._fullscreenSubscription=I,this._vrSubscription=L,this._vrModeSubscription=F,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=defaultValue(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=o,this._element=n,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=f,this._dataSourceCollection=h,this._destroyDataSourceCollection=p,this._dataSourceDisplay=_,this._clockViewModel=l,this._destroyClockViewModel=u,this._toolbar=B,this._homeButton=S,this._sceneModePicker=T,this._projectionPicker=x,this._baseLayerPicker=b,this._navigationHelpButton=P,this._animation=A,this._timeline=w,this._fullscreenButton=M,this._vrButton=O,this._geocoder=y,this._eventHelper=a,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=defined(f)||defined(m),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new Event,this._trackedEntityChanged=new Event,knockout.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),a.add(h.dataSourceAdded,Viewer.prototype._onDataSourceAdded,this),a.add(h.dataSourceRemoved,Viewer.prototype._onDataSourceRemoved,this),a.add(g.postUpdate,Viewer.prototype.resize,this),a.add(g.postRender,Viewer.prototype._postRender,this);for(var z=h.length,U=0;U<z;U++)this._dataSourceAdded(h,h.get(U));this._dataSourceAdded(void 0,_.defaultDataSource),a.add(h.dataSourceAdded,Viewer.prototype._dataSourceAdded,this),a.add(h.dataSourceRemoved,Viewer.prototype._dataSourceRemoved,this),d.screenSpaceEventHandler.setInputAction(function(e){r.selectedEntity=pickEntity(r,e)},ScreenSpaceEventType$1.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(function(e){defined(e=pickEntity(r,e))?Property.getValueOrUndefined(e.position,r.clock.currentTime)?r.trackedEntity=e:r.zoomTo(e):defined(r.trackedEntity)&&(r.trackedEntity=void 0)},ScreenSpaceEventType$1.LEFT_DOUBLE_CLICK)}function zoomToOrFly(i,e,t,r){cancelZoom(i);var n=when.defer();return i._zoomPromise=n,i._zoomIsFlight=r,i._zoomOptions=t,when(e,function(e){var t;i._zoomPromise===n&&(e instanceof ImageryLayer?e.getViewableRectangle().then(function(e){return computeFlyToLocationForRectangle(e,i.scene)}).then(function(e){i._zoomPromise===n&&(i._zoomTarget=e)}):e instanceof Cesium3DTileset||e instanceof TimeDynamicPointCloud?i._zoomTarget=e:e.isLoading&&defined(e.loadingEvent)?t=e.loadingEvent.addEventListener(function(){t(),i._zoomPromise===n&&(i._zoomTarget=e.entities.values.slice(0))}):Array.isArray(e)?i._zoomTarget=e.slice(0):(defined((e=defaultValue(e.values,e)).entities)&&(e=e.entities.values),Array.isArray(e)?i._zoomTarget=e.slice(0):i._zoomTarget=[e]))}),i.scene.requestRender(),n.promise}function clearZoom(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function cancelZoom(e){var t=e._zoomPromise;defined(t)&&(clearZoom(e),t.resolve(!1))}function updateZoomTarget(t){var i=t._zoomTarget;if(defined(i)&&t.scene.mode!==SceneMode$1.MORPHING){var r,e=t.scene,n=e.camera,a=t._zoomPromise,o=defaultValue(t._zoomOptions,{});if(i instanceof Cesium3DTileset)return i.readyPromise.then(function(){var e=i.boundingSphere;defined(o.offset)||(o.offset=new HeadingPitchRange(0,-.5,e.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)}},t._zoomIsFlight?n.flyToBoundingSphere(i.boundingSphere,r):(n.viewBoundingSphere(e,o.offset),n.lookAtTransform(Matrix4.IDENTITY),a.resolve(!0)),clearZoom(t)});if(i instanceof TimeDynamicPointCloud)return i.readyPromise.then(function(){var e=i.boundingSphere;defined(o.offset)||(o.offset=new HeadingPitchRange(0,-.5,e.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)}},t._zoomIsFlight?n.flyToBoundingSphere(e,r):(n.viewBoundingSphere(e,o.offset),n.lookAtTransform(Matrix4.IDENTITY),a.resolve(!0)),clearZoom(t)});if(i instanceof Cartographic)return r={destination:e.mapProjection.ellipsoid.cartographicToCartesian(i),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)}},t._zoomIsFlight?n.flyTo(r):(n.setView(r),a.resolve(!0)),void clearZoom(t);for(var s=i,l=[],c=0,u=s.length;c<u;c++){var d=t._dataSourceDisplay.getBoundingSphere(s[c],!1,boundingSphereScratch$2);if(d===BoundingSphereState$1.PENDING)return;d!==BoundingSphereState$1.FAILED&&l.push(BoundingSphere.clone(boundingSphereScratch$2))}0!==l.length?(t.trackedEntity=void 0,e=BoundingSphere.fromBoundingSpheres(l),t._zoomIsFlight?(clearZoom(t),n.flyToBoundingSphere(e,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){a.resolve(!0)},cancel:function(){a.resolve(!1)},offset:o.offset})):(n.viewBoundingSphere(e,o.offset),n.lookAtTransform(Matrix4.IDENTITY),clearZoom(t),a.resolve(!0))):cancelZoom(t)}}function updateTrackedEntity(e){var t,i,r,n,a;e._needTrackedEntityUpdate&&(t=e._trackedEntity,i=e.clock.currentTime,defined(Property.getValueOrUndefined(t.position,i))&&(r=e.scene,(a=e._dataSourceDisplay.getBoundingSphere(t,!1,boundingSphereScratch$2))!==BoundingSphereState$1.PENDING&&((n=r.mode)!==SceneMode$1.COLUMBUS_VIEW&&n!==SceneMode$1.SCENE2D||(r.screenSpaceCameraController.enableTranslate=!1),n!==SceneMode$1.COLUMBUS_VIEW&&n!==SceneMode$1.SCENE3D||(r.screenSpaceCameraController.enableTilt=!1),a=a!==BoundingSphereState$1.FAILED?boundingSphereScratch$2:void 0,e._entityView=new EntityView(t,r,r.mapProjection.ellipsoid),e._entityView.update(i,a),e._needTrackedEntityUpdate=!1)))}function viewerCesium3DTilesInspectorMixin(e){var t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);var i=new Cesium3DTilesInspector(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return i}}})}function viewerCesiumInspectorMixin(e){var t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);var i=new CesiumInspector(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return i}}})}function viewerDragDropMixin(o,e){e=defaultValue(e,defaultValue.EMPTY_OBJECT);var t=!0,i=defaultValue(e.flyToOnDrop,!0),r=new Event,s=defaultValue(e.clearOnDrop,!0),n=defaultValue(e.dropTarget,o.container),l=defaultValue(e.clampToGround,!0),c=e.proxy;function a(e){stop(e),s&&(o.entities.removeAll(),o.dataSources.removeAll());for(var t=e.dataTransfer.files,i=t.length,r=0;r<i;r++){var n=t[r],a=new FileReader;a.onload=createOnLoadCallback(o,n,c,l),a.onerror=createDropErrorCallback(o,n),a.readAsText(n)}}n=getElement(n),Object.defineProperties(o,{dropTarget:{get:function(){return n},set:function(e){unsubscribe(n,a),subscribe(n=e,a)}},dropEnabled:{get:function(){return t},set:function(e){e!==t&&((e?subscribe:unsubscribe)(n,a),t=e)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return s},set:function(e){s=e}},flyToOnDrop:{get:function(){return i},set:function(e){i=e}},proxy:{get:function(){return c},set:function(e){c=e}},clampToGround:{get:function(){return l},set:function(e){l=e}}}),subscribe(n,a),o.destroy=wrapFunction(o,o.destroy,function(){o.dropEnabled=!1}),o._handleDrop=a}function stop(e){e.stopPropagation(),e.preventDefault()}function unsubscribe(e,t){defined(e)&&(e.removeEventListener("drop",t,!1),e.removeEventListener("dragenter",stop,!1),e.removeEventListener("dragover",stop,!1),e.removeEventListener("dragexit",stop,!1))}function subscribe(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",stop,!1),e.addEventListener("dragover",stop,!1),e.addEventListener("dragexit",stop,!1)}function createOnLoadCallback(r,n,a,o){var s=r.scene;return function(e){var t,i=n.name;try{if(/\.czml$/i.test(i))t=CzmlDataSource.load(JSON.parse(e.target.result),{sourceUri:i});else if(/\.geojson$/i.test(i)||/\.json$/i.test(i)||/\.topojson$/i.test(i))t=GeoJsonDataSource.load(JSON.parse(e.target.result),{sourceUri:i,clampToGround:o});else{if(!/\.(kml|kmz)$/i.test(i))return void r.dropError.raiseEvent(r,i,"Unrecognized file: "+i);t=KmlDataSource.load(n,{sourceUri:i,proxy:a,camera:s.camera,canvas:s.canvas,clampToGround:o})}defined(t)&&r.dataSources.add(t).then(function(e){r.flyToOnDrop&&r.flyTo(e)}).otherwise(function(e){r.dropError.raiseEvent(r,i,e)})}catch(e){r.dropError.raiseEvent(r,i,e)}}}function createDropErrorCallback(t,i){return function(e){t.dropError.raiseEvent(t,i.name,e.target.error)}}function viewerPerformanceWatchdogMixin(e,t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);var i=new PerformanceWatchdog({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return i}}})}function callAndWrap(e,t,i){try{return e(t,i)}catch(e){return when.reject(e)}}function createTaskProcessorWorker(n){var a;return function(e){var t=e.data,i=[],r={id:t.id,result:void 0,error:void 0};return when(callAndWrap(n,t.parameters,i)).then(function(e){r.result=e}).otherwise(function(e){e instanceof Error?r.error={name:e.name,message:e.message,stack:e.stack}:r.error=e}).always(function(){defined(a)||(a=defaultValue(self.webkitPostMessage,self.postMessage)),t.canTransferArrayBuffer||(i.length=0);try{a(r,i)}catch(e){r.result=void 0,r.error="postMessage failed with error: "+formatError(e)+"\n with responseMessage: "+JSON.stringify(r),a(r)}})}}Object.defineProperties(Viewer.prototype,{container:{get:function(){return this._container}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){var t,i;this._trackedEntity!==e&&(this._trackedEntity=e,cancelZoom(this),i=(t=this.scene).mode,defined(e)&&defined(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,i!==SceneMode$1.COLUMBUS_VIEW&&i!==SceneMode$1.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==SceneMode$1.COLUMBUS_VIEW&&i!==SceneMode$1.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(Matrix4.IDENTITY)),this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender())}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){var t;this._selectedEntity!==e&&(this._selectedEntity=e,t=defined(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0,defined(e)?defined(t)&&t.animateAppear():defined(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e))}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,trackDataSourceClock(this._timeline,this.clock,e))}}}),Viewer.prototype.extend=function(e,t){e(this,t)},Viewer.prototype.resize=function(){var e,t,i,r,n=this._cesiumWidget,a=this._container,o=a.clientWidth,s=a.clientHeight,l=defined(this._animation),c=defined(this._timeline);n.resize(),o===this._lastWidth&&s===this._lastHeight||(r=s-125,defined(e=this._baseLayerPickerDropDown)&&(e.style.maxHeight=r+"px"),defined(this._geocoder)&&(this._geocoder.searchSuggestionsContainer.style.maxHeight=r+"px"),defined(this._infoBox)&&(this._infoBox.viewModel.maxHeight=r),a=this._timeline,r=e=n=0,l&&"hidden"!==window.getComputedStyle(this._animation.container).visibility&&(t=this._lastWidth,i=this._animation.container,900<o?(n=169,t<=900&&(i.style.width="169px",i.style.height="112px",this._animation.resize())):600<=o?(n=136,(t<600||900<t)&&(i.style.width="136px",i.style.height="90px",this._animation.resize())):(n=106,(600<t||0===t)&&(i.style.width="106px",i.style.height="70px",this._animation.resize())),e=n+5),c&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility&&(l=this._fullscreenButton,t=this._vrButton,c=(i=a.container).style,r=i.clientHeight+3,c.left=n+"px",n=0,defined(l)&&(n+=l.container.clientWidth),defined(t)&&(n+=t.container.clientWidth),c.right=n+"px",a.resize()),this._bottomContainer.style.left=e+"px",this._bottomContainer.style.bottom=r+"px",this._lastWidth=o,this._lastHeight=s)},Viewer.prototype.forceResize=function(){this._lastWidth=0,this.resize()},Viewer.prototype.render=function(){this._cesiumWidget.render()},Viewer.prototype.isDestroyed=function(){return!1},Viewer.prototype.destroy=function(){this.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(ScreenSpaceEventType$1.LEFT_DOUBLE_CLICK);for(var e=this.dataSources,t=e.length,i=0;i<t;i++)this._dataSourceRemoved(e,e.get(i));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),defined(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),defined(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),defined(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),defined(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),defined(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),defined(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),defined(this._timeline)&&(this._timeline.removeEventListener("settime",onTimelineScrubfunction,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),defined(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),defined(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),defined(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),defined(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),destroyObject(this)},Viewer.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Viewer.prototype._onEntityCollectionChanged,this)},Viewer.prototype._dataSourceRemoved=function(e,t){t=t.entities;t.collectionChanged.removeEventListener(Viewer.prototype._onEntityCollectionChanged,this),defined(this.trackedEntity)&&t.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),defined(this.selectedEntity)&&t.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},Viewer.prototype._onTick=function(e){var t=e.currentTime,i=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=i);var r,n=this._entityView;defined(n)&&(a=this._trackedEntity,this._dataSourceDisplay.getBoundingSphere(a,!1,boundingSphereScratch$2)===BoundingSphereState$1.DONE&&n.update(t,boundingSphereScratch$2));var e=!1,i=this.selectedEntity,a=defined(i)&&this._enableInfoOrSelection;a&&i.isShowing&&i.isAvailable(t)&&(this._dataSourceDisplay.getBoundingSphere(i,!0,boundingSphereScratch$2)!==BoundingSphereState$1.FAILED?r=boundingSphereScratch$2.center:defined(i.position)&&(r=i.position.getValue(t,r)),e=defined(r));n=defined(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;defined(n)&&(n.position=Cartesian3.clone(r,n.position),n.showSelection=a&&e,n.update());n=defined(this._infoBox)?this._infoBox.viewModel:void 0;defined(n)&&(n.showInfo=a,n.enableCamera=e,n.isCameraTracking=this.trackedEntity===this.selectedEntity,a?(n.titleText=defaultValue(i.name,i.id),n.description=Property.getValueOrDefault(i.description,t,"")):(n.titleText="",n.description=""))},Viewer.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var a=i[n];this.trackedEntity===a&&(this.trackedEntity=void 0),this.selectedEntity===a&&(this.selectedEntity=void 0)}},Viewer.prototype._onInfoBoxCameraClicked=function(e){e.isCameraTracking&&this.trackedEntity===this.selectedEntity?this.trackedEntity=void 0:defined(this.selectedEntity.position)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)},Viewer.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},Viewer.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},Viewer.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},Viewer.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&trackDataSourceClock(this.timeline,this.clock,e)},Viewer.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,t=this._eventHelper.add(t.changedEvent,Viewer.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=t},Viewer.prototype._onDataSourceRemoved=function(e,t){var i=this.clockTrackedDataSource===t,t=t.entities.id;this._dataSourceChangedListeners[t](),this._dataSourceChangedListeners[t]=void 0,i&&(i=e.length,this._automaticallyTrackDataSourceClocks&&0<i?this.clockTrackedDataSource=e.get(i-1):this.clockTrackedDataSource=void 0)},Viewer.prototype.zoomTo=function(e,t){return zoomToOrFly(this,e,{offset:t},!1)},Viewer.prototype.flyTo=function(e,t){return zoomToOrFly(this,e,t,!0)},Viewer.prototype._postRender=function(){updateZoomTarget(this),updateTrackedEntity(this)};var VERSION="1.76";exports.Animation=Animation,exports.AnimationViewModel=AnimationViewModel,exports.Appearance=Appearance,exports.ApproximateTerrainHeights=ApproximateTerrainHeights,exports.ArcGISTiledElevationTerrainProvider=ArcGISTiledElevationTerrainProvider,exports.ArcGisMapServerImageryProvider=ArcGisMapServerImageryProvider,exports.ArcType=ArcType$1,exports.AssociativeArray=AssociativeArray,exports.AttributeCompression=AttributeCompression,exports.AttributeType=AttributeType$1,exports.AutoExposure=AutoExposure,exports.Autolinker=Autolinker,exports.AutomaticUniforms=AutomaticUniforms,exports.Axis=Axis$1,exports.AxisAlignedBoundingBox=AxisAlignedBoundingBox,exports.BaseLayerPicker=BaseLayerPicker,exports.BaseLayerPickerViewModel=BaseLayerPickerViewModel,exports.BatchTable=BatchTable,exports.Batched3DModel3DTileContent=Batched3DModel3DTileContent,exports.Billboard=Billboard,exports.BillboardCollection=BillboardCollection,exports.BillboardGraphics=BillboardGraphics,exports.BillboardVisualizer=BillboardVisualizer,exports.BingMapsGeocoderService=BingMapsGeocoderService,exports.BingMapsImageryProvider=BingMapsImageryProvider,exports.BingMapsStyle=BingMapsStyle$1,exports.BlendEquation=BlendEquation$1,exports.BlendFunction=BlendFunction$1,exports.BlendOption=BlendOption$1,exports.BlendingState=BlendingState$1,exports.BoundingRectangle=BoundingRectangle,exports.BoundingSphere=BoundingSphere,exports.BoundingSphereState=BoundingSphereState$1,exports.BoxEmitter=BoxEmitter,exports.BoxGeometry=BoxGeometry,exports.BoxGeometryUpdater=BoxGeometryUpdater,exports.BoxGraphics=BoxGraphics,exports.BoxOutlineGeometry=BoxOutlineGeometry,exports.BrdfLutGenerator=BrdfLutGenerator,exports.Buffer=Buffer$1,exports.BufferUsage=BufferUsage$1,exports.CallbackProperty=CallbackProperty,exports.Camera=Camera,exports.CameraEventAggregator=CameraEventAggregator,exports.CameraEventType=CameraEventType$1,exports.CameraFlightPath=CameraFlightPath,exports.Cartesian2=Cartesian2,exports.Cartesian3=Cartesian3,exports.Cartesian4=Cartesian4,exports.Cartographic=Cartographic,exports.CartographicGeocoderService=CartographicGeocoderService,exports.CatmullRomSpline=CatmullRomSpline,exports.Cesium3DTile=Cesium3DTile,exports.Cesium3DTileBatchTable=Cesium3DTileBatchTable,exports.Cesium3DTileColorBlendMode=Cesium3DTileColorBlendMode$1,exports.Cesium3DTileContent=Cesium3DTileContent,exports.Cesium3DTileContentFactory=Cesium3DTileContentFactory,exports.Cesium3DTileContentState=Cesium3DTileContentState$1,exports.Cesium3DTileFeature=Cesium3DTileFeature,exports.Cesium3DTileFeatureTable=Cesium3DTileFeatureTable,exports.Cesium3DTileOptimizationHint=Cesium3DTileOptimizationHint$1,exports.Cesium3DTileOptimizations=Cesium3DTileOptimizations,exports.Cesium3DTilePass=Cesium3DTilePass$1,exports.Cesium3DTilePassState=Cesium3DTilePassState,exports.Cesium3DTilePointFeature=Cesium3DTilePointFeature,exports.Cesium3DTileRefine=Cesium3DTileRefine$1,exports.Cesium3DTileStyle=Cesium3DTileStyle,exports.Cesium3DTileStyleEngine=Cesium3DTileStyleEngine,exports.Cesium3DTilesInspector=Cesium3DTilesInspector,exports.Cesium3DTilesInspectorViewModel=Cesium3DTilesInspectorViewModel,exports.Cesium3DTileset=Cesium3DTileset,exports.Cesium3DTilesetCache=Cesium3DTilesetCache,exports.Cesium3DTilesetGraphics=Cesium3DTilesetGraphics,exports.Cesium3DTilesetHeatmap=Cesium3DTilesetHeatmap,exports.Cesium3DTilesetMostDetailedTraversal=Cesium3DTilesetMostDetailedTraversal,exports.Cesium3DTilesetStatistics=Cesium3DTilesetStatistics,exports.Cesium3DTilesetTraversal=Cesium3DTilesetTraversal,exports.Cesium3DTilesetVisualizer=Cesium3DTilesetVisualizer,exports.CesiumInspector=CesiumInspector,exports.CesiumInspectorViewModel=CesiumInspectorViewModel,exports.CesiumTerrainProvider=CesiumTerrainProvider,exports.CesiumWidget=CesiumWidget,exports.Check=Check,exports.CheckerboardMaterialProperty=CheckerboardMaterialProperty,exports.CircleEmitter=CircleEmitter,exports.CircleGeometry=CircleGeometry,exports.CircleOutlineGeometry=CircleOutlineGeometry,exports.ClassificationModel=ClassificationModel,exports.ClassificationPrimitive=ClassificationPrimitive,exports.ClassificationType=ClassificationType$1,exports.ClearCommand=ClearCommand,exports.ClippingPlane=ClippingPlane,exports.ClippingPlaneCollection=ClippingPlaneCollection,exports.Clock=Clock,exports.ClockRange=ClockRange$1,exports.ClockStep=ClockStep$1,exports.ClockViewModel=ClockViewModel,exports.Color=Color,exports.ColorBlendMode=ColorBlendMode$1,exports.ColorGeometryInstanceAttribute=ColorGeometryInstanceAttribute,exports.ColorMaterialProperty=ColorMaterialProperty,exports.Command=Command,exports.ComponentDatatype=ComponentDatatype$1,exports.Composite3DTileContent=Composite3DTileContent,exports.CompositeEntityCollection=CompositeEntityCollection,exports.CompositeMaterialProperty=CompositeMaterialProperty,exports.CompositePositionProperty=CompositePositionProperty,exports.CompositeProperty=CompositeProperty,exports.CompressedTextureBuffer=CompressedTextureBuffer,exports.ComputeCommand=ComputeCommand,exports.ComputeEngine=ComputeEngine,exports.ConditionsExpression=ConditionsExpression,exports.ConeEmitter=ConeEmitter,exports.ConstantPositionProperty=ConstantPositionProperty,exports.ConstantProperty=ConstantProperty,exports.Context=Context,exports.ContextLimits=ContextLimits,exports.CoplanarPolygonGeometry=CoplanarPolygonGeometry,exports.CoplanarPolygonGeometryLibrary=CoplanarPolygonGeometryLibrary,exports.CoplanarPolygonOutlineGeometry=CoplanarPolygonOutlineGeometry,exports.CornerType=CornerType$1,exports.CorridorGeometry=CorridorGeometry,exports.CorridorGeometryLibrary=CorridorGeometryLibrary,exports.CorridorGeometryUpdater=CorridorGeometryUpdater,exports.CorridorGraphics=CorridorGraphics,exports.CorridorOutlineGeometry=CorridorOutlineGeometry,exports.Credit=Credit,exports.CreditDisplay=CreditDisplay,exports.CubeMap=CubeMap,exports.CubeMapFace=CubeMapFace,exports.CubicRealPolynomial=CubicRealPolynomial,exports.CullFace=CullFace$1,exports.CullingVolume=CullingVolume,exports.CustomDataSource=CustomDataSource,exports.CylinderGeometry=CylinderGeometry,exports.CylinderGeometryLibrary=CylinderGeometryLibrary,exports.CylinderGeometryUpdater=CylinderGeometryUpdater,exports.CylinderGraphics=CylinderGraphics,exports.CylinderOutlineGeometry=CylinderOutlineGeometry,exports.CzmlDataSource=CzmlDataSource,exports.DataSource=DataSource,exports.DataSourceClock=DataSourceClock,exports.DataSourceCollection=DataSourceCollection,exports.DataSourceDisplay=DataSourceDisplay,exports.DebugAppearance=DebugAppearance,exports.DebugCameraPrimitive=DebugCameraPrimitive,exports.DebugInspector=DebugInspector,exports.DebugModelMatrixPrimitive=DebugModelMatrixPrimitive,exports.DefaultProxy=DefaultProxy,exports.DepthFunction=DepthFunction$1,exports.DepthPlane=DepthPlane,exports.DerivedCommand=DerivedCommand,exports.DeveloperError=DeveloperError,exports.DeviceOrientationCameraController=DeviceOrientationCameraController,exports.DirectionalLight=DirectionalLight,exports.DiscardEmptyTileImagePolicy=DiscardEmptyTileImagePolicy,exports.DiscardMissingTileImagePolicy=DiscardMissingTileImagePolicy,exports.DistanceDisplayCondition=DistanceDisplayCondition,exports.DistanceDisplayConditionGeometryInstanceAttribute=DistanceDisplayConditionGeometryInstanceAttribute,exports.DoublyLinkedList=DoublyLinkedList,exports.DracoLoader=DracoLoader,exports.DrawCommand=DrawCommand,exports.DynamicGeometryBatch=DynamicGeometryBatch,exports.DynamicGeometryUpdater=DynamicGeometryUpdater,exports.EarthOrientationParameters=EarthOrientationParameters,exports.EarthOrientationParametersSample=EarthOrientationParametersSample,exports.EasingFunction=EasingFunction$1,exports.EllipseGeometry=EllipseGeometry,exports.EllipseGeometryLibrary=EllipseGeometryLibrary,exports.EllipseGeometryUpdater=EllipseGeometryUpdater,exports.EllipseGraphics=EllipseGraphics,exports.EllipseOutlineGeometry=EllipseOutlineGeometry,exports.Ellipsoid=Ellipsoid,exports.EllipsoidGeodesic=EllipsoidGeodesic,exports.EllipsoidGeometry=EllipsoidGeometry,exports.EllipsoidGeometryUpdater=EllipsoidGeometryUpdater,exports.EllipsoidGraphics=EllipsoidGraphics,exports.EllipsoidOutlineGeometry=EllipsoidOutlineGeometry,exports.EllipsoidPrimitive=EllipsoidPrimitive,exports.EllipsoidRhumbLine=EllipsoidRhumbLine,exports.EllipsoidSurfaceAppearance=EllipsoidSurfaceAppearance,exports.EllipsoidTangentPlane=EllipsoidTangentPlane,exports.EllipsoidTerrainProvider=EllipsoidTerrainProvider,exports.EllipsoidalOccluder=EllipsoidalOccluder,exports.Empty3DTileContent=Empty3DTileContent,exports.EncodedCartesian3=EncodedCartesian3,exports.Entity=Entity,exports.EntityCluster=EntityCluster,exports.EntityCollection=EntityCollection,exports.EntityView=EntityView,exports.Event=Event,exports.EventHelper=EventHelper,exports.Expression=Expression,exports.ExpressionNodeType=ExpressionNodeType$1,exports.ExtrapolationType=ExtrapolationType$1,exports.FXAA3_11=FXAA3_11,exports.FeatureDetection=FeatureDetection,exports.Fog=Fog,exports.ForEach=ForEach,exports.FrameRateMonitor=FrameRateMonitor,exports.FrameState=FrameState,exports.Framebuffer=Framebuffer,exports.FrustumCommands=FrustumCommands,exports.FrustumGeometry=FrustumGeometry,exports.FrustumOutlineGeometry=FrustumOutlineGeometry,exports.Fullscreen=Fullscreen,exports.FullscreenButton=FullscreenButton,exports.FullscreenButtonViewModel=FullscreenButtonViewModel,exports.GeoJsonDataSource=GeoJsonDataSource,exports.GeocodeType=GeocodeType$1,exports.Geocoder=Geocoder,exports.GeocoderService=GeocoderService,exports.GeocoderViewModel=GeocoderViewModel,exports.GeographicProjection=GeographicProjection,exports.GeographicTilingScheme=GeographicTilingScheme,exports.Geometry=Geometry,exports.Geometry3DTileContent=Geometry3DTileContent,exports.GeometryAttribute=GeometryAttribute,exports.GeometryAttributes=GeometryAttributes,exports.GeometryFactory=GeometryFactory,exports.GeometryInstance=GeometryInstance,exports.GeometryInstanceAttribute=GeometryInstanceAttribute,exports.GeometryOffsetAttribute=GeometryOffsetAttribute$1,exports.GeometryPipeline=GeometryPipeline,exports.GeometryType=GeometryType$1,exports.GeometryUpdater=GeometryUpdater,exports.GeometryVisualizer=GeometryVisualizer,exports.GetFeatureInfoFormat=GetFeatureInfoFormat,exports.Globe=Globe,exports.GlobeDepth=GlobeDepth,exports.GlobeSurfaceShaderSet=GlobeSurfaceShaderSet,exports.GlobeSurfaceTile=GlobeSurfaceTile,exports.GlobeSurfaceTileProvider=GlobeSurfaceTileProvider,exports.GlobeTranslucency=GlobeTranslucency,exports.GlobeTranslucencyFramebuffer=GlobeTranslucencyFramebuffer,exports.GlobeTranslucencyState=GlobeTranslucencyState,exports.GoogleEarthEnterpriseImageryProvider=GoogleEarthEnterpriseImageryProvider,exports.GoogleEarthEnterpriseMapsProvider=GoogleEarthEnterpriseMapsProvider,exports.GoogleEarthEnterpriseMetadata=GoogleEarthEnterpriseMetadata,exports.GoogleEarthEnterpriseTerrainData=GoogleEarthEnterpriseTerrainData,exports.GoogleEarthEnterpriseTerrainProvider=GoogleEarthEnterpriseTerrainProvider,exports.GoogleEarthEnterpriseTileInformation=GoogleEarthEnterpriseTileInformation,exports.GregorianDate=GregorianDate,exports.GridImageryProvider=GridImageryProvider,exports.GridMaterialProperty=GridMaterialProperty,exports.GroundGeometryUpdater=GroundGeometryUpdater,exports.GroundPolylineGeometry=GroundPolylineGeometry,exports.GroundPolylinePrimitive=GroundPolylinePrimitive,exports.GroundPrimitive=GroundPrimitive,exports.HeadingPitchRange=HeadingPitchRange,exports.HeadingPitchRoll=HeadingPitchRoll,exports.Heap=Heap,exports.HeightReference=HeightReference$1,exports.HeightmapEncoding=HeightmapEncoding$1,exports.HeightmapTerrainData=HeightmapTerrainData,exports.HeightmapTessellator=HeightmapTessellator,exports.HermitePolynomialApproximation=HermitePolynomialApproximation,exports.HermiteSpline=HermiteSpline,exports.HomeButton=HomeButton,exports.HomeButtonViewModel=HomeButtonViewModel,exports.HorizontalOrigin=HorizontalOrigin$1,exports.Iau2000Orientation=Iau2000Orientation,exports.Iau2006XysData=Iau2006XysData,exports.Iau2006XysSample=Iau2006XysSample,exports.IauOrientationAxes=IauOrientationAxes,exports.IauOrientationParameters=IauOrientationParameters,exports.ImageMaterialProperty=ImageMaterialProperty,exports.Imagery=Imagery,exports.ImageryLayer=ImageryLayer,exports.ImageryLayerCollection=ImageryLayerCollection,exports.ImageryLayerFeatureInfo=ImageryLayerFeatureInfo,exports.ImageryProvider=ImageryProvider,exports.ImagerySplitDirection=ImagerySplitDirection$1,exports.ImageryState=ImageryState$1,exports.IndexDatatype=IndexDatatype$1,exports.InfoBox=InfoBox,exports.InfoBoxViewModel=InfoBoxViewModel,exports.InspectorShared=InspectorShared,exports.Instanced3DModel3DTileContent=Instanced3DModel3DTileContent,exports.InterpolationAlgorithm=InterpolationAlgorithm,exports.Intersect=Intersect$1,exports.IntersectionTests=IntersectionTests,exports.Intersections2D=Intersections2D,exports.Interval=Interval,exports.InvertClassification=InvertClassification,exports.Ion=Ion,exports.IonGeocoderService=IonGeocoderService,exports.IonImageryProvider=IonImageryProvider,exports.IonResource=IonResource,exports.IonWorldImageryStyle=IonWorldImageryStyle$1,exports.Iso8601=Iso8601,exports.JobScheduler=JobScheduler,exports.JobType=JobType$1,exports.JulianDate=JulianDate,exports.KeyboardEventModifier=KeyboardEventModifier$1,exports.KmlCamera=KmlCamera,exports.KmlDataSource=KmlDataSource,exports.KmlLookAt=KmlLookAt,exports.KmlTour=KmlTour,exports.KmlTourFlyTo=KmlTourFlyTo,exports.KmlTourWait=KmlTourWait,exports.Label=Label,exports.LabelCollection=LabelCollection,exports.LabelGraphics=LabelGraphics,exports.LabelStyle=LabelStyle$1,exports.LabelVisualizer=LabelVisualizer,exports.LagrangePolynomialApproximation=LagrangePolynomialApproximation,exports.LeapSecond=LeapSecond,exports.LercDecode=LercDecode,exports.Light=Light,exports.LinearApproximation=LinearApproximation,exports.LinearSpline=LinearSpline,exports.ManagedArray=ManagedArray,exports.MapMode2D=MapMode2D$1,exports.MapProjection=MapProjection,exports.MapboxImageryProvider=MapboxImageryProvider,exports.MapboxStyleImageryProvider=MapboxStyleImageryProvider,exports.Material=Material,exports.MaterialAppearance=MaterialAppearance,exports.MaterialProperty=MaterialProperty,exports.Math=CesiumMath,exports.Matrix2=Matrix2,exports.Matrix3=Matrix3,exports.Matrix4=Matrix4,exports.MipmapHint=MipmapHint$1,exports.Model=Model,exports.ModelAnimation=ModelAnimation,exports.ModelAnimationCache=ModelAnimationCache,exports.ModelAnimationCollection=ModelAnimationCollection,exports.ModelAnimationLoop=ModelAnimationLoop$1,exports.ModelAnimationState=ModelAnimationState,exports.ModelGraphics=ModelGraphics,exports.ModelInstance=ModelInstance,exports.ModelInstanceCollection=ModelInstanceCollection,exports.ModelLoadResources=ModelLoadResources,exports.ModelMaterial=ModelMaterial,exports.ModelMesh=ModelMesh,exports.ModelNode=ModelNode,exports.ModelOutlineLoader=ModelOutlineLoader,exports.ModelUtility=ModelUtility,exports.ModelVisualizer=ModelVisualizer,exports.Moon=Moon,exports.NavigationHelpButton=NavigationHelpButton,exports.NavigationHelpButtonViewModel=NavigationHelpButtonViewModel,exports.NearFarScalar=NearFarScalar,exports.NeverTileDiscardPolicy=NeverTileDiscardPolicy,exports.NoSleep=NoSleep,exports.NodeTransformationProperty=NodeTransformationProperty,exports.OIT=OIT,exports.Occluder=Occluder,exports.OctahedralProjectedCubeMap=OctahedralProjectedCubeMap,exports.OffsetGeometryInstanceAttribute=OffsetGeometryInstanceAttribute,exports.OpenCageGeocoderService=OpenCageGeocoderService,exports.OpenStreetMapImageryProvider=OpenStreetMapImageryProvider,exports.OrderedGroundPrimitiveCollection=OrderedGroundPrimitiveCollection,exports.OrientedBoundingBox=OrientedBoundingBox,exports.OrthographicFrustum=OrthographicFrustum,exports.OrthographicOffCenterFrustum=OrthographicOffCenterFrustum,exports.Packable=Packable,exports.PackableForInterpolation=PackableForInterpolation,exports.Particle=Particle,exports.ParticleBurst=ParticleBurst,exports.ParticleEmitter=ParticleEmitter,exports.ParticleSystem=ParticleSystem,exports.Pass=Pass$1,exports.PassState=PassState,exports.PathGraphics=PathGraphics,exports.PathVisualizer=PathVisualizer,exports.PeliasGeocoderService=PeliasGeocoderService,exports.PerInstanceColorAppearance=PerInstanceColorAppearance,exports.PerformanceDisplay=PerformanceDisplay,exports.PerformanceWatchdog=PerformanceWatchdog,exports.PerformanceWatchdogViewModel=PerformanceWatchdogViewModel,exports.PerspectiveFrustum=PerspectiveFrustum,exports.PerspectiveOffCenterFrustum=PerspectiveOffCenterFrustum,exports.PickDepth=PickDepth,exports.PickDepthFramebuffer=PickDepthFramebuffer,exports.PickFramebuffer=PickFramebuffer,exports.Picking=Picking,exports.PinBuilder=PinBuilder,exports.PixelDatatype=PixelDatatype$1,exports.PixelFormat=PixelFormat$1,exports.Plane=Plane,exports.PlaneGeometry=PlaneGeometry,exports.PlaneGeometryUpdater=PlaneGeometryUpdater,exports.PlaneGraphics=PlaneGraphics,exports.PlaneOutlineGeometry=PlaneOutlineGeometry,exports.PointCloud=PointCloud,exports.PointCloud3DTileContent=PointCloud3DTileContent,exports.PointCloudEyeDomeLighting=PointCloudEyeDomeLighting,exports.PointCloudShading=PointCloudShading,exports.PointGraphics=PointGraphics,exports.PointPrimitive=PointPrimitive,exports.PointPrimitiveCollection=PointPrimitiveCollection,exports.PointVisualizer=PointVisualizer,exports.PolygonGeometry=PolygonGeometry,exports.PolygonGeometryLibrary=PolygonGeometryLibrary,exports.PolygonGeometryUpdater=PolygonGeometryUpdater,exports.PolygonGraphics=PolygonGraphics,exports.PolygonHierarchy=PolygonHierarchy,exports.PolygonOutlineGeometry=PolygonOutlineGeometry,exports.PolygonPipeline=PolygonPipeline,exports.Polyline=Polyline,exports.PolylineArrowMaterialProperty=PolylineArrowMaterialProperty,exports.PolylineCollection=PolylineCollection,exports.PolylineColorAppearance=PolylineColorAppearance,exports.PolylineDashMaterialProperty=PolylineDashMaterialProperty,exports.PolylineGeometry=PolylineGeometry,exports.PolylineGeometryUpdater=PolylineGeometryUpdater,exports.PolylineGlowMaterialProperty=PolylineGlowMaterialProperty,exports.PolylineGraphics=PolylineGraphics,exports.PolylineMaterialAppearance=PolylineMaterialAppearance,exports.PolylineOutlineMaterialProperty=PolylineOutlineMaterialProperty,exports.PolylinePipeline=PolylinePipeline,exports.PolylineVisualizer=PolylineVisualizer,exports.PolylineVolumeGeometry=PolylineVolumeGeometry,exports.PolylineVolumeGeometryLibrary=PolylineVolumeGeometryLibrary,exports.PolylineVolumeGeometryUpdater=PolylineVolumeGeometryUpdater,exports.PolylineVolumeGraphics=PolylineVolumeGraphics,exports.PolylineVolumeOutlineGeometry=PolylineVolumeOutlineGeometry,exports.PositionProperty=PositionProperty,exports.PositionPropertyArray=PositionPropertyArray,exports.PostProcessStage=PostProcessStage,exports.PostProcessStageCollection=PostProcessStageCollection,exports.PostProcessStageComposite=PostProcessStageComposite,exports.PostProcessStageLibrary=PostProcessStageLibrary,exports.PostProcessStageSampleMode=PostProcessStageSampleMode,exports.PostProcessStageTextureCache=PostProcessStageTextureCache,exports.Primitive=Primitive,exports.PrimitiveCollection=PrimitiveCollection,exports.PrimitivePipeline=PrimitivePipeline,exports.PrimitiveState=PrimitiveState$1,exports.PrimitiveType=PrimitiveType$1,exports.ProjectionPicker=ProjectionPicker,exports.ProjectionPickerViewModel=ProjectionPickerViewModel,exports.Property=Property,exports.PropertyArray=PropertyArray,exports.PropertyBag=PropertyBag,exports.ProviderViewModel=ProviderViewModel,exports.Proxy=Proxy,exports.QuadraticRealPolynomial=QuadraticRealPolynomial,exports.QuadtreeOccluders=QuadtreeOccluders,exports.QuadtreePrimitive=QuadtreePrimitive,exports.QuadtreeTile=QuadtreeTile,exports.QuadtreeTileLoadState=QuadtreeTileLoadState$1,exports.QuadtreeTileProvider=QuadtreeTileProvider,exports.QuantizedMeshTerrainData=QuantizedMeshTerrainData,exports.QuarticRealPolynomial=QuarticRealPolynomial,exports.Quaternion=Quaternion,exports.QuaternionSpline=QuaternionSpline,exports.Queue=Queue,exports.Ray=Ray,exports.Rectangle=Rectangle,exports.RectangleCollisionChecker=RectangleCollisionChecker,exports.RectangleGeometry=RectangleGeometry,exports.RectangleGeometryLibrary=RectangleGeometryLibrary,exports.RectangleGeometryUpdater=RectangleGeometryUpdater,exports.RectangleGraphics=RectangleGraphics,exports.RectangleOutlineGeometry=RectangleOutlineGeometry,exports.ReferenceFrame=ReferenceFrame$1,exports.ReferenceProperty=ReferenceProperty,exports.RenderState=RenderState,exports.Renderbuffer=Renderbuffer,exports.RenderbufferFormat=RenderbufferFormat$1,exports.Request=Request,exports.RequestErrorEvent=RequestErrorEvent,exports.RequestScheduler=RequestScheduler,exports.RequestState=RequestState$1,exports.RequestType=RequestType$1,exports.Resource=Resource,exports.Rotation=Rotation,exports.RuntimeError=RuntimeError,exports.SDFSettings=SDFSettings$1,exports.SampledPositionProperty=SampledPositionProperty,exports.SampledProperty=SampledProperty,exports.Sampler=Sampler,exports.ScaledPositionProperty=ScaledPositionProperty,exports.Scene=Scene,exports.SceneFramebuffer=SceneFramebuffer,exports.SceneMode=SceneMode$1,exports.SceneModePicker=SceneModePicker,exports.SceneModePickerViewModel=SceneModePickerViewModel,exports.SceneTransforms=SceneTransforms,exports.SceneTransitioner=SceneTransitioner,exports.ScreenSpaceCameraController=ScreenSpaceCameraController,exports.ScreenSpaceEventHandler=ScreenSpaceEventHandler,exports.ScreenSpaceEventType=ScreenSpaceEventType$1,exports.SelectionIndicator=SelectionIndicator,exports.SelectionIndicatorViewModel=SelectionIndicatorViewModel,exports.ShaderCache=ShaderCache,exports.ShaderProgram=ShaderProgram,exports.ShaderSource=ShaderSource,exports.ShadowMap=ShadowMap,exports.ShadowMapShader=ShadowMapShader,exports.ShadowMode=ShadowMode$1,exports.ShadowVolumeAppearance=ShadowVolumeAppearance,exports.ShowGeometryInstanceAttribute=ShowGeometryInstanceAttribute,exports.Simon1994PlanetaryPositions=Simon1994PlanetaryPositions,exports.SimplePolylineGeometry=SimplePolylineGeometry,exports.SingleTileImageryProvider=SingleTileImageryProvider,exports.SkyAtmosphere=SkyAtmosphere,exports.SkyBox=SkyBox,exports.SphereEmitter=SphereEmitter,exports.SphereGeometry=SphereGeometry,exports.SphereOutlineGeometry=SphereOutlineGeometry,exports.Spherical=Spherical,exports.Spline=Spline,exports.StaticGeometryColorBatch=StaticGeometryColorBatch,exports.StaticGeometryPerMaterialBatch=StaticGeometryPerMaterialBatch,exports.StaticGroundGeometryColorBatch=StaticGroundGeometryColorBatch,exports.StaticGroundGeometryPerMaterialBatch=StaticGroundGeometryPerMaterialBatch,exports.StaticGroundPolylinePerMaterialBatch=StaticGroundPolylinePerMaterialBatch,exports.StaticOutlineGeometryBatch=StaticOutlineGeometryBatch,exports.StencilConstants=StencilConstants$1,exports.StencilFunction=StencilFunction$1,exports.StencilOperation=StencilOperation$1,exports.StripeMaterialProperty=StripeMaterialProperty,exports.StripeOrientation=StripeOrientation$1,exports.StyleExpression=StyleExpression,exports.Sun=Sun,exports.SunLight=SunLight,exports.SunPostProcess=SunPostProcess,exports.SvgPathBindingHandler=SvgPathBindingHandler,exports.TaskProcessor=TaskProcessor,exports.TerrainData=TerrainData,exports.TerrainEncoding=TerrainEncoding,exports.TerrainFillMesh=TerrainFillMesh,exports.TerrainMesh=TerrainMesh,exports.TerrainOffsetProperty=TerrainOffsetProperty,exports.TerrainProvider=TerrainProvider,exports.TerrainQuantization=TerrainQuantization$1,exports.TerrainState=TerrainState$2,exports.Texture=Texture,exports.TextureAtlas=TextureAtlas,exports.TextureCache=TextureCache,exports.TextureMagnificationFilter=TextureMagnificationFilter$1,exports.TextureMinificationFilter=TextureMinificationFilter$1,exports.TextureWrap=TextureWrap$1,exports.TileAvailability=TileAvailability,exports.TileBoundingRegion=TileBoundingRegion,exports.TileBoundingSphere=TileBoundingSphere,exports.TileBoundingVolume=TileBoundingVolume,exports.TileCoordinatesImageryProvider=TileCoordinatesImageryProvider,exports.TileDiscardPolicy=TileDiscardPolicy,exports.TileEdge=TileEdge,exports.TileImagery=TileImagery,exports.TileMapServiceImageryProvider=TileMapServiceImageryProvider,exports.TileOrientedBoundingBox=TileOrientedBoundingBox,exports.TileProviderError=TileProviderError,exports.TileReplacementQueue=TileReplacementQueue,exports.TileSelectionResult=TileSelectionResult,exports.TileState=TileState$1,exports.Tileset3DTileContent=Tileset3DTileContent,exports.TilingScheme=TilingScheme,exports.TimeConstants=TimeConstants$1,exports.TimeDynamicImagery=TimeDynamicImagery,exports.TimeDynamicPointCloud=TimeDynamicPointCloud,exports.TimeInterval=TimeInterval,exports.TimeIntervalCollection=TimeIntervalCollection,exports.TimeIntervalCollectionPositionProperty=TimeIntervalCollectionPositionProperty,exports.TimeIntervalCollectionProperty=TimeIntervalCollectionProperty,exports.TimeStandard=TimeStandard$1,exports.Timeline=Timeline,exports.TimelineHighlightRange=TimelineHighlightRange,exports.TimelineTrack=TimelineTrack,exports.Tipsify=Tipsify,exports.ToggleButtonViewModel=ToggleButtonViewModel,exports.Tonemapper=Tonemapper$1,exports.Transforms=Transforms,exports.TranslationRotationScale=TranslationRotationScale,exports.TridiagonalSystemSolver=TridiagonalSystemSolver,exports.TrustedServers=TrustedServers,exports.Tween=TWEEN,exports.TweenCollection=TweenCollection,exports.UniformState=UniformState,exports.Uri=URI,exports.UrlTemplateImageryProvider=UrlTemplateImageryProvider,exports.VERSION=VERSION,exports.VRButton=VRButton,exports.VRButtonViewModel=VRButtonViewModel,exports.VRTheWorldTerrainProvider=VRTheWorldTerrainProvider,exports.Vector3DTileBatch=Vector3DTileBatch,exports.Vector3DTileContent=Vector3DTileContent,exports.Vector3DTileGeometry=Vector3DTileGeometry,exports.Vector3DTilePoints=Vector3DTilePoints,exports.Vector3DTilePolygons=Vector3DTilePolygons,exports.Vector3DTilePolylines=Vector3DTilePolylines,exports.Vector3DTilePrimitive=Vector3DTilePrimitive,exports.VelocityOrientationProperty=VelocityOrientationProperty,exports.VelocityVectorProperty=VelocityVectorProperty,exports.VertexArray=VertexArray,exports.VertexArrayFacade=VertexArrayFacade,exports.VertexFormat=VertexFormat,exports.VerticalOrigin=VerticalOrigin$1,exports.VideoSynchronizer=VideoSynchronizer,exports.View=View,exports.Viewer=Viewer,exports.ViewportQuad=ViewportQuad,exports.Visibility=Visibility$1,exports.Visualizer=Visualizer,exports.WallGeometry=WallGeometry,exports.WallGeometryLibrary=WallGeometryLibrary,exports.WallGeometryUpdater=WallGeometryUpdater,exports.WallGraphics=WallGraphics,exports.WallOutlineGeometry=WallOutlineGeometry,exports.WebGLConstants=WebGLConstants$1,exports.WebMapServiceImageryProvider=WebMapServiceImageryProvider,exports.WebMapTileServiceImageryProvider=WebMapTileServiceImageryProvider,exports.WebMercatorProjection=WebMercatorProjection,exports.WebMercatorTilingScheme=WebMercatorTilingScheme,exports.WeightSpline=WeightSpline,exports.WindingOrder=WindingOrder$1,exports._shadersAcesTonemappingStage=AcesTonemapping,exports._shadersAdditiveBlend=AdditiveBlend,exports._shadersAdjustTranslucentFS=AdjustTranslucentFS,exports._shadersAllMaterialAppearanceFS=AllMaterialAppearanceFS,exports._shadersAllMaterialAppearanceVS=AllMaterialAppearanceVS,exports._shadersAmbientOcclusionGenerate=AmbientOcclusionGenerate,exports._shadersAmbientOcclusionModulate=AmbientOcclusionModulate,exports._shadersAspectRampMaterial=AspectRampMaterial,exports._shadersBasicMaterialAppearanceFS=BasicMaterialAppearanceFS,exports._shadersBasicMaterialAppearanceVS=BasicMaterialAppearanceVS,exports._shadersBillboardCollectionFS=BillboardCollectionFS,exports._shadersBillboardCollectionVS=BillboardCollectionVS,exports._shadersBlackAndWhite=BlackAndWhite,exports._shadersBloomComposite=BloomComposite,exports._shadersBrdfLutGeneratorFS=BrdfLutGeneratorFS,exports._shadersBrightPass=BrightPass,exports._shadersBrightness=Brightness,exports._shadersBumpMapMaterial=BumpMapMaterial,exports._shadersCheckerboardMaterial=CheckerboardMaterial,exports._shadersCompositeOITFS=CompositeOITFS,exports._shadersContrastBias=ContrastBias,exports._shadersCzmBuiltins=CzmBuiltins,exports._shadersDepthOfField=DepthOfField,exports._shadersDepthPlaneFS=DepthPlaneFS,exports._shadersDepthPlaneVS=DepthPlaneVS,exports._shadersDepthView=DepthView,exports._shadersDepthViewPacked=DepthViewPacked,exports._shadersDotMaterial=DotMaterial,exports._shadersEdgeDetection=EdgeDetection,exports._shadersElevationContourMaterial=ElevationContourMaterial,exports._shadersElevationRampMaterial=ElevationRampMaterial,exports._shadersEllipsoidFS=EllipsoidFS,exports._shadersEllipsoidSurfaceAppearanceFS=EllipsoidSurfaceAppearanceFS,exports._shadersEllipsoidSurfaceAppearanceVS=EllipsoidSurfaceAppearanceVS,exports._shadersEllipsoidVS=EllipsoidVS,exports._shadersFXAA=FXAA,exports._shadersFadeMaterial=FadeMaterial,exports._shadersFilmicTonemapping=FilmicTonemapping,exports._shadersGaussianBlur1D=GaussianBlur1D,exports._shadersGlobeFS=GlobeFS,exports._shadersGlobeVS=GlobeVS,exports._shadersGridMaterial=GridMaterial,exports._shadersGroundAtmosphere=GroundAtmosphere,exports._shadersHSBToRGB=czm_HSBToRGB,exports._shadersHSLToRGB=czm_HSLToRGB,exports._shadersLensFlare=LensFlare,exports._shadersModifiedReinhardTonemapping=ModifiedReinhardTonemapping,exports._shadersNightVision=NightVision,exports._shadersNormalMapMaterial=NormalMapMaterial,exports._shadersOctahedralProjectionAtlasFS=OctahedralProjectionAtlasFS,exports._shadersOctahedralProjectionFS=OctahedralProjectionFS,exports._shadersOctahedralProjectionVS=OctahedralProjectionVS,exports._shadersPassThrough=PassThrough,exports._shadersPassThroughDepth=PassThroughDepth,exports._shadersPerInstanceColorAppearanceFS=PerInstanceColorAppearanceFS,exports._shadersPerInstanceColorAppearanceVS=PerInstanceColorAppearanceVS,exports._shadersPerInstanceFlatColorAppearanceFS=PerInstanceFlatColorAppearanceFS,exports._shadersPerInstanceFlatColorAppearanceVS=PerInstanceFlatColorAppearanceVS,exports._shadersPointCloudEyeDomeLighting=PointCloudEyeDomeLightingShader,exports._shadersPointPrimitiveCollectionFS=PointPrimitiveCollectionFS,exports._shadersPointPrimitiveCollectionVS=PointPrimitiveCollectionVS,exports._shadersPolylineArrowMaterial=PolylineArrowMaterial,exports._shadersPolylineColorAppearanceVS=PolylineColorAppearanceVS,exports._shadersPolylineCommon=PolylineCommon,exports._shadersPolylineDashMaterial=PolylineDashMaterial,exports._shadersPolylineFS=PolylineFS,exports._shadersPolylineGlowMaterial=PolylineGlowMaterial,exports._shadersPolylineMaterialAppearanceVS=PolylineMaterialAppearanceVS,exports._shadersPolylineOutlineMaterial=PolylineOutlineMaterial,exports._shadersPolylineShadowVolumeFS=PolylineShadowVolumeFS,exports._shadersPolylineShadowVolumeMorphFS=PolylineShadowVolumeMorphFS,exports._shadersPolylineShadowVolumeMorphVS=PolylineShadowVolumeMorphVS,exports._shadersPolylineShadowVolumeVS=PolylineShadowVolumeVS,exports._shadersPolylineVS=PolylineVS,exports._shadersRGBToHSB=czm_RGBToHSB,exports._shadersRGBToHSL=czm_RGBToHSL,exports._shadersRGBToXYZ=czm_RGBToXYZ,exports._shadersReinhardTonemapping=ReinhardTonemapping,exports._shadersReprojectWebMercatorFS=ReprojectWebMercatorFS,exports._shadersReprojectWebMercatorVS=ReprojectWebMercatorVS,exports._shadersRimLightingMaterial=RimLightingMaterial,exports._shadersShadowVolumeAppearanceFS=ShadowVolumeAppearanceFS,exports._shadersShadowVolumeAppearanceVS=ShadowVolumeAppearanceVS,exports._shadersShadowVolumeFS=ShadowVolumeFS,exports._shadersSilhouette=Silhouette,exports._shadersSkyAtmosphereCommon=SkyAtmosphereCommon,exports._shadersSkyAtmosphereFS=SkyAtmosphereFS,exports._shadersSkyAtmosphereVS=SkyAtmosphereVS,exports._shadersSkyBoxFS=SkyBoxFS,exports._shadersSkyBoxVS=SkyBoxVS,exports._shadersSlopeRampMaterial=SlopeRampMaterial,exports._shadersStripeMaterial=StripeMaterial,exports._shadersSunFS=SunFS,exports._shadersSunTextureFS=SunTextureFS,exports._shadersSunVS=SunVS,exports._shadersTexturedMaterialAppearanceFS=TexturedMaterialAppearanceFS,exports._shadersTexturedMaterialAppearanceVS=TexturedMaterialAppearanceVS,exports._shadersVector3DTilePolylinesVS=Vector3DTilePolylinesVS,exports._shadersVectorTileVS=VectorTileVS,exports._shadersViewportQuadFS=ViewportQuadFS,exports._shadersViewportQuadVS=ViewportQuadVS,exports._shadersWater=WaterMaterial,exports._shadersXYZToRGB=czm_XYZToRGB,exports._shadersacesTonemapping=czm_acesTonemapping,exports._shadersalphaWeight=czm_alphaWeight,exports._shadersantialias=czm_antialias,exports._shadersapproximateSphericalCoordinates=czm_approximateSphericalCoordinates,exports._shadersbackFacing=czm_backFacing,exports._shadersbranchFreeTernary=czm_branchFreeTernary,exports._shaderscascadeColor=czm_cascadeColor,exports._shaderscascadeDistance=czm_cascadeDistance,exports._shaderscascadeMatrix=czm_cascadeMatrix,exports._shaderscascadeWeights=czm_cascadeWeights,exports._shaderscolumbusViewMorph=czm_columbusViewMorph,exports._shaderscomputePosition=czm_computePosition,exports._shaderscosineAndSine=czm_cosineAndSine,exports._shadersdecompressTextureCoordinates=czm_decompressTextureCoordinates,exports._shadersdegreesPerRadian=czm_degreesPerRadian,exports._shadersdepthClamp=czm_depthClamp,exports._shadersdepthRange=czm_depthRange,exports._shadersdepthRangeStruct=czm_depthRangeStruct,exports._shaderseastNorthUpToEyeCoordinates=czm_eastNorthUpToEyeCoordinates,exports._shadersellipsoidContainsPoint=czm_ellipsoidContainsPoint,exports._shadersellipsoidWgs84TextureCoordinates=czm_ellipsoidWgs84TextureCoordinates,exports._shadersepsilon1=czm_epsilon1,exports._shadersepsilon2=czm_epsilon2,exports._shadersepsilon3=czm_epsilon3,exports._shadersepsilon4=czm_epsilon4,exports._shadersepsilon5=czm_epsilon5,exports._shadersepsilon6=czm_epsilon6,exports._shadersepsilon7=czm_epsilon7,exports._shadersequalsEpsilon=czm_equalsEpsilon,exports._shaderseyeOffset=czm_eyeOffset,exports._shaderseyeToWindowCoordinates=czm_eyeToWindowCoordinates,exports._shadersfastApproximateAtan=czm_fastApproximateAtan,exports._shadersfog=czm_fog,exports._shadersgammaCorrect=czm_gammaCorrect,exports._shadersgeodeticSurfaceNormal=czm_geodeticSurfaceNormal,exports._shadersgetDefaultMaterial=czm_getDefaultMaterial,exports._shadersgetLambertDiffuse=czm_getLambertDiffuse,exports._shadersgetSpecular=czm_getSpecular,exports._shadersgetWaterNoise=czm_getWaterNoise,exports._shadershue=czm_hue,exports._shadersinfinity=czm_infinity,exports._shadersinverseGamma=czm_inverseGamma,exports._shadersisEmpty=czm_isEmpty,exports._shadersisFull=czm_isFull,exports._shaderslatitudeToWebMercatorFraction=czm_latitudeToWebMercatorFraction,exports._shaderslineDistance=czm_lineDistance,exports._shadersluminance=czm_luminance,exports._shadersmaterial=czm_material,exports._shadersmaterialInput=czm_materialInput,exports._shadersmetersPerPixel=czm_metersPerPixel,exports._shadersmodelToWindowCoordinates=czm_modelToWindowCoordinates,exports._shadersmultiplyWithColorBalance=czm_multiplyWithColorBalance,exports._shadersnearFarScalar=czm_nearFarScalar,exports._shadersoctDecode=czm_octDecode,exports._shadersoneOverPi=czm_oneOverPi,exports._shadersoneOverTwoPi=czm_oneOverTwoPi,exports._shaderspackDepth=czm_packDepth,exports._shaderspassCesium3DTile=czm_passCesium3DTile,exports._shaderspassCesium3DTileClassification=czm_passCesium3DTileClassification,exports._shaderspassCesium3DTileClassificationIgnoreShow=czm_passCesium3DTileClassificationIgnoreShow,exports._shaderspassClassification=czm_passClassification,exports._shaderspassCompute=czm_passCompute,exports._shaderspassEnvironment=czm_passEnvironment,exports._shaderspassGlobe=czm_passGlobe,exports._shaderspassOpaque=czm_passOpaque,exports._shaderspassOverlay=czm_passOverlay,exports._shaderspassTerrainClassification=czm_passTerrainClassification,exports._shaderspassTranslucent=czm_passTranslucent,exports._shadersphong=czm_phong,exports._shaderspi=czm_pi,exports._shaderspiOverFour=czm_piOverFour,exports._shaderspiOverSix=czm_piOverSix,exports._shaderspiOverThree=czm_piOverThree,exports._shaderspiOverTwo=czm_piOverTwo,exports._shadersplaneDistance=czm_planeDistance,exports._shaderspointAlongRay=czm_pointAlongRay,exports._shadersradiansPerDegree=czm_radiansPerDegree,exports._shadersray=czm_ray,exports._shadersrayEllipsoidIntersectionInterval=czm_rayEllipsoidIntersectionInterval,exports._shadersraySegment=czm_raySegment,exports._shadersreadDepth=czm_readDepth,exports._shadersreadNonPerspective=czm_readNonPerspective,exports._shadersreverseLogDepth=czm_reverseLogDepth,exports._shaderssampleOctahedralProjection=czm_sampleOctahedralProjection,exports._shaderssaturation=czm_saturation;exports._shaderssceneMode2D=czm_sceneMode2D,exports._shaderssceneMode3D=czm_sceneMode3D,exports._shaderssceneModeColumbusView=czm_sceneModeColumbusView,exports._shaderssceneModeMorphing=czm_sceneModeMorphing,exports._shadersshadowDepthCompare=czm_shadowDepthCompare,exports._shadersshadowParameters=czm_shadowParameters,exports._shadersshadowVisibility=czm_shadowVisibility,exports._shaderssignNotZero=czm_signNotZero,exports._shaderssolarRadius=czm_solarRadius,exports._shaderssphericalHarmonics=czm_sphericalHarmonics,exports._shaderstangentToEyeSpaceMatrix=czm_tangentToEyeSpaceMatrix,exports._shadersthreePiOver2=czm_threePiOver2,exports._shaderstransformPlane=czm_transformPlane,exports._shaderstranslateRelativeToEye=czm_translateRelativeToEye,exports._shaderstranslucentPhong=czm_translucentPhong,exports._shaderstranspose=czm_transpose,exports._shaderstwoPi=czm_twoPi,exports._shadersunpackDepth=czm_unpackDepth,exports._shadersunpackFloat=czm_unpackFloat,exports._shadersvertexLogDepth=czm_vertexLogDepth,exports._shaderswebMercatorMaxLatitude=czm_webMercatorMaxLatitude,exports._shaderswindowToEyeCoordinates=czm_windowToEyeCoordinates,exports._shaderswriteDepthClamp=czm_writeDepthClamp,exports._shaderswriteLogDepth=czm_writeLogDepth,exports._shaderswriteNonPerspective=czm_writeNonPerspective,exports.addBuffer=addBuffer,exports.addDefaults=addDefaults,exports.addExtensionsRequired=addExtensionsRequired,exports.addExtensionsUsed=addExtensionsUsed,exports.addPipelineExtras=addPipelineExtras,exports.addToArray=addToArray,exports.appendForwardSlash=appendForwardSlash,exports.arrayFill=arrayFill,exports.arrayRemoveDuplicates=arrayRemoveDuplicates,exports.arraySlice=arraySlice,exports.barycentricCoordinates=barycentricCoordinates,exports.binarySearch=binarySearch,exports.bitmap_sdf=calcSDF,exports.buildModuleUrl=buildModuleUrl,exports.cancelAnimationFrame=cancelAnimationFramePolyfill,exports.clone=clone,exports.combine=combine,exports.computeFlyToLocationForRectangle=computeFlyToLocationForRectangle,exports.createBillboardPointCallback=createBillboardPointCallback,exports.createCommand=createCommand$2,exports.createDefaultImageryProviderViewModels=createDefaultImageryProviderViewModels,exports.createDefaultTerrainProviderViewModels=createDefaultTerrainProviderViewModels,exports.createGuid=createGuid,exports.createMaterialPropertyDescriptor=createMaterialPropertyDescriptor,exports.createOsmBuildings=createOsmBuildings,exports.createPropertyDescriptor=createPropertyDescriptor,exports.createRawPropertyDescriptor=createRawPropertyDescriptor,exports.createTangentSpaceDebugPrimitive=createTangentSpaceDebugPrimitive,exports.createTaskProcessorWorker=createTaskProcessorWorker,exports.createUniform=createUniform$1,exports.createUniformArray=createUniformArray,exports.createWorldImagery=createWorldImagery,exports.createWorldTerrain=createWorldTerrain,exports.decodeGoogleEarthEnterpriseData=decodeGoogleEarthEnterpriseData,exports.defaultValue=defaultValue,exports.defined=defined,exports.deprecationWarning=deprecationWarning,exports.destroyObject=destroyObject,exports.earcut_2_2_1=earcut,exports.exportKml=exportKml,exports.findAccessorMinMax=findAccessorMinMax,exports.formatError=formatError,exports.freezeRenderState=freezeRenderState,exports.getAbsoluteUri=getAbsoluteUri,exports.getAccessorByteStride=getAccessorByteStride,exports.getBaseUri=getBaseUri,exports.getBinaryAccessor=getBinaryAccessor,exports.getClipAndStyleCode=getClipAndStyleCode,exports.getClippingFunction=getClippingFunction,exports.getComponentReader=getComponentReader,exports.getElement=getElement,exports.getExtensionFromUri=getExtensionFromUri,exports.getFilenameFromUri=getFilenameFromUri,exports.getImagePixels=getImagePixels,exports.getMagic=getMagic,exports.getStringFromTypedArray=getStringFromTypedArray,exports.getTimestamp=getTimestamp$1,exports.graphemesplitter=GraphemeSplitter,exports.hasExtension=hasExtension,exports.heightReferenceOnEntityPropertyChanged=heightReferenceOnEntityPropertyChanged,exports.isBitSet=isBitSet,exports.isBlobUri=isBlobUri,exports.isCrossOriginUrl=isCrossOriginUrl,exports.isDataUri=isDataUri,exports.isLeapYear=isLeapYear,exports.jsep=jsep,exports.kdbush=kdbush,exports.knockout=knockout,exports.knockout_3_5_1=knockout,exports.knockout_es5=knockout_es5,exports.loadAndExecuteScript=loadAndExecuteScript,exports.loadCRN=loadCRN,exports.loadCubeMap=loadCubeMap,exports.loadImageFromTypedArray=loadImageFromTypedArray,exports.loadKTX=loadKTX,exports.measureText=measureText,exports.mergeSort=mergeSort,exports.mersenne_twister=MersenneTwister,exports.modernizeShader=modernizeShader,exports.moveTechniqueRenderStates=moveTechniqueRenderStates,exports.moveTechniquesToExtension=moveTechniquesToExtension,exports.numberOfComponentsForType=numberOfComponentsForType,exports.objectToQuery=objectToQuery,exports.oneTimeWarning=oneTimeWarning,exports.parseGlb=parseGlb,exports.parseResponseHeaders=parseResponseHeaders,exports.pointInsideTriangle=pointInsideTriangle,exports.processModelMaterialsCommon=processModelMaterialsCommon,exports.processPbrMaterials=processPbrMaterials,exports.protobuf_minimal=protobuf,exports.purify=purify,exports.queryToObject=queryToObject,exports.quickselect=quickselect$1,exports.rbush=RBush,exports.readAccessorPacked=readAccessorPacked,exports.removeExtensionsRequired=removeExtensionsRequired,exports.removeExtensionsUsed=removeExtensionsUsed,exports.removePipelineExtras=removePipelineExtras,exports.removeUnusedElements=removeUnusedElements,exports.requestAnimationFrame=requestAnimationFramePolyFill,exports.sampleTerrain=sampleTerrain,exports.sampleTerrainMostDetailed=sampleTerrainMostDetailed,exports.scaleToGeodeticSurface=scaleToGeodeticSurface,exports.sprintf=sprintf,exports.subdivideArray=subdivideArray,exports.subscribeAndEvaluate=subscribeAndEvaluate,exports.topojson=topojson,exports.updateAccessorComponentTypes=updateAccessorComponentTypes,exports.updateVersion=updateVersion,exports.viewerCesium3DTilesInspectorMixin=viewerCesium3DTilesInspectorMixin,exports.viewerCesiumInspectorMixin=viewerCesiumInspectorMixin,exports.viewerDragDropMixin=viewerDragDropMixin,exports.viewerPerformanceWatchdogMixin=viewerPerformanceWatchdogMixin,exports.webGLConstantToGlslType=webGLConstantToGlslType,exports.when=when,exports.wrapFunction=wrapFunction,exports.writeTextToCanvas=writeTextToCanvas,exports.zip=zip,Object.defineProperty(exports,"__esModule",{value:!0})}); diff --git a/cesium/widgets.css b/cesium/widgets.css deleted file mode 100644 index 84e783e..0000000 --- a/cesium/widgets.css +++ /dev/null @@ -1 +0,0 @@ -.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:0}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff}.cesium-button-disabled,.cesium-button-disabled:active,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button:disabled{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default}.cesium-button option{background-color:#000;color:#eee}.cesium-button option:disabled{color:#777}.cesium-button input,.cesium-button label{cursor:pointer}.cesium-button input{vertical-align:sub}.cesium-toolbar-button{box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right}.cesium-performanceDisplay{background-color:rgba(40,40,40,.7);padding:7px;border-radius:5px;border:1px solid #444;font:bold 12px sans-serif}.cesium-performanceDisplay-fps{color:#e52}.cesium-performanceDisplay-throttled{color:#a42}.cesium-performanceDisplay-ms{color:#de3}.cesium-animation-theme{visibility:hidden;display:block;position:absolute;z-index:-100}.cesium-animation-themeNormal{color:#222}.cesium-animation-themeHover{color:#4488b0}.cesium-animation-themeSelect{color:#242}.cesium-animation-themeDisabled{color:#333}.cesium-animation-themeKnob{color:#222}.cesium-animation-themePointer{color:#2e2}.cesium-animation-themeSwoosh{color:#8ac}.cesium-animation-themeSwooshHover{color:#aef}.cesium-animation-svgText{fill:#edffff;font-family:Sans-Serif;font-size:15px;text-anchor:middle}.cesium-animation-blank{fill:#000;fill-opacity:.01;stroke:none}.cesium-animation-rectButton{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-animation-rectButton .cesium-animation-buttonGlow{fill:#fff;stroke:none;display:none}.cesium-animation-rectButton:hover .cesium-animation-buttonGlow{display:block}.cesium-animation-rectButton .cesium-animation-buttonPath{fill:#edffff}.cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#444;stroke-width:1.2}.cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#aef}.cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#abd6ff}.cesium-animation-buttonDisabled{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#555}.cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181}.cesium-animation-buttonDisabled .cesium-animation-buttonGlow{display:none}.cesium-animation-buttonToggled .cesium-animation-buttonGlow{display:block;fill:#2e2}.cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#2e2}.cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff}.cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#2e2}.cesium-animation-shuttleRingG{cursor:pointer}.cesium-animation-shuttleRingPointer{cursor:pointer}.cesium-animation-shuttleRingPausePointer{cursor:pointer}.cesium-animation-shuttleRingBack{fill:#181818;fill-opacity:.8;stroke:#333;stroke-width:1.2}.cesium-animation-shuttleRingSwoosh line{stroke:#8ac;stroke-width:3;stroke-opacity:.2;stroke-linecap:round}.cesium-animation-knobOuter{cursor:pointer;stroke:#444;stroke-width:1.2}.cesium-animation-knobInner{cursor:pointer}.cesium-baseLayerPicker-selected{position:absolute;top:0;left:0;width:100%;height:100%;border:none}.cesium-baseLayerPicker-dropDown{display:block;position:absolute;box-sizing:content-box;top:auto;right:0;width:320px;max-height:500px;margin-top:5px;background-color:rgba(38,38,38,.75);border:1px solid #444;padding:6px;overflow:auto;border-radius:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;transform:translate(0,-20%);visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in,transform .2s ease-in}.cesium-baseLayerPicker-dropDown-visible{transform:translate(0,0);visibility:visible;opacity:1;transition:opacity .2s ease-out,transform .2s ease-out}.cesium-baseLayerPicker-sectionTitle{display:block;font-family:sans-serif;font-size:16pt;text-align:left;color:#edffff;margin-bottom:4px}.cesium-baseLayerPicker-choices{margin-bottom:5px}.cesium-baseLayerPicker-categoryTitle{color:#edffff;font-size:11pt}.cesium-baseLayerPicker-choices{display:block;border:1px solid #888;border-radius:5px;padding:5px 0}.cesium-baseLayerPicker-item{display:inline-block;vertical-align:top;margin:2px 5px;width:64px;text-align:center;cursor:pointer}.cesium-baseLayerPicker-itemLabel{display:block;font-family:sans-serif;font-size:8pt;text-align:center;vertical-align:middle;color:#edffff;cursor:pointer;word-wrap:break-word}.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel,.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel{text-decoration:underline}.cesium-baseLayerPicker-itemIcon{display:inline-block;position:relative;width:inherit;height:auto;background-size:100% 100%;border:solid 1px #444;border-radius:9px;color:#edffff;margin:0;padding:0;cursor:pointer;box-sizing:border-box}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#fff;box-shadow:0 0 8px #fff,0 0 8px #fff}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:#bdecf8}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px #bdecf8}.cesium-widget{position:relative}.cesium-widget,.cesium-widget canvas{width:100%;height:100%;touch-action:none}.cesium-widget-credits{display:block;position:absolute;bottom:0;left:0;color:#fff;font-size:10px;text-shadow:0 0 2px #000;padding-right:5px}.cesium-widget-credits a,.cesium-widget-credits a:visited{color:#fff}.cesium-widget-errorPanel{position:absolute;top:0;right:0;bottom:0;left:0;text-align:center;background:rgba(0,0,0,.7);z-index:99999}.cesium-widget-errorPanel:before{display:inline-block;vertical-align:middle;height:100%;content:""}.cesium-widget-errorPanel-content{width:75%;max-width:500px;display:inline-block;text-align:left;vertical-align:middle;border:1px solid #510c00;border-radius:7px;background-color:#f0d9d5;font-size:14px;color:#510c00}.cesium-widget-errorPanel-content.expanded{max-width:75%}.cesium-widget-errorPanel-header{font-size:18px;font-family:"Open Sans",Verdana,Geneva,sans-serif;background:#d69d93;border-bottom:2px solid #510c00;padding-bottom:10px;border-radius:3px 3px 0 0;padding:15px}.cesium-widget-errorPanel-scroll{overflow:auto;font-family:"Open Sans",Verdana,Geneva,sans-serif;white-space:pre-wrap;padding:0 15px;margin:10px 0 20px 0}.cesium-widget-errorPanel-buttonPanel{padding:0 15px;margin:10px 0 20px 0;text-align:right}.cesium-widget-errorPanel-buttonPanel button{border-color:#510c00;background:#d69d93;color:#202020;margin:0}.cesium-widget-errorPanel-buttonPanel button:focus{border-color:#510c00;background:#f0d9d5;color:#510c00}.cesium-widget-errorPanel-buttonPanel button:hover{border-color:#510c00;background:#f0d9d5;color:#510c00}.cesium-widget-errorPanel-buttonPanel button:active{border-color:#510c00;background:#b17b72;color:#510c00}.cesium-widget-errorPanel-more-details{text-decoration:underline;cursor:pointer}.cesium-widget-errorPanel-more-details:hover{color:#2b0700}.cesium-cesiumInspector{border-radius:5px;transition:width ease-in-out .25s;background:rgba(48,51,54,.8);border:1px solid #444;color:#edffff;display:inline-block;position:relative;padding:4px 12px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden}.cesium-cesiumInspector-button{text-align:center;font-size:11pt}.cesium-cesiumInspector-visible .cesium-cesiumInspector-button{border-bottom:1px solid #aaa;padding-bottom:3px}.cesium-cesiumInspector input:enabled,.cesium-cesiumInspector-button{cursor:pointer}.cesium-cesiumInspector-visible{width:185px;height:auto}.cesium-cesiumInspector-hidden{width:122px;height:17px}.cesium-cesiumInspector-sectionContent{max-height:500px}.cesium-cesiumInspector-section-collapsed .cesium-cesiumInspector-sectionContent{max-height:0;padding:0!important;overflow:hidden}.cesium-cesiumInspector-dropDown{margin:5px 0;font-family:sans-serif;font-size:10pt;width:185px}.cesium-cesiumInspector-frustumStatistics{padding-left:10px;padding:5px;background-color:rgba(80,80,80,.75)}.cesium-cesiumInspector-pickButton{background-color:rgba(0,0,0,.3);border:1px solid #444;color:#edffff;border-radius:5px;padding:3px 7px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0 auto}.cesium-cesiumInspector-pickButton:focus{outline:0}.cesium-cesiumInspector-pickButton:active,.cesium-cesiumInspector-pickButtonHighlight{color:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff}.cesium-cesiumInspector-center{text-align:center}.cesium-cesiumInspector-sectionHeader{font-weight:700;font-size:10pt;margin:0;cursor:pointer}.cesium-cesiumInspector-pickSection{border:1px solid #aaa;border-radius:5px;padding:3px;margin-bottom:5px}.cesium-cesiumInspector-sectionContent{margin-bottom:10px;transition:max-height .25s}.cesium-cesiumInspector-tileText{padding-bottom:10px;border-bottom:1px solid #aaa}.cesium-cesiumInspector-relativeText{padding-top:10px}.cesium-cesiumInspector-sectionHeader::before{margin-right:5px;content:"-";width:1ch;display:inline-block}.cesium-cesiumInspector-section-collapsed .cesium-cesiumInspector-sectionHeader::before{content:"+"}ul.cesium-cesiumInspector-statistics{margin:0;padding-top:3px;padding-bottom:3px}ul.cesium-cesiumInspector-statistics+ul.cesium-cesiumInspector-statistics{border-top:1px solid #aaa}.cesium-cesiumInspector-slider{margin-top:5px}.cesium-cesiumInspector-slider input[type=number]{text-align:left;background-color:#222;outline:0;border:1px solid #444;color:#edffff;width:100px;border-radius:3px;padding:1px;margin-left:10px;cursor:auto}.cesium-cesiumInspector-slider input[type=number]::-webkit-inner-spin-button,.cesium-cesiumInspector-slider input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.cesium-cesiumInspector-slider input[type=range]{margin-left:5px;vertical-align:middle}.cesium-cesiumInspector-hide .cesium-cesiumInspector-styleEditor{display:none}.cesium-cesiumInspector-styleEditor{padding:10px;border-radius:5px;background:rgba(48,51,54,.8);border:1px solid #444}.cesium-cesiumInspector-styleEditor textarea{width:100%;height:300px;background:0 0;color:#edffff;border:none;padding:0;white-space:pre;overflow-wrap:normal;overflow-x:auto}.cesium-3DTilesInspector{width:300px;pointer-events:all}.cesium-3DTilesInspector-statistics{font-size:11px}.cesium-3DTilesInspector div,.cesium-3DTilesInspector input[type=range]{width:100%;box-sizing:border-box}.cesium-cesiumInspector-error{color:#ff9e9e;overflow:auto}.cesium-3DTilesInspector .cesium-cesiumInspector-section{margin-top:3px}.cesium-3DTilesInspector .cesium-cesiumInspector-sectionHeader+.cesium-cesiumInspector-show{border-top:1px solid #fff}input.cesium-cesiumInspector-url{overflow:hidden;white-space:nowrap;overflow-x:scroll;background-color:transparent;color:#fff;outline:0;border:none;height:1em;width:100%}.cesium-cesiumInspector .field-group{display:table}.cesium-cesiumInspector .field-group>label{display:table-cell;font-weight:700}.cesium-cesiumInspector .field-group>.field{display:table-cell;width:100%}.cesium-button.cesium-fullscreenButton{display:block;width:100%;height:100%;margin:0;border-radius:0}.cesium-button.cesium-vrButton{display:block;width:100%;height:100%;margin:0;border-radius:0}.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:rgba(40,40,40,.7);color:#fff;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;box-sizing:border-box;transition:width ease-in-out .25s,background-color .2s ease-in-out;-webkit-appearance:none}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:rgba(15,15,15,.9);box-shadow:none;outline:0}.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{padding-left:4px;width:250px}.cesium-viewer-geocoderContainer .search-results{position:absolute;background-color:#000;color:#eee;overflow-y:auto;opacity:.8;width:100%}.cesium-viewer-geocoderContainer .search-results ul{list-style-type:none;margin:0;padding:0}.cesium-viewer-geocoderContainer .search-results ul li{font-size:14px;padding:3px 10px}.cesium-viewer-geocoderContainer .search-results ul li:hover{cursor:pointer}.cesium-viewer-geocoderContainer .search-results ul li.active{background:#48b}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff}.cesium-geocoder-searchButton:hover{background-color:#48b}.cesium-infoBox{display:block;position:absolute;top:50px;right:0;width:40%;max-width:480px;background:rgba(38,38,38,.95);color:#edffff;border:1px solid #444;border-right:none;border-top-left-radius:7px;border-bottom-left-radius:7px;box-shadow:0 0 10px 1px #000;transform:translate(100%,0);visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in,transform .2s ease-in}.cesium-infoBox-visible{transform:translate(0,0);visibility:visible;opacity:1;transition:opacity .2s ease-out,transform .2s ease-out}.cesium-infoBox-title{display:block;height:20px;padding:5px 30px 5px 25px;background:#545454;border-top-left-radius:7px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:content-box}.cesium-infoBox-bodyless .cesium-infoBox-title{border-bottom-left-radius:7px}button.cesium-infoBox-camera{display:block;position:absolute;top:4px;left:4px;width:22px;height:22px;background:0 0;border-color:transparent;border-radius:3px;padding:0 5px;margin:0}button.cesium-infoBox-close{display:block;position:absolute;top:5px;right:5px;height:20px;background:0 0;border:none;border-radius:2px;font-weight:700;font-size:16px;padding:0 5px;margin:0;color:#edffff}button.cesium-infoBox-close:focus{background:rgba(238,136,0,.44);outline:0}button.cesium-infoBox-close:hover{background:#888;color:#000}button.cesium-infoBox-close:active{background:#a00;color:#000}.cesium-infoBox-bodyless .cesium-infoBox-iframe{display:none}.cesium-infoBox-iframe{border:none;width:100%;width:calc(100% - 2px)}span.cesium-sceneModePicker-wrapper{display:inline-block;position:relative;margin:0 3px}.cesium-sceneModePicker-visible{visibility:visible;opacity:1;transition:opacity .25s linear}.cesium-sceneModePicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s .25s,opacity .25s linear}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none{display:none}.cesium-sceneModePicker-slide-svg{transition:left 2s;top:0;left:0}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView{margin:0 0 3px 0}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-icon2D{left:100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-iconColumbusView{left:200%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon3D{left:-200%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon2D{left:-100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-icon3D{left:-100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-iconColumbusView{left:100%}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff}span.cesium-projectionPicker-wrapper{display:inline-block;position:relative;margin:0 3px}.cesium-projectionPicker-visible{visibility:visible;opacity:1;transition:opacity .25s linear}.cesium-projectionPicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s .25s,opacity .25s linear}.cesium-projectionPicker-wrapper .cesium-projectionPicker-none{display:none}.cesium-projectionPicker-wrapper .cesium-projectionPicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic,.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective{margin:0 0 3px 0}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective .cesium-projectionPicker-iconOrthographic{left:100%}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic .cesium-projectionPicker-iconPerspective{left:-100%}.cesium-projectionPicker-wrapper .cesium-projectionPicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff}.cesium-performance-watchdog-message-area{position:relative;background-color:#ff0;color:#000;padding:10px}.cesium-performance-watchdog-message{margin-right:30px}.cesium-performance-watchdog-message-dismiss{position:absolute;right:0;margin:0 10px 0 0}.cesium-navigationHelpButton-wrapper{position:relative;display:inline-block}.cesium-navigation-help{visibility:hidden;position:absolute;top:38px;right:2px;width:250px;border-radius:10px;transform:scale(.01);transform-origin:234px -10px;transition:visibility 0s .25s,transform .25s ease-in}.cesium-navigation-help-visible{visibility:visible;transform:scale(1);transition:transform .25s ease-out}.cesium-navigation-help-instructions{border:1px solid #444;background-color:rgba(38,38,38,.75);padding-bottom:5px;border-radius:0 0 10px 10px}.cesium-click-navigation-help{display:none}.cesium-touch-navigation-help{display:none;padding-top:5px}.cesium-click-navigation-help-visible{display:block}.cesium-touch-navigation-help-visible{display:block}.cesium-navigation-help-pan{color:#6cf;font-weight:700}.cesium-navigation-help-zoom{color:#65fd00;font-weight:700}.cesium-navigation-help-rotate{color:#ffd800;font-weight:700}.cesium-navigation-help-tilt{color:#d800d8;font-weight:700}.cesium-navigation-help-details{color:#fff}.cesium-navigation-button{color:#fff;background-color:transparent;border-bottom:none;border-top:1px solid #444;border-right:1px solid #444;margin:0;width:50%;cursor:pointer}.cesium-navigation-button-icon{vertical-align:middle;padding:5px 1px}.cesium-navigation-button:focus{outline:0}.cesium-navigation-button-left{border-radius:10px 0 0 0;border-left:1px solid #444}.cesium-navigation-button-right{border-radius:0 10px 0 0;border-left:none}.cesium-navigation-button-selected{background-color:rgba(38,38,38,.75)}.cesium-navigation-button-unselected{background-color:rgba(0,0,0,.75)}.cesium-navigation-button-unselected:hover{background-color:rgba(76,76,76,.75)}.cesium-selection-wrapper{position:absolute;width:160px;height:160px;pointer-events:none;visibility:hidden;opacity:0;transition:visibility 0s .2s,opacity .2s ease-in}.cesium-selection-wrapper-visible{visibility:visible;opacity:1;transition:opacity .2s ease-out}.cesium-selection-wrapper svg{fill:#2e2;stroke:#000;stroke-width:1.1px}.cesium-timeline-main{position:relative;left:0;bottom:0;overflow:hidden;border:solid 1px #888}.cesium-timeline-trackContainer{width:100%;overflow:auto;border-top:solid 1px #888;position:relative;top:0;left:0}.cesium-timeline-tracks{position:absolute;top:0;left:0;width:100%}.cesium-timeline-needle{position:absolute;left:0;top:1.7em;bottom:0;width:1px;background:red}.cesium-timeline-bar{position:relative;left:0;top:0;overflow:hidden;cursor:pointer;width:100%;height:1.7em;background:linear-gradient(to bottom,rgba(116,117,119,.8) 0,rgba(58,68,82,.8) 11%,rgba(46,50,56,.8) 46%,rgba(53,53,53,.8) 81%,rgba(53,53,53,.8) 100%)}.cesium-timeline-ruler{visibility:hidden;white-space:nowrap;font-size:80%;z-index:-200}.cesium-timeline-highlight{position:absolute;bottom:0;left:0;background:#08f}.cesium-timeline-ticLabel{position:absolute;top:0;left:0;white-space:nowrap;font-size:80%;color:#eee}.cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#eee}.cesium-timeline-ticSub{position:absolute;bottom:0;left:0;width:1px;height:33%;background:#aaa}.cesium-timeline-ticTiny{position:absolute;bottom:0;left:0;width:1px;height:25%;background:#888}.cesium-timeline-icon16{display:block;position:absolute;width:16px;height:16px;background-image:url(Images/TimelineIcons.png);background-repeat:no-repeat}.cesium-viewer{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0;width:100%;height:100%}.cesium-viewer-cesiumWidgetContainer{width:100%;height:100%}.cesium-viewer-bottom{display:block;position:absolute;bottom:0;left:0;right:0;padding-right:5px}.cesium-viewer .cesium-widget-credits{display:inline;position:static;bottom:auto;left:auto;padding-right:0;color:#fff;font-size:10px;text-shadow:0 0 2px #000}.cesium-viewer-timelineContainer{position:absolute;bottom:0;left:169px;right:29px;height:27px;padding:0;margin:0;overflow:hidden;font-size:14px}.cesium-viewer-animationContainer{position:absolute;bottom:0;left:0;padding:0;width:169px;height:112px}.cesium-viewer-fullscreenContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden}.cesium-viewer-vrContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden}.cesium-viewer-toolbar{display:block;position:absolute;top:5px;right:5px}.cesium-viewer-cesiumInspectorContainer{display:block;position:absolute;top:50px;right:10px}.cesium-viewer-geocoderContainer{position:relative;display:inline-block;margin:0 3px}.cesium-viewer-cesium3DTilesInspectorContainer{display:block;position:absolute;top:50px;right:10px;max-height:calc(100% - 120px);box-sizing:border-box;overflow-y:auto;overflow-x:hidden} \ No newline at end of file diff --git a/gnss-earth-multi.py b/galileo-earth.py similarity index 78% rename from gnss-earth-multi.py rename to galileo-earth.py index cf2bfce..b7c06be 100755 --- a/gnss-earth-multi.py +++ b/galileo-earth.py @@ -10,16 +10,8 @@ from datetime import datetime, timedelta from satellite_czml import satellite_czml from satellite_czml import satellite -# GNSS -url = 'https://celestrak.com/NORAD/elements/gnss.txt' -# GPS Operational -#url = 'https://celestrak.com/NORAD/elements/gps-ops.txt' # Galileo -#url = 'https://celestrak.com/NORAD/elements/galileo.txt' -# GLONASS Operational -#url = 'https://celestrak.com/NORAD/elements/glo-ops.txt' -# Beidou -#url = 'https://celestrak.com/NORAD/elements/beidou.txt' +url = 'https://celestrak.com/NORAD/elements/galileo.txt' apikey = open('cesium.key').read().strip() @@ -33,13 +25,12 @@ external_css = ['https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesiu external_scripts = [{'src':'https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js'}] app = dash.Dash(__name__, - title='Spacecruft GNSS Earth', + title='Spacecruft Galileo Earth', external_scripts=external_scripts, external_stylesheets=external_css) app.layout = html.Div(children=[ html.Div(id='cesiumContainer'), - #html.Div(id='czml', style={'display': 'none'}, children=single_czml), html.Div(id='czml', style={'display': 'none'}, children=multiple_czml), html.Div(id='apikey', style={'display': 'none'}, children=apikey), ]) @@ -74,5 +65,5 @@ function(id, czml, apikey) { ) if __name__ == '__main__': - app.run_server(debug=False, use_reloader=False) + app.run_server(debug=False, port=8052, use_reloader=False) diff --git a/glonass-earth.py b/glonass-earth.py new file mode 100755 index 0000000..429fbe4 --- /dev/null +++ b/glonass-earth.py @@ -0,0 +1,69 @@ +#!/usr/bin/python3 + +import random +import urllib.request +import dash +from dash import html +from dash import dcc +from dash.dependencies import Input, Output +from datetime import datetime, timedelta +from satellite_czml import satellite_czml +from satellite_czml import satellite + +# GLONASS +url = 'https://celestrak.com/NORAD/elements/glo-ops.txt' + +apikey = open('cesium.key').read().strip() + +tles = [l.decode("utf-8").strip() for l in urllib.request.urlopen(url).readlines()] +tle_list = [[tles[i],tles[i+1],tles[i+2]] for i,_ in enumerate(tles) if i%3==0] + +multiple_czml = satellite_czml(tle_list=tle_list).get_czml() + +# DASH +external_css = ['https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Widgets/widgets.css'] +external_scripts = [{'src':'https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js'}] + +app = dash.Dash(__name__, + title='Spacecruft GLONASS Earth', + external_scripts=external_scripts, + external_stylesheets=external_css) + +app.layout = html.Div(children=[ + html.Div(id='cesiumContainer'), + html.Div(id='czml', style={'display': 'none'}, children=multiple_czml), + html.Div(id='apikey', style={'display': 'none'}, children=apikey), +]) + +app.clientside_callback( + ''' +function(id, czml, apikey) { + // Create the Cesium Viewer + if (!window.viewer) { + Cesium.Ion.defaultAccessToken = apikey; + window.viewer = new Cesium.Viewer(id,{ + shouldAnimate: false, + }); + window.viewer.scene.globe.enableLighting = true; + } + + // Update the Cesium Viewer + if (czml) { + window.viewer.dataSources.removeAll(); + czmlJson = JSON.parse(czml); + window.viewer.dataSources.add( + Cesium.CzmlDataSource.load(czmlJson) + ); + } + return true; + } + ''', + Output('cesiumContainer', 'data-done'), + Input('cesiumContainer', 'id'), + Input('czml', 'children'), + Input('apikey', 'children') +) + +if __name__ == '__main__': + app.run_server(debug=False, port=8054, use_reloader=False) + diff --git a/gnss-earth.py b/gnss-earth.py index 90dda8e..cf2bfce 100755 --- a/gnss-earth.py +++ b/gnss-earth.py @@ -10,68 +10,25 @@ from datetime import datetime, timedelta from satellite_czml import satellite_czml from satellite_czml import satellite +# GNSS url = 'https://celestrak.com/NORAD/elements/gnss.txt' +# GPS Operational +#url = 'https://celestrak.com/NORAD/elements/gps-ops.txt' +# Galileo +#url = 'https://celestrak.com/NORAD/elements/galileo.txt' +# GLONASS Operational +#url = 'https://celestrak.com/NORAD/elements/glo-ops.txt' +# Beidou +#url = 'https://celestrak.com/NORAD/elements/beidou.txt' + apikey = open('cesium.key').read().strip() + tles = [l.decode("utf-8").strip() for l in urllib.request.urlopen(url).readlines()] tle_list = [[tles[i],tles[i+1],tles[i+2]] for i,_ in enumerate(tles) if i%3==0] multiple_czml = satellite_czml(tle_list=tle_list).get_czml() -name_list = [t[0] for t in tle_list] -description_list = ['Station: ' + t[0] for t in tle_list] -color_list = [[random.randrange(256) for x in range(3)] for x in range(len(tle_list))] -size_list = [7] * len(tle_list) - -czml_obj = satellite_czml(tle_list=tle_list, name_list=name_list, description_list=description_list, - color_list=color_list, speed_multiplier=1, use_default_image=False, - marker_scale_list=size_list, show_label=False, show_path=False, - ignore_bad_tles=True) -multiple_czml_p = czml_obj.get_czml() - -multiple_sats=[] -for tle in tle_list: - sat = satellite(tle, - description='Station: ' + tle[0], - color = [random.randrange(256) for x in range(3)], - marker_scale=12, - use_default_image=False, - start_time=datetime.strptime('2020-01-01 00:00:00','%Y-%m-%d %H:%M:%S'), - end_time=datetime.strptime('2020-01-01 01:00:00','%Y-%m-%d %H:%M:%S'), - show_label=True, - show_path=True, - ) - multiple_sats.append(sat) - -czml_obj = satellite_czml(satellite_list=multiple_sats) -multiple_czml_c = czml_obj.get_czml() - -last_sat_key = list(czml_obj.satellites.keys())[-1] -last_sat = czml_obj.satellites[last_sat_key] - -# Change the path to display the orbit path -last_sat.build_path(rebuild=True, - show=True, - color=[255, 255, 0, 127], - width=3 - ) - -# Change the label look -last_sat.build_label(rebuild=True, - show=True, - font='12pt Arial', - color=[255, 255, 0, 200], - outlineColor=[0, 0, 0, 127], - outlineWidth=3, - ) - -# Change the marker (billboard) -last_sat.build_marker(rebuild=True, - size=18, - outlineColor=[0, 0, 0, 128], - ) - -modified_czml = czml_obj.get_czml() - +# DASH external_css = ['https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Widgets/widgets.css'] external_scripts = [{'src':'https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js'}] @@ -81,26 +38,14 @@ app = dash.Dash(__name__, external_stylesheets=external_css) app.layout = html.Div(children=[ - dcc.Dropdown(id='choose_czml_dd', - options=[ - {'label': 'Multiple CZML', 'value': 'multiple_czml'} - ], - value='multiple_czml' - ), html.Div(id='cesiumContainer'), - html.Div(id='czml', style={'display': 'none'}), - html.Div(id='apikey', style={'display': 'none'}, children=apikey) + #html.Div(id='czml', style={'display': 'none'}, children=single_czml), + html.Div(id='czml', style={'display': 'none'}, children=multiple_czml), + html.Div(id='apikey', style={'display': 'none'}, children=apikey), ]) -@app.callback( - Output('czml', 'children'), - Input('choose_czml_dd', 'value')) -def update_satellite_filter(v): - d = {'multiple_czml':multiple_czml - } - return d[v] - -app.clientside_callback(''' +app.clientside_callback( + ''' function(id, czml, apikey) { // Create the Cesium Viewer if (!window.viewer) { @@ -119,9 +64,9 @@ function(id, czml, apikey) { Cesium.CzmlDataSource.load(czmlJson) ); } - - return true; -}''', + return true; + } + ''', Output('cesiumContainer', 'data-done'), Input('cesiumContainer', 'id'), Input('czml', 'children'), @@ -129,5 +74,5 @@ function(id, czml, apikey) { ) if __name__ == '__main__': - app.run_server(debug=True, use_reloader=False) + app.run_server(debug=False, use_reloader=False) diff --git a/gps-earth.py b/gps-earth.py new file mode 100755 index 0000000..b2adc42 --- /dev/null +++ b/gps-earth.py @@ -0,0 +1,69 @@ +#!/usr/bin/python3 + +import random +import urllib.request +import dash +from dash import html +from dash import dcc +from dash.dependencies import Input, Output +from datetime import datetime, timedelta +from satellite_czml import satellite_czml +from satellite_czml import satellite + +# GPS +url = 'https://celestrak.com/NORAD/elements/gps-ops.txt' + +apikey = open('cesium.key').read().strip() + +tles = [l.decode("utf-8").strip() for l in urllib.request.urlopen(url).readlines()] +tle_list = [[tles[i],tles[i+1],tles[i+2]] for i,_ in enumerate(tles) if i%3==0] + +multiple_czml = satellite_czml(tle_list=tle_list).get_czml() + +# DASH +external_css = ['https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Widgets/widgets.css'] +external_scripts = [{'src':'https://cesium.com/downloads/cesiumjs/releases/1.76/Build/Cesium/Cesium.js'}] + +app = dash.Dash(__name__, + title='Spacecruft GPS Earth', + external_scripts=external_scripts, + external_stylesheets=external_css) + +app.layout = html.Div(children=[ + html.Div(id='cesiumContainer'), + html.Div(id='czml', style={'display': 'none'}, children=multiple_czml), + html.Div(id='apikey', style={'display': 'none'}, children=apikey), +]) + +app.clientside_callback( + ''' +function(id, czml, apikey) { + // Create the Cesium Viewer + if (!window.viewer) { + Cesium.Ion.defaultAccessToken = apikey; + window.viewer = new Cesium.Viewer(id,{ + shouldAnimate: false, + }); + window.viewer.scene.globe.enableLighting = true; + } + + // Update the Cesium Viewer + if (czml) { + window.viewer.dataSources.removeAll(); + czmlJson = JSON.parse(czml); + window.viewer.dataSources.add( + Cesium.CzmlDataSource.load(czmlJson) + ); + } + return true; + } + ''', + Output('cesiumContainer', 'data-done'), + Input('cesiumContainer', 'id'), + Input('czml', 'children'), + Input('apikey', 'children') +) + +if __name__ == '__main__': + app.run_server(debug=False, port=8053, use_reloader=False) +